memoryd: the Honcho worker sends conclusions, their deletions and fleet notes

Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
2026-09-28 13:11:51 -07:00
co-authored by ornith-1.5-35b-a3b
parent 4ebfc36c1a
commit fb05b26462
9 changed files with 790 additions and 121 deletions
+1
View File
@@ -6,6 +6,7 @@ reviewer adds findings under "Reviews" once per milestone.
| Task | Date | Status | Gate runs | First gate | Deviations | Notes | Model |
|---|---|---|---|---|---|---|---|
| M5c1/13-memoryd-honcho-edits | 2026-09-28 | done | 1 | pass | none | Copied the given files from `docs/plans/M5c1/files/`: the test `crates/memoryd/tests/honcho_edits.rs` (from `honcho_edits.rs-task13`), new versions of `crates/memoryd/tests/honcho_worker_more.rs` (from `honcho_worker_more.rs-task13`) and `tests/support/honcho.rs` (from `support/honcho.rs`), and the skeletons `crates/memoryd/src/honcho/edits.rs` and `crates/memoryd/src/honcho/start.rs` (given whole). Step 2 showed exactly the named failure: `honcho_edits` with one E0432 (`unresolved import memoryd::honcho::edits`); every other target compiled; `honcho_worker_more` 10, `honcho_client` 13, `honcho_worker` 12 passed. Made H1 (`pub mod edits;` after `pub mod decide;` in `honcho/mod.rs`), H2 (`pub mod start;` after `pub mod naming;`), C1 (`owner: String` field in `Clients`), C2 (`owner: config.owner.clone()` in `Clients::new`) and C3 (`ensure_memory_session`: ensure workspace, the agent's peer, the owner's, then the `<id>_memory` session with both peers `observe_me(false) observe_others(false)`); copied the two skeletons. `cargo check -p memoryd` gave 22 warnings (six unused imports, sixteen unused variables, exactly the task named). Filled its five bodies in the order of the file, deleting each instruction comment and keeping the doc comments, each from its comment and `cargo check` after: `memory_session` (`format!("{}{MEMORY_SUFFIX}", session.as_str())`); `conclude` (`memory_session`, `ensure_memory_session`, `ConclusionCreate::new(neutralise(text), peer, peer).with_session_id(name)` in `ConclusionBatchCreate::new(vec![..])`, `create_conclusions` -> the ids); `unconclude` (`Some(id)` -> `delete_conclusion` then `vec![id]`, `None` -> `Vec::new()`); `fleet_batch` (`Map` metadata `agent`/`boxmaker_session`/`edit`, `parts(neutralise(text))` each `MessageCreate::new(part, agent)` with the metadata); `fleet` (`HonchoSession { name: session id, speakers: [] }`, `ensure_session(Fleet, ...)`, `add_messages` -> the ids). `cargo check` clean. Made W1 (imports: drop `Config`/`Timeouts`/`HonchoConfig`/`mirror`/`state`/`LEDGER`/`read_log`/`StartError`, add `edits`, re-export `start::{Opened, open, spawn}`); W2 (`Job` enum `Turn`/`Conclude`/`Unconclude`/`Fleet`, `Next` holds `item`/`workspace`/`job`); W3 (`label` naming a turn or a part); W4 and W5 (the two log lines use `label(&next.item)`); W6 (`next` matching every `(Item, Action)` pair into a `Job`, `send` dispatching and `send_turn` split out); W7 (the start code removed, it moves to `start.rs`). `cargo check -p memoryd` clean, `worker.rs` 486 lines. Step 6 all pass: `honcho_edits` 10, `honcho_worker_more` 10, `honcho_worker` 12, `honcho_client` 13, `honcho_keys` 3, `honcho_mirror_serve` 6, `honcho_serve` 6. Step 7: `fn open`/`fn spawn` both in `start.rs`, no `Action::Retract` in `worker.rs`, the other-crates `git diff --stat` empty. `cargo fmt --all`; `make gate` printed `gate: ok` with 1324 tests (1313 in `cargo test --workspace`, plus the 10 in `honcho_edits.rs` and the 1 ignored `end_to_end` the gate runs separately). No new dependency, so `Cargo.lock` is unchanged. | ornith-1.5-35b-a3b |
| M5c1/12-memoryd-honcho-mirror | 2026-09-28 | done | 3 | pass | none | Copied the two given tests from `docs/plans/M5c1/files/crates/memoryd/tests/`: `honcho_mirror.rs` (from `honcho_mirror.rs-task12`) and `honcho_mirror_serve.rs` (from `honcho_mirror_serve.rs-task12`), and the skeleton `crates/memoryd/src/honcho/mirror.rs`. Step 2 showed exactly the named failures: `honcho_mirror` with one E0432 (`unresolved import memoryd::honcho::mirror`); `honcho_mirror_serve` 1 pass (`without_honcho_nothing_is_decided`) and 5 fail. Made H1 (`pub mod mirror;` after `pub mod ledger;` in `honcho/mod.rs`) and copied the skeleton; `cargo check` gave 24 warnings (unused `Kind` and `Workspace`, and the twenty unused variables the task named). Filled its seven bodies in the order of the file, deleting each instruction comment and keeping the doc comments, each from its comment and `cargo check` after: `diff` (`minus(before, after), minus(after, before)`); `minus` (a `left` of `b`'s refs, keep a `text` when `left.iter().position` is `None`, else `swap_remove` that occurrence then drop it); `notes_of` (`flat_map` `notes::parse` over `record.notes`); `session_of` (walk the `undoes` chain bound by `records.len()`, return `SessionId::new` when the session is not `OWNER`, else follow `undoes` and `None` when it or the id is missing); `conclusion` (`Conclude` in the trusted workspace with the session, or `Skip` with `NO_SESSION`); `identity_actions` (`moved` notes' texts filtered out of the diff's dropped side as `Unconclude`, the added side each `conclusion` about the owner for `user.md` else the agent); `note_actions` (`Skip` `flagged: <rule>` when flagged, else each `noted` note, `Fleet` when untrusted with a session else `Skip` without one, else a conclusion about the agent). The `before` block for W2 (`use crate::honcho::naming::{HonchoSession, honcho_session}`) was rustfmt-ordered `{honcho_session, HonchoSession}` in the tree, so I anchored on that actual line. Made T1-T8 (the ledger's own `Arc<Mutex<Ledger>>` in `TurnSync`, `ledger()` returning a `MutexGuard`, the new `shared_ledger()`, and every `self.ledger` call going through it), W1-W9 (the worker takes `self.ledger` and a `sessions` field of its own, `Opened` gains `owner` and `mirror()`), and S1-S7 (`Memoryd` gains `mirror: Option<Mirror>`, `start` builds it from `opened.mirror()`, and `memory` calls `self.mirror(Some(&id))` after `journal::record`, `admin` calls `self.mirror(None)` after an undo or accept). `cargo check` clean with no warning; `honcho_mirror` 8, `honcho_mirror_serve` 6, and every earlier suite pass. `make gate` printed `gate: ok` with 1314 tests (1300 before plus the 14 new). No new dependency, so `Cargo.lock` is unchanged. | ornith-1.5-35b-a3b |
| M5c1/11-memoryd-honcho-worker | 2026-09-28 | done | 1 | pass | none | Copied the four given files from `docs/plans/M5c1/files/`: the tests `crates/memoryd/tests/honcho_worker.rs` and `honcho_worker_more.rs` (from `honcho_worker_more.rs-task11`), a new version of `crates/memoryd/tests/honcho_serve.rs` (from `honcho_serve.rs-task11`, replacing the tree's) and the support `crates/memoryd/tests/support/worker.rs` (from `worker.rs-task11`), then the skeleton `crates/memoryd/src/honcho/worker.rs`. Step 2 showed exactly the named failures: `honcho_worker` with three (E0432 for `memoryd::honcho::worker` in the test and in `support/worker.rs`, E0599 for the missing `resume` on `TurnSync`); `honcho_worker_more` with four (the same three plus E0599 for the missing `Secret` on `StartError`); every other target compiled and `honcho_serve` passed its 6 already. Made D1/D2 (`user_text`/`final_reply` `pub` in `decide.rs`), H1 (`pub mod worker;` after `pub mod turns;` in `honcho/mod.rs`), T1 (`sessions` in `impl TurnSync`), T2 (`resume` walking `decisions` deduped by id then reading each log, and `append` delegating to `ledger.append` before `updated`'s doc), T3 (`updated` calling `self.retry` then the new `retry`), S1 (imports: drop `Ledger`, add `worker::{self, Wake}`), S2 (`Memoryd` holds `Arc<Mutex<TurnSync>>` and a `wake`), S3 (`StartError::Secret(String)`), S4 (the `Display` arm), S5 (`start` calling `worker::open`), S6 (`wake` built and `worker::spawn` bound after the sockets), S7 (`wake` in the `Memoryd`), S8 (`decide_turns` dropping the lock then `wake.notify()`), M1 (`main.rs` matching both `Ledger` and `Secret`). Filled its eleven bodies in the order of the file, deleting each instruction comment and keeping the doc comments, each from its comment and `cargo check` after: `notify` (lock, set flag, `notify_one`); `wait` (lock, `wait_timeout_while(..., |woken| !*woken)`, clear the flag); `parts` (collect `chars`, `chunks(MAX_PART)`); `read_turn` (`read_log` ok, `turn_records`, `user_text`, `final_reply`, both `to_string`); `batch` (a `Map` with `agent`/`boxmaker_session`/`turn` in order, then for each of `(text,speaker)`/`(reply,agent)` the neutralised `parts`, each a `MessageCreate` with the metadata); `ids` (`m.id.clone()`); `next` (lock, `outbox().find_map`, `Item::Turn` and `Action::Turn` by `let .. else`, skip when `refused.contains(workspace)`, build `Next` with `honcho_session`); `unreachable` (the `outage` match, log the start once, double-and-cap the wait, `Backoff`); `recovered` (`outage.take()` ends it, log once, `retry`); `retry` (lock, `sync.retry`); `record` (`append`, `Ok` -> `Done`, `Err` logs with `ledger::RUNBOOK`, sets `stopped`, `Stopped`). After the last body `cargo check -p memoryd` is clean with no warning. Step 5 all pass: `honcho_worker` 12, `honcho_worker_more` 10, `honcho_serve` 6, and every unchanged suite. Step 6 all pass: the `thread::spawn`/`Builder::new` grep prints one line in `spawn`, the three runbook-pointer greps print the three constants, and the other-crates `git diff --stat` is empty. Appended the three runbook fragments (`runbook-honcho-unreachable`, `-send-refused`, `-key-refused`) with `{ echo; cat ... } >>`; `grep -c '^## honcho-'` printed 5. `make gate` printed `gate: ok` with 1300 tests (1299 in `cargo test --workspace`, plus the 1 ignored `end_to_end` the gate runs separately). No new dependency, so `Cargo.lock` is unchanged. | ornith-1.5-35b-a3b |
| M5c1/10-memoryd-honcho-client | 2026-09-28 | done | 1 | pass | none | Copied the given files from `docs/plans/M5c1/files/`: the tests `crates/memoryd/tests/honcho_client.rs`, `honcho_keys.rs` and `honcho_naming.rs` (from `honcho_naming.rs-task10`) and the support `crates/memoryd/tests/support/honcho.rs` (from `honcho.rs-task10`), and the directory `crates/memoryd/tests/fixtures/honcho/` (30 files, 29 JSON and a README). Step 2 showed exactly the named failures: three test targets (`honcho_client`, `honcho_keys`, `honcho_naming`) with E0432 for the `memoryd::honcho::client` and `...::naming` imports and E0599 for the missing `decisions` method on `Ledger`; every other target compiled. Made H1 (`pub mod client;` and `pub mod naming;` in `honcho/mod.rs`, the former first so the imports resolve and the latter last to keep the alphabetical order) and L1 (the `decisions` method before `outbox`, walking `order` with `.iter().filter_map` returning `(item, &self.entries.get(item)?.action)` for every decided item, `Skip` included), then copied the two skeletons; `cargo check` gave 26 warnings (unused `json`; unused `PeerCreate` and `WorkspaceCreate`; unused variables `workspace` five, `session` twice, the rest once each; the three `Clients` fields never read; the `Ensured::Workspace` and `Peer` variants never constructed). Filled its thirteen bodies in the order of each file, deleting each instruction comment and keeping the doc comments, each from its comment and `cargo check` after: in `client.rs` `kind` (one arm for the two `{ kind, .. }` variants, `"key-refused"` for `KeyRefused`), `status` (the two `{ status, .. }` arms, `Some(*status)` for `KeyRefused`), `fleet_configuration` (`Map::new`, insert each of `reasoning`, `summary`, `dream` -> `{ "enabled": false }`), `session_peers` (agent `observe_me(false)`, each speaker `observe_me(true)`), `created` (`Ok` and a `Refused` 409 are success), the free `client` (chain `.without_config_file()`, `.base_url`, `.workspace_id`, the two timeouts, `.api_key` only when there is a key, `.build()`), `key` (`config.keys.get(name)` else `None`, `secrets::load`, extend the warnings, return the secret), `Clients::client` (match the workspace to its field), `ensure_workspace` (the fleet one with `fleet_configuration`, the other two with defaults, remembered), `ensure_peer` (the agent's peer with `observe_me(false)`, remembered), `delete_conclusion` (Ok and a 404 are done); in `naming.rs` `session_name` (the id for `count <= 1`, `<id>-<count>` otherwise) and `honcho_session` (walk `decisions`, keep each `Turn` of the session's speakers each counted once in decision order, return when the turn-th is reached, else `None`). After the last `cargo check` is clean with no warning; `cargo test -p memoryd --test honcho_client --test honcho_keys --test honcho_naming` gives 13, 3 (one ignored, run by the third) and 5 pass. Step 6 all pass: `without_config_file` counts once, `expose()` appears once in the free `client`, the other-crates `git diff --stat` is empty. `make gate` printed `gate: ok` with 1278 tests (1257 before this task, plus the 21 new: 13, 3 and 5). No new dependency, so `Cargo.lock` is unchanged. | ornith-1.5-35b-a3b |