Enrich reports/generation-summary.md with the review-oriented sections that the 2026-05-17 smoke run flagged as missing: ## Chapter coverage (per-chapter source/entity/relation/anchor counts), ## Entities (the deduped title list), ## Unmapped source chunks (sources with no downstream generated artifact), and ## Page anchors (total plus deterministic sample). Sections are conditional on data being present so generic non-Lefevre runs stay terse. Add docs/lefevre-readiness.md as the final sign-off document for IB-WP-0016: what is wired (T01-T06 recap), an output policy table (checked-in fixture sources vs disposable generated infospaces vs archive targets), a seven-item reviewer checklist (duplicate entities, relation endpoints, weak evidence, overgeneralization, anchor coverage, unmapped sources, plan-vs-actual variance), a scale-up plan from one-chapter to full-book, and the load-bearing risks still outstanding (cross-chunk dedup, whole-run resume, adaptive routing deferred to LLM-WP-0004 / IB-WP-0018, rate-table drift). Closes IB-WP-0016 (Lefevre EPUB3 Infospace Readiness Pilot): T01-T07 all done; the workplan is set to status=done. 131 tests pass, 1 skipped (live OpenRouter smoke, correctly gated). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
8.7 KiB
Lefevre Infospace — Final Readiness Report
Date: 2026-05-17 Workplan: IB-WP-0016 Status: ready for a single-chapter live run; full-book run gated on human review of that first chapter's output
This is the human-facing readiness summary that closes IB-WP-0016. It records what is wired, where generated outputs live, what gets committed, the review checks a reviewer must perform before scaling beyond one chapter, and a few load-bearing risks that should be re-checked before any full-book run.
What is wired (T01–T06)
- T01 spine-aware EPUB3 intake. Parses
META-INF/container.xmland the OPF package document; iterates documents in spine order; tags every spine entry with a section role (body,cover,nav,toc,header,footer,notes,license,auxiliary); excludes non-body sections by default with aninclude_non_body=Trueopt-in. Full OPF book metadata (title, creator, language, subjects, rights, identifier, source_url, modified) reaches every chunk. - T02 chapter-aware chunking and stable IDs. Resolves chapter
labels from the nav doc and from in-document headings; parses roman
numerals and "Chapter N" labels into numeric indices; emits stable
IDs
chapter-NNwith-part-NNNsuffix on multi-part chapters.id="Page_*"anchors are extracted upfront and distributed per chunk; anoverlap_wordsparameter supports an evidence window between adjacent parts. - T03 scale-aware planning.
generate planreturns a compact summary by default (selected chunks, per-workflow calls, prompt tokens, rough USD). Selection filters--chapter,--from-chapter,--to-chapter,--chunkand budget caps--max-calls,--cost-cap,--cost-per-1kare all wired.--fullopts back into the full per-workflow plan when needed. - T04 trading-literature profile. Eight entity categories (trader, market, strategy, error, psychological_pattern, institution, instrument, evidence_bearing_claim), five relation types (cause_effect, lesson_evidence, risk_mitigation, actor_venue, strategy_outcome), four evaluation criteria (groundedness, lesson_clarity, historical_context, overgeneralization_risk).
- T05 deterministic Lefevre fixture. A checked-in Lefevre-shaped
EPUB fixture under
tests/fixtures/lefevre/plus a trading-tuned responses YAML. Three tests prove the full pipeline produces a manifest-backed infospace with stablechapter-NN.mdsource slugs and that PG boilerplate is excluded by default. - T06 OpenRouter live-run guardrails.
--chapterselection oninitandfrom-sourceso a one-chapter live run is a one-flag command. Provider metadata (model, request_id, usage tokens, retry_count, duration_seconds) lives in run records and in the generated artifact provenance underprovider_metadata. The optional live smoke test intests/test_openrouter_live.pyis gated onOPENROUTER_API_KEYplusINFOSPACE_BENCH_ENABLE_LIVE_OPENROUTER=1.
The IB-WP-0019 budget registry rides along: every generate plan
appends a snapshot, every generate run writes a usage rollup +
variance summary + a state-hub token event with failure isolation.
Output policy
Where things live, and what to commit:
| Path | Status | Notes |
|---|---|---|
tests/fixtures/lefevre/sources/ |
Committed | Inspectable XHTML; the smoke test rebuilds the EPUB at test time. |
tests/fixtures/lefevre/responses.yaml |
Committed | Trading-tuned fixture responses. |
docs/ |
Committed | This file, the validation note, generator docs. |
infospaces/<slug>/ |
Disposable | Generated infospaces — do not commit. |
infospaces/<slug>/output/budget/ |
Disposable but archive-relevant | Carried into archive packages by IB-WP-0014 / IB-WP-0019-T07. |
| Live-run outputs (entities, relations, evaluations, reports) | Review then archive | After a successful chapter review, archive via infospace-bench archive rather than commit. |
The repo gitignore already excludes infospaces/ content at the
working-copy level; the only Lefevre input shape committed today is the
small fixture under tests/fixtures/lefevre/. Archived outputs live in
the artifact-store registry, not in git.
Reviewer checklist (per chapter)
Run after each chapter's generation completes and before scaling:
- Duplicate entities.
artifacts/entities/and the report's## Entitieslist. Look for near-duplicates (e.g.Larry LivingstonvsThe narrator, orBucket ShopvsCosmopolitan Stock Brokerage Companywhen the latter is intended as a specific instance). Merge or split before continuing. - Relation endpoints. Every relation's
## Subjectand## Objectshould match an existing entity title. Anything that does not should either gain an entity or be dropped. - Weak evidence. Open the
## Evidencesection of each relation and confirm it quotes a concrete phrase from the source chunk, not a paraphrase. Relations with evidence like "the chapter implies…" should be downgraded or removed. - Overgeneralization. For every entity whose category is
strategy,error,psychological_pattern, orevidence_bearing_claim, check the evaluation'sovergeneralization_riskscore and read the## Review Notesit produced. Anything that silently universalises a chapter-local claim ("traders always…", "every market does…") should be re-scoped or dropped. - Page anchor coverage. The report's
## Page anchorssection should show anchors actually present in the source. If the anchor count is zero for a chapter that should have them, intake mis-fired. - Unmapped source chunks. The report's
## Unmapped source chunkssection must be empty before a full-book run. Any chunk listed there had its entity or relation stage skip silently — fix the underlying workflow or re-run with a different selection. - Plan-vs-actual variance.
output/budget/summary.yamland the "Plan variance" line of the report. If actual is more than 1.5× estimated for either calls or tokens, re-plan before scaling.
Scale-up plan
To go from a reviewed one-chapter run to the full Lefevre book:
- Re-plan against the full book:
infospace-bench generate plan <root> --cost-per-1k <rate>and inspecttotal_provider_calls_estimate,total_prompt_tokens_estimate, andestimated_cost_usd. The current real-book numbers are 730 calls / ~518k tokens / ~$155 at $0.30/1k. - Pick a defensible cost-cap. If the plan shows estimated cost above
the cap, narrow selection with
--from-chapter/--to-chapterbefore running. - Pick the final model. Confirm an entry exists in
src/infospace_bench/model_rates.yaml(or a workspace override) socost_usd_estimatedlines up with reality. List prices drift — refreshcaptured_atif older than 90 days. - Run one chapter, review per the checklist above, then either
continue chapter-by-chapter or batch via
--from-chapter/--to-chapter. Resume is whole-run-skip today (see Risks); avoid relying on it for partial recovery. - After each successful range, archive the infospace with
infospace-bench archiveso the budget log, the metrics, and the generated artifacts all land in a single content-addressed package.
Risks still load-bearing
These do not block a one-chapter run but should be re-checked before a full-book run:
- Cross-chunk entity dedupe. Exact-title upsert works (same entity title across chunks collapses to one file), but near-duplicate dedup is still a reviewer responsibility. Plan: only proceed to multi- chapter once a chapter's entity list has been hand-pruned.
- Whole-run resume.
generate resumeskips a completed run; it does not skip just-completed-chunks. For a real 24-chapter run that fails midway, the safest recovery today is a new infospace with the remaining chapter range — not resume on the original. - Adaptive routing. The current single-model run is fine for one
chapter but expensive at full-book scale. The cost-quality routing
layer is parked in
llm-connectLLM-WP-0004; the consumer wiring is parked ininfospace-benchIB-WP-0018. Either land that work first or accept the single-model bill. - Provider rate drift. The default rate table in
src/infospace_bench/model_rates.yamlcaptured prices on 2026-05-17. Refresh before a full-book run if the file is older than 90 days.
Sign-off
IB-WP-0016 T01–T07 are done. The pipeline can plan a chapter, run it against OpenRouter, write a manifest-backed infospace with provider metadata, record budget and variance, archive the result, and surface the review-oriented sections that this checklist depends on. The full Lefevre book is not yet a committed artifact and should not become one until at least one chapter has cleared the reviewer checklist above.