Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

test(mcp): cover an old conformant checkpoint through the admin route

AkitaOnRails8b0acbe0ef74
diff --cc CHANGELOG.md
index 55042ffc,0736de97..247d8051
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -13,16 -13,12 +13,20 @@@ version in [`docs/changelog/`](docs/cha
### Fixed
+- Restoring a page from a checkpoint (`/admin/restore-page`) no longer
+ rewrites the restored file's `generated.at` to the current time when the
+ checkpoint is already OKF-conformant. The restore now keeps the
+ checkpoint's own timestamp when conformance leaves the rest of its
+ frontmatter unchanged and the file on disk holds other content, so a
+ checkpoint emitted by ai-memory restores byte for byte whatever the clock.
+ When the file on disk already holds the same content, its timestamp is kept
+ so file and row stay aligned; checkpoints that need conformance still go
+ through the existing inheritance and stamping rules (#1671).
-
+ - Updated tokio to 1.54.1 in the server, relay, importer and wikisync
+ lockfiles. 1.52.3 and the 1.53.x releases before 1.53.3 fall inside
+ RUSTSEC-2026-0386, an unsound advisory for `AsyncFd` constructors that
+ nothing here calls, and the `cargo-deny` gate failed on every pull request
+ from the moment the advisory was assigned (#1658).
-
- `ai-memory user list` and `ai-memory api-key list` now size their columns
by terminal display width rather than bytes, as `list-projects` and the
grants tables already do. An accented username, display name or key label
diff --cc crates/ai-memory-mcp/src/admin.rs
index b32094ca,b32094ca..e826d0f6
--- a/crates/ai-memory-mcp/src/admin.rs
+++ b/crates/ai-memory-mcp/src/admin.rs
@@@ -11315,6 -11315,6 +11315,59 @@@ mod tests
);
}
++ /// The same promise when the checkpoint is older than the restore: the
++ /// test above passes only when its writes and the restore fall in one
++ /// second, because the restore used to inherit `generated.at` from the
++ /// file it replaces and otherwise stamped the current time.
++ #[tokio::test]
++ async fn restoring_an_old_conformant_page_keeps_its_generated_at() {
++ let (tmp, router) = read_page_test_router();
++ post_write_page(&router, "default", "scratch", "notes/a.md", "first").await;
++ let proj_dir = scratch_project_dir(tmp.path());
++ let page = proj_dir.join("notes/a.md");
++ let written = std::fs::read_to_string(&page).unwrap();
++ let at_line = written
++ .lines()
++ .find(|line| line.trim_start().starts_with("at: "))
++ .unwrap_or_else(|| panic!("no generated.at line in:\n{written}"));
++ let indent = &at_line[..at_line.len() - at_line.trim_start().len()];
++ let checkpointed =
++ written.replacen(at_line, &format!("{indent}at: 2026-09-01T00:00:00Z"), 1);
++ std::fs::write(&page, &checkpointed).unwrap();
++ let rev = post_commit(&router, "checkpoint").await;
++
++ post_write_page(&router, "default", "scratch", "notes/a.md", "second").await;
++ post_commit(&router, "later").await;
++
++ let resp = router
++ .clone()
++ .oneshot(
++ Request::builder()
++ .method("POST")
++ .uri("/admin/restore-page")
++ .header("content-type", "application/json")
++ .body(Body::from(
++ serde_json::to_vec(&serde_json::json!({
++ "workspace": "default",
++ "project": "scratch",
++ "path": "notes/a.md",
++ "rev": rev,
++ }))
++ .unwrap(),
++ ))
++ .unwrap(),
++ )
++ .await
++ .unwrap();
++ assert_eq!(resp.status(), StatusCode::OK, "restore-page failed");
++
++ assert_eq!(
++ std::fs::read_to_string(&page).unwrap(),
++ checkpointed,
++ "the restore re-stamped generated.at instead of keeping the checkpoint's"
++ );
++ }
++
/// `POST /admin/commit`, returning the oid of the resulting HEAD
/// checkpoint. A write-page already checkpoints itself, so the commit
/// here may legitimately have nothing left to stage.