Skip to content

Slice 070: Gateway core (adapter behaviour, routing, PubSub fan-out) - #66

Merged
HackTuah merged 10 commits into
mainfrom
slice/070-gateway-core
Sep 23, 2026
Merged

HackTuah merged 10 commits into
mainfrom
slice/070-gateway-core

Conversation

@HackTuah

Copy link
Copy Markdown
Member

Slice 070: the gateway layer, so Trinity can be reached from somewhere other than the desktop.

The shape. Trinity.Gateways.Adapter is what a platform implements (child_spec/1,
capabilities/0, deliver/2, format/2, render_approval/2); Router is the one road from a
channel to a session, and it decides in this order and no other: is this identity admitted, is it
inside its rate limit, is the text a command, and only then whose session is it. Console is an
in-process adapter that ships, so every criterion here runs without an account, a token or a
network, and mix trinity.console talks to it from a terminal.

An unknown sender gets a pairing code and nothing else. No session, no model call: asserted,
not asserted loosely (Sessions.list_sessions() == [] and Fake.calls() == 0 after a stranger
writes). The code is shown on /gateways and nowhere else, which is the whole of the proof: a
sender who can read it is at the owner's desktop.

What a channel may approve is capped below what the desktop may. Cap applies a tier ceiling
per adapter, :write by default, after the gate's own decision and never instead of it. A
:destructive request is refused in words, the request stays pending for the desktop (the gate is
never asked), and the refusal is a receipt on the session's chain with basis channel_cap.

Proof: slices/070-gateway-core/PROOF.md. Nine criteria, 39 tests for the slice, 564 in the
suite; gate green including the release check. Both manual artefacts are in proof/: a pairing
transcript from a running application and the /gateways screenshot.

Three bugs the suite caught, in NOTES "Findings" — two worth naming here: a command calling the
router's own API deadlocked (commands run inside that process), and a malformed /attach argument
raised inside the router and took every conversation's binding with it. Command dispatch now
rescues, so a hostile message from a channel costs its own reply and nothing else.

One deviation for the record: docs/07 read ":exec and :destructive are desktop or console
only", written before a console adapter existed. Console is now capped like every other channel
and the doc is amended, because exempting the in-process adapter would make it the one channel that
may approve a destructive effect. Raising its ceiling is a config line if the owner prefers.

…rrected to M5b Reaches

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…ormatting and the in-process console adapter

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…code and nothing else, the code pairs once, a revoked row stays visible

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…t, session binding with the adapter as origin, the stream coalesced into edits, and the slash commands

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…versation that raised it, /approve and /deny decide through the gate, and the channel trust cap refuses a tier above its ceiling with a receipt

The console adapter recorded a message's reference by position rather than the
reference deliver/2 returned, so an edit landed on a different message; found by
the approvals suite, where a refusal overwrote an earlier reply.

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…ress: each in its own session, none shown another's message

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…tions on 'the last thing shown' were racing the reply and failed only when the suite ran whole

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…ve, pairing codes, identities to allow or revoke) and mix trinity.console

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…llow-ups; docs 01, 05, 07 and the README as built; PROOF with the evidence and the two manual artefacts

Signed-off-by: Ayla Croft <aylacroft@proton.me>
Signed-off-by: Ayla Croft <aylacroft@proton.me>
@HackTuah
HackTuah merged commit d515d2d into main Sep 23, 2026
11 checks passed
@HackTuah
HackTuah deleted the slice/070-gateway-core branch September 23, 2026 13:01
@HackTuah HackTuah mentioned this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant