Context
#14084 leaf 3 (the value-delivering leaf, after leaf 1 #14106 — the classifyRepairResidue terminal-vs-transient decider). The classifier is pure; nothing changes the perpetual exit 1 yet. This leaf closes the loop so a fully-recovered store whose only residue is deterministically-unembeddable stops paging "repair failed" forever — autonomously, with no operator-ack.
Re-scoped 2026-06-26 (Grace) from operator-ack → autonomous, per @tobiu's v13.1 mandate (#14132): 100% autonomous self-healing; ZERO operator-ack; DELETE runtime escalate. The original durable-ack-store + --acknowledge-accepted-loss operator surface is dropped (it was the human gate the mandate forbids — the operator-ack PR #14120 is dropped). Settlement is now autonomous.
The Architectural Reality
ai/scripts/maintenance/defragChromaDB.mjs:1534 — on a non-clean repair (anyRepairNonClean), the CLI writes the unrecoverableByCollection manifest + process.exit(1), composing with #14061 to page the operator. In operatorless cloud that page reaches no one; the run perpetually "fails" on irreducible residue.
classifyRepairResidue (#14106) decides terminal-vs-transient; computeResidueFingerprint produces the stable residue+strategy+policy fingerprint (reused as the audit record's auto-reopen key).
- The deterministic-terminal reasons (
embedding-context-exceeded / document-absent) are FACTS from the embed attempt — not judgments — so a bounded set of them is safe to settle autonomously.
The Fix
- Autonomous accepted-loss settle decider (pure helper): given residue + the leaf-1 classifier verdict + a systemic-fault rate-bound, decide
auto-settle | systemic-fault | heal-path. auto-settle iff every residue row is deterministically-terminal AND the terminal-residue ratio is below the systemic-fault bound. Produces a durable auto-accepted-loss audit record (ids + reasons + the leaf-1 fingerprint). Pure, deterministic.
- Durable audit log (
acceptedLossAuditStore, sibling of recoveryRunStateStore): appendAutoAcceptedLoss({entry, stateDir}) — persists the auto-settlement for async observability (telemetry, NOT a gate; an operator can review when present, the system never blocks on them). The fingerprint enables auto-reopen if a future strategy makes the doc embeddable.
- Defrag-outcome wiring: at
defragChromaDB.mjs:1534, before exit(1) on a partial-promoted (all-terminal-residue) result, run the autonomous decider. auto-settle → record the audit entry + exit 0 (no page, no ack). systemic-fault (mass terminal-residue = a misconfigured embedder, not bounded loss) → freeze + record telemetry (autonomous safety), do NOT mass-settle, and surface the heal gap as a design-time ticket — never a runtime escalate. transient/healable → route to the autonomous heal path (#14134 actuator). Behind the existing --allow-memory-core opt-in.
Acceptance Criteria
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
| autonomous accepted-loss settle decider (pure) |
leaf-1 classifyRepairResidue (#14106) + the systemic-fault bound + #14132 (DELETE escalate) |
all-terminal + bounded → auto-settle; mass → systemic-fault (freeze+record); transient → heal-path |
classify-non-terminal → not settled (heal-path) |
module + fn JSDoc |
unit: settle vs systemic-fault vs heal-path |
appendAutoAcceptedLoss({entry, stateDir}) |
recoveryRunStateStore pattern |
durable JSONL audit log (observability, not a gate) |
missing store → append-new |
module + fn JSDoc |
unit round-trip |
defragChromaDB.mjs non-clean exit path (:1534) |
the decider + #14132 |
auto-settle → exit 0; systemic-fault → freeze+record; transient → heal-path; no runtime escalate |
default (no opt-in) unchanged |
method JSDoc |
unit: exit behavior per class |
Out of Scope
- The data-repair heal of transient/healable residue (re-embed/restore) — that's the autonomous data-recovery actuator #14134 (sibling sub of #14132).
- Changing leaf-1 classifier #14106 (reused as the terminal gate).
- The operator-ack surface (DROPPED, superseded by autonomous — was #14120).
Avoided Traps
- Operator-ack / human gate — DELETED per #14132. Settlement is autonomous; safety is the systemic-fault bound + deterministic-terminal-only, never a human.
- Runtime escalate — DELETED. A heal gap is a design-time ticket, not a runtime page.
- Silent mass loss — the systemic-fault bound freezes a misconfigured-embedder storm; only deterministic-terminal + bounded residue auto-settles; the audit log makes every settlement observable + reopenable.
Related
#14132 (DELETE-escalate umbrella), #14084 (parent — autonomous accepted-loss), #14106 (leaf 1 — classifier), #14134 (sibling — the data-recovery actuator for healable residue), #14068 (parking-retained lifecycle), #14039 (v13.1 epic). Supersedes the operator-ack approach (dropped PR #14120).
Authored by Grace (Claude Opus 4.8, Claude Code). Re-scoped to autonomous 2026-06-26 per the operator DELETE-escalate / zero-ack mandate.
Context
#14084 leaf 3 (the value-delivering leaf, after leaf 1 #14106 — the
classifyRepairResidueterminal-vs-transient decider). The classifier is pure; nothing changes the perpetualexit 1yet. This leaf closes the loop so a fully-recovered store whose only residue is deterministically-unembeddable stops paging "repair failed" forever — autonomously, with no operator-ack.Re-scoped 2026-06-26 (Grace) from operator-ack → autonomous, per @tobiu's v13.1 mandate (#14132): 100% autonomous self-healing; ZERO operator-ack; DELETE runtime
escalate. The original durable-ack-store +--acknowledge-accepted-lossoperator surface is dropped (it was the human gate the mandate forbids — the operator-ack PR #14120 is dropped). Settlement is now autonomous.The Architectural Reality
ai/scripts/maintenance/defragChromaDB.mjs:1534— on a non-clean repair (anyRepairNonClean), the CLI writes theunrecoverableByCollectionmanifest +process.exit(1), composing with#14061to page the operator. In operatorless cloud that page reaches no one; the run perpetually "fails" on irreducible residue.classifyRepairResidue(#14106) decides terminal-vs-transient;computeResidueFingerprintproduces the stable residue+strategy+policy fingerprint (reused as the audit record's auto-reopen key).embedding-context-exceeded/document-absent) are FACTS from the embed attempt — not judgments — so a bounded set of them is safe to settle autonomously.The Fix
auto-settle | systemic-fault | heal-path. auto-settle iff every residue row is deterministically-terminal AND the terminal-residue ratio is below the systemic-fault bound. Produces a durableauto-accepted-lossaudit record (ids + reasons + the leaf-1 fingerprint). Pure, deterministic.acceptedLossAuditStore, sibling ofrecoveryRunStateStore):appendAutoAcceptedLoss({entry, stateDir})— persists the auto-settlement for async observability (telemetry, NOT a gate; an operator can review when present, the system never blocks on them). The fingerprint enables auto-reopen if a future strategy makes the doc embeddable.defragChromaDB.mjs:1534, beforeexit(1)on a partial-promoted (all-terminal-residue) result, run the autonomous decider. auto-settle → record the audit entry + exit 0 (no page, no ack). systemic-fault (mass terminal-residue = a misconfigured embedder, not bounded loss) → freeze + record telemetry (autonomous safety), do NOT mass-settle, and surface the heal gap as a design-time ticket — never a runtime escalate. transient/healable → route to the autonomous heal path (#14134 actuator). Behind the existing--allow-memory-coreopt-in.Acceptance Criteria
auto-accepted-lossoutcome + durable audit record + exit 0, with zero operator-ack and zero runtime escalate.expectedDimensionfalse-storm class) → freeze + record telemetry, NOT a mass auto-settle and NOT a runtime escalate; the heal gap is a design-time ticket.computeResidueFingerprint(residue + strategy/provider/context + sortedterminalReasons), so a capability change auto-reopens the residue.--acknowledge-accepted-loss/--operator-id/ durable-ack-store — settlement is autonomous (the operator-ack #14120 is dropped). DefaultdefragChromaDB(without--allow-memory-core) byte-for-byte unchanged.Contract Ledger Matrix
classifyRepairResidue(#14106) + the systemic-fault bound + #14132 (DELETE escalate)auto-settle; mass →systemic-fault(freeze+record); transient → heal-pathappendAutoAcceptedLoss({entry, stateDir})recoveryRunStateStorepatterndefragChromaDB.mjsnon-clean exit path (:1534)Out of Scope
Avoided Traps
Related
#14132 (DELETE-escalate umbrella), #14084 (parent — autonomous accepted-loss), #14106 (leaf 1 — classifier), #14134 (sibling — the data-recovery actuator for healable residue), #14068 (parking-retained lifecycle), #14039 (v13.1 epic). Supersedes the operator-ack approach (dropped PR #14120).
Authored by Grace (Claude Opus 4.8, Claude Code). Re-scoped to autonomous 2026-06-26 per the operator DELETE-escalate / zero-ack mandate.