@codyswann/lisa 8.2.7 → 8.2.9
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/all/copy-overwrite/scripts/check-npm-publish-landed.mjs +7 -6
- package/dist/core/lisa-owned-hash-ledger.json +4 -0
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.json +9 -2
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/scripts/lisa-ci-failure-redispatch.mjs +137 -2
|
@@ -159,12 +159,13 @@ export const DEFAULT_MAX_RUNTIME_MS =
|
|
|
159
159
|
* to make a failing release green.
|
|
160
160
|
*
|
|
161
161
|
* OBSERVED LONGER, NOT YET RAISED. `@codyswann/lisa@8.2.4`, 2026-11-20 (Release
|
|
162
|
-
* and Deploy run 44743107550): `npm publish` was accepted at 13:33:04Z
|
|
163
|
-
* own `time` record for the version reads 14:28:26.191Z,
|
|
164
|
-
* job's check first got a 200 at 14:28:43Z
|
|
165
|
-
* {@link DEFAULT_WINDOW_MS}. The publish job's check gave
|
|
166
|
-
* value is left at 18m03s for now
|
|
167
|
-
* also force the window wider, and
|
|
162
|
+
* and Deploy run 44743107550): `npm publish` was accepted at 13:33:04Z. npm's
|
|
163
|
+
* own `time` record for the version reads 14:28:26.191Z, 55m22s after that;
|
|
164
|
+
* the reconcile job's check first got a 200 at 14:28:43Z, 55m39s after it.
|
|
165
|
+
* Both are longer than {@link DEFAULT_WINDOW_MS}. The publish job's check gave
|
|
166
|
+
* up at 14:12:40Z. This value is left at 18m03s for now
|
|
167
|
+
* (CodySwannGT/lisa#5106): raising it would also force the window wider, and
|
|
168
|
+
* that is a separate decision. A landing that
|
|
168
169
|
* late is not lost: the reconcile job in deploy.yml asks again, and treats
|
|
169
170
|
* `published` as a landed release.
|
|
170
171
|
*/
|
|
@@ -274,6 +274,8 @@
|
|
|
274
274
|
"2be5dbf57f3c23d8eacac06930637b9695ef292a58199247bc81ea2e242969b4",
|
|
275
275
|
"316a3d09a7c28a1c9c90f144552d7be68b4fb8c65e191e29534ce1961fd2c3e3",
|
|
276
276
|
"3ad3bb02a80666ec34b2e11af336f0238471320881c1a00009504099ee92fdef",
|
|
277
|
+
"58473074d6ecdba56b389bf8a0fe8594b80db76ef8114a1948c44219c040c57d",
|
|
278
|
+
"6077197980f4f90a22f871813452c5acdef8eb507b66575bb9673b4e366df10f",
|
|
277
279
|
"64ab045af386169a7f669bd5e90c8bec75f9edd722f7d5ea07ad8fd1d58022a6",
|
|
278
280
|
"6b20fc72b48c51938bc6e2211821db625d5f908f6ace07b4bbc2f9488e079357",
|
|
279
281
|
"7a2838530ca2dbfb18b7dfb7be446a92f01c1c87f7035740a300845b95ef82d5",
|
|
@@ -3398,6 +3400,8 @@
|
|
|
3398
3400
|
"2be5dbf57f3c23d8eacac06930637b9695ef292a58199247bc81ea2e242969b4",
|
|
3399
3401
|
"316a3d09a7c28a1c9c90f144552d7be68b4fb8c65e191e29534ce1961fd2c3e3",
|
|
3400
3402
|
"3ad3bb02a80666ec34b2e11af336f0238471320881c1a00009504099ee92fdef",
|
|
3403
|
+
"58473074d6ecdba56b389bf8a0fe8594b80db76ef8114a1948c44219c040c57d",
|
|
3404
|
+
"6077197980f4f90a22f871813452c5acdef8eb507b66575bb9673b4e366df10f",
|
|
3401
3405
|
"64ab045af386169a7f669bd5e90c8bec75f9edd722f7d5ea07ad8fd1d58022a6",
|
|
3402
3406
|
"6b20fc72b48c51938bc6e2211821db625d5f908f6ace07b4bbc2f9488e079357",
|
|
3403
3407
|
"7a2838530ca2dbfb18b7dfb7be446a92f01c1c87f7035740a300845b95ef82d5",
|
|
@@ -48,9 +48,9 @@ export const NIGHTLY_E2E_GUARD_BEHAVIOR_CERTIFICATES = Object.freeze({
|
|
|
48
48
|
}),
|
|
49
49
|
df39aa29b19817f67726107fec45078ce639f14a682cf6d5587ba37617f31ac9: Object.freeze({
|
|
50
50
|
contractVersion: "1.9.0",
|
|
51
|
-
packageVersions: Object.freeze(["8.2.
|
|
51
|
+
packageVersions: Object.freeze(["8.2.9"]),
|
|
52
52
|
provenances: Object.freeze([
|
|
53
|
-
"workspace package @codyswann/lisa@8.2.
|
|
53
|
+
"workspace package @codyswann/lisa@8.2.9 (typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs)",
|
|
54
54
|
]),
|
|
55
55
|
}),
|
|
56
56
|
dfd2fef680de5ef03e63075e8a61c62ca4d95cdfdff6201939b79c748d3397f6: Object.freeze({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"all/copy-contents/gitignore": "9aee6fe2edce4acdef159a1757c998b313abe538142aa6df37f01b38de088230",
|
|
5
5
|
"all/copy-contents/scripts/lisa-mutation.sh": "dd62950d6f13b9eae7e879b9de24ec1d19dc985634a2d921e003ede5a6f56a81",
|
|
6
6
|
"all/copy-overwrite/scripts/check-conflict-markers.mjs": "8a4b2cab9ac32a855e2adc1a7a3c6f7a9ac35dcb75cda2fac7eea144ced50098",
|
|
7
|
-
"all/copy-overwrite/scripts/check-npm-publish-landed.mjs": "
|
|
7
|
+
"all/copy-overwrite/scripts/check-npm-publish-landed.mjs": "58473074d6ecdba56b389bf8a0fe8594b80db76ef8114a1948c44219c040c57d",
|
|
8
8
|
"all/copy-overwrite/scripts/check-orphaned-branches.mjs": "1f450d2492ca0bcdba440f6b403c1deee0f35e749c54d2ed5c5ddc696d5ab896",
|
|
9
9
|
"all/copy-overwrite/scripts/check-release-package-identity.mjs": "a0f17592d4436de4c240f7c78512537581aa2ed5e89f0caf1fe890694163a873",
|
|
10
10
|
"all/copy-overwrite/scripts/check-state-classification.mjs": "a72910f9885629dd6d8a739b900f5603e4b53d68ece64100a2a5647016b58e1e",
|
|
@@ -1491,7 +1491,7 @@
|
|
|
1491
1491
|
"scripts/lib/worktree-dependencies.mjs": "31cb1cd96e7bd692d10ed2c26aa83c6b0580e48dbe6d2393edf9652970def091",
|
|
1492
1492
|
"scripts/lisa-assert-eas-profile.mjs": "624e40d7f33ca17208fc6b7a19320a785cff19da5d2ff8062b67a432b2a34022",
|
|
1493
1493
|
"scripts/lisa-audit.mjs": "27c1e83e620cf7e6e841f28d80479b2184d144c639a894ba427392133b650a6e",
|
|
1494
|
-
"scripts/lisa-ci-failure-redispatch.mjs": "
|
|
1494
|
+
"scripts/lisa-ci-failure-redispatch.mjs": "6c182d99448f4413fd55b5be8d12f8a39f542c83b43628611662bdaa638803ec",
|
|
1495
1495
|
"scripts/lisa-ci-rework-route.mjs": "0234a31160f50f89d6b229d8412b19f14649fffd90a072476fdb2ea548857590",
|
|
1496
1496
|
"scripts/lisa-commit-and-pr-local.sh": "5fa841490f4248ded6b16cbbeff111ce42532125a711b5b14a831e2ec52513de",
|
|
1497
1497
|
"scripts/lisa-commit-msg-gates.mjs": "f961cb70a525e7b0a94b8ca7a76d1e2bb5b1929d5477417e159dbf58312ce0d8",
|
|
@@ -12465,6 +12465,7 @@
|
|
|
12465
12465
|
"tests/unit/scripts/lisa-ci-failure-redispatch-cli.test.ts": true,
|
|
12466
12466
|
"tests/unit/scripts/lisa-ci-failure-redispatch-edges.test.ts": true,
|
|
12467
12467
|
"tests/unit/scripts/lisa-ci-failure-redispatch-intake.test.ts": true,
|
|
12468
|
+
"tests/unit/scripts/lisa-ci-failure-redispatch-stale-backlink.test.ts": true,
|
|
12468
12469
|
"tests/unit/scripts/lisa-ci-failure-redispatch-third-party.test.ts": true,
|
|
12469
12470
|
"tests/unit/scripts/lisa-ci-failure-redispatch-trust.test.ts": true,
|
|
12470
12471
|
"tests/unit/scripts/lisa-ci-failure-redispatch-workflow.test.ts": true,
|
|
@@ -17312,6 +17313,7 @@
|
|
|
17312
17313
|
"373ac9b2d06664531e5604aa7e7a53b024761365": true,
|
|
17313
17314
|
"37406134e4aefe0c02ddb72affc98fd57ae3b888": true,
|
|
17314
17315
|
"37488994ac7108d0c21a7f5e03317261f14cd990": true,
|
|
17316
|
+
"3749f6a1608ccc366e58b8f60f91383b1927240b": true,
|
|
17315
17317
|
"374d6259ca29e68e0584f62c45089a05deba56cf": true,
|
|
17316
17318
|
"374e82e4ad9e4df6e179922e75fa5e90c7c553b8": true,
|
|
17317
17319
|
"375006f03babb8113c50af1b424b8cb207b78167": true,
|
|
@@ -17749,6 +17751,7 @@
|
|
|
17749
17751
|
"3d70be0067e070c874411dae585e837ed79bec81": true,
|
|
17750
17752
|
"3d759e3b60352c9a195e364b0106067ee5abeef7": true,
|
|
17751
17753
|
"3d76f4aee5fa08f4c1d9b8c9233f9a507aafc366": true,
|
|
17754
|
+
"3d78b5232fc0fd88e63b7b93ebcafd9db0eb4dd8": true,
|
|
17752
17755
|
"3d7a4ec827d728d1dc509bfa5b090e1b929c7bea": true,
|
|
17753
17756
|
"3d7c4b89bfee95cc369911f80b3c82e3f5e84d65": true,
|
|
17754
17757
|
"3d7fa0674509a6aa8a7b9c3c2964380ca44443f2": true,
|
|
@@ -20956,6 +20959,7 @@
|
|
|
20956
20959
|
"6e5f27d667082863bdd592035c71f1789243f13e": true,
|
|
20957
20960
|
"6e61616c22af3d148057598326a88174b83d061c": true,
|
|
20958
20961
|
"6e66790862e23dd3e6d00fa2188904cabb9558b5": true,
|
|
20962
|
+
"6e67685e35e460bcfe976406506820b4313a9206": true,
|
|
20959
20963
|
"6e6b9b79b386f0a87850bca0094992fdbdf0e2be": true,
|
|
20960
20964
|
"6e6ecb6046d4f16479b2f9386821cd6937cd7b71": true,
|
|
20961
20965
|
"6e6eff0185647de48d11dab1941624b19d88b1c6": true,
|
|
@@ -21578,6 +21582,7 @@
|
|
|
21578
21582
|
"774bd8bf3ab145ddf06aa8266453f2b184eab37f": true,
|
|
21579
21583
|
"774e27a530b460408278fcd662fb77c8f8933c3e": true,
|
|
21580
21584
|
"775d3160164fdaccec750593723becb372c42be6": true,
|
|
21585
|
+
"775f447d43fe575d016e2156d6a3309f9b87a2ef": true,
|
|
21581
21586
|
"7760f5438e823d7900690f9c2d59c9680ecf50e9": true,
|
|
21582
21587
|
"77613461ca3a43534be0273898a6c5ce1254f1ad": true,
|
|
21583
21588
|
"7764e2a944efd9680d480c50f6d1835863f25c9c": true,
|
|
@@ -24369,6 +24374,7 @@
|
|
|
24369
24374
|
"a274a743bf74ff13d68572b55f82c6440e2bfba0": true,
|
|
24370
24375
|
"a277037ba5daad78ea5f6cf20d021e99611dbb1a": true,
|
|
24371
24376
|
"a27b81557186ac9a343ecdd99f7c394b678eefb4": true,
|
|
24377
|
+
"a27ce3e52891e36639b64047d4e63df38a6d22e5": true,
|
|
24372
24378
|
"a27f6874fa00ef5fc0cfa898268874591545a657": true,
|
|
24373
24379
|
"a281bd4f671d14dac48c8df8a36cfb010130876a": true,
|
|
24374
24380
|
"a28514fe9f1a67a244550334275810cbedcee9cc": true,
|
|
@@ -29199,6 +29205,7 @@
|
|
|
29199
29205
|
"e9ba5dc8d22a61fc4319b51927dfc8cad63cf8b8": true,
|
|
29200
29206
|
"e9be87ac12d48fd40b2844dd79ca0168c0a4a009": true,
|
|
29201
29207
|
"e9bffa0c16aff829b7f435b6daf31f3623594714": true,
|
|
29208
|
+
"e9c62dc36ee12836fd516d8bf6d0e3ce64f99b8d": true,
|
|
29202
29209
|
"e9ce5c89d487a9ca182b41b54ba91c7ebfc23e9a": true,
|
|
29203
29210
|
"e9d5ab76dd08189fed0e2cd52fb0a716a6346755": true,
|
|
29204
29211
|
"e9e250ab9f41fa45bace3b87e7bd5193d2c3857a": true,
|
package/package.json
CHANGED
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"zod": "^4.6.7"
|
|
200
200
|
},
|
|
201
201
|
"name": "@codyswann/lisa",
|
|
202
|
-
"version": "8.2.
|
|
202
|
+
"version": "8.2.9",
|
|
203
203
|
"description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
|
|
204
204
|
"main": "dist/index.js",
|
|
205
205
|
"exports": {
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"optional": true
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
|
-
"lisaReleaseCommit": "
|
|
374
|
-
"gitHead": "
|
|
375
|
-
"lisaReleaseTag": "v8.2.
|
|
373
|
+
"lisaReleaseCommit": "da5b3ffddbfee4882d1d6799862b6d5f7a767439",
|
|
374
|
+
"gitHead": "da5b3ffddbfee4882d1d6799862b6d5f7a767439",
|
|
375
|
+
"lisaReleaseTag": "v8.2.9"
|
|
376
376
|
}
|
|
@@ -37,6 +37,15 @@
|
|
|
37
37
|
* check run all end with no write and no further read. A passing gate runs the same pipeline; the
|
|
38
38
|
* decision logic is shared. `--head-sha` re-evaluates a past head by hand.
|
|
39
39
|
*
|
|
40
|
+
* A stale traceability failure (CodySwannGT/lisa#5111): the documented order
|
|
41
|
+
* opens the PR and THEN posts the `[lisa-pr-link]` backlink, but CI starts when
|
|
42
|
+
* the PR opens, so Work-Item Traceability can read the tracker first and fail
|
|
43
|
+
* gate 5. When that check is the ONLY failing required check and this PR's
|
|
44
|
+
* managed backlink was written after the check completed, the verdict is
|
|
45
|
+
* stale: the check is re-run instead of the item being bounced. The re-run
|
|
46
|
+
* reads the tracker live, so gate 5 stays the check's own decision; a missing
|
|
47
|
+
* or older backlink takes the ordinary path.
|
|
48
|
+
*
|
|
40
49
|
* Writes need positive evidence. A run for a superseded head, a fork PR, a PR
|
|
41
50
|
* with no or a foreign `Work-Item:`, a closed item, or an item outside the
|
|
42
51
|
* claimed lane all end with no write.
|
|
@@ -60,6 +69,7 @@ import process from "node:process";
|
|
|
60
69
|
|
|
61
70
|
import { invokedAsScript } from "../all/copy-overwrite/scripts/lib/invoked-as-script.mjs";
|
|
62
71
|
import {
|
|
72
|
+
partitionBacklinks,
|
|
63
73
|
soleWorkItem,
|
|
64
74
|
trackerContract,
|
|
65
75
|
} from "../all/copy-overwrite/scripts/lisa-work-item.mjs";
|
|
@@ -85,6 +95,17 @@ export const LISA_MARKER = /\[(?:lisa-[a-z0-9-]+|claude-build-intake)\]/u;
|
|
|
85
95
|
*/
|
|
86
96
|
const CLAIM_MARKERS =
|
|
87
97
|
/\[(?:lisa-tracker-claim|claude-build-intake|lisa-session-manager)\]/gu;
|
|
98
|
+
/**
|
|
99
|
+
* The required check that proves work-item traceability, as `gh pr checks`
|
|
100
|
+
* names it: the `🔍 Quality Checks` caller job in ci.yml and the
|
|
101
|
+
* `work_item_traceability` job in quality.yml. A test pins both halves to the
|
|
102
|
+
* workflow files, so a rename fails CI instead of silently disabling the
|
|
103
|
+
* stale-backlink path.
|
|
104
|
+
*/
|
|
105
|
+
export const TRACEABILITY_CHECK =
|
|
106
|
+
"🔍 Quality Checks / 🔗 Work-Item Traceability";
|
|
107
|
+
/** A check row's link to its Actions job: run id, then job id. */
|
|
108
|
+
const JOB_LINK = /\/actions\/runs\/(\d+)\/job\/(\d+)(?:$|[/?#])/u;
|
|
88
109
|
const NO_REQUIRED = /no (?:required )?checks reported/iu;
|
|
89
110
|
/** Read every page of a REST list as one array of pages. */
|
|
90
111
|
const PAGINATE = Object.freeze(["--paginate", "--slurp"]);
|
|
@@ -100,7 +121,9 @@ export const MARKER_AUTHORS = Object.freeze(["github-actions[bot]"]);
|
|
|
100
121
|
/**
|
|
101
122
|
* One write a plan would make.
|
|
102
123
|
* @typedef {object} PlannedAction
|
|
103
|
-
* @property {string} kind - `comment`, `relabel`, or `
|
|
124
|
+
* @property {string} kind - `comment`, `relabel`, `edit-comment`, or `rerun-job`.
|
|
125
|
+
* @property {number} [runId] - Actions run id, for `rerun-job`.
|
|
126
|
+
* @property {number} [jobId] - Actions job id, for `rerun-job`.
|
|
104
127
|
* @property {string} [item] - Canonical work item, for `comment` and `relabel`.
|
|
105
128
|
* @property {string} [body] - Comment body, for `comment` and `edit-comment`.
|
|
106
129
|
* @property {string} [remove] - Lane label to remove, for `relabel`.
|
|
@@ -121,11 +144,12 @@ export const MARKER_AUTHORS = Object.freeze(["github-actions[bot]"]);
|
|
|
121
144
|
* @property {number} [runId] - Actions run id.
|
|
122
145
|
*/
|
|
123
146
|
|
|
124
|
-
/** The
|
|
147
|
+
/** The writes a plan can contain. */
|
|
125
148
|
const ACTION = Object.freeze({
|
|
126
149
|
comment: "comment",
|
|
127
150
|
relabel: "relabel",
|
|
128
151
|
editComment: "edit-comment",
|
|
152
|
+
rerunJob: "rerun-job",
|
|
129
153
|
});
|
|
130
154
|
|
|
131
155
|
/**
|
|
@@ -646,6 +670,8 @@ function untouchedSince(ctx, marker) {
|
|
|
646
670
|
function planFailure(ctx) {
|
|
647
671
|
const { item, view, pr, sha, failing, lanes } = ctx;
|
|
648
672
|
const known = { pr, sha, item };
|
|
673
|
+
const stale = planStaleTraceability(ctx);
|
|
674
|
+
if (stale) return stale;
|
|
649
675
|
const relabel = {
|
|
650
676
|
kind: ACTION.relabel,
|
|
651
677
|
item,
|
|
@@ -693,6 +719,102 @@ function planFailure(ctx) {
|
|
|
693
719
|
};
|
|
694
720
|
}
|
|
695
721
|
|
|
722
|
+
/**
|
|
723
|
+
* Plan a traceability failure that read the tracker before the backlink existed.
|
|
724
|
+
*
|
|
725
|
+
* Returns null — the ordinary failure path — unless ALL of these hold: the
|
|
726
|
+
* only failing required check is `TRACEABILITY_CHECK`; the item carries Lisa's
|
|
727
|
+
* managed backlink comment for exactly this PR; and that comment was created
|
|
728
|
+
* or last edited after the failing check completed. Then the failure answers a
|
|
729
|
+
* question about a tracker that no longer exists, and the remedy is to ask the
|
|
730
|
+
* check again, not to send the item back to the queue.
|
|
731
|
+
*
|
|
732
|
+
* The comment's author is deliberately not trusted or checked. Nothing here
|
|
733
|
+
* decides gate 5: a forged backlink earns one re-run, which reads the tracker
|
|
734
|
+
* itself, and that run's own completion is then newer than the comment, so a
|
|
735
|
+
* second failure takes the ordinary path. No loop is possible.
|
|
736
|
+
*
|
|
737
|
+
* A job in a run that has not finished cannot be re-run, and a third-party
|
|
738
|
+
* check can trigger this while CI is still running. That case writes nothing:
|
|
739
|
+
* the CI run's own `workflow_run` completion re-evaluates and re-runs then.
|
|
740
|
+
* @param {object} ctx - Resolved context.
|
|
741
|
+
* @returns {Plan|null} A re-run or wait plan, or null for the ordinary path.
|
|
742
|
+
*/
|
|
743
|
+
function planStaleTraceability(ctx) {
|
|
744
|
+
const { view, pr, sha, item, failing, repository, gh } = ctx;
|
|
745
|
+
if (failing.length !== 1 || failing[0] !== TRACEABILITY_CHECK) return null;
|
|
746
|
+
const prUrl = `https://github.com/${repository}/pull/${pr}`;
|
|
747
|
+
const { mine } = partitionBacklinks(view.comments, prUrl, c => c.body);
|
|
748
|
+
if (mine === undefined) return null;
|
|
749
|
+
const row = readCheckDetails(pr, repository, gh).find(
|
|
750
|
+
c => c.name === TRACEABILITY_CHECK && c.bucket === "fail"
|
|
751
|
+
);
|
|
752
|
+
if (row === undefined) return null;
|
|
753
|
+
const written = Date.parse(mine.updated_at ?? mine.created_at);
|
|
754
|
+
const completed = Date.parse(row.completedAt);
|
|
755
|
+
if (!Number.isFinite(written) || !Number.isFinite(completed))
|
|
756
|
+
throw new Error(
|
|
757
|
+
`cannot compare the backlink time (${mine.updated_at ?? mine.created_at}) with the check completion (${row.completedAt})`
|
|
758
|
+
);
|
|
759
|
+
if (written <= completed) return null;
|
|
760
|
+
const link = JOB_LINK.exec(String(row.link ?? ""));
|
|
761
|
+
if (link === null)
|
|
762
|
+
throw new Error(
|
|
763
|
+
`the ${TRACEABILITY_CHECK} row links to no Actions job: ${row.link}`
|
|
764
|
+
);
|
|
765
|
+
const runId = Number(link[1]);
|
|
766
|
+
const jobId = Number(link[2]);
|
|
767
|
+
const known = { pr, sha, item };
|
|
768
|
+
const run = readJson(gh, [
|
|
769
|
+
"api",
|
|
770
|
+
`repos/${repository}/actions/runs/${runId}`,
|
|
771
|
+
]);
|
|
772
|
+
if (run.status !== "completed")
|
|
773
|
+
return stop(
|
|
774
|
+
"stale-traceability-pending",
|
|
775
|
+
`${TRACEABILITY_CHECK} failed before this PR's backlink was written, and run ${runId} has not finished; its completion re-evaluates`,
|
|
776
|
+
known
|
|
777
|
+
);
|
|
778
|
+
return {
|
|
779
|
+
...known,
|
|
780
|
+
outcome: "rerun-stale-traceability",
|
|
781
|
+
reason: `${TRACEABILITY_CHECK} completed at ${row.completedAt}, before this PR's backlink was written at ${mine.updated_at ?? mine.created_at}; re-running it instead of re-dispatching`,
|
|
782
|
+
actions: [{ kind: ACTION.rerunJob, runId, jobId }],
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Read completion time and job link for the PR's required checks.
|
|
788
|
+
*
|
|
789
|
+
* A separate read from `readRequiredChecks` so the common path keeps its
|
|
790
|
+
* recorded argv; only the stale-traceability path needs these two fields.
|
|
791
|
+
* @param {number} pr - PR number.
|
|
792
|
+
* @param {string} repo - Repository.
|
|
793
|
+
* @param {Function} gh - Runner.
|
|
794
|
+
* @returns {Array<{name: string, bucket: string, completedAt: string, link: string}>} Rows.
|
|
795
|
+
*/
|
|
796
|
+
function readCheckDetails(pr, repo, gh) {
|
|
797
|
+
const args = [
|
|
798
|
+
"pr",
|
|
799
|
+
"checks",
|
|
800
|
+
String(pr),
|
|
801
|
+
"--repo",
|
|
802
|
+
repo,
|
|
803
|
+
"--required",
|
|
804
|
+
"--json",
|
|
805
|
+
"name,bucket,completedAt,link",
|
|
806
|
+
];
|
|
807
|
+
const result = gh(args);
|
|
808
|
+
// Non-zero exit with rows on stdout is normal while a check is failing.
|
|
809
|
+
try {
|
|
810
|
+
const rows = JSON.parse(result.stdout);
|
|
811
|
+
if (Array.isArray(rows)) return rows;
|
|
812
|
+
} catch {
|
|
813
|
+
// fall through
|
|
814
|
+
}
|
|
815
|
+
throw new Error(`gh ${args.join(" ")} failed: ${result.stderr}`);
|
|
816
|
+
}
|
|
817
|
+
|
|
696
818
|
/**
|
|
697
819
|
* Plan the clear path.
|
|
698
820
|
* @param {object} ctx - Resolved context.
|
|
@@ -825,6 +947,8 @@ export function planRedispatch({ run, repository, contract, gh }) {
|
|
|
825
947
|
failing,
|
|
826
948
|
runId: run.id,
|
|
827
949
|
lanes: contract.lifecycle,
|
|
950
|
+
repository: contract.repository,
|
|
951
|
+
gh,
|
|
828
952
|
// Read lazily: only a lane repair or restore needs the label history.
|
|
829
953
|
events: () => readEvents(view.number, contract.repository, gh),
|
|
830
954
|
// The same supersession rule the route helper applies (#4707).
|
|
@@ -1015,6 +1139,15 @@ function writeCall(action, repo) {
|
|
|
1015
1139
|
],
|
|
1016
1140
|
input: JSON.stringify({ body: action.body }),
|
|
1017
1141
|
};
|
|
1142
|
+
if (action.kind === ACTION.rerunJob)
|
|
1143
|
+
return {
|
|
1144
|
+
args: [
|
|
1145
|
+
"api",
|
|
1146
|
+
"-X",
|
|
1147
|
+
"POST",
|
|
1148
|
+
`repos/${repo}/actions/jobs/${action.jobId}/rerun`,
|
|
1149
|
+
],
|
|
1150
|
+
};
|
|
1018
1151
|
throw new Error(`unknown planned action: ${action.kind}`);
|
|
1019
1152
|
}
|
|
1020
1153
|
|
|
@@ -1057,6 +1190,8 @@ function describePlan(plan, dryRun) {
|
|
|
1057
1190
|
);
|
|
1058
1191
|
if (action.kind === ACTION.editComment)
|
|
1059
1192
|
lines.push(`${verb}: mark comment ${action.commentId} cleared`);
|
|
1193
|
+
if (action.kind === ACTION.rerunJob)
|
|
1194
|
+
lines.push(`${verb}: re-run job ${action.jobId} of run ${action.runId}`);
|
|
1060
1195
|
}
|
|
1061
1196
|
return lines;
|
|
1062
1197
|
}
|