gateway: flip Router and ChatContract inbound signatures onto domain/messaging.Message #1203
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#1203
Reference in new issue
Block a user
Flip the gateway's channel-facing inbound signatures from gateway.Message to
domain/messaging.Message, so the canonical type reaches the channel boundary and
gateway.Message can eventually be deleted per the TARGET block in
internal/gateway/messaging_convert.go:17-21.
This is the single shared choke-point every channel feeds. It must land alone,
before any per-channel work, because all three messaging-migration beads
(4hof, h3w2, o4e4) converge on these same symbols and would collide on identical
diff hunks if run in parallel.
Symbols to change:
Measured state at 1a0be64: no package under internal/channels/ or internal/webui/
imports domain/messaging at all (0 references). The channels build gateway.Message
at 8 construction sites and hand it to the Router, which converts at the store
boundary. So there is no channel-local migration to do until this flip lands.
Construction sites that follow this change:
Also amend the messaging_convert.go TARGET block and migration-decisions.md
section 2 so the register and the code agree on whether gateway.Message survives.
1a0be64's commit message says it "remains the channel-facing transport", which is
true of that commit's scope but reads as contradicting the TARGET block.
Acceptance criteria
Router.Route, RouteStream and ResolveSessionKey take messaging.Message. ChatContract's three methods take/return messaging.Message. gatewayrpc wire conversion updated. All existing gateway tests pass unchanged in behaviour. Lands as one commit touching no channel package.
Close reason
Implemented in 7e1f44b, merged as 23e29b0. gateway.Message deleted; the channel boundary now speaks messaging.Message via a new gateway.Inbound{Message messaging.Message, Page string} envelope (Page reaches the system prompt, never persisted). Role set at construction; RoleForSender survives for the RPC boundary's per-side derivation. Proto unchanged. Added inbound_test.go (Page reaches prompt not record; channel Inbound round-trips with its Role). task check green on main.
Imported from beads
archie-core-9g5e· GitHub #780 · type task · priority P2 · created 2026-09-08 · closed 2026-09-08