Skip to content

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.

fix(view): a fresh board files new work where it can be built [N26,N27]

Corey Olson20eed7f721fa
diff --git a/src/cockpit.js b/src/cockpit.js
index ffabed02..d2570993 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -659,11 +659,16 @@ function render() {
const lanes = p.lanes;
const working = lanes.filter((l) => l !== 'coordinator');
- if ($('add-lane').dataset.lanes !== lanes.join()) {
- $('add-lane').dataset.lanes = lanes.join();
- $('add-lane').innerHTML = [...working, 'coordinator'].map((l) => '<option>' + esc(l) + '</option>').join('');
+ // New work goes first to a lane that owns folders, where builders work, then to the coordinator; a
+ // lane that owns none, such as review, is for verifiers and comes last.
+ const filing = [...working.filter((l) => p.owning.includes(l)), 'coordinator', ...working.filter((l) => !p.owning.includes(l))];
+ if ($('add-lane').dataset.lanes !== filing.join()) {
+ $('add-lane').dataset.lanes = filing.join();
+ $('add-lane').innerHTML = filing.map((l) => '<option>' + esc(l) + '</option>').join('');
$('hold-lane').innerHTML = working.map((l) => '<option>' + esc(l) + '</option>').join('');
}
+ const approved = p.spec.filter((r) => r.status === 'approved');
+ $('add-specs').placeholder = (approved.length ? approved : p.spec).slice(0, 2).map((r) => r.id).join(',') || 'none yet';
const q = $('q').value.trim().toLowerCase();
// Each chip counts what it would show under the lane and the search. A search looks through every
// state, withdrawn items included; browsing leaves those out.
@@ -759,7 +764,7 @@ function render() {
const head = r.section !== section ? '<h4>' + esc(r.section) + '</h4>' : '';
section = r.section;
return head + '<div class="srow' + (view.row[kind] === r.id ? ' on' : '') + '" data-row="' + kind + ':' + esc(r.id) + '"><code>' + esc(r.id) + '</code><span><span class="chip ' + tone(r.status) + '">' + esc(r.status) + '</span></span><span>' + esc(r.text) + '</span></div>';
- }).join('') : '<div class="empty">No rows match.</div>';
+ }).join('') : '<div class="empty">' + (rows.length ? 'No rows match.' : kind === 'spec' ? 'No spec rows yet. Each requirement is one row in SPEC.md, such as G1 [draft, must] and a line; write them, or ask an agent to, and they show up here.' : 'No practice rows yet: they live in PRACTICE.md.') + '</div>';
const row = rows.find((r) => r.id === view.row[kind]);
const citing = row ? p.items.filter((i) => i.specs.includes(row.id)) : [];
$(kind + '-detail').innerHTML = row ? '<div style="display:grid;gap:12px"><h2><span>' + esc(row.id) + '</span>' + esc(row.text) + '</h2><div class="meta"><span class="chip ' + tone(row.status) + '">' + esc(row.status) + '</span>' + (row.tier ? '<span class="chip">' + esc(row.tier) + '</span>' : '') + '</div><dl class="kv"><dt>section</dt><dd>' + esc(row.section) + '</dd>' + (row.gate ? '<dt>gate</dt><dd>' + esc(row.gate) + '</dd>' : '') + (row.serves && row.serves.length ? '<dt>serves</dt><dd>' + esc(row.serves.join(', ')) + '</dd>' : '') + '</dl><div><h3>Items that cite it</h3>' + (citing.length ? '<div class="links">' + citing.map((i) => '<button data-go="item:' + i.id + '" type="button">#' + i.id + ' ' + esc(i.title) + '</button>').join('') + '</div>' : '<div class="muted">None yet.</div>') + '</div><div class="muted">Rows change in ' + (kind === 'spec' ? 'SPEC.md' : 'PRACTICE.md') + ', and only you approve them.</div></div>' : '<div class="empty">Pick a row to see it, and the items that cite it.</div>';
diff --git a/src/serve.js b/src/serve.js
index 8012c425..d2dda6f2 100644
--- a/src/serve.js
+++ b/src/serve.js
@@ -94,6 +94,8 @@ export function projectState(root, { seen = null } = {}) {
return {
root: info.root,
lanes: [COORDINATOR, ...Object.keys(config.lanes)],
+ // The lanes that own folders, where builders work; review lanes own none.
+ owning: Object.keys(config.lanes).filter((lane) => (config.lanes[lane].owns ?? []).length > 0),
items: all.map((item) => {
const verdicts = store.verdictsFor(board, item.item_id).map(verdict);
const after = item.item_after ? item.item_after.split(',').map(Number) : [];
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index de03699b..fe97efd1 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -1325,6 +1325,30 @@ test('a machine with no board says how to start one [N26]', async () => {
await view.stop();
}
});
+test('a fresh board files new work where it can be built [N26, N27]', async () => {
+ const box = machine();
+ // A repo set up by init alone: its only lane is review, which owns no folders, and it has no rows.
+ const fresh = join(box.dir, 'fresh');
+ mkdirSync(fresh);
+ box.git(fresh, 'init', '-q', '-b', 'main');
+ box.run(fresh, 'init');
+ const beta = project(box, 'beta', SPEC, { lanes: { web: { owns: ['web/'], specs: ['G'] }, review: { owns: [] } } });
+ const view = await startView(box);
+ try {
+ const page = await openPage(view);
+ assert.equal(page.element('proj-name').textContent, 'fresh');
+ assert.equal(page.show('add-lane'), '<option>coordinator</option><option>review</option>', 'with no lane that owns folders, new work goes to the coordinator, not to the verifiers');
+ assert.equal(page.element('add-specs').placeholder, 'none yet', 'and its hint names no rows the board lacks');
+ assert.equal(page.show('spec-list'), '<div class="empty">No spec rows yet. Each requirement is one row in SPEC.md, such as G1 [draft, must] and a line; write them, or ask an agent to, and they show up here.</div>', 'the Spec tab says where rows come from');
+
+ await page.click({ root: beta.repo });
+ assert.equal(page.show('add-lane'), '<option>web</option><option>coordinator</option><option>review</option>', 'a lane that owns folders comes first, review last');
+ assert.equal(page.element('add-specs').placeholder, 'G1,G2');
+ assert.equal(page.show('spec-list'), '<div class="empty">No rows match.</div>', 'rows a filter hides are not missing');
+ } finally {
+ await view.stop();
+ }
+});
test('the view runs no init [N27]', async () => {
const box = machine();
const alpha = project(box, 'alpha');