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): read the boards once each time the stream opens [N26,A2]
Corey Olsonf38748b92a52
diff --git a/src/cockpit.js b/src/cockpit.jsindex ec0e2562..c4c6aed6 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -1204,17 +1204,15 @@ async function listen(entry) {headers: { ...connection.headers, accept: 'text/event-stream', 'last-event-id': entry.cursor }, cache: 'no-store', signal: controller.signal,});if (!res.ok || !res.body) throw new Error('the board stream answered ' + res.status);- // A change with no event while the stream was down, such as a SPEC.md edit, is not replayed by Last-Event-ID, and- // the reopened stream's changed signal starts after it. So a stream that reopens reads its boards once.- const reopened = entry.status === 'down';entry.status = 'up';entry.offline = false;entry.failures = 0;$('live').textContent = liveLine();- if (reopened) {- for (const board of entry.boards) catchRoots.add(board.root);- catchUp();- }+ // A change with no event made before the stream opened, such as a SPEC.md edit after the snapshot was read or+ // while a dropped stream was down, is not replayed by Last-Event-ID, and the stream's changed signal starts after+ // it. So each time the stream opens, the page reads its boards once.+ for (const board of entry.boards) catchRoots.add(board.root);+ catchUp();const reader = res.body.pipeThrough(new TextDecoderStream()).getReader();let buffer = '';for (;;) {diff --git a/test/cockpit/live.test.js b/test/cockpit/live.test.jsindex 15484920..6e7a9e99 100644--- a/test/cockpit/live.test.js+++ b/test/cockpit/live.test.js@@ -63,6 +63,11 @@ async function cuttableProxy(view) {};}+/** Wait until the page's stream is open and the read it makes on opening has landed, so the page is quiet. */+async function liveReady(chrome) {+ await chrome.waitFor("typeof stream !== 'undefined' && stream?.status === 'up' && catching === null && catchRoots.size === 0 && !catchEvery");+}+/** A board with one open item, served by the real view and opened in real Chrome on the Items list. */async function liveBoard(name, { proxied = false } = {}) {const executable = chromeExecutable();@@ -77,6 +82,7 @@ async function liveBoard(name, { proxied = false } = {}) {proxy = proxied ? await cuttableProxy(view) : null;chrome = await openSnapshotChrome(executable, proxy?.href ?? view.link.href, profile);await chrome.waitFor('data?.project?.items?.some(item => item.id === 1) && !!document.querySelector(\'#chain [data-item="1"]\')');+ await liveReady(chrome);} catch (error) {if (chrome) await closeSnapshotChrome(chrome);await proxy?.close();@@ -260,6 +266,7 @@ async function groupClaim(t, name, count, mover) {await chrome.waitFor(`data?.projects?.length === ${count} && !!${group}`);await pickProject(chrome, group);await chrome.waitFor(`data?.group?.repos?.length === ${count} && document.querySelector('#live').textContent === ''`);+ await liveReady(chrome);const ids = (await Promise.all(repos.map((repo) => boardId(view, repo.repo)))).sort();assert.deepEqual(groupStreamReads(chrome).at(-1), ids, 'the group follows every repo it shows on one stream');const shown = `data?.group?.repos?.find(repo => repo.root === ${JSON.stringify(repos[mover].repo)})?.board.items.find(item => item.id === 1)?.status`;