@codyswann/lisa 8.2.3 → 8.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/copy-overwrite/scripts/check-npm-publish-landed.mjs +6 -4
- package/dist/core/lisa-owned-hash-ledger.json +2 -0
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.json +6 -2
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/scripts/check-self-dependency-pin.mjs +105 -30
|
@@ -208,11 +208,13 @@ async function askOnce(url, fetchImpl, version, timeout) {
|
|
|
208
208
|
headers: { accept: "application/json" },
|
|
209
209
|
signal: controller.signal,
|
|
210
210
|
});
|
|
211
|
-
if (response.status === 404) {
|
|
212
|
-
return { verdict: "missing", detail: "registry returned 404" };
|
|
213
|
-
}
|
|
214
211
|
if (!response.ok) {
|
|
215
|
-
|
|
212
|
+
// An unread body keeps its socket, and with it the process, alive after
|
|
213
|
+
// the verdict; the deadline is cleared below, so nothing else ends it.
|
|
214
|
+
await response.body?.cancel().catch(() => {});
|
|
215
|
+
return response.status === 404
|
|
216
|
+
? { verdict: "missing", detail: "registry returned 404" }
|
|
217
|
+
: { verdict: "unprovable", detail: `HTTP ${response.status}` };
|
|
216
218
|
}
|
|
217
219
|
const manifest = await response.json();
|
|
218
220
|
// A 200 that names a different version is not this version being present.
|
|
@@ -272,6 +272,7 @@
|
|
|
272
272
|
"scripts/check-npm-publish-landed.mjs": [
|
|
273
273
|
"0c441a2f05cacfb020f5c658595f87bfddf1630388680ec7ca471da3f9aa96dd",
|
|
274
274
|
"2be5dbf57f3c23d8eacac06930637b9695ef292a58199247bc81ea2e242969b4",
|
|
275
|
+
"316a3d09a7c28a1c9c90f144552d7be68b4fb8c65e191e29534ce1961fd2c3e3",
|
|
275
276
|
"3ad3bb02a80666ec34b2e11af336f0238471320881c1a00009504099ee92fdef",
|
|
276
277
|
"64ab045af386169a7f669bd5e90c8bec75f9edd722f7d5ea07ad8fd1d58022a6",
|
|
277
278
|
"6b20fc72b48c51938bc6e2211821db625d5f908f6ace07b4bbc2f9488e079357",
|
|
@@ -3367,6 +3368,7 @@
|
|
|
3367
3368
|
"scripts/check-npm-publish-landed.mjs": [
|
|
3368
3369
|
"0c441a2f05cacfb020f5c658595f87bfddf1630388680ec7ca471da3f9aa96dd",
|
|
3369
3370
|
"2be5dbf57f3c23d8eacac06930637b9695ef292a58199247bc81ea2e242969b4",
|
|
3371
|
+
"316a3d09a7c28a1c9c90f144552d7be68b4fb8c65e191e29534ce1961fd2c3e3",
|
|
3370
3372
|
"3ad3bb02a80666ec34b2e11af336f0238471320881c1a00009504099ee92fdef",
|
|
3371
3373
|
"64ab045af386169a7f669bd5e90c8bec75f9edd722f7d5ea07ad8fd1d58022a6",
|
|
3372
3374
|
"6b20fc72b48c51938bc6e2211821db625d5f908f6ace07b4bbc2f9488e079357",
|
|
@@ -48,9 +48,9 @@ export const NIGHTLY_E2E_GUARD_BEHAVIOR_CERTIFICATES = Object.freeze({
|
|
|
48
48
|
}),
|
|
49
49
|
df39aa29b19817f67726107fec45078ce639f14a682cf6d5587ba37617f31ac9: Object.freeze({
|
|
50
50
|
contractVersion: "1.9.0",
|
|
51
|
-
packageVersions: Object.freeze(["8.2.
|
|
51
|
+
packageVersions: Object.freeze(["8.2.4"]),
|
|
52
52
|
provenances: Object.freeze([
|
|
53
|
-
"workspace package @codyswann/lisa@8.2.
|
|
53
|
+
"workspace package @codyswann/lisa@8.2.4 (typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs)",
|
|
54
54
|
]),
|
|
55
55
|
}),
|
|
56
56
|
dfd2fef680de5ef03e63075e8a61c62ca4d95cdfdff6201939b79c748d3397f6: Object.freeze({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"all/copy-contents/gitignore": "9aee6fe2edce4acdef159a1757c998b313abe538142aa6df37f01b38de088230",
|
|
5
5
|
"all/copy-contents/scripts/lisa-mutation.sh": "dd62950d6f13b9eae7e879b9de24ec1d19dc985634a2d921e003ede5a6f56a81",
|
|
6
6
|
"all/copy-overwrite/scripts/check-conflict-markers.mjs": "8a4b2cab9ac32a855e2adc1a7a3c6f7a9ac35dcb75cda2fac7eea144ced50098",
|
|
7
|
-
"all/copy-overwrite/scripts/check-npm-publish-landed.mjs": "
|
|
7
|
+
"all/copy-overwrite/scripts/check-npm-publish-landed.mjs": "316a3d09a7c28a1c9c90f144552d7be68b4fb8c65e191e29534ce1961fd2c3e3",
|
|
8
8
|
"all/copy-overwrite/scripts/check-orphaned-branches.mjs": "1f450d2492ca0bcdba440f6b403c1deee0f35e749c54d2ed5c5ddc696d5ab896",
|
|
9
9
|
"all/copy-overwrite/scripts/check-release-package-identity.mjs": "a0f17592d4436de4c240f7c78512537581aa2ed5e89f0caf1fe890694163a873",
|
|
10
10
|
"all/copy-overwrite/scripts/check-state-classification.mjs": "a72910f9885629dd6d8a739b900f5603e4b53d68ece64100a2a5647016b58e1e",
|
|
@@ -1364,7 +1364,7 @@
|
|
|
1364
1364
|
"scripts/check-required-check-promotions.mjs": "3f65f71350da46dfcbaca342b23c9175667849770c053073e904fc108136fd46",
|
|
1365
1365
|
"scripts/check-rules-pairing.sh": "0fc26c4bb3e9283dbc775e794ee8abad98d59f401dfcc55deead0160c5c6bb71",
|
|
1366
1366
|
"scripts/check-security-floors.mjs": "a1abe6d2cbbef9243b9687c73d5c4497c069bc8d714e34be7375805fadbc4721",
|
|
1367
|
-
"scripts/check-self-dependency-pin.mjs": "
|
|
1367
|
+
"scripts/check-self-dependency-pin.mjs": "9bbf569530956adb60b0503848a41b5012cb801914d805458a8e603fc5d1fa9b",
|
|
1368
1368
|
"scripts/check-shell-guard-refusal-coverage.mjs": "82bc9fbd7537cfc30d359d75e4ce86efbcea6455d4854c8d1273a445feae253c",
|
|
1369
1369
|
"scripts/check-shipped-surface-removals.mjs": "2ff9e161d101cc55ffe099f0a7b4fc83e023e79215ff09e53c5d0c889a9594bb",
|
|
1370
1370
|
"scripts/check-state-classification.mjs": "26baaa85c0758fa41f1f66257f7d3a31ea4dd5cf17a9c0acaa3e89caaaf6265a",
|
|
@@ -11053,6 +11053,7 @@
|
|
|
11053
11053
|
"tests/integration/ruby-runner-image-pin.test.ts": true,
|
|
11054
11054
|
"tests/integration/security-floors-gate.test.ts": true,
|
|
11055
11055
|
"tests/integration/seeded-gates-preserve-hook-outcomes.test.ts": true,
|
|
11056
|
+
"tests/integration/self-pin-cli-exits.test.ts": true,
|
|
11056
11057
|
"tests/integration/self-pin-drift-gate-wiring.test.ts": true,
|
|
11057
11058
|
"tests/integration/self-pin-raise-prepare-job.test.ts": true,
|
|
11058
11059
|
"tests/integration/self-pin-raise-triggers.test.ts": true,
|
|
@@ -12370,6 +12371,7 @@
|
|
|
12370
12371
|
"tests/unit/scripts/check-pipeline-status-reads.test.ts": true,
|
|
12371
12372
|
"tests/unit/scripts/check-probe-absence-direction.test.ts": true,
|
|
12372
12373
|
"tests/unit/scripts/check-release-package-identity.test.ts": true,
|
|
12374
|
+
"tests/unit/scripts/check-self-dependency-pin-deadline.test.ts": true,
|
|
12373
12375
|
"tests/unit/scripts/check-self-dependency-pin-listed.test.ts": true,
|
|
12374
12376
|
"tests/unit/scripts/check-self-dependency-pin.test.ts": true,
|
|
12375
12377
|
"tests/unit/scripts/check-shell-guard-refusal-coverage.test.ts": true,
|
|
@@ -18870,6 +18872,7 @@
|
|
|
18870
18872
|
"4f07e3a3bdf0c0657ced432a33596f2dd1192e39": true,
|
|
18871
18873
|
"4f0848c12b6a9c05914ae1a87cba8b5127048eba": true,
|
|
18872
18874
|
"4f0c3fd3dd3cae1661d2e75d1bc3e869cb505db1": true,
|
|
18875
|
+
"4f0e13970b313cb6511cb2b6e5be0454349d4d51": true,
|
|
18873
18876
|
"4f0f03fad4978782dac86fdf215d5b645c25947f": true,
|
|
18874
18877
|
"4f1236bc55413dc3a9e0ef2e36981d0a4b93f5b3": true,
|
|
18875
18878
|
"4f126c97d51e1dc6619d5d2ca43f480c96af6388": true,
|
|
@@ -27570,6 +27573,7 @@
|
|
|
27570
27573
|
"d1410754900b32b0b8c0e53ca66bd10451692a14": true,
|
|
27571
27574
|
"d14118a1a4caa44834a75e94e067d47d274b0bbc": true,
|
|
27572
27575
|
"d14182f9f9455ef90bc98fe62528e8ca502347fe": true,
|
|
27576
|
+
"d142f0417de68b64903862af3d6923484f3757e6": true,
|
|
27573
27577
|
"d145f157de002a8255b9cd67510c69bce161c5b5": true,
|
|
27574
27578
|
"d1477c459bc9f881177a489d39ba9b1775627eb9": true,
|
|
27575
27579
|
"d14bf8be069e2b6216c49ad1b28df38c9ed18ea4": true,
|
package/package.json
CHANGED
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"zod": "^4.6.7"
|
|
200
200
|
},
|
|
201
201
|
"name": "@codyswann/lisa",
|
|
202
|
-
"version": "8.2.
|
|
202
|
+
"version": "8.2.4",
|
|
203
203
|
"description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
|
|
204
204
|
"main": "dist/index.js",
|
|
205
205
|
"exports": {
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"optional": true
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
|
-
"lisaReleaseCommit": "
|
|
374
|
-
"gitHead": "
|
|
375
|
-
"lisaReleaseTag": "v8.2.
|
|
373
|
+
"lisaReleaseCommit": "a1f6dffca1bcf354d0c8cff455f4f8df17a703d4",
|
|
374
|
+
"gitHead": "a1f6dffca1bcf354d0c8cff455f4f8df17a703d4",
|
|
375
|
+
"lisaReleaseTag": "v8.2.4"
|
|
376
376
|
}
|
|
@@ -101,6 +101,30 @@ const VERDICT_PREFIX = "self-dependency-pin:";
|
|
|
101
101
|
*/
|
|
102
102
|
const MAX_CANDIDATES = 5;
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Deadline for one packument read, body included.
|
|
106
|
+
*
|
|
107
|
+
* A packument read had none, and in a real pre-push one held an ESTABLISHED
|
|
108
|
+
* registry connection for about 74 minutes before failing "network:
|
|
109
|
+
* terminated" (CodySwannGT/lisa#5094). A read that runs out of time is a
|
|
110
|
+
* transport failure like any other: it is retried within the existing
|
|
111
|
+
* attempts and then reported. Sixty seconds clears the slowest whole read
|
|
112
|
+
* measured, 17.5s for the abbreviated document on 2026-11-19, by more than
|
|
113
|
+
* three times, and turns that 74-minute wait into at most three minutes.
|
|
114
|
+
*/
|
|
115
|
+
export const PACKUMENT_ATTEMPT_TIMEOUT_MS = 60_000;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The packument shape this check reads: the abbreviated install document.
|
|
119
|
+
*
|
|
120
|
+
* The check reads only the keys of `versions`, and the abbreviated document
|
|
121
|
+
* lists exactly the same versions as the full one (2187 of 2187, compared on
|
|
122
|
+
* 2026-11-19) at a quarter of the size: 6.0 MB rather than 23.5 MB, 487 KB
|
|
123
|
+
* rather than 830 KB compressed. Each candidate it picks is still confirmed
|
|
124
|
+
* through the exact-version prover before it is used.
|
|
125
|
+
*/
|
|
126
|
+
const ABBREVIATED = "application/vnd.npm.install-v1+json";
|
|
127
|
+
|
|
104
128
|
/** Specs naming a LOCATION rather than a registry version. */
|
|
105
129
|
const NON_REGISTRY_SPEC =
|
|
106
130
|
/^(?:file|link|portal|workspace|git|git\+[a-z]+|github|https?|npm):/i;
|
|
@@ -162,28 +186,69 @@ export function compareSpec(spec, newest) {
|
|
|
162
186
|
}
|
|
163
187
|
|
|
164
188
|
/**
|
|
165
|
-
*
|
|
189
|
+
* The deadline seams one packument read takes, with their defaults.
|
|
190
|
+
*
|
|
191
|
+
* The same shape `verifyPublish` takes in check-npm-publish-landed.mjs, so a
|
|
192
|
+
* test injects one controller factory and one timer for every read.
|
|
193
|
+
* @param {object} options - Any seams a caller passed.
|
|
194
|
+
* @returns {{attemptTimeoutMs: number, createAbortController: () => AbortController, setAttemptTimer: (callback: () => void, ms: number) => unknown, clearAttemptTimer: (timer: unknown) => void}} The seams.
|
|
195
|
+
*/
|
|
196
|
+
function deadlineSeams({
|
|
197
|
+
attemptTimeoutMs = PACKUMENT_ATTEMPT_TIMEOUT_MS,
|
|
198
|
+
createAbortController = () => new AbortController(),
|
|
199
|
+
setAttemptTimer = setTimeout,
|
|
200
|
+
clearAttemptTimer = clearTimeout,
|
|
201
|
+
} = {}) {
|
|
202
|
+
return {
|
|
203
|
+
attemptTimeoutMs,
|
|
204
|
+
createAbortController,
|
|
205
|
+
setAttemptTimer,
|
|
206
|
+
clearAttemptTimer,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* One packument read in one shape, bounded by a deadline that also covers the
|
|
212
|
+
* body: the timer is cleared only once `response.json()` has settled.
|
|
166
213
|
* @param {string} url - The packument URL.
|
|
214
|
+
* @param {string} accept - The shape's media type.
|
|
167
215
|
* @param {typeof fetch} fetchImpl - Injected for tests.
|
|
216
|
+
* @param {ReturnType<typeof deadlineSeams>} deadline - Per-attempt deadline seams.
|
|
168
217
|
* @returns {Promise<{packument: object | null, detail: string}>} The outcome.
|
|
169
218
|
*/
|
|
170
|
-
async function
|
|
219
|
+
async function readShapeOnce(url, accept, fetchImpl, deadline) {
|
|
220
|
+
const controller = deadline.createAbortController();
|
|
221
|
+
const timer = deadline.setAttemptTimer(
|
|
222
|
+
() => controller.abort(),
|
|
223
|
+
deadline.attemptTimeoutMs
|
|
224
|
+
);
|
|
171
225
|
try {
|
|
172
226
|
const response = await fetchImpl(url, {
|
|
173
|
-
headers: { accept
|
|
227
|
+
headers: { accept },
|
|
228
|
+
signal: controller.signal,
|
|
174
229
|
});
|
|
175
230
|
if (!response.ok) {
|
|
231
|
+
// An unread body keeps its socket, and with it the process, alive after
|
|
232
|
+
// the verdict; the deadline is cleared below, so nothing else ends it.
|
|
233
|
+
await response.body?.cancel().catch(() => {});
|
|
176
234
|
return { packument: null, detail: `HTTP ${response.status} from ${url}` };
|
|
177
235
|
}
|
|
178
236
|
return { packument: await response.json(), detail: "ok" };
|
|
179
237
|
} catch (error) {
|
|
180
|
-
return {
|
|
238
|
+
return {
|
|
239
|
+
packument: null,
|
|
240
|
+
detail: controller.signal.aborted
|
|
241
|
+
? `network: attempt exceeded ${String(deadline.attemptTimeoutMs)}ms deadline (${url})`
|
|
242
|
+
: `network: ${error.message} (${url})`,
|
|
243
|
+
};
|
|
244
|
+
} finally {
|
|
245
|
+
deadline.clearAttemptTimer(timer);
|
|
181
246
|
}
|
|
182
247
|
}
|
|
183
248
|
|
|
184
249
|
/**
|
|
185
250
|
* Ask the registry for the packument, retrying transport failures.
|
|
186
|
-
* @param {object} options - Registry, package, fetch seam and
|
|
251
|
+
* @param {object} options - Registry, package, fetch seam, retry budget and per-attempt deadline seams.
|
|
187
252
|
* @returns {Promise<{packument: object | null, detail: string}>} The document.
|
|
188
253
|
*/
|
|
189
254
|
async function fetchPackument({
|
|
@@ -192,6 +257,7 @@ async function fetchPackument({
|
|
|
192
257
|
fetchImpl,
|
|
193
258
|
attempts,
|
|
194
259
|
sleep,
|
|
260
|
+
deadline,
|
|
195
261
|
}) {
|
|
196
262
|
const url = `${registry}/${packageName}`;
|
|
197
263
|
const tries = Array.from({ length: attempts }, (_unused, index) => index);
|
|
@@ -200,7 +266,7 @@ async function fetchPackument({
|
|
|
200
266
|
const settled = await previous;
|
|
201
267
|
if (settled.packument !== null) return settled;
|
|
202
268
|
if (index > 0) await sleep();
|
|
203
|
-
return
|
|
269
|
+
return readShapeOnce(url, ABBREVIATED, fetchImpl, deadline);
|
|
204
270
|
},
|
|
205
271
|
Promise.resolve({ packument: null, detail: "no attempt was made" })
|
|
206
272
|
);
|
|
@@ -275,6 +341,7 @@ export async function checkSelfPin({
|
|
|
275
341
|
attempts = 3,
|
|
276
342
|
sleep = () => new Promise(resolve => setTimeout(resolve, 2000)),
|
|
277
343
|
injected = {},
|
|
344
|
+
...seams
|
|
278
345
|
}) {
|
|
279
346
|
const declared = locateSelfPin(manifest);
|
|
280
347
|
if (declared === null) {
|
|
@@ -291,6 +358,7 @@ export async function checkSelfPin({
|
|
|
291
358
|
fetchImpl,
|
|
292
359
|
attempts,
|
|
293
360
|
sleep,
|
|
361
|
+
deadline: deadlineSeams(seams),
|
|
294
362
|
});
|
|
295
363
|
if (packument === null) {
|
|
296
364
|
return { verdict: "unprovable", detail, newest: null, spec: declared.spec };
|
|
@@ -316,13 +384,14 @@ export async function checkSelfPin({
|
|
|
316
384
|
}
|
|
317
385
|
|
|
318
386
|
/**
|
|
319
|
-
* The two packument shapes a registry serves. The
|
|
320
|
-
* check
|
|
321
|
-
* They are cached separately, so one can
|
|
387
|
+
* The two packument shapes a registry serves. The abbreviated install document
|
|
388
|
+
* is what this check and Bun's resolver read; the full document is what npm's
|
|
389
|
+
* own commands such as `npm view` read. They are cached separately, so one can
|
|
390
|
+
* list a release the other does not, and the raise waits for both.
|
|
322
391
|
*/
|
|
323
392
|
const PACKUMENT_SHAPES = [
|
|
324
393
|
{ name: "full", accept: "application/json" },
|
|
325
|
-
{ name: "abbreviated", accept:
|
|
394
|
+
{ name: "abbreviated", accept: ABBREVIATED },
|
|
326
395
|
];
|
|
327
396
|
|
|
328
397
|
/** How many times the packument is read before the release is given up on. */
|
|
@@ -332,37 +401,39 @@ const LISTED_POLLS = 40;
|
|
|
332
401
|
const LISTED_POLL_DELAY_MS = 15_000;
|
|
333
402
|
|
|
334
403
|
/**
|
|
335
|
-
* Whether one packument shape lists a version.
|
|
404
|
+
* Whether one packument shape lists a version, within one read's deadline.
|
|
336
405
|
* @param {string} url - The packument URL.
|
|
337
406
|
* @param {string} accept - The shape's media type.
|
|
338
407
|
* @param {string} version - The release to look for.
|
|
339
408
|
* @param {typeof fetch} fetchImpl - Injected for tests.
|
|
409
|
+
* @param {ReturnType<typeof deadlineSeams>} deadline - Per-read deadline seams.
|
|
340
410
|
* @returns {Promise<{listed: boolean, detail: string}>} The answer.
|
|
341
411
|
*/
|
|
342
|
-
async function shapeLists(url, accept, version, fetchImpl) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
return { listed: false, detail: `network: ${error.message} (${url})` };
|
|
354
|
-
}
|
|
412
|
+
async function shapeLists(url, accept, version, fetchImpl, deadline) {
|
|
413
|
+
const { packument, detail } = await readShapeOnce(
|
|
414
|
+
url,
|
|
415
|
+
accept,
|
|
416
|
+
fetchImpl,
|
|
417
|
+
deadline
|
|
418
|
+
);
|
|
419
|
+
if (packument === null) return { listed: false, detail };
|
|
420
|
+
return packument?.versions?.[version] === undefined
|
|
421
|
+
? { listed: false, detail: `the packument does not list ${version} yet` }
|
|
422
|
+
: { listed: true, detail: `the packument lists ${version}` };
|
|
355
423
|
}
|
|
356
424
|
|
|
357
425
|
/**
|
|
358
426
|
* Wait, with a bound, until both packument shapes list a release.
|
|
359
427
|
*
|
|
360
428
|
* The exact-version endpoint can serve a release before the packument lists
|
|
361
|
-
* it.
|
|
362
|
-
* abbreviated packument
|
|
363
|
-
* the release would compare `^7.0.0` against 6.x and fail for a reason
|
|
364
|
-
* only propagation lag.
|
|
365
|
-
*
|
|
429
|
+
* it. `check:self-pin` (newest listed version) and Bun's resolver read the
|
|
430
|
+
* abbreviated packument and npm reads the full one, so a raise proved before it
|
|
431
|
+
* lists the release would compare `^7.0.0` against 6.x and fail for a reason
|
|
432
|
+
* that is only propagation lag.
|
|
433
|
+
*
|
|
434
|
+
* Each read ends at the same per-attempt deadline as {@link checkSelfPin}'s, so
|
|
435
|
+
* the wait is bounded by its poll budget alone.
|
|
436
|
+
* @param {object} options - Version, registry, fetch seam, poll budget, sleep seam and per-read deadline seams.
|
|
366
437
|
* @returns {Promise<{listed: boolean, detail: string}>} Whether both shapes list it.
|
|
367
438
|
*/
|
|
368
439
|
export async function awaitListed({
|
|
@@ -372,12 +443,14 @@ export async function awaitListed({
|
|
|
372
443
|
polls = LISTED_POLLS,
|
|
373
444
|
sleep = () =>
|
|
374
445
|
new Promise(resolve => setTimeout(resolve, LISTED_POLL_DELAY_MS)),
|
|
446
|
+
...seams
|
|
375
447
|
}) {
|
|
376
448
|
const url = `${registry}/${SELF_PACKAGE}`;
|
|
449
|
+
const deadline = deadlineSeams(seams);
|
|
377
450
|
const poll = async number => {
|
|
378
451
|
const answers = await Promise.all(
|
|
379
452
|
PACKUMENT_SHAPES.map(shape =>
|
|
380
|
-
shapeLists(url, shape.accept, version, fetchImpl)
|
|
453
|
+
shapeLists(url, shape.accept, version, fetchImpl, deadline)
|
|
381
454
|
)
|
|
382
455
|
);
|
|
383
456
|
const missing = answers.flatMap((answer, index) =>
|
|
@@ -410,6 +483,7 @@ export async function newestInstallableVersion({
|
|
|
410
483
|
attempts = 3,
|
|
411
484
|
sleep = () => new Promise(resolve => setTimeout(resolve, 2000)),
|
|
412
485
|
injected = {},
|
|
486
|
+
...seams
|
|
413
487
|
}) {
|
|
414
488
|
const { packument, detail } = await fetchPackument({
|
|
415
489
|
registry,
|
|
@@ -417,6 +491,7 @@ export async function newestInstallableVersion({
|
|
|
417
491
|
fetchImpl,
|
|
418
492
|
attempts,
|
|
419
493
|
sleep,
|
|
494
|
+
deadline: deadlineSeams(seams),
|
|
420
495
|
});
|
|
421
496
|
if (packument === null) return { version: null, detail };
|
|
422
497
|
const found = await newestInstallable({
|