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
chore(merge): integrate accepted lane add [I1,I2]
Corey Olsond7c2322cac41
diff --cc docs/api.mdindex f5c3cb23,49c927ae..6c60156a--- a/docs/api.md+++ b/docs/api.md@@@ -54,9 -54,9 +54,10 @@@ For example: `flow: review wait averag| `resume` | `version:number`, `me:object`, `all:array`, `requests:array`, `holding:array`, `sentBack:array`, `awaiting:array`, `toVerify:array`, `toMerge:array`, `open:array`, `stale:array`, `holds:array`, `unread:number`, `newest:array`, `root:string`, `dirty:number`, `next:string` || `whoami` | `version:number`, `id:string`, `lane:string`, `path:string`, `model:string`, `displayName:string` || `lanes` | `version:number`, `lanes:object`, `shared:array`, `coordinator:string` |+| `lane add` | `version:number`, `lane:string`, `owns:array` || `resources` | `version:number`, `resources:array` || `settings` | `version:number`, `settings:object` |+ | `runner` | `version:number`, `runner:object` || `relay` | `version:number`, `linked:boolean`, `board:string`, `url:string`, `link:string`, `sequence:number`, `behind:number`, `recovery:object` || `list` | `version:number`, `items:array` || `roadmap` | `version:number`, `milestones:array` |diff --cc src/cli.jsindex 16643e25,062d6c58..1be7c7c4--- a/src/cli.js+++ b/src/cli.js@@@ -1604,9 -1640,17 +1641,18 @@@ function setupCommands(io, { first, secif (linked && model !== undefined) await withBoard(ctx, (board) => ordered(ctx, board, 'register', [{ lane: COORDINATOR, path: info.root, model },]));- io.result?.({ root: info.root, notes, proposedLanes: proposeLanes(info.root) });- // init --blueprint: the same add as pullboard blueprint add, in the same command (#678).++ // Keep blueprint initialization and the person's unwritten lane proposals in the same result.+ const added = blueprint ? await addBlueprintHere(io, values.blueprint, { report: false, blueprint }) : null;- io.result?.({ root: info.root, notes, ...(added ? { blueprint: { name: added.blueprint.name, title: added.blueprint.title,- section: added.section, waiting: added.rows.length, items: added.items.length, gate: added.gate, checksNotRun: added.checksNotRun } } : {}) });++ io.result?.({ root: info.root, notes, proposedLanes: proposeLanes(info.root),++ ...(added ? { blueprint: { name: added.blueprint.name, title: added.blueprint.title,++ section: added.section, waiting: added.rows.length, items: added.items.length, gate: added.gate, checksNotRun: added.checksNotRun } } : {}) });const staging = notes.at(-1)?.startsWith('git add -f -- ') ? notes.at(-1) : null;(staging ? notes.slice(0, -1) : notes).forEach((note) => io.say(note));+ 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.gate ? `, gate set to ${added.gate}` : ''}`);+ 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');io.say(agentSessionDigest()? 'Next: run pullboard resume now to continue setup in this session; the new skills load next session, and setup does not need them.'diff --cc src/help.jsindex 0bd0b449,4faff8fb..dcd73847--- a/src/help.js+++ b/src/help.js@@@ -196,8 -200,8 +202,9 @@@ const HELP_EXAMPLES =verify: 'pullboard verify 12 accept --note "removed the fix; the test failed"',answer: 'pullboard answer 12 "done"', pass: 'pullboard pass 12 "please decide"',status: 'pullboard status', view: 'pullboard view', stats: 'pullboard stats --since 2026-10-08', log: 'pullboard log 12', ledger: 'pullboard ledger',+ 'lane add': 'pullboard lane add web --owns apps/web/', lane: 'pullboard lane add web --owns apps/web/',roadmap: 'pullboard roadmap', milestone: 'pullboard milestone add "0.7.0" --items 12,13',+ runner: 'pullboard runner add studio --slots 2 --browser 1', 'runner add': 'pullboard runner add studio --slots 2 --browser 1',edit: 'pullboard edit 12 --brief "Add the upload page"', release: 'pullboard release 12',land: 'pullboard land --max 4',reopen: 'pullboard reopen 12 --note "correct the frozen criterion"',diff --cc src/init.jsindex 04273ff7,7c22c502..9b87486d--- a/src/init.js+++ b/src/init.js@@@ -4,8 -4,8 +4,11 @@@* the main checkout as the coordinator. It runs again safely and never overwrites a file it did not* write.*/- import { appendFileSync, existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';- import { basename, join } from 'node:path';-import { accessSync, appendFileSync, constants as fsConstants, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';++import {++ accessSync, appendFileSync, constants as fsConstants, existsSync, mkdirSync,++ readdirSync, readFileSync, statSync, writeFileSync,++} from 'node:fs';+ import { delimiter, basename, join, resolve } from 'node:path';import { CONFIG_FILE, COORDINATOR, doctrineFile, loadConfig } from './config.js';import { loadDoctrine } from './doctrine.js';import { installHooks } from './hooks.js';@@@ -38,83 -38,67 +41,144 @@@ export function detectGate(root)return '';}+/** Folders a lane proposal never hands out: dependencies and build output. */+const NOT_LANE_FOLDERS = new Set(['node_modules', 'dist', 'build', 'out', 'target', 'vendor', 'coverage']);++/**+ * The visible folders directly inside `dir`, sorted, without dependencies or build output.+ *+ * @param {string} dir+ * @returns {string[]}+ */+function visibleFolders(dir) {+ if (!existsSync(dir)) return [];+ return readdirSync(dir, { withFileTypes: true })+ .filter((entry) => entry.isDirectory() && !entry.name.startsWith('.') && !NOT_LANE_FOLDERS.has(entry.name))+ .map((entry) => entry.name).sort();+}++/**+ * A lane name made from a folder name: lowercase letters, digits and dashes, starting with a letter.+ *+ * @param {string} folder+ * @returns {string}+ */+function laneNameFor(folder) {+ const name = folder.toLowerCase().replace(/[^a-z0-9-]+/gu, '-').replace(/^[^a-z]+/u, '').replace(/-+$/u, '').slice(0, 31).replace(/-+$/u, '');+ return name || 'lane';+}++/**+ * The lanes init proposes from the repo's layout (I1, I2): one lane per top-level package for a+ * packages/* or apps/* layout, and one app lane owning the top-level folders otherwise. Nothing is+ * proposed once any lane owns a folder. Proposals are never written: the person accepts each one+ * by running its `pullboard lane add` command.+ *+ * @param {string} root+ * @param {any} [config] - The repo's config; read from root when omitted.+ * @returns {{ name: string, owns: string[] }[]}+ */+export function proposeLanes(root, config = loadConfig(root)) {+ if (Object.values(config.lanes).some((lane) => lane.owns.length)) return [];+ const taken = new Set([COORDINATOR, 'all', ...Object.keys(config.lanes)]);+ const proposals = [];+ for (const parent of ['packages', 'apps']) {+ for (const folder of visibleFolders(join(root, parent))) {+ let name = laneNameFor(folder);+ if (taken.has(name)) name = laneNameFor(`${parent}-${folder}`);+ for (let n = 2; taken.has(name); n += 1) name = `${laneNameFor(`${parent}-${folder}`).slice(0, 28)}-${n}`;+ taken.add(name);+ proposals.push({ name, owns: [`${parent}/${folder}/`] });+ }+ }+ if (proposals.length) return proposals;+ const folders = visibleFolders(root);+ return [{ name: taken.has('app') ? 'app-1' : 'app', owns: folders.length ? folders.map((folder) => `${folder}/`) : ['app/'] }];+}++/**+ * Quote one word for a POSIX shell when it needs quoting.+ *+ * @param {string} word+ * @returns {string}+ */+const shellWord = (word) => (/^[A-Za-z0-9_./,@%+=:-]+$/u.test(word) ? word : `'${word.replaceAll("'", "'\\''")}'`);++/**+ * The init lines that show proposed lanes and the one command that accepts them.+ *+ * @param {{ name: string, owns: string[] }[]} proposals+ * @returns {string[]}+ */+export function laneProposalNotes(proposals) {+ if (!proposals.length) return [];+ return [+ `proposed lanes, not written until the person accepts: ${proposals.map((lane) => `${lane.name} owns ${lane.owns.join(' ')}`).join('; ')}`,+ `ask the person; to accept, run: ${proposals.map((lane) => `pullboard lane add ${shellWord(lane.name)} --owns ${shellWord(lane.owns.join(','))}`).join(' && ')}`,+ ];+}++ /** Check whether a command can be found on PATH or in a named project environment without running it. */+ function gateCommandAvailable(root, command) {+ /** Check one file without executing it or resolving arbitrary shell syntax. */+ const executableFile = (file) => {+ try {+ const info = statSync(file);+ if (!info.isFile()) return false;+ if (process.platform === 'win32') return true;+ accessSync(file, fsConstants.X_OK);+ return true;+ } catch {+ return false;+ }+ };+ /** Return platform command-name variants for a directory lookup. */+ const commandFiles = (directory) => {+ const base = join(directory, command);+ if (process.platform !== 'win32' || /\.[^\\/]+$/u.test(command)) return [base];+ return (process.env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';').map((extension) => `${base}${extension}`);+ };+ /** Check a PATH directory entry, using the process working directory for an empty entry. */+ const onPath = (directory) => {+ return commandFiles(directory || process.cwd()).some(executableFile);+ };+ if ((process.env.PATH ?? '').split(delimiter).some(onPath)) return true;++ /** Check conventional executable directories inside a named environment. */+ const hasEnvironmentCommand = (environment) => [+ ...commandFiles(join(environment, 'bin')),+ ...commandFiles(join(environment, 'Scripts')),+ ].some(executableFile);++ const environments = new Set([join(root, '.venv')]);+ if (process.env.UV_PROJECT_ENVIRONMENT) {+ const configured = process.env.UV_PROJECT_ENVIRONMENT;+ environments.add(resolve(root, configured));+ }+ if (process.env.POETRY_ACTIVE && process.env.VIRTUAL_ENV) environments.add(process.env.VIRTUAL_ENV);+ if ([...environments].some(hasEnvironmentCommand)) return true;+ return false;+ }++ /** Describe a detected gate that init cannot resolve without executing it. */+ function missingGateNote(root, gate) {+ if (!gate) return '';+ const command = gate.trim().split(/\s+/u)[0];+ if (gateCommandAvailable(root, command)) return '';+ if (command === 'pytest') {+ const hasPoetry = existsSync(join(root, 'poetry.lock'));+ const hasUv = existsSync(join(root, 'uv.lock')) || Boolean(process.env.UV_PROJECT_ENVIRONMENT);+ const searched = ['PATH', 'project `.venv`'];+ if (process.env.UV_PROJECT_ENVIRONMENT) searched.push('configured uv environment');+ if (process.env.POETRY_ACTIVE && process.env.VIRTUAL_ENV) searched.push('active Poetry environment');+ const setupHint = hasUv ? 'run `uv sync` and activate its `.venv`'+ : hasPoetry ? 'run `poetry install` and activate that environment'+ : 'install pytest or activate the project `.venv`';+ return `gate command "pytest" is not available on ${searched.join(', ')}; ${setupHint} before running it`;+ }+ return `gate command "${command}" is not available on PATH; install it before running the gate`;+ }+/*** The fixers to start with (C5): prettier, when the repo already depends on it, on every file it* understands. Only fast, deterministic fixers belong at commit time; slow ones stay in the gate.diff --cc src/json.jsindex cdc4bcf9,ac886b58..f26a5e00--- a/src/json.js+++ b/src/json.js@@@ -19,9 -19,9 +19,10 @@@ export const JSON_SHAPES =resume: shape({ me: 'object', all: 'array', requests: 'array', holding: 'array', sentBack: 'array', awaiting: 'array', toVerify: 'array', toMerge: 'array', open: 'array', stale: 'array', holds: 'array', unread: 'number', newest: 'array', root: 'string', dirty: 'number', next: 'string' }),whoami: shape({ id: 'string', lane: 'string', path: 'string', model: 'string', displayName: 'string' }),lanes: shape({ lanes: 'object', shared: 'array', coordinator: 'string' }),+ 'lane add': shape({ lane: 'string', owns: 'array' }),resources: shape({ resources: 'array' }),settings: shape({ settings: 'object' }),+ runner: shape({ runner: 'object' }),relay: shape({ linked: 'boolean', board: 'string', url: 'string', link: 'string', sequence: 'number', behind: 'number', recovery: 'object' }),list: shape({ items: 'array' }),roadmap: shape({ milestones: 'array' }),diff --cc test/api.test.jsindex 34c45124,0a6ba75f..53254d69--- a/test/api.test.js+++ b/test/api.test.js@@@ -981,9 -983,8 +983,11 @@@ test('[A1] every catalog command and su/** Exercise the agent-only takeover with a private explicit session, leaving later terminal calls markerless. */const sessionSource = { ...source, run: (cwd, ...args) => runFixtureChild(process.execPath, [BIN, ...args], { cwd, env: { ...source.env, CODEX_SESSION_ID: 'api-catalog-session' }, encoding: 'utf8' }) };json(sessionSource, source.repo, 'takeover');+ const lane = json(source, source.repo, 'lane', ['add', 'catalog', '--owns', 'catalog/'], 'add');+ assert.deepEqual([lane.lane, lane.owns], ['catalog', ['catalog/']]);+ assert.deepEqual(json(source, source.repo, 'lanes').lanes.catalog, { owns: ['catalog/'] });+ const runner = json(source, source.repo, 'runner', ['add', 'fixture-runner', '--slots', '2', '--browser', '1']);+ assert.deepEqual(runner.runner, { host: 'fixture-runner', slots: 2, browser: 1 });const missing = Object.keys(JSON_SHAPES.commands).filter((key) => !covered.has(key));assert.deepEqual(missing, [], `add real-repo invocations for undocumented coverage gaps: ${missing.join(', ')}`);assert.deepEqual([...coveredRoots].sort(), resultCommands(), 'every actual root/factory command has an invocation');