@diffci.com/diffci 0.3.28 → 0.3.30

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 (96) hide show
  1. package/dist-client/src/client/cli.js +53 -5
  2. package/dist-client/src/client/command-batches.d.ts +17 -0
  3. package/dist-client/src/client/command-batches.js +73 -9
  4. package/dist-client/src/client/failure-baseline.js +0 -0
  5. package/dist-client/src/client/outcome-log.d.ts +40 -0
  6. package/dist-client/src/client/outcome-log.js +38 -1
  7. package/dist-client/src/client/selected-coverage.d.ts +3 -0
  8. package/dist-client/src/client/selected-coverage.js +35 -5
  9. package/dist-client/src/client/test-ranking.d.ts +39 -0
  10. package/dist-client/src/client/test-ranking.js +127 -0
  11. package/dist-client/src/client/test-results.d.ts +27 -0
  12. package/dist-client/src/client/test-results.js +54 -0
  13. package/dist-client/src/client/test-shards.d.ts +36 -0
  14. package/dist-client/src/client/test-shards.js +68 -0
  15. package/dist-client/src/client/verify-savings.d.ts +6 -0
  16. package/dist-client/src/client/verify-savings.js +4 -0
  17. package/dist-client/src/client/verify.d.ts +32 -1
  18. package/dist-client/src/client/verify.js +141 -13
  19. package/node_modules/@babel/helper-string-parser/lib/index.js +5 -5
  20. package/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -1
  21. package/node_modules/@babel/helper-string-parser/package.json +1 -1
  22. package/node_modules/@babel/parser/lib/index.js +6306 -6143
  23. package/node_modules/@babel/parser/lib/index.js.map +1 -1
  24. package/node_modules/@babel/parser/package.json +3 -3
  25. package/node_modules/@babel/types/lib/definitions/typescript.js +2 -1
  26. package/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
  27. package/node_modules/@babel/types/package.json +3 -3
  28. package/node_modules/@diffci.com/core/dist/cache/graph-cache.d.ts +1 -1
  29. package/node_modules/@diffci.com/core/dist/cache/graph-cache.js +2 -1
  30. package/node_modules/@diffci.com/core/dist/cache/graph-cache.js.map +1 -1
  31. package/node_modules/@diffci.com/core/dist/repo/file-references.js +39 -2
  32. package/node_modules/@diffci.com/core/dist/repo/file-references.js.map +1 -1
  33. package/node_modules/@diffci.com/core/dist/repo/graph.js +22 -4
  34. package/node_modules/@diffci.com/core/dist/repo/graph.js.map +1 -1
  35. package/node_modules/@diffci.com/core/dist/repo/impact-types.d.ts +1 -1
  36. package/node_modules/@diffci.com/core/dist/repo/impact.d.ts +13 -0
  37. package/node_modules/@diffci.com/core/dist/repo/impact.js +104 -9
  38. package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
  39. package/node_modules/@diffci.com/core/dist/repo/repo-config.d.ts +11 -0
  40. package/node_modules/@diffci.com/core/dist/repo/repo-config.js +11 -1
  41. package/node_modules/@diffci.com/core/dist/repo/repo-config.js.map +1 -1
  42. package/node_modules/@diffci.com/core/dist/repo/route-visits.d.ts +34 -0
  43. package/node_modules/@diffci.com/core/dist/repo/route-visits.js +93 -0
  44. package/node_modules/@diffci.com/core/dist/repo/route-visits.js.map +1 -0
  45. package/node_modules/@diffci.com/core/package.json +3 -3
  46. package/node_modules/@diffci.com/core/src/cache/graph-cache.ts +2 -1
  47. package/node_modules/@diffci.com/core/src/repo/file-references.ts +32 -2
  48. package/node_modules/@diffci.com/core/src/repo/graph.ts +20 -3
  49. package/node_modules/@diffci.com/core/src/repo/impact-types.ts +2 -0
  50. package/node_modules/@diffci.com/core/src/repo/impact.ts +95 -9
  51. package/node_modules/@diffci.com/core/src/repo/repo-config.ts +23 -1
  52. package/node_modules/@diffci.com/core/src/repo/route-visits.ts +88 -0
  53. package/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js +4 -3
  54. package/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +4 -3
  55. package/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js +4 -3
  56. package/node_modules/@vue/compiler-core/package.json +4 -4
  57. package/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js +9 -6
  58. package/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +41 -4
  59. package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +10 -7
  60. package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +12 -11
  61. package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +5 -3
  62. package/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js +10 -7
  63. package/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js +12 -11
  64. package/node_modules/@vue/compiler-dom/package.json +3 -3
  65. package/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +155 -20
  66. package/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +431 -98
  67. package/node_modules/@vue/compiler-sfc/package.json +10 -10
  68. package/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1 -1
  69. package/node_modules/@vue/compiler-ssr/package.json +3 -3
  70. package/node_modules/@vue/shared/dist/shared.cjs.js +51 -32
  71. package/node_modules/@vue/shared/dist/shared.cjs.prod.js +51 -32
  72. package/node_modules/@vue/shared/dist/shared.d.ts +2 -1
  73. package/node_modules/@vue/shared/dist/shared.esm-bundler.js +51 -32
  74. package/node_modules/@vue/shared/package.json +1 -1
  75. package/node_modules/nanoid/async/index.d.cts +56 -0
  76. package/node_modules/nanoid/index.cjs +12 -7
  77. package/node_modules/nanoid/index.js +1 -1
  78. package/node_modules/nanoid/package.json +3 -3
  79. package/node_modules/postcss/lib/input.js +1 -1
  80. package/node_modules/postcss/lib/lazy-result.js +1 -1
  81. package/node_modules/postcss/lib/list.js +19 -1
  82. package/node_modules/postcss/lib/map-generator.js +9 -3
  83. package/node_modules/postcss/lib/no-work-result.js +1 -1
  84. package/node_modules/postcss/lib/node.js +2 -2
  85. package/node_modules/postcss/lib/parser.js +6 -1
  86. package/node_modules/postcss/lib/processor.js +1 -1
  87. package/node_modules/postcss/lib/stringifier.js +16 -28
  88. package/node_modules/postcss/lib/stringify.js +84 -2
  89. package/node_modules/postcss/lib/warning.js +1 -0
  90. package/node_modules/postcss/package.json +3 -3
  91. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +19 -18
  92. package/node_modules/yaml/browser/dist/nodes/Alias.js +25 -23
  93. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +19 -18
  94. package/node_modules/yaml/dist/nodes/Alias.js +25 -23
  95. package/node_modules/yaml/package.json +1 -1
  96. package/package.json +2 -2
