@codyswann/lisa 8.1.0 → 8.1.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.
- package/all/copy-overwrite/scripts/lib/npm-update-bun.mjs +8 -3
- package/all/copy-overwrite/scripts/lib/npm-update-cache-seed.mjs +145 -0
- package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +1 -0
- package/all/copy-overwrite/scripts/lib/npm-update-prepare.mjs +34 -6
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +14 -3
- package/dist/core/lisa-owned-hash-ledger.json +24 -2
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.json +20 -6
- 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/record-npm-update-dual-lock-seed.mjs +203 -0
- package/scripts/two-channel-couplings.json +1 -1
- package/typescript/copy-overwrite/.prettierignore +1 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Record the registry data tests/integration/npm-update-dual-lock.test.ts runs
|
|
4
|
+
* on, so the suite never asks the live registry (CodySwannGT/lisa#5092).
|
|
5
|
+
*
|
|
6
|
+
* Every byte comes from https://registry.npmjs.org/. This runs the commands
|
|
7
|
+
* the suite and the updater it drives run, against the real registry, with
|
|
8
|
+
* npm's and Bun's caches pointed at a fresh seed folder; what they fetched is
|
|
9
|
+
* what an offline run will need. It also resolves each host's npm lock.
|
|
10
|
+
*
|
|
11
|
+
* The record is committed as one archive, tests/fixtures/npm-update-dual-lock/
|
|
12
|
+
* registry-record.tgz, which the suite extracts. Registry responses are
|
|
13
|
+
* third-party data, not Lisa source: kept loose they are cache files with no
|
|
14
|
+
* name a scanner can read, and package metadata naming its authors' public
|
|
15
|
+
* repositories. Recording again replaces the whole archive.
|
|
16
|
+
*
|
|
17
|
+
* Run it under the updater's own Node, so the cache holds what that npm asks
|
|
18
|
+
* for:
|
|
19
|
+
*
|
|
20
|
+
* mise exec node@22.23.3 bun@1.4.4 -- node scripts/record-npm-update-dual-lock-seed.mjs
|
|
21
|
+
*/
|
|
22
|
+
import { spawnSync } from "node:child_process";
|
|
23
|
+
import {
|
|
24
|
+
lstatSync,
|
|
25
|
+
mkdirSync,
|
|
26
|
+
mkdtempSync,
|
|
27
|
+
readdirSync,
|
|
28
|
+
readFileSync,
|
|
29
|
+
rmSync,
|
|
30
|
+
writeFileSync,
|
|
31
|
+
} from "node:fs";
|
|
32
|
+
import { tmpdir } from "node:os";
|
|
33
|
+
import { dirname, join, resolve } from "node:path";
|
|
34
|
+
import { fileURLToPath } from "node:url";
|
|
35
|
+
|
|
36
|
+
const ARCHIVE = resolve(
|
|
37
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
38
|
+
"../tests/fixtures/npm-update-dual-lock/registry-record.tgz"
|
|
39
|
+
);
|
|
40
|
+
const REGISTRY = "https://registry.npmjs.org/";
|
|
41
|
+
const IGNORE = "--ignore-scripts";
|
|
42
|
+
const FLAGS = [IGNORE, "--no-audit", "--no-fund"];
|
|
43
|
+
/** Bun's two installs, as the suite runs them and as the updater does. */
|
|
44
|
+
const BUN_LOCK = ["install", "--lockfile-only", IGNORE];
|
|
45
|
+
const BUN_FROZEN = ["install", "--frozen-lockfile", IGNORE];
|
|
46
|
+
const AT_REGISTRY = ["--registry", REGISTRY];
|
|
47
|
+
const UPDATE = "is-number@7.0.0";
|
|
48
|
+
|
|
49
|
+
/** The hosts the suite builds, as their manifests and recorded locks. */
|
|
50
|
+
const HOSTS = [
|
|
51
|
+
{
|
|
52
|
+
name: "alias",
|
|
53
|
+
devDependencies: {
|
|
54
|
+
"is-number": "6.0.0",
|
|
55
|
+
"fixture-ee-first": "npm:ee-first@1.1.1",
|
|
56
|
+
"pretty-format": "30.5.1",
|
|
57
|
+
},
|
|
58
|
+
lock: "alias-package-lock.json",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "plain",
|
|
62
|
+
devDependencies: { "is-number": "6.0.0" },
|
|
63
|
+
lock: "plain-package-lock.json",
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
if (process.versions.node !== "22.23.3")
|
|
68
|
+
throw new Error(
|
|
69
|
+
`run this under the updater's Node 22.23.3, not ${process.versions.node}`
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const scratch = mkdtempSync(join(tmpdir(), "lisa-dual-lock-seed-"));
|
|
73
|
+
const STAGE = join(scratch, "record");
|
|
74
|
+
const SEED = join(STAGE, "seed");
|
|
75
|
+
mkdirSync(join(SEED, "npm"), { recursive: true });
|
|
76
|
+
mkdirSync(join(SEED, "bun"), { recursive: true });
|
|
77
|
+
const env = {
|
|
78
|
+
PATH: process.env.PATH ?? "/usr/bin:/bin",
|
|
79
|
+
HOME: join(scratch, "home"),
|
|
80
|
+
LANG: "C.UTF-8",
|
|
81
|
+
LC_ALL: "C.UTF-8",
|
|
82
|
+
TZ: "UTC",
|
|
83
|
+
COPYFILE_DISABLE: "1",
|
|
84
|
+
NPM_CONFIG_USERCONFIG: join(scratch, "npmrc"),
|
|
85
|
+
NPM_CONFIG_GLOBALCONFIG: join(scratch, "global-npmrc"),
|
|
86
|
+
NPM_CONFIG_CACHE: join(SEED, "npm"),
|
|
87
|
+
NPM_CONFIG_REGISTRY: REGISTRY,
|
|
88
|
+
NPM_CONFIG_UPDATE_NOTIFIER: "false",
|
|
89
|
+
BUN_INSTALL_CACHE_DIR: join(SEED, "bun"),
|
|
90
|
+
BUN_FEATURE_FLAG_DISABLE_NATIVE_DEPENDENCY_LINKER: "1",
|
|
91
|
+
};
|
|
92
|
+
mkdirSync(env.HOME);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Drop the links Bun's cache keeps beside each package, and the folders that
|
|
96
|
+
* held only links. Bun writes them as absolute paths into this folder, so they
|
|
97
|
+
* would point outside any copy, and the updater refuses a seed holding a link.
|
|
98
|
+
* Bun reads a package from its `name@version` folder without them.
|
|
99
|
+
* @param {string} folder - A folder inside the seed.
|
|
100
|
+
*/
|
|
101
|
+
function dropLinks(folder) {
|
|
102
|
+
for (const name of readdirSync(folder)) {
|
|
103
|
+
const path = join(folder, name);
|
|
104
|
+
const entry = lstatSync(path);
|
|
105
|
+
if (entry.isSymbolicLink()) rmSync(path);
|
|
106
|
+
else if (entry.isDirectory()) {
|
|
107
|
+
dropLinks(path);
|
|
108
|
+
if (readdirSync(path).length === 0) rmSync(path, { recursive: true });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Run one recording command, and stop on a failure it did not expect.
|
|
115
|
+
* @param {string} cwd - Where to run it.
|
|
116
|
+
* @param {string} command - The program.
|
|
117
|
+
* @param {string[]} args - Its arguments.
|
|
118
|
+
* @param {number[]} [allowed] - Exit codes that are not a failure.
|
|
119
|
+
* @param {NodeJS.ProcessEnv} [runEnv] - Its environment.
|
|
120
|
+
*/
|
|
121
|
+
function run(cwd, command, args, allowed = [0], runEnv = env) {
|
|
122
|
+
const done = spawnSync(command, args, {
|
|
123
|
+
cwd,
|
|
124
|
+
env: runEnv,
|
|
125
|
+
encoding: "utf8",
|
|
126
|
+
timeout: 600_000,
|
|
127
|
+
});
|
|
128
|
+
if (done.error !== undefined || !allowed.includes(done.status ?? -1))
|
|
129
|
+
throw new Error(
|
|
130
|
+
`${command} ${args.join(" ")} failed (${done.status}): ${done.stderr}`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
for (const host of HOSTS) {
|
|
136
|
+
const cwd = join(scratch, host.name);
|
|
137
|
+
mkdirSync(cwd);
|
|
138
|
+
writeFileSync(
|
|
139
|
+
join(cwd, "package.json"),
|
|
140
|
+
JSON.stringify({
|
|
141
|
+
name: "anonymous-dual-lock-host",
|
|
142
|
+
version: "1.0.0",
|
|
143
|
+
private: true,
|
|
144
|
+
devDependencies: host.devDependencies,
|
|
145
|
+
})
|
|
146
|
+
);
|
|
147
|
+
// Resolving reads install packuments the suite never needs, since it
|
|
148
|
+
// installs from this lock, so it gets a cache of its own.
|
|
149
|
+
run(cwd, "npm", ["install", "--package-lock-only", ...FLAGS], [0], {
|
|
150
|
+
...env,
|
|
151
|
+
NPM_CONFIG_CACHE: join(scratch, "resolve-cache"),
|
|
152
|
+
});
|
|
153
|
+
writeFileSync(
|
|
154
|
+
join(STAGE, host.lock),
|
|
155
|
+
readFileSync(join(cwd, "package-lock.json"))
|
|
156
|
+
);
|
|
157
|
+
// The suite's baseline, then the updater's prepare, in their order.
|
|
158
|
+
run(cwd, "npm", ["ci", ...FLAGS]);
|
|
159
|
+
run(cwd, "bun", BUN_LOCK);
|
|
160
|
+
run(cwd, "bun", BUN_FROZEN);
|
|
161
|
+
run(cwd, "npm", ["outdated", "--json", "--long"], [0, 1]);
|
|
162
|
+
run(cwd, "npm", ["view", UPDATE, "--json"]);
|
|
163
|
+
run(cwd, "npm", [
|
|
164
|
+
"install",
|
|
165
|
+
UPDATE,
|
|
166
|
+
"--save-exact",
|
|
167
|
+
"--package-lock-only",
|
|
168
|
+
"--save-dev",
|
|
169
|
+
...FLAGS,
|
|
170
|
+
]);
|
|
171
|
+
run(cwd, "bun", [...BUN_LOCK, ...AT_REGISTRY]);
|
|
172
|
+
run(cwd, "npm", ["ci", ...FLAGS]);
|
|
173
|
+
run(cwd, "bun", [...BUN_FROZEN, ...AT_REGISTRY]);
|
|
174
|
+
}
|
|
175
|
+
dropLinks(SEED);
|
|
176
|
+
// Bun's extracted packages are package source, not registry data: the suite
|
|
177
|
+
// extracts the one it needs from npm's recorded, integrity-checked tarball.
|
|
178
|
+
for (const name of readdirSync(join(SEED, "bun")))
|
|
179
|
+
if (lstatSync(join(SEED, "bun", name)).isDirectory())
|
|
180
|
+
rmSync(join(SEED, "bun", name), { recursive: true });
|
|
181
|
+
// npm's debug logs name local paths, and nothing offline reads them.
|
|
182
|
+
rmSync(join(SEED, "npm", "_logs"), { force: true, recursive: true });
|
|
183
|
+
// No local owner, extended attributes or macOS metadata in the archive.
|
|
184
|
+
run(STAGE, "tar", [
|
|
185
|
+
"-czf",
|
|
186
|
+
ARCHIVE,
|
|
187
|
+
"--uid",
|
|
188
|
+
"0",
|
|
189
|
+
"--gid",
|
|
190
|
+
"0",
|
|
191
|
+
"--uname",
|
|
192
|
+
"",
|
|
193
|
+
"--gname",
|
|
194
|
+
"",
|
|
195
|
+
"--no-xattrs",
|
|
196
|
+
"--no-mac-metadata",
|
|
197
|
+
"seed",
|
|
198
|
+
...HOSTS.map(host => host.lock),
|
|
199
|
+
]);
|
|
200
|
+
} finally {
|
|
201
|
+
rmSync(scratch, { force: true, recursive: true });
|
|
202
|
+
}
|
|
203
|
+
console.log(`recorded ${ARCHIVE}`);
|
|
@@ -188,6 +188,7 @@ scripts/lib/npm-update-allocate.mjs
|
|
|
188
188
|
scripts/lib/npm-update-authorization.mjs
|
|
189
189
|
scripts/lib/npm-update-broker-client.mjs
|
|
190
190
|
scripts/lib/npm-update-bun.mjs
|
|
191
|
+
scripts/lib/npm-update-cache-seed.mjs
|
|
191
192
|
scripts/lib/npm-update-cancel-origin.mjs
|
|
192
193
|
scripts/lib/npm-update-cancellation-proof.mjs
|
|
193
194
|
scripts/lib/npm-update-cancellation.mjs
|