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.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(cli): initialize cold local approval authority [S1,H16]
Corey Olson37e72ce95138
diff --git a/src/cli.js b/src/cli.jsindex e2cb22e8..3f17f381 100644--- a/src/cli.js+++ b/src/cli.js@@ -902,6 +902,11 @@ export async function ordered(ctx, board, operation, args) {() => store.recordSpecApprovalBaseline(board, ...values)): store.recordSpecApprovalBaseline(board, ...values);};+ // A hand-configured local project's first command may create a worktree before any seat exists.+ // Establish its local coordinator first; linked and recovered moves retain relay authority.+ if (initialBaseline && ctx.info.isMain && !relayLinked(ctx.info.root) && !relayRecovered(ctx.info.root)) {+ store.ensureCoordinator(board, ctx.info.root);+ }const actor = ctx.info.isMain ? COORDINATOR : store.agentAt(board, ctx.info.root)?.agent_id;if (initialBaseline && actor) await recordBaseline(actor);const result = await withItemSession(ctx.info, operation, args, () => relayLinked(ctx.info.root) || relayRecovered(ctx.info.root)diff --git a/test/board.test.js b/test/board.test.jsindex add2d7b4..17792513 100644--- a/test/board.test.js+++ b/test/board.test.js@@ -1293,6 +1293,15 @@ test('[O3] declared families travel from join through submit and verdict, and abconst file = join(repo, '.git', 'pullboard', 'board.sqlite');const persistent = store.openBoard(file);t.after(() => store.closeBoard(persistent));+ const initialEvents = store.events(persistent);+ const coordinatorJoin = initialEvents.find(event => event.event_kind === 'join' && event.event_by === 'coordinator');+ const baselineEvents = initialEvents.filter(event => event.event_kind === 'spec_approval_baseline');+ const builderJoin = initialEvents.find(event => event.event_kind === 'join' && event.event_by === 'web-1');+ assert.equal(baselineEvents.length, 1, 'first worktree setup records the compatibility baseline exactly once');+ assert.ok(coordinatorJoin.event_id < baselineEvents[0].event_id && baselineEvents[0].event_id < builderJoin.event_id,+ 'a cold local main establishes its coordinator and existing approvals before registering the worktree');+ assert.deepEqual(store.specApprovalBaseline(persistent).rows.map(row => row.id), ['G1'],+ 'later lane joins retain the original approved source row');assert.equal(store.agentAt(persistent, builderPath).agent_family, 'Family Alpha');assert.equal(store.agentAt(persistent, reviewerRoot).agent_family, 'Family Beta');assert.equal(store.agentAt(persistent, noFamilyRoot).agent_family, null);