feat(mcp): graph-backed sections in get_context with structured handoff and VOR filter - #30
Merged
Merged
Conversation
…ff and vor filter New deterministic sections assembled from the PropertyGraph (no LLM): dataflow (ASSIGNED_FROM/TO chains with condition_path for local variables), writes (WRITES edges), receipts (ActionReceipts filtered by target file), tests (affected tests from impact affected_files). Wired into intent profiles: modify/debug/prepare_change/verify_change/test; budgets and priorities extended. Structured handoff: _section_symbols now carries meta (file_path/line/symbol/affected_files) consumed by source/git and the new sections; regex text-parsing demoted to fallback. Memory section applies VOR filtering: only VERIFIED/ACTIVE (or status-less) nodes are shown. Lazy SymbolIndexAdapter init; every new section degrades to None when the graph is unavailable. 12 new tests (test_context_sections.py): 14 passed with existing context_tool tests; full suite 1659 passed / 9 skipped / 91 deselected; ruff clean. Refs: agent-research on Anthropic code-execution-with-mcp + writing-tools-for-agents (tool consolidation, meaningful context, token efficiency).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
added 2 commits
September 8, 2026 16:48
The test job started exceeding the 10-minute job timeout once get_context v2 (+433 lines, 12 tests) and the collect() work landed: locally the suite takes ~15.6 min with coverage. Observed: job 102074901674/102093822441 timed out at 10 min mid-suite (last file test_hybrid_cache.py, all tests green up to that point). clean-state (same suite, filtered) stays green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_contextv2 — the tool now assembles deterministic, graph-backed context sections (no LLM), following the Anthropic "code execution with MCP" / "writing effective tools for agents" guidance (tool consolidation, meaningful context, token efficiency).New sections (all degrade gracefully to absent when data is unavailable)
condition_pathfor local variables of the target file (candidate variables derived deterministically from local assignments in the source window; verified against the live graph: chain entries carrycondition_path).affected_files.Structural improvements
_section_symbolsnow carriesmeta(file_path/line/symbol/affected_files) consumed bysource/gitand the new sections; regex text-parsing demoted to a fallback path (root cause of fragility identified in review).VERIFIED/ACTIVE(or status-less) nodes are shown — REFUTED/INCONCLUSIVE/STALE are no longer surfaced (protocol §9.5 verify-on-read).SymbolIndexAdapterinit; new sections wired into intent profiles (modify/debug/prepare_change/verify_change/test) with budgets/priorities;TOKEN_LIMITkept at 2000.Evidence
tests/test_context_sections.py): 14 passed together with existing context_tool tests.condition_path; receipts ledger empty → section omitted.Notes / follow-ups
WRITESedges proved empty at method level on the current graph build — section degrades to omitted; revisit when more WRITES edges are indexed.detail=name|desc|full), narrow default toolset, tool-health consolidation report, E-11 "Bundle vs Relay" eval.