|
| 1 | +# Pipeline Fix Verification Report |
| 2 | + |
| 3 | +Date: 2026-07-14 |
| 4 | + |
| 5 | +Scope: the eleven continuity, approval, context, editing, summary, and recovery findings reported for the scene-generation pipeline. |
| 6 | + |
| 7 | +## Result |
| 8 | + |
| 9 | +All eleven issues were reproduced or confirmed from the implementation, fixed, tested, reviewed on both repository-standards and specification axes, and committed separately. The final repository test run passed: **308 tests**. |
| 10 | + |
| 11 | +## Fixes |
| 12 | + |
| 13 | +### 1. POV character missing from character context |
| 14 | + |
| 15 | +- **Verified:** the POV selector and participant selector were independent, while character collection read only participant IDs. |
| 16 | +- **Before:** a POV character omitted from the participant list had no State, intent, or knowledge boundary in generation context. |
| 17 | +- **Fix:** collect unique character IDs from the union of POV and participants. |
| 18 | +- **After:** the POV character is always present once, even when not selected as a participant. |
| 19 | +- **Commit:** `be3c9a8` — Enhance character context collection to include POV characters and ensure uniqueness. |
| 20 | + |
| 21 | +### 2. Regeneration changed accepted state before approval |
| 22 | + |
| 23 | +- **Verified:** regeneration invalidation could affect accepted prose and memory before the replacement was approved. |
| 24 | +- **Before:** generating a candidate could hide or retire accepted state even if the author rejected the candidate. |
| 25 | +- **Fix:** keep revisions as non-canonical drafts and move retirement/replacement into publication after approval. Keep the accepted prose visible while a draft exists. |
| 26 | +- **After:** regeneration is read-only with respect to accepted state until publication succeeds. |
| 27 | +- **Commits:** `f8fcad1`, `846352d`, `0038990`. |
| 28 | + |
| 29 | +### 3. Approval was not an atomic logical transaction |
| 30 | + |
| 31 | +- **Verified:** characters could be appended, checkpointed, published, and snapshotted one at a time under a shared transaction ID. |
| 32 | +- **Before:** a failure partway through approval could leave a partially published batch. |
| 33 | +- **Fix:** validate the complete batch first, stage publication, and make interrupted publication recoverable and safe to retry. |
| 34 | +- **After:** approval either completes the approved batch or resumes the same staged transaction without duplicating or partially replacing canonical state. |
| 35 | +- **Commits:** `a8e6edf`, `f58bbe2`, `fa9256a`. |
| 36 | + |
| 37 | +### 4. Fifth and later major characters received no State update |
| 38 | + |
| 39 | +- **Verified:** the four-character concurrency cap also limited the single State Updater input. |
| 40 | +- **Before:** only the first four major participants could receive proposed State changes. |
| 41 | +- **Fix:** retain the cap only for concurrent Character Intent calls and pass every participating major character to the State Updater. |
| 42 | +- **After:** all participating major characters are considered for State changes. |
| 43 | +- **Commit:** `8e66804` — fix: update state for every major character. |
| 44 | + |
| 45 | +### 5. Long scenes lost their endings during review and memory work |
| 46 | + |
| 47 | +- **Verified:** post-processing prompts truncated prose from the start only. |
| 48 | +- **Before:** late revelations, final locations, injuries, power changes, and hooks could be absent from review, fact extraction, State updates, and summary generation. |
| 49 | +- **Fix:** remove post-processing prose truncation and pass the complete scene to Reviewer, Fact Extractor, and State Updater. |
| 50 | +- **After:** opening, middle, and ending events are all available to review, facts, State changes, and summary generation. |
| 51 | +- **Commits:** `e50aa5f`, followed by full-coverage correction `075e7da`. |
| 52 | + |
| 53 | +### 6. Summary and fact retrieval ignored story time |
| 54 | + |
| 55 | +- **Verified:** retrieval could include current or future scenes when generation occurred out of order. |
| 56 | +- **Before:** future knowledge could leak into a character's context and continuity could be ordered by file history instead of story position. |
| 57 | +- **Fix:** resolve scene positions, sort summaries by story order, and retrieve only facts and summaries from prior story scenes. |
| 58 | +- **After:** out-of-order generation respects the target scene's timeline and knowledge boundary. |
| 59 | +- **Commit:** `66a8350` — fix: bound retrieval to prior story scenes. |
| 60 | + |
| 61 | +### 7. Failed review did not block memory analysis |
| 62 | + |
| 63 | +- **Verified:** missing, failed, or crashed review output could still be followed by fact and State analysis. |
| 64 | +- **Before:** memory proposals could be produced after an unsuccessful review without explicit author authorization. |
| 65 | +- **Fix:** require a passing review or a persisted explicit override before analysis begins. |
| 66 | +- **After:** review failure gates memory work; an author can deliberately continue by overriding it. |
| 67 | +- **Commit:** `740fbb8` — fix: gate memory analysis on review outcome. |
| 68 | + |
| 69 | +### 8. Assembled context was discarded before writing |
| 70 | + |
| 71 | +- **Verified:** the context builder loaded substantial world and character data that the Writer and State Updater prompts omitted. |
| 72 | +- **Before:** the Writer lacked geography, factions, history, terminology, social structure, technology, volume summary, and detailed major-character State; the State Updater lacked current power level. |
| 73 | +- **Fix:** include the assembled world, volume, and major-character context in the Writer prompt and current power State in State Updater input. |
| 74 | +- **After:** both agents receive the context already gathered for their decisions. |
| 75 | +- **Commit:** `1a58543` — fix: include assembled context in agent prompts. |
| 76 | + |
| 77 | +### 9. Required plan and proposal editing controls were missing |
| 78 | + |
| 79 | +- **Verified:** the plan was read-only and State proposals could not be edited change by change. |
| 80 | +- **Before:** authors could only accept or reject the generated structures as presented. |
| 81 | +- **Fix:** make the structured plan checkpoint editable and add selection plus per-change editors for nested State proposals. |
| 82 | +- **After:** authors can revise the plan before writing and edit individual proposed changes before approval. |
| 83 | +- **Commit:** `7531724` — feat: add required approval editing controls. |
| 84 | + |
| 85 | +### 10. The normal pipeline produced no Scene Summary |
| 86 | + |
| 87 | +- **Verified:** retrieval read scene summaries, but generation did not create or persist them. |
| 88 | +- **Before:** recent-scene-summary context normally remained empty and continuity depended only on facts and State. |
| 89 | +- **Fix:** require the Fact Extractor to return a narrative summary and open threads, persist the raw result with the revision, and publish the approved revision's summary with revision-aware active filtering. |
| 90 | +- **After:** every successful memory-analysis pass produces a revision-scoped summary that becomes canonical only with its approved revision. |
| 91 | +- **Commit:** `da9576b` — feat: generate revision-scoped scene summaries. |
| 92 | + |
| 93 | +### 11. Completed Writer prose was not saved immediately |
| 94 | + |
| 95 | +- **Verified:** completed prose remained only in memory while Reviewer and later agents ran. |
| 96 | +- **Before:** a crash after Writer completion could lose the whole draft, and the app had no recovery path on restart. |
| 97 | +- **Fix:** atomically save a Writer recovery artifact before Reviewer starts; promote it to a non-canonical versioned draft on scene load; make prose and generation-record finalization atomic and idempotent across interruption points; remove the recovery artifact only after durable finalization. |
| 98 | +- **After:** completed prose survives downstream crashes, reappears after reopening, preserves accepted prose, and does not create duplicate recovery revisions. |
| 99 | +- **Commit:** `30006fc` — fix: persist writer prose before review. |
| 100 | + |
| 101 | +## Final Audit Follow-up |
| 102 | + |
| 103 | +The repository-wide audit also found that edited-draft and explicit review-override analysis ran in detached tasks without surfacing exceptions. Commit `0652dcc` catches those task failures, keeps the draft saved, shows a visible memory-analysis failure, and restores the retry control. This follow-up was tested and reviewed separately before the final suite run. |
| 104 | + |
| 105 | +## Verification |
| 106 | + |
| 107 | +- Each fix received focused regression tests and a post-fix Standards review plus Spec review before commit. |
| 108 | +- Review findings discovered during implementation were fixed and re-reviewed until both axes were clean. |
| 109 | +- `git diff --check` was clean for each final fix; the Windows checkout reported only expected LF-to-CRLF notices. |
| 110 | +- Final test command: `conda activate fourteen; python -m pytest -q` |
| 111 | +- Final result: **308 passed in 6.70s**. |
| 112 | + |
| 113 | +User-owned untracked files `environment.yml` and `notes.md` were left unchanged. |
0 commit comments