From b3fa83983331dda87aacee586fac752f5ec33384 Mon Sep 17 00:00:00 2001 From: zahica1234 Date: Wed, 27 May 2026 00:52:55 +0300 Subject: [PATCH] docs(memory-tree): update stale comment on translate_query_global_args The doc comment described QueryGlobalRequest as having `window_days: u32` as its primary field, which was the pre-fix state. The field was renamed to `time_window_days` with `#[serde(alias = "window_days")]` added so both names deserialize correctly. Update the comment to match the current struct shape and clarify that the translator routes through the alias path. Also add .specify/ and .claude/skills/ to .gitignore to exclude spec-kit project scaffolding from the tracked tree. Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 2 ++ src/openhuman/memory/query/mod.rs | 17 +++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index c49daf3b8..c10d49bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -106,5 +106,7 @@ test-map.md # AI assistant progress tracking .kimi/ +.specify/ +.claude/skills/ .codex-tmp *.enc diff --git a/src/openhuman/memory/query/mod.rs b/src/openhuman/memory/query/mod.rs index 67af0f518..d8e7e8077 100644 --- a/src/openhuman/memory/query/mod.rs +++ b/src/openhuman/memory/query/mod.rs @@ -174,16 +174,13 @@ impl Tool for MemoryTreeTool { /// /// The consolidated `parameters_schema()` exposes one shared /// `time_window_days` field for both `query_source` and `query_global` (the -/// `query_source` backend uses that exact name). The `query_global` backend -/// — `QueryGlobalRequest { window_days: u32 }` in `memory/tree/retrieval/rpc.rs` -/// — was never aligned with that schema, so any call following the -/// consolidated contract failed with `missing field 'window_days'`. -/// -/// Translating in the dispatch keeps the LLM-facing schema stable and -/// leaves the standalone [`MemoryTreeQueryGlobalTool`] (which advertises -/// `window_days` natively) untouched. An explicit `window_days` always -/// wins so callers can opt into the underlying contract if they ever -/// want to. +/// `query_source` backend uses that exact name). `QueryGlobalRequest` in +/// `memory_tree/retrieval/rpc.rs` uses `time_window_days` as its primary +/// field name and accepts `window_days` via `#[serde(alias = "window_days")]`. +/// The translation here keeps the LLM-facing consolidated schema stable +/// (callers always send `time_window_days`) while routing through the alias +/// path, which is equivalent. An explicit `window_days` in the payload +/// always wins — the translator is a no-op for callers that already use it. fn translate_query_global_args(mut args: serde_json::Value) -> serde_json::Value { if let Some(obj) = args.as_object_mut() { if !obj.contains_key("window_days") {