Skip to content

The agent that grows with you

fix(plugins): validate requires_hermes from manifest module

jinli.ylc4c508579d87
diff --git a/hermes_cli/plugin_validate.py b/hermes_cli/plugin_validate.py
index 3555df2e77f..bcc7cb9943f 100644
--- a/hermes_cli/plugin_validate.py
+++ b/hermes_cli/plugin_validate.py
@@ -74,11 +74,11 @@ class ValidationReport:
def _requires_hermes_spec_valid(spec: str) -> bool:
"""Strictly validate a ``requires_hermes`` spec.
- Unlike :func:`hermes_cli.plugins._version_satisfies` (permissive at load
+ Unlike :func:`hermes_cli.plugins_manifest.version_satisfies` (permissive at load
time), validation REJECTS clauses whose version segment doesn't parse —
a typo'd spec should fail admission, not silently gate nothing.
"""
- from hermes_cli.plugins import _VERSION_COMPARATOR_RE, _version_tuple
+ from hermes_cli.plugins_manifest import _VERSION_COMPARATOR_RE, _version_tuple
for clause in spec.split(","):
clause = clause.strip()
diff --git a/tests/hermes_cli/test_plugin_validate.py b/tests/hermes_cli/test_plugin_validate.py
index 4398b517f80..afe626a675a 100644
--- a/tests/hermes_cli/test_plugin_validate.py
+++ b/tests/hermes_cli/test_plugin_validate.py
@@ -33,6 +33,16 @@ BASE_MANIFEST = {
}
+def test_requires_hermes_spec_is_validated(tmp_path):
+ manifest = dict(BASE_MANIFEST, requires_hermes=">=0.21")
+ d = _make_plugin(tmp_path, manifest=manifest)
+
+ report = validate_plugin_dir(d)
+
+ assert report.ok, report.failures
+ assert ("requires_hermes", True, "spec '>=0.21' parses") in report.checks
+
+
class TestCapabilityProbe:
def test_undeclared_tool_registration_fails_with_diff(self, tmp_path):
init = (