Parent Epic
#11831 — Sub 8 of Epic (folder-structure cleanup; per-daemon co-location).
Scope
Move Orchestrator's cluster into self-contained ai/daemons/orchestrator/. Entry-script renamed to daemon.mjs per @tobiu chief-architect convention (folder context provides daemon identity; eliminates orchestrator/orchestrator-daemon.mjs redundancy). Orchestrator-private services (sole consumer = Orchestrator) move into ai/daemons/orchestrator/services/.
Source moves
| 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/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 |
ai/daemons/DreamService.mjs |
ai/daemons/orchestrator/services/DreamService.mjs |
ai/daemons/SwarmHeartbeatService.mjs |
ai/daemons/orchestrator/services/SwarmHeartbeatService.mjs |
Note: ai/scripts/bridge-daemon-queries.mjs STAYS in ai/scripts/ for this Sub — moves to ai/daemons/bridge/queries.mjs in Sub 9 (bridge cluster).
Test moves (mirror source)
| From |
To |
test/playwright/unit/ai/daemons/Orchestrator.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjs |
test/playwright/unit/ai/scripts/orchestrator-daemon.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/daemon.spec.mjs (rename match) |
test/playwright/unit/ai/daemons/DreamService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs |
test/playwright/unit/ai/daemons/DreamServiceGoldenPath.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/DreamServiceGoldenPath.spec.mjs |
test/playwright/unit/ai/daemons/SwarmHeartbeatService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/SwarmHeartbeatService.spec.mjs |
test/playwright/unit/ai/daemons/services/BackupCoordinatorService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/BackupCoordinatorService.spec.mjs |
test/playwright/unit/ai/daemons/services/CadenceEngine.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/CadenceEngine.spec.mjs |
test/playwright/unit/ai/daemons/services/HeavyMaintenanceLeaseService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/HeavyMaintenanceLeaseService.spec.mjs |
test/playwright/unit/ai/daemons/services/PrimaryRepoSyncService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/PrimaryRepoSyncService.spec.mjs |
test/playwright/unit/ai/daemons/services/ProcessSupervisorService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/ProcessSupervisorService.spec.mjs |
test/playwright/unit/ai/daemons/services/SummarizationCoordinatorService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/SummarizationCoordinatorService.spec.mjs |
test/playwright/unit/ai/daemons/services/TaskStateService.spec.mjs |
test/playwright/unit/ai/daemons/orchestrator/services/TaskStateService.spec.mjs |
package.json
"ai:orchestrator" script path: ./ai/scripts/orchestrator-daemon.mjs → ./ai/daemons/orchestrator/daemon.mjs
.github/workflows
(none affected by Sub 8 — workflows only reference lint/check scripts which Sub 11 handles).
Integration tests
(none affected by Sub 8 — integration tests touching Orchestrator-cluster files import via the unit-test path which mirrors source structure).
Acceptance Criteria
- All listed files moved.
- Cross-codebase import paths updated (
grep -rn post-move shows zero stale imports to the moved files).
- All affected unit specs pass from their new locations.
npm run ai:orchestrator works.
- Tier 1 Config Immutability suite + Orchestrator.spec.mjs + each moved service's spec pass.
Authored by: [Claude Opus 4.7] (Claude Code)
Parent Epic
#11831 — Sub 8 of Epic (folder-structure cleanup; per-daemon co-location).
Scope
Move Orchestrator's cluster into self-contained
ai/daemons/orchestrator/. Entry-script renamed todaemon.mjsper @tobiu chief-architect convention (folder context provides daemon identity; eliminatesorchestrator/orchestrator-daemon.mjsredundancy). Orchestrator-private services (sole consumer = Orchestrator) move intoai/daemons/orchestrator/services/.Source moves
ai/daemons/Orchestrator.mjsai/daemons/orchestrator/Orchestrator.mjsai/daemons/TaskDefinitions.mjsai/daemons/orchestrator/TaskDefinitions.mjsai/scripts/orchestrator-daemon.mjsai/daemons/orchestrator/daemon.mjs(rename)ai/daemons/services/BackupCoordinatorService.mjsai/daemons/orchestrator/services/BackupCoordinatorService.mjsai/daemons/services/CadenceEngine.mjsai/daemons/orchestrator/services/CadenceEngine.mjsai/daemons/services/HeavyMaintenanceLeaseService.mjsai/daemons/orchestrator/services/HeavyMaintenanceLeaseService.mjsai/daemons/services/PrimaryRepoSyncService.mjsai/daemons/orchestrator/services/PrimaryRepoSyncService.mjsai/daemons/services/ProcessSupervisorService.mjsai/daemons/orchestrator/services/ProcessSupervisorService.mjsai/daemons/services/SummarizationCoordinatorService.mjsai/daemons/orchestrator/services/SummarizationCoordinatorService.mjsai/daemons/services/TaskStateService.mjsai/daemons/orchestrator/services/TaskStateService.mjsai/daemons/DreamService.mjsai/daemons/orchestrator/services/DreamService.mjsai/daemons/SwarmHeartbeatService.mjsai/daemons/orchestrator/services/SwarmHeartbeatService.mjsNote:
ai/scripts/bridge-daemon-queries.mjsSTAYS inai/scripts/for this Sub — moves toai/daemons/bridge/queries.mjsin Sub 9 (bridge cluster).Test moves (mirror source)
test/playwright/unit/ai/daemons/Orchestrator.spec.mjstest/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjstest/playwright/unit/ai/scripts/orchestrator-daemon.spec.mjstest/playwright/unit/ai/daemons/orchestrator/daemon.spec.mjs(rename match)test/playwright/unit/ai/daemons/DreamService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjstest/playwright/unit/ai/daemons/DreamServiceGoldenPath.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/DreamServiceGoldenPath.spec.mjstest/playwright/unit/ai/daemons/SwarmHeartbeatService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/SwarmHeartbeatService.spec.mjstest/playwright/unit/ai/daemons/services/BackupCoordinatorService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/BackupCoordinatorService.spec.mjstest/playwright/unit/ai/daemons/services/CadenceEngine.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/CadenceEngine.spec.mjstest/playwright/unit/ai/daemons/services/HeavyMaintenanceLeaseService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/HeavyMaintenanceLeaseService.spec.mjstest/playwright/unit/ai/daemons/services/PrimaryRepoSyncService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/PrimaryRepoSyncService.spec.mjstest/playwright/unit/ai/daemons/services/ProcessSupervisorService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/ProcessSupervisorService.spec.mjstest/playwright/unit/ai/daemons/services/SummarizationCoordinatorService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/SummarizationCoordinatorService.spec.mjstest/playwright/unit/ai/daemons/services/TaskStateService.spec.mjstest/playwright/unit/ai/daemons/orchestrator/services/TaskStateService.spec.mjspackage.json
"ai:orchestrator"script path:./ai/scripts/orchestrator-daemon.mjs→./ai/daemons/orchestrator/daemon.mjs.github/workflows
(none affected by Sub 8 — workflows only reference lint/check scripts which Sub 11 handles).
Integration tests
(none affected by Sub 8 — integration tests touching Orchestrator-cluster files import via the unit-test path which mirrors source structure).
Acceptance Criteria
grep -rnpost-move shows zero stale imports to the moved files).npm run ai:orchestratorworks.Authored by: [Claude Opus 4.7] (Claude Code)