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
test: fence outside revisions and sensitive trust boundaries [V3,B26]
Corey Olson6ac0ce4237f5
diff --git a/test/intake-fixture.js b/test/intake-fixture.jsindex f95eed1c..b07f8072 100644--- a/test/intake-fixture.js+++ b/test/intake-fixture.js@@ -5,8 +5,12 @@ import {mkdirSync,readFileSync,writeFileSync,+ unlinkSync,} from 'node:fs';-import { join } from 'node:path';+import {+ dirname,+ join,+} from 'node:path';import { createE2eHelpers } from './e2e-helpers.js';/** Quote an owned fixture path for the tiny executable shim. */@@ -73,7 +77,7 @@ 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(route==='repos/fixture/project/pulls/7') value=facts.pull;-else if(route==='repos/fixture/project/pulls/7/files') value=[{filename:'relay/outside.js',status:'added'},{filename:'test/contribution.test.js',status:'added'}];+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=[];else if(route==='repos/fixture/project/issues/6') value=facts.issue;else if(route==='repos/fixture/project/issues/6/comments') value=facts.issueComments||[];@@ -116,3 +120,19 @@ export function calls(path) {try { return readFileSync(path, 'utf8').trim().split('\n').filter(Boolean).map(line => JSON.parse(line)); }catch (error) { if (error.code === 'ENOENT') return []; throw error; }}++/** Advance only this owned fork/ref and its public metadata; never execute its contributed program. */+export function advanceOutsideFixture(box, path, content, remove = []) {+ for (const deleted of remove) unlinkSync(join(box.fork, deleted));+ mkdirSync(dirname(join(box.fork, path)), { recursive: true });+ writeFileSync(join(box.fork, path), content);+ box.git(box.fork, 'add', '-A');+ box.git(box.fork, 'commit', '-q', '--author', 'Outside Contributor <[email protected]>', '-m', 'feat: revise owned outside fixture\n\nSigned-off-by: Outside Contributor <[email protected]>');+ const commit = box.git(box.fork, 'rev-parse', 'HEAD');+ 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' }));+ 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 5218590c..b54b8db8 100644--- a/test/intake.test.js+++ b/test/intake.test.js@@ -7,6 +7,7 @@ import {writeFileSync,} from 'node:fs';import {+ advanceOutsideFixture,calls,configureFixtureSandbox,fixtureJSON,@@ -94,3 +95,42 @@ test('outside issue intake retains source state and distinguishes a maintainer rassert.equal(item.outside.maintainerReplied, true);assert.equal(item.item_status, 'open', 'GitHub closure alone does not verify or land a local board item');});+++test('outside sealing and command-bearing changes require owner approval [B26,V3]', t => {+ const box = intakeFixture(t);+ // Remove the original relay path so it cannot conceal an omitted sealing classification.+ advanceOutsideFixture(box, 'src/seal.js', 'export const sealFixture = true;\n', ['relay/outside.js']);+ const filed = fixtureJSON(box, box.repo, 'intake', box.pull.html_url, '--criterion', 'the fixture behavior works', '--check', 'node --test test/contribution.test.js');+ const id = String(filed.item.item_id);+ assert.equal(fixtureJSON(box, box.repo, 'show', id).outside.sensitive, true, 'the existing sealing boundary needs owner approval even without a relay change');+});++test('a returned outside pull request cannot be claimed as native build work [V1,V3]', t => {+ const box = intakeFixture(t);+ const filed = fixtureJSON(box, box.repo, 'intake', box.pull.html_url, '--criterion', 'the fixture behavior works', '--check', 'node --test test/contribution.test.js');+ const id = String(filed.item.item_id);+ fixtureJSON(box, box.repo, 'reopen', id, '--note', 'outside author must revise its pull request');+ refusal(box.run(box.web, 'claim', id, '--json'), 'OUTSIDE_NATIVE_BUILD');+ const item = fixtureJSON(box, box.repo, 'show', id);+ assert.equal(item.item_status, 'open');+ assert.equal(item.item_built_by, 'outside:github:outside-contributor');+});++test('an outside author revision is re-intaken only after normal return and clears exact-commit approval [V1,V3,B26]', t => {+ const box = intakeFixture(t);+ const filed = fixtureJSON(box, box.repo, 'intake', box.pull.html_url, '--criterion', 'the fixture behavior works', '--check', 'node --test test/contribution.test.js');+ const id = String(filed.item.item_id);+ fixtureJSON(box, box.repo, 'intake', 'approve', id);+ const next = advanceOutsideFixture(box, 'relay/outside.js', 'export const outside = "revised owned fixture";\n');+ refusal(box.run(box.repo, 'intake', box.pull.html_url, '--criterion', 'the fixture behavior works', '--check', 'node --test test/contribution.test.js', '--json'), 'OUTSIDE_HEAD_CHANGED');+ assert.equal(fixtureJSON(box, box.repo, 'show', id).item_commit, box.commit, 'source refresh cannot replace an active submission');+ fixtureJSON(box, box.repo, 'reopen', id, '--note', 'outside author supplied a new exact head');+ const refreshed = fixtureJSON(box, box.repo, 'intake', box.pull.html_url, '--criterion', 'the fixture behavior works', '--check', 'node --test test/contribution.test.js');+ assert.equal(refreshed.item.item_id, Number(id));+ assert.equal(refreshed.item.item_status, 'submitted');+ assert.equal(refreshed.item.item_commit, next.commit);+ assert.equal(refreshed.item.item_tree, next.tree);+ assert.equal(refreshed.item.outside.ownerApproval, null, 'the old owner approval never authorizes the new source commit');+ assert.equal(refreshed.item.outside.sandbox, null, 'the new outside head must be executed in the sandbox again');+});