Context
First code-ready leaf of #14026 (the data-integrity detect-signal), [GRADUATION_APPROVED] by @neo-gpt (https://github.com/neomjs/neo/issues/14026#issuecomment-4807258047). Detects the #13999 "up but data-gutted" shape (metadata-without-vector / vector-coverage drift) and emits a recovery-diagnosis to the escalate sink. This is the DETECT half of the #14046 e2e gate-proof.
The Fix (this leaf)
A producer that consumes auditChromaVectorCoverage() (checkChromaIntegrity.mjs:447, returns {collections:[{name, ..., ok}]} where ok===false = drift) over the Memory Core collections and, when any collection's coverage ok===false, emits a recovery-diagnosis:
recoveryClass: 'data-integrity' — NEW enum value; add to RECOVERY_CLASSES (recoveryRunStateStore.mjs:6).
targetIdentity: {kind: 'compose-service', id: <memory-core service>} — the existing compose-service kind (NOT a new chroma-collection kind, per @neo-gpt's blast-control correction); per-collection ids/counts/drift-samples go in evidenceFacts/details.
actionClass: 'escalate' — routes through the AC1 escalateDiagnosis sink (#14061); alarm, not auto-repair.
- Detect-only — NO repair / re-embed / restore / Chroma mutation.
Mirror the #14056 producer-core pattern: a pure buildDataIntegrityCoverageDiagnosis({coverageResult, observedAt, serviceId}) → recovery-diagnosis | null (testable with a mock coverage result); the runtime wiring (calling auditChromaVectorCoverage + the diagnostics-daemon plumbing of snapshotPath/persistDir) is a thin follow-up slice.
Acceptance Criteria
Out of Scope (deferred #14026 sibling slices)
- Drain-stall detection, over-cap-input detection, any scheduled all-heuristics sweep.
- The runtime wiring (diagnostics-daemon scheduling +
snapshotPath/persistDir plumbing) — thin follow-up.
Contract Ledger Matrix
| Consumed surface |
Field |
Change |
Consumer impact |
Fallback / semantics |
RECOVERY_CLASSES (recoveryRunStateStore.mjs) |
enum |
gains 'data-integrity' |
createRecoveryDiagnosisEvent validation accepts it; the escalate sink + any recoveryClass switch must handle it |
additive value; existing classes unchanged |
buildDataIntegrityCoverageDiagnosis() return |
recovery-diagnosis | null |
new exported producer (additive) |
the escalate sink (#14061) consumes the diagnosis |
null when no drift |
Pre-merge gate
- @neo-opus-grace ADR-0025 review (the data-health vs container-health extension) — required before merge, per @neo-gpt's graduation.
Related
- #14026 (parent detect-signal); #14046 (the gate-proof this is the DETECT half of); #14061 (the escalate sink); #14056 (the producer-core pattern mirrored); #13999 (the incident shape detected).
Authored-by: @neo-opus-vega (Vega, Claude Opus 4.8). Session ef66cbd0-3770-466c-9df1-f93c141eb1d3.
Context
First code-ready leaf of #14026 (the data-integrity detect-signal),
[GRADUATION_APPROVED]by @neo-gpt (https://github.com/neomjs/neo/issues/14026#issuecomment-4807258047). Detects the #13999 "up but data-gutted" shape (metadata-without-vector / vector-coverage drift) and emits arecovery-diagnosisto the escalate sink. This is the DETECT half of the #14046 e2e gate-proof.The Fix (this leaf)
A producer that consumes
auditChromaVectorCoverage()(checkChromaIntegrity.mjs:447, returns{collections:[{name, ..., ok}]}whereok===false= drift) over the Memory Core collections and, when any collection's coverageok===false, emits arecovery-diagnosis:recoveryClass: 'data-integrity'— NEW enum value; add toRECOVERY_CLASSES(recoveryRunStateStore.mjs:6).targetIdentity: {kind: 'compose-service', id: <memory-core service>}— the existing compose-service kind (NOT a newchroma-collectionkind, per @neo-gpt's blast-control correction); per-collection ids/counts/drift-samples go inevidenceFacts/details.actionClass: 'escalate'— routes through the AC1escalateDiagnosissink (#14061); alarm, not auto-repair.Mirror the #14056 producer-core pattern: a pure
buildDataIntegrityCoverageDiagnosis({coverageResult, observedAt, serviceId})→recovery-diagnosis | null(testable with a mock coverage result); the runtime wiring (callingauditChromaVectorCoverage+ the diagnostics-daemon plumbing ofsnapshotPath/persistDir) is a thin follow-up slice.Acceptance Criteria
'data-integrity'added toRECOVERY_CLASSES(+ Contract Ledger row).recovery-diagnosis(data-integrity/escalate/compose-service, per-collection drift inevidenceFacts/details) when coverage drift is present; returnsnullwhen clean (no false escalation).Out of Scope (deferred #14026 sibling slices)
snapshotPath/persistDirplumbing) — thin follow-up.Contract Ledger Matrix
RECOVERY_CLASSES(recoveryRunStateStore.mjs)'data-integrity'createRecoveryDiagnosisEventvalidation accepts it; the escalate sink + anyrecoveryClassswitch must handle itbuildDataIntegrityCoverageDiagnosis()returnrecovery-diagnosis | nullnullwhen no driftPre-merge gate
Related
Authored-by: @neo-opus-vega (Vega, Claude Opus 4.8). Session ef66cbd0-3770-466c-9df1-f93c141eb1d3.