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:
1 parent
a6eee78165
commit
88e53ac51f
22 files changed
+212
-181
No files matched your search
@@ -201,7 +201,7 @@ CHOICE_ANSWER = """(async () => {@HELPERS@@WATCH@
|
||||
if (!card) {
|
||||
return {error: text(document.getElementById("main"))};
|
||||
}
|
||||
const option = all(".option", card).find((button) => text(button.querySelector("strong")) === "Wait");
|
||||
const option = all("button.option", card).find((button) => text(button.querySelector("strong")) === "Wait");
|
||||
const title = option.title;
|
||||
const shown = new Set(all("#toasts .toast"));
|
||||
option.click();
|
||||
|
||||
@@ -32,7 +32,7 @@ FRONT = """(async () => {@HELPERS@
|
||||
peek.click();
|
||||
}
|
||||
const node = await until(() => (card() && card().dataset.card === "@PICK@" ? card() : null), 3000);
|
||||
return {front: node ? node.dataset.card : null, options: node ? all(".match-options .option", node).map((option) => [text(option.querySelector("strong")), option.classList.contains("recommended")]) : [],
|
||||
return {front: node ? node.dataset.card : null, options: node ? all(".match-options button.option", node).map((option) => [text(option.querySelector("strong")), option.classList.contains("recommended")]) : [],
|
||||
wide: document.documentElement.scrollWidth > window.innerWidth + 1};
|
||||
})()"""
|
||||
HOME = """(async () => {@HELPERS@@HOME_KIT@
|
||||
@@ -79,13 +79,13 @@ FLOW = """(async () => {@HELPERS@
|
||||
const id = node.dataset.card;
|
||||
const acts = Object.fromEntries(all("#main .match-actions .match-act").map((button) => [text(button.querySelector(".match-act-label")), button.disabled]));
|
||||
seen[id] = {kind: node.dataset.kind, chips: all(".match-metric", node).map((chip) => `${chip.dataset.metric}=${text(chip.querySelector("strong"))}`), acts,
|
||||
options: all(".match-options .option", node).map((option) => text(option.querySelector("strong"))), rule: Boolean(node.querySelector(".rule-request")), command: text(node.querySelector(".match-command"))};
|
||||
options: all(".match-options button.option", node).map((option) => text(option.querySelector("strong"))), rule: Boolean(node.querySelector(".rule-request")), command: text(node.querySelector(".match-command"))};
|
||||
if (id.startsWith("operator:")) {
|
||||
node.querySelector(".match-options .option:not(.recommended)").click();
|
||||
node.querySelector(".match-options button.option:not(.recommended)").click();
|
||||
} else if (id.startsWith("decision:")) {
|
||||
key("ArrowLeft");
|
||||
seen[id].refused = Boolean(await until(() => all("#toasts .toast").map(text).find((entry) => entry.startsWith("Reject: not possible")), 3000));
|
||||
node.querySelector(".match-options .option").click();
|
||||
node.querySelector(".match-options button.option").click();
|
||||
} else if (id.startsWith("ask:")) {
|
||||
key("ArrowRight");
|
||||
} else {
|
||||
|
||||
@@ -39,11 +39,11 @@ MATCH = """(async () => {@HELPERS@@CAPTURE@
|
||||
if (!card) {
|
||||
return {error: text(document.getElementById("main"))};
|
||||
}
|
||||
const options = () => all(".match-options .option", card);
|
||||
const pick = card.querySelector(".match-pick");
|
||||
const options = () => all(".match-options button.option", card);
|
||||
const pick = card.querySelector(".choice-send");
|
||||
const before = look(options(), pick);
|
||||
[0, 2, 1, 1].forEach((index) => options()[index].click());
|
||||
const toggled = {...look(options(), pick), front: document.querySelector("#main .match-card.front") === card, other: Boolean(card.querySelector(`.match-other input[maxlength="1000"]`))};
|
||||
const toggled = {...look(options(), pick), front: document.querySelector("#main .match-card.front") === card, other: Boolean(card.querySelector(`.option.other input[maxlength="1000"]`))};
|
||||
pick.click();
|
||||
const overview = await until(() => document.querySelector("#main .match-overview"), 3000);
|
||||
const found = {before, toggled, rows: overview ? all("#main .match-decision").map((item) => [item.dataset.card, text(item.querySelector(".match-verdict"))]) : [], wide: wide()};
|
||||
|
||||
Reference in new issue
Block a user