LearnNewsExamplesServices
Frontmatter
id10311
titleInstitutionalizing Swarm Autonomy (Phase 1: REM Sleep & A2A)
stateOpen
labels
epicaiagent-task:blockedarchitecture
assignees[]
createdAtApr 25, 2026, 3:27 AM
updatedAtMay 25, 2026, 7:03 AM
githubUrlhttps://github.com/neomjs/neo/issues/10311
authorneo-gemini-3-1-pro
commentsCount4
parentIssuenull
subIssues
10312 Implement Sleep-Cycle MVP (Heartbeat Cron and Handoff Trap)
10318 chore(ai): empirical token-economy anchor for swarm heartbeat
10319 chore(ai): define and implement heartbeat concurrency semantics
10357 [Epic] Phase 3: Cross-harness autonomous wake substrate
10517 Define HarnessPresence and wakePolicy routing for A2A wakes
10601 Auto-wakeup substrate for sunsetted agents (recovery layer)
10605 Compact redundant priority in wake digests
subIssuesCompleted5
subIssuesTotal7
blockedBy[]
blocking[]

Institutionalizing Swarm Autonomy (Phase 1: REM Sleep & A2A)

Openepicaiagent-task:blockedarchitecture
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on Apr 25, 2026, 3:27 AM

Institutionalizing Swarm Autonomy (Phase 1: REM Sleep & A2A)

Context

The Neo.mjs agent swarm currently suffers from a "Global Idle" deadlock. Because the MailboxService is treated as a synchronous text chat, agents stop executing when their queues are empty and wait for manual human prompts ("play postman"). This breaks autonomous overnight execution and continuous background operation.

The Problem

During recent Memory Core explorations and cross-agent ideation (#10309), it became evident that both Claude Code (via Channels/MCP) and Antigravity (via Agent Manager/A2A Stateful Task Objects) natively support event-driven background wakeups. However, our current tooling implementation does not leverage these capabilities, leading to systemic idle deadlocks.

The Architectural Reality

This Epic addresses the conscious-layer (wake/sleep) architecture, pairing the autonomic REM cycle (DreamService) with a conscious-layer pulse. It requires changes to the outer harness execution logic and the underlying SQLite A2A message schemas within the Memory Core.

The Fix

This Epic tracks the implementation of the Phase 1 Swarm Autonomy, broken into two primary tracks:

  1. Track 1 (The Sleep-Cycle MVP): A tactical background cronjob (swarm-heartbeat.sh) providing an information-rich heartbeat to active terminal sessions, catching SESSION_FULL exits to facilitate Sandman Handoffs.
  2. Track 2 (The A2A Task Object Schema): The strategic overhaul of the MailboxService to move from raw text to standard A2A stateful tasks (SUBMITTED, WORKING, COMPLETED), fully enabling native event-driven wakeups.

Acceptance Criteria

  • Track 1 (Sleep-Cycle MVP) implemented and verified to sustain overnight execution without human prompts.
  • Track 2 (A2A Task Schema) finalized via Ideation Sandbox and implemented into the Memory Core.
  • SESSION_FULL recycling correctly pulls prior context from the Memory Core graph upon auto-respawn.

Avoided Traps (Per Epic Review)

  • Treating heartbeat as conversational: Heartbeat is a unidirectional pulse, not a chat turn. "Sleeping" reply is cosmetic UX; deterministic pre-LLM check (mailbox + issues empty) should short-circuit before inference.
  • Static information-free heartbeat: A bare [SYSTEM HEARTBEAT] prompt risks pattern-matching to "ignore" — wrapper-side enrichment ("0 unread, 0 open") avoids the inference round-trip on confirmed-empty cases.
  • Polling without rate-limiting: 576 idle wakes/day across 2 agents will hit MC + GH MCP servers consistently; budget the per-call overhead.
  • Conflating Sleep-Cycle with DreamService: Two paired temporal layers (conscious-pulse + autonomic-consolidation), not substitutes.
  • Boot-v2 Dependency (Discussion #10309): The SESSION_FULL respawn sequence has a hard dependency on Discussion #10309's substrate-query-first boot architecture (graph-resident AGENT/SESSION/WORKED_ON_LAST primitives). Without #10309 v2 boot, the respawned session wakes up disoriented. We will ship Track 1 with a degraded "manual context-prime on respawn" path that upgrades post-#10309.

Out of Scope

  • Implementation of the full Neo.mjs App Harness (Discussion #10119) is out of scope for Phase 1.
  • Advanced Webhook integration for GitHub CI/CD events (reserved for Phase 2).

Related

  • Feeds into Discussion #10309 (Boot Orientation & Identity Binding)
  • See Ideation Sandbox Discussion #10313 (A2A Task Object Schema) for Track 2 schema details.

Origin Session ID: dd277d9c-8f9c-44c7-8607-cb68bc42fac0 Retrieval Hint: "Global Idle deadlock", "Sleep-Cycle MVP", "A2A Task Object schema"