mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-16 19:36:54 +00:00
Activation reaches plugin discovery before the application dependencies exist. Give PM its own locked Python project and runtime so it can install or repair the application without importing that dependency tree. Keep PM outside the application workspace. A shared uv workspace resolves the application graph and cannot provide this isolation. Route mutations through an isolated worker and preserve transaction callbacks, cancellation, custom package registrations, and correlated receipts. Use the same runtime builder for source installs and packaged payloads. Keep offline wheelhouse support in that builder. Nix builds the independent PM lock as a separate derivation. Refuse lazy-disabled bootstrap before installing tools or dependencies. Move first-party YAML readers and writers to ruamel. Keep the application lock's transitive PyYAML requirements for third-party packages. Verification: - Focused canonical Python suite: 177 passed, 1 host-gated skip. - Electron backend probes: 12 passed. Electron typecheck passed. - Both uv locks, scoped lint, Bash syntax, and whitespace checks passed. - Cold activation, corrupt-app repair, offline staging, and relocation ran. - Built and exercised the Nix PM runtime and standalone YAML merge script. Six broader caller test files retain the same 24 failing test IDs as an archive of HEAD. The existing real-home guard blocks those tests before they can exercise the affected paths. No full-suite pass is claimed. Native Windows signing and full Bionic package execution remain unverified.
21 lines
1.1 KiB
Python
21 lines
1.1 KiB
Python
import hermes_yaml as yaml
|
|
from tools import approval
|
|
|
|
|
|
def test_legacy_string_allowlist_recovers_only_string_lists(tmp_path, monkeypatch, caplog):
|
|
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
|
|
description = "script execution via -e/-c flag"
|
|
for value in ([description], yaml.safe_dump([description])):
|
|
(tmp_path / "config.yaml").write_text(yaml.safe_dump({"command_allowlist": value}))
|
|
assert approval.load_permanent_allowlist() == {description}
|
|
assert approval.is_approved("probe", description)
|
|
assert "command_allowlist" in caplog.text
|
|
|
|
|
|
def test_malformed_allowlist_does_not_grant_approval(tmp_path, monkeypatch, caplog):
|
|
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
|
|
for value in ("plain text", "[bad", {"not": "a list"}, [True, "candidate"], "[true, candidate]", 42):
|
|
(tmp_path / "config.yaml").write_text(yaml.safe_dump({"command_allowlist": value}))
|
|
assert approval.load_permanent_allowlist() == set()
|
|
assert not approval.is_approved("probe", "candidate")
|
|
assert "command_allowlist" in caplog.text
|