CLAUDE.md: memoryd and the M5 split

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-24 13:12:38 -07:00
co-authored by Claude Opus 5.5
parent d1c106dd5c
commit 174bdc05b2
+10 -5
View File
@@ -17,7 +17,9 @@ M4 is split: M4a (`gatewayd`, conversations over Mattermost, spec
and checked end to end against the owner's Mattermost; no finding is open. M4b (approvals over
Mattermost, spec `docs/specs/2026-09-24-m4b-approvals.md`, 18 tasks) is done and merged, reviewed
in `docs/implementer-log.md` and checked end to end against the owner's Mattermost, including an
approval asked by a non-approver; no finding is open. Branches land on master by rebase and
approval asked by a non-approver; no finding is open. M5 (memory, then the scheduler) is split into
M5a, M5b and M5c by P17 to P20 (applied 2026-09-24); the M5a spec is next. The owner's Honcho client
`roncho` is on titan, not on this machine. Branches land on master by rebase and
fast-forward, never a merge commit. The owner's Mattermost settings and the
bot's token are in `mattermost.env` at the repository root: ignored by git, never committed, and
the token is never printed.
@@ -62,15 +64,18 @@ requests, check `GET /slots?model=ornith-1.5-35b-a3b` so you do not evict someon
runs `brokerd`, `loopd` and an approval end to end against it.
- `bxctl` is the owner CLI: `bxctl chat` talks to a running `loopd serve --config <path>`;
`bxctl approvals`, `approve`, `refuse`, `grants check` and `audit verify` talk to `brokerd serve`
(or read the audit log directly); `bxctl reindex` comes in M5. `gatewayd serve --config <path>` is the
(or read the audit log directly); `bxctl reindex` comes in M5a. `gatewayd serve --config <path>` is the
Mattermost channel (M4a).
## Architecture in brief
Separate binaries in one Cargo workspace. Each role holds as little authority as possible:
- `loopd` owns sessions, prompt assembly and memory. It has no credentials and no network. Its
only I/O is Unix sockets to `gatewayd`, `brokerd` and `inferproxy`.
- `loopd` owns sessions and prompt assembly. It has no credentials and no network. Its only I/O
is Unix sockets to `gatewayd`, `brokerd`, `inferproxy` and (from M5a) `memoryd`.
- `memoryd` (M5) owns memory: `memory/soul.md`, `memory.md`, `user.md`, `archive.md`, the FTS5
index, and from M5b the sync to the fleet's Honcho. It runs memory tool calls `brokerd` has
decided, and reaches Honcho and nothing else.
- `brokerd` is the only place authority lives. It reads owner-written grants (it cannot write
them), runs each approved tool call in a fresh rootless container, and writes a hash-chained
JSONL audit log.
@@ -104,7 +109,7 @@ its KV cache, so any change to an earlier byte of the prompt forces an expensive
found with `find_tool` and called through the `call_tool` meta-tool. Never prompt the model to
call an undeclared tool: the server's grammar forces the call into a declared one.
- Tool results are size-capped when first appended and never trimmed later.
- The baseline (system prompt, tool schemas, `memory/core.md`) stays at 3,000 tokens or less,
- The baseline (system prompt, tool schemas, the three memory files) stays at 3,000 tokens or less,
measured with the server's tokenizer.
- Compaction happens only when the session is idle, and starts a new epoch
(`sessions/<id>/<epoch>.jsonl`). Old logs are kept.