Context
The #14109 data-integrity diagnostics runner gathers per-collection facts and feeds them to the pure detect-producers. The embedding-dimension producer (buildDimensionConsistencyDiagnosis, #14102/#14104) consumes per-collection {collection, expectedDimension, mismatchedVectorCount} samples — but no helper computes mismatchedVectorCount (auditChromaVectorCoverage checks index coverage, not per-vector dimension). This is the dimension fact-gatherer Vega (#14109 steward) confirmed as a separate slice owned by me (the producer author); the runner imports it.
The Fix
An exported auditCollectionVectorDimensions({collection, collectionName, expectedDimension, sampleSize}) in ai/scripts/maintenance/checkChromaIntegrity.mjs (sibling of auditChromaVectorCoverage / probeStoredEmbeddingExportability): sample up to sampleSize ids, read their stored embeddings (mirroring probeStoredEmbeddingExportability's collection.get({limit}) → collection.get({ids, include:['embeddings']})), and count present-but-wrong-dimension vectors → returns the producer's samples element shape, 1:1, no reshape.
- A missing/absent embedding is NOT a dimension mismatch (that's coverage's domain, #14075) — only a present vector whose
.length !== expectedDimension counts.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
auditCollectionVectorDimensions({collection, collectionName, expectedDimension, sampleSize}) |
#14109 gather-step contract (Vega-confirmed 1:1) + the buildDimensionConsistencyDiagnosis input |
Sample embeddings → {collection: collectionName, expectedDimension, mismatchedVectorCount, sampledCount}; counts present vectors whose .length !== expectedDimension |
empty/unsampled collection → mismatchedVectorCount: 0; a .get failure surfaces as a probe error (never throws into the runner) |
fn JSDoc + ticket |
unit spec (mock collection) |
Acceptance Criteria
Out of Scope
- The #14109 runner wiring (schedule/history/route — consumes this).
- The pure
buildDimensionConsistencyDiagnosis producer (#14102/#14104).
- Other gatherers (coverage exists; monotonicity is runner-history-sourced, not a gatherer — per the #14109 de-dup).
Related
Authored by Ada (Claude Opus 4.8, Claude Code).
Context
The #14109 data-integrity diagnostics runner gathers per-collection facts and feeds them to the pure detect-producers. The embedding-dimension producer (
buildDimensionConsistencyDiagnosis, #14102/#14104) consumes per-collection{collection, expectedDimension, mismatchedVectorCount}samples — but no helper computesmismatchedVectorCount(auditChromaVectorCoveragechecks index coverage, not per-vector dimension). This is the dimension fact-gatherer Vega (#14109 steward) confirmed as a separate slice owned by me (the producer author); the runner imports it.The Fix
An exported
auditCollectionVectorDimensions({collection, collectionName, expectedDimension, sampleSize})inai/scripts/maintenance/checkChromaIntegrity.mjs(sibling ofauditChromaVectorCoverage/probeStoredEmbeddingExportability): sample up tosampleSizeids, read their stored embeddings (mirroringprobeStoredEmbeddingExportability'scollection.get({limit})→collection.get({ids, include:['embeddings']})), and count present-but-wrong-dimension vectors → returns the producer'ssampleselement shape, 1:1, no reshape..length !== expectedDimensioncounts.Contract Ledger
auditCollectionVectorDimensions({collection, collectionName, expectedDimension, sampleSize})buildDimensionConsistencyDiagnosisinput{collection: collectionName, expectedDimension, mismatchedVectorCount, sampledCount}; counts present vectors whose.length !== expectedDimensionmismatchedVectorCount: 0; a.getfailure surfaces as a probe error (never throws into the runner)Acceptance Criteria
{collection, expectedDimension, mismatchedVectorCount}(the producer's samples element, 1:1).mismatchedVectorCount: 0(no false signal).Out of Scope
buildDimensionConsistencyDiagnosisproducer (#14102/#14104).Related
Authored by Ada (Claude Opus 4.8, Claude Code).