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
fix(view): finished releases sit under Shipped; roadmap copy [N26]
Corey Olson44130c321a69
diff --git a/src/cockpit.js b/src/cockpit.jsindex 50fceff4..3d80e234 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -2317,7 +2317,12 @@ function readMilestone(milestone, p) {const numeric = value => Number.isInteger(value) && value >= 0 ? value : null;const done = numeric(milestone.summary?.landed) ?? numeric(milestone.landed) ?? verified.length;const total = numeric(milestone.summary?.total) ?? numeric(milestone.total) ?? rows.length;- const shipped = milestone.shipped !== undefined ? Boolean(milestone.shipped) : rows.length > 0 && verified.length === rows.length;+ // A milestone with nothing left, every item landed or withdrawn, is finished and sits under Shipped whether or not it+ // was recorded with milestone ship (the person, 18 Oct). The summary's left owns that when present; an empty plan is+ // never finished.+ const left = numeric(milestone.summary?.left);+ const finished = milestone.items.length > 0 && (left !== null ? left === 0 : rows.every((row) => row.stage === 'merged'));+ const shipped = finished || (milestone.shipped !== undefined ? Boolean(milestone.shipped) : rows.length > 0 && verified.length === rows.length);return { milestone, rows, done, total, shipped };}diff --git a/src/view.css b/src/view.cssindex c038a618..f7ad4ff5 100644--- a/src/view.css+++ b/src/view.css@@ -926,7 +926,7 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }.roadmap-has-summary > .milestone-head { align-items: flex-start; }.roadmap-has-summary > .milestone-head h2 { flex: 1; min-width: 0; font-size: 18px; line-height: 1.35; }.roadmap-left { flex: none; display: grid; gap: 4px; margin-left: auto; text-align: right; white-space: nowrap; }-.roadmap-left > b { font-size: 22px; font-weight: 600; line-height: 1.1; }+.roadmap-left > b { font-size: 19px; font-weight: 600; line-height: 1.1; }.roadmap-left > span { color: var(--ink-muted); font: 12px var(--mono); }.roadmap-summary { margin: 0 14px 14px; min-width: 0; }.roadmap-summary-bar { display: block; height: 10px; margin: 10px 0; border-radius: 5px; }diff --git a/src/view/roadmap-summary.js b/src/view/roadmap-summary.jsindex d74db7fb..b179128e 100644--- a/src/view/roadmap-summary.js+++ b/src/view/roadmap-summary.js@@ -3,11 +3,14 @@ export function roadmapSummary(milestone, context = {}) {/** Escape supplied milestone text before placing it in HTML or attributes. */const escape = text => String(text ?? '').replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''})[c]);const summary = milestone.summary;- const states = [['landed','landed'],['landing','accepted, landing'],['review','in review'],['building','building'],['waiting','waiting for an agent'],['held','held']];+ const states = [['landed','landed'],['landing','accepted, landing'],['review','in review'],['building','building'],['waiting','waiting'],['held','held']];/** Accept only nonnegative integer counts from the backend contract. */const number = value => Number.isInteger(value) && value >= 0;if (!summary || !number(summary.total) || !number(summary.left) || states.some(([key]) => !number(summary[key]))) return null;- const count = '<span class="roadmap-left"><b>'+escape(summary.left)+' left</b><span aria-label="'+escape(summary.landed)+'/'+escape(summary.total)+' landed">'+escape(summary.landed)+' of '+escape(summary.total)+' landed</span></span>';+ // A finished milestone, items and none left, has no header: it never reads "0 remaining" or "About 0 to 0 h".+ // An empty plan keeps its own reading.+ if (summary.left === 0 && summary.total > 0) return null;+ const count = '<span class="roadmap-left"><b>'+escape(summary.left)+' remaining</b><span aria-label="'+escape(summary.landed)+'/'+escape(summary.total)+' landed">'+escape(summary.landed)+' of '+escape(summary.total)+' landed</span></span>';const description = states.map(([key,label]) => summary[key]+' '+label).join(', ');let offset = 0;const segments = states.map(([key]) => { const x = offset; offset += summary[key]; return '<rect class="roadmap-summary-segment ' + key + '" data-summary-segment="' + key + '" data-count="' + summary[key] + '" x="' + x + '" width="' + summary[key] + '" height="1"/>'; }).join('');@@ -17,7 +20,7 @@ export function roadmapSummary(milestone, context = {}) {const target = milestone.target ? '<span class="roadmap-target">Target <time datetime="'+escape(milestone.target)+'">'+escape(context.time ? context.time(milestone.target) : milestone.target)+'</time>'+(milestone.pastTarget?' <span class="chip warn">past target</span>':'')+'</span>' : '';const estimate = summary.estimate, pace = summary.pace;const measured = estimate && Number.isFinite(estimate.low) && Number.isFinite(estimate.high) && pace && number(pace.last6h) && number(pace.last2h);- const forecast = measured ? '<span class="roadmap-estimate">About '+escape(estimate.low)+' to '+escape(estimate.high)+' h at today’s pace</span><span class="roadmap-pace">'+escape(pace.last6h)+' landed in the last 6 h, '+escape(pace.last2h)+' in the last 2 h</span>' : '';+ const forecast = measured ? '<span class="roadmap-estimate">About '+escape(estimate.low)+(estimate.low === estimate.high ? '' : ' to '+escape(estimate.high))+' h at today’s pace</span><span class="roadmap-pace">'+escape(pace.last6h)+' landed in the last 6 h, '+escape(pace.last2h)+' in the last 2 h</span>' : '';const meta = target || forecast ? '<div class="roadmap-summary-meta">'+target+forecast+'</div>' : '';const needs = Array.isArray(summary.needsYou) ? summary.needsYou.map(id => {const item = context.lookup ? context.lookup(id) : null;diff --git a/test/cockpit/roadmap.test.js b/test/cockpit/roadmap.test.jsindex 85ddd662..5b6ba0c4 100644--- a/test/cockpit/roadmap.test.js+++ b/test/cockpit/roadmap.test.js@@ -897,7 +897,7 @@ test('the roadmap panel counts the next release by stage [N26]', {test('the roadmap shows landed, accepted and past target [N26]', { timeout: 90_000 }, async () => {const executable = chromeExecutable(); assert.ok(executable, 'Chrome is required for the roadmap header check.');const box=machine(), alpha=project(box,'roadmap-truth',SPEC,{lanes:{web:{owns:['web/'],specs:['G']},ops:{owns:['ops/'],specs:['G']}}});- const names=['Landed A','Accepted A','Waiting A','Shipped B','Landed C','Accepted C','In review C','Building C','Approve the release','Held C','Withdrawn C'];+ const names=['Landed A','Accepted A','Waiting A','Shipped B','Landed C','Accepted C','In review C','Building C','Approve the release','Held C','Withdrawn C','Landed D','Withdrawn D'];names.forEach((name,index)=>box.run(alpha.repo,'add',index===9?'ops':'web',name,'--specs','G1','--criterion','The page renders.'));/** Land through real Git and the ordinary board receipt; acceptance alone stays unlanded. */function land(id) {@@ -906,6 +906,9 @@ test('the roadmap shows landed, accepted and past target [N26]', { timeout: 90_0}for(const id of [1,2,4,5,6]) {build(box,alpha,id,`item-${id}.txt`);accept(box,alpha,id);if([1,4,5].includes(id))land(id);}box.run(alpha.repo,'withdraw','11','Removed from this release');+ // A release that finished, every item landed or withdrawn, without milestone ship (the person, 18 Oct).+ build(box,alpha,12,'item-12.txt');accept(box,alpha,12);land(12);box.run(alpha.repo,'withdraw','13','Not needed after all');+ box.run(alpha.repo,'milestone','add','Finished unshipped','--items','12,13');build(box,alpha,7,'item-7.txt');box.run(alpha.web,'claim','8');box.run(alpha.repo,'hold','ops','--reason','Waiting for the person');box.run(alpha.repo,'shout','person','#9 Approve the release','--decision');box.run(alpha.repo,'milestone','add','Past target','--items','1,2,3');@@ -918,11 +921,11 @@ test('the roadmap shows landed, accepted and past target [N26]', { timeout: 90_0const shipped=box.git(alpha.repo,'rev-parse','HEAD');const rawRoadmap=JSON.parse(box.run(alpha.repo,'roadmap','--json'));assert.equal(rawRoadmap.milestones.find(m=>m.name==='State summary').total,7,'692 total retains the withdrawn member; the summary excludes it');- assert.deepEqual(rawRoadmap.milestones.find(m=>m.name==='State summary').summary,{total:6,left:5,landed:1,landing:1,review:1,building:1,waiting:1,held:1,needsYou:[9],pace:{last6h:3,last2h:3},estimate:{low:3.5,high:10}},'real roadmap JSON owns every header field');+ assert.deepEqual(rawRoadmap.milestones.find(m=>m.name==='State summary').summary,{total:6,left:5,landed:1,landing:1,review:1,building:1,waiting:1,held:1,needsYou:[9],pace:{last6h:4,last2h:4},estimate:{low:2.5,high:7.5}},'real roadmap JSON owns every header field');const view=await startView(box),profile=mkdtempSync(join(tmpdir(),'pullboard-roadmap-truth-'));let chrome;const milestone=name=>`document.querySelector('[data-key="m:${name}"]')`;try {- chrome=await openSnapshotChrome(executable,view.link.href,profile);await chrome.waitFor('data?.project?.milestones?.length===4');+ chrome=await openSnapshotChrome(executable,view.link.href,profile);await chrome.waitFor('data?.project?.milestones?.length===5');const apiSummary=JSON.parse(await chrome.stable("JSON.stringify(data.project.milestones.find(m=>m.name==='State summary').summary)"));assert.deepEqual(apiSummary,rawRoadmap.milestones.find(m=>m.name==='State summary').summary,'the live API carries the real CLI summary unchanged');await press(chrome,"document.querySelector('[data-tab=roadmap]')");@@ -936,18 +939,30 @@ test('the roadmap shows landed, accepted and past target [N26]', { timeout: 90_0assert.match(await chrome.stable(`${milestone('Shipped release')}.textContent`),new RegExp(shipped.slice(0,12)),'the shipped release names its actual commit');assert.equal(await chrome.stable(`${milestone('Empty shipped')}.closest('.shipped')!==null`),true,'an empty shipped milestone appears only under Shipped');assert.equal(await chrome.stable("document.querySelectorAll('[data-key=\"m:Empty shipped\"]').length"),1,'an empty shipment is not repeated among upcoming releases');+ // Finished without milestone ship: under Shipped, no summary header, never among upcoming releases; the page opens on the+ // first release with work left (Past target), and the Releases list starts with it.+ const finished=JSON.parse(await chrome.stable(`JSON.stringify({shipped:${milestone('Finished unshipped')}?.closest('.shipped')!==null,copies:document.querySelectorAll('[data-key="m:Finished unshipped"]').length,summary:Boolean(${milestone('Finished unshipped')}?.querySelector('.roadmap-summary,.roadmap-left')),zero:/0 (left|remaining)|About 0/u.test(${milestone('Finished unshipped')}?.textContent||''),releases:[...document.querySelectorAll('#roadmap-releases [data-roadmap-jump]')].map(b=>b.querySelector('span').textContent),status:document.querySelector('[data-status=release]')?.textContent.trim()||''})`));+ assert.deepEqual([finished.shipped,finished.copies,finished.summary,finished.zero],[true,1,false,false],`a finished release sits once under Shipped with no summary: ${JSON.stringify(finished)}`);+ assert.equal(finished.releases[0],'Past target','the Releases list starts with the first release with work left');+ assert.ok(!finished.releases.includes('Finished unshipped'),'a finished release is not listed as coming');+ assert.match(finished.status,/^Past target/u,'the page opens on the first release with work left');for(const width of [375,1280]) {await chrome.send('Emulation.setDeviceMetricsOverride',{width,height:950,deviceScaleFactor:1,mobile:false});for(const scheme of ['light','dark']) {await chrome.send('Emulation.setEmulatedMedia',{features:[{name:'prefers-color-scheme',value:scheme}]});const read=JSON.parse(await chrome.stable(`JSON.stringify((()=>{const m=${milestone('State summary')},bar=m.querySelector('.roadmap-summary-bar');return {text:m.textContent,releaseCount:document.querySelector('[data-roadmap-jump=\"m:State summary\"] b').textContent,legend:[...m.querySelectorAll('[data-summary-state]')].map(x=>[x.dataset.summaryState,x.querySelector('b').textContent]),segments:[...m.querySelectorAll('[data-summary-segment]')].map(x=>[x.dataset.summarySegment,Number(x.dataset.count),x.getBoundingClientRect().width]),bar:bar?.getBoundingClientRect().width,width:document.documentElement.scrollWidth,viewport:innerWidth};})())`));- assert.match(read.text,/5 left.*1 of 6 landed/u);assert.equal(read.releaseCount,'1/6','the header and Releases list share the summary total');assert.match(read.text,/About 3\.5 to 10 h/u);assert.match(read.text,/3 landed in the last 6 h, 3 in the last 2 h/u);assert.match(read.text,/Needs you:.*#9 Approve the release/u);+ assert.match(read.text,/5 remaining.*1 of 6 landed/u);assert.doesNotMatch(read.text,/ left/u,'the count reads remaining, never left');assert.equal(read.releaseCount,'1/6','the header and Releases list share the summary total');assert.match(read.text,/About 2\.5 to 7\.5 h/u);assert.match(read.text,/4 landed in the last 6 h, 4 in the last 2 h/u);assert.match(read.text,/Needs you:.*#9 Approve the release/u);assert.deepEqual(read.legend,[['landed','1'],['landing','1'],['review','1'],['building','1'],['waiting','1'],['held','1']]);assert.equal(read.segments.reduce((sum,row)=>sum+row[1],0),6,'the six supplied states sum to total');assert.ok(read.segments.every(row=>row[2]>0&&Math.abs(row[2]-read.bar/6)<1),`${width}/${scheme}: every supplied state occupies its share`);assert.ok(read.width<=read.viewport,`${width}/${scheme}: the header stays inside the viewport`);}}+ // Equal bounds read as one number, and the legend says waiting.+ await chrome.stable("(()=>{const m=data.project.milestones.find(m=>m.name==='State summary');m.summary={...m.summary,estimate:{low:2.5,high:2.5}};render();return true;})()");+ const single=await chrome.stable(`${milestone('State summary')}.querySelector('.roadmap-estimate')?.textContent||''`);+ assert.match(single,/^About 2\.5 h at today/u,`equal bounds read as one number: ${single}`);+ assert.equal(await chrome.stable(`${milestone('State summary')}.querySelector('[data-summary-state=waiting]').textContent.trim()`),'1 waiting','the legend says waiting');// The API owns counts: changing held item summaries cannot change the supplied milestone summary.await chrome.stable("window.__originalItems=data.project.items;window.__originalRoadmapItems=data.project.milestones.find(m=>m.name==='State summary').items;data.project.items=data.project.items.map(item=>({...item,status:'open',stage:'open',merged:null,claim:null}));data.project.milestones.find(m=>m.name==='State summary').items=window.__originalRoadmapItems.map(item=>({...item,status:'open',state:'open'}));render();true");assert.equal(await chrome.stable(`${milestone('State summary')}.querySelector('[data-summary-state=building] b').textContent`),'1');