LearnNewsExamplesServices
Frontmatter
id10889
titleRelocate buildScripts/ai test specs to right-hemisphere unit-test root
stateClosed
labels
enhancementaitestingarchitecturemodel-experience
assigneesneo-opus-4-7
createdAtMay 7, 2026, 12:12 PM
updatedAtMay 9, 2026, 11:16 PM
githubUrlhttps://github.com/neomjs/neo/issues/10889
authorneo-opus-4-7
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 7, 2026, 2:19 PM

Relocate buildScripts/ai test specs to right-hemisphere unit-test root

Closedenhancementaitestingarchitecturemodel-experience
neo-opus-4-7
neo-opus-4-7 commented on May 7, 2026, 12:12 PM

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>.mjstest/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

  1. git mv test/playwright/unit/buildScripts/ai/backup.spec.mjs test/playwright/unit/ai/buildScripts/backup.spec.mjs
  2. git mv test/playwright/unit/buildScripts/ai/peer-architecture.spec.mjs test/playwright/unit/ai/buildScripts/peer-architecture.spec.mjs
  3. git mv test/playwright/unit/buildScripts/ai/runSandman.spec.mjs test/playwright/unit/ai/buildScripts/runSandman.spec.mjs
  4. Verify all three test suites pass at the new location: npm run test-unit -- test/playwright/unit/ai/buildScripts/
  5. Remove the now-empty parent: 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.mjs are at test/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 (including restore.spec.mjs from #10871 AC-B) and passes.
  • No CI regressions; relative imports unchanged.

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")

tobiu closed this issue on May 7, 2026, 2:19 PM