devagentic-docs: MVP plugin (/doc search | write | show)#19
Merged
Conversation
Sibling to devagentic-canvas — same env conventions, same loss- tolerant contract, same enable/disable semantics. Surfaces three slash commands: /doc search <query> [--tag t] [--limit N] /doc write <body> [--tags a,b,c] (auto-tags source:hermes-cli) /doc show <id> Client mirrors the canvas plugin's last_error_text() pattern from #15, so slash commands surface auth / 404 / unreachable / parse / no-user-id specifically instead of opaque "command failed." MVP scope: no /fork commands and no pre_llm_call hook — both are in the #12 proposal and tracked as follow-up. Keeping this PR small + verifiable per the charter. Closes #12 (MVP scope).
3 tasks
PowerCreek
added a commit
that referenced
this pull request
May 22, 2026
#20) Two changes in this PR — one a defect fix, one the rest of #12's proposed scope. Schema fix (defect in #19 MVP): - The actual schema is searchDocs(query, k), not (query, limit, tag). My PR #19 shipped invalid GraphQL that the server would reject. Confirmed via introspection of devagentic's live schema. - Route /doc search differently: with --tag, hit Query.docs(tags:[t]) and filter client-side; without --tag, hit Query.searchDocs(query, k). - Doc shape: drop `score` (not on Doc); add `source`, `ts`. /fork surface (#12 follow-up): - /fork open <parent_id> [--goal "..."] wraps forkContext, sets a marker at $HERMES_HOME/docs-fork-active (sibling to canvas-active). - /fork close clears the marker. - /fork show prints active fork tags + annotations via context(id). - /fork pin <doc_id> appends a pinned-doc annotation via decorateContext. - /fork render exposes renderContext(ctxId) directly — useful for debugging the preamble injection. pre_llm_call hook: - When a fork is active, calls renderContext(ctxId) and returns {context: header + rendered} for the host to append to the user message. Capped at 8000 chars hermes-side; devagentic does its own bounding upstream. - Returns None (turn proceeds without preamble) on any failure path: no marker, render returns None, render returns "". Tests: 45 passed (43 prior + 2 net new after schema-fix rewrites). The fixture now eagerly pre-loads all three submodules so monkeypatches on plugin_pkg.client reach preamble's docs_client reference. Closes #12 in full.
This was referenced May 22, 2026
PowerCreek
added a commit
that referenced
this pull request
May 22, 2026
Mirrors the canvas-tools pattern (#56) for the just-shipped devagentic-docs plugin (#12 / PRs #19+#20+#23). MCP-aware clients (Claude Code, Cursor, Codex) can now writeDoc / searchDocs / forkContext / decorateContext / renderContext against any devagentic instance hermes is configured for. New tools (7): - doc_search(query, limit, tag) → search_docs - doc_write(content, tags, source) → write_doc - doc_show(doc_id) → get_doc - fork_open(parent_id, goal, tags) → fork_context (auto-pins parent + threads goal) - fork_decorate(ctx_id, key, value, weight) → decorate_context - fork_get(ctx_id) → get_context - fork_render(ctx_id) → render_context (envelope: {ctx_id, rendered}) Loader pattern: _resolve_docs_client() mirrors _resolve_canvas_client at line 880 — file-path import of plugins/devagentic-docs/client.py since the hyphenated dir isn't a Python package. Failure semantics: every tool returns {"error": "<msg>"} JSON. The plugin's last_error_text() pattern (introduced in #15) threads through via a _reason() helper, so federated agents see the same actionable hints CLI users get — e.g. on the canonical devbox deployment (where /graphql isn't exposed, see #21), they'd see "not found at <url>/graphql ..." instead of an opaque None. Out of scope per #24: fork_close + fork_pin depend on the session-local $HERMES_HOME/docs-fork-active marker, which doesn't translate to MCP's stateless tool model. fork_open auto-tags with source:hermes-mcp so MCP-authored forks are distinguishable from CLI-authored ones (source:hermes-cli). Tests: 22 new (tests/test_mcp_docs.py) covering registration, plugin-missing fallback, arg routing, last_error surfacing for the #21 case, and the real-import smoke. All passing alongside canvas MCP suite (14 existing) and the broader devagentic- adjacent test set (159 total). Closes #24.
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
Closes #12 (MVP scope). First proof-of-concept for the synergy-charter "agent-context federation skills exposed to hermes" item. New
plugins/devagentic-docs/is a structural sibling toplugins/devagentic-canvas/— same env conventions, same enable/disable contract, same loss-tolerant failure semantics.Surface
/doc search <query> [--tag <tag>] [--limit N]—searchDocsGraphQL primitive/doc write <body> [--tags a,b,c]—writeDoc, auto-tagged withsource:hermes-cli/doc show <id>— identity-verified top-1 search matchFailure loudness
Client mirrors the
last_error_text()pattern shipped for canvas in #15 + #16. Slash commands print a specificReason:clause on any failure (auth, 404, unreachable, parse, GraphQL errors, no user_id), so operators don't have to grep DEBUG logs.Deliberately out of scope for MVP
/fork open <doc_id>+/fork close— proposed in [synergy] Add devagentic-docs plugin: /doc search + /doc write + ephemeral finding-injection (sibling to devagentic-canvas) #12 body. Need the marker-file plumbing the canvas plugin uses. Follow-up.pre_llm_callhook for pinned-doc context injection — proposed in [synergy] Add devagentic-docs plugin: /doc search + /doc write + ephemeral finding-injection (sibling to devagentic-canvas) #12 body. Depends on the/forkmarker. Follow-up./doc delete— devagentic's doc graph is append-only.Filing each as its own follow-up issue would be premature; will surface them as scope deltas if #12 stays open after this lands.
Test plan
tests/test_devagentic_docs_plugin.py: manifest, base-URL handling, failure-loudness (5 cases), search rendering, write tagging, dispatcher routing.pytest tests/test_devagentic_docs_plugin.py→ 25 passed.pytest tests/test_devagentic_{canvas,skills,memory}_plugin.py tests/hermes_cli/test_doctor_devagentic_graph.py→ 76 passed (43 + 27 + … existing).Filed by hermes-maintainer (PowerCreek).