Context
This ticket is the deliverable importable-consumer slice of the broader ADR 0019 A1 cleanup under Epic #12456. The original audit-wide wording was too broad for one PR and duplicated parent-epic scope; after V-B-A against current source and the closed #12464 micro-split correction, this issue is scoped to the load-bearing Memory Core graph / wake path consumers that can read existing config leaves directly.
Authority: ADR 0019 — AiConfig and child providers are the reactive Provider SSOT. Importable consumers read resolved leaves at the use site; genuine non-entrypoint helpers remain out of this ticket and use ADR 0019 §5.5 pure-defaults / bootstrap-injection treatment.
Problem
Three active importable consumers still re-derived config-owned path defaults:
ai/daemons/bridge/daemon.mjs used process.env.NEO_AI_DB_PATH || '.neo-ai-data/sqlite/memory-core-graph.sqlite' and process.env.NEO_AI_DAEMON_DIR || '.neo-ai-data/wake-daemon'.
ai/services/memory-core/HealthService.mjs used process.env.NEO_HEARTBEAT_ALIVE_PATH || <repo>/.neo-ai-data/wake-daemon/heartbeat.alive even though the Tier-1 leaf owns that env.
ai/scripts/diagnostics/analyzeNlTelemetry.mjs used process.env.NEO_MEMORY_DB_PATH || aiConfig.storagePaths.graph, duplicating the Memory Core graph leaf env resolution.
These local fallback chains drift from the owning config leaves and make test-mode resolution harder to reason about. The #12464 one-line variant was rejected as negative ROI; this ticket is the clustered form that removes the same pattern across daemon, service, and diagnostic consumers with focused tests.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge Case |
Docs |
Evidence |
| Bridge daemon graph DB path |
ADR 0019; ai/mcp/server/memory-core/config.template.mjs#storagePaths.graph |
Read memoryCoreConfig.storagePaths.graph at module setup. |
Unit subprocesses running with UNIT_TEST_MODE=true provide NEO_MEMORY_DB_PATH_TEST; production env remains NEO_MEMORY_DB_PATH through the leaf. |
PR body lists the stale alias removal. |
Bridge daemon unit file validates delivery against a physical test DB. |
| Bridge daemon data dir |
ADR 0019; ai/mcp/server/memory-core/config.template.mjs#wakeDaemon.dataDir |
Read memoryCoreConfig.wakeDaemon.dataDir. |
Existing NEO_AI_DAEMON_DIR env remains leaf-owned. |
PR body lists the retained env leaf. |
Bridge daemon unit file validates PID/log/state isolation. |
| HealthService heartbeat liveness path |
ADR 0019; ai/config.template.mjs#wakeDaemonHeartbeatAlivePath; SwarmHeartbeatService.heartbeatAlivePath() precedent |
Read aiConfig.wakeDaemonHeartbeatAlivePath and export the helper for a focused invariant. |
Tests apply NEO_HEARTBEAT_ALIVE_PATH through AiConfig.setEnvOverride(); no live per-read env fallback. |
JSDoc names producer/consumer shared path contract. |
HealthService unit file validates helper + wake features block. |
| Diagnostic NL telemetry DB path |
ADR 0019; ai/mcp/server/memory-core/config.template.mjs#storagePaths.graph |
Read aiConfig.storagePaths.graph; remove direct process.env.NEO_MEMORY_DB_PATH fallback. |
Under UNIT_TEST_MODE=true, tests use NEO_MEMORY_DB_PATH_TEST; production env remains NEO_MEMORY_DB_PATH through the leaf. |
Inline comment names leaf-owned env. |
Diagnostic unit file validates subprocess behavior + source invariant. |
Acceptance Criteria
Out of Scope
- Genuine non-entrypoint / pure-defaults surfaces such as
TaskDefinitions.mjs and its orchestrator consumers.
- Broader data-root redesign /
NEO_AI_DATA_ROOT resurrection (#12417 is still needs-re-triage).
- B3 defensive-read cleanup (#12461 and its cluster PRs).
- Lifecycle-script local state files that do not yet have owning config leaves.
- Public docs, Docker, examples, and historical
resources/content/** records.
Related
- Parent epic: #12456
- Authority: ADR 0019 (#12457 / PR #12458)
- Correction anchor: #12464 / PR #12468 closed as negative-ROI micro-split
- Related stale broad root: #12417 (
needs-re-triage)
Origin Session ID: 1a18ef10-3f42-42ce-833a-9451be0eec6d
Handoff Retrieval Hint: AiConfig A1 Memory Core graph wake path bridge HealthService analyzeNlTelemetry
Context
This ticket is the deliverable importable-consumer slice of the broader ADR 0019 A1 cleanup under Epic #12456. The original audit-wide wording was too broad for one PR and duplicated parent-epic scope; after V-B-A against current source and the closed #12464 micro-split correction, this issue is scoped to the load-bearing Memory Core graph / wake path consumers that can read existing config leaves directly.
Authority: ADR 0019 —
AiConfigand child providers are the reactive Provider SSOT. Importable consumers read resolved leaves at the use site; genuine non-entrypoint helpers remain out of this ticket and use ADR 0019 §5.5 pure-defaults / bootstrap-injection treatment.Problem
Three active importable consumers still re-derived config-owned path defaults:
ai/daemons/bridge/daemon.mjsusedprocess.env.NEO_AI_DB_PATH || '.neo-ai-data/sqlite/memory-core-graph.sqlite'andprocess.env.NEO_AI_DAEMON_DIR || '.neo-ai-data/wake-daemon'.ai/services/memory-core/HealthService.mjsusedprocess.env.NEO_HEARTBEAT_ALIVE_PATH || <repo>/.neo-ai-data/wake-daemon/heartbeat.aliveeven though the Tier-1 leaf owns that env.ai/scripts/diagnostics/analyzeNlTelemetry.mjsusedprocess.env.NEO_MEMORY_DB_PATH || aiConfig.storagePaths.graph, duplicating the Memory Core graph leaf env resolution.These local fallback chains drift from the owning config leaves and make test-mode resolution harder to reason about. The #12464 one-line variant was rejected as negative ROI; this ticket is the clustered form that removes the same pattern across daemon, service, and diagnostic consumers with focused tests.
Contract Ledger Matrix
ai/mcp/server/memory-core/config.template.mjs#storagePaths.graphmemoryCoreConfig.storagePaths.graphat module setup.UNIT_TEST_MODE=trueprovideNEO_MEMORY_DB_PATH_TEST; production env remainsNEO_MEMORY_DB_PATHthrough the leaf.ai/mcp/server/memory-core/config.template.mjs#wakeDaemon.dataDirmemoryCoreConfig.wakeDaemon.dataDir.NEO_AI_DAEMON_DIRenv remains leaf-owned.ai/config.template.mjs#wakeDaemonHeartbeatAlivePath;SwarmHeartbeatService.heartbeatAlivePath()precedentaiConfig.wakeDaemonHeartbeatAlivePathand export the helper for a focused invariant.NEO_HEARTBEAT_ALIVE_PATHthroughAiConfig.setEnvOverride(); no live per-read env fallback.ai/mcp/server/memory-core/config.template.mjs#storagePaths.graphaiConfig.storagePaths.graph; remove directprocess.env.NEO_MEMORY_DB_PATHfallback.UNIT_TEST_MODE=true, tests useNEO_MEMORY_DB_PATH_TEST; production env remainsNEO_MEMORY_DB_PATHthrough the leaf.Acceptance Criteria
bridge/daemon.mjsno longer referencesNEO_AI_DB_PATHor hardcoded Memory Core graph DB fallback literals.bridge/daemon.mjsreads the wake-daemon data directory from the Memory Core config leaf, preservingNEO_AI_DAEMON_DIRas a leaf-owned env override.HealthService.heartbeatAlivePath()reads the resolved Tier-1 heartbeat leaf and matches the existingSwarmHeartbeatServiceproducer precedent.analyzeNlTelemetry.mjsreadsaiConfig.storagePaths.graphdirectly; no duplicateprocess.env.NEO_MEMORY_DB_PATH ||/??fallback remains.Out of Scope
TaskDefinitions.mjsand its orchestrator consumers.NEO_AI_DATA_ROOTresurrection (#12417 is stillneeds-re-triage).resources/content/**records.Related
needs-re-triage)Origin Session ID: 1a18ef10-3f42-42ce-833a-9451be0eec6d
Handoff Retrieval Hint:
AiConfig A1 Memory Core graph wake path bridge HealthService analyzeNlTelemetry