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): show person-only blocks in Needs you [N26]
Corey Olsoncf865e98c145
diff --git a/src/cockpit.js b/src/cockpit.jsindex 6db0335b..92b21985 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -1115,7 +1115,8 @@ function render() {const needs = personalNeeds.filter((row) => !['draft', 'rigor-draft', 'sentinel-draft', 'agent-approved'].includes(row.kind)).map((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)- : ['tab:shouts', row.ref, row.text, row.what, p.holds.find((hold) => hold.hold_lane === row.id)?.hold_at]);+ : row.kind === 'block' ? [null, row.ref, row.text, row.what, row.at, 'block']+ : ['tab:shouts', row.ref, row.text, row.what, p.holds.find((hold) => hold.hold_lane === row.id)?.hold_at]);const drafts = personalNeeds.find((row) => row.kind === 'draft')?.count ?? 0;const rigorDrafts = personalNeeds.filter((row) => row.kind === 'rigor-draft');const sentinelDrafts = personalNeeds.filter((row) => row.kind === 'sentinel-draft');@@ -1124,10 +1125,11 @@ function render() {// its kind where an item has its lane, and what to do at the right. Every call is a row; the draft rows are one row// with their count. Read-only, a row is its words, opening nothing.$('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 ? '' : ' data-go="' + esc(target) + '"') + '><span class="dot ask"></span><div><div class="t">' + (ref ? '<span>' + esc(ref) + '</span>' : '') + rich(text, titles, !readOnly) + '</div>'+ 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[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 needKind = (entry) => 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');$('needs').innerHTML = needs.map(needKind).join('')+ rigorDrafts.map(row => needRow([row.target, row.ref, row.text], 'a proved Rigor draft', 'Approve or Decline')).join('')+ sentinelDrafts.map(row => sentinelDraftRow(row)).join('')diff --git a/test/cockpit/needs.test.js b/test/cockpit/needs.test.jsindex c8b301af..7a78d6eb 100644--- a/test/cockpit/needs.test.js+++ b/test/cockpit/needs.test.js@@ -1,12 +1,13 @@/** @pullboard-test-input source-tree *//** Cockpit needs checks, using the shared real-board fixtures [N26]. */import assert from 'node:assert/strict';+import { spawnSync } from 'node:child_process';import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { createServer } from 'node:http';import { tmpdir } from 'node:os';import { join } from 'node:path';import { test } from 'node:test';-import { SPEC, machine, project, build, sendBack, startView, styleOf, element, openPage, projectRows, agentEntries, needEntries, itemRow, shoutNameText, chromeExecutable, openSnapshotChrome, closeSnapshotChrome, chooseFilter, boardId, boardOf, fetchLive, serveFolder } from './fixture.js';+import { BIN, SPEC, machine, project, build, sendBack, startView, styleOf, element, openPage, projectRows, agentEntries, needEntries, itemRow, shoutNameText, chromeExecutable, openSnapshotChrome, closeSnapshotChrome, chooseFilter, boardId, boardOf, fetchLive, serveFolder } from './fixture.js';import { cockpitPage } from '../../src/cockpit.js';import { runFixtureChild } from '../fixture-child.js';import { approvalAgentApi, approvalReadGate } from './agent-approval-fixture.js';@@ -145,6 +146,50 @@ test("the page's Needs-you comes from the shared builder [N26]", { timeout: 180_}});+test('a person-only block shows in Needs you with its one step [N26]', async () => {+ const box = machine();+ const alpha = project(box, 'person block');+ box.env.CLAUDECODE = '1';+ const refused = spawnSync(process.execPath, [BIN, 'answer', '1', 'yes', '--as', 'person'], {+ cwd: alpha.repo, env: box.env, encoding: 'utf8',+ });+ delete box.env.CLAUDECODE;+ assert.equal(refused.status, 1, refused.stderr);+ assert.match(refused.stderr, /only the person can clear this/u);++ const view = await startView(box);+ try {+ const page = await openPage(view);+ const state = await boardOf(view, alpha.repo);+ assert.equal(state.blocks.length, 1, 'the live API supplies the person-only block list');+ assert.equal(state.blocks[0].audience, 'person');+ const entries = needEntries(page.show('needs'));+ assert.deepEqual(entries, [[null, 'blocked', 'Pullboard stopped a request that only you can clear: this terminal belongs to an agent',+ state.blocks[0].step, 'next step']], 'the view shows the plain reason and the exact API step without a bogus release action');+ assert.doesNotMatch(page.show('needs'), /B26_PERSON_CHANNEL|--as|pullboard answer/u,+ 'the view does not expose the rule code or refused command');++ // Model #1077's API result after a successful matching move: the view follows the returned list instead of+ // maintaining its own clear rule or editing the ledger.+ page.run(`globalThis.realFetch = fetch;+globalThis.hidePersonBlocks = false;+globalThis.fetch = async function controlledStateFetch(path, init) {+ const reply = await globalThis.realFetch(path, init);+ if (!globalThis.hidePersonBlocks || !String(path).includes('/state')) return reply;+ const body = await reply.json();+ if (!body.state) throw new Error('the test expected a fresh board-state response');+ body.state.blocks = [];+ return { ok: reply.ok, status: reply.status, json: async () => body };+};`);+ page.run('globalThis.hidePersonBlocks = true; sentStates.clear();');+ await page.run('refresh()');+ assert.equal(needEntries(page.show('needs')).some(entry => entry[2].includes('Pullboard stopped a request')), false,+ 'the row disappears when the next API state no longer lists the block');+ } finally {+ await view.stop();+ }+});+test('a decision waits in needs-you until the view answers it [B21, B26, N27]', async () => {const box = machine();