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(spec): explain inline gate syntax [S1,P4]

Corey Olson21a79a411d2f
diff --git a/src/cli.js b/src/cli.js
index be1e8c61..b29065c8 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -3403,6 +3403,9 @@ async function specCommand(io, { first, second, rest, values }) {
const practice = ctx.doctrine;
const signoffs = readSignoffs(ctx.info.root);
if (first === 'draft') {
+ if (second && /\|\s*gate\s*:/iu.test(second)) {
+ throw new Refused('INLINE_GATE', 'move the gate after the requirement as --gate "<check>"');
+ }
if (!second?.trim() || rest.length || /[\r\n|]/u.test(second)) {
throw new Refused('USAGE', 'give one nonempty, single-line requirement: pullboard spec draft "<text>"');
}
diff --git a/src/next-steps.js b/src/next-steps.js
index 4bc1f143..28c067da 100644
--- a/src/next-steps.js
+++ b/src/next-steps.js
@@ -138,6 +138,7 @@ export const NEXT_STEPS = Object.freeze({
IMPORT_NOT_EMPTY: 'import into a fresh repo whose board is empty: git init <dir> && cd <dir> && pullboard init',
IMPORT_SCHEMA: 'export and import with the same Pullboard version',
IMPORT_VERSION: 'export the board again with this Pullboard version: pullboard export > board.json',
+ INLINE_GATE: 'use the gate as its own flag: pullboard spec draft "<text>" --gate "<check>"',
INTERNAL: 'run the command again; if it repeats, report it with pullboard shout coordinator "<command and output>"',
ITEM_HELD: 'take another item with pullboard next while the coordinator holds this one',
ITEM_NOT_AVAILABLE: 'read the item from this API\'s board state',
diff --git a/test/spec.test.js b/test/spec.test.js
index 4eaa14b6..679d747b 100644
--- a/test/spec.test.js
+++ b/test/spec.test.js
@@ -443,6 +443,15 @@ test('spec draft files a row in the named section [S1,C7]', (t) => {
assert.match(misplaced.stderr, /FLAG_NOT_ALLOWED.*section/u);
});
+test('spec draft with an inline gate names the flag to use [S1,P4]', (t) => {
+ const box = specBox(t, { freshInit: true });
+ const result = box.run('draft', 'A requirement | gate: node --test test/example.test.js');
+ assert.equal(result.status, 1);
+ assert.match(result.stderr, /INLINE_GATE/u);
+ assert.match(result.stderr, /pullboard spec draft "<text>" --gate "<check>"/u);
+ assert.equal(readFileSync(join(box.root, box.specName), 'utf8').includes('A requirement'), false);
+});
+
/** Exercise fresh-init examples, cross-file ID reservation, and fail-closed malformed rows. */
test('spec draft never reuses an existing id [S1,C7]', (t) => {
const fresh = specBox(t, { freshInit: true });