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): keep own handoff facts available [E21,B3]

Corey Olsonf89f536e52af
diff --git a/src/agent-grant.js b/src/agent-grant.js
index dac91ff6..3433c72d 100644
--- a/src/agent-grant.js
+++ b/src/agent-grant.js
@@ -39,6 +39,11 @@ export function requireAgentGrant(board, move, at = board.clock.now()) {
const item = Number.isSafeInteger(scope.item)
? board.db.prepare('SELECT * FROM item WHERE item_id=?').get(scope.item) : null;
if (!scope.creating && !item) return; // Preserve the operation's own malformed/missing-item refusal.
+ // The seat's immutable handoff-open event grants only its own channel facts, not other item work.
+ // Replacement fencing runs before this guard, so a taken-over seat keeps only its existing shout path.
+ if (move.operation === 'appendFact' && board.db.prepare(
+ "SELECT event_id FROM event WHERE item_id=? AND event_by=? AND event_kind='handoff-open' LIMIT 1")
+ .get(scope.item, actor)) return;
const now = at.toISOString();
if (item?.item_review_by === actor && item.item_status === 'submitted' && item.item_review_until > now
&& ['verify', 'appendFact'].includes(move.operation)) return;