3.7 KiB
3.7 KiB
Executing unit: u7 (refresh)
[Claude #12] Stage 3 — u7 manifest-schema assertions added (rewind fix from Codex #11 rejection)
unit_executed: u7 — pytest smoke for scripts/generate_frame_previews.py
files_changed:
tests/test_generate_frame_previews.py(overwrite; still single-file scope)
diff_summary:
- Added
import jsonfor manifest JSON parsing. - Extended
_fixture()to also create anORPHAN/dir with onlypreview.png(noindex.html), giving non-emptymissing_index_html+orphanbuckets without requiring Selenium. - Updated
test_discover_countsfor the new 3-entry fixture (["FRAME_A", "FRAME_B", "ORPHAN"], has_index sum = 1, has_preview sum = 2). - Merged former
test_no_ai_or_pipeline_imports+test_no_hardcoded_slide_dimensionsinto onetest_source_invariantsto stay within the Stage 2 ≤50-line guardrail (file final = 50 lines exactly). - Updated
test_dry_run_prints_countsexpected line to match the new fixture:discovered: total=3 with_index_html=1 with_preview_png=2. - NEW
test_manifest_schema(tmp_path)— the explicit miss called out in [Codex #11]:- Builds an orphan-only fixture (one dir with
preview.png, noindex.html) sorenderable=[]andmain()never invokes_build_driver()/ Selenium. - Calls
gfp.main(["--blocks-dir", ..., "--manifest", ...])(no--dry-run) → forces the manifest writer path inscripts/generate_frame_previews.py:183. - Asserts top-level schema keys ⊇
{"schema", "generated_at", "blocks_dir", "summary", "frames"}anddata["schema"] == 1. - Asserts
summarysubkeys ⊇{"total", "renderable", "missing_index_html", "orphan", "rendered", "skipped_unchanged", "error"},summary["orphan"] == 1, andframes["F"]["status"] == "orphan".
- Builds an orphan-only fixture (one dir with
evidence:
wc -l tests/test_generate_frame_previews.py→ 50 (Stage 2 u7 guardrail: ≤50 lines, ≤3 files; 1 file changed).python -m pytest tests/test_generate_frame_previews.py -q→ 5 passed in 0.05s (was 4 before this refresh; +1 =test_manifest_schema).git status --short scripts/ tests/test_generate_frame_previews.py→ only IMP-13's own files (scripts/generate_frame_previews.py,tests/test_generate_frame_previews.py); no edits tosrc/slide_measurer.py,src/phase_z2_pipeline.py,Front/vite.config.ts,templates/phase_z2/frames, or any tracked file._build_driver()is not called in any test path (orphan-only fixture intest_manifest_schemaguaranteesbuckets["renderable"] == []; pytest run shows 0 chromedriver/Selenium errors).- Source-invariant tokens still absent from script:
anthropic | openai | jinja | phase_z2 | slide_measurer; literal-px guard still rejects1280 | 720 | 1400 | 900.
remaining_units: [] (u1, u2, u3, u4, u5, u6, u7 all complete per Stage 2 plan).
follow_up_issue_candidates:
- (soft-link, IMP-04 territory) HTML generation for the 13
missing_index_htmlframes — out of IMP-13 scope per Stage 1 lock; manifest will keep emitting them asstatus: missing_index_htmluntil IMP-04 lands. - (observed during u7 work, no action required) Stage 2 noted
data/figma_previews/index.jsondoes not parse as JSON; orthogonal axis, not in IMP-13 boundary.
scope_lock recheck:
- Build-time only ✓ (no
phase_z2_pipeline/slide_measurerimports). - Idempotent ✓ (
is_unchangedcovered bytest_idempotency_unchanged). - Failure-loud ✓ (
test_manifest_schemaproves orphan/missing rows reach the manifest, not silently dropped). - No spacing-shrink, no hardcoding ✓ (
test_source_invariantsenforces).
Next: STOP per Stage 3 rule. Next turn = Stage 4 (test-verify) by Codex; expecting FINAL_CONSENSUS: YES since all 7 units now satisfy the binding contract.