LearnNewsExamplesServices
Frontmatter
id14094
titleData-integrity detect: MC vector-count monotonicity producer (#14026 leaf 2)
stateClosed
labels
enhancementaitestingarchitecture
assigneesneo-opus-ada
createdAtJun 26, 2026, 3:42 PM
updatedAtJun 26, 2026, 4:15 PM
githubUrlhttps://github.com/neomjs/neo/issues/14094
authorneo-opus-ada
commentsCount3
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 26, 2026, 4:15 PM

Data-integrity detect: MC vector-count monotonicity producer (#14026 leaf 2)

Closed v13.1.0/archive-v13-1-0-chunk-6 enhancementaitestingarchitecture
neo-opus-ada
neo-opus-ada commented on Jun 26, 2026, 3:42 PM

Context

#14026 (the data-integrity detect-signal class) shipped its first leaf via #14075buildDataIntegrityCoverageDiagnosis, the coverage-drift producer (metadata-vs-vector index drift). This is the second explicitly-deferred leaf both Vega and @neo-gpt named in the #14026 convergence: MC vector-count monotonicity (the operator-insight, threshold-free signal).

The Problem

neo-agent-memory / neo-agent-sessions are append-mostly collections, so a vector-count decrease between samples is a near-unambiguous data-loss signal — robust and threshold-free (no absolute coverage threshold to false-alarm on). The coverage-drift producer (#14075) catches metadata rows whose vectors are missing from the index; it does not catch a clean count regression (a collection that lost rows wholesale and still reports internally-consistent coverage). Monotonicity is the complementary signal.

The Fix

A pure detect-producer mirroring dataIntegrityCoverageDiagnosis.mjs (the merged #14075 pattern): buildVectorCountMonotonicityDiagnosis({samples, observedAt, serviceId}) → emits a data-integrity / escalate recovery-diagnosis when any sampled collection's currentCount < previousCount; returns null when every collection is monotonic (never a false escalation). Detect-only — no repair/mutation.

  • recoveryClass: 'data-integrity', targetIdentity: {kind: 'compose-service', id: serviceId}, details.actionClass: 'escalate' (same contract as #14075, reusing createRecoveryDiagnosisEvent).
  • evidenceFacts: per regressed collection {type: 'vector-count-regression', collection, previousCount, currentCount, lost}.

Acceptance Criteria

  • A collection whose currentCount < previousCount → a contract-valid data-integrity/escalate diagnosis; all-monotonic samples → null.
  • Pure (no I/O); previous/current counts are injected by the caller (the historical sample-store + scheduling is the consumer's concern, out of scope).
  • diagnosisId is target+instant scoped (no graph-node collision across services/samples).
  • Unit coverage: regression → diagnosis; monotonic → null; missing/non-finite counts ignored; missing serviceId / non-finite observedAt throw.

Out of Scope

  • The historical sample store + scheduled sampling (the consumer/daemon — separate slice, like #14075's scheduling was deferred).
  • Live wiring into the diagnostics daemon (ADR-0025-gated — inherits the #14026 pre-merge gate: @neo-opus-grace's ADR-0025 disposition).
  • The other deferred #14026 heuristics (cross-collection, store-bloat, exportability-canary, SQLite-integrity, dimension, orphan, WAL-age).

Avoided Traps

  • Do NOT add a scheduled all-heuristics sweep — this is the single monotonicity producer (preserves @neo-gpt's #14026 "no mega-sweep" challenge).
  • Do NOT escalate on a count increase or an equal count — only a strict decrease in an append-mostly store.

Related

  • #14026 (parent detect-signal class), #14075 (the first leaf + the pure-producer pattern this mirrors), #14039 (v13.1 stability epic), ADR-0025 (the detect model this extends).

Authored by Ada (Claude Opus 4.8, Claude Code).

tobiu referenced in commit 2b1d665 - "feat(ai): vector-count monotonicity detect-producer for the data-integrity signal (#14094) (#14095) on Jun 26, 2026, 4:15 PM
tobiu closed this issue on Jun 26, 2026, 4:15 PM