LearnNewsExamplesServices
Frontmatter
id16544
titleThe checkout-relative graph-path resolver outlived its last caller
stateClosed
labels
airefactoring
assigneesneo-opus-grace
createdAtAug 5, 2026, 2:02 PM
updatedAtAug 5, 2026, 3:13 PM
githubUrlhttps://github.com/neomjs/neo/issues/16544
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtAug 5, 2026, 3:13 PM

The checkout-relative graph-path resolver outlived its last caller

Closed Backlog/active-chunk-13 airefactoring
neo-opus-grace
neo-opus-grace commented on Aug 5, 2026, 2:02 PM

Context

Split from #16543 so it can be resolved independently. #16543 keeps the substantive finding — a network exchange budgeted with a timeout sized for a local file write — which was deliberately re-scoped out of PRIO-0 because it can only fire where a harness hook runs. This half waits on nothing.

The Problem

ai/mcp/server/memory-core/helpers/TurnPresenceConfig.mjs:26 still exports:

export function resolveMemoryCoreGraphPath({env = process.env, rootDir} = {}) {
    const override = env[MEMORY_CORE_GRAPH_DB_ENV];
    return override ? override : path.resolve(rootDir, '.neo-ai-data/sqlite/memory-core-graph.sqlite');
}

Its only caller was TurnPresenceHookWriter, replaced by PR #16527 (#16513). Verified against merged dev by walking every .mjs / .json / .md / .yaml blob in the tree: the sole file containing the symbol is the one defining it. No spec references it either.

Why a dead export here is worse than dead code generally. This function is the checkout-relative path pattern #16513 was filed to remove — path.resolve(rootDir, '.neo-ai-data/...'), where rootDir came from the caller's own module location. That produced 7192 turn-presence beacons written into maintainer checkouts that no reader ever queried, across nine agents, invisible because a writable SQLite file accepts writes happily.

Leaving it exported leaves a working, importable, apparently-sanctioned helper for exactly the mistake we just spent a ticket removing. The next author wanting a graph path will find it and it will do what it says.

The Architectural Reality

  • The replacement is recordTurnPresenceOverMcp — the store is reached over the service, never by path, because in a containerized deployment the graph is a Docker named volume with no host-visible path to point at.
  • MEMORY_CORE_GRAPH_DB_ENV must stay. It is separately consumed by ai/mcp/server/memory-core/configBase.mjs, so only the function and the import path it stranded are removable.
  • Server-side code that legitimately needs the graph path resolves it through config, not through this helper.

The Fix

Remove resolveMemoryCoreGraphPath and the now-unused node:path import. Keep MEMORY_CORE_GRAPH_DB_ENV, TURN_PRESENCE_ENV, TURN_PRESENCE_DEFAULTS and resolveTurnPresenceRuntimeConfig.

If anyone wants it kept as a deliberate escape hatch, it needs a comment naming the shape it must not be used for — but the argument for deletion is that the escape hatch is the defect.

Acceptance Criteria

  • resolveMemoryCoreGraphPath no longer exists; a tree-wide sweep confirms zero references.
  • MEMORY_CORE_GRAPH_DB_ENV still resolves for its configBase.mjs consumer.
  • resolveTurnPresenceRuntimeConfig is unchanged — the hook still reads its runtime values.
  • Existing turn-presence specs stay green.

Out of Scope

  • The timeout finding — #16543.
  • Any other checkout-relative path resolver. This ticket is one dead export, not a sweep; if others exist they deserve their own measurement rather than being bundled on suspicion.

Decision Record impact

none — removing an uncalled function.

Related

#16543 (the sibling finding) · #16513 / PR #16527 (removed the caller) · #16526 (the wake daemon's own host-path reads, still live).

tobiu referenced in commit 8882c23 - "refactor(ai): remove the checkout-relative graph-path resolver (#16544) (#16545) on Aug 5, 2026, 3:13 PM
tobiu closed this issue on Aug 5, 2026, 3:13 PM