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: retain renamed trust boundaries in outside intake [V3,B26]
Corey Olson43ccc4f939af
diff --git a/src/intake-github.js b/src/intake-github.jsindex 7292f39c..6f16b9c9 100644--- a/src/intake-github.js+++ b/src/intake-github.js@@ -37,9 +37,9 @@ export function githubSource(root, url) {git(root, ['fetch', '--no-tags', '--no-recurse-submodules', `https://github.com/${source.repository}.git`, `refs/pull/${source.number}/head`]);const fetched = git(root, ['rev-parse', 'FETCH_HEAD^{commit}']).trim();if (fetched !== data.head.sha) throw new Refused('OUTSIDE_HEAD_CHANGED', 'the pull request moved while intake fetched it; read and intake its new exact head');- const paths = files.map(file => file.filename);+ const paths = [...new Set(files.flatMap(file => [file.filename, ...(file.previous_filename ? [file.previous_filename] : [])]))];if (paths.some(path => typeof path !== 'string' || path.includes('\n') || path.startsWith('/') || path.split('/').includes('..'))) throw new Refused('OUTSIDE_FETCH', 'GitHub returned an invalid changed path; restore its file metadata');- const changed = git(root, ['diff', '--name-only', '-z', `${data.base.sha}...${fetched}`]).split('\0').filter(Boolean);+ const changed = git(root, ['diff', '--no-ext-diff', '--no-textconv', '--no-renames', '--name-only', '-z', `${data.base.sha}...${fetched}`]).split('\0').filter(Boolean);if (changed.length !== paths.length || changed.some(path => !paths.includes(path))) throw new Refused('OUTSIDE_FETCH', 'the changed-file list differs from the fetched exact commit; refresh GitHub metadata');const sensitivity = outsideSensitivity(root, data.base.sha, fetched, paths);return { ...common, commit: fetched, tree: git(root, ['rev-parse', `${fetched}^{tree}`]).trim(), base: data.base.sha, files: paths, sensitivity, sensitive: sensitivity.length > 0 };diff --git a/src/sandbox-verify.js b/src/sandbox-verify.jsindex 127ca0a3..2b9e56fe 100644--- a/src/sandbox-verify.js+++ b/src/sandbox-verify.js@@ -11,8 +11,10 @@ import {rmSync,writeFileSync,} from 'node:fs';-import { tmpdir } from 'node:os';-import { join } from 'node:path';+import {+ isAbsolute,+ join,+} from 'node:path';import {git,repoInfo,@@ -66,6 +68,7 @@ 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');}@@ -98,7 +101,12 @@ async function container(runtime, environment, directory, image, source, stage,/** Verify both pinned image roles inside actual containers, then execute the trusted full gate and frozen criterion. */export async function verifyOutsideSandbox(root, item, policy, lease) {const runtime = provider(root);- const directory = mkdtempSync(join(tmpdir(), 'pullboard-outside-'));+ const exportRoot = runtime.exportRoot ?? join(repoInfo(root).commonDir, 'pullboard', 'sandbox-exports');+ let directory;+ try {+ mkdirSync(exportRoot, { recursive: true, mode: 0o700 });+ directory = mkdtempSync(join(exportRoot, 'pullboard-outside-'));+ } catch { throw new Refused('SANDBOX_EXPORT', 'create a writable private sandbox.exportRoot shared with the configured Docker daemon, then verify again'); }try {const environment = clientEnvironment(directory, runtime.endpoint);const command = JSON.parse(item.item_frozen).check;@@ -128,6 +136,7 @@ export async function verifyOutsideSandbox(root, item, policy, lease) {catch { throw new Refused('SANDBOX_IMAGE_REQUIRED', 'the configured image has no readable digest receipt; restore the pinned official Node image'); }if (!imageFacts?.RepoDigests?.includes(image)) throw new Refused('SANDBOX_IMAGE_REQUIRED', 'the local runtime image does not match the configured digest; preload that exact official Node image');const measured = record(role, 'environment', await container(runtime, environment, directory, image, candidate.target, 'environment', 'node -p ' + "'JSON.stringify({node:process.versions.node,platform:process.platform,arch:process.arch})'"));+ if (measured.exitCode !== 0) throw new Refused('SANDBOX_EXECUTION', 'the container environment did not execute; restore Docker and its pinned image, and configure sandbox.exportRoot as a private path shared with that daemon\n' + measured.output.slice(-2000));let actual;try { actual = JSON.parse(measured.output.trim()); }catch { throw new Refused('SANDBOX_RUNTIME', 'the container did not report its actual Node environment; restore the pinned Node runtime'); }diff --git a/test/intake-fixture.js b/test/intake-fixture.jsindex b9209562..efff676d 100644--- a/test/intake-fixture.js+++ b/test/intake-fixture.js@@ -140,7 +140,7 @@ export function advanceOutsideFixture(box, path, content, remove = []) {box.git(box.origin, 'fetch', '-q', box.fork, '+HEAD:refs/pull/7/head');const facts = JSON.parse(readFileSync(box.facts, 'utf8'));facts.pull.head.sha = commit;- facts.files = box.git(box.fork, 'diff', '--name-only', `${box.base}...${commit}`).split('\n').filter(Boolean).map(filename => ({ filename, status: 'added' }));+ facts.files = box.git(box.fork, 'diff', '--no-renames', '--name-only', `${box.base}...${commit}`).split('\n').filter(Boolean).map(filename => ({ filename, status: 'added' }));writeFileSync(box.facts, JSON.stringify(facts));return { commit, tree: box.git(box.fork, 'rev-parse', 'HEAD^{tree}') };}diff --git a/test/intake.test.js b/test/intake.test.jsindex fd74efe0..f5eee5fa 100644--- a/test/intake.test.js+++ b/test/intake.test.js@@ -169,7 +169,7 @@ test('renaming an existing sealing boundary cannot hide its touched old path [B2const box = intakeFixture(t, { baseFiles: { 'src/seal.js': content } });advanceOutsideFixture(box, 'lib/moved-boundary.js', content, ['src/seal.js', 'relay/outside.js']);const facts = JSON.parse(readFileSync(box.facts, 'utf8'));- facts.files = facts.files.filter(file => file.filename !== 'lib/moved-boundary.js');+ facts.files = facts.files.filter(file => !['lib/moved-boundary.js', 'src/seal.js'].includes(file.filename));facts.files.push({ filename: 'lib/moved-boundary.js', previous_filename: 'src/seal.js', status: 'renamed' });writeFileSync(box.facts, JSON.stringify(facts));const filed = fixtureJSON(box, box.repo, 'intake', box.pull.html_url, '--criterion', 'the fixture behavior works', '--check', 'node --test test/contribution.test.js');