Context
Ada's #12435 surface map (A2A) flagged handoffFilePath (ai/mcp/server/memory-core/config.template.mjs:392) as a live-store-write vector with no test/prod branch: GoldenPathSynthesizer.mjs:1296 reads aiConfig.handoffFilePath and writeFileSyncs the handoff — so an offline GoldenPathSynthesizer run under a test harness clobbers the TRACKED resources/content/sandman_handoff.md.
Unlike the trajectories vector (where backup.mjs:104 hardcodes the path), the handoff writer already reads the config leaf — so this is a clean by-construction fix: just branch the leaf.
The fix
Mirror the collections.memory / storagePaths.graph by-construction shape: split handoffFilePath → handoffFilePathProd (the tracked resource, unchanged) + handoffFilePathTest (a disposable .neo-ai-data/test/ path), resolved via a formulas entry gated on the canonical storagePaths.useTestDatabase (UNIT_TEST_MODE) toggle. Under UNIT_TEST_MODE, aiConfig.handoffFilePath resolves to the test path by construction → no singleton mutation, and GoldenPathSynthesizer never clobbers the tracked handoff.
AC
Out of scope
- The trajectories + concepts vectors (separate; trajectories needs hardcode-removal per my A2A); the graph-spec construct-config-injection primitive.
Refs #12435, #13658, #13624.
Context
Ada's #12435 surface map (A2A) flagged
handoffFilePath(ai/mcp/server/memory-core/config.template.mjs:392) as a live-store-write vector with no test/prod branch:GoldenPathSynthesizer.mjs:1296readsaiConfig.handoffFilePathandwriteFileSyncs the handoff — so an offlineGoldenPathSynthesizerrun under a test harness clobbers the TRACKEDresources/content/sandman_handoff.md.Unlike the trajectories vector (where
backup.mjs:104hardcodes the path), the handoff writer already reads the config leaf — so this is a clean by-construction fix: just branch the leaf.The fix
Mirror the
collections.memory/storagePaths.graphby-construction shape: splithandoffFilePath→handoffFilePathProd(the tracked resource, unchanged) +handoffFilePathTest(a disposable.neo-ai-data/test/path), resolved via aformulasentry gated on the canonicalstoragePaths.useTestDatabase(UNIT_TEST_MODE) toggle. UnderUNIT_TEST_MODE,aiConfig.handoffFilePathresolves to the test path by construction → no singleton mutation, andGoldenPathSynthesizernever clobbers the tracked handoff.AC
aiConfig.handoffFilePathresolves to the tracked path in prod, the disposable test path underUNIT_TEST_MODE.resources/content/sandman_handoff.md).UNIT_TEST_MODEresolution.config.template.mjs(the tracked SSOT) only;config.mjsre-materializes via--migrate-config.Out of scope
Refs #12435, #13658, #13624.