Skip to content

feat(remote): notification layer — event classes and subscriber routing (ADR 0006) - #24

Merged
orangewk merged 2 commits into
mainfrom
claude/multi-env-agent-messaging-pk8mte
Jul 14, 2026
Merged

feat(remote): notification layer — event classes and subscriber routing (ADR 0006)#24
orangewk merged 2 commits into
mainfrom
claude/multi-env-agent-messaging-pk8mte

Conversation

@orangewk

@orangewk orangewk commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the notification layer from ADR 0006 (included), replacing the earlier broadcast wake spike with a routed design where each layer is statable in one sentence:

  • Layer 1 — transport (ADR 0005): unchanged.
  • Layer 2 — event classes: every event type is either a deliverable (message_sent, legacy no-type lines — wakes its recipient) or state gossip (message_read — wakes no one; it converges on the next sync). Declared in scripts/lib/sync.sh and the docs.
  • Layer 3 — subscriber routing: subscribers/<team>/<agent>.json on the bus is the routing table; the router Action (docs/examples/agmsg-router.yml, deployed on the bus branch) reads only the metadata of newly appended event lines and delivers only matching deliverables — never to the writer itself, never for gossip. wake.kind (pr-comment today) is the replaceable delivery part.

New commands:

remote.sh subscribe <team> <agent> --pr <number>
remote.sh unsubscribe <team> <agent>

This design removes the broadcast spike's observed symptoms (self-echo, receipt-triggered wake storms, no recipient targeting) from the architecture instead of patching them; the rejected patches are recorded in the ADR.

Tests

  • 4 new bats tests (registry content, idempotent re-subscribe / pr update, unsubscribe, path-safety and --pr validation); full remote suite 35/35 green locally.
  • Router classify/match logic verified against fixtures (gossip dropped, team-field spoof dropped, legacy lines kept, writer self-suppression).
  • Live end-to-end on this repo's bus: deliverable from a second environment → router woke exactly mathdesk-desktop/claude-cloud via one comment on PR agmsg wake channel (perpetual — do not merge) #23 (webhook received by the subscribed session); the reader's receipt push logged "Only state gossip in this push; waking no one"; workflow-only and subscribe-only pushes no-op.

🤖 Generated with Claude Code

https://claude.ai/code/session_017XnLYnoNRCbGCGUFSvhDD2

claude added 2 commits July 14, 2026 09:13
Documents the bus-push -> Action -> wake-channel-PR-comment pattern that
wakes webhook-subscribed cloud sessions, with the workflow as a copyable
example. Verified end-to-end on this repo's bus.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XnLYnoNRCbGCGUFSvhDD2
…ng (ADR 0006)

Replaces the broadcast wake spike with a routed design: every event type
declares a class (deliverable wakes its recipient; state gossip wakes no
one), a subscribers/ registry on the bus says who to wake and how, and the
router Action delivers only matching deliverables, never to the writer
itself. remote.sh gains subscribe/unsubscribe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XnLYnoNRCbGCGUFSvhDD2
@orangewk orangewk changed the title docs(remote): webhook wake glue for cloud sessions feat(remote): notification layer — event classes and subscriber routing (ADR 0006) Jul 14, 2026
@orangewk
orangewk marked this pull request as ready for review July 14, 2026 13:35
@orangewk
orangewk merged commit a613118 into main Jul 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants