From 454e1fd73152f311f3001312b445ea0db022a099 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 23 Nov 2026 11:02:52 +0000 Subject: [PATCH] fix(hub): sign the grant label the bulk grant shows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bulk() computed each item's grant label twice, once for the shown pick and once for the entry the passkey signs. One map now feeds both. The grant-mode harness gains the missing base line. Origins: 14bb4f3, 0fa05c5. 🎯 Fix: 92 % 💥 Break: 3 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 89 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 --- orchestrator/templates/page-inbox.js | 5 +++-- tests/test_hub_grant_mode.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/orchestrator/templates/page-inbox.js b/orchestrator/templates/page-inbox.js index 6e1ac96..8cb05e4 100644 --- a/orchestrator/templates/page-inbox.js +++ b/orchestrator/templates/page-inbox.js @@ -185,8 +185,9 @@ toast(`${label}: nothing to ${deny ? "deny" : "grant"}`, [], false); return; } + const labels = new Map([...usable, ...alone].map((item) => [keyOf(item), deny ? "" : grantLabel(item)])); const rows = [...usable, ...alone].map((item) => h("li", {}, - h("div", {class: "row"}, pill(ITEM_LABELS[item.kind], KIND_TONES[item.kind]), !deny && grantLabel(item) ? h("span", {class: "muted"}, revealed(`→ ${shownPick(grantLabel(item))}`)) : null), + h("div", {class: "row"}, pill(ITEM_LABELS[item.kind], KIND_TONES[item.kind]), labels.get(keyOf(item)) ? h("span", {class: "muted"}, revealed(`→ ${shownPick(labels.get(keyOf(item)))}`)) : null), h("strong", {}, revealed(item.title)), item.kind === "operator" ? h("div", {class: "command"}, h("code", {}, revealed(item.command))) : null, item.kind === "operator" ? h("span", {class: "muted"}, revealed(`in ${item.directory}`)) : null, @@ -201,7 +202,7 @@ } } if (usable.length) { - await submit(usable.map((item) => (deny ? denialOf(item, reason.value) : entryOf(item, "approve", grantLabel(item)))), `${label}: ${usable.length} entries`); + await submit(usable.map((item) => (deny ? denialOf(item, reason.value) : entryOf(item, "approve", labels.get(keyOf(item))))), `${label}: ${usable.length} entries`); } }); openSheet(label, [h("p", {class: "muted"}, deny ? DENY_NOTE : grantNote(alone.length, usable.length)), h("ul", {class: "mini"}, rows), ...(deny ? [reasonChips(reason), h("label", {class: "deny-reason"}, "Reason (optional, every requester reads it)", reason)] : []), diff --git a/tests/test_hub_grant_mode.py b/tests/test_hub_grant_mode.py index 24d9c56..5afcebf 100644 --- a/tests/test_hub_grant_mode.py +++ b/tests/test_hub_grant_mode.py @@ -60,7 +60,7 @@ const context = { known: {batches: new Set()}, ViewStore: {get: (path) => (path === "approval.mode" ? mode.value : null), set: (path, value) => { sets.push([path, value]); mode.value = value; }, on: (path, callback) => listeners.push([path, callback])}, denySplit: () => new El("deny"), jobOpen: () => false, load: async () => {}, openItem: () => {}, - items, mode, sets, listeners, all, text, buttons, + base, items, mode, sets, listeners, all, text, buttons, }; const source = names.map((name) => fs.readFileSync(`${dir}/${name}`, "utf8")).join("\n"); const probe = `