Commit Graph

1 Commits

Author SHA1 Message Date
Alexander Whitestone
9385e07393 M1: The Stop Protocol (#844)
Some checks failed
CI / test (pull_request) Failing after 1m9s
CI / validate (pull_request) Failing after 1m16s
Review Approval Gate / verify-review (pull_request) Failing after 10s
Implements an unbreakable hard interrupt for agentic systems.

**Core module (nexus/stop_protocol.py):**
- Pre-tool-check gate: blocks tool execution when a stop is active
  (raises StopInterrupt)
- STOP_ACK logging: append-only JSONL at ~/.hermes/stop_ack_log.jsonl
- Hands-off registry: time-bounded locks at ~/.hermes/hands_off_registry.json
  (default 24h, auto-expires)
- Full stop: atomic ack + hands-off in one call
- Graceful handling of corrupted registry (starts empty, does not crash)

**Compliance tests (tests/test_stop_protocol.py):**
- 20 tests covering pre-tool-check gate, STOP_ACK logging, hands-off registry,
  full stop, edge cases, and invalid-state recovery
- 100% compliance verification: test_all_stop_paths_covered

**Documentation (docs/stop-protocol.md):**
- Usage examples, component descriptions, and local test command

Closes #844
2026-04-22 02:15:24 -04:00