@diffci.com/diffci 0.3.16 → 0.3.18
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/dist-client/src/client/agent-selection.js +14 -4
- package/dist-client/src/client/cli.js +6 -1
- package/dist-client/src/client/gate-checks.js +120 -0
- package/dist-client/src/client/hook.js +9 -0
- package/dist-client/src/client/verify.js +30 -7
- package/node_modules/@diffci.com/core/dist/git/git-diff.js +6 -2
- package/node_modules/@diffci.com/core/dist/git/git-diff.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/check-narrowing.d.ts +45 -0
- package/node_modules/@diffci.com/core/dist/planner/check-narrowing.js +252 -0
- package/node_modules/@diffci.com/core/dist/planner/check-narrowing.js.map +1 -0
- package/node_modules/@diffci.com/core/dist/planner/pipeline-steps.d.ts +60 -0
- package/node_modules/@diffci.com/core/dist/planner/pipeline-steps.js +241 -0
- package/node_modules/@diffci.com/core/dist/planner/pipeline-steps.js.map +1 -0
- package/node_modules/@diffci.com/core/dist/planner/script-reads.d.ts +31 -0
- package/node_modules/@diffci.com/core/dist/planner/script-reads.js +197 -0
- package/node_modules/@diffci.com/core/dist/planner/script-reads.js.map +1 -0
- package/node_modules/@diffci.com/core/dist/planner/type-program.d.ts +33 -0
- package/node_modules/@diffci.com/core/dist/planner/type-program.js +106 -0
- package/node_modules/@diffci.com/core/dist/planner/type-program.js.map +1 -0
- package/node_modules/@diffci.com/core/dist/repo/file-references.d.ts +14 -2
- package/node_modules/@diffci.com/core/dist/repo/file-references.js +42 -1
- package/node_modules/@diffci.com/core/dist/repo/file-references.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/impact.d.ts +4 -0
- package/node_modules/@diffci.com/core/dist/repo/impact.js +34 -3
- package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/workflow-test-steps.js +23 -1
- package/node_modules/@diffci.com/core/dist/repo/workflow-test-steps.js.map +1 -1
- package/node_modules/@diffci.com/core/src/git/git-diff.ts +5 -2
- package/node_modules/@diffci.com/core/src/planner/check-narrowing.ts +269 -0
- package/node_modules/@diffci.com/core/src/planner/pipeline-steps.ts +243 -0
- package/node_modules/@diffci.com/core/src/planner/script-reads.ts +174 -0
- package/node_modules/@diffci.com/core/src/planner/type-program.ts +103 -0
- package/node_modules/@diffci.com/core/src/repo/file-references.ts +44 -2
- package/node_modules/@diffci.com/core/src/repo/impact.ts +31 -3
- package/node_modules/@diffci.com/core/src/repo/workflow-test-steps.ts +22 -1
- package/package.json +2 -2
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
/**
|
|
3
|
+
* Narrowing gate checks to a change (2026-10-29, docs/design/pipeline-impact.md, phase 1 slice 2).
|
|
4
|
+
*
|
|
5
|
+
* A per-file linter or formatter (`eslint "src/**\/*.ts"`, `prettier --check .`) judges each file on its
|
|
6
|
+
* own, so after a change it only needs the changed files it would have covered. When none of them is
|
|
7
|
+
* covered, it can be skipped.
|
|
8
|
+
*
|
|
9
|
+
* THE RULES, each failing toward running more:
|
|
10
|
+
*
|
|
11
|
+
* - Only `eslint` and `prettier --check` leaves whose every flag is known are touched. Anything else
|
|
12
|
+
* keeps its decision.
|
|
13
|
+
* - A change to the tool's configuration, an ignore file, a file the configuration names by a relative
|
|
14
|
+
* path, `package.json` or a lockfile runs the whole check.
|
|
15
|
+
* - ESLint rules that read other files make lint whole-program: type-aware parsing (`project`,
|
|
16
|
+
* `projectService`, `*TypeChecked` configs), import-plugin rules, boundary plugins, and any nested
|
|
17
|
+
* ESLint configuration (only the root one is read). Whole-program lint runs as written whenever a code
|
|
18
|
+
* file changed and is skipped only when none did. Lint that is only type-aware is skipped when no
|
|
19
|
+
* changed file is in the TypeScript program or the lint target (type-program.ts, slice 4).
|
|
20
|
+
* - `tsc` runs as written unless no changed file is in the project it checks (slice 4).
|
|
21
|
+
* - A deleted code file can break an import in a file that remains: ESLint then runs as written.
|
|
22
|
+
* - `--max-warnings` with a narrowed file list could fail on "file ignored" warnings for files the full
|
|
23
|
+
* run never lints, so it is never narrowed; it can still be skipped.
|
|
24
|
+
* - Paths that need shell quoting, or more than MAX_FILES files, run the whole check.
|
|
25
|
+
*
|
|
26
|
+
* RESIDUAL RISK. A shareable config that enables cross-file rules without any of the names above (a
|
|
27
|
+
* company preset wrapping eslint-plugin-import) is treated as per-file. Required CI stays authoritative.
|
|
28
|
+
*/
|
|
29
|
+
import { posix } from "node:path";
|
|
30
|
+
import { decideScriptCheck } from "./script-reads.js";
|
|
31
|
+
import { programMembership, tscProject } from "./type-program.js";
|
|
32
|
+
const MAX_FILES = 100;
|
|
33
|
+
const MAX_COMMAND = 6000;
|
|
34
|
+
const SAFE_PATH = /^[\w./@+-]+$/;
|
|
35
|
+
const CODE = /\.(?:[cm]?[jt]sx?|vue|svelte|astro|json5?|d\.ts)$/;
|
|
36
|
+
const LOCKFILE = /^(?:package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?)$/;
|
|
37
|
+
const ESLINT_CONFIG = /^(?:eslint\.config\.[cm]?[jt]s|\.eslintrc(?:\.(?:js|cjs|json|ya?ml))?|\.eslintignore)$/;
|
|
38
|
+
const PRETTIER_CONFIG = /^(?:\.prettierrc(?:\.(?:json5?|ya?ml|toml|[cm]?[jt]s))?|prettier\.config\.[cm]?[jt]s|\.prettierignore|\.editorconfig)$/;
|
|
39
|
+
const ESLINT_EXTENSIONS = ["js", "mjs", "cjs", "jsx", "ts", "tsx", "mts", "cts"];
|
|
40
|
+
const PRETTIER_EXTENSIONS = [...ESLINT_EXTENSIONS, "json", "json5", "css", "scss", "less", "md", "mdx", "yaml", "yml", "html", "vue", "graphql", "gql", "hbs", "handlebars"];
|
|
41
|
+
/** Configuration text that turns on rules reading files other than the one being linted: type-aware
|
|
42
|
+
* parsing reads the TypeScript program; import and boundary rules read whatever is imported. */
|
|
43
|
+
const TYPE_AWARE = /\bproject(?:Service)?\s*:|TypeChecked|type-checked/;
|
|
44
|
+
const IMPORT_RULES = /\bimport(?:-x)?\/|eslint-plugin-import|import-x|plugin:import|airbnb|boundaries|no-cycle/;
|
|
45
|
+
const TOOLS = {
|
|
46
|
+
eslint: {
|
|
47
|
+
name: "eslint",
|
|
48
|
+
valueFlags: new Set(["--cache-strategy", "--cache-location", "--max-warnings", "--ext", "-c", "--config", "-f", "--format", "--ignore-path", "-o", "--output-file"]),
|
|
49
|
+
booleanFlags: new Set(["--cache", "--quiet", "--fix", "--color", "--no-color", "--no-warn-ignored", "--no-error-on-unmatched-pattern", "--report-unused-disable-directives", "--pass-on-no-patterns"]),
|
|
50
|
+
configs: ESLINT_CONFIG,
|
|
51
|
+
extensions: ESLINT_EXTENSIONS,
|
|
52
|
+
},
|
|
53
|
+
prettier: {
|
|
54
|
+
name: "prettier",
|
|
55
|
+
valueFlags: new Set(["--config", "--ignore-path", "--log-level", "--cache-location", "--cache-strategy", "--end-of-line"]),
|
|
56
|
+
booleanFlags: new Set(["--check", "-c", "--list-different", "-l", "--cache", "--ignore-unknown", "-u", "--no-error-on-unmatched-pattern"]),
|
|
57
|
+
configs: PRETTIER_CONFIG,
|
|
58
|
+
extensions: PRETTIER_EXTENSIONS,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
function words(command) {
|
|
62
|
+
const out = [];
|
|
63
|
+
for (const match of command.trim().matchAll(/"([^"]*)"|'([^']*)'|(\S+)/g)) {
|
|
64
|
+
if (match[3] !== undefined && /["']/.test(match[3]))
|
|
65
|
+
return undefined;
|
|
66
|
+
out.push(match[0]);
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
const unquote = (word) => word.replace(/^(["'])(.*)\1$/, "$2");
|
|
71
|
+
function parseCommand(command) {
|
|
72
|
+
const all = words(command);
|
|
73
|
+
if (!all)
|
|
74
|
+
return undefined;
|
|
75
|
+
let index = 0;
|
|
76
|
+
if (all[index] === "npx") {
|
|
77
|
+
index++;
|
|
78
|
+
if (all[index] === "--no-install")
|
|
79
|
+
index++;
|
|
80
|
+
}
|
|
81
|
+
const name = all[index];
|
|
82
|
+
if (name !== "eslint" && name !== "prettier")
|
|
83
|
+
return undefined;
|
|
84
|
+
const tool = TOOLS[name];
|
|
85
|
+
const prefix = all.slice(0, ++index);
|
|
86
|
+
const values = new Map();
|
|
87
|
+
const targets = [];
|
|
88
|
+
for (; index < all.length; index++) {
|
|
89
|
+
const word = all[index];
|
|
90
|
+
if (word.startsWith("-")) {
|
|
91
|
+
if (targets.length)
|
|
92
|
+
return undefined;
|
|
93
|
+
const [flag, inline] = word.includes("=") ? [word.slice(0, word.indexOf("=")), word.slice(word.indexOf("=") + 1)] : [word, undefined];
|
|
94
|
+
if (tool.booleanFlags.has(flag)) {
|
|
95
|
+
prefix.push(word);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (!tool.valueFlags.has(flag))
|
|
99
|
+
return undefined;
|
|
100
|
+
const value = inline ?? all[++index];
|
|
101
|
+
if (value === undefined)
|
|
102
|
+
return undefined;
|
|
103
|
+
values.set(flag, unquote(value));
|
|
104
|
+
prefix.push(...(inline === undefined ? [word, value] : [word]));
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
targets.push(unquote(word));
|
|
108
|
+
}
|
|
109
|
+
if (targets.length === 0 || targets.some((target) => target.startsWith("!")))
|
|
110
|
+
return undefined;
|
|
111
|
+
if (tool.name === "prettier" && !["--check", "-c", "--list-different", "-l"].some((flag) => prefix.includes(flag)))
|
|
112
|
+
return undefined;
|
|
113
|
+
return { tool, prefix, targets, values };
|
|
114
|
+
}
|
|
115
|
+
function expandBraces(pattern) {
|
|
116
|
+
const match = /\{([^{}]*)\}/.exec(pattern);
|
|
117
|
+
if (!match)
|
|
118
|
+
return [pattern];
|
|
119
|
+
return match[1].split(",").flatMap((alternative) => expandBraces(pattern.slice(0, match.index) + alternative + pattern.slice(match.index + match[0].length)));
|
|
120
|
+
}
|
|
121
|
+
function globMatches(pattern, path) {
|
|
122
|
+
return expandBraces(pattern.replace(/^\.\//, "")).some((p) => {
|
|
123
|
+
const source = p.replace(/[.+^$()|[\]\\]/g, "\\$&")
|
|
124
|
+
.replace(/\*\*\//g, "\0A").replace(/\*\*/g, "\0B").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]")
|
|
125
|
+
.replace(/\0A/g, "(?:.*/)?").replace(/\0B/g, ".*");
|
|
126
|
+
return new RegExp(`^${source}$`).test(path);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function covers(target, path, extensions) {
|
|
130
|
+
if (/[*?{[]/.test(target))
|
|
131
|
+
return globMatches(target, path);
|
|
132
|
+
const normalized = posix.normalize(target).replace(/\/$/, "");
|
|
133
|
+
if (normalized === path)
|
|
134
|
+
return true;
|
|
135
|
+
const inside = normalized === "." || path.startsWith(`${normalized}/`);
|
|
136
|
+
return inside && extensions.includes(posix.extname(path).slice(1));
|
|
137
|
+
}
|
|
138
|
+
/** Root configuration files of the tool that exist, and the paths each one names relatively. */
|
|
139
|
+
function configReferences(tool, input, explicit) {
|
|
140
|
+
const candidates = explicit ? [posix.normalize(explicit)] : tool.name === "eslint"
|
|
141
|
+
? ["eslint.config.js", "eslint.config.mjs", "eslint.config.cjs", "eslint.config.ts", "eslint.config.mts", "eslint.config.cts", ".eslintrc.js", ".eslintrc.cjs", ".eslintrc.json", ".eslintrc.yaml", ".eslintrc.yml", ".eslintrc"]
|
|
142
|
+
: [];
|
|
143
|
+
const texts = [];
|
|
144
|
+
const referenced = [];
|
|
145
|
+
for (const path of candidates) {
|
|
146
|
+
const text = input.read(path);
|
|
147
|
+
if (text === undefined)
|
|
148
|
+
continue;
|
|
149
|
+
texts.push(text);
|
|
150
|
+
for (const match of text.matchAll(/["'`](\.{1,2}\/[^"'`\s]+)["'`]/g)) {
|
|
151
|
+
const ref = posix.normalize(posix.join(posix.dirname(path), match[1]));
|
|
152
|
+
// A local plugin's entry file imports its siblings, so its whole directory counts.
|
|
153
|
+
referenced.push(ref, ...(posix.extname(ref) && posix.dirname(ref) !== "." ? [posix.dirname(ref)] : []));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (tool.name === "eslint") {
|
|
157
|
+
const manifest = input.read("package.json");
|
|
158
|
+
try {
|
|
159
|
+
const embedded = manifest === undefined ? undefined : JSON.parse(manifest).eslintConfig;
|
|
160
|
+
if (embedded !== undefined)
|
|
161
|
+
texts.push(JSON.stringify(embedded));
|
|
162
|
+
}
|
|
163
|
+
catch { /* package.json changes already run the whole check */ }
|
|
164
|
+
}
|
|
165
|
+
return { texts, referenced };
|
|
166
|
+
}
|
|
167
|
+
function hasHooks(check, input) {
|
|
168
|
+
return check.runsScript && input.lifecycleHooks !== false
|
|
169
|
+
&& (input.scripts[`pre${check.script}`] !== undefined || input.scripts[`post${check.script}`] !== undefined);
|
|
170
|
+
}
|
|
171
|
+
/** `tsc` checks a whole program: it runs as written unless no changed file is in that program. */
|
|
172
|
+
function decideTypecheck(check, input, cache) {
|
|
173
|
+
if (!input.files || hasHooks(check, input))
|
|
174
|
+
return check;
|
|
175
|
+
const project = tscProject(check.command);
|
|
176
|
+
if (!project)
|
|
177
|
+
return check;
|
|
178
|
+
const membership = programMembership(project, input, cache);
|
|
179
|
+
return { ...check, decision: membership.inProgram ? "RUN" : "SKIP", reason: membership.reason };
|
|
180
|
+
}
|
|
181
|
+
function decide(check, input, cache) {
|
|
182
|
+
if (check.kind !== "lint" && check.kind !== "format")
|
|
183
|
+
return check;
|
|
184
|
+
if (hasHooks(check, input))
|
|
185
|
+
return check;
|
|
186
|
+
const parsed = parseCommand(check.command);
|
|
187
|
+
if (!parsed)
|
|
188
|
+
return check;
|
|
189
|
+
const { tool, prefix, targets, values } = parsed;
|
|
190
|
+
const run = (reason) => ({ ...check, decision: "RUN", reason });
|
|
191
|
+
const skip = (reason) => ({ ...check, decision: "SKIP", reason });
|
|
192
|
+
const explicitConfig = values.get("-c") ?? values.get("--config");
|
|
193
|
+
const ignorePath = values.get("--ignore-path");
|
|
194
|
+
const { texts, referenced } = configReferences(tool, input, explicitConfig);
|
|
195
|
+
const configChange = input.changes.find(({ path }) => {
|
|
196
|
+
const base = posix.basename(path);
|
|
197
|
+
return tool.configs.test(base) || LOCKFILE.test(base) || path === "package.json"
|
|
198
|
+
|| path === explicitConfig || path === ignorePath || (tool.name === "eslint" && base === ".gitignore")
|
|
199
|
+
|| referenced.some((ref) => path === ref || path.startsWith(`${ref}/`) || path.startsWith(`${ref}.`));
|
|
200
|
+
});
|
|
201
|
+
if (configChange)
|
|
202
|
+
return run(`${configChange.path} changed: runs the whole ${tool.name} check`);
|
|
203
|
+
const extensions = tool.name === "eslint" && values.has("--ext")
|
|
204
|
+
? [...ESLINT_EXTENSIONS, ...values.get("--ext").split(",").map((ext) => ext.replace(/^\./, ""))]
|
|
205
|
+
: tool.extensions;
|
|
206
|
+
if (tool.name === "eslint") {
|
|
207
|
+
const nested = input.files?.find((path) => path.includes("/") && ESLINT_CONFIG.test(posix.basename(path)) && !posix.basename(path).endsWith("ignore"));
|
|
208
|
+
const importRules = texts.some((text) => IMPORT_RULES.test(text));
|
|
209
|
+
const typeAware = texts.some((text) => TYPE_AWARE.test(text));
|
|
210
|
+
if (!nested && texts.length > 0 && !importRules && typeAware && input.files) {
|
|
211
|
+
// Type-aware rules read the TypeScript program (slice 4): outside it, and outside the lint target,
|
|
212
|
+
// a change cannot alter the result. `project: "x.json"` names the program; otherwise the root one.
|
|
213
|
+
const named = [...new Set(texts.flatMap((text) => [...text.matchAll(/\bproject\s*:\s*["']([^"']+\.json)["']/g)].map((m) => posix.normalize(m[1]))))];
|
|
214
|
+
const membership = named.length > 1 ? undefined : programMembership(named[0] ?? "tsconfig.json", input, cache);
|
|
215
|
+
const linted = input.changes.find(({ path, status }) => status !== "deleted" && targets.some((target) => covers(target, path, extensions)));
|
|
216
|
+
if (membership && !membership.inProgram && !linted)
|
|
217
|
+
return skip(`type-aware ESLint rules, but ${membership.reason}`);
|
|
218
|
+
return run(`type-aware ESLint rules lint the whole target: ${membership?.reason ?? "several projects are named"}`);
|
|
219
|
+
}
|
|
220
|
+
const crossFile = nested !== undefined || texts.length === 0 || importRules || typeAware;
|
|
221
|
+
if (crossFile) {
|
|
222
|
+
const why = nested ? `nested ESLint config ${nested}` : texts.length === 0 ? "no root ESLint config found" : "type-aware or cross-file ESLint rules";
|
|
223
|
+
const code = input.changes.find(({ path }) => CODE.test(path));
|
|
224
|
+
return code ? run(`${why}: lints the whole target because ${code.path} changed`) : skip(`${why}, but no code file changed`);
|
|
225
|
+
}
|
|
226
|
+
const deleted = input.changes.find(({ path, status }) => status === "deleted" && CODE.test(path));
|
|
227
|
+
if (deleted)
|
|
228
|
+
return run(`${deleted.path} was deleted: an import of it may break in a file that remains`);
|
|
229
|
+
}
|
|
230
|
+
const files = input.changes.filter(({ path, status }) => status !== "deleted" && targets.some((target) => covers(target, path, extensions))).map(({ path }) => path);
|
|
231
|
+
if (files.length === 0)
|
|
232
|
+
return skip(`no changed file is in ${targets.join(" ")}`);
|
|
233
|
+
if (tool.name === "eslint" && values.has("--max-warnings"))
|
|
234
|
+
return run("--max-warnings: a narrowed file list could warn about files the full run ignores");
|
|
235
|
+
if (files.length > MAX_FILES || files.some((path) => !SAFE_PATH.test(path)))
|
|
236
|
+
return run(`${files.length} changed file(s) in the target; runs the whole check`);
|
|
237
|
+
const command = [...prefix, ...files].join(" ");
|
|
238
|
+
if (command.length > MAX_COMMAND)
|
|
239
|
+
return run("the narrowed command would be too long; runs the whole check");
|
|
240
|
+
return { ...check, runsScript: false, command, decision: "NARROWED", reason: `${files.length} changed file(s) in ${targets.join(" ")}` };
|
|
241
|
+
}
|
|
242
|
+
/** Narrows or skips each lint and format check, and runs or skips each repository-script check
|
|
243
|
+
* (script-reads.ts), for this change; other checks are returned unchanged. */
|
|
244
|
+
export function narrowGateChecks(checks, input) {
|
|
245
|
+
// A whole-script leaf's command is the script body, so the same parse applies; a RUN keeps running the
|
|
246
|
+
// script as written.
|
|
247
|
+
const cache = new Map();
|
|
248
|
+
return checks.map((check) => check.kind === "script" ? decideScriptCheck(check, input)
|
|
249
|
+
: check.kind === "typecheck" ? decideTypecheck(check, input, cache)
|
|
250
|
+
: decide(check, input, cache));
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=check-narrowing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-narrowing.js","sourceRoot":"","sources":["../../src/planner/check-narrowing.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAsB,MAAM,mBAAmB,CAAC;AAkBtF,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,IAAI,GAAG,mDAAmD,CAAC;AACjE,MAAM,QAAQ,GAAG,sFAAsF,CAAC;AAExG,MAAM,aAAa,GAAG,wFAAwF,CAAC;AAC/G,MAAM,eAAe,GAAG,wHAAwH,CAAC;AACjJ,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACjF,MAAM,mBAAmB,GAAG,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;AAC7K;gGACgG;AAChG,MAA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 slice 1).
|
|
3
|
+
*
|
|
4
|
+
* WHY. On one dogfood repository 104 pushes passed whatever the agent ran locally and then failed the
|
|
5
|
+
* gate (`npm run check`: typecheck, lint, an architecture-boundary script, ...) after push. Agents ran the
|
|
6
|
+
* tests DiffCI selected, or `tsc`, and never the rest. Test selection cannot catch those failures because
|
|
7
|
+
* they are not tests. This module names every leaf of the gate so verification can run them.
|
|
8
|
+
*
|
|
9
|
+
* THE RULE. The gate is the `check` script, else `validate`, else the conventional typecheck, lint and
|
|
10
|
+
* format scripts that exist; plus every check-named script (`check*`, `lint*`, `typecheck`, `validate*`)
|
|
11
|
+
* a CI workflow step runs. In the dogfood repository the architecture rule behind one of the 104 failures
|
|
12
|
+
* runs in `validate:release`, which a deploy workflow calls and `check` does not. A gate script is expanded into leaves: `a && b` and `a ; b` parts, `npm run x`
|
|
13
|
+
* (with x's pre/post hooks), `run-p`/`run-s`/`npm-run-all` script lists and globs, `concurrently` with
|
|
14
|
+
* `npm:x` or quoted commands, and a repository runner whose every argument is a script name
|
|
15
|
+
* (`node scripts/run-parallel.mjs lint:a check:b`).
|
|
16
|
+
*
|
|
17
|
+
* FAILING CLOSED. A script whose body cannot be split safely (`||`, pipes, redirects, subshells, variables,
|
|
18
|
+
* environment assignments, unknown arguments) stays one leaf, run as `npm run <script>`, so it runs exactly
|
|
19
|
+
* as the gate would. Leaves that run a test runner are left to test selection. Every leaf discovered here is
|
|
20
|
+
* RUN; check-narrowing.ts narrows or skips some of them for a given change.
|
|
21
|
+
*/
|
|
22
|
+
export type GateCheckKind = "typecheck" | "lint" | "format" | "script" | "unknown";
|
|
23
|
+
export interface GateCheck {
|
|
24
|
+
/** The script name when the leaf is a whole script, `script[n]` for the n-th part of one. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** The package script the leaf belongs to. */
|
|
27
|
+
script: string;
|
|
28
|
+
/** True: run the whole script (`npm run <script>`, which also runs its hooks). False: `command` is one
|
|
29
|
+
* part of the script's body, run on its own. */
|
|
30
|
+
runsScript: boolean;
|
|
31
|
+
/** The leaf as written: the script body when `runsScript`, otherwise the part. A NARROWED check's
|
|
32
|
+
* command is the narrowed one. */
|
|
33
|
+
command: string;
|
|
34
|
+
kind: GateCheckKind;
|
|
35
|
+
/** RUN as written, NARROWED to the changed files (`command` rewritten), or SKIP for this change. */
|
|
36
|
+
decision: "RUN" | "NARROWED" | "SKIP";
|
|
37
|
+
reason: string;
|
|
38
|
+
}
|
|
39
|
+
export interface GateDiscovery {
|
|
40
|
+
/** The scripts the gate was read from, in order. Empty when the repository declares none. */
|
|
41
|
+
roots: string[];
|
|
42
|
+
checks: GateCheck[];
|
|
43
|
+
/** Leaves that run a test runner; test selection covers them. */
|
|
44
|
+
coveredByTests: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check-named package scripts that GitHub Actions steps run, in workflow order. Disabled jobs (`if: false`)
|
|
48
|
+
* and workflows that do not parse contribute nothing: these only add checks, so missing one is the
|
|
49
|
+
* pre-existing behaviour rather than a wrong skip.
|
|
50
|
+
*/
|
|
51
|
+
export declare function workflowGateScripts(workflowTexts: readonly string[], scripts: Readonly<Record<string, string>>): string[];
|
|
52
|
+
export interface GateDiscoveryOptions {
|
|
53
|
+
/** Further gate scripts, such as `workflowGateScripts`; expanded after the package's own gate. */
|
|
54
|
+
workflowScripts?: readonly string[];
|
|
55
|
+
/** Whether the package manager runs `pre<name>`/`post<name>` scripts (npm and Yarn 1 do; pnpm does
|
|
56
|
+
* not by default). Default true. */
|
|
57
|
+
lifecycleHooks?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** Finds the gate's scripts and expands them into leaf checks. Reads nothing but `scripts`. */
|
|
60
|
+
export declare function discoverGateChecks(scripts: Readonly<Record<string, string>>, options?: GateDiscoveryOptions): GateDiscovery;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
/**
|
|
3
|
+
* The repository's gate as a list of checks (2026-10-29, docs/design/pipeline-impact.md, phase 1 slice 1).
|
|
4
|
+
*
|
|
5
|
+
* WHY. On one dogfood repository 104 pushes passed whatever the agent ran locally and then failed the
|
|
6
|
+
* gate (`npm run check`: typecheck, lint, an architecture-boundary script, ...) after push. Agents ran the
|
|
7
|
+
* tests DiffCI selected, or `tsc`, and never the rest. Test selection cannot catch those failures because
|
|
8
|
+
* they are not tests. This module names every leaf of the gate so verification can run them.
|
|
9
|
+
*
|
|
10
|
+
* THE RULE. The gate is the `check` script, else `validate`, else the conventional typecheck, lint and
|
|
11
|
+
* format scripts that exist; plus every check-named script (`check*`, `lint*`, `typecheck`, `validate*`)
|
|
12
|
+
* a CI workflow step runs. In the dogfood repository the architecture rule behind one of the 104 failures
|
|
13
|
+
* runs in `validate:release`, which a deploy workflow calls and `check` does not. A gate script is expanded into leaves: `a && b` and `a ; b` parts, `npm run x`
|
|
14
|
+
* (with x's pre/post hooks), `run-p`/`run-s`/`npm-run-all` script lists and globs, `concurrently` with
|
|
15
|
+
* `npm:x` or quoted commands, and a repository runner whose every argument is a script name
|
|
16
|
+
* (`node scripts/run-parallel.mjs lint:a check:b`).
|
|
17
|
+
*
|
|
18
|
+
* FAILING CLOSED. A script whose body cannot be split safely (`||`, pipes, redirects, subshells, variables,
|
|
19
|
+
* environment assignments, unknown arguments) stays one leaf, run as `npm run <script>`, so it runs exactly
|
|
20
|
+
* as the gate would. Leaves that run a test runner are left to test selection. Every leaf discovered here is
|
|
21
|
+
* RUN; check-narrowing.ts narrows or skips some of them for a given change.
|
|
22
|
+
*/
|
|
23
|
+
import { parse } from "yaml";
|
|
24
|
+
const GATE_FALLBACK_ROOTS = ["typecheck", "type-check", "types", "tsc", "lint", "format:check", "prettier:check", "fmt:check"];
|
|
25
|
+
const MAX_DEPTH = 10;
|
|
26
|
+
/** Workflow-run scripts that are checks by name. Anything else a workflow runs (build, deploy, release,
|
|
27
|
+
* migrations) is never run locally on the strength of a workflow naming it. */
|
|
28
|
+
const CHECK_NAME = /^(?:check|checks|lint|typecheck|type-check|types|tsc|validate|format:check|prettier:check|fmt:check)(?::[\w:.-]+)?$/;
|
|
29
|
+
const WORKFLOW_SCRIPT = /\b(?:npm|pnpm|yarn|bun)\s+(?:run(?:-script)?\s+)?([\w:.-]+)/g;
|
|
30
|
+
const SCRIPT_RUN = /^(npm|pnpm|yarn|bun)\s+(?:(?:run|run-script)\s+)?([\w:.@/-]+)$/;
|
|
31
|
+
const NPM_BUILTINS = new Set(["test", "start", "stop", "restart"]);
|
|
32
|
+
const RUN_ALL = /^(?:npx\s+(?:--no-install\s+)?)?(?:run-p|run-s|npm-run-all2?)\b(.*)$/;
|
|
33
|
+
const CONCURRENTLY = /^(?:npx\s+(?:--no-install\s+)?)?concurrently\b(.*)$/;
|
|
34
|
+
const REPO_RUNNER = /^(?:node|tsx|bun)\s+(\.{0,2}\/?[\w./-]+\.(?:m?[jt]s|c[jt]s))((?:\s+[\w:.@/-]+)+)$/;
|
|
35
|
+
/** Shell syntax whose meaning changes when the script is split into parts or run outside its shell. */
|
|
36
|
+
const UNSPLITTABLE = /\|\||[|<>`$()\\]|^\s*\w+=|\s\w+=\S/;
|
|
37
|
+
const TEST_RUNNER = /(?:^|[\s/])(?:vitest|jest|mocha|ava|tap|playwright|cypress|karma|jasmine)(?:\s|$)|(?:node|tsx|bun|deno)(?:\s+--?[\w-]+(?:=\S+)?)*\s+--test\b|^(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?test(?:\s|$)/;
|
|
38
|
+
function kindOf(command) {
|
|
39
|
+
if (/(?:^|[\s/])(?:tsc|vue-tsc|svelte-check|tsgo)(?:\s|$)/.test(command))
|
|
40
|
+
return "typecheck";
|
|
41
|
+
if (/(?:^|[\s/])prettier\b.*--(?:check|list-different)\b|(?:^|[\s/])(?:biome|dprint)\s+(?:format|check)\b/.test(command))
|
|
42
|
+
return "format";
|
|
43
|
+
if (/(?:^|[\s/])(?:eslint|biome|oxlint|stylelint|xo|standard|markdownlint(?:-cli2)?)(?:\s|$)/.test(command))
|
|
44
|
+
return "lint";
|
|
45
|
+
if (/^(?:node|tsx|ts-node|bun|deno\s+run|python3?|bash|sh)\s+\S/.test(command))
|
|
46
|
+
return "script";
|
|
47
|
+
return "unknown";
|
|
48
|
+
}
|
|
49
|
+
/** Splits on top-level `&&` and `;`. Undefined when the body needs its shell (see UNSPLITTABLE). */
|
|
50
|
+
function splitParts(body) {
|
|
51
|
+
const parts = [];
|
|
52
|
+
let current = "";
|
|
53
|
+
let quote;
|
|
54
|
+
for (let i = 0; i < body.length; i++) {
|
|
55
|
+
const char = body[i];
|
|
56
|
+
if (quote) {
|
|
57
|
+
if (char === quote)
|
|
58
|
+
quote = undefined;
|
|
59
|
+
current += char;
|
|
60
|
+
}
|
|
61
|
+
else if (char === "'" || char === "\"") {
|
|
62
|
+
quote = char;
|
|
63
|
+
current += char;
|
|
64
|
+
}
|
|
65
|
+
else if (char === ";" || (char === "&" && body[i + 1] === "&")) {
|
|
66
|
+
parts.push(current.trim());
|
|
67
|
+
current = "";
|
|
68
|
+
if (char === "&")
|
|
69
|
+
i++;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
if (char === "&")
|
|
73
|
+
return undefined;
|
|
74
|
+
current += char;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (quote)
|
|
78
|
+
return undefined;
|
|
79
|
+
parts.push(current.trim());
|
|
80
|
+
const unquoted = parts.map((part) => part.replace(/"[^"]*"|'[^']*'/g, "\"\""));
|
|
81
|
+
// A double-quoted `$` or backtick still expands in the shell.
|
|
82
|
+
if (parts.some((part) => !part || /"[^"]*[$`][^"]*"/.test(part)) || unquoted.some((part) => UNSPLITTABLE.test(part)))
|
|
83
|
+
return undefined;
|
|
84
|
+
return parts;
|
|
85
|
+
}
|
|
86
|
+
function globToRegExp(pattern) {
|
|
87
|
+
return new RegExp(`^${pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, ".*").replace(/\*/g, "[^:]*")}$`);
|
|
88
|
+
}
|
|
89
|
+
/** Script names a part runs, or undefined when the part is not only a list of scripts. */
|
|
90
|
+
function scriptsRunBy(part, scripts) {
|
|
91
|
+
const direct = SCRIPT_RUN.exec(part);
|
|
92
|
+
if (direct) {
|
|
93
|
+
const [, manager, name] = direct;
|
|
94
|
+
if (manager === "npm" && !/\brun(?:-script)?\s/.test(part) && !NPM_BUILTINS.has(name))
|
|
95
|
+
return undefined;
|
|
96
|
+
return scripts[name] !== undefined ? [name] : undefined;
|
|
97
|
+
}
|
|
98
|
+
const runAll = RUN_ALL.exec(part);
|
|
99
|
+
if (runAll) {
|
|
100
|
+
const names = [];
|
|
101
|
+
for (const word of runAll[1].trim().split(/\s+/).filter(Boolean)) {
|
|
102
|
+
if (/^-(?:p|s|l|c|-parallel|-sequential|-serial|-print-label|-continue-on-error|-print-name|-silent)$/.test(word))
|
|
103
|
+
continue;
|
|
104
|
+
const pattern = word.replace(/^["']|["']$/g, "");
|
|
105
|
+
if (pattern.startsWith("-"))
|
|
106
|
+
return undefined;
|
|
107
|
+
const matched = /[*]/.test(pattern) ? Object.keys(scripts).filter((name) => globToRegExp(pattern).test(name)) : scripts[pattern] !== undefined ? [pattern] : [];
|
|
108
|
+
if (matched.length === 0)
|
|
109
|
+
return undefined;
|
|
110
|
+
names.push(...matched);
|
|
111
|
+
}
|
|
112
|
+
return names.length ? names : undefined;
|
|
113
|
+
}
|
|
114
|
+
const runner = REPO_RUNNER.exec(part);
|
|
115
|
+
if (runner) {
|
|
116
|
+
const names = runner[2].trim().split(/\s+/);
|
|
117
|
+
return names.every((name) => scripts[name] !== undefined) ? names : undefined;
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
/** `concurrently "npm:a" "eslint ."`: the quoted commands, or undefined when any argument is not one. */
|
|
122
|
+
function concurrentlyParts(part) {
|
|
123
|
+
const match = CONCURRENTLY.exec(part);
|
|
124
|
+
if (!match)
|
|
125
|
+
return undefined;
|
|
126
|
+
const args = match[1].trim();
|
|
127
|
+
const commands = [...args.matchAll(/"([^"]*)"|'([^']*)'/g)].map((m) => (m[1] ?? m[2] ?? "").trim());
|
|
128
|
+
const rest = args.replace(/"[^"]*"|'[^']*'/g, "").trim();
|
|
129
|
+
if (rest || commands.length === 0 || commands.some((command) => !command))
|
|
130
|
+
return undefined;
|
|
131
|
+
return commands.map((command) => (command.startsWith("npm:") ? `npm run ${command.slice(4)}` : command));
|
|
132
|
+
}
|
|
133
|
+
/** A leaf that only runs a test runner. A body that mixes tests with other work stays a check. */
|
|
134
|
+
function onlyRunsTests(command) {
|
|
135
|
+
const parts = splitParts(command);
|
|
136
|
+
return parts?.length === 1 && TEST_RUNNER.test(parts[0]);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Check-named package scripts that GitHub Actions steps run, in workflow order. Disabled jobs (`if: false`)
|
|
140
|
+
* and workflows that do not parse contribute nothing: these only add checks, so missing one is the
|
|
141
|
+
* pre-existing behaviour rather than a wrong skip.
|
|
142
|
+
*/
|
|
143
|
+
export function workflowGateScripts(workflowTexts, scripts) {
|
|
144
|
+
const names = [];
|
|
145
|
+
for (const text of workflowTexts) {
|
|
146
|
+
let jobs;
|
|
147
|
+
try {
|
|
148
|
+
jobs = parse(text)?.jobs;
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (!jobs || typeof jobs !== "object")
|
|
154
|
+
continue;
|
|
155
|
+
for (const job of Object.values(jobs)) {
|
|
156
|
+
if (!job || typeof job !== "object")
|
|
157
|
+
continue;
|
|
158
|
+
const { steps, if: condition } = job;
|
|
159
|
+
if (condition === false || (typeof condition === "string" && /^\s*(?:\$\{\{\s*)?false(?:\s*\}\})?\s*$/.test(condition)))
|
|
160
|
+
continue;
|
|
161
|
+
if (!Array.isArray(steps))
|
|
162
|
+
continue;
|
|
163
|
+
for (const step of steps) {
|
|
164
|
+
const run = step?.run;
|
|
165
|
+
if (typeof run !== "string")
|
|
166
|
+
continue;
|
|
167
|
+
for (const match of run.matchAll(WORKFLOW_SCRIPT)) {
|
|
168
|
+
const name = match[1];
|
|
169
|
+
if (CHECK_NAME.test(name) && scripts[name] !== undefined && !names.includes(name))
|
|
170
|
+
names.push(name);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return names;
|
|
176
|
+
}
|
|
177
|
+
/** Finds the gate's scripts and expands them into leaf checks. Reads nothing but `scripts`. */
|
|
178
|
+
export function discoverGateChecks(scripts, options = {}) {
|
|
179
|
+
const hooks = options.lifecycleHooks !== false;
|
|
180
|
+
const packageRoots = scripts["check"] !== undefined ? ["check"]
|
|
181
|
+
: scripts["validate"] !== undefined ? ["validate"]
|
|
182
|
+
: GATE_FALLBACK_ROOTS.filter((name) => scripts[name] !== undefined);
|
|
183
|
+
const roots = [...packageRoots, ...(options.workflowScripts ?? []).filter((name) => scripts[name] !== undefined && !packageRoots.includes(name))];
|
|
184
|
+
const checks = [];
|
|
185
|
+
const coveredByTests = [];
|
|
186
|
+
const seen = new Set();
|
|
187
|
+
const add = (check) => {
|
|
188
|
+
if (seen.has(check.id))
|
|
189
|
+
return;
|
|
190
|
+
seen.add(check.id);
|
|
191
|
+
if (onlyRunsTests(check.command)) {
|
|
192
|
+
coveredByTests.push(check.id);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
checks.push({ ...check, kind: kindOf(check.command), decision: "RUN", reason: `${check.reason}; always run (not yet narrowed)` });
|
|
196
|
+
};
|
|
197
|
+
const whole = (script, reason) => add({ id: script, script, runsScript: true, command: scripts[script], reason });
|
|
198
|
+
const expand = (script, stack, reason) => {
|
|
199
|
+
if (stack.includes(script) || stack.length >= MAX_DEPTH) {
|
|
200
|
+
whole(script, reason);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const body = scripts[script];
|
|
204
|
+
const parts = splitParts(body);
|
|
205
|
+
const inner = parts?.map((part) => ({ part, names: scriptsRunBy(part, scripts), concurrent: concurrentlyParts(part) }));
|
|
206
|
+
const reducible = inner && (inner.length > 1 || inner.some((p) => p.names || p.concurrent));
|
|
207
|
+
if (!reducible) {
|
|
208
|
+
whole(script, reason);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const next = [...stack, script];
|
|
212
|
+
if (hooks && scripts[`pre${script}`] !== undefined)
|
|
213
|
+
expand(`pre${script}`, next, `runs before ${script}`);
|
|
214
|
+
inner.forEach(({ part, names, concurrent }, index) => {
|
|
215
|
+
if (names) {
|
|
216
|
+
for (const name of names)
|
|
217
|
+
expand(name, next, `run by ${script}`);
|
|
218
|
+
}
|
|
219
|
+
else if (concurrent) {
|
|
220
|
+
concurrent.forEach((command, n) => {
|
|
221
|
+
const named = scriptsRunBy(command, scripts);
|
|
222
|
+
if (named)
|
|
223
|
+
for (const name of named)
|
|
224
|
+
expand(name, next, `run by ${script}`);
|
|
225
|
+
else
|
|
226
|
+
add({ id: `${script}[${index + 1}.${n + 1}]`, script, runsScript: false, command, reason: `part of ${script}` });
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
add({ id: `${script}[${index + 1}]`, script, runsScript: false, command: part, reason: `part of ${script}` });
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
if (hooks && scripts[`post${script}`] !== undefined)
|
|
234
|
+
expand(`post${script}`, next, `runs after ${script}`);
|
|
235
|
+
};
|
|
236
|
+
for (const root of roots) {
|
|
237
|
+
expand(root, [], !packageRoots.includes(root) ? `${root}, run by a CI workflow` : GATE_FALLBACK_ROOTS.includes(root) ? "a conventional gate script" : `the ${root} gate`);
|
|
238
|
+
}
|
|
239
|
+
return { roots, checks, coveredByTests };
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=pipeline-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-steps.js","sourceRoot":"","sources":["../../src/planner/pipeline-steps.ts"],"names":[],"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CAAC,CAAC,CAAC;QACH,IAAI,KAAK,IAAI,OAAO,CAAC,OAAO,MAAM,EAAE,CAAC,KAAK,SAAS;YAAE,MAAM,CAAC,OAAO,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,MAAM,EAAE,CAAC,CAAC;IAC7G,CAAC,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,wBAAwB,CAAC,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;IAC5K,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which paths does a repository check script read? (2026-10-29, docs/design/pipeline-impact.md, phase 1
|
|
3
|
+
* slice 3.)
|
|
4
|
+
*
|
|
5
|
+
* This is the inverse of the reference resolver (`src/repo/file-references.ts`): there the question is
|
|
6
|
+
* "which files name the changed path", here it is "which paths does this check name". Dogfood check
|
|
7
|
+
* scripts name what they walk: `sourceFiles(path.join(root, "src"))`, `join(root,
|
|
8
|
+
* "ops/cloudflare/d1-migrations")`, `readFileSync(join(root, "package.json"))`. A script that names `src`
|
|
9
|
+
* reads everything under `src/`; a change elsewhere cannot change its result.
|
|
10
|
+
*
|
|
11
|
+
* THE RULE. The script's closure is the script file plus every relative module it imports, transitively.
|
|
12
|
+
* Its reads are every string literal in the closure, and every argument on its command line, that is a
|
|
13
|
+
* tracked file or directory (relative to the repository root or to the module's directory), plus the
|
|
14
|
+
* static prefix of each template literal. The check runs when a changed path:
|
|
15
|
+
*
|
|
16
|
+
* - is in the closure (the check's own code changed);
|
|
17
|
+
* - is, or is under, a path the closure names; or has a basename the closure names (`"index.ts"`);
|
|
18
|
+
* - is package.json or a lockfile and the closure imports a package or names package.json.
|
|
19
|
+
*
|
|
20
|
+
* FAILING CLOSED. The check runs as written, for any change, when its reads cannot be bounded: it runs
|
|
21
|
+
* another program (child_process), walks the repository root or the working directory, uses a glob that
|
|
22
|
+
* starts at the root, reads a path from the environment, its closure cannot be read or is too large, or the
|
|
23
|
+
* command is not `node`/`tsx`/`bun` running one JavaScript or TypeScript file.
|
|
24
|
+
*
|
|
25
|
+
* RESIDUAL RISK. A path assembled from parts that never appear as literals (`["s", "rc"].join("")`) is not
|
|
26
|
+
* seen, as in the reference resolver. Required CI stays authoritative.
|
|
27
|
+
*/
|
|
28
|
+
import type { NarrowingInput } from "./check-narrowing.js";
|
|
29
|
+
import type { GateCheck } from "./pipeline-steps.js";
|
|
30
|
+
/** RUN or SKIP for a check that runs one repository script; other checks are returned unchanged. */
|
|
31
|
+
export declare function decideScriptCheck(check: GateCheck, input: NarrowingInput): GateCheck;
|