@diffci.com/diffci 0.3.55 → 0.3.56

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 (51) hide show
  1. package/dist-client/src/client/cli.js +4 -3
  2. package/dist-client/src/client/context.d.ts +2 -0
  3. package/dist-client/src/client/context.js +19 -0
  4. package/dist-client/src/client/full-command.js +5 -2
  5. package/dist-client/src/client/gate.js +24 -10
  6. package/dist-client/src/client/job-summary.d.ts +1 -1
  7. package/dist-client/src/client/job-summary.js +2 -1
  8. package/dist-client/src/client/observe.js +1 -1
  9. package/dist-client/src/client/report.d.ts +7 -0
  10. package/dist-client/src/client/report.js +11 -0
  11. package/dist-client/src/client/workflow-guard.js +27 -6
  12. package/dist-client/src/client/workflow-templates.d.ts +11 -1
  13. package/dist-client/src/client/workflow-templates.js +43 -2
  14. package/node_modules/@diffci.com/core/README.md +4 -4
  15. package/node_modules/@diffci.com/core/dist/ci-inference/resolve.js +20 -2
  16. package/node_modules/@diffci.com/core/dist/ci-inference/resolve.js.map +1 -1
  17. package/node_modules/@diffci.com/core/dist/git/git-diff.js +43 -12
  18. package/node_modules/@diffci.com/core/dist/git/git-diff.js.map +1 -1
  19. package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js +51 -8
  20. package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js.map +1 -1
  21. package/node_modules/@diffci.com/core/dist/repo/adapters/python.js +111 -14
  22. package/node_modules/@diffci.com/core/dist/repo/adapters/python.js.map +1 -1
  23. package/node_modules/@diffci.com/core/dist/repo/adapters/rust-invocation.d.ts +3 -1
  24. package/node_modules/@diffci.com/core/dist/repo/adapters/rust-invocation.js +44 -6
  25. package/node_modules/@diffci.com/core/dist/repo/adapters/rust-invocation.js.map +1 -1
  26. package/node_modules/@diffci.com/core/dist/repo/adapters/rust.js +158 -9
  27. package/node_modules/@diffci.com/core/dist/repo/adapters/rust.js.map +1 -1
  28. package/node_modules/@diffci.com/core/dist/repo/adapters/types.d.ts +3 -0
  29. package/node_modules/@diffci.com/core/dist/repo/adapters/types.js.map +1 -1
  30. package/node_modules/@diffci.com/core/dist/repo/graph.js +1 -1
  31. package/node_modules/@diffci.com/core/dist/repo/graph.js.map +1 -1
  32. package/node_modules/@diffci.com/core/dist/repo/impact.js +1 -1
  33. package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
  34. package/node_modules/@diffci.com/core/dist/repo/yarn-berry-lockfile.d.ts +11 -0
  35. package/node_modules/@diffci.com/core/dist/repo/yarn-berry-lockfile.js +208 -0
  36. package/node_modules/@diffci.com/core/dist/repo/yarn-berry-lockfile.js.map +1 -0
  37. package/node_modules/@diffci.com/core/dist/repo/yarn-lockfile.d.ts +3 -0
  38. package/node_modules/@diffci.com/core/dist/repo/yarn-lockfile.js +2 -2
  39. package/node_modules/@diffci.com/core/dist/repo/yarn-lockfile.js.map +1 -1
  40. package/node_modules/@diffci.com/core/src/ci-inference/resolve.ts +20 -2
  41. package/node_modules/@diffci.com/core/src/git/git-diff.ts +38 -12
  42. package/node_modules/@diffci.com/core/src/repo/adapters/maven.ts +55 -8
  43. package/node_modules/@diffci.com/core/src/repo/adapters/python.ts +86 -14
  44. package/node_modules/@diffci.com/core/src/repo/adapters/rust-invocation.ts +44 -6
  45. package/node_modules/@diffci.com/core/src/repo/adapters/rust.ts +129 -9
  46. package/node_modules/@diffci.com/core/src/repo/adapters/types.ts +3 -0
  47. package/node_modules/@diffci.com/core/src/repo/graph.ts +1 -1
  48. package/node_modules/@diffci.com/core/src/repo/impact.ts +1 -1
  49. package/node_modules/@diffci.com/core/src/repo/yarn-berry-lockfile.ts +178 -0
  50. package/node_modules/@diffci.com/core/src/repo/yarn-lockfile.ts +2 -2
  51. package/package.json +2 -2
