@codyswann/lisa 8.1.0 → 8.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/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 +158 -17
- 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/.codex-plugin/scripts/queue-contract-resolution.mjs +583 -0
- package/plugins/lisa/.codex-plugin/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-agy/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-agy/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-agy/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-agy/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-agy/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-agy/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-agy/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-agy/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-agy/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-agy/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-agy/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-agy/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- 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-copilot/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-copilot/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-copilot/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-copilot/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-copilot/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-cursor/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-cursor/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-cursor/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-cursor/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-cursor/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-devin/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-devin/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-devin/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-devin/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-devin/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-devin/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-devin/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-devin/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-devin/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-devin/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-devin/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-devin/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- 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/plugins/src/base/scripts/ready-queue-order.mjs +99 -25
- package/plugins/src/base/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/src/base/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/src/base/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/src/base/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/src/base/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/src/base/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/src/base/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/src/base/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/src/base/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/src/base/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/src/base/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/src/base/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- 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
|
@@ -52,6 +52,14 @@ import { orphanPlan } from "./cli-orphans.mjs";
|
|
|
52
52
|
import { overruledPlan } from "./cli-overruled.mjs";
|
|
53
53
|
import { repoDir, start, status, stop, validate } from "./cli-manager.mjs";
|
|
54
54
|
import { queue } from "./cli-queue.mjs";
|
|
55
|
+
import { staleLinksConfirm, staleLinksPlan } from "./cli-stale-links.mjs";
|
|
56
|
+
import {
|
|
57
|
+
staleLinksPending,
|
|
58
|
+
staleLinksPosted,
|
|
59
|
+
staleLinksReport,
|
|
60
|
+
staleLinksRestored,
|
|
61
|
+
staleLinksVerify,
|
|
62
|
+
} from "./cli-stale-links-results.mjs";
|
|
55
63
|
import { CliError, EXIT } from "./cli-runtime.mjs";
|
|
56
64
|
import {
|
|
57
65
|
coexistence,
|
|
@@ -134,6 +142,47 @@ const COMMANDS = {
|
|
|
134
142
|
options: { input: text, max: text },
|
|
135
143
|
positionals: 0,
|
|
136
144
|
},
|
|
145
|
+
"stale-links-plan": {
|
|
146
|
+
run: staleLinksPlan,
|
|
147
|
+
options: { tracker: text, input: text, max: text, "github-repo": text },
|
|
148
|
+
positionals: 0,
|
|
149
|
+
},
|
|
150
|
+
"stale-links-confirm": {
|
|
151
|
+
run: staleLinksConfirm,
|
|
152
|
+
options: { tracker: text, input: text, plan: text, "github-repo": text },
|
|
153
|
+
positionals: 0,
|
|
154
|
+
},
|
|
155
|
+
"stale-links-verify": {
|
|
156
|
+
run: staleLinksVerify,
|
|
157
|
+
options: {
|
|
158
|
+
tracker: text,
|
|
159
|
+
input: text,
|
|
160
|
+
plan: text,
|
|
161
|
+
blockers: text,
|
|
162
|
+
"github-repo": text,
|
|
163
|
+
},
|
|
164
|
+
positionals: 0,
|
|
165
|
+
},
|
|
166
|
+
"stale-links-pending": {
|
|
167
|
+
run: staleLinksPending,
|
|
168
|
+
options: {},
|
|
169
|
+
positionals: 0,
|
|
170
|
+
},
|
|
171
|
+
"stale-links-posted": {
|
|
172
|
+
run: staleLinksPosted,
|
|
173
|
+
options: { ref: text, removed: text, failed: flag },
|
|
174
|
+
positionals: 0,
|
|
175
|
+
},
|
|
176
|
+
"stale-links-restored": {
|
|
177
|
+
run: staleLinksRestored,
|
|
178
|
+
options: { tracker: text, input: text, ref: text, "github-repo": text },
|
|
179
|
+
positionals: 0,
|
|
180
|
+
},
|
|
181
|
+
"stale-links-report": {
|
|
182
|
+
run: staleLinksReport,
|
|
183
|
+
options: { input: text },
|
|
184
|
+
positionals: 0,
|
|
185
|
+
},
|
|
137
186
|
"orphan-plan": {
|
|
138
187
|
run: orphanPlan,
|
|
139
188
|
options: { input: text, max: text, "stale-hours": text },
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The GitHub reads behind `stale-links-plan --tracker github`
|
|
3
|
+
* (CodySwannGT/lisa#5065): every open issue, the native `blocked_by`
|
|
4
|
+
* dependencies of those that have any, the issue each `Blocked by` body line
|
|
5
|
+
* names, and the comments of every issue with a blocker (for the marker
|
|
6
|
+
* dedupe). Every read goes through `gh`, GitHub's access layer, with
|
|
7
|
+
* the scrubbed worker env. A blocker that cannot be read is passed on as
|
|
8
|
+
* null, so the plan reports it as inaccessible instead of guessing.
|
|
9
|
+
* @module session-manager/stale-links-github
|
|
10
|
+
*/
|
|
11
|
+
import { parseBlockedByRefs } from "../../../scripts/stale-blocker-edges.mjs";
|
|
12
|
+
import { CliError, mustRun, run } from "./cli-runtime.mjs";
|
|
13
|
+
import { parseJson } from "./json-input.mjs";
|
|
14
|
+
import { scrubWorkerEnv } from "./workers.mjs";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Every page of one paginated `gh api` list, flattened.
|
|
18
|
+
* @param {object} ctx - CLI context
|
|
19
|
+
* @param {string} endpoint
|
|
20
|
+
* @returns {object[]}
|
|
21
|
+
*/
|
|
22
|
+
function listAll(ctx, endpoint) {
|
|
23
|
+
const stdout = mustRun("gh", ["api", "--paginate", "--slurp", endpoint], {
|
|
24
|
+
env: scrubWorkerEnv(ctx.env),
|
|
25
|
+
});
|
|
26
|
+
const pages = parseJson(stdout, `gh api ${endpoint}`);
|
|
27
|
+
return Array.isArray(pages) ? pages.flat() : [];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* One issue by canonical ref, or null when it cannot be read.
|
|
32
|
+
*
|
|
33
|
+
* probe-direction: fail-closed — a null blocker is judged inaccessible, so its
|
|
34
|
+
* link is kept and reported, never removed; a failed read can only shrink what
|
|
35
|
+
* the sweep clears.
|
|
36
|
+
* @param {object} ctx - CLI context
|
|
37
|
+
* @param {string} ref - `owner/repo#n`
|
|
38
|
+
* @returns {object | null}
|
|
39
|
+
*/
|
|
40
|
+
function readIssue(ctx, ref) {
|
|
41
|
+
const [repo, number] = ref.split("#");
|
|
42
|
+
const result = run("gh", ["api", `repos/${repo}/issues/${number}`], {
|
|
43
|
+
env: scrubWorkerEnv(ctx.env),
|
|
44
|
+
});
|
|
45
|
+
if (result.missing) throw new CliError("gh is not on PATH.", 1);
|
|
46
|
+
if (result.status !== 0) return null;
|
|
47
|
+
try {
|
|
48
|
+
return JSON.parse(result.stdout);
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Whether an issue has any native blocker, open or closed.
|
|
56
|
+
* @param {Record<string, any>} row - REST issue
|
|
57
|
+
* @returns {boolean}
|
|
58
|
+
*/
|
|
59
|
+
const hasNativeBlockers = row =>
|
|
60
|
+
Number(row?.issue_dependencies_summary?.total_blocked_by ?? 0) > 0;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A cached reader for blocker issues, so a blocker named by several items is
|
|
64
|
+
* read once per command.
|
|
65
|
+
* @param {object} ctx - CLI context
|
|
66
|
+
* @returns {(ref: string) => object | null}
|
|
67
|
+
*/
|
|
68
|
+
export function blockerReader(ctx) {
|
|
69
|
+
const cache = new Map();
|
|
70
|
+
return ref => {
|
|
71
|
+
if (!cache.has(ref)) cache.set(ref, readIssue(ctx, ref));
|
|
72
|
+
return cache.get(ref);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether a REST issue names any blocker, natively or in its body.
|
|
78
|
+
* @param {Record<string, any>} row - REST issue
|
|
79
|
+
* @param {string} repo - `owner/repo`
|
|
80
|
+
* @returns {boolean}
|
|
81
|
+
*/
|
|
82
|
+
export const hasBlockers = (row, repo) =>
|
|
83
|
+
hasNativeBlockers(row) ||
|
|
84
|
+
parseBlockedByRefs(row?.body, repo.toLowerCase()).length > 0;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The REST issue with its blockers attached, in the shape the shared rule
|
|
88
|
+
* reads (`nativeBlockers`, `bodyBlockers`). An issue with no blocker gets
|
|
89
|
+
* empty ones without a single read.
|
|
90
|
+
* @param {object} ctx - CLI context
|
|
91
|
+
* @param {string} repo - `owner/repo`
|
|
92
|
+
* @param {Record<string, any>} row - REST issue
|
|
93
|
+
* @param {(ref: string) => object | null} blocker - From {@link blockerReader}
|
|
94
|
+
* @returns {Record<string, any>}
|
|
95
|
+
*/
|
|
96
|
+
export function withBlockers(ctx, repo, row, blocker) {
|
|
97
|
+
const own = repo.toLowerCase();
|
|
98
|
+
const nativeBlockers = hasNativeBlockers(row)
|
|
99
|
+
? listAll(
|
|
100
|
+
ctx,
|
|
101
|
+
`repos/${repo}/issues/${row.number}/dependencies/blocked_by?per_page=100`
|
|
102
|
+
)
|
|
103
|
+
: [];
|
|
104
|
+
const bodyBlockers = Object.fromEntries(
|
|
105
|
+
parseBlockedByRefs(row.body, own).map(ref => [ref, blocker(ref)])
|
|
106
|
+
);
|
|
107
|
+
return { ...row, nativeBlockers, bodyBlockers };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* One issue with its blockers and comments, as the plan reads it.
|
|
112
|
+
* @param {object} ctx - CLI context
|
|
113
|
+
* @param {string} repo - `owner/repo`
|
|
114
|
+
* @param {Record<string, any>} row - REST issue
|
|
115
|
+
* @param {(ref: string) => object | null} blocker - From {@link blockerReader}
|
|
116
|
+
* @returns {Record<string, any>}
|
|
117
|
+
*/
|
|
118
|
+
function staleLinkItem(ctx, repo, row, blocker) {
|
|
119
|
+
const enriched = readOrUnreadable(() =>
|
|
120
|
+
withBlockers(ctx, repo, row, blocker)
|
|
121
|
+
);
|
|
122
|
+
const comments = readOrUnreadable(() =>
|
|
123
|
+
listAll(ctx, `repos/${repo}/issues/${row.number}/comments?per_page=100`)
|
|
124
|
+
);
|
|
125
|
+
// probe-direction: fail-closed — a candidate whose dependency list or
|
|
126
|
+
// comments could not be read gets `nativeBlockers: null`, which the plan
|
|
127
|
+
// reads as "blocker list not read": it is reported and nothing of it is
|
|
128
|
+
// removed (without its comments, a link a person put back could not be
|
|
129
|
+
// told apart). Every other candidate is still planned.
|
|
130
|
+
const unreadable = enriched === null || comments === null;
|
|
131
|
+
return {
|
|
132
|
+
repo: repo.toLowerCase(),
|
|
133
|
+
number: row.number,
|
|
134
|
+
// Carried so confirm can skip an issue closed since the plan, and the
|
|
135
|
+
// ready claim can apply the queue's own container rule.
|
|
136
|
+
state: row.state ?? "",
|
|
137
|
+
sub_issues_summary: row.sub_issues_summary ?? null,
|
|
138
|
+
body: row.body ?? "",
|
|
139
|
+
labels: row.labels ?? [],
|
|
140
|
+
nativeBlockers: unreadable ? null : enriched.nativeBlockers,
|
|
141
|
+
bodyBlockers: unreadable ? {} : enriched.bodyBlockers,
|
|
142
|
+
// Every candidate can hold a stale link, so its comments are read for
|
|
143
|
+
// the marker dedupe; issues with no blocker are never read.
|
|
144
|
+
comments: comments ?? [],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Run one read, or return null when it fails (the caller decides what an
|
|
150
|
+
* unread result means; here it always holds the candidate back).
|
|
151
|
+
* @template T
|
|
152
|
+
* @param {() => T} read
|
|
153
|
+
* @returns {T | null}
|
|
154
|
+
*/
|
|
155
|
+
function readOrUnreadable(read) {
|
|
156
|
+
try {
|
|
157
|
+
return read();
|
|
158
|
+
} catch {
|
|
159
|
+
// probe-direction: fail-closed — see staleLinkItem: null means "not
|
|
160
|
+
// read", which removes nothing.
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Read every open issue with a blocker, ready for `planStaleLinkSweep`.
|
|
167
|
+
* @param {object} ctx - CLI context
|
|
168
|
+
* @param {string} repo - `owner/repo`
|
|
169
|
+
* @returns {{ items: object[] }}
|
|
170
|
+
*/
|
|
171
|
+
export function collectGithubStaleLinkInput(ctx, repo) {
|
|
172
|
+
const blocker = blockerReader(ctx);
|
|
173
|
+
const items = listAll(ctx, `repos/${repo}/issues?state=open&per_page=100`)
|
|
174
|
+
.filter(row => !row.pull_request && hasBlockers(row, repo))
|
|
175
|
+
.map(row => staleLinkItem(ctx, repo, row, blocker));
|
|
176
|
+
return { items };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Re-read one issue, every blocker it names and its comments, right before
|
|
181
|
+
* the writes (`stale-links-confirm`).
|
|
182
|
+
* @param {object} ctx - CLI context
|
|
183
|
+
* @param {string} repo - `owner/repo`
|
|
184
|
+
* @param {number} number - Issue number
|
|
185
|
+
* @returns {Record<string, any>}
|
|
186
|
+
*/
|
|
187
|
+
export function readGithubStaleLinkItem(ctx, repo, number) {
|
|
188
|
+
const row = readIssue(ctx, `${repo}#${number}`);
|
|
189
|
+
if (!row) {
|
|
190
|
+
throw new CliError(
|
|
191
|
+
`Could not read ${repo}#${number} to confirm the plan.`,
|
|
192
|
+
1
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return staleLinkItem(ctx, repo, row, blockerReader(ctx));
|
|
196
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session manager's stale-link state across cycles (CodySwannGT/lisa#5065),
|
|
3
|
+
* kept in its state directory:
|
|
4
|
+
*
|
|
5
|
+
* - `stale-links-pending.json`: comments owed for confirmed removals, until
|
|
6
|
+
* they post.
|
|
7
|
+
* - `stale-links-failures.json`: items whose planned removals did not
|
|
8
|
+
* happen, so the planner puts them after every other candidate.
|
|
9
|
+
* - `stale-links-inflight.json`: plans confirmed before their deletes, until
|
|
10
|
+
* a read-back succeeds, so a failed read-back is retried, not lost.
|
|
11
|
+
* - `stale-links-restores.json`: links put back after a blocker reopened,
|
|
12
|
+
* until a read-back shows them present; the queue holds those items.
|
|
13
|
+
*
|
|
14
|
+
* All are replaced atomically. Only a missing file reads as empty. Every
|
|
15
|
+
* read-change-write of either file runs inside {@link withStateLock}, the
|
|
16
|
+
* ledger's cross-process lock, so two overlapping commands on one project
|
|
17
|
+
* root never drop each other's owed comment or failure count.
|
|
18
|
+
* @module session-manager/stale-links-state
|
|
19
|
+
*/
|
|
20
|
+
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
21
|
+
import path from "node:path";
|
|
22
|
+
|
|
23
|
+
import { CliError } from "./cli-runtime.mjs";
|
|
24
|
+
import { withLedgerLock } from "./ledger-lock.mjs";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} root - Project root
|
|
28
|
+
* @param {string} name - File name
|
|
29
|
+
* @returns {string} The state file
|
|
30
|
+
*/
|
|
31
|
+
const stateFile = (root, name) =>
|
|
32
|
+
path.join(root, ".lisa", "session-manager", name);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Run one whole read-change-write of the stale-link state under the
|
|
36
|
+
* project root's lock.
|
|
37
|
+
* @template T
|
|
38
|
+
* @param {string} root - Project root
|
|
39
|
+
* @param {() => T | Promise<T>} operation - Reads, changes and writes
|
|
40
|
+
* @returns {Promise<T>}
|
|
41
|
+
*/
|
|
42
|
+
export async function withStateLock(root, operation) {
|
|
43
|
+
const target = stateFile(root, "stale-links-state");
|
|
44
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
45
|
+
return withLedgerLock(target, undefined, async () => operation());
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @param {string} root - Project root
|
|
50
|
+
* @returns {string} The pending-comments file
|
|
51
|
+
*/
|
|
52
|
+
export const pendingPath = root => stateFile(root, "stale-links-pending.json");
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param {string} root - Project root
|
|
56
|
+
* @returns {string} The removal-failures file
|
|
57
|
+
*/
|
|
58
|
+
export const failuresPath = root =>
|
|
59
|
+
stateFile(root, "stale-links-failures.json");
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Read one state file.
|
|
63
|
+
* @param {string} file
|
|
64
|
+
* @param {(parsed: unknown) => boolean} valid - Shape check
|
|
65
|
+
* @param {unknown} empty - Value when the file does not exist yet
|
|
66
|
+
* @returns {any}
|
|
67
|
+
*/
|
|
68
|
+
function readState(file, valid, empty) {
|
|
69
|
+
try {
|
|
70
|
+
const parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
71
|
+
if (!valid(parsed)) throw new Error("unexpected shape");
|
|
72
|
+
return parsed;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
// probe-direction: fail-closed — only a missing file reads as empty; an
|
|
75
|
+
// unreadable or corrupt one throws, so no owed comment or failure count
|
|
76
|
+
// is silently dropped.
|
|
77
|
+
if (error?.code === "ENOENT") return empty;
|
|
78
|
+
throw new CliError(`${file}: ${error.message}`, 1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Replace one state file atomically.
|
|
84
|
+
* @param {string} file
|
|
85
|
+
* @param {unknown} value
|
|
86
|
+
* @returns {void}
|
|
87
|
+
*/
|
|
88
|
+
function writeState(file, value) {
|
|
89
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
90
|
+
const temp = `${file}.${process.pid}.tmp`;
|
|
91
|
+
writeFileSync(temp, `${JSON.stringify(value, null, 2)}\n`);
|
|
92
|
+
renameSync(temp, file);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {unknown} value
|
|
97
|
+
* @returns {boolean}
|
|
98
|
+
*/
|
|
99
|
+
const isRecord = value =>
|
|
100
|
+
Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @param {string} root
|
|
104
|
+
* @returns {import("../../../scripts/stale-blocker-pending.mjs").PendingComment[]}
|
|
105
|
+
*/
|
|
106
|
+
export const readPending = root =>
|
|
107
|
+
readState(pendingPath(root), Array.isArray, []);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {string} root
|
|
111
|
+
* @param {readonly object[]} pending
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
|
+
export const writePending = (root, pending) =>
|
|
115
|
+
writeState(pendingPath(root), pending);
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @param {string} root
|
|
119
|
+
* @returns {import("../../../scripts/stale-blocker-pending.mjs").RemovalFailures}
|
|
120
|
+
*/
|
|
121
|
+
export const readFailures = root => readState(failuresPath(root), isRecord, {});
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @param {string} root
|
|
125
|
+
* @param {object} failures
|
|
126
|
+
* @returns {void}
|
|
127
|
+
*/
|
|
128
|
+
export const writeFailures = (root, failures) =>
|
|
129
|
+
writeState(failuresPath(root), failures);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @param {string} root - Project root
|
|
133
|
+
* @returns {string} The in-flight file: plans confirmed whose read-back has
|
|
134
|
+
* not succeeded yet
|
|
135
|
+
*/
|
|
136
|
+
export const inFlightPath = root =>
|
|
137
|
+
stateFile(root, "stale-links-inflight.json");
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @param {string} root - Project root
|
|
141
|
+
* @returns {string} The owed-restores file: links put back whose read-back
|
|
142
|
+
* has not shown them present yet
|
|
143
|
+
*/
|
|
144
|
+
export const restoresPath = root =>
|
|
145
|
+
stateFile(root, "stale-links-restores.json");
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @param {string} root
|
|
149
|
+
* @returns {import("../../../scripts/stale-blocker-pending.mjs").InFlight}
|
|
150
|
+
*/
|
|
151
|
+
export const readInFlight = root => readState(inFlightPath(root), isRecord, {});
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @param {string} root
|
|
155
|
+
* @param {object} inflight
|
|
156
|
+
* @returns {void}
|
|
157
|
+
*/
|
|
158
|
+
export const writeInFlight = (root, inflight) =>
|
|
159
|
+
writeState(inFlightPath(root), inflight);
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @param {string} root
|
|
163
|
+
* @returns {import("../../../scripts/stale-blocker-pending.mjs").OwedRestores}
|
|
164
|
+
*/
|
|
165
|
+
export const readRestores = root => readState(restoresPath(root), isRecord, {});
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @param {string} root
|
|
169
|
+
* @param {object} restores
|
|
170
|
+
* @returns {void}
|
|
171
|
+
*/
|
|
172
|
+
export const writeRestores = (root, restores) =>
|
|
173
|
+
writeState(restoresPath(root), restores);
|
|
@@ -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
|