Commit Graph
212 Commits
Author SHA1 Message Date
kyleandClaude Opus 5.5 f6dd7f1741 M4b review, and follow-up tasks 16 to 18
The review of tasks 01 to 15 goes in the implementer log, with the
device check against the owner's Mattermost. Three follow-ups:

- 16: the refusal without a runner says why.
- 17: the texts that say who asked.
- 18: approvals from non-approvers in direct or group messages go to
  an approver.

Task 14's given serve_approvals.rs becomes serve_approvals.rs-task14,
since task 18 hands over a new version. Tip T31 is added.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 11:35:24 -07:00
kyleandClaude Opus 5.5 d2e814161f M4b spec: approvals from non-approvers in direct messages go to an approver, with who asked and what
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 11:09:59 -07:00
kyle edf9ba3515 gatewayd: approvals answered from Mattermost; typing paused; the notice
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 10:19:41 -07:00
kyleandClaude Opus 5.5 af7137dafe M4b task 15: fix task 14's dropped refusal reason, as a listed edit
Task 15's session found the defect in serve/approvals.rs, a file it did not list, and stopped.
The comment in task 14 used one name for two values; task 14's tests could not reach it. Lesson T30.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 08:46:33 -07:00
kyle c38e450f44 gatewayd: serve, posting approvals, marking them, and the listener
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 05:07:50 -07:00
kyle a33ff240c4 gatewayd: gateway, the gateway.sock listener and one thread per connection
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:59:02 -07:00
kyle 07e4e16270 gatewayd: state, the posts of open approvals, and the turn of a session
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:50:54 -07:00
kyle c5df86d13d gatewayd: approvals, the registry and the judging of commands
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:48:06 -07:00
kyle d9f8fa9331 gatewayd: approvals::text, the posts that show an approval
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:42:37 -07:00
kyle 18791ab389 gatewayd: mm, patch_post and username
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:36:45 -07:00
kyle 365e50081d gatewayd: strip a leading mention of this bot; recognise approval commands 2026-09-24 04:33:03 -07:00
kyle b45ca14c14 gatewayd: config, [approvals] users and socket
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:28:26 -07:00
kyle e0560ab996 brokerd: courier, carrying pending approvals to gatewayd and answers back
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:25:07 -07:00
kyle 412f80c470 brokerd: config, [gateway] socket for Mattermost approvals 2026-09-24 04:18:04 -07:00
kyle a00711e379 brokerd: answers carry the Mattermost post; Table::contains
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:15:11 -07:00
kyle a5c37d8756 bxctl: deny, another name for refuse
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:11:01 -07:00
kyle ebb78e816d proto: gateway, the four messages between brokerd and gatewayd
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:07:46 -07:00
kyle db3f9ed01b proto: escape, moved from bxctl so gatewayd shows the same thing
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 04:01:03 -07:00
kyleandClaude Opus 5.5 2d415fc1be Plan M4b: approvals over Mattermost in 15 tasks
Skeletons for new files only; existing files change by exact edits, so no task overwrites an
earlier one's work. Each task's tests were run against a reference built in order from master,
with the gate at each step and mutations checked; each skeleton compiles and fails its tests, and
every todo!() comment was read beside its signature. The reference is kept off this machine.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 03:34:21 -07:00
kyleandClaude Opus 5.5 b1f732a42a M4b spec: names and details settled while building the reference
approval_reply and GatewayOutcome (proto already has an ApprovalAnswer); the bot's edit permission
confirmed on the owner's server; a restart replaces a dead post's text; the reason escaped as
inline code; the part size bound; the reply for an approval too long to show.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 03:22:55 -07:00
kyleandClaude Opus 5.5 a8f7819da3 M4b spec approved
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:54:59 -07:00
kyleandClaude Opus 5.5 1c2695d21d Apply P16: approvals are !approve/!deny replies in the approval's thread; no reactions
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:54:50 -07:00
kyleandClaude Opus 5.5 3088dcc201 M4b spec: gatewayd strips a leading mention of its own bot; bare commands are the operator's care
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:53:54 -07:00
kyleandClaude Opus 5.5 00a9b576b2 Specify M4b (approvals over Mattermost); propose P16 on approval replies
The owner's decisions of 2026-09-24: commands only, no reactions; an approvers list that falls
back to allow.users; approvals in the asking thread; on a gatewayd restart, old posts are marked
dead and brokerd's courier posts pending approvals again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:48:51 -07:00
kyleandClaude Opus 5.5 53560ca731 M4a task 16 review: accepted; the plan's copy of its test is now the formatted file
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:36:22 -07:00
kyle 10c80b74f3 gatewayd: read a secret file from the file that was checked
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 01:33:36 -07:00
kyleandClaude Opus 5.5 6feffadd11 M4a task 16: read a secret file from the file that was checked (review finding 2)
The test swaps the file between the check and the open through a `between` hook. A reference fix
passed it and the gate (769 tests) in the working tree, caught two mutations, and was removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:27:41 -07:00
kyleandClaude Opus 5.5 0081f24b70 gatewayd: strict status lines and chunk lines; no as casts (M4a review, findings 1 and 3)
A status line splits on single spaces only, and every chunk line must end in CRLF. The bounded
`as` casts in http.rs, handshake.rs and proto's sha1.rs become try_from and from.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:23:51 -07:00
kyleandClaude Opus 5.5 131b3677fd M4a review: accepted; checked end to end against the owner's Mattermost
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 01:21:27 -07:00
kyle 09b074c121 gatewayd: main, serve --config with its start checks
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 01:00:22 -07:00
kyle ed361db718 gatewayd: serve, the event loop, typing, catch-up and reconnecting
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-24 00:55:58 -07:00
kyleandClaude Opus 5.5 02d5e25046 M4a task 14: post's comment was now_ms's; fixed, and every comment read
A script that rewrote the skeleton's comments put `now_ms`'s text on `post`. Task 14's second
session saw the contradiction and deliberated until cut off. Both comments are fixed, each
todo!() comment in tasks 14 and 15 was read beside its signature, and both tasks now say to stop
and quote a comment that does not fit. Lesson T29.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 00:40:05 -07:00
kyleandClaude Opus 5.5 564875f0a0 M4a tasks 14 and 15: glue written, calls tabled, after task 14's session wrote nothing
Task 14's session read the crate to learn the APIs and planned `connect` in prose until it was
cut off. `connect`, `Gateway::new` and `catch_up` are now written; the task lists every call with
its signature and makes the copy and the failing test the first actions. Task 15's comment is
rewritten one step per item. Both checked to fail, then pass when filled from their comments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 21:50:18 -07:00
kyle d1d8531495 gatewayd: deliver, turns on loop.sock and answers posted in their thread
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 21:34:34 -07:00
kyle 24cac6a4eb gatewayd: state, what was handled, our threads and turns in flight
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 21:23:49 -07:00
kyle fc32144048 gatewayd: sessions, routing posts to sessions, commands and the queue
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 21:17:17 -07:00
kyle 18fddd03d9 gatewayd: mm, Mattermost's events and REST calls, typed
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 21:04:00 -07:00
kyle 74e08a5b1a gatewayd: ws conn, messages, pings, closing and a dead peer
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 20:54:38 -07:00
kyle f649ca9e3d gatewayd: ws frames, a strict decoder and a masked encoder
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 20:50:00 -07:00
kyleandClaude Opus 5.5 02681069b6 M4a tasks 08 and 09: finer skeletons after task 08's session wrote nothing
Task 08's `header` was one todo!() with a dozen branches; Ornith planned it in its head until the
turn ran out (tip T25). `next_message` and `header` are now written as glue over seven small
helpers, and task 09's `poll` over four, each checked to pass when filled from its comments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 20:37:48 -07:00
kyle d56fcf8611 gatewayd: ws, the WebSocket error type and the opening handshake
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 19:55:22 -07:00
kyle 3a5b693878 gatewayd: http, requests over a stream with size caps and rate-limit waits
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 19:51:00 -07:00
kyle e8311aeb54 gatewayd: net, TCP or verified TLS to the Mattermost server
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 19:41:08 -07:00
kyle 608d426f95 gatewayd: secrets from a credential, the environment or a file; runbook entries
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 19:37:12 -07:00
kyle ede25312b3 gatewayd: config, gatewayd.toml into a checked Config
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 19:27:43 -07:00
kyle 64b34f48d6 gatewayd: dependencies for TLS and secrets; test-only certificates
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 19:17:51 -07:00
kyle 9fa8f0abed proto: sha1, for the WebSocket handshake check
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 19:15:01 -07:00
kyleandClaude Opus 5.5 0339dc13b2 Plan M4a: gatewayd in 15 tasks, with skeletons and given tests
Each task's tests were run against a reference at its end state; the end states were replayed
from master in order with the gate at each step (650 to 762 tests); each skeleton compiles
against its tests and fails them. The reference is kept off this machine. Lessons T27 (every
wait in a test has a limit) and T28 (mutate the reference before hand-over) come from this work.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 19:05:44 -07:00
kyleandClaude Opus 5.5 f38dc8d474 M4a spec: catch-up, recording and state writes, as settled while planning
Which channels are caught up (direct channels with allowed users, allowed channels; a new one
starts from now), what posts?since returns at v11.11.0 (changed posts, only those in `order`,
at most 1,000), that a post is recorded before it is acted on, that a failed state write stops
gatewayd, and that "interrupted" is posted on the first connection after a start only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 19:05:44 -07:00
kyleandClaude Opus 5.5 eab2fbdc55 Apply P15: secrets from a systemd credential, the environment or a file
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 17:43:08 -07:00