Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(view): present complete approval decisions [B26,N26,S1,P6]
Corey Olson432e07ea6988
diff --git a/src/cockpit.js b/src/cockpit.jsindex d97c6042..dd6bb4e3 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -1424,7 +1424,7 @@ function render() {const defaults = kind === 'doctrine' ? rows.filter((r) => r.origin === 'standard') : [];const labels = { decide: 'Needs your decision', ...(defaults.length ? { defaults: 'Defaults to review' } : {}), all: 'All rows', approved: 'Approved' };/** Inherited defaults are reviewed in the repo's doctrine; only local proposals ask for a decision. */- const undecided = (r) => (['pending', 'draft'].includes(r.status) && !r.decision || !!r.staleDecision) && !(kind === 'doctrine' && r.origin === 'standard');+ const undecided = (r) => (['pending', 'draft'].includes(r.status) && !r.decision || !!r.staleDecision || kind === 'spec' && agentApprovals.some(approval => approval.id === r.id)) && !(kind === 'doctrine' && r.origin === 'standard');const n = { decide: rows.filter(undecided).length, defaults: defaults.length, all: rows.length, approved: rows.filter((r) => r.status === 'approved').length };$(kind + '-chips').innerHTML = Object.keys(labels).map((f) => '<button data-rows="' + kind + ':' + f + '" class="' + (filter === f ? 'on' : '') + '" type="button">' + labels[f] + '<b>' + n[f] + '</b></button>').join('');const shownRows = rows.filter((r) => filter === 'all' || (filter === 'decide' ? undecided(r) : filter === 'defaults' ? r.origin === 'standard' : r.status === 'approved'));@@ -1460,7 +1460,8 @@ function render() {// Only a standard rule gets a note; who approves rows is said once elsewhere, not in every detail (#822).const home = kind === 'doctrine' && row && row.origin === 'standard' ? 'Standard rules come with Pullboard as defaults to review; override or decline one in DOCTRINE.md.' : '';const rowStatus = row?.stage || row?.status;- const rowDecisionActions = !snapshot && (!readOnly || requests) && row && undecided(row) && (kind === 'spec' || row.origin !== 'standard')+ const agentApproval = kind === 'spec' && row ? agentApprovals.find(approval => approval.id === row.id) : null;+ const rowDecisionActions = agentApproval ? agentApprovalActions(agentApproval, true) : !snapshot && (!readOnly || requests) && row && undecided(row) && (kind === 'spec' || row.origin !== 'standard')? '<div class="spec-decision-actions detail-decision-actions"><button class="approve-row" data-row-decision="approve" data-row-kind="' + kind + '" data-row-id="' + esc(row.id) + '" title="Approve (A, from the list)" type="button">Approve <kbd>A</kbd></button><button class="decline-row" data-row-decision="decline" data-row-kind="' + kind + '" data-row-id="' + esc(row.id) + '" title="Decline (D, from the list)" type="button">Decline <kbd>D</kbd></button></div>': '';$(kind + '-detail').innerHTML = row ? '<div class="stack tight"><h2><span>' + esc(row.id) + '</span>' + text + '</h2><div class="meta"><span class="chip ' + tone(row.status) + '">' + esc(rowStatus) + '</span>' + (row.tier ? '<span class="chip">' + esc(row.tier) + '</span>' : '') + source + '</div>' + rowDecisionActions + (kind === 'spec' && view.specFeedback?.kind === kind && view.specFeedback.root === view.root && view.specFeedback.from === 'detail' && view.specFeedback.id === row.id ? specFeedback(view.specFeedback) : '') + '<dl class="kv"><dt>section</dt><dd>' + esc(row.section) + '</dd>' + reason + (row.gate ? '<dt>gate</dt><dd>' + esc(row.gate) + '</dd>' : '') + (row.serves && row.serves.length ? '<dt>serves</dt><dd>' + esc(row.serves.join(', ')) + '</dd>' : '') + '</dl><div><h3>Items that cite it</h3>' + (citing.length ? '<div class="links">' + citing.map((i) => '<div class="links-item" data-item="' + i.id + '"><span>#' + i.id + ' ' + rich(i.title, titles) + '</span></div>').join('') + '</div>' : '<div class="muted">None yet.</div>') + '</div>' + (home ? '<div class="muted">' + home + '</div>' : '') + '</div>' : '<div class="empty">' + (view.tab === kind && view.addressDetail !== null ? 'No ' + (kind === 'spec' ? 'Spec' : 'Doctrine') + ' row ' + esc(view.addressDetail) + ' exists here.' : 'Pick a row to see it, and the items that cite it.') + '</div>';diff --git a/src/view.css b/src/view.cssindex 8221a97d..56f4e217 100644--- a/src/view.css+++ b/src/view.css@@ -1033,9 +1033,14 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }.machine-settings-entry { display: none; }.boardless .machine-settings-entry { display: block; }-/* Approval provenance is literal text, including an unabridged commit on a phone. */+/* Complete approval context wraps on a phone; the two person actions stay together. */+.row.agent-approval { grid-template-columns: 12px minmax(0, 1fr); grid-template-areas: none; align-items: start; cursor: default; }+.row.agent-approval > .dot { grid-area: auto; margin-top: 4px; }+.row.agent-approval > div { display: block; min-width: 0; }+.row.agent-approval .t { white-space: normal; overflow: visible; overflow-wrap: anywhere; }+.row.agent-approval .meta { white-space: normal; overflow: visible; }.agent-approval p { margin: 6px 0; overflow-wrap: anywhere; }-.agent-approval .actions { display: flex; flex-wrap: wrap; gap: 8px; }+.agent-approval .actions { display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 8px; }/* Revision proposals compare complete row bytes even on a phone; authority stays in the core. */.row.spec-revision { display: block; cursor: default; }diff --git a/src/view/agent-approval.js b/src/view/agent-approval.jsindex 3c1b642c..ec4505ec 100644--- a/src/view/agent-approval.js+++ b/src/view/agent-approval.js@@ -4,17 +4,31 @@ import { specRevisionScript } from './spec-revision.js';/** Embed a Needs-you row renderer that reuses the existing person decision pipeline. */export function agentApprovalScript() {return `-/** Render literal core attribution, with only core-advertised person moves. */-function agentApprovalRow(row) {+/** Reuse only core-advertised person moves on either approval surface. */+function agentApprovalActions(row, detail = false) {const person = !snapshot && (!readOnly || requests);const allowed = verb => person && Array.isArray(row.actions) && row.actions.some(action => action.verb === verb && action.args?.ids === row.id);- const button = (decision, label) => '<button type="button" data-row-kind="spec" data-row-id="' + esc(row.id) + '" data-row-decision="' + decision + '">' + label + '</button>';- const feedback = view.specFeedback?.root === view.root && view.specFeedback.kind === 'spec' && view.specFeedback.id === row.id ? view.specFeedback : null;+ const button = (decision, label) => '<button class="' + (decision === 'approve' ? 'approve-row' : 'decline-row') + '" type="button" data-row-kind="spec" data-row-id="' + esc(row.id) + '" data-row-decision="' + decision + '">' + label + '</button>';const controls = (allowed('spec-approve') ? button('approve', 'Confirm') : '') + (allowed('spec-decline') ? button('decline', 'Decline') : '');- return '<li class="row ask agent-approval" data-agent-approved="' + esc(row.id) + '"><span class="dot ask"></span><div><div class="t"><span>' + esc(row.ref ?? row.id) + '</span>agent-approved</div>'- + '<p>' + esc(row.attribution ?? 'Attribution unavailable') + ': ' + esc(row.agent ?? 'unknown') + '</p><p>Commit: <code>' + esc(row.commit ?? 'unavailable') + '</code></p>'+ return controls ? '<div class="spec-decision-actions actions' + (detail ? ' detail-decision-actions' : '') + '">' + controls + '</div>' : '';+}+/** Show Git provenance plainly without treating a Git author as a confirmed person. */+function agentApprovalAttribution(approval) {+ const at = approval?.at;+ const date = typeof at === 'string' && Number.isFinite(Date.parse(at)) ? '<time datetime="' + esc(at) + '">' + esc(new Date(at).toLocaleString()) + '</time>' : 'date unavailable';+ return '<p class="approval-attribution">Approved in Git by ' + esc(approval?.agent ?? 'unknown author') + ' · ' + date + '. Person confirmation pending.</p>';+}+/** Render the complete current row from this same board snapshot, plus literal provenance. */+function agentApprovalRow(row) {+ const source = data.project.spec.find(entry => entry.id === row.id);+ const approval = source?.agentApproval ?? row;+ const commit = approval.commit;+ const feedback = view.specFeedback?.root === view.root && view.specFeedback.kind === 'spec' && view.specFeedback.id === row.id ? view.specFeedback : null;+ return '<li class="row ask agent-approval" data-agent-approved="' + esc(row.id) + '"><span class="dot ask"></span><div><div class="t"><span>' + esc(row.ref ?? row.id) + '</span>' + esc(source?.text ?? 'Row text unavailable') + '</div>'+ + '<p class="approval-gate">Gate: ' + esc(source?.gate || 'No gate recorded') + '</p>' + agentApprovalAttribution(approval)+ + '<p>Commit: <code title="' + esc(commit ?? '') + '">' + esc(commit ? commit.slice(0, 12) : 'unavailable') + '</code></p>'+ (feedback ? specFeedback(feedback) : '')- + '<div class="meta"><span class="why"><b>NEEDS YOU</b> confirm or decline this row</span></div></div>' + (controls ? '<div class="actions">' + controls + '</div>' : '') + '</li>';+ + '<div class="meta"><span class="why"><b>NEEDS YOU</b> agent-approved; confirm or decline this row</span></div>' + agentApprovalActions(row) + '</div></li>';}${specRevisionScript()}`;diff --git a/test/cockpit/approvals.test.js b/test/cockpit/approvals.test.jsindex ac12e728..87846dfd 100644--- a/test/cockpit/approvals.test.js+++ b/test/cockpit/approvals.test.js@@ -29,7 +29,8 @@ test('agent approvals show full rows and styled actions at narrow width and resoconst commit = row.querySelector('code');return { text: row.textContent, commit: commit.textContent, full: commit.title,labels: buttons.map(button => button.textContent),- styled: buttons.every(button => button.classList.contains(button.dataset.rowDecision === 'approve' ? 'approve-row' : 'decline-row')),+ styled: buttons.every(button => button.classList.contains(button.dataset.rowDecision === 'approve' ? 'approve-row' : 'decline-row'))+ && getComputedStyle(buttons[0]).backgroundColor !== 'rgba(0, 0, 0, 0)' && getComputedStyle(buttons[1]).borderTopStyle === 'solid',targets: boxes.every(box => box.height >= 44),beside: boxes[0].top === boxes[1].top && boxes[0].right <= boxes[1].left,overflow: document.documentElement.scrollWidth > innerWidth };diff --git a/test/cockpit/needs.test.js b/test/cockpit/needs.test.jsindex 372e6cf2..a4e4b604 100644--- a/test/cockpit/needs.test.js+++ b/test/cockpit/needs.test.js@@ -566,7 +566,7 @@ test('an agent-approved row shows in Needs you with its agent and commit and a cassert.equal(row.agent, 'Agent & \"unconfirmed\" seat');assert.ok(page.show('needs').includes('Agent & "unconfirmed" seat'), 'author text is escaped rather than promoted into markup');assert.ok(page.show('needs').includes(row.commit));- assert.ok(page.show('needs').includes(row.attribution));+ assert.ok(page.show('needs').includes('Approved in Git by'), 'Git provenance is expressed plainly without inventing a person identity');}assert.match(page.show('needs'), />Confirm</u);assert.match(page.show('needs'), />Decline</u);