Skip to content

Refactor: Reorganize repository structure#181

Merged
sheepdestroyer merged 2 commits into
masterfrom
refactor/repo-reorganization
Jun 30, 2026
Merged

Refactor: Reorganize repository structure#181
sheepdestroyer merged 2 commits into
masterfrom
refactor/repo-reorganization

Conversation

@sheepdestroyer

@sheepdestroyer sheepdestroyer commented Jun 30, 2026

Copy link
Copy Markdown
Owner

This PR reorganizes the repository structure by moving scripts to scripts/ and python tests to tests/, merging the duplicate memory MCP tests into router/tests/test_memory_mcp.py, and updating all references, CI workflows, and documentation accordingly.

Summary by Sourcery

Reorganize test and script layout into dedicated scripts/ and tests/ directories and merge duplicate memory MCP tests into a single router-focused suite.

Bug Fixes:

  • Fix test and helper script imports and paths after moving files into scripts/ and tests/ directories.

Enhancements:

  • Document the new locations and roles of scripts, verification tools, and tests in README and scripts/README.
  • Consolidate memory MCP test coverage into router/tests/test_memory_mcp.py and remove duplicate root-level tests.
  • Update CI workflow, helper scripts, and upgrade plan docs to use the new script and test paths.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sourcery-ai

sourcery-ai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Refactors the repo layout by moving shell/Python scripts under scripts/, consolidating memory MCP tests under router/tests, relocating root tests into tests/, and updating imports, docs, and CI workflows to match the new structure.

File-Level Changes

Change Details Files
Reorganize documentation to describe the new scripts/ and tests/ layout and list newly documented helper scripts and test files.
  • Expanded scripts README to include verification/verify_breaker.py and newly added maintenance/helper daemons.
  • Updated classifier section to include host_agy_daemon.py, sync_gemini_token.py, get_pr_status.py, watch_quota.sh, and test_quota_reset.sh.
  • Rewrote integration test suite section to reference tests/ paths and added subsections for simulation, utility, and helper daemon tests.
  • Updated root README tree to show scripts/ and tests/ directories instead of individual files in the repo root.
  • Adjusted usage examples to call tests/test_agy_tiers.py and scripts/host_agy_daemon.py paths.
scripts/README.md
README.md
Update CI workflow and scripts to call tests and verification utilities from their new locations under scripts/ and tests/.
  • Changed pytest invocation in GitHub Actions to ignore tests/test_agy_behavior.py and tests/test_agy_tiers.py instead of root files.
  • Updated CI breaker verification step to run scripts/verification/verify_breaker.py.
  • Updated CI integration verification step to run tests/test_a2_verify.py.
  • Adjusted start-stack.sh to invoke scripts/sync_gemini_token.py instead of the root-level script.
  • Fixed watch_quota.sh to locate test_quota_reset.sh via SCRIPT_DIR and reflect moved script path.
.github/workflows/test.yml
start-stack.sh
scripts/watch_quota.sh
Move root-level and router memory MCP tests into a single consolidated router/tests/test_memory_mcp.py module and update imports.
  • Created router/tests/test_memory_mcp.py combining tests from router/test_memory_mcp.py and test_memory_mcp.py.
  • Removed obsolete router/test_memory_mcp.py and test_memory_mcp.py files.
  • Ensured consolidated tests import memory_mcp via PATH injection to router/ and validate key generation, parsing, and value handling for memory MCP functionality.
router/tests/test_memory_mcp.py
router/test_memory_mcp.py
test_memory_mcp.py
Relocate root-level integration and helper tests into tests/ and fix their import paths to match the new directory structure.
  • Moved test_host_agy_daemon.py to tests/test_host_agy_daemon.py and updated sys.path to import host_agy_daemon from scripts/.
  • Moved test_sync_gemini_token.py to tests/test_sync_gemini_token.py and adjusted sys.path to point at the scripts/ directory.
  • Moved test_a2_verify.py, test_circuit_breaker.py, test_models_proxy.py to tests/ equivalents and updated sys.path insertions to import from router/ via parent.parent.
  • Added sys.path insertion in router/tests/test_agy_proxy.py to include the router/ parent for imports.
  • Updated triage_upgrade_plan.md to refer to tests/test_agy_tiers.py and tests/test_classifier_accuracy.py instead of root files.
tests/test_host_agy_daemon.py
tests/test_sync_gemini_token.py
tests/test_a2_verify.py
tests/test_circuit_breaker.py
tests/test_models_proxy.py
router/tests/test_agy_proxy.py
triage_upgrade_plan.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

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.

Hey - I've left some high level feedback:

  • Several tests now manipulate sys.path manually to reach router and scripts modules; consider turning router and scripts into proper packages or using relative imports to avoid ad‑hoc path injection and make imports more robust.
  • The long sys.path parent traversals (e.g., in scripts/verification/verify_breaker.py) are a bit brittle; encapsulating this in a helper or using a consistent project root discovery mechanism would reduce duplication and future breakage if the layout changes again.
  • Since start-stack.sh now calls scripts/sync_gemini_token.py, it might be worth adding a simple check that the script exists or fails fast with a clear message if the repository structure is not as expected.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several tests now manipulate sys.path manually to reach router and scripts modules; consider turning router and scripts into proper packages or using relative imports to avoid ad‑hoc path injection and make imports more robust.
- The long sys.path parent traversals (e.g., in scripts/verification/verify_breaker.py) are a bit brittle; encapsulating this in a helper or using a consistent project root discovery mechanism would reduce duplication and future breakage if the layout changes again.
- Since start-stack.sh now calls scripts/sync_gemini_token.py, it might be worth adding a simple check that the script exists or fails fast with a clear message if the repository structure is not as expected.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@sheepdestroyer, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f1953398-9cb5-43af-b740-a7f8c1e97416

📥 Commits

Reviewing files that changed from the base of the PR and between 778da4d and cad53cb.

📒 Files selected for processing (32)
  • .github/workflows/test.yml
  • README.md
  • router/test_memory_mcp.py
  • router/tests/test_agy_proxy.py
  • router/tests/test_memory_mcp.py
  • scripts/README.md
  • scripts/get_pr_status.py
  • scripts/host_agy_daemon.py
  • scripts/sync_gemini_token.py
  • scripts/test_quota_reset.sh
  • scripts/verification/verify_breaker.py
  • scripts/watch_quota.sh
  • start-stack.sh
  • test_memory_mcp.py
  • tests/test_a2_verify.py
  • tests/test_agy_behavior.py
  • tests/test_agy_tiers.py
  • tests/test_antigravity.py
  • tests/test_atomic_write.py
  • tests/test_check_http_endpoint.py
  • tests/test_circuit_breaker.py
  • tests/test_classifier_accuracy.py
  • tests/test_compute_free_model_score.py
  • tests/test_host_agy_daemon.py
  • tests/test_map_tool_to_category.py
  • tests/test_models_proxy.py
  • tests/test_pie_chart_gradient.py
  • tests/test_record_tool_usage.py
  • tests/test_src_badge.py
  • tests/test_stream_latency.py
  • tests/test_sync_gemini_token.py
  • triage_upgrade_plan.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/repo-reorganization

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.

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.

1 participant