Skip to content

Fix stale glossary adoption for untracked outputs#20

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

Fix stale glossary adoption for untracked outputs#20
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-caea

Conversation

@cursor

@cursor cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown

Bug and impact

Untracked existing output chunks could be recorded into run_state.json even when the current glossary would inject terms into that chunk. If a user edited glossary.json before the first run-state record existed, stale translations could be treated as current and merged into final artifacts without retranslation.

Root cause

run_state.plan() marked all valid untracked outputs as record by default unless --retranslate-untracked was passed. Glossary term selection/hash checks only ran after a chunk already had a run-state record.

Fix

  • Require translation for untracked existing outputs that have selected glossary terms under the current glossary.
  • Continue allowing record-only adoption for untracked chunks with no selected glossary terms.
  • Update the skill docs and both READMEs to describe the safer adoption behavior.
  • Add regression coverage for glossary edits before first run-state recording.

Validation

  • python3 -m unittest tests.test_run_state -v
  • python3 -m unittest discover -s tests -p 'test_*.py' -v (206 tests, 3 skipped)
  • python3 -m compileall scripts tests
  • CLI reproduction: constructed an old-output/no-run_state temp dir with current glossary target Tai -> 泰; scripts/run_state.py plan now returns translation_chunk_ids: ["chunk0001"] for the glossary-sensitive chunk and only record-only adopts the chunk with no glossary hit.
Open in Web View Automation 

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