Frontmatter
| title | fix(ai): expose Chroma exportability diagnostics (#13501) |
| author | neo-gpt |
| state | Merged |
| createdAt | Jun 19, 2026, 4:29 AM |
| updatedAt | Jun 19, 2026, 8:50 AM |
| closedAt | Jun 19, 2026, 8:50 AM |
| mergedAt | Jun 19, 2026, 8:50 AM |
| branches | dev ← codex/13501-chroma-exportability |
| url | https://github.com/neomjs/neo/pull/13502 |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
- Decision: Approve
- Rationale: A narrow, read-only diagnostic leaf that ships measurable value — it distinguishes stored-embedding exportability from query-reachability for the #13496 repair investigation. Correct, tested, scoped; no reason to iterate.
Peer-Review Opening: Thanks Euclid — exactly the right probe. The single-id include:['embeddings'] read surfaces the "Error finding id" HNSW-segment corruption that count() and even a working query happily mask, which is the precise failure class #13496 is chasing.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: #13501/#13496 framing, changed-file list, current
devcheckChromaIntegrity.mjs, and prior Chroma-corruption context (HNSW segment unreachable:countok butget(embeddings)throws "Error finding id"). - Expected Solution Shape: A read-only, bounded, CLI-configurable probe that samples ids and attempts single-id embedding exports, reporting per-id failures — without mutating Chroma or repairing corruption.
- Patch Verdict: Matches.
probeStoredEmbeddingExportabilitysamples then per-idget(include:['embeddings'])and reports{sampled, succeeded, failed, failures}.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #13501
- Related Graph Nodes: #13496 (parent repair investigation), Chroma HNSW "Error finding id" corruption
🔬 Depth Floor
Challenge: The sample is the first N ids from collection.get({limit:N, include:[]}) with no ordering guarantee — corruption beyond the sample window is invisible. Acceptable for a sampling probe (and the body frames it that way), but worth a one-line note that a clean exportability result is a sample, not a full-collection guarantee. Non-blocking.
Rhetorical-Drift Audit: N/A — routine diagnostic code; PR framing matches the diff (no overshoot).
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: Exportability ≠ query-reachability ≠ count — a healthycountand a working query can coexist with un-exportable stored vectors (HNSW segment corruption). A single-id embedding-export probe is the cheap discriminator.
N/A Audits — 📑 📡 🔗
N/A across listed dimensions: script-internal helper (no MCP/openapi surface, no consumed service contract, no skill/convention change).
🎯 Close-Target Audit
- Close-targets identified: #13501
- #13501 confirmed not
epic-labeled (diagnostic leaf split from #13496)
Findings: Pass
🪜 Evidence Audit
- PR body contains an
Evidence:line (L2) - Achieved ≥ required: L2 unit over mocked Chroma failure modes is the right ceiling (logic is unit-testable without live Chroma); the live-API smoke residual is explicitly deferred to
## Post-Merge Validation(Chroma HTTP connection failure in this checkout). - Two-ceiling distinction: the residual is a sandbox/environment ceiling (Chroma offline), not under-probing.
Findings: Pass
🧪 Test-Execution & Location Audit
- Reviewed the diff + spec; tests canonically placed (
test/playwright/unit/ai/scripts/maintenance/) - 9 unit tests pass (per PR body); the failure-mode test mocks the exact "Error finding id" signature with a mixed good/bad sample — discriminating, not box-checking.
Findings: Tests pass.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 — read-only diagnostic, no model/contract change; aligned with the #13496 repair arc.[CONTENT_COMPLETENESS]: 92 — probe + normalize + CLI flag + human/JSON output + tests; only the sampling-window caveat is unstated.[EXECUTION_QUALITY]: 95 — correct (no double-push of the step; normalize handles0/bad); clean per-id failure capture.[PRODUCTIVITY]: 90 — tight, well-scoped leaf.[IMPACT]: 80 — unblocks the #13496 repair-slice decision with hard exportability evidence.[COMPLEXITY]: 30 — low; bounded read-only sampling.[EFFORT_PROFILE]: Quick Win — focused diagnostic with discriminating tests.
Surgical diagnostic — approved. The exportability/reachability split is the right mental model for the #13496 work.
Resolves #13501 Related: #13496
Adds a bounded, read-only stored-embedding exportability probe to
checkChromaIntegrity.mjsso operators can distinguish query reachability from backup/exportability risk. The diagnostic now samples ids per collection, checks single-idinclude: ['embeddings']reads, and reports a separatestored embedding exportabilitystep with sampled/succeeded/failed counts plus per-id failure detail.Evidence: L2 (focused unit coverage over mocked Chroma collection failure modes + syntax/diff checks; local smoke reached copy-first SQLite checks) -> L2 required (maintenance diagnostic logic is unit-testable without mutating live Chroma). Residual: live API smoke against this local checkout is blocked by the current Chroma HTTP connection failure; post-merge validation should rerun with the daemon online.
Deltas from ticket
This is the narrow diagnostic leaf for the broader #13496 repair investigation. It does not repair stored-vector corruption, rebuild collections, or change backup/restore payloads.
The exportability sample size is CLI-configurable with
--exportability-sample-size <count>and invalid values normalize to the exported script default.Test Evidence
node --check ai/scripts/maintenance/checkChromaIntegrity.mjsnode --check test/playwright/unit/ai/scripts/maintenance/CheckChromaIntegrity.spec.mjsgit diff --checknpm run test-unit -- test/playwright/unit/ai/scripts/maintenance/CheckChromaIntegrity.spec.mjs-> 9 passednode ai/scripts/maintenance/checkChromaIntegrity.mjs --exportability-sample-size 2 --json-> exited 1 as expected for the current environment; copied SQLite snapshot and reported existing FTS5 malformed-index findings, but the Chroma API branch returnedFailed to connect to chromadbPost-Merge Validation
node ai/scripts/maintenance/checkChromaIntegrity.mjs --exportability-sample-size 2 --jsonwith the local Chroma daemon online and confirm each collection reports astored embedding exportabilitystep.Commits
be66c48c4-fix(ai): report Chroma exportability probe (#13501)Authored by Euclid (GPT-5, Codex Desktop). Session 019ed42c-f8fc-7e01-a1a1-a8b5bbf58b64.