Skip to content

fix: admit remote commands only through verified addressed contracts - #5603

Merged
joelteply merged 4 commits into
canaryfrom
fable/ingress-contract
Oct 30, 2026
Merged

joelteply merged 4 commits into
canaryfrom
fable/ingress-contract

Conversation

@joelteply

@joelteply joelteply commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

An untrusted peer could publish command-shaped room messages that a node executed and residents perceived as speech. Commands now enter only through the identity's verified addressed inbox. Room subscriptions carry conversation, with no command execution path.

The kernel owns the addressed frame/inbox/port/handler contract. Ingress checks authenticated kind, addressee, command header, trust or verified capability before decoding the payload, then rejects path disagreement. Generation identity and validity are required. Invalid presented grants are refused without tier fallback. Commands and results use merged AIRC d26713bf; the assumed API and old body hints are removed.

The integrated consumer changes from #5605 use one sealed progress/completion exchange, required bodies and typed inbox failures. Execution and stream draining share lifetime and deadline; lost progress cancels work, success requires a final marker, and requester cancellation is mandatory. Obsolete room/store reply recovery and event-control parsers are deleted. Shutdown releases inbox ownership and interrupts handlers.

Validation: #5605 exact5158a7d3e946e75e4bf78ab2c9db886f6d28a10c passed the full selected Rust workflow,1224 core tests (zero failures;10ignored,2filtered), client/CLI regressions, hygiene and macOS ARM/Intel plus Windows artifact builds. Local cumulative source review approved the production fixes. Its squash integration a60f004 has the identical source tree; this PR's canary integration checks remain required.

Remaining scope: event-control adapters accept verified addressed frames but production dispatcher registrations/private event fan-out are not wired here. Existing event fan-out remains public room traffic. Deployment, reciprocal actual-session delivery, maintenance continuity and retained learning require separate live evidence.

The mandatory development doctrine is recorded once in docs/architecture/DEVELOPMENT-DOCTRINE.md, linked by AGENTS.md and CLAUDE.md: zero backward compatibility, explicit typed failures, one mechanism owner, crate boundaries and continuous refinement/deletion.

…here, from a tier that meets the command (ingress contract)

Incident 2026-10-30 00:28-00:38Z: peer e9093c03 (untrusted in the trust store)
published persona/placement/reserve and ai/generate requests into #general; the
M5 executed them (airc.command.accepted caller=e9093c03) and fed the same frames
to two residents as room speech (mind.feed.event residents=2).

- continuum-airc-protocol::inbound: the ONE inbound decode point. An airc event
  becomes a ProtocolEnvelope or a ConversationEvent from HEADER facts only
  (continuum.body_hint, airc.correlation_id, the addressee, sender, room); the
  payload stays opaque. A guard test fails if the classifier reads a payload.
- perception_feed::feed takes only a ConversationEvent; inbound_attach routes a
  protocol frame away from perception, the chat projection and the bus.
- command_ingress::ingress_contract: a command request executes only if direct
  (never a room broadcast), addressed to this node, names its command in the
  continuum.command.path header (the decoded body must agree), and the caller's
  airc trust tier meets the command ACL's declared tier (Provisional -> friend,
  above -> own_account; untrusted meets nothing) or a verified grant confers it.
  Typed IngressRefusal per rule, probe airc.command.ingress_refused (caller,
  path, channel, tier), refusal replies name the rule and never echo params.
- The command pump keys on the classifier instead of its own header string.
- TwoAircLoopback enrols its peers at own_account (two nodes of one account).
- Pure moves to keep files under 1,000 lines: inbound_attach tests to
  inbound_attach/tests.rs, StreamPublisher to command_ingress/stream_publisher.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…o command handling (rebuild on the airc addressed seam)

Rebuilds the ingress contract on the agreed airc API seam (airc#1620 foundation
c7083d04 + the addressed module still to publish). BLOCKED on that module: this
does not compile until airc exports AddressedInbox / VerifiedAddressed /
AddressedKind and the reply bound to a request.

- continuum-kernel routing::addressed_inbox: the core's seam (AddressedFrame,
  AddressedInbox, AddressedPort, AddressedHandler) with the airc impls, plus
  test-fixtures FakeFrame / FakeInbox / FakePort so the contract runs without a
  daemon.
- command_ingress: CommandRequestHandler is an AddressedHandler only. The
  contract reads the verified fields: kind() == Command, to() == this node, the
  path from the typed header, from()'s airc trust tier >= the command ACL's tier
  (or a verified grant); the body is decoded only after, and must name the same
  command. Typed IngressRefusal per rule; replies bound to the request.
  ParsedEnvelope / parse_envelope / ConsumerAdapter / HANDLER_NAME deleted.
- The command pump reads only the addressed inbox (no room subscription).
- COMMAND_REQUEST_BODY_HINT / COMMAND_RESPONSE_BODY_HINT deleted with every
  stamp and check (kernel AircTransport, engine AircLiveTransport, client
  AircIpcTransport, its serve loop now on the inbox too). No compatibility branch.
- Room events: inbound::classify routes airc's Command / CommandResult kinds
  (and event-protocol hints / bus correlation) away from perception by transport
  kind and headers; the payload-guard test stays.
- await_reply consumers read VerifiedAddressed getters.
- Tests rewritten around the fake inbox: untrusted sender refused, frame
  addressed elsewhere ignored, own_account command executes, lying header
  refused, and a source guard that nothing on the room path reaches the command
  receiver. Integration tests drive the real receiver from the inbox.
- airc rev bumped to c7083d04 (lock rewritten by rev; cargo will settle it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply marked this pull request as draft October 30, 2026 01:24
@joelteply joelteply changed the title A peer command never reaches a mind, and runs only direct, addressed here, from a tier that meets the command [blocked on airc addressed module] Commands arrive only through the addressed inbox; the room path has no command handling Oct 30, 2026
…acts (#5605)

* fix: migrate command consumers to sealed progress and retained deadlines

* fix: finish client addressed API migration and fixture dependency scope

* Migrate event control handlers to verified addressed requests

* Keep client command serving alive across rejected inbox items

* Route placement reservation commands by authenticated peer

* Execute client transport regressions in the existing CLI CI job

* Remove obsolete command compatibility paths and require cancellation

* Define continuous refinement and hard architectural contracts

* Align learning doctrine with existing conscious and dream modes

* fix(ingress): refuse invalid generation metadata and presented grants

* test(ingress): mark extracted metadata tests as test-only
@joelteply joelteply changed the title [blocked on airc addressed module] Commands arrive only through the addressed inbox; the room path has no command handling fix: admit remote commands only through verified addressed contracts Oct 30, 2026
@joelteply
joelteply marked this pull request as ready for review October 30, 2026 16:18
@joelteply

Copy link
Copy Markdown
Contributor Author

The a60f004 integration run failed one engine test: 1404 passed, 1 failed. Source diagnosis identified two fixtures sharing a bounded process-global sample cache: one intentionally cycles more than its eight-directory capacity while the stuck-reader fixture expects its live sample to remain. None was the observed result, consistent with eviction.

Repair 195e767 gives samples and their single disk-read flight one StateSampler owner. Production uses one shared instance; each lifecycle fixture uses an independent instance of exactly that implementation. Original assertions remain, with an added cross-owner eviction assertion while the first read is blocked. Independent source review APPROVE; exact-head CI remains required. No local Rust build beside serving. No retry, larger timeout, assertion relaxation or cache reset.

@joelteply
joelteply merged commit 365f70f into canary Oct 30, 2026
46 checks passed
@joelteply
joelteply deleted the fable/ingress-contract branch October 30, 2026 18:14
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