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 saved blueprint never holds the project name [S1]
Corey Olsoncf95887ade19
diff --git a/src/blueprints.js b/src/blueprints.jsindex 58a9ed4e..a95344b3 100644--- a/src/blueprints.js+++ b/src/blueprints.js@@ -430,7 +430,7 @@ export function privateTextReason(text, names, parts = []) {* rule with no "Why:" reason to carry, is left out and named in `left`, never rewritten [S1].** @param {{ rows: any[] }} spec - The parsed SPEC.md.- * @param {{ name: string, title: string, gate?: string, names: string[], parts?: string[] }} board+ * @param {{ name?: string, title?: string, gate?: string, names: string[], parts?: string[] }} board - name and title are the person's own choice, never the project's* @returns {{ blueprint: Blueprint, left: { id: string, reason: string }[] }}*/export function saveBlueprint(spec, { name, title, gate, names, parts = [] }) {@@ -455,17 +455,21 @@ export function saveBlueprint(spec, { name, title, gate, names, parts = [] }) {if (!rule.text.trim() || !rule.why.trim() || ruleText(rule) !== text) { left.push({ id: row.id, reason: 'its rule cannot be read back exactly' }); continue; }rules.push({ key: row.id, ...rule, tier: row.tier === 'aim' ? 'aim' : 'must', gate: 'review' });}- // The project's own name leaves only if no private name hides in it, in any case or spelling.+ // The project's name never goes in (decision de849661): the person names the blueprint, or it+ // gets a neutral default to edit. A chosen name still may not carry anything private.+ const safeName = name ?? 'my-blueprint';+ const safeTitle = title ?? 'My blueprint';+ if (typeof safeName !== 'string' || !NAME_RE.test(safeName)) throw new Refused('USAGE', 'a blueprint name is lowercase letters, digits and dashes; run pullboard blueprint save --name my-rules');+ if (typeof safeTitle !== 'string' || !safeTitle.trim() || /[\r\n|]/u.test(safeTitle)) throw new Refused('USAGE', 'a blueprint title is one line without a | character; run pullboard blueprint save --title "My rules"');const strict = [...names, ...parts];- const loose = (text) => privateTextReason(text, strict) || privateTextReason(text.replace(/[^\p{L}\p{N}]+/gu, ' '), strict);- const raw = String(name ?? '').trim();- const slug = raw.normalize('NFKD').toLowerCase().replace(/[\u0300-\u036f]/gu, '').replace(/[^a-z0-9]+/gu, '-').replace(/^-|-$/gu, '');- const safeName = slug && !loose(raw) && !loose(slug) ? slug : 'board';- const cleanTitle = String(title ?? '').trim();+ for (const [flag, text] of [['--name', safeName.replaceAll('-', ' ')], ['--title', safeTitle]]) {+ const privacy = privateTextReason(text, strict);+ if (privacy) throw new Refused('PRIVATE_BLUEPRINT', `${flag} holds ${privacy}; choose a name that names no one: pullboard blueprint save ${flag} "..."`);+ }const value = {blueprint: BLUEPRINT_FORMAT,name: safeName,- title: cleanTitle && !/[\r\n|]/u.test(cleanTitle) && !loose(cleanTitle) ? cleanTitle : safeName,+ title: safeTitle.trim(),version: 1,...(gate?.trim() && !/[\r\n|]/u.test(gate) && !privateTextReason(gate.trim(), names, parts) ? { gate: gate.trim() } : {}),...(rules.length ? { rules } : {}),diff --git a/src/cli.js b/src/cli.jsindex 402ad1ac..206ffb13 100644--- a/src/cli.js+++ b/src/cli.js@@ -272,6 +272,7 @@ const OPTIONS = {add: { type: 'string' },remove: { type: 'string' },name: { type: 'string' },+ title: { type: 'string' },url: { type: 'string' },skip: { type: 'string' },wait: { type: 'string' },@@ -3491,7 +3492,7 @@ async function runCommand(argv, io) {return 0;}if (command === 'blueprint' && first === 'save') {- if (rest.length) throw new Refused('USAGE', 'pullboard blueprint save [file]');+ if (rest.length) throw new Refused('USAGE', 'pullboard blueprint save [file] [--name <name>] [--title "<title>"]');const ctx = context(io);const { root, commonDir } = ctx.info;const project = ctx.config.project || ctx.config.name || basename(dirname(resolve(root, commonDir)));@@ -3499,7 +3500,7 @@ async function runCommand(argv, io) {if (existsSync(file)) throw new Refused('BLUEPRINT_EXISTS', `${file} already exists; name another file: pullboard blueprint save <file>`);const spec = loadSpec(root, ctx.config);const { names, parts } = withBoard(ctx, (board) => privateNames(root, board, spec));- const { blueprint, left } = saveBlueprint(spec, { name: project, title: project, gate: ctx.config.gate, names, parts });+ const { blueprint, left } = saveBlueprint(spec, { name: values.name, title: values.title, gate: ctx.config.gate, names, parts });writeFileSync(file, `${JSON.stringify(blueprint, null, 2)}\n`, { flag: 'wx' });io.result?.({ file, name: blueprint.name, rules: blueprint.rules?.length ?? 0, questions: blueprint.questions?.length ?? 0, left });io.say(`saved ${blueprint.rules?.length ?? 0} rules and ${blueprint.questions?.length ?? 0} answered questions to ${file}`);diff --git a/src/help.js b/src/help.jsindex cefd1782..7dbc07bf 100644--- a/src/help.js+++ b/src/help.js@@ -151,8 +151,8 @@ SpecDefaults to must and gate review.pullboard blueprint add <name or file> add a blueprint's rules and questions as drafts, and its starter itemsbundled: web-app; nothing is approved, and a repeat adds nothing- pullboard blueprint save [file] write approved rules and answered questions as a blueprint- never items, notes, paths, emails or names; defaults to <project>.blueprint.json+ pullboard blueprint save [file] [--name <name>] [--title "<title>"] write approved rules and answered questions as a blueprint+ never items, notes, paths, emails or names; file defaults to <project>.blueprint.jsonpullboard spec signers add [--key <path>] [--by <principal>] opt into SSH-signed sign-offsprincipal defaults to Git user.email; --by overrides itpullboard spec approve <ids> | decline <ids> --reason "why" the person's exact-row decisiondiff --git a/test/blueprint.test.js b/test/blueprint.test.jsindex dbe884aa..069ab114 100644--- a/test/blueprint.test.js+++ b/test/blueprint.test.js@@ -263,7 +263,9 @@ test('a saved board adds back as the same rows [S1]', () => {assert.ok(!text.includes(secret), `the blueprint never carries ${JSON.stringify(secret)}`);}const blueprint = JSON.parse(text);- assert.deepEqual([blueprint.name, blueprint.title], ['board', 'board'], 'a project named after a person leaves as board');+ assert.deepEqual([blueprint.name, blueprint.title], ['my-blueprint', 'My blueprint'], 'the project name never goes in; a neutral default does');+ const named = box.run(box.repo, 'blueprint', 'save', 'named.json', '--name', 'dana-whitlock', '--json');+ assert.equal(JSON.parse(named.out).error?.code, 'PRIVATE_BLUEPRINT', 'a chosen name that names someone is refused');assert.deepEqual(Object.keys(blueprint).sort(), ['blueprint', 'gate', 'name', 'questions', 'rules', 'title', 'version'], 'only allow-listed fields are written');assert.deepEqual(blueprint.rules.map((rule) => Object.keys(rule).sort()), [['gate', 'key', 'text', 'tier', 'why'], ['gate', 'key', 'text', 'tier', 'why']]);assert.deepEqual(blueprint.questions.map((question) => Object.keys(question).sort()), Array(3).fill(['ask', 'choices', 'default', 'key']));