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.

fix(init): init --blueprint runs nothing from a blueprint [I1,S1]

Corey Olsonaf0231945659
diff --git a/src/cli.js b/src/cli.js
index d9a7316e..1061e417 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -1582,8 +1582,17 @@ function setupCommands(io, { first, values }) {
init: async () => {
const info = repoInfo(io.cwd);
// A named blueprint is read and checked before anything is written, so an unknown name
- // or a broken file leaves the repository untouched (#678).
+ // or a broken file leaves the repository untouched (#678). Init executes nothing from a
+ // blueprint: it fetches no URL and launches no check baseline, so a starter with a check waits
+ // for pullboard blueprint add, where the coordinator's check rules apply.
+ if (values.blueprint !== undefined && /^[a-z][a-z0-9+.-]*:\/\//iu.test(values.blueprint)) {
+ throw new Refused('BLUEPRINT_URL', `init reads a bundled blueprint name or a local file, never a URL; download ${values.blueprint} yourself, read it, then run pullboard init --blueprint <file>`);
+ }
const blueprint = values.blueprint === undefined ? null : readBlueprint(values.blueprint, info.root);
+ const checked = blueprint ? blueprint.items.filter((item) => item.check) : [];
+ if (checked.length) {
+ throw new Refused('BLUEPRINT_CHECK', `init launches no check baselines, and ${checked.map((item) => `items[${item.key}]`).join(', ')} carr${checked.length === 1 ? 'ies' : 'y'} a check; run pullboard init, then pullboard blueprint add ${values.blueprint} from the coordinator`);
+ }
const model = optionalModel(values.model);
const linked = relayLinked(info.root);
const ctx = linked && model !== undefined ? context(io) : null;
diff --git a/test/blueprint.test.js b/test/blueprint.test.js
index a6f880d6..ced4c4b1 100644
--- a/test/blueprint.test.js
+++ b/test/blueprint.test.js
@@ -292,6 +292,27 @@ test('init --blueprint starts a board from a blueprint [I1,S1]', () => {
assert.deepEqual(readdirSync(unknown.repo).filter((name) => name !== '.git'), [], 'nothing is written');
assert.equal(existsSync(join(unknown.repo, '.git', 'pullboard')), false, 'no board is created');
+ // Init executes nothing from a blueprint: a URL is refused unfetched, and a starter that carries
+ // a check is refused rather than launching its baseline. Both leave the repository untouched.
+ const remote = emptyRepo();
+ const fetched = remote.run('init', '--blueprint', 'https://example.invalid/web-app.json', '--json');
+ assert.notEqual(fetched.status, 0);
+ assert.equal(JSON.parse(fetched.stdout).error.code, 'BLUEPRINT_URL');
+ assert.deepEqual(readdirSync(remote.repo).filter((name) => name !== '.git'), [], 'a URL writes nothing');
+ assert.equal(existsSync(join(remote.repo, '.git', 'pullboard')), false, 'a URL creates no board');
+ const outside = mkdtempSync(join(tmpdir(), 'pullboard-blueprint-check-'));
+ const withCheck = join(outside, 'checked.blueprint.json');
+ writeFileSync(withCheck, JSON.stringify({ ...PUBLISHED, items: PUBLISHED.items.map((item, index) => (index === 0 ? { ...item, check: 'true' } : item)) }));
+ const checkedRepo = emptyRepo();
+ const checked = checkedRepo.run('init', '--blueprint', withCheck, '--json');
+ assert.notEqual(checked.status, 0);
+ const checkRefusal = JSON.parse(checked.stdout).error;
+ assert.equal(checkRefusal.code, 'BLUEPRINT_CHECK');
+ assert.match(checkRefusal.message, new RegExp(`items\\[${PUBLISHED.items[0].key}\\]`, 'u'), 'the refusal names the starter with a check');
+ assert.deepEqual(readdirSync(checkedRepo.repo).filter((name) => name !== '.git'), [], 'a check writes nothing');
+ assert.equal(existsSync(join(checkedRepo.repo, '.git', 'pullboard')), false, 'a check creates no board');
+ rmSync(outside, { recursive: true, force: true });
+
// Plain init is unchanged: no blueprint section, no items, no summary line.
const plain = emptyRepo();
const initialized = plain.run('init');