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): send-backs show one sentence and plain agent names [N26]
Corey Olson3af603e07f12
diff --git a/src/cockpit.js b/src/cockpit.jsindex 41a29fb8..9ef0df89 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -2240,7 +2240,7 @@ function milestoneItem(entry, p) {state: read ? stateOf(read) : null,stale: item ? staleChip(item) : '',block: item ? roadmapBlock(detail?.item || item, {- holds: root === view.root ? source.holds : source.laneHolds, items: source.items, name: (id) => agentName(id, source), time: when, state: stateOf,+ holds: root === view.root ? source.holds : source.laneHolds, items: source.items, agents: source.agents, state: stateOf,address: (id) => itemAddress(id, root), board: root === view.root ? null : root,releases: (p.milestones || []).filter((milestone) => milestone.items.some((ref) => ref.id === entry.id)).map((milestone) => milestone.name),loading: detail?.loading, error: detail?.error,diff --git a/src/view/roadmap-block.js b/src/view/roadmap-block.jsindex e2d73ff6..3be7c237 100644--- a/src/view/roadmap-block.js+++ b/src/view/roadmap-block.js@@ -2,7 +2,11 @@export function roadmapBlock(item, context = {}) {if (!item) return null;const escape = text => String(text ?? '').replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''})[c]);- const items = context.items || [], name = context.name || (id => id), time = context.time || (at => at);+ const items = context.items || [], boardAgents = context.agents || [];+ // An agent's name: its display name with the model, or its name alone when the model is unknown (the display name would carry an "unknown" placeholder).+ const name = context.name || (id => { const agent = boardAgents.find(entry => entry.agent_id === id), model = agent?.model || agent?.agent_model; return !model || model === 'unknown' ? id : agent.displayName || id + ' (' + model + ')'; });+ // A time as the viewer's locale writes it with hours and minutes (7:09 PM in English), with the date first when it is not today.+ const time = context.time || (iso => { const moment = new Date(iso), clock = moment.toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' }); return moment.toDateString() === new Date().toDateString() ? clock : moment.toLocaleDateString([], { month: 'short', day: 'numeric' }) + ' ' + clock; });const waits = (item.blockedBy || []).map(id => items.find(other => other.id === id) || {id,status:'unavailable'});const hold = (context.holds || []).find(h => h.hold_lane === item.lane);const blocked = item.status === 'open' && Boolean(waits.length || hold);@@ -22,6 +26,15 @@ export function roadmapBlock(item, context = {}) {const ref = other => {const [word,color] = words[state(other)] || [other.status,''];return '<span class="chip roadmap-ref '+color+'">#'+escape(other.id)+' '+escape(word || (other.merged || other.stage === 'merged' ? 'landed' : 'verified'))+'</span>';};const field = (key,value,extra='') => value ? '<dt>'+icon(key)+escape(key)+'</dt><dd'+(extra?' class="'+extra+'"':'')+'>'+value+'</dd>' : '';const first = text => String(text || '').split('\n').find(line => line.trim())?.trim() || '';+ /**+ * The first sentence of a send-back note, cut at 160 characters. An ellipsis marks any text left out,+ * so a reader knows the full note is one click away in Items (the row never shows it all).+ */+ const shortNote = text => {+ const line = first(text), sentence = line.match(/^.*?[.!?](?=\s|$)/u)?.[0] || line;+ const short = sentence.length > 160 ? sentence.slice(0, 160).trimEnd() : sentence;+ return short.length < text.length ? short + '…' : short;+ };const criterion = first(item.criterion).match(/^.*?[.!?](?:\s|$)|^.*$/u)?.[0]?.trim() || '';const agents = [];const builder = item.status === 'claimed' ? item.claim?.by || item.owner : item.builtBy;@@ -38,7 +51,7 @@ export function roadmapBlock(item, context = {}) {const reasons = {TEST_FAILURE:'A test failed',BEHAVIOR_MISMATCH:'Behavior differs from the criterion',INSUFFICIENT_EVIDENCE:'More evidence is needed',STALE_HEAD:'The submitted commit is out of date',OTHER:'Sent back'};let returned = '';if (reject) {- const note = first(reject.note).replace(new RegExp('^'+String(reject.reason || '')+'(?::|\\s*[-–—])?\\s*','u'),'');+ const note = shortNote(String(reject.note ?? '').trim().replace(new RegExp('^'+String(reject.reason || '')+'(?::|\\s*[-–—])?\\s*','u'),''));returned = (reject.at?escape(time(reject.at))+' ':'')+(reject.by?'by <b>'+escape(name(reject.by))+'</b>: ':'')+escape(note || reasons[reject.reason] || 'Sent back');}let claims = 0;diff --git a/test/cockpit/roadmap.test.js b/test/cockpit/roadmap.test.jsindex ff613e2e..8450dc49 100644--- a/test/cockpit/roadmap.test.js+++ b/test/cockpit/roadmap.test.js@@ -1115,6 +1115,51 @@ test('a blocked roadmap item shows its dot and expands to say why [N26]', { time} finally { if(chrome) await closeSnapshotChrome(chrome); rmSync(profile,{recursive:true,force:true}); await view.stop(); }});+test('the expanded row keeps send-backs short and names agents plainly [N26]', { timeout: 90_000 }, async () => {+ const executable = chromeExecutable();+ assert.ok(executable, 'Chrome is required for the roadmap send-back check.');+ const box = machine(), alpha = project(box, 'short-roadmap');+ const long = 'Evidence '.repeat(25).trim();+ box.run(alpha.repo, 'add', 'web', 'Several sentences', '--specs', 'G1', '--criterion', 'Ready.');+ build(box, alpha, 1, 'several.html');+ sendBack(box, alpha, 1, 'The heading is missing. The footer link is also broken.\nMore evidence stays in Items.');+ box.run(alpha.repo, 'add', 'web', 'One long sentence', '--specs', 'G1', '--criterion', 'Ready.');+ build(box, alpha, 2, 'long.html'); sendBack(box, alpha, 2, long);+ box.run(alpha.repo, 'milestone', 'add', 'Next', '--items', '1,2');+ const view = await startView(box), profile = mkdtempSync(join(tmpdir(), 'pullboard-short-roadmap-chrome-'));+ let chrome;+ const row = id => `[...document.querySelectorAll('#roadmap .milestone-item')].find(x=>x.querySelector('.id')?.textContent===${JSON.stringify(id)})`;+ /** Expand a row, if it is not open yet, and read its detail once it has loaded. */+ async function opened(id) {+ if (await chrome.stable(`${row(id)}?.getAttribute('aria-expanded')`) !== 'true') await press(chrome, row(id));+ await chrome.waitFor(`${row(id)}?.getAttribute('aria-expanded')==='true' && !${row(id)}.parentElement.querySelector('.roadmap-loading')`);+ return await chrome.stable(`${row(id)}.parentElement.querySelector('.milestone-why').textContent`);+ }+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.send('Emulation.setLocaleOverride', { locale: 'en-US' });+ await chrome.send('Page.reload');+ await chrome.waitFor('data?.project?.milestones?.length===1');+ await press(chrome, "document.querySelector('[data-tab=roadmap]')");+ await chrome.waitFor(`Boolean(${row('#2')})`);+ const several = await opened('#1');+ const returned = await chrome.stable(`${row('#1')}.parentElement.querySelector('.roadmap-return').textContent`);+ assert.match(returned, /^\d{1,2}:\d{2}\s[AP]M by coordinator: The heading is missing\.…$/u, 'a multi-sentence send-back shows only its first sentence, then an ellipsis');+ assert.doesNotMatch(several, /footer link|More evidence/u, 'the rest of the note stays out of the row; Open in Items shows it');+ await opened('#2');+ const capped = await chrome.stable(`${row('#2')}.parentElement.querySelector('.roadmap-return').textContent`);+ assert.equal(capped.replace(/^.*?by coordinator: /u, ''), long.slice(0, 160).trimEnd() + '…', 'a sentence longer than 160 characters is cut there, with an ellipsis');+ const panel = await opened('#1');+ assert.match(panel, /Agents.*web-1 \(Test Model\) built/u, 'an agent with a known model keeps the model after its name');+ assert.doesNotMatch(panel, /\(unknown\)/u, 'the coordinator, whose model is unknown, is named alone with no placeholder');+ const times = JSON.parse(await chrome.stable(`JSON.stringify([...${row('#1')}.parentElement.querySelectorAll('.roadmap-history time')].map(t=>[t.getAttribute('datetime'),t.textContent]))`));+ assert.ok(times.length >= 3, 'the history lists its moves with times');+ for (const [, text] of times) assert.match(text, /^\d{1,2}:\d{2}\s[AP]M$/u, 'history times use the viewer locale, such as 7:09 PM');+ assert.equal(await chrome.stable(`[...${row('#1')}.parentElement.querySelectorAll('.roadmap-history time')].every(t=>t.textContent===new Date(t.getAttribute('datetime')).toLocaleTimeString([],{hour:'numeric',minute:'2-digit'}))`), true, 'history times match the locale formatter');+ assert.deepEqual(chrome.exceptions, []);+ } finally { if(chrome) await closeSnapshotChrome(chrome); rmSync(profile,{recursive:true,force:true}); await view.stop(); }+});+test('a release jump on a phone leaves its heading below the top bar [N26]', { timeout: 90_000 }, async (t) => {const executable = chromeExecutable();assert.ok(executable, 'Chrome is required for phone release-jump checks.');