@codyswann/lisa 5.1.6 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/all/copy-overwrite/scripts/lib/github-attestation-provider.mjs +15 -0
- package/all/copy-overwrite/scripts/lib/npm-update-allocate.mjs +32 -39
- package/all/copy-overwrite/scripts/lib/npm-update-authorization.mjs +12 -2
- package/all/copy-overwrite/scripts/lib/npm-update-checkpoint.mjs +10 -30
- package/all/copy-overwrite/scripts/lib/npm-update-execution-adapter.mjs +4 -1
- package/all/copy-overwrite/scripts/lib/npm-update-helper-graph.mjs +1 -1
- package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +4 -0
- package/all/copy-overwrite/scripts/lib/npm-update-hosted-hook.mjs +2 -1
- package/all/copy-overwrite/scripts/lib/npm-update-invariants.mjs +15 -1
- package/all/copy-overwrite/scripts/lib/npm-update-leaf-contract.mjs +41 -9
- package/all/copy-overwrite/scripts/lib/npm-update-leaf.mjs +23 -35
- package/all/copy-overwrite/scripts/lib/npm-update-policy.mjs +41 -6
- package/all/copy-overwrite/scripts/lib/npm-update-recovery.mjs +16 -3
- package/all/copy-overwrite/scripts/lib/npm-update-tracker-jira.mjs +300 -0
- package/all/copy-overwrite/scripts/lib/npm-update-tracker-linear.mjs +304 -0
- package/all/copy-overwrite/scripts/lib/npm-update-tracker-wire.mjs +298 -0
- package/all/copy-overwrite/scripts/lib/npm-update-tracker.mjs +179 -0
- package/all/copy-overwrite/scripts/lisa-npm-updater.mjs +16 -2
- package/all/copy-overwrite/scripts/lisa-work-item.mjs +1 -1
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +62 -14
- package/cdk/package-lisa/package.lisa.json +4 -4
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +96 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +64 -24
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/harper-fabric/package-lisa/package.lisa.json +2 -2
- package/nestjs/package-lisa/package.lisa.json +4 -4
- package/npm-package/package-lisa/package.lisa.json +2 -2
- package/package.json +9 -9
- package/phaser/package-lisa/package.lisa.json +2 -2
- 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/check-npm-install-compat.mjs +316 -0
- package/scripts/two-channel-couplings.json +31 -7
- package/typescript/copy-overwrite/.prettierignore +4 -0
- package/typescript/package-lisa/package.lisa.json +4 -4
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Prove the packed `@codyswann/lisa` tarball installs under every npm version
|
|
4
|
+
* a host may run (CodySwannGT/lisa#4871).
|
|
5
|
+
*
|
|
6
|
+
* Measured defect: a plain `npm install @codyswann/lisa` under npm 10.9.9
|
|
7
|
+
* crashed with `Cannot read properties of null (reading 'edgesOut')`. npm 10's
|
|
8
|
+
* arborist resolves peer dependencies in a scratch tree that ignores the
|
|
9
|
+
* installing package's own pins; a Vitest 4 dependency reached Vitest 5 there
|
|
10
|
+
* through vite's optional devtools peer chain, a Vitest 4 browser package then
|
|
11
|
+
* orphaned that node, and arborist dereferenced its null parent. npm 11 handles
|
|
12
|
+
* the same graph, so a check run only under npm 11 would never have seen it.
|
|
13
|
+
*
|
|
14
|
+
* The check installs the real tarball into a fresh empty directory once per
|
|
15
|
+
* npm version and refuses on any signal that the install did not happen as
|
|
16
|
+
* claimed, because each alone has a gap:
|
|
17
|
+
* - the npm that ran is not the npm requested (a silent fallback to the
|
|
18
|
+
* runner's own npm would test the wrong resolver);
|
|
19
|
+
* - a non-zero exit, or a spawn that never produced one;
|
|
20
|
+
* - the `edgesOut` crash text, in case a future npm logs it without failing;
|
|
21
|
+
* - no installed manifest, or one whose version is not the tarball's (an exit
|
|
22
|
+
* 0 that installed nothing, or something else, is not this install).
|
|
23
|
+
*
|
|
24
|
+
* Usage: `node scripts/check-npm-install-compat.mjs [--tarball <tgz>]
|
|
25
|
+
* [--npm 10.9.9,11.6.2]`. With no tarball the repository is packed with
|
|
26
|
+
* `npm pack --ignore-scripts` into a temporary directory.
|
|
27
|
+
* @module scripts/check-npm-install-compat
|
|
28
|
+
*/
|
|
29
|
+
import {
|
|
30
|
+
existsSync,
|
|
31
|
+
mkdtempSync,
|
|
32
|
+
readFileSync,
|
|
33
|
+
readdirSync,
|
|
34
|
+
rmSync,
|
|
35
|
+
} from "node:fs";
|
|
36
|
+
import os from "node:os";
|
|
37
|
+
import path from "node:path";
|
|
38
|
+
import process from "node:process";
|
|
39
|
+
import { fileURLToPath } from "node:url";
|
|
40
|
+
|
|
41
|
+
import { boundedSpawnSync } from "./lib/bounded-spawn.mjs";
|
|
42
|
+
import { invokedAsScript } from "./lib/invoked-as-script.mjs";
|
|
43
|
+
|
|
44
|
+
/** npm versions every Lisa release must install under. */
|
|
45
|
+
export const DEFAULT_NPM_VERSIONS = Object.freeze(["10.9.9", "11.6.2"]);
|
|
46
|
+
|
|
47
|
+
/** The crash signature of npm 10's arborist peer-set defect. */
|
|
48
|
+
const CRASH_SIGNATURE = "edgesOut";
|
|
49
|
+
|
|
50
|
+
/** Installed manifest whose presence proves the install placed Lisa. */
|
|
51
|
+
const INSTALLED_MANIFEST = "node_modules/@codyswann/lisa/package.json";
|
|
52
|
+
|
|
53
|
+
/** A cold install of Lisa's dependency tree takes minutes, not seconds. */
|
|
54
|
+
const INSTALL_BUDGET_MS = 15 * 60_000;
|
|
55
|
+
|
|
56
|
+
const REPO_ROOT = path.resolve(
|
|
57
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
58
|
+
".."
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Read one CLI option's value, refusing a flag left without one.
|
|
63
|
+
* @param {readonly string[]} argv - CLI arguments
|
|
64
|
+
* @param {string} name - Flag name
|
|
65
|
+
* @returns {string | undefined} The value, or undefined when absent
|
|
66
|
+
*/
|
|
67
|
+
function optionValue(argv, name) {
|
|
68
|
+
const index = argv.indexOf(name);
|
|
69
|
+
if (index === -1) return undefined;
|
|
70
|
+
const value = argv[index + 1];
|
|
71
|
+
if (!value || value.startsWith("--")) {
|
|
72
|
+
throw new Error(`${name} needs a value`);
|
|
73
|
+
}
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Parse the CLI arguments.
|
|
79
|
+
* @param {readonly string[]} argv - CLI arguments
|
|
80
|
+
* @returns {{tarball: string | undefined, npmVersions: string[]}} Options
|
|
81
|
+
*/
|
|
82
|
+
export function parseArgs(argv) {
|
|
83
|
+
const versions = optionValue(argv, "--npm");
|
|
84
|
+
const npmVersions =
|
|
85
|
+
versions === undefined
|
|
86
|
+
? [...DEFAULT_NPM_VERSIONS]
|
|
87
|
+
: versions
|
|
88
|
+
.split(",")
|
|
89
|
+
.map(version => version.trim())
|
|
90
|
+
.filter(Boolean);
|
|
91
|
+
if (npmVersions.length === 0) {
|
|
92
|
+
// An empty list would check nothing and report success.
|
|
93
|
+
throw new Error("--npm needs at least one version");
|
|
94
|
+
}
|
|
95
|
+
return { tarball: optionValue(argv, "--tarball"), npmVersions };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The most useful npm error line in an install transcript.
|
|
100
|
+
* @param {string} output - Combined install stdout and stderr
|
|
101
|
+
* @returns {string} The crash line, else the first `npm error` line, else ""
|
|
102
|
+
*/
|
|
103
|
+
function errorLine(output) {
|
|
104
|
+
const lines = output.split("\n").map(line => line.trim());
|
|
105
|
+
return (
|
|
106
|
+
lines.find(line => line.includes(CRASH_SIGNATURE)) ??
|
|
107
|
+
lines.find(line => line.startsWith("npm error")) ??
|
|
108
|
+
""
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @typedef {object} InstallOutcome
|
|
114
|
+
* @property {string} npmReported - What `npm --version` printed for the npx-run npm
|
|
115
|
+
* @property {number | null} status - Install exit status; null when spawn failed
|
|
116
|
+
* @property {string} output - Combined install stdout and stderr
|
|
117
|
+
* @property {string} [error] - Spawn error message, when the child never ran
|
|
118
|
+
* @property {string | null} installedVersion - Installed Lisa version, or null when absent
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Ordered refusal rules; the first that returns a reason decides.
|
|
123
|
+
* @type {readonly ((expected: {npmVersion: string, packageVersion: string}, outcome: InstallOutcome) => string)[]}
|
|
124
|
+
*/
|
|
125
|
+
const RULES = Object.freeze([
|
|
126
|
+
(expected, outcome) =>
|
|
127
|
+
outcome.npmReported === expected.npmVersion
|
|
128
|
+
? ""
|
|
129
|
+
: `npx ran npm ${outcome.npmReported || "(nothing)"}, not the requested npm ${expected.npmVersion}`,
|
|
130
|
+
(_expected, outcome) => {
|
|
131
|
+
if (outcome.status === 0) return "";
|
|
132
|
+
const quoted = errorLine(outcome.output) || outcome.error;
|
|
133
|
+
const detail = [`npm install exited ${outcome.status}`, quoted];
|
|
134
|
+
return detail.filter(Boolean).join(": ");
|
|
135
|
+
},
|
|
136
|
+
(_expected, outcome) =>
|
|
137
|
+
outcome.output.includes(CRASH_SIGNATURE)
|
|
138
|
+
? `install output contains "${CRASH_SIGNATURE}": ${errorLine(outcome.output)}`
|
|
139
|
+
: "",
|
|
140
|
+
(_expected, outcome) =>
|
|
141
|
+
outcome.installedVersion === null
|
|
142
|
+
? `install exited 0 but ${INSTALLED_MANIFEST} is missing`
|
|
143
|
+
: "",
|
|
144
|
+
(expected, outcome) =>
|
|
145
|
+
outcome.installedVersion === expected.packageVersion
|
|
146
|
+
? ""
|
|
147
|
+
: `installed @codyswann/lisa ${outcome.installedVersion}, but the tarball is ${expected.packageVersion}`,
|
|
148
|
+
]);
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Decide whether one install proves compatibility.
|
|
152
|
+
* @param {{npmVersion: string, packageVersion: string}} expected - Requested npm and the tarball's version
|
|
153
|
+
* @param {InstallOutcome} outcome - What the install did
|
|
154
|
+
* @returns {{npmVersion: string, ok: boolean, reason: string}} Verdict
|
|
155
|
+
*/
|
|
156
|
+
export function evaluateInstall(expected, outcome) {
|
|
157
|
+
const reason = RULES.map(rule => rule(expected, outcome)).find(Boolean) ?? "";
|
|
158
|
+
return { npmVersion: expected.npmVersion, ok: reason === "", reason };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Install the tarball under each npm version and judge each install.
|
|
163
|
+
* @param {{tarball: string, packageVersion: string}} candidate - Tarball and its version
|
|
164
|
+
* @param {readonly string[]} npmVersions - npm versions to try
|
|
165
|
+
* @param {(tarball: string, npmVersion: string) => InstallOutcome} install - Installer
|
|
166
|
+
* @returns {{npmVersion: string, ok: boolean, reason: string}[]} Verdicts
|
|
167
|
+
*/
|
|
168
|
+
export function runChecks(candidate, npmVersions, install) {
|
|
169
|
+
return npmVersions.map(npmVersion =>
|
|
170
|
+
evaluateInstall(
|
|
171
|
+
{ npmVersion, packageVersion: candidate.packageVersion },
|
|
172
|
+
install(candidate.tarball, npmVersion)
|
|
173
|
+
)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Render verdicts for an operator.
|
|
179
|
+
* @param {readonly {npmVersion: string, ok: boolean, reason: string}[]} results - Verdicts
|
|
180
|
+
* @returns {string} One line per npm version, plus a summary
|
|
181
|
+
*/
|
|
182
|
+
export function formatReport(results) {
|
|
183
|
+
const lines = results.map(result =>
|
|
184
|
+
result.ok
|
|
185
|
+
? `PASS npm ${result.npmVersion}: @codyswann/lisa installed\n`
|
|
186
|
+
: `FAIL npm ${result.npmVersion}: ${result.reason}\n`
|
|
187
|
+
);
|
|
188
|
+
const failed = results.filter(result => !result.ok).length;
|
|
189
|
+
const summary =
|
|
190
|
+
failed === 0
|
|
191
|
+
? "Lisa installs cleanly under every checked npm version.\n"
|
|
192
|
+
: `Lisa does not install under ${failed} of ${results.length} npm version(s). A host on that npm cannot install Lisa; fix the published dependency graph before release.\n`;
|
|
193
|
+
return [...lines, summary].join("");
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Run `npx -y npm@<version>` with arguments in a directory.
|
|
198
|
+
* @param {string} directory - Working directory
|
|
199
|
+
* @param {string} npmVersion - npm version npx should fetch
|
|
200
|
+
* @param {readonly string[]} args - npm arguments
|
|
201
|
+
* @returns {import("node:child_process").SpawnSyncReturns<string>} Result
|
|
202
|
+
*/
|
|
203
|
+
function npx(directory, npmVersion, args) {
|
|
204
|
+
return boundedSpawnSync("npx", ["-y", `npm@${npmVersion}`, ...args], {
|
|
205
|
+
cwd: directory,
|
|
206
|
+
encoding: "utf8",
|
|
207
|
+
timeout: INSTALL_BUDGET_MS,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Read the installed Lisa version, if any.
|
|
213
|
+
* @param {string} directory - Install directory
|
|
214
|
+
* @returns {string | null} Installed version, or null when not installed
|
|
215
|
+
*/
|
|
216
|
+
function installedVersionIn(directory) {
|
|
217
|
+
const manifest = path.join(directory, INSTALLED_MANIFEST);
|
|
218
|
+
if (!existsSync(manifest)) return null;
|
|
219
|
+
return JSON.parse(readFileSync(manifest, "utf8")).version ?? "";
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Install a tarball into a fresh empty directory with one npm version.
|
|
224
|
+
* @param {string} tarball - Packed tarball path
|
|
225
|
+
* @param {string} npmVersion - npm version to run through npx
|
|
226
|
+
* @returns {InstallOutcome} Outcome
|
|
227
|
+
*/
|
|
228
|
+
function installWithNpm(tarball, npmVersion) {
|
|
229
|
+
const directory = mkdtempSync(path.join(os.tmpdir(), "lisa-npm-compat-"));
|
|
230
|
+
try {
|
|
231
|
+
const reported = npx(directory, npmVersion, ["--version"]);
|
|
232
|
+
const result = npx(directory, npmVersion, [
|
|
233
|
+
"install",
|
|
234
|
+
"--ignore-scripts",
|
|
235
|
+
"--no-audit",
|
|
236
|
+
"--no-fund",
|
|
237
|
+
tarball,
|
|
238
|
+
]);
|
|
239
|
+
return {
|
|
240
|
+
npmReported: (reported.stdout ?? "").trim(),
|
|
241
|
+
status: result.status,
|
|
242
|
+
output: `${result.stdout ?? ""}${result.stderr ?? ""}`,
|
|
243
|
+
error: result.error?.message,
|
|
244
|
+
installedVersion: installedVersionIn(directory),
|
|
245
|
+
};
|
|
246
|
+
} finally {
|
|
247
|
+
rmSync(directory, { recursive: true, force: true });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Read the version a packed tarball declares.
|
|
253
|
+
* @param {string} tarball - Packed tarball path
|
|
254
|
+
* @returns {string} The tarball's package.json version
|
|
255
|
+
*/
|
|
256
|
+
function tarballVersion(tarball) {
|
|
257
|
+
const result = boundedSpawnSync(
|
|
258
|
+
"tar",
|
|
259
|
+
["-xOzf", tarball, "package/package.json"],
|
|
260
|
+
{ encoding: "utf8", maxBuffer: 16 * 1024 * 1024 }
|
|
261
|
+
);
|
|
262
|
+
if (result.status !== 0) {
|
|
263
|
+
throw new Error(`cannot read package.json from ${tarball}`);
|
|
264
|
+
}
|
|
265
|
+
return JSON.parse(result.stdout).version;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Pack this repository into a temporary directory.
|
|
270
|
+
* @returns {string} Path of the packed tarball
|
|
271
|
+
*/
|
|
272
|
+
function packRepository() {
|
|
273
|
+
const destination = mkdtempSync(path.join(os.tmpdir(), "lisa-npm-pack-"));
|
|
274
|
+
const result = boundedSpawnSync(
|
|
275
|
+
"npm",
|
|
276
|
+
["pack", "--ignore-scripts", "--pack-destination", destination],
|
|
277
|
+
{ cwd: REPO_ROOT, encoding: "utf8", timeout: INSTALL_BUDGET_MS }
|
|
278
|
+
);
|
|
279
|
+
const tarball = readdirSync(destination).find(name => name.endsWith(".tgz"));
|
|
280
|
+
if (result.status !== 0 || !tarball) {
|
|
281
|
+
throw new Error(`npm pack failed: ${result.stderr ?? ""}`.trim());
|
|
282
|
+
}
|
|
283
|
+
return path.join(destination, tarball);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Run the check.
|
|
288
|
+
* @param {readonly string[]} argv - CLI arguments
|
|
289
|
+
* @param {{install?: typeof installWithNpm, pack?: () => string, readVersion?: (tarball: string) => string, write?: (text: string) => void}} [deps] - Injected effects
|
|
290
|
+
* @returns {number} Process exit code
|
|
291
|
+
*/
|
|
292
|
+
export function main(argv, deps = {}) {
|
|
293
|
+
const {
|
|
294
|
+
install = installWithNpm,
|
|
295
|
+
pack = packRepository,
|
|
296
|
+
readVersion = tarballVersion,
|
|
297
|
+
write = text => process.stdout.write(text),
|
|
298
|
+
} = deps;
|
|
299
|
+
const options = parseArgs(argv);
|
|
300
|
+
// Absolute, because the install runs in a temp directory: a relative
|
|
301
|
+
// `--tarball` would resolve against a different cwd there than here.
|
|
302
|
+
const tarball = path.resolve(options.tarball ?? pack());
|
|
303
|
+
const candidate = { tarball, packageVersion: readVersion(tarball) };
|
|
304
|
+
const results = runChecks(candidate, options.npmVersions, install);
|
|
305
|
+
write(formatReport(results));
|
|
306
|
+
return results.every(result => result.ok) ? 0 : 1;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (invokedAsScript(import.meta.url)) {
|
|
310
|
+
try {
|
|
311
|
+
process.exitCode = main(process.argv.slice(2));
|
|
312
|
+
} catch (error) {
|
|
313
|
+
process.stderr.write(`check-npm-install-compat: ${error.message}\n`);
|
|
314
|
+
process.exitCode = 1;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"ratified": {
|
|
3
3
|
"quality.yml::scripts/check-learnings-budget.ts": "Lisa-source-only branch, and the else arm is the delivery. The step tests for BOTH scripts/check-learnings-budget.ts and src/core/learnings-budget-check.ts, which co-exist only in this repository; every consumer takes the else arm and runs the prover as `bunx @codyswann/lisa@<their own declared version>`, which is the PACKAGE channel and not a caller-tree read at all. A trailing `grep -qE \"learnings budget (passed|saturated)|no learnings file\"` then refuses a run that printed no verdict, so the arm cannot pass vacuously. Ratified because the caller-tree read is unreachable outside this repository, not because the gap is tolerated.",
|
|
4
4
|
"quality.yml::scripts/generate-nightly-e2e-guard-certificate.mjs": "Lisa-source-only branch. Both reusable jobs require `github.repository == 'CodySwannGT/lisa'` before the step can start, and the run body repeats that exact repository guard before checking this artifact path. Ordinary and private host callers therefore skip the step without reading or fetching from their own tree. The scoped branch fetches only the immutable refs needed to behavior-test Lisa's own retained certificate inputs. Ratified because the caller-tree read is unreachable outside this repository, not because an undelivered host dependency is tolerated.",
|
|
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."
|
|
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
|
+
"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."
|
|
6
7
|
},
|
|
7
8
|
"staleness": {
|
|
8
9
|
"npm-updater.yml::scripts/lisa-npm-updater.mjs": {
|
|
@@ -116,30 +117,34 @@
|
|
|
116
117
|
"quality.yml::scripts/verify-host-name-target-scope.mjs": {
|
|
117
118
|
"decision": "not-needed",
|
|
118
119
|
"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."
|
|
120
|
+
},
|
|
121
|
+
"publish-to-npm.yml::scripts/check-npm-install-compat.mjs": {
|
|
122
|
+
"decision": "not-needed",
|
|
123
|
+
"reason": "Lisa-source-only. The script and the workflow that runs it change together in this repository's own release commit, so no superseded copy can sit in front of a newer workflow; host callers never reach the read."
|
|
119
124
|
}
|
|
120
125
|
},
|
|
121
126
|
"inspected": {
|
|
122
127
|
"workflows": 26,
|
|
123
|
-
"steps":
|
|
124
|
-
"couplings":
|
|
125
|
-
"inventory":
|
|
128
|
+
"steps": 835,
|
|
129
|
+
"couplings": 41,
|
|
130
|
+
"inventory": 228
|
|
126
131
|
},
|
|
127
132
|
"counts": {
|
|
128
133
|
"package-backed": 11,
|
|
129
134
|
"apply-lagged": 26,
|
|
130
135
|
"never-delivered": 0,
|
|
131
|
-
"undelivered":
|
|
136
|
+
"undelivered": 4
|
|
132
137
|
},
|
|
133
138
|
"detectionCounts": {
|
|
134
139
|
"version-handshake": 4,
|
|
135
140
|
"capability-probe": 0,
|
|
136
141
|
"existence-only": 5,
|
|
137
142
|
"no-probe": 17,
|
|
138
|
-
"unchecked":
|
|
143
|
+
"unchecked": 4
|
|
139
144
|
},
|
|
140
145
|
"decisionCounts": {
|
|
141
146
|
"handshake": 4,
|
|
142
|
-
"not-needed":
|
|
147
|
+
"not-needed": 15,
|
|
143
148
|
"warranted": 11
|
|
144
149
|
},
|
|
145
150
|
"couplings": [
|
|
@@ -360,6 +365,25 @@
|
|
|
360
365
|
],
|
|
361
366
|
"detail": "`npm-updater.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/lisa-npm-updater.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 `exit-nonzero` — 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."
|
|
362
367
|
},
|
|
368
|
+
{
|
|
369
|
+
"key": "publish-to-npm.yml::scripts/check-npm-install-compat.mjs",
|
|
370
|
+
"workflow": "publish-to-npm.yml",
|
|
371
|
+
"path": "scripts/check-npm-install-compat.mjs",
|
|
372
|
+
"channel": "undelivered",
|
|
373
|
+
"verdict": "undelivered",
|
|
374
|
+
"remedy": "author-the-artifact",
|
|
375
|
+
"guarded": false,
|
|
376
|
+
"handling": [
|
|
377
|
+
"exit-nonzero",
|
|
378
|
+
"error-annotation"
|
|
379
|
+
],
|
|
380
|
+
"detection": "unchecked",
|
|
381
|
+
"stalenessSignals": [],
|
|
382
|
+
"decision": "not-needed",
|
|
383
|
+
"reason": "Lisa-source-only. The script and the workflow that runs it change together in this repository's own release commit, so no superseded copy can sit in front of a newer workflow; host callers never reach the read.",
|
|
384
|
+
"lanes": [],
|
|
385
|
+
"detail": "`publish-to-npm.yml` is delivered at `@main`, so this step is live in every consumer on their next run. It reads `scripts/check-npm-install-compat.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."
|
|
386
|
+
},
|
|
363
387
|
{
|
|
364
388
|
"key": "publish-to-npm.yml::scripts/check-npm-publish-landed.mjs",
|
|
365
389
|
"workflow": "publish-to-npm.yml",
|
|
@@ -237,6 +237,10 @@ scripts/lib/npm-update-runtime-transport.mjs
|
|
|
237
237
|
scripts/lib/npm-update-runtime.mjs
|
|
238
238
|
scripts/lib/npm-update-supersession.mjs
|
|
239
239
|
scripts/lib/npm-update-tool-launcher.mjs
|
|
240
|
+
scripts/lib/npm-update-tracker-jira.mjs
|
|
241
|
+
scripts/lib/npm-update-tracker-linear.mjs
|
|
242
|
+
scripts/lib/npm-update-tracker-wire.mjs
|
|
243
|
+
scripts/lib/npm-update-tracker.mjs
|
|
240
244
|
scripts/lib/npm-update-worker-environment.mjs
|
|
241
245
|
scripts/lib/npm-update-worker-inspection.mjs
|
|
242
246
|
scripts/lib/npm-update-worker-lifecycle.mjs
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"eslint-plugin-oxlint": ">=1.62.0 <1.86.0",
|
|
36
36
|
"oxlint": ">=1.62.0 <1.86.0",
|
|
37
37
|
"oxlint-tsgolint": "^0.24.0",
|
|
38
|
-
"@stryker-mutator/core": "^
|
|
39
|
-
"@stryker-mutator/vitest-runner": "^
|
|
38
|
+
"@stryker-mutator/core": "^10.1.1",
|
|
39
|
+
"@stryker-mutator/vitest-runner": "^10.1.1",
|
|
40
40
|
"fast-check": "^4.9.0"
|
|
41
41
|
},
|
|
42
42
|
"resolutions": {
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"defaults": {
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@ast-grep/cli": "^0.40.4",
|
|
76
|
-
"@vitest/coverage-v8": "^
|
|
76
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
77
77
|
"eslint": "^9.39.5",
|
|
78
78
|
"husky": "^8.0.0",
|
|
79
79
|
"prettier": "3.8.0",
|
|
80
80
|
"typescript": "^6.0.3",
|
|
81
|
-
"vitest": "^
|
|
81
|
+
"vitest": "^5.1.0"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "node scripts/lib/worktree-dependencies.mjs && tsc",
|