Commit Graph
92 Commits
Author SHA1 Message Date
kyleandClaude Opus 5 ed8cf49540 M3a task 01: copy a strict.rs of its own
The strict.rs in files/ is the merged one and walks task 02's new wire
fixtures, so task 01's gate could not pass; the first run stopped on it.
Task 01 now copies area A's version, checked to give 3 and 5 passed at
task 01's end state.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 12:07:59 -07:00
kyleandClaude Opus 5 0703306e19 Record that the M3a plan is ready, and how it was checked
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 23:45:43 -07:00
kyleandClaude Opus 5 e3f37da232 Hand over the M3a plan: 22 tasks, their files, and the check record
Task files, the files they copy in (byte-identical to the reference on
m3a-ref), each area's check record, and a README with the per-task
table of what each check exposed. The handoff note is done with.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 23:45:43 -07:00
kyleandClaude Opus 5 69f0a0a218 M3a spec: fold in area E's findings; runbook and egress to match
Every request is recorded, unreadable state is recorded as secret, a
refusal that cannot be recorded is an error, and the other cases the
brokerd reference settled. The audit-unavailable and
broker-state-damaged entries name the new messages; egress lists the
development calls to straylight.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 23:40:02 -07:00
kyleandClaude Opus 5 43f5b8abc6 M3a spec: fold in the defects the plan's checks found in areas A to D
DecisionRecord's empty struct variants, the verifier's report fields and
region rule, the startup fallback, the IPv4 host rule, Denial, BrokerPort
deadlines and envelope id, the runbook anchor rule, bxctl's --say/--json
and escaping. Recorded in docs/decisions.md; the array-form question is
left open.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 23:09:32 -07:00
kyleandClaude Fable 5.1 b39dac3f71 Hand off the half-built M3a plan
Areas A to D (audit, policy side, loopd, bxctl) are written on branches
in ~/src/boxmaker-ref-a to -d; area E (broker and approval handoff) is
not started. HANDOFF.md records each area's result, the contract
conflicts between them, the spec defects they found and the remaining
steps in order.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 23:00:21 -07:00
kyleandClaude Fable 5.1 66fa143524 M3a spec: a ledger module and a two-process end-to-end test
Both came out of planning the tasks. The three locked steps need a home
that is neither the connection handler nor the pending table. The
one-process end-to-end test would have made loopd dev-depend on
brokerd, which the crate-dependency gate forbids.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 22:36:55 -07:00
kyleandClaude Fable 5.1 1008dce351 Decide where reference implementations are still written
From M3a: a full reference for the audit chain and the approval
handoff, the property test's oracle for policy, and compiling
skeletons for everything else. Each plan records what its checks
exposed, and that record decides what the next milestone gets.
Tip T17; the spec's handover section says which check each module has.

Also restores three / examples that an editing tool had decoded
to a plain slash.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 22:28:53 -07:00
kyleandClaude Fable 5.1 0ee375dd03 Record the open M4 decision on approvals too long for one post
Settled: what is being approved is never truncated. Leading option for
Mattermost is a thread of numbered chunks approved on the last post.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 22:23:54 -07:00
kyleandClaude Fable 5.1 9dcb16ff30 Apply P14: the brief's State list names brokerd's session state
broker/sessions/<id>.json holds each session's taint and untrusted
flag. It is written only by brokerd and can be rebuilt from the audit
log's result records.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 22:22:18 -07:00
kyleandClaude Fable 5.1 477e28a759 Close the remaining M3a spec review findings
brokerd internals: the ledger lock over the audit writer and session
state, the pending table's take-it-and-answer rule, sticky
audit_unavailable after a failed write, pure policy functions with an
Ask type that only redecide turns into a Decision, how a waiting
thread detects a lost connection without peek, fixed RunError text.

Approvals: bxctl chat fetches the block from brokerd by id, shows the
parsed arguments with invisible and bidi characters escaped, asks for
the approval id instead of y, and escapes model text. A tool_denied
event carries the reason to the owner.

