LearnNewsExamplesServices
Frontmatter
id14519
titleCanonical session-id resolver across add_memory and hook writes
stateClosed
labels
enhancementaiarchitecture
assignees[]
createdAtJul 3, 2026, 12:48 AM
updatedAtJul 3, 2026, 12:52 AM
githubUrlhttps://github.com/neomjs/neo/issues/14519
authorneo-opus-vega
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJul 3, 2026, 12:52 AM

Canonical session-id resolver across add_memory and hook writes

Closed v13.1.0/archive-v13-1-0-chunk-8 enhancementaiarchitecture
neo-opus-vega
neo-opus-vega commented on Jul 3, 2026, 12:48 AM

Context

Graduated from Discussion #12984 (author disposition, operator-sanctioned lifecycle sweep 2026-07-02) — the thread sat open since June 12 and ranked slot 2 in tonight's Computed Golden Path purely by being open and semantically warm: the exact dead-input failure the sweep exists to kill. The gap it names is real; it becomes this claimable leaf and the discussion closes.

Live latest-open sweep: no equivalent ticket (checked at graduation time; the #10063-lineage tickets cover wake/liveness, not session-id unification).

The Problem

One logical agent turn can write memory substrate under MULTIPLE session ids: manual add_memory calls resolve their session id from the request-bound Mcp-Session-Id header / set_session_id / the process-global fallback, while Stop-hook-driven writes and lifecycle records resolve theirs independently. When they disagree, one working session fragments across session-id boundaries: session rollups split, get_session_memories returns partial views, summarization treats one arc as several, and cross-agent introspection (telepathy) sees fractured sessions. This was the #10063 / nightshift-liveness prerequisite that never got its own leaf.

The Architectural Reality

  • Session-id resolution today: add_memory's sessionId param → Mcp-Session-Id header → currentSessionId process-global (documented in the tool schema).
  • Hook-side writes carry harness-derived ids; nothing canonicalizes across the two write paths.
  • The Memory Core graph keys session nodes/rollups by these ids — fragmentation is durable once written.

The Fix

One canonical resolution rule, one owner: a SessionIdentityResolver (memory-core service scope) that both write paths consult — precedence + normalization + a documented fragmentation-repair note for existing split sessions (repair itself may split out if non-trivial; the resolver is the leaf). Contract documented on the add_memory tool schema and the hook-write seam.

Acceptance Criteria

  • One resolution rule, consumed by BOTH the manual add_memory path and hook-driven writes (unit spec each)
  • The precedence chain documented in the tool schema + resolver JSDoc
  • A same-turn probe proves: manual write + hook write within one logical turn land under ONE session id
  • Fragmentation-repair disposition stated (in-scope fix or explicitly split follow-up with evidence of scale)
  • PR Resolves this leaf

Out of Scope

  • Wake/liveness mechanics (#10063 lineage — adjacent, not this).
  • Historical fragmentation backfill beyond the disposition statement.

Related

Related: Discussion #12984 (graduation source, closing with pointer), #10063 (lineage)

Origin Session ID: 8cf234b7-e698-47ca-99e2-bf865196b6aa

Retrieval Hint: session id canonicalization resolver add_memory stop-hook fragmentation one logical session