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.

chore(merge): integrate sentinel with command imports [A6,H16]

Corey Olson07e808fa53e5
diff --cc src/board.js
index 0fb5d9e1,61fb27ff..65a867c9
--- a/src/board.js
+++ b/src/board.js
@@@ -13,16 -24,42 +24,48 @@@ import
import { dirname } from 'node:path';
import { DatabaseSync } from 'node:sqlite';
import { boardNotWritable } from './board-access.js';
- import { briefFiles, briefSections } from './brief.js';
+ import {
+ briefFiles,
+ briefSections,
+ } from './brief.js';
import { COORDINATOR } from './config.js';
- import { ENGINE_VERSION, VERDICT_REVIEW_ENGINE, MILESTONE_RANK_ENGINE, GUARDS, IN_STATE, MOVES, STATES, UNKNOWN_MOVE, effectiveGuards, storeTriggers } from './machine.js';
+ import {
+ ENGINE_VERSION,
+ VERDICT_REVIEW_ENGINE,
+ MILESTONE_RANK_ENGINE,
+ GUARDS,
+ IN_STATE,
+ MOVES,
+ STATES,
+ UNKNOWN_MOVE,
+ effectiveGuards,
+ storeTriggers,
+ } from './machine.js';
import { Refused } from './refused.js';
- import { causeProblem, requireNeverAgain } from './rigor.js';
+ import {
+ causeProblem,
+ requireNeverAgain,
+ } from './rigor.js';
import { barCorrectionFields } from './bar-corrections.js';
- import { HEALTH_SENTINEL_ENGINE, healthFindingIdentity, healthFindingNotice, normalizedHealthFindings } from './health-receipts.js';
++import {
++ HEALTH_SENTINEL_ENGINE,
++ healthFindingIdentity,
++ healthFindingNotice,
++ normalizedHealthFindings,
++} from './health-receipts.js';
import { factReference } from './fact-reference.js';
- import { factFromEvent, requestAnswerRefusal, tellAnswerImplications, tellFactImplications, tellVerdictImplications } from './implies.js';
- import { landingFlakes, landingWaiverCovers, landingWaiverKind } from './landing-exceptions.js';
+ import {
+ factFromEvent,
+ requestAnswerRefusal,
+ tellAnswerImplications,
+ tellFactImplications,
+ tellVerdictImplications,
+ } from './implies.js';
+ import {
+ landingFlakes,
+ landingWaiverCovers,
+ landingWaiverKind,
+ } from './landing-exceptions.js';
import { parseSpec } from './spec.js';
export { landingFlakes, landingWaiverCovers, landingWaiverKind };
export { acceptCheck } from './check-accept.js';
diff --cc src/cli.js
index 4a804e7f,d3605da2..a2e25992
--- a/src/cli.js
+++ b/src/cli.js
@@@ -47,9 -170,15 +170,16 @@@ import
import { Refused } from './refused.js';
import { personNeeds } from './needs.js';
import { personNeedsState } from './needs-state.js';
+import { startServeSentinel } from './serve-sentinel.js';
- import { commitCitations, committedIds } from './history.js';
- import { promptFor, skillProblems, updateSkills } from './skills.js';
+ import {
+ commitCitations,
+ committedIds,
+ } from './history.js';
+ import {
+ promptFor,
+ skillProblems,
+ updateSkills,
+ } from './skills.js';
import {
frozenCriterion,
idProblems,
@@@ -86,31 -304,107 +305,108 @@@ import { rigorDraft } from './rigor-dra
import { serveApi } from './api.js';
import { watchCommand } from './watch.js';
import { serveMcp } from './mcp.js';
- import { doctorProblems, doctrineProblems } from './doctor.js';
- import { boardHealth, healthLines } from './health.js';
+import { scanHealthSentinel } from './health-sentinel.js';
- import { staleFrozenItems, staleItemFinding } from './approved-rows.js';
- import { mainPolicy, policyAt, itemPolicy, submissionPaths, frozenCheck, checkAtCommit, dependencySnapshots, requireTrunkMerge, trunkRef } from './trusted-policy.js';
- import { captureVerdictReview, staleVerdictRefusal, verdictProjector, verdictTrunk } from './verdict-freshness.js';
+ import {
+ doctorProblems,
+ doctrineProblems,
+ } from './doctor.js';
+ import {
+ boardHealth,
+ healthLines,
+ } from './health.js';
+ import {
+ staleFrozenItems,
+ staleItemFinding,
+ } from './approved-rows.js';
+ import {
+ mainPolicy,
+ policyAt,
+ itemPolicy,
+ submissionPaths,
+ frozenCheck,
+ checkAtCommit,
+ dependencySnapshots,
+ requireTrunkMerge,
+ trunkRef,
+ } from './trusted-policy.js';
+ import {
+ captureVerdictReview,
+ staleVerdictRefusal,
+ verdictProjector,
+ verdictTrunk,
+ } from './verdict-freshness.js';
import { proofStats } from './stats.js';
- import { flowLines, flowAlertLine } from './stats-flow.js';
+ import {
+ flowLines,
+ flowAlertLine,
+ } from './stats-flow.js';
import { releaseHeadlinesBetween } from './changelog.js';
- import { exportBoard, importBoard } from './exchange.js';
+ import {
+ exportBoard,
+ importBoard,
+ } from './exchange.js';
import { digestCommand } from './digest.js';
- import { addSigner, assertRequiredSigners, defaultPrincipal, hasSignerFile } from './signature.js';
- import { addRunner, browserFreeChecksEnabled, gateQueueSettings, gateShortSlots, loadMachineSettings, memoryFloorMB, relayOfferEnabled, setBrowserSlots, setGateShortSlots, setGateSlots } from './settings.js';
- import { formatSnapshotLimit, pendingSnapshotSize, pendingCheckpointProblem, relayCommandReceipt, relayCommandReceiptReported, relayLinked, relayOff, relayOn, relayOperation, relayRecover, relayRecovered, relayRevoke, relayStatus, relayTokens, syncRelay } from './relay.js';
- import { autoLinkProject, offerRelayAtInit, relayOnAllCommand, revokeRelayDevice, unlinkedRelayProjects } from './relay-setup.js';
- import { relayRoster, rosterLines } from './relay-roster.js';
- import { relayJoin, relayPair } from './relay-pairing-client.js';
+ import {
+ addSigner,
+ assertRequiredSigners,
+ defaultPrincipal,
+ hasSignerFile,
+ } from './signature.js';
+ import {
+ addRunner,
+ browserFreeChecksEnabled,
+ gateQueueSettings,
+ gateShortSlots,
+ loadMachineSettings,
+ memoryFloorMB,
+ relayOfferEnabled,
+ setBrowserSlots,
+ setGateShortSlots,
+ setGateSlots,
+ } from './settings.js';
+ import {
+ formatSnapshotLimit,
+ pendingSnapshotSize,
+ pendingCheckpointProblem,
+ relayCommandReceipt,
+ relayCommandReceiptReported,
+ relayLinked,
+ relayOff,
+ relayOn,
+ relayOperation,
+ relayRecover,
+ relayRecovered,
+ relayRevoke,
+ relayStatus,
+ relayTokens,
+ syncRelay,
+ } from './relay.js';
+ import {
+ autoLinkProject,
+ offerRelayAtInit,
+ relayOnAllCommand,
+ revokeRelayDevice,
+ unlinkedRelayProjects,
+ } from './relay-setup.js';
+ import {
+ relayRoster,
+ rosterLines,
+ } from './relay-roster.js';
+ import {
+ relayJoin,
+ relayPair,
+ } from './relay-pairing-client.js';
import { executePersonRequests } from './relay-request-execution.js';
import { engineReceipt } from './engine.js';
- import { accountedFailures, land, landingRemote, landingSubject, liveWaiverProjection, waivedFailures, waiverLine } from './land.js';
+ import {
+ accountedFailures,
+ land,
+ landingRemote,
+ landingSubject,
+ liveWaiverProjection,
+ waivedFailures,
+ waiverLine,
+ } from './land.js';
import { installStep } from './worktree.js';
export { gateWaitReporter };
diff --cc src/engine.js
index 38c1ea35,e12ad878..17064e6e
--- a/src/engine.js
+++ b/src/engine.js
@@@ -1,15 -1,35 +1,36 @@@
/** Versioned, deterministic replay through the CLI's existing board engine [H3,H16]. */
- import { createHash, randomUUID } from 'node:crypto';
+ import {
+ createHash,
+ randomUUID,
+ } from 'node:crypto';
import * as store from './board.js';
import { recordedRefusal } from './recorded-refusal.js';
- import { BAR_ENGINE, carriesBarReason } from './bar-corrections.js';
- import { carriesImplies, IMPLIES_ENGINE } from './implies.js';
+ import {
+ BAR_ENGINE,
+ carriesBarReason,
+ } from './bar-corrections.js';
+ import {
+ carriesImplies,
+ IMPLIES_ENGINE,
+ } from './implies.js';
import { CHECK_ACCEPT_ENGINE } from './check-accept.js';
+import { HEALTH_SENTINEL_ENGINE } from './health-receipts.js';
- import { CAUSE_ENGINE, ENGINE_VERSION, VERDICT_REVIEW_ENGINE, MILESTONE_RANK_ENGINE } from './machine.js';
+ import {
+ CAUSE_ENGINE,
+ ENGINE_VERSION,
+ VERDICT_REVIEW_ENGINE,
+ MILESTONE_RANK_ENGINE,
+ } from './machine.js';
import { Refused } from './refused.js';
- import { requestMoveProblem, recordRequestMove } from './relay-requests.js';
- import { relayMoveActor, relaySenderProblem, validRelaySender } from './relay-sender.js';
+ import {
+ requestMoveProblem,
+ recordRequestMove,
+ } from './relay-requests.js';
+ import {
+ relayMoveActor,
+ relaySenderProblem,
+ validRelaySender,
+ } from './relay-sender.js';
const ITEM_ID_FIRST_ARGUMENT = new Set(['acceptCheck', 'editItem', 'escalate', 'recordAttempt', 'claim', 'release', 'submit', 'reserveReview', 'verify', 'merged', 'withdraw', 'refreeze', 'reopen', 'appendFact']);
diff --cc src/health-sentinel.js
index 426901b7,00000000..77983d6a
mode 100644,000000..100644
--- a/src/health-sentinel.js
+++ b/src/health-sentinel.js
@@@ -1,23 -1,0 +1,26 @@@
+/** Snapshot health without keeping a board write lock across Git's merge checks [A6]. */
+import { existsSync } from 'node:fs';
+import { openBoardReadOnly } from './board.js';
+import { healthReport } from './health.js';
+import { healthSentinelEnabled } from './settings.js';
- import { healthFindingIdentity, normalizedHealthFindings } from './health-receipts.js';
++import {
++ healthFindingIdentity,
++ normalizedHealthFindings,
++} from './health-receipts.js';
+
+/** A missing board or an explicitly disabled sentinel has no observation to publish. */
+export function scanHealthSentinel(file, { root, config, now }) {
+ if (!healthSentinelEnabled(config) || !existsSync(file)) return null;
+ const db = openBoardReadOnly(file);
+ try {
+ db.exec('BEGIN');
+ const observedRevision = db.prepare('SELECT COALESCE(MAX(event_id), 0) AS revision FROM event').get().revision;
+ const report = healthReport({ db, root, config, now });
+ const last = db.prepare("SELECT event_detail FROM event WHERE event_kind = 'health-scan' ORDER BY event_id DESC LIMIT 1").get();
+ const before = (last ? JSON.parse(last.event_detail).active : []).map(healthFindingIdentity).sort();
+ const after = normalizedHealthFindings(report.stuck).map(healthFindingIdentity).sort();
+ db.exec('COMMIT');
+ if (JSON.stringify(before) === JSON.stringify(after)) return null;
+ return { observedRevision, findings: report.stuck };
+ } finally { db.close(); }
+}