Skip to content

docs(memory-tree): update stale comment on translate_query_global_args#2713

Open
zahica1234 wants to merge 1 commit into
tinyhumansai:mainfrom
zahica1234:docs/fix-translate-query-global-comment
Open

docs(memory-tree): update stale comment on translate_query_global_args#2713
zahica1234 wants to merge 1 commit into
tinyhumansai:mainfrom
zahica1234:docs/fix-translate-query-global-comment

Conversation

@zahica1234
Copy link
Copy Markdown

@zahica1234 zahica1234 commented May 26, 2026

Summary

  • Update stale doc comment on translate_query_global_args in tools/impl/memory/tree/mod.rs
  • Comment described QueryGlobalRequest as { window_days: u32 } (pre-fix shape); field is now time_window_days with #[serde(alias = "window_days")]
  • Add .specify/ and .claude/skills/ to .gitignore to exclude spec-kit scaffolding

Test plan

  • No logic changes — doc comment only
  • cargo fmt --check passes
  • Existing tests in mod.rs and rpc.rs cover the field alias behaviour

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Updated development environment configuration.
  • Documentation

    • Clarified internal documentation for query translation functionality.

Review Change Stack

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 <noreply@anthropic.com>
@zahica1234 zahica1234 requested a review from a team May 26, 2026 22:01
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee4159c3-ec07-4fdc-bce5-e5161b9ee593

📥 Commits

Reviewing files that changed from the base of the PR and between 6d0657e and e4f3952.

📒 Files selected for processing (2)
  • .gitignore
  • src/openhuman/tools/impl/memory/tree/mod.rs

📝 Walkthrough

Walkthrough

This PR makes two independent maintenance updates: adding local AI assistant directories (.specify/ and .claude/skills/) to .gitignore to exclude them from version control, and clarifying the documentation for the translate_query_global_args function to explain how time_window_days maps to the backend's window_days via serde aliasing and precedence rules.

Changes

Configuration and Documentation Updates

Layer / File(s) Summary
AI assistant directory ignores
.gitignore
.specify/ and .claude/skills/ directories are added to the ignore list under the AI assistant progress tracking section.
Query argument translation documentation
src/openhuman/tools/impl/memory/tree/mod.rs
Documentation comments for translate_query_global_args are updated to clarify the time_window_dayswindow_days routing through serde aliasing, emphasize that explicit window_days takes precedence, and state the translator becomes a no-op when window_days is already provided.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • tinyhumansai/openhuman#2273: Introduces the translation logic for translate_query_global_args that this PR now documents.
  • tinyhumansai/openhuman#2255: Changes QueryGlobalRequest to accept time_window_days via serde alias, directly corresponding to the documented mapping.
  • tinyhumansai/openhuman#2219: Renames tool inputs to time_window_days, establishing the same backend field mapping clarified in the updated documentation.

Suggested labels

rust-core

Suggested reviewers

  • senamakel
  • graycyrus

Poem

🐰 With git rules and comments refined,
These local tools stay tucked from sight,
While docs now shine with purpose clear—
No logic shift, just words made right. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating documentation in the memory-tree module for the translate_query_global_args function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. label May 26, 2026
Comment thread .gitignore
# AI assistant progress tracking
.kimi/
.specify/
.claude/skills/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Blocker — merge conflict with main. GitHub reports this PR as mergeable: CONFLICTING. Both this branch and main appended ignore entries just below .kimi/, and they collide here. The fix is a trivial union of the four entries:

# AI assistant progress tracking
.kimi/
.specify/
.claude/skills/
.codex-tmp
*.enc

The PR cannot be merged until this conflict is resolved on the branch (rebase onto / merge current main, keep all entries).

/// 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This reference is already stale against current main. Since this branch was cut, main refactored the memory module: QueryGlobalRequest no longer lives at memory/tree/retrieval/rpc.rs — it's now memory_tree/retrieval/rpc.rs, and this whole file moved from tools/impl/memory/tree/mod.rsmemory/query/mod.rs. A docs PR whose entire purpose is to de-stale this comment will re-introduce a dead path the moment it merges. Please rebase onto current main and update the reference:

/// `query_source` backend uses that exact name). `QueryGlobalRequest` in
/// `memory_tree/retrieval/rpc.rs` uses `time_window_days` as its primary

/// `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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Is this translator still needed, or is the cleaner fix to delete it? The original comment justified the rename because the backend only accepted window_days (failing with missing field 'window_days'). That's no longer true: QueryGlobalRequest now has time_window_days as its primary field with #[serde(alias = "window_days")], so the consolidated tool's time_window_days payload already deserializes directly. The new comment even concedes the rename just routes "through the alias path, which is equivalent" — i.e. effectively a no-op.

Rather than spend a paragraph documenting why a redundant rename is retained, consider removing the indirection so this arm matches its siblings (query_source, query_topic, … dispatch args unchanged):

"query_global" => MemoryTreeQueryGlobalTool.execute(args).await,

…and drop translate_query_global_args plus its rename test cases. If there is a remaining caller path that still needs the rename, a one-line note on that would be more useful than the current justification.

Copy link
Copy Markdown
Contributor

@sanil-23 sanil-23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #2713 — docs(memory-tree): update stale comment on translate_query_global_args

Cross-repo PR from zahica1234:docs/fix-translate-query-global-commenttinyhumansai/openhuman:main. State: OPEN. GitHub reports mergeable: CONFLICTING.

Walkthrough

