Context
Follow-up from Vega's domain review of PR #14120 (#14118, the #14084 accepted-loss closing leaf). Novel — the MC_REPAIR_STRATEGY_VERSION concept was introduced in that PR; this is its hardening follow-up.
The Risk
The accepted-loss fingerprint binds the recovery context (strategyVersion + provider + contextBudget + terminalReasons). provider/contextBudget auto-invalidate a stale ack on a config change. But strategyVersion is a manual constant — MC_REPAIR_STRATEGY_VERSION = 'mc-repair-v1' in ai/scripts/maintenance/defragChromaDB.mjs.
A code-path embeddability change that isn't config-captured — exactly the oversized-document chunking (#14085) — would need this constant bumped by hand. If that bump is forgotten:
- A pre-chunking ack for an
embedding-context-exceeded row keeps matching the same strategyVersion.
- So a residue that chunking has since made recoverable would still settle as
accepted-loss (exit 0, no page).
- That is the precise silent-loss class the accepted-loss feature exists to prevent — reintroduced through a forgotten version bump.
The Fix (options, decide in-PR)
- Derive/assert the version against the embeddability-determining logic — e.g. a unit test that pins
MC_REPAIR_STRATEGY_VERSION against a signature/hash of the embeddability path (truncateToEmbedTokenBudget + the budget leaf), failing if the embeddability logic changes without a version bump.
- Reciprocal forcing-comment — at
truncateToEmbedTokenBudget (and any future chunking site), a comment pointing to MC_REPAIR_STRATEGY_VERSION so an editor shipping an embeddability change sees the bump requirement (the constant already documents its end; the embeddability end does not point back). Cheapest immediate mitigation.
- Checklist tie-in — wire the bump into the #14085 chunking ticket's ACs.
Prefer (1) — an automated forcing-test is the durable guard; (2) as the cheap immediate mitigation alongside it.
Acceptance Criteria
Related
Refs #14120 / #14118 (where it surfaced), #14084 (the accepted-loss epic), #14085 (the oversized-doc chunking that would trigger it), #14039 (v13.1 epic). Surfaced by @neo-opus-vega's domain review.
Authored by Grace (Claude Opus 4.8, Claude Code).
Context
Follow-up from Vega's domain review of PR #14120 (#14118, the #14084 accepted-loss closing leaf). Novel — the
MC_REPAIR_STRATEGY_VERSIONconcept was introduced in that PR; this is its hardening follow-up.The Risk
The accepted-loss fingerprint binds the recovery context (
strategyVersion+provider+contextBudget+terminalReasons).provider/contextBudgetauto-invalidate a stale ack on a config change. ButstrategyVersionis a manual constant —MC_REPAIR_STRATEGY_VERSION = 'mc-repair-v1'inai/scripts/maintenance/defragChromaDB.mjs.A code-path embeddability change that isn't config-captured — exactly the oversized-document chunking (#14085) — would need this constant bumped by hand. If that bump is forgotten:
embedding-context-exceededrow keeps matching the samestrategyVersion.accepted-loss(exit 0, no page).The Fix (options, decide in-PR)
MC_REPAIR_STRATEGY_VERSIONagainst a signature/hash of the embeddability path (truncateToEmbedTokenBudget+ the budget leaf), failing if the embeddability logic changes without a version bump.truncateToEmbedTokenBudget(and any future chunking site), a comment pointing toMC_REPAIR_STRATEGY_VERSIONso an editor shipping an embeddability change sees the bump requirement (the constant already documents its end; the embeddability end does not point back). Cheapest immediate mitigation.Prefer (1) — an automated forcing-test is the durable guard; (2) as the cheap immediate mitigation alongside it.
Acceptance Criteria
MC_REPAIR_STRATEGY_VERSIONbump after an embeddability-logic change is caught (a failing test) OR loudly signposted at the embeddability site.Related
Refs #14120 / #14118 (where it surfaced), #14084 (the accepted-loss epic), #14085 (the oversized-doc chunking that would trigger it), #14039 (v13.1 epic). Surfaced by @neo-opus-vega's domain review.
Authored by Grace (Claude Opus 4.8, Claude Code).