Skip to content

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

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
zahica1234:docs/fix-translate-query-global-comment
May 29, 2026
Merged

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

Conversation

@zahica1234
Copy link
Copy Markdown
Contributor

@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 gitignore configuration to exclude local tooling directories used during development.
  • Documentation

    • Clarified internal module comments to reflect current behavior and aliasing for query time-window handling (maintainer-facing; no functional changes).

Review Change Stack

@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: 501f4c03-a4f6-4935-a4f8-fe9e7ccc47df

📥 Commits

Reviewing files that changed from the base of the PR and between b3fa839 and ce50f80.

📒 Files selected for processing (2)
  • .gitignore
  • src/openhuman/memory/query/mod.rs
✅ Files skipped from review due to trivial changes (1)
  • src/openhuman/memory/query/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • .gitignore

📝 Walkthrough

Walkthrough

Adds .specify/ and .claude/skills/ to .gitignore and updates the module-level comment in src/openhuman/memory/query/mod.rs to clarify time_window_daysquery_global.window_days aliasing and precedence; no runtime behavior changes.

Changes

Configuration and docs clarification

Layer / File(s) Summary
AI assistant directory ignores
.gitignore
Adds .specify/ and .claude/skills/ to the AI assistant progress tracking section of .gitignore.
Module comment: time_window_days aliasing
src/openhuman/memory/query/mod.rs
Reworded the explanatory comment above translate_query_global_args to describe how time_window_days is translated to query_global.window_days (serde alias) and the precedence when both fields are supplied; no code changes.

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • graycyrus

Poem

🐰 A tiny patch hopped into the tree,
Ignoring helpers that hum locally,
A comment tweaked so the mapping's clear,
Small changes, soft and sincere,
Hooray — the repo breathes easy today!

🚥 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 clearly describes the main change: updating a stale documentation comment on the translate_query_global_args function to reflect current aliasing behavior.
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.


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
coderabbitai[bot]
coderabbitai Bot previously approved these changes 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

Comment thread src/openhuman/memory/query/mod.rs
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.

graycyrus
graycyrus previously approved these changes May 27, 2026
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.

@graycyrus
Copy link
Copy Markdown
Contributor

@zahica1234 this PR has merge conflicts with main — please rebase/resolve before review.

@graycyrus
Copy link
Copy Markdown
Contributor

This PR has merge conflicts with main — please rebase/resolve before review.

@zahica1234 zahica1234 dismissed stale reviews from graycyrus and coderabbitai[bot] via b3fa839 May 27, 2026 20:11
@zahica1234 zahica1234 force-pushed the docs/fix-translate-query-global-comment branch from e4f3952 to b3fa839 Compare May 27, 2026 20:11
@zahica1234
Copy link
Copy Markdown
Contributor Author

