[MC-463] Preserve manual overrides on enrichment recompute#655
Merged
Conversation
TarahAssistant
pushed a commit
that referenced
this pull request
Jun 15, 2026
#655) (#656) * [MC-463] Make enrichment writes atomic and lock merge contract - _write_json_file: tmp + fsync + os.replace so a crash, a concurrent reader, or two interleaved read-modify-write callers never see (or are left with) a half-written or truncated file. - _api_post_enrichments: docstring documenting deep-merge (not replace) semantics so non-frontend callers know omitted keys are preserved and deletions must send an emptied shape. - Tests: atomic-write round-trip + no .tmp residue; POST empty-group deep-merge contract lock (emptied cognate group stays []). Follow-up hardening to #655 (MC-463). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [MC-463] Raise server.py thin-orchestrator LoC budget for atomic write helper Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MC Task: MC-463 — Fix enrichments recompute wiping manual_overrides / Lane MC-463-A
Summary
parse-enrichments.jsonso recompute-owned fields update onlycomputed_at,config, autocognate_sets, andsimilarity.POST /api/enrichmentsmerge stale client snapshots into the on-disk payload so omitted or emptymanual_overridescannot erase human cognate decisions.manual_overrides.Fail on origin/main before fix
Pass on branch after fix
Local validation
Root-level handoff command note: the literal root-scoped
PYTHONPATH=python python3 -m pytest -q -k ...still hits pre-existing collection import errors undertests/migration/*(No module named 'migration.test_*'). Per backend-root-vs-python-scope guidance, I ran the backend-scoped equivalent above.Follow-up out of scope
enrichmentStore.tsoptimistic-only canonical lexeme concern remains separate.