Context
Operator decision (2026-06-20, the neomjs/neo#13647 / neomjs/neo#13668 dialogue): we do not keep the orphaned sessions — archiving them forever is hoarding noise. This is the one-shot hard-delete (the cleanup half of neomjs/neo#13624 axis-3; the prevention half is the insert-guard neomjs/neo#13639 / neomjs/neo#13665).
Surfaced by the cross-store V-B-A (#13647 issuecomment-4759938336) + a live orchestrator run: of 285 graph-pending sessions, 238 are orphaned (no Chroma content); grace's miniSummary aged-drain showed 1335/1344 missing-content. Hypothesis (grace, neomjs/neo#13639): bare-npx test-pollution — graph AGENT_MEMORY nodes written without live Chroma content.
Live latest-open sweep: searched delete/purge/garbage/orphan/cleanup/pollution + the latest 14 open at ~2026-06-20T21:48Z — no equivalent (closest neomjs/neo-agent-brain#142 is Fleet-Manager auto-memory-key reconciliation, different).
The Problem
~238 session-level (1335+ node-level) orphaned AGENT_MEMORY graph rows have no recoverable Chroma content → they can never be summarized. Archiving them (the neomjs/neo#13668 interim) hides them from the marker but leaves them in Nodes: every graph query still scans them, and every consumer must carry the archivedAt filter forever. They are pure garbage; the honest fix is to purge them.
The Architectural Reality
Orphan = a graph AGENT_MEMORY node whose semanticVectorId has no row in the Chroma neo-agent-memory collection. Identified via the cross-store anti-join (graph Nodes vs Chroma embedding_metadata keyed on sessionId — the neomjs/neo#13647 V-B-A pattern: ATTACH the two sqlite stores read-only). Deletion via the Memory Core session-purge primitive (purge_session) or a one-shot script under ai/scripts/maintenance/.
The Fix
One-shot hard-delete of the confirmed test-pollution orphan set, gated on grace's neomjs/neo#13639 confirmation (they are test-pollution, not real content-GC'd sessions — do not delete recoverable history). Identify the set via the cross-store query; purge the graph nodes + any orphaned edges. The reversible-archive (#13656) is the safe interim until this runs.
Decision Record impact
none — data cleanup; no API/config/schema change.
Acceptance Criteria
Out of Scope
- Prevention (the insert-guard — neomjs/neo#13639 / neomjs/neo#13665).
- The marker archived-filter (#13668 — the interim that this makes moot for the deleted set).
Related
Parent: neomjs/neo#13624 (epic; axis-3 cleanup). Depends-on: neomjs/neo#13639 (confirmation + guard). Interim: neomjs/neo#13668 (archived-filter), neomjs/neo#13656 (reversible-archival).
Origin Session ID: c4fcedd0-c449-4f8c-b368-e3ac0c0509ff
Retrieval Hint: "hard-delete test-pollution orphan AGENT_MEMORY sessions graph purge cross-store no-Chroma-content neomjs/neo#13624 axis-3"
Context
Operator decision (2026-06-20, the neomjs/neo#13647 / neomjs/neo#13668 dialogue): we do not keep the orphaned sessions — archiving them forever is hoarding noise. This is the one-shot hard-delete (the cleanup half of neomjs/neo#13624 axis-3; the prevention half is the insert-guard neomjs/neo#13639 / neomjs/neo#13665).
Surfaced by the cross-store V-B-A (#13647 issuecomment-4759938336) + a live orchestrator run: of 285 graph-pending sessions, 238 are orphaned (no Chroma content); grace's miniSummary aged-drain showed 1335/1344 missing-content. Hypothesis (grace, neomjs/neo#13639): bare-
npxtest-pollution — graphAGENT_MEMORYnodes written without live Chroma content.Live latest-open sweep: searched delete/purge/garbage/orphan/cleanup/pollution + the latest 14 open at ~2026-06-20T21:48Z — no equivalent (closest neomjs/neo-agent-brain#142 is Fleet-Manager auto-memory-key reconciliation, different).
The Problem
~238 session-level (1335+ node-level) orphaned
AGENT_MEMORYgraph rows have no recoverable Chroma content → they can never be summarized. Archiving them (the neomjs/neo#13668 interim) hides them from the marker but leaves them inNodes: every graph query still scans them, and every consumer must carry thearchivedAtfilter forever. They are pure garbage; the honest fix is to purge them.The Architectural Reality
Orphan = a graph
AGENT_MEMORYnode whosesemanticVectorIdhas no row in the Chromaneo-agent-memorycollection. Identified via the cross-store anti-join (graphNodesvs Chromaembedding_metadatakeyed onsessionId— the neomjs/neo#13647 V-B-A pattern: ATTACH the two sqlite stores read-only). Deletion via the Memory Core session-purge primitive (purge_session) or a one-shot script underai/scripts/maintenance/.The Fix
One-shot hard-delete of the confirmed test-pollution orphan set, gated on grace's neomjs/neo#13639 confirmation (they are test-pollution, not real content-GC'd sessions — do not delete recoverable history). Identify the set via the cross-store query; purge the graph nodes + any orphaned edges. The reversible-archive (#13656) is the safe interim until this runs.
Decision Record impact
none— data cleanup; no API/config/schema change.Acceptance Criteria
AGENT_MEMORYnot present in Chromaneo-agent-memory).getPendingSessionSummaryCountreflects only the drainable set and the graph no longer carries the test-pollution noise.Out of Scope
Related
Parent: neomjs/neo#13624 (epic; axis-3 cleanup). Depends-on: neomjs/neo#13639 (confirmation + guard). Interim: neomjs/neo#13668 (archived-filter), neomjs/neo#13656 (reversible-archival).
Origin Session ID: c4fcedd0-c449-4f8c-b368-e3ac0c0509ff Retrieval Hint: "hard-delete test-pollution orphan AGENT_MEMORY sessions graph purge cross-store no-Chroma-content neomjs/neo#13624 axis-3"