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): spec and doctrine line up and decide quietly [N26,B26]
Corey Olson09d8c0292a89
diff --git a/src/cockpit.js b/src/cockpit.jsindex 047cdfa5..33691b5b 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -128,11 +128,11 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ</aside></section><section data-pane="spec" class="two">- <div class="primary"><div class="chips" id="spec-chips"></div><div class="card-panel rows" id="spec-list"></div></div>+ <div class="primary"><div class="card-panel rows-card"><div class="rows-filter"><div class="seg" id="spec-chips" role="group" aria-label="Show"></div></div><div class="rows" id="spec-list"></div></div></div><aside class="card-panel detail" aria-label="Spec row"><div id="spec-detail"></div></aside></section><section data-pane="doctrine" class="two">- <div class="primary"><div class="chips" id="doctrine-chips"></div><div class="card-panel rows" id="doctrine-list"></div></div>+ <div class="primary"><div class="card-panel rows-card"><div class="rows-filter"><div class="seg" id="doctrine-chips" role="group" aria-label="Show"></div></div><div class="rows" id="doctrine-list"></div></div></div><aside class="card-panel detail" aria-label="Practice row"><div id="doctrine-detail"></div></aside></section><section data-pane="activity">@@ -1094,6 +1094,8 @@ function render() {const n = { decide: rows.filter(undecided).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) : r.status === 'approved'));+ // With no row picked, or the pick filtered out, the detail opens on the first row shown, as Items does.+ if (!shownRows.some((r) => r.id === view.row[kind])) view.row[kind] = shownRows[0]?.id ?? null;const feedback = kind === 'spec' && view.specFeedback?.root === view.root && view.specFeedback.from === 'list' ? view.specFeedback : null;const feedbackId = feedback && (shownRows.some((r) => r.id === feedback.id) ? feedback.id : shownRows.some((r) => r.id === feedback.next) ? feedback.next : shownRows[0]?.id);let section = null;@@ -1108,9 +1110,9 @@ function render() {const status = r.stage || r.status;/** Render person-only row decisions in both the list and its detail pane. */const decisionActions = (!snapshot && (!readOnly || requests) && kind === 'spec' && undecided(r))- ? '<div class="spec-decision-actions"><button class="approve-row" data-row-decision="approve" data-row-id="' + esc(r.id) + '" type="button">Approve</button><button class="decline-row" data-row-decision="decline" data-row-id="' + esc(r.id) + '" type="button">Decline</button></div>'+ ? '<span class="spec-decision-actions"><button class="approve-row" data-row-decision="approve" data-row-id="' + esc(r.id) + '" type="button">Approve</button><button class="decline-row" data-row-decision="decline" data-row-id="' + esc(r.id) + '" type="button">Decline</button></span>': '';- return head + (feedback && feedbackId === r.id ? specFeedback(feedback) : '') + '<div class="srow' + (view.row[kind] === r.id ? ' on' : '') + '" data-row="' + kind + ':' + esc(r.id) + '"><code>' + esc(r.id) + '</code><span><span class="chip ' + tone(r.status) + '">' + esc(status) + '</span>' + source + '</span><span>' + text + reason + decisionActions + '</span></div>';+ return head + (feedback && feedbackId === r.id ? specFeedback(feedback) : '') + '<div class="srow' + (view.row[kind] === r.id ? ' on' : '') + '" data-row="' + kind + ':' + esc(r.id) + '"><code>' + esc(r.id) + '</code><span><span class="chip ' + tone(r.status) + '">' + esc(status) + '</span>' + source + '</span><span>' + text + reason + '</span>' + decisionActions + '</div>';}).join('') : '<div class="empty">' + (rows.length ? 'No rows match.' : kind === 'spec' ? 'No spec rows yet. Each requirement is one row in SPEC.md, such as G1 [draft, must] and a line; write them, or ask an agent to, and they show up here.' : 'No doctrine rows yet: they live in DOCTRINE.md.') + '</div>';if (feedback && !shownRows.length) $(kind + '-list').innerHTML += specFeedback(feedback);const row = rows.find((r) => r.id === view.row[kind]);diff --git a/src/view.css b/src/view.cssindex 1b3299d1..ecea32f1 100644--- a/src/view.css+++ b/src/view.css@@ -281,14 +281,18 @@ code.inline { padding: 0 3px; border-radius: 3px; background: color-mix(in srgb,.agent-work:hover > span:first-child { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }.lane { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }.lane:first-child { border-top: 0; }+.rows-filter { display: flex; padding: 10px 10px 2px; }.rows { padding: 4px 10px 10px; }.spec-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 4px; }.rows h4 { margin: 0; font-size: 12.5px; color: var(--ink-muted); }-.spec-section-approve, .approve-row, .decline-row { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }-.spec-section-approve { color: var(--accent-strong); }-.approve-row { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }-.decline-row { border-color: var(--reject); color: var(--reject); }-.spec-decision-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; cursor: default; }+/* Deciding a row is a quiet word beside it, no box: Approve in the accent, Decline in grey, each lit only on hover. */+.spec-section-approve, .approve-row, .decline-row { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font-weight: 600; white-space: nowrap; cursor: pointer; }+.spec-section-approve, .approve-row { color: var(--accent-strong); }+.decline-row { color: var(--ink-muted); }+.spec-section-approve:hover, .approve-row:hover { background: var(--accent-soft); }+.decline-row:hover { background: var(--reject-soft); color: var(--reject); }+.spec-decision-actions { display: flex; align-items: center; gap: 2px; margin: -11px -6px -11px 0; cursor: default; }+.detail-decision-actions { margin: 4px 0 0 -10px; }.detail-decision-actions { margin: 0 0 12px; }.spec-reason-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 16px; background: rgb(15 23 42 / 45%); }.spec-reason-dialog { width: min(100%, 420px); display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 60px rgb(0 0 0 / 24%); }@@ -297,13 +301,13 @@ code.inline { padding: 0 3px; border-radius: 3px; background: color-mix(in srgb,.spec-reason-dialog input { width: 100%; min-height: 44px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; }.spec-reason-dialog .actions { display: flex; flex-wrap: wrap; gap: 8px; }.spec-reason-dialog .actions button { min-height: 44px; }-.srow { display: grid; grid-template-columns: 4.4em minmax(6.2em, max-content) minmax(0, 1fr); gap: 8px; padding: 6px 4px; border-top: 1px solid var(--line); align-items: baseline; cursor: pointer; border-radius: 6px; }+.srow { display: grid; grid-template-columns: 4.4em minmax(6.2em, max-content) minmax(0, 1fr) auto; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--line); align-items: baseline; cursor: pointer; border-radius: 6px; }.srow:hover { background: var(--surface-2); }.srow.on { background: var(--accent-soft); }.srow code { font: 600 12px var(--mono); }.rule-source, .rule-reason { display: block; color: var(--ink-muted); font-size: 11.5px; line-height: 1.5; }.rule-reason { margin-top: 3px; }-@media (width < 480px) { .srow { grid-template-columns: auto minmax(0, 1fr); } .srow > span:last-child { grid-column: 1 / -1; } }+@media (width < 480px) { .srow { grid-template-columns: auto minmax(0, 1fr); } .srow > span:nth-child(3), .srow > .spec-decision-actions { grid-column: 1 / -1; } .srow > .spec-decision-actions { margin: -6px 0 -8px -10px; } }.flow { position: relative; margin: 0 0 12px; padding: 10px 12px 8px; overflow-x: auto; }.flow svg { display: block; width: 100%; min-width: 680px; max-width: 920px; height: auto; margin: 0 auto; }.flow figcaption { color: var(--ink-faint); font-size: 12px; padding: 2px 34px 0 2px; }diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex 50bed301..7c1f10fc 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -608,6 +608,70 @@ test('projects group repos with combined needs and activity, while ungrouped and}});+test('Spec and Doctrine line up, open on a row and decide with quiet controls [N26, B26]', { timeout: 120_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for Spec layout checks.');++ const spec = '# Demo spec\n\n## G · Goals\n- G1 [draft, must] One short line. | gate: web test\n- G2 [draft, must] A second draft row. | gate: web test\n- G3 [approved, must] An approved row. | gate: web test\n';+ const box = machine();+ project(box, 'spec-layout', spec);+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-spec-layout-chrome-'));+ let chrome;+ /** Where the list and detail cards start, what is picked, and how a row's decision sits beside its text. */+ const read = async (kind) => JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const pane = document.querySelector('[data-pane="${kind}"]');+ const box = (e) => { const r = e.getBoundingClientRect(); return { top: r.top, bottom: r.bottom, left: r.left, right: r.right, height: r.height }; };+ const row = document.querySelector('#${kind}-list .srow[data-row="${kind}:G1"]');+ const text = row?.querySelector(':scope > span:nth-child(3)');+ const buttons = row ? [...row.querySelectorAll('[data-row-decision]')] : [];+ const quiet = (e) => { const s = getComputedStyle(e); return s.borderTopWidth === '0px' && s.backgroundColor === 'rgba(0, 0, 0, 0)'; };+ const line = text ? parseFloat(getComputedStyle(text).lineHeight) : 0;+ return { list: box(pane.querySelector('.rows-card')), detail: box(pane.querySelector('.detail')), picked: document.querySelector('#${kind}-list .srow.on')?.dataset.row ?? null,+ shown: document.querySelector('#${kind}-detail h2 span')?.textContent ?? null, first: document.querySelector('#${kind}-list .srow')?.dataset.row ?? null,+ row: row && box(row), text: text && box(text), line, buttons: buttons.map((e) => ({ ...box(e), quiet: quiet(e), word: e.textContent })),+ section: [...document.querySelectorAll('#${kind}-list [data-section-approve], #${kind}-detail [data-row-decision]')].map((e) => quiet(e)),+ overflow: document.documentElement.scrollWidth > document.documentElement.clientWidth };+ })())`));+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor("typeof data === 'object' && !!data && !!data.project");+ for (const width of [1280, 375]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.evaluate("document.querySelector('[data-tab=spec]').click(); document.querySelector('#spec-chips [data-rows=\"spec:decide\"]').click(); view.row.spec = null; render();");+ await chrome.waitFor(`innerWidth === ${width} && !!document.querySelector('#spec-list [data-row="spec:G1"]')`);+ const spec = await read('spec');+ if (width === 1280) assert.ok(Math.abs(spec.list.top - spec.detail.top) < 0.5, `${width}: the list and the detail start on one line: ${JSON.stringify([spec.list, spec.detail])}`);+ assert.deepEqual([spec.picked, spec.shown], ['spec:G1', 'G1'], `${width}: with nothing picked, the detail opens on the first row shown`);+ assert.deepEqual(spec.buttons.map((b) => b.word), ['Approve', 'Decline'], `${width}: an undecided row offers its decision`);+ assert.ok(spec.buttons.every((b) => b.quiet && b.height >= 44), `${width}: quiet words, no box or fill until hovered, each a 44px target: ${JSON.stringify(spec.buttons)}`);+ assert.ok(spec.section.length >= 3 && spec.section.every(Boolean), `${width}: Approve all and the detail's decision are quiet too`);+ if (width === 1280) {+ assert.ok(spec.buttons.every((b) => b.left >= spec.text.right && Math.abs((b.top + b.bottom) / 2 - (spec.text.top + spec.line / 2)) < spec.line), `${width}: the decision sits beside the text, on its first line: ${JSON.stringify(spec)}`);+ assert.ok(spec.row.height <= 60, `${width}: so a one-line undecided row is at most 60px tall: ${spec.row.height}`);+ } else {+ assert.ok(spec.buttons.every((b) => b.top >= spec.text.bottom - 12), `${width}: on a phone the decision sits under the text: ${JSON.stringify(spec)}`);+ }+ assert.ok(!spec.overflow, `${width}: nothing runs off the screen`);+ // A filter that hides the pick moves it to the new first row; one that keeps it keeps it.+ await chrome.evaluate("document.querySelector('#spec-list [data-row=\"spec:G2\"]').click()");+ await chrome.evaluate("document.querySelector('#spec-chips [data-rows=\"spec:all\"]').click()");+ assert.equal((await read('spec')).picked, 'spec:G2', `${width}: a filter that still shows the pick keeps it`);+ await chrome.evaluate("document.querySelector('#spec-chips [data-rows=\"spec:approved\"]').click()");+ const moved = await read('spec');+ assert.deepEqual([moved.picked, moved.shown], ['spec:G3', 'G3'], `${width}: a filter that hides the pick moves it to the first row shown`);+ await chrome.evaluate("document.querySelector('[data-tab=doctrine]').click(); view.row.doctrine = null; render();");+ const doctrine = await read('doctrine');+ if (width === 1280) assert.ok(Math.abs(doctrine.list.top - doctrine.detail.top) < 0.5, `${width}: Doctrine's cards start on one line too`);+ assert.ok(doctrine.picked && doctrine.picked === doctrine.first && doctrine.shown === doctrine.first.split(':')[1], `${width}: and Doctrine opens on its first row: ${JSON.stringify([doctrine.picked, doctrine.shown])}`);+ }+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});+test('the tabs fit one row on a phone [N26]', async () => {const view = await startView(machine());try {@@ -2025,9 +2089,9 @@ test('spec rows read across a phone [N26,D1]', async () => {assert.match(doctrineRows, /data-row="doctrine:W1"[^]*?Numbers over adjectives\./, 'W1 from the configured doctrine is shown');assert.match(doctrineRows, /data-row="doctrine:W2"[^]*?One record per decision\./, 'W2 from the configured doctrine is shown');const style = await styleOf(view);- assert.match(style, /\n\.srow \{ display: grid; grid-template-columns: 4\.4em minmax\(6\.2em, max-content\) minmax\(0, 1fr\);/, 'wider, a row keeps its three columns');- const phone = /\n@media ([^{]+) \{ \.srow \{ grid-template-columns: auto minmax\(0, 1fr\); \} \.srow > span:last-child \{ grid-column: 1 \/ -1; \} \}\n/.exec(style);- assert.ok(phone, 'on a phone the text takes the full width below the id and status');+ assert.match(style, /\n\.srow \{ display: grid; grid-template-columns: 4\.4em minmax\(6\.2em, max-content\) minmax\(0, 1fr\) auto;/, 'wider, a row keeps its columns: id, status, text, and its decision when it has one');+ const phone = /\n@media ([^{]+) \{ \.srow \{ grid-template-columns: auto minmax\(0, 1fr\); \} \.srow > span:nth-child\(3\), \.srow > \.spec-decision-actions \{ grid-column: 1 \/ -1; \}/.exec(style);+ assert.ok(phone, 'on a phone the text, and the decision under it, take the full width below the id and status');assert.equal(phone[1], '(width < 480px)', 'under 480px only: at 480px itself the three columns stay');// The rule holds because every row is the id, then the status, then the text.