feat(mcp): assert_output MCP tool — G2b (closes #60)#92
Merged
Conversation
Wraps devagentic's ``assertOutput(callId, expectation:
{fragment, predicate?}) -> Verdict`` mutation as an MCP tool.
Workers can now vet a prior tool_call's output against a
predicate without shelling out to ``python api.py``.
## Implementation
- ``plugins/devagentic-mutations/client.py::assert_output(call_id,
fragment, predicate=None)`` — thin GraphQL wrapper following the
``query_silo`` / ``run_confer_loop`` pattern. Returns the verdict
dict ``{id, ts, callId, passed, violations}`` on success or
``None`` on failure (auth, network, ``errors`` payload).
- ``mcp_serve.py::_register_devagentic_mutation_tools`` — adds the
``assert_output`` MCP tool. Flat args ``(call_id, fragment,
predicate=None)``; mapped to the ``ExpectationInput`` GraphQL
shape internally. Failure path returns ``{"error": "..."}`` JSON
with the plugin's ``last_error_text()`` surface threaded in.
## Predicate stiffener interop
When ``predicate`` is omitted or empty, the wrapper passes ``None``
to devagentic — explicitly matching the resolver's
``_stiffen_predicate(tool, None) -> tool-specific floor`` path.
This is what triggers the ``kind:predicate-coerced`` telemetry doc
on the devagentic side (arc-6 audit trail). Tested with two
parametric cases: omitted predicate, empty-string predicate.
## Tests
- 7 new client-level tests in tests/plugins/devagentic-mutations/
test_client.py: empty-arg fail-soft, missing user_id fail-soft,
happy-path verdict round-trip, predicate-omitted-sends-null,
empty-predicate-sends-null, null-data fail-soft, non-dict-response
fail-soft.
- Contract test in tests/test_mcp_defensive_registrars.py extended:
``assert_output`` is now in the required-G2-tools set, so a future
regression that drops the registrar will surface in CI.
- 182 total green across the affected suites (mutations + MCP +
canvas + docs + subset-filter + autowire). No regression.
## Tracking
- Closes hermes-agent#60 (G2b of #56).
- G2c (#61: patchArtifact / readArtifact) and G2d (#62: fetchUrl)
remain open as sub-issues.
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 #60 (G2b sub-issue of #56). Adds the
assert_outputMCP tool — third devagentic-mutation wrapper aftersilo_queryandconfer_run.Workers can now vet a prior
tool_call's output against a predicate without shelling out topython api.py.Schema
Wraps devagentic's:
Devagentic-side resolver:
/tmp/devagentic_api.py:21363(verified viagh api).MCP tool signature
Returns JSON
{id, ts, callId, passed, violations}on success,{"error": "..."}on failure.Predicate stiffener interop
When
predicateis omitted or empty, the wrapper passesNoneto devagentic — matching the resolver's_stiffen_predicate(tool, None) -> tool-specific floorpath. Triggers thekind:predicate-coercedaudit doc (devagentic arc-6 telemetry). Both cases (omitted, empty-string) have parametric tests.Test plan
tests/plugins/devagentic-mutations/test_client.pypasstests/test_mcp_defensive_registrars.pyextended;assert_outputnow in required-G2-tools setassert_outputreachable via MCP from a polynomial-explorer worker sessionTracking