Skip to content

refactor: drop code only tests reached — paged search, verifier compat path, dead helpers - #469

Open
CryptoJones wants to merge 1 commit into
mainfrom
factory/simplify-a869c5c8
Open

CryptoJones wants to merge 1 commit into
mainfrom
factory/simplify-a869c5c8

Conversation

@CryptoJones

Copy link
Copy Markdown
Owner

Removes code that nothing in the product calls; only tests (or nothing at all) reached it. 12 files, +38 / −340 (net −302).

What was removed and why nothing needs it

  • SearchIndex.search_page, SearchPage, _pack_edge_first (searchindex.py), plus their 6 tests. This cursor- and token-budgeted search API was never wired to any surface. The MCP server pages through server._page, and the CLI and web app call search. Searched src/, docs/, e2e/, scripts/ and README: no caller outside tests/test_searchindex.py.
  • The verifier's omi_dir=None compatibility path (verify.py). verify.judge and verify.judge_with_activity were used only by tests, and they were the only way _ask_model ran without a vault. In that case it used its own hand-rolled copy of ai_usage.run_model: resolve backend → substitute {prompt} → subprocess.run → parse. That copy also skipped usage accounting and the profile's verifier_llm permission. The only production caller, verify_consult, always passes the vault. omi_dir is now required, and tests call _judge_scored through a 2-line _judge helper. I removed the two tests that only exercised the deleted subprocess branch. Backend resolution is still covered in test_ai_usage.py.
  • Functions nothing calls:
    • mesh.commit_local (also dropped from docs/mesh.md)
    • hooks._latest_by_name, hooks._journal_tail, and the now-unused _JOURNAL_TAIL_BULLETS / _JOURNAL_GLOB constants
    • guard._shell_body, a wrapper over _shell_body_index; its docstring moved to _shell_body_index
    • policy._heredoc_owner_is_shell, a wrapper over _HeredocOwners; its docstring moved to the class
    • compliance.recidivism; its two test call sites now use recidivism_counts()[rule], which production already uses

Behavior is unchanged: every production path calls exactly what it called before.

Verification

Ran

  • ruff check .: clean. mypy src (strict): no issues in 59 files.
  • pytest full suite: 3818 passed and 13 failed. Two of those 13 were my missed compliance.recidivism test call sites, which I fixed afterwards; test_compliance.py now passes (16/16). The other 11 also fail on the unmodified base commit c8c1015 with this branch's changes stashed, so they predate this PR:
    • 8 timing tests in test_guard.py / test_rules.py hit the 2.0 s hard bound on this machine.
    • test_repo_block_message_embeds_governing_excerpt fails: the excerpt is missing from the reason text.
    • 2 test_name_timelines.py decoy tests pick B.md instead of A.md.
  • Live: omind guard reset, then omind guard verify with real PostToolUse events against a temporary vault and a temporary XDG_STATE_HOME, once with OMI_MODEL_CMD=/bin/false. The verifier ran end to end through the simplified _judge_scored → _ask_model(…, omi_dir) path and returned relevant without raising. I did not confirm which branch decided that verdict.

Did not run

  • The e2e suite. The change only removes code that nothing calls, and the CI matrix (including Windows) covers the rest.

Blocked by the machine

  • pytest was not on PATH until I ran uv sync --all-extras. The 8 timing tests exceed their 2.0 s bound on this host whether or not this branch's changes are applied.

🤖 Generated with Claude Code

…t path, dead helpers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 2e1c0a02-a40b-4305-a1f4-4d690468b19c
📥 Commits

Reviewing files that changed from the base of the PR and between c8c1015 and 80af741.

📒 Files selected for processing (12)
  • docs/mesh.md
  • src/omind/compliance.py
  • src/omind/guard.py
  • src/omind/hooks.py
  • src/omind/mesh.py
  • src/omind/policy.py
  • src/omind/searchindex.py
  • src/omind/verify.py
  • tests/test_compliance.py
  • tests/test_hooks.py
  • tests/test_searchindex.py
  • tests/test_verify.py
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@CryptoJones CryptoJones added the factory:simplify Simplification opened by the software factory; removes more than it adds label Oct 3, 2026

This branch has not been deployed

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

Labels

factory:simplify Simplification opened by the software factory; removes more than it adds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant