feat(svrnty-vision): Phase 4b complete — full impl + e2e test suite

- palette.py + rembg.py: implement from stubs (Pillow median-cut + rembg u2net)
- vlm.py: rename Spark2→steev (Strix Halo / Ollama); bump max_tokens 1024→4096
  (qwen3-vl:32b thinking mode consumes budget tokens — 4096 min for valid output)
- settings.py: rename spark2_vlm_*/spark1_flux_* → vlm_*/flux_*; real defaults
  (steev 100.88.167.87:11434 Ollama, gx10 100.90.100.10:8188 ComfyUI)
- tests/: conftest.py + test_palette.py + test_rembg.py + test_integration_e2e.py
  (28 unit + 10 integration; 38/38 passing — VLM raw/polished/ugc + FLUX render)
- CLAUDE.md: rewrite to accurate phase status + infra + layout
- requirements.txt + pyproject.toml: add Pillow, rembg, pytest-asyncio deps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Svrnty
2026-05-25 06:44:21 -04:00
parent d567489475
commit f6e09dbff2
15 changed files with 684 additions and 101 deletions
+5 -8
View File
@@ -1,7 +1,7 @@
"""Pytest port of BTE's FakeVlmEvaluationParseTests + VlmRubric parse coverage.
These tests cover the pure-function side of the VLM router (rubric prompt + score
parsing). The HTTP call to Spark 2 is exercised separately via TestClient with a
parsing). The HTTP call to steev (Ollama) is exercised separately via TestClient with a
mocked httpx transport.
"""
@@ -64,11 +64,8 @@ def test_analyze_requires_image_input() -> None:
assert response.status_code == 400
def test_analyze_returns_502_when_spark2_unreachable() -> None:
"""Smoke: with no Spark 2 (or a failing transport), gateway surfaces 502.
Uses a mock async client that raises ConnectError on POST.
"""
def test_analyze_returns_502_when_steev_unreachable() -> None:
"""Smoke: with no steev (Ollama) or a failing transport, gateway surfaces 502."""
class _StubClient:
def __init__(self, *a, **kw):
@@ -95,8 +92,8 @@ def test_analyze_returns_502_when_spark2_unreachable() -> None:
assert response.status_code == 502
def test_analyze_round_trip_with_mocked_spark2() -> None:
"""Happy path: mock vLLM returns a well-formed score JSON; gateway parses it."""
def test_analyze_round_trip_with_mocked_steev() -> None:
"""Happy path: mocked Ollama returns well-formed score JSON; gateway parses it."""
canned_response = {
"choices": [