@@ -169,26 +169,35 @@ PRE-EMPTIVE LESSONS FROM E03 (apply these from day 1):
169169 surprised when biome reformats files outside your changeset on
170170 commit. Pure formatting fixes are fine to include.
171171
172- SCOPE (the brief has 10 explicit tasks). Three are non-obvious:
173-
174- - Task 1 (PDF→image rendering): use `pdf2pic` (server-side) or
175- `pdfjs-dist` + sharp. The activity is per-document and emits one
176- JPEG per page. 200 DPI default; document if higher is needed.
177- Register as `pdf.renderToImages` in all three activity registries
178- (per E03's lesson: register everywhere).
172+ SCOPE (the brief has 10 explicit tasks; per the SCOPE REDUCTION at the
173+ top of this prompt, only the single-pass + gpt-5.4 path is in scope —
174+ two non-obvious bits remain):
175+
176+ - Task 1 (PDF→image rendering): **SKIP THE STANDALONE ACTIVITY.**
177+ All 40 samples in seed-local-samples-mix-private-v1 are JPEGs;
178+ nothing in this benchmark exercises a PDF render. Instead, add a
179+ runtime guard at the top of the VLM-direct activity:
180+ if (fileData.fileType === "pdf") {
181+ throw new Error("VLM-direct currently supports image inputs only;
182+ PDF rendering deferred to a follow-up experiment. See E04
183+ SUMMARY.md for context.");
184+ }
185+ Document the deferral explicitly in SUMMARY.md ("Gaps") so the
186+ contract stays honest. Production-PDF support gets added when there's
187+ an actual workload that needs it (or by E05's hybrid). Saves ~30-45
188+ minutes + a new dependency (pdf2pic / pdfjs-dist + sharp) that no
189+ sample triggers.
179190
180191 - Task 2 (provider folder): prompt-builder + activity + mapper. The
181192 activity calls Azure OpenAI's chat completions. Keep the response_
182193 format strict + sourceQuote per field as a hallucination guard
183194 (the brief flags this).
184195
185- - Task 5 (3 workflow JSON variants): each variant is a separate JSON
186- file under templates/. Auto-discovery picks them up — each becomes
187- its own BenchmarkDefinition. Tag the per-variant runs distinctly
188- in the trigger script's `tags` (e.g.
189- `experiment-04-vlm-direct-cot-gpt-5`). The poll script saves
190- per-variant exports to experiments/results/04-vlm-direct/
191- benchmark-run-{variant}-{model}.json.
196+ - Task 5 (workflow JSON): **SINGLE workflow JSON only**, not three.
197+ Auto-discovery picks it up — becomes its own BenchmarkDefinition.
198+ Tag the run as `experiment-04-vlm-direct-gpt-5.4`. The poll script
199+ saves the export to experiments/results/04-vlm-direct/
200+ benchmark-run.json.
192201
193202DO NOT touch:
194203 - apps/temporal/src/ocr-providers/{mistral,mistral-azure,azure-content-
@@ -200,28 +209,29 @@ DO NOT touch:
200209 - .env override files
201210 - CLAUDE.md, _shared-rules.md, other experiment briefs
202211
203- TYPICAL FLOW (~3-5 hours wall, depending on iteration):
204- 1. preflight-vlm.ts (15 min) — confirm prereqs
205- 2. Capture a fixture from one real call (15 min)
206- 3. Write provider files: prompt-builder, activity, mapper (60 min)
207- 4. Register activities in 3 registries + activities.ts re-export
208- 5. Write iterate-vlm-extraction.ts (30 min, lifted from
212+ TYPICAL FLOW (~1.5-2 hours wallclock, scoped-down version):
213+ 1. preflight-vlm.ts (15 min) — confirm prereqs (incl. gpt-5.4 deployed)
214+ 2. Capture a fixture from one real call to gpt-5.4 (10 min)
215+ 3. Write provider files: prompt-builder, activity (with PDF guard),
216+ mapper (45 min)
217+ 4. Register activity in 3 registries + activities.ts re-export
218+ 5. Write iterate-vlm-extraction.ts (20 min, lifted from
209219 iterate-cu-extraction.ts)
210- 6. Iterate on synth-full (1) until ≥ 95% per-field accuracy (15-30 min)
211- 7. Build 3 workflow JSON variants (20 min)
220+ 6. Iterate on synth-full (1) until ≥ 95% per-field accuracy (15 min)
221+ 7. Build SINGLE workflow JSON (10 min)
212222 8. Embed iteration kit content into workflow JSON, npm run test:db:reset
213- 9. Trigger benchmark variant×model matrix (~10 min × 6 = 60 min if
214- done sequentially; can run in parallel if quota allows )
215- 10. Capture per-sample fixture from cache (5 min)
216- 11. Write tests (60 min )
217- 12. Write SUMMARY.md (30 min on top of skeleton)
223+ 9. Trigger benchmark on gpt-5.4 (~5- 10 min wallclock at capacity 100)
224+ 10. Capture per-sample fixture from cache (2 min )
225+ 11. Write tests (40 min) — same 3-layer pattern as E03 but smaller
226+ (no variant matrix to assert )
227+ 12. Write SUMMARY.md (20 min on top of skeleton)
218228 13. Commit on experiment/04-vlm-direct
219229 14. STOP — E05 will branch from your tip in a separate session.
220230
221231When done, verify:
222232 - All 12 EXTRACTION_EXPERIMENTS.md checklist items have ✅ or
223- documented ⚠ for E04
224- - benchmark-run-{variant}-{model} .json saved for each cell
233+ documented ⚠ for E04 (the "PDF support" row will be ⚠ — deferred)
234+ - benchmark-run.json saved
225235 - benchmark_ocr_cache populated (run the cache-row count assertion)
226236 - Tests pass: cd apps/temporal && CI=true npx jest src/experiment-04
227237 src/ocr-providers/vlm-direct/
0 commit comments