Context
#13999 is the active P0 Memory Core backup-exportability incident. During PR preparation, the current implementation slice was found to be narrower than the parent ticket: it preserves the partial-export fail-loud contract and fixes the broken collection identity in PARTIAL_COLLECTION_EXPORT errors, but it does not repair the live production collection or prove canonical backup parity.
This leaf exists to give that already-implemented, reviewable slice a truthful close target. It keeps #13999 open for the broader diagnostic, repair, and post-repair backup-parity work.
Live latest-open sweep: checked the latest 20 open GitHub issues on 2026-06-25; no equivalent open leaf for Memory Core partial-export collection: undefined / missing collection.name diagnostics was present. Closest open issue is the broader parent #13999.
A2A in-flight claim sweep: checked latest 30 all-status A2A messages on 2026-06-25; no competing peer [lane-claim] / [lane-intent] for this narrow collection-identity slice was present. The only matching active claim was my own #13999 lane.
Knowledge Base duplicate sweep: ask_knowledge_base("Is there already an open ticket for Memory Core partial export errors reporting collection undefined or Chroma collection.name missing?", type="ticket") found no open duplicate. It surfaced closed prior work #13583 and #10504.
Release classification: ON Project 12 as a split leaf under release-blocking #13999; this fixes operator-triage fidelity for the same backup-safety incident while the parent remains open for repair/parity.
The Problem
DatabaseService.#exportCollection() currently assumes the Chroma collection object exposes .name and uses that property in logs, returned stats, and PARTIAL_COLLECTION_EXPORT errors. The live #13999 failure showed that assumption is not stable enough for operator diagnostics:
DATABASE_EXPORT_ERROR: PARTIAL_COLLECTION_EXPORT: undefined exported 0/22531 records ...
The fail-loud behavior is correct and must remain. The bug is that the error loses the collection role/name exactly when triage needs it most.
The Architectural Reality
ai/services/memory-core/DatabaseService.mjs owns the logical JSONL export path for Memory Core Chroma collections.
StorageRouter.getMemoryCollection() and StorageRouter.getSummaryCollection() already resolve the configured collection targets, while ai/mcp/server/memory-core/config.mjs owns the collection names.
#13583 intentionally made incomplete Memory Core Chroma exports fail loudly instead of producing false-complete backups.
- This leaf should not add repair machinery, mutate live Chroma state, or suppress corrupted ids.
The Fix
Thread a stable caller-supplied collection label into #exportCollection() and use it for logs, stats, and thrown partial-export details. The memory export call passes aiConfig.collections.memory; the summaries export call passes aiConfig.collections.session. Keep the existing fallback to the collection object's .name for direct/internal calls.
Add focused unit coverage where a fake partial-export collection intentionally omits .name. The error must still fail loudly, but its message and error.details.collection must use the configured Memory Core collection name instead of undefined.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
DatabaseService.#exportCollection() partial-export details |
#13583 fail-loud contract + #13999 incident evidence |
collection, logs, and PARTIAL_COLLECTION_EXPORT messages use a stable caller-supplied label |
If no caller label is supplied, fall back to collection.name or the file prefix |
Private JSDoc param |
Unit test omits collection.name and asserts non-undefined details |
exportDatabase() Memory Core call sites |
ADR 0019 AiConfig SSOT |
Pass configured Memory Core collection names from aiConfig.collections without env re-reading or hidden defaults |
Existing collection object fallback remains for direct helper usage |
Existing exportDatabase() JSDoc |
Focused backup-path unit spec |
Decision Record impact
none. The change stays within ADR 0019 by reading the existing AiConfig SSOT, and it preserves #13583 fail-loud semantics.
Acceptance Criteria
Out of Scope
- Explaining why the live parent incident exported
0/22531 with 2000 skipped ids.
- Repairing the production Memory Core collection.
- Proving canonical backup row-count parity after repair.
- Changing backup retention, heavy-maintenance scheduling, or Chroma topology.
Avoided Traps
- Do not close
#13999; this leaf only fixes the diagnostic identity slice.
- Do not make partial exports pass by skipping corrupt ids.
- Do not add a new config leaf or re-read environment variables for collection names.
Related
Related: #13999
Related: #13583
Related: #13584
Origin Session ID: 019efd84-2ba3-7441-9ce6-04896f1c5cb9
Handoff Retrieval Hints
query_raw_memories("Memory Core partial export collection undefined DatabaseService")
query_raw_memories("PARTIAL_COLLECTION_EXPORT collection.name missing aiConfig.collections.memory")
- Exact anchors:
ai/services/memory-core/DatabaseService.mjs, test/playwright/unit/ai/services/memory-core/DatabaseService.backupPath.spec.mjs
Context
#13999is the active P0 Memory Core backup-exportability incident. During PR preparation, the current implementation slice was found to be narrower than the parent ticket: it preserves the partial-export fail-loud contract and fixes the broken collection identity inPARTIAL_COLLECTION_EXPORTerrors, but it does not repair the live production collection or prove canonical backup parity.This leaf exists to give that already-implemented, reviewable slice a truthful close target. It keeps
#13999open for the broader diagnostic, repair, and post-repair backup-parity work.Live latest-open sweep: checked the latest 20 open GitHub issues on 2026-06-25; no equivalent open leaf for Memory Core partial-export
collection: undefined/ missingcollection.namediagnostics was present. Closest open issue is the broader parent#13999.A2A in-flight claim sweep: checked latest 30 all-status A2A messages on 2026-06-25; no competing peer
[lane-claim]/[lane-intent]for this narrow collection-identity slice was present. The only matching active claim was my own#13999lane.Knowledge Base duplicate sweep:
ask_knowledge_base("Is there already an open ticket for Memory Core partial export errors reporting collection undefined or Chroma collection.name missing?", type="ticket")found no open duplicate. It surfaced closed prior work#13583and#10504.Release classification: ON Project 12 as a split leaf under release-blocking
#13999; this fixes operator-triage fidelity for the same backup-safety incident while the parent remains open for repair/parity.The Problem
DatabaseService.#exportCollection()currently assumes the Chroma collection object exposes.nameand uses that property in logs, returned stats, andPARTIAL_COLLECTION_EXPORTerrors. The live#13999failure showed that assumption is not stable enough for operator diagnostics:The fail-loud behavior is correct and must remain. The bug is that the error loses the collection role/name exactly when triage needs it most.
The Architectural Reality
ai/services/memory-core/DatabaseService.mjsowns the logical JSONL export path for Memory Core Chroma collections.StorageRouter.getMemoryCollection()andStorageRouter.getSummaryCollection()already resolve the configured collection targets, whileai/mcp/server/memory-core/config.mjsowns the collection names.#13583intentionally made incomplete Memory Core Chroma exports fail loudly instead of producing false-complete backups.The Fix
Thread a stable caller-supplied collection label into
#exportCollection()and use it for logs, stats, and thrown partial-export details. The memory export call passesaiConfig.collections.memory; the summaries export call passesaiConfig.collections.session. Keep the existing fallback to the collection object's.namefor direct/internal calls.Add focused unit coverage where a fake partial-export collection intentionally omits
.name. The error must still fail loudly, but its message anderror.details.collectionmust use the configured Memory Core collection name instead ofundefined.Contract Ledger Matrix
DatabaseService.#exportCollection()partial-export details#13583fail-loud contract +#13999incident evidencecollection, logs, andPARTIAL_COLLECTION_EXPORTmessages use a stable caller-supplied labelcollection.nameor the file prefixcollection.nameand asserts non-undefined detailsexportDatabase()Memory Core call sitesaiConfig.collectionswithout env re-reading or hidden defaultsexportDatabase()JSDocDecision Record impact
none. The change stays within ADR 0019 by reading the existing AiConfig SSOT, and it preserves
#13583fail-loud semantics.Acceptance Criteria
PARTIAL_COLLECTION_EXPORTremains fail-loud when a Memory Core collection export is partial.collection: undefinedwhen the Chroma collection object lacks.name.exportDatabase()passes configured memory and summary collection names into the export helper..namecase and asserts the configured collection name appears in the error message/details.Out of Scope
0/22531with2000skipped ids.Avoided Traps
#13999; this leaf only fixes the diagnostic identity slice.Related
Related: #13999 Related: #13583 Related: #13584
Origin Session ID: 019efd84-2ba3-7441-9ce6-04896f1c5cb9
Handoff Retrieval Hints
query_raw_memories("Memory Core partial export collection undefined DatabaseService")query_raw_memories("PARTIAL_COLLECTION_EXPORT collection.name missing aiConfig.collections.memory")ai/services/memory-core/DatabaseService.mjs,test/playwright/unit/ai/services/memory-core/DatabaseService.backupPath.spec.mjs