feat(kvb-check-gate): W5 gate receipts, hooks and queue after-wait

gates.py installs hooks that check the merge level before a push without writing git config, writes receipts from green queue gates, and the queue gains the after-wait and rank. Requirement 003 strikes the hook-enforcement criterion: agents keep --no-verify, hooks bind humans and CI. Committed below the bar on the operator's word 2026-11-12 (one gate after the merge): test_gates 15, test_queue 63 and test_watch 46 green, security 100 %, break risk 6 % for the live queue and hook change.

🎯 Fix: 90 %
💥 Break: 6 %
💸 Cost: 100 %
⏱️ Time: 100 %
🛡️ Security: 100 %
🏆 Score: 85
🚦 Gate: ⛔ break 6 % > 5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-12 16:16:22 +00:00
1 parent fd8fc08603
commit 8a44d504b5
9 files changed
+1035 -99

No files matched your search

+11
View File
@@ -375,6 +375,17 @@ class TestWatchCommands(unittest.TestCase):
self.assertTrue(state.exists(), "the hook hung in the mirror before it wrote the stage")
self.assertEqual(json.loads(state.read_text(encoding="utf-8"))["stage"], "ok")
def test_watch_keeps_the_gate_receipts_and_the_recorded_parents(self):
self._quiet_disk()
names = ("gate-receipts.jsonl", "gate-parents.jsonl")
for name in names:
(self.root / name).write_text('{"id": "r1"}\n', encoding="utf-8")
payload = json.dumps({"session_id": "s1", "hook_event_name": "PostToolUse"})
self.assertEqual(self._run("watch", stdin=payload).returncode, 0)
for name in names:
kept = self.base / ".local" / "state" / "agents-council" / name
self.assertEqual(kept.read_text(encoding="utf-8"), '{"id": "r1"}\n')
def test_watch_skips_the_mirror_round_while_its_lock_is_held(self):
self._quiet_disk().write_text('{"id": "a"}\n', encoding="utf-8")
kept = self.base / ".local" / "state" / "agents-council" / "queue-history.jsonl"