Rebased onto current main (b3fa839). Three things addressed:

  1. .gitignore conflict — resolved with the exact 4-line union @sanil-23 suggested (keeping .kimi/, .specify/, .claude/skills/, .codex-tmp, *.enc).

  2. Stale path reference in the doc comment (per @sanil-23) — updated memory/tree/retrieval/rpc.rsmemory_tree/retrieval/rpc.rs. Git rename detection moved the edit onto the new file at src/openhuman/memory/query/mod.rs, and the comment now correctly describes the current QueryGlobalRequest shape (primary time_window_days with #[serde(alias = "window_days")]).

  3. Bigger structural suggestion@sanil-23 raised a fair point that translate_query_global_args is now effectively a no-op given the serde alias, and the dispatch arm could just pass args straight through. That's a real change (it touches the dispatch arm, removes the function, and removes 4 test cases), so I'd rather not retrofit it into a PR titled docs(memory-tree): update stale comment — happy to open a focused follow-up PR (refactor(memory/query): drop redundant translate_query_global_args after serde alias) once this lands, if maintainers are happy with that direction.

cc @graycyrusmergeable: MERGEABLE now, ready for re-review.

@zahica1234 zahica1234 requested review from graycyrus and sanil-23 May 27, 2026 20:53
@oxoxDev oxoxDev assigned oxoxDev and unassigned oxoxDev May 28, 2026
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 force-pushed the docs/fix-translate-query-global-comment branch from b3fa839 to ce50f80 Compare May 28, 2026 13:17
@zahica1234
Copy link
Copy Markdown
Contributor Author

Rebased onto current upstream/main (2d68c81) — clean replay, no conflicts. New head: ce50f80.

Diff is unchanged in intent: doc-comment-only update to translate_query_global_args reflecting the post-fix struct shape (time_window_days primary + window_days serde alias) at src/openhuman/memory/query/mod.rs, plus .specify/ and .claude/skills/ added to .gitignore.

Pushed with --no-verify — the pre-push hook's lint:commands-tokens step failed on Tailwind tokens in app/src/components/commands/ which is unrelated to this PR's surface area (this PR touches only a Rust doc comment + .gitignore). Per the contributor guidance in CLAUDE.md ("If a pre-push hook fails on something unrelated to your changes, push with --no-verify and call it out in the PR body"), flagging here rather than blocking on it.

Ready for re-review when convenient.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@zahica1234
Copy link
Copy Markdown
Contributor Author

The single failing check is Rust Core Coverage (cargo-llvm-cov) and the failure is a runner disk-out-of-space, not a code problem:

rustc-LLVM ERROR: IO failure on output stream: No space left on device

cargo-llvm-cov produces instrumented binaries and .profraw files that comfortably fill GHA's 14 GB free space — this PR's diff is a Rust doc comment in src/openhuman/memory/query/mod.rs plus two .gitignore lines, which cannot produce that error path. Every other check is green, including the actually-meaningful test / Rust Core Tests + Quality, Rust Quality (fmt + clippy), and Rust Tauri Coverage (cargo-llvm-cov) (Tauri shell, which is smaller). Coverage Gate (diff-cover ≥ 80%) is only SKIPPED because it consumes the failed core-coverage artifact.

CodeRabbit re-reviewed after the rebase (ce50f80) and posted Actionable comments posted: 0. No code changes needed.

Could a maintainer kindly re-run the failed core-coverage job? gh run rerun --failed returns "cannot be rerun" from the fork side, so I can't retry it myself. Happy to push an empty commit to re-trigger if that's the preferred workflow — just let me know.

@zahica1234
Copy link
Copy Markdown
Contributor Author

@sanil-23 — addressing your review on e4f3952 now that the branch is on ce50f80 (rebased onto current upstream/main 2d68c81):

1. .gitignore conflict (Blocker) — ✅ resolved. The rebased .gitignore carries the four-entry union you suggested:

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

GitHub now reports mergeable: MERGEABLE.

2. Stale path reference in the comment (Major) — ✅ resolved. The rebased comment now reads:

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

i.e. memory_tree/retrieval/rpc.rs (underscore), matching the post-refactor path. The edited file itself also moved to src/openhuman/memory/query/mod.rs per the upstream rename; the rebase tracked it automatically.

3. Delete translate_query_global_args entirely (Refactor) — your read of the contract is correct: with time_window_days as the primary serde name and window_days as an alias on QueryGlobalRequest, the translator is functionally a no-op for any caller that already sends time_window_days. The one residual behaviour is the explicit-window_days-wins case (preserved when both keys are present), but no current call site exercises that. I'd like to keep this PR scoped to the doc-comment fix (per the CLAUDE.md "don't add refactors beyond what the task requires" rule) and open a follow-up that deletes the translator + its memory_tree_dispatcher_tests rename cases. Happy to spin that up as a separate PR once this one merges — flag it as chore(memory-tree): drop redundant translate_query_global_args.

Nitpick about the sibling test comment — noted, will fold that into the follow-up refactor PR since it's adjacent to the deletion.

CI on ce50f80: 28 of 29 green; the one failure is Rust Core Coverage (cargo-llvm-cov) with a runner disk-OOM, asked a maintainer to re-run in this comment.

Would you mind dismissing the CHANGES_REQUESTED (or converting it to a comment) if blockers 1 + 2 read as resolved on your end? Thanks for the thorough review.

@senamakel senamakel merged commit 6f188b3 into tinyhumansai:main May 29, 2026
30 of 33 checks passed
senamakel pushed a commit to junjunjunbong/openhuman that referenced this pull request May 29, 2026
tinyhumansai#2713)

Co-authored-by: zahica1234 <i.milev001@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

5 participants