@@ -48,6 +48,7 @@ import { inferFullCommand, inferComparableSelectedCommand, inferWorkspaceCompari
48
48
  import { addDiffciPackageScripts, detectPackageManager, installDiffci } from "./install.js";
49
49
  import { hookCommand, installPrePushHook, isGitRepository, refreshPrePushHook } from "./hook.js";
50
50
  import { AGENT_HOOK_TIMEOUT_SECONDS, ignoredWrites, MCP_CONFIG_PATHS, SKILL_PATHS, writeAgentStopHook, writeMcpConfig, writeSkill } from "./agent-setup.js";
51
+ import { worktreeChangeSuspected } from "./report.js";
51
52
  import { submitObservation } from "./submit.js";
52
53
  import { configureGraphCache } from "./shared-graph-cache.js";
53
54
  import { GraphCache } from "@diffci.com/core/cache/graph-cache";
@@ -65,7 +66,7 @@ import { formatGrowthPrompt, formatVerifySavingsSummary, measureCommand, runVeri
65
66
  import { auditEnforceWorkflows, auditWorkflows, isNonInterfering } from "./workflow-guard.js";
66
67
  import { renderPilotPacket } from "./pilot-packet.js";
67
68
  import { observerIdentity } from "./package-identity.js";
68
- import { buildPilotWorkflow, diffciVerificationWorkflow, diffciWorkflow } from "./workflow-templates.js";
69
+ import { buildPilotWorkflow, diffciVerificationWorkflow, diffciWorkflow, verificationInstallCommands } from "./workflow-templates.js";
69
70
  import { buildMissReport, formatMissReportMarkdown, parseJunit } from "./enforce-misses.js";
70
71
  import { appendOutcome, formatOutcomeSummary, outcomeLogPath, readOutcomes, summarizeOutcomes } from "./outcome-log.js";
71
72
  import { checkPlan } from "./check-plan.js";
@@ -435,7 +436,7 @@ function runInit(flags, env) {
435
436
  if (includeWorkflow)
436
437
  writes.push(writeInitFile(repoPath, ".github/workflows/diffci.yml", diffciWorkflow(identity.version), force));
437
438
  if (includeVerificationWorkflow) {
438
- writes.push(writeInitFile(repoPath, ".github/workflows/diffci-verify.yml", diffciVerificationWorkflow(identity.version), force));
439
+ writes.push(writeInitFile(repoPath, ".github/workflows/diffci-verify.yml", diffciVerificationWorkflow(identity.version, verificationInstallCommands(repoPath)), force));
439
440
  }
440
441
  // The hook, MCP server and skill are on by default so an agent meets DiffCI without being told to.
441
442
  const skipped = [];
@@ -938,7 +939,7 @@ function summarise(report, executionFollows = false) {
938
939
  lines.push(" blind spot: this repository declares a test framework and DiffCI discovered none of its tests");
939
940
  }
940
941
  }
941
- lines.push(` non-interference${executionFollows ? " (analysis phase)" : ""}: worktree ${report.nonInterference.worktreeUnchanged ? "unchanged" : "CHANGED - report this"}, report written ${report.nonInterference.reportWrittenOutsideRepository ? "outside" : "INSIDE"} the checkout`);
942
+ lines.push(` non-interference${executionFollows ? " (analysis phase)" : ""}: worktree ${report.nonInterference.worktreeUnchanged ? "unchanged" : worktreeChangeSuspected(report.nonInterference) ? "CHANGED - report this" : "not a git checkout, nothing to compare"}, report written ${report.nonInterference.reportWrittenOutsideRepository ? "outside" : "INSIDE"} the checkout`);
942
943
  const blocking = report.nonInterference.workflowFindings.filter((f) => f.severity === "BLOCKING");
943
944
  // `check` is a local trial, not an installation, so it names the count and where to look; `observe`
944
945
  // runs inside the installation being judged and keeps every finding in its log.
@@ -1,10 +1,12 @@
1
1
  /** Injected so tests can drive this without a real repository. Returns stdout, or a failure. */
2
+ /** `stderr` is only inspected, never reported: a failed fetch can print a remote URL with credentials. */
2
3
  export type GitRunner = (args: string[]) => {
3
4
  ok: true;
4
5
  stdout: string;
5
6
  } | {
6
7
  ok: false;
7
8
  error: string;
9
+ stderr?: string;
8
10
  };
9
11
  export interface ObservationEnvironment {
10
12
  [key: string]: string | undefined;
@@ -153,6 +153,17 @@ const DEEPEN_HINT = "the commit is not in this checkout - add `fetch-depth: 0` t
153
153
  const GITLAB_DEEPEN_HINT = "the commit is not in this checkout - set `GIT_DEPTH: \"0\"` in the variables of the job that runs DiffCI (this does not affect any other job)";
154
154
  /** Azure Pipelines checks out shallow (`fetchDepth: 1`) by default in pipelines created since 2022. */
155
155
  const AZURE_DEEPEN_HINT = "the commit is not in this checkout - set `fetchDepth: 0` on the `checkout` step of the job that runs DiffCI (this does not affect any other job)";
156
+ /** For a path that is not a git checkout: where the checkout is, not how deep it is (#278). */
157
+ function notACheckoutHint(env) {
158
+ if (env.GITHUB_ACTIONS === "true") {
159
+ return "set the DiffCI Action's `repository-path` (or `--repo`) to the directory actions/checkout cloned into - its `path:` when the checkout step sets one";
160
+ }
161
+ if (env.GITLAB_CI === "true")
162
+ return "run DiffCI in the cloned project directory, or pass `--repo` with that directory";
163
+ if (isAzurePipelines(env))
164
+ return "set the DiffCIObserve task's `repositoryPath` (or `--repo`) to the directory the `checkout` step cloned into - its `path:` when it sets one";
165
+ return "pass `--repo` with the directory of a git checkout";
166
+ }
156
167
  function deepenHint(env) {
157
168
  if (env.GITLAB_CI === "true")
158
169
  return GITLAB_DEEPEN_HINT;
@@ -290,6 +301,14 @@ export function resolveCommitRangeFetchingHistory(options) {
290
301
  if (first.ok)
291
302
  return first;
292
303
  const { env, git } = options;
304
+ // A path that is not a git checkout at all (#278): no history depth fixes that, so the deepen hint
305
+ // would send the user the wrong way. Name the setting that points DiffCI at the checkout instead.
306
+ const inside = git(["rev-parse", "--is-inside-work-tree"]);
307
+ // Only git saying so means "not a checkout": dubious ownership or a missing git binary fail differently.
308
+ if (!inside.ok && !/not a git repository/i.test(inside.stderr ?? ""))
309
+ return first;
310
+ if (!inside.ok || inside.stdout.trim() !== "true")
311
+ return { ok: false, reason: `this path is not a git checkout: ${notACheckoutHint(env)}` };
293
312
  if (env.GITHUB_ACTIONS !== "true" && env.GITLAB_CI !== "true" && !isAzurePipelines(env))
294
313
  return first;
295
314
  const shallow = git(["rev-parse", "--is-shallow-repository"]);
@@ -160,7 +160,10 @@ export function inferFullCommand(repoPath) {
160
160
  }
161
161
  else {
162
162
  const manager = typeof pkg.packageManager === "string" ? pkg.packageManager.split("@")[0] : undefined;
163
- if (manager === "pnpm" || manager === "yarn" || manager === "bun") {
163
+ // `bun test` is Bun's own test runner and ignores scripts.test; `bun run test` runs the script.
164
+ if (manager === "bun")
165
+ return { command: "bun run test", reason: "package.json test script via bun" };
166
+ if (manager === "pnpm" || manager === "yarn") {
164
167
  return { command: `${manager} test`, reason: `package.json test script via ${manager}` };
165
168
  }
166
169
  if (manager && manager !== "npm")
@@ -170,7 +173,7 @@ export function inferFullCommand(repoPath) {
170
173
  if (existsSync(join(repoPath, "yarn.lock")))
171
174
  return { command: "yarn test", reason: "package.json test script with Yarn lockfile" };
172
175
  if (existsSync(join(repoPath, "bun.lock")) || existsSync(join(repoPath, "bun.lockb")))
173
- return { command: "bun test", reason: "package.json test script with Bun lockfile" };
176
+ return { command: "bun run test", reason: "package.json test script with Bun lockfile" };
174
177
  return { command: "npm test", reason: "package.json test script" };
175
178
  }
176
179
  }
@@ -90,12 +90,19 @@ export async function runGate(options) {
90
90
  const repoPath = resolve(options.repoPath);
91
91
  const run = options.run ?? measureCommand;
92
92
  const started = Date.now();
93
- const remaining = () => Math.max(options.timeoutMs - (Date.now() - started), 0);
94
- const execute = (command) => run(command, { cwd: repoPath, timeoutMs: remaining(), tailBytes: options.tailBytes });
93
+ // The step budget starts after the analysis: a slow analysis must not leave the full gate unrun.
94
+ let stepsStarted = started;
95
+ // A step that would start with no time left is not run: a 0ms timeout would mean no limit at all.
96
+ const execute = (command) => {
97
+ const remaining = options.timeoutMs - (Date.now() - stepsStarted);
98
+ return remaining > 0 ? run(command, { cwd: repoPath, timeoutMs: remaining, tailBytes: options.tailBytes }) : undefined;
99
+ };
100
+ const step = (measurement) => measurement ? stepRun(measurement) : { status: "not_run" };
95
101
  // 1. What DiffCI would do: a plan made elsewhere, or an analysis here. Never fatal: the full gate runs
96
102
  // whatever happens here.
97
103
  const supplied = options.plan !== undefined ? usablePlan(options.plan, options.expectHead) : undefined;
98
104
  const plan = supplied ? supplied.plan : await planGate(options);
105
+ stepsStarted = Date.now();
99
106
  const analysis = plan?.analysis ?? { status: "PLAN_UNUSABLE", reason: supplied?.reason, fallback_reasons: [] };
100
107
  const unplanned = analysis.reason ?? "the change could not be analysed";
101
108
  const analysisMs = supplied?.plan ? 0 : plan?.analysis.duration_ms ?? 0;
@@ -105,7 +112,7 @@ export async function runGate(options) {
105
112
  // 2. The full gate, every leaf, continuing past failures so each one is attributed.
106
113
  const checks = full.map((check) => {
107
114
  const decided = decisionOf.get(check.id);
108
- const measured = stepRun(execute(check.command));
115
+ const measured = step(execute(check.command));
109
116
  return {
110
117
  id: check.id, kind: check.kind,
111
118
  decision: decided?.decision ?? "UNPLANNED",
@@ -119,7 +126,7 @@ export async function runGate(options) {
119
126
  let tests;
120
127
  if (testCommand) {
121
128
  const measurement = execute(testCommand);
122
- const fullRun = { ...stepRun(measurement), ...(measurement.failingTests?.length ? { failing_tests: measurement.failingTests } : {}) };
129
+ const fullRun = { ...step(measurement), ...(measurement?.failingTests?.length ? { failing_tests: measurement.failingTests } : {}) };
123
130
  tests = {
124
131
  command: testCommand, full: fullRun,
125
132
  selection: plan?.tests.selection ?? "unavailable",
@@ -134,27 +141,31 @@ export async function runGate(options) {
134
141
  for (const check of checks) {
135
142
  if (check.full.status === "passed" && !options.measureSelected)
136
143
  continue;
144
+ // A step the time limit left unrun has no result, so it cannot be a miss.
145
+ if (check.full.status === "not_run")
146
+ continue;
137
147
  if (check.decision === "SKIP") {
138
148
  check.missed = check.full.status !== "passed";
139
149
  continue;
140
150
  }
141
151
  if (check.decision !== "NARROWED" || !check.narrowed_command)
142
152
  continue;
143
- check.narrowed = stepRun(execute(check.narrowed_command));
153
+ check.narrowed = step(execute(check.narrowed_command));
144
154
  if (check.full.status !== "passed")
145
155
  check.missed = check.narrowed.status === "passed";
146
156
  }
147
157
  if (tests?.selected_commands && (tests.full.status !== "passed" || options.measureSelected)) {
148
158
  const runs = tests.selected_commands.map((command) => execute(command));
149
- const failed = runs.find((measurement) => stepRun(measurement).status !== "passed");
150
- tests.selected = { ...stepRun(failed ?? runs[runs.length - 1]), wall_ms: runs.reduce((sum, measurement) => sum + measurement.wallMs, 0) };
159
+ const failed = runs.findIndex((measurement) => step(measurement).status !== "passed");
160
+ tests.selected = { ...step(runs[failed >= 0 ? failed : runs.length - 1]), wall_ms: runs.reduce((sum, measurement) => sum + (measurement?.wallMs ?? 0), 0) };
151
161
  if (tests.full.status !== "passed")
152
162
  tests.missed = tests.selected.status === "passed";
153
163
  }
154
164
  // 4. Summary. The build's result is the full gate's, never DiffCI's.
155
165
  const failedSteps = [...checks.filter((check) => check.full.status !== "passed").map((check) => check.id), ...(tests && tests.full.status !== "passed" ? ["tests"] : [])];
156
166
  const fullMs = checks.reduce((sum, check) => sum + (check.full.wall_ms ?? 0), 0) + (tests?.full.wall_ms ?? 0);
157
- let estimated = false;
167
+ // A step the time limit left unrun has no time in either total, so the comparison is not fully measured.
168
+ let estimated = checks.some((check) => check.full.status === "not_run") || tests?.full.status === "not_run";
158
169
  let diffciMs = analysisMs;
159
170
  for (const check of checks) {
160
171
  if (check.decision === "SKIP")
@@ -201,6 +212,9 @@ export function gateExitCode(report) {
201
212
  return report.gate.status === "passed" ? 0 : 1;
202
213
  }
203
214
  const seconds = (ms) => `${(ms / 1000).toFixed(1)}s`;
215
+ /** A step the time limit left unrun did not fail; it reads as not run, and the gate's reason says it failed. */
216
+ const stepLabel = (status) => status === "passed" ? "ok " : status === "not_run" ? "-- " : "FAIL";
217
+ const notRun = (status) => status === "not_run" ? " (not run)" : "";
204
218
  export function formatGateSummary(report) {
205
219
  const lines = [
206
220
  `DiffCI gate (observe): ${report.gate.status.toUpperCase()} - ${report.gate.reason}`,
@@ -208,12 +222,12 @@ export function formatGateSummary(report) {
208
222
  ` analysis: ${report.analysis.status}${report.analysis.mode ? ` (${report.analysis.mode})` : ""}${report.analysis.reason ? ` - ${report.analysis.reason}` : ""}`,
209
223
  ];
210
224
  for (const check of report.checks) {
211
- lines.push(` ${check.full.status === "passed" ? "ok " : "FAIL"} ${check.id} ${seconds(check.full.wall_ms ?? 0)} - DiffCI: ${check.decision}${check.missed ? " (MISSED)" : ""}`);
225
+ lines.push(` ${stepLabel(check.full.status)} ${check.id} ${seconds(check.full.wall_ms ?? 0)}${notRun(check.full.status)} - DiffCI: ${check.decision}${check.missed ? " (MISSED)" : ""}`);
212
226
  }
213
227
  if (report.tests) {
214
228
  const t = report.tests;
215
229
  const scope = t.selection === "selected" ? `${t.tests_selected}/${t.tests_available} test files` : t.selection;
216
- lines.push(` ${t.full.status === "passed" ? "ok " : "FAIL"} tests ${seconds(t.full.wall_ms ?? 0)} - DiffCI: ${scope}${t.missed ? " (MISSED)" : ""}`);
230
+ lines.push(` ${stepLabel(t.full.status)} tests ${seconds(t.full.wall_ms ?? 0)}${notRun(t.full.status)} - DiffCI: ${scope}${t.missed ? " (MISSED)" : ""}`);
217
231
  }
218
232
  const s = report.summary;
219
233
  lines.push(` full gate ${seconds(s.full_ms)}, DiffCI ${seconds(s.diffci_ms)} (${s.basis}), would save ${seconds(s.saved_ms)}`);
@@ -1,4 +1,4 @@
1
- import type { ObservationReport } from "./report.js";
1
+ import { type ObservationReport } from "./report.js";
2
2
  /**
3
3
  * The GitHub job summary for `diffci observe`: the place most people will ever read a report, so it
4
4
  * leads with the answer (what this change affects) and keeps the full text summary one click away.
@@ -1,3 +1,4 @@
1
+ import { worktreeChangeSuspected } from "./report.js";
1
2
  /** Selected tests listed by name before the rest collapse into a count. */
2
3
  const MAX_LISTED_TESTS = 20;
3
4
  /** Inline code that survives any path: no backticks to close it early, no pipes to split a table cell. */
@@ -65,7 +66,7 @@ export function formatJobSummary(report, textSummary, delivery) {
65
66
  }
66
67
  // A broken promise of non-interference is the one thing that must never hide in a collapsed block.
67
68
  const blocking = report.nonInterference.workflowFindings.filter((finding) => finding.severity === "BLOCKING");
68
- if (!report.nonInterference.worktreeUnchanged) {
69
+ if (worktreeChangeSuspected(report.nonInterference)) {
69
70
  lines.push("", "> [!WARNING]", "> The working tree changed while DiffCI observed it. Please report this at https://github.com/DiffCI/core/issues.");
70
71
  }
71
72
  if (blocking.length > 0) {
@@ -43,7 +43,7 @@ export function makeGitRunner(repoPath) {
43
43
  return { ok: true, stdout };
44
44
  }
45
45
  catch (error) {
46
- return { ok: false, error: error.message.split("\n")[0] ?? "git failed" };
46
+ return { ok: false, error: error.message.split("\n")[0] ?? "git failed", stderr: String(error.stderr ?? "") };
47
47
  }
48
48
  };
49
49
  }
@@ -93,6 +93,13 @@ export interface NonInterferenceEvidence {
93
93
  /** Findings from the workflow guard (src/client/workflow-guard.ts), embedded on every run. */
94
94
  workflowFindings: WorkflowFinding[];
95
95
  }
96
+ /**
97
+ * Whether the evidence shows the observer may have changed the checkout: a before/after pair differs,
98
+ * or evidence captured before is missing after. With no evidence at all - the path is not a git
99
+ * checkout, so the observation refused - there was nothing to change and nothing to report (#278).
100
+ * This only decides what is shown; `worktreeUnchanged` stays false, so such a run never narrows.
101
+ */
102
+ export declare function worktreeChangeSuspected(evidence: Pick<NonInterferenceEvidence, "headShaBefore" | "headShaAfter" | "worktreeDigestBefore" | "worktreeDigestAfter" | "worktreeUnchanged">): boolean;
96
103
  export type WorkflowFindingSeverity = "BLOCKING" | "WARNING" | "INFO";
97
104
  export interface WorkflowFinding {
98
105
  severity: WorkflowFindingSeverity;
@@ -19,6 +19,17 @@
19
19
  */
20
20
  /** Wire identifier. Consumers MUST reject a document whose `schema` they do not recognise. */
21
21
  export const OBSERVATION_SCHEMA = "diffci.observation.v1";
22
+ /**
23
+ * Whether the evidence shows the observer may have changed the checkout: a before/after pair differs,
24
+ * or evidence captured before is missing after. With no evidence at all - the path is not a git
25
+ * checkout, so the observation refused - there was nothing to change and nothing to report (#278).
26
+ * This only decides what is shown; `worktreeUnchanged` stays false, so such a run never narrows.
27
+ */
28
+ export function worktreeChangeSuspected(evidence) {
29
+ if (evidence.worktreeUnchanged)
30
+ return false;
31
+ return [evidence.headShaBefore, evidence.headShaAfter, evidence.worktreeDigestBefore, evidence.worktreeDigestAfter].some((value) => value !== undefined);
32
+ }
22
33
  /** Optional, additive metrics; unknown or incomplete core telemetry stays absent. */
23
34
  export function readTypeScriptProgramMetrics(value) {
24
35
  if (!value || typeof value !== "object" || Array.isArray(value))
@@ -366,13 +366,33 @@ const ENFORCE_VARIABLE_EXPRESSION = /^\$\{\{\s*vars\.DIFFCI_ENFORCE\s*\}\}$/;
366
366
  function runInvokesEnforcePolicy(run) {
367
367
  return runInvokesDiffCiVerification(run) && /--policy[=\s]+["']?enforce\b/.test(commandText(run));
368
368
  }
369
- /** `npm run test` and `npm test` are the same command; so are the pnpm/yarn/bun pairs. */
369
+ /**
370
+ * `npm run test` and `npm test` are the same command; so are the pnpm and yarn pairs. Bun's are not:
371
+ * `bun test` starts Bun's own test runner and never reads scripts.test, so only `bun run test` is the
372
+ * test script.
373
+ */
370
374
  function normalizeTestCommand(command) {
371
- return command.trim().replace(/\s+/g, " ").replace(/^(npm|pnpm|yarn|bun) run test$/, "$1 test");
375
+ return command.trim().replace(/\s+/g, " ").replace(/^(npm|pnpm|yarn) run test$/, "$1 test");
376
+ }
377
+ function runInvokesFullCommand(run, fullCommands) {
378
+ const targets = new Set(fullCommands.map(normalizeTestCommand));
379
+ return commandText(run).split("\n").some((line) => targets.has(normalizeTestCommand(line)));
372
380
  }
373
- function runInvokesFullCommand(run, fullCommand) {
374
- const target = normalizeTestCommand(fullCommand);
375
- return commandText(run).split("\n").some((line) => normalizeTestCommand(line) === target);
381
+ /**
382
+ * `bun run test` runs scripts.test. When that script is exactly `bun test`, a workflow step that runs
383
+ * `bun test` directly runs the same suite, so it counts as the full command too.
384
+ */
385
+ function bunScriptEquivalents(repoPath, fullCommand) {
386
+ if (normalizeTestCommand(fullCommand) !== "bun run test")
387
+ return [];
388
+ try {
389
+ const pkg = JSON.parse(readFileSync(join(repoPath, "package.json"), "utf8"));
390
+ const script = pkg.scripts?.test;
391
+ return typeof script === "string" && normalizeTestCommand(script) === "bun test" ? ["bun test"] : [];
392
+ }
393
+ catch {
394
+ return [];
395
+ }
376
396
  }
377
397
  function globToRegExp(glob) {
378
398
  const pattern = glob
@@ -523,6 +543,7 @@ export function auditEnforceWorkflows(repoPath, options = {}) {
523
543
  const unprovable = [];
524
544
  const inferred = options.fullCommand ? { command: options.fullCommand, reason: "--full-command" } : inferFullCommand(repoPath);
525
545
  const fullCommand = inferred.command;
546
+ const fullCommands = fullCommand ? [fullCommand, ...bunScriptEquivalents(repoPath, fullCommand)] : [];
526
547
  if (!fullCommand) {
527
548
  findings.push({
528
549
  severity: "BLOCKING",
@@ -577,7 +598,7 @@ export function auditEnforceWorkflows(repoPath, options = {}) {
577
598
  if (jobCondition === "FALSE")
578
599
  continue;
579
600
  for (const step of steps) {
580
- if (typeof step.run !== "string" || !runInvokesFullCommand(step.run, fullCommand))
601
+ if (typeof step.run !== "string" || !runInvokesFullCommand(step.run, fullCommands))
581
602
  continue;
582
603
  if (step["working-directory"] !== undefined && step["working-directory"] !== ".")
583
604
  continue;
@@ -1,8 +1,18 @@
1
+ import { type SupportedPackageManager } from "./install.js";
1
2
  /** GitHub-hosted runner and Node 24 action pins shared by every workflow the CLI generates. */
2
3
  export declare const RUNNER = "ubuntu-26.04";
3
4
  export declare const CHECKOUT_SHA = "3d3c42e5aac5ba805825da76410c181273ba90b1";
4
5
  export declare const SETUP_NODE_SHA = "949feb2413d6458794dcd2491c4babbbce0c15c1";
5
6
  export declare const UPLOAD_ARTIFACT_SHA = "cf430e030ddbb5b0abf93d22962f4752f3646cd9";
6
7
  export declare function diffciWorkflow(version: string): string;
7
- export declare function diffciVerificationWorkflow(version: string): string;
8
+ /**
9
+ * The commands that install a JavaScript repository's dependencies in CI, for the verification workflow:
10
+ * verify runs the repository's tests, which a fresh checkout cannot run before its dependencies are
11
+ * installed (every receipt then fails, 2026-11-18). Empty when the package manager is not known, or is
12
+ * Bun, which needs a setup action this template does not pin.
13
+ */
14
+ export declare function dependencyInstallCommands(manager: SupportedPackageManager | undefined, hasLockfile: boolean, yarnBerry?: boolean): string[];
15
+ /** How the verification workflow installs `repoPath`'s dependencies before verify runs its tests. */
16
+ export declare function verificationInstallCommands(repoPath: string): string[];
17
+ export declare function diffciVerificationWorkflow(version: string, installCommands?: readonly string[]): string;
8
18
  export declare function buildPilotWorkflow(version: string): string;
@@ -1,3 +1,6 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { detectPackageManager } from "./install.js";
1
4
  /** GitHub-hosted runner and Node 24 action pins shared by every workflow the CLI generates. */
2
5
  export const RUNNER = "ubuntu-26.04";
3
6
  export const CHECKOUT_SHA = "3d3c42e5aac5ba805825da76410c181273ba90b1"; // actions/checkout v7.0.1
@@ -22,7 +25,45 @@ jobs:
22
25
  - run: npx "@diffci.com/diffci@${version}" observe --no-send
23
26
  `;
24
27
  }
25
- export function diffciVerificationWorkflow(version) {
28
+ /**
29
+ * The commands that install a JavaScript repository's dependencies in CI, for the verification workflow:
30
+ * verify runs the repository's tests, which a fresh checkout cannot run before its dependencies are
31
+ * installed (every receipt then fails, 2026-11-18). Empty when the package manager is not known, or is
32
+ * Bun, which needs a setup action this template does not pin.
33
+ */
34
+ export function dependencyInstallCommands(manager, hasLockfile, yarnBerry = false) {
35
+ // pnpm and Yarn 2+ install frozen by default in CI, which fails without a lockfile; Yarn 2+ spells it --immutable.
36
+ switch (manager) {
37
+ case "npm": return [hasLockfile ? "npm ci" : "npm install"];
38
+ case "pnpm": return ["corepack enable", hasLockfile ? "pnpm install --frozen-lockfile" : "pnpm install --no-frozen-lockfile"];
39
+ case "yarn": return ["corepack enable", yarnBerry ? (hasLockfile ? "yarn install --immutable" : "yarn install --no-immutable") : hasLockfile ? "yarn install --frozen-lockfile" : "yarn install"];
40
+ default: return [];
41
+ }
42
+ }
43
+ /** How the verification workflow installs `repoPath`'s dependencies before verify runs its tests. */
44
+ export function verificationInstallCommands(repoPath) {
45
+ if (!existsSync(join(repoPath, "package.json")))
46
+ return [];
47
+ let manager;
48
+ try {
49
+ manager = detectPackageManager(repoPath);
50
+ }
51
+ catch {
52
+ return [];
53
+ }
54
+ const lockfiles = manager === "pnpm" ? ["pnpm-lock.yaml"] : manager === "yarn" ? ["yarn.lock"] : ["package-lock.json", "npm-shrinkwrap.json"];
55
+ const hasLockfile = lockfiles.some((name) => existsSync(join(repoPath, name)));
56
+ const yarnBerry = existsSync(join(repoPath, ".yarnrc.yml")) || /"packageManager"\s*:\s*"yarn@(?!1\.)/.test(readFileSync(join(repoPath, "package.json"), "utf8"));
57
+ return dependencyInstallCommands(manager, hasLockfile, yarnBerry);
58
+ }
59
+ function installStep(commands) {
60
+ if (commands.length === 0) {
61
+ return " # Install the repository's dependencies here: verify runs its tests.\n";
62
+ }
63
+ const run = commands.length === 1 ? ` ${commands[0]}` : ` |\n${commands.map((command) => ` ${command}`).join("\n")}`;
64
+ return ` - name: Install dependencies\n run:${run}\n`;
65
+ }
66
+ export function diffciVerificationWorkflow(version, installCommands = []) {
26
67
  return `name: DiffCI verification
27
68
  on: [push, pull_request]
28
69
  permissions:
@@ -39,7 +80,7 @@ jobs:
39
80
  - uses: actions/setup-node@${SETUP_NODE_SHA} # immutable setup-node pin
40
81
  with:
41
82
  node-version: 22
42
- - name: Verify changed code
83
+ ${installStep(installCommands)} - name: Verify changed code
43
84
  run: npx "@diffci.com/diffci@${version}" verify --json --out "$RUNNER_TEMP/diffci-verification.json"
44
85
  - name: Upload verification receipt
45
86
  if: always()
@@ -27,7 +27,7 @@ If DiffCI saves you CI time, a ⭐ helps others find it.
27
27
 
28
28
  ```yaml
29
29
  - uses: actions/checkout@v7
30
- - uses: DiffCI/core@v0.3.54
30
+ - uses: DiffCI/core@v0.3.55
31
31
  ```
32
32
 
33
33
  Add `with: comment: "true"` (and `pull-requests: write` on the job) and the same answer appears on the pull request itself, updated in place on each push:
@@ -282,11 +282,11 @@ Most open work is teaching DiffCI to narrow changes it currently treats as "run
282
282
 
283
283
  Thank you to everyone who has improved DiffCI:
284
284
 
285
- - <a href="https://github.com/KingEmma7"><img src="https://github.com/KingEmma7.png?size=80" width="40" height="40" alt="@KingEmma7"></a> **[Emmanuel Mawulolo Tagbor](https://github.com/KingEmma7)**, **[Regular contributor](CONTRIBUTING.md#contributor-tiers)**: [`diffci check-plan`](docs/using-diffci.md#compare-a-plan-with-a-full-suite-junit-report) for comparing a saved plan with full-suite JUnit results ([#74](https://github.com/DiffCI/core/pull/74)), Yarn Classic lockfile narrowing ([#63](https://github.com/DiffCI/core/pull/63)), and follow-ups ([#67](https://github.com/DiffCI/core/pull/67), [#70](https://github.com/DiffCI/core/pull/70)).
286
- - <a href="https://github.com/FredApps"><img src="https://github.com/FredApps.png?size=80" width="40" height="40" alt="@FredApps"></a> **[@FredApps](https://github.com/FredApps)**, **[Area maintainer: Rust](CONTRIBUTING.md#contributor-tiers)**: the [Rust (Cargo) adapter](https://github.com/DiffCI/core/issues/62), from Cargo package and test-target mapping ([#91](https://github.com/DiffCI/core/pull/91)) through crate-dependency selection ([#92](https://github.com/DiffCI/core/pull/92)), conservative `cargo test` commands ([#93](https://github.com/DiffCI/core/pull/93)), registration inside the release boundary ([#94](https://github.com/DiffCI/core/pull/94)) and a pinned public replay on hosted CI ([#95](https://github.com/DiffCI/core/pull/95)), and five safety fixes for runtime module dependencies, Maven module resources, runner suites, deleted assets and Go runtime inputs ([#32](https://github.com/DiffCI/core/pull/32)–[#36](https://github.com/DiffCI/core/pull/36)); match the verify usage line that lists --staged and --paths ([#203](https://github.com/DiffCI/core/pull/203)); list npm run agent:check with the local checks in CONTRIBUTING ([#289](https://github.com/DiffCI/core/pull/289)); say Rust is supported experimentally in the roadmap ([#291](https://github.com/DiffCI/core/pull/291)); retry removing Cargo-built fixtures on Windows ([#235](https://github.com/DiffCI/core/pull/235)); assert the interpreter the analysis recorded, not a second probe ([#310](https://github.com/DiffCI/core/pull/310)); build dist-client once instead of in every test file ([#202](https://github.com/DiffCI/core/pull/202)); find the npm-cli.js npm runs, not one under its global prefix ([#240](https://github.com/DiffCI/core/pull/240)); drop the dead --share-usage flag from the help ([#312](https://github.com/DiffCI/core/pull/312)); expand matrix include the way GitHub does ([#165](https://github.com/DiffCI/core/pull/165)); compare if: strings ignoring case, as GitHub does ([#170](https://github.com/DiffCI/core/pull/170)); an empty or comment-only workflow file no longer crashes diffci plan ([#171](https://github.com/DiffCI/core/pull/171)); parse numstat -z renames so renamed files keep isBinary ([#176](https://github.com/DiffCI/core/pull/176)); compile globs character by character so regex metacharacters stay literal ([#179](https://github.com/DiffCI/core/pull/179)); split run lines into argv the way sh would ([#181](https://github.com/DiffCI/core/pull/181)); read GitHub Actions path filters from the workflow's on: triggers ([#182](https://github.com/DiffCI/core/pull/182)); plan a purpose from a job that runs its step ([#185](https://github.com/DiffCI/core/pull/185)); treat Azure Pipelines and other CI providers' pipeline files as CI config ([#186](https://github.com/DiffCI/core/pull/186)); only an ancestor script makes a cycle ([#188](https://github.com/DiffCI/core/pull/188)); match task input patterns as path globs ([#174](https://github.com/DiffCI/core/pull/174)); read template text after a substitution in script checks ([#219](https://github.com/DiffCI/core/pull/219)); treat a change to an extended tsconfig base as global ([#237](https://github.com/DiffCI/core/pull/237)); lint changed files of types the ESLint config adds ([#242](https://github.com/DiffCI/core/pull/242)); check double-quoted expansion in linear time ([#302](https://github.com/DiffCI/core/pull/302)); resolve imports against a test package's basedir ([#205](https://github.com/DiffCI/core/pull/205)); follow pytest plugins that addopts loads with -p ([#207](https://github.com/DiffCI/core/pull/207)); expand wildcards in pytest testpaths ([#209](https://github.com/DiffCI/core/pull/209)); recognise Failsafe's IT* and *ITCase test names ([#211](https://github.com/DiffCI/core/pull/211)); ignore XML comments when reading a POM ([#213](https://github.com/DiffCI/core/pull/213)); ignore go.mod fixtures under testdata, _ and . directories ([#215](https://github.com/DiffCI/core/pull/215)); keep +, $ and ^ literal in globs, and match everything with ** ([#249](https://github.com/DiffCI/core/pull/249)); resolve a leading <rootDir> in testPathIgnorePatterns ([#253](https://github.com/DiffCI/core/pull/253)); install with --mode=skip-build on Yarn 2 and later ([#200](https://github.com/DiffCI/core/pull/200)); coverage map records files a test reads by relative path ([#201](https://github.com/DiffCI/core/pull/201)); turn the shared graph cache off when its secret is too short ([#264](https://github.com/DiffCI/core/pull/264)); answer ping with an empty result ([#295](https://github.com/DiffCI/core/pull/295)); list both paths of a renamed file in changed_files ([#299](https://github.com/DiffCI/core/pull/299)); replace a local action-v tag left by a rejected push on rerun ([#280](https://github.com/DiffCI/core/pull/280)); do not persist write-scoped checkout tokens in publish and merge-gate ([#282](https://github.com/DiffCI/core/pull/282)); count observe runs as the GitHub Action surface ([#285](https://github.com/DiffCI/core/pull/285)); say usage counting is on where the docs said DiffCI sends nothing ([#287](https://github.com/DiffCI/core/pull/287)); count Azure DevOps task runs as surface azure-devops-task ([#307](https://github.com/DiffCI/core/pull/307)); resolve Vue paths aliases against the declaring tsconfig without baseUrl ([#268](https://github.com/DiffCI/core/pull/268)); link the implementation next to a resolved declaration file ([#270](https://github.com/DiffCI/core/pull/270)); name the adapter runner when a repository has no test files ([#217](https://github.com/DiffCI/core/pull/217)); fall back when an npm lockfile bump meets undeclared imports ([#246](https://github.com/DiffCI/core/pull/246)); translate wildcards inside import.meta.glob brace alternatives ([#274](https://github.com/DiffCI/core/pull/274)); treat modelled Python files as code when resolving readers ([#257](https://github.com/DiffCI/core/pull/257)); let declared inputs and alwaysRunTests select pytest and Maven tests ([#272](https://github.com/DiffCI/core/pull/272)); cover a program the test script runs directly ([#306](https://github.com/DiffCI/core/pull/306)); keep a GitLab subgroup project's full path in the report ([#266](https://github.com/DiffCI/core/pull/266)); name a member NAME@VERSION when a dependency shares its name ([#232](https://github.com/DiffCI/core/pull/232)); keep required-feature targets' packages whole instead of blocking the repository ([#248](https://github.com/DiffCI/core/pull/248)); confine helper scripts and native sources to the crate that owns them ([#250](https://github.com/DiffCI/core/pull/250)); add covering crates instead of refusing when features would differ ([#254](https://github.com/DiffCI/core/pull/254)); pinned anstyle replay narrows real revisions with the same failures ([#258](https://github.com/DiffCI/core/pull/258)); read byte and C raw strings as raw in the input scan ([#228](https://github.com/DiffCI/core/pull/228)); treat quoted keys and inline tables in Cargo config as build settings ([#229](https://github.com/DiffCI/core/pull/229)); scan doctest code in doc comments for inputs ([#230](https://github.com/DiffCI/core/pull/230)); resolve literal paths from the workspace root too ([#231](https://github.com/DiffCI/core/pull/231)); list the Rust planner's no-command reasons and check them ([#233](https://github.com/DiffCI/core/pull/233)); restore the non-Windows branch of the .mcp.json MCP launcher ([#167](https://github.com/DiffCI/core/pull/167)).
285
+ - <a href="https://github.com/KingEmma7"><img src="https://github.com/KingEmma7.png?size=80" width="40" height="40" alt="@KingEmma7"></a> **[Emmanuel Mawulolo Tagbor](https://github.com/KingEmma7)**, **[Regular contributor](CONTRIBUTING.md#contributor-tiers)**: [`diffci check-plan`](docs/using-diffci.md#compare-a-plan-with-a-full-suite-junit-report) for comparing a saved plan with full-suite JUnit results ([#74](https://github.com/DiffCI/core/pull/74)), Yarn Classic lockfile narrowing ([#63](https://github.com/DiffCI/core/pull/63)), and follow-ups ([#67](https://github.com/DiffCI/core/pull/67), [#70](https://github.com/DiffCI/core/pull/70)); narrow supported Yarn Berry lockfile changes ([#245](https://github.com/DiffCI/core/pull/245)).
286
+ - <a href="https://github.com/FredApps"><img src="https://github.com/FredApps.png?size=80" width="40" height="40" alt="@FredApps"></a> **[@FredApps](https://github.com/FredApps)**, **[Area maintainer: Rust](CONTRIBUTING.md#contributor-tiers)**: the [Rust (Cargo) adapter](https://github.com/DiffCI/core/issues/62), from Cargo package and test-target mapping ([#91](https://github.com/DiffCI/core/pull/91)) through crate-dependency selection ([#92](https://github.com/DiffCI/core/pull/92)), conservative `cargo test` commands ([#93](https://github.com/DiffCI/core/pull/93)), registration inside the release boundary ([#94](https://github.com/DiffCI/core/pull/94)) and a pinned public replay on hosted CI ([#95](https://github.com/DiffCI/core/pull/95)), and five safety fixes for runtime module dependencies, Maven module resources, runner suites, deleted assets and Go runtime inputs ([#32](https://github.com/DiffCI/core/pull/32)–[#36](https://github.com/DiffCI/core/pull/36)); match the verify usage line that lists --staged and --paths ([#203](https://github.com/DiffCI/core/pull/203)); list npm run agent:check with the local checks in CONTRIBUTING ([#289](https://github.com/DiffCI/core/pull/289)); say Rust is supported experimentally in the roadmap ([#291](https://github.com/DiffCI/core/pull/291)); retry removing Cargo-built fixtures on Windows ([#235](https://github.com/DiffCI/core/pull/235)); assert the interpreter the analysis recorded, not a second probe ([#310](https://github.com/DiffCI/core/pull/310)); build dist-client once instead of in every test file ([#202](https://github.com/DiffCI/core/pull/202)); find the npm-cli.js npm runs, not one under its global prefix ([#240](https://github.com/DiffCI/core/pull/240)); drop the dead --share-usage flag from the help ([#312](https://github.com/DiffCI/core/pull/312)); expand matrix include the way GitHub does ([#165](https://github.com/DiffCI/core/pull/165)); compare if: strings ignoring case, as GitHub does ([#170](https://github.com/DiffCI/core/pull/170)); an empty or comment-only workflow file no longer crashes diffci plan ([#171](https://github.com/DiffCI/core/pull/171)); parse numstat -z renames so renamed files keep isBinary ([#176](https://github.com/DiffCI/core/pull/176)); compile globs character by character so regex metacharacters stay literal ([#179](https://github.com/DiffCI/core/pull/179)); split run lines into argv the way sh would ([#181](https://github.com/DiffCI/core/pull/181)); read GitHub Actions path filters from the workflow's on: triggers ([#182](https://github.com/DiffCI/core/pull/182)); plan a purpose from a job that runs its step ([#185](https://github.com/DiffCI/core/pull/185)); treat Azure Pipelines and other CI providers' pipeline files as CI config ([#186](https://github.com/DiffCI/core/pull/186)); only an ancestor script makes a cycle ([#188](https://github.com/DiffCI/core/pull/188)); match task input patterns as path globs ([#174](https://github.com/DiffCI/core/pull/174)); read template text after a substitution in script checks ([#219](https://github.com/DiffCI/core/pull/219)); treat a change to an extended tsconfig base as global ([#237](https://github.com/DiffCI/core/pull/237)); lint changed files of types the ESLint config adds ([#242](https://github.com/DiffCI/core/pull/242)); check double-quoted expansion in linear time ([#302](https://github.com/DiffCI/core/pull/302)); resolve imports against a test package's basedir ([#205](https://github.com/DiffCI/core/pull/205)); follow pytest plugins that addopts loads with -p ([#207](https://github.com/DiffCI/core/pull/207)); expand wildcards in pytest testpaths ([#209](https://github.com/DiffCI/core/pull/209)); recognise Failsafe's IT* and *ITCase test names ([#211](https://github.com/DiffCI/core/pull/211)); ignore XML comments when reading a POM ([#213](https://github.com/DiffCI/core/pull/213)); ignore go.mod fixtures under testdata, _ and . directories ([#215](https://github.com/DiffCI/core/pull/215)); keep +, $ and ^ literal in globs, and match everything with ** ([#249](https://github.com/DiffCI/core/pull/249)); resolve a leading <rootDir> in testPathIgnorePatterns ([#253](https://github.com/DiffCI/core/pull/253)); install with --mode=skip-build on Yarn 2 and later ([#200](https://github.com/DiffCI/core/pull/200)); coverage map records files a test reads by relative path ([#201](https://github.com/DiffCI/core/pull/201)); turn the shared graph cache off when its secret is too short ([#264](https://github.com/DiffCI/core/pull/264)); answer ping with an empty result ([#295](https://github.com/DiffCI/core/pull/295)); list both paths of a renamed file in changed_files ([#299](https://github.com/DiffCI/core/pull/299)); replace a local action-v tag left by a rejected push on rerun ([#280](https://github.com/DiffCI/core/pull/280)); do not persist write-scoped checkout tokens in publish and merge-gate ([#282](https://github.com/DiffCI/core/pull/282)); count observe runs as the GitHub Action surface ([#285](https://github.com/DiffCI/core/pull/285)); say usage counting is on where the docs said DiffCI sends nothing ([#287](https://github.com/DiffCI/core/pull/287)); count Azure DevOps task runs as surface azure-devops-task ([#307](https://github.com/DiffCI/core/pull/307)); resolve Vue paths aliases against the declaring tsconfig without baseUrl ([#268](https://github.com/DiffCI/core/pull/268)); link the implementation next to a resolved declaration file ([#270](https://github.com/DiffCI/core/pull/270)); name the adapter runner when a repository has no test files ([#217](https://github.com/DiffCI/core/pull/217)); fall back when an npm lockfile bump meets undeclared imports ([#246](https://github.com/DiffCI/core/pull/246)); translate wildcards inside import.meta.glob brace alternatives ([#274](https://github.com/DiffCI/core/pull/274)); treat modelled Python files as code when resolving readers ([#257](https://github.com/DiffCI/core/pull/257)); let declared inputs and alwaysRunTests select pytest and Maven tests ([#272](https://github.com/DiffCI/core/pull/272)); cover a program the test script runs directly ([#306](https://github.com/DiffCI/core/pull/306)); keep a GitLab subgroup project's full path in the report ([#266](https://github.com/DiffCI/core/pull/266)); name a member NAME@VERSION when a dependency shares its name ([#232](https://github.com/DiffCI/core/pull/232)); keep required-feature targets' packages whole instead of blocking the repository ([#248](https://github.com/DiffCI/core/pull/248)); confine helper scripts and native sources to the crate that owns them ([#250](https://github.com/DiffCI/core/pull/250)); add covering crates instead of refusing when features would differ ([#254](https://github.com/DiffCI/core/pull/254)); pinned anstyle replay narrows real revisions with the same failures ([#258](https://github.com/DiffCI/core/pull/258)); read byte and C raw strings as raw in the input scan ([#228](https://github.com/DiffCI/core/pull/228)); treat quoted keys and inline tables in Cargo config as build settings ([#229](https://github.com/DiffCI/core/pull/229)); scan doctest code in doc comments for inputs ([#230](https://github.com/DiffCI/core/pull/230)); resolve literal paths from the workspace root too ([#231](https://github.com/DiffCI/core/pull/231)); list the Rust planner's no-command reasons and check them ([#233](https://github.com/DiffCI/core/pull/233)); restore the non-Windows branch of the .mcp.json MCP launcher ([#167](https://github.com/DiffCI/core/pull/167)); infer go test or pytest when package.json has no test script ([#293](https://github.com/DiffCI/core/pull/293)); cover every commit of a branch's first push ([#309](https://github.com/DiffCI/core/pull/309)); --tail-bytes 0 keeps no output, and tails are cut by bytes ([#239](https://github.com/DiffCI/core/pull/239)); fail verify when the time limit leaves gate checks unrun ([#260](https://github.com/DiffCI/core/pull/260)); plan verify --redact-paths with real paths, redact the receipt ([#276](https://github.com/DiffCI/core/pull/276)); read nested package-manager calls like top-level ones ([#198](https://github.com/DiffCI/core/pull/198)); run a Bun repository's test script with bun run test ([#199](https://github.com/DiffCI/core/pull/199)); accept literal #[path] modules inside their own crate ([#234](https://github.com/DiffCI/core/pull/234)); accept rustup chains, deny-warnings flags and whole-workspace cargo test as CI evidence ([#252](https://github.com/DiffCI/core/pull/252)); do not run gate steps once the time limit is used up ([#262](https://github.com/DiffCI/core/pull/262)); Do not report a changed worktree when there was no checkout to compare ([#283](https://github.com/DiffCI/core/pull/283)); install dependencies in the generated verification workflow ([#297](https://github.com/DiffCI/core/pull/297)); model local path packages inside the repository instead of blocking it ([#256](https://github.com/DiffCI/core/pull/256)).
287
287
  - <a href="https://github.com/shounakjoshi88-a11y"><img src="https://github.com/shounakjoshi88-a11y.png?size=80" width="40" height="40" alt="@shounakjoshi88-a11y"></a> **[Shounak Joshi](https://github.com/shounakjoshi88-a11y)**: Go package-owned `testdata` selection, so a golden-file edit runs the owning package's tests instead of the full suite ([#85](https://github.com/DiffCI/core/pull/85)).
288
288
  - <a href="https://github.com/bfs2021"><img src="https://github.com/bfs2021.png?size=80" width="40" height="40" alt="@bfs2021"></a> **[@bfs2021](https://github.com/bfs2021)**: `bun.lock` and `npm-shrinkwrap.json` recognition in the lockfile signal ([#64](https://github.com/DiffCI/core/pull/64)).
289
- - <a href="https://github.com/sarankumar1325"><img src="https://github.com/sarankumar1325.png?size=80" width="40" height="40" alt="@sarankumar1325"></a> **[@sarankumar1325](https://github.com/sarankumar1325)**: lockfile and config-file signals. One shared lockfile list replaced every hand-written copy in `src/` ([#97](https://github.com/DiffCI/core/issues/97)): reference resolution, impact analysis and the lockfile-free dependency check ([#118](https://github.com/DiffCI/core/pull/118)–[#120](https://github.com/DiffCI/core/pull/120)), config-file discovery and impact classification, where `npm-shrinkwrap.json` is now a config change like every other lockfile ([#151](https://github.com/DiffCI/core/pull/151), [#152](https://github.com/DiffCI/core/pull/152)), the Vue analysis cache ([#107](https://github.com/DiffCI/core/pull/107)), CI inference ([#105](https://github.com/DiffCI/core/pull/105), [#146](https://github.com/DiffCI/core/pull/146)) and both path baselines, which now also fall back on `npm-shrinkwrap.json` ([#147](https://github.com/DiffCI/core/pull/147), [#148](https://github.com/DiffCI/core/pull/148)). A full run when only `babel.config.*` or `.babelrc*` changes ([#108](https://github.com/DiffCI/core/pull/108)) or a package's Jest, Vitest or Babel config changes ([#121](https://github.com/DiffCI/core/pull/121)), where these files used to select no tests. Regression tests for `vite.config`-only changes in Vitest projects ([#109](https://github.com/DiffCI/core/pull/109)) and for a root Vitest config that turns isolation off ([#149](https://github.com/DiffCI/core/pull/149)), and removal of dead config-file patterns with a test for every entry ([#106](https://github.com/DiffCI/core/pull/106)). Go `replace` targets inside the repository modelled under root-module scope instead of forcing the full suite ([#110](https://github.com/DiffCI/core/pull/110)). The [no-runnable-command reasons](docs/using-diffci.md#no-runnable-command), documented with a test that keeps the table complete ([#150](https://github.com/DiffCI/core/pull/150)), and `"\0"` escapes in place of raw NUL bytes, so git and ripgrep can search those source files again ([#145](https://github.com/DiffCI/core/pull/145)); document verify-workflow, pilot-packet, validate-specs and telemetry ([#153](https://github.com/DiffCI/core/pull/153)); pytest.ini wins even when empty, and read .pytest.ini ([#314](https://github.com/DiffCI/core/pull/314)).
289
+ - <a href="https://github.com/sarankumar1325"><img src="https://github.com/sarankumar1325.png?size=80" width="40" height="40" alt="@sarankumar1325"></a> **[@sarankumar1325](https://github.com/sarankumar1325)**: lockfile and config-file signals. One shared lockfile list replaced every hand-written copy in `src/` ([#97](https://github.com/DiffCI/core/issues/97)): reference resolution, impact analysis and the lockfile-free dependency check ([#118](https://github.com/DiffCI/core/pull/118)–[#120](https://github.com/DiffCI/core/pull/120)), config-file discovery and impact classification, where `npm-shrinkwrap.json` is now a config change like every other lockfile ([#151](https://github.com/DiffCI/core/pull/151), [#152](https://github.com/DiffCI/core/pull/152)), the Vue analysis cache ([#107](https://github.com/DiffCI/core/pull/107)), CI inference ([#105](https://github.com/DiffCI/core/pull/105), [#146](https://github.com/DiffCI/core/pull/146)) and both path baselines, which now also fall back on `npm-shrinkwrap.json` ([#147](https://github.com/DiffCI/core/pull/147), [#148](https://github.com/DiffCI/core/pull/148)). A full run when only `babel.config.*` or `.babelrc*` changes ([#108](https://github.com/DiffCI/core/pull/108)) or a package's Jest, Vitest or Babel config changes ([#121](https://github.com/DiffCI/core/pull/121)), where these files used to select no tests. Regression tests for `vite.config`-only changes in Vitest projects ([#109](https://github.com/DiffCI/core/pull/109)) and for a root Vitest config that turns isolation off ([#149](https://github.com/DiffCI/core/pull/149)), and removal of dead config-file patterns with a test for every entry ([#106](https://github.com/DiffCI/core/pull/106)). Go `replace` targets inside the repository modelled under root-module scope instead of forcing the full suite ([#110](https://github.com/DiffCI/core/pull/110)). The [no-runnable-command reasons](docs/using-diffci.md#no-runnable-command), documented with a test that keeps the table complete ([#150](https://github.com/DiffCI/core/pull/150)), and `"\0"` escapes in place of raw NUL bytes, so git and ripgrep can search those source files again ([#145](https://github.com/DiffCI/core/pull/145)); document verify-workflow, pilot-packet, validate-specs and telemetry ([#153](https://github.com/DiffCI/core/pull/153)); pytest.ini wins even when empty, and read .pytest.ini ([#314](https://github.com/DiffCI/core/pull/314)); read pyproject pytest lists as TOML strings ([#315](https://github.com/DiffCI/core/pull/315)); pytest settings from tox.ini and setup.cfg ([#316](https://github.com/DiffCI/core/pull/316)); show that declared inputs select pytest tests, and document it ([#319](https://github.com/DiffCI/core/pull/319)); find tests under a relative <testSourceDirectory> ([#317](https://github.com/DiffCI/core/pull/317)); read pytest.toml and the native [tool.pytest] table ([#318](https://github.com/DiffCI/core/pull/318)).
290
290
  - <a href="https://github.com/robertwmccarty-caelum"><img src="https://github.com/robertwmccarty-caelum.png?size=80" width="40" height="40" alt="@robertwmccarty-caelum"></a> **[@robertwmccarty-caelum](https://github.com/robertwmccarty-caelum)**: the Vitest reporter/timeout config fixture and its narrowing conditions ([#53](https://github.com/DiffCI/core/issues/53#issuecomment-6514436312), landed in [#65](https://github.com/DiffCI/core/pull/65)).
291
291
  - <a href="https://github.com/varshith84"><img src="https://github.com/varshith84.png?size=80" width="40" height="40" alt="@varshith84"></a> **[Varshith Sai Pasupuleti](https://github.com/varshith84)**: tests for transitive Vue selection and full fallback ([#16](https://github.com/DiffCI/core/pull/16)).
292
292
  - <a href="https://github.com/aniKet0753"><img src="https://github.com/aniKet0753.png?size=80" width="40" height="40" alt="@aniKet0753"></a> **[@aniKet0753](https://github.com/aniKet0753)**: a `diffci help` command list and `USAGE` text that match the commands the CLI runs, with a test that fails when a command is missing ([#130](https://github.com/DiffCI/core/pull/130)).
@@ -13,6 +13,7 @@
13
13
  import { existsSync, readFileSync } from "node:fs";
14
14
  import { join } from "node:path";
15
15
  import { replaceExpressions } from "./expression.js";
16
+ import { packageManagerCommand } from "./purpose.js";
16
17
  /** Binaries that orchestrate a project's whole toolchain and cannot be decomposed by reading it. */
17
18
  const OPAQUE_WRAPPERS = /^(kcd-scripts|react-scripts|nx|turbo|lerna|ut|rush|nps)\b/;
18
19
  /** `${{ ... }}` expressions and shell variables that repository evidence cannot settle. */
@@ -67,6 +68,23 @@ export function expressionReferences(command, evidence) {
67
68
  }
68
69
  return nodes;
69
70
  }
71
+ /**
72
+ * Scripts a script body runs through `npm run`, `yarn` or `pnpm`. Each invocation is read up to the next
73
+ * shell separator with the same package-manager grammar the top-level step uses (`packageManagerCommand`),
74
+ * so `yarn install` or `pnpm add` is an install, `yarn why` a builtin, and a flag such as `-r` or `-s`
75
+ * is never taken for a script name.
76
+ */
77
+ function nestedScriptNames(body) {
78
+ const names = [];
79
+ for (const m of body.matchAll(/\b(?:npm run|yarn|pnpm)\b/g)) {
80
+ const rest = body.slice(m.index);
81
+ const cut = rest.search(/\|\||&&|\||;/);
82
+ const pm = packageManagerCommand((cut === -1 ? rest : rest.slice(0, cut)).trim().split(/\s+/));
83
+ if (pm?.kind === "script" && pm.scriptName)
84
+ names.push(pm.scriptName);
85
+ }
86
+ return names;
87
+ }
70
88
  /**
71
89
  * Follows `npm run <script>` through package.json, recursively.
72
90
  *
@@ -119,10 +137,10 @@ export function resolveScript(repoPath, scriptName, evidence, seen = new Set())
119
137
  }
120
138
  // A script that invokes further scripts: follow each.
121
139
  const nested = [];
122
- for (const m of body.matchAll(/\b(?:npm run|yarn(?: run)?|pnpm(?: run)?)\s+([A-Za-z0-9:_-]+)/g)) {
140
+ for (const scriptName of nestedScriptNames(body)) {
123
141
  // `seen` holds this script's ancestors only. A script reached twice through different branches (a
124
142
  // diamond: `ci` runs `build` and `test`, and `test` runs `build` too) is not a cycle.
125
- nested.push(...resolveScript(repoPath, m[1], bodyEvidence, new Set(seen)));
143
+ nested.push(...resolveScript(repoPath, scriptName, bodyEvidence, new Set(seen)));
126
144
  }
127
145
  const expressions = expressionReferences(body, bodyEvidence);
128
146
  const blockers = [...nested, ...expressions].filter((n) => n.resolution !== "RESOLVED");
@@ -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