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

+12 -4
View File
@@ -5,9 +5,11 @@ Usage:
watch.py watch hook (UserPromptSubmit, PostToolUse): measure at most once
per interval machine-wide, act on the stage, show alerts,
and append the rows of <root>/queue-history.jsonl
(kvb-org-queue) and <root>/security-accepted.jsonl
(kvb-check-security) whose id it lacks to the same name
under ~/.local/state/agents-council/
(kvb-org-queue), <root>/security-accepted.jsonl
(kvb-check-security), <root>/gate-receipts.jsonl and
<root>/gate-parents.jsonl (kvb-check-gate) whose id it
lacks to the same name under
~/.local/state/agents-council/
watch.py block hook (PreToolUse on Bash): exit 2 for a heavy job while the
disk stage is stop or critical, the memory stage is stop
or cannot be judged without memory_limits, or a
@@ -104,7 +106,13 @@ HISTORY = ROOT / "queue-history.jsonl"
KEPT_HISTORY = KEPT / "queue-history.jsonl"
ACCEPTED = ROOT / "security-accepted.jsonl"
KEPT_ACCEPTED = KEPT / "security-accepted.jsonl"
MIRRORED = ((HISTORY, KEPT_HISTORY), (ACCEPTED, KEPT_ACCEPTED))
RECEIPTS = ROOT / "gate-receipts.jsonl"
KEPT_RECEIPTS = KEPT / "gate-receipts.jsonl"
PARENTS = ROOT / "gate-parents.jsonl"
KEPT_PARENTS = KEPT / "gate-parents.jsonl"
MIRRORED = (
(HISTORY, KEPT_HISTORY), (ACCEPTED, KEPT_ACCEPTED), (RECEIPTS, KEPT_RECEIPTS), (PARENTS, KEPT_PARENTS),
)
ALERT_TTL = 3600
CLIP = 1000
CLEANUP_LOCK = "cleanup.lock"