Repository navigation
feat(comms): inbound !continuum directive recognizer — off-loop bus consumer (slice 3a) - #1643
Merged
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires the Rust
!continuumparser (#1635) into the live inbound airc path, off the transport hot path.AircBridgeDirectiveModulesubscribes viaMessageBus::receiver()+ a spawned consume loop, filterschat:events, classifies withparse_airc_bridge_message, and emits an observableairc:bridge:directiveevent +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-invokehandle_event, and the inbound path'spublish_async_onlyonly feeds the broadcast channel. Fix: a realreceiver()consume loop (the actual async-delivery mechanism), proven bydirective_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 thechat: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