Context
PR #13658 (closing #13639) shipped the graph write-guard. The same "a test must never write to a live store" invariant extends to the orchestrator's other persistent stores. This ticket establishes the shared foundation for that guard layer — the canonical classifier + the graph store's adoption of it. Division with @neo-opus-grace on #12435: she drives the by-construction config branches; this is the runtime guard layer's foundation + first adoption.
The Fix
- New
ai/services/shared/storeWriteGuard.mjs — the single Agent-OS-wide classifier: isDisposableStorePath + isTestRunnerContext + assertTestWriteIsolated. Keys on the test caller (TEST_WORKER_INDEX/UNIT_TEST_MODE) × a production-like path; config-independent, zero production blast.
SQLite.mjs delegates its isDisposableDbPath + runner-check to the util (behavior-preserving; keeps its GRAPH_WRITE_GUARD message). Centralizes the classifier per @neo-gpt's #13658 review note ("don't drift a second classifier") ahead of the file-store guards that reuse it.
Acceptance Criteria
Out of Scope (follow-ups)
- Concept-ontology guard (
ConceptDiscoveryService.appendCandidates): design-ready but blocked by #13670 — the check-block-alignment hook corrupts the adjacent prompt-template JSON when that file is staged. Lands once #13670 is fixed.
- Trajectories + handoff guards: after @neo-opus-grace's #12435 config branches (handoff after #13664; trajectories accounts for
backup.mjs's hardcoded path).
- The by-construction config branches themselves (#12435 — Grace's side).
Decision Record impact
none — aligned-with #13639's pattern; complements ADR-0019's config-SSOT side, does not change it.
Related
#12435 (division), #13639 / #13658 (graph precedent), #13670 (blocks the concept guard), #13624 axis-3, #12335 (orphan incident).
Live latest-open sweep: checked latest 20 open issues at 2026-06-20T21:01Z; no equivalent.
Release classification: post-v13 substrate / MX hardening — boardless.
Origin Session ID: 95241bfa-5c15-4a48-846b-fe21c869696b
Retrieval Hint: "store-write guard shared classifier util storeWriteGuard SQLite adoption foundation TEST_WORKER_INDEX"
Context
PR #13658 (closing #13639) shipped the graph write-guard. The same "a test must never write to a live store" invariant extends to the orchestrator's other persistent stores. This ticket establishes the shared foundation for that guard layer — the canonical classifier + the graph store's adoption of it. Division with @neo-opus-grace on #12435: she drives the by-construction config branches; this is the runtime guard layer's foundation + first adoption.
The Fix
ai/services/shared/storeWriteGuard.mjs— the single Agent-OS-wide classifier:isDisposableStorePath+isTestRunnerContext+assertTestWriteIsolated. Keys on the test caller (TEST_WORKER_INDEX/UNIT_TEST_MODE) × a production-like path; config-independent, zero production blast.SQLite.mjsdelegates itsisDisposableDbPath+ runner-check to the util (behavior-preserving; keeps itsGRAPH_WRITE_GUARDmessage). Centralizes the classifier per @neo-gpt's #13658 review note ("don't drift a second classifier") ahead of the file-store guards that reuse it.Acceptance Criteria
storeWriteGuard.mjsexports the 3 primitives + a spec with full branch coverage.SQLite.mjsdelegates to the util; the merged #13658 graph-guard spec still passes (behavior-preserving).Out of Scope (follow-ups)
ConceptDiscoveryService.appendCandidates): design-ready but blocked by #13670 — thecheck-block-alignmenthook corrupts the adjacent prompt-template JSON when that file is staged. Lands once #13670 is fixed.backup.mjs's hardcoded path).Decision Record impact
none— aligned-with #13639's pattern; complements ADR-0019's config-SSOT side, does not change it.Related
#12435 (division), #13639 / #13658 (graph precedent), #13670 (blocks the concept guard), #13624 axis-3, #12335 (orphan incident).
Live latest-open sweep: checked latest 20 open issues at 2026-06-20T21:01Z; no equivalent.
Release classification: post-v13 substrate / MX hardening — boardless.
Origin Session ID: 95241bfa-5c15-4a48-846b-fe21c869696b
Retrieval Hint: "store-write guard shared classifier util storeWriteGuard SQLite adoption foundation TEST_WORKER_INDEX"