docs: M5d-1 checklist fixes before hand-over
Given tests: Action::Turn (not To), send_turn of epoch 1, clippy on
compact_summary, jsonl-without-baseline, live turn after compact sends
the carry. send_turn maps Damaged to Local("log") as read_turn did.
Gate counts 1484 → 1508. Mutations recorded in the README.
Co-Authored-By: Grok 4.6 <noreply@x.ai>
This commit is contained in:
@@ -20,7 +20,7 @@ decided and sent.
|
||||
| Place | What happens there |
|
||||
|---|---|
|
||||
| `crates/memoryd/src/honcho/turns.rs` | `epoch_logs`; `read_session`; `records` and `resume` use it |
|
||||
| `crates/memoryd/src/honcho/worker.rs` | `send_turn` reads the concatenated log |
|
||||
| `crates/memoryd/src/honcho/worker.rs` | `send_turn` reads the concatenated log (W1–W3) |
|
||||
| `crates/memoryd/tests/honcho_epochs.rs` | new, given |
|
||||
| everything else | **no change**: not `log_path`'s return value, not `decide.rs` |
|
||||
|
||||
@@ -45,7 +45,9 @@ decided and sent.
|
||||
stable.
|
||||
- **`send_turn` today** calls `read_turn(&log_path(...), turn)`, which only sees epoch 0. After
|
||||
this task it loads `read_session`, then `turn_records` / `user_text` / `final_reply` from
|
||||
`crate::honcho::decide` (already `pub`).
|
||||
`crate::honcho::decide` (already `pub`). `read_turn` maps a damaged line to `Ok(None)` (the
|
||||
turn is marked failed, kind `log`). Keep that: `LogError::Damaged` is `Unsent::Local("log")`;
|
||||
an I/O error stays `Unsent::Unreadable` and is retried.
|
||||
- `turns.rs` after this task stays under 500 lines (it is 332 now).
|
||||
- The items the edits use. This table is complete.
|
||||
|
||||
@@ -159,7 +161,7 @@ becomes
|
||||
|
||||
```rust
|
||||
use crate::honcho::decide::{final_reply, turn_records, user_text};
|
||||
use crate::honcho::turns::{TurnSync, log_path, read_session};
|
||||
use crate::honcho::turns::{LogError, TurnSync, log_path, read_session};
|
||||
```
|
||||
|
||||
**W2.** The body of `send_turn`, the lines
|
||||
@@ -180,6 +182,7 @@ become
|
||||
self.readable(&path);
|
||||
records
|
||||
}
|
||||
Err(LogError::Damaged(_)) => return Err(Unsent::Local("log")),
|
||||
Err(e) => return Err(Unsent::Unreadable(e.to_string())),
|
||||
};
|
||||
let slice = turn_records(&records, turn).ok_or(Unsent::Local("log"))?;
|
||||
@@ -187,9 +190,20 @@ become
|
||||
let reply = final_reply(slice).ok_or(Unsent::Local("log"))?;
|
||||
```
|
||||
|
||||
The rest of `send_turn` is unchanged (`honcho.ok_or`, `batch`, `MAX_BATCH`, `add_messages`).
|
||||
`text` is `&str` from `user_text`; `reply` is `&str` from `final_reply`. `batch` already takes
|
||||
`&str`.
|
||||
**W3.** The `batch` call, the line
|
||||
|
||||
```rust
|
||||
let messages = batch(&text, &reply, speaker, &self.agent, session, turn);
|
||||
```
|
||||
|
||||
becomes
|
||||
|
||||
```rust
|
||||
let messages = batch(text, reply, speaker, &self.agent, session, turn);
|
||||
```
|
||||
|
||||
`text` and `reply` are already `&str`; clippy denies the extra borrows (`needless_borrow`).
|
||||
The rest of `send_turn` is unchanged (`honcho.ok_or`, `MAX_BATCH`, `add_messages`).
|
||||
|
||||
## Steps
|
||||
|
||||
@@ -202,31 +216,32 @@ The rest of `send_turn` is unchanged (`honcho.ok_or`, `batch`, `MAX_BATCH`, `add
|
||||
- [ ] **2. See it fail.** `cargo build --tests --keep-going -p memoryd`, timeout 600000 ms: test
|
||||
target `honcho_epochs` does not compile (`E0432` unresolved import
|
||||
`memoryd::honcho::turns::read_session`). Every other target compiles.
|
||||
- [ ] **3. The edits.** H1, H1b, H2, H3, W1, W2. `cargo check -p memoryd`
|
||||
- [ ] **3. The edits.** H1, H1b, H2, H3, W1, W2, W3. `cargo check -p memoryd`
|
||||
prints no error and no warning. `wc -l crates/memoryd/src/honcho/turns.rs` and
|
||||
`wc -l crates/memoryd/src/honcho/worker.rs` are each ≤ 500.
|
||||
- [ ] **4. The tests.** `cargo test -p memoryd --test honcho_epochs --test honcho_turns --test
|
||||
honcho_worker`: every test passes, 5 in `honcho_epochs` and the others as before.
|
||||
honcho_worker`: every test passes, 6 in `honcho_epochs` and the others as before.
|
||||
- [ ] **5. Check.** `git diff --stat` lists exactly `crates/memoryd/src/honcho/turns.rs` and
|
||||
`crates/memoryd/src/honcho/worker.rs`.
|
||||
- [ ] **6. Run the gate.** `cargo fmt --all`, then `make gate`, timeout 600000 ms. Last line
|
||||
`gate: ok`. Test count **1483** (1478 before, plus 5).
|
||||
`gate: ok`. Test count **1484** (1478 before, plus 6).
|
||||
- [ ] **7. Log and commit.** Task cell `M5d1/04-memoryd-honcho-epochs`. Stage with
|
||||
`git add crates/memoryd docs/implementer-log.md Cargo.lock`, then commit as `AGENTS.md` says.
|
||||
|
||||
## Done when
|
||||
|
||||
- `make gate` prints `gate: ok` with 1483 tests.
|
||||
- `make gate` prints `gate: ok` with 1484 tests.
|
||||
- `git diff HEAD~1 --stat` lists only the two `honcho` sources, `honcho_epochs.rs`, and the log.
|
||||
|
||||
## Stop and report if
|
||||
|
||||
- The branch check fails; a "before" block is not found exactly once; step 2 differs; a file
|
||||
exceeds 500 lines; a test fails; the gate count is not 1483.
|
||||
exceeds 500 lines; a test fails; the gate count is not 1484.
|
||||
- You think `log_path` should return every file. It must still return `0.jsonl`.
|
||||
|
||||
## What the given tests pin
|
||||
|
||||
Two users in epoch 0 and one in epoch 1 is `turns() == 3` and `turn_records(..., 3)` is the
|
||||
epoch-1 user; epoch 0 alone still reads; a damaged `1.jsonl` names that file; `TurnSync` decides
|
||||
turn 3 from epoch 1; a missing session directory is empty.
|
||||
turn 3 from epoch 1; `send_turn` posts turn 3 from epoch 1 (three worker steps, oldest first);
|
||||
a missing session directory is empty.
|
||||
|
||||
Reference in New Issue
Block a user