forgedock 1.67.0 → 1.69.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/bin/config-schema.mjs +1 -0
- package/bin/engine/outcome-codes.mjs +1 -0
- package/bin/engine-cli.mjs +103 -21
- package/bin/engine.mjs +10 -0
- package/bin/forgedock.mjs +17 -1
- package/bin/help-text.mjs +1 -0
- package/bin/lean/admission.mjs +21 -0
- package/bin/lean/admission.test.mjs +30 -0
- package/bin/lean/advisory.test.mjs +39 -15
- package/bin/lean/amendment-schema.mjs +3 -4
- package/bin/lean/attempts.mjs +34 -31
- package/bin/lean/attempts.test.mjs +33 -19
- package/bin/lean/basered.mjs +26 -0
- package/bin/lean/batch-health.mjs +17 -12
- package/bin/lean/batch-health.test.mjs +39 -11
- package/bin/lean/batch.mjs +11 -1
- package/bin/lean/batch.test.mjs +51 -2
- package/bin/lean/capsample.mjs +25 -0
- package/bin/lean/ci-gate.mjs +2 -90
- package/bin/lean/ci-gate.test.mjs +1 -127
- package/bin/lean/ci-precheck.mjs +25 -8
- package/bin/lean/ci-precheck.test.mjs +24 -0
- package/bin/lean/clear-breaker.test.mjs +4 -3
- package/bin/lean/commentstate.mjs +10 -5
- package/bin/lean/commentstate.test.mjs +12 -1
- package/bin/lean/conformance.e2e.test.mjs +9 -6
- package/bin/lean/conformance.mjs +62 -197
- package/bin/lean/conformance.test.mjs +46 -376
- package/bin/lean/depcache.mjs +102 -10
- package/bin/lean/depcache.test.mjs +105 -0
- package/bin/lean/docsgate.mjs +0 -32
- package/bin/lean/docsgate.test.mjs +2 -23
- package/bin/lean/effects-cap.test.mjs +9 -1
- package/bin/lean/effects-killtree.test.mjs +35 -0
- package/bin/lean/effects.mjs +57 -25
- package/bin/lean/engine-readmit.test.mjs +35 -0
- package/bin/lean/envgap.mjs +111 -0
- package/bin/lean/envgap.test.mjs +64 -0
- package/bin/lean/execution.mjs +13 -4
- package/bin/lean/execution.test.mjs +33 -0
- package/bin/lean/failure-census.mjs +170 -0
- package/bin/lean/failure-census.test.mjs +59 -0
- package/bin/lean/failure-stop.mjs +12 -1
- package/bin/lean/failure-stop.test.mjs +14 -1
- package/bin/lean/guardgate.test.mjs +2 -3
- package/bin/lean/heavy.mjs +33 -4
- package/bin/lean/heavy.test.mjs +38 -6
- package/bin/lean/hostconfig.mjs +54 -0
- package/bin/lean/hostconfig.test.mjs +67 -0
- package/bin/lean/hotarea.mjs +0 -36
- package/bin/lean/hotarea.test.mjs +1 -22
- package/bin/lean/issuewatch-verify.mjs +19 -4
- package/bin/lean/issuewatch.mjs +21 -4
- package/bin/lean/issuewatch.test.mjs +48 -1
- package/bin/lean/lane-audit-gap.mjs +66 -0
- package/bin/lean/lane-audit-gap.test.mjs +59 -0
- package/bin/lean/lane-audit-llm.mjs +52 -0
- package/bin/lean/lane-audit-llm.test.mjs +57 -0
- package/bin/lean/lane-audit-query.mjs +47 -0
- package/bin/lean/lane-audit-query.test.mjs +44 -0
- package/bin/lean/lane-audit-signatures.mjs +33 -0
- package/bin/lean/lane-audit.mjs +110 -0
- package/bin/lean/lane-audit.test.mjs +97 -0
- package/bin/lean/lane-recovery.test.mjs +33 -0
- package/bin/lean/lanecheck.mjs +5 -3
- package/bin/lean/lanecheck.test.mjs +6 -0
- package/bin/lean/lean.mjs +247 -152
- package/bin/lean/lean.test.mjs +502 -206
- package/bin/lean/limits.mjs +17 -0
- package/bin/lean/limits.test.mjs +15 -1
- package/bin/lean/live-execution.mjs +24 -2
- package/bin/lean/live-execution.test.mjs +62 -0
- package/bin/lean/orchestrate-attempts.test.mjs +17 -9
- package/bin/lean/orchestrate-dispatch-placement.test.mjs +81 -0
- package/bin/lean/orchestrate-envhold.test.mjs +62 -1
- package/bin/lean/orchestrate-heldroot.test.mjs +72 -0
- package/bin/lean/orchestrate-hostfallback.test.mjs +59 -1
- package/bin/lean/orchestrate-overload-recovery.test.mjs +37 -0
- package/bin/lean/orchestrate-pause.test.mjs +53 -1
- package/bin/lean/orchestrate-reconcile.test.mjs +17 -0
- package/bin/lean/orchestrate-relaunch-gates.test.mjs +57 -0
- package/bin/lean/orchestrate-stacking.test.mjs +10 -0
- package/bin/lean/orchestrate.mjs +215 -42
- package/bin/lean/postdeploy-check.test.mjs +1 -3
- package/bin/lean/precheck.mjs +20 -0
- package/bin/lean/preflight.mjs +110 -14
- package/bin/lean/preflight.test.mjs +64 -4
- package/bin/lean/prompts.mjs +11 -21
- package/bin/lean/recurrence.mjs +6 -148
- package/bin/lean/recurrence.test.mjs +11 -147
- package/bin/lean/release-deploy.mjs +35 -5
- package/bin/lean/release-deploy.test.mjs +50 -3
- package/bin/lean/release-flakes.mjs +48 -2
- package/bin/lean/release-flakes.test.mjs +45 -1
- package/bin/lean/release-ledger.mjs +19 -1
- package/bin/lean/release-ledger.test.mjs +23 -0
- package/bin/lean/release-preflight.mjs +28 -0
- package/bin/lean/release-preflight.test.mjs +42 -1
- package/bin/lean/release-review.mjs +40 -5
- package/bin/lean/release-review.test.mjs +43 -2
- package/bin/lean/release.mjs +45 -15
- package/bin/lean/release.test.mjs +32 -0
- package/bin/lean/retry.mjs +1 -1
- package/bin/lean/retry.test.mjs +6 -1
- package/bin/lean/rotator.mjs +9 -0
- package/bin/lean/rotator.test.mjs +11 -1
- package/bin/lean/sandbox-remote.mjs +51 -13
- package/bin/lean/schedd.mjs +13 -8
- package/bin/lean/schedd.test.mjs +65 -5
- package/bin/lean/selfreview.mjs +1 -1
- package/bin/lean/statuscomment.mjs +4 -1
- package/bin/lean/validate-catalog.mjs +108 -0
- package/bin/lean/validate-catalog.test.mjs +46 -1
- package/bin/lean/verify.mjs +1 -1
- package/bin/pool/affinity.test.mjs +91 -0
- package/bin/pool/agent.mjs +247 -23
- package/bin/pool/cache-sweep.mjs +31 -10
- package/bin/pool/ci-autoscale.mjs +160 -0
- package/bin/pool/cli.mjs +56 -9
- package/bin/pool/docker.mjs +5 -0
- package/bin/pool/engine-placement.test.mjs +94 -0
- package/bin/pool/image-manifest.mjs +24 -0
- package/bin/pool/image-manifest.test.mjs +20 -0
- package/bin/pool/lane-target.mjs +41 -0
- package/bin/pool/lane-tools.mjs +29 -5
- package/bin/pool/lane-tools.test.mjs +36 -7
- package/bin/pool/mirror-seed.mjs +15 -11
- package/bin/pool/project-layer.mjs +142 -0
- package/bin/pool/project-layer.test.mjs +73 -0
- package/bin/pool/router.mjs +106 -36
- package/bin/pool/version.mjs +72 -2
- package/bin/review-staging.mjs +11 -3
- package/bin/runner.mjs +59 -11
- package/bin/stats/release.mjs +7 -0
- package/bin/stats/release.test.mjs +20 -0
- package/bin/stats/scorecard.mjs +187 -0
- package/bin/stats/scorecard.test.mjs +89 -0
- package/bin/stats/tool-parks.mjs +29 -0
- package/bin/stats/tool-parks.test.mjs +21 -0
- package/docs/CONFIG.md +41 -0
- package/docs/OUTCOME-CODES.md +1 -0
- package/docs/STATS.md +17 -0
- package/package.json +1 -1
- package/pool/image/Dockerfile +15 -3
- package/pool/image/manifest.json +25 -0
- package/pool/image/mirror.sh +11 -2
- package/pool/install/install-agent.ps1 +11 -4
- package/scripts/ci-local/adapters/github-actions.mjs +8 -0
- package/scripts/ci-local/cli.mjs +1 -1
- package/scripts/ci-local/plan.mjs +3 -2
- package/scripts/ci-local.test.sh +14 -2
- package/scripts/failure-census.mjs +67 -0
- package/scripts/review-finalize.sh +5 -5
- package/scripts/review-finalize.test.sh +8 -1
- package/scripts/verify-phase-trail.sh +11 -0
- package/scripts/verify-phase-trail.test.sh +9 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// #5975: a batch-level pause stops admission for every issue (dependency merge, engine/env re-admit, expiry), never a running lane.
|
|
4
4
|
import { describe, it } from "node:test";
|
|
5
5
|
import assert from "node:assert/strict";
|
|
6
|
-
import { orchestrate } from "./orchestrate.mjs";
|
|
6
|
+
import { orchestrate, AUTH_PROBE_MS, AUTH_ESCALATE_MS, HOLD_RAMP_STEP_MS } from "./orchestrate.mjs";
|
|
7
7
|
|
|
8
8
|
const memStore = () => { let st = null; return { load: () => (st ? JSON.parse(JSON.stringify(st)) : null), save: (s) => { st = JSON.parse(JSON.stringify(s)); }, log: () => {} }; };
|
|
9
9
|
const EE = (detail) => ({ terminalReason: "engine-error", detail });
|
|
@@ -60,6 +60,58 @@ describe("#5975: batch pause", () => {
|
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
// #5988: a backend.auth outage is probed every 5 min, rotated, escalated once at 30 min; hold expiry is paced and warned at T-30.
|
|
64
|
+
describe("#5988: auth outage probe and hold expiry", () => {
|
|
65
|
+
const AUTH = { terminalReason: "deferred", code: "backend.auth", retryInSeconds: 56 * 3600, detail: "login failed" };
|
|
66
|
+
const rot = (cur = { n: 1 }) => ({ accounts: [{ n: 1 }, { n: 2 }], current: () => cur.n, headroom: (ex) => [1, 2].some((n) => !(ex instanceof Map ? ex : new Map()).has(n)), resumeAt: (ex) => Math.max(0, ...[...(ex ?? new Map()).values()]) || null, isAccount: () => true,
|
|
67
|
+
pick: ({ exclude } = {}) => { const ex = new Set([...(exclude instanceof Map ? exclude.keys() : exclude ?? [])].map(Number)); const a = [1, 2].find((n) => !ex.has(n)); return a ? { account: a } : { account: null }; }, markLimited: (n) => { cur.n = n === 1 ? 2 : 1; return true; } });
|
|
68
|
+
|
|
69
|
+
it("login failure recovering at 10 min resumes within 5 min on the next account first, no operator action", async () => {
|
|
70
|
+
const resumed = await (async () => {
|
|
71
|
+
const c = { t: 5_000_000 }, s0 = c.t, ps = [], rows = [];
|
|
72
|
+
const out = await orchestrate({ issues: [1], parallel: 1, pollMs: 1000, readBody: async () => "", trusted: () => true, now: () => c.t, store: memStore(), rotator: rot(),
|
|
73
|
+
sleep: async (ms) => { c.t += Math.max(1, Number(ms) || 0); }, recovery: { maxAttempts: 1, mechanicalMaxAttempts: 3 },
|
|
74
|
+
authProbe: async ({ account }) => { ps.push({ account, at: c.t - s0 }); return { ok: c.t - s0 >= 10 * 60000 }; },
|
|
75
|
+
runOne: async () => { c.t += 1000; return c.t - s0 < 10 * 60000 ? AUTH : MERGED; }, onUpdate: (x) => rows.push({ ...x, at: c.t - s0 }) });
|
|
76
|
+
return { out, ps, rows };
|
|
77
|
+
})();
|
|
78
|
+
assert.equal(resumed.out[0].outcome, "merged");
|
|
79
|
+
assert.ok(Number.isInteger(resumed.ps[0].account), "the probe runs on the next rotator account, picked before the lane retries");
|
|
80
|
+
const back = resumed.rows.find((x) => x.outcome === "merged");
|
|
81
|
+
assert.ok(back && back.at <= 10 * 60000 + AUTH_PROBE_MS + 5000, "resumed within one probe interval of the recovery");
|
|
82
|
+
assert.ok(!resumed.rows.some((x) => x.outcome === "auth-escalation"));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("a 56 h outage pauses at most 30 min and escalates exactly once", async () => {
|
|
86
|
+
const c = { t: 9_000_000 }, s0 = c.t, rows = [], esc = []; let k = 0;
|
|
87
|
+
await orchestrate({ issues: [1], parallel: 1, pollMs: 1000, readBody: async () => "", trusted: () => true, now: () => c.t, store: memStore(), rotator: rot(),
|
|
88
|
+
sleep: async (ms) => { c.t += Math.max(1, Number(ms) || 0); }, recovery: { maxAttempts: 1, mechanicalMaxAttempts: 3 },
|
|
89
|
+
authProbe: async () => ({ ok: false }), onEscalate: async (e) => esc.push(e),
|
|
90
|
+
runOne: async () => { c.t += 1000; return ++k <= 12 ? AUTH : MERGED; }, onUpdate: (x) => rows.push({ ...x, at: c.t - s0 }) });
|
|
91
|
+
assert.equal(esc.length, 1);
|
|
92
|
+
assert.equal(rows.filter((x) => x.outcome === "auth-escalation").length, 1);
|
|
93
|
+
assert.ok(rows.find((x) => x.outcome === "auth-escalation").at <= AUTH_ESCALATE_MS + 2 * AUTH_PROBE_MS);
|
|
94
|
+
assert.ok(c.t - s0 < 3 * 3600_000, "never a multi-hour pause");
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("expiry of 100 holds is announced once at T-30 and released at the controller's pace, not all at once", async () => {
|
|
98
|
+
const issues = Array.from({ length: 100 }, (_, i) => i + 1), clock = { t: 2_000_000 };
|
|
99
|
+
let held = new Set(issues), live = 0, peak = 0; const starts = [], release = clock.t + 20 * 60000;
|
|
100
|
+
const info = Object.fromEntries(issues.map((n) => [n, { owner: "op", since: "x", expiresAt: new Date(clock.t + 20 * 60000).toISOString() }]));
|
|
101
|
+
const rows = [];
|
|
102
|
+
await orchestrate({ issues, parallel: 4, pollMs: 1000, readBody: async () => "", trusted: () => true, now: () => clock.t, store: memStore(),
|
|
103
|
+
sleep: async (ms) => { clock.t += Math.max(1, Number(ms) || 0); }, recovery: { maxAttempts: 1, mechanicalMaxAttempts: 3 },
|
|
104
|
+
getHeld: () => [...held], getHoldInfo: () => info,
|
|
105
|
+
expireHolds: () => { if (clock.t < Date.parse(info[1].expiresAt) || !held.size) return []; const due = [...held].map((n) => ({ issue: n, owner: "op", since: "x" })); held = new Set(); return due; },
|
|
106
|
+
runOne: async () => { live++; peak = Math.max(peak, live); starts.push({ live, since: clock.t - release }); clock.t += 1000; await Promise.resolve(); live--; return MERGED; }, onUpdate: (x) => rows.push(x) });
|
|
107
|
+
assert.equal(rows.filter((x) => x.outcome === "hold-alert").length, 100, "one T-30 alert per hold");
|
|
108
|
+
assert.ok(peak <= 4, `peak ${peak} never exceeds the controller's cap`);
|
|
109
|
+
const early = starts.filter((x) => x.since < HOLD_RAMP_STEP_MS);
|
|
110
|
+
assert.ok(early.length > 0 && early.every((x) => x.live === 1), "the first step after expiry admits one lane, not the parallel cap of 4");
|
|
111
|
+
assert.equal(rows.filter((x) => x.outcome === "merged").length, 100);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
63
115
|
describe("#6008: hold and pause cover deferred retries and kept sandboxes", () => {
|
|
64
116
|
const CAP = { terminalReason: "deferred", code: "sandbox.capacity", retryInSeconds: 30, detail: "no sandbox capacity" };
|
|
65
117
|
it("a sandbox.capacity-deferred issue is not dispatched while held, including when its timer fires", async () => {
|
|
@@ -36,6 +36,23 @@ describe("selector reconcile (R2, R13)", () => {
|
|
|
36
36
|
const d = diffSelection({ open: [{ number: 5 }], members: [5, 7, 9], pending: [7, 9], running: new Set(), results: new Map(), matched: new Set([5, 7]) });
|
|
37
37
|
assert.deepEqual(d, { join: [], leave: [7] });
|
|
38
38
|
});
|
|
39
|
+
it("#6029 a selector-matched member closed during a resume's downtime leaves; unmatched pending members still run", async () => {
|
|
40
|
+
const saves = [];
|
|
41
|
+
const store = { load: () => ({ v: 1, order: [7, 9], pending: [7, 9], results: {}, selMatched: [7] }), save: (s) => saves.push(s), log: () => {} };
|
|
42
|
+
const ac = new AbortController();
|
|
43
|
+
let polls = 0;
|
|
44
|
+
const r = await harness({ issues: [], reconcile: { everyMs: 5000, list: async () => { if (++polls >= 3) ac.abort(); return [{ number: 9 }]; } }, extra: { store, signal: ac.signal } });
|
|
45
|
+
assert.deepEqual(r.calls, [9]);
|
|
46
|
+
assert.ok(r.rows.find((x) => x.issue === 7)?.outcome !== "merged");
|
|
47
|
+
assert.ok(saves.some((s) => Array.isArray(s.selMatched) && s.selMatched.includes(9)), "save() persists selMatched");
|
|
48
|
+
});
|
|
49
|
+
it("#6029 old state without selMatched restores an empty set: a closed pending member does not leave", async () => {
|
|
50
|
+
const store = { load: () => ({ v: 1, order: [7], pending: [7], results: {} }), save: () => {}, log: () => {} };
|
|
51
|
+
const ac = new AbortController();
|
|
52
|
+
let polls = 0;
|
|
53
|
+
const r = await harness({ issues: [], reconcile: { everyMs: 5000, list: async () => { if (++polls >= 3) ac.abort(); return []; } }, extra: { store, signal: ac.signal } });
|
|
54
|
+
assert.deepEqual(r.calls, [7]);
|
|
55
|
+
});
|
|
39
56
|
it("a failed read leaves nothing (parseSelected null)", () => {
|
|
40
57
|
assert.equal(parseSelected("not json"), null);
|
|
41
58
|
assert.deepEqual(parseSelected('[{"number":3,"labels":[{"name":"x"}]}]'), [{ number: 3, labels: ["x"] }]);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
// #6081: relaunch, recovery and requeue honour holds and pauses like fresh admission; an operator-stopped held lane is a hold, not an engine-error.
|
|
4
|
+
import { describe, it } from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { orchestrate } from "./orchestrate.mjs";
|
|
7
|
+
|
|
8
|
+
const memStore = () => { let st = null; return { load: () => (st ? JSON.parse(JSON.stringify(st)) : null), save: (s) => { st = JSON.parse(JSON.stringify(s)); }, log: () => {} }; };
|
|
9
|
+
const EE = (detail) => ({ terminalReason: "engine-error", detail });
|
|
10
|
+
const STOPPED = EE("lane pid 4242 exited without a result; see lanes/1.log");
|
|
11
|
+
const MERGED = { terminalReason: "merged", pr: 9 };
|
|
12
|
+
const REC = { owner: "op@h", since: "2026-01-01T00:00:00.000Z", expiresAt: null, reason: "host reserved", ownerPid: null, ownerHost: null };
|
|
13
|
+
|
|
14
|
+
const run = ({ script, issues = [1], store = memStore(), held = { v: [] }, pause = { v: null }, onStart = () => {}, extra = {}, clock = { t: 1_000_000 } }) => {
|
|
15
|
+
const calls = [], updates = [];
|
|
16
|
+
const p = orchestrate({ issues, parallel: 2, pollMs: 1000, readBody: async () => "", trusted: () => true, now: () => clock.t, store,
|
|
17
|
+
sleep: async (ms) => { clock.t += Math.max(1, Number(ms) || 0); },
|
|
18
|
+
getHeld: () => held.v, getPause: () => pause.v, recovery: { maxAttempts: 1, mechanicalMaxAttempts: 3 },
|
|
19
|
+
breaker: { errors: 2, window_min: 30 },
|
|
20
|
+
runOne: async (n) => { calls.push(n); clock.t += 1000; onStart(n); const l = script[n] ?? [MERGED]; return l[Math.min(calls.filter((c) => c === n).length - 1, l.length - 1)]; },
|
|
21
|
+
onUpdate: (r) => updates.push(r), ...extra });
|
|
22
|
+
return p.then((rows) => ({ rows, calls, updates, byIssue: Object.fromEntries(rows.map((r) => [r.issue, r])) }));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
describe("#6081: relaunch gates", () => {
|
|
26
|
+
it("held while running, then engine-error: no relaunch until --release", async () => {
|
|
27
|
+
const store = memStore(), held = { v: [] };
|
|
28
|
+
const a = await run({ script: { 1: [EE("boom"), MERGED] }, store, held, onStart: (n) => { if (n === 1) held.v = [1]; } });
|
|
29
|
+
assert.deepEqual(a.calls, [1], "the relaunch waits for the release");
|
|
30
|
+
assert.equal(a.byIssue[1].outcome, "held");
|
|
31
|
+
held.v = [];
|
|
32
|
+
const b = await run({ script: { 1: [MERGED] }, store, held });
|
|
33
|
+
assert.deepEqual(b.calls, [1]);
|
|
34
|
+
assert.equal(b.byIssue[1].outcome, "merged");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("a batch pause blocks the engine-error relaunch; the running lane still finishes", async () => {
|
|
38
|
+
const store = memStore(), pause = { v: null };
|
|
39
|
+
const a = await run({ script: { 1: [EE("boom"), MERGED] }, store, pause, onStart: (n) => { if (n === 1) pause.v = REC; } });
|
|
40
|
+
assert.deepEqual(a.calls, [1]);
|
|
41
|
+
assert.equal(a.byIssue[1].outcome, "held");
|
|
42
|
+
pause.v = null;
|
|
43
|
+
const b = await run({ script: { 1: [MERGED] }, store, pause });
|
|
44
|
+
assert.equal(b.byIssue[1].outcome, "merged");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("an operator-stopped held lane is a hold row, not an engine-error, and never counts toward the breaker", async () => {
|
|
48
|
+
const held = { v: [] };
|
|
49
|
+
const r = await run({ issues: [1, 2, 3], script: { 1: [STOPPED], 2: [STOPPED], 3: [MERGED] }, held,
|
|
50
|
+
onStart: (n) => { if (n === 1 || n === 2) held.v = [1, 2]; } });
|
|
51
|
+
assert.ok(!r.updates.some((u) => u.outcome === "breaker"), "no breaker trip");
|
|
52
|
+
assert.ok(!r.updates.some((u) => u.outcome === "engine-error"), "no engine-error row");
|
|
53
|
+
assert.ok(r.updates.some((u) => u.issue === 1 && u.outcome === "hold" && /stopped/.test(u.detail)));
|
|
54
|
+
assert.equal(r.byIssue[1].outcome, "held");
|
|
55
|
+
assert.equal(r.byIssue[3].outcome, "merged");
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -56,6 +56,16 @@ describe("orchestrate stacking (#5831)", () => {
|
|
|
56
56
|
await h.run();
|
|
57
57
|
assert.deepEqual(h.updates.filter((u) => u.issue === 2).map((u) => u.outcome), ["plan-failed", "merged"]);
|
|
58
58
|
});
|
|
59
|
+
for (const reason of ["invalid", "needs-human", "decomposed", "budget-exceeded"]) {
|
|
60
|
+
it(`plan (#5909): a ${reason} plan end settles the issue; no build lane, no plan-failed`, async () => {
|
|
61
|
+
const h = harness({ planResult: { terminalReason: reason, detail: "verdict" } });
|
|
62
|
+
await h.run();
|
|
63
|
+
assert.equal(h.calls.filter((c) => c.n === 2 && !c.ctx.plan).length, 0, "no build lane");
|
|
64
|
+
const outs = h.updates.filter((u) => u.issue === 2).map((u) => u.outcome);
|
|
65
|
+
assert.equal(outs.includes("plan-failed"), false);
|
|
66
|
+
assert.equal(outs.at(-1), reason);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
59
69
|
it("plan: planned/planTried are persisted for --resume", async () => {
|
|
60
70
|
let saved = null;
|
|
61
71
|
const store = { load: () => null, save: (s) => { if (s.planTried) saved = s; }, log: () => {} };
|