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): the Spec pane lists every blueprint fit proposal [N26,S1]
Corey Olson897e3e7f739d
diff --git a/src/cockpit.js b/src/cockpit.jsindex 7a6b8a6f..147f4845 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -190,7 +190,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ</aside></section><section data-pane="spec" class="two">- <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" tabindex="0" aria-label="Spec rows"></div></div></div>+ <div class="primary"><div class="card-panel rows-card"><div id="spec-fit" class="fit"></div><div class="rows-filter"><div class="seg" id="spec-chips" role="group" aria-label="Show"></div></div><div class="rows" id="spec-list" tabindex="0" aria-label="Spec rows"></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">@@ -2812,6 +2812,7 @@ function render() {const held = new Map(p.holds.map((h) => [h.hold_lane, h]));$('lanes').innerHTML = working.map((l) => '<div class="lane"><span><b>' + esc(l) + '</b> ' + (held.has(l) ? '<span class="chip no" title="held by ' + esc(agentName(held.get(l).hold_by)) + '">held by ' + esc(agentName(held.get(l).hold_by)) + '</span> <span class="muted">' + linked(held.get(l).hold_reason, titles) + '</span>' : '<span class="chip ok">open</span>') + '</span>' + (held.has(l) ? '<button class="ghost" data-release="' + esc(l) + '" type="button">Release</button>' : '') + '</div>').join('');+ $('spec-fit').innerHTML = (p.fit || []).length ? '<h3>Blueprint fit: ' + p.fit.length + ' unverified ' + (p.fit.length === 1 ? 'proposal' : 'proposals') + ' waiting for you</h3>' + p.fit.map(fitRow).join('') : '';for (const kind of ['spec', 'doctrine']) {const rows = kind === 'spec' ? p.spec : p.practice;const filter = view.rows[kind];@@ -2889,7 +2890,6 @@ function showFlow(shown) {$('flow-show').hidden = shown;if (shown && data && data.project) $('flow').innerHTML = flowSvg(data.project);}-function showTab() {document.querySelectorAll('[data-pane]').forEach((pane) => { pane.hidden = pane.dataset.pane !== view.tab; });document.querySelectorAll('.tab').forEach((button) => button.classList.toggle('on', button.dataset.tab === view.tab));@@ -3328,6 +3328,11 @@ function moveMessage(move, result) {return move.args.off ? 'released the ' + move.args.lane + ' lane' : 'holding the ' + move.args.lane + ' lane: ' + move.args.reason;}+/** One blueprint fit proposal: its decision, its new text or reason, and where it came from. */+function fitRow(f) {+ return '<div class="fit-row" data-fit="' + esc(f.target) + '"><div class="meta"><b>' + esc(f.target) + '</b><span class="chip">' + esc(f.decision) + '</span><span class="chip">unverified draft, recorded as ' + esc(f.recordedAs) + '</span></div>' + (f.text ? '<div>' + esc(f.text) + '</div>' : '') + (f.reason ? '<div>Reason: ' + esc(f.reason) + '</div>' : '') + '<div class="muted">Blueprint source: ' + esc(f.blueprint.name + ' v' + f.blueprint.version + ' ' + (f.kind === 'item' ? 'starter' : f.kind) + ' ' + f.key + ': ' + f.source) + '</div></div>';+}+/** Render escaped decision feedback beside the affected Spec row (B26, N26). */function specFeedback(feedback) {return '<div class="spec-feedback ' + feedback.tone + '" role="status">' + esc(feedback.text) + '</div>';@@ -3546,7 +3551,6 @@ function foldShouts() {card.classList.toggle('clamp', card.classList.contains('open') || text.scrollHeight > text.clientHeight + 1);});}-function tickAges() {document.querySelectorAll('[data-ago]').forEach((node) => { node.textContent = node.classList.contains('long') ? agoLong(node.dataset.ago) : ago(node.dataset.ago); });tickDays();@@ -3568,13 +3572,11 @@ function tickDays() {if (first && !first.previousElementSibling?.classList?.contains('day-rule')) first.insertAdjacentHTML('beforebegin', '<div class="day-rule" role="separator"><span>' + names.Today + '</span></div>');daysNamedAt = now;}-/** Open or close the project list where the sidebar is folded into a top bar (under 900px). */function fold(open) {$('side').classList.toggle('open', open);$('proj-switch').setAttribute('aria-expanded', String(open));}-/** Show another project and its item; history restores keep the tab their entry named. */function switchTo(root, target = null, record = true) {// Switching board or project closes Approve all's confirmation and the decline dialog; neither records on either board.@@ -3600,7 +3602,6 @@ function switchTo(root, target = null, record = true) {if (generation === switchGeneration && requestedItem !== null && view.item === requestedItem && view.root === root && view.tab === 'items') reveal();});}-// The Shouts tab's own controls: a folded shout's more and less, every agent or only those at work, the agents// panel hidden or shown, and an agent's name, which filters the feed to its shouts and addresses the composer to it.$('shouts-pane').addEventListener('click', (event) => {@@ -3944,7 +3945,6 @@ async function openApprovedBoard(boardId) {keep('pb.tab', view.tab);return switchTo(board.root);}-/** Load the configured decrypting transport once, only when relay reads or pairing need it. */let transportLoading = null;async function loadTransport() {@@ -3965,7 +3965,6 @@ async function loadTransport() {catch (error) { transportLoadError = error; pageStartup(document.documentElement).say(error.message + ' Check your connection, then reload this page.'); throw error; }finally { transportLoading = null; }}-/** Read local boards first; relay-only pages and pairing still load their configured client directly. */async function startPage() {let local = 'unreachable';diff --git a/test/cockpit/blueprint-fit.test.js b/test/cockpit/blueprint-fit.test.jsnew file mode 100644index 00000000..4a3e477e--- /dev/null+++ b/test/cockpit/blueprint-fit.test.js@@ -0,0 +1,46 @@+/** Cockpit blueprint fit checks, using the shared real-board fixtures [N26,S1]. */+import assert from 'node:assert/strict';+import { test } from 'node:test';+import { SPEC, machine, project, startView, openPage } from './fixture.js';++/**+ * A fit proposal as the state carries it after projectFit: unverified, with its recorder shown only as recorded.+ *+ * @param {object} fields - The target, decision, text or reason, and recorder.+ * @returns {object} One proposal in the state's shape.+ */+function proposal({ target, decision, text, reason, recorder }) {+ return {+ target, decision, text, reason,+ kind: 'row', key: target, source: 'blueprints/cockpit.md', blueprint: { name: 'cockpit starter', version: '2' },+ recordedAs: recorder, verified: false,+ };+}++test('the view shows every fit proposal with its reason and source [N26,S1]', async () => {+ const box = machine();+ project(box, 'fit board', SPEC);+ const view = await startView(box);+ try {+ const page = await openPage(view);+ const fit = [+ proposal({ target: 'G1', decision: 'keep', recorder: 'builder-1' }),+ proposal({ target: 'G2', decision: 'adapt', text: 'Each card names its owner.', recorder: 'builder-1' }),+ proposal({ target: 'G3', decision: 'drop', reason: 'Covered by G1.', recorder: 'reviewer-2' }),+ ];+ await page.run(`data.project.fit = ${JSON.stringify(fit)}; render();`);+ const html = page.element('spec-fit').innerHTML;+ const panel = html.replace(/<[^>]+>/g, '');+ assert.match(panel, /Blueprint fit: 3 unverified proposals waiting for you/, 'the panel counts all three proposals together');+ assert.equal((html.match(/class="fit-row"/g) || []).length, 3, 'each proposal is one row in the panel');+ assert.match(panel, /G1keepunverified draft, recorded as builder-1/, 'a keep row names its decision and its recorder as recorded');+ assert.match(panel, /G2adaptunverified draft, recorded as builder-1Each card names its owner\./, 'an adapt row shows its new text');+ assert.match(panel, /G3dropunverified draft, recorded as reviewer-2Reason: Covered by G1\./, 'a drop row shows its reason');+ assert.equal((panel.match(/Blueprint source: cockpit starter v2 row G[123]: blueprints\/cockpit\.md/g) || []).length, 3, 'every row shows its blueprint source');+ assert.doesNotMatch(panel, /authenticated|verified by|signed/i, 'no recorder is shown as authenticated');+ await page.run('data.project.fit = []; render();');+ assert.equal(page.element('spec-fit').innerHTML, '', 'the panel is empty when no proposal waits');+ } finally {+ await view.stop();+ }+});