@ai-dossier/sched 0.64.0 → 0.66.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 +4 -2
- package/dist/batch-dispatch.d.ts.map +1 -1
- package/dist/batch-dispatch.js +55 -0
- package/dist/batch-dispatch.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +7 -35
- package/dist/engine.js.map +1 -1
- package/dist/groundtruth.d.ts.map +1 -1
- package/dist/groundtruth.js +50 -32
- package/dist/groundtruth.js.map +1 -1
- package/dist/merge-mechanism.d.ts +32 -0
- package/dist/merge-mechanism.d.ts.map +1 -1
- package/dist/merge-mechanism.js +40 -1
- package/dist/merge-mechanism.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1818,7 +1818,8 @@ Dispatched runs park their PR on `auto-merge` (detached ship mode) and exit —
|
|
|
1818
1818
|
a merge mechanism is confirmed** (#887). sched's watch only WAITS for a merge; it never merges,
|
|
1819
1819
|
so the default prompts render `{ship_clause}` from `GroundTruth.mergeMechanism()` (`gh api
|
|
1820
1820
|
repos/<r>` `allow_auto_merge` + allowed methods, and a scan of the remote default branch's
|
|
1821
|
-
`.github/workflows` for a label watcher
|
|
1821
|
+
`.github/workflows` for a label watcher, both read through the GitHub API so a stale local
|
|
1822
|
+
`origin/*` ref can never hide a newly added watcher — #921; cached 10 min). A confirmed mechanism still parks only
|
|
1822
1823
|
after `gh pr view --json autoMergeRequest` reads back non-null (the label is not proof); with no
|
|
1823
1824
|
confirmed mechanism — or an unknown one — the run ships **attached** (waits for checks, merges
|
|
1824
1825
|
with an allowed method) and blocks `no-merge-mechanism` if it cannot. A batch tail needs a
|
|
@@ -1826,7 +1827,8 @@ confirmed *watcher* (native auto-merge alone never confirms a detached batch shi
|
|
|
1826
1827
|
`awaiting-merge` milestone carrying `ship_mode=attached` is not a park. Backstop for custom
|
|
1827
1828
|
prompts: a parked, OPEN PR with no auto-merge request and no watcher (positively read absent —
|
|
1828
1829
|
unknown never counts) that persists past 10 minutes fails `no-merge-mechanism`; the batch PR
|
|
1829
|
-
watch has
|
|
1830
|
+
watch has the same backstop (#921): the batch blocks `no-merge-mechanism`, and the onset marker
|
|
1831
|
+
(`BatchEntry.no_merge_mechanism_since`) resets when a request lands. The engine owns everything after the park:
|
|
1830
1832
|
|
|
1831
1833
|
1. **Park detection (AC1)** — an agent exit whose latest milestone is the ship
|
|
1832
1834
|
phase's `awaiting-merge` (with `pr=`) is a VERIFIED park, not an unverified
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-dispatch.d.ts","sourceRoot":"","sources":["../src/batch-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAUH,OAAO,EAIL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EAGtB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAeL,KAAK,gBAAgB,EAGrB,KAAK,SAAS,EAEf,MAAM,YAAY,CAAC;AAGpB,OAAO,EAGL,KAAK,WAAW,EAcjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,OAAO,EAAa,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"batch-dispatch.d.ts","sourceRoot":"","sources":["../src/batch-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAUH,OAAO,EAIL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EAGtB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAeL,KAAK,gBAAgB,EAGrB,KAAK,SAAS,EAEf,MAAM,YAAY,CAAC;AAGpB,OAAO,EAGL,KAAK,WAAW,EAcjB,M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B,kBAAkB,CAQpB;AAymBD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AA8UvC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,gBAAgB,GACzB,eAAe,CAgSjB"}
|
package/dist/batch-dispatch.js
CHANGED
|
@@ -116,6 +116,7 @@ const dispatch_health_1 = require("./dispatch-health");
|
|
|
116
116
|
const dossier_root_1 = require("./dossier-root");
|
|
117
117
|
const groundtruth_1 = require("./groundtruth");
|
|
118
118
|
const journal_1 = require("./journal");
|
|
119
|
+
const merge_mechanism_1 = require("./merge-mechanism");
|
|
119
120
|
const readiness_1 = require("./readiness");
|
|
120
121
|
const recovery_1 = require("./recovery");
|
|
121
122
|
const run_log_1 = require("./run-log");
|
|
@@ -3328,6 +3329,16 @@ function advanceBatchDedupStreak(priorReason, priorSince, priorTicks, reason, no
|
|
|
3328
3329
|
*/
|
|
3329
3330
|
function clearPrWatchFailed(deps, batch, now) {
|
|
3330
3331
|
clearBatchDedupMarker(deps, batch, batch.pr_watch_failed_reason, state_1.CLEARED_PR_WATCH_FIELDS, now);
|
|
3332
|
+
clearNoMergeMechanism(deps, batch, now);
|
|
3333
|
+
}
|
|
3334
|
+
/** Drop the #921 `no-merge-mechanism` onset marker (a no-op, no write, when none is recorded). */
|
|
3335
|
+
function clearNoMergeMechanism(deps, batch, now) {
|
|
3336
|
+
if (batch.no_merge_mechanism_since == null)
|
|
3337
|
+
return;
|
|
3338
|
+
deps.store.withLock((s) => ({
|
|
3339
|
+
state: (0, state_1.patchBatch)(s, batch.id, { no_merge_mechanism_since: null }, now, false),
|
|
3340
|
+
result: undefined,
|
|
3341
|
+
}));
|
|
3331
3342
|
}
|
|
3332
3343
|
function reconcilePrWatch(deps, config, now, result) {
|
|
3333
3344
|
const state = deps.store.load();
|
|
@@ -3409,6 +3420,9 @@ function reconcilePrWatch(deps, config, now, result) {
|
|
|
3409
3420
|
}, now, false),
|
|
3410
3421
|
result: undefined,
|
|
3411
3422
|
}));
|
|
3423
|
+
// A conflicting/blocked PR is a different condition: end any no-merge-mechanism onset so a
|
|
3424
|
+
// re-ship starts a fresh grace window.
|
|
3425
|
+
clearNoMergeMechanism(deps, batch, now);
|
|
3412
3426
|
// An awaiting-merge record without its integration checkout is an
|
|
3413
3427
|
// incomplete/corrupt batch, not safe to rebase. Keep its durable watch
|
|
3414
3428
|
// evidence for an operator rather than running recovery in repoDir.
|
|
@@ -3469,6 +3483,47 @@ function reconcilePrWatch(deps, config, now, result) {
|
|
|
3469
3483
|
result.failed.push(unit(batch.id));
|
|
3470
3484
|
}
|
|
3471
3485
|
}
|
|
3486
|
+
else if (truth.state === 'OPEN' &&
|
|
3487
|
+
truth.autoMergeRequested === false &&
|
|
3488
|
+
(0, merge_mechanism_1.parkedWithoutMerger)(truth, deps.groundTruth.mergeMechanism?.())) {
|
|
3489
|
+
// #921: the issue-unit backstop (#887) for a batch PR — parked OPEN with no auto-merge
|
|
3490
|
+
// request and a POSITIVELY absent watcher. sched's watch only waits, so once this has
|
|
3491
|
+
// persisted past the grace window the batch blocks loudly instead of waiting forever.
|
|
3492
|
+
// `mergeMechanism()` is cached and, like `prState`, read outside the store lock.
|
|
3493
|
+
clearBatchDedupMarker(deps, batch, batch.pr_watch_failed_reason, state_1.CLEARED_PR_WATCH_FIELDS, now);
|
|
3494
|
+
const step = (0, merge_mechanism_1.advanceNoMergeMechanism)(batch.no_merge_mechanism_since, pr, now);
|
|
3495
|
+
if (step.arm !== null) {
|
|
3496
|
+
deps.store.withLock((s) => ({
|
|
3497
|
+
state: (0, state_1.patchBatch)(s, batch.id, { no_merge_mechanism_since: step.arm }, now, false),
|
|
3498
|
+
result: undefined,
|
|
3499
|
+
}));
|
|
3500
|
+
}
|
|
3501
|
+
else if (step.due) {
|
|
3502
|
+
// Re-check on a fresh load: the batch may have merged, blocked or been abandoned since
|
|
3503
|
+
// the poll above, and blockBatch throws on a terminal batch — never abort the tick.
|
|
3504
|
+
const fresh = deps.store.load();
|
|
3505
|
+
if ((0, state_1.findBatch)(fresh, batch.id)?.status !== 'awaiting-merge')
|
|
3506
|
+
continue;
|
|
3507
|
+
let blocked;
|
|
3508
|
+
try {
|
|
3509
|
+
blocked = (0, recovery_1.blockBatch)(fresh, batch.id, { reason: merge_mechanism_1.NO_MERGE_MECHANISM_REASON, milestonePhase: 'batch-ship' }, recoveryDeps(deps, config, batch, now));
|
|
3510
|
+
}
|
|
3511
|
+
catch {
|
|
3512
|
+
continue;
|
|
3513
|
+
}
|
|
3514
|
+
journalEvent(deps, 'pr-watch-failed', unit(batch.id), {
|
|
3515
|
+
reason: merge_mechanism_1.NO_MERGE_MECHANISM_REASON,
|
|
3516
|
+
pr,
|
|
3517
|
+
at: now.toISOString(),
|
|
3518
|
+
});
|
|
3519
|
+
deps.store.withLock((s) => ({
|
|
3520
|
+
state: applyBatchAndIssues(s, blocked.state, batch.id, [], batch.members),
|
|
3521
|
+
result: undefined,
|
|
3522
|
+
}));
|
|
3523
|
+
stopAndReleaseBlocked(deps, batch.id, now);
|
|
3524
|
+
result.failed.push(unit(batch.id));
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3472
3527
|
else {
|
|
3473
3528
|
// #630: the condition cleared — reset the marker so a future
|
|
3474
3529
|
// re-occurrence (even the SAME reason) journals its own fresh entry.
|