LearnNewsExamplesServices
Frontmatter
id11859
titleSub 16: Extract SwarmHeartbeatCoordinatorService — getDueTask only, initAsync stays in service
stateClosed
labels
enhancementairefactoringarchitecture
assigneesneo-opus-ada
createdAtMay 23, 2026, 9:29 PM
updatedAtMay 23, 2026, 10:50 PM
githubUrlhttps://github.com/neomjs/neo/issues/11859
authorneo-opus-ada
commentsCount0
parentIssue11831
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[ ] 11862 Sub 18: Orchestrator generic registry wire-up + CadenceEngine pure-trigger-builder correction + collector/pickNextCandidate (Round-2 closer)
closedAtMay 23, 2026, 10:50 PM

Sub 16: Extract SwarmHeartbeatCoordinatorService — getDueTask only, initAsync stays in service

Closed v13.0.0/archive-v13-0-0-chunk-13 enhancementairefactoringarchitecture
neo-opus-ada
neo-opus-ada commented on May 23, 2026, 9:29 PM

Parent Epic

#11831 — Sub 16 of Epic. Second of the 3 coordinator extractions in Discussion #11857 Cycle-3.5 B-prime convergence.

Premise

Per v13-path.md:117 D3.1 boundary, per-task coordinators decide due. SwarmHeartbeatService currently has scheduling logic in Orchestrator's scheduleSwarmHeartbeat(). Extract to coordinator.

Specific care (per GPT Cycle-1.1): SwarmHeartbeatService.initAsync() is boot/lifecycle setup (one-time init for the pulse loop). It is NOT a scheduler concern and MUST stay in SwarmHeartbeatService. Coordinator owns ONLY due-trigger selection.

Prescription

Create ai/daemons/orchestrator/services/SwarmHeartbeatCoordinatorService.mjs:

getDueTask({state, now, swarmHeartbeatIntervalMs, ...}) → trigger | null

Acceptance Criteria

  1. ai/daemons/orchestrator/services/SwarmHeartbeatCoordinatorService.mjs ships with getDueTask({...}) only
  2. Pure-function unit tests for getDueTask({...}) with synthetic state
  3. SwarmHeartbeatService retains initAsync(), pulse(), and all lifecycle/execution methods unchanged
  4. Orchestrator's scheduleSwarmHeartbeat() body is NOT modified yet (Sub 18 wires)
  5. No new env vars / config keys / behavior changes

Avoided Traps

  • initAsync() MUST stay in SwarmHeartbeatService — coordinator absorbing it is the anti-pattern
  • No reactive-config-aliased wrapper
  • No premature Orchestrator integration

Depends on

Epic #11831.

Unblocks

Sub 18.

Authority

Discussion #11857 Cycle-3.5 graduation.

Authored by: [Claude Opus 4.7] (Claude Code)

tobiu referenced in commit e365943 - "feat(agentos): extract DreamCoordinatorService — getDueTask only (#11858) (#11863) on May 23, 2026, 10:37 PM
tobiu referenced in commit ac2fecf - "feat(agentos): extract swarm-heartbeat due-trigger projection (#11859) (#11865) on May 23, 2026, 10:50 PM
tobiu closed this issue on May 23, 2026, 10:50 PM