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
Merge remote-tracking branch 'origin/main' into view/58
Corey Olsonc9401b0cc200
diff --cc src/cockpit.jsindex d1480e86,1e71c7de..565512d6--- a/src/cockpit.js+++ b/src/cockpit.js@@@ -190,16 -190,12 +190,21 @@@ function theme(pick)$('theme').title = 'Theme: ' + (document.documentElement.dataset.theme || 'system');}theme(keep('pb.theme'));+/** Collapse the sidebar into the tab bar on a wide screen, or bring it back, as the person last chose. */+function collapseSide(collapsed) {+ if (collapsed) document.documentElement.dataset.side = 'collapsed';+ else delete document.documentElement.dataset.side;+ $('side-toggle').setAttribute('aria-pressed', String(collapsed));+ $('side-toggle').title = collapsed ? 'Show the project list' : 'Collapse the project list';+ $('side-toggle').setAttribute('aria-label', $('side-toggle').title);+}+collapseSide(keep('pb.side') === 'collapsed');const esc = (text) => String(text ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);+ // Inline code: a short chip stays whole on its line; one wider than a phone line's worth may wrap. Width+ // is in columns, as a terminal counts them: CJK, full-width and emoji characters take two.+ const wideChar = (c) => { const p = c.codePointAt(0); return (p >= 0x1100 && p <= 0x115f) || (p >= 0x2e80 && p <= 0xa4cf) || (p >= 0xac00 && p <= 0xd7a3) || (p >= 0xf900 && p <= 0xfaff) || (p >= 0xfe30 && p <= 0xfe4f) || (p >= 0xff00 && p <= 0xff60) || (p >= 0xffe0 && p <= 0xffe6) || (p >= 0x1f300 && p <= 0x1faff) || (p >= 0x20000 && p <= 0x3fffd); };+ const columns = (text) => [...String(text)].reduce((n, c) => n + (wideChar(c) ? 2 : 1), 0);+ const codeChip = (text) => '<code class="inline' + (columns(text) > 24 ? ' long' : '') + '">' + esc(text) + '</code>';const ago = (iso) => { const m = Math.round((Date.now() - Date.parse(iso)) / 60000); return m < 1 ? 'now' : m < 60 ? m + 'm' : m < 2880 ? Math.round(m / 60) + 'h' : Math.round(m / 1440) + 'd'; };// An age as the page shows it: the moment it counts from stays on it, so tickAges can move it on.const age = (iso) => '<time data-ago="' + esc(iso) + '">' + ago(iso) + '</time>';diff --cc test/cockpit.test.jsindex 72e4c648,8c51ccfd..473d4e23--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@@ -608,80 -608,78 +608,152 @@@ test('projects group repos with combine}});+test('the project list collapses into the tab bar and stays collapsed [N26]', { timeout: 90_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for sidebar checks.');++ const box = machine();+ const demo = project(box, 'collapse-demo');+ const other = project(box, 'collapse-other');+ box.run(demo.repo, 'add', 'web', 'An item to show', '--specs', 'G1', '--criterion', 'shown');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-collapse-chrome-'));+ let chrome;+ /** Read the sidebar, the tab bar and the board's columns as the person sees them. */+ const read = async () => JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const box = (s) => { const e = document.querySelector(s); const r = e.getBoundingClientRect(); return { left: r.left, top: r.top, right: r.right, bottom: r.bottom, width: r.width, height: r.height, shown: getComputedStyle(e).display !== 'none' && r.width > 0 }; };+ const logo = document.querySelector('#side-toggle');+ return { width: innerWidth, logo: box('#side-toggle'), side: box('.side'), top: box('.top'), main: box('main'), switcher: box('#proj-switch'), list: box('#side-body'), theme: box('#theme'), live: box('#live'),+ columns: box('.two > :first-child').width + box('#detail').width, collapsed: document.documentElement.dataset.side || '', pressed: logo.getAttribute('aria-pressed'), title: logo.title,+ listPosition: getComputedStyle(document.querySelector('#side-body')).position, overflow: document.documentElement.scrollWidth > document.documentElement.clientWidth };+ })())`));+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.send('Emulation.setDeviceMetricsOverride', { width: 1280, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor('innerWidth === 1280 && !!document.querySelector("#chain .row") && !!document.querySelector("#detail h2")');+ const open = await read();+ assert.ok(open.side.width >= 200 && open.side.height >= 800 && !open.collapsed && open.pressed === 'false', `the sidebar starts open: ${JSON.stringify(open)}`);+ assert.ok(open.theme.right >= open.width - 16 && open.theme.top < open.top.bottom && open.live.right <= open.theme.left, `the light/dark button sits at the right end of the tab bar, clear of the live status: ${JSON.stringify(open)}`);++ await chrome.evaluate('document.querySelector("#side-toggle").click()');+ await chrome.waitFor('document.documentElement.dataset.side === "collapsed"');+ const collapsed = await read();+ assert.deepEqual([collapsed.pressed, collapsed.title], ['true', 'Show the project list'], 'the logo says it brings the list back');+ assert.ok(collapsed.side.height <= collapsed.top.height + 0.5 && collapsed.switcher.shown && Math.abs(collapsed.switcher.top - collapsed.top.top) < collapsed.top.height && collapsed.switcher.right <= collapsed.top.left + 0.5,+ `the sidebar is one switcher at the left of the tab bar, in its row: ${JSON.stringify(collapsed)}`);+ assert.ok(!collapsed.list.shown, 'the project list folds away until asked for');+ assert.ok(Math.abs(collapsed.logo.width - collapsed.logo.height) < 1 && collapsed.logo.height >= 44, `the logo alone is a square control, so its hover is a square: ${JSON.stringify(collapsed.logo)}`);+ assert.ok(collapsed.main.left <= 0.5 && collapsed.main.width >= collapsed.width - 0.5 && collapsed.columns >= open.columns + 200 && !collapsed.overflow,+ `the board takes the whole width: the list and detail gain at least 200px: ${JSON.stringify({ open: open.columns, collapsed: collapsed.columns, main: collapsed.main })}`);+ assert.ok(collapsed.theme.right >= collapsed.width - 16 && collapsed.live.right <= collapsed.theme.left, 'the light/dark button stays at the right end');++ await chrome.evaluate('document.querySelector("#proj-switch").click()');+ const dropdown = await read();+ assert.ok(dropdown.list.shown && dropdown.listPosition === 'absolute' && dropdown.list.top >= dropdown.top.bottom - 0.5 && dropdown.list.right <= dropdown.width, `the switcher opens the project list as a dropdown: ${JSON.stringify(dropdown.list)}`);+ await chrome.evaluate('document.querySelector("main").click()');+ assert.equal((await read()).list.shown, false, 'a click outside closes it');+ await chrome.evaluate('document.querySelector("#proj-switch").click()');+ await chrome.evaluate(`document.querySelector('#proj-list [data-root="${other.repo}"]').click()`);+ await chrome.waitFor(`document.querySelector('#proj-name').textContent === 'collapse-other'`);+ assert.equal((await read()).list.shown, false, 'a pick closes it and shows that project');++ await chrome.send('Page.reload');+ await chrome.waitFor('document.readyState === "complete" && !!document.querySelector("#proj-switch")');+ assert.equal((await read()).collapsed, 'collapsed', 'the choice is kept in this browser across a reload');++ await chrome.evaluate('document.querySelector("#side-toggle").click()');+ await chrome.waitFor('!document.documentElement.dataset.side');+ const back = await read();+ assert.ok(back.side.width >= 200 && back.list.shown && back.pressed === 'false' && back.title === 'Collapse the project list', `the logo brings the sidebar back as it was: ${JSON.stringify(back)}`);++ await chrome.evaluate('document.querySelector("#side-toggle").click()');+ await chrome.send('Emulation.setDeviceMetricsOverride', { width: 375, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor('innerWidth === 375');+ const phone = await read();+ await chrome.evaluate('document.querySelector("#side-toggle").click()');+ const tapped = await read();+ assert.ok(phone.switcher.shown && !phone.list.shown && phone.theme.right >= phone.width - 16 && phone.theme.top < phone.side.bottom, `a phone keeps its switcher, the light/dark button at the right of its top row: ${JSON.stringify(phone)}`);+ assert.equal(tapped.collapsed, phone.collapsed, 'on a phone the logo is only the logo');+ assert.ok(!phone.overflow, 'and nothing runs off the phone');+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});++ test('a project with one repo shows once in the project list [N33, N26]', async () => {+ const box = machine();+ const solo = project(box, 'solo', SPEC, { name: 'Solo board', project: 'Solo' });+ box.run(solo.repo, 'shout', 'person', 'Ship it today?', '--decision');+ // The relay lists every board this way: its project is its own repository's name.+ const mirrored = project(box, 'mirrored', SPEC, { name: 'acme/site', project: 'acme/site' });+ project(box, 'core', SPEC, { name: 'Core API', project: 'Atlas' });+ project(box, 'web', SPEC, { name: 'Web UI', project: 'Atlas' });+ const view = await startView(box);+ try {+ const page = await openPage(view);+ const side = page.show('proj-list');+ const once = (name) => side.split('<span class="pname">' + name + '</span>').length - 1;+ assert.doesNotMatch(side, /data-root="group:Solo"|data-root="group:acme\/site"/, 'a project with one repo has no group heading');+ assert.deepEqual([once('Solo board'), once('acme/site'), once('Solo')], [1, 1, 0], 'each one-repo project shows as its repo, once');+ assert.ok(side.includes(`data-root="${solo.repo}"`) && side.includes(`data-root="${mirrored.repo}"`), 'as a repo button of its own');+ assert.equal((side.match(/title="needs you">1<\/b>/g) || []).length, 1, "the lone repo's decision is counted once, not again on a heading");+ assert.match(side, /data-root="group:Atlas"/, 'two repos sharing a project still group');+ assert.deepEqual([once('Core API'), once('Web UI'), once('Atlas')], [1, 1, 1], 'under one heading');+ await page.click({ root: solo.repo });+ assert.deepEqual([page.element('group-view').hidden, page.element('tabs').hidden], [true, false], 'the lone repo opens on its own board');+ } finally {+ await view.stop();+ }+ });++ test('the view never scrolls sideways at 320px [N26]', { timeout: 120_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for the 320px check.');++ const box = machine();+ const demo = project(box, 'narrow');+ box.run(demo.repo, 'add', 'web', 'A title long enough to need every bit of a narrow phone row, and then some more words', '--specs', 'G1', '--criterion', 'fits');+ box.run(demo.repo, 'add', 'web', 'Built, then sent back', '--specs', 'G1', '--criterion', 'back');+ build(box, demo, 2, 'two.txt');+ sendBack(box, demo, 2, 'It misses the edge the criterion names, a reason long enough to wrap on a phone.');+ const sha = box.git(demo.repo, 'rev-parse', 'HEAD').trim();+ box.run(demo.repo, 'shout', 'web', `Run \`pullboard next --verify\` and read SPEC.md:1-2@${sha} before you take #1.`);+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-sideways-chrome-'));+ let chrome;+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor('document.querySelectorAll("#chain .row").length === 2');+ // This machine's fonts first, then a wide one (Verdana here, DejaVu Sans on Linux) at 320 and at 305,+ // the room a 320px screen leaves beside a classic 15px scrollbar: Linux CI measured 324px of tabs there.+ for (const [width, font] of [[320, ''], [320, 'Verdana, "DejaVu Sans", sans-serif'], [305, 'Verdana, "DejaVu Sans", sans-serif']]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 800, deviceScaleFactor: 1, mobile: false });+ await chrome.evaluate(`document.documentElement.style.setProperty('--sans', ${JSON.stringify(font || 'system-ui, sans-serif')})`);+ await chrome.waitFor(`innerWidth === ${width}`);+ for (const tab of ['items', 'shouts', 'spec', 'doctrine', 'activity', 'roadmap']) {+ await chrome.evaluate(`document.querySelector('[data-tab="${tab}"]').click()`);+ await chrome.waitFor(`!document.querySelector('[data-pane="${tab}"]').hidden`);+ const seen = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const edge = document.documentElement.clientWidth;+ // Name each element that runs past the edge with nothing above it to clip or scroll it.+ const clipped = (e) => { for (let p = e.parentElement; p && p !== document.body; p = p.parentElement) if (!['visible', ''].includes(getComputedStyle(p).overflowX)) return true; return false; };+ const name = (e) => e.tagName.toLowerCase() + (e.id ? '#' + e.id : '') + (typeof e.className === 'string' && e.className ? '.' + e.className.trim().split(/\\s+/).join('.') : '');+ const past = [...document.querySelectorAll('body *')].filter((e) => { const r = e.getBoundingClientRect(); return r.width > 0 && r.right > edge + 0.5 && !clipped(e); })+ .map((e) => name(e) + ' right ' + Math.round(e.getBoundingClientRect().right) + ': ' + (e.textContent || '').trim().slice(0, 40));+ return { scrollWidth: document.documentElement.scrollWidth, clientWidth: edge, past: past.slice(0, 8), more: Math.max(0, past.length - 8) };+ })())`));+ assert.ok(seen.scrollWidth <= seen.clientWidth, `${width}${font ? ' in a wide font' : ''}, ${tab}: the page scrolls sideways, ${seen.scrollWidth} wide in ${seen.clientWidth}; past the edge: ${seen.past.join(' | ')}${seen.more ? ` (+${seen.more} more)` : ''}`);+ }+ }+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+ });+test('the tabs fit one row on a phone [N26]', async () => {const view = await startView(machine());try {