Skip to content

Fix selective retranslation for untracked glossary-sensitive chunks - #28

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

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

Conversation

@cursor

@cursor cursor Bot commented Jun 19, 2026

Copy link
Copy Markdown

Bug and impact

Existing output_chunk*.md files without run_state.json records were adopted as record-only before checking whether the current glossary affected the chunk. A stale translation could be recorded as if it already used the current glossary, then skipped forever as unchanged. Alias-only glossary edits for already-selected terms could also be missed because aliases were not part of the per-term hash.

Root cause

run_state.plan() short-circuited untracked existing outputs to record before glossary term selection/hash checks, and glossary.term_hash() only hashed source, target, and category.

Fix

  • Re-translate untracked existing outputs when the current glossary selects terms for that chunk, while preserving record-only adoption for glossary-free chunks.
  • Include sorted aliases in term_hash() when aliases are present, preserving no-alias hash compatibility.
  • Update SKILL/README docs for the corrected default behavior.
  • Add regression coverage for untracked glossary-sensitive outputs and alias-only changes.

Validation

  • Reproduced the pre-fix CLI scenario where stale chunk0001 was recorded and then marked unchanged.
  • Post-fix CLI scenario keeps glossary-sensitive chunk0001 in translation_chunk_ids through record-all, while record-only adopting glossary-free chunk0002.
  • python3 -m unittest tests.test_run_state tests.test_glossary -v (66 tests OK)
  • python3 -m unittest discover -s tests -p 'test_*.py' -v (207 tests OK, 3 skipped)
  • python3 -m compileall scripts tests
Open in Web View Automation 

Co-authored-by: Rainman <deusyu@users.noreply.github.com>
@deusyu
deusyu force-pushed the cursor/critical-bug-investigation-365b branch from 353d1f1 to 45d3550 Compare June 26, 2026 02:15
@cursor
cursor Bot deleted the cursor/critical-bug-investigation-365b 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