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
perf(cli): compose accepted indexed reads with lazy commands [C7]
Corey Olson42f020f0469c
diff --cc src/cli-identity.jsindex d199bdb7,00000000..20878b38mode 100644,000000..100644--- a/src/cli-identity.js+++ b/src/cli-identity.js@@@ -1,33 -1,0 +1,33 @@@+/** Caller identity shared by read and write commands without loading their transports [C7,E18]. */+import * as store from './board.js';+import { COORDINATOR } from './config.js';+import { displayAgentName } from './agent-names.js';+import { Refused } from './refused.js';++/**+ * Who is asking: the coordinator in the main checkout, or the agent this worktree joined as.+ *+ * @param {any} ctx+ * @param {any} board+ * @returns {{ id: string, lane: string, route?: string, family: string | null, model: string | null, displayName: string }}+ */+export function identifyCaller(ctx, board, { environmentAgent, relayLinked }) {+ // A CI or cloud session works as the agent its environment token names, on that one board [E18].+ const seat = environmentAgent(ctx.info.root, board);+ if (seat) return { id: seat.agent_id, lane: seat.agent_lane, route: seat.agent_route, family: seat.agent_family ?? null, model: seat.agent_model ?? 'unknown', displayName: displayAgentName(seat, ctx.config.agents.names) };+ if (ctx.info.isMain) {+ ctx.io.caller?.('coordinator', ctx.info.root);- const registered = store.listAgents(board).find((agent) => agent.agent_id === COORDINATOR);++ const registered = store.agentById(board, COORDINATOR);+ const linked = relayLinked(ctx.info.root);+ if (linked && !registered) throw new Refused('NO_AGENT', 'the linked snapshot has no coordinator; restore a consistent relay snapshot before acting');+ const id = linked ? COORDINATOR : store.ensureCoordinator(board, ctx.info.root);+ const agent = registered ?? store.agentAt(board, ctx.info.root);+ return { id, lane: COORDINATOR, family: agent?.agent_family ?? null, model: agent?.agent_model ?? 'unknown', displayName: displayAgentName(agent ?? { agent_id: id }, ctx.config.agents.names) };+ }+ const agent = store.agentAt(board, ctx.info.root);+ if (!agent) {+ throw new Refused('NOT_JOINED', 'this worktree has not joined a lane: pullboard join <lane> --model "<model name>" (see: pullboard lanes)');+ }+ ctx.io.caller?.('seat', ctx.info.root);+ return { id: agent.agent_id, lane: agent.agent_lane, route: agent.agent_route, family: agent.agent_family ?? null, model: agent.agent_model ?? 'unknown', displayName: displayAgentName(agent, ctx.config.agents.names) };+}diff --cc src/commands/status.jsindex 9c60219f,ee1be22d..158c2493--- a/src/commands/status.js+++ b/src/commands/status.js@@@ -23,22 -23,19 +23,22 @@@ importimport {context,span,- whoAmI,- withBoardRead,-} from '../cli.js';+} from '../cli-context.js';/** Run `pullboard status` and return its exit code. */-export function run(io, { values }) {+export async function run(io, { values }) {const ctx = context(io);+ const hasRelayState = relayStateExists(ctx.info.commonDir);+ const relay = hasRelayState ? await import('../relay.js') : null;+ const environment = hasRelayState && process.env.PULLBOARD_RELAY_TOKEN !== undefined+ ? await import('../relay-environment.js') : null;const summary = withBoardRead(ctx, (board) => {- const me = whoAmI(ctx, board);+ const me = identifyCaller(ctx, board, { environmentAgent: environment?.environmentAgent ?? (() => null),+ relayLinked: relay?.relayLinked ?? (() => false) });- const mine = store.listItems(board).filter((item) => item.item_status === 'claimed' && item.item_owner === me.id);+ const mine = store.itemsInStatus(board, 'claimed', me.id);const approvalState = personNeedsSummary(ctx.info.root, { board, config: ctx.config });- return { me, mine, needs: approvalState.needs, specApprovalBaseline: approvalState.specApprovalBaseline, specApprovalEvidenceErrors: approvalState.specApprovalEvidenceErrors, stats: store.stats(board), reviewQueue: { ...store.reviewQueue(board), ...store.reviewQueueBreakdown(board) }, unread: store.unreadCount(board, me.id), relay: relayStatus(ctx.info.root),+ return { me, mine, needs: approvalState.needs, specApprovalBaseline: approvalState.specApprovalBaseline, specApprovalEvidenceErrors: approvalState.specApprovalEvidenceErrors, stats: store.stats(board), reviewQueue: { ...store.reviewQueue(board), ...store.reviewQueueBreakdown(board) }, unread: store.unreadCount(board, me.id), relay: relay ? relay.relayStatus(ctx.info.root) : unlinkedRelayStatus(),- submitInvariantProposals: submitInvariantProposals(store.eventsOfKinds(board, ['submit', 'landing_batch']), ctx.config) };+ submitInvariantProposals: submitInvariantProposals(store.submitInvariantEvents(board, ctx.config), ctx.config) };});if (values.json) {io.result(summary);