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
Merge remote-tracking branch 'origin/main' into view/59-cmd
Corey Olson7cbd84fbdd9d
diff --cc test/cockpit.test.jsindex 9263d9b3,56a0defa..3d089088--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@@ -810,47 -809,65 +810,106 @@@ test('the tabs fit one row on a phone [await view.stop();}});+test('a pullboard command in prose chips only the command [N26]', async () => {+ // The page's command list is the CLI's: every phrase HELP declares, from its usage lines, and nothing else.+ const declared = new Set();+ for (const row of Object.values(HELP.commands)) for (const usage of row.usages) {+ const phrase = [];+ for (const word of usage.split(/\s+/).slice(1)) {+ if (/^[a-z][a-zA-Z-]*$/.test(word)) { phrase.push(word); continue; }+ const choices = /^\[?([a-z][a-zA-Z-]*(?:\|[a-z][a-zA-Z-]*)+)\]?$/.exec(word);+ if (choices) for (const choice of choices[1].split('|')) declared.add([...phrase, choice].join(' '));+ break;+ }+ if (phrase.length) declared.add(phrase.join(' '));+ }+ assert.deepEqual([...PULLBOARD_COMMANDS].sort(), [...declared].sort(), 'the view chips exactly the commands the CLI declares');+ assert.deepEqual(PULLBOARD_COMMANDS, [...PULLBOARD_COMMANDS].sort((a, b) => b.split(' ').length - a.split(' ').length), 'longest phrases first, so spec check wins over spec');++ const box = machine();+ const demo = project(box, 'commands');+ box.run(demo.repo, 'shout', 'all', [+ 'pullboard spec check prints a line for docs/api.md with 0 errors.',+ 'pullboard view serves every board.',+ 'Run pullboard next --verify 235 then review it.',+ 'pullboard verify 235 reject goes on in words.',+ 'Turn pullboard relay on now, and pullboard hold web --reason "a pause" after that.',+ "pullboard's own page has no command.",+ ].join(' '));+ const view = await startView(box);+ try {+ const page = await openPage(view);+ page.run("view.tab = 'shouts'; render();");+ const feed = page.show('feed');+ const chips = [...feed.matchAll(/<code class="inline(?: long)?">([^<]*)<\/code>/g)].map((match) => match[1].replaceAll('"', '"'));+ assert.deepEqual(chips.filter((chip) => chip.startsWith('pullboard')), ['pullboard spec check', 'pullboard view', 'pullboard next --verify 235', 'pullboard verify 235', 'pullboard relay on', 'pullboard hold'],+ `each chip is the command and its arguments, never the words after it: ${JSON.stringify(chips)}`);+ assert.ok(chips.includes('docs/api.md') && chips.includes('--reason'), 'a path and a flag in the prose after a command still chip on their own');+ for (const word of ['prints', 'serves', 'then', 'goes', 'now', 'after', 'own']) assert.ok(!chips.some((chip) => chip.split(' ').includes(word)), `"${word}" stays prose`);+ } finally {+ await view.stop();+ }+});++ test('real Chrome renders brief lists with inline paths [N26]', { timeout: 90_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for brief list checks.');++ const box = machine();+ const demo = project(box, 'briefs');+ const brief = ['The person called the old rendering ugly.', '', 'Files:', '- web/index.html', '- web/app.js', '- web/style.css', '- web/api.md', '',+ 'Test:', '- node bin/run-tests.js --test-name-pattern "brief lists" test/cockpit.test.js', '- make test stays prose', '- a parent bullet',+ ' - capture, measurement, `note`', ' - decision, rejection', '', 'Sentences:',+ '- pullboard spec check prints a DOCTRINE.md line with 0 errors, and no PRACTICE.md remains at the root.', '- npm test runs the suite before every push', '- git merge main'].join('\n');+ box.run(demo.repo, 'add', 'web', 'A brief with lists', '--specs', 'G1', '--criterion', 'lists', '--brief', brief);+ box.run(demo.repo, 'shout', 'all', 'A fence still reads as code:\n```\nconst greeting = "hello";\n```');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-brief-lists-chrome-'));+ let chrome;+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor("typeof data === 'object' && !!data && !!data.project && !!document.querySelector('#detail .text.muted')");+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width} && document.querySelector('#detail .text.muted ul') !== null`);+ const seen = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const text = document.querySelector('#detail .text.muted');+ const lists = [...text.querySelectorAll(':scope > ul.text-list')];+ const label = (list) => { let n = list.previousSibling; while (n && n.nodeType === 3 && !n.textContent.trim()) n = n.previousSibling; return n ? (n.nodeType === 3 ? n.textContent : n.textContent).trim().split('\\n').pop() : ''; };+ const item = (li) => ({ text: li.firstChild ? [...li.childNodes].filter((n) => n.nodeName !== 'UL').map((n) => n.textContent).join('') : '',+ codes: [...li.querySelectorAll(':scope > code')].map((code) => [code.textContent, getComputedStyle(code).display]), nested: [...li.querySelectorAll(':scope > ul > li')].map((child) => child.textContent) });+ const line = parseFloat(getComputedStyle(text).lineHeight);+ const testLabelTop = (() => { const r = document.createRange(); const node = [...text.childNodes].find((n) => n.nodeType === 3 && n.textContent.includes('Test:')); r.selectNode(node); return r.getBoundingClientRect().top; })();+ return { lists: lists.map((list) => ({ label: label(list), items: [...list.querySelectorAll(':scope > li')].map(item) })),+ blocks: text.querySelectorAll('code.block, .code').length, dashes: text.innerText.split('\\n').filter((l) => l.trim().startsWith('-')).length,+ gap: (testLabelTop - lists[0].getBoundingClientRect().bottom) / line, overflow: document.documentElement.scrollWidth > document.documentElement.clientWidth };+ })())`));+ const place = `${width}: ${JSON.stringify(seen)}`;+ assert.deepEqual(seen.lists.map((list) => list.label), ['Files:', 'Test:', 'Sentences:'], `${width}: each label stays a plain line above its own list`);+ assert.deepEqual(seen.lists[0].items.map((li) => li.codes), [[['web/index.html', 'inline']], [['web/app.js', 'inline']], [['web/style.css', 'inline']], [['web/api.md', 'inline']]],+ `each path is a bullet holding one inline chip at ${place}`);+ const [command, prose, parent] = seen.lists[1].items;+ assert.deepEqual(command.codes, [['node bin/run-tests.js --test-name-pattern "brief lists" test/cockpit.test.js', 'inline']], `${width}: a whole command bullet is one chip`);+ assert.deepEqual([prose.text, prose.codes], ['make test stays prose', []], `${width}: any other command, unmarked, stays prose`);+ assert.deepEqual(parent.nested, ['capture, measurement, note', 'decision, rejection'], `${width}: indented bullets nest under the bullet above them`);+ // A bullet that only starts with a command is a sentence, never one chip; the command alone is.+ const [sentence, runs, merge] = seen.lists[2].items;+ assert.ok(!sentence.codes.some(([code]) => code === sentence.text) && /0 errors, and no/.test(sentence.text), `${width}: a sentence that starts with pullboard stays prose: ${JSON.stringify(sentence)}`);+ assert.ok(!runs.codes.some(([code]) => code === runs.text), `${width}: so does one that starts with npm and goes on in words: ${JSON.stringify(runs)}`);+ assert.deepEqual(merge.codes, [['git merge main', 'inline']], `${width}: a short command alone is one chip`);+ assert.deepEqual([seen.blocks, seen.dashes], [0, 0], `${width}: no code block and no stray dash in the brief`);+ assert.ok(seen.gap > 0.4 && seen.gap < 1.6, `${width}: one blank line between a list and the next label, as written: ${seen.gap.toFixed(2)} lines`);+ assert.ok(!seen.overflow, `${width}: nothing runs off the screen`);+ }+ await chrome.evaluate("document.querySelector('[data-tab=\"shouts\"]').click()");+ await chrome.waitFor("[...document.querySelectorAll('#feed code.block')].some((code) => code.textContent.includes('const greeting'))");+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+ });+test('the view has a light and a dark theme to choose [N26]', async () => {const view = await startView(machine());try {