Skip to content

feat: sync updated codebase from development snapshot#40

Merged
tardigrde merged 1 commit into
mainfrom
feat/sync-new-version
Jun 19, 2026
Merged

feat: sync updated codebase from development snapshot#40
tardigrde merged 1 commit into
mainfrom
feat/sync-new-version

Conversation

@tardigrde

Copy link
Copy Markdown
Owner

Syncs the latest codebase version from the development snapshot.

Key changes:

  • Updated source files: cache.py, cli.py, config.py, core.py, filters.py, formatters.py, hooks.py, loaders.py, mcp_server.py
  • Updated tests: test_cache, test_cli, test_core, test_filters, test_formatters, test_hooks, test_loaders, test_mcp_server
  • Updated docs: CLAUDE.md, README.md, Makefile, skills
  • Added: ADVERSARIAL_REVIEW_2026-06-18.md, AGENTS.md

All 567 tests pass.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

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

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

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

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

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 538f00d6-643c-432c-ab5a-76e48f0e4d7c

📥 Commits

Reviewing files that changed from the base of the PR and between ee8856c and 45d12d7.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (23)
  • AGENTS.md
  • CLAUDE.md
  • Makefile
  • README.md
  • skills/gcpath/SKILL.md
  • skills/gcpath/references/commands.md
  • src/gcpath/cache.py
  • src/gcpath/cli.py
  • src/gcpath/config.py
  • src/gcpath/core.py
  • src/gcpath/filters.py
  • src/gcpath/formatters.py
  • src/gcpath/hooks.py
  • src/gcpath/loaders.py
  • src/gcpath/mcp_server.py
  • tests/test_cache.py
  • tests/test_cli.py
  • tests/test_core.py
  • tests/test_filters.py
  • tests/test_formatters.py
  • tests/test_hooks.py
  • tests/test_loaders.py
  • tests/test_mcp_server.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sync-new-version

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.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.97598% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.44%. Comparing base (e0cca06) to head (45d12d7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/gcpath/core.py 73.79% 38 Missing ⚠️
src/gcpath/cli.py 57.89% 32 Missing ⚠️
src/gcpath/mcp_server.py 81.81% 6 Missing ⚠️
src/gcpath/hooks.py 77.77% 2 Missing ⚠️
src/gcpath/loaders.py 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
- Coverage   88.15%   87.44%   -0.71%     
==========================================
  Files          15       15              
  Lines        3182     3474     +292     
==========================================
+ Hits         2805     3038     +233     
- Misses        377      436      +59     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tardigrde tardigrde force-pushed the feat/sync-new-version branch from 385439f to 12086fd Compare June 19, 2026 04:52

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request addresses several security, correctness, and usability issues identified in an adversarial review. Key changes include restricting cache validity based on API mode and metadata completeness, securing cache file permissions to 0o600, unescaping path segments to fix round-trip conversion of escaped display names, enforcing strict scoping on cached hierarchies, and updating status commands to respect JSON/YAML formatting. Additionally, the MCP server was updated to enforce server-level scopes and utilize the disk cache. The review feedback highlights a critical issue where the MCP server unconditionally writes to the disk cache for arbitrary scopes, potentially overwriting the user's main global cache. It is recommended to restrict cache writes to None or the configured entrypoint, and update the corresponding test suite accordingly.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/gcpath/mcp_server.py
Comment on lines +117 to +123
write_cache(
hierarchy,
scope=scope,
via_resource_manager=not use_asset_api,
include_labels=include_labels,
include_tags=include_tags,
)

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.

high

Unconditionally writing the loaded hierarchy to the disk cache for arbitrary scopes will overwrite the user's main global/entrypoint disk cache file (~/.gcpath/cache.json). This causes subsequent CLI commands to suffer from cache scope mismatches, forcing slow live loads. The disk cache should only be written if the scope is None or matches the configured entrypoint. Please ensure read_config is imported at the top of the file rather than inline.

Suggested change
write_cache(
hierarchy,
scope=scope,
via_resource_manager=not use_asset_api,
include_labels=include_labels,
include_tags=include_tags,
)
entrypoint = read_config().get("entrypoint")
if scope is None or scope == entrypoint:
write_cache(
hierarchy,
scope=scope,
via_resource_manager=not use_asset_api,
include_labels=include_labels,
include_tags=include_tags,
)
References
  1. Place all imports at the top of the file, after any module docstrings and all declarations, to improve consistency and readability, following PEP 8 guidelines. (link)

Comment thread tests/test_mcp_server.py
Comment on lines +104 to +132
def test_get_hierarchy_refresh_loads_and_writes_disk_cache():
import gcpath.mcp_server as mcp_mod

mcp_mod._HIERARCHY_CACHE.clear()
loaded = make_test_hierarchy()
with (
patch.object(mcp_mod, "read_cache") as mock_read,
patch.object(mcp_mod, "write_cache") as mock_write,
patch.object(Hierarchy, "load", return_value=loaded) as mock_load,
):
result = mcp_mod._get_hierarchy(
use_asset_api=False,
scope="folders/1",
refresh=True,
include_labels=True,
include_tags=False,
)

assert result is loaded
mock_read.assert_not_called()
mock_load.assert_called_once()
mock_write.assert_called_once_with(
loaded,
scope="folders/1",
via_resource_manager=True,
include_labels=True,
include_tags=False,
)
mcp_mod._HIERARCHY_CACHE.clear()

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.

medium

Since we restricted write_cache in _get_hierarchy to only write when the scope is cacheable (i.e., None or the configured entrypoint), we should update this test to use scope=None so that it continues to test the write-cache path without needing to mock the configuration. Please ensure any required imports (like mcp_server) are placed at the top of the file.

def test_get_hierarchy_refresh_loads_and_writes_disk_cache():
    mcp_mod._HIERARCHY_CACHE.clear()
    loaded = make_test_hierarchy()
    with (
        patch.object(mcp_mod, "read_cache") as mock_read,
        patch.object(mcp_mod, "write_cache") as mock_write,
        patch.object(Hierarchy, "load", return_value=loaded) as mock_load,
    ):
        result = mcp_mod._get_hierarchy(
            use_asset_api=False,
            scope=None,
            refresh=True,
            include_labels=True,
            include_tags=False,
        )

    assert result is loaded
    mock_read.assert_not_called()
    mock_load.assert_called_once()
    mock_write.assert_called_once_with(
        loaded,
        scope=None,
        via_resource_manager=True,
        include_labels=True,
        include_tags=False,
    )
    mcp_mod._HIERARCHY_CACHE.clear()
References
  1. Place all imports at the top of the file, after any module docstrings and all declarations, to improve consistency and readability, following PEP 8 guidelines. (link)

@tardigrde tardigrde force-pushed the feat/sync-new-version branch from 12086fd to 45d12d7 Compare June 19, 2026 04:53
@tardigrde tardigrde merged commit 3f95486 into main Jun 19, 2026
8 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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