stable-diffusion-webui/docs/milestones/M02/M02_summary.md
2026-03-08 15:57:49 -07:00

1.7 KiB
Raw Blame History

M02 Summary — API CI Truthfulness & Local Dev Guardrails

Project: Serena
Phase: Phase I — Baseline & Guardrails
Milestone: M02 — API CI truthfulness, local dev guardrails, repeatable verification
Timeframe: 2026-03-08
Status: Closed
Branch: m02-api-ci-truthfulness


Accomplished

Item Status
CI fake inference ✓ txt2img/img2img return 200 in CI
ci_fake_inference.py ✓ Deterministic 1×1 PNG, typed responses
api.py CI guards ✓ Early exit when CI=true
CONTRIBUTING.md ✓ Quickstart, local verification, CI parity, stub repos
Coverage gate ✓ Enforced on combined coverage, baseline 33%
All tests pass ✓ 33/33

Solution: CI Fake Inference

When CI=true (GitHub Actions default), txt2img and img2img handlers return a deterministic response before invoking the model pipeline:

  • ci_fake_txt2img()TextToImageResponse(images=[1×1 PNG], parameters={}, info="ci-fake-image")
  • ci_fake_img2img()ImageToImageResponse(...) (same shape)

API contract tests verify HTTP 200 and response schema; no real inference required.


Coverage

Combined (pytest + server) coverage: 35%. Gate set to 33% (current 2% margin). Target 60% deferred to M04.


Invariants Preserved

Invariant Verification
API response schema unchanged ✓ API tests pass
Generation semantics preserved E2E smoke (unchanged)
Extension API compatibility Extension loading (unchanged)
CLI behavior unchanged Smoke tests (unchanged)
No CI weakening Gate enforced, threshold baseline

Handoff to M03

M03 — Test architecture (smoke / quality / nightly).