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(view): #965's agent-approved case writes its spec after init [N26]

Corey Olson6a4c9d9d1336
diff --git a/test/cockpit/fixture.js b/test/cockpit/fixture.js
index 8d3b257a..f27c554b 100644
--- a/test/cockpit/fixture.js
+++ b/test/cockpit/fixture.js
@@ -72,7 +72,7 @@ function machine() {
* A project registered on the machine: a repo set up by `pullboard init`, one web lane, and a
* worktree joined to it as web-1. `extra` adds to its pullboard.json, such as products.
*/
-function project(box, name, spec = SPEC, extra = {}) {
+function project(box, name, spec = SPEC, extra = {}, { agentApproved = false } = {}) {
const repo = join(box.dir, name);
mkdirSync(repo);
box.git(repo, 'init', '-q', '-b', 'main');
@@ -80,8 +80,9 @@ function project(box, name, spec = SPEC, extra = {}) {
delete initEnv.PULLBOARD_MODEL;
// Set the fixture-only opt-out in the machine home that this exact init environment will use.
disableFixtureBackgroundView(initEnv, box.dir);
- // The spec is in place before init, so the board's approval baseline holds its approved rows as the person's (#960).
- writeFileSync(join(repo, 'SPEC.md'), spec);
+ // The spec is in place before init, so the board's approval baseline holds its approved rows as the person's (#960);
+ // agentApproved writes it after init instead, so its approved rows read as an agent's.
+ if (!agentApproved) writeFileSync(join(repo, 'SPEC.md'), spec);
box.runWithEnv(repo, initEnv, 'init');
const config = { gate: 'true', spec: 'SPEC.md', verify: 'any', lease: '2h', lanes: { web: { owns: ['web/'], specs: ['G'] } }, shared: [], ...extra };
writeFileSync(join(repo, 'pullboard.json'), JSON.stringify(config, null, 2));
diff --git a/test/cockpit/needs.test.js b/test/cockpit/needs.test.js
index 6017f315..c8b301af 100644
--- a/test/cockpit/needs.test.js
+++ b/test/cockpit/needs.test.js
@@ -448,7 +448,7 @@ test('needs you and the asks sit in their lists [N26]', { timeout: 180_000 }, as
test('an agent-approved row shows in Needs you with its agent and commit and a confirm and decline move [S1,B26,P6,N26]', { timeout: 120_000 }, async () => { // budget: isolated real Git/API setup and two owned browser profiles, not a performance claim.
const box = machine();
box.env.GIT_AUTHOR_NAME = 'Agent & \"unconfirmed\" seat';
- const alpha = project(box, 'agent approval');
+ const alpha = project(box, 'agent approval', undefined, {}, { agentApproved: true });
const view = await startView(box);
let chrome, snapshotHost, agentApi, reads;
try {