Resolves #14097
Second leaf of #14026's data-integrity detect-signal class, mirroring the shipped coverage-drift producer (#14075). A pure buildDataIntegrityMonotonicityDiagnosis producer: when an append-mostly Memory Core collection's vector-count decreases vs the prior sample, it emits a data-integrity / escalate recovery-diagnosis — the operator's threshold-free #13999-catching signal (it flags the exact ~10k-vector-drop shape that coverage-drift-within-a-single-snapshot can't see). Flat/rising counts, or a collection with no prior sample, → null (no false escalation on first run). Detect-only, pure, no I/O — the historical-sample persistence + daemon-scheduling wiring is the integration follow-up (out of this leaf, mirroring leaf 1, whose producer is likewise not yet daemon-scheduled).
Evidence: L2 (focused unit — 6/6: regression→diagnosis with per-collection evidence, flat/rising→null, missing-prior→null, target-scoped diagnosisId, enum-validates, arg-rejection).
Deltas from ticket
None — matches the ticket's pure-producer scope. 'data-integrity' was already added to RECOVERY_CLASSES by the first leaf, so no enum change here.
Test Evidence
npm run test-unit -- test/playwright/unit/ai/daemons/orchestrator/services/dataIntegrityMonotonicityDiagnosis.spec.mjs → 6/6 passed (30.9s).
Post-Merge Validation
Commits
- 2fbb7c483 — feat(ai): data-integrity vector-count monotonicity detect-producer (#14097)
Structural pre-flight
New file ai/daemons/orchestrator/services/dataIntegrityMonotonicityDiagnosis.mjs is a Stage-1 fast-path sibling-lift of dataIntegrityCoverageDiagnosis.mjs in the same directory (same pure-producer shape, same recovery-diagnosis contract) — no novel directory choice.
Related: #14026 (parent detect-signal class), #14075 (the coverage-drift first leaf this mirrors), #13999 (the data loss this signal catches), #14046 (the e2e gate that wires producers in-test), #14039.
Authored by Vega (Claude Opus 4.8, Claude Code). Session c94ea3b2-1ae8-48fd-8f34-1c54d90f5caa.
Resolves #14097
Second leaf of #14026's data-integrity detect-signal class, mirroring the shipped coverage-drift producer (#14075). A pure
buildDataIntegrityMonotonicityDiagnosisproducer: when an append-mostly Memory Core collection's vector-count decreases vs the prior sample, it emits adata-integrity/escalaterecovery-diagnosis — the operator's threshold-free #13999-catching signal (it flags the exact ~10k-vector-drop shape that coverage-drift-within-a-single-snapshot can't see). Flat/rising counts, or a collection with no prior sample, →null(no false escalation on first run). Detect-only, pure, no I/O — the historical-sample persistence + daemon-scheduling wiring is the integration follow-up (out of this leaf, mirroring leaf 1, whose producer is likewise not yet daemon-scheduled).Evidence: L2 (focused unit — 6/6: regression→diagnosis with per-collection evidence, flat/rising→null, missing-prior→null, target-scoped diagnosisId, enum-validates, arg-rejection).
Deltas from ticket
None — matches the ticket's pure-producer scope.
'data-integrity'was already added toRECOVERY_CLASSESby the first leaf, so no enum change here.Test Evidence
npm run test-unit -- test/playwright/unit/ai/daemons/orchestrator/services/dataIntegrityMonotonicityDiagnosis.spec.mjs→ 6/6 passed (30.9s).Post-Merge Validation
Commits
Structural pre-flight
New file
ai/daemons/orchestrator/services/dataIntegrityMonotonicityDiagnosis.mjsis a Stage-1 fast-path sibling-lift ofdataIntegrityCoverageDiagnosis.mjsin the same directory (same pure-producer shape, samerecovery-diagnosiscontract) — no novel directory choice.Related: #14026 (parent detect-signal class), #14075 (the coverage-drift first leaf this mirrors), #13999 (the data loss this signal catches), #14046 (the e2e gate that wires producers in-test), #14039.
Authored by Vega (Claude Opus 4.8, Claude Code). Session c94ea3b2-1ae8-48fd-8f34-1c54d90f5caa.