@tokenfactory/acc-runner 0.41.6 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -4
- package/dist/acc.d.ts +3 -0
- package/dist/acc.d.ts.map +1 -0
- package/dist/acc.js +21 -0
- package/dist/acc.js.map +1 -0
- package/dist/cli-name.d.ts +29 -0
- package/dist/cli-name.d.ts.map +1 -0
- package/dist/cli-name.js +17 -0
- package/dist/cli-name.js.map +1 -0
- package/dist/cli.d.ts +20 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +45 -289
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +56 -0
- package/dist/config.js.map +1 -1
- package/dist/keychain.d.ts +17 -0
- package/dist/keychain.d.ts.map +1 -1
- package/dist/keychain.js +36 -0
- package/dist/keychain.js.map +1 -1
- package/dist/login.d.ts +45 -1
- package/dist/login.d.ts.map +1 -1
- package/dist/login.js +91 -4
- package/dist/login.js.map +1 -1
- package/dist/program.d.ts +16 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +342 -0
- package/dist/program.js.map +1 -0
- package/dist/task-runner.d.ts +1 -1
- package/dist/task-runner.d.ts.map +1 -1
- package/dist/task-runner.js +40 -3
- package/dist/task-runner.js.map +1 -1
- package/dist/user-auth/device-login.d.ts +47 -0
- package/dist/user-auth/device-login.d.ts.map +1 -0
- package/dist/user-auth/device-login.js +189 -0
- package/dist/user-auth/device-login.js.map +1 -0
- package/dist/user-auth/liveness.d.ts +27 -0
- package/dist/user-auth/liveness.d.ts.map +1 -0
- package/dist/user-auth/liveness.js +128 -0
- package/dist/user-auth/liveness.js.map +1 -0
- package/dist/user-auth/session.d.ts +82 -0
- package/dist/user-auth/session.d.ts.map +1 -0
- package/dist/user-auth/session.js +172 -0
- package/dist/user-auth/session.js.map +1 -0
- package/dist/user-cli/chat.d.ts +44 -0
- package/dist/user-cli/chat.d.ts.map +1 -0
- package/dist/user-cli/chat.js +199 -0
- package/dist/user-cli/chat.js.map +1 -0
- package/dist/user-cli/client.d.ts +20 -0
- package/dist/user-cli/client.d.ts.map +1 -0
- package/dist/user-cli/client.js +60 -0
- package/dist/user-cli/client.js.map +1 -0
- package/dist/user-cli/tasks.d.ts +37 -0
- package/dist/user-cli/tasks.d.ts.map +1 -0
- package/dist/user-cli/tasks.js +131 -0
- package/dist/user-cli/tasks.js.map +1 -0
- package/package.json +3 -2
package/dist/program.js
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE command tree, built for whichever binary name invoked it.
|
|
3
|
+
*
|
|
4
|
+
* The package ships two bins — `acc` (unified) and `acc-runner` (the original
|
|
5
|
+
* name, kept as a deprecated alias) — over this single tree. Almost every
|
|
6
|
+
* command is registered identically for both; the exception is `login` /
|
|
7
|
+
* `logout`, and the reason is compatibility rather than taste.
|
|
8
|
+
*
|
|
9
|
+
* WHY `login` IS NAME-DEPENDENT
|
|
10
|
+
* ----------------------------------------------------------------------------
|
|
11
|
+
* There are two lanes, and the published meaning of the old name is already
|
|
12
|
+
* spoken for:
|
|
13
|
+
*
|
|
14
|
+
* * the MACHINE lane — enrol this host into the fleet, mint an ACC-signed JWT
|
|
15
|
+
* that impersonates its owner, create a runner row. That is what
|
|
16
|
+
* `acc-runner login` has always meant, and it is baked into docker
|
|
17
|
+
* entrypoints, launchd plists and the enrollment guidance the UI prints.
|
|
18
|
+
* * the PERSON lane — sign the human at the keyboard in as themselves, via the
|
|
19
|
+
* generalized device flow, with no runner row. That is what a command called
|
|
20
|
+
* `acc login` must mean; a unified CLI whose `login` enrolled a server would
|
|
21
|
+
* be actively misleading.
|
|
22
|
+
*
|
|
23
|
+
* Silently redefining `acc-runner login` to the person lane would be a breaking
|
|
24
|
+
* change wearing an alias costume — every existing enrollment script would stop
|
|
25
|
+
* producing a runner and start producing a session. So the mapping is:
|
|
26
|
+
*
|
|
27
|
+
* acc login → person acc runner login → machine
|
|
28
|
+
* acc-runner login → machine acc-runner auth login → person
|
|
29
|
+
*
|
|
30
|
+
* Both spellings of each lane exist under both names, so nothing an operator or
|
|
31
|
+
* a script types today changes meaning, and `acc runner login` is the forward
|
|
32
|
+
* name for what the alias called `login`.
|
|
33
|
+
*/
|
|
34
|
+
import { realpathSync } from "node:fs";
|
|
35
|
+
import { fileURLToPath } from "node:url";
|
|
36
|
+
import { Command } from "commander";
|
|
37
|
+
import chalk from "chalk";
|
|
38
|
+
import { loadConfig } from "./config.js";
|
|
39
|
+
import { fetchPricing } from "./cost-pricing.js";
|
|
40
|
+
import { loginCommand } from "./login.js";
|
|
41
|
+
import { logoutCommand } from "./logout.js";
|
|
42
|
+
import { watchCommand } from "./watch.js";
|
|
43
|
+
import { companionCommand, companionInstallCommand, companionStatusCommand, companionUninstallCommand, } from "./companion-run.js";
|
|
44
|
+
import { authLoginCommand, authLogoutCommand, authStatusCommand, } from "./user-auth/device-login.js";
|
|
45
|
+
import { ensureUserSessionLive } from "./user-auth/liveness.js";
|
|
46
|
+
import { chatCommand } from "./user-cli/chat.js";
|
|
47
|
+
import { taskListCommand, taskShowCommand } from "./user-cli/tasks.js";
|
|
48
|
+
import { doctorCommand } from "./doctor.js";
|
|
49
|
+
import { clarifyCommand } from "./clarification.js";
|
|
50
|
+
import { clearQuarantine, getQuarantine } from "./runtime/quarantine.js";
|
|
51
|
+
import { clearChatCircuit, getChatCircuit } from "./runtime/chat-circuit-breaker.js";
|
|
52
|
+
import { runCommitGuardHook } from "./commit-guard.js";
|
|
53
|
+
import { PROTOCOL_VERSION } from "./types.js";
|
|
54
|
+
import { PACKAGE_VERSION } from "./pkg-version.js";
|
|
55
|
+
/** Every action shares this shape: report the message, set a failing exit code. */
|
|
56
|
+
function guard(fn) {
|
|
57
|
+
return async () => {
|
|
58
|
+
try {
|
|
59
|
+
await fn();
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
console.error(chalk.red(`✗ ${err.message}`));
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A person-lane command that ACTS on the operator's credential, rather than one
|
|
69
|
+
* that manages it. These check first that the credential still exists server-side,
|
|
70
|
+
* because a revoke on Settings → Sessions cannot reach into this machine's
|
|
71
|
+
* keychain: without the check, a revoked terminal keeps reading the board until
|
|
72
|
+
* its access token expires (see user-auth/liveness.ts). Login / logout / whoami
|
|
73
|
+
* are deliberately NOT wrapped — logging in has nothing to check yet, and logging
|
|
74
|
+
* out of a session that is already gone must still clear the keychain.
|
|
75
|
+
*/
|
|
76
|
+
function personGuard(fn) {
|
|
77
|
+
return guard(async () => {
|
|
78
|
+
await ensureUserSessionLive();
|
|
79
|
+
await fn();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export function buildProgram(options = {}) {
|
|
83
|
+
const invokedAs = options.invokedAs ?? "acc-runner";
|
|
84
|
+
const unified = invokedAs === "acc";
|
|
85
|
+
const program = new Command();
|
|
86
|
+
program
|
|
87
|
+
.name(invokedAs)
|
|
88
|
+
.description(unified
|
|
89
|
+
? "Agent Control Center. Sign in, read the board, ask ACC, and run agents on this machine."
|
|
90
|
+
: "Agent Control Center local runner. Subscribes to ACC, spawns Claude Code on assignment, and opens a PR when done.")
|
|
91
|
+
.version(`${PACKAGE_VERSION} (protocol v${PROTOCOL_VERSION})`);
|
|
92
|
+
// ── The person lane ───────────────────────────────────────────────────────
|
|
93
|
+
// Registered under `auth <verb>` for BOTH names (so `acc-runner auth login`
|
|
94
|
+
// is untouched), and additionally promoted to the top level under `acc`,
|
|
95
|
+
// where `login` is free to mean what a person expects it to mean.
|
|
96
|
+
const registerPersonLane = (parent, verbs) => {
|
|
97
|
+
parent
|
|
98
|
+
.command("login")
|
|
99
|
+
.description("Sign in via device-code and store a user session in the OS keychain.")
|
|
100
|
+
.action(guard(() => authLoginCommand()));
|
|
101
|
+
parent
|
|
102
|
+
.command(verbs.status)
|
|
103
|
+
.description("Show who this terminal is signed in as.")
|
|
104
|
+
.action(guard(() => authStatusCommand()));
|
|
105
|
+
parent
|
|
106
|
+
.command("logout")
|
|
107
|
+
.description("Revoke this terminal's user session and clear the keychain entry.")
|
|
108
|
+
.action(guard(() => authLogoutCommand()));
|
|
109
|
+
};
|
|
110
|
+
const authCmd = program
|
|
111
|
+
.command("auth")
|
|
112
|
+
.description("Sign in to ACC as yourself (no runner registration).");
|
|
113
|
+
registerPersonLane(authCmd, { status: "status" });
|
|
114
|
+
// ── The machine lane ──────────────────────────────────────────────────────
|
|
115
|
+
const registerMachineLane = (parent) => {
|
|
116
|
+
parent
|
|
117
|
+
.command("login")
|
|
118
|
+
.description("Sign in via device-code OAuth and register this machine.")
|
|
119
|
+
.action(guard(() => loginCommand()));
|
|
120
|
+
parent
|
|
121
|
+
.command("logout")
|
|
122
|
+
.description("Clear the local session and mark this runner offline.")
|
|
123
|
+
.action(guard(() => logoutCommand()));
|
|
124
|
+
};
|
|
125
|
+
registerMachineLane(program
|
|
126
|
+
.command("runner")
|
|
127
|
+
.description("Enrol or retire THIS machine as a runner in the fleet."));
|
|
128
|
+
if (unified) {
|
|
129
|
+
registerPersonLane(program, { status: "whoami" });
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
registerMachineLane(program);
|
|
133
|
+
}
|
|
134
|
+
// ── Reading the board ─────────────────────────────────────────────────────
|
|
135
|
+
const taskCmd = program
|
|
136
|
+
.command("task")
|
|
137
|
+
.description("Read the task board as yourself (read-only).");
|
|
138
|
+
taskCmd
|
|
139
|
+
.command("list")
|
|
140
|
+
.description("List tasks visible to you, newest first.")
|
|
141
|
+
.option("--status <status>", "Only tasks in this status (e.g. in_progress).")
|
|
142
|
+
.option("--repo <slug>", "Only tasks for this repo (owner/name).")
|
|
143
|
+
.option("--limit <n>", "How many rows (1-100, default 25).")
|
|
144
|
+
.option("--json", "Emit raw JSON instead of a table.")
|
|
145
|
+
.action((opts) => personGuard(() => taskListCommand(opts))());
|
|
146
|
+
taskCmd
|
|
147
|
+
.command("show")
|
|
148
|
+
.description("Show one task in full.")
|
|
149
|
+
.argument("<id>", "Task id, e.g. T-1234.")
|
|
150
|
+
.option("--json", "Emit raw JSON instead of fields.")
|
|
151
|
+
.action((id, opts) => personGuard(() => taskShowCommand(id, opts))());
|
|
152
|
+
program
|
|
153
|
+
.command("chat")
|
|
154
|
+
.description("Ask ACC. Pass a question, pipe one in, or run bare for a session.")
|
|
155
|
+
.argument("[message...]", "The question. Omit for an interactive session.")
|
|
156
|
+
.option("--conversation <id>", "Continue an existing conversation.")
|
|
157
|
+
.option("--json", "Emit the turn as JSON instead of streaming it.")
|
|
158
|
+
.action((words, opts) => personGuard(() => chatCommand(words ?? [], opts))());
|
|
159
|
+
// ── Running agents on this machine ────────────────────────────────────────
|
|
160
|
+
program
|
|
161
|
+
.command("watch")
|
|
162
|
+
.description("Long-running. Receive task assignments and execute them.")
|
|
163
|
+
.action(guard(async () => {
|
|
164
|
+
// Warm the cost-pricing cache before the realtime loop opens.
|
|
165
|
+
// fetchPricing handles its own logging; embedded fallback governs
|
|
166
|
+
// if the endpoint is unreachable.
|
|
167
|
+
await fetchPricing(loadConfig().publicUrl);
|
|
168
|
+
await watchCommand();
|
|
169
|
+
// Keep the process alive — stop() runs in the SIGINT handler.
|
|
170
|
+
await new Promise(() => { });
|
|
171
|
+
}));
|
|
172
|
+
// COMPANION: companion mode — an owner-affinity chat runner. Serves ONLY the
|
|
173
|
+
// logged-in owner's interactive chat turns (no code tasks), mirrors the turn
|
|
174
|
+
// stream to the same-machine browser over a loopback socket, and on exit
|
|
175
|
+
// requeues in-flight turns so an Auto turn fails over to the fleet.
|
|
176
|
+
const companionCmd = program
|
|
177
|
+
.command("companion")
|
|
178
|
+
.description("Long-running. Serve the owner's interactive chat turns (companion mode).")
|
|
179
|
+
.action(guard(async () => {
|
|
180
|
+
const handle = await companionCommand();
|
|
181
|
+
const shutdown = () => {
|
|
182
|
+
void handle.stop().finally(() => process.exit(0));
|
|
183
|
+
};
|
|
184
|
+
process.on("SIGINT", shutdown);
|
|
185
|
+
process.on("SIGTERM", shutdown);
|
|
186
|
+
// Keep the process alive; the loop runs on timers until a signal.
|
|
187
|
+
await new Promise(() => { });
|
|
188
|
+
}));
|
|
189
|
+
companionCmd
|
|
190
|
+
.command("status")
|
|
191
|
+
.description("Print the one-line companion status (menu-bar friendly).")
|
|
192
|
+
.action(guard(() => companionStatusCommand()));
|
|
193
|
+
companionCmd
|
|
194
|
+
.command("install")
|
|
195
|
+
.description("Install the companion login agent (autostart at login).")
|
|
196
|
+
.action(guard(() => companionInstallCommand()));
|
|
197
|
+
companionCmd
|
|
198
|
+
.command("uninstall")
|
|
199
|
+
.description("Remove the companion login agent.")
|
|
200
|
+
.action(guard(() => companionUninstallCommand()));
|
|
201
|
+
program
|
|
202
|
+
.command("doctor")
|
|
203
|
+
.description("Run environment checks. Exit 0 if all green, 1 otherwise.")
|
|
204
|
+
.option("--strict", "Treat advisory warnings (missing ANTHROPIC_API_KEY, version drift, etc.) as failures.")
|
|
205
|
+
.action(async (opts) => {
|
|
206
|
+
const code = await doctorCommand({ strict: opts.strict === true });
|
|
207
|
+
process.exitCode = code;
|
|
208
|
+
});
|
|
209
|
+
// NEEDS-INFO-HALT: a spawned agent that needs clarification / approval /
|
|
210
|
+
// missing information raises a needs_clarification halt for its task and hands
|
|
211
|
+
// the question off to JOJO, instead of guessing or dead-lettering. The operator
|
|
212
|
+
// answers by resolving the halt, which resumes the SAME task blocked -> queued.
|
|
213
|
+
program
|
|
214
|
+
.command("clarify")
|
|
215
|
+
.description("Raise a needs_clarification halt for a task and hand the question off to JOJO.")
|
|
216
|
+
.requiredOption("--task <id>", "Task id the agent is blocked on (e.g. T-1234).")
|
|
217
|
+
.requiredOption("--question <text>", "The question / missing info the operator must answer.")
|
|
218
|
+
.option("--context <json>", "Optional JSON object merged into the halt payload.")
|
|
219
|
+
.action((opts) => guard(() => clarifyCommand(opts))());
|
|
220
|
+
// Quarantine management. The runner enters quarantine automatically when the
|
|
221
|
+
// failure classifier detects a machine-level failure. An operator resolves the
|
|
222
|
+
// underlying issue then clears the quarantine to resume work.
|
|
223
|
+
const quarantineCmd = program
|
|
224
|
+
.command("quarantine")
|
|
225
|
+
.description("Inspect or clear the runner quarantine state.");
|
|
226
|
+
quarantineCmd
|
|
227
|
+
.command("status")
|
|
228
|
+
.description("Show quarantine state.")
|
|
229
|
+
.action(guard(async () => {
|
|
230
|
+
const q = await getQuarantine();
|
|
231
|
+
if (!q) {
|
|
232
|
+
console.log("Runner is not quarantined.");
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
console.log(chalk.red.bold(`QUARANTINED (${q.cause})`));
|
|
236
|
+
console.log(` Detail: ${q.detail}`);
|
|
237
|
+
console.log(` Task: ${q.taskId}`);
|
|
238
|
+
console.log(` Since: ${q.classifiedAt}`);
|
|
239
|
+
// Consecutive instant-empty count (1 = definitive, 2 = heuristic
|
|
240
|
+
// confirmed by retry). Omitted for states written before it existed.
|
|
241
|
+
if (q.consecutive !== undefined) {
|
|
242
|
+
console.log(` Streak: ${q.consecutive} consecutive instant-empty exit(s)`);
|
|
243
|
+
}
|
|
244
|
+
console.log(chalk.gray(`\nResolve the underlying ${q.cause} issue, then run \`${invokedAs} quarantine clear\`.`));
|
|
245
|
+
process.exitCode = 1;
|
|
246
|
+
}));
|
|
247
|
+
quarantineCmd
|
|
248
|
+
.command("clear")
|
|
249
|
+
.description("Clear quarantine and allow the runner to resume claiming tasks.")
|
|
250
|
+
.action(guard(async () => {
|
|
251
|
+
await clearQuarantine();
|
|
252
|
+
console.log(chalk.green("✓ Quarantine cleared. Runner will resume on next task assignment."));
|
|
253
|
+
}));
|
|
254
|
+
// TURN-LANE: chat-circuit management. The runner opens the chat circuit
|
|
255
|
+
// automatically when a `claude_exit_1`-class fault surfaces while serving a
|
|
256
|
+
// chat turn — benching ONLY the chat lane (code/review keep running). An
|
|
257
|
+
// operator resolves the credential/host issue then clears it to resume chat.
|
|
258
|
+
const chatCircuitCmd = program
|
|
259
|
+
.command("chat-circuit")
|
|
260
|
+
.description("Inspect or clear the chat-capability circuit breaker (chat lane only).");
|
|
261
|
+
chatCircuitCmd
|
|
262
|
+
.command("status")
|
|
263
|
+
.description("Show chat circuit state.")
|
|
264
|
+
.action(guard(async () => {
|
|
265
|
+
const c = await getChatCircuit();
|
|
266
|
+
if (!c) {
|
|
267
|
+
console.log("Chat circuit is closed (chat lane serving).");
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
console.log(chalk.red.bold(`CHAT CIRCUIT OPEN (${c.cause})`));
|
|
271
|
+
console.log(` Detail: ${c.detail}`);
|
|
272
|
+
console.log(` Turn: ${c.turnId}`);
|
|
273
|
+
console.log(` Conversation: ${c.conversationId}`);
|
|
274
|
+
console.log(` Since: ${c.trippedAt}`);
|
|
275
|
+
console.log(chalk.gray(`\nResolve the underlying ${c.cause} issue, then run \`${invokedAs} chat-circuit clear\`. ` +
|
|
276
|
+
`Code/review lanes are unaffected.`));
|
|
277
|
+
process.exitCode = 1;
|
|
278
|
+
}));
|
|
279
|
+
chatCircuitCmd
|
|
280
|
+
.command("clear")
|
|
281
|
+
.description("Close the chat circuit and allow the runner to resume claiming chat turns.")
|
|
282
|
+
.action(guard(async () => {
|
|
283
|
+
await clearChatCircuit();
|
|
284
|
+
console.log(chalk.green("✓ Chat circuit closed. Runner will resume claiming chat turns."));
|
|
285
|
+
}));
|
|
286
|
+
// The git pre-commit hook the runner installs into a task worktree (see
|
|
287
|
+
// commit-guard.ts) re-invokes this hidden subcommand. It scans the STAGED text
|
|
288
|
+
// files and exits non-zero (with an actionable message on stderr) when a NUL
|
|
289
|
+
// byte / invalid UTF-8 / binary-blob-where-text is found, so git aborts the
|
|
290
|
+
// commit and the agent fixes it in-session. Hidden — it is a hook entry point,
|
|
291
|
+
// not an operator command.
|
|
292
|
+
program
|
|
293
|
+
.command("_precommit-guard", { hidden: true })
|
|
294
|
+
.description("Internal: commit-time mechanical guard (pre-commit hook entry).")
|
|
295
|
+
.action(async () => {
|
|
296
|
+
try {
|
|
297
|
+
const result = await runCommitGuardHook();
|
|
298
|
+
if (!result.ok) {
|
|
299
|
+
console.error(result.message);
|
|
300
|
+
process.exitCode = 1;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
// Fail OPEN on an internal error: a guard bug must never wedge the agent's
|
|
305
|
+
// ability to commit. The pre-PR gate (prepr-gate.ts) is the backstop.
|
|
306
|
+
console.error(chalk.yellow(`commit-guard skipped (internal error): ${err.message}`));
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
program
|
|
310
|
+
.command("version")
|
|
311
|
+
.description("Print CLI + protocol versions.")
|
|
312
|
+
.action(() => {
|
|
313
|
+
const label = Math.max(invokedAs.length, "protocol".length);
|
|
314
|
+
console.log(`${invokedAs.padEnd(label)} ${PACKAGE_VERSION}`);
|
|
315
|
+
console.log(`${"protocol".padEnd(label)} ${PROTOCOL_VERSION}`);
|
|
316
|
+
});
|
|
317
|
+
return program;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* True when `moduleUrl` is the process entry point — NOT when it is imported by
|
|
321
|
+
* a test. realpath resolves the npm bin symlink to the built file so the compare
|
|
322
|
+
* holds for a globally-installed CLI.
|
|
323
|
+
*/
|
|
324
|
+
export function isMainModule(moduleUrl) {
|
|
325
|
+
const entry = process.argv[1];
|
|
326
|
+
if (!entry)
|
|
327
|
+
return false;
|
|
328
|
+
try {
|
|
329
|
+
return realpathSync(entry) === realpathSync(fileURLToPath(moduleUrl));
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/** Parse argv and turn a thrown error into a red line + exit 1. */
|
|
336
|
+
export function runProgram(program) {
|
|
337
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
338
|
+
console.error(chalk.red(`✗ ${err.message}`));
|
|
339
|
+
process.exit(1);
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAoB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAwB,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,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EL,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,YAAY,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/task-runner.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ export interface RunTaskController {
|
|
|
202
202
|
* line (REG-294) so an operator can tell whether a multi-minute task
|
|
203
203
|
* died at fetch, git, claude, or push.
|
|
204
204
|
*/
|
|
205
|
-
export type RunTaskPhase = "claim_locks" | "transition_to_running" | "fetch" | "clone" | "worktree_lock" | "git" | "claude_exit" | "prepr_gate" | "push" | "github" | "repo_scope";
|
|
205
|
+
export type RunTaskPhase = "claim_locks" | "transition_to_running" | "fetch" | "clone" | "worktree_lock" | "git" | "claude_exit" | "prepr_gate" | "push" | "github" | "repo_scope" | "base_resolution";
|
|
206
206
|
export interface RunTaskOutcome {
|
|
207
207
|
taskId: string;
|
|
208
208
|
status: "ok" | "failed" | "cancelled" | "capacity_paused" | "requeued" | "ignored";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-runner.d.ts","sourceRoot":"","sources":["../src/task-runner.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"task-runner.d.ts","sourceRoot":"","sources":["../src/task-runner.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAsE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACxI,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,iBAAiB,CA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AI,CAIlD;AAED,MAAM,WAAW,yBAAyB;IACxC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,KAAK,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,yBAAyB,CAgB9E;AA6DD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAU9D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAM3E;AA8ED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,gBAAgB,CAWlB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB/E;AA+KD,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,GAChB,iBAAiB,CAi4DnB"}
|
package/dist/task-runner.js
CHANGED
|
@@ -20,7 +20,7 @@ import path from "node:path";
|
|
|
20
20
|
import { join } from "node:path";
|
|
21
21
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
22
22
|
import { execa } from "execa";
|
|
23
|
-
import { canServeRepo, loadProfile as defaultLoadProfile } from "./config.js";
|
|
23
|
+
import { canServeRepo, loadProfile as defaultLoadProfile, resolveBaseBranch } from "./config.js";
|
|
24
24
|
import { normalizeUsage, priceUsdCents, toCliAlias, } from "./cost-pricing.js";
|
|
25
25
|
import { extractResetTime, isCapacityExhausted, isGitProvisionContention, } from "./failure-classifier.js";
|
|
26
26
|
import { getEngine } from "./engines/registry.js";
|
|
@@ -1042,6 +1042,40 @@ export function runTask(taskId, deps) {
|
|
|
1042
1042
|
});
|
|
1043
1043
|
return { taskId, status: "ignored", phase: "repo_scope" };
|
|
1044
1044
|
}
|
|
1045
|
+
// RF-9 PER-REPO-BASE-RESOLUTION. Resolve the PR base HERE, before any git
|
|
1046
|
+
// side-effect, and REFUSE rather than guess when this runner cannot know it.
|
|
1047
|
+
// The precedence order is untouched (task.integration_branch always wins —
|
|
1048
|
+
// migration 0304 is what finally stamps it, per-repo, at creation); what
|
|
1049
|
+
// changed is the fallback: a runner serving MORE THAN ONE repo has exactly
|
|
1050
|
+
// one machine-global ACC_INTEGRATION_BRANCH, which is guaranteed wrong for
|
|
1051
|
+
// every repo but one. On 2026-07-28 that silently forked six
|
|
1052
|
+
// agent-control-center tasks from origin/fg/integration and dead-lettered
|
|
1053
|
+
// them (hard_failure:git). Refusing is lossless: same IGNORE contract as the
|
|
1054
|
+
// repo-scope guard above — no terminal transition, no retry-budget burn, no
|
|
1055
|
+
// quarantine; the stale-running sweep requeues the task with runner_id
|
|
1056
|
+
// cleared. A SINGLE-repo runner keeps the historic cfg → "main" fallback, so
|
|
1057
|
+
// the current fleet is byte-identical.
|
|
1058
|
+
const baseResolution = resolveBaseBranch({
|
|
1059
|
+
taskBase: task.integration_branch,
|
|
1060
|
+
taskRepo: servedRepo,
|
|
1061
|
+
configBase: deps.cfg.integrationBranch,
|
|
1062
|
+
servedRepos: deps.cfg.repos,
|
|
1063
|
+
});
|
|
1064
|
+
if (baseResolution.base === null) {
|
|
1065
|
+
await appendEvent(deps.supabase, taskId, "log", {
|
|
1066
|
+
phase: "base_resolution",
|
|
1067
|
+
stream: "stderr",
|
|
1068
|
+
event: "runner.base_branch_unresolved",
|
|
1069
|
+
repo: servedRepo,
|
|
1070
|
+
served_repos: deps.cfg.repos ?? [],
|
|
1071
|
+
runner_id: deps.session.runnerId,
|
|
1072
|
+
message: baseResolution.reason,
|
|
1073
|
+
});
|
|
1074
|
+
return { taskId, status: "ignored", phase: "base_resolution" };
|
|
1075
|
+
}
|
|
1076
|
+
// Non-null past the guard; bound to a local so the narrowing survives the
|
|
1077
|
+
// awaits between here and the worktree prep below.
|
|
1078
|
+
const resolvedBase = baseResolution.base;
|
|
1045
1079
|
// v0.48 T-48-5: conflict_resolution tasks bypass Claude Code entirely.
|
|
1046
1080
|
// The runner resolves conflicts on the real base∩head file set via the
|
|
1047
1081
|
// GitHub API, pushes the resolution, and transitions the task to done
|
|
@@ -1115,8 +1149,11 @@ export function runTask(taskId, deps) {
|
|
|
1115
1149
|
const targetRepo = task.repo?.trim() || deps.cfg.targetRepo;
|
|
1116
1150
|
// REG-301: branch base comes from task → cfg → main. cfg.integrationBranch
|
|
1117
1151
|
// already defaults to "acc/integration" so the third fallback only
|
|
1118
|
-
// matters when an operator zeroed it out via env.
|
|
1119
|
-
|
|
1152
|
+
// matters when an operator zeroed it out via env. RF-9: resolved by
|
|
1153
|
+
// resolveBaseBranch at the top of the run (a multi-repo runner refuses the
|
|
1154
|
+
// task there rather than falling through to its machine default), so by the
|
|
1155
|
+
// time we get here the value is non-null and its provenance is known.
|
|
1156
|
+
const integrationBranch = resolvedBase;
|
|
1120
1157
|
// v0.51 T-51-1: rework prompts replace the "open a PR" protocol header
|
|
1121
1158
|
// with "update the existing PR's branch" + the reviewer's verdict.
|
|
1122
1159
|
const renderedPrompt = reworkMeta
|