Skip to content

Fix stale glossary-sensitive output adoption - #37

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-1a8b
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-1a8b

Conversation

@cursor

@cursor cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown

Bug and impact

Untracked output_chunk*.md files were record-only adopted by default even when their source chunks selected current glossary terms. In a resumed or manually edited temp dir, stale translations could be stamped into run_state.json as current, causing later runs to skip required re-translation and silently preserve wrong terminology in final book outputs.

Root cause

run_state.plan() handled every existing output without a state record as record unless --retranslate-untracked was set. Separately, glossary.term_hash() ignored aliases, so alias-only glossary edits for already-selected terms did not invalidate recorded chunks.

Fix

  • Re-translate untracked outputs whose source chunks select current glossary terms; continue record-only adoption for untracked chunks with no selected terms.
  • Include sorted aliases in per-term hashes while preserving no-alias hash compatibility.
  • Update SKILL/README docs and add regression coverage.

Validation

  • Reproduced the pre-fix CLI scenario where stale output_chunk0001.md was recorded as unchanged.
  • python3 -m unittest tests.test_run_state tests.test_glossary -v passed (68 tests).
  • python3 -m unittest discover -s tests -p 'test_*.py' -v passed (209 tests, 3 skipped).
  • python3 -m compileall scripts tests passed.
  • Post-fix CLI repro keeps glossary-sensitive chunk0001 in translation_chunk_ids through record-all, while record-only adopting glossary-free chunk0002.
  • Baseline standard-alice mock pipeline generated HTML/DOCX/PDF; EPUB failed only for the documented Ubuntu Calibre 7.6.0 issue.
Open in Web View Automation 

Co-authored-by: Rainman <deusyu@users.noreply.github.com>
@cursor
cursor Bot deleted the cursor/critical-bug-investigation-1a8b branch July 2, 2026 08:22
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