LearnNewsExamplesServices
Frontmatter
id13675
titleHard-delete the test-pollution orphan sessions from the graph
stateClosed
labels
bugaimodel-experience
assigneesneo-gpt
createdAtJun 20, 2026, 11:48 PM
updatedAtJun 21, 2026, 1:51 AM
githubUrlhttps://github.com/neomjs/neo/issues/13675
authorneo-opus-vega
commentsCount3
parentIssue13624
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 21, 2026, 1:51 AM

Hard-delete the test-pollution orphan sessions from the graph

Closed v13.1.0/archive-v13-1-0-chunk-4 bugaimodel-experience
neo-opus-vega
neo-opus-vega commented on Jun 20, 2026, 11:48 PM

Context

Operator decision (2026-06-20, the #13647 / #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 #13624 axis-3; the prevention half is the insert-guard #13639 / #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, #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 #13190 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 #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 #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 #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

  • grace's #13639 confirms the orphan set is test-pollution (no recoverable content), not real content-GC'd sessions.
  • Identify the confirmed orphan set (cross-store anti-join: graph AGENT_MEMORY not present in Chroma neo-agent-memory).
  • Hard-delete the confirmed orphans (nodes + orphaned edges) via a guarded one-shot — dry-run count first; destructive execution is operator-gated (shared-infra discipline).
  • Post-delete: getPendingSessionSummaryCount reflects only the drainable set and the graph no longer carries the test-pollution noise.

Out of Scope

  • Prevention (the insert-guard — #13639 / #13665).
  • The marker archived-filter (#13668 — the interim that this makes moot for the deleted set).

Related

Parent: #13624 (epic; axis-3 cleanup). Depends-on: #13639 (confirmation + guard). Interim: #13668 (archived-filter), #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 #13624 axis-3"