openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

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

Open zahica1234 opened this issue 6 months ago β€’ 4 comments

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

  • [x] No logic changes β€” doc comment only
  • [x] cargo fmt --check passes
  • [x] Existing tests in mod.rs and rpc.rs cover the field alias behaviour

πŸ€– Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated gitignore configuration for development environment.

Review Change Stack

zahica1234 avatar May 26 '26 22:05 zahica1234

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 b3fa83983331dda87aacee586fac752f5ec33384 and ce50f802b4d7f916912f2b440a254f1ad1d9fa3c.

πŸ“’ 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_days ↔ query_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

  • tinyhumansai/openhuman#2273: Related update describing time_window_daysβ†’window_days aliasing in translate_query_global_args.
  • tinyhumansai/openhuman#2219: Documentation change tied to time_window_days ↔ query_global.window_days rename across query_global RPC/tool.

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[bot] avatar May 26 '26 22:05 coderabbitai[bot]

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

graycyrus avatar May 27 '26 19:05 graycyrus

This PR has merge conflicts with main β€” please rebase/resolve before review.

graycyrus avatar May 27 '26 19:05 graycyrus

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.rs β†’ memory_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 @graycyrus β€” mergeable: MERGEABLE now, ready for re-review.

zahica1234 avatar May 27 '26 20:05 zahica1234

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.

zahica1234 avatar May 28 '26 13:05 zahica1234

Actionable comments posted: 0

coderabbitai[bot] avatar May 28 '26 13:05 coderabbitai[bot]

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 avatar May 28 '26 14:05 zahica1234

@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.

zahica1234 avatar May 28 '26 14:05 zahica1234