Compare commits
2 Commits
step35/595
...
step35/341
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
287aed33f7 | ||
|
|
8b3cbd3654 |
11
AGENTS.md
Normal file
11
AGENTS.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# AGENTS.md — Sovereign Operation Rules
|
||||||
|
|
||||||
|
## Hard Rules
|
||||||
|
|
||||||
|
### SIDECAR-5: Never commit directly to hermes-agent
|
||||||
|
|
||||||
|
**DO NOT COMMIT TO THIS REPO.** All custom work to the hermes-agent codebase must be done through sidecar repositories (e.g., `timmy-config`, `timmy-home`, etc.). Use the sidecar overlay mechanism; do not edit files inside `~/.hermes/hermes-agent` directly.
|
||||||
|
|
||||||
|
Commits directly to `hermes-agent` are blocked by a pre-commit guard. If you need to make a change, create an issue or PR from the appropriate sidecar repo.
|
||||||
|
|
||||||
|
**Rationale:** Direct commits cause drift, break updates, and violate sovereignty. Changes belong in sidecars where they can be versioned, reviewed, and deployed cleanly.
|
||||||
16
deploy.sh
16
deploy.sh
@@ -58,6 +58,12 @@ for f in "$SCRIPT_DIR"/memories/*; do
|
|||||||
done
|
done
|
||||||
log "memories/ -> $HERMES_HOME/memories/"
|
log "memories/ -> $HERMES_HOME/memories/"
|
||||||
|
|
||||||
|
# === Deploy AGENTS.md (sidecar boundary rule) ===
|
||||||
|
if [ -f "$SCRIPT_DIR/AGENTS.md" ]; then
|
||||||
|
cp "$SCRIPT_DIR/AGENTS.md" "$HERMES_HOME/AGENTS.md"
|
||||||
|
log "AGENTS.md -> $HERMES_HOME/ (SIDECAR-5 rule)"
|
||||||
|
fi
|
||||||
|
|
||||||
# === Deploy skins ===
|
# === Deploy skins ===
|
||||||
for f in "$SCRIPT_DIR"/skins/*; do
|
for f in "$SCRIPT_DIR"/skins/*; do
|
||||||
[ -f "$f" ] && cp "$f" "$HERMES_HOME/skins/"
|
[ -f "$f" ] && cp "$f" "$HERMES_HOME/skins/"
|
||||||
@@ -86,6 +92,16 @@ done
|
|||||||
chmod +x "$HERMES_HOME/bin/"*.sh "$HERMES_HOME/bin/"*.py 2>/dev/null || true
|
chmod +x "$HERMES_HOME/bin/"*.sh "$HERMES_HOME/bin/"*.py 2>/dev/null || true
|
||||||
log "bin/ -> $HERMES_HOME/bin/"
|
log "bin/ -> $HERMES_HOME/bin/"
|
||||||
|
|
||||||
|
# === Install SIDECAR-5 pre-commit guard on hermes-agent repo ===
|
||||||
|
if [ -d "$HERMES_HOME/hermes-agent/.git" ]; then
|
||||||
|
HOOK_SRC="$SCRIPT_DIR/hermes-sovereign/githooks/hermes-agent-pre-commit"
|
||||||
|
if [ -f "$HOOK_SRC" ]; then
|
||||||
|
cp "$HOOK_SRC" "$HERMES_HOME/hermes-agent/.git/hooks/pre-commit"
|
||||||
|
chmod +x "$HERMES_HOME/hermes-agent/.git/hooks/pre-commit"
|
||||||
|
log "Installed hermes-agent pre-commit drift guard (SIDECAR-5)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${1:-}" != "" ]; then
|
if [ "${1:-}" != "" ]; then
|
||||||
echo "ERROR: deploy.sh no longer accepts legacy loop flags." >&2
|
echo "ERROR: deploy.sh no longer accepts legacy loop flags." >&2
|
||||||
echo "Deploy the sidecar only. Do not relaunch deprecated bash loops." >&2
|
echo "Deploy the sidecar only. Do not relaunch deprecated bash loops." >&2
|
||||||
|
|||||||
10
hermes-sovereign/githooks/hermes-agent-pre-commit
Executable file
10
hermes-sovereign/githooks/hermes-agent-pre-commit
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# SIDECAR-5: Pre-commit guard for hermes-agent
|
||||||
|
# Blocks all commits directly to the hermes-agent repository.
|
||||||
|
# This repository is managed via sidecar overlays; commit attempts indicate drift.
|
||||||
|
# Use --no-verify to bypass only in exceptional cases (e.g., guard installation).
|
||||||
|
|
||||||
|
echo "ERROR: Commits to hermes-agent are blocked by SIDECAR-5 drift guard." >&2
|
||||||
|
echo "All custom work must go through sidecar repositories (timmy-config, timmy-home, etc.)." >&2
|
||||||
|
echo "If you need to modify hermes-agent, file an issue on the appropriate sidecar." >&2
|
||||||
|
exit 1
|
||||||
6
memories/SIDECAR_BOUNDARY.md
Normal file
6
memories/SIDECAR_BOUNDARY.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
SIDECAR-5: Drift Guard — Never commit directly to hermes-agent.
|
||||||
|
All modifications must go through sidecar repos (timmy-config, timmy-home, etc.).
|
||||||
|
Pre-commit hook blocks commits; AGENTS.md rule enforced; violations logged.
|
||||||
|
§
|
||||||
|
2026-04-30 — Guard installed: pre-commit hook in ~/.hermes/hermes-agent/.git/hooks/,
|
||||||
|
AGENTS.md rule deployed, agent_guardrails updated. Never bypass without explicit approval.
|
||||||
@@ -20,6 +20,8 @@ from typing import List, Dict, Tuple
|
|||||||
|
|
||||||
# Patterns adapted from hermes-agent/agent/input_sanitizer.py
|
# Patterns adapted from hermes-agent/agent/input_sanitizer.py
|
||||||
EXTRACTION_PATTERNS = [
|
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+the\s+words\s+above",
|
||||||
r"repeat\s+your\s+(?:system\s+|initial\s+)?instructions",
|
r"repeat\s+your\s+(?:system\s+|initial\s+)?instructions",
|
||||||
r"what\s+is\s+your\s+(?:system\s+|initial\s+)?prompt",
|
r"what\s+is\s+your\s+(?:system\s+|initial\s+)?prompt",
|
||||||
|
|||||||
25
tests/test_sidecar_guard.py
Normal file
25
tests/test_sidecar_guard.py
Normal 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")
|
||||||
Reference in New Issue
Block a user