feat(hub): every choice is one numbered dialog with an Other answer

Decisions, decision rows and hook questions render through one page-dialog.js: numbered options, check boxes for multi picks, the recommended option tagged, and a one-line Other answer; page-inbox.js and page-match.js drop their own option code. choosing.picks accepts one line of other text for every decision and decision row, not only hook questions, and approving checks a decision row's label through it and visible(). operator.py add --check decision now needs 2 to 4 --option values, as an AskUserQuestion offers (OPTION_FLOOR 2, OPTION_LIMIT 4 instead of 12), and refuses --option or --recommended on any other check; kvb-agent-optimize's graph.py passes two answers for each row it adds, and checks.md names the instruction-step answers Done= and Blocked=.

Stacked on questions (a6eee78); applied cleanly. ruff and node --check pass.

Tests: test_hub_decision_rows, test_hub_questions, test_operator, test_code_graph, test_hub_match and the Match waiting and question e2e updated. Written, not run: the full suite runs once on master after all bundles (operator order).

Security: MEDUSA over the staged tree on master: 100, no findings over 21 files; index.html.j2 is not covered and was read by hand (dialog style rules and the page-dialog.js include).

🎯 Fix: 90 %
💥 Break: 5 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 86
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %

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-22 15:10:26 +00:00
1 parent a6eee78165
commit 88e53ac51f
22 files changed
+212 -181

No files matched your search

+6 -7
View File
@@ -50,7 +50,7 @@ class TestHubQuestions(HubCase):
with mock.patch.object(batches, "UNDO", 0.05):
status, _, body = self.approve(items, proof)
self.assertEqual(status, 202, body)
self.settle(lambda: self.state(decision_id)["status"] == "decided")
self.settle(lambda: self.httpd.hub.decisions.get(decision_id)["status"] == "decided")
def hook(self, payload: dict, timeout: str) -> subprocess.Popen:
trust = ["--approvers", str(self.approvers), "--replay", str(self.replay / "hook.json")]
@@ -120,19 +120,18 @@ class TestHubQuestions(HubCase):
single = self.ask_question(BODY)
self.assertEqual(self.approve([self.entry("decision", single, f"{PICK}\n{PICK}", "")], None)[0], 400)
def test_a_hook_question_also_takes_one_trimmed_line_of_other_text_and_an_mcp_decision_does_not(self):
def test_every_decision_takes_one_trimmed_line_of_other_text_as_an_ask_user_question_does(self):
self.claim("s1", "Skills session")
signer = self.pin()
single, multi, mcp = self.ask_question(BODY), self.ask_question(MULTI_BODY), self.decision("")
item = next(item for item in self.snapshot()["inbox"] if item["id"] == mcp)
self.assertFalse(item["other"])
self.assertTrue(next(item for item in self.snapshot()["inbox"] if item["id"] == single)["other"])
for decision_id, label in ((single, " padded"), (single, "x" * 1001), (single, "tab\there"), (mcp, "free text")):
for decision_id, label in ((single, " padded"), (single, "x" * 1001), (single, "tab\there"), (mcp, "two\nlines"), (mcp, "padded ")):
with self.subTest(label=label[:20]):
self.assertEqual(self.approve([self.entry("decision", decision_id, label, "")], None)[0], 400)
self.pick(single, "Keep the old one", signer)
self.pick(multi, "None of these", signer)
self.assertEqual((self.state(single)["choice"], self.state(multi)["choice"]), ("Keep the old one", "None of these"))
self.pick(mcp, "Ask Main first", signer)
self.assertEqual([self.httpd.hub.decisions.get(found)["choice"] for found in (single, multi, mcp)], ["Keep the old one", "None of these", "Ask Main first"])
self.assertTrue(all("other" not in item for item in self.snapshot()["inbox"]))
def test_the_hook_passes_a_signed_other_text_on_as_the_answer(self):
self.claim("s1", "Skills session")