@codyswann/lisa 5.14.3 → 6.0.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.
Files changed (104) hide show
  1. package/cdk/copy-overwrite/eslint.cdk.ts +7 -161
  2. package/cdk/copy-overwrite/tsconfig.eslint.json +5 -1
  3. package/dist/configs/jest/base.d.ts +2 -2
  4. package/dist/configs/jest/index.d.ts +5 -6
  5. package/dist/configs/jest/index.d.ts.map +1 -1
  6. package/dist/configs/jest/index.js +5 -6
  7. package/dist/configs/jest/index.js.map +1 -1
  8. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  9. package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
  10. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  11. package/dist/core/upstream-evidence-manifest.js +33 -18
  12. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  13. package/expo/copy-overwrite/eslint.expo.ts +17 -18
  14. package/expo/copy-overwrite/tsconfig.eslint.json +5 -1
  15. package/harper-fabric/copy-overwrite/tsconfig.eslint.json +5 -1
  16. package/nestjs/copy-overwrite/eslint.nestjs.ts +7 -161
  17. package/nestjs/copy-overwrite/tsconfig.eslint.json +5 -1
  18. package/nestjs/copy-overwrite/tsconfig.spec.json +2 -3
  19. package/package.json +7 -9
  20. package/phaser/copy-overwrite/tsconfig.eslint.json +5 -1
  21. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  23. package/plugins/lisa-agy/plugin.json +1 -1
  24. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  26. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  27. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  31. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  35. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  37. package/plugins/lisa-expo-agy/plugin.json +1 -1
  38. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  42. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  44. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  45. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  49. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  51. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  52. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  56. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  58. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  59. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  63. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  65. package/plugins/lisa-rails-agy/plugin.json +1 -1
  66. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  70. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  73. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  77. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  79. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  80. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  84. package/scripts/check-learnings-budget.ts +4 -4
  85. package/scripts/check-self-dependency-pin.mjs +172 -5
  86. package/scripts/check-typecheck-tests.mjs +88 -20
  87. package/scripts/push-self-pin-raise.sh +79 -0
  88. package/scripts/raise-self-dependency-pin.mjs +166 -0
  89. package/scripts/two-channel-couplings.json +125 -9
  90. package/scripts/update-node-version.ts +1 -1
  91. package/scripts/verify-self-pin-raise.mjs +487 -0
  92. package/typescript/copy-overwrite/tsconfig.eslint.json +5 -1
  93. package/dist/configs/jest/cdk.d.ts +0 -33
  94. package/dist/configs/jest/cdk.d.ts.map +0 -1
  95. package/dist/configs/jest/cdk.js +0 -29
  96. package/dist/configs/jest/cdk.js.map +0 -1
  97. package/dist/configs/jest/nestjs.d.ts +0 -36
  98. package/dist/configs/jest/nestjs.d.ts.map +0 -1
  99. package/dist/configs/jest/nestjs.js +0 -49
  100. package/dist/configs/jest/nestjs.js.map +0 -1
  101. package/dist/configs/jest/typescript.d.ts +0 -29
  102. package/dist/configs/jest/typescript.d.ts.map +0 -1
  103. package/dist/configs/jest/typescript.js +0 -37
  104. package/dist/configs/jest/typescript.js.map +0 -1
@@ -40,6 +40,13 @@
40
40
  * token out of this header to decide the gate is probeable at all — without it
41
41
  * this sits in that sweep's declared blind spot.
42
42
  *
