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): only the hosted page builds the release note [N26,A2]
Corey Olsona6f24df45625
diff --git a/src/cockpit.js b/src/cockpit.jsindex e0da2e84..8c636d82 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -68,7 +68,8 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requconst requestMode = Boolean(readOnly && requests && !snapshot && transportModule);if (signIn !== null && (typeof signIn !== 'string' || !signIn.startsWith('/') || signIn.startsWith('//'))) throw new TypeError('signIn must be a path on the hosting site, or null');const hostedOptions = JSON.stringify({ local: Boolean(hostedLocal) && !snapshot, relaySession: Boolean(relaySession), signIn }).replace(/</g, '\\u003c');- const releaseInfo = hostedReleaseInfo(hostedReleaseVersion, hostedReleaseVersions, Boolean(hostedLocal) && !snapshot);+ const releaseHosted = Boolean(hostedLocal) && !snapshot;+ const releaseInfo = hostedReleaseInfo(hostedReleaseVersion, hostedReleaseVersions, releaseHosted);const css = stylesheet ?? (snapshot ? 'view.css' : transportModule ? '/view.css' : '/view.css?k=' + encodeURIComponent(key));const cssAttribute = css.replace(/[&<>"']/g, (character) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[character]);return `<!doctype html>@@ -310,9 +311,10 @@ let detailRead = null;const addressedShouts = new Map();const $ = (id) => document.getElementById(id);// The update note from src/view/hosted-release.js (#632): only a confirmed read of this machine's view says how far behind it is.-const renderHostedReleaseNote = (${hostedReleaseNote.toString()})(${releaseInfo}, { $, keep, distance: (${hostedReleaseDistance.toString()}),+// Only the hosted page builds it; every other page draws nothing and never touches the DOM for it.+const renderHostedReleaseNote = ${releaseHosted ? `(${hostedReleaseNote.toString()})(${releaseInfo}, { $, keep, distance: (${hostedReleaseDistance.toString()}),readable: () => hosted.local && localConfirmed && Boolean(localSession) && connection.base === localSession.origin && !transportModule && !transport,- project: (project = data?.project) => project?.releaseNotes ? project : data?.projects?.find((entry) => entry.ok && entry.releaseNotes) });+ project: (project = data?.project) => project?.releaseNotes ? project : data?.projects?.find((entry) => entry.ok && entry.releaseNotes) })` : '() => {}'};const hostedState = (${hostedState.toString()});const hostedBrowser = (${hostedBrowser.toString()});diff --git a/test/cockpit/local-origin.test.js b/test/cockpit/local-origin.test.jsindex cbcd5387..7ea865b7 100644--- a/test/cockpit/local-origin.test.js+++ b/test/cockpit/local-origin.test.js@@ -60,6 +60,16 @@ function onwardOf(page) {return new URL(JSON.parse(literal));}+/**+ * The relay's own asset at a path, as its production handler serves it, or null when it serves none there. Why: the+ * relay page loads its own scripts (such as /relay/screens.js), and answering those with the view's styles throws in Chrome.+ */+async function relayAsset(pathname) {+ let body = null;+ const handled = await createRelayBrowserHandler({ authenticate: async () => ({ kind: 'session' }) })({ method: 'GET', url: pathname, headers: {} }, { writeHead() {}, end(content) { body = content ?? ''; } });+ return handled ? body : null;+}+/*** Stand in for the hosted page at its real origin, and for this machine's default view address. Chrome answers every* request for https://app.pullboard.dev with the cockpit the relay would serve there and the view's styles. A request@@ -110,7 +120,8 @@ async function hostedStandIn(chrome, pages, styles, local) {}const document = resourceType === 'Document';const page = pages[address.search.slice(1)] ?? (address.search === '?relay' ? pages.relay : pages.anonymous);- const asset = pages.assets?.[address.pathname];+ // The transport stays each test's own: one that names none means the relay module never loads.+ const asset = pages.assets?.[address.pathname] ?? (document || address.pathname === '/relay/client.js' ? null : await relayAsset(address.pathname));await chrome.send('Fetch.fulfillRequest', {requestId, responseCode: 200,responseHeaders: [