Repository navigation
feat(routing): EventPublishAdapter — the emit() landing (4th SDK verb) - #1668
Merged
Merged
Conversation
…4th SDK verb) The client-side emit() (BigMama, #1666) builds an AircEventPublish envelope; this is its peer-side landing — the ConsumerAdapter that receives a publish, gates it, fans it out to every matching subscriber, and acks the delivered count. Completes the Event primitive's write half on the core: subscribe (read) + publish (write), the twin of execute + provide on the Command side. Built from the lowest shared level outward, mirroring the subscribe path line-for-line so a reader who knows one knows the other: protocol (continuum-airc-protocol, already on canary): AircEventPublish, AircEventPublishAck, EVENT_PUBLISH_BODY_HINT, resolve_publish, decode_publish_ack — the single source of truth for the wire shape. routing/airc_event_protocol.rs + mod.rs: re-export the publish symbols alongside the subscribe ones. routing/airc_event_publisher.rs: ParsedPublish + parse_publish_envelope (twin of parse_subscribe_envelope) + build_publish_ack (twin of build_subscribe_ack, carrying the fan-out count). routing/airc_event_adapters.rs: EventPublishAdapter — gate_publish (the pure WRITE-gate seam) + process_publish (gate → AircEventPublisher::publish fan-out → ack) + the ConsumerAdapter impl claiming EVENT_PUBLISH_BODY_HINT. Publish is a WRITE: unlike subscribe (registers the caller's own interest), a publish MUTATES every subscriber's stream. So it is gated through the same AuthPolicy chokepoint on the synthetic URI events/<topic>/publish — without it any reachable peer could inject events onto ANY topic, including internal substrate signals other personas act on. Empty topic refused upfront ([[no-fallbacks-ever]]). Tests (routing::airc_event_adapters::tests, mirroring the subscribe suite): - gate_publish_threads_caller_into_gate — the verified sender reaches the gate (no silent privilege escalation) - gate_publish_refuses_empty_topic_with_typed_error - gate_publish_refuses_when_policy_forbids - gate_publish_decision_path_is_stable — pins events/<topic>/publish - build_publish_ack_carries_topic_and_delivered_count - adapter name + body_hint pinned to the protocol constants The async fan-out half composes AircEventPublisher::publish, whose composition is covered without airc by build_publish_envelopes tests. Boot wiring (register_consumer_adapter for the whole event surface) is the same not-yet-present integration step the subscribe/unsubscribe adapters await — this lands the publish adapter ready to register beside them. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Nov 8, 2026
joelteply
added a commit
that referenced
this pull request
Nov 8, 2026
…anchored clone holding nothing unpublished is re-allocated (card 7f824214) (#5873) * Every held card checkout goes through airc's ensure_card_clone: an unanchored clone holding nothing unpublished is re-allocated (card 7f824214) Kimi on the Windows node, 2026-11-08: a clean, weeks-old card clone (e5fe473) with no allocation evidence was handed back to her as-is by stage_for_card's early return, so her hands sat on old code and work/submit could never name a base. airc e05c44d (#1668) makes ensure_card_clone re-allocate such a clone when nothing in it is unpublished (HEAD and every branch tip on the remote, clean tree, no stash) and refuse naming what it holds otherwise. The early return is deleted, so every existing checkout reaches it (the linked-worktree migration of #1582 needed the same path), and a re-allocation is probed as card.checkout.reallocated. Bumps the airc pin 22c9c0e -> e05c44d (6 commits; IPC_PROTOCOL_VERSION unchanged at 6). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * A held turn and a submit route a checkout without allocation evidence through the stager too (Codex on #5873) Two more paths handed an existing checkout back as-is, so Kimi's anchorless clone never reached ensure_card_clone: restage_held_linked_checkout returned early for any present non-linked checkout, and next_after_submission submitted from any found path. One predicate, card_checkout::lacks_allocation_evidence (airc's allocation_evidence, off the runtime threads), is true unless evidence decodes against its creation anchor; both paths now send such a checkout to the stager (re-allocate, or refuse naming what it holds). A checkout with its evidence keeps the fast path. Test: none, valid, then the anchor deleted. continuum-mind card_checkout + card_staging: 12 passed (IntelMac, --features metal). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Only a checkout with no creation anchor goes to airc's stager; an anchored one predating the full allocation record keeps working (#5873 CI) 32ea routed any checkout without airc's full allocation record to ensure_card_clone, which refuses one holding unpushed work: a checkout with its creation anchor but from before airc wrote the record (continuum-core's a_checkout_derived_submit_publishes_her_patch_and_records_its_issuer) could no longer submit. Submit needs only the anchor. The predicate is now card_checkout::lacks_creation_anchor: Kimi's clone has none and still goes to the stager; an anchored one is reused. stage_for_card keeps its early return for an anchored, non-linked clone, so a claim never sends old anchored work to that refusal. Tests: none / anchor only / anchor gone; card_checkout + card_staging 12 passed, the failing continuum-core test passes (IntelMac, --features metal). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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
The client-side
emit()(BigMama, #1666) builds anAircEventPublishenvelope. This is its peer-side landing — theConsumerAdapterthat receives a publish, gates it, fans it out to every matching subscriber, and acks the delivered count.Completes the Event primitive's write half on the core:
Built lowest-level-out, mirroring subscribe line-for-line
continuum-airc-protocol, already on canary):AircEventPublish,AircEventPublishAck,EVENT_PUBLISH_BODY_HINT,resolve_publish,decode_publish_ack— single source of truth for the wire shape.routing/airc_event_protocol.rs+mod.rs: re-export the publish symbols beside the subscribe ones.routing/airc_event_publisher.rs:ParsedPublish+parse_publish_envelope(twin ofparse_subscribe_envelope) +build_publish_ack(twin ofbuild_subscribe_ack, carrying the fan-out count).routing/airc_event_adapters.rs:EventPublishAdapter—gate_publish(pure WRITE-gate seam) +process_publish(gate →AircEventPublisher::publishfan-out → ack) + theConsumerAdapterimpl claimingEVENT_PUBLISH_BODY_HINT.Why publish is gated as a WRITE
Unlike subscribe (registers the caller's own interest), a publish mutates every subscriber's stream. It runs through the same
AuthPolicychokepoint on the synthetic URIevents/<topic>/publish— without it, any reachable peer could inject events onto any topic, including internal substrate signals other personas act on. Empty topic refused upfront ([[no-fallbacks-ever]]).Test
cargo test -p continuum-core --lib --features metal,accelerate,test-fixtures routing::airc_event_adapters::tests→ 15 passed (4 new publish-gate/ack tests + the existing subscribe suite). Clippy clean on touched files. The async fan-out half composesAircEventPublisher::publish, covered without airc by the existingbuild_publish_envelopestests.Scope
Boot wiring (
register_consumer_adapterfor the whole event surface) is the same not-yet-present integration step the subscribe/unsubscribe adapters await — this lands the publish adapter ready to register beside them.🤖 Generated with Claude Code