Skip to content

feat(comms): inbound !continuum directive recognizer — off-loop bus consumer (slice 3a) - #1643

Merged
joelteply merged 1 commit into
canaryfrom
feat/airc-bridge-directive-inbound
Jun 16, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/airc-bridge-directive-inbound

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

Wires the Rust !continuum parser (#1635) into the live inbound airc path, off the transport hot path. AircBridgeDirectiveModule subscribes via MessageBus::receiver() + a spawned consume loop, filters chat: events, classifies with parse_airc_bridge_message, and emits an observable airc:bridge:directive event + probe!.

NO command execution — that's the security-sensitive slice 3b, which will subscribe to this event (vuln-A: peer content is conversation, not instructions). The parser's deny-by-default allowlist is the safety boundary.

Agentic review caught a blocker (the loop working)

The first cut used event_subscriptions + handle_event — a reviewer found that's dead code: async subscriptions don't auto-invoke handle_event, and the inbound path's publish_async_only only feeds the broadcast channel. Fix: a real receiver() consume loop (the actual async-delivery mechanism), proven by directive_flows_through_the_real_bus — an end-to-end test through the bus that would fail on the dead wiring (pure-fn tests can't catch that class of bug). Also addressed: peer-settable event name → filter on the chat: prefix + rely on the parser allowlist for safety; 16KB length cap bounds peer-controlled tokenize cost.

Accommodates media + all transport (good architecture first)

Only continuum-body-hint envelopes project to bus events (media/WebRTC forwarded opaque, never deserialized); this further filters to chat:, so presence/media/transport are never classified. It's additive — one more consumer + one more event in an event-rich system (UI reactivity, persona updates, persona-to-persona). Off-loop, in-memory, no ORM — honors the airc performance doctrine.

Tests

9 unit + integration tests green under --features metal,accelerate: directive recognition, plain-chat/self-echo/missing-text → no-op, nested-payload defensiveness, off-allowlist → Unknown (surfaced, not executed), oversized-text skipped, non-chat events ignored, end-to-end through the real bus, passive-consumer config.

🤖 Generated with Claude Code

…onsumer (slice 3a)

Wires the Rust bridge parser (#1635) into the live inbound airc path, OFF the
transport hot path: AircBridgeDirectiveModule subscribes via MessageBus::receiver()
and spawns a consume loop on initialize, filters chat: events, classifies via
parse_airc_bridge_message, and emits an observable airc:bridge:directive event +
probe. NO command execution — that's the security-sensitive slice 3b that will
subscribe to this event (vuln-A: peer content is conversation, not instructions).

Agentic review caught a BLOCKER on the first cut and drove this design:
- async event_subscriptions do NOT auto-invoke handle_event; the inbound path's
  publish_async_only only feeds the broadcast channel. A handle_event override was
  dead code. FIX: real receiver() consume loop (the actual async-delivery
  mechanism), proven by the directive_flows_through_the_real_bus integration test
  (end-to-end through the bus — pure-fn tests can't catch dead wiring).
- event name is peer-settable → filter on the chat: PREFIX (robust), and the
  safety guarantee is the parser's deny-by-default allowlist, NOT the name.
- length cap (16KB) bounds peer-controlled tokenize CPU/alloc.

Architecturally accommodating to media/WebRTC/all transport: only continuum-body-hint
envelopes project to bus events (media forwarded opaque), and this filters to chat:
— presence/media/transport never classified. Additive: one more consumer + event in
an event-rich system. 9 unit+integration tests green under --features metal,accelerate.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit 2d79924 into canary Jun 16, 2026
4 checks passed
@joelteply
joelteply deleted the feat/airc-bridge-directive-inbound branch June 16, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant