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(git): create an absent-source fixture without row deletion [C7]

Corey Olson413e3c349958
diff --git a/test/git-calls.test.js b/test/git-calls.test.js
index 7ec75926..70a85c51 100644
--- a/test/git-calls.test.js
+++ b/test/git-calls.test.js
@@ -179,22 +179,29 @@ test('combined Git source facts retain repository identity when optional doctrin
assert.equal(present.head, box.git(box.worker, 'rev-parse', 'HEAD'));
assert.equal(present.blobs.config, box.git(box.repo, 'rev-parse', 'HEAD:pullboard.json'));
assert.equal(present.blobs.doctrine, box.git(box.repo, 'rev-parse', 'HEAD:DOCTRINE.md'));
- box.git(box.repo, 'rm', 'DOCTRINE.md');
- box.git(box.repo, 'commit', '-q', '-m', 'test(core): omit optional doctrine source [C7]');
- const missing = readFactScenario(box, box.worker, script);
+ const missingRepo = join(box.dir, 'missing-doctrine');
+ const missingWorker = join(box.dir, 'missing-worker');
+ mkdirSync(missingRepo);
+ box.git(missingRepo, 'init', '-q', '-b', 'main');
+ writeFileSync(join(missingRepo, 'pullboard.json'), '{}\n');
+ box.git(missingRepo, 'add', 'pullboard.json');
+ box.git(missingRepo, 'commit', '-q', '-m', 'test(core): create optional-source fixture [C7]');
+ box.git(missingRepo, 'worktree', 'add', '-q', '-b', 'worker', missingWorker);
+ const missing = readFactScenario(box, missingWorker, script);
+ const missingHead = box.git(missingRepo, 'rev-parse', 'HEAD');
assert.equal(missing.blobs, null);
- assert.equal(missing.main.commit, box.git(box.repo, 'rev-parse', 'HEAD'));
- assert.equal(missing.head, present.head, 'missing primary doctrine does not discard the linked HEAD');
- box.git(box.repo, 'config', 'core.hooksPath', `hooks\n${'a'.repeat(40)}\n${'b'.repeat(40)}`);
- const unusual = readFactScenario(box, box.worker, script);
+ assert.equal(missing.main.commit, missingHead);
+ assert.equal(missing.head, missingHead, 'missing primary doctrine does not discard the linked HEAD');
+ box.git(missingRepo, 'config', 'core.hooksPath', `hooks\n${'a'.repeat(40)}\n${'b'.repeat(40)}`);
+ const unusual = readFactScenario(box, missingWorker, script);
assert.equal(unusual.blobs, null, 'hook path lines never become trusted source object IDs');
- assert.equal(unusual.main.commit, missing.main.commit, 'opaque hook paths preserve the validated Git fallback');
- assert.equal(unusual.head, present.head);
- box.git(box.repo, 'config', '--unset', 'core.hooksPath');
- box.git(box.repo, 'switch', '-q', '--detach');
- const detached = readFactScenario(box, box.worker, script);
+ assert.equal(unusual.main.commit, missingHead, 'opaque hook paths preserve the validated Git fallback');
+ assert.equal(unusual.head, missingHead);
+ box.git(missingRepo, 'config', '--unset', 'core.hooksPath');
+ box.git(missingRepo, 'switch', '-q', '--detach');
+ const detached = readFactScenario(box, missingWorker, script);
assert.equal(detached.main, null, 'a detached primary never acquires an invented main branch');
- assert.equal(detached.head, present.head);
+ assert.equal(detached.head, missingHead);
});
/** Record schema-valid private fixture history, never represented as a real gate execution. */