M-0: BusForwarder sink fanout + check-fanout-drainer.sh boundary gate (R-009) #97

Open
opened 2026-05-12 19:36:44 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-05-12 19:36:44 +00:00 (Migrated from github.com)

Goal

BusForwarder.drain takes sink fan-out: 1 drainer, N>=1 sinks (AppBusForwarderSink, HarnessSink, ReplaySink). Add check-fanout-drainer.sh as 18th boundary gate asserting exactly one fanout drainer. Mitigates R-009.

Scope

  • BusForwarder.drain accepts [Sink] parameter
  • Multiple sinks supported: AppBusForwarderSink, HarnessSink, ReplaySink
  • scripts/check-orchestrator-events-single-consumer.sh updated to assert exactly one fanout drainer
  • New scripts/check-fanout-drainer.sh

Files

  • packages/AgentCore/Sources/AgentOrchestrator/BusForwarder.swift
  • scripts/check-orchestrator-events-single-consumer.sh (update)
  • scripts/check-fanout-drainer.sh (new)

Acceptance

  • Drainer count == 1
  • Sink count >= 1 with all three sinks registered
  • scripts/check-fanout-drainer.sh green
  • scripts/check-orchestrator-events-single-consumer.sh green with new semantics

Test

Unit test: register 3 sinks → all receive each event. Boundary script asserts single drainer literal.

Parent epic

#4

Source

.planning/architecture/JARVIS-API-MIGRATION-PLAN.md §2.1 (M-0.8)
.planning/architecture/REVIEW-MIGRATION-RISK.md R-009

## Goal BusForwarder.drain takes sink fan-out: 1 drainer, N>=1 sinks (AppBusForwarderSink, HarnessSink, ReplaySink). Add check-fanout-drainer.sh as 18th boundary gate asserting exactly one fanout drainer. Mitigates R-009. ## Scope - `BusForwarder.drain` accepts `[Sink]` parameter - Multiple sinks supported: `AppBusForwarderSink`, `HarnessSink`, `ReplaySink` - `scripts/check-orchestrator-events-single-consumer.sh` updated to assert exactly one fanout drainer - New `scripts/check-fanout-drainer.sh` ## Files - `packages/AgentCore/Sources/AgentOrchestrator/BusForwarder.swift` - `scripts/check-orchestrator-events-single-consumer.sh` (update) - `scripts/check-fanout-drainer.sh` (new) ## Acceptance - [ ] Drainer count == 1 - [ ] Sink count >= 1 with all three sinks registered - [ ] `scripts/check-fanout-drainer.sh` green - [ ] `scripts/check-orchestrator-events-single-consumer.sh` green with new semantics ## Test Unit test: register 3 sinks → all receive each event. Boundary script asserts single drainer literal. ## Parent epic #4 ## Source `.planning/architecture/JARVIS-API-MIGRATION-PLAN.md` §2.1 (M-0.8) `.planning/architecture/REVIEW-MIGRATION-RISK.md` R-009
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#97