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: align outside intake defaults and lifecycle contracts [V3,M1]

Corey Olsond023c12359cf
diff --git a/docs/formats.md b/docs/formats.md
index e7202383..57d3aa3c 100644
--- a/docs/formats.md
+++ b/docs/formats.md
@@ -113,7 +113,7 @@ The board file is in the repository's Git common directory at `.git/pullboard/bo
| `row grammar` | `1` | `SPEC_GRAMMAR_VERSION` in `src/spec.js`; optional `<!-- pullboard-grammar N -->` line in either file (absence means the current grammar) | Both files share the version. A declared version must match; an incompatible grammar change requires a coordinated version bump and compatible files. No automatic conversion occurs. |
| `board schema` | `3` | `SCHEMA_VERSION` in `src/board.js`, persisted as `PRAGMA user_version` | On a write open of a board whose version is behind: create missing tables and indexes (version 3 adds the hot-path indexes), add missing columns in place with declared defaults, restore missing or changed triggers, and remove stale machine triggers without replacing rows. Read opens never migrate; a board at the current version whose shape differs is reported once on stderr and left as it is. |
| `event log` | `1` | `EVENT_LOG_VERSION` in `src/board.js`, persisted in `board_meta` as `event_log_version` | Older event-log versions upgrade in place; newer versions are refused with `EVENT_LOG_VERSION`. Preserve event rows when the board schema changes. |
-| `move engine` | `94` | `ENGINE_VERSION` in `src/machine.js`, carried as `engine` in every sealed executable move | Bump when a move's meaning changes, independently of the event log and sealed envelope. A newer engine is refused with `ENGINE_VERSION`, naming both versions and asking you to upgrade Pullboard. |
+| `move engine` | `95` | `ENGINE_VERSION` in `src/machine.js`, carried as `engine` in every sealed executable move | Bump when a move's meaning changes, independently of the event log and sealed envelope. A newer engine is refused with `ENGINE_VERSION`, naming both versions and asking you to upgrade Pullboard. |
<!-- format-versions:end -->
A builder never picks an engine number (#1101). An item that adds a board move adds its own `src/<name>-engine.js` leaf as `export const NAME_ENGINE = unassignedEngine();` (importing `unassignedEngine` from `./engine-next.js`); on its branch the leaf reads as one above the highest landed engine. The landing merge writes the next number into the leaf, in landing order, inside that item's merge commit, and sets the `move engine` row above to the highest landed number. A landed number never changes, so recorded moves replay as they were written. Moves are recorded under landed numbers only: code with an unnumbered engine is for its branch's own tests, and a move it records on a real board before landing may later read under another item's number, so the item lands before its moves are used.
diff --git a/src/commands/intake.js b/src/commands/intake.js
index e53041c2..2e64b326 100644
--- a/src/commands/intake.js
+++ b/src/commands/intake.js
@@ -22,7 +22,7 @@ export async function run(io, { first, second, values }) {
return 0;
}
const source = githubSource(ctx.info.root, first);
- const lane = values.lane ?? me.lane ?? Object.keys(ctx.config.lanes)[0];
+ const lane = values.lane ?? (ctx.config.lanes[me.lane] ? me.lane : Object.keys(ctx.config.lanes)[0]);
if (!lane || !ctx.config.lanes[lane]) throw new Refused('NO_LANE', 'choose a configured lane with --lane before intake');
if (source.kind === 'pull-request' && (!values.criterion?.trim() || !values.check?.trim())) throw new Refused('CHECK_REQUIRED', 'intake a pull request with --criterion "behavior" --check "command" from the trusted coordinator checkout');
const item = { lane, title: source.title, criterion: values.criterion ?? '', check: values.check, specIds: [], route: 'strong' };
diff --git a/src/next-step-words.js b/src/next-step-words.js
index b7effbfa..7cf495e6 100644
--- a/src/next-step-words.js
+++ b/src/next-step-words.js
@@ -56,6 +56,7 @@ export function personRequestGuidance(message, { caller, leading = false } = {})
/** @type {Readonly<Record<string, string>>} */
export const NEXT_STEPS = Object.freeze({
+ CHECK_NO_PROOF: 'strengthen the trusted criterion so it fails before the outside change, then ask the coordinator to refreeze it',
OUTSIDE_URL: 'use a GitHub issue or pull request URL with owner/repository and its positive number',
OUTSIDE_FETCH: 'restore read-only gh API and Git fetch access, then intake the exact source again',
OUTSIDE_SOURCE: 'fetch the exact GitHub source metadata and its immutable commit/tree before intake',
diff --git a/test/machine.test.js b/test/machine.test.js
index 8ff76525..9ad9d20f 100644
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@ -446,7 +446,7 @@ test('the declared lifecycle is sound: reachable, no traps, no second door, ever
assert.deepEqual(machineProblems(), []);
assert.deepEqual(MACHINE.states.map((state) => state.id), ['open', 'claimed', 'submitted', 'verified', 'withdrawn']);
assert.deepEqual(MACHINE.states.filter((state) => state.final).map((state) => state.id), ['withdrawn']);
- assert.deepEqual(MACHINE.moves.map((move) => move.verb), ['claim', 'release', 'lapse', 'submit', 'reserve', 'accept', 'reject', 'reopen', 'escalate', 'refreeze', 'refreeze', 'withdraw']);
+ assert.deepEqual(MACHINE.moves.map((move) => move.verb), ['intake', 'claim', 'release', 'lapse', 'submit', 'reserve', 'accept', 'reject', 'reopen', 'escalate', 'refreeze', 'refreeze', 'withdraw']);
});
for (const broken of BROKEN) {
@@ -777,10 +777,11 @@ test('the triggers come from the declaration, so a changed declaration changes t
const moveSql = (machine) => storeTriggers(machine).find(({ name }) => name === 'machine_item_move').sql;
const pairs = MACHINE.moves.flatMap((move) => move.from.filter((from) => from !== move.to).map((from) => `'${from}>${move.to}'`));
for (const pair of pairs) assert.ok(moveSql(MACHINE).includes(pair), `the move trigger allows ${pair}`);
- assert.ok(!moveSql(MACHINE).includes("'open>submitted'"));
+ // Outside intake now legitimately declares open>submitted; claimed>verified still cannot bypass a submitted review.
+ assert.ok(!moveSql(MACHINE).includes("'claimed>verified'"));
const machine = copy();
- machine.moves.push({ verb: 'land', from: ['open'], to: 'submitted', by: ['coordinator'], refuse: 'CLOSED', guards: ['joined', 'coordinatorOnly', 'itemExists', IN_STATE], sets: ['item_built_by', 'item_commit', 'item_frozen_digest'] });
- assert.ok(moveSql(machine).includes("'open>submitted'"));
+ machine.moves.push({ verb: 'testDirectVerdict', from: ['claimed'], to: 'verified', by: ['coordinator'], refuse: 'CLOSED', guards: ['joined', 'coordinatorOnly', 'itemExists', IN_STATE], sets: ['item_built_by', 'item_commit', 'item_frozen_digest'] });
+ assert.ok(moveSql(machine).includes("'claimed>verified'"));
const names = storeTriggers().map(({ name }) => name);
for (const state of MACHINE.states.filter((entry) => entry.requires.length)) assert.ok(names.includes(`machine_fields_${state.id}`), `${state.id} has a fields trigger`);
assert.ok(names.includes('machine_proof_verified'));
@@ -1287,7 +1288,7 @@ test('the lifecycle page and the help show the reservation: reserve, and reviewF
assert.match(page, /^\| reserve \| submitted \| submitted \| agent, coordinator \| .*reviewFree \(REVIEW_HELD\) \|$/m);
for (const verb of ['accept', 'reject']) assert.match(page, new RegExp(`^\\| ${verb} \\| submitted, verified \\| .*policyAllows \\(COORDINATOR_VERIFIES\\), familyAllows \\(O2_FAMILY_MATCH\\), reviewFree \\(REVIEW_HELD\\), criterionUnchanged`, 'm'));
assert.match(page, /^\| REVIEW_HELD \| no other agent holds its review under a live lease \| pullboard next --verify/m);
- assert.match(HELP.all, /^ {2}agent +claim, release, submit, reserve, accept, reject, escalate, refreeze \(when a live claim has a pending coordinator correction\)$/m);
+ assert.match(HELP.all, /^ {2}agent +intake, claim, release, submit, reserve, accept, reject, escalate, refreeze \(when a live claim has a pending coordinator correction\)$/m);
assert.match(HELP.all, /pullboard next --verify +reserve the next submitted item you can check/);
});