Also: BrokerPort timeouts, tests for runbook pointers and concurrency,
threat-model notes, P14 for broker/sessions in the brief's State list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 22:18:13 -07:00
kyleandClaude Fable 5.1 3492734434 Fix seven M3a spec review findings in policy and the audit chain
Policy: a deny grant must apply at every taint; a result's label is
combined over all matching grants and the longest matched path wins
within a mode; a grant of / is invalid.

Audit: a recovered line need not fail to parse; the writer never goes
back to an earlier day's file; --accept-break verifies the whole log
and the break record's fields are all checked, with a seq counted from
lines; the Approval record carries the re-decision's grant and state;
calls with no Result are reported.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 22:13:28 -07:00
kyleandClaude Opus 5 180ef28833 Specify M3a (the decision path) and write the runbook
Split M3 into M3a and M3b, record the M3 design decisions, propose P13
(tool image built by Nix, named by digest), and add docs/runbook.md with an
entry for every fail-closed state, including loopd's existing ones.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 21:57:21 -07:00
kyleandClaude Opus 5 92a57f6350 Review M2b task 11: accept; M2b done
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 21:10:34 -07:00
kyle c060c80c7e Fix four review findings: busy release, poison recovery, core.md errors, chat loop
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 21:06:58 -07:00
kyleandClaude Fable 5.1 2be8581a0c Review M2b: accept with one follow-up task; record lessons
All ten tasks pass the checklist, the gate, the audit and the device
checks, including a four-turn conversation with a loopd restart and no
cache loss. Reading and probing found four low defects: the busy guard
is released before the final frame on the main path but not on the
three error paths, its Drop skips a poisoned lock, an unreadable
core.md is treated as missing, and bxctl's interactive loop exits on a
failed turn. Task 11 carries the fixes with two new tests, checked
against a fixed copy of the branch.

The Model column is filled in (all Ornith) and one malformed row is
repaired. Two rules are promoted to AGENTS.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 20:47:03 -07:00
kyle 34951084cc Extend on-device verification to the agent loop
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 20:38:56 -07:00
kyle 06cda69509 Add bxctl chat
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 20:24:26 -07:00
kyle eb8fc5f920 Add the loopd serve command
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 19:50:32 -07:00
kyle 8bc835f623 Add the channel server on loop.sock
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 19:43:12 -07:00
kyle 9063cf958e Add the turn loop with its limits
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 19:14:52 -07:00
kyle 9704a64507 Add the session store: baseline file and append-only log
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 18:42:00 -07:00
kyle b152ba3cd3 Add the baseline and the log replay function
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 18:31:33 -07:00
kyle fd7ade9689 Add the tool port, registry, dispatch and the fake tools
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 18:12:45 -07:00
kyle ec5d887daa Add the paths, channel, loop and baseline config tables
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 17:36:20 -07:00
kyle 06298d6a8e Add the channel messages and the usage record to proto
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 17:30:51 -07:00
kyleandClaude Fable 5.1 e156975649 Add M2b plan: ten tasks, tests, recordings and the first system prompt
The tasks build the agent loop on M2a's client: channel messages and
the usage record in proto, four config tables, the tool port and
registry with find_tool and call_tool, the baseline and replay, the
session store, the turn loop with its limits and the append-only
property test, the channel server, loopd serve, bxctl chat, and the
device checks including a four-turn conversation with a restart.

Checked against a private reference implementation: the gate passes
after every task in order, the new suites pass under CPU load, and the
reference passes make verify-device on straylight with no cache loss.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 17:19:02 -07:00
kyleandClaude Fable 5.1 f238e6a260 Add M2b design spec: the agent loop
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 16:45:41 -07:00
kyleandClaude Fable 5.1 afe25f0bc9 Accept M2a follow-ups; M2a complete
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 16:26:13 -07:00
kyle 0f5213a466 Return chunked body data as soon as it is available
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 16:15:22 -07:00
kyle 1faa38be44 Close the client side when the upstream closes, in inferproxy
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 16:07:45 -07:00
kyleandClaude Fable 5.1 58c7738721 Review M2a: accept with two follow-up tasks; record models and lessons
The branch passes every check, including make verify-device on
straylight and repeated timing runs under load. Reading and probing
found that inferproxy does not pass an upstream close on to a client
that is still sending, and that the chunked body reader delivers a
stream only when the caller's buffer fills or the stream ends. Both
were also gaps in the tasks and tests, so tasks 14 and 15 carry the
fixes with new tests checked against the reference.

