@ai-dossier/sched 0.47.0 → 0.48.1
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 +103 -13
- package/dist/anchor-close.d.ts.map +1 -1
- package/dist/anchor-close.js +2 -1
- package/dist/anchor-close.js.map +1 -1
- package/dist/batch-dispatch.d.ts +7 -1
- package/dist/batch-dispatch.d.ts.map +1 -1
- package/dist/batch-dispatch.js +234 -89
- package/dist/batch-dispatch.js.map +1 -1
- package/dist/dispatch.d.ts +17 -0
- package/dist/dispatch.d.ts.map +1 -1
- package/dist/dispatch.js +31 -0
- package/dist/dispatch.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +10 -2
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/dist/recovery.d.ts +39 -3
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +206 -46
- package/dist/recovery.js.map +1 -1
- package/dist/scheduler.d.ts +15 -1
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +26 -0
- package/dist/scheduler.js.map +1 -1
- package/dist/state.d.ts +69 -8
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +177 -14
- package/dist/state.js.map +1 -1
- package/dist/status.d.ts +107 -5
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +291 -4
- package/dist/status.js.map +1 -1
- package/dist/teardown.d.ts +9 -0
- package/dist/teardown.d.ts.map +1 -1
- package/dist/teardown.js +19 -10
- package/dist/teardown.js.map +1 -1
- package/dist/types.d.ts +45 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +20 -2
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/status.js
CHANGED
|
@@ -6,16 +6,104 @@
|
|
|
6
6
|
* `renderTable`) — the package deliberately has no dependency on CLI
|
|
7
7
|
* utilities.
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
9
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.STATUS_HEALTH_WARNING_AGE_MS = void 0;
|
|
43
|
+
exports.KEPT_WORKTREE_PROBE_LIMIT = exports.STATUS_HEALTH_WARNING_AGE_MS = void 0;
|
|
11
44
|
exports.buildStatusWarnings = buildStatusWarnings;
|
|
45
|
+
exports.keptWorktreeCandidates = keptWorktreeCandidates;
|
|
46
|
+
exports.defaultKeptWorktreeReader = defaultKeptWorktreeReader;
|
|
47
|
+
exports.buildKeptWorktreeWarnings = buildKeptWorktreeWarnings;
|
|
12
48
|
exports.buildStatusReport = buildStatusReport;
|
|
49
|
+
const fs = __importStar(require("node:fs"));
|
|
13
50
|
const anchor_close_1 = require("./anchor-close");
|
|
14
51
|
const dispatch_1 = require("./dispatch");
|
|
15
52
|
const journal_1 = require("./journal");
|
|
16
53
|
const readiness_1 = require("./readiness");
|
|
54
|
+
const recovery_1 = require("./recovery");
|
|
17
55
|
const state_1 = require("./state");
|
|
56
|
+
const teardown_1 = require("./teardown");
|
|
18
57
|
const types_1 = require("./types");
|
|
58
|
+
/** The parked-member row for one entry (#810). */
|
|
59
|
+
function parkedMemberItem(entry) {
|
|
60
|
+
const kind = entry.status;
|
|
61
|
+
const reason = entry.reason ?? entry.failure_evidence?.reason ?? kind;
|
|
62
|
+
const branch = entry.failure_evidence?.branch ?? null;
|
|
63
|
+
const profile = entry.dispatch_profile ?? null;
|
|
64
|
+
const from = branch !== null ? `from ${branch}` : 'from the base branch (no member branch recorded)';
|
|
65
|
+
const on = profile !== null ? ` on profile ${profile}` : ' on the default profile';
|
|
66
|
+
const note = kind === 'handed-back'
|
|
67
|
+
? `the member handed back (${reason}) — resolve what it needs (see its handover / blocked milestone on #${entry.issue}) before requeueing`
|
|
68
|
+
: `evicted (${reason}) — requeue continues the work ${from}${on}`;
|
|
69
|
+
return {
|
|
70
|
+
issue: entry.issue,
|
|
71
|
+
batch: entry.batch ?? entry.failure_evidence?.batch ?? null,
|
|
72
|
+
kind,
|
|
73
|
+
reason,
|
|
74
|
+
branch,
|
|
75
|
+
dispatch_profile: profile,
|
|
76
|
+
since: entry.updated_at,
|
|
77
|
+
note,
|
|
78
|
+
remedies: [
|
|
79
|
+
`ai-dossier sched requeue --issue ${entry.issue}`,
|
|
80
|
+
`ai-dossier sched abandon --issue ${entry.issue} --reason <why>`,
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* #810: what an operator can do with a batch whose `full` dissolve was
|
|
86
|
+
* refused over validated members (`blocked_reason: dissolve-refused:<why>`).
|
|
87
|
+
* Only an unattributed failure or a broken dispatch profile leaves a branch
|
|
88
|
+
* worth shipping as-is; a red suite or a partial revert does not.
|
|
89
|
+
*/
|
|
90
|
+
function dissolveRefusedNote(state, batch) {
|
|
91
|
+
const reason = batch.blocked_reason ?? '';
|
|
92
|
+
if (!reason.startsWith(recovery_1.DISSOLVE_REFUSED_PREFIX))
|
|
93
|
+
return '';
|
|
94
|
+
const validated = (0, state_1.validatedMembersOf)(state, batch);
|
|
95
|
+
if (validated.length === 0)
|
|
96
|
+
return '';
|
|
97
|
+
const why = reason.slice(recovery_1.DISSOLVE_REFUSED_PREFIX.length);
|
|
98
|
+
const branch = batch.branch ?? '<integration branch>';
|
|
99
|
+
const list = validated.map((m) => `#${m}`).join(',');
|
|
100
|
+
const shippable = why === 'unattributable-suite-failure' || why.startsWith('dispatch-profile-missing');
|
|
101
|
+
const salvage = shippable
|
|
102
|
+
? `ship them: \`gh pr create --head ${branch} --base ${batch.base_branch}\` — once it merges the engine reconciles them to shipped`
|
|
103
|
+
: `the branch is red or partly reverted — inspect it before shipping anything (fix on ${branch}, then \`gh pr create --head ${branch} --base ${batch.base_branch}\`)`;
|
|
104
|
+
return (`; validated member(s) ${list} stay landed on ${branch} — ${salvage}; or ` +
|
|
105
|
+
`\`ai-dossier sched abandon --batch ${batch.id}\` (requeues them full-cycle instead)`);
|
|
106
|
+
}
|
|
19
107
|
/**
|
|
20
108
|
* #776: how long a pause, or a live slot without progress, may last before
|
|
21
109
|
* `sched status` flags it. A day is long past every phase stall allowance
|
|
@@ -105,12 +193,197 @@ function buildStatusWarnings(state, engineLease, now) {
|
|
|
105
193
|
}
|
|
106
194
|
return warnings;
|
|
107
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Every `done` batch whose `worktree` or `member_worktree` is still set in
|
|
198
|
+
* the ledger (#791) — pure over state, exactly like `buildStatusWarnings`.
|
|
199
|
+
* A candidate is skipped when its path is ALSO held by a non-`done` (still
|
|
200
|
+
* in-flight) batch: a pool worktree the operator already returned can be
|
|
201
|
+
* re-claimed by a fresh batch before the done batch's own ledger field is
|
|
202
|
+
* cleared, and warning about a path a live batch is actively using is worse
|
|
203
|
+
* than not warning at all — it tells the operator to remove/return a
|
|
204
|
+
* worktree that is in use. Naturally bounded beyond that: only `done`
|
|
205
|
+
* batches are considered, and in practice very few ever carry a kept
|
|
206
|
+
* worktree (only the `members-closed` reconcile path leaves one).
|
|
207
|
+
*/
|
|
208
|
+
function keptWorktreeCandidates(state) {
|
|
209
|
+
const inFlightPaths = new Set();
|
|
210
|
+
for (const batch of state.batches) {
|
|
211
|
+
if (batch.status === 'done')
|
|
212
|
+
continue;
|
|
213
|
+
if (batch.worktree !== null)
|
|
214
|
+
inFlightPaths.add(batch.worktree);
|
|
215
|
+
if (batch.member_worktree !== null)
|
|
216
|
+
inFlightPaths.add(batch.member_worktree);
|
|
217
|
+
}
|
|
218
|
+
const candidates = [];
|
|
219
|
+
for (const batch of state.batches) {
|
|
220
|
+
if (batch.status !== 'done')
|
|
221
|
+
continue;
|
|
222
|
+
if (batch.worktree !== null && !inFlightPaths.has(batch.worktree)) {
|
|
223
|
+
candidates.push({
|
|
224
|
+
batch: batch.id,
|
|
225
|
+
field: 'worktree',
|
|
226
|
+
path: batch.worktree,
|
|
227
|
+
poolClaimed: batch.pool_claimed,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (batch.member_worktree !== null && !inFlightPaths.has(batch.member_worktree)) {
|
|
231
|
+
candidates.push({
|
|
232
|
+
batch: batch.id,
|
|
233
|
+
field: 'member_worktree',
|
|
234
|
+
path: batch.member_worktree,
|
|
235
|
+
poolClaimed: batch.member_pool_claimed,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return candidates;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The real {@link KeptWorktreeReader}: `exec`/`fsExists` follow the same
|
|
243
|
+
* injectable conventions as the rest of the package (`project.ts`'s
|
|
244
|
+
* `ExecFn`, `teardown.ts`'s `FsExists`) so the CLI wires in a real,
|
|
245
|
+
* bounded-timeout `git`/`fs` and every test wires in a spy instead.
|
|
246
|
+
*/
|
|
247
|
+
function defaultKeptWorktreeReader(exec, fsExists = teardown_1.defaultFsExists) {
|
|
248
|
+
return {
|
|
249
|
+
exists: fsExists,
|
|
250
|
+
hasLocalWork: (worktreePath) => {
|
|
251
|
+
// Containment: a kept path that is no longer its OWN worktree root —
|
|
252
|
+
// pruned by `git worktree prune`, or its directory reused for
|
|
253
|
+
// something else entirely — must never report the status of whatever
|
|
254
|
+
// repo git happens to find by walking up from it (#791 supportability
|
|
255
|
+
// review finding 3). `git rev-parse --show-toplevel` from inside a
|
|
256
|
+
// non-worktree directory still finds an ENCLOSING repo (this one, if
|
|
257
|
+
// the path is under it), so the toplevel must match `worktreePath`
|
|
258
|
+
// itself, not merely resolve to something.
|
|
259
|
+
const toplevel = exec('git', ['rev-parse', '--show-toplevel'], worktreePath);
|
|
260
|
+
if (toplevel === null)
|
|
261
|
+
return null;
|
|
262
|
+
let resolvedTarget;
|
|
263
|
+
let resolvedToplevel;
|
|
264
|
+
try {
|
|
265
|
+
resolvedTarget = fs.realpathSync(worktreePath);
|
|
266
|
+
resolvedToplevel = fs.realpathSync(toplevel);
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
if (resolvedTarget !== resolvedToplevel)
|
|
272
|
+
return null;
|
|
273
|
+
// `--no-optional-locks`: this worktree may be the operator's own
|
|
274
|
+
// in-progress repair work (the entire reason #768 kept it) — a plain
|
|
275
|
+
// `git status` can contend for `index.lock` with a concurrent `git
|
|
276
|
+
// add`/`commit` there (#791 supportability review finding 4); the
|
|
277
|
+
// read-only variant never takes it.
|
|
278
|
+
const status = exec('git', ['--no-optional-locks', 'status', '--porcelain'], worktreePath);
|
|
279
|
+
if (status === null)
|
|
280
|
+
return null;
|
|
281
|
+
if (status.trim().length > 0)
|
|
282
|
+
return true;
|
|
283
|
+
// Scoped to THIS worktree's own HEAD, not `--branches` (every local
|
|
284
|
+
// branch in the shared repository, #791 supportability/maintainability
|
|
285
|
+
// review): worktrees share refs, so `--branches` would mark a clean,
|
|
286
|
+
// fully-pushed kept worktree "unsafe to remove" because of an
|
|
287
|
+
// unrelated unpushed branch sitting in a completely different
|
|
288
|
+
// worktree.
|
|
289
|
+
const unpushed = exec('git', ['log', 'HEAD', '--not', '--remotes', '--oneline'], worktreePath);
|
|
290
|
+
if (unpushed === null)
|
|
291
|
+
return null;
|
|
292
|
+
return unpushed.trim().length > 0;
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
/** Shell-quote `s` for a copy-pasteable remedy command (#791 security review) — passthrough when already shell-safe. */
|
|
297
|
+
function shellQuote(s) {
|
|
298
|
+
return /^[A-Za-z0-9_./-]+$/.test(s) ? s : `'${s.replace(/'/g, `'\\''`)}'`;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* The `git worktree remove` / `worktree-pool return` remedy text for a
|
|
302
|
+
* candidate — never executed here, only printed. The pool invocation is
|
|
303
|
+
* built from `teardown.ts`'s own `POOL_BIN`/`POOL_ARGS_PREFIX` (the same
|
|
304
|
+
* `npx -y @ai-dossier/worktree-pool@^0.7.0` pin teardown.ts actually runs),
|
|
305
|
+
* not a hand-written `ai-dossier worktree-pool` string — that binary does
|
|
306
|
+
* not exist (#791 DRY/documentation review).
|
|
307
|
+
*/
|
|
308
|
+
function keptWorktreeRemedy(candidate) {
|
|
309
|
+
const path = shellQuote(candidate.path);
|
|
310
|
+
return candidate.poolClaimed
|
|
311
|
+
? `${teardown_1.POOL_BIN} ${teardown_1.POOL_ARGS_PREFIX.join(' ')} return --path ${path}`
|
|
312
|
+
: `git worktree remove ${path}`;
|
|
313
|
+
}
|
|
314
|
+
/** Per-run cap on how many kept-worktree candidates get probed with real git calls (#791 supportability review finding 7) — `sched status` must stay fast even with many leftovers. */
|
|
315
|
+
exports.KEPT_WORKTREE_PROBE_LIMIT = 10;
|
|
316
|
+
/** One `{ kind: 'kept-worktree', ... }` warning — the shared literal shape every branch below returns (#791 maintainability review finding 5). */
|
|
317
|
+
function keptWorktreeWarning(candidate, detail, remedy) {
|
|
318
|
+
const poolNote = candidate.poolClaimed ? ' (pool claim held indefinitely)' : '';
|
|
319
|
+
return {
|
|
320
|
+
kind: 'kept-worktree',
|
|
321
|
+
message: `batch ${candidate.batch} is done but its ${candidate.field} ${candidate.path} is still held${poolNote} — ${detail}`,
|
|
322
|
+
remedy,
|
|
323
|
+
batch: candidate.batch,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Turn kept-worktree candidates into `StatusWarning`s (#791) — pure given
|
|
328
|
+
* the reader, exactly like `buildStatusWarnings` is pure given the state
|
|
329
|
+
* and lease. A reader call that throws is caught defensively (a hostile or
|
|
330
|
+
* buggy injected reader must never crash `sched status`) and routed to the
|
|
331
|
+
* SAME "could not be checked" outcome as a reader returning `null` — a
|
|
332
|
+
* thrown `exists()` must never read as "gone", which would tell an operator
|
|
333
|
+
* there is nothing left to do when the truth is simply unknown (#791
|
|
334
|
+
* maintainability review finding 3).
|
|
335
|
+
*/
|
|
336
|
+
function buildKeptWorktreeWarnings(candidates, reader) {
|
|
337
|
+
const probed = candidates.slice(0, exports.KEPT_WORKTREE_PROBE_LIMIT);
|
|
338
|
+
const overflow = candidates.slice(exports.KEPT_WORKTREE_PROBE_LIMIT);
|
|
339
|
+
const warnings = probed.map((candidate) => {
|
|
340
|
+
let exists;
|
|
341
|
+
let existsChecked = true;
|
|
342
|
+
try {
|
|
343
|
+
exists = reader.exists(candidate.path);
|
|
344
|
+
}
|
|
345
|
+
catch {
|
|
346
|
+
exists = false;
|
|
347
|
+
existsChecked = false;
|
|
348
|
+
}
|
|
349
|
+
if (!existsChecked) {
|
|
350
|
+
return keptWorktreeWarning(candidate, 'whether the path still exists could not be checked', `inspect ${shellQuote(candidate.path)} manually — if it is gone, no cleanup is needed; if clear, \`${keptWorktreeRemedy(candidate)}\``);
|
|
351
|
+
}
|
|
352
|
+
if (!exists) {
|
|
353
|
+
return keptWorktreeWarning(candidate, 'the path no longer exists on disk — the engine clears this ledger entry automatically once it re-confirms on its next tick', candidate.poolClaimed
|
|
354
|
+
? 'no local cleanup needed for now — if this persists past the next tick, check `worktree-pool status` for the claim'
|
|
355
|
+
: 'no local cleanup needed — the worktree is already gone');
|
|
356
|
+
}
|
|
357
|
+
let hasLocalWork;
|
|
358
|
+
try {
|
|
359
|
+
hasLocalWork = reader.hasLocalWork(candidate.path);
|
|
360
|
+
}
|
|
361
|
+
catch {
|
|
362
|
+
hasLocalWork = null;
|
|
363
|
+
}
|
|
364
|
+
const removeCmd = keptWorktreeRemedy(candidate);
|
|
365
|
+
if (hasLocalWork === null) {
|
|
366
|
+
return keptWorktreeWarning(candidate, 'local git status could not be checked', `inspect ${shellQuote(candidate.path)} manually before removing (git probe failed) — if clear, \`${removeCmd}\``);
|
|
367
|
+
}
|
|
368
|
+
if (hasLocalWork) {
|
|
369
|
+
return keptWorktreeWarning(candidate, 'it has uncommitted changes or commits not on any remote branch', `commit/push first, then \`${removeCmd}\``);
|
|
370
|
+
}
|
|
371
|
+
return keptWorktreeWarning(candidate, 'it is clean and fully pushed', removeCmd);
|
|
372
|
+
});
|
|
373
|
+
for (const candidate of overflow) {
|
|
374
|
+
warnings.push(keptWorktreeWarning(candidate, `not probed (over the ${exports.KEPT_WORKTREE_PROBE_LIMIT}-candidate limit this run)`, 're-run `sched status` after clearing some of the other kept worktrees, or inspect it manually'));
|
|
375
|
+
}
|
|
376
|
+
return warnings;
|
|
377
|
+
}
|
|
108
378
|
function buildStatusReport(state, config, project, engineLease = null, now = new Date(),
|
|
109
379
|
/** #768: the opt-in anchor sweep's GitHub/git readers; omitted → `anchors: null`. */
|
|
110
|
-
anchorSweep
|
|
380
|
+
anchorSweep,
|
|
381
|
+
/** #791: the opt-in kept-worktree reader; omitted → no `kept-worktree` warnings (zero behavior change for every existing caller). */
|
|
382
|
+
worktreeReader) {
|
|
111
383
|
const blocked = [];
|
|
112
384
|
const failed = [];
|
|
113
385
|
const stopped = [];
|
|
386
|
+
const parkedMembers = [];
|
|
114
387
|
const describeBlocker = (b) => b.reason === 'not-in-queue'
|
|
115
388
|
? `dependency #${b.dep} is not in the queue`
|
|
116
389
|
: `dependency #${b.dep} not merged (status: ${b.depStatus ?? 'unknown'})`;
|
|
@@ -134,6 +407,10 @@ anchorSweep) {
|
|
|
134
407
|
if (types_1.TERMINAL_ISSUE_STATUSES.has(entry.status) || types_1.SATISFIED_ISSUE_STATUSES.has(entry.status)) {
|
|
135
408
|
continue;
|
|
136
409
|
}
|
|
410
|
+
if (state_1.PARKED_MEMBER_STATUSES.has(entry.status)) {
|
|
411
|
+
parkedMembers.push(parkedMemberItem(entry));
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
137
414
|
if (entry.mode === 'full') {
|
|
138
415
|
if (readiness_1.DISPATCHABLE_ISSUE_STATUSES.has(entry.status)) {
|
|
139
416
|
const blockers = (0, readiness_1.dependencyBlockers)(state, entry);
|
|
@@ -172,10 +449,11 @@ anchorSweep) {
|
|
|
172
449
|
for (const batch of state.batches) {
|
|
173
450
|
if (batch.status !== 'blocked')
|
|
174
451
|
continue;
|
|
452
|
+
const validatedNote = dissolveRefusedNote(state, batch);
|
|
175
453
|
blocked.push({
|
|
176
454
|
issue: batch.anchor ?? batch.members[batch.executing_member - 1] ?? -1,
|
|
177
455
|
status: 'batch-blocked',
|
|
178
|
-
reason: batch.blocked_reason ?? 'unknown'
|
|
456
|
+
reason: `${batch.blocked_reason ?? 'unknown'}${validatedNote}`,
|
|
179
457
|
});
|
|
180
458
|
}
|
|
181
459
|
const units = state.paused ? [] : (0, readiness_1.runnableUnits)(state);
|
|
@@ -209,6 +487,7 @@ anchorSweep) {
|
|
|
209
487
|
// duplicates — nothing rewrites them).
|
|
210
488
|
batches: state.batches.map((b) => ({ ...b, evictions: (0, state_1.distinctEvictions)(b.evictions) })),
|
|
211
489
|
parked,
|
|
490
|
+
parked_members: parkedMembers,
|
|
212
491
|
last_pr_poll_at: state.last_pr_poll_at,
|
|
213
492
|
last_label_poll_at: state.last_label_poll_at,
|
|
214
493
|
dispatch_health: {
|
|
@@ -224,7 +503,15 @@ anchorSweep) {
|
|
|
224
503
|
blocked,
|
|
225
504
|
failed,
|
|
226
505
|
stopped,
|
|
227
|
-
warnings:
|
|
506
|
+
warnings: [
|
|
507
|
+
...buildStatusWarnings(state, engineLease, now),
|
|
508
|
+
// #791: omitted unless the caller supplies a reader — same opt-in-by-
|
|
509
|
+
// omission shape as the anchor sweep below, so every pre-existing
|
|
510
|
+
// caller/test sees zero behavior change.
|
|
511
|
+
...(worktreeReader !== undefined
|
|
512
|
+
? buildKeptWorktreeWarnings(keptWorktreeCandidates(state), worktreeReader)
|
|
513
|
+
: []),
|
|
514
|
+
],
|
|
228
515
|
anchors: anchorSweep !== undefined
|
|
229
516
|
? (0, anchor_close_1.sweepAnchors)(state, anchorSweep.read, {
|
|
230
517
|
repo: anchorSweep.repo,
|
package/dist/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA8KH,kDAuEC;AAED,8CAmJC;AAxYD,iDAKwB;AACxB,yCAKoB;AACpB,uCAAwC;AAExC,2CAKqB;AACrB,mCAA4C;AAU5C,mCAAgG;AAiBhG;;;;;GAKG;AACU,QAAA,4BAA4B,GAAG,EAAE,GAAG,EAAE,GAAG,EA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KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAC7D;QACD,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE;QAC1D,OAAO;QACP,MAAM;QACN,OAAO;QACP,QAAQ,EAAE;YACR,GAAG,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC;YAC/C,sEAAsE;YACtE,kEAAkE;YAClE,yCAAyC;YACzC,GAAG,CAAC,cAAc,KAAK,SAAS;gBAC9B,CAAC,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;gBAC1E,CAAC,CAAC,EAAE,CAAC;SACR;QACD,OAAO,EACL,WAAW,KAAK,SAAS;YACvB,CAAC,CAAC,IAAA,2BAAY,EAAC,KAAK,EAAE,WAAW,CAAC,IAAI,EAAE;gBACpC,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,YAAY,EAAE,WAAW,CAAC,YAAY;aACvC,CAAC;YACJ,CAAC,CAAC,IAAI;KACX,CAAC;AACJ,CAAC"}
|
package/dist/teardown.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export interface TeardownResult {
|
|
|
53
53
|
}
|
|
54
54
|
/** Whether a path exists (injectable so tests need no filesystem). */
|
|
55
55
|
export type FsExists = (p: string) => boolean;
|
|
56
|
+
/** The real `FsExists` — `fs.existsSync`, never throwing. Shared default so it is defined once (#791 DRY review). */
|
|
57
|
+
export declare const defaultFsExists: FsExists;
|
|
56
58
|
/**
|
|
57
59
|
* Containment check for a worktree path recovered from an issue comment
|
|
58
60
|
* (#468): the path must be absolute and fully resolved (no `..`/`.`/symlink
|
|
@@ -72,4 +74,11 @@ export declare function isSafeWorktree(repoRoot: string, worktree: string): bool
|
|
|
72
74
|
* `failed-missing-setup-info` case — this function always has one.
|
|
73
75
|
*/
|
|
74
76
|
export declare function runTeardown(exec: ExecFn, repoDir: string, info: SetupInfo, fsExists?: FsExists): TeardownResult;
|
|
77
|
+
/**
|
|
78
|
+
* The pool entry status (`warm`/`assigned`/…) for `worktree`, or null when
|
|
79
|
+
* absent/unparseable. Exported (#791) so a caller can tell "the pool already
|
|
80
|
+
* shows this path returned" from ledger-observed state alone, without
|
|
81
|
+
* duplicating the `worktree-pool status --json` parse.
|
|
82
|
+
*/
|
|
83
|
+
export declare function poolEntryFor(statusJson: string, worktree: string): string | null;
|
|
75
84
|
//# sourceMappingURL=teardown.d.ts.map
|
package/dist/teardown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teardown.d.ts","sourceRoot":"","sources":["../src/teardown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,+HAA+H;AAC/H,eAAO,MAAM,mBAAmB,SAAU,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,gBAAgB,UAA6C,CAAC;AAE3E,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,OAAO,EAAE,aAAa,CAAC;IACvB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,sEAAsE;AACtE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAM1E;AAsBD;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,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= (this && this.__importStar) || (function () {
|
|
|
56
56
|
};
|
|
57
57
|
})();
|
|
58
58
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
exports.POOL_ARGS_PREFIX = exports.POOL_BIN = exports.TEARDOWN_TIMEOUT_MS = void 0;
|
|
59
|
+
exports.defaultFsExists = exports.POOL_ARGS_PREFIX = exports.POOL_BIN = exports.TEARDOWN_TIMEOUT_MS = void 0;
|
|
60
60
|
exports.isSafeWorktree = isSafeWorktree;
|
|
61
61
|
exports.runTeardown = runTeardown;
|
|
62
|
+
exports.poolEntryFor = poolEntryFor;
|
|
62
63
|
const fs = __importStar(require("node:fs"));
|
|
63
64
|
const path = __importStar(require("node:path"));
|
|
64
65
|
/** Timeout for teardown subprocesses — pool return shells out through npx and recycles a worktree (git ops), which is slow. */
|
|
@@ -81,6 +82,16 @@ exports.TEARDOWN_TIMEOUT_MS = 120_000;
|
|
|
81
82
|
*/
|
|
82
83
|
exports.POOL_BIN = 'npx';
|
|
83
84
|
exports.POOL_ARGS_PREFIX = ['-y', '@ai-dossier/worktree-pool@^0.7.0'];
|
|
85
|
+
/** The real `FsExists` — `fs.existsSync`, never throwing. Shared default so it is defined once (#791 DRY review). */
|
|
86
|
+
const defaultFsExists = (p) => {
|
|
87
|
+
try {
|
|
88
|
+
return fs.existsSync(p);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.defaultFsExists = defaultFsExists;
|
|
84
95
|
/**
|
|
85
96
|
* Containment check for a worktree path recovered from an issue comment
|
|
86
97
|
* (#468): the path must be absolute and fully resolved (no `..`/`.`/symlink
|
|
@@ -126,14 +137,7 @@ function listedAsWorktree(exec, repoDir, worktree) {
|
|
|
126
137
|
* setup milestone (groundtruth.setupInfo); a missing `info` is the caller's
|
|
127
138
|
* `failed-missing-setup-info` case — this function always has one.
|
|
128
139
|
*/
|
|
129
|
-
function runTeardown(exec, repoDir, info, fsExists =
|
|
130
|
-
try {
|
|
131
|
-
return fs.existsSync(p);
|
|
132
|
-
}
|
|
133
|
-
catch {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
}) {
|
|
140
|
+
function runTeardown(exec, repoDir, info, fsExists = exports.defaultFsExists) {
|
|
137
141
|
// The worktree path originates from an issue comment written by the spawned
|
|
138
142
|
// agent — validate it before any destructive subprocess (CWE-22).
|
|
139
143
|
if (info.worktree.includes('\0') || !path.isAbsolute(info.worktree)) {
|
|
@@ -210,7 +214,12 @@ function worktreeRemove(exec, repoDir, worktree, fsExists) {
|
|
|
210
214
|
}
|
|
211
215
|
return { cleanup: 'done', detail: 'worktree removed' };
|
|
212
216
|
}
|
|
213
|
-
/**
|
|
217
|
+
/**
|
|
218
|
+
* The pool entry status (`warm`/`assigned`/…) for `worktree`, or null when
|
|
219
|
+
* absent/unparseable. Exported (#791) so a caller can tell "the pool already
|
|
220
|
+
* shows this path returned" from ledger-observed state alone, without
|
|
221
|
+
* duplicating the `worktree-pool status --json` parse.
|
|
222
|
+
*/
|
|
214
223
|
function poolEntryFor(statusJson, worktree) {
|
|
215
224
|
try {
|
|
216
225
|
const parsed = JSON.parse(statusJson);
|
package/dist/teardown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teardown.js","sourceRoot":"","sources":["../src/teardown.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"teardown.js","sourceRoot":"","sources":["../src/teardown.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DH,wCAMC;AA2BD,kCA2BC;AA4ED,oCAeC;AAnND,4CAA8B;AAC9B,gDAAkC;AAKlC,+HAA+H;AAClH,QAAA,mBAAmB,GAAG,OAAO,CAAC;AAE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CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -31,14 +31,18 @@ export type ReviewLevel = 'light' | 'full';
|
|
|
31
31
|
* slot: → batched(b) → waiting → in-work → committed(range) → validated
|
|
32
32
|
* → shipped-in-batch → done
|
|
33
33
|
* failure edges (any state):
|
|
34
|
-
*
|
|
34
|
+
* batched…committed → evicted(reason) | handed-back(reason) (#810: PARKED —
|
|
35
|
+
* never auto-dispatched) → requeued{full} only by an operator's
|
|
36
|
+
* `sched requeue` (or `sched abandon --batch`)
|
|
37
|
+
* validated → evicted → requeued{full} (aggregate-suite eviction: commits
|
|
38
|
+
* reverted, requeued by `evictMembers`)
|
|
35
39
|
* any → blocked(dep-failed) | decision-pending | failed(escalation-cap)
|
|
36
40
|
* failed(auto-merge-blocked) → shipped (#501 stale-failure reconcile —
|
|
37
41
|
* the ONE edge out of `failed`, engine-guarded to that one reason; see
|
|
38
42
|
* `state.ts`'s `ISSUE_BASE_TRANSITIONS.failed`)
|
|
39
43
|
* ```
|
|
40
44
|
*/
|
|
41
|
-
export type IssueStatus = 'queued' | 'classified' | 'dispatched' | 'parked' | 'shipped' | 'done' | 'batched' | 'waiting' | 'in-work' | 'committed' | 'validated' | 'shipped-in-batch' | 'evicted' | 'requeued' | 'blocked' | 'decision-pending' | 'failed' | 'stopped';
|
|
45
|
+
export type IssueStatus = 'queued' | 'classified' | 'dispatched' | 'parked' | 'shipped' | 'done' | 'batched' | 'waiting' | 'in-work' | 'committed' | 'validated' | 'shipped-in-batch' | 'evicted' | 'handed-back' | 'requeued' | 'blocked' | 'decision-pending' | 'failed' | 'stopped';
|
|
42
46
|
/**
|
|
43
47
|
* Issue statuses the normal rails never leave: `done` is absolute, and
|
|
44
48
|
* `failed` has exactly one escape hatch (`failed → shipped`, #501's
|
|
@@ -110,8 +114,30 @@ export interface FailureEvidence {
|
|
|
110
114
|
attribution: AttributionMethod;
|
|
111
115
|
/** Commits reverted out of the batch branch for this member. */
|
|
112
116
|
reverted_commits: string[];
|
|
117
|
+
/**
|
|
118
|
+
* #810: the member branch holding the member's un-landed work, when it had
|
|
119
|
+
* one (`batch/<id>-m<i>-<issue>`; the REMOTE copy survives teardown). A
|
|
120
|
+
* full-cycle requeue of a parked member continues from this branch instead
|
|
121
|
+
* of starting from the base. Absent on records written before #810 and on
|
|
122
|
+
* post-landing evictions (the member branch was deleted when it landed).
|
|
123
|
+
*/
|
|
124
|
+
branch?: string | null;
|
|
113
125
|
at: string;
|
|
114
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* #810: how a member left its batch before landing — also the two PARKED
|
|
129
|
+
* issue statuses. `evicted` is a failure the ENGINE decided (unverified exit,
|
|
130
|
+
* incremental-gate task-failed, landing conflict, worktree prep, or an
|
|
131
|
+
* in-flight member of a dissolve) and counts toward the dissolve threshold;
|
|
132
|
+
* `handed-back` is the MEMBER's own explicit terminal hand-back (a `blocked`
|
|
133
|
+
* or `review partial` milestone it posted) — a valued outcome, never counted.
|
|
134
|
+
* (Aggregate-suite attribution evictions — `evictMembers`, after landing —
|
|
135
|
+
* revert the member's commits and still requeue it full-cycle: its member
|
|
136
|
+
* branch was deleted when it landed, so there is no branch to park it on.)
|
|
137
|
+
*/
|
|
138
|
+
export declare const MEMBER_EXIT_KINDS: readonly ["evicted", "handed-back"];
|
|
139
|
+
/** See {@link MEMBER_EXIT_KINDS}. */
|
|
140
|
+
export type MemberExitKind = (typeof MEMBER_EXIT_KINDS)[number];
|
|
115
141
|
/**
|
|
116
142
|
* One eviction, kept on the batch for the batch report and as the classifier
|
|
117
143
|
* feedback signal (RFC-0001 §D.4 audit, AC5 "per-member outcome recorded").
|
|
@@ -123,6 +149,14 @@ export interface EvictionRecord {
|
|
|
123
149
|
reverted_commits: string[];
|
|
124
150
|
/** Members evicted alongside it because they share an eviction group (§E.4). */
|
|
125
151
|
group: number[];
|
|
152
|
+
/**
|
|
153
|
+
* #810: `handed-back` records are the member's own hand-back — they take the
|
|
154
|
+
* member out of the batch like an eviction but never count toward the
|
|
155
|
+
* dissolve threshold. Absent = `evicted` (every record before #810).
|
|
156
|
+
*/
|
|
157
|
+
kind?: MemberExitKind;
|
|
158
|
+
/** #810: the member branch holding its un-landed work (see `FailureEvidence.branch`). */
|
|
159
|
+
branch?: string | null;
|
|
126
160
|
at: string;
|
|
127
161
|
}
|
|
128
162
|
/** The one bounded fix attempt a member gets before it is evicted (§F.2). */
|
|
@@ -452,7 +486,8 @@ export interface BatchEntry {
|
|
|
452
486
|
* name that no longer resolves against the CURRENT config never silently
|
|
453
487
|
* falls back — the silent fallback is the #680 incident shape: pre-merge
|
|
454
488
|
* the batch DISSOLVES with reason `dispatch-profile-missing:<name>`
|
|
455
|
-
* (members requeue as full-cycle units on the config default
|
|
489
|
+
* (members requeue as full-cycle units on the config default — #810:
|
|
490
|
+
* in-flight ones park on it, and validated members block the batch), post-merge
|
|
456
491
|
* the remaining tail work runs on the default with a journaled
|
|
457
492
|
* `dispatch-profile-missing` event. Added in schema 1.19.0; 1.18.0
|
|
458
493
|
* batches backfill to null.
|
|
@@ -1184,8 +1219,13 @@ export declare const JOURNAL_DEDUP_REANNOUNCE_TICKS = 20;
|
|
|
1184
1219
|
* at the executing claim) and `member_runs` (parallel members' own
|
|
1185
1220
|
* branch/worktree/status); `null`/`[]` backfilled on load — a null mode past
|
|
1186
1221
|
* `ready` reads as serial, so batches in flight keep their serial rail.
|
|
1222
|
+
* 1.24.0 (#810): `IssueStatus` gains `handed-back`; `EvictionRecord` gains
|
|
1223
|
+
* optional `kind`/`branch` and `FailureEvidence` optional `branch` (absent =
|
|
1224
|
+
* a pre-#810 record with no recorded branch). Bumped so an older engine
|
|
1225
|
+
* refuses a state carrying a `handed-back` member with `EngineTooOldError`
|
|
1226
|
+
* instead of an opaque invalid-status error.
|
|
1187
1227
|
*/
|
|
1188
|
-
export declare const SCHEMA_VERSION: "1.
|
|
1228
|
+
export declare const SCHEMA_VERSION: "1.24.0";
|
|
1189
1229
|
/** Schema versions `validateState` accepts on load (migrated to SCHEMA_VERSION on save). */
|
|
1190
1230
|
export declare const LEGACY_SCHEMA_VERSIONS: readonly string[];
|
|
1191
1231
|
export declare const CONFIG_SCHEMA_VERSION: "1.9.0";
|
|
@@ -1258,7 +1298,7 @@ export declare class EngineTooOldError extends Error {
|
|
|
1258
1298
|
* (since #507) by `sched enqueue` itself, before any dispatch: see the
|
|
1259
1299
|
* `label-blocked`/`label-check-failed` group below.
|
|
1260
1300
|
*/
|
|
1261
|
-
export type JournalEventName = 'assigned' | 'spawned' | 'exit-detected' | 'orphan-pid' | 'external-advance' | 'progress' | 'phase-updated' | 'verify-complete' | 'verify-incomplete' | 'stalled' | 'redispatched' | 'unit-failed' | 'member-advance-skipped' | 'dependents-blocked' | 'dispatch-profile-missing' | 'slot-released' | 'requeued' | 'ground-truth-unreachable' | 'suspect-dispatch' | 'dispatch-unhealthy' | 'dispatch-failure' | 'tick-failed' | 'pr-parked' | 'merge-accepted' | 'pr-watch-failed' | 'pr-watch-waiting' | 'teardown-done' | 'teardown-failed' | 'report-dispatched' | 'report-failed' | 'stale-failure-reconciled' | 'anchor-closed' | 'anchor-close-failed' | 'suite-failed' | 'git-failed' | 'attributed' | 'fix-dispatched' | 'fix-resolved' | 'member-evicted' | 'revert-conflict' | 'batch-rebased' | 'batch-dissolved' | 'batch-preserved' | 'batch-split' | 'batch-blocked' | 'gate-inconclusive' | 'gate-skipped' | 'milestone-post-failed' | 'fence-written' | 'fence-failed' | 'stale-closed' | 'fence-bound' | 'fence-bind-failed' | 'fence-released' | 'fence-release-failed' | 'deferred-to-owner' | 'announced-wait' | 'stopped' | 'batch-setup-done' | 'batch-setup-failed' | 'batch-warmup-done' | 'batch-warmup-failed' | 'member-advanced' | 'member-worktree-reused' | 'member-landed' | 'landing-failed' | 'member-worktree-torn-down' | 'stale-member-worktree' | 'label-blocked' | 'label-check-failed' | 'label-cleared' | 'run-log-skipped' | 'run-log-recorded' | 'run-log-no-usage' | 'run-log-failed' | 'engine-stale' | 'engine-auto-upgrade-attempted' | 'engine-auto-upgrade-failed' | 'reprioritized' | 'stale-milestone-ignored' | 'eviction-duplicate';
|
|
1301
|
+
export type JournalEventName = 'assigned' | 'spawned' | 'exit-detected' | 'orphan-pid' | 'external-advance' | 'progress' | 'phase-updated' | 'verify-complete' | 'verify-incomplete' | 'stalled' | 'redispatched' | 'unit-failed' | 'member-advance-skipped' | 'dependents-blocked' | 'dispatch-profile-missing' | 'slot-released' | 'requeued' | 'ground-truth-unreachable' | 'suspect-dispatch' | 'dispatch-unhealthy' | 'dispatch-failure' | 'tick-failed' | 'pr-parked' | 'merge-accepted' | 'pr-watch-failed' | 'pr-watch-waiting' | 'teardown-done' | 'teardown-failed' | 'report-dispatched' | 'report-failed' | 'stale-failure-reconciled' | 'anchor-closed' | 'anchor-close-failed' | 'suite-failed' | 'git-failed' | 'attributed' | 'fix-dispatched' | 'fix-resolved' | 'member-evicted' | 'revert-conflict' | 'batch-rebased' | 'batch-dissolved' | 'batch-preserved' | 'batch-split' | 'batch-blocked' | 'gate-inconclusive' | 'gate-skipped' | 'milestone-post-failed' | 'fence-written' | 'fence-failed' | 'stale-closed' | 'fence-bound' | 'fence-bind-failed' | 'fence-released' | 'fence-release-failed' | 'deferred-to-owner' | 'announced-wait' | 'stopped' | 'batch-setup-done' | 'batch-setup-failed' | 'batch-warmup-done' | 'batch-warmup-failed' | 'member-advanced' | 'member-worktree-reused' | 'member-landed' | 'landing-failed' | 'member-worktree-torn-down' | 'stale-member-worktree' | 'label-blocked' | 'label-check-failed' | 'label-cleared' | 'run-log-skipped' | 'run-log-recorded' | 'run-log-no-usage' | 'run-log-failed' | 'engine-stale' | 'engine-auto-upgrade-attempted' | 'engine-auto-upgrade-failed' | 'reprioritized' | 'stale-milestone-ignored' | 'eviction-duplicate' | 'member-handed-back' | 'dissolve-suppressed' | 'member-requeued' | 'kept-worktree-cleared';
|
|
1262
1302
|
/**
|
|
1263
1303
|
* The closed `reason` vocabulary a `slot-released` event carries (#525) —
|
|
1264
1304
|
* one entry per per-issue terminal path `walkSlotToIdle` can be released
|