Skip to content

test: contract tests against real hermes-agent (CI + local staging clone) - #2

Merged
offendingcommit merged 1 commit into
mainfrom
feat/hermes-contract-tests
Jun 12, 2026
Merged

test: contract tests against real hermes-agent (CI + local staging clone)#2
offendingcommit merged 1 commit into
mainfrom
feat/hermes-contract-tests

Conversation

@offendingcommit

Copy link
Copy Markdown
Owner

Answers "does the kit have contract tests against actual hermes-agent source so it stays relevant?" — now yes.

What

tests/test_hermes_contract.py registers a kit-built @tool into the real hermes registry and asserts the kit's output still satisfies the runtime contract:

  • registry.get_definitions() (the actual {**schema, "name": ...} conversion the model receives) yields a function with populated parameters — the empty-{} failure mode this kit prevents, checked against real source.
  • registry.dispatch() runs the handler and the kit's required-arg validation in-band.
  • register_all's calls bind to the real inspect.signature(PluginContext.register_tool) — fails if upstream renames/removes a param the kit uses.

How it runs against upstream (CI + local)

  • CI: a hermes-contract job checks out NousResearch/hermes-agent into .hermes-agent and runs the contract module against upstream main.
  • Local: make test-contract clones hermes-agent into the same staging dir and runs it — identical to CI.
  • Skip-guarded: the module skips when hermes-agent isn't importable, so the default make test stays green standalone.

Verified locally against a fresh upstream clone: 3 contract tests pass. PyYAML is dev-only (runtime stays dependency-free).

Keeps the kit from silently drifting from upstream. tests/test_hermes_contract.py
registers a kit-built tool into the REAL hermes registry and asserts:
- registry.get_definitions() yields a function with populated parameters (the
  empty-{} failure mode, checked against the actual conversion);
- registry.dispatch() runs the handler and the kit's validation in-band;
- register_all's calls bind to the real PluginContext.register_tool signature.

Skip-guarded, so it's green standalone. Runs against upstream via a staging
clone: 'make test-contract' (clones NousResearch/hermes-agent into .hermes-agent)
and a CI 'hermes-contract' job that checks out upstream main. PyYAML added as a
dev-only dep (runtime stays dependency-free).
@offendingcommit
offendingcommit merged commit 09aa2c2 into main Jun 12, 2026
4 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