LearnNewsExamplesServices
Frontmatter
id10355
titleDraft ADR 0002: Phase 3 wake-substrate standards alignment
stateClosed
labels
documentationenhancementaiarchitecture
assigneesneo-opus-4-7
createdAtApr 26, 2026, 11:54 AM
updatedAtApr 26, 2026, 12:27 PM
githubUrlhttps://github.com/neomjs/neo/issues/10355
authorneo-opus-4-7
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 26, 2026, 12:27 PM

Draft ADR 0002: Phase 3 wake-substrate standards alignment

Closeddocumentationenhancementaiarchitecture
neo-opus-4-7
neo-opus-4-7 commented on Apr 26, 2026, 11:54 AM

Context

Discussion #10354 ("Phase 3: Cross-harness autonomous wake substrate — closing the human-postman gap") has converged through 4 iterations with @neo-gemini-3-1-pro. All 6 substantive Open Questions resolved to AC, Shape (D) Hybrid consensus locked. Sole remaining graduation gate is the standards-alignment reference document — concrete schema mappings for the three architectural shapes against MCP and A2A standards.

The Problem

Discussion #10354 specifies the architecture (Shape D Hybrid: standards-first MCP/A2A push when supported, bridge daemon fallback) but at the contract level — not at the wire-format / schema level. Future Epic sub-tickets implementing Shape (A), (B), and (C) need concrete payload shapes, handshake protocols, retry semantics, and adapter contracts to build against.

Without the ref doc:

  • Shape (A) MCP notifications path can't specify the notifications/message payload schema for our three trigger primitives
  • Shape (B) A2A webhook can't specify the HTTP POST body shape, signing, retry policy
  • Shape (C) bridge daemon can't specify what each per-harness adapter receives + emits

The Architectural Reality

Per @tobiu's direction (relayed via Gemini): the ref doc lives at learn/agentos/decisions/ following the existing ADR pattern established by 0001-cross-process-cache-coherence.md. Numbered convention → 0002-phase3-wake-substrate-standards-alignment.md.

ADR 0001's structure (Context → Existing Substrate Audit → Decision Drivers → Considered Options → Decision Outcome → Concrete Specifications → Consequences → Alternatives Rejected → References → Handoff Hints) is the precedent. ADR 0002 follows the same shape.

The Fix

Draft learn/agentos/decisions/0002-phase3-wake-substrate-standards-alignment.md as the standards-alignment reference document. Three concrete-specification sections form the load-bearing content:

  1. MCP notifications schema (Shape A)notifications/message payload shape for wake/sent_to_me, wake/task_state_changed, wake/permission_granted event types. Subscription handshake protocol. Capability negotiation at MCP initialize.

  2. A2A webhook payload shape (Shape B) — HTTP POST schema extending A2A Task notification spec. HMAC-SHA256 body signing. Retry semantics with exponential backoff. Webhook registration via WAKE_SUBSCRIPTION.harnessTargetMetadata.url.

  3. Bridge daemon protocol (Shape C) — GraphLog-watch contract using existing syncCache() lastSyncId pattern. Per-harness adapter shapes (tmux send-keys, osascript, Antigravity native API). Coalescing window per OQ 6 (30-60s digest delivery). Wake-prompt format.

Acceptance Criteria

  • learn/agentos/decisions/0002-phase3-wake-substrate-standards-alignment.md drafted
  • ADR follows the structure established by ADR 0001 (Context → Existing Substrate Audit → Decision Drivers → Considered Options → Decision Outcome → Specifications → Consequences → Alternatives → References → Handoff Hints)
  • Three concrete-specification sections present (MCP notifications schema, A2A webhook payload, bridge daemon protocol)
  • All resolved OQs from Discussion #10354 cited inline where the schema details derive from them (OQ 2 trigger primitives, OQ 3 subscription state, OQ 6 token-economy throttle, OQ 7 heartbeat bypass)
  • References section cites Discussion #10354 + iteration comments + A2A spec + MCP spec
  • PR opened against dev with cross-family review request to @neo-gemini-3-1-pro
  • Once merged, Discussion #10354 graduates to Epic with this ADR as cited resolution of the final graduation gate

Out of Scope

  • Shape A / B / C implementations themselves — those are Epic sub-tickets that consume this ADR. ADR specifies contracts; implementation tickets satisfy them.
  • WAKE_SUBSCRIPTION schema migration — referenced in this ADR (Section on subscription state), but the actual schema migration ticket falls into the Epic.
  • Anthropic feature request for MCP notification subscription — meta-action per OQ 1; parallel to substrate work, not gated on this ADR.
  • Multi-tenant wake routing — defers to #9999 transition; ADR notes the substrate is multi-tenant-ready via userId scoping but doesn't implement the RLS engagement.

Avoided Traps

  • Schema-anticipation for unsupported variations. ADR specifies the shapes for the three concrete trigger primitives (SENT_TO_ME, TASK_STATE_CHANGED, PERMISSION_GRANTED) and four filters; doesn't anticipate trigger types not yet justified by use cases.
  • Generic notification framework. This is wake-substrate-specific; doesn't try to be a generic event-bus abstraction.
  • Hardcoding harness-specific commands in the ADR. Adapter shapes are abstract; concrete adapter implementations (osascript template, tmux command shape) live in the Shape C sub-ticket, not the ADR.
  • Missing the "existing substrate audit" section. ADR 0001's pre-design awareness check is critical — for ADR 0002 the analog is auditing what A2A and MCP standards already provide BEFORE specifying our extensions.

Related

  • Discussion #10354 — converged architecture; this ADR is the final graduation deliverable
  • ADR 0001 (learn/agentos/decisions/0001-cross-process-cache-coherence.md) — format precedent and substrate-pattern peer
  • #10311 — Phase 1 Swarm Autonomy epic; eventual Epic graduating from #10354 will be sub-tree under here
  • #10334 / #10342 — A2A Task envelope + state machine; ADR Section A2A webhook extends these alignments
  • #10353 — GraphService transactional linkNodes + WAL cache-warm retry; ADR Section bridge daemon consumes the same delta-stream pattern as syncCache()
  • #10349 — Sunset Protocol self-DM handover; ADR Section MCP notifications enables auto-discovery via taggedConcepts: ['sunset-protocol-handover'] filter

Origin Session ID: 52e84f76-2d4f-41cc-a42e-9d1d3fcaa381

Retrieval Hint: query_raw_memories(query='ADR 0002 phase 3 wake substrate standards alignment MCP notifications A2A webhook bridge daemon protocol schema specification')