Skip to content

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.

test: retain sensitive old paths across outside renames [B26,V3]

Corey Olson8f95650c1e27
diff --git a/test/intake-fixture.js b/test/intake-fixture.js
index b07f8072..b9209562 100644
--- a/test/intake-fixture.js
+++ b/test/intake-fixture.js
@@ -33,7 +33,7 @@ export function fixtureJSON(box, cwd, ...args) {
}
/** Build a real outside commit/ref and an independently initialized trusted receiving board. */
-export function intakeFixture(t) {
+export function intakeFixture(t, { baseFiles = {} } = {}) {
const helpers = createE2eHelpers();
t.after(helpers.cleanup);
const box = helpers.sandbox();
@@ -45,6 +45,14 @@ export function intakeFixture(t) {
box.env.GH_TOKEN = randomUUID();
box.env.HOST_SECRET = randomUUID();
const made = helpers.project('node --test test/contribution.test.js', box);
+ for (const [path, content] of Object.entries(baseFiles)) {
+ mkdirSync(dirname(join(made.repo, path)), { recursive: true });
+ writeFileSync(join(made.repo, path), content);
+ }
+ if (Object.keys(baseFiles).length) {
+ box.git(made.repo, 'add', '-A');
+ box.git(made.repo, 'commit', '-q', '-m', 'chore: seed trusted boundary fixture');
+ }
const base = box.git(made.repo, 'rev-parse', 'HEAD');
const fork = join(box.dir, 'outside-fork');
box.git(box.dir, 'clone', '-q', '--no-hardlinks', made.repo, fork);
diff --git a/test/intake.test.js b/test/intake.test.js
index 85668bea..fd74efe0 100644
--- a/test/intake.test.js
+++ b/test/intake.test.js
@@ -162,3 +162,16 @@ test('only trusted main can extend outside sensitive paths and ordinary source s
assert.ok(filed.item.outside.sensitivity.some(reason => reason.path === 'data/regulated.json' && reason.rule === 'configured-sensitive-path'));
assert.equal(filed.item.outside.sensitivity.some(reason => reason.path === 'lib/ordinary.js'), false, 'source files are not all sensitive just for being source');
});
+
+
+test('renaming an existing sealing boundary cannot hide its touched old path [B26,V3]', t => {
+ const content = 'export const sealFixture = value => value;\n';
+ const 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.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');
+ assert.ok(filed.item.outside.sensitivity.some(reason => reason.path === 'src/seal.js' && reason.rule === 'declared-sensitive-path'), 'the exact old trust-boundary path remains part of the owner decision after a GitHub rename');
+});