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(grants): a bar signature is outside review from an engine [E21,B4]

Corey Olson035c26f73341
diff --git a/src/agent-grant.js b/src/agent-grant.js
index ba576667..17e7cfeb 100644
--- a/src/agent-grant.js
+++ b/src/agent-grant.js
@@ -1,6 +1,7 @@
/** Derive authority from existing seats and claims; no mutable saved grant supplies permission [E21]. */
import { AGENT_GRANT_ENGINE } from './agent-grant-engine.js';
import { REVIEW_GRANT_ENGINE } from './review-grant-engine.js';
+import { BAR_SIGN_GRANT_ENGINE } from './bar-sign-grant-engine.js';
import { MOVE_REGISTRY } from './move-registry.js';
import { Refused } from './refused.js';
import { recordedGrantActivation } from './relay-activation.js';
@@ -28,6 +29,8 @@ export function agentGrantMinimum(board, move) {
const actor = MOVE_REGISTRY[move.operation]?.actor(move);
// Person, coordinator and machine moves are never grant-checked, so activation cannot wedge an in-flight one.
if (typeof actor !== 'string' || ['person', 'coordinator', 'machine'].includes(actor)) return 1;
+ // The newest engine never grant-checks a verdict, so an older verdict bypasses nothing and replays under its own rules.
+ if (move.operation === 'verify') return 1;
if (recordedGrantActivation(board)) return AGENT_GRANT_ENGINE;
const event = board.db.prepare("SELECT event_detail FROM event WHERE event_by=? AND event_kind IN ('join','claim','renew') ORDER BY event_id DESC LIMIT 1").get(actor);
const item = existingItem(board, target(move)?.item ?? (move.operation === 'claim' ? move.args?.[0] : null));
@@ -56,6 +59,8 @@ export function requireAgentGrant(board, move, at = board.clock.now()) {
// independence) govern reviewers, who check other lanes' work by design. Older verdicts keep the
// reservation-only rule they were recorded under, so every replica replays them identically.
if (move.operation === 'verify' && move.engine >= REVIEW_GRANT_ENGINE) return;
+ // A bar signature is the outside review a bar needs before anyone claims it, so it crosses lanes by design.
+ if (move.operation === 'signBar' && move.engine >= BAR_SIGN_GRANT_ENGINE) return;
if (item?.item_review_by === actor && item.item_status === 'submitted' && item.item_review_until > now
&& move.operation === 'verify') return;
const claims = board.db.prepare("SELECT item_id,item_lease_until FROM item WHERE item_owner=? AND item_status='claimed'").all(actor);
diff --git a/src/bar-sign-grant-engine.js b/src/bar-sign-grant-engine.js
new file mode 100644
index 00000000..11cc5d31
--- /dev/null
+++ b/src/bar-sign-grant-engine.js
@@ -0,0 +1,4 @@
+/** From this engine a bar signature is review, not an item change; older signatures replay as recorded [E21,B4,H16]. */
+import { unassignedEngine } from './engine-next.js';
+
+export const BAR_SIGN_GRANT_ENGINE = unassignedEngine();