@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/scheduler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../src/scheduler.ts"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AE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAoC3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,SAAqB,EAC3B,GAAG,GAAE,IAAiB,GACrB;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAe1C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAmBhG;AAED,mGAAmG;AACnG,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,UAAU,CAeZ"}
|
package/dist/scheduler.js
CHANGED
|
@@ -20,6 +20,7 @@ exports.abandonIssue = abandonIssue;
|
|
|
20
20
|
exports.stopIssue = stopIssue;
|
|
21
21
|
exports.stopBatch = stopBatch;
|
|
22
22
|
exports.abandonBatch = abandonBatch;
|
|
23
|
+
exports.requeueParkedMember = requeueParkedMember;
|
|
23
24
|
exports.reprioritizeIssue = reprioritizeIssue;
|
|
24
25
|
exports.reprioritizeBatch = reprioritizeBatch;
|
|
25
26
|
const enqueue_1 = require("./enqueue");
|
|
@@ -282,6 +283,31 @@ function abandonBatch(state, batchId, reason = 'batch abandoned', now = new Date
|
|
|
282
283
|
}
|
|
283
284
|
return { state: next, requeued };
|
|
284
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* `sched requeue --issue N` (#810): the operator's decision on a PARKED batch
|
|
288
|
+
* member (`evicted` / `handed-back`) — put it back on the queue as a
|
|
289
|
+
* full-cycle unit. The entry keeps the dispatch profile stamped at park time
|
|
290
|
+
* (`requeueMember` never re-derives a parked entry's profile — a
|
|
291
|
+
* `dispatch-profile-missing` park is deliberately `null`) and its `failure_evidence`,
|
|
292
|
+
* whose `branch` makes the engine's cycle prompt continue from the member
|
|
293
|
+
* branch instead of the base. Refuses any entry that is not parked: this is
|
|
294
|
+
* a remedy for the park rail, not a general re-run lever.
|
|
295
|
+
*/
|
|
296
|
+
function requeueParkedMember(state, issue, reason = 'operator-requeue', now = new Date()) {
|
|
297
|
+
const entry = state.entries.find((e) => e.issue === issue);
|
|
298
|
+
if (!entry) {
|
|
299
|
+
throw new types_1.SchedNotFoundError(`Queue entry not found: ${issue}`);
|
|
300
|
+
}
|
|
301
|
+
if (!state_1.PARKED_MEMBER_STATUSES.has(entry.status)) {
|
|
302
|
+
throw new types_1.SchedNotFoundError(`Issue ${issue} is ${entry.status}, not a parked batch member (evicted / handed-back) — ` +
|
|
303
|
+
'nothing to requeue; `sched status` lists the parked members');
|
|
304
|
+
}
|
|
305
|
+
const result = (0, state_1.requeueMember)(state, issue, { mode: 'full', batch: null }, reason, now);
|
|
306
|
+
const requeued = (0, state_1.findEntry)(result.state, issue);
|
|
307
|
+
if (!requeued)
|
|
308
|
+
throw new types_1.SchedNotFoundError(`Queue entry not found: ${issue}`);
|
|
309
|
+
return { state: result.state, entry: requeued };
|
|
310
|
+
}
|
|
285
311
|
/**
|
|
286
312
|
* `sched reprioritize --issue N --priority P` (#565): adjust a queued unit's
|
|
287
313
|
* assignment weight in place — no abandon/re-enqueue round trip, which would
|
package/dist/scheduler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../src/scheduler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAmEH,gDAsCC;AAGD,oCAGC;AAaD,4CAmCC;AAeD,8BAgBC;AAQD,oCA0BC;AAOD,8BAkCC;AAOD,8BAwBC;AAOD,oCAyCC;AAeD,8CAmBC;AAGD,8CAmBC;AA9YD,uCAAkC;AAClC,2CAMqB;AAmBuB,8FAxB1C,yBAAa,OAwB0C;AAAjC,mGAtBtB,8BAAk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AAO,eAAe,KAAK,CAAC,MAAM,4BAA4B,CACxE,CAAC;IACJ,CAAC;IACD,IAAA,eAAK,EAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC;IACpC,OAAO;QACL,GAAG,KAAK;QACR,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/E,CAAC;AACJ,CAAC"}
|
package/dist/state.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* decision-pending | failed(escalation-cap)" — encoded generically for every
|
|
9
9
|
* non-terminal issue status rather than repeated per row.
|
|
10
10
|
*/
|
|
11
|
-
import { type BatchEntry, type BatchStatus, type CycleMode, type EvictionRecord, type FailureEvidence, type IssueStatus, type QueueEntry, type SchedState, type SlotEntry, type SlotStatus } from './types';
|
|
11
|
+
import { type BatchEntry, type BatchStatus, type CycleMode, type EvictionRecord, type FailureEvidence, type IssueStatus, type MemberExitKind, type QueueEntry, type SchedState, type SlotEntry, type SlotStatus } from './types';
|
|
12
12
|
/**
|
|
13
13
|
* Failure edges RFC-0001 §D.1 attaches to ANY state (blocked / decision-pending / failed).
|
|
14
14
|
* Exported because a member sitting in one of them is a failure trail — #768's
|
|
@@ -223,15 +223,19 @@ export declare function duplicateEvictionDetail(issue: number, reason: string, p
|
|
|
223
223
|
* (RFC-0001 §D.1 "in-work/committed → evicted(reason) → requeued", §F.8
|
|
224
224
|
* "nothing green is discarded").
|
|
225
225
|
*
|
|
226
|
-
* The single requeue path
|
|
227
|
-
*
|
|
228
|
-
*
|
|
226
|
+
* The single requeue path — `abandonBatch` (operator dissolve), an operator's
|
|
227
|
+
* `sched requeue` of a parked member (`requeueParkedMember`, #810), the
|
|
228
|
+
* aggregate-suite eviction (`evictMembers`), and a dissolve's unstarted
|
|
229
|
+
* members / half-batch split (#472) — so the "which edge applies from here?"
|
|
230
|
+
* question is answered once. (Per-member evictions and hand-backs on the
|
|
231
|
+
* executing rail PARK through `parkMember` instead, #810.)
|
|
229
232
|
*
|
|
230
233
|
* - already terminal or shipped → left alone, `requeued: false`
|
|
231
234
|
* - never reached the batch rail (`queued`/`classified`), or already on the
|
|
232
235
|
* requeue rail (`requeued`) → metadata retag only; there is no status edge to
|
|
233
236
|
* take, and re-transitioning `requeued → requeued` would throw
|
|
234
|
-
* - `evicted` → the one remaining edge,
|
|
237
|
+
* - parked (`evicted` / `handed-back`) → the one remaining edge, `→ requeued`
|
|
238
|
+
* — keeping the dispatch profile stamped at park time (#810)
|
|
235
239
|
* - anything else active → the full failure rail, `→ evicted → requeued`
|
|
236
240
|
*
|
|
237
241
|
* `target` is where the member goes next: full-cycle (`{ mode: 'full', batch:
|
|
@@ -240,12 +244,69 @@ export declare function duplicateEvictionDetail(issue: number, reason: string, p
|
|
|
240
244
|
export declare function requeueMember(state: SchedState, issue: number, target: {
|
|
241
245
|
mode: CycleMode;
|
|
242
246
|
batch: string | null;
|
|
243
|
-
}, reason: string, now?: Date, extra?: {
|
|
244
|
-
failure_evidence?: FailureEvidence | null;
|
|
245
|
-
}): {
|
|
247
|
+
}, reason: string, now?: Date, extra?: MemberExitExtra): {
|
|
246
248
|
state: SchedState;
|
|
247
249
|
requeued: boolean;
|
|
248
250
|
};
|
|
251
|
+
/**
|
|
252
|
+
* #810: the statuses a batch member is PARKED in — out of its batch, its work
|
|
253
|
+
* (if any) on its member branch, and never auto-dispatched until an operator
|
|
254
|
+
* decides (`sched requeue` / `sched abandon`).
|
|
255
|
+
*/
|
|
256
|
+
export declare const PARKED_MEMBER_STATUSES: ReadonlySet<IssueStatus>;
|
|
257
|
+
/**
|
|
258
|
+
* Optional fields a member exit carries onto its entry (#810): the evidence
|
|
259
|
+
* (reason, member branch) and — only to override the default — the dispatch
|
|
260
|
+
* profile (`null` = the config default).
|
|
261
|
+
*/
|
|
262
|
+
export interface MemberExitExtra {
|
|
263
|
+
failure_evidence?: FailureEvidence | null;
|
|
264
|
+
dispatch_profile?: string | null;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* The `failure_evidence` a pre-landing member exit records (#810): no failing
|
|
268
|
+
* tests, no attribution, nothing reverted — just why, and where its work is.
|
|
269
|
+
*/
|
|
270
|
+
export declare function memberExitEvidence(batchId: string, reason: string, branch: string | null, now: Date): FailureEvidence;
|
|
271
|
+
/**
|
|
272
|
+
* The member branch holding `issue`'s un-landed work in `batch` (#810): its
|
|
273
|
+
* parallel run's branch, else the serial current-member branch when `issue`
|
|
274
|
+
* is the member in work. `null` when the batch has none recorded. (Contrast
|
|
275
|
+
* `memberBranchFor` in batch-dispatch.ts, which BUILDS the name for a spawn.)
|
|
276
|
+
*/
|
|
277
|
+
export declare function recordedMemberBranch(batch: BatchEntry, issue: number): string | null;
|
|
278
|
+
/**
|
|
279
|
+
* #810: the members of `batch` whose work is validated and landed on its
|
|
280
|
+
* integration branch — the work a dissolve must never throw away. The one
|
|
281
|
+
* definition shared by the executing rail's dissolve suppression, the
|
|
282
|
+
* `full` dissolve's block, and `sched status`.
|
|
283
|
+
*/
|
|
284
|
+
export declare function validatedMembersOf(state: SchedState, batch: BatchEntry): number[];
|
|
285
|
+
/**
|
|
286
|
+
* The dispatch profile a member runs on (#810): its own when it has one, else
|
|
287
|
+
* its batch's. The one answer for "which provider does this member's work
|
|
288
|
+
* belong to?" — a requeue and a park both carry it onto the entry.
|
|
289
|
+
*/
|
|
290
|
+
export declare function memberDispatchProfile(state: SchedState, entry: QueueEntry): string | null;
|
|
291
|
+
/**
|
|
292
|
+
* Park one batch member (#810): move it to `evicted` (an engine-decided
|
|
293
|
+
* failure) or `handed-back` (the member's own explicit hand-back), keeping
|
|
294
|
+
* `mode: 'slot'` + `batch` so the ledger still says which batch it left, and
|
|
295
|
+
* stamping the evidence (reason, member branch) and the batch's dispatch
|
|
296
|
+
* profile onto the entry. Nothing is requeued: an operator's `sched requeue`
|
|
297
|
+
* is the only way on, and it then continues from `failure_evidence.branch`
|
|
298
|
+
* on the recorded profile.
|
|
299
|
+
*
|
|
300
|
+
* Replaces the pre-#810 automatic `requeueMember(..., { mode: 'full' })` on
|
|
301
|
+
* the eviction rail, which restarted the member from the base branch on the
|
|
302
|
+
* config-default provider — discarding its commits and its profile.
|
|
303
|
+
*
|
|
304
|
+
* Already terminal / shipped / parked → left alone (`parked: false`).
|
|
305
|
+
*/
|
|
306
|
+
export declare function parkMember(state: SchedState, issue: number, kind: MemberExitKind, reason: string, now?: Date, extra?: MemberExitExtra): {
|
|
307
|
+
state: SchedState;
|
|
308
|
+
parked: boolean;
|
|
309
|
+
};
|
|
249
310
|
export declare function findEntry(state: SchedState, issue: number): QueueEntry | undefined;
|
|
250
311
|
export declare function findBatch(state: SchedState, batchId: string): BatchEntry | undefined;
|
|
251
312
|
/** The `unit` string a batch's slot carries. */
|
package/dist/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EAId,KAAK,cAAc,EACnB,KAAK,eAAe,EAEpB,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EAId,KAAK,cAAc,EACnB,KAAK,eAAe,EAEpB,KAAK,WAAW,EAIhB,KAAK,cAAc,EACnB,KAAK,UAAU,EAIf,KAAK,UAAU,EAEf,KAAK,SAAS,EAEd,KAAK,UAAU,EAEhB,MAAM,SAAS,CAAC;AAiFjB;;;;GAIG;AACH,eAAO,M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G,EAAE,IAAI,GACR,UAAU,CAGZ;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,UAAU,CAI9F;AAcD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,UAAU,CAG1F;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW;kBACR,WAAW;kBACX,WAAW;iBACZ,UAAU;CACxB,CAAC"}
|
package/dist/state.js
CHANGED
|
@@ -43,7 +43,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
43
43
|
};
|
|
44
44
|
})();
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.TRANSITIONS = exports.CLEARED_SLOT_FIELDS = exports.CLEARED_PR_WATCH_FIELDS = exports.CLEARED_ANCHOR_CLOSE_FAILED_FIELDS = exports.CLEARED_ENTRY_DEDUP_MARKERS = exports.ISSUE_UNIVERSAL_FAILURE_EDGES = void 0;
|
|
46
|
+
exports.TRANSITIONS = exports.PARKED_MEMBER_STATUSES = exports.CLEARED_SLOT_FIELDS = exports.CLEARED_PR_WATCH_FIELDS = exports.CLEARED_ANCHOR_CLOSE_FAILED_FIELDS = exports.CLEARED_ENTRY_DEDUP_MARKERS = exports.ISSUE_UNIVERSAL_FAILURE_EDGES = void 0;
|
|
47
47
|
exports.allowedBatchTransitions = allowedBatchTransitions;
|
|
48
48
|
exports.createEmptyState = createEmptyState;
|
|
49
49
|
exports.createBatch = createBatch;
|
|
@@ -60,6 +60,11 @@ exports.appendEvictions = appendEvictions;
|
|
|
60
60
|
exports.distinctEvictions = distinctEvictions;
|
|
61
61
|
exports.duplicateEvictionDetail = duplicateEvictionDetail;
|
|
62
62
|
exports.requeueMember = requeueMember;
|
|
63
|
+
exports.memberExitEvidence = memberExitEvidence;
|
|
64
|
+
exports.recordedMemberBranch = recordedMemberBranch;
|
|
65
|
+
exports.validatedMembersOf = validatedMembersOf;
|
|
66
|
+
exports.memberDispatchProfile = memberDispatchProfile;
|
|
67
|
+
exports.parkMember = parkMember;
|
|
63
68
|
exports.findEntry = findEntry;
|
|
64
69
|
exports.findBatch = findBatch;
|
|
65
70
|
exports.batchUnit = batchUnit;
|
|
@@ -103,21 +108,29 @@ const ISSUE_BASE_TRANSITIONS = {
|
|
|
103
108
|
// #468: dispatched → parked is the detached-ship exit — the agent parked
|
|
104
109
|
// its PR on auto-merge and exited; parked → shipped accepts the MERGE
|
|
105
110
|
// (never the park — RFC-0001 §E.4 "scheduler gates on merge").
|
|
106
|
-
// Both also carry `evicted`: a batch dissolve (#472) requeues every
|
|
107
|
-
// member whatever state it reached, and an unmodelled edge there
|
|
108
|
-
// mid-eviction, after the reverts already landed.
|
|
111
|
+
// Both also carry `evicted`: a batch dissolve (#472) parks or requeues every
|
|
112
|
+
// unshipped member whatever state it reached, and an unmodelled edge there
|
|
113
|
+
// would throw mid-eviction, after the reverts already landed.
|
|
109
114
|
dispatched: ['shipped', 'parked', 'evicted'],
|
|
110
115
|
parked: ['shipped', 'evicted'],
|
|
111
116
|
shipped: ['done'],
|
|
112
117
|
// batched/waiting/validated also carry `evicted`: RFC-0001 §D.2 dissolving
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
// removes members at ANY batch stage, not just mid-member (F.8).
|
|
119
|
+
// #810: `handed-back` is the member's own explicit hand-back (a `blocked` /
|
|
120
|
+
// `review partial` milestone it posted) — a pre-landing exit, so it exists
|
|
121
|
+
// on the rows a member can still be working in, never from `validated`.
|
|
122
|
+
batched: ['waiting', 'evicted', 'handed-back'],
|
|
123
|
+
waiting: ['in-work', 'evicted', 'handed-back'],
|
|
124
|
+
'in-work': ['committed', 'evicted', 'handed-back'],
|
|
125
|
+
committed: ['validated', 'evicted', 'handed-back'],
|
|
118
126
|
validated: ['shipped-in-batch', 'evicted'],
|
|
119
127
|
'shipped-in-batch': ['done'],
|
|
128
|
+
// #810: `evicted` and `handed-back` are PARKED — terminal for their batch,
|
|
129
|
+
// never auto-dispatched. The only way on is an operator's decision:
|
|
130
|
+
// `sched requeue` (→ `requeued`, full-cycle from the member branch with
|
|
131
|
+
// the batch's dispatch profile) or `sched abandon`/`stop` (universal edges).
|
|
120
132
|
evicted: ['requeued'],
|
|
133
|
+
'handed-back': ['requeued'],
|
|
121
134
|
// `batched` is the half-batch rail: a member requeued into a fresh batch by a
|
|
122
135
|
// halved dissolve (#472 AC4) re-enters §D.1's slot line, not the full-cycle
|
|
123
136
|
// one. Without it those members are stranded — `requeued` + `mode: 'slot'` is
|
|
@@ -431,6 +444,12 @@ function validateQueueEntry(data, where) {
|
|
|
431
444
|
ev.reverted_commits.some((c) => typeof c !== 'string')) {
|
|
432
445
|
throw new Error(`${label}: failure_evidence.reverted_commits must be an array of strings`);
|
|
433
446
|
}
|
|
447
|
+
// #810: `reason` and `branch` reach an agent's prompt and git argv on a
|
|
448
|
+
// requeue — a malformed value is refused at load, never interpolated.
|
|
449
|
+
if (typeof ev.reason !== 'string') {
|
|
450
|
+
throw new Error(`${label}: failure_evidence.reason must be a string`);
|
|
451
|
+
}
|
|
452
|
+
validateMemberBranch(ev.branch, `${label}: failure_evidence.branch`);
|
|
434
453
|
}
|
|
435
454
|
validateDedupMarker(entry, label, 'ground_truth_unreachable_since', 'ground_truth_unreachable_ticks');
|
|
436
455
|
validateDedupMarker(entry, label, 'pr_watch_waiting_since', 'pr_watch_waiting_ticks');
|
|
@@ -438,6 +457,14 @@ function validateQueueEntry(data, where) {
|
|
|
438
457
|
throw new Error(`${label}: enqueued_at/updated_at must be ISO date strings`);
|
|
439
458
|
}
|
|
440
459
|
}
|
|
460
|
+
/** #810: a recorded member branch is absent, null, or a plain git ref. */
|
|
461
|
+
function validateMemberBranch(branch, label) {
|
|
462
|
+
if (branch === undefined || branch === null)
|
|
463
|
+
return;
|
|
464
|
+
if (typeof branch !== 'string' || !attribution_1.SAFE_REF_RE.test(branch)) {
|
|
465
|
+
throw new Error(`${label} must be null or a plain git ref`);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
441
468
|
/**
|
|
442
469
|
* The #472 recovery fields of one batch. Absent fields are legacy (pre-1.3.0)
|
|
443
470
|
* and backfilled by the migration below; present ones must be well-shaped —
|
|
@@ -506,6 +533,15 @@ function validateBatchRecovery(batch, id) {
|
|
|
506
533
|
issue <= 0) {
|
|
507
534
|
throw new Error(`Batch ${id}: each ${key} record must carry a positive issue number`);
|
|
508
535
|
}
|
|
536
|
+
// #810: an unrecognized `kind` would silently change what the dissolve
|
|
537
|
+
// threshold counts — refuse it rather than guess.
|
|
538
|
+
if (key === 'evictions') {
|
|
539
|
+
const { kind, branch } = record;
|
|
540
|
+
if (kind !== undefined && !types_1.MEMBER_EXIT_KINDS.includes(kind)) {
|
|
541
|
+
throw new Error(`Batch ${id}: evictions[].kind must be one of ${types_1.MEMBER_EXIT_KINDS.join('|')}`);
|
|
542
|
+
}
|
|
543
|
+
validateMemberBranch(branch, `Batch ${id}: evictions[].branch`);
|
|
544
|
+
}
|
|
509
545
|
}
|
|
510
546
|
}
|
|
511
547
|
if (batch.pr !== null &&
|
|
@@ -1018,6 +1054,10 @@ function validateState(data) {
|
|
|
1018
1054
|
gate_inconclusive: run.gate_inconclusive ?? null,
|
|
1019
1055
|
torn_down: run.torn_down ?? false,
|
|
1020
1056
|
})),
|
|
1057
|
+
// 1.23.0 → 1.24.0 (#810): no backfill — `evictions[].kind`/`branch` and
|
|
1058
|
+
// `failure_evidence.branch` are optional (absent = a pre-#810 `evicted`
|
|
1059
|
+
// record with no recorded branch), and `handed-back` is a new status no
|
|
1060
|
+
// older state can contain.
|
|
1021
1061
|
}));
|
|
1022
1062
|
return {
|
|
1023
1063
|
...data,
|
|
@@ -1299,15 +1339,19 @@ function partitionByIssue(seen, records) {
|
|
|
1299
1339
|
* (RFC-0001 §D.1 "in-work/committed → evicted(reason) → requeued", §F.8
|
|
1300
1340
|
* "nothing green is discarded").
|
|
1301
1341
|
*
|
|
1302
|
-
* The single requeue path
|
|
1303
|
-
*
|
|
1304
|
-
*
|
|
1342
|
+
* The single requeue path — `abandonBatch` (operator dissolve), an operator's
|
|
1343
|
+
* `sched requeue` of a parked member (`requeueParkedMember`, #810), the
|
|
1344
|
+
* aggregate-suite eviction (`evictMembers`), and a dissolve's unstarted
|
|
1345
|
+
* members / half-batch split (#472) — so the "which edge applies from here?"
|
|
1346
|
+
* question is answered once. (Per-member evictions and hand-backs on the
|
|
1347
|
+
* executing rail PARK through `parkMember` instead, #810.)
|
|
1305
1348
|
*
|
|
1306
1349
|
* - already terminal or shipped → left alone, `requeued: false`
|
|
1307
1350
|
* - never reached the batch rail (`queued`/`classified`), or already on the
|
|
1308
1351
|
* requeue rail (`requeued`) → metadata retag only; there is no status edge to
|
|
1309
1352
|
* take, and re-transitioning `requeued → requeued` would throw
|
|
1310
|
-
* - `evicted` → the one remaining edge,
|
|
1353
|
+
* - parked (`evicted` / `handed-back`) → the one remaining edge, `→ requeued`
|
|
1354
|
+
* — keeping the dispatch profile stamped at park time (#810)
|
|
1311
1355
|
* - anything else active → the full failure rail, `→ evicted → requeued`
|
|
1312
1356
|
*
|
|
1313
1357
|
* `target` is where the member goes next: full-cycle (`{ mode: 'full', batch:
|
|
@@ -1336,9 +1380,22 @@ extra = {}) {
|
|
|
1336
1380
|
const reviewPatch = target.mode === 'full' && entry.review === 'full'
|
|
1337
1381
|
? { tier: (0, dispatch_1.memberDispatchTier)(entry), review: 'light' }
|
|
1338
1382
|
: {};
|
|
1383
|
+
// #810 (the #713 class, on the requeue rail): a member leaving its batch for
|
|
1384
|
+
// a full cycle keeps the batch's dispatch profile. A slot member's own
|
|
1385
|
+
// `dispatch_profile` is normally null — the BATCH carries it — so without
|
|
1386
|
+
// this every requeue silently re-ran the member on the config default
|
|
1387
|
+
// (observed: an `openai` batch's members requeued `dispatch_profile: null`).
|
|
1388
|
+
// A PARKED entry already carries the profile stamped at park time — which
|
|
1389
|
+
// may be a deliberate `null` (a `dispatch-profile-missing` dissolve parks on
|
|
1390
|
+
// the config default); re-deriving it from the batch would bring the broken
|
|
1391
|
+
// profile back.
|
|
1392
|
+
const profilePatch = target.mode === 'full' && !exports.PARKED_MEMBER_STATUSES.has(entry.status)
|
|
1393
|
+
? { dispatch_profile: memberDispatchProfile(state, entry) }
|
|
1394
|
+
: {};
|
|
1339
1395
|
const patch = {
|
|
1340
1396
|
...target,
|
|
1341
1397
|
...reviewPatch,
|
|
1398
|
+
...profilePatch,
|
|
1342
1399
|
reason,
|
|
1343
1400
|
...exports.CLEARED_ENTRY_DEDUP_MARKERS,
|
|
1344
1401
|
...extra,
|
|
@@ -1347,12 +1404,118 @@ extra = {}) {
|
|
|
1347
1404
|
return { state: patchEntry(state, issue, patch, now), requeued: true };
|
|
1348
1405
|
}
|
|
1349
1406
|
let next = state;
|
|
1350
|
-
if (entry.status
|
|
1407
|
+
if (!exports.PARKED_MEMBER_STATUSES.has(entry.status)) {
|
|
1351
1408
|
next = transitionIssue(next, issue, 'evicted', { reason }, now);
|
|
1352
1409
|
}
|
|
1353
1410
|
next = transitionIssue(next, issue, 'requeued', patch, now);
|
|
1354
1411
|
return { state: next, requeued: true };
|
|
1355
1412
|
}
|
|
1413
|
+
/**
|
|
1414
|
+
* #810: the statuses a batch member is PARKED in — out of its batch, its work
|
|
1415
|
+
* (if any) on its member branch, and never auto-dispatched until an operator
|
|
1416
|
+
* decides (`sched requeue` / `sched abandon`).
|
|
1417
|
+
*/
|
|
1418
|
+
exports.PARKED_MEMBER_STATUSES = new Set(types_1.MEMBER_EXIT_KINDS);
|
|
1419
|
+
/**
|
|
1420
|
+
* The `failure_evidence` a pre-landing member exit records (#810): no failing
|
|
1421
|
+
* tests, no attribution, nothing reverted — just why, and where its work is.
|
|
1422
|
+
*/
|
|
1423
|
+
function memberExitEvidence(batchId, reason, branch, now) {
|
|
1424
|
+
return {
|
|
1425
|
+
batch: batchId,
|
|
1426
|
+
reason,
|
|
1427
|
+
failing_tests: [],
|
|
1428
|
+
attribution: 'none',
|
|
1429
|
+
reverted_commits: [],
|
|
1430
|
+
branch,
|
|
1431
|
+
at: now.toISOString(),
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* The member branch holding `issue`'s un-landed work in `batch` (#810): its
|
|
1436
|
+
* parallel run's branch, else the serial current-member branch when `issue`
|
|
1437
|
+
* is the member in work. `null` when the batch has none recorded. (Contrast
|
|
1438
|
+
* `memberBranchFor` in batch-dispatch.ts, which BUILDS the name for a spawn.)
|
|
1439
|
+
*/
|
|
1440
|
+
function recordedMemberBranch(batch, issue) {
|
|
1441
|
+
const run = batch.member_runs.find((r) => r.issue === issue);
|
|
1442
|
+
if (run !== undefined)
|
|
1443
|
+
return run.branch;
|
|
1444
|
+
if (batch.members[batch.executing_member - 1] === issue)
|
|
1445
|
+
return batch.member_branch;
|
|
1446
|
+
return null;
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* #810: the members of `batch` whose work is validated and landed on its
|
|
1450
|
+
* integration branch — the work a dissolve must never throw away. The one
|
|
1451
|
+
* definition shared by the executing rail's dissolve suppression, the
|
|
1452
|
+
* `full` dissolve's block, and `sched status`.
|
|
1453
|
+
*/
|
|
1454
|
+
function validatedMembersOf(state, batch) {
|
|
1455
|
+
const exited = new Set(batch.evictions.map((e) => e.issue));
|
|
1456
|
+
return batch.members.filter((issue) => {
|
|
1457
|
+
if (exited.has(issue))
|
|
1458
|
+
return false;
|
|
1459
|
+
const entry = findEntry(state, issue);
|
|
1460
|
+
return (entry !== undefined &&
|
|
1461
|
+
entry.mode === 'slot' &&
|
|
1462
|
+
entry.batch === batch.id &&
|
|
1463
|
+
entry.status === 'validated');
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* The dispatch profile a member runs on (#810): its own when it has one, else
|
|
1468
|
+
* its batch's. The one answer for "which provider does this member's work
|
|
1469
|
+
* belong to?" — a requeue and a park both carry it onto the entry.
|
|
1470
|
+
*/
|
|
1471
|
+
function memberDispatchProfile(state, entry) {
|
|
1472
|
+
if (entry.dispatch_profile !== null && entry.dispatch_profile !== undefined) {
|
|
1473
|
+
return entry.dispatch_profile;
|
|
1474
|
+
}
|
|
1475
|
+
if (entry.batch === null)
|
|
1476
|
+
return null;
|
|
1477
|
+
return findBatch(state, entry.batch)?.dispatch_profile ?? null;
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Park one batch member (#810): move it to `evicted` (an engine-decided
|
|
1481
|
+
* failure) or `handed-back` (the member's own explicit hand-back), keeping
|
|
1482
|
+
* `mode: 'slot'` + `batch` so the ledger still says which batch it left, and
|
|
1483
|
+
* stamping the evidence (reason, member branch) and the batch's dispatch
|
|
1484
|
+
* profile onto the entry. Nothing is requeued: an operator's `sched requeue`
|
|
1485
|
+
* is the only way on, and it then continues from `failure_evidence.branch`
|
|
1486
|
+
* on the recorded profile.
|
|
1487
|
+
*
|
|
1488
|
+
* Replaces the pre-#810 automatic `requeueMember(..., { mode: 'full' })` on
|
|
1489
|
+
* the eviction rail, which restarted the member from the base branch on the
|
|
1490
|
+
* config-default provider — discarding its commits and its profile.
|
|
1491
|
+
*
|
|
1492
|
+
* Already terminal / shipped / parked → left alone (`parked: false`).
|
|
1493
|
+
*/
|
|
1494
|
+
function parkMember(state, issue, kind, reason, now = new Date(), extra = {}) {
|
|
1495
|
+
const entry = state.entries.find((e) => e.issue === issue);
|
|
1496
|
+
if (!entry || isPreservedMember(entry) || exports.PARKED_MEMBER_STATUSES.has(entry.status)) {
|
|
1497
|
+
return { state, parked: false };
|
|
1498
|
+
}
|
|
1499
|
+
const patch = {
|
|
1500
|
+
reason,
|
|
1501
|
+
dispatch_profile: memberDispatchProfile(state, entry),
|
|
1502
|
+
...exports.CLEARED_ENTRY_DEDUP_MARKERS,
|
|
1503
|
+
...extra,
|
|
1504
|
+
};
|
|
1505
|
+
// A `classified` member (evicted before its first spawn, e.g. a failed
|
|
1506
|
+
// worktree prep) walks the `batched` waypoint first — the same waypoint
|
|
1507
|
+
// `advanceMemberToInWork` walks. `queued`/`requeued` have no batch-rail
|
|
1508
|
+
// edge at all and are left where they are, reported as not parked.
|
|
1509
|
+
let next = state;
|
|
1510
|
+
if (entry.status === 'classified') {
|
|
1511
|
+
next = transitionIssue(next, issue, 'batched', {}, now);
|
|
1512
|
+
}
|
|
1513
|
+
const from = findEntry(next, issue)?.status;
|
|
1514
|
+
if (from === undefined || !allowedIssueTransitions(from).includes(kind)) {
|
|
1515
|
+
return { state, parked: false };
|
|
1516
|
+
}
|
|
1517
|
+
return { state: transitionIssue(next, issue, kind, patch, now), parked: true };
|
|
1518
|
+
}
|
|
1356
1519
|
// --- Lookups ---
|
|
1357
1520
|
function findEntry(state, issue) {
|
|
1358
1521
|
return state.entries.find((e) => e.issue === issue);
|