This is a small, well-intentioned docs-only change: it rewrites the doc comment on translate_query_global_args so it stops describing the old QueryGlobalRequest { window_days: u32 } shape and instead documents the current time_window_days primary field + #[serde(alias = "window_days")]. It also appends .specify/ and .claude/skills/ to .gitignore. The comment rewrite is technically accurate against the struct as it exists on the PR's base. However, the PR cannot merge as-is: there is an unresolved .gitignore conflict with main, and — more importantly — main has since landed a large memory-module refactor that moves the very file this PR edits and renames the path the new comment cites, so the "de-staled" comment lands stale again. This needs a rebase before it's worth merging.

Changes

File Summary
.gitignore Adds .specify/ and .claude/skills/ ignore entries. Currently in merge conflict with main.
src/openhuman/tools/impl/memory/tree/mod.rs Rewrites the doc comment on translate_query_global_args to match the current time_window_days (primary) + window_days (serde alias) shape. No logic change.

Actionable comments (3)

🛑 Blockers

1. .gitignore:109-115 — unresolved merge conflict with main

GitHub reports this PR as mergeable: CONFLICTING, and merging main locally leaves conflict markers in .gitignore. Both branches appended ignore entries just below .kimi/:

<<<<<<< HEAD
.specify/
.claude/skills/
=======
.codex-tmp
*.enc
>>>>>>> main

The PR cannot be merged until this is resolved. The resolution is trivial (union — keep all four entries), but it must be done on the branch.

Suggested change (resolved block):

# AI assistant progress tracking
.kimi/
.specify/
.claude/skills/
.codex-tmp
*.enc

⚠️ Major

2. src/openhuman/tools/impl/memory/tree/mod.rs:172 — the doc comment is already stale against current main

The whole point of this PR is to de-stale this comment, but main has landed a large memory refactor (PR #2556 and follow-ups) since the branch was cut. After merging current main:

  • The edited file itself moves: src/openhuman/tools/impl/memory/tree/mod.rssrc/openhuman/memory/query/mod.rs.
  • The path the new comment cites — memory/tree/retrieval/rpc.rs — no longer exists; QueryGlobalRequest now lives at src/openhuman/memory_tree/retrieval/rpc.rs.

So as written, the "fixed" comment points at a dead path the moment it merges. Please rebase onto current main and update the reference.

Suggested change:

// before
/// `query_source` backend uses that exact name). `QueryGlobalRequest` in
/// `memory/tree/retrieval/rpc.rs` uses `time_window_days` as its primary

// after
/// `query_source` backend uses that exact name). `QueryGlobalRequest` in
/// `memory_tree/retrieval/rpc.rs` uses `time_window_days` as its primary

💡 Refactor / suggestion

3. src/openhuman/tools/impl/memory/tree/mod.rs:171-184 — the translator is now redundant; consider deleting it instead of documenting why it's kept

The original comment explained the translation existed because the backend only accepted window_days and rejected time_window_days with missing field 'window_days'. That is no longer true: QueryGlobalRequest now has time_window_days as its primary field (with window_days as a serde alias), so the consolidated tool's time_window_days payload deserializes directly — no rename needed. The new comment even concedes the rename just routes "through the alias path, which is equivalent."

If the rename is equivalent to a no-op, the honest fix is to remove the indirection rather than write a paragraph justifying it. That also lets the query_global arm match every sibling arm (query_source, query_topic, …) which dispatch args unchanged.

Suggested change:

// in execute():
"query_global" => MemoryTreeQueryGlobalTool.execute(args).await,

…and delete translate_query_global_args plus its memory_tree_dispatcher_tests rename cases. (Out of scope for a pure docs PR — flagging as a question for the author: is there a remaining caller path that still needs the rename, or is this safe to drop?)

Nitpicks (1)

  • src/openhuman/memory/query/mod.rs:310 (post-merge location; pre-existing, not in this PR's diff) — while de-staling the function's doc comment, the sibling test comment in translate_query_global_args_renames_time_window_days_to_window_days is equally stale: it still claims "QueryGlobalRequest deserializes from window_days", which is the old shape. If you touch this area in the rebase, fix it too: the struct now deserializes from time_window_days (primary) and accepts window_days via the alias.

Questions for the author (1)

  • src/openhuman/tools/impl/memory/tree/mod.rs:178 — Given the backend now accepts time_window_days natively, is translate_query_global_args still serving any purpose, or can it be deleted outright (see comment #3)?

Verified / looks good

  • The rewritten comment is technically correct against the current struct: QueryGlobalRequest { #[serde(alias = "window_days")] pub time_window_days: u32 }time_window_days primary, window_days alias. ✔
  • The function body is unchanged and still correct: explicit window_days is preserved, time_window_days is renamed only when window_days is absent. ✔
  • .gitignore additions (.specify/, .claude/skills/) are reasonable spec-kit/scaffolding ignores; consistent with the existing .kimi/ entry. ✔
  • No i18n, security, or logging concerns — Rust doc comment + ignore entries only. ✔

🛑 Requesting changes — the .gitignore merge conflict is a hard merge blocker, and the docs change re-introduces a stale path reference once rebased onto current main.

Copy link
Copy Markdown
Contributor

@sanil-23 sanil-23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the detailed review above. Blocking: (1) unresolved .gitignore merge conflict with main (mergeable: CONFLICTING); (2) the doc comment's path reference (memory/tree/retrieval/rpc.rs) is stale post-refactor — rebase onto current main and point it at memory_tree/retrieval/rpc.rs.

Copy link
Copy Markdown
Contributor

@graycyrus graycyrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Updated doc comment now accurately reflects the current field structure of QueryGlobalRequest — time_window_days as primary field with window_days as serde alias. Clean, focused change with no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants