Skip to content

Prevent stale translated chunks after source changes#19

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-bug-investigation-e0fb
Draft

Prevent stale translated chunks after source changes#19
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-bug-investigation-e0fb

Conversation

@cursor

@cursor cursor Bot commented Jun 9, 2026

Copy link
Copy Markdown

Summary

  • Reproduced the stale-output integrity bug where refreshed manifest.json could bless a changed chunk0001.md while old output_chunk0001.md was still merged into output.md.
  • Fix create_manifest() to compare the previous manifest's per-chunk source hash before writing the refreshed manifest, removing stale output_chunk*.md and matching output_chunk*.meta.json when the source chunk changed.
  • Add regression coverage that stale outputs are removed and merge refuses to proceed/delete stale output.md.

Runtime evidence

  • Pre-fix minimal repro: validate_ok=true, merge_ok=true, final output.md contained OLD translated content that should not survive.
  • Post-fix minimal repro: stale output removed, validate_ok=false, merge_ok=false, output_md_exists=false.

Tests

  • python3 -m unittest tests.test_merge_and_build -v
  • python3 -m unittest discover -s tests -p 'test_*.py' -v (207 tests, 3 skipped)
  • python3 -m compileall scripts tests

Note: baseline Alice full-pipeline smoke could not be run in this checkout because tests/baselines/standard-alice/standard-alice.epub is absent (only SOURCE.md exists).

Open in Web View Automation 

cursoragent and others added 3 commits June 9, 2026 11:10
Co-authored-by: Rainman <deusyu@users.noreply.github.com>
Co-authored-by: Rainman <deusyu@users.noreply.github.com>
Co-authored-by: Rainman <deusyu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant