Context
Operator architectural guidance from session 78a3272e-847b-4799-ad6c-ce334464844c (during PR #10886 review): tests affecting the right hemisphere of the Neo.mjs platform — the Agent OS substrate (Memory Core, Knowledge Base, agent runtime, and the SDK orchestrators that consume them) — should live under test/playwright/unit/ai/ rather than mirroring the source location at buildScripts/ai/. See learn/benefits/ArchitectureOverview.md for the Two-Hemispheres model.
PR #10886 (#10871 AC-B) relocated the new restore.spec.mjs to test/playwright/unit/ai/buildScripts/restore.spec.mjs per this guidance, but kept the three sibling specs at the old path to keep that PR scoped to AC-B's deliverable. This ticket completes the symmetric relocation.
The Problem
After PR #10886 lands, the test/playwright/unit/buildScripts/ai/ directory still contains three specs whose architectural-pillar grouping says they belong under test/playwright/unit/ai/:
backup.spec.mjs — orchestrator-level coverage of buildScripts/ai/backup.mjs (peer of restore.spec.mjs; both consume KB_DatabaseService + Memory_DatabaseService via the SDK).
peer-architecture.spec.mjs — covers the #10129 peer-architecture invariant (defrag-vs-backup boundary).
runSandman.spec.mjs — covers the sandman daemon orchestrator script.
All three directly exercise right-hemisphere substrate. The old layout mirrors source (buildScripts/ai/<name>.mjs → test/playwright/unit/buildScripts/ai/<name>.spec.mjs); the new layout mirrors architectural pillar (test/playwright/unit/ai/buildScripts/<name>.spec.mjs).
The asymmetry between PR #10886's relocated restore.spec.mjs and these three siblings is a discoverability hazard for future agents grepping the test tree by feature area.
The Architectural Reality
Per learn/benefits/ArchitectureOverview.md § "The Two Hemispheres":
- Left Hemisphere: Frontend Runtime Engine —
src/component/, src/grid/, src/data/, etc. → tests under test/playwright/unit/<package>/.
- Right Hemisphere: Agent OS —
ai/Agent.mjs, ai/agent/, ai/services.mjs, ai/daemons/, ai/graph/, ai/mcp/server/, plus the orchestrator scripts that drive the AI substrate (buildScripts/ai/backup.mjs, restore.mjs, etc.) → tests under test/playwright/unit/ai/.
Path-depth observation: relocating test/playwright/unit/buildScripts/ai/<file> → test/playwright/unit/ai/buildScripts/<file> preserves the 4-level depth from test/, so all relative imports (../../../setup.mjs, ../../../../../ai/services.mjs, etc.) remain valid. The move is mechanically a git mv plus directory cleanup — no file content changes required.
The Fix
git mv test/playwright/unit/buildScripts/ai/backup.spec.mjs test/playwright/unit/ai/buildScripts/backup.spec.mjs
git mv test/playwright/unit/buildScripts/ai/peer-architecture.spec.mjs test/playwright/unit/ai/buildScripts/peer-architecture.spec.mjs
git mv test/playwright/unit/buildScripts/ai/runSandman.spec.mjs test/playwright/unit/ai/buildScripts/runSandman.spec.mjs
- Verify all three test suites pass at the new location:
npm run test-unit -- test/playwright/unit/ai/buildScripts/
- Remove the now-empty parent:
rmdir test/playwright/unit/buildScripts/ai && rmdir test/playwright/unit/buildScripts (only if empty after the move).
Acceptance Criteria
Out of Scope
- Source-tree relocation of
buildScripts/ai/ itself — this ticket is about test layout only. Source location is unchanged.
- Additional test moves (e.g., other
buildScripts/ subdirs that are NOT right-hemisphere) — left-hemisphere build scripts can keep mirroring source.
- Updating any
learn/ or skill documentation that references the old paths — out of scope; references would be re-fetched at next sync.
Avoided Traps
- Bundling into PR #10886 (#10871 AC-B): scope-discipline preference; the AC-B deliverable should not carry sibling-cleanup work that pre-dates the architectural guidance.
- Source relocation:
buildScripts/ai/ source structure is well-established; moving the source would be a much larger ripple (script invocation paths, npm script entries, JSDoc cross-references, learn/ runbooks). Tests are the right place to apply the right-hemisphere pillar discipline first.
Related
- #10871 — Backup/restore parity (AC-A merged via PR #10876; AC-B in PR #10886 with the precedent move applied).
- #10129 — Atomic timestamped backup bundle (parent for the orchestrator architecture).
- #10844 — Daily snapshot pipeline (consumes the same orchestrators).
Origin Session ID: 78a3272e-847b-4799-ad6c-ce334464844c
Retrieval Hint: query_raw_memories(query="right hemisphere unit test directory layout buildScripts/ai relocation")
Context
Operator architectural guidance from session
78a3272e-847b-4799-ad6c-ce334464844c(during PR #10886 review): tests affecting the right hemisphere of the Neo.mjs platform — the Agent OS substrate (Memory Core, Knowledge Base, agent runtime, and the SDK orchestrators that consume them) — should live undertest/playwright/unit/ai/rather than mirroring the source location atbuildScripts/ai/. Seelearn/benefits/ArchitectureOverview.mdfor the Two-Hemispheres model.PR #10886 (#10871 AC-B) relocated the new
restore.spec.mjstotest/playwright/unit/ai/buildScripts/restore.spec.mjsper this guidance, but kept the three sibling specs at the old path to keep that PR scoped to AC-B's deliverable. This ticket completes the symmetric relocation.The Problem
After PR #10886 lands, the
test/playwright/unit/buildScripts/ai/directory still contains three specs whose architectural-pillar grouping says they belong undertest/playwright/unit/ai/:backup.spec.mjs— orchestrator-level coverage ofbuildScripts/ai/backup.mjs(peer ofrestore.spec.mjs; both consume KB_DatabaseService + Memory_DatabaseService via the SDK).peer-architecture.spec.mjs— covers the #10129 peer-architecture invariant (defrag-vs-backup boundary).runSandman.spec.mjs— covers the sandman daemon orchestrator script.All three directly exercise right-hemisphere substrate. The old layout mirrors source (
buildScripts/ai/<name>.mjs→test/playwright/unit/buildScripts/ai/<name>.spec.mjs); the new layout mirrors architectural pillar (test/playwright/unit/ai/buildScripts/<name>.spec.mjs).The asymmetry between PR #10886's relocated
restore.spec.mjsand these three siblings is a discoverability hazard for future agents grepping the test tree by feature area.The Architectural Reality
Per
learn/benefits/ArchitectureOverview.md§ "The Two Hemispheres":src/component/,src/grid/,src/data/, etc. → tests undertest/playwright/unit/<package>/.ai/Agent.mjs,ai/agent/,ai/services.mjs,ai/daemons/,ai/graph/,ai/mcp/server/, plus the orchestrator scripts that drive the AI substrate (buildScripts/ai/backup.mjs,restore.mjs, etc.) → tests undertest/playwright/unit/ai/.Path-depth observation: relocating
test/playwright/unit/buildScripts/ai/<file>→test/playwright/unit/ai/buildScripts/<file>preserves the 4-level depth fromtest/, so all relative imports (../../../setup.mjs,../../../../../ai/services.mjs, etc.) remain valid. The move is mechanically agit mvplus directory cleanup — no file content changes required.The Fix
git mv test/playwright/unit/buildScripts/ai/backup.spec.mjs test/playwright/unit/ai/buildScripts/backup.spec.mjsgit mv test/playwright/unit/buildScripts/ai/peer-architecture.spec.mjs test/playwright/unit/ai/buildScripts/peer-architecture.spec.mjsgit mv test/playwright/unit/buildScripts/ai/runSandman.spec.mjs test/playwright/unit/ai/buildScripts/runSandman.spec.mjsnpm run test-unit -- test/playwright/unit/ai/buildScripts/rmdir test/playwright/unit/buildScripts/ai && rmdir test/playwright/unit/buildScripts(only if empty after the move).Acceptance Criteria
backup.spec.mjs,peer-architecture.spec.mjs,runSandman.spec.mjsare attest/playwright/unit/ai/buildScripts/.test/playwright/unit/buildScripts/directory is removed (or contains only sibling-AI specs after future moves).npm run test-unit -- test/playwright/unit/ai/buildScripts/runs all four orchestrator specs (includingrestore.spec.mjsfrom #10871 AC-B) and passes.Out of Scope
buildScripts/ai/itself — this ticket is about test layout only. Source location is unchanged.buildScripts/subdirs that are NOT right-hemisphere) — left-hemisphere build scripts can keep mirroring source.learn/or skill documentation that references the old paths — out of scope; references would be re-fetched at next sync.Avoided Traps
buildScripts/ai/source structure is well-established; moving the source would be a much larger ripple (script invocation paths, npm script entries, JSDoc cross-references, learn/ runbooks). Tests are the right place to apply the right-hemisphere pillar discipline first.Related
Origin Session ID: 78a3272e-847b-4799-ad6c-ce334464844c
Retrieval Hint:
query_raw_memories(query="right hemisphere unit test directory layout buildScripts/ai relocation")