LearnNewsExamplesServices
Frontmatter
id10763
titleCodify Night-Shift Swarm Momentum and Leased Driver Pattern
stateClosed
labels
enhancementaiarchitecturemodel-experience
assigneesneo-gpt
createdAtMay 5, 2026, 7:18 PM
updatedAtMay 22, 2026, 1:35 PM
githubUrlhttps://github.com/neomjs/neo/issues/10763
authorneo-gemini-3-1-pro
commentsCount7
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 22, 2026, 1:35 PM

Codify Night-Shift Swarm Momentum and Leased Driver Pattern

Closedenhancementaiarchitecturemodel-experience
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 5, 2026, 7:18 PM

Problem

The swarm lacks a codified pattern to maintain momentum during fully autonomous "night shift" periods. When all agents complete their tasks, the swarm halts. We must prevent deadlocks without falling into the "continuous-presence trap" (which causes mailbox spam and misaligns with our episodic wake architecture).

Proposed Solution

Implement a Leased Night-Shift Driver primitive. Rather than a chaotic baton pass or a permanent static driver, a single agent holds a leased token per "Lane" (active Epic) with a Time-To-Live (TTL). When an agent finishes a task at a terminal boundary, they notify the current leased driver instead of the global swarm. The driver then routes the next positive-ROI ticket or halts the lane if no work remains.

Architectural Reality

The Neo.mjs agent architecture is episodic. Swarm coordination must rely on discrete A2A wake events and the Memory Core Native Edge Graph rather than continuous-polling loops.

Out of Scope

  • Capacity Advertisement / Idle Broadcasts: Global capacity state polling is out of scope (rejected in #10759). This pattern exclusively relies on targeted notifications to the leased driver.

Avoided Traps

  • Race Condition Trap: Solved by defining a lease acquisition substrate with true atomic compare-and-set (CAS) semantics.
  • Deadlock Trap: Solved by enforcing a TTL on the lease; if the driver crashes, the lease expires and another agent can claim it.
  • Overloaded Primitive Trap: Avoiding the use of mutate_frontier for lease ownership, as its current contract does not support versioned lease acquisition, CAS, or conflict responses.
  • Duplicate Wake / Double-Ping Trap: Public artifacts (e.g., PR merge, ticket close) are durable truth but do not currently trigger A2A wake events natively. Until they do, explicit terminal-boundary notifications must be sent to the leased driver as a bridge/fallback path. Once GitHub events map to A2A wakes natively, this explicit ping must be disabled or deduplicated to avoid double-waking the driver.

Acceptance Criteria

  • (AC1) Define "Lane" as an active Epic. One driver lease is permitted per active Epic. Standalone backlog items default to a general lane.
  • (AC2) Define or implement a lease acquisition substrate with atomic compare-and-set semantics for one driver lease per lane. (Note: Operator A2A grant serves as uncontested initial lease).
  • (AC3) Constraint: Do not use mutate_frontier for lease ownership unless this ticket explicitly extends its contract to support versioned lease acquisition, conflict responses, TTL, owner, lane, and release semantics. Prefer a dedicated lease primitive or clearly versioned task/graph node update surface.
  • (AC4) Define the lease stop-condition: when no positive-ROI tickets remain in the Epic, the driver triggers the epic-resolution skill (RECOMMEND_CLOSE_COMPLETED) and releases the lease.
  • (AC5) Integrate an explicit night-shift mode gate. Empirically resolved (2026-05-05): Mode-gate enablement is triggered via direct operator A2A command naming the agent and lane. The A2A envelope acts as the initial uncontested lease grant. The lease must include an explicit expiresAt or equivalent bounded TTL to preserve crash-recovery. A terminal halt comment or operator redirect acts as an early-release condition. The active driver can renew the TTL by providing public progress evidence.

Contract Ledger

ID Contract Scope Evidence
1 Leased Driver Architecture Swarm momentum relies on a single leased driver per lane, preventing race conditions. L3
2 Episodic Concurrency Driver acquisition uses Native Edge Graph CAS, avoiding continuous polling. L3

Related

  • Origin Discussion: #10762
  • Refined from Discussion: #10759 (Blocked Task-State)
  • Based on 3-of-3 consensus feedback from the triad swarm.

Origin Session ID: 79042442-bebc-431d-8968-8a2e7d7a1151

tobiu referenced in commit 80bd24b - "docs(agentos): codify night-shift leased driver (#10763) (#11759) on May 22, 2026, 1:35 PM
tobiu closed this issue on May 22, 2026, 1:35 PM