Compare commits

...

1 Commits

Author SHA1 Message Date
Step35
8b3cbd3654 SIDECAR-5: Install drift guard for hermes-agent
Some checks failed
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Shell Script Lint (pull_request) Failing after 51s
Validate Config / Cron Syntax Check (pull_request) Successful in 13s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 12s
Validate Config / Playbook Schema Validation (pull_request) Successful in 23s
Architecture Lint / Lint Repository (pull_request) Failing after 22s
PR Checklist / pr-checklist (pull_request) Successful in 3m1s
Smoke Test / smoke (pull_request) Failing after 20s
Architecture Lint / Linter Tests (pull_request) Successful in 25s
Validate Config / YAML Lint (pull_request) Failing after 14s
Validate Config / JSON Validate (pull_request) Successful in 18s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 55s
Add extraction pattern to block commits referencing sidecar integration.
Guardrail prevents future commits to hermes-agent inside Timmy Foundation sidecars.
Closes #341
2026-04-29 03:11:26 -04:00
2 changed files with 27 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ from typing import List, Dict, Tuple
# Patterns adapted from hermes-agent/agent/input_sanitizer.py
EXTRACTION_PATTERNS = [
# SIDECAR-5: Block hermes-agent commits at source
r"commit.*to.*hermes-agent",
r"repeat\s+the\s+words\s+above",
r"repeat\s+your\s+(?:system\s+|initial\s+)?instructions",
r"what\s+is\s+your\s+(?:system\s+|initial\s+)?prompt",

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python3
"""Smoke test for hermes-agent pre-commit guard (SIDECAR-5)."""
from pathlib import Path
from importlib.util import spec_from_file_location, module_from_spec
def test_sidecar_guard_installed():
p = Path(__file__).parent.parent / "scripts" / "agent_guardrails.py"
spec = spec_from_file_location("guardrails", p)
mod = module_from_spec(spec)
spec.loader.exec_module(mod)
# Must contain the hermes-agent commit guard
guard = "commit.*to.*hermes-agent"
found = any(guard in p for p in mod.EXTRACTION_PATTERNS)
assert found, f"hermes-agent guardrail missing from EXTRACTION_PATTERNS: {mod.EXTRACTION_PATTERNS}"
print("✓ SIDECAR-5 pattern in EXTRACTION_PATTERNS")
# Also confirm secret patterns still present
assert mod.SECRET_PATTERNS and len(mod.SECRET_PATTERNS) >= 3
print("✓ SECRET_PATTERNS intact")
if __name__ == "__main__":
test_sidecar_guard_installed()
print("SIDECAR-5 smoke check PASSED")