LearnNewsExamplesServices
Frontmatter
title>-
authorneo-opus-ada
stateMerged
createdAtMay 23, 2026, 4:14 PM
updatedAtMay 23, 2026, 4:57 PM
closedAtMay 23, 2026, 4:57 PM
mergedAtMay 23, 2026, 4:57 PM
branchesdevtobiu/11844-daemons-folder-cleanup
urlhttps://github.com/neomjs/neo/pull/11849
Merged
neo-opus-ada
neo-opus-ada commented on May 23, 2026, 4:14 PM

Authored by Claude Opus 4.7 (Claude Code). Session 5572d9a5-558d-4bea-b416-e31496c289c4.

FAIR-band: in-band [verify @ merge-gate]

Resolves #11844

Summary

Sub 8 of Epic #11831. Folder-structure cleanup: move Orchestrator's cluster into self-contained ai/daemons/orchestrator/{,services/} folder per @tobiu chief-architect direction. Entry-script renamed orchestrator-daemon.mjsdaemon.mjs (folder context provides daemon identity; eliminates orchestrator/orchestrator-daemon.mjs redundancy).

Source moves (13)

From To
ai/daemons/Orchestrator.mjs ai/daemons/orchestrator/Orchestrator.mjs
ai/daemons/TaskDefinitions.mjs ai/daemons/orchestrator/TaskDefinitions.mjs
ai/scripts/orchestrator-daemon.mjs ai/daemons/orchestrator/daemon.mjs (rename)
ai/daemons/DreamService.mjs ai/daemons/orchestrator/services/DreamService.mjs
ai/daemons/SwarmHeartbeatService.mjs ai/daemons/orchestrator/services/SwarmHeartbeatService.mjs
ai/daemons/services/BackupCoordinatorService.mjs ai/daemons/orchestrator/services/BackupCoordinatorService.mjs
ai/daemons/services/CadenceEngine.mjs ai/daemons/orchestrator/services/CadenceEngine.mjs
ai/daemons/services/HeavyMaintenanceLeaseService.mjs ai/daemons/orchestrator/services/HeavyMaintenanceLeaseService.mjs
ai/daemons/services/PrimaryRepoSyncService.mjs ai/daemons/orchestrator/services/PrimaryRepoSyncService.mjs
ai/daemons/services/ProcessSupervisorService.mjs ai/daemons/orchestrator/services/ProcessSupervisorService.mjs
ai/daemons/services/SummarizationCoordinatorService.mjs ai/daemons/orchestrator/services/SummarizationCoordinatorService.mjs
ai/daemons/services/TaskStateService.mjs ai/daemons/orchestrator/services/TaskStateService.mjs

Test moves (12, mirror source structure)

All affected specs moved into test/playwright/unit/ai/daemons/orchestrator/{,services/}/ paths.

Consumer updates

  • ai/services.mjsDreamService + HeavyMaintenanceLeaseService import paths
  • 7 buildScripts/ai/ files — backup.mjs, ingestTenant.mjs, roadmapPlanner.mjs, runGoldenPath.mjs, runSandman.mjs, syncGithubWorkflow.mjs, syncKnowledgeBase.mjs
  • package.jsonai:orchestrator script path → ./ai/daemons/orchestrator/daemon.mjs

Deltas from ticket

None — implementation matches #11844 ACs verbatim.

Evidence: L1 (119/119 unit tests pass) → L1 required for substrate refactor (pure structural move; no behavioral change).

Test Evidence

  • npm run test-unit -- test/playwright/unit/ai/daemons/orchestrator/119/119 pass (6.6s)

Covers: Orchestrator.spec (26) + daemon.spec (10) + 9 service specs (BackupCoordinator/Cadence/Dream/DreamServiceGoldenPath/HeavyMaintenanceLease/PrimaryRepoSync/ProcessSupervisor/Summarization/SwarmHeartbeat/TaskState).

Post-Merge Validation

  • Operator runs npm run ai:orchestrator to verify daemon entry path resolves
  • Operator confirms Tier 1 Config Immutability suite + integration suite still pass post-merge
  • Subsequent subs unblocked: Sub 9 #11845, Sub 10 #11846, then Sub 11 #11847 → Sub 12 #11848
neo-opus-ada
neo-opus-ada commented on May 23, 2026, 4:43 PM

Cycle-2 self-correction — pushed c322215b3.

CI unit job 26335211375 caught a regression my prior turn missed:

test/playwright/unit/ai/services/memory-core/MailboxService.spec.mjs:49
Error: Cannot find module '/home/runner/work/neo/neo/ai/daemons/SwarmHeartbeatService.mjs'

Root cause: my Sub 8 sweep regex from\s*['"]... caught all static imports of moved files but missed the dynamic await import('...') call-site in MailboxService.spec.mjs:49. Local re-run on the patched spec: 59/59 pass.

V-B-A lesson: previously I claimed "ZERO new failures with NEO_TEST_SKIP_CI=true" — that flag must have been skipping services/memory-core/MailboxService.spec.mjs locally. The CI's full unit suite is the authoritative gate, not the skip-filtered local subset. Future cross-cutting moves: sweep for both from '...' and await import('...') call-sites.

Remaining check status (pre-fix run):

  • 1 failed: MailboxService addMessage enforces identity and routes correctly — fixed by this commit
  • 2 flaky: VectorService.tenantStamping, WriteSideInvariant MailboxService.addMessage succeeds — both passed on retry; pre-existing intermittents

Awaiting CI re-run.


tobiu
tobiu APPROVED reviewed on May 23, 2026, 4:56 PM

No review body provided.