Commit Graph
193 Commits
Author SHA1 Message Date
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 75304b4e65 Ignore *.env: local secrets such as mattermost.env are never committed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 17:54:38 -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
kyleandClaude Opus 5.5 4a510fde08 M4a spec: approved, with a file-secret warning and multi-agent channels
A secret read from a file warns at startup. In allowed channels and group
messages, Boxmaker answers only posts that name it, or replies in its own
threads that name nobody else; one Boxmaker per machine, each its own bot.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 17:42:45 -07:00
kyleandClaude Opus 5.5 7e3783faae Specify M4a (conversations over Mattermost); propose P15 on secrets
M4 is split into M4a and M4b. The M4a spec rests on facts checked against
the owner's server and Mattermost's source at v11.11.0: the REST and
WebSocket shapes, and that clients will not post a message starting with
'/'. Records the design decisions, proposes P15 (secrets from a systemd
credential, the environment or an owner-only file), and adds the run-time
rows egress.md was missing since M2a and M3b.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 17:30:31 -07:00
kyleandClaude Opus 5.5 f0ec0efe9d CLAUDE.md: M3a finding 14 was closed by M3b task 02
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 16:43:07 -07:00
kyleandClaude Opus 5.5 8bcdb25ff1 Merge m3b: the runner and the tools (M3b)
Tasks 01 to 17 by Ornith, the review, and the design model's fixes to the
plan. Tool containers run from a Nix-built image named by digest; checked on
straylight.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 16:42:22 -07:00
kyleandClaude Opus 5.5 a43362edb4 Review M3b tasks 14 to 17: accept; M3b done
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 16:42:22 -07:00
kyle 9662966b45 toolkit: no thread panic in http_fetch, no casts, exact egress-proxy form
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 16:13:43 -07:00
kyle e69ba632e6 brokerd: escape container errors in the log; prefix and quote two messages
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 16:10:54 -07:00
kyle 93539dbead brokerd: start pipe threads safely and collect output within a grace period
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 16:07:15 -07:00
kyle c87aff0793 brokerd: move the container's pipe handling into pipes.rs 2026-09-23 15:59:44 -07:00
kyleandClaude Opus 5.5 a57a1305e7 M3b plan: follow-up tasks 14 to 17 for the review's lower findings
14 moves the pipe handling out of container.rs (a pure move, replayed on its
own); 15 starts threads with Builder and bounds output collection with a 2 s
grace period; 16 escapes container errors in the log and fixes two texts; 17
fixes toolkit's thread start, casts and the egress-proxy form. Each checked
against a reference, which is not kept. Tips T24 to T26 from this run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 15:33:23 -07:00
kyleandClaude Opus 5.5 c3aaecdae2 M3b review fixes by the design model: curl --globoff, podman --pull=never
Review findings 1 and 2, both plan defects. curl gains --globoff and a
leading --disable; both podman runs gain --pull=never. The given fetch.rs and
the six golden files change with them. Checked on straylight with a rebuilt
image: a glob URL is one request, a missing image fails at once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 15:25:51 -07:00
kyleandClaude Opus 5.5 75c2f1adbf Review M3b: accept with follow-ups; add the Nix expression for the image
On straylight, with real containers from deploy/tools-image.nix, every claim
held: no network without a grant, the limits, the file tools, http_fetch's
host checks including a redirect and a tailnet name, and no leftovers. Two
plan defects found there (curl globbing, podman pulling a missing image),
five lower findings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 11:48:31 -07:00
kyle feb50abc88 brokerd serve: run tools in containers when [runner] is set
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 09:35:46 -07:00
kyle e6081a2177 brokerd: start and remove the egress proxy for http_fetch
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 09:22:24 -07:00
kyle cfe13787b0 brokerd: the Podman runtime
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 08:51:44 -07:00
kyleandClaude Opus 5.5 4a1c6fa0a5 M3b plan: task 11's skeleton writes run as glue over small helpers
The third attempt filled five functions, then ran out of room planning all of
run in one turn. run and run_container are now given; spawn, Io::start,
Io::finish and answer are small todo!()s. Checked fillable: 11 of 11 passed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 08:36:00 -07:00
kyleandClaude Opus 5.5 62d1da44d6 M3b plan: task 11 starts from a compiling skeleton of container.rs
Two sessions ended with nothing written, each out of room while planning the
whole file in one turn. The skeleton has the signatures, the constants and
the steps as comments; the task says to fill one function at a time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 07:34:14 -07:00
kyleandClaude Opus 5.5 4458369d64 M3b plan: task 11 gives Podman::egress_dir(), so the field is read
Without it the field was never read in task 11, clippy's dead_code failed the
gate, and #[allow] is forbidden; the implementer stopped on the dilemma.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 07:16:56 -07:00
kyle 49ac8d72d2 brokerd: the podman argument lists
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 01:13:25 -07:00
kyle 81ce5a3345 brokerd: the [runner] section
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 01:07:21 -07:00
kyle 95872d94b8 toolkit: the egress proxy
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 01:01:13 -07:00
kyleandClaude Opus 5.5 e87d876f26 M3b plan: task 08 says not to join handler threads and to skip argv[0]
The first attempt at task 08 did both and stopped without a commit. Also asks
the implementer to debug inside the repository, since OpenCode refuses /tmp.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 00:46:23 -07:00
kyle 74da0c9d96 toolkit: is_public, the addresses the egress proxy may reach
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 00:19:18 -07:00
kyle adf6713866 toolkit: http_fetch through curl
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 00:14:16 -07:00
kyle ac1ecacadc toolkit: shell
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 00:06:44 -07:00
kyleandClaude Opus 5.5 5e55fe4c66 M3b plan: every task's git add includes Cargo.lock
Task 04 added dependencies to toolkit and its git add line left out the lock
file, so the driver stopped on an unclean tree. The lock change is folded into
task 04's commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 00:00:12 -07:00
kyle 0d444dd5bf toolkit: the tool program, read_file and write_file
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-23 00:00:03 -07:00
kyle 644fda14da Refuse grant paths that cannot be mounted
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-22 23:06:09 -07:00
kyle bf9e79ac21 Seal the fetch target: one value holds the URL and its host
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-22 23:03:49 -07:00
kyle f095cca1ee Move the tools' arguments and the host rules to proto
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-22 22:59:40 -07:00
kyleandClaude Opus 5.5 655683c9e0 Apply P13: tool containers run from one Nix-built image named by digest
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 22:30:04 -07:00
kyleandClaude Opus 5.5 b426ca1958 Specify and plan M3b: the runner and the tools
A draft spec for the owner's review and 13 offline tasks with their given
tests: shared tool arguments and host rules in proto, the sealed fetch
target (M3a finding 14), the toolkit tools and SOCKS5 egress proxy, and
brokerd's [runner], podman argument lists, runtime and proxy lifecycle. Each
task's tests were run against a reference at that task's end state (560 to
638 tests, clippy clean); the reference is not in the repository. Adds the
runner-unavailable runbook entry and tip T23 (ETXTBSY in script tests).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 22:29:27 -07:00
kyleandClaude Opus 5.5 d988edac4a Implementer log: record which model did each M3a task; repair the rows
Models from the owner: Ornith for tasks 01 to 18, Ornith then Grok 4.6 for
19, Grok 4.6 for 20 to 22. Future and late dates set to the commit dates;
notes pasted into the wrong rows moved back; every row has eight cells.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 22:01:14 -07:00
kyleandClaude Opus 5.5 6b9bd7f5f0 CLAUDE.md: M3a is done; M3b next; the new slot layout
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:55:27 -07:00
kyleandClaude Opus 5.5 aafd9f930e Merge m3a: brokerd's decision path (M3a)
Tasks 01 to 22, the review, and task 23 (the review fixes, with a second,
independent review of them). The one conflict, docs/implementer-lessons.md,
had the same T18 and T19 on both sides; m3a's T20 to T22 follow them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:55:11 -07:00
kyleandClaude Opus 5.5 f0b39a4766 Record the second review of task 23 and the findings first left out
The review table gains findings 16 to 20, which the two review agents
reported and the first write-up dropped. The independent review of the fix
commits, and what was changed for it, is recorded; task 23's claims about
its tests are corrected. The spec and decisions record the day-long cap, the
ttl_ms bound, the socket-directory rule and the listener's retry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:54:28 -07:00