feat(orchestrator): triage, dialog-bound cards and silent expired drops on the hub

093: triage.py classifies every request as open, failed, expired or
stale; POST /api/requests/dismiss hides many requests hub-wide under one
passkey signature with the usual undo window, ledger dismissals.json.
094: an ask or hooked decision lives as long as its Claude dialog: the
hook waits the hub Settings' hook wait (1-60 min, default 60), PostToolUse,
Stop, UserPromptSubmit and SessionEnd hooks close the session's cards,
and a card whose hook stopped waiting reads open in Claude. Closes are
bound to a per-session closer token whose sha256 the hub stores, so a
local process cannot close another session's cards or forge a choice.
GET /api/match/closed lets the page drop closed cards within 5 s.
096: the release signs dismissals of dropped expired cards together with
the inbox entries; no radio reaches the agent.
088: the prune list is no longer capped at 50 tasks.
091: nvidia-smi's error line reaches the GPU row as its cause; limits
take a batch of staged values under one proof.

MEDUSA: 57 findings accepted as false positives after an independent
skeptic review and the operator's word (MM-SCAN-058 regex PLA matching
replay/place/replace, CODEGEN-SCAN-001 on Map.delete and labels,
fixed nvidia-smi argv, localhost-only hook URLs, passkey in tooltips).

Gate missed on the operator's word: break 8 %, the E2E runs after the
page bundle; operator must run make orchestrator-hook and restart every
Claude Code session after the install.

🎯 Fix: 92 %
💥 Break: 8 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 85
🚦 Gate: ⛔ break 8 % > 5

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-28 01:21:37 +00:00
1 parent 909ea85605
commit 8ee52644c8
25 files changed
+1531 -130

No files matched your search

+7 -6
View File
@@ -21,6 +21,7 @@ CALL = signing.call_key("Bash", {"command": "make deploy"})
OTHER = signing.call_key("Bash", {"command": "make deploy", "run_in_background": True})
CALLED = {**ASK, "call_key": CALL}
QUESTION = {"question": "Clean up the two worktrees?", "options": [{"label": PICK, "description": "Both are merged"}], "session": "s1", "timeout": 60, "multi": False}
NONE = {"asks": [], "decisions": []}
class TestExpiredFilter(unittest.TestCase):
@@ -121,20 +122,20 @@ class TestExpiredRelease(MatchCase):
report = {"call_key": CALL, "session": "s1"}
self.assertEqual(self.ran(report, {"Host": self.host})[0], 403)
self.assertEqual(self.ran(report, {**self.local(), "Origin": "http://evil.example"})[0], 403)
self.assertEqual(self.ran(report, self.local()), (200, {"closed": first}))
self.assertEqual(self.ran(report, self.local()), (200, {**NONE, "asks": [first]}))
record = self.httpd.hub.asks.get(first)
self.assertEqual((record["status"], record["proof"]), (TERMINAL, None))
self.assertEqual(self.ask_status(first, "0"), TERMINAL)
self.assertEqual(self.httpd.hub.asks.get(second)["status"], "pending")
self.assertNotIn(f"ask:{first}", [card["id"] for card in self.cards()])
self.assertEqual(self.ran(report, self.local()), (200, {"closed": second}))
self.assertEqual(self.ran(report, self.local()), (200, {"closed": None}))
self.assertEqual(self.ran(report, self.local()), (200, {**NONE, "asks": [second]}))
self.assertEqual(self.ran(report, self.local()), (200, NONE))
self.assertEqual(self.post_json("/api/sign", {"items": [self.denial("ask", first, "Skills")]}, self.guard(self.host))[0], 409)
def test_a_report_never_closes_an_ask_created_after_it(self):
ask = self.lapsed_ask(CALLED)
self.httpd.hub.asks.change(ask, {"created_ts": time.time() + 60})
self.assertEqual(self.ran({"call_key": CALL, "session": "s1"}, self.local()), (200, {"closed": None}))
self.assertEqual(self.ran({"call_key": CALL, "session": "s1"}, self.local()), (200, NONE))
self.assertEqual(self.httpd.hub.asks.get(ask)["status"], "pending")
def test_the_hook_client_keys_its_ask_and_reports_the_call_that_ran_and_prints_nothing(self):
@@ -148,8 +149,8 @@ class TestExpiredRelease(MatchCase):
def test_a_foreign_session_a_different_input_or_a_bad_report_closes_nothing(self):
ask = self.lapsed_ask(CALLED)
self.assertEqual(self.ran({"call_key": CALL, "session": "s2"}, self.local()), (200, {"closed": None}))
self.assertEqual(self.ran({"call_key": OTHER, "session": "s1"}, self.local()), (200, {"closed": None}))
self.assertEqual(self.ran({"call_key": CALL, "session": "s2"}, self.local()), (200, NONE))
self.assertEqual(self.ran({"call_key": OTHER, "session": "s1"}, self.local()), (200, NONE))
for bad in ({"call_key": CALL}, {"call_key": CALL, "session": ""}, {"call_key": "../x", "session": "s1"}, {"call_key": CALL, "session": "s1", "status": "allowed"}):
with self.subTest(bad=bad):
self.assertEqual(self.ran(bad, self.local())[0], 400)