43
+ * `--project` POINTS IT AT ANOTHER PROGRAM. `tsconfig.eslint.json` is the
44
+ * program ESLint's type-aware rules read their types from; it once reported
45
+ * 5,294 errors while lint passed, so those rules were reasoning over `any` and
46
+ * error types (CodySwannGT/lisa#4927). `bun run typecheck:eslint` runs this
47
+ * same gate over it — same rules, same refusals, no exemption list — so that
48
+ * program cannot rot unseen again. Without the flag it checks the test program.
49
+ *
43
50
  * WHAT IS DELIBERATELY NOT DONE HERE: the declared `lib` is not widened. tsc
44
51
  * emits "Try changing the 'lib' compiler option to 'es2023' or later" on the
45
52
  * ES2023 array APIs, and taking that suggestion would have erased the
@@ -66,8 +73,40 @@ const DEFAULT_ROOT = path.resolve(
66
73
  ".."
67
74
  );
68
75
 
69
- /** The gate's name, as it prints in both the report and the refusal. */
70
- const GATE = "type-correctness (tests)";
76
+ /** The project the gate compiles when no `--project` is given. */
77
+ const DEFAULT_PROJECT = "tsconfig.tests.json";
78
+
79
+ /**
80
+ * How each known program is named in the report and the refusal. The test
81
+ * program's wording is a contract: `gate-failure-diagnosis.mjs` and the tests
82
+ * pinning this gate read it.
83
+ * @type {Readonly<Record<string, { gate: string, program: string }>>}
84
+ */
85
+ const PROGRAMS = {
86
+ "tsconfig.tests.json": {
87
+ gate: "type-correctness (tests)",
88
+ program: "the test program",
89
+ },
90
+ "tsconfig.eslint.json": {
91
+ gate: "type-correctness (eslint program)",
92
+ program: "the ESLint program",
93
+ },
94
+ };
95
+
96
+ /**
97
+ * Name a program for the report: a known one by its fixed wording, any other
98
+ * by its config file, so a new project never prints as the test program.
99
+ * @param {string} project - The tsconfig path, relative to the root.
100
+ * @returns {{ gate: string, program: string }} The gate name and program noun.
101
+ */
102
+ export function describeProgram(project) {
103
+ return (
104
+ PROGRAMS[project] ?? {
105
+ gate: `type-correctness (${project})`,
106
+ program: `the ${project} program`,
107
+ }
108
+ );
109
+ }
71
110
 
72
111
  /**
73
112
  * Where the compiler is spawned from, relative to the root: the TypeScript
@@ -117,16 +156,17 @@ function parseDiagnostics(output) {
117
156
  * NO FILE IS NAMED HERE, deliberately: nothing was compiled, so nothing is
118
157
  * known about any file.
119
158
  *
159
+ * @param {{ gate: string, program: string }} named - The program's names.
120
160
  * @param {string} because - Why the measurement could not happen.
121
161
  * @param {string} fix - The action that repairs THIS cause. Named per call
122
162
  * site rather than fixed, because telling someone to install dependencies
123
163
  * they already have is how a refusal gets dismissed as noise.
124
164
  * @returns {string} The refusal block.
125
165
  */
126
- function refuseUnmeasurable(because, fix) {
166
+ function refuseUnmeasurable(named, because, fix) {
127
167
  return cannotMeasure({
128
- gate: GATE,
129
- denial: "that the test program type-checks",
168
+ gate: named.gate,
169
+ denial: `that ${named.program} type-checks`,
130
170
  because,
131
171
  remedy: `${fix} No file was compiled, so nothing was established about any of them.`,
132
172
  });
@@ -135,9 +175,11 @@ function refuseUnmeasurable(because, fix) {
135
175
  /**
136
176
  * Run the gate.
137
177
  * @param {string} root - Directory to resolve the project under.
178
+ * @param {string} [project] - The tsconfig to compile, relative to the root.
138
179
  * @returns {number} The process exit code.
139
180
  */
140
- export function main(root) {
181
+ export function main(root, project = DEFAULT_PROJECT) {
182
+ const named = describeProgram(project);
141
183
  // PRECONDITION. Checked before the spawn rather than inferred from it: the
142
184
  // spawn SUCCEEDS with an empty `node_modules` — node starts, and it is node
143
185
  // that cannot find the module — so `tsc.error` never fires and the failure
@@ -146,6 +188,7 @@ export function main(root) {
146
188
  if (missing.length > 0) {
147
189
  console.error(
148
190
  refuseUnmeasurable(
191
+ named,
149
192
  `the TypeScript native compiler (tsgo) is not installed — no file at ${missing[0]}.`,
150
193
  `Run \`${INSTALL_COMMAND}\`, then re-run this gate.`
151
194
  )
@@ -161,7 +204,7 @@ export function main(root) {
161
204
  "--pretty",
162
205
  "false",
163
206
  "-p",
164
- path.join(root, "tsconfig.tests.json"),
207
+ path.join(root, project),
165
208
  ],
166
209
  { cwd: root, encoding: "utf-8", maxBuffer: 64 * 1024 * 1024 }
167
210
  );
@@ -189,6 +232,7 @@ export function main(root) {
189
232
  .find(Boolean);
190
233
  console.error(
191
234
  refuseUnmeasurable(
235
+ named,
192
236
  `tsgo exited ${tsc.status} without emitting one diagnostic this gate ` +
193
237
  `could parse, so the check had no subject.` +
194
238
  `${firstLine ? ` First output line: ${firstLine}` : ""}`,
@@ -201,7 +245,7 @@ export function main(root) {
201
245
  const offenders = [...errorsByFile.keys()].sort();
202
246
  const totalErrors = [...errorsByFile.values()].reduce((sum, n) => sum + n, 0);
203
247
  console.log(
204
- `${GATE}: ${errorsByFile.size} file(s) with ${totalErrors} error(s).`
248
+ `${named.gate}: ${errorsByFile.size} file(s) with ${totalErrors} error(s).`
205
249
  );
206
250
 
207
251
  if (offenders.length > 0) {
@@ -212,32 +256,56 @@ export function main(root) {
212
256
  }
213
257
  console.error("");
214
258
  console.error(
215
- "Fix each at its cause. There is no exemption list: every file in the"
259
+ "Fix each at its cause. There is no exemption list: every file in"
216
260
  );
217
- console.error("test program is type-checked, and one error fails it.");
261
+ console.error(`${named.program} is type-checked, and one error fails it.`);
218
262
  return 1;
219
263
  }
220
264
 
221
- console.log("✅ The test program type-checks with no errors.");
265
+ const program =
266
+ named.program.charAt(0).toUpperCase() + named.program.slice(1);
267
+ console.log(`✅ ${program} type-checks with no errors.`);
222
268
  return 0;
223
269
  }
224
270
 
225
271
  /**
226
- * Resolve the root from `--root <dir>`, defaulting to the repository.
272
+ * Read the value following `flag`, or undefined when the flag is absent.
227
273
  * @param {ReadonlyArray<string>} argv - Arguments after the script name.
228
- * @returns {string} The absolute root.
274
+ * @param {string} flag - The flag, e.g. `--root`.
275
+ * @returns {string | undefined} The flag's value.
229
276
  */
230
- export function rootFrom(argv) {
231
- const flag = argv.indexOf("--root");
232
- if (flag === -1) return DEFAULT_ROOT;
233
- const value = argv[flag + 1];
277
+ function flagValue(argv, flag) {
278
+ const index = argv.indexOf(flag);
279
+ if (index === -1) return undefined;
280
+ const value = argv[index + 1];
234
281
  if (value === undefined) {
235
- console.error("check-typecheck-tests: --root requires a value");
282
+ console.error(`check-typecheck-tests: ${flag} requires a value`);
236
283
  process.exit(2);
237
284
  }
238
- return path.resolve(value);
285
+ return value;
286
+ }
287
+
288
+ /**
289
+ * Resolve the root from `--root <dir>`, defaulting to the repository.
290
+ * @param {ReadonlyArray<string>} argv - Arguments after the script name.
291
+ * @returns {string} The absolute root.
292
+ */
293
+ export function rootFrom(argv) {
294
+ const value = flagValue(argv, "--root");
295
+ return value === undefined ? DEFAULT_ROOT : path.resolve(value);
296
+ }
297
+
298
+ /**
299
+ * Resolve the project from `--project <tsconfig>`, relative to the root and
300
+ * defaulting to the test program.
301
+ * @param {ReadonlyArray<string>} argv - Arguments after the script name.
302
+ * @returns {string} The tsconfig path relative to the root.
303
+ */
304
+ export function projectFrom(argv) {
305
+ return flagValue(argv, "--project") ?? DEFAULT_PROJECT;
239
306
  }
240
307
 
241
308
  if (invokedAsScript(import.meta.url)) {
242
- process.exit(main(rootFrom(process.argv.slice(2))));
309
+ const argv = process.argv.slice(2);
310
+ process.exit(main(rootFrom(argv), projectFrom(argv)));
243
311
  }
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Push the proved self-pin raise to main (CodySwannGT/lisa#4951).
4
+ #
5
+ # The self-pin-raise workflow's `push_self_pin_raise` job runs this in its
6
+ # final step, the only step that holds the deploy key. The raise commit is
7
+ # already made on top of the commit the raise was proved against (BASE_SHA).
8
+ #
9
+ # It pushes ONLY onto that exact commit: the push carries an explicit lease on
10
+ # refs/heads/main at BASE_SHA, so any other tip — a newer main, or one rolled
11
+ # back to an ancestor — is rejected; this script then fetches main and, when
12
+ # the tip is no longer BASE_SHA, refuses. It never rebases: a rebased raise
13
+ # would combine the raised dependency graph with source nobody tested it
14
+ # against.
15
+ #
16
+ # The refusal needs no one to act on it, but it does not rely on the commit
17
+ # that moved main either: a `[skip ci]` push starts no deploy run, and a later
18
+ # release whose publish never proves itself skips the raise. The workflow also
19
+ # runs hourly with no version, recomputing the raise against main as it is
20
+ # then, so the next scheduled run re-proves and pushes it.
21
+ #
22
+ # A push or fetch that fails while main is still BASE_SHA is transient (network,
23
+ # GitHub outage) and is retried a bounded number of times with a growing delay.
24
+ # When every attempt fails the step fails: nothing unproved is ever pushed.
25
+ #
26
+ # Usage:
27
+ # scripts/push-self-pin-raise.sh <remote> <base-sha> <version>
28
+ #
29
+ # Environment:
30
+ # SELF_PIN_PUSH_RETRY_DELAY seconds per attempt of back-off (default 5)
31
+ #
32
+
33
+ set -euo pipefail
34
+
35
+ if [ "$#" -ne 3 ] || [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
36
+ echo "usage: push-self-pin-raise.sh <remote> <base-sha> <version>" >&2
37
+ exit 2
38
+ fi
39
+
40
+ remote="$1"
41
+ base_sha="$2"
42
+ version="$3"
43
+ attempts=3
44
+ delay="${SELF_PIN_PUSH_RETRY_DELAY:-5}"
45
+
46
+ # The raise must be exactly one commit on top of the proved base, or the lease
47
+ # below would vouch for a commit it never inspected.
48
+ if [ "$(git rev-parse HEAD^ 2>/dev/null || true)" != "$base_sha" ] || [ "$(git rev-list --parents -n 1 HEAD | wc -w | tr -d ' ')" != "2" ]; then
49
+ echo "::error::HEAD is not a single raise commit on top of $base_sha; refusing to push." >&2
50
+ exit 2
51
+ fi
52
+
53
+ for attempt in $(seq 1 "$attempts"); do
54
+ # A plain push accepts any fast-forward, including one from an ANCESTOR of
55
+ # BASE_SHA — so a main rolled back to an older commit would be quietly
56
+ # restored. The explicit lease accepts only a main that is still BASE_SHA.
57
+ if git -c core.hooksPath=/dev/null push --force-with-lease="refs/heads/main:$base_sha" "$remote" HEAD:refs/heads/main; then
58
+ echo "✅ Raised the self-pin to ^${version} on main."
59
+ exit 0
60
+ fi
61
+ echo "::warning::Push attempt $attempt of $attempts failed; checking whether main moved."
62
+ # Full refs throughout: a remote that also has a `main` tag would make the
63
+ # short name ambiguous, and no retry resolves an ambiguity.
64
+ if git fetch "$remote" refs/heads/main; then
65
+ fetched="$(git rev-parse FETCH_HEAD)"
66
+ if [ "$fetched" != "$base_sha" ]; then
67
+ echo "::error::main moved from $base_sha to $fetched after the raise was proved, so this raise is untested against it and nothing was pushed. The hourly run of the self-pin-raise workflow recomputes and re-proves the raise against main as it is then; a release that reaches npm in the meantime does the same sooner."
68
+ exit 1
69
+ fi
70
+ else
71
+ echo "::warning::Fetching main failed on attempt $attempt of $attempts; it is retried before anything is decided."
72
+ fi
73
+ if [ "$attempt" -lt "$attempts" ]; then
74
+ sleep $((attempt * delay))
75
+ fi
76
+ done
77
+
78
+ echo "::error::Could not push the self-pin raise to main after $attempts attempts; nothing was pushed."
79
+ exit 1
@@ -0,0 +1,166 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Raise Lisa's own `@codyswann/lisa` pin when a release leaves it behind
4
+ * (CodySwannGT/lisa#4951).
5
+ *
6
+ * ## Why this exists beside the check
7
+ *
8
+ * `check-self-dependency-pin.mjs` (#3768) reports a self-pin that can no longer
9
+ * resolve the newest release, and it is wired into a required status check. On
10
+ * its own that turned every major release into a red required check on every
11
+ * open pull request until somebody raised the floor by hand — 6.0.0 did exactly
12
+ * that. A report whose only remedy is a person is half a control.
13
+ *
14
+ * This is the other half. The release workflow runs it right after the publish
15
+ * lands, with the version it just published, and pushes the result to `main`
16
+ * with the same deploy key the release commit itself uses. The check and this
17
+ * script share one definition of "stale" (`compareSpec`), so the script raises
18
+ * the floor in exactly the cases the check fails on and in no others: a release
19
+ * the declared range already admits changes nothing, which is also what keeps
20
+ * the bump from chasing its own releases.
21
+ *
22
+ * ## Why it rewrites the manifest itself instead of calling `bun add`
23
+ *
24
+ * `bun add` re-sorts the whole dependency section, turning a one-line pin raise
25
+ * into a diff that touches unrelated lines. Parsing and re-serialising with the
26
+ * repository's own two-space format keeps key order and changes one value.
27
+ * @module scripts/raise-self-dependency-pin
28
+ */
29
+ import { readFileSync, writeFileSync } from "node:fs";
30
+ import path from "node:path";
31
+ import process from "node:process";
32
+ import { fileURLToPath } from "node:url";
33
+
34
+ import semver from "semver";
35
+
36
+ import {
37
+ compareSpec,
38
+ locateSelfPin,
39
+ SELF_PACKAGE,
40
+ } from "./check-self-dependency-pin.mjs";
41
+ import { invokedAsScript } from "./lib/invoked-as-script.mjs";
42
+
43
+ /** The line a caller greps for. */
44
+ const VERDICT_PREFIX = "raise-self-dependency-pin:";
45
+
46
+ /**
47
+ * Decide what the manifest's self-pin should become for one published version.
48
+ * @param {Record<string, unknown>} manifest - Parsed package.json.
49
+ * @param {string} version - The version the release just published.
50
+ * @returns {{verdict: "raised" | "current" | "local-checkout" | "unprovable" | "no-pin" | "below-floor", detail: string, manifest: Record<string, unknown>}} Outcome and the manifest to write.
51
+ */
52
+ export function raiseSelfPin(manifest, version) {
53
+ if (semver.valid(version) === null || semver.prerelease(version) !== null) {
54
+ throw new Error(
55
+ `"${version}" is not a published release version; refusing to pin to it`
56
+ );
57
+ }
58
+ const declared = locateSelfPin(manifest);
59
+ if (declared === null) {
60
+ return {
61
+ verdict: "no-pin",
62
+ detail: `this manifest declares no ${SELF_PACKAGE} dependency`,
63
+ manifest,
64
+ };
65
+ }
66
+ const { verdict, detail } = compareSpec(declared.spec, version);
67
+ if (verdict !== "stale") {
68
+ return { verdict, detail, manifest };
69
+ }
70
+ // `stale` means only "outside the range", and a version BELOW the floor is
71
+ // outside it too. The hourly run raises to the newest INSTALLABLE release,
72
+ // which skips one whose tarball 404s — so a pin of ^7.1.0 whose 7.1.0 is
73
+ // unservable would otherwise be "raised" to ^7.0.5. A raise never lowers.
74
+ const floor = semver.minVersion(declared.spec);
75
+ if (floor !== null && semver.lt(version, floor)) {
76
+ return {
77
+ verdict: "below-floor",
78
+ detail:
79
+ `${version} is below the declared floor ${floor.version} of ${declared.spec}; ` +
80
+ `a raise never lowers the pin, so nothing was written. The floor release itself ` +
81
+ `is not installable, which is what to fix`,
82
+ manifest,
83
+ };
84
+ }
85
+ const raised = `^${version}`;
86
+ return {
87
+ verdict: "raised",
88
+ detail: `${declared.section}["${SELF_PACKAGE}"] ${declared.spec} → ${raised}`,
89
+ manifest: {
90
+ ...manifest,
91
+ [declared.section]: {
92
+ ...manifest[declared.section],
93
+ [SELF_PACKAGE]: raised,
94
+ },
95
+ },
96
+ };
97
+ }
98
+
99
+ /**
100
+ * Return an optional CLI option.
101
+ * @param {string[]} argv - Arguments after the script path.
102
+ * @param {string} name - Option name, `--` included.
103
+ * @returns {string | undefined} The option's value.
104
+ */
105
+ function option(argv, name) {
106
+ const index = argv.indexOf(name);
107
+ const value = index === -1 ? undefined : argv[index + 1];
108
+ return value === undefined || value.startsWith("--") ? undefined : value;
109
+ }
110
+
111
+ /**
112
+ * The default manifest: this repository's own package.json.
113
+ * @returns {string} Absolute path.
114
+ */
115
+ function defaultManifestPath() {
116
+ const here = path.dirname(fileURLToPath(import.meta.url));
117
+ return path.join(here, "..", "package.json");
118
+ }
119
+
120
+ /**
121
+ * Run the raise for a caller that is a workflow step.
122
+ *
123
+ * Exit 0 for `raised`, `current`, `local-checkout` and `no-pin` — the same
124
+ * verdicts the check passes — and the workflow commits only on `raised`. Exit 1
125
+ * on `unprovable` (a spec that is not a valid range) and on `below-floor` (the
126
+ * newest installable release is older than the declared floor), because the
127
+ * check fails on both too and leaving either alone silently would hand the
128
+ * next pull request a red check with no run that says why.
129
+ * @param {string[]} argv - Arguments after the script path.
130
+ * @returns {number} Process exit code.
131
+ */
132
+ export function main(argv) {
133
+ const version = option(argv, "--version");
134
+ if (version === undefined) {
135
+ process.stderr.write("❌ --version <published version> is required\n");
136
+ return 1;
137
+ }
138
+ const manifestPath = option(argv, "--manifest") ?? defaultManifestPath();
139
+ const outcome = raiseSelfPin(
140
+ JSON.parse(readFileSync(manifestPath, "utf8")),
141
+ version
142
+ );
143
+ if (outcome.verdict === "raised") {
144
+ writeFileSync(
145
+ manifestPath,
146
+ `${JSON.stringify(outcome.manifest, null, 2)}\n`
147
+ );
148
+ }
149
+ process.stdout.write(
150
+ `${VERDICT_PREFIX} ${outcome.verdict} package=${SELF_PACKAGE} published=${version} — ${outcome.detail}\n`
151
+ );
152
+ return outcome.verdict === "unprovable" || outcome.verdict === "below-floor"
153
+ ? 1
154
+ : 0;
155
+ }
156
+
157
+ /* c8 ignore start -- CLI wiring, exercised through main() in tests */
158
+ if (invokedAsScript(import.meta.url)) {
159
+ try {
160
+ process.exitCode = main(process.argv.slice(2));
161
+ } catch (error) {
162
+ process.stderr.write(`❌ ${error.message}\n`);
163
+ process.exitCode = 1;
164
+ }
165
+ }
166
+ /* c8 ignore stop */
@@ -5,7 +5,11 @@
5
5
  "quality.yml::scripts/verify-host-name-target-scope.mjs": "Lisa-source-only regression proof. Two steps execute this driver, each behind `github.repository == 'CodySwannGT/lisa'`: the enforcing `🔒 Enforce host-name target scope` step in `test_unit` (also gated on `steps.gate_run.outcome == 'success'`), and the named host-name target-scope step in the Lisa-only `test_named_regression_specs` job, whose job-level `if:` carries the same repository guard. Every host caller skips both without reading this path. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced.",
6
6
  "publish-to-npm.yml::scripts/check-npm-install-compat.mjs": "Lisa-source-only release gate. The step requires `github.repository == 'CodySwannGT/lisa'` before it can start, and the run body repeats that exact repository guard (failing loudly, never passing vacuously) before reading this path. Host callers reaching publish-to-npm.yml at @main skip the step without reading their own tree. The script installs Lisa's own packed release tarball under npm 10.9.9 and 11.6.2 (CodySwannGT/lisa#4871). Ratified because the caller-tree read is unreachable outside this repository, not because an undelivered host dependency is tolerated.",
7
7
  "quality.yml::scripts/integration-shard-build.mjs": "Lisa-source-only shared build for integration-test shards (#4599). The `test_integration_shard_build` job carries `github.repository == 'CodySwannGT/lisa'` in its job-level `if:`, so every host caller skips the job, and the step that runs this script, without reading this path from their own tree. Host legs build for themselves through lisa-test-run. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced.",
8
- "quality.yml::scripts/plan-integration-shards.mjs": "Lisa-source-only timing planner for integration-test shards (#4599). The `⏱️ Assign files to shards from recorded timings` step and the checkout before it are gated on `github.repository == 'CodySwannGT/lisa'`, so every host caller skips the step without reading this path, and its legs take Vitest's own `--shard` slice. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced."
8
+ "quality.yml::scripts/plan-integration-shards.mjs": "Lisa-source-only timing planner for integration-test shards (#4599). The `⏱️ Assign files to shards from recorded timings` step and the checkout before it are gated on `github.repository == 'CodySwannGT/lisa'`, so every host caller skips the step without reading this path, and its legs take Vitest's own `--shard` slice. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced.",
9
+ "self-pin-raise.yml::scripts/check-self-dependency-pin.mjs": "Lisa-only check of Lisa's own self-pin; here it decides the raise target and waits for npm to list it. Both jobs of self-pin-raise.yml carry `github.repository == 'CodySwannGT/lisa'` in their job-level `if:` (the push job repeats it rather than inheriting it from prepare), so a host repository that calls this reusable workflow at @main skips both jobs without reading this path from its own tree. The workflow raises Lisa's own @codyswann/lisa self-pin (CodySwannGT/lisa#4951) and has no meaning in a host. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced.",
10
+ "self-pin-raise.yml::scripts/push-self-pin-raise.sh": "Lisa-only push of the proved raise with the deploy key. Both jobs of self-pin-raise.yml carry `github.repository == 'CodySwannGT/lisa'` in their job-level `if:` (the push job repeats it rather than inheriting it from prepare), so a host repository that calls this reusable workflow at @main skips both jobs without reading this path from its own tree. The workflow raises Lisa's own @codyswann/lisa self-pin (CodySwannGT/lisa#4951) and has no meaning in a host. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced.",
11
+ "self-pin-raise.yml::scripts/raise-self-dependency-pin.mjs": "Lisa-only rewrite of Lisa's own self-pin. Both jobs of self-pin-raise.yml carry `github.repository == 'CodySwannGT/lisa'` in their job-level `if:` (the push job repeats it rather than inheriting it from prepare), so a host repository that calls this reusable workflow at @main skips both jobs without reading this path from its own tree. The workflow raises Lisa's own @codyswann/lisa self-pin (CodySwannGT/lisa#4951) and has no meaning in a host. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced.",
12
+ "self-pin-raise.yml::scripts/verify-self-pin-raise.mjs": "Lisa-only proof that the raise changes only the pin and a regenerated lockfile. Both jobs of self-pin-raise.yml carry `github.repository == 'CodySwannGT/lisa'` in their job-level `if:` (the push job repeats it rather than inheriting it from prepare), so a host repository that calls this reusable workflow at @main skips both jobs without reading this path from its own tree. The workflow raises Lisa's own @codyswann/lisa self-pin (CodySwannGT/lisa#4951) and has no meaning in a host. Ratified because the caller-tree read is unreachable outside this repository; no host dependency is introduced."
9
13
  },
10
14
  "staleness": {
11
15
  "npm-updater.yml::scripts/lisa-npm-updater.mjs": {
@@ -139,30 +143,50 @@
139
143
  "quality-rails.yml::scripts/lisa-rspec-select.mjs": {
140
144
  "decision": "not-needed",
141
145
  "reason": "A merger, not a judge (CodySwannGT/lisa#4612). The aggregate calls only its `merge-maps` subcommand, which unions the shard legs' crystalball maps into the one artifact pushes download; it posts no check context and the RSpec verdict comes from the legs and the aggregate's own steps. A superseded copy that lacks the subcommand fails the step loudly, and one that merges differently changes only which specs a later push selects, which the pre-push selector bounds with its full-suite fallbacks. A version handshake would gate an advisory map on a version comparison and buy no cover."
146
+ },
147
+ "self-pin-raise.yml::scripts/check-self-dependency-pin.mjs": {
148
+ "decision": "not-needed",
149
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling."
150
+ },
151
+ "self-pin-raise.yml::scripts/push-self-pin-raise.sh": {
152
+ "decision": "not-needed",
153
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling."
154
+ },
155
+ "self-pin-raise.yml::scripts/raise-self-dependency-pin.mjs": {
156
+ "decision": "not-needed",
157
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling."
158
+ },
159
+ "self-pin-raise.yml::scripts/verify-self-pin-raise.mjs": {
160
+ "decision": "not-needed",
161
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling."
162
+ },
163
+ "self-pin-raise.yml::scripts/check-npm-publish-landed.mjs": {
164
+ "decision": "not-needed",
165
+ "reason": "Lisa delivers this prover to hosts on the apply channel, but this workflow never reaches a host's copy: both jobs require `github.repository == 'CodySwannGT/lisa'`, so the only copy read here is Lisa's own, from the same checkout as the workflow. The host-facing exposure of this prover is recorded once, on `publish-to-npm.yml::scripts/check-npm-publish-landed.mjs`, and is not restated here."
142
166
  }
143
167
  },
144
168
  "inspected": {
145
- "workflows": 26,
146
- "steps": 873,
147
- "couplings": 45,
169
+ "workflows": 27,
170
+ "steps": 890,
171
+ "couplings": 50,
148
172
  "inventory": 245
149
173
  },
150
174
  "counts": {
151
175
  "package-backed": 11,
152
- "apply-lagged": 28,
176
+ "apply-lagged": 29,
153
177
  "never-delivered": 0,
154
- "undelivered": 6
178
+ "undelivered": 10
155
179
  },
156
180
  "detectionCounts": {
157
181
  "version-handshake": 4,
158
182
  "capability-probe": 0,
159
183
  "existence-only": 7,
160
- "no-probe": 17,
161
- "unchecked": 6
184
+ "no-probe": 18,
185
+ "unchecked": 10
162
186
  },
163
187
  "decisionCounts": {
164
188
  "handshake": 4,
165
- "not-needed": 19,
189
+ "not-needed": 24,
166
190
  "warranted": 11
167
191
  },
168
192
  "couplings": [
@@ -900,6 +924,98 @@
900
924
  "reason": "Unreachable outside this repository under the exact step-level repository guard ratified above. The driver and its cases run from the same Lisa checkout as the hooks under test. No consuming caller reads its installed or caller-tree copy through this workflow step, so no independently versioned consumer copy participates in this coupling.",
901
925
  "lanes": [],
902
926
  "detail": "`quality.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/verify-host-name-target-scope.mjs` from the CALLER's tree, and Lisa ships no such path in any delivery lane — no apply and no bump ever produces it. Either the consumer authors it, or whatever the step does where the path is missing runs instead — and that branch is the part this scan does not read. No existence test guards the read, which is ALL this scan examined of the step's control flow: it did not read anything that could absorb the failure. An absent path most likely fails the job loudly — the better of the two failures, because it is visible — but that is inferred from the missing guard, NOT MEASURED. The step's text carries none of the tokens this scan can see (`else-branch`, `exit-zero`, `exit-nonzero`, `error-annotation`, `notice-annotation`, `failure-suppression`), which is a statement about those names and not about the step's behaviour. STALENESS (a separate dimension from the delivery verdict above): `unchecked`. Lisa delivers nothing at this path, so there is no artifact to ask whether it could answer a version. The staleness half is UNKNOWN here — not current, and not probe-less. Tokens found: `workflow-requests-version`. `workflow-requests-version` is workflow-scoped — it does not say THIS step asks."
927
+ },
928
+ {
929
+ "key": "self-pin-raise.yml::scripts/check-npm-publish-landed.mjs",
930
+ "workflow": "self-pin-raise.yml",
931
+ "path": "scripts/check-npm-publish-landed.mjs",
932
+ "channel": "apply",
933
+ "verdict": "apply-lagged",
934
+ "remedy": "run-lisa-apply",
935
+ "guarded": false,
936
+ "handling": [
937
+ "else-branch"
938
+ ],
939
+ "detection": "no-probe",
940
+ "stalenessSignals": [],
941
+ "decision": "not-needed",
942
+ "reason": "Lisa delivers this prover to hosts on the apply channel, but this workflow never reaches a host's copy: both jobs require `github.repository == 'CodySwannGT/lisa'`, so the only copy read here is Lisa's own, from the same checkout as the workflow. The host-facing exposure of this prover is recorded once, on `publish-to-npm.yml::scripts/check-npm-publish-landed.mjs`, and is not restated here.",
943
+ "lanes": [
944
+ "all/copy-overwrite"
945
+ ],
946
+ "detail": "`self-pin-raise.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/check-npm-publish-landed.mjs` from the CALLER's tree with no package-relative candidate, and Lisa delivers that path on the `lisa apply` channel (all/copy-overwrite). The two halves land in the wrong order: this step is live everywhere immediately, the file it needs is live only where somebody applied. No existence test guards the read, which is ALL this scan examined of the step's control flow: it did not read anything that could absorb the failure. An absent path most likely fails the job loudly — the better of the two failures, because it is visible — but that is inferred from the missing guard, NOT MEASURED. The step's text does carry `else-branch` — located in the step, deliberately NOT related to this read, and enough to make \"it skips silently\" a claim to check rather than assume. STALENESS (a separate dimension from the delivery verdict above): `no-probe`. Neither an existence test nor a version probe bears on this read, so nothing here distinguishes a current artifact from an absent or a superseded one. None of the staleness tokens this scan can see (`artifact-declares-version`, `artifact-answers-version`, `step-requests-version`, `workflow-requests-version`) were found."
947
+ },
948
+ {
949
+ "key": "self-pin-raise.yml::scripts/check-self-dependency-pin.mjs",
950
+ "workflow": "self-pin-raise.yml",
951
+ "path": "scripts/check-self-dependency-pin.mjs",
952
+ "channel": "undelivered",
953
+ "verdict": "undelivered",
954
+ "remedy": "author-the-artifact",
955
+ "guarded": false,
956
+ "handling": [
957
+ "else-branch"
958
+ ],
959
+ "detection": "unchecked",
960
+ "stalenessSignals": [],
961
+ "decision": "not-needed",
962
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling.",
963
+ "lanes": [],
964
+ "detail": "`self-pin-raise.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/check-self-dependency-pin.mjs` from the CALLER's tree, and Lisa ships no such path in any delivery lane — no apply and no bump ever produces it. Either the consumer authors it, or whatever the step does where the path is missing runs instead — and that branch is the part this scan does not read. No existence test guards the read, which is ALL this scan examined of the step's control flow: it did not read anything that could absorb the failure. An absent path most likely fails the job loudly — the better of the two failures, because it is visible — but that is inferred from the missing guard, NOT MEASURED. The step's text does carry `else-branch` — located in the step, deliberately NOT related to this read, and enough to make \"it skips silently\" a claim to check rather than assume. STALENESS (a separate dimension from the delivery verdict above): `unchecked`. Lisa delivers nothing at this path, so there is no artifact to ask whether it could answer a version. The staleness half is UNKNOWN here — not current, and not probe-less. None of the staleness tokens this scan can see (`artifact-declares-version`, `artifact-answers-version`, `step-requests-version`, `workflow-requests-version`) were found."
965
+ },
966
+ {
967
+ "key": "self-pin-raise.yml::scripts/push-self-pin-raise.sh",
968
+ "workflow": "self-pin-raise.yml",
969
+ "path": "scripts/push-self-pin-raise.sh",
970
+ "channel": "undelivered",
971
+ "verdict": "undelivered",
972
+ "remedy": "author-the-artifact",
973
+ "guarded": false,
974
+ "handling": [],
975
+ "detection": "unchecked",
976
+ "stalenessSignals": [],
977
+ "decision": "not-needed",
978
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling.",
979
+ "lanes": [],
980
+ "detail": "`self-pin-raise.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/push-self-pin-raise.sh` from the CALLER's tree, and Lisa ships no such path in any delivery lane — no apply and no bump ever produces it. Either the consumer authors it, or whatever the step does where the path is missing runs instead — and that branch is the part this scan does not read. No existence test guards the read, which is ALL this scan examined of the step's control flow: it did not read anything that could absorb the failure. An absent path most likely fails the job loudly — the better of the two failures, because it is visible — but that is inferred from the missing guard, NOT MEASURED. The step's text carries none of the tokens this scan can see (`else-branch`, `exit-zero`, `exit-nonzero`, `error-annotation`, `notice-annotation`, `failure-suppression`), which is a statement about those names and not about the step's behaviour. STALENESS (a separate dimension from the delivery verdict above): `unchecked`. Lisa delivers nothing at this path, so there is no artifact to ask whether it could answer a version. The staleness half is UNKNOWN here — not current, and not probe-less. None of the staleness tokens this scan can see (`artifact-declares-version`, `artifact-answers-version`, `step-requests-version`, `workflow-requests-version`) were found."
981
+ },
982
+ {
983
+ "key": "self-pin-raise.yml::scripts/raise-self-dependency-pin.mjs",
984
+ "workflow": "self-pin-raise.yml",
985
+ "path": "scripts/raise-self-dependency-pin.mjs",
986
+ "channel": "undelivered",
987
+ "verdict": "undelivered",
988
+ "remedy": "author-the-artifact",
989
+ "guarded": false,
990
+ "handling": [
991
+ "exit-nonzero",
992
+ "error-annotation"
993
+ ],
994
+ "detection": "unchecked",
995
+ "stalenessSignals": [],
996
+ "decision": "not-needed",
997
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling.",
998
+ "lanes": [],
999
+ "detail": "`self-pin-raise.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/raise-self-dependency-pin.mjs` from the CALLER's tree, and Lisa ships no such path in any delivery lane — no apply and no bump ever produces it. Either the consumer authors it, or whatever the step does where the path is missing runs instead — and that branch is the part this scan does not read. No existence test guards the read, which is ALL this scan examined of the step's control flow: it did not read anything that could absorb the failure. An absent path most likely fails the job loudly — the better of the two failures, because it is visible — but that is inferred from the missing guard, NOT MEASURED. The step's text does carry `exit-nonzero`, `error-annotation` — located in the step, deliberately NOT related to this read, and enough to make \"it skips silently\" a claim to check rather than assume. STALENESS (a separate dimension from the delivery verdict above): `unchecked`. Lisa delivers nothing at this path, so there is no artifact to ask whether it could answer a version. The staleness half is UNKNOWN here — not current, and not probe-less. None of the staleness tokens this scan can see (`artifact-declares-version`, `artifact-answers-version`, `step-requests-version`, `workflow-requests-version`) were found."
1000
+ },
1001
+ {
1002
+ "key": "self-pin-raise.yml::scripts/verify-self-pin-raise.mjs",
1003
+ "workflow": "self-pin-raise.yml",
1004
+ "path": "scripts/verify-self-pin-raise.mjs",
1005
+ "channel": "undelivered",
1006
+ "verdict": "undelivered",
1007
+ "remedy": "author-the-artifact",
1008
+ "guarded": false,
1009
+ "handling": [
1010
+ "exit-nonzero",
1011
+ "error-annotation"
1012
+ ],
1013
+ "detection": "unchecked",
1014
+ "stalenessSignals": [],
1015
+ "decision": "not-needed",
1016
+ "reason": "Unreachable outside this repository under the job-level repository guard ratified above. The script runs from the same Lisa checkout the workflow runs from, so no independently versioned consumer copy participates in this coupling.",
1017
+ "lanes": [],
1018
+ "detail": "`self-pin-raise.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/verify-self-pin-raise.mjs` from the CALLER's tree, and Lisa ships no such path in any delivery lane — no apply and no bump ever produces it. Either the consumer authors it, or whatever the step does where the path is missing runs instead — and that branch is the part this scan does not read. No existence test guards the read, which is ALL this scan examined of the step's control flow: it did not read anything that could absorb the failure. An absent path most likely fails the job loudly — the better of the two failures, because it is visible — but that is inferred from the missing guard, NOT MEASURED. The step's text does carry `exit-nonzero`, `error-annotation` — located in the step, deliberately NOT related to this read, and enough to make \"it skips silently\" a claim to check rather than assume. STALENESS (a separate dimension from the delivery verdict above): `unchecked`. Lisa delivers nothing at this path, so there is no artifact to ask whether it could answer a version. The staleness half is UNKNOWN here — not current, and not probe-less. None of the staleness tokens this scan can see (`artifact-declares-version`, `artifact-answers-version`, `step-requests-version`, `workflow-requests-version`) were found."
903
1019
  }
904
1020
  ]
905
1021
  }
@@ -136,7 +136,7 @@ function readNvmrcVersion(): string {
136
136
  * Extracts the major version from a semver string
137
137
  */
138
138
  function getMajorVersion(version: string): string {
139
- return version.split(".")[0];
139
+ return version.split(".").at(0) ?? version;
140
140
  }
141
141
 
142
142
  /**