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): a machine with no board says how to start one [N26]
Corey Olsonf080d664101f
diff --git a/src/cockpit.js b/src/cockpit.jsindex ee07af23..43cba263 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -80,9 +80,6 @@ button, input, select, textarea { font: inherit; color: inherit; }.proj small { grid-column: 1 / -1; color: var(--ink-faint); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }.proj small.bad { color: var(--reject); }.need { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font: 700 11.5px/1.5 var(--mono); text-align: center; }-.start { margin: 12px 4px 0; padding: 10px 4px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); }-.start summary { cursor: pointer; }-.start form { margin-top: 10px; }.products { padding-top: 6px; }.prod { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 6px 8px 8px; font-size: 13px; }.prod p { margin: 0; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }@@ -104,6 +101,12 @@ button, input, select, textarea { font: inherit; color: inherit; }.switching main, .switching .products { opacity: .45; transition: opacity .12s; }main { padding: 16px 18px 28px; }+.first { display: none; max-width: 520px; margin: 10vh auto 0; padding: 22px 24px; }+.first h2 { margin: 0 0 6px; font-size: 18px; }+.first p { margin: 0; color: var(--ink-muted); }+.first code { font: 600 13px var(--mono); color: var(--ink); }+.boardless .first { display: block; }+.boardless .top, .boardless [data-pane] { display: none; }.two { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 42%, 600px); gap: 16px; align-items: start; }.two.narrow { grid-template-columns: minmax(0, 1fr) var(--agents-w); }@media (max-width: 900px) {@@ -273,7 +276,6 @@ input, select, textarea { border: 1px solid var(--line-strong); background: var(<div class="label">Projects</div><nav id="proj-list" aria-label="Projects on this machine"></nav><section class="products" id="products" aria-label="Products" hidden><div class="label">Products</div><div id="prod-list"></div></section>- <details class="start"><summary>Start a board</summary><form id="init-form" class="panel-form"><label>Folder of a git repo<input id="init-path" required placeholder="/path/to/repo"></label><button class="go" type="submit">Init</button></form></details></div></aside><div class="body">@@ -288,6 +290,10 @@ input, select, textarea { border: 1px solid var(--line-strong); background: var(<span class="live" id="live"></span></header><main>+ <section class="card-panel first">+ <h2>No boards yet</h2>+ <p>Run <code>pullboard init</code> in a git repo, or ask an agent to. Its board shows up here by itself.</p>+ </section><section data-pane="items" class="two"><div class="primary"><div class="card-panel toolbar"><div class="seg" id="state-chips" role="group" aria-label="Show"></div><input id="q" type="search" placeholder="Search" aria-label="Search titles, lanes or ids"><button class="go" id="new-item" type="button">New item</button></div>@@ -575,7 +581,7 @@ function renderSide() {$('proj-list').innerHTML = data.projects.length ? data.projects.map((x) => {const on = x.root === view.root;return '<button class="proj' + (on ? ' on' : '') + '"' + (on ? ' aria-current="true"' : '') + ' data-root="' + esc(x.root) + '" title="' + esc(x.root) + '" type="button"><span class="pname">' + esc(x.name) + '</span>' + (needCount(x) ? '<b class="need" title="needs you">' + needCount(x) + '</b>' : '') + (x.ok ? '<small>' + esc(doing(x)) : '<small class="bad">' + esc(x.error)) + '</small></button>';- }).join('') : '<div class="empty">No projects yet: run pullboard init in a repo, or start one below.</div>';+ }).join('') : '<div class="empty">None yet.</div>';const elsewhere = data.projects.filter((x) => x.root !== view.root).reduce((n, x) => n + needCount(x), 0);$('proj-elsewhere').textContent = elsewhere ? elsewhere + ' elsewhere' : '';$('proj-elsewhere').hidden = !elsewhere;@@ -590,9 +596,11 @@ function renderSide() {function render() {const p = data.project;renderSide();+ // With no board to show, one message says how a board starts, in place of empty panes.+ document.body.classList.toggle('boardless', !p);+ $('products').hidden = !p || !p.products.length;if (!p) return;// Each product's progress (N28): the rows an accepted item cites, and its items by state.- $('products').hidden = !p.products.length;$('prod-list').innerHTML = p.products.map((x) => {const states = [['open', '', x.items.open], ['building', 'building', x.items.claimed], ['to verify', 'verify', x.items.submitted], ['verified', 'verified', x.items.verified]].filter(([, , n]) => n);return '<div class="prod" title="' + x.rows + ' rows in force, ' + x.approved + ' approved, ' + x.proven + ' cited by accepted items"><p><b>' + esc(x.name) + '</b><span>' + x.proven + '/' + x.rows + ' rows met</span></p><div class="bar"><i style="width:' + (x.rows ? Math.round((100 * x.proven) / x.rows) : 0) + '%"></i></div>'@@ -884,17 +892,6 @@ $('hold-form').addEventListener('submit', async (event) => {event.preventDefault();if (await act('hold', { lane: $('hold-lane').value, reason: $('hold-reason').value })) $('hold-reason').value = '';});-// A board just started is the one to look at, and init's output ends with what to do next, so it-// stays until the person closes it.-$('init-form').addEventListener('submit', async (event) => {- event.preventDefault();- const known = new Set(data ? data.projects.map((x) => x.root) : []);- if (!(await act('init', { path: $('init-path').value }, null))) return;- $('init-path').value = '';- clearTimeout(view.closing);- const started = data && data.projects.find((x) => !known.has(x.root));- if (started) switchTo(started.root);-});showTab();refresh().catch((error) => { $('live').textContent = 'cannot reach the view: ' + error.message; });setInterval(() => { if (!document.hidden) refresh().catch(() => { $('live').textContent = 'offline: is pullboard view still running?'; }); }, 3000);diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex 2a32764c..d029f070 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -1169,41 +1169,28 @@ test('a new item from the view can carry a brief [N27]', async () => {await view.stop();}});-test('starting a board shows it [N27]', async () => {+test('a machine with no board says how to start one [N26]', async () => {const box = machine();- project(box, 'alpha');- const fresh = join(box.dir, 'fresh');- mkdirSync(fresh);- box.git(fresh, 'init', '-q', '-b', 'main');- writeFileSync(join(fresh, 'README.md'), '# Fresh\n');- box.git(fresh, 'add', '-A');- box.git(fresh, 'commit', '-q', '-m', 'chore: start');- const plain = join(box.dir, 'plain');- mkdirSync(plain);const view = await startView(box);try {const page = await openPage(view);- // The page's timers, held by the test, so a pending close shows.- page.run('globalThis.closes = []; globalThis.setTimeout = (run, ms) => closes.push({ run, ms, live: true }); globalThis.clearTimeout = (id) => { if (closes[id - 1]) closes[id - 1].live = false; };');- const start = async (path) => {- page.element('init-path').value = path;- await page.fire('init-form', 'submit');- };- const out = page.element('console');-- await start(plain);- assert.equal(out.className, 'console no', 'init refuses a folder that is no git repo');- assert.equal(page.element('proj-name').textContent, 'alpha', 'and the view stays where it was');-- await start(fresh);- assert.equal(out.className, 'console ok');- assert.match(out.textContent, /^\$ pullboard init\n[^]*\nnext: /, 'the output ends with what to do next');- assert.equal(out.hidden, false);- assert.ok(JSON.parse(page.run('JSON.stringify(closes.map((close) => close.live))')).every((live) => !live), 'and no close is pending, so it stays');- assert.equal(page.element('init-path').value, '');- assert.equal(page.element('proj-name').textContent, 'fresh', 'the view shows the board just started');- assert.deepEqual(projectRows(page.show('proj-list')).map((row) => [row.name, row.current]), [['alpha', false], ['fresh', true]]);- assert.match(page.show('chain'), /No items yet/, 'its own empty board');+ const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));+ // Agents start boards, so the view offers no form for it.+ assert.doesNotMatch(page.html, /init-form|init-path|Start a board|<details/, 'no form to start a board');+ assert.doesNotMatch(style, /\.start\b/);++ assert.equal(page.run("document.body.classList.contains('boardless')"), true, 'with no board, the board steps aside');+ assert.match(style, /\n\.first \{ display: none;[^}]*\}\n(?:\.first [^\n]*\n)*\.boardless \.first \{ display: block; \}\n\.boardless \.top, \.boardless \[data-pane\] \{ display: none; \}\n/, 'its bar of tabs and its panes hide, and the message shows');+ assert.match(page.html, /<main>\n {2}<section class="card-panel first">\n {4}<h2>No boards yet<\/h2>\n {4}<p>Run <code>pullboard init<\/code> in a git repo, or ask an agent to\. Its board shows up here by itself\.<\/p>\n {2}<\/section>\n/, 'the message says how a board starts');+ assert.equal(page.show('proj-list'), '<div class="empty">None yet.</div>');+ assert.equal(page.element('products').hidden, true);++ // A board started meanwhile shows up on the next refresh, with no reload.+ project(box, 'alpha');+ await page.run('refresh()');+ assert.equal(page.run("document.body.classList.contains('boardless')"), false, 'a board shows its tabs and panes');+ assert.equal(page.element('proj-name').textContent, 'alpha');+ assert.deepEqual(projectRows(page.show('proj-list')).map((row) => [row.name, row.current]), [['alpha', true]]);} finally {await view.stop();}