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
feat(view): compare spec revision proposals [P6,B23,N39]
Corey Olson05c3cfd69452
diff --git a/src/cockpit.js b/src/cockpit.jsindex 025755b7..0f9b7223 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -1126,7 +1126,7 @@ function render() {// on the board with who holds it; it is the agents' to move.const personalNeeds = personNeeds(p);// Adapt display targets and the existing hold age without reimplementing which calls belong here.- const needs = personalNeeds.filter((row) => !['draft', 'rigor-draft', 'sentinel-draft', 'agent-approved'].includes(row.kind)).map((row) => row.kind === 'decision'+ const needs = personalNeeds.filter((row) => !['draft', 'rigor-draft', 'sentinel-draft', 'agent-approved'].includes(row.kind)).map((row) => row.kind === 'spec-revision' ? { revision: row } : row.kind === 'decision'? ['decide:' + row.id, row.ref, row.text, 'decide', row.at]: row.kind === 'pending' ? ['spec:' + row.id, row.ref, row.text, 'answer ' + row.ref] // the person's words; agents get the command (#875): row.kind === 'block' ? [null, row.ref, row.text, row.what, row.at, 'block']@@ -1141,7 +1141,7 @@ function render() {$('needs').hidden = (!needs.length && !drafts && !rigorDrafts.length && !sentinelDrafts.length && !agentApprovals.length) || view.state !== 'active' || Boolean(view.lane);const needRow = ([target, ref, text, what, at], kind, action) => '<li class="row ask"' + (readOnly || !target ? '' : ' data-go="' + esc(target) + '"') + '><span class="dot ask"></span><div><div class="t">' + (ref ? '<span>' + esc(ref) + '</span>' : '') + rich(text, titles, !readOnly) + '</div>'+ (at ? '<span class="row-age">' + age(at) + '</span>' : '') + '<div class="meta"><span class="why"><b>NEEDS YOU</b> ' + esc(kind) + '</span></div></div><span class="chip warn">' + esc(action) + '</span></li>';- const needKind = (entry) => entry[5] === 'block' ? needRow(entry, entry[3], 'next step')+ const needKind = (entry) => entry.revision ? specRevisionRow(entry.revision) : entry[5] === 'block' ? needRow(entry, entry[3], 'next step'): entry[3] === 'decide' ? needRow([entry[0], '', entry[2], entry[3], entry[4]], 'a decision, asked by ' + entry[1], 'decide'): entry[0].startsWith('spec:') ? needRow(entry, 'an open question in SPEC.md', 'answer') : needRow(entry, entry[3], 'release');const needsHtml = needs.map(needKind).join('')diff --git a/src/view.css b/src/view.cssindex 51509cbe..8221a97d 100644--- a/src/view.css+++ b/src/view.css@@ -1036,3 +1036,13 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }/* Approval provenance is literal text, including an unabridged commit on a phone. */.agent-approval p { margin: 6px 0; overflow-wrap: anywhere; }.agent-approval .actions { display: flex; flex-wrap: wrap; gap: 8px; }++/* Revision proposals compare complete row bytes even on a phone; authority stays in the core. */+.row.spec-revision { display: block; cursor: default; }+.row.spec-revision > div { display: block; min-width: 0; }+.spec-revision .revision-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }+.spec-revision section { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }+.spec-revision h3 { margin: 0 0 6px; color: var(--ink-muted); font-size: 12px; }+.spec-revision pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px var(--mono); }+.spec-revision .revision-reason { margin: 8px 0; overflow-wrap: anywhere; }+.spec-revision .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }diff --git a/src/view/agent-approval.js b/src/view/agent-approval.jsindex 9b5aab0e..3c1b642c 100644--- a/src/view/agent-approval.js+++ b/src/view/agent-approval.js@@ -1,3 +1,4 @@+import { specRevisionScript } from './spec-revision.js';/** Render core-projected agent approval calls without inferring who approved a row [S1,B26,P6,N26]. *//** Embed a Needs-you row renderer that reuses the existing person decision pipeline. */@@ -15,5 +16,6 @@ function agentApprovalRow(row) {+ (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>';}+${specRevisionScript()}`;}diff --git a/src/view/spec-revision.js b/src/view/spec-revision.jsnew file mode 100644index 00000000..8a14c609--- /dev/null+++ b/src/view/spec-revision.js@@ -0,0 +1,20 @@+/** Render a core-projected revision without changing its person authority or approved source [P6,B23,N39]. */+export function specRevisionScript() {+ return `+/** Show the exact before/after row and only the proposal actions supplied by the core. */+function specRevisionRow(row) {+ 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 controls = (allowed('spec-approve') ? button('approve', 'Approve') : '') + (allowed('spec-decline') ? button('decline', 'Decline') : '');+ const feedback = view.specFeedback?.root === view.root && view.specFeedback.kind === 'spec' && view.specFeedback.id === row.id ? view.specFeedback : null;+ return '<li class="row ask spec-revision" data-spec-revision="' + esc(row.id) + '"><div>'+ + '<div class="t">' + esc(row.ref ?? row.id) + '</div><div class="revision-columns">'+ + '<section data-revision-before><h3>Current row</h3><pre>' + esc(row.source ?? row.old?.text ?? '') + '</pre></section>'+ + '<section data-revision-after><h3>Proposed row</h3><pre>' + esc(row.replacement ?? row.proposed?.text ?? '') + '</pre></section></div>'+ + '<p class="revision-reason">Reason: ' + esc(row.reason ?? '') + '</p>' + (feedback ? specFeedback(feedback) : '')+ + '<div class="meta"><span class="why"><b>NEEDS YOU</b> ' + esc(row.what ?? 'approve or decline revision') + '</span></div>'+ + (controls ? '<div class="actions">' + controls + '</div>' : '') + '</div></li>';+}+`;+}