Skip to content

Fix stale glossary-sensitive output adoption - #29

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

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

Conversation

@cursor

@cursor cursor Bot commented Jun 20, 2026

Copy link
Copy Markdown

Bug and impact

Selective re-translation could silently adopt existing output_chunk*.md files that had no run_state.json record, even when the current source chunk selected glossary terms. If the output was produced before a glossary edit, record-all stamped the stale translation as current and future plans reported it unchanged, causing persistent terminology corruption in final books.

Root cause

run_state.plan() treated every untracked existing output as record-only by default, without checking whether the current glossary would be injected into that chunk. glossary.term_hash() also ignored aliases, so alias-only prompt changes for already-selected terms did not invalidate prior records.

Fix

  • Re-translate untracked outputs whose source chunks select glossary terms; continue record-only adoption for glossary-free chunks.
  • Include sorted aliases in per-term hashes when aliases are present.
  • Add regression coverage for untracked glossary-sensitive outputs, record-all adoption, and alias hash changes.
  • Update SKILL/README docs to describe the safer adoption behavior.

Validation

  • python3 -m unittest tests.test_run_state tests.test_glossary -v
  • python3 -m compileall scripts tests
  • python3 -m unittest discover -s tests -p 'test_*.py' -v (209 tests, 3 skipped)
  • CLI repro now keeps stale glossary-sensitive chunk0001 in translation_chunk_ids before and after record-all.
  • Standard Alice mock pipeline generated HTML/DOCX/PDF successfully; EPUB failed only due the documented Ubuntu Calibre 7.6.0 packaging bug.
Open in Web View Automation 

Co-authored-by: Rainman <deusyu@users.noreply.github.com>
@deusyu
deusyu force-pushed the cursor/critical-bug-investigation-a6d8 branch from 236c63b to 291a0f3 Compare June 26, 2026 02:15
@cursor
cursor Bot deleted the cursor/critical-bug-investigation-a6d8 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