sedum-cli 0.1.0-alpha.21 → 0.1.0-alpha.22

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.
@@ -323,10 +323,6 @@ Fix: ${diagnostic.fix}`
323
323
  }
324
324
  throw error;
325
325
  }
326
- let candidateIndex = 0;
327
- const probabilities = tests.map(
328
- (_, index) => forced[index] ? 1 : scores.probabilities[candidateIndex++]
329
- );
330
326
  return {
331
327
  base: branch.base,
332
328
  head: branch.head,
@@ -337,14 +333,33 @@ Fix: ${diagnostic.fix}`
337
333
  aggregation: "max",
338
334
  threshold: options.threshold,
339
335
  calls: scores.calls,
340
- tests: tests.map((test, index) => ({
341
- file: test.file,
342
- probability: probabilities[index],
343
- selected: forced[index] || branch.diff !== "" && probabilities[index] >= options.threshold,
344
- reason: forced[index] ? "test-or-module-changed" : branch.diff ? "model" : branch.ignoredFiles.length ? "all-ignored" : "no-diff"
345
- }))
336
+ tests: decideTests(tests, forced, scores, {
337
+ diff: branch.diff,
338
+ ignored: branch.ignoredFiles.length > 0,
339
+ threshold: options.threshold
340
+ })
346
341
  };
347
342
  }
343
+ function decideTests(tests, forced, scores, context) {
344
+ const oversized = new Set(scores.oversized ?? []);
345
+ const fallback = context.diff ? "model" : context.ignored ? "all-ignored" : "no-diff";
346
+ let candidate = 0;
347
+ return tests.map((test, index) => {
348
+ if (forced[index]) return run(test, "test-or-module-changed");
349
+ const current = candidate++;
350
+ if (oversized.has(current)) return run(test, "too-large-to-score");
351
+ const probability = scores.probabilities[current];
352
+ return {
353
+ file: test.file,
354
+ probability,
355
+ selected: context.diff !== "" && probability >= context.threshold,
356
+ reason: fallback
357
+ };
358
+ });
359
+ }
360
+ function run(test, reason) {
361
+ return { file: test.file, probability: 1, selected: true, reason };
362
+ }
348
363
  export {
349
364
  AffectedSelectionError,
350
365
  readBranchDiff,
@@ -939,7 +939,7 @@ async function runCli(args, version, runtime = {}) {
939
939
  return;
940
940
  }
941
941
  if (options.affected) {
942
- const { selectAffectedTests, AffectedSelectionError } = await import("./affected-selection-NTBVWIK5.js");
942
+ const { selectAffectedTests, AffectedSelectionError } = await import("./affected-selection-7XPP7NKZ.js");
943
943
  const { ProviderError: ProviderError2 } = await import("@sedum-dev/core");
944
944
  writeErr(
945
945
  "Experimental selection sends the committed Git diff and complete test/module sources to the configured provider. Tracked local edits are refused. Full CI is still recommended.\n"
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runCli,
4
4
  sedumCommand
5
- } from "./chunk-PX6PJ7U2.js";
5
+ } from "./chunk-7RXHCQFR.js";
6
6
  import "./chunk-JYWNBHN7.js";
7
7
  import "./chunk-FOGLJA3Z.js";
8
8
  import "./chunk-EFRMSNBD.js";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  renderRunSummary,
3
3
  runCli,
4
4
  runExitCode
5
- } from "./chunk-PX6PJ7U2.js";
5
+ } from "./chunk-7RXHCQFR.js";
6
6
  import "./chunk-JYWNBHN7.js";
7
7
  import "./chunk-FOGLJA3Z.js";
8
8
  import "./chunk-EFRMSNBD.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sedum-cli",
3
- "version": "0.1.0-alpha.21",
3
+ "version": "0.1.0-alpha.22",
4
4
  "description": "Plain-English browser tests on Playwright. Write steps as sentences, keep TypeScript, and run the suite on every pull request.",
5
5
  "keywords": [
6
6
  "playwright",
@@ -44,10 +44,10 @@
44
44
  "minimatch": "10.2.6",
45
45
  "yaml": "2.9.1",
46
46
  "zod": "4.6.7",
47
- "@sedum-dev/core": "0.1.0-alpha.21",
48
- "@sedum-dev/provider-clef": "0.1.0-alpha.21",
49
- "@sedum-dev/provider-typesafe": "0.1.0-alpha.21",
50
- "@sedum-dev/reporters": "0.1.0-alpha.21"
47
+ "@sedum-dev/core": "0.1.0-alpha.22",
48
+ "@sedum-dev/provider-typesafe": "0.1.0-alpha.22",
49
+ "@sedum-dev/provider-clef": "0.1.0-alpha.22",
50
+ "@sedum-dev/reporters": "0.1.0-alpha.22"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "tsup src/index.ts src/cli.ts --format esm --dts --clean --out-dir dist",