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.

Merge branch 'main' into core/408-claude

Corey Olson2d2056d8e3d7
diff --cc docs/formats.md
index a6d54de4,911a951c..1bf812f9
--- a/docs/formats.md
+++ b/docs/formats.md
@@@ -112,8 -112,8 +112,8 @@@ The board file is in the repository's G
| `CLI JSON envelope` | `1` | `JSON_SHAPES.version` in `src/json.js` | Keep optional fields additive within version 1; bump the envelope version for incompatible command/export shapes. |
| `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. |
+| `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`. A signed board uses event-log format 2; older tools refuse it. Preserve event rows when the board schema changes. |
- | `move engine` | `107` | `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` | `109` | `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 --cc relay/browser-client.js
index a5dc10d8,8e729385..721e4549
--- a/relay/browser-client.js
+++ b/relay/browser-client.js
@@@ -24,38 -6,14 +24,39 @@@ import
import { ENGINE_VERSION } from './engine.js';
import { Refused } from './refused.js';
import { SNAPSHOT_BODY_BYTES } from './relay-limits.js';
-import { enqueueStream, followStream } from './browser-stream.js';
-import { emptyBoardStep, homeLineDismissed, homeScreenLine, noticeLines, rememberOwnedRequestId, showRelayScreen, storedOwnedRequestState } from './browser-notice.js';
-import { registerApp, requestPairingPersistence } from './install.js';
-import { browserJSON, withBrowserDeadline } from './browser-deadline.js';
-import { phoneApprovalStatus, placePhoneApprovals, forgetPhoneApprovals } from './browser-approval-card.js';
+import {
+ enqueueStream,
+ followStream,
+} from './browser-stream.js';
+import {
+ emptyBoardStep,
+ homeLineDismissed,
+ homeScreenLine,
+ noticeLines,
+ rememberOwnedRequestId,
+ showRelayScreen,
+ storedOwnedRequestState,
+} from './browser-notice.js';
+import {
+ registerApp,
+ requestPairingPersistence,
+} from './install.js';
+import {
+ browserJSON,
+ withBrowserDeadline,
+} from './browser-deadline.js';
+import {
+ phoneApprovalStatus,
+ placePhoneApprovals,
+ forgetPhoneApprovals,
+} from './browser-approval-card.js';
import { phoneSnapshotPages } from './browser-pages.js';
import { createPhoneHistory } from './browser-history.js';
+import {
+ installPersonPasskeys,
+ passkeyPresence,
+} from './browser-passkeys.js';
+ import { readUploadSize } from './browser-upload-status.js';
import { deviceExcludedBoards } from './browser-devices.js';
const CHECKPOINT_WAIT_MS = 15_000;
diff --cc relay/service.js
index 4eaa7e02,631fd1e2..96fcfe86
--- a/relay/service.js
+++ b/relay/service.js
@@@ -25,16 -13,10 +25,17 @@@ import { createPairingStore } from './p
import { createPairingHandler } from './pairing-http.js';
import { createRelayBrowserHandler } from './browser-page.js';
import { VERIFIER_STANDING_ENGINE } from '../src/machine.js';
-import { SEALED_SNAPSHOT_BYTES, SNAPSHOT_BODY_BYTES } from '../src/relay-limits.js';
-import { createRelayPagesHandler, snapshotPageRoot } from './pages-http.js';
+import {
+ SEALED_SNAPSHOT_BYTES,
+ SNAPSHOT_BODY_BYTES,
+} from '../src/relay-limits.js';
+import {
+ createRelayPagesHandler,
+ snapshotPageRoot,
+} from './pages-http.js';
import { createStorageQuota } from './storage-quota.js';
+import { createPasskeyHandler } from './passkey-http.js';
+ import { createUploadStatusHandler } from './upload-status.js';
const SNAPSHOT_BODY = SNAPSHOT_BODY_BYTES;
const STORED_BYTES = SEALED_SNAPSHOT_BYTES;
@@@ -373,9 -341,10 +374,11 @@@ export function createRelayHandler({ di
request: async (board, body, who) => (await append(board, body, who, 'request')).body,
}, { pollMs });
+ const uploadStatus = createUploadStatusHandler({ authorize: authorizedRequest, withJournal, sender });
+
/** Add authenticated snapshot replacement and deletion to the common versioned read/move paths. */
async function handle(req, res) {
+ if (await passkeys(req, res)) return;
if (await pagesHandler(req, res)) return;
if (await deviceHandler(req, res)) return;
if (await pairing(req, res)) return;
diff --cc src/api-moves.js
index 58b36741,6b397f10..67ba42fb
--- a/src/api-moves.js
+++ b/src/api-moves.js
@@@ -9,12 -9,9 +9,12 @@@ const MOVES =
'sentinel-decline': { prefix: ['sentinel', 'decline'], positions: ['name'], flags: ['digest', 'reason'] },
'spec-answer': { prefix: ['spec', 'answer'], positions: ['row', 'answer'] },
'check-accept': { prefix: ['check', 'accept'], item: true },
- add: { positions: ['lane', 'title'], flags: ['criterion', 'specs', 'parent', 'after', 'brief', 'route', 'check'], booleans: ['wait'], booleans: ['wait'] },
- edit: { item: true, flags: ['criterion', 'brief', 'route', 'check', 'reason'], booleans: ['wait'], booleans: ['wait'] },
- fact: { item: true, positions: ['kind', 'text'], flags: ['answers', 'supersedes', 'ref', 'implies'] },
+ 'land-waive': { prefix: ['land'], flags: ['waive', 'until', 'reason'] },
+ 'bar-sign': { prefix: ['bar', 'sign'], item: true, flags: ['note'] },
+ signing: { prefix: ['settings', 'person.signed'], positions: ['signed'] },
+ add: { positions: ['lane', 'title'], flags: ['criterion', 'specs', 'parent', 'after', 'brief', 'route', 'check', 'as'], booleans: ['wait'] },
+ edit: { item: true, flags: ['criterion', 'brief', 'route', 'check', 'reason', 'after', 'as'], booleans: ['wait'] },
- fact: { item: true, positions: ['kind', 'text'], flags: ['supersedes', 'ref', 'implies', 'as', 'cause'], booleans: ['never-again'] },
++ fact: { item: true, positions: ['kind', 'text'], flags: ['answers', 'supersedes', 'ref', 'implies', 'as', 'cause'], booleans: ['never-again'] },
claim: { item: true },
release: { item: true, flags: ['note'] },
submit: { item: true },
diff --cc src/commands/spec.js
index c7c9797c,189f4a87..0aed58a8
--- a/src/commands/spec.js
+++ b/src/commands/spec.js
@@@ -1,6 -1,9 +1,10 @@@
/** The pullboard spec command, in its own module so an item adding another command never edits these lines. */
+import { verifiedPasskeyRowDecision } from '../person-signing.js';
import { planAutomaticRigorApply } from '../rigor-auto-apply.js';
+ import {
+ planSpecRevision,
+ prepareSpecRevisionDecisions,
+ } from '../spec-revisions.js';
import {
fitCommand,
} from '../blueprint-fit-command.js';
@@@ -201,33 -207,25 +218,44 @@@ export async function specCommand(io,
return 0;
}
if (first === 'approve' || first === 'decline') {
- requirePersonChannel(io.personChannel);
return withBoard(ctx, async (board) => {
const me = whoAmI(ctx, board);
- if (!ctx.info.isMain || me.id !== COORDINATOR) throw new Refused('B26_PERSON_APPROVAL', 'only the person from the main checkout approves or declines rows; use pullboard view for the person to decide');
const ids = [second, ...rest].filter(Boolean).flatMap((text) => text.split(/[\s,]+/u)).filter(Boolean);
+ // With signed person moves on, the decision goes to the person's passkey; a named SSH signer has no passkey yet [E22].
+ const shown = [...spec.rows, ...(practice.rows ?? []).map(row => ({ ...row, id: `doctrine:${row.id}` }))].filter(row => ids.includes(row.id));
+ if (personSigning(board).signed) {
+ refuseNamedSigners(shown, ids);
+ if (values.by !== undefined && values.by !== 'person') throw new Refused('PERSON_SIGNER_REQUIRED', `the requested SSH signer ${values.by} has no passkey identity`, 'confirm as the person without --by, or wait until signing is off');
+ }
+ // The rows are read only when a passkey request is built, so an unpaired board refuses before reading them.
+ const confirmed = await requireSignedPerson(ctx, board, me, { verb: `spec-${first}`, args: { ids: ids.join(','),
+ ...(values.text === undefined ? {} : { text: values.text }), ...(values.reason === undefined ? {} : { reason: values.reason }) } },
+ () => shownDecisionRows(ctx.info.root, ctx.config, ids));
+ if (confirmed !== null) return confirmed;
+ const sources = shownDecisionRows(ctx.info.root, ctx.config, ids);
+ requirePersonChannel(io.personChannel);
+ if (!ctx.info.isMain || me.id !== COORDINATOR) throw new Refused('B26_PERSON_APPROVAL', 'only the person from the main checkout approves or declines rows; use pullboard view for the person to decide');
+ if (personSigning(board).signed) {
+ const decidable = [...spec.rows, ...(practice.rows ?? []).map((row) => ({ ...row, id: `doctrine:${row.id}` }))];
+ refuseNamedSigners(decidable, ids);
+ requireShownRows(board, io.personRequest, decidable, ids, sources);
+ }
+ const drafts = store.rowDrafts(board);
+ const revisionIds = ids.filter(id => drafts.some(draft => draft.id === id && draft.revises));
+ if (revisionIds.length) {
+ if (revisionIds.length !== ids.length || values.text !== undefined) throw new Refused('SPEC_REVISION', 'decide exact revision proposals separately; draft a new proposal to change its text');
+ const records = prepareSpecRevisionDecisions(ctx.info.root, ctx.config, drafts, { ids, decision: first,
+ reason: values.reason, by: values.by, on: new Date().toISOString(), commit: headCommit(ctx.info.root) ?? '' });
+ const decisions = await ordered(ctx, board, 'decideSpecRevisions', [{ agentId: store.PERSON, channel: io.personChannel ?? 'terminal', decisions: records }]);
+ io.result?.({ decisions });
+ revisionIds.forEach(id => io.say(`${id}: ${first === 'approve' ? 'approved, pending apply' : 'declined; approved row unchanged'}`));
+ return 0;
+ }
// An approve keeps a pending answer: plain, it approves the answered text; --text says what it replaces.
+ const signedDecision = personSigning(board).signed;
const kept = first === 'approve' ? pendingAnswers(ctx.info.root, ctx.config, ids, store.rowDecisions(board)) : new Map();
- const decide = { decision: first, reason: values.reason, by: values.by, on: new Date().toISOString(), commit: headCommit(ctx.info.root) ?? '' };
+ if (signedDecision && values.text === undefined && kept.size) throw new Refused('STALE_ROW_DECISION', 'this row has a pending answer different from the original shown source', 'approve one row with --text containing the exact pending answer you want your passkey to confirm');
+ const decide = { decision: first, reason: values.reason, by: signedDecision ? 'person' : values.by, sshSign: !signedDecision, passkeyRequest: signedDecision ? io.personRequest?.id : undefined, on: new Date().toISOString(), commit: headCommit(ctx.info.root) ?? '' };
const records = values.text === undefined && kept.size ? ids.flatMap((id) => prepareRowDecisions(ctx.info.root, ctx.config, { ...decide, ids: [id], text: kept.get(id)?.text }))
: prepareRowDecisions(ctx.info.root, ctx.config, { ...decide, ids, text: values.text });
const decisions = await ordered(ctx, board, 'recordRowDecisions', [{ agentId: store.PERSON, channel: io.personChannel ?? 'terminal', decisions: records }]);
diff --cc src/help.js
index 8ad5c574,93f31957..07393072
--- a/src/help.js
+++ b/src/help.js
@@@ -40,7 -40,7 +40,8 @@@ Set u
release priority is opt-in: gate.queue.currentReleaseFirst (default false), within each board's otherwise-tied positions
memory hold is opt-in: gate.memoryFloorMB in ~/.pullboard/settings.json holds the queue under that many MB free or critical pressure (default off)
short slots for runs that name their test files are opt-in: pullboard settings gate.shortSlots <n> (default 0)
+ signed person moves are opt-in: pullboard settings person.signed on makes each wait for your passkey; only the passkey turns it off
+ runner-first dispatch is opt-in: pullboard settings gate.runnersFirst on|off (default off)
pullboard runner add <ssh-host> --slots <n> --browser <n> [--node <remote-path>] [--root <remote-path>]
register SSH test capacity; no runner sign-in; root defaults to ~/.pullboard-runner
pullboard runner list each runner's registered slots and browsers, which it runs at
diff --cc src/relay-outbox.js
index c75d0422,c1c65150..e9aa2022
--- a/src/relay-outbox.js
+++ b/src/relay-outbox.js
@@@ -172,10 -172,10 +172,10 @@@ export const ITEM_SLOTS = Object.freeze
recordPublishFinding: [[0, 'item']],
register: [], ensureCoordinator: [], shout: [], passDecision: [], holdLane: [], releaseLane: [],
moveMilestone: [], editMilestone: [], removeMilestone: [], shipMilestone: [],
- recordRowDecisions: [], applyRowDecisions: [], draftSpecRow: [], recordSpecApprovalBaseline: [],
+ recordRowDecisions: [], decideSpecRevisions: [], applyRowDecisions: [], draftSpecRow: [], recordSpecApprovalBaseline: [],
recordLandingBatch: [], recordLandingWaiver: [], recordLandingFlake: [], recordLandingTestDefect: [], finishLandingBatch: [],
recordHealthFindings: [], decideSentinel: [], beginSentinelRun: [], finishSentinelRun: [],
- recordFlakeObservation: [], recordGateRun: [], declareJob: [], recordJobRun: [], takeCoordinator: [], openHandoff: [], landingLeaseMove: [],
+ recordFlakeObservation: [], recordGateRun: [], declareJob: [], recordJobRun: [], takeCoordinator: [], openHandoff: [], landingLeaseMove: [], setPersonSigning: [], proposePersonMove: [],
...Object.fromEntries(FIRST_ITEM.map((operation) => [operation, [[0]]])),
intakeOutside: [[0, 'item', 'parentId'], [0, 'item', 'after', '*']],
addItem: [[0, 'parentId'], [0, 'after', '*']],
diff --cc src/relay-requests.js
index 6c8d29ad,da9df6c0..6f7e1680
--- a/src/relay-requests.js
+++ b/src/relay-requests.js
@@@ -186,24 -132,13 +186,24 @@@ function fulfilsIntent(record, move, bo
&& (value.reason ?? '') === (decline ? args.reason.trim() : '')
&& Object.keys(value).every(key => ['agentId', 'channel', 'name', 'digest', 'decision', 'reason'].includes(key));
}
+ // Signed person moves [E22]: the waiver and the signing switch carry exactly the request's values, and its id.
+ if (intent.verb === 'land-waive') return value?.agentId === 'person' && value.channel === 'view' && value.test === args.waive
+ && value.until === args.until && value.reason === args.reason;
+ if (intent.verb === 'signing') return value?.signed === (args.signed === 'on') && (args.signed === 'on' || value.agentId === 'person' && value.request === record.id);
const rows = value?.decisions;
+ if (!['spec-approve', 'spec-decline', 'spec-answer'].includes(intent.verb) || typeof args.ids !== 'string') return false;
const ids = args.ids.split(/[\s,]+/u).filter(Boolean);
+ const requiresShown = personSigning(board, { strict: false }).signed || Array.isArray(rows) && rows.some(row => row.passkeyRequest !== undefined);
+ let shown;
+ try { shown = JSON.parse(record.encoded).rows; } catch { return false; }
+ if (requiresShown && (!Array.isArray(shown) || shown.length !== ids.length)) return false;
return value?.agentId === 'person' && value.channel === 'view' && Array.isArray(rows) && rows.length === ids.length
- && rows.every((row, index) => (row.kind === 'doctrine' ? 'doctrine:' : '') + row.id === ids[index]
+ && rows.every((row, index) => (move.operation === 'decideSpecRevisions' ? row.revision?.proposal : (row.kind === 'doctrine' ? 'doctrine:' : '') + row.id) === ids[index]
&& row.decision === (intent.verb === 'spec-approve' ? 'approve' : 'decline')
&& (intent.verb !== 'spec-decline' || row.reason === args.reason.trim())
- && (args.text === undefined || row.text === args.text.trim()));
+ && (args.text === undefined ? !requiresShown || row.text === shown.find(entry => entry.id === ids[index])?.text : row.text === args.text.trim())
+ && (!requiresShown || row.by === 'person' && row.signature === undefined))
+ && (!requiresShown || signedRowDecisionsMatch(record, rows));
}
/** The item ids a request's `implies` text names, parsed as `--implies` is, or null when it names none validly. */
@@@ -261,8 -196,9 +261,9 @@@ export function requestMoveProblem(boar
const actor = relayMoveActor(move);
if (!['coordinator', 'person'].includes(actor)) return new Refused('PERSON_REQUEST_RECEIPT', 'only the coordinator fulfils an authenticated person request');
if (tag.phase === 'execute') {
- const expected = { add: 'addItem', shout: 'shout', answer: 'answerDecision', hold: record.move.args.off ? 'releaseLane' : 'holdLane', 'spec-approve': 'recordRowDecisions', 'spec-decline': 'recordRowDecisions', 'sentinel-approve': 'decideSentinel', 'sentinel-decline': 'decideSentinel' }[record.move.verb];
+ const expected = { add: 'addItem', shout: 'shout', answer: 'answerDecision', hold: record.move.args.off ? 'releaseLane' : 'holdLane', 'spec-approve': 'recordRowDecisions', 'spec-decline': 'recordRowDecisions', 'spec-answer': 'recordRowDecisions', fact: 'appendFact', 'sentinel-approve': 'decideSentinel', 'sentinel-decline': 'decideSentinel', 'land-waive': 'recordLandingWaiver', signing: 'setPersonSigning', edit: 'editItem', 'bar-sign': 'signBar' }[record.move.verb];
- if (move.operation !== expected || !fulfilsIntent(record, move, board)) return new Refused('PERSON_REQUEST_RECEIPT', 'the ordinary move does not fulfil this request; execute its original CLI intent');
+ const revision = ['spec-approve', 'spec-decline'].includes(record.move.verb) && move.operation === 'decideSpecRevisions';
- if ((!revision && move.operation !== expected) || !fulfilsIntent(record, move)) return new Refused('PERSON_REQUEST_RECEIPT', 'the ordinary move does not fulfil this request; execute its original CLI intent');
++ if ((!revision && move.operation !== expected) || !fulfilsIntent(record, move, board)) return new Refused('PERSON_REQUEST_RECEIPT', 'the ordinary move does not fulfil this request; execute its original CLI intent');
}
if (move.engine >= 6 && ['claim', 'repo-request', 'refuse'].includes(tag.phase) && !fulfilsStage(record, move, tag)) return new Refused('PERSON_REQUEST_RECEIPT', 'publish only the exact stage for this authenticated phone request');
if (['claim', 'repo-request', 'refuse'].includes(tag.phase) && !(move.operation === 'shout' && move.args[0]?.from === 'person' && move.args[0]?.to === 'coordinator'
diff --cc src/relay-sender.js
index f790e37b,2f69d18c..07e44484
--- a/src/relay-sender.js
+++ b/src/relay-sender.js
@@@ -35,8 -32,8 +35,8 @@@ function personBarMove(move)
* person fact or request, or any move whose actor is the person. On a board that names approvers, only an approver's
* session makes one [E4].
*/
-function personAuthority(move) {
- return personBarMove(move) || personFact(move) || ['recordRowDecisions', 'decideSpecRevisions', 'decideSentinel'].includes(move?.operation) || move?.operation === 'answerDecision' && Boolean(move.args?.[1]?.asPerson) ||
+export function personAuthority(move) {
- return personBarMove(move) || personFact(move) || ['holdLane', 'releaseLane'].includes(move?.operation) && Boolean(move.args?.[1]?.asPerson) || ['recordRowDecisions', 'decideSentinel'].includes(move?.operation) || move?.operation === 'answerDecision' && Boolean(move.args?.[1]?.asPerson) ||
++ return personBarMove(move) || personFact(move) || ['holdLane', 'releaseLane'].includes(move?.operation) && Boolean(move.args?.[1]?.asPerson) || ['recordRowDecisions', 'decideSpecRevisions', 'decideSentinel'].includes(move?.operation) || move?.operation === 'answerDecision' && Boolean(move.args?.[1]?.asPerson) ||
move?.operation === 'shout' && Boolean(move.args?.[0]?.request) || relayMoveActor(move) === 'person';
}
diff --cc test/relay-client-fixture.js
index f2c45efc,bac7af33..5e087909
--- a/test/relay-client-fixture.js
+++ b/test/relay-client-fixture.js
@@@ -3,30 -3,13 +3,30 @@@ import { AGENT_SHELL_MARKERS, SSH_SHELL
/** Private real CLI, auth and relay fixture; credentials never enter assertion messages [H1,H7,H18]. */
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
-import { startFixtureChild as spawn, reportFixtureChildFailure, runFixtureChild } from './fixture-child.js';
+import {
+ startFixtureChild as spawn,
+ reportFixtureChildFailure,
+ runFixtureChild,
+} from './fixture-child.js';
import { performance } from 'node:perf_hooks';
import { createServer } from 'node:http';
- import { Transform } from 'node:stream';
+ import { Readable, Transform } from 'node:stream';
import { once } from 'node:events';
-import { existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
-import { delimiter, join, resolve } from 'node:path';
+import {
+ existsSync,
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ realpathSync,
+ rmSync,
+ symlinkSync,
+ writeFileSync,
+} from 'node:fs';
+import {
+ delimiter,
+ join,
+ resolve,
+} from 'node:path';
import { tmpdir } from 'node:os';
import { pathToFileURL } from 'node:url';
import { createAuthHandler } from '../relay/auth-http.js';