@@ -945,6 +945,18 @@ export async function buildDependencyGraph(
945
945
  // aliases. Any other diagnostic remains a hard blocker.
946
946
  return errors.every(error => error.code === 18003 || error.code === 5083 || error.code === 6053);
947
947
  }
948
+ // The bundled TypeScript (5.9) rejects `target`/`lib` values that newer compilers accept, such as
949
+ // TypeScript 6's "es2025" (jshttp/cookie, first GitLab run 2026-11-05: every plan FULL). Neither
950
+ // option names a file or alias, so the rejection does not change what an import resolves to - with
951
+ // one exception: an unset `module` defaults from `target`, and `moduleResolution` from `module`.
952
+ // The diagnostic is therefore ignored only when the project states `module` or `moduleResolution`
953
+ // itself. Every other 6046 (an unknown `module` or `moduleResolution` value) stays fatal.
954
+ function isNewerTargetOrLibValue(error: ts.Diagnostic, parsedOptions: ts.CompilerOptions): boolean {
955
+ if (error.code !== 6046) return false;
956
+ if (parsedOptions.module === undefined && parsedOptions.moduleResolution === undefined) return false;
957
+ const text = ts.flattenDiagnosticMessageText(error.messageText, "\n");
958
+ return /'--(?:target|lib)'/.test(text);
959
+ }
948
960
  // Nearest tsconfig.json per importer directory. Probing the disk for every importer walked to the
949
961
  // repository root once per file: about a third of graph build time on a 2,000-file repository (2026-10-21).
950
962
  const nearestConfig = new Map<string, ts.CompilerOptions>();
@@ -962,13 +974,18 @@ export async function buildDependencyGraph(
962
974
  if (!projectOptions.has(config)) {
963
975
  const read = ts.readConfigFile(toPosix(config), ts.sys.readFile);
964
976
  const parsed = read.error ? undefined : ts.parseJsonConfigFileContent(read.config, ts.sys, directory, undefined, config);
977
+ const errors = parsed ? parsed.errors.filter(error => !isNewerTargetOrLibValue(error, parsed.options)) : [];
965
978
  // No-input diagnostics do not invalidate module-resolution options.
966
- const invalid = !parsed || parsed.errors.some(error => error.code !== 18003)
967
- && !hasUnavailableExternalBase(read.config, parsed.errors);
979
+ const invalid = !parsed || errors.some(error => error.code !== 18003)
980
+ && !hasUnavailableExternalBase(read.config, errors);
968
981
  if (invalid) {
969
982
  adapterBlockers.push(`Invalid importer TypeScript configuration: ${toRelativeInternal(repoPath, config)}`);
970
983
  projectOptions.set(config, compilerOptions);
971
- } else projectOptions.set(config, parsed.options);
984
+ } else {
985
+ // A target newer than the bundled compiler knows is at least its newest one.
986
+ const droppedTarget = parsed.errors.some(error => !errors.includes(error) && /'--target'/.test(ts.flattenDiagnosticMessageText(error.messageText, "\n")));
987
+ projectOptions.set(config, droppedTarget && parsed.options.target === undefined ? { ...parsed.options, target: ts.ScriptTarget.ESNext } : parsed.options);
988
+ }
972
989
  }
973
990
  return projectOptions.get(config)!;
974
991
  }
@@ -24,6 +24,8 @@ export type ImpactReason =
24
24
  | "OUTSIDE_FULL_SUITE"
25
25
  | "TEST_FIXTURE_OWNER"
26
26
  | "ALWAYS_RUN_POLICY"
27
+ | "DECLARED_INPUT"
28
+ | "ROUTE_VISIT"
27
29
  | "DELETED_FILE_LEGACY_DEPENDENTS"
28
30
  | "DELETED_FILE_UNKNOWABLE_GRAPH"
29
31
  | "RENAMED_FILE_LEGACY_IDENTITY"
