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 Olsonb0c4ee71fde2
diff --cc docs/formats.md
index f84629b5,78dd9d90..bcbe5ac7
--- 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` | `96` | `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` | `105` | `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 docs/formats.test.js
index 2311dbe9,724120c2..c9aa51f5
--- a/docs/formats.test.js
+++ b/docs/formats.test.js
@@@ -1,21 -2,12 +2,22 @@@
/** Keep the format guide aligned with parser behavior, live SQLite schema and static export [A5,A10]. */
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
-import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
+import {
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ readdirSync,
+ rmSync,
+ writeFileSync,
+} from 'node:fs';
import { tmpdir } from 'node:os';
-import { join, relative } from 'node:path';
+import {
+ join,
+ relative,
+} from 'node:path';
import { DatabaseSync } from 'node:sqlite';
import { test } from 'node:test';
+ import { fileURLToPath, pathToFileURL } from 'node:url';
import { submitFixture } from '../test/board-submit-fixture.js';
import { syntheticFlakeObservation } from '../test/flake-observation-fixture.js';
import { recordFlakeObservation } from '../src/board.js';
diff --cc src/board.js
index 97cfda7c,5d6f989c..50166837
--- a/src/board.js
+++ b/src/board.js
@@@ -205,57 -262,16 +271,52 @@@ import
NATIVE_FLAKE_ENGINE,
carriesFlakeDiagnostics,
} from './flake-engine.js';
- import { preserveInvariantEvidence } from './submit-invariants.js';
- import { validateLandingBatch } from './submit-invariants.js';
- import { validateLandingRevision } from './submit-invariants.js';
- import { submissionProof } from './submit-invariants.js';
- import { SUBMISSION_PROOF_ENGINE } from './submit-invariants.js';
export { landingFlakes, landingWaiverCovers, landingWaiverKind };
-export { landingWaivers, landingWaiverFor, waivedLandingProof } from './landing-waivers.js';
+export {
+ landingWaivers,
+ landingWaiverFor,
+ waivedLandingProof,
+} from './landing-waivers.js';
export { acceptCheck } from './check-accept.js';
-export { declareJob, recordJobRun } from './recurring-jobs.js';
-export { proposeSentinel, decideSentinel, beginSentinelRun, finishSentinelRun } from './sentinels.js';
-export { flakeLedger, recordFlakeObservation } from './flakes.js';
-export { flakeQuarantines, gateRuns, recordGateRun } from './quarantine.js';
+export {
+ declareJob,
+ recordJobRun,
+} from './recurring-jobs.js';
+export {
+ proposeSentinel,
+ decideSentinel,
+ beginSentinelRun,
+ finishSentinelRun,
+} from './sentinels.js';
+export {
+ flakeLedger,
+ recordFlakeObservation,
+} from './flakes.js';
+export {
+ flakeQuarantines,
+ gateRuns,
+ recordGateRun,
+} from './quarantine.js';
+export {
+ personProposals,
+ personSigning,
+ proposePersonMove,
+ setPersonSigning,
+} from './person-signing.js'; // Signed person moves [E22].
export { recordPublishFinding } from './pr-findings.js';
/** The seat readers live in seats.js; the board re-exports them so `store.*` callers keep one import. */
-export { agentAt, agentById, agentCreator, coordinatorHolder, listAgents, nextSeatId, seatEnrolled, seatLineage, takeCoordinator, withVerifierStanding } from './seats.js';
+export {
+ agentAt,
+ agentById,
+ agentCreator,
+ coordinatorHolder,
+ listAgents,
+ nextSeatId,
+ seatEnrolled,
+ seatLineage,
+ takeCoordinator,
+ withVerifierStanding,
+} from './seats.js';
export const ACCEPT_REASON = 'CRITERION_MET';
export { PERSON } from './board-query.js';
@@@ -2246,41 -2198,12 +2244,29 @@@ export function releaseItemHold(board,
});
}
- /** Read named milestones from board metadata; older boards simply have none. */
- export function milestones(board) {
- const row = board.db.prepare('SELECT meta_value FROM board_meta WHERE meta_key = ?').get('milestones');
- if (!row) return [];
- try {
- const value = JSON.parse(row.meta_value);
- if (!Array.isArray(value)) throw new Error('not an array');
- return value;
- } catch {
- throw new Refused('MILESTONES_CORRUPT', 'the stored roadmap is unreadable; restore board metadata from a known-good board export');
- }
- }
// A lane agent's drafted rows live in row-drafts.js (#878); exported here so the engine dispatches them.
-export { draftSpecRow, rowDrafts } from './row-drafts.js';
-export { recordSpecApprovalBaseline, specApprovalBaseline, specApprovalBaselineExists } from './spec-approval-baseline.js';
+export {
+ draftSpecRow,
+ rowDrafts,
+} from './row-drafts.js';
+export {
+ recordSpecApprovalBaseline,
+ specApprovalBaseline,
+ specApprovalBaselineExists,
+} from './spec-approval-baseline.js';
// The roadmap's moves live in milestones.js; the board keeps exporting them so the engine replays them.
-export { addMilestone, canonicalMilestoneTarget, editMilestone, editMilestoneItems, orderMilestoneItems, moveMilestone, removeMilestone, roadmap, shipMilestone } from './milestones.js';
+export {
+ addMilestone,
+ canonicalMilestoneTarget,
+ editMilestone,
+ editMilestoneItems,
+ orderMilestoneItems,
+ moveMilestone,
+ removeMilestone,
+ roadmap,
+ shipMilestone,
+} from './milestones.js';
export { rowDecisions } from './board-query.js';
@@@ -2344,31 -2267,8 +2330,15 @@@ export function applyRowDecisions(board
});
}
- /**
- * The newest unread shouts, without marking them read: `resume` shows them, `inbox` reads them.
- *
- * @param {any} board
- * @param {string} agentId
- * @param {number} [limit]
- * @returns {any[]}
- */
- export function peekShouts(board, agentId, limit = 2) {
- const agent = board.db.prepare('SELECT * FROM agent WHERE agent_id = ?').get(agentId);
- if (!agent) return [];
- return board.db
- .prepare(`SELECT * ${UNREAD_SQL} ORDER BY shout_id DESC LIMIT ?`)
- .all(...unreadShoutBindings(agent.agent_last_shout_id, agentId, agent.agent_lane), limit)
- .reverse();
- }
-export { recentShouts, eventsOfKinds, recentEvents, lastMoves, decisionAndEvidenceShouts, submitInvariantEvents } from './board-hot.js';
+export {
+ recentShouts,
+ eventsOfKinds,
+ recentEvents,
+ lastMoves,
+ decisionAndEvidenceShouts,
+ submitInvariantEvents,
+} from './board-hot.js';
export { stats } from './board-stats.js';
diff --cc src/commands/spec.js
index 8b69c705,5a1de7c6..2a5eaa7f
--- a/src/commands/spec.js
+++ b/src/commands/spec.js
@@@ -1,5 -1,5 +1,6 @@@
/** 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 {
fitCommand,
} from '../blueprint-fit-command.js';
diff --cc src/engine.js
index 07f9be73,aa95197c..7641abf6
--- a/src/engine.js
+++ b/src/engine.js
@@@ -73,10 -85,11 +86,13 @@@ import { requireCoordinatorHold } from
import { LANDING_ENVIRONMENT_ENGINE } from './landing-environment-engine.js';
import { carriesLandingEnvironment } from './execution-environment.js';
import { LANDING_LEASE_ENGINE } from './landing-lease-engine.js';
+ import { LINE_ORDER_ENGINE } from './line-order-engine.js';
+ import { LINE_SETTINGS_ENGINE } from './line-settings-engine.js';
+ import { LAND_COLLISION_ENGINE } from './landing-collision-engine.js';
import { PR_BRIDGE_ENGINE } from './pr-bridge-engine.js';
import { LANDING_LOCAL_LEASE_ENGINE } from './landing-local-lease-engine.js';
+import { PERSON_SIGNING_ENGINE } from './person-signing-engine.js';
+import { signedMoveProblem } from './person-signing.js';
const ITEM_ID_FIRST_ARGUMENT = new Set(['signBar', 'acceptCheck', 'editItem', 'escalate', 'recordAttempt', 'claim', 'release', 'submit', 'reserveReview', 'verify', 'merged', 'withdraw', 'refreeze', 'reopen', 'appendFact']);
@@@ -89,14 -102,13 +105,14 @@@ export const ENGINE_OPERATIONS = Object
'recordRowDecisions', 'applyRowDecisions', 'draftSpecRow', 'appendFact', 'recordSpecApprovalBaseline',
'recordLandingBatch', 'recordLandingWaiver', 'recordLandingFlake', 'recordLandingTestDefect', 'finishLandingBatch', 'acceptCheck',
'recordHealthFindings', 'proposeSentinel', 'decideSentinel', 'beginSentinelRun', 'finishSentinelRun',
- 'recordFlakeObservation', 'recordGateRun', 'declareJob', 'recordJobRun', 'takeCoordinator', 'landingLeaseMove', 'setPersonSigning', 'proposePersonMove',
- 'setLineSetting', 'recordFlakeObservation', 'recordGateRun', 'declareJob', 'recordJobRun', 'takeCoordinator', 'landingLeaseMove',
++ 'setLineSetting', 'recordFlakeObservation', 'recordGateRun', 'declareJob', 'recordJobRun', 'takeCoordinator', 'landingLeaseMove', 'setPersonSigning', 'proposePersonMove',
'recordPublishFinding',
]);
/** Engine version at which each ordered operation first has stable replay semantics. */
- const OPERATION_ENGINE = Object.freeze({ draftSpecRow: ROW_DRAFT_ENGINE, orderMilestoneItems: MILESTONE_RANK_ENGINE, reopen: 8, recordLandingBatch: 8, recordLandingWaiver: 8, recordLandingFlake: 8, finishLandingBatch: 8, acceptCheck: CHECK_ACCEPT_ENGINE,
+ const OPERATION_ENGINE = Object.freeze({ setLineSetting: LINE_SETTINGS_ENGINE, draftSpecRow: ROW_DRAFT_ENGINE, orderMilestoneItems: MILESTONE_RANK_ENGINE, reopen: 8, recordLandingBatch: 8, recordLandingWaiver: 8, recordLandingFlake: 8, finishLandingBatch: 8, acceptCheck: CHECK_ACCEPT_ENGINE,
- shipMilestone: MILESTONE_SHIP_ENGINE, recordSpecApprovalBaseline: SPEC_APPROVAL_ENGINE, takeCoordinator: COORDINATOR_HOLD_ENGINE });
+ shipMilestone: MILESTONE_SHIP_ENGINE, recordSpecApprovalBaseline: SPEC_APPROVAL_ENGINE, takeCoordinator: COORDINATOR_HOLD_ENGINE,
+ setPersonSigning: PERSON_SIGNING_ENGINE, proposePersonMove: PERSON_SIGNING_ENGINE });
/** Dependency edits, causes, sealed reviews, submission proofs, trunk conflicts, health observations and milestone targets retain distinct recorded engine meanings. */
function minimumOperationEngine(operation, args, board, at) {
@@@ -341,9 -375,9 +379,11 @@@ function registrationProblem(board, mov
export function applyRelayMove(board, move, { sequence, at, sender, kind, digest = null, registration }) {
requireSupportedEngine(move);
const phoneReceipt = sender?.kind === 'machine' && move?.engine >= 6 && Boolean(move.personRequest) && !requestMoveProblem(board, move, { checkExecutorLease: false });
- const problem = relaySenderProblem(move, sender, kind, { phoneReceipt }) ?? (kind === 'move' ? registrationProblem(board, move, { sender, registration, sequence, digest }) : null)
+ const problem = relaySenderProblem(move, sender, kind, { phoneReceipt })
+ ?? (kind === 'move' ? handoffMoveProblem(board, relayMoveActor(move), move.operation, move.args) : null)
- ?? (kind === 'move' ? registrationProblem(board, move, { sender, registration, sequence, digest }) : null);
++ ?? (kind === 'move' ? registrationProblem(board, move, { sender, registration, sequence, digest }) : null)
+ // With signing on, a person-only move counts only when it carries out a passkey-confirmed request [E22].
+ ?? (kind === 'move' ? signedMoveProblem(board, personAuthority(move), phoneReceipt ? move.personRequest : null) : null);
if (!problem) {
// Engine-48 relay moves run under linked verifier standing; older recorded moves replay as they did.
// The person is above every seat; their own moves act with the coordinator's standing.
diff --cc src/next-step-words.js
index 3717b372,71d97a8f..d8b9fd55
--- a/src/next-step-words.js
+++ b/src/next-step-words.js
@@@ -56,17 -56,27 +56,38 @@@ export function personRequestGuidance(m
/** @type {Readonly<Record<string, string>>} */
export const NEXT_STEPS = Object.freeze({
+ PASSKEY_ASSERTION: 'confirm the move again on your passkey from the relay view',
+ PASSKEY_PRESENCE: 'confirm the move again with Face ID, Touch ID or a key touch',
+ PASSKEY_REGISTRATION: 'add the passkey again from the relay view on this phone or browser',
+ PASSKEY_REQUIRED: 'add a passkey in the relay view on your phone or browser, then confirm the move',
+ PERSON_AUTHORITY: 'upgrade the relay so it publishes its passkey stamp key, then retry',
+ PERSON_AUTHORITY_CHANGED: 'check which relay this board belongs to; link it to the relay it pinned',
+ PERSON_PROPOSAL: 'start the person move from a terminal seat, then confirm it with your passkey',
+ PERSON_SIGNED: 'confirm it with your passkey in the relay view; pair a phone or browser first with pullboard relay on --all',
+ PERSON_SIGNER_REQUIRED: 'decide the other rows with your passkey; a row that names SSH signers waits until signing is off',
+ PERSON_SIGNING_CORRUPT: 'restore the board from a known-good export',
+ PERSON_SIGNING_ERASED: 'restore a known-good board that keeps its signing history',
+ LINE_WIP_LIMIT: 'review the oldest eligible waiting submission: pullboard next --verify; if none is eligible, ask the coordinator to arrange a reviewer',
+ OUTSIDE_NATIVE_BUILD: 'the outside author revises the PR; ask the coordinator to return it, then intake its new exact head',
+ 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',
+ OUTSIDE_HEAD_CHANGED: 'ask the coordinator to reopen the old outside submission before intaking its new exact head',
+ OUTSIDE_OWNER_APPROVAL: 'the owner runs pullboard intake approve <id> from the person terminal or view',
+ OUTSIDE_SANDBOX_REQUIRED: 'read the exact PR diff, then run pullboard verify <id> accept --sandbox with the configured container provider',
+ SANDBOX_PROVIDER_REQUIRED: 'commit sandbox.provider docker with an absolute executable, explicit Unix endpoint and pinned minimum/current images in trusted main pullboard.json',
+ SANDBOX_IMAGE_REQUIRED: 'preload the exact configured digest in the configured Docker daemon; verification does not pull automatically',
+ SANDBOX_RUNTIME: 'correct the pinned official image so its actual Linux Node environment matches the configured minimum/current role',
+ SANDBOX_EXPORT: 'restore Git access to the exact recorded commit and independent private export before verifying',
+ SANDBOX_EXECUTION: 'restore the Docker daemon and inspect the named owned container before another verification',
+ SANDBOX_CLEANUP_REQUIRED: 'restore Docker and remove the exact named owned container before another verification',
+ SANDBOX_CHECK_REQUIRED: 'set a trusted full gate and frozen causal criterion before intake',
+
+ LINE_SETTING_UNKNOWN: 'read pullboard settings line and choose a listed board control',
+ LINE_SETTING_RANGE: 'read the allowed range with pullboard settings line, then record an in-range value or off with its reason and window numbers',
+ LINE_SETTING_REASON: 'repeat the board setting change with --reason describing the measured window',
+ LINE_SETTING_WINDOW: 'repeat the board setting change with --window containing a nonempty JSON object of finite nonnegative measurements or null for unknown',
PERSON_ENROLL_AUTH: 'authenticate a fresh enrollment with the locally trusted person credential',
PERSON_ENROLL_EXPIRED: 'create a fresh person-authenticated challenge valid for at most ten minutes',
PERSON_ENROLL_REVOKED: 'authenticate a different non-revoked device with the person credential',
diff --cc src/relay-sender.js
index 37b787a9,50d3bfc5..05cbd2f0
--- a/src/relay-sender.js
+++ b/src/relay-sender.js
@@@ -10,7 -12,7 +12,7 @@@ export function relayMoveActor(move)
if (move.operation === 'addItem') return args[0]?.by ?? null;
if (move.operation === 'shout') return args[0]?.from ?? null;
if (['proposeSentinel', 'decideSentinel', 'beginSentinelRun', 'finishSentinelRun'].includes(move.operation)) return args[0]?.agentId ?? null;
- if (['setBarReady', 'recordHealthFindings', 'recordFlakeObservation', 'recordGateRun', 'declareJob', 'recordJobRun', 'takeCoordinator', 'landingLeaseMove', 'setPersonSigning', 'proposePersonMove', 'recordPublishFinding'].includes(move.operation)) return args[0]?.agentId ?? null;
- if (['openHandoff', 'takeHandoff', 'setLineSetting', 'setBarReady', 'recordHealthFindings', 'recordFlakeObservation', 'recordGateRun', 'declareJob', 'recordJobRun', 'takeCoordinator', 'landingLeaseMove', 'recordPublishFinding'].includes(move.operation)) return args[0]?.agentId ?? null;
++ if (['openHandoff', 'takeHandoff', 'setLineSetting', 'setBarReady', 'recordHealthFindings', 'recordFlakeObservation', 'recordGateRun', 'declareJob', 'recordJobRun', 'takeCoordinator', 'landingLeaseMove', 'setPersonSigning', 'proposePersonMove', 'recordPublishFinding'].includes(move.operation)) return args[0]?.agentId ?? null;
if (['holdLane', 'releaseLane'].includes(move.operation) && args[1]?.asPerson) return 'person';
if (move.operation === 'release') return args[1] ?? null;
if (['reserveNextReview', 'addMilestone', 'recordRowDecisions', 'applyRowDecisions', 'draftSpecRow', 'recordSpecApprovalBaseline', 'recordLandingBatch', 'recordLandingWaiver', 'recordLandingFlake', 'recordLandingTestDefect', 'finishLandingBatch'].includes(move.operation)) return args[0]?.agentId ?? null;
diff --cc src/sentinel-command.js
index b81c396c,8eb77ebc..a4ba1cbf
--- a/src/sentinel-command.js
+++ b/src/sentinel-command.js
@@@ -1,32 -1,76 +1,80 @@@
/** CLI proposal and exact person decisions for board-owned watches [A6,D3]. */
import { PERSON } from './board.js';
+import {
+ requireSignedPerson,
+ signsPersonMoves,
+} from './person-signing-cli.js';
import { requirePersonChannel } from './person.js';
import { Refused } from './refused.js';
+ import { dueSentinels } from './sentinels.js';
import { sentinels } from './sentinels.js';
import { runDueSentinels } from './sentinel-runner.js';
+ import { withSentinelTrunk } from './sentinel-runner.js';
import { healthSentinelEnabled } from './settings.js';
+ import { recordedHealthFindings } from './health-sentinel.js';
+ import { scanHealthSentinel } from './health-sentinel.js';
+ import { initialSpecApprovalBaseline } from './spec-approval-bootstrap.js';
- /** Run due approved watches from ordinary resume, respecting the health switches. */
- export async function resumeSentinels({ ctx, withBoard, whoAmI, ordered }) {
+ /** The watch command's existing string options, shared with the CLI parser. */
+ export const SENTINEL_OPTIONS = {
+ every: { type: 'string' },
+ owner: { type: 'string' },
+ directory: { type: 'string' },
+ timeout: { type: 'string' },
+ next: { type: 'string' },
+ sentinel: { type: 'boolean' },
+ };
+
+ /** Resume reports due watches in one line and never starts their commands. */
+ export function resumeSentinels({ ctx, withBoard }) {
+ if (!healthSentinelEnabled(ctx.config)) return;
+ return withBoard(ctx, board => {
+ if (dueSentinels(board).length) ctx.io.say('Sentinels are due; schedule pullboard sentinel run to run them in a prepared trunk checkout.');
+ });
+ }
+
+ /** Run due approved watches on pinned trunk, recording through the original caller's board. */
+ async function runSentinels({ ctx, withBoard, whoAmI, ordered }) {
return withBoard(ctx, async board => {
const me = whoAmI(ctx, board);
- if (!healthSentinelEnabled(ctx.config)) return;
- await runDueSentinels({ root: ctx.info.root, board, agentId: me.id,
- ordered: (operation, args) => ordered(ctx, board, operation, args) });
+ const enabled = healthSentinelEnabled(ctx.config);
+ if (enabled) {
+ // Preserve bootstrap-before-observation ordering so the compatibility move cannot stale the scan.
+ const baseline = initialSpecApprovalBaseline(ctx, board, 'recordHealthFindings');
+ if (baseline) {
+ const io = ctx.io.personRequest || ctx.io.personRequestMoveId
+ ? { ...ctx.io, personRequest: undefined, personRequestMoveId: undefined } : ctx.io;
+ await ordered({ ...ctx, io }, board, 'recordSpecApprovalBaseline', [{ agentId: 'coordinator', baseline }]);
+ }
+ const observation = scanHealthSentinel(ctx.file, { root: ctx.info.root, config: ctx.config, now: ctx.clock.now() });
+ if (observation) {
+ try { await ordered(ctx, board, 'recordHealthFindings', [{ agentId: me.id, ...observation }]); }
+ catch (error) { if (!(error instanceof Refused) || error.code !== 'HEALTH_SCAN_STALE') throw error; }
+ }
+ }
+ const health = recordedHealthFindings(board);
+ if (!enabled || !dueSentinels(board).length) {
+ ctx.io.result?.({ sentinels: [], health });
+ ctx.io.say('No enabled sentinel is due.');
+ return 0;
+ }
+ const { results, trunk } = await withSentinelTrunk(ctx.info.root, root => runDueSentinels({ root, board, agentId: me.id,
+ ordered: (operation, args) => ordered(ctx, board, operation, args) }));
+ ctx.io.result?.({ sentinels: results, trunk, health });
+ ctx.io.say(`Sentinels: ${results.length} run from trunk ${trunk.branch}@${trunk.commit.slice(0, 12)}.`);
+ for (const row of results) ctx.io.say(`${row.name}: ${row.lastRun.green ? 'green' : 'red'}; owner ${row.owner}`);
+ return 0;
});
}
/** Keep command parsing separate from the CLI's process and server setup. */
export async function sentinelCommand({ ctx, words, values, withBoard, whoAmI, ordered }) {
const [verb, name, ...extra] = words;
+ if (verb === 'run' && !name && !extra.length) return runSentinels({ ctx, withBoard, whoAmI, ordered });
if (extra.length || !['propose', 'approve', 'decline'].includes(verb) || !name) {
- throw new Refused('USAGE', 'use pullboard sentinel propose <name> --check "<command>" --every 10m --owner <seat or lane>, sentinel approve <name>, sentinel decline <name> --reason "<why>", or pullboard sentinels');
+ throw new Refused('USAGE', 'use pullboard sentinel run, sentinel propose <name> --check "<command>" --every 10m --owner <seat or lane>, sentinel approve <name>, sentinel decline <name> --reason "<why>", or pullboard sentinels');
}
- if (verb !== 'propose') requirePersonChannel(ctx.io.personChannel);
+ if (verb !== 'propose' && !signsPersonMoves(ctx.info.root)) requirePersonChannel(ctx.io.personChannel);
return withBoard(ctx, async board => {
const me = whoAmI(ctx, board);
let row;