Skip to content

refactor: split commands.rs (820 LOC) into per-command modules - #187

Merged
ajianaz merged 6 commits into
developfrom
refactor/split-commands
Jun 7, 2026
Merged

ajianaz merged 6 commits into
developfrom
refactor/split-commands

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #180

Summary

Split monolithic commands.rs (820 LOC) into 9 focused modules:

Module LOC Responsibility
server.rs 183 HTTP routing for server mode
remember.rs 59 Store new memories
recall.rs 57 Semantic + keyword search
list.rs 54 List, get, stats
forget.rs 96 Delete (single, tag, cold, all)
tags.rs 74 Tag CRUD
namespace.rs 56 Namespace management
aging.rs 89 Aging status/preview/cleanup
maintenance.rs 230 Doctor, verify, repair, prune, consolidate, export, import, checksums

Zero behavioral changes — pure reorganization.

Split monolithic commands.rs into 9 focused modules:
- server.rs (183 LOC) — HTTP routing for server mode
- remember.rs (59 LOC) — store new memories
- recall.rs (57 LOC) — semantic + keyword search
- list.rs (54 LOC) — list, get, stats
- forget.rs (96 LOC) — delete (single, tag, cold, all)
- tags.rs (74 LOC) — tag CRUD
- namespace.rs (56 LOC) — namespace management
- aging.rs (89 LOC) — aging status/preview/cleanup
- maintenance.rs (230 LOC) — doctor, verify, repair, prune, consolidate, export, import, checksums

Zero behavioral changes — pure reorganization.
@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@ajianaz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 13 minutes and 53 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a6b7ae0b-059d-4fbb-885d-29f77dfbd7ee

📥 Commits

Reviewing files that changed from the base of the PR and between d00328d and 4930501.

📒 Files selected for processing (21)
  • INSTALL.md
  • README.md
  • crates/uteke-cli/src/commands.rs
  • crates/uteke-cli/src/commands/aging.rs
  • crates/uteke-cli/src/commands/forget.rs
  • crates/uteke-cli/src/commands/list.rs
  • crates/uteke-cli/src/commands/maintenance.rs
  • crates/uteke-cli/src/commands/mod.rs
  • crates/uteke-cli/src/commands/namespace.rs
  • crates/uteke-cli/src/commands/recall.rs
  • crates/uteke-cli/src/commands/remember.rs
  • crates/uteke-cli/src/commands/server.rs
  • crates/uteke-cli/src/commands/tags.rs
  • crates/uteke-core/src/operations.rs
  • docs/launch/hn-post.md
  • docs/launch/twitter-thread.md
  • examples/python_uteke.py
  • examples/test_uteke_integration.py
  • scripts/shell/uteke-hook.bash
  • scripts/shell/uteke-hook.zsh
  • scripts/verify_integration.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/split-commands

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.

@github-actions

github-actions Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

⚠️ Review could not complete. Cora produced an empty result. Check the workflow logs for errors.


Review powered by cora-cli · BYOK · MIT

Zeko (Hermes) added 5 commits June 7, 2026 01:55
…183, #178)

- Fix README.md: 256d → 768d (3 occurrences)
- Fix docs/launch/hn-post.md: 256d → 768d (2 occurrences)
- Fix docs/launch/twitter-thread.md: 256d → 768d
- Rename python_hermes.py → python_uteke.py
- Rename test_hermes_integration.py → test_uteke_integration.py
- Update all import references (README, INSTALL, scripts, examples)
- Remove 'Hermes AI agents' from docstrings

Note: --namespace hermes CLI examples kept as valid usage examples.
All write operations now follow the same pattern:
1. Write to SQLite (source of truth) first
2. Write to vector index second
3. If index write fails, data is safe in SQLite and can be rebuilt via `uteke repair`

Previously `remember()` used opposite order (index → SQLite) with a
rollback mechanism. This was inconsistent with `forget()` and bulk
operations, and added unnecessary complexity. SQLite-first is simpler
and consistent across all operations.
Bash: check PROMPT_COMMAND before appending to avoid duplicate hooks
when `eval "$(uteke hook bash)"` is sourced multiple times.

Zsh: check chpwd_functions array before appending.

Fish is unaffected — function definitions are idempotent.
@ajianaz
ajianaz merged commit f45cc11 into develop Jun 7, 2026
7 checks passed
@ajianaz
ajianaz deleted the refactor/split-commands branch June 7, 2026 02:08
ajianaz added a commit that referenced this pull request Aug 13, 2026
* refactor: split commands.rs (820 LOC) into per-command modules (#180)

Split monolithic commands.rs into 9 focused modules:
- server.rs (183 LOC) — HTTP routing for server mode
- remember.rs (59 LOC) — store new memories
- recall.rs (57 LOC) — semantic + keyword search
- list.rs (54 LOC) — list, get, stats
- forget.rs (96 LOC) — delete (single, tag, cold, all)
- tags.rs (74 LOC) — tag CRUD
- namespace.rs (56 LOC) — namespace management
- aging.rs (89 LOC) — aging status/preview/cleanup
- maintenance.rs (230 LOC) — doctor, verify, repair, prune, consolidate, export, import, checksums

Zero behavioral changes — pure reorganization.

* fix: correct embedding docs (768d not 256d) + remove hermes branding (#183, #178)

- Fix README.md: 256d → 768d (3 occurrences)
- Fix docs/launch/hn-post.md: 256d → 768d (2 occurrences)
- Fix docs/launch/twitter-thread.md: 256d → 768d
- Rename python_hermes.py → python_uteke.py
- Rename test_hermes_integration.py → test_uteke_integration.py
- Update all import references (README, INSTALL, scripts, examples)
- Remove 'Hermes AI agents' from docstrings

Note: --namespace hermes CLI examples kept as valid usage examples.

* fix: correct include_str path + remove unused imports after split

* fix: consistent SQLite-first dual-write for remember (#182)

All write operations now follow the same pattern:
1. Write to SQLite (source of truth) first
2. Write to vector index second
3. If index write fails, data is safe in SQLite and can be rebuilt via `uteke repair`

Previously `remember()` used opposite order (index → SQLite) with a
rollback mechanism. This was inconsistent with `forget()` and bulk
operations, and added unnecessary complexity. SQLite-first is simpler
and consistent across all operations.

* fix: guard against PROMPT_COMMAND duplication in shell hooks (#143)

Bash: check PROMPT_COMMAND before appending to avoid duplicate hooks
when `eval "$(uteke hook bash)"` is sourced multiple times.

Zsh: check chpwd_functions array before appending.

Fish is unaffected — function definitions are idempotent.

* fix: reduce forget::run args to satisfy clippy (8→6)

---------

Co-authored-by: Zeko (Hermes) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: split commands.rs (820 LOC) into per-command modules

1 participant