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
refactor(cli): the gate wait reporter gets a module [C7]
Corey Olson428431e37367
diff --git a/src/cli.js b/src/cli.jsindex 16390816..09b752fb 100644--- a/src/cli.js+++ b/src/cli.js@@ -19,6 +19,7 @@ import { agentSessionDigest, requirePersonChannel } from './person.js';import { bindLocalSession, localSessionMatches } from './agent-session.js';import { decisionAnswer, decisionProjection, handAnsweredQuestions, pendingAnswers, planRowApply, prepareRowDecisions, restoreRowApply, writeRowApply } from './row-decisions.js';import { digestOf, gateReport, refuseSandboxBlocked, runGate, runProfiledShell, runSubmitGate, submitGateReport, timingDigest, withGateSlot } from './gate.js';+import { gateWaitReporter } from './gate-wait.js';import { checkNeedsBrowser } from './browser-admission.js';import { bareWorktreeFinding, codeIsFromMain, contains, differFromHead, git, gitChildEnv, headCommit, headTree, invalidateGitFacts, isClean, mainCheckout, patchId, repoInfo, resolveCommit, tryGit, untracked, withGitFacts } from './git.js';import {@@ -99,6 +100,7 @@ import { engineReceipt } from './engine.js';import { accountedFailures, land, landingRemote, landingSubject, liveWaiverProjection, waivedFailures, waiverLine } from './land.js';import { installStep } from './worktree.js';+export { gateWaitReporter };const CHECKOUT_LEASES = new WeakMap();const CHECKOUT_BOARD_ONLY = new WeakMap();let startupMainTraced = false;@@ -3259,38 +3261,6 @@ function browserAdmissionReporter(io, jsonMode = false) {};}-/** Build de-duplicated queue messages for a gate waiting on machine capacity or memory; exported so tests can read what a person sees. */-export function gateWaitReporter(io) {- let last = '';- let warned = false;- let held = false;- return ({ holders, position, memory, runnerUnavailable }) => {- if (runnerUnavailable) {- io.say(`runner ${runnerUnavailable.host} unavailable: ${runnerUnavailable.reason}; until ${runnerUnavailable.until}; requeueing the run`);- return;- }- // Memory speaks once per state: one warning where it cannot be read, one line per hold.- if (memory && !memory.checked) {- if (!warned) io.say(memory.warning);- warned = true;- if (!position) return;- }- if (memory?.held) {- if (!held) io.say(memory.line);- held = true;- last = '';- return;- }- held = false;- const repos = holders.map(({ repo }) => repo).filter(Boolean);- const message = `gate waiting: ${holders.length} running${repos.length ? ` in ${repos.join(', ')}` : ''}; place ${position}`;- if (message !== last) {- io.say(message);- last = message;- }- };-}-/** Read or update machine-wide gate capacity. */function settingsCommand(io, { first, second, rest }) {if (!first && !second && !rest.length) {diff --git a/src/gate-wait.js b/src/gate-wait.jsnew file mode 100644index 00000000..62a404c4--- /dev/null+++ b/src/gate-wait.js@@ -0,0 +1,36 @@+/**+ * What a person sees while a gate waits for the machine queue [C7]: one line per new place in the+ * queue, one line per memory state and one line when a runner drops out. src/cli.js re-exports it.+ */++/** Build de-duplicated queue messages for a gate waiting on machine capacity or memory; tests read it through src/cli.js. */+export function gateWaitReporter(io) {+ let last = '';+ let warned = false;+ let held = false;+ return ({ holders, position, memory, runnerUnavailable }) => {+ if (runnerUnavailable) {+ io.say(`runner ${runnerUnavailable.host} unavailable: ${runnerUnavailable.reason}; until ${runnerUnavailable.until}; requeueing the run`);+ return;+ }+ // Memory speaks once per state: one warning where it cannot be read, one line per hold.+ if (memory && !memory.checked) {+ if (!warned) io.say(memory.warning);+ warned = true;+ if (!position) return;+ }+ if (memory?.held) {+ if (!held) io.say(memory.line);+ held = true;+ last = '';+ return;+ }+ held = false;+ const repos = holders.map(({ repo }) => repo).filter(Boolean);+ const message = `gate waiting: ${holders.length} running${repos.length ? ` in ${repos.join(', ')}` : ''}; place ${position}`;+ if (message !== last) {+ io.say(message);+ last = message;+ }+ };+}