diff --git a/crates/memoryd/src/journal.rs b/crates/memoryd/src/journal.rs index 38ac944..358aa3d 100644 --- a/crates/memoryd/src/journal.rs +++ b/crates/memoryd/src/journal.rs @@ -84,11 +84,7 @@ pub(crate) fn append(store: &Store, mut record: Record, now: Timestamp) -> Resul // `serde_json::to_string(&record)`, then `store.append(&format!("edits/{month}.jsonl"), // &format!("{line}\n"))?` where month is the first 7 characters of day. Ok(record.id). let rfc = now.to_rfc3339(); - let day = if rfc.len() >= 10 { - &rfc[..10] - } else { - "0000-00-00" - }; + let day = rfc.get(..10).unwrap_or("0000-00-00"); let taken = records(store)? .iter() .filter(|r| r.id.starts_with(&format!("{day}-"))) @@ -97,7 +93,7 @@ pub(crate) fn append(store: &Store, mut record: Record, now: Timestamp) -> Resul let edits_dir = store.path("edits"); std::fs::create_dir_all(&edits_dir).map_err(|e| format!("{}: {e}", edits_dir.display()))?; let line = serde_json::to_string(&record).map_err(|e| e.to_string())?; - let month = &day[..7]; + let month = day.get(..7).unwrap_or("0000-00"); store.append(&format!("edits/{month}.jsonl"), &format!("{line}\n"))?; Ok(record.id) } diff --git a/crates/memoryd/src/notes.rs b/crates/memoryd/src/notes.rs index e14cc8e..cb435b7 100644 --- a/crates/memoryd/src/notes.rs +++ b/crates/memoryd/src/notes.rs @@ -34,8 +34,7 @@ pub struct Note { /// A time as the notes show it: to the minute, in UTC. pub fn minute(time: Timestamp) -> String { let s = time.to_rfc3339(); - let head = if s.len() >= 16 { &s[..16] } else { &s }; - format!("{head}Z") + format!("{}Z", s.get(..16).unwrap_or(&s)) } fn class_name(class: DataClass) -> &'static str { diff --git a/crates/memoryd/src/recall.rs b/crates/memoryd/src/recall.rs index ffccc37..2e1951d 100644 --- a/crates/memoryd/src/recall.rs +++ b/crates/memoryd/src/recall.rs @@ -158,7 +158,7 @@ pub fn recall( Some(fts) => search(index, &fts, args.k)?, }; let rfc = now.to_rfc3339(); - let month = &rfc[..7]; + let month = rfc.get(..7).unwrap_or("0000-00"); std::fs::create_dir_all(store.path("recalls")).map_err(|e| format!("recalls: {e}"))?; let logged = Logged { time: rfc.clone(), diff --git a/crates/memoryd/src/review.rs b/crates/memoryd/src/review.rs index 82c5a12..f731436 100644 --- a/crates/memoryd/src/review.rs +++ b/crates/memoryd/src/review.rs @@ -100,7 +100,7 @@ pub fn submit( // accepted")). args.check()?; let rfc = ctx.now.to_rfc3339(); - let day = &rfc[..10]; + let day = rfc.get(..10).unwrap_or("0000-00-00"); let taken = waiting(store)? .iter() .filter(|line| match line { diff --git a/docs/implementer-log.md b/docs/implementer-log.md index a0ddfb4..d924219 100644 --- a/docs/implementer-log.md +++ b/docs/implementer-log.md @@ -6,6 +6,7 @@ reviewer adds findings under "Reviews" once per milestone. | Task | Date | Status | Gate runs | First gate | Deviations | Notes | Model | |---|---|---|---|---|---|---|---| +| M5a/17-memoryd-no-slicing | 2026-09-25 | done | 1 | pass | none | The five slice-to-`get` edits exactly as the task gives: `notes.rs` `minute` two lines -> `format!("{}Z", s.get(..16).unwrap_or(&s))`; `journal.rs` `append` the five-line `day` -> `rfc.get(..10).unwrap_or("0000-00-00")` and `&day[..7]` -> `day.get(..7).unwrap_or("0000-00")`; `review.rs` `submit` `&rfc[..10]` -> `rfc.get(..10).unwrap_or("0000-00-00")`; `recall.rs` `recall` `&rfc[..7]` -> `rfc.get(..7).unwrap_or("0000-00")`. Left `&all[all.len().saturating_sub(count)..]` in `log` as instructed. `cargo fmt --all`; the step-2 grep for `\[..[0-9]+\]` prints nothing; `cargo test -p memoryd` every suite passes; `make gate` printed `gate: ok` on the first run, 936 tests unchanged. | Ornith-1.5-35B-A3B | | M5a/16-macos-gate | 2026-09-25 | done (by the design model) | 1 | pass | none | The session's work was right and left uncommitted: the diff matches the task file line for line, and the copied `shell.rs` is identical to the plan's. The stop was right too: clippy 1.95 (the workspace's `rust-version`) flags `collapsible_match` in `memoryd`'s `index.rs`, which the plan's gate run did not catch. The design model fixed that in its own commit (44bdcbd), outside this task. Then `make gate` printed `gate: ok`, 936 tests. | Ornith-1.5-35B-A3B (the session); design model (the commit) | | M5a/16-macos-gate | 2026-09-24 | stopped | 1 | fail | none | Created `.cargo/config.toml` (TMPDIR=/tmp for every process Cargo runs, tests included), copied the new `crates/toolkit/tests/shell.rs` from `docs/plans/M5a/files/`, and made the three edits to `read_checked` in `crates/gatewayd/src/secrets.rs`: the comment `"/proc/self"` -> `user_id()`, the three `/proc/self` lines -> `let owner = user_id()?;`, and the `user_id()` function (the uid of a freshly-made pipe) inserted above `value`. `cargo fmt --all`; `cargo test -p gatewayd -p toolkit -p brokerd` every suite passes. `make gate` never reaches the tests: it fails to compile `memoryd` on clippy `collapsible_match` at `crates/memoryd/src/index.rs:224` (the `LogRecord::User { time, content }` arm's nested `if !content.trim().is_empty()` guard), a crate this task does not touch and a file it does not list. Verified pre-existing and unrelated by stashing all my changes and re-running `make gate`: identical `memoryd` failure on the original committed code, so the gate does not compile `memoryd` with or without this task. Did not edit `memoryd` (outside this task's scope, AGENTS.md "do that task and nothing else"); committing only this log row per AGENTS.md point 4. | Ornith-1.5-35B-A3B | | M5a/15-soul-and-device | 2026-09-24 | done (by the design model) | 1 | pass | none | Finished by the design model from the session's work, which was right and left uncommitted. The stop was not the server: `tools/run-plan.sh` and the device tests both read `BOXMAKER_MODEL`. The run set it to OpenCode's id `straylight/ornith-1.5-35b-a3b`, which the device tests then sent to `llama-server` as the model name, and it answered 400. With it unset, `make verify-device` passed 6 of 6 (72.7 s). The three copied files are identical to the plan's; `make gate` prints `gate: ok`, 936 tests. | Ornith-1.5-35B-A3B (the session); design model (the commit) |