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): a starter's lane counts only when it builds [S1,I1]
Corey Olson12351befcda9
diff --git a/src/cli.js b/src/cli.jsindex d7edd671..6e0c558e 100644--- a/src/cli.js+++ b/src/cli.js@@ -32,7 +32,7 @@ import {pushesTrunk,unwiredHookProblems,} from './hooks.js';-import { detectGate, initRepo, proposeLanes, starterLane, starterLaneNotes } from './init.js';+import { askedLaneNotes, detectGate, initRepo, proposeLanes, starterLane, starterLaneNotes } from './init.js';import { lifecycleMarkdown } from './machine.js';import { HELP, VERSION } from './help.js';import { defaultViewPort } from './view-port.js';@@ -1672,6 +1672,7 @@ function setupCommands(io, { first, second, rest = [], values }) {if (added) {io.say(`added the ${added.blueprint.title} blueprint: ${added.rows.length} ${added.rows.length === 1 ? 'row waits' : 'rows wait'} for your approval in SPEC.md (${added.section}), `+ `${added.items.length} starter ${added.items.length === 1 ? 'item' : 'items'} filed${added.proposedLanes.length ? ` in the ${added.proposedLanes.map((lane) => lane.name).join(' and ')} lane, proposed above and not written until the person accepts` : ''}${added.gate ? `, gate set to ${added.gate}` : ''}`);+ for (const note of askedLaneNotes(added.items, loadConfig(info.root))) io.say(` ${note}`);if (added.checksNotRun.length) io.say(` checks stored, not run: ${added.checksNotRun.map((id) => `#${id}`).join(', ')}; no check baseline ran, so read each check before work starts: pullboard show <id>`);}if (await registerProjectAndLink(info.root, new Date(), loadConfig(info.root), io)) io.say('registered this project on this machine, so pullboard view lists it');@@ -2322,7 +2323,7 @@ export async function addBlueprintHere(io, reference, { report = true, blueprint* @property {{ name: string, title: string, version: number }} blueprint* @property {string} section - The SPEC.md section heading the rows are in.* @property {{ key: string, id: string, status: string, text: string }[]} rows - New rows; each waits for the person.- * @property {{ id: number, key: string, title: string, lane: string, specIds: string[], after: number[], check?: string }[]} items - New open items.+ * @property {{ id: number, key: string, title: string, lane: string, askedLane?: string, specIds: string[], after: number[], check?: string }[]} items - New open items.* @property {string | null} gate - The gate set in pullboard.json, or null when it was left alone.* @property {boolean} marked - This blueprint version was already on the board, so nothing was added.* @property {number[]} checksNotRun - New items that carry a check; no check baseline ran for them.@@ -2359,7 +2360,7 @@ async function addBlueprint(ctx, board, me, blueprint, { report = true } = {}) {const proposals = proposeLanes(ctx.info.root, ctx.config);const lanes = plan.items.map((entry) => starterLane(entry.lane, ctx.config, proposals));const proposedLanes = proposals.filter((lane) => lanes.some((placed) => placed.proposal === lane));- const starters = plan.items.map((entry, index) => ({ key: entry.key, afterKeys: entry.after, item: { by: me.id, lane: lanes[index].lane,+ const starters = plan.items.map((entry, index) => ({ key: entry.key, afterKeys: entry.after, asked: lanes[index].asked, item: { by: me.id, lane: lanes[index].lane,title: entry.title, criterion: entry.criterion, specIds: entry.specIds, parentId: null, after: [], brief: entry.brief, route: entry.route,...(entry.check === undefined ? {} : { check: entry.check }) } }));// The same checks pullboard add uses, before anything is written. A blueprint's item check is@@ -2384,11 +2385,11 @@ async function addBlueprint(ctx, board, me, blueprint, { report = true } = {}) {try {// A retry starts from the starters a failed add already put on the board.const byKey = { ...plan.existing };- for (const { key, afterKeys, item } of starters) {+ for (const { key, afterKeys, asked, item } of starters) {item.after = afterKeys.map((before) => byKey[before]).filter(Boolean);const id = await ordered(ctx, board, 'addItem', [item]);byKey[key] = id;- added.push({ id, key, title: item.title, lane: item.lane, specIds: item.specIds, after: item.after, ...(item.check ? { check: item.check } : {}) });+ added.push({ id, key, title: item.title, lane: item.lane, ...(asked ? { askedLane: asked } : {}), specIds: item.specIds, after: item.after, ...(item.check ? { check: item.check } : {}) });}} catch (error) {// Items already added stay on the board; with no marker yet, a retry adds only what is missing.@@ -2415,7 +2416,7 @@ async function addBlueprint(ctx, board, me, blueprint, { report = true } = {}) {for (const item of added) io.say(` #${item.id} open ${item.title}${item.specIds.length ? ` cites ${item.specIds.join(', ')}` : ''}${item.after.length ? ` waits on #${item.after.join(', #')}` : ''}`);const checked = added.filter((item) => item.check);if (checked.length) io.say(` checks stored, not run: ${checked.map((item) => `#${item.id}`).join(', ')}; no check baseline ran during add, so read each check before work starts: pullboard show <id>`);- for (const note of starterLaneNotes(summary.proposedLanes)) io.say(` ${note}`);+ for (const note of [...askedLaneNotes(added, ctx.config), ...starterLaneNotes(summary.proposedLanes)]) io.say(` ${note}`);if (plan.gate) io.say(` gate set in ${CONFIG_FILE}: ${plan.gate}`);const changed = files.map((file) => file.file);io.say(`next: the person approves the rows in pullboard view or with pullboard spec approve <ids>${changed.length ? `; commit ${changed.join(' and ')}` : ''}`);diff --git a/src/init.js b/src/init.jsindex e591a8aa..51b2c7f3 100644--- a/src/init.js+++ b/src/init.js@@ -112,13 +112,38 @@ export function proposeLanes(root, config = loadConfig(root)) {*/export function starterLane(wanted, config, proposals) {const proposalFor = (name) => proposals.find((lane) => lane.name === name) ?? null;- if (wanted && wanted !== COORDINATOR && (Object.hasOwn(config.lanes, wanted) || proposalFor(wanted))) {- return { lane: wanted, proposal: Object.hasOwn(config.lanes, wanted) ? null : proposalFor(wanted) };+ // A lane that owns no folders, like a verifier lane, builds nothing, so it never takes a starter.+ const builds = (name) => name !== COORDINATOR && Object.hasOwn(config.lanes, name) && config.lanes[name].owns.length > 0;+ if (wanted && (builds(wanted) || (!Object.hasOwn(config.lanes, wanted) && proposalFor(wanted)))) {+ return { lane: wanted, proposal: builds(wanted) ? null : proposalFor(wanted) };}- const built = Object.entries(config.lanes).find(([name, lane]) => name !== COORDINATOR && lane.owns.length);- if (built) return { lane: built[0], proposal: null };+ const asked = wanted ? { asked: wanted } : {};+ const built = Object.keys(config.lanes).find(builds);+ if (built) return { lane: built, proposal: null, ...asked };// proposeLanes always proposes one lane when no lane owns a folder, so this is never empty.- return { lane: proposals[0].name, proposal: proposals[0] };+ return { lane: proposals[0].name, proposal: proposals[0], ...asked };+}++/**+ * The lines blueprint add prints for starters that named a lane they could not go to: which lane+ * they asked for, why it was not used, and where they went instead, so a person reading the output+ * knows the blueprint's lane was set aside.+ *+ * @param {{ lane: string, askedLane?: string }[]} placed - The starters filed, each with its lane.+ * @param {any} config - The repo's config.+ * @returns {string[]}+ */+export function askedLaneNotes(placed, config) {+ const groups = new Map();+ for (const { lane, askedLane: asked } of placed) {+ if (!asked) continue;+ const key = `${asked}\n${lane}`;+ groups.set(key, { asked, lane, count: (groups.get(key)?.count ?? 0) + 1 });+ }+ return [...groups.values()].map(({ asked, lane, count }) => {+ const why = asked === COORDINATOR ? 'which verifies and merges' : Object.hasOwn(config.lanes, asked) ? 'which owns no folders' : 'which does not exist';+ return `${count} starter ${count === 1 ? 'item' : 'items'} asked for the ${asked} lane, ${why}, so ${count === 1 ? 'it is' : 'they are'} filed in the ${lane} lane`;+ });}/**diff --git a/test/blueprint.test.js b/test/blueprint.test.jsindex 810e4058..c1817bb3 100644--- a/test/blueprint.test.js+++ b/test/blueprint.test.js@@ -531,6 +531,18 @@ test('starter items land in a build lane, never the coordinator lane [S1,I1]', (assert.deepEqual(placed.proposedLanes, [], 'nothing is proposed when a build lane exists');assert.deepEqual(lanesOf(laned).filter((lane) => lane === 'coordinator'), [], 'no starter lands in the coordinator lane');+ // A blueprint that names an existing lane owning no folders, a verifier lane: that lane builds+ // nothing, so every starter goes to the first build lane, and add says so.+ const verifier = freshBoard({ lanes: { tests: { owns: [] } } });+ const web = verifier.run('lane', 'add', 'web', '--owns', 'web/');+ assert.equal(web.status, 0, web.stdout + web.stderr);+ writeFileSync(join(verifier.repo, 'verifier-lane.json'), `${JSON.stringify({ ...PUBLISHED, name: 'verifier-lane',+ items: PUBLISHED.items.map((item) => ({ ...item, lane: 'tests' })) })}\n`);+ const moved = verifier.run('blueprint', 'add', 'verifier-lane.json');+ assert.equal(moved.status, 0, moved.stdout + moved.stderr);+ assert.deepEqual(lanesOf(verifier), Array(PUBLISHED.items.length).fill('web'), 'a starter naming a lane that owns no folders goes to the first build lane');+ assert.match(moved.stdout, /asked for the tests lane, which owns no folders, so (?:it is|they are) filed in the web lane/u, 'add says the named lane was not used');+// A board with no build lane, only a verifier lane that owns no folders: blueprint add proposes// one, files the starters in it and says so.const bare = freshBoard({ lanes: { tests: { owns: [] } } });