Skip to content

Review fix: refresh live MCP-03 working-tree indices and preserve read errors - #16

Merged
patrickdugan merged 2 commits into
gym/mcp-local-retrieval-20261119from
review/mcp03-live-worktree-cache-20261121
Nov 21, 2026
Merged

patrickdugan merged 2 commits into
gym/mcp-local-retrieval-20261119from
review/mcp03-live-worktree-cache-20261121

Conversation

@patrickdugan

Copy link
Copy Markdown
Contributor

Review of Carbon's MCP-01/02/03 and Bonsai Hubrun gyms

The complete retrieval gym in PR #14 is a useful benchmark scaffold. MCP-02's synthetic learned routers show meaningful gains under difficult index layouts, while MCP-03's SWE-bench repository transfer exposes a symbol-read bottleneck. The Hubrun Bonsai comparison highlights the regression of line-bag compaction on mutable document editing.

One independently testable correctness problem is in the live Goose MCP server: MCP/mcp03/goblin_server.py caches a full source/AST/index by directory forever, regardless of edits made during an agent session. A subsequent read_symbol can return old source after a patch or new file. It also wraps CodeEnv.read_symbol errors with isError: false.

Changes

  • Local working-tree revision from Python file paths, metadata and inode, respecting SKIP_DIRS; both snapshot and index refresh after edits, additions or deletions.
  • Concurrent-change detection while rebuilding, with a retryable error.
  • worktree_revision included with packet/read result so downstream traces can distinguish generations.
  • Proper propagation of isError from CodeEnv on invalid symbol reads.
  • Regression tests for edits, additions, deletion, ignored directories and error flags, plus a short review note.

Evidence limits and follow-up

The revision key uses metadata for ordinary filesystem freshness, not a cryptographic content digest. For an evaluation source lock, use a pinned git commit or a SHA-256 content manifest. Real model performance is unaltered and has not been rerun. See MCP/mcp03/WORKTREE_CACHE_REVIEW.md.

Additional prioritized findings for PR #14 review: persistent typed negative-evidence/edit-state ledger for Hubrun compaction, explicit read-symbol utility training to remedy MCP-03 symbol starvation, and clean separation between gold-file localization and native SWE-bench patch resolution.

This PR targets the MCP gym feature branch rather than master, to allow Carbon to integrate it without pulling the entire 248-file gym PR ahead of review.

@patrickdugan
patrickdugan merged commit 7e90a2d into gym/mcp-local-retrieval-20261119 Nov 21, 2026
2 checks passed
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