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
fix(blueprint): light and mid starters pass through to add [S1,I1]
Corey Olsone3993f31da86
diff --git a/src/blueprints.js b/src/blueprints.jsindex 3a00258b..136cb859 100644--- a/src/blueprints.js+++ b/src/blueprints.js@@ -17,7 +17,11 @@* gate "npm test" optional, set in pullboard.json only when it has no gate* rules [{ key, text, why, tier?, gate? }] tier must|aim (must), gate (review)* questions [{ key, ask, choices, default }] default is one of choices- * items [{ key, title, cites?, after?, lane?, route?, criterion?, brief? }] route is strong+ * items [{ key, title, cites?, after?, lane?, route?, criterion?, brief?, check? }]+ *+ * An item's route is light, mid or strong (strong when left out), as pullboard add takes it. Its+ * brief, criterion and check pass through to add unchanged, so a light or mid item is filed when it+ * carries what add requires for that route and refused with add's own refusal when it does not.** Rule and question keys ("W1", "Q1") are unique within the file; an item cites them by key and* waits on other items by their keys. On a board they get real ids from the section's prefix.@@ -38,6 +42,7 @@ const BUNDLED_DIR = fileURLToPath(new URL('./blueprints/', import.meta.url));const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;const KEY_RE = /^[A-Za-z0-9]+$/u;const PREFIX_RE = /^[A-Z][A-Z0-9]*$/u;+const ROUTES = ['light', 'mid', 'strong'];/*** The names of the blueprints shipped with Pullboard, sorted.@@ -161,8 +166,8 @@ export function validateBlueprint(value, source = 'blueprint') {if (!itemKeys.has(before) || before === item.key) fail(`${at}.after`, `names ${JSON.stringify(before)}, which is no earlier item key`);}line(`${at}.lane`, item.lane, { required: false });- // A light or mid item needs a coordinator's check and a cold brief, which a blueprint cannot carry.- if (item.route !== undefined && item.route !== 'strong') fail(`${at}.route`, 'must be strong or left out; add a light or mid item later with pullboard add and its check');+ if (item.route !== undefined && !ROUTES.includes(item.route)) fail(`${at}.route`, `must be one of ${ROUTES.join(', ')}`);+ line(`${at}.check`, item.check, { required: false });line(`${at}.criterion`, item.criterion, { required: false });if (item.brief !== undefined && typeof item.brief !== 'string') fail(`${at}.brief`, 'must be text');});@@ -306,7 +311,7 @@ export function planBlueprint(blueprint, { source, spec, doctrine, existingItemsconst found = resumed && existingItems.find((entry) => entry.title === item.title.trim() && entry.specIds.join(',') === specIds.join(','));if (found) { existing[item.key] = found.id; continue; }items.push({ key: item.key, title: item.title.trim(), specIds, after: item.after,- ...(item.lane ? { lane: item.lane } : {}), route: item.route, criterion: item.criterion, brief: item.brief });+ ...(item.lane ? { lane: item.lane } : {}), ...(item.check ? { check: item.check } : {}), route: item.route, criterion: item.criterion, brief: item.brief });}return { marked, resumed, section, rows, specRows, specAfter, ids, items, existing, gate: gateToSet };}diff --git a/src/cli.js b/src/cli.jsindex 60ac9c01..96957ea4 100644--- a/src/cli.js+++ b/src/cli.js@@ -2231,8 +2231,13 @@ async function addBlueprint(ctx, board, me, blueprint, { report = true } = {}) {// Every starter is checked before anything is written, so a refusal leaves the board as it was.const starters = plan.items.map((entry) => ({ key: entry.key, afterKeys: entry.after, item: { by: me.id,lane: entry.lane && entry.lane !== COORDINATOR && isLane(ctx.config, entry.lane) ? entry.lane : COORDINATOR,- title: entry.title, criterion: entry.criterion, specIds: entry.specIds, parentId: null, after: [], brief: entry.brief, route: entry.route } }));- for (const { item } of starters) store.validateItemAddition(board, item);+ title: entry.title, criterion: entry.criterion, specIds: entry.specIds, parentId: null, after: [], brief: entry.brief, route: entry.route,+ ...(entry.check === undefined ? {} : { check: entry.check }) } }));+ for (const { item } of starters) {+ // The same checks and check baseline pullboard add uses, before anything is written.+ const { command } = store.validateItemAddition(board, item);+ if (command) item.checkBaseline = prepareCheckBaseline(ctx.info.root, command);+ }const files = [];if (plan.specRows !== source) files.push({ file: ctx.config.spec, before: source, after: plan.specRows });if (plan.gate) {@@ -2249,6 +2254,7 @@ async function addBlueprint(ctx, board, me, blueprint, { report = true } = {}) {for (const { key, afterKeys, item } of starters) {item.after = afterKeys.map((before) => byKey[before]).filter(Boolean);const id = await ordered(ctx, board, 'addItem', [item]);+ if (item.checkBaseline?.result === 'pending') await launchBaseline(ctx, board, id, item.checkBaseline);byKey[key] = id;added.push({ id, key, title: item.title, lane: item.lane, specIds: item.specIds, after: item.after });}diff --git a/test/blueprint.test.js b/test/blueprint.test.jsindex 75d67cea..d3bfdac7 100644--- a/test/blueprint.test.js+++ b/test/blueprint.test.js@@ -166,11 +166,11 @@ test('blueprint add files a blueprint as drafts or nothing at all [S1,I1]', () =// A later starter the board refuses (here a brief over its limit) stops the add before any write.const late = refused('late-refusal', [{ key: '1', title: 'First starter', cites: ['W1'] }, { key: '2', title: 'Second starter', brief: 'x'.repeat(8001) }]);assert.equal(late.code, 'BRIEF_TOO_LONG');- // Light and mid starters need a coordinator's check and a cold brief, so a blueprint refuses them.+ // A light or mid starter without what pullboard add requires is refused with add's own refusal.for (const route of ['light', 'mid']) {const error = refused(`${route}-route`, [{ key: '1', title: 'First starter', cites: ['W1'] }, { key: '2', title: 'Second starter', route }]);- assert.equal(error.code, 'BAD_BLUEPRINT');- assert.match(error.message, new RegExp(`items\\[1\\]\\.route must be strong`, 'u'));+ assert.equal(error.code, 'NO_BRIEF');+ assert.match(error.message, new RegExp(`an item routed ${route} must be buildable cold`, 'u'));}// After the refusals, the same blueprint fixed adds everything at once.const added = json(box, 'blueprint', 'add', 'web-app');@@ -178,6 +178,29 @@ test('blueprint add files a blueprint as drafts or nothing at all [S1,I1]', () =assert.equal(added.items.length, 3);});+test('blueprint add files a blueprint as drafts with light and mid starters add accepts [S1,I1]', () => {+ // A light or mid starter carrying its brief, criterion and check is filed on that route, with+ // all three passed to the item unchanged; a strong starter needs none of them.+ const box = freshBoard({ gate: 'true' });+ box.git('commit', '-q', '-am', 'chore: set the fixture gate');+ const brief = 'Files:\n- web/index.html\nTest:\n- test/home.test.js asserts the page fits 375 pixels';+ const items = [+ { key: '1', title: 'Light starter', cites: ['W3'], route: 'light', brief, criterion: 'The home page fits 375 pixels.', check: 'true' },+ { key: '2', title: 'Mid starter', cites: ['W1'], route: 'mid', brief, criterion: 'A test fails without the change.', check: 'true', after: ['1'] },+ { key: '3', title: 'Strong starter', cites: ['W2'] },+ ];+ writeFileSync(join(box.repo, 'routes.json'), `${JSON.stringify({ ...PUBLISHED, name: 'routes', items })}\n`);+ const added = json(box, 'blueprint', 'add', 'routes.json');+ assert.equal(added.items.length, 3);+ const filed = json(box, 'list', '--all').items.sort((a, b) => a.item_id - b.item_id);+ assert.deepEqual(filed.map((item) => [item.item_title, item.item_route, item.item_check, item.item_criterion, item.item_brief]), [+ ['Light starter', 'light', 'true', items[0].criterion, brief],+ ['Mid starter', 'mid', 'true', items[1].criterion, brief],+ ['Strong starter', 'strong', '', '', ''],+ ]);+ assert.equal(filed[1].item_after, String(filed[0].item_id));+});+test('blueprint add files a blueprint as drafts beside approved rows in its own section [S1,I1]', () => {// The person already wrote the blueprint's section, with one rule approved in the same words: a// first add still files every rule as a draft and every question as a pending row.