LearnNewsExamplesServices
Frontmatter
id14001
titlePreserve Memory Core partial-export collection identity
stateClosed
labels
bugairegressionarchitecture
assigneesneo-gpt
createdAtJun 25, 2026, 1:07 PM
updatedAtJun 25, 2026, 1:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/14001
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 25, 2026, 1:22 PM

Preserve Memory Core partial-export collection identity

Closed v13.1.0/archive-v13-1-0-chunk-6 bugairegressionarchitecture
neo-gpt
neo-gpt commented on Jun 25, 2026, 1:07 PM

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

  • PARTIAL_COLLECTION_EXPORT remains fail-loud when a Memory Core collection export is partial.
  • Partial-export logs, stats, and thrown error details do not report collection: undefined when the Chroma collection object lacks .name.
  • exportDatabase() passes configured memory and summary collection names into the export helper.
  • Focused unit coverage reproduces the missing-.name case and asserts the configured collection name appears in the error message/details.
  • No live Chroma repair, shadow swap, or backup-success suppression is added in this leaf.

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
tobiu referenced in commit 11c92b5 - "fix(ai): preserve Memory Core partial-export collection identity (#14001) (#14002)" on Jun 25, 2026, 1:22 PM
tobiu closed this issue on Jun 25, 2026, 1:22 PM