feat(mcp): grafted_context_fetch tool — extends devagentic-lane-h plugin (#71 PR2)#72
Merged
Merged
Conversation
This was referenced May 24, 2026
Merged
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.
PR2 of 3 closing #71. Depends on TechDevGroup/devagentic#220 (graftedContextById query — merge that first).
Summary
plugins/devagentic-lane-h/client.pywithfetch_grafted_context(graft_id, user_id=None)— wraps the newgraftedContextByIdGraphQL query. Pattern mirrors existingfetch_reasoning_graftexactly (same plugin, same transport, same fail-soft contract).grafted_context_fetch(graft_id, user_id?)MCP tool inmcp_serve.py::_register_lane_h_toolsnext tolane_h_fetch.grafted_context_fetch).Why this plugin
The Lane H read pattern (G4 / hermes-agent#58) and the lazy-load preamble pattern (#71) are structurally identical — both fetch single per-user docs by id. Putting them in the same plugin keeps the worker's mental model simple (one "fetch a graft" surface, two doc kinds underneath).
Test plan
tests/plugins/devagentic-lane-h/test_grafted_context_fetch.pycover: empty graft_id guard, missing user_id guard, happy path, user_id arg override, null doc → actionable error, network error, GraphQL errors, non-dict response.test_client.pystill pass — no regression to the existinglist_reasoning_grafts/fetch_reasoning_graft.create_mcp_server()smoke registers 33 tools;grafted_context_fetch+lane_h_fetchboth present.Next in series
[graft_id | source | path | 1-line abstract]) instead of full graft bodies + injects "use grafted_context_fetch(graft_id) to load full content" instruction. Cuts ~30KB of per-turn preamble noise for verticals with many grafts; matches the saturation observation from G1 preamble doesn't scale past ~10 grafts even with caps — needs carving / lazy-load / summarization #71.Notes
user_idarg supports operator-side queries from a different profile (e.g. inspecting another vertical's grafts from your hermes session). Defaults to the active profile when omitted — the usual case.