Files
timmy-config/tests/test_sidecar_guard.py
Step35 8b3cbd3654
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
SIDECAR-5: Install drift guard for hermes-agent
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

26 lines
982 B
Python

#!/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")