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 commit 'a7601541c575966ebf989e4ee8286d93eee12d32' into HEAD
Corey Olson5b5be1e31a09
diff --cc src/serve.jsindex d1e2129e,f43c8de2..c1b52671--- a/src/serve.js+++ b/src/serve.js@@@ -4,8 -4,9 +4,9 @@@* refreshing itself. Reads and actions use the shared local API v1 handler (A3); actions run the* real CLI in the project, so every rule and refusal applies exactly as at a terminal.*- * It listens on the loopback address only and answers nothing without its own Host, and no board without the- * session's secret or its HttpOnly session cookie, so another site in the browser cannot reach it. Besides its own page, it answers one other origin,+ * By default it listens on loopback only; explicit LAN mode binds one assigned private IPv4 interface [H19].- * It answers nothing without its own Host, and no board without the- * session's secret, so another site in the browser cannot reach it. Besides its own page, it answers one other origin,++ * It answers nothing without its own Host, and no board without the session's secret or its HttpOnly session cookie,++ * so another site in the browser cannot reach it. Besides its own page, it answers one other origin,* the hosted page at https://app.pullboard.dev, which gets the secret by a round trip that only ever returns there.* Idle reads open no outbound connection (P5); an explicit person sign-in reuses the existing relay linking flow.*/@@@ -478,17 -445,12 +480,18 @@@ const credentialMatches = (given, expec/*** Serve the view until stopped, optionally giving its API access to only one registered project.*- * @param {{ port?: number, secret?: string, projectRoot?: string }} [options]+ * @param {{ port?: number, secret?: string, projectRoot?: string, lan?: boolean }} [options]* @returns {Promise<{ url: string, port: number, close: () => Promise<void> }>}*/- export async function serveView({ port = 0, secret = randomBytes(18).toString('base64url'), projectRoot } = {}) {+ export async function serveView({ port = 0, secret = randomBytes(18).toString('base64url'), projectRoot, lan = false } = {}) {+ const address = lan ? viewLanAddress() : LOOPBACK;const key = Buffer.from(secret);+ const cookieName = `pullboard_view_${randomBytes(9).toString('hex')}`;+ const session = randomBytes(18).toString('base64url');+ const sessionKey = Buffer.from(session);+ /** Only same-origin browser requests may authenticate by this session cookie. */+ const cookieMatches = (req) => credentialMatches(Buffer.from(requestCookie(req.headers.cookie, cookieName) ?? ''), sessionKey)+ && (req.headers['sec-fetch-site'] === undefined || req.headers['sec-fetch-site'] === 'same-origin');let bound = 0;// The API reads projectState and codeAt from this module. Load its factory after our exports// initialize, and use the real CLI entry point without adding a second move implementation.@@@ -498,8 -460,9 +501,9 @@@const signIns = new Set();const signInLifetime = new AbortController();const apiHandler = createLocalApiHandler({ secret, getPort: () => bound, runCommand: main, stateDetail: 'summary',- allowedOrigins: [HOSTED_ORIGIN], sessionCookie: { name: cookieName, value: session }, ...(projectRoot === undefined ? {} : { scope: { projectRoot } }) });+ allowedOrigins: lan ? [] : [HOSTED_ORIGIN], allowedHosts: lan ? [address] : [],- ...(projectRoot === undefined ? {} : { scope: { projectRoot } }) });- const reply = (res, code, type, body) => {++ sessionCookie: { name: cookieName, value: session }, ...(projectRoot === undefined ? {} : { scope: { projectRoot } }) });+ const reply = (res, code, type, body, headers = {}) => {res.writeHead(code, {'content-type': type,'cache-control': 'no-store',diff --cc test/cockpit/fixture.jsindex 2cd97482,af732c50..791e4244--- a/test/cockpit/fixture.js+++ b/test/cockpit/fixture.js@@@ -406,9 -399,9 +406,9 @@@ async function openPage(view, { widthclearTimeout,fetch: (path, init = {}) => {requests.push({ path, method: init?.method ?? 'GET', body: init?.body ? JSON.parse(init.body) : null });- const answer = held.then(() => fetchLive(`${view.base}${path}`, { ...init, signal: init.signal ?? AbortSignal.timeout(30_000) })).then(async (res) => {+ const answer = held.then(() => fetchLive(`${view.base}${path}`, { ...init, headers: { ...init.headers, ...session }, signal: init.signal ?? AbortSignal.timeout(30_000) })).then(async (res) => {const body = await res.json();- return { ok: res.ok, status: res.status, json: async () => body };+ return { ok: res.ok, status: res.status, headers: res.headers, json: async () => body };});inflight.add(answer);const done = () => inflight.delete(answer);