@@ -12,6 +12,7 @@ import { directoryWalkers, DIRECTING_EXTENSIONS, infrastructureRole, listsDirect
12
12
  import { workflowFeedsTests } from "./workflow-test-steps.js";
13
13
  import { modelTestScriptUniverse, type ScriptUniverse } from "./script-universe.js";
14
14
  import { compiledProjects, type CompiledProject } from "./compiled-projects.js";
15
+ import { isPlaywrightSpec, nextAppRoute, routeMatches, visitedRoutes } from "./route-visits.js";
15
16
 
16
17
  const SOURCE_EXTENSIONS = new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts",".vue",".go",".java",".kt"]);
17
18
  const ASSET_EXTENSIONS = new Set([".css",".scss",".sass",".less",".json",".jsonc",".svg",".png",".jpg",".jpeg",".gif",".webp",".ico",".bmp",".woff",".woff2",".ttf",".otf",".eot",".wasm",".md",".txt"]);
@@ -267,6 +268,33 @@ export class ImpactAnalyzer {
267
268
  private runtimeTestSelection = false;
268
269
  private unresolved: readonly UnresolvedDependency[] = [];
269
270
  private walkerTests: string[] | undefined;
271
+ private knownTests: string[] | undefined;
272
+ private declaredCovered = new Set<string>();
273
+
274
+ /** Test files known to the graph: nodes matching the profile's test globs or the test-file matcher. */
275
+ private knownTestPaths(profile: RepositoryProfile, graph: DependencyGraph): string[] {
276
+ if (this.knownTests) return this.knownTests;
277
+ const known = new Set<string>();
278
+ for (const testLocation of profile.tests) {
279
+ for (const node of graph.nodes) {
280
+ if (matchesTestGlob(node.path, testLocation.glob) || this.isTestFile(node.path)) known.add(node.path);
281
+ }
282
+ }
283
+ this.knownTests = [...known].sort();
284
+ return this.knownTests;
285
+ }
286
+
287
+ /**
288
+ * The tests the repository's declared inputs (src/repo/repo-config.ts, `inputs`) select for a changed
289
+ * path, or undefined when no declaration names the path (2026-11-05). An empty array means a declaration
290
+ * names it but its `tests` globs match nothing: a stale declaration, which must not stand in for evidence.
291
+ */
292
+ private declaredTests(path: string, profile: RepositoryProfile, graph: DependencyGraph): string[] | undefined {
293
+ const inputs = (profile.diffciConfig?.inputs ?? []).filter((input) => input.files.some((glob) => matchesTestGlob(path, glob)));
294
+ if (inputs.length === 0) return undefined;
295
+ const globs = inputs.flatMap((input) => input.tests);
296
+ return this.knownTestPaths(profile, graph).filter((test) => globs.some((glob) => matchesTestGlob(test, glob)));
297
+ }
270
298
 
271
299
  /** Dependents whose tests a change to `path` can affect. When the graph allows runtime selection
272
300
  * (DependencyGraphResult.runtimeTestSelection) an `import type` edge selects only type tests. */
@@ -298,6 +326,8 @@ export class ImpactAnalyzer {
298
326
  this.testPhases = new Set();
299
327
  this.workersOutsideSuite = undefined;
300
328
  this.walkerTests = undefined;
329
+ this.knownTests = undefined;
330
+ this.declaredCovered = new Set();
301
331
  this.runtimeTestSelection = graphResult.runtimeTestSelection === true;
302
332
  this.unresolved = graphResult.unresolved ?? [];
303
333
  this.sortedRepositoryFiles = options.repositoryFiles ? [...options.repositoryFiles].sort() : [];
@@ -347,6 +377,18 @@ export class ImpactAnalyzer {
347
377
  }
348
378
  }
349
379
 
380
+ // Declared inputs (2026-11-05): a changed path a declaration names, with at least one test behind it,
381
+ // is covered - its tests are selected below instead of the unknown-file or database/infrastructure
382
+ // fallback. A declaration whose tests match nothing is stale and falls back.
383
+ for (const path of new Set(delta.files.flatMap(allChangePaths))) {
384
+ const tests = this.declaredTests(path, profile, graph);
385
+ if (tests === undefined) continue;
386
+ if (tests.length > 0) { this.declaredCovered.add(path); continue; }
387
+ const message = `Declared input ${path} selects no tests; full validation required`;
388
+ riskSignals.push({ level: "critical", reason: "DECLARED_INPUT", message, paths: [path] });
389
+ if (!fallbackReasons.includes(message)) fallbackReasons.push(message);
390
+ }
391
+
350
392
  this.applyGlobalRiskRules(delta, riskSignals, fallbackReasons);
351
393
 
352
394
  // Stage 1B fix (2026-08-21, docs/research/2026-08-21-stage1b-*.md): refine the graph's raw,
@@ -394,6 +436,7 @@ export class ImpactAnalyzer {
394
436
  this.collectDependencyChangeTests(delta, graphResult, profile, affectedSources, affectedEntryPoints, affectedTests, affectedScripts, evidence, riskSignals, fallbackReasons);
395
437
  this.handleStructuralNextLayout(changedImpacts, profile, affectedEntryPoints, affectedSources, evidence);
396
438
  this.handleAddedEntryPoints(delta, affectedEntryPoints, affectedSources, affectedTests, evidence, fallbackReasons);
439
+ this.collectRouteVisitTests(profile, graph, affectedEntryPoints, affectedTests, evidence);
397
440
  this.collectAlwaysRunTests(profile, graph, affectedTests, evidence, graphResult.profile.vueRuntimeAlwaysRunPaths ?? []);
398
441
  this.collectComputedImportTests(graphResult, graph, changedImpacts, affectedTests, evidence, riskSignals, fallbackReasons);
399
442
 
@@ -474,6 +517,12 @@ export class ImpactAnalyzer {
474
517
  paths = paths.filter((path) => !isWorkerConfig(path));
475
518
  if (paths.length === 0) continue;
476
519
  }
520
+ if ((rule.signal === "infrastructure" || rule.signal === "database") && paths.length > 0) {
521
+ // A database or deployment definition the repository declared inputs for selects those tests in
522
+ // processChangedPath. Configuration, manifests, lockfiles and workflows stay global (2026-11-05).
523
+ paths = paths.filter((path) => !this.declaredCovered.has(path));
524
+ if (paths.length === 0) continue;
525
+ }
477
526
  const message = paths.length === 0 ? rule.message
478
527
  : `${rule.message}: ${paths.slice(0, 5).join(", ")}${paths.length > 5 ? ` (+${paths.length - 5} more)` : ""}`;
479
528
  riskSignals.push({ level: "critical", reason: rule.reason, message, ...(paths.length ? { paths: [...paths] } : {}) });
@@ -673,6 +722,12 @@ export class ImpactAnalyzer {
673
722
  riskSignals: ImpactRiskSignal[],
674
723
  fallbackReasons: string[],
675
724
  ): void {
725
+ // Declared inputs add their tests to whatever the graph finds. For a covered path they also stand in
726
+ // for the reader evidence whose absence would otherwise fall back below (2026-11-05).
727
+ for (const test of this.declaredTests(changedPath, profile, graph) ?? []) {
728
+ this.addAffectedTest(changedPath, test, graph, affectedTests, "DECLARED_INPUT", evidence);
729
+ }
730
+ const covered = this.declaredCovered.has(changedPath);
676
731
  // Go's embed metadata is ownership evidence regardless of suffix or documentation naming.
677
732
  // Traverse it before generic unknown/docs classification can discard the dependency.
678
733
  if (this.goEmbedPaths.has(changedPath)) {
@@ -731,6 +786,7 @@ export class ImpactAnalyzer {
731
786
  const specifiersOnly = changedPath === "package.json" && this.packageJsonSpecifiersOnly;
732
787
  const options = specifiersOnly ? { allowNoReaders: true, implicitReadersUnresolvable: true } : {};
733
788
  if (this.resolveByReference(changedPath, graph, profile, affectedSources, affectedEntryPoints, affectedTests, affectedScripts, evidence, options)) return;
789
+ if (covered) return;
734
790
  const message = `Unknown changed file: ${changedPath}`;
735
791
  evidence.push(makeEvidence("UNKNOWN_FILE", changedPath, message));
736
792
  riskSignals.push({ level: "critical", reason: "UNKNOWN_FILE", message, paths: [changedPath] });
@@ -745,6 +801,7 @@ export class ImpactAnalyzer {
745
801
  // and require nothing, which is a silent skip; it now needs reader evidence like any other
746
802
  // non-code file (2026-10-21).
747
803
  if (this.resolveByReference(changedPath, graph, profile, affectedSources, affectedEntryPoints, affectedTests, affectedScripts, evidence)) return;
804
+ if (covered) return;
748
805
  const message = `Unknown changed file: ${changedPath}`;
749
806
  evidence.push(makeEvidence("UNKNOWN_FILE", changedPath, message));
750
807
  riskSignals.push({ level: "critical", reason: "UNKNOWN_FILE", message, paths: [changedPath] });
@@ -754,6 +811,7 @@ export class ImpactAnalyzer {
754
811
  if (isAssetFilePath(changedPath)) {
755
812
  if (removed && !hasNode(graph, changedPath)) {
756
813
  if (this.resolveRemovedFile(changedPath, graph, profile, affectedSources, affectedEntryPoints, affectedTests, affectedScripts, evidence)) return;
814
+ if (covered) return;
757
815
  const message = `Deleted source/asset ${changedPath} not present in HEAD dependency graph; legacy dependents cannot be determined`;
758
816
  evidence.push(makeEvidence("DELETED_FILE_UNKNOWABLE_GRAPH", changedPath, message));
759
817
  riskSignals.push({ level: "critical", reason: "DELETED_FILE_UNKNOWABLE_GRAPH", message, paths: [changedPath] });
@@ -765,6 +823,7 @@ export class ImpactAnalyzer {
765
823
  }
766
824
  if (category === "infrastructure" && isWorkerConfig(changedPath) && this.workerConfigsOutsideSuite()) {
767
825
  if (this.resolveByReference(changedPath, graph, profile, affectedSources, affectedEntryPoints, affectedTests, affectedScripts, evidence)) return;
826
+ if (covered) return;
768
827
  const message = `Unknown changed file: ${changedPath}`;
769
828
  evidence.push(makeEvidence("UNKNOWN_FILE", changedPath, message));
770
829
  riskSignals.push({ level: "critical", reason: "UNKNOWN_FILE", message, paths: [changedPath] });
@@ -782,6 +841,7 @@ export class ImpactAnalyzer {
782
841
  // its readers are resolved like any other non-code file. A deployment definition that names it
783
842
  // (wrangler.*, Dockerfile) runs it without naming anything a test would, so that stays global.
784
843
  if (this.resolveByReference(changedPath, graph, profile, affectedSources, affectedEntryPoints, affectedTests, affectedScripts, evidence, { implicitReadersUnresolvable: true })) return;
844
+ if (covered) return;
785
845
  const message = `Infrastructure code ${changedPath} is outside the dependency graph; full validation required`;
786
846
  evidence.push(makeEvidence("INFRASTRUCTURE_GLOBAL", changedPath, message));
787
847
  riskSignals.push({ level: "critical", reason: "INFRASTRUCTURE_GLOBAL", message, paths: [changedPath] });
@@ -794,6 +854,7 @@ export class ImpactAnalyzer {
794
854
  }
795
855
  if (changedImpact.file.changeType === "deleted" && !hasNode(graph, changedPath)) {
796
856
  if (this.resolveRemovedFile(changedPath, graph, profile, affectedSources, affectedEntryPoints, affectedTests, affectedScripts, evidence)) return;
857
+ if (covered) return;
797
858
  const message = `Deleted source/asset ${changedPath} not present in HEAD dependency graph; legacy dependents cannot be determined`;
798
859
  evidence.push(makeEvidence("DELETED_FILE_UNKNOWABLE_GRAPH", changedPath, message));
799
860
  riskSignals.push({ level: "critical", reason: "DELETED_FILE_UNKNOWABLE_GRAPH", message, paths: [changedPath] });
@@ -1205,6 +1266,39 @@ export class ImpactAnalyzer {
1205
1266
  }
1206
1267
  }
1207
1268
 
1269
+ /** Playwright specs that visit an affected Next.js route (route-visits.ts, 2026-11-06). Without the
1270
+ * repository's contents no spec can be read, which leaves selection as the graph made it. */
1271
+ private collectRouteVisitTests(
1272
+ profile: RepositoryProfile,
1273
+ graph: DependencyGraph,
1274
+ affectedEntryPoints: Map<string, EntryPointImpact>,
1275
+ affectedTests: Map<string, TestImpact>,
1276
+ evidence: ImpactEvidence[],
1277
+ ): void {
1278
+ const read = this.readRepositoryFile;
1279
+ if (!read) return;
1280
+ const entries = [...affectedEntryPoints.values()].filter((entry) => entry.kind.startsWith("next-"));
1281
+ if (entries.length === 0) return;
1282
+ const specs = this.knownTestPaths(profile, graph).flatMap((path) => {
1283
+ const source = read(path);
1284
+ return source !== undefined && isPlaywrightSpec(source) ? [{ path, visits: visitedRoutes(source) }] : [];
1285
+ });
1286
+ if (specs.length === 0) return;
1287
+ for (const entry of entries) {
1288
+ const route = nextAppRoute(entry.path, entry.kind);
1289
+ for (const spec of specs) {
1290
+ const visited = route ? spec.visits.paths.find((path) => routeMatches(route, path)) : undefined;
1291
+ const why = !route ? `${entry.path} has no route DiffCI can derive, so every end-to-end spec may reach it`
1292
+ : visited ? `${spec.path} visits ${visited}, served by ${entry.path}`
1293
+ : spec.visits.computed ? `${spec.path} visits a URL built at run time, which may be served by ${entry.path}`
1294
+ : undefined;
1295
+ if (!why) continue;
1296
+ this.addAffectedTest(entry.path, spec.path, graph, affectedTests, "ROUTE_VISIT", evidence);
1297
+ evidence.push(makeEvidence("ROUTE_VISIT", entry.path, why, spec.path));
1298
+ }
1299
+ }
1300
+ }
1301
+
1208
1302
  private collectAlwaysRunTests(
1209
1303
  profile: RepositoryProfile,
1210
1304
  graph: DependencyGraph,
@@ -1213,16 +1307,8 @@ export class ImpactAnalyzer {
1213
1307
  graphRuntimeTests: readonly string[],
1214
1308
  ): void {
1215
1309
  const alwaysRunPaths = new Set<string>([...(profile.vueTypeTestPaths ?? []), ...(profile.vueRuntimeAlwaysRunPaths ?? []), ...graphRuntimeTests]);
1216
- const knownTestPaths = new Set<string>();
1217
- for (const testLocation of profile.tests) {
1218
- for (const node of graph.nodes) {
1219
- if (matchesTestGlob(node.path, testLocation.glob) || this.isTestFile(node.path)) {
1220
- knownTestPaths.add(node.path);
1221
- }
1222
- }
1223
- }
1224
1310
  for (const check of [...this.alwaysRunChecks, ...alwaysRunChecksFromProfile(profile)]) {
1225
- for (const path of knownTestPaths) {
1311
+ for (const path of this.knownTestPaths(profile, graph)) {
1226
1312
  if (check.patterns.some((pattern) => pattern.test(path))) { alwaysRunPaths.add(path); continue; }
1227
1313
  if (check.globs?.some((glob) => matchesTestGlob(path, glob))) alwaysRunPaths.add(path);
1228
1314
  }
@@ -24,9 +24,21 @@
24
24
  import { existsSync, readFileSync } from "node:fs";
25
25
  import { join } from "node:path";
26
26
 
27
+ /**
28
+ * A declared edge (2026-11-05): when a changed path matches `files`, the tests matching `tests` are
29
+ * selected. For edges static analysis cannot see - fixtures loaded by name, env files, codegen inputs,
30
+ * schemas - the way Nx `namedInputs` and Turborepo `inputs` let a repository say what a task reads.
31
+ */
32
+ export interface DeclaredInput {
33
+ files: string[];
34
+ tests: string[];
35
+ }
36
+
27
37
  export interface DiffCiRepositoryConfig {
28
38
  /** Globs for tests that must be selected on every analysed change, regardless of reachability. */
29
39
  alwaysRunTests?: string[];
40
+ /** Edges the repository declares about itself; see DeclaredInput and ImpactAnalyzer.declaredTests. */
41
+ inputs?: DeclaredInput[];
30
42
  /** Explicitly limit Go selection to the root module's `go test ./...` universe. */
31
43
  go?: { scope: "root-module" };
32
44
  /** One package's default Vitest suite; paths are relative to the repository/package respectively. */
@@ -62,8 +74,18 @@ function parseConfig(raw: unknown): DiffCiRepositoryConfig {
62
74
  const safePath = (value: unknown): value is string => typeof value === "string" && /^(?:[A-Za-z0-9_][A-Za-z0-9_.-]*)(?:\/[A-Za-z0-9_][A-Za-z0-9_.-]*)*$/.test(value) && !value.split("/").some(part => part === "." || part === "..");
63
75
  const validVue = vue && (vue.packageRoot === "." || safePath(vue.packageRoot)) && safePath(vue.testConfig) && /^vitest\.config\.[cm]?[jt]s$/.test(vue.testConfig);
64
76
  const validMaven = maven && (maven.goal === "test" || maven.goal === "verify") && (maven.profiles === undefined || Array.isArray(maven.profiles) && maven.profiles.every((profile: unknown) => typeof profile === "string" && /^[A-Za-z0-9_.-]+$/.test(profile)));
77
+ // Unlike a malformed file, a malformed `inputs` block is an error: dropping one entry would turn a
78
+ // declared edge into a silent skip, so the analysis falls back instead (graph.ts, adapterBlockers).
79
+ const globs = (value: unknown): value is string[] => Array.isArray(value) && value.length > 0
80
+ && value.every((entry) => typeof entry === "string" && entry.trim() !== "");
81
+ const inputs = record.inputs;
82
+ const validInputs = Array.isArray(inputs) && inputs.every((entry: unknown) => entry !== null && typeof entry === "object"
83
+ && globs((entry as Record<string, unknown>).files) && globs((entry as Record<string, unknown>).tests));
65
84
  return {
66
85
  ...(alwaysRunTests && alwaysRunTests.length > 0 ? { alwaysRunTests } : {}),
86
+ ...(validInputs && inputs.length > 0
87
+ ? { inputs: (inputs as DeclaredInput[]).map(({ files, tests }) => ({ files: [...files], tests: [...tests] })) }
88
+ : inputs !== undefined && !validInputs ? { configurationError: "Invalid inputs: each entry needs non-empty files and tests glob lists" } : {}),
67
89
  ...(go?.scope === "root-module" ? { go: { scope: "root-module" as const } } : {}),
68
90
  ...(validVue ? { vue: { packageRoot: vue.packageRoot as string, testConfig: vue.testConfig as string } } : record.vue !== undefined ? { configurationError: "Invalid Vue package/suite scope" } : {}),
69
91
  ...(validMaven ? { maven: { goal: maven.goal as "test" | "verify", ...(maven.profiles ? { profiles: maven.profiles as string[] } : {}) } } : record.maven !== undefined ? { configurationError: "Invalid Maven lifecycle goal or profiles" } : {}),
@@ -78,7 +100,7 @@ export function readRepositoryConfig(repoPath: string, packageJson?: Record<stri
78
100
  const dedicated = readJsonFile(join(repoPath, "diffci.json"));
79
101
  if (dedicated) {
80
102
  const parsed = parseConfig(dedicated);
81
- if (parsed.alwaysRunTests || parsed.go || parsed.vue || parsed.maven || parsed.configurationError) return parsed;
103
+ if (parsed.alwaysRunTests || parsed.inputs || parsed.go || parsed.vue || parsed.maven || parsed.configurationError) return parsed;
82
104
  }
83
105
  const pkg = packageJson ?? readJsonFile(join(repoPath, "package.json"));
84
106
  return parseConfig(pkg?.diffci);
@@ -0,0 +1,88 @@
1
+ // SPDX-License-Identifier: MIT
2
+ /**
3
+ * End-to-end specs selected by the routes they visit (2026-11-06).
4
+ *
5
+ * WHY. A Playwright spec reaches the application through a URL, not an import: `page.goto("/blog/x")`
6
+ * exercises `app/blog/[slug]/page.tsx` without naming it. The dependency graph sees no edge, so a change
7
+ * to that page selected no end-to-end spec at all, a silent skip wherever the suite runs them.
8
+ *
9
+ * WHAT. A spec is a Playwright spec when it imports `@playwright/test`. The URLs it visits are read from
10
+ * literal `.goto(...)` and `request.get/post/...(...)` calls. A Next.js App Router entry point maps to a
11
+ * route pattern (route groups and parallel slots dropped, `[x]`, `[...x]` and `[[...x]]` matched as Next
12
+ * matches them); a page or route handler matches its own route, a layout, loading, error, template or
13
+ * not-found file every route under it, and middleware every route. A spec visiting a URL built at run time
14
+ * (a template with `${}` or a variable) is selected whenever any entry point is affected, as is every spec
15
+ * when an affected entry point's route cannot be derived: an unknown visit is not a negative.
16
+ */
17
+
18
+ export interface RouteVisits {
19
+ /** Literal paths the spec visits, origin, query and hash removed. */
20
+ paths: string[];
21
+ /** True when some visit's URL is computed at run time. */
22
+ computed: boolean;
23
+ }
24
+
25
+ const PLAYWRIGHT_IMPORT = /(?:from\s+|require\(\s*|import\(\s*)['"]@playwright\/test['"]/;
26
+
27
+ export function isPlaywrightSpec(source: string): boolean {
28
+ return PLAYWRIGHT_IMPORT.test(source);
29
+ }
30
+
31
+ function normalizeVisit(url: string): string {
32
+ const withoutOrigin = url.replace(/^[a-z][a-z0-9+.-]*:\/\/[^/?#]*/i, "");
33
+ const path = withoutOrigin.replace(/[?#].*$/, "");
34
+ const absolute = path.startsWith("/") ? path : `/${path}`;
35
+ return absolute.length > 1 ? absolute.replace(/\/+$/, "") : "/";
36
+ }
37
+
38
+ export function visitedRoutes(source: string): RouteVisits {
39
+ const paths = new Set<string>();
40
+ let computed = false;
41
+ const call = /(?:\.goto|\brequest\.(?:get|post|put|patch|delete|head|fetch))\(\s*(?:(['"])((?:\\.|(?!\1).)*)\1|`((?:\\.|[^`\\])*)`|([^\s)]))/g;
42
+ for (const match of source.matchAll(call)) {
43
+ const quoted = match[2];
44
+ const template = match[3];
45
+ if (quoted !== undefined) paths.add(normalizeVisit(quoted));
46
+ else if (template !== undefined && !template.includes("${")) paths.add(normalizeVisit(template));
47
+ else computed = true;
48
+ }
49
+ return { paths: [...paths].sort(), computed };
50
+ }
51
+
52
+ export type RouteScope = "exact" | "prefix" | "all";
53
+
54
+ /** The route pattern an App Router entry point serves, or undefined when the path is not under `app/`. */
55
+ export function nextAppRoute(entryPath: string, kind: string): { segments: string[]; scope: RouteScope } | undefined {
56
+ const parts = entryPath.split("/");
57
+ const base = (parts[parts.length - 1] ?? "").replace(/\.[^.]+$/, "");
58
+ if (base === "middleware") return { segments: [], scope: "all" };
59
+ const appIndex = parts.lastIndexOf("app");
60
+ if (appIndex < 0 || appIndex === parts.length - 1) return undefined;
61
+ const segments = parts.slice(appIndex + 1, -1)
62
+ .filter((segment) => !/^\(.*\)$/.test(segment) && !segment.startsWith("@"));
63
+ if (segments.some((segment) => segment.startsWith("("))) return undefined; // intercepting routes
64
+ const exact = kind === "next-page" || kind === "next-route" || kind === "next-api" || base === "page" || base === "route";
65
+ return { segments, scope: exact ? "exact" : "prefix" };
66
+ }
67
+
68
+ /** Whether `path` (a visited URL path) is served by the route `segments` under `scope`. */
69
+ export function routeMatches(route: { segments: string[]; scope: RouteScope }, path: string): boolean {
70
+ if (route.scope === "all") return true;
71
+ const url = path.split("/").filter(Boolean).map((part) => { try { return decodeURIComponent(part); } catch { return part; } });
72
+ const match = (r: number, u: number): boolean => {
73
+ if (r === route.segments.length) return route.scope === "prefix" || u === url.length;
74
+ const segment = route.segments[r]!;
75
+ if (/^\[\[\.\.\..+\]\]$/.test(segment)) {
76
+ for (let next = u; next <= url.length; next += 1) if (match(r + 1, next)) return true;
77
+ return false;
78
+ }
79
+ if (/^\[\.\.\..+\]$/.test(segment)) {
80
+ for (let next = u + 1; next <= url.length; next += 1) if (match(r + 1, next)) return true;
81
+ return false;
82
+ }
83
+ if (u >= url.length) return false;
84
+ if (/^\[.+\]$/.test(segment)) return match(r + 1, u + 1);
85
+ return segment === url[u] && match(r + 1, u + 1);
86
+ };
87
+ return match(0, 0);
88
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.42
2
+ * @vue/compiler-core v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1542,7 +1542,8 @@ const errorMessages = {
1542
1542
  [42]: `v-model value must be a valid JavaScript member expression.`,
1543
1543
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
1544
1544
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
1545
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
1545
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.
1546
+ For props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
1546
1547
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
1547
1548
  [46]: `Error parsing JavaScript expression: `,
1548
1549
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -5041,7 +5042,7 @@ const transformFor = createStructuralDirectiveTransform(
5041
5042
  createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
5042
5043
  createCompoundExpression([
5043
5044
  `if (_cached && _cached.el`,
5044
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
5045
+ ...keyExp ? [` && _cached.key === (`, keyExp, `)`] : [],
5045
5046
  ` && ${context.helperString(
5046
5047
  IS_MEMO_SAME
5047
5048
  )}(_cached, _memo)) return _cached`
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.42
2
+ * @vue/compiler-core v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1538,7 +1538,8 @@ const errorMessages = {
1538
1538
  [42]: `v-model value must be a valid JavaScript member expression.`,
1539
1539
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
1540
1540
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
1541
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
1541
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.
1542
+ For props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
1542
1543
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
1543
1544
  [46]: `Error parsing JavaScript expression: `,
1544
1545
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -4954,7 +4955,7 @@ const transformFor = createStructuralDirectiveTransform(
4954
4955
  createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
4955
4956
  createCompoundExpression([
4956
4957
  `if (_cached && _cached.el`,
4957
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
4958
+ ...keyExp ? [` && _cached.key === (`, keyExp, `)`] : [],
4958
4959
  ` && ${context.helperString(
4959
4960
  IS_MEMO_SAME
4960
4961
  )}(_cached, _memo)) return _cached`
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.42
2
+ * @vue/compiler-core v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1473,7 +1473,8 @@ const errorMessages = {
1473
1473
  [42]: `v-model value must be a valid JavaScript member expression.`,
1474
1474
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
1475
1475
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
1476
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
1476
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.
1477
+ For props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
1477
1478
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
1478
1479
  [46]: `Error parsing JavaScript expression: `,
1479
1480
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -4294,7 +4295,7 @@ const transformFor = createStructuralDirectiveTransform(
4294
4295
  createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
4295
4296
  createCompoundExpression([
4296
4297
  `if (_cached && _cached.el`,
4297
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
4298
+ ...keyExp ? [` && _cached.key === (`, keyExp, `)`] : [],
4298
4299
  ` && ${context.helperString(
4299
4300
  IS_MEMO_SAME
4300
4301
  )}(_cached, _memo)) return _cached`
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.5.42",
3
+ "version": "3.5.44",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -46,11 +46,11 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
48
48
  "dependencies": {
49
- "@babel/parser": "^7.29.8",
49
+ "@babel/parser": "^7.29.9",
50
+ "@vue/shared": "3.5.44",
50
51
  "entities": "^7.0.1",
51
52
  "estree-walker": "^2.0.2",
52
- "source-map-js": "^1.2.1",
53
- "@vue/shared": "3.5.42"
53
+ "source-map-js": "^1.2.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.29.8"
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.42
2
+ * @vue/compiler-dom v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -412,7 +412,8 @@ const transformTransition = (node, context) => {
412
412
  if (!node.children.length) {
413
413
  return;
414
414
  }
415
- if (hasMultipleChildren(node)) {
415
+ const multipleChildren = hasMultipleChildren(node);
416
+ if (multipleChildren) {
416
417
  context.onError(
417
418
  createDOMCompilerError(
418
419
  63,
@@ -607,8 +608,9 @@ function stringifyNode(node, context) {
607
608
  }
608
609
  }
609
610
  function stringifyElement(node, context) {
611
+ var _a;
610
612
  let res = `<${node.tag}`;
611
- let innerHTML = "";
613
+ let innerHTML = void 0;
612
614
  for (let i = 0; i < node.props.length; i++) {
613
615
  const p = node.props[i];
614
616
  if (p.type === 6) {
@@ -642,7 +644,7 @@ function stringifyElement(node, context) {
642
644
  )}"`;
643
645
  }
644
646
  } else if (p.name === "html") {
645
- innerHTML = evaluateConstant(p.exp);
647
+ innerHTML = (_a = evaluateConstant(p.exp)) != null ? _a : "";
646
648
  } else if (p.name === "text") {
647
649
  innerHTML = shared.escapeHtml(
648
650
  shared.toDisplayString(evaluateConstant(p.exp))
@@ -654,7 +656,7 @@ function stringifyElement(node, context) {
654
656
  res += ` ${context.scopeId}`;
655
657
  }
656
658
  res += `>`;
657
- if (innerHTML) {
659
+ if (innerHTML !== void 0) {
658
660
  res += innerHTML;
659
661
  } else {
660
662
  for (let i = 0; i < node.children.length; i++) {
@@ -876,7 +878,8 @@ const validateHtmlNesting = (node, context) => {
876
878
 
877
879
  const DOMNodeTransforms = [
878
880
  transformStyle,
879
- ...[transformTransition, validateHtmlNesting]
881
+ transformTransition,
882
+ ...[validateHtmlNesting]
880
883
  ];
881
884
  const DOMDirectiveTransforms = {
882
885
  cloak: compilerCore.noopDirectiveTransform,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.42
2
+ * @vue/compiler-dom v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -386,6 +386,41 @@ const transformShow = (dir, node, context) => {
386
386
  };
387
387
  };
388
388
 
389
+ const transformTransition = (node, context) => {
390
+ if (node.type === 1 && node.tagType === 1) {
391
+ const component = context.isBuiltInComponent(node.tag);
392
+ if (component === TRANSITION) {
393
+ return () => {
394
+ if (!node.children.length) {
395
+ return;
396
+ }
397
+ hasMultipleChildren(node);
398
+ const child = node.children[0];
399
+ if (child.type === 1) {
400
+ for (const p of child.props) {
401
+ if (p.type === 7 && p.name === "show") {
402
+ node.props.push({
403
+ type: 6,
404
+ name: "persisted",
405
+ nameLoc: node.loc,
406
+ value: void 0,
407
+ loc: node.loc
408
+ });
409
+ }
410
+ }
411
+ }
412
+ };
413
+ }
414
+ }
415
+ };
416
+ function hasMultipleChildren(node) {
417
+ const children = node.children = node.children.filter(
418
+ (c) => !compilerCore.isCommentOrWhitespace(c)
419
+ );
420
+ const child = children[0];
421
+ return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
422
+ }
423
+
389
424
  const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
390
425
  const stringifyStatic = (children, context, parent) => {
391
426
  if (context.scopes.vSlot > 0) {
@@ -543,8 +578,9 @@ function stringifyNode(node, context) {
543
578
  }
544
579
  }
545
580
  function stringifyElement(node, context) {
581
+ var _a;
546
582
  let res = `<${node.tag}`;
547
- let innerHTML = "";
583
+ let innerHTML = void 0;
548
584
  for (let i = 0; i < node.props.length; i++) {
549
585
  const p = node.props[i];
550
586
  if (p.type === 6) {
@@ -578,7 +614,7 @@ function stringifyElement(node, context) {
578
614
  )}"`;
579
615
  }
580
616
  } else if (p.name === "html") {
581
- innerHTML = evaluateConstant(p.exp);
617
+ innerHTML = (_a = evaluateConstant(p.exp)) != null ? _a : "";
582
618
  } else if (p.name === "text") {
583
619
  innerHTML = shared.escapeHtml(
584
620
  shared.toDisplayString(evaluateConstant(p.exp))
@@ -590,7 +626,7 @@ function stringifyElement(node, context) {
590
626
  res += ` ${context.scopeId}`;
591
627
  }
592
628
  res += `>`;
593
- if (innerHTML) {
629
+ if (innerHTML !== void 0) {
594
630
  res += innerHTML;
595
631
  } else {
596
632
  for (let i = 0; i < node.children.length; i++) {
@@ -631,6 +667,7 @@ const ignoreSideEffectTags = (node, context) => {
631
667
 
632
668
  const DOMNodeTransforms = [
633
669
  transformStyle,
670
+ transformTransition,
634
671
  ...[]
635
672
  ];
636
673
  const DOMDirectiveTransforms = {