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): keep Needs-you readable in read-only mode [N26,B26]
Corey Olsonc953aad07848
diff --git a/src/cockpit.js b/src/cockpit.jsindex 6b8eaca5..6d006180 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -867,11 +867,17 @@ function render() {const needs = [...p.decisions.map((d) => ['decide:' + d.shout_id, d.shout_from, d.shout_text, 'decide', d.shout_at]),...p.spec.filter((r) => r.status === 'pending').map((r) => ['spec:' + r.id, r.id, r.text, 'answer in SPEC.md']),- ...p.holds.map((h) => ['tab:shouts', h.hold_lane, h.hold_reason, 'lane held by ' + h.hold_by]),+ ...p.holds.map((h) => ['tab:shouts', h.hold_lane, h.hold_reason, 'lane held by ' + h.hold_by, h.hold_at]),];const drafts = p.spec.filter((r) => r.status === 'draft').length;$('needs').hidden = !needs.length && !drafts;- $('needs').innerHTML = '<div class="head"><i></i>Needs you</div>' + needs.slice(0, 6).map(([target, ref, text, what, at]) => '<button class="ny" data-go="' + esc(target) + '" type="button"><code>' + esc(ref) + '</code><span>' + rich(text, titles, false) + '</span><em>' + esc(what) + (at ? ', ' + age(at) : '') + ' →</em></button>').join('') + (needs.length > 6 ? '<div class="muted more">and ' + (needs.length - 6) + ' more</div>' : '') + (drafts ? '<button class="ny" data-go="tab:spec" type="button"><code>' + drafts + '</code><span>draft spec rows to approve or drop</span><em>review →</em></button>' : '');+ /** Render one Needs-you entry as a link for an active page or text for a read-only page. */+ const needRow = ([target, ref, text, what, at]) => {+ const tag = readOnly ? 'div' : 'button';+ const action = readOnly ? '' : ' data-go="' + esc(target) + '" type="button"';+ return '<' + tag + ' class="ny"' + action + '><code>' + esc(ref) + '</code><span>' + rich(text, titles, false) + '</span><em>' + esc(what) + (at ? ', ' + age(at) : '') + ' →</em></' + tag + '>';+ };+ $('needs').innerHTML = '<div class="head"><i></i>Needs you</div>' + needs.slice(0, 6).map(needRow).join('') + (needs.length > 6 ? '<div class="muted more">and ' + (needs.length - 6) + ' more</div>' : '') + (drafts ? needRow(['tab:spec', String(drafts), 'draft spec rows to approve or drop', 'review']) : '');const lanes = p.lanes;const working = lanes.filter((l) => l !== 'coordinator');diff --git a/src/view.css b/src/view.cssindex f434b7ac..ff3b2d01 100644--- a/src/view.css+++ b/src/view.css@@ -145,8 +145,9 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }.needs-you .head.quiet { color: var(--ink-muted); font-weight: 600; }.needs-you .ask + .head.quiet { margin-top: 12px; }.needs-you .more { padding: 2px 4px; }-.ny { display: grid; grid-template-columns: auto minmax(5em, 1fr) minmax(0, max-content); gap: 10px; align-items: baseline; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: 8px; cursor: pointer; width: 100%; }-.ny:hover { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }+.ny { display: grid; grid-template-columns: auto minmax(5em, 1fr) minmax(0, max-content); gap: 10px; align-items: baseline; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: 8px; min-height: 44px; width: 100%; }+button.ny { cursor: pointer; }+button.ny:hover { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }.ny code { font: 600 12px var(--mono); }.ny span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }.ny em { font-style: normal; color: var(--warn); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex 6e7272a2..80931e19 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -1528,7 +1528,7 @@ test("needs-you holds only the person's calls; the rest show on the board with w['tab', '1', 'draft spec rows to approve or drop'],], "the person's calls, and only those: the decision asked of them, the spec's question, the held lane, the draft row");assert.doesNotMatch(needs, /Which colour|Greeting|Farewell/, "an agent's ask, work waiting for a verdict and work sent back are not the person's");- assert.match(needs, /<code>web<\/code><span>G3 is open<\/span><em>lane held by coordinator →<\/em>/, 'a held lane says who set it');+ assert.match(needs, /<code>web<\/code><span>G3 is open<\/span><em>lane held by coordinator, <time data-ago="[^"]+">(?:now|\d+[mhd])<\/time> →<\/em>/, 'a held lane says who set it and shows the API-provided hold age');// Each of the rest is on the board, with who holds it.assert.match(page.show('decisions'), /<div class="head quiet">Waiting on others<\/div><div class="ask other"><p><small><b>web-1<\/b> asks <b>coordinator<\/b>, /, "the agent's ask waits on its coordinator");@@ -2639,12 +2639,12 @@ test('served connection reaches an authenticated API on another origin and path}});-test('read-only pages use a local browser transport and refresh on its updates [N26,N27]', { timeout: 90_000 }, async (t) => {+test('read-only Needs-you preserves each entry as text while its transport stays read-only [N26,N27,B26]', { timeout: 90_000 }, async (t) => {const executable = chromeExecutable();if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME to run the browser transport proof.');const box = machine();- const app = project(box, 'read only transport');+ const app = project(box, 'read only transport', `${SPEC}- G3 [pending, must] Confirm the read-only question. | gate: review\n- G4 [draft, must] Confirm the draft row. | gate: review\n`);box.run(app.repo, 'add', 'web', 'Read-only fixture item', '--specs', 'G1', '--criterion', 'keeps action controls in the DOM');box.run(app.repo, 'shout', 'person', 'Should the read-only fixture ship?', '--decision');box.run(app.repo, 'hold', 'web', '--reason', 'read-only fixture hold');@@ -2716,8 +2716,26 @@ test('read-only pages use a local browser transport and refresh on its updates [scratch.push(profile);let chrome;try {- chrome = await openSnapshotChrome(executable, `http://127.0.0.1:${address.port}/`, profile);+ chrome = await openSnapshotChrome(executable, live.link.href, profile);+ await chrome.waitFor("typeof data === 'object' && !!data?.project && document.querySelector('#needs .ny')?.textContent.includes('Should the read-only fixture ship?')");+ /** Read Needs-you labels with absolute API age timestamps so the comparison survives minute ticks. */+ const readNeedEntries = () => chrome.evaluate(`JSON.stringify([...document.querySelectorAll('#needs .ny')].map((row) => {+ const em = row.querySelector('em');+ const time = em.querySelector('time');+ return [row.querySelector('code')?.textContent, row.querySelector('span')?.textContent,+ time ? em.textContent.replace(time.textContent, '@' + time.dataset.ago) : em.textContent];+ }))`);+ const normalEntries = JSON.parse(await readNeedEntries());+ assert.deepEqual(normalEntries.map((row) => row[0]), ['coordinator', 'G3', 'web', '1'], 'the normal Needs-you list contains the decision, pending row, held lane, and draft summary');+ assert.match(normalEntries[0][2], /decide, @[^ ]+ →/, 'the API-provided decision timestamp is shown as an age');+ assert.match(normalEntries[2][2], /lane held by coordinator, @[^ ]+ →/, 'the holder and API-provided hold timestamp are shown as an age');+ await chrome.send('Page.navigate', { url: `http://127.0.0.1:${address.port}/` });await chrome.waitFor("typeof data === 'object' && document.body?.classList.contains('read-only') && !!data?.project && typeof window.__transportUpdate === 'function'");+ await chrome.waitFor("document.querySelector('#needs .ny')?.textContent.includes('Should the read-only fixture ship?')");+ const readOnlyEntries = JSON.parse(await readNeedEntries());+ assert.deepEqual(readOnlyEntries, normalEntries, 'read-only Needs-you preserves the normal entries and their API-provided asker and ages');+ assert.equal(await chrome.evaluate("document.querySelectorAll('#needs button, #needs [data-go], #needs [data-new], #needs [data-shout], #needs [data-release]').length"), 0,+ 'read-only Needs-you entries contain no answer, approve, navigation, or other action controls');const calls = JSON.parse(await chrome.evaluate('JSON.stringify(window.__transportCalls)'));assert.ok(calls.some((call) => call.path === '/api/v1/boards'));assert.ok(calls.some((call) => call.path.startsWith('/api/v1/boards/') && call.path.endsWith('/state')));