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
feat(intake): trust pinned browser images and share reads [V3,C7]
Corey Olson34925674c1d0
diff --git a/docs/formats.md b/docs/formats.mdindex 081f57c3..5e4b76f9 100644--- a/docs/formats.md+++ b/docs/formats.md@@ -559,7 +559,9 @@ Sandbox verification reads operational provider settings from committed trustedmain, not from the PR's configuration. `sandbox.provider` is `docker`,`sandbox.executable` is an absolute Docker-compatible CLI path, `sandbox.endpoint`is an explicit Unix daemon socket, and `sandbox.images.minimum` and-`sandbox.images.current` are immutable `node@sha256:<digest>` references. Images+`sandbox.images.current` are immutable `<image>@sha256:<digest>` references selected by trusted main.+Prebuilt Node+Chrome images are supported for browser gates; outside heads cannot+choose runtime images, and actual container Node versions must still match both roles. Imagesmust already be present; verification uses `--pull never`. The actual containermust report Linux Node 22.13.x and Node 24.x respectively, the two roles in thecommitted CI matrix; this is not a claim about the latest global Node release.diff --git a/src/intake-github.js b/src/intake-github.jsindex 6f16b9c9..4e26d982 100644--- a/src/intake-github.js+++ b/src/intake-github.js@@ -1,6 +1,6 @@import { outsideSensitivity } from './outside-sensitive.js';/** Read GitHub public source metadata; never post, execute PR programs or use its executable settings. */-import { spawnSync } from 'node:child_process';+import { githubPullClient } from './pr-github.js';import { Refused } from './refused.js';import { git } from './git.js';@@ -11,27 +11,19 @@ export function outsideURL(value) {return { repository: match[1], kind: match[2] === 'pull' ? 'pull-request' : 'issue', number: Number(match[3]) };}-/** A bounded read-only GitHub API request; authenticated gh never receives a posting verb. */-function read(root, route) {- const result = spawnSync('gh', ['api', '--paginate', '--slurp', route], { cwd: root, encoding: 'utf8', timeout: 30_000, maxBuffer: 8 * 1024 * 1024 });- if (result.error || result.status !== 0) throw new Refused('OUTSIDE_FETCH', 'GitHub metadata could not be read; authenticate gh for this repository, then run intake again');- try { const value = JSON.parse(result.stdout); return Array.isArray(value) && value.every(Array.isArray) ? value.flat() : Array.isArray(value) && value.length === 1 && !Array.isArray(value[0]) ? value[0] : value; }- catch { throw new Refused('OUTSIDE_FETCH', 'GitHub returned unreadable metadata; restore gh API access before intake'); }-}-/** Fetch exact PR objects using Git only; preserve author and sign-off by never rewriting its commit. */export function githubSource(root, url) {const source = outsideURL(url);- const prefix = `repos/${source.repository}`;- const data = read(root, `${prefix}/${source.kind === 'pull-request' ? 'pulls' : 'issues'}/${source.number}`);- const comments = read(root, `${prefix}/issues/${source.number}/comments?per_page=100`);- const reviews = source.kind === 'pull-request' ? read(root, `${prefix}/pulls/${source.number}/reviews?per_page=100`) : [];+ const client = githubPullClient(root, source.repository);+ const data = source.kind === 'pull-request' ? client.read(source.number) : client.readIssue(source.number);+ const comments = client.comments(source.number);+ const reviews = source.kind === 'pull-request' ? client.reviews(source.number) : [];const replies = [...(Array.isArray(comments) ? comments : []), ...(Array.isArray(reviews) ? reviews : [])];const common = { ...source, url, title: String(data.title ?? ''), author: data.user?.login, state: data.state,maintainerReplied: replies.some(comment => ['OWNER', 'MEMBER', 'COLLABORATOR'].includes(comment.author_association)), updatedAt: data.updated_at };if (source.kind === 'issue') return common;if (!/^[a-f0-9]{40}$/u.test(data.head?.sha ?? '') || !/^[a-f0-9]{40}$/u.test(data.base?.sha ?? '')) throw new Refused('OUTSIDE_FETCH', 'GitHub did not return exact commit IDs; read the pull request again');- const files = read(root, `${prefix}/pulls/${source.number}/files?per_page=100`);+ const files = client.files(source.number);if (!Array.isArray(files) || files.length >= 100) throw new Refused('OUTSIDE_FETCH', 'this pull request needs a complete bounded changed-file list; split it below 100 files before intake');// The server-owned pull ref, rather than the contributor-controlled clone URL, supplies objects.git(root, ['fetch', '--no-tags', '--no-recurse-submodules', `https://github.com/${source.repository}.git`, `refs/pull/${source.number}/head`]);diff --git a/src/pr-github.js b/src/pr-github.jsindex d6d19a8a..ee8f9403 100644--- a/src/pr-github.js+++ b/src/pr-github.js@@ -41,6 +41,10 @@ export function githubPullClient(root, repository) {return {list: head => pages(`pulls?state=open&head=${encodeURIComponent(repository.split('/')[0] + ':' + head)}`),read: number => api('GET', `pulls/${number}`),+ readIssue: number => api('GET', `issues/${number}`),+ comments: number => pages(`issues/${number}/comments`),+ reviews: number => pages(`pulls/${number}/reviews`),+ files: number => pages(`pulls/${number}/files`),create: body => api('POST', 'pulls', body),update: (number, body) => api('PATCH', `pulls/${number}`, body),checks: head => pages(`commits/${head}/check-runs`, 'check_runs'),diff --git a/src/sandbox-verify.js b/src/sandbox-verify.jsindex 2b9e56fe..e14a2927 100644--- a/src/sandbox-verify.js+++ b/src/sandbox-verify.js@@ -63,14 +63,14 @@ function exportSource(root, commit, directory) {return { target, tree };}-/** A supported provider must be explicitly configured by accepted main, with two immutable official runtime images. */+/** A supported provider must be explicitly configured by accepted main, with two immutable trusted runtime images. */function provider(root) {const value = mainPolicy(root).config.sandbox;if (!value || value.provider !== 'docker' || typeof value.executable !== 'string' || !value.executable.startsWith('/') ||typeof value.endpoint !== 'string' || !/^unix:\/\/\/[^\r\n]+$/u.test(value.endpoint) ||value.exportRoot !== undefined && (typeof value.exportRoot !== 'string' || !isAbsolute(value.exportRoot) || /[\r\n\0]/u.test(value.exportRoot)) ||- !['minimum', 'current'].every(role => /^node@sha256:[a-f0-9]{64}$/u.test(value.images?.[role] ?? ''))) {- throw new Refused('SANDBOX_PROVIDER_REQUIRED', 'configure sandbox.provider=docker with an absolute executable, explicit Unix endpoint and pinned node@sha256 images for minimum/current in committed main pullboard.json; no host fallback is permitted');+ !['minimum', 'current'].every(role => /^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)*[a-z0-9]+(?:[._-][a-z0-9]+)*@sha256:[a-f0-9]{64}$/u.test(value.images?.[role] ?? ''))) {+ throw new Refused('SANDBOX_PROVIDER_REQUIRED', 'configure sandbox.provider=docker with an absolute executable, explicit Unix endpoint and digest-pinned runtime images for minimum/current in committed main pullboard.json; no host fallback is permitted');}return value;}diff --git a/test/intake-fixture.js b/test/intake-fixture.jsindex e5a9943b..8bfbb7c4 100644--- a/test/intake-fixture.js+++ b/test/intake-fixture.js@@ -83,7 +83,7 @@ const facts=JSON.parse(fs.readFileSync(${JSON.stringify(facts)},'utf8'));const route=(args.find(arg=>arg.startsWith('repos/')||arg.startsWith('/repos/'))||'').replace(/^\\//,'').split('?')[0];let value;if(args[0]==='repo'&&args[1]==='view') value={nameWithOwner:'fixture/project',defaultBranchRef:{name:'main'}};-else if(args[0]!=='api'||args.includes('--method')||args.includes('-X')) { process.stderr.write('fixture refuses posting or unknown commands'); process.exit(2); }+else if(args[0]!=='api'||args.includes('-X')||(args.includes('--method')&&args[args.indexOf('--method')+1]!=='GET')) { process.stderr.write('fixture refuses posting or unknown commands'); process.exit(2); }else if(route==='repos/fixture/project/pulls/7') value=facts.pull;else if(route==='repos/fixture/project/pulls/7/files') value=facts.files||[{filename:'relay/outside.js',status:'added'},{filename:'test/contribution.test.js',status:'added'}];else if(route==='repos/fixture/project/pulls/7/reviews') value=[];diff --git a/test/intake.test.js b/test/intake.test.jsindex a9cf1453..efe18346 100644--- a/test/intake.test.js+++ b/test/intake.test.js@@ -66,7 +66,7 @@ test('an intaken pull request is verified only in the sandbox [V1,V2,V3,B26]', tassert.equal(call.secret, null, 'no inherited host secret reaches the Docker client');assert.equal(call.credential, null, 'no inherited GitHub credential reaches the Docker client');}- assert.equal(calls(box.ghLog).some(args => args.includes('--method') || args.includes('-X')), false, 'no outside reply is posted without a separate person action');+ assert.equal(calls(box.ghLog).some(args => args.includes('-X') || args.includes('--method') && args[args.indexOf('--method') + 1] !== 'GET'), false, 'no outside reply is posted without a separate person action');});