The Model column is corrected: tasks 04 to 06 and 08 to 13 were Ornith.
Lessons gain four implementer tips and five task-writing tips; three
rules are promoted to AGENTS.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 15:43:06 -07:00
kyle ad7bce88a4 Add on-device verification for the inference path
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 15:32:20 -07:00
kyle f1d880568f Add the startup self-test and the loopd selftest command
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 15:28:37 -07:00
kyle 59cf89e7ba Add the per-slot gate and chat_with_retry
Implemented SlotGate (one request in flight per server slot, FIFO queue,
bounded) and chat_with_retry (retry only server-gone errors, jittered
backoff within a window and attempt budget). chat acquires the gate and
maps GateFull to Busy; Client gained a gate field.

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 14:45:45 -07:00
kyle a07c341cbb Add the thinking cap to Client::chat
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 14:06:11 -07:00
kyle 60557a0634 Add Client::chat with the first-byte wait, liveness and error mapping
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 13:37:01 -07:00
kyle 3663a1e4d5 Add props, slots, tokenize and the cache-loss check to the llama client
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 03:39:05 -07:00
kyle 0fa481df29 Add the per-slot gate and chat_with_retry
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-18 03:19:02 -07:00
kyleandClaude Fable 5.1 cce1c99570 Record which model did each task
The implementer log gains a Model column, filled by the owner. Tasks so
far: M1 and M2a 01 to 06 by Laguna S 2.1, M2a 07 by GLM-5.3. The commit
trailer no longer names a model.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 02:56:38 -07:00
kyle 3d876d4fa9 Add the assembler that folds streamed chunks into a completion
Implemented-By: GLM-5.3 (z.ai, default settings) via OpenCode
2026-09-18 02:56:31 -07:00
kyle f48999306e Add the llama client types and the chat request builder
Implemented-By: Laguna S 2.1 (OpenCode)
2026-09-18 02:40:35 -07:00
kyle f58c29e707 Add a server-sent-events reader to loopd
Implemented-By: Laguna S 2.1 (OpenCode)
2026-09-18 02:31:49 -07:00
kyle 4460bb241a M2a/04-loopd-http
Implemented-By: Laguna S 2.1 (OpenCode)
2026-09-18 02:11:25 -07:00
kyle 6e8e24794d Add loopd configuration with every M2a limit
Implemented-By: Laguna S 2.1 (OpenCode)
2026-09-17 23:07:38 -07:00
kyle a0495ea36a Add the inferproxy byte forwarder with its two limits
Implemented-By: Laguna S 2.1 (OpenCode)
2026-09-17 21:03:41 -07:00
kyle bc1e727c19 Add SHA-256 to proto, wrapping the emsha crate
Implemented-By: Laguna S 2.1 (OpenCode)
2026-09-17 14:11:51 -07:00
kyleandClaude Fable 5.1 db0ba081db Add tools/run-plan.sh to run a plan's tasks in fresh OpenCode sessions
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 14:02:49 -07:00
kyleandClaude Fable 5.1 76ccc251cd Add M2a plan: thirteen tasks, tests, fake server and recordings
The tasks build the inference path: emsha-backed SHA-256, inferproxy,
config, a hand-written HTTP and SSE client, request building, delta
assembly, the chat state machine, the thinking cap, the slot gate with
retry, the startup self-test and on-device verification.

Everything the tasks copy in was checked against a private reference
implementation: the gate passes after each task in order, the timing
tests pass repeatedly under CPU load, and the reference passes the
self-test and all four device checks on straylight. Expected results
for the recorded streams were derived by a separate script.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 13:34:11 -07:00
kyleandClaude Fable 5.1 a49db39b54 Brief: add a one-sentence purpose for every role and crate
Requested by the owner so that future readers, agents included, learn
what each piece is for first. No behaviour changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 13:00:21 -07:00