mirror of
https://github.com/khodges42/nightShift.git
synced 2026-06-14 10:08:37 +00:00
3.7 KiB
3.7 KiB
Iteration 1: SCENE-002 Update State Failure
Date: 2026-05-22
Run Reviewed
- Sandbox:
integ_runs/20260522T214944.385761Z - Run:
.nightshift/runs/20260522T215005.188534Z - Task:
SCENE-002 - Final status: failed
- Failed stage:
update_state
What Happened
The scene workflow mostly succeeded:
draft_scenewrote the scene.continuity_reviewcorrectly failed the first draft for pronoun drift.edit_scenerepaired the pronoun issue.continuity_reviewpassed after edit.style_reviewpassed.
The remaining failure happened in update_state.
NightShift reported:
File writer error: no file blocks found. Expected FILE: path with ---CONTENT---/---END--- or fenced blocks like ```file:path.py.
The model output did contain visible FILE: blocks, but it omitted the required ---END--- delimiter. It emitted:
FILE: story/plot-state.md
---CONTENT---
...
FILE: story/characters.md
---CONTENT---
...
The current parser requires ---END---, so it rejected all of the blocks.
Additional Risk Found
The rejected state update also tried to rewrite character canon in unsafe ways:
- It changed BLOODMONEY's pronoun reference to
he/him. - It changed Cricket's pronoun reference to
they/them. - It compressed/replaced larger parts of
story/characters.md.
That means simply accepting unterminated blocks is not enough. The parser can be more tolerant, but the state updater still needs stronger constraints so durable canon does not drift.
Suggested Fixes
Short-term fixes for this iteration:
- Make
parse_file_updatestolerate delimiter blocks that omit---END---when a newFILE:block or EOF clearly terminates the previous block. - Keep strict path validation and duplicate-file validation unchanged.
- Strengthen the state-updater prompt:
- never edit
Pronouns / Referencesections - preserve existing character profiles
- prefer updating
plot-state.md,timeline.md, andunresolved-threads.md - edit
characters.mdonly for small additive current-status facts
- never edit
- Add regression tests for unterminated delimiter parsing.
Longer-term follow-up:
- Add deterministic writing-state validation that rejects changes to protected canon sections such as
Pronouns / Reference. - Move character canon into structured data so pronoun constraints can be validated directly.
Planned Changes
- Update delimiter block parsing in
nightshift/patches.py. - Add parser tests in
tests/test_patches.py. - Tighten
state-updater.mdin the tutorial novel template. - Run focused parser tests and the full suite.
Changes Made
parse_file_updatesnow accepts delimiter-style file blocks that omit---END---when the nextFILE:header or EOF clearly terminates the block.- Added regression coverage for:
- unterminated delimiter blocks before another
FILE: - mixed terminated and unterminated delimiter blocks
- unterminated delimiter blocks before another
- Strengthened the tutorial novel state updater prompt to protect character canon:
- never change
Pronouns / Reference - never change canonical pronouns, narrative reference, identity, or core wound
- prefer state/timeline/thread files over
characters.md - edit
characters.mdonly for small additive current-status facts or new named characters
- never change
- Added deterministic protection in file-block patch generation:
- changes to existing
Pronouns / Referencesections instory/characters.mdare rejected before a patch is generated
- changes to existing
- Added regression coverage for rejecting protected pronoun canon changes.
Verification
Focused tests:
python -m pytest tests/test_patches.py tests/test_pipeline.py -q
Result:
56 passed
Full suite:
python -m pytest -q
Result:
199 passed, 4 subtests passed