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(cockpit): order roadmap work before shipped items [N26]
Corey Olsonb7a34b3663ec
diff --git a/src/cockpit.js b/src/cockpit.jsindex e589d13e..8677a98d 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -1637,12 +1637,12 @@ function milestoneRow(row, titles) {: '<li><button ' + attributes + ' type="button">' + inner + '</button></li>';}-/** Read a release once using the same terminal-item rule in the Roadmap and status bar. */+/** Read the work still to ship before verified items, excluding withdrawn work from every count. */function readMilestone(milestone, p) {- const rows = milestone.items.map((entry) => milestoneItem(entry, p));- const done = rows.filter((row) => row.state === 'verified').length;- // A nonempty release has no work left when every item is verified or withdrawn.- return { milestone, rows, done, shipped: rows.length > 0 && rows.every((row) => row.state === 'verified' || row.state === 'withdrawn') };+ const visible = milestone.items.map((entry) => milestoneItem(entry, p)).filter((row) => row.state !== 'withdrawn');+ const verified = visible.filter((row) => row.state === 'verified');+ const rows = visible.filter((row) => row.state !== 'verified').concat(verified);+ return { milestone, rows, done: verified.length, shipped: rows.length > 0 && verified.length === rows.length };}/** Pick the first release with remaining work in roadmap order; empty plans wait behind it. */@@ -1655,7 +1655,7 @@ function nextMilestone(p) {/*** The Roadmap (N26, N38) leads with what ships next: every milestone with work still to verify, in the board's order,- * open by default; then one Shipped section, folded, holding nonempty milestones with only verified or withdrawn items, newest+ * open by default; then one Shipped section, folded, holding nonempty milestones with only verified items, newest* first, each a line with its name, its item count and its note's first line. A milestone opens to a card as before:* how many of its items are verified as a count and a bar, a row for each, and the note to the person in its own* highlighted line; one with no items says so. Each part stays open or closed as the person left it.diff --git a/test/cockpit/roadmap.test.js b/test/cockpit/roadmap.test.jsindex 28365539..0062c382 100644--- a/test/cockpit/roadmap.test.js+++ b/test/cockpit/roadmap.test.js@@ -115,14 +115,13 @@ test('the roadmap reads every item as the Items tab does, opens each one, anothebox.run(alpha.repo, 'milestone', 'add', 'Later', '--note', 'Ideas not filed yet.');// What the person reads on each row: the Items tab's word for the item's state, and its colour's class.const words = [- { id: '#1', label: 'verified', tone: 'ok' },- { id: '#2', label: 'verified', tone: 'ok' },{ id: '#3', label: 'sent back', tone: 'no' },{ id: '#4', label: 'to verify', tone: 'warn' },{ id: 'beacon#1', label: 'sent back', tone: 'no' },+ { id: '#1', label: 'verified', tone: 'ok' },+ { id: '#2', label: 'verified', tone: 'ok' },{ id: '#5', label: 'building', tone: 'busy' },{ id: '#6', label: 'unclaimed', tone: 'free' },- { id: '#7', label: 'withdrawn', tone: '' },];const view = await startView(box);const roadmapPath = '/roadmap-demo/roadmap';@@ -154,12 +153,12 @@ test('the roadmap reads every item as the Items tab does, opens each one, anotheassert.ok(seen.document <= seen.client && seen.body <= seen.client, `${width}: no sideways scroll: ${JSON.stringify(seen)}`);assert.deepEqual(seen.cards.map((card) => card.name), ['Launch', 'Next', 'Later'], `${width}: a card for each milestone, in order`);assert.deepEqual(seen.cards.map((card) => card.note), ['Ships when the review lands; your call on the name.', 'Queued behind Launch.', 'Ideas not filed yet.'], `${width}: each card's note`);- assert.deepEqual(seen.cards.map((card) => [card.count, card.progress, card.filled]), [['2/5 done', [2, 5], 0.4], ['0/3 done', [0, 3], 0], [null, null, null]], `${width}: counts and bars say how many items are verified`);+ assert.deepEqual(seen.cards.map((card) => [card.count, card.progress, card.filled]), [['2/5 done', [2, 5], 0.4], ['0/2 done', [0, 2], 0], [null, null, null]], `${width}: counts and bars say how many visible items are verified`);assert.deepEqual([seen.cards[2].empty, seen.cards[2].rows.length], ['No items yet.', 0], `${width}: an empty milestone says so, with no bar or count`);const rows = seen.cards.flatMap((card) => card.rows);assert.deepEqual(rows.map(({ id, label, tone }) => ({ id, label, tone })), words, `${width}: each chip shows the word and colour the Items tab gives its item's state`);assert.ok(rows.every((row) => row.seen), `${width}: every chip is on screen`);- assert.deepEqual(rows.map((row) => row.title), [...titles.slice(0, 4), 'Billing webhook retries', ...titles.slice(4)], `${width}: each row names its item`);+ assert.deepEqual(rows.map((row) => row.title), [titles[2], titles[3], 'Billing webhook retries', titles[0], titles[1], titles[4], titles[5]], `${width}: unfinished work precedes verified items in each milestone`);assert.deepEqual(rows.map((row) => row.tip), rows.map((row) => row.title), `${width}: each row's tooltip is its whole title`);assert.ok(rows.every((row) => row.lines === 1 && row.ellipsis), `${width}: every title holds one line, set to end in an ellipsis: ${JSON.stringify(rows)}`);assert.ok(rows.find((row) => row.id === '#6').cut, `${width}: the long title is cut, so its ellipsis shows`);@@ -247,6 +246,70 @@ test('the roadmap reads every item as the Items tab does, opens each one, anothe}});+test('a milestone lists work to ship first, shipped below, and no withdrawn items [N26]', { timeout: 90_000 }, async (t) => {+ const executable = chromeExecutable();+ assert.ok(executable, 'Chrome is required for shipping-order checks.');+ const box = machine();+ const alpha = project(box, 'shipping-rows');+ for (const title of ['First verified', 'First open', 'Second verified', 'Dropped idea', 'Second open']) {+ box.run(alpha.repo, 'add', 'web', title, '--specs', 'G1', '--criterion', 'renders');+ }+ for (const id of [1, 3]) { build(box, alpha, id, `page-${id}.html`); accept(box, alpha, id); }+ box.run(alpha.repo, 'withdraw', '4', 'not needed');+ box.run(alpha.repo, 'milestone', 'add', 'Next', '--items', '3,2,4,1,5');+ box.run(alpha.repo, 'milestone', 'add', 'Shipped', '--items', '1,4,3');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-shipping-rows-chrome-'));+ let chrome;+ /** Read the actual row order and every visible-count consumer, including folded history. */+ const read = async () => JSON.parse(await chrome.stable(`JSON.stringify((() => {+ const next = document.querySelector('#roadmap-list > [data-key="m:Next"]');+ const progress = next.querySelector('[role=progressbar]');+ const shipped = document.querySelector('#roadmap .shipped-one[data-key="m:Shipped"]');+ return {+ rows: [...next.querySelectorAll(':scope > .milestone-body > ul .milestone-item .id')].map(id => id.textContent),+ count: next.querySelector('.milestone-count').textContent,+ progress: [progress.getAttribute('aria-valuenow'), progress.getAttribute('aria-valuemax')],+ index: document.querySelector('#roadmap-panel [data-roadmap-jump="m:Next"] b').textContent,+ status: document.querySelector('[data-status=release]').textContent.replace(/\\s+/g, ' ').trim(),+ openCounts: [...document.querySelectorAll('[data-shipping-stage=open] dd')].map(count => count.textContent),+ shippedCount: shipped.querySelector('.milestone-count').textContent,+ shippedRows: [...shipped.querySelectorAll(':scope > .milestone-body > ul .milestone-item .id')].map(id => id.textContent),+ allIds: [...document.querySelectorAll('#roadmap .milestone-item .id')].map(id => id.textContent),+ };+ })())`));+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor('data?.project?.milestones?.length === 2');+ await press(chrome, "document.querySelector('[data-tab=roadmap]')");+ await chrome.waitFor("!document.querySelector('[data-pane=roadmap]').hidden && document.querySelector('#roadmap-list > [data-key=\"m:Next\"]')");+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width}`);+ const seen = await read();+ assert.deepEqual(seen.rows, ['#2', '#5', '#3', '#1'], `${width}: each group keeps milestone order, with work to ship before verified items`);+ assert.equal(seen.count, '2/4 done', `${width}: withdrawn work is absent from the card count`);+ assert.deepEqual(seen.progress, ['2', '4'], `${width}: progress counts only retained items`);+ assert.equal(seen.index, '2/4', `${width}: the release index uses the same count`);+ assert.equal(seen.status, 'Next 2/4', `${width}: the status bar names the same next release and count`);+ assert.deepEqual(seen.openCounts, ['2', '2'], `${width}: desktop and mobile shipping counts include both open items`);+ assert.equal(seen.shippedCount, '2 items', `${width}: folded history excludes withdrawn work from its total`);+ assert.equal(seen.allIds.includes('#4'), false, `${width}: no withdrawn row is rendered, including folded history`);+ await press(chrome, "document.querySelector('#roadmap-list > [data-key=shipped] > .milestone-head')");+ await press(chrome, "document.querySelector('#roadmap .shipped-one[data-key=\"m:Shipped\"] > .milestone-head')");+ await chrome.waitFor("document.querySelector('#roadmap .shipped-one[data-key=\"m:Shipped\"] > .milestone-head').getAttribute('aria-expanded') === 'true'");+ assert.deepEqual((await read()).shippedRows, ['#1', '#3'], `${width}: verified history remains available below the work to ship`);+ await press(chrome, "document.querySelector('#roadmap .shipped-one[data-key=\"m:Shipped\"] > .milestone-head')");+ await press(chrome, "document.querySelector('#roadmap-list > [data-key=shipped] > .milestone-head')");+ }+ assert.deepEqual(chrome.exceptions, [], 'the shipping roadmap raises no uncaught page exception');+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});+test('the roadmap leads with the next release and folds shipped ones [N26]', { timeout: 150_000 }, async (t) => {const executable = chromeExecutable();if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for roadmap browser checks.');@@ -323,13 +386,13 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { tconst expanded = await read();const history = expanded.parts.find((part) => part.key === 'shipped');assert.deepEqual(history.shipped.map((one) => [one.key, one.open, one.summary]), [- ['m:0.2', false, '0.2 | Shipped on Tuesday. | 2 items'],+ ['m:0.2', false, '0.2 | Shipped on Tuesday. | 1 item'],['m:0.1', false, '0.1 | The first page. | 1 item'],], at + ': shipped names, first note line and counts in reverse roadmap order');assert.ok(history.shipped.every((one) => one.height >= 44), at + ': shipped targets are at least 44px');assert.ok(expanded.page.scroll <= expanded.page.width && expanded.page.body <= expanded.page.width, at + ': expanded history has no sideways scroll');await click('#roadmap .shipped-one[data-key="m:0.2"] > .milestone-head');- assert.deepEqual((await read()).parts.find((part) => part.key === 'shipped').shipped[0].rows, ['#2', '#6'], at + ': verified and withdrawn items remain readable');+ assert.deepEqual((await read()).parts.find((part) => part.key === 'shipped').shipped[0].rows, ['#2'], at + ': verified items remain readable and withdrawn work is absent');await proofShot(chrome, 'releases', width);await click('#roadmap .shipped-one[data-key="m:0.2"] > .milestone-head');await click('#roadmap-list > [data-key="shipped"] > .milestone-head');@@ -348,13 +411,13 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { tlet r = await read();const shipped = r.parts.find((part) => part.key === 'shipped');assert.deepEqual(shipped.shipped.map((one) => [one.key, one.open, one.summary]), [- ['m:0.2', false, '0.2 | Shipped on Tuesday. | 2 items'],+ ['m:0.2', false, '0.2 | Shipped on Tuesday. | 1 item'],['m:0.1', false, '0.1 | The first page. | 1 item'],], 'newest first, each one line, closed');assert.ok(shipped.shipped.every((one) => one.height >= 44), 'each a 44px target');await click('#roadmap .shipped-one[data-key="m:0.2"] > .milestone-head');r = await read();- assert.deepEqual(r.parts.find((part) => part.key === 'shipped').shipped.find((one) => one.key === 'm:0.2').rows, ['#2', '#6'], 'a shipped release opens to its items');+ assert.deepEqual(r.parts.find((part) => part.key === 'shipped').shipped.find((one) => one.key === 'm:0.2').rows, ['#2'], 'a shipped release opens to its verified items');await click('#roadmap .shipped-one[data-key="m:0.2"] .milestone-item[data-go="item:2"]');await chrome.waitFor("view.tab === 'items' && document.querySelector('#detail h2')?.textContent.includes('Second page')");