feat: add durable Event Await suspension protocol
Repair status — 2026-09-24
Head: 8e170e4bc493710b618e282a68a63338fb630f67 (main merged at e04c5b9715d6bc2c3233b92610dd15133010c229).
The required linux-x64-artifact failure was reproducible: the Event Await CLI fixture ran false, which durably exhausted eight semantic retries and their backoffs. Its 75-second child timeout expired first, returned empty stdout, and the test then obscured the timeout with JSON.parse: Unexpected end of JSON input.
The regression now uses the supported fail-closed authored verdict f.done('step_failed', { detail }). It asserts the report diagnostic, root completion output, closed subscription, zero worker_error retries, and the exact durable relayflows.authored-verdict.v1 stream record. The fixture also refuses empty stdout before parsing. Its local ingress path uses receipt-fenced subscriptionDeliver, resumes the authored root, and reads the durable verdict from the journal.
Local verification after the main merge:
- Event Await CLI E2E: 1/1 passed, including repeated suspended resumes, SIGKILL/restart, ordered wake replay, deduplication, exactly-once child effects, and the authored failure verdict.
- Focused Event Await/authored activity group: 36 passed.
cargo test --workspace: exit 0.- Surface build; SDK build, source typecheck, and test typecheck: exit 0.
Detailed evidence: evidence/pr441-router-2026-09-20.md.
Hosted proof boundary
This proves the local runtime/protocol and receipt-fenced ingress path. It does not prove deployed hosted Event Await or a real GitHub webhook delivery. Cloud PR #3873 remains an open, conflicting draft at af49683468017885de9b95ee0e50314734721368; Cloud PR #3878 is closed without merge at 6884d0373dda256f8b71d9ce4fa9898515dd329b. The available credential also lacks admin:repo_hook, so the exact real-delivery dedup proof remains externally blocked.
Do not merge or represent this PR as hosted-complete on the basis of local evidence.
Prior hosted-dev context — 2026-09-20
The pinned Linux artifact CI run 35525739964 succeeded; downloaded artifact 10610415637 had inner tar SHA-256 f740bbc3ff44843cde3021ad15c4a9a59f0b58b394bc15a11798d78b25bc3620 and manifest source commit a4f857589af930bd5d6ea365a0e0a4166417a125.
Dev candidate e882221f47a8ff894bdfcaa5ad61ca8a8239f28b deployed successfully in Cloud run 35526582211. A fresh GET https://dev.agentrelay.com/cloud/api/health returned buildSha: e882… and bindingsOk: true. A real granted-repository PR reached a durable event_wait binding, but no matching frame was consumed; the next resume was the idle boundary.
[!NOTE]
Low Risk
This PR slice is documentation and captured test logs only; it does not modify kernel or SDK logic, so merge risk here is low aside from contract drift if implementation diverges from the updated spec.
Overview
Documents and records verification for durable in-run event awaiting (f.on().next()) and a related YAML declared-stream worker fix.
Event-await spec and surface — EVENT-AWAIT.md is updated to match the implemented local path: subscription.prepared → Cloud persistence → subscription.activate → subscription.opened, plus subscription.park / run.resume, run-scoped activity-* ordinals, and new Cloud-facing router verbs (subscription.deliver, subscription.inspect, subscription.fence_overflow). An implementation-boundary section scopes what the SDK/daemon proves locally versus what remains Cloud integration. SURFACE.md adds exit code 4 and JSON status: "suspended" for activation and event_wait boundaries (lease released without crash retries).
Evidence only in this diff — docs/evidence/event-await-implementation/README.md captures kernel parking/replay, SDK/CLI probe (resume, SIGKILL, ordered wakes, dedup), and corruption regressions. evidence/dev-declared-streams-2026-09-20/ documents a dev cloud run that parked on assess-1 because the worker lacked the declared flows-drive-cloud stream, the SDK fix (register journaled stream names on resume), and green Vitest runs against a real daemon. evidence/pr441-router-2026-09-20/ adds a relayflowd build transcript.
This changeset is spec + proof artifacts; runtime behavior it describes lives in kernel/SDK code not shown in this diff.
Reviewed by Cursor Bugbot for commit 0138ad4e504892d3000a9f58f165320c9e943d81. Bugbot is set up for automated code reviews on this repo. Configure here.
Agent Relay sessions