@codyswann/lisa 2.311.10 → 2.311.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/cli/doctor-readiness-domain.d.ts.map +1 -1
  2. package/dist/cli/doctor-readiness-domain.js +3 -1
  3. package/dist/cli/doctor-readiness-domain.js.map +1 -1
  4. package/dist/cli/doctor-readiness-local-scripts.d.ts +9 -0
  5. package/dist/cli/doctor-readiness-local-scripts.d.ts.map +1 -0
  6. package/dist/cli/doctor-readiness-local-scripts.js +267 -0
  7. package/dist/cli/doctor-readiness-local-scripts.js.map +1 -0
  8. package/dist/cli/doctor-readiness-promoted-artifact.d.ts +23 -1
  9. package/dist/cli/doctor-readiness-promoted-artifact.d.ts.map +1 -1
  10. package/dist/cli/doctor-readiness-promoted-artifact.js +109 -6
  11. package/dist/cli/doctor-readiness-promoted-artifact.js.map +1 -1
  12. package/dist/cli/doctor-readiness-release-path.d.ts.map +1 -1
  13. package/dist/cli/doctor-readiness-release-path.js +11 -38
  14. package/dist/cli/doctor-readiness-release-path.js.map +1 -1
  15. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  16. package/dist/core/upstream-evidence-manifest.js +2 -0
  17. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  18. package/package.json +1 -1
  19. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  21. package/plugins/lisa-agy/plugin.json +1 -1
  22. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  24. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  25. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  31. package/plugins/lisa-expo-agy/plugin.json +1 -1
  32. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  36. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  37. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  41. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  42. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  46. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  47. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  51. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  52. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  56. package/plugins/lisa-rails-agy/plugin.json +1 -1
  57. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  61. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  62. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  66. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  67. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-readiness-domain.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-readiness-domain.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,iCAAiC,CAAC;AAEzC,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AA4PhE;;;;;;;;;;GAUG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,GAC1C,OAAO,CAAC,wBAAwB,CAAC,CA2BnC"}
1
+ {"version":3,"file":"doctor-readiness-domain.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-readiness-domain.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,iCAAiC,CAAC;AAEzC,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AA4PhE;;;;;;;;;;GAUG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,GAC1C,OAAO,CAAC,wBAAwB,CAAC,CA4BnC"}
@@ -27,6 +27,7 @@
27
27
  * @module cli/doctor-readiness-domain
28
28
  */
29
29
  import { commandTargetsOwnedService, describeCommands, hasCheckedInRunbook, looksEphemeral, scanCommands, } from "./doctor-readiness-operations.js";
30
+ import { expandLocalScriptCommands } from "./doctor-readiness-local-scripts.js";
30
31
  import { informationalFindings } from "./doctor-readiness-shared.js";
31
32
  import { parseRepositoryWorkflows, } from "./doctor-readiness-workflows.js";
32
33
  /** The domain-ownership readiness dimension id (readiness-rubric, RRR-1). */
@@ -237,7 +238,8 @@ function skipRecord(guarded, scan, inspected, runbook, recoverableDestructiveOps
237
238
  * @returns The domain-ownership dimension record
238
239
  */
239
240
  export async function assessDomainOwnershipDimension(root, parsedWorkflows) {
240
- const workflows = parsedWorkflows ?? (await parseRepositoryWorkflows(root));
241
+ const parsed = parsedWorkflows ?? (await parseRepositoryWorkflows(root));
242
+ const workflows = await expandLocalScriptCommands(root, parsed);
241
243
  const scan = scanCommands(workflows, destroysData, {
242
244
  exemptStep: jobTakesBackupBeforeStep,
243
245
  unresolvedStep: servicesDeferral,
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-readiness-domain.js","sourceRoot":"","sources":["../../src/cli/doctor-readiness-domain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAEd,YAAY,GAEb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAGL,wBAAwB,GAEzB,MAAM,iCAAiC,CAAC;AAEzC,6EAA6E;AAC7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,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC;QAC7C,OAAO,UAAU,CACf,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAC3D,IAAI,EACJ,SAAS,CAAC,MAAM,EAChB,WAAW,EACX,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CACtC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,6BAA6B;QACjC,4EAA4E;QAC5E,yEAAyE;QACzE,6EAA6E;QAC7E,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAC3E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ParsedWorkflow } from "./doctor-readiness-workflows.js";
2
+ /**
3
+ * Inline directly invoked local shell scripts into the parsed workflow commands.
4
+ * @param root - Repository root
5
+ * @param workflows - Parsed workflow files
6
+ * @returns Workflows with bounded script content appended to matching steps
7
+ */
8
+ export declare function expandLocalScriptCommands(root: string, workflows: readonly ParsedWorkflow[]): Promise<readonly ParsedWorkflow[]>;
9
+ //# sourceMappingURL=doctor-readiness-local-scripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-readiness-local-scripts.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-readiness-local-scripts.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,iCAAiC,CAAC;AA8QzC;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAKpC"}
@@ -0,0 +1,267 @@
1
+ /**
2
+ * Bounded expansion of repo-local shell wrappers referenced by workflow run
3
+ * steps.
4
+ * @module cli/doctor-readiness-local-scripts
5
+ */
6
+ import { open, realpath } from "node:fs/promises";
7
+ import * as path from "node:path";
8
+ /** Most bytes read from one local wrapper script during offline expansion. */
9
+ const MAX_LOCAL_SCRIPT_BYTES = 16_384;
10
+ /** Most wrapper scripts expanded across one readiness scan. */
11
+ const MAX_LOCAL_SCRIPT_EXPANSIONS = 64;
12
+ /** Separators that end one shell invocation for this conservative scan. */
13
+ const SHELL_INVOCATION_SEPARATOR = /\n|&&|\|\||[;&|]/;
14
+ /** Shell commands that execute another shell script path. */
15
+ const SHELL_SCRIPT_RUNNERS = new Set(["bash", "sh", "source", "."]);
16
+ /** Shell runners that accept option flags before the script path. */
17
+ const OPTIONED_SHELL_RUNNERS = new Set(["bash", "sh"]);
18
+ /** Prefix assignments that set env only for the following shell invocation. */
19
+ const SHELL_ENV_ASSIGNMENT = /^[A-Za-z_]\w*=.*$/u;
20
+ /**
21
+ * Whether a word is a shell-runner option rather than the script path.
22
+ * @param word - Shell token
23
+ * @returns True when the token should be skipped after bash/sh
24
+ */
25
+ function isShellRunnerOption(word) {
26
+ return word.startsWith("-") && word !== "-";
27
+ }
28
+ /**
29
+ * Find the first non-assignment token in one shell invocation.
30
+ * @param words - Whitespace-split shell invocation
31
+ * @param index - Current scan index
32
+ * @returns Index of the command token
33
+ */
34
+ function firstCommandIndex(words, index = 0) {
35
+ return SHELL_ENV_ASSIGNMENT.test(words[index] ?? "")
36
+ ? firstCommandIndex(words, index + 1)
37
+ : index;
38
+ }
39
+ /**
40
+ * Find the first non-option script argument after a shell runner.
41
+ * @param words - Whitespace-split shell invocation
42
+ * @param index - Current scan index
43
+ * @returns Index of the script argument
44
+ */
45
+ function firstShellScriptIndex(words, index) {
46
+ return isShellRunnerOption(words[index] ?? "")
47
+ ? firstShellScriptIndex(words, index + 1)
48
+ : index;
49
+ }
50
+ /**
51
+ * Locate the word in one invocation that names the script to expand.
52
+ * @param words - Whitespace-split shell invocation
53
+ * @returns Script word and whether a shell runner selected it
54
+ */
55
+ function scriptCandidate(words) {
56
+ const index = firstCommandIndex(words);
57
+ const command = words[index];
58
+ if (command === undefined) {
59
+ return null;
60
+ }
61
+ const usesRunner = SHELL_SCRIPT_RUNNERS.has(command);
62
+ if (!usesRunner) {
63
+ return { candidate: command, usesRunner };
64
+ }
65
+ const candidateIndex = OPTIONED_SHELL_RUNNERS.has(command)
66
+ ? firstShellScriptIndex(words, index + 1)
67
+ : index + 1;
68
+ const candidate = words[candidateIndex];
69
+ return candidate === undefined ? null : { candidate, usesRunner };
70
+ }
71
+ /**
72
+ * Extract repo-relative shell scripts named directly by a workflow run step.
73
+ * @param command - Workflow step command
74
+ * @returns Unique repo-relative script paths
75
+ */
76
+ function localScriptPaths(command) {
77
+ return [
78
+ ...new Set(command
79
+ .split(SHELL_INVOCATION_SEPARATOR)
80
+ .flatMap(invocation => {
81
+ const words = invocation.trim().split(/\s+/u);
82
+ if (words.length === 0 || words[0]?.startsWith("#")) {
83
+ return [];
84
+ }
85
+ const parsed = scriptCandidate(words);
86
+ if (parsed === null) {
87
+ return [];
88
+ }
89
+ const candidate = parsed?.candidate;
90
+ if (candidate === undefined ||
91
+ !candidate.endsWith(".sh") ||
92
+ candidate.includes("..")) {
93
+ return [];
94
+ }
95
+ if (!parsed.usesRunner &&
96
+ !candidate.includes("/") &&
97
+ !candidate.startsWith("./")) {
98
+ return [];
99
+ }
100
+ return [candidate.replace(/^\.\//u, "")];
101
+ })
102
+ .filter(candidate => !candidate.startsWith("-"))),
103
+ ];
104
+ }
105
+ /**
106
+ * Read one bounded repo-local script for offline command expansion.
107
+ * @param root - Repository root
108
+ * @param relativePath - Repo-relative script path
109
+ * @returns Script content, or null when it cannot be safely read
110
+ */
111
+ async function readLocalScript(root, relativePath) {
112
+ try {
113
+ const rootPath = await realpath(root);
114
+ const target = await realpath(path.resolve(rootPath, relativePath));
115
+ if (!target.startsWith(`${rootPath}${path.sep}`)) {
116
+ return null;
117
+ }
118
+ const file = await open(target, "r");
119
+ try {
120
+ const buffer = Buffer.alloc(MAX_LOCAL_SCRIPT_BYTES + 1);
121
+ const { bytesRead } = await file.read(buffer, 0, MAX_LOCAL_SCRIPT_BYTES + 1, 0);
122
+ return bytesRead > MAX_LOCAL_SCRIPT_BYTES
123
+ ? null
124
+ : buffer.subarray(0, bytesRead).toString("utf8");
125
+ }
126
+ finally {
127
+ await file.close();
128
+ }
129
+ }
130
+ catch {
131
+ return null;
132
+ }
133
+ }
134
+ /**
135
+ * Append any bounded local script bodies referenced by a workflow step.
136
+ * @param root - Repository root
137
+ * @param step - Parsed workflow step
138
+ * @param context - Shared expansion budget
139
+ * @returns Step with script bodies appended to `run`, when present
140
+ */
141
+ async function expandLocalScriptStep(root, step, context) {
142
+ const expanded = await expandLocalScriptBodies(root, localScriptPaths(step.run), context.remainingScripts);
143
+ return {
144
+ remainingScripts: expanded.remainingScripts,
145
+ value: expanded.value.length === 0
146
+ ? step
147
+ : { ...step, run: [step.run, ...expanded.value].join("\n") },
148
+ };
149
+ }
150
+ /**
151
+ * Read script bodies sequentially under the aggregate expansion budget.
152
+ * @param root - Repository root
153
+ * @param scripts - Candidate script paths
154
+ * @param remainingScripts - Remaining aggregate expansion budget
155
+ * @returns Expanded script bodies and updated budget
156
+ */
157
+ async function expandLocalScriptBodies(root, scripts, remainingScripts) {
158
+ const [script, ...rest] = scripts;
159
+ if (script === undefined || remainingScripts <= 0) {
160
+ return { value: [], remainingScripts };
161
+ }
162
+ const content = await readLocalScript(root, script);
163
+ const expanded = await expandLocalScriptBodies(root, rest, remainingScripts - 1);
164
+ return {
165
+ remainingScripts: expanded.remainingScripts,
166
+ value: content === null ? expanded.value : [content, ...expanded.value],
167
+ };
168
+ }
169
+ /**
170
+ * Expand directly invoked local shell scripts in one parsed job.
171
+ * @param root - Repository root
172
+ * @param job - Parsed workflow job
173
+ * @param context - Shared expansion budget
174
+ * @returns Job with script-expanded steps
175
+ */
176
+ async function expandLocalScriptJob(root, job, context) {
177
+ const expanded = await expandLocalScriptSteps(root, job.steps, context);
178
+ return {
179
+ remainingScripts: expanded.remainingScripts,
180
+ value: {
181
+ ...job,
182
+ steps: expanded.value,
183
+ },
184
+ };
185
+ }
186
+ /**
187
+ * Expand local scripts across a job's steps under the shared budget.
188
+ * @param root - Repository root
189
+ * @param steps - Parsed workflow steps
190
+ * @param context - Shared expansion budget
191
+ * @returns Expanded steps and updated budget
192
+ */
193
+ async function expandLocalScriptSteps(root, steps, context) {
194
+ const [step, ...rest] = steps;
195
+ if (step === undefined) {
196
+ return { value: [], remainingScripts: context.remainingScripts };
197
+ }
198
+ const expandedStep = await expandLocalScriptStep(root, step, context);
199
+ const expandedRest = await expandLocalScriptSteps(root, rest, {
200
+ remainingScripts: expandedStep.remainingScripts,
201
+ });
202
+ return {
203
+ remainingScripts: expandedRest.remainingScripts,
204
+ value: [expandedStep.value, ...expandedRest.value],
205
+ };
206
+ }
207
+ /**
208
+ * Inline directly invoked local shell scripts into the parsed workflow commands.
209
+ * @param root - Repository root
210
+ * @param workflows - Parsed workflow files
211
+ * @returns Workflows with bounded script content appended to matching steps
212
+ */
213
+ export async function expandLocalScriptCommands(root, workflows) {
214
+ const expanded = await expandLocalScriptWorkflows(root, workflows, {
215
+ remainingScripts: MAX_LOCAL_SCRIPT_EXPANSIONS,
216
+ });
217
+ return expanded.value;
218
+ }
219
+ /**
220
+ * Expand local scripts across workflows under the shared budget.
221
+ * @param root - Repository root
222
+ * @param workflows - Parsed workflow files
223
+ * @param context - Shared expansion budget
224
+ * @returns Expanded workflows and updated budget
225
+ */
226
+ async function expandLocalScriptWorkflows(root, workflows, context) {
227
+ const [workflow, ...rest] = workflows;
228
+ if (workflow === undefined) {
229
+ return { value: [], remainingScripts: context.remainingScripts };
230
+ }
231
+ const expandedJobs = await expandLocalScriptJobs(root, workflow.jobs, context);
232
+ const expandedRest = await expandLocalScriptWorkflows(root, rest, {
233
+ remainingScripts: expandedJobs.remainingScripts,
234
+ });
235
+ return {
236
+ remainingScripts: expandedRest.remainingScripts,
237
+ value: [
238
+ {
239
+ ...workflow,
240
+ jobs: expandedJobs.value,
241
+ },
242
+ ...expandedRest.value,
243
+ ],
244
+ };
245
+ }
246
+ /**
247
+ * Expand local scripts across workflow jobs under the shared budget.
248
+ * @param root - Repository root
249
+ * @param jobs - Parsed workflow jobs
250
+ * @param context - Shared expansion budget
251
+ * @returns Expanded jobs and updated budget
252
+ */
253
+ async function expandLocalScriptJobs(root, jobs, context) {
254
+ const [job, ...rest] = jobs;
255
+ if (job === undefined) {
256
+ return { value: [], remainingScripts: context.remainingScripts };
257
+ }
258
+ const expandedJob = await expandLocalScriptJob(root, job, context);
259
+ const expandedRest = await expandLocalScriptJobs(root, rest, {
260
+ remainingScripts: expandedJob.remainingScripts,
261
+ });
262
+ return {
263
+ remainingScripts: expandedRest.remainingScripts,
264
+ value: [expandedJob.value, ...expandedRest.value],
265
+ };
266
+ }
267
+ //# sourceMappingURL=doctor-readiness-local-scripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-readiness-local-scripts.js","sourceRoot":"","sources":["../../src/cli/doctor-readiness-local-scripts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAOlC,8EAA8E;AAC9E,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAEtC,+DAA+D;AAC/D,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEvC,2EAA2E;AAC3E,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAEtD,6DAA6D;AAC7D,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;AAEpE,qEAAqE;AACrE,MAA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E,YAAY,CAAC,gBAAgB;QAC/C,KAAK,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC;KAClD,CAAC;AACJ,CAAC"}
@@ -6,6 +6,12 @@ import type { ParsedWorkflowJob, ParsedWorkflowStep } from "./doctor-readiness-w
6
6
  import type { ReleasePathOutcome } from "./doctor-readiness-release-path.js";
7
7
  /** The GitHub Actions promotion step Lisa recognizes for CI-built artifacts. */
8
8
  export declare const PROMOTION_ACTION = "actions/download-artifact";
9
+ /**
10
+ * Whether an action step publishes something externally.
11
+ * @param step - The step to classify
12
+ * @returns True when the action is a known publishing action
13
+ */
14
+ export declare function isPublishAction(step: ParsedWorkflowStep): boolean;
9
15
  /**
10
16
  * Whether an action reference is the trusted artifact-promotion action.
11
17
  * @param uses - Raw action reference
@@ -16,9 +22,25 @@ export declare function isPromotionAction(uses: string): boolean;
16
22
  * Whether the job promotes an artifact produced by another job.
17
23
  * @param job - The publishing job
18
24
  * @param publishStep - The step that ships
25
+ * @param ancestorJobs - Jobs in the publishing job's `needs:` closure
19
26
  * @returns True when a download-artifact step is present before publication
20
27
  */
21
- export declare function promotesValidatedArtifact(job: ParsedWorkflowJob, publishStep: ParsedWorkflowStep): boolean;
28
+ export declare function promotesValidatedArtifact(job: ParsedWorkflowJob, publishStep: ParsedWorkflowStep, ancestorJobs?: readonly ParsedWorkflowJob[]): boolean;
29
+ /**
30
+ * Whether a named artifact download disagrees with named ancestor uploads.
31
+ * @param job - The publishing job
32
+ * @param publishStep - The step that ships
33
+ * @param ancestorJobs - Jobs in the publishing job's `needs:` closure
34
+ * @returns True when the downloaded artifact name is not uploaded by any ancestor
35
+ */
36
+ export declare function hasArtifactNameMismatch(job: ParsedWorkflowJob, publishStep: ParsedWorkflowStep, ancestorJobs: readonly ParsedWorkflowJob[]): boolean;
37
+ /**
38
+ * The release job downloaded a named artifact different from anything a
39
+ * validating ancestor uploaded, so the shipped bytes are not the tested bytes.
40
+ * @param where - Evidence location label
41
+ * @returns The violation outcome
42
+ */
43
+ export declare function artifactNameMismatch(where: string): ReleasePathOutcome;
22
44
  /**
23
45
  * A downloaded artifact without linked validation is unestablished, not clean.
24
46
  * @param where - Evidence location label
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-readiness-promoted-artifact.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-readiness-promoted-artifact.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,iBAAiB,EACtB,WAAW,EAAE,kBAAkB,GAC9B,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAQ5E"}
1
+ {"version":3,"file":"doctor-readiness-promoted-artifact.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-readiness-promoted-artifact.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AA4B5D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAMjE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AA6CD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,iBAAiB,EACtB,WAAW,EAAE,kBAAkB,EAC/B,YAAY,GAAE,SAAS,iBAAiB,EAAO,GAC9C,OAAO,CAWT;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,iBAAiB,EACtB,WAAW,EAAE,kBAAkB,EAC/B,YAAY,EAAE,SAAS,iBAAiB,EAAE,GACzC,OAAO,CAST;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAOtE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAQ5E"}
@@ -1,24 +1,127 @@
1
1
  /** The GitHub Actions promotion step Lisa recognizes for CI-built artifacts. */
2
2
  export const PROMOTION_ACTION = "actions/download-artifact";
3
+ const DOCKER_BUILD_PUSH_ACTION = "docker/build-push-action";
4
+ const GITHUB_RELEASE_ACTION = "softprops/action-gh-release";
5
+ const PYPI_PUBLISH_ACTION = "pypa/gh-action-pypi-publish";
6
+ const UPLOAD_ARTIFACT_ACTION = "actions/upload-artifact";
7
+ /**
8
+ * Normalize an action reference to its owner/repo component.
9
+ * @param uses - Raw `uses:` value
10
+ * @returns Lowercase action id without an `@ref`
11
+ */
12
+ function actionId(uses) {
13
+ return (uses.split("@")[0] ?? "").trim().toLowerCase();
14
+ }
15
+ /**
16
+ * Whether a serialized `with:` block sets a boolean option to true.
17
+ * @param inputs - Flattened step inputs
18
+ * @param name - Input name to read
19
+ * @returns True when the option is explicitly true
20
+ */
21
+ function hasTrueInput(inputs, name) {
22
+ const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
23
+ return new RegExp(`(^|\\n)${escaped}:\\s*['"]?true['"]?(\\s|$)`, "i").test(inputs);
24
+ }
25
+ /**
26
+ * Whether an action step publishes something externally.
27
+ * @param step - The step to classify
28
+ * @returns True when the action is a known publishing action
29
+ */
30
+ export function isPublishAction(step) {
31
+ const id = actionId(step.uses);
32
+ if (id === DOCKER_BUILD_PUSH_ACTION) {
33
+ return hasTrueInput(step.inputs, "push");
34
+ }
35
+ return id === PYPI_PUBLISH_ACTION || id === GITHUB_RELEASE_ACTION;
36
+ }
3
37
  /**
4
38
  * Whether an action reference is the trusted artifact-promotion action.
5
39
  * @param uses - Raw action reference
6
40
  * @returns True when the action id is exactly actions/download-artifact
7
41
  */
8
42
  export function isPromotionAction(uses) {
9
- const actionId = uses.split("@")[0]?.trim();
10
- return actionId === PROMOTION_ACTION;
43
+ return actionId(uses) === PROMOTION_ACTION;
44
+ }
45
+ /**
46
+ * Whether an action reference uploads an artifact produced by CI.
47
+ * @param uses - Raw action reference
48
+ * @returns True when the action id is exactly actions/upload-artifact
49
+ */
50
+ function isUploadAction(uses) {
51
+ return actionId(uses) === UPLOAD_ARTIFACT_ACTION;
52
+ }
53
+ /**
54
+ * Read a scalar step input from the parser's flattened `with:` text.
55
+ * @param inputs - Flattened step inputs
56
+ * @param name - Input name to read
57
+ * @returns The input value, or null when absent
58
+ */
59
+ function stepInput(inputs, name) {
60
+ const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
61
+ const match = new RegExp(`(^|\\n)${escaped}:\\s*(.+)(\\n|$)`).exec(inputs);
62
+ const value = match?.[2]?.trim();
63
+ if (value === undefined || value === "") {
64
+ return null;
65
+ }
66
+ return value.replace(/^['"]|['"]$/g, "");
67
+ }
68
+ /**
69
+ * List artifact names uploaded by jobs whose outputs have already been validated.
70
+ * @param validatingAncestorJobs - Validating jobs in the publishing job's `needs:` closure
71
+ * @returns Uploaded artifact names
72
+ */
73
+ function uploadedArtifactNames(validatingAncestorJobs) {
74
+ return new Set(validatingAncestorJobs.flatMap(job => job.steps
75
+ .filter(step => isUploadAction(step.uses))
76
+ .map(step => stepInput(step.inputs, "name"))
77
+ .filter((name) => name !== null)));
11
78
  }
12
79
  /**
13
80
  * Whether the job promotes an artifact produced by another job.
14
81
  * @param job - The publishing job
15
82
  * @param publishStep - The step that ships
83
+ * @param ancestorJobs - Jobs in the publishing job's `needs:` closure
16
84
  * @returns True when a download-artifact step is present before publication
17
85
  */
18
- export function promotesValidatedArtifact(job, publishStep) {
19
- return job.steps
20
- .slice(0, job.steps.indexOf(publishStep))
21
- .some(step => isPromotionAction(step.uses));
86
+ export function promotesValidatedArtifact(job, publishStep, ancestorJobs = []) {
87
+ const uploads = uploadedArtifactNames(ancestorJobs);
88
+ return job.steps.slice(0, job.steps.indexOf(publishStep)).some(step => {
89
+ if (!isPromotionAction(step.uses)) {
90
+ return false;
91
+ }
92
+ const downloadName = stepInput(step.inputs, "name");
93
+ return (downloadName === null || uploads.size === 0 || uploads.has(downloadName));
94
+ });
95
+ }
96
+ /**
97
+ * Whether a named artifact download disagrees with named ancestor uploads.
98
+ * @param job - The publishing job
99
+ * @param publishStep - The step that ships
100
+ * @param ancestorJobs - Jobs in the publishing job's `needs:` closure
101
+ * @returns True when the downloaded artifact name is not uploaded by any ancestor
102
+ */
103
+ export function hasArtifactNameMismatch(job, publishStep, ancestorJobs) {
104
+ const uploads = uploadedArtifactNames(ancestorJobs);
105
+ return job.steps.slice(0, job.steps.indexOf(publishStep)).some(step => {
106
+ if (!isPromotionAction(step.uses)) {
107
+ return false;
108
+ }
109
+ const downloadName = stepInput(step.inputs, "name");
110
+ return downloadName !== null && !uploads.has(downloadName);
111
+ });
112
+ }
113
+ /**
114
+ * The release job downloaded a named artifact different from anything a
115
+ * validating ancestor uploaded, so the shipped bytes are not the tested bytes.
116
+ * @param where - Evidence location label
117
+ * @returns The violation outcome
118
+ */
119
+ export function artifactNameMismatch(where) {
120
+ return {
121
+ kind: "violation",
122
+ evidence: `${where} downloads a named artifact that no validating ancestor uploads, ` +
123
+ "so the release path cannot prove the shipped artifact is the one CI tested",
124
+ };
22
125
  }
23
126
  /**
24
127
  * A downloaded artifact without linked validation is unestablished, not clean.
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-readiness-promoted-artifact.js","sourceRoot":"","sources":["../../src/cli/doctor-readiness-promoted-artifact.ts"],"names":[],"mappings":"AAUA,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAC5C,OAAO,QAAQ,KAAK,gBAAgB,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,GAAsB,EACtB,WAA+B;IAE/B,OAAO,GAAG,CAAC,KAAK;SACb,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACxC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa;IACtD,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,MAAM,EACJ,GAAG,KAAK,+BAA+B,gBAAgB,aAAa;YACpE,2EAA2E;YAC3E,uEAAuE;KAC1E,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"doctor-readiness-promoted-artifact.js","sourceRoot":"","sources":["../../src/cli/doctor-readiness-promoted-artifact.ts"],"names":[],"mappings":"AAUA,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAC5D,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAC5D,MAAM,qBAAqB,GAAG,6BAA6B,CAAC;AAC5D,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAC1D,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAEzD;;;;GAIG;AACH,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,CAAC,I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E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,GAAsB,EACtB,WAA+B,EAC/B,YAA0C;IAE1C,MAAM,OAAO,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;IACpD,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACpE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,YAAY,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,QAAQ,EACN,GAAG,KAAK,mEAAmE;YAC3E,4EAA4E;KAC/E,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa;IACtD,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,MAAM,EACJ,GAAG,KAAK,+BAA+B,gBAAgB,aAAa;YACpE,2EAA2E;YAC3E,uEAAuE;KAC1E,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-readiness-release-path.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-readiness-release-path.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AAYzC,OAAO,EAAE,gBAAgB,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AQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/B;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAW7D;AA4BD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,iBAAiB,GACrB,SAAS,kBAAkB,EAAE,CAE/B;AAmJD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,iBAAiB,EACtB,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,EACnC,YAAY,CAAC,EAAE,SAAS,cAAc,EAAE,GACvC,SAAS,kBAAkB,EAAE,CAuC/B"}
@@ -1,17 +1,8 @@
1
- import { ancestorJobs, reusableCallerValidation, } from "./doctor-readiness-reusable-callers.js";
2
- import { isPromotionAction, promotesValidatedArtifact, PROMOTION_ACTION, unresolvedPromotedArtifact, } from "./doctor-readiness-promoted-artifact.js";
1
+ import { ancestorJobs as ancestors, reusableCallerValidation, } from "./doctor-readiness-reusable-callers.js";
2
+ import { artifactNameMismatch, hasArtifactNameMismatch, isPublishAction, isPromotionAction, promotesValidatedArtifact, PROMOTION_ACTION, unresolvedPromotedArtifact, } from "./doctor-readiness-promoted-artifact.js";
3
3
  export { PROMOTION_ACTION } from "./doctor-readiness-promoted-artifact.js";
4
- const PUBLISH_VERBS = [
5
- "npm publish",
6
- "docker push",
7
- "gh release upload",
8
- "aws s3 sync",
9
- "cdk deploy",
10
- "eas submit",
11
- ];
4
+ const PUBLISH_VERB = /(npm publish|docker push|gh release upload|aws s3 sync|cdk deploy|eas submit)/;
12
5
  const DOCKER_BUILD_PUSH_ACTION = "docker/build-push-action";
13
- const PYPI_PUBLISH_ACTION = "pypa/gh-action-pypi-publish";
14
- const GITHUB_RELEASE_ACTION = "softprops/action-gh-release";
15
6
  /** Commands that actually run a test suite. */
16
7
  const VALIDATING_COMMANDS = [
17
8
  /\b(npm|yarn|pnpm|bun|npx|bunx)\s+(run\s+)?test\b/,
@@ -101,28 +92,6 @@ const DRY_RUN_FLAG = /--dry[-_]?run\b/;
101
92
  function actionId(uses) {
102
93
  return (uses.split("@")[0] ?? "").trim().toLowerCase();
103
94
  }
104
- /**
105
- * Whether a serialized `with:` block sets a boolean option to true.
106
- * @param inputs - Flattened step inputs
107
- * @param name - Input name to read
108
- * @returns True when the option is explicitly true
109
- */
110
- function hasTrueInput(inputs, name) {
111
- const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
112
- return new RegExp(`(^|\\n)${escaped}:\\s*['"]?true['"]?(\\s|$)`, "i").test(inputs);
113
- }
114
- /**
115
- * Whether an action step publishes something externally.
116
- * @param step - The step to classify
117
- * @returns True when the action is a known publishing action
118
- */
119
- function isPublishAction(step) {
120
- const id = actionId(step.uses);
121
- if (id === DOCKER_BUILD_PUSH_ACTION) {
122
- return hasTrueInput(step.inputs, "push");
123
- }
124
- return id === PYPI_PUBLISH_ACTION || id === GITHUB_RELEASE_ACTION;
125
- }
126
95
  /**
127
96
  * Whether a step actually puts an artifact in front of users. A `--dry-run`
128
97
  * invocation names a publish verb but ships nothing, so faulting its release
@@ -131,8 +100,7 @@ function isPublishAction(step) {
131
100
  * @returns True when the step really publishes
132
101
  */
133
102
  function isPublishStep(step) {
134
- return ((PUBLISH_VERBS.some(verb => step.run.includes(verb)) &&
135
- !DRY_RUN_FLAG.test(step.run)) ||
103
+ return ((PUBLISH_VERB.test(step.run) && !DRY_RUN_FLAG.test(step.run)) ||
136
104
  isPublishAction(step));
137
105
  }
138
106
  /**
@@ -169,7 +137,7 @@ function validationPrecedesPublish(workflow, job, publishStep, allWorkflows) {
169
137
  "validated") {
170
138
  return true;
171
139
  }
172
- if (ancestorJobs(workflow, job).some(isValidatingJob)) {
140
+ if (ancestors(workflow, job).some(isValidatingJob)) {
173
141
  return true;
174
142
  }
175
143
  return job.steps
@@ -260,16 +228,21 @@ function offlineUnresolvableTrigger(workflow, defaultBranches, allWorkflows) {
260
228
  export function assessReleasePaths(workflow, job, defaultBranches, allWorkflows) {
261
229
  return findPublishSteps(job).map(publishStep => {
262
230
  const where = `${workflow.file} job \`${job.id}\` step \`${describeStep(publishStep)}\``;
231
+ const validatingAncestors = ancestors(workflow, job).filter(isValidatingJob);
263
232
  const validated = validationPrecedesPublish(workflow, job, publishStep, allWorkflows);
264
233
  if (shipsSelfBuiltArtifact(job, publishStep)) {
265
234
  return validated
266
235
  ? rebuildPastValidation(where)
267
236
  : unvalidatedSelfBuild(where, workflow, defaultBranches, allWorkflows);
268
237
  }
238
+ if (validated &&
239
+ hasArtifactNameMismatch(job, publishStep, validatingAncestors)) {
240
+ return artifactNameMismatch(where);
241
+ }
269
242
  if (validated) {
270
243
  return { kind: "clean" };
271
244
  }
272
- if (promotesValidatedArtifact(job, publishStep))
245
+ if (promotesValidatedArtifact(job, publishStep, validatingAncestors))
273
246
  return unresolvedPromotedArtifact(where);
274
247
  // Neither built here nor promoted from CI, and nothing validating precedes it:
275
248
  // the link between what ships and what was validated is simply not observable