@diffci.com/diffci 0.3.29 → 0.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/src/client/cli.js +78 -5
- package/dist-client/src/client/command-batches.d.ts +22 -0
- package/dist-client/src/client/command-batches.js +82 -9
- package/dist-client/src/client/coverage-map.d.ts +46 -0
- package/dist-client/src/client/coverage-map.js +213 -0
- package/dist-client/src/client/failure-baseline.js +0 -0
- package/dist-client/src/client/observe.js +3 -0
- package/dist-client/src/client/outcome-log.d.ts +40 -0
- package/dist-client/src/client/outcome-log.js +38 -1
- package/dist-client/src/client/report.d.ts +3 -0
- package/dist-client/src/client/selected-coverage.d.ts +3 -0
- package/dist-client/src/client/selected-coverage.js +35 -5
- package/dist-client/src/client/test-ranking.d.ts +39 -0
- package/dist-client/src/client/test-ranking.js +127 -0
- package/dist-client/src/client/test-results.d.ts +27 -0
- package/dist-client/src/client/test-results.js +54 -0
- package/dist-client/src/client/test-shards.d.ts +36 -0
- package/dist-client/src/client/test-shards.js +68 -0
- package/dist-client/src/client/verify-savings.d.ts +6 -0
- package/dist-client/src/client/verify-savings.js +4 -0
- package/dist-client/src/client/verify.d.ts +36 -1
- package/dist-client/src/client/verify.js +171 -13
- package/node_modules/@babel/helper-string-parser/lib/index.js +5 -5
- package/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -1
- package/node_modules/@babel/helper-string-parser/package.json +1 -1
- package/node_modules/@babel/parser/lib/index.js +6306 -6143
- package/node_modules/@babel/parser/lib/index.js.map +1 -1
- package/node_modules/@babel/parser/package.json +3 -3
- package/node_modules/@babel/types/lib/definitions/typescript.js +2 -1
- package/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
- package/node_modules/@babel/types/package.json +3 -3
- package/node_modules/@diffci.com/core/dist/cache/graph-cache.d.ts +1 -1
- package/node_modules/@diffci.com/core/dist/cache/graph-cache.js +2 -1
- package/node_modules/@diffci.com/core/dist/cache/graph-cache.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/git/git-diff.js +59 -0
- package/node_modules/@diffci.com/core/dist/git/git-diff.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/git/types.d.ts +4 -0
- package/node_modules/@diffci.com/core/dist/planner/test-command.d.ts +11 -0
- package/node_modules/@diffci.com/core/dist/planner/test-command.js +65 -9
- package/node_modules/@diffci.com/core/dist/planner/test-command.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/file-references.d.ts +10 -1
- package/node_modules/@diffci.com/core/dist/repo/file-references.js +96 -18
- package/node_modules/@diffci.com/core/dist/repo/file-references.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/impact-types.d.ts +4 -1
- package/node_modules/@diffci.com/core/dist/repo/impact.d.ts +20 -0
- package/node_modules/@diffci.com/core/dist/repo/impact.js +147 -25
- package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/repo-config.d.ts +11 -0
- package/node_modules/@diffci.com/core/dist/repo/repo-config.js +11 -1
- package/node_modules/@diffci.com/core/dist/repo/repo-config.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/route-visits.d.ts +34 -0
- package/node_modules/@diffci.com/core/dist/repo/route-visits.js +93 -0
- package/node_modules/@diffci.com/core/dist/repo/route-visits.js.map +1 -0
- package/node_modules/@diffci.com/core/dist/repo/test-fixture-ownership.d.ts +1 -1
- package/node_modules/@diffci.com/core/dist/repo/test-fixture-ownership.js +48 -5
- package/node_modules/@diffci.com/core/dist/repo/test-fixture-ownership.js.map +1 -1
- package/node_modules/@diffci.com/core/package.json +3 -3
- package/node_modules/@diffci.com/core/src/cache/graph-cache.ts +2 -1
- package/node_modules/@diffci.com/core/src/git/git-diff.ts +48 -0
- package/node_modules/@diffci.com/core/src/git/types.ts +4 -0
- package/node_modules/@diffci.com/core/src/planner/test-command.ts +54 -9
- package/node_modules/@diffci.com/core/src/repo/file-references.ts +92 -20
- package/node_modules/@diffci.com/core/src/repo/impact-types.ts +5 -0
- package/node_modules/@diffci.com/core/src/repo/impact.ts +134 -25
- package/node_modules/@diffci.com/core/src/repo/repo-config.ts +23 -1
- package/node_modules/@diffci.com/core/src/repo/route-visits.ts +88 -0
- package/node_modules/@diffci.com/core/src/repo/test-fixture-ownership.ts +39 -5
- package/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js +4 -3
- package/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +4 -3
- package/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js +4 -3
- package/node_modules/@vue/compiler-core/package.json +4 -4
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js +9 -6
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +41 -4
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +10 -7
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +12 -11
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +5 -3
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js +10 -7
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js +12 -11
- package/node_modules/@vue/compiler-dom/package.json +3 -3
- package/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +155 -20
- package/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +431 -98
- package/node_modules/@vue/compiler-sfc/package.json +10 -10
- package/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1 -1
- package/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/node_modules/@vue/shared/dist/shared.cjs.js +51 -32
- package/node_modules/@vue/shared/dist/shared.cjs.prod.js +51 -32
- package/node_modules/@vue/shared/dist/shared.d.ts +2 -1
- package/node_modules/@vue/shared/dist/shared.esm-bundler.js +51 -32
- package/node_modules/@vue/shared/package.json +1 -1
- package/node_modules/nanoid/async/index.d.cts +56 -0
- package/node_modules/nanoid/index.cjs +12 -7
- package/node_modules/nanoid/index.js +1 -1
- package/node_modules/nanoid/package.json +3 -3
- package/node_modules/postcss/lib/input.js +1 -1
- package/node_modules/postcss/lib/lazy-result.js +1 -1
- package/node_modules/postcss/lib/list.js +19 -1
- package/node_modules/postcss/lib/map-generator.js +9 -3
- package/node_modules/postcss/lib/no-work-result.js +1 -1
- package/node_modules/postcss/lib/node.js +2 -2
- package/node_modules/postcss/lib/parser.js +6 -1
- package/node_modules/postcss/lib/processor.js +1 -1
- package/node_modules/postcss/lib/stringifier.js +16 -28
- package/node_modules/postcss/lib/stringify.js +84 -2
- package/node_modules/postcss/lib/warning.js +1 -0
- package/node_modules/postcss/package.json +3 -3
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/browser/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/package.json +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ import { type FailureBaseline } from "./failure-baseline.js";
|
|
|
2
2
|
import { type EnforcementDecision } from "./enforce-policy.js";
|
|
3
3
|
import { type CheckResult } from "./gate-checks.js";
|
|
4
4
|
import type { ObservationCommitRange, ObservationReport, SelectionReason } from "./report.js";
|
|
5
|
+
import { type ShardSpec, type TimingsFile } from "./test-shards.js";
|
|
5
6
|
import type { CommandMeasurement } from "./verify-savings.js";
|
|
6
7
|
import { type SnapshotChange } from "./working-tree.js";
|
|
7
8
|
export declare const VERIFICATION_SCHEMA: "diffci.verification.v1";
|
|
@@ -73,6 +74,20 @@ export interface VerificationReport {
|
|
|
73
74
|
enforcement?: EnforcementDecision & {
|
|
74
75
|
applied: boolean;
|
|
75
76
|
};
|
|
77
|
+
/** Present when nothing ran because an earlier pass of this exact tree covered it (outcome-log.ts, reusablePass). */
|
|
78
|
+
reused_from?: {
|
|
79
|
+
produced_at: string;
|
|
80
|
+
selection: "selected" | "full";
|
|
81
|
+
command?: string;
|
|
82
|
+
};
|
|
83
|
+
/** Present under `--shard i/N`: this job's share of the selection (test-shards.ts). */
|
|
84
|
+
shard?: {
|
|
85
|
+
index: number;
|
|
86
|
+
total: number;
|
|
87
|
+
timings: "file" | "equal";
|
|
88
|
+
};
|
|
89
|
+
/** Tests the coverage map added to the selection (coverage-map.ts), when it added any. */
|
|
90
|
+
coverage_added?: string[];
|
|
76
91
|
}
|
|
77
92
|
interface VerifyOptions {
|
|
78
93
|
repoPath: string;
|
|
@@ -86,6 +101,17 @@ interface VerifyOptions {
|
|
|
86
101
|
baselineOnFailure?: boolean;
|
|
87
102
|
/** Run only the tests, not the gate's other checks (`--no-checks`). */
|
|
88
103
|
skipChecks?: boolean;
|
|
104
|
+
/** False runs everything even when an earlier pass of the same tree covers it (`--no-reuse`). */
|
|
105
|
+
reuse?: boolean;
|
|
106
|
+
/** False keeps the selection's own order instead of likeliest failures first (`--no-rank`). */
|
|
107
|
+
rank?: boolean;
|
|
108
|
+
/** Run the likeliest failures first and stop there if one fails (`--fail-fast`). */
|
|
109
|
+
failFast?: boolean;
|
|
110
|
+
/** Run only this job's share of the selection (`--shard i/N`), balanced by `timings` when given. */
|
|
111
|
+
shard?: ShardSpec;
|
|
112
|
+
timings?: TimingsFile;
|
|
113
|
+
/** False ignores the coverage map (`--no-coverage`). */
|
|
114
|
+
coverage?: boolean;
|
|
89
115
|
}
|
|
90
116
|
export interface VerifyChangedOptions extends VerifyOptions {
|
|
91
117
|
}
|
|
@@ -101,13 +127,22 @@ export declare function verifyChanged(options: VerifyChangedOptions): Promise<Ve
|
|
|
101
127
|
export declare function verifyRange(options: VerifyRangeOptions): Promise<VerificationReport>;
|
|
102
128
|
export declare function verificationExitCode(report: VerificationReport): number;
|
|
103
129
|
export declare function formatVerificationSummary(report: VerificationReport): string;
|
|
130
|
+
/** The order to run selected tests in, and under --fail-fast the ones to run first (test-ranking.ts). */
|
|
131
|
+
export interface SelectedOrdering {
|
|
132
|
+
order: readonly string[];
|
|
133
|
+
first?: readonly string[];
|
|
134
|
+
}
|
|
104
135
|
/** Shared executable plan for read-only agent selection and verification. */
|
|
105
|
-
export declare function executableSelection(repoPath: string, result: NonNullable<ObservationReport["result"]
|
|
136
|
+
export declare function executableSelection(repoPath: string, result: NonNullable<ObservationReport["result"]>, ordering?: SelectedOrdering, shard?: {
|
|
137
|
+
tests: ReadonlySet<string>;
|
|
138
|
+
first: boolean;
|
|
139
|
+
}): {
|
|
106
140
|
selection: "full" | "selected";
|
|
107
141
|
command: string | undefined;
|
|
108
142
|
commands: string[];
|
|
109
143
|
reason: string;
|
|
110
144
|
outsideSuite: number;
|
|
145
|
+
unshardable: boolean;
|
|
111
146
|
};
|
|
112
147
|
/** A test-script phase as a standalone command. `npm test` puts `node_modules/.bin` on PATH; outside
|
|
113
148
|
* it a repository-local runner such as tsx is reached the way selected TypeScript tests are. */
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { mkdtempSync, rmSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
|
-
import { batchCommand, measureCommands } from "./command-batches.js";
|
|
4
|
+
import { appendToCommand, batchCommand, measureCommands, orderCommand, splitCommand, subsetCommand } from "./command-batches.js";
|
|
5
|
+
import { coverageAdditions, readCoverageMap } from "./coverage-map.js";
|
|
5
6
|
import { checkAtBaseline, compareWithBaseline } from "./failure-baseline.js";
|
|
6
7
|
import { collectEnforcementContext, evaluateEnforcement } from "./enforce-policy.js";
|
|
7
8
|
import { inferFullCommand, inferSelectedCommand, inferSelectedCommands } from "./full-command.js";
|
|
8
9
|
import { plannedChecks, runChecks } from "./gate-checks.js";
|
|
9
10
|
import { makeGitRunner, observe } from "./observe.js";
|
|
10
11
|
import { selectedNodeTests, traceNodeTestFiles, unmatchedNodeTests, unstartedNodeTests } from "./selected-coverage.js";
|
|
12
|
+
import { outcomeLogPath, readOutcomes, reusablePass } from "./outcome-log.js";
|
|
13
|
+
import { likelyFailures, rankTests, testHistory } from "./test-ranking.js";
|
|
14
|
+
import { assignShards } from "./test-shards.js";
|
|
15
|
+
import { mergeTestFileResults } from "./test-results.js";
|
|
11
16
|
import { captureWorkingTreeSnapshot, snapshotChanges } from "./working-tree.js";
|
|
12
17
|
export const VERIFICATION_SCHEMA = "diffci.verification.v1";
|
|
13
18
|
function receiptRange(range) {
|
|
@@ -64,7 +69,8 @@ async function executeWithPolicy(options, scope, before, observation, enforcemen
|
|
|
64
69
|
// Under enforce, a fired fallback runs the full suite even where plain verify would block: an
|
|
65
70
|
// unusable analysis is a reason to run everything, never a reason to pass with nothing run.
|
|
66
71
|
const enforcedFull = enforcement !== undefined && enforcement.fired_fallback !== null;
|
|
67
|
-
|
|
72
|
+
// Under --shard, narrowed to this job's share once the commands are built.
|
|
73
|
+
let result = observation.result;
|
|
68
74
|
const range = observation.commitRange;
|
|
69
75
|
const boundRange = scope === "commit-range" ? range : undefined;
|
|
70
76
|
const counts = {
|
|
@@ -105,9 +111,72 @@ async function executeWithPolicy(options, scope, before, observation, enforcemen
|
|
|
105
111
|
report.snapshot.after_tree_sha = afterAnalysis.treeSha;
|
|
106
112
|
return report;
|
|
107
113
|
}
|
|
108
|
-
|
|
114
|
+
// Coverage edges, phase A (coverage-map.ts, 2026-11-06): tests the coverage map connects to a changed
|
|
115
|
+
// file and the graph did not select are added. Only ever adds; a selected command that cannot take them
|
|
116
|
+
// runs the full suite instead. Never under enforce or path redaction.
|
|
117
|
+
const coverageAdded = [];
|
|
118
|
+
if (result && result.mode === "SELECTIVE" && !enforcement && !options.redactPaths && options.coverage !== false) {
|
|
119
|
+
const map = readCoverageMap(options.repoPath);
|
|
120
|
+
const additions = map ? coverageAdditions(map, result.changedFiles, result.selectedTests) : [];
|
|
121
|
+
if (additions.length) {
|
|
122
|
+
const tests = additions.map((addition) => addition.test);
|
|
123
|
+
const extended = result.proposedCommands.length === 1 ? appendToCommand(result.proposedCommands[0], result.selectedTests, tests) : undefined;
|
|
124
|
+
coverageAdded.push(...tests);
|
|
125
|
+
result = extended
|
|
126
|
+
? {
|
|
127
|
+
...result,
|
|
128
|
+
selectedTests: [...result.selectedTests, ...tests],
|
|
129
|
+
proposedCommands: [extended],
|
|
130
|
+
selectionReasons: { ...result.selectionReasons, ...Object.fromEntries(additions.map((addition) => [addition.test, { reason: "COVERAGE", changed_file: addition.changed_file }])) },
|
|
131
|
+
}
|
|
132
|
+
: { ...result, mode: "FULL", fallbackReasons: [...result.fallbackReasons, `the coverage map adds ${tests.length} test file(s) the selected command cannot include, such as ${tests[0]}`] };
|
|
133
|
+
counts.testsSelected = result.selectedTests.length;
|
|
134
|
+
analysis.fallback_reasons = result.fallbackReasons;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// --shard i/N (test-shards.ts): this job's share of the selection, split the same way in every job.
|
|
138
|
+
const shard = options.shard;
|
|
139
|
+
const shardTests = shard && result && !enforcedFull && result.mode === "SELECTIVE"
|
|
140
|
+
? assignShards(result.selectedTests, shard.total, options.timings)[shard.index - 1]
|
|
141
|
+
: undefined;
|
|
142
|
+
const executable = enforcedFull || !result
|
|
109
143
|
? fullSelection(options.repoPath, `enforce fallback (${enforcement?.fired_fallback}): ${enforcement?.detail}`)
|
|
110
|
-
: executableSelection(options.repoPath, result);
|
|
144
|
+
: executableSelection(options.repoPath, result, rankedOrdering(options, result), shard && shardTests ? { tests: new Set(shardTests), first: shard.index === 1 } : undefined);
|
|
145
|
+
const { selection, command, commands, outsideSuite } = executable;
|
|
146
|
+
const reason = coverageAdded.length && selection === "selected"
|
|
147
|
+
? `${executable.reason}; the coverage map added ${coverageAdded.length} test file(s) the dependency graph did not select (${coverageAdded.slice(0, 3).join(", ")})`
|
|
148
|
+
: executable.reason;
|
|
149
|
+
const coverageField = coverageAdded.length && selection === "selected" ? { coverage_added: coverageAdded } : {};
|
|
150
|
+
const unshardable = "unshardable" in executable && executable.unshardable;
|
|
151
|
+
const shardField = shard ? { shard: { index: shard.index, total: shard.total, timings: options.timings ? "file" : "equal" } } : {};
|
|
152
|
+
if (shard) {
|
|
153
|
+
const label = `${shard.index}/${shard.total}`;
|
|
154
|
+
const elsewhere = selection === "full" ? `the full suite runs in shard 1/${shard.total}`
|
|
155
|
+
: unshardable ? `the selected command cannot be split, so the whole selection runs in shard 1/${shard.total}`
|
|
156
|
+
: undefined;
|
|
157
|
+
if ((elsewhere && shard.index !== 1) || commands.length === 0) {
|
|
158
|
+
const why = elsewhere && shard.index !== 1 ? elsewhere : `shard ${label} has no selected test files`;
|
|
159
|
+
return {
|
|
160
|
+
...baseReport(before, scope, boundRange),
|
|
161
|
+
verification: "passed",
|
|
162
|
+
safe_to_continue: true,
|
|
163
|
+
reason: `nothing to run in shard ${label}: ${why}`,
|
|
164
|
+
changed_files: counts.changedFiles,
|
|
165
|
+
tests_available: counts.testsAvailable,
|
|
166
|
+
tests_selected: 0,
|
|
167
|
+
selection: "none",
|
|
168
|
+
snapshot: { ...baseReport(before, scope, boundRange).snapshot, after_base_sha: before.baseSha, after_tree_sha: before.treeSha, unchanged: true },
|
|
169
|
+
analysis,
|
|
170
|
+
required_actions: [],
|
|
171
|
+
...shardField,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (selection === "selected" && !unshardable && shardTests && result) {
|
|
175
|
+
const reasons = result.selectionReasons;
|
|
176
|
+
result = { ...result, selectedTests: shardTests, ...(reasons ? { selectionReasons: Object.fromEntries(shardTests.flatMap((test) => reasons[test] ? [[test, reasons[test]]] : [])) } : {}) };
|
|
177
|
+
counts.testsSelected = shardTests.length;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
111
180
|
if (!command) {
|
|
112
181
|
const inferred = inferFullCommand(options.repoPath);
|
|
113
182
|
return blocked(before, scope, `no executable verification command is available: ${inferred.reason}`, analysis, counts, boundRange);
|
|
@@ -117,6 +186,35 @@ async function executeWithPolicy(options, scope, before, observation, enforcemen
|
|
|
117
186
|
const checkBase = scope === "commit-range" ? range?.baseSha : before.baseSha;
|
|
118
187
|
const checkHead = scope === "commit-range" ? range?.headSha : before.commitSha;
|
|
119
188
|
const planned = options.skipChecks ? [] : plannedChecks(options.repoPath, checkBase && checkHead ? { baseSha: checkBase, headSha: checkHead } : undefined);
|
|
189
|
+
// An earlier pass of this exact tree that covers these tests and checks ends the run here (2026-11-06).
|
|
190
|
+
// Never under enforce, whose receipt must show the decision it applied, nor for tests outside the full
|
|
191
|
+
// suite, which a full run does not cover.
|
|
192
|
+
const reusable = options.reuse !== false && !enforcement && !outsideSuite
|
|
193
|
+
? findReusablePass(options, before.treeSha, selection, result?.selectedTests ?? [], commands.join(" && "), planned)
|
|
194
|
+
: undefined;
|
|
195
|
+
if (reusable) {
|
|
196
|
+
const reused_from = { produced_at: reusable.produced_at, selection: reusable.selection, ...(reusable.command ? { command: reusable.command } : {}) };
|
|
197
|
+
return {
|
|
198
|
+
...baseReport(before, scope, boundRange),
|
|
199
|
+
verification: "passed",
|
|
200
|
+
safe_to_continue: true,
|
|
201
|
+
reason: `reused the passing ${reused_from.selection} run of this exact tree from ${reused_from.produced_at}; nothing was run again (--no-reuse runs it)`,
|
|
202
|
+
changed_files: counts.changedFiles,
|
|
203
|
+
tests_available: counts.testsAvailable,
|
|
204
|
+
tests_selected: selection === "full" ? counts.testsAvailable : counts.testsSelected,
|
|
205
|
+
selection,
|
|
206
|
+
...(selection === "selected" && result ? { selected_tests: result.selectedTests } : {}),
|
|
207
|
+
...(selection === "selected" && result?.selectionReasons ? { selection_reasons: result.selectionReasons } : {}),
|
|
208
|
+
command,
|
|
209
|
+
...(commands.length > 1 ? { commands } : {}),
|
|
210
|
+
snapshot: { ...baseReport(before, scope, boundRange).snapshot, after_base_sha: before.baseSha, after_tree_sha: before.treeSha, unchanged: true },
|
|
211
|
+
analysis,
|
|
212
|
+
required_actions: [],
|
|
213
|
+
reused_from,
|
|
214
|
+
...shardField,
|
|
215
|
+
...coverageField,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
120
218
|
const checkBaseline = options.baselineOnFailure && checkBase && checkHead
|
|
121
219
|
? (check, remainingMs) => checkAtBaseline({ repoPath: options.repoPath, baseSha: checkBase, headSha: checkHead, command: check.command, timeoutMs: Math.max(remainingMs, 0) })
|
|
122
220
|
: undefined;
|
|
@@ -126,23 +224,31 @@ async function executeWithPolicy(options, scope, before, observation, enforcemen
|
|
|
126
224
|
// Checks that also fail at the base: still a failed verdict (required CI fails either way), but they
|
|
127
225
|
// no longer stop the run before the change's own failures.
|
|
128
226
|
const preexistingChecks = checkRun?.preexisting ?? [];
|
|
129
|
-
const
|
|
227
|
+
const checksNote = preexistingChecks.length
|
|
130
228
|
? `; gate check(s) ${preexistingChecks.map((check) => check.id).join(", ")} also fail at the base commit (already broken before this change)`
|
|
131
229
|
: "";
|
|
132
|
-
//
|
|
230
|
+
// Every test run goes under a probe that records which `node --test` files started (selected ones must)
|
|
231
|
+
// and each one's duration and result for the outcome log (2026-11-06). Outside node:test it does nothing.
|
|
133
232
|
const expectedNodeTests = selection === "selected" && result ? selectedNodeTests(command, result.selectedTests) : [];
|
|
134
|
-
const trace =
|
|
233
|
+
const trace = !checkRun?.failure ? traceNodeTestFiles(options.repoPath) : undefined;
|
|
135
234
|
let startedNodeTests;
|
|
136
235
|
let execution;
|
|
137
236
|
try {
|
|
138
237
|
execution = checkRun?.failure
|
|
139
238
|
? checkRun.failure.measurement
|
|
140
|
-
: measureCommands(commands, { cwd: options.repoPath, timeoutMs: Math.max(options.timeoutMs - (checkRun?.wallMs ?? 0), 0), tailBytes: options.tailBytes, env: trace?.env });
|
|
239
|
+
: measureCommands(commands, { cwd: options.repoPath, timeoutMs: Math.max(options.timeoutMs - (checkRun?.wallMs ?? 0), 0), tailBytes: options.tailBytes, env: trace?.env, stopOnFailure: options.failFast });
|
|
141
240
|
startedNodeTests = trace?.read();
|
|
241
|
+
const nodeResults = trace?.results() ?? [];
|
|
242
|
+
if (nodeResults.length)
|
|
243
|
+
execution = { ...execution, testResults: mergeTestFileResults(execution.testResults, nodeResults) };
|
|
142
244
|
}
|
|
143
245
|
finally {
|
|
144
246
|
trace?.dispose();
|
|
145
247
|
}
|
|
248
|
+
const failFastNote = execution.partsNotRun
|
|
249
|
+
? `; --fail-fast stopped at the first failing part, so ${execution.partsNotRun} later part(s) of the selection did not run`
|
|
250
|
+
: "";
|
|
251
|
+
const preexistingNote = checksNote + failFastNote;
|
|
146
252
|
let after;
|
|
147
253
|
try {
|
|
148
254
|
after = captureWorkingTreeSnapshot(options.repoPath);
|
|
@@ -234,6 +340,8 @@ async function executeWithPolicy(options, scope, before, observation, enforcemen
|
|
|
234
340
|
analysis,
|
|
235
341
|
required_actions: verification === "passed" ? [] : [finalReason + baselineNote],
|
|
236
342
|
...(failureBaseline ? { failure_baseline: failureBaseline } : {}),
|
|
343
|
+
...shardField,
|
|
344
|
+
...coverageField,
|
|
237
345
|
};
|
|
238
346
|
}
|
|
239
347
|
function stamped(report, version) {
|
|
@@ -383,8 +491,38 @@ function fullSelection(repoPath, reason) {
|
|
|
383
491
|
const command = inferFullCommand(repoPath).command;
|
|
384
492
|
return { selection: "full", command, commands: command ? [command] : [], reason, outsideSuite: 0 };
|
|
385
493
|
}
|
|
494
|
+
/** Ranks the selected tests by the outcome log's history, or undefined when nothing in it says any is
|
|
495
|
+
* likelier to fail than another, so a repository without history runs its selection exactly as before. */
|
|
496
|
+
function rankedOrdering(options, result) {
|
|
497
|
+
if (options.rank === false || result.mode !== "SELECTIVE")
|
|
498
|
+
return undefined;
|
|
499
|
+
const path = outcomeLogPath(options.repoPath);
|
|
500
|
+
const history = testHistory(path ? readOutcomes(path) : []);
|
|
501
|
+
const reasons = result.selectionReasons ?? {};
|
|
502
|
+
const likely = likelyFailures(result.selectedTests, history, reasons);
|
|
503
|
+
if (likely.length === 0)
|
|
504
|
+
return undefined;
|
|
505
|
+
const order = rankTests(result.selectedTests, history, reasons);
|
|
506
|
+
return { order, ...(options.failFast ? { first: order.filter((test) => likely.includes(test)) } : {}) };
|
|
507
|
+
}
|
|
508
|
+
/** The earlier pass in this repository's outcome log that covers this run, if any (reusablePass). */
|
|
509
|
+
function findReusablePass(options, treeSha, selection, selectedTests, command, planned) {
|
|
510
|
+
const path = outcomeLogPath(options.repoPath);
|
|
511
|
+
if (!path)
|
|
512
|
+
return undefined;
|
|
513
|
+
return reusablePass(readOutcomes(path), {
|
|
514
|
+
tree_sha: treeSha,
|
|
515
|
+
diffci_version: options.version,
|
|
516
|
+
node_version: process.versions.node,
|
|
517
|
+
selection,
|
|
518
|
+
selected_tests: selectedTests,
|
|
519
|
+
command,
|
|
520
|
+
full_command: selection === "full" ? command : fullSelection(options.repoPath, "").command,
|
|
521
|
+
checks: planned.filter((check) => check.decision !== "SKIP").map(({ id, command: checkCommand }) => ({ id, command: checkCommand })),
|
|
522
|
+
});
|
|
523
|
+
}
|
|
386
524
|
/** Shared executable plan for read-only agent selection and verification. */
|
|
387
|
-
export function executableSelection(repoPath, result) {
|
|
525
|
+
export function executableSelection(repoPath, result, ordering, shard) {
|
|
388
526
|
let selection;
|
|
389
527
|
let command;
|
|
390
528
|
let reason;
|
|
@@ -458,13 +596,33 @@ export function executableSelection(repoPath, result) {
|
|
|
458
596
|
reason = `${reason}; ${outside.length} affected test file(s) outside the full test command were not run (${auxiliary?.reason ?? "no single command covers them"})`;
|
|
459
597
|
}
|
|
460
598
|
}
|
|
599
|
+
// Under --shard each selected command keeps only the shard's files, and the test-script phases and the
|
|
600
|
+
// outside-suite command run in shard 1 (test-shards.ts, 2026-11-06). A command that cannot be cut
|
|
601
|
+
// safely leaves the whole selection to shard 1.
|
|
602
|
+
let shardParts;
|
|
603
|
+
let unshardable = false;
|
|
604
|
+
if (shard && selection === "selected" && command) {
|
|
605
|
+
const cut = (selectedParts ?? [primary ?? command]).map((part) => subsetCommand(part, result.selectedTests, shard.tests));
|
|
606
|
+
if (cut.some((part) => part === undefined))
|
|
607
|
+
unshardable = true;
|
|
608
|
+
else
|
|
609
|
+
shardParts = cut.filter((part) => typeof part === "string");
|
|
610
|
+
}
|
|
611
|
+
// A single selected command runs its files likeliest failures first, and under --fail-fast as two
|
|
612
|
+
// invocations, the likely ones and then the rest (test-ranking.ts, 2026-11-06).
|
|
613
|
+
const singleSource = shardParts ? (shardParts.length === 1 ? shardParts[0] : undefined) : primary ?? command;
|
|
614
|
+
const single = selection === "selected" && !selectedParts && ordering ? singleSource : undefined;
|
|
615
|
+
const ordered = single ? orderCommand(single, ordering.order) : undefined;
|
|
616
|
+
const primaryParts = ordered
|
|
617
|
+
? (ordering.first?.length ? splitCommand(ordered, result.selectedTests, ordering.first) : [ordered]).flatMap((part) => batchCommand(part, result.selectedTests))
|
|
618
|
+
: undefined;
|
|
619
|
+
const extras = !shard || shard.first || unshardable ? [...primaryPhases, ...(auxiliaryCommand ? batchCommand(auxiliaryCommand, outside) : [])] : [];
|
|
461
620
|
// Each part stays within the shell's command-line limit (cmd.exe stops at 8,191 characters).
|
|
462
621
|
const commands = command ? [
|
|
463
|
-
...(selectedParts ?? batchCommand(primary ?? command, selection === "selected" ? result.selectedTests : [])),
|
|
464
|
-
...
|
|
465
|
-
...(auxiliaryCommand ? batchCommand(auxiliaryCommand, outside) : []),
|
|
622
|
+
...(primaryParts ?? shardParts?.flatMap((part) => batchCommand(part, result.selectedTests)) ?? selectedParts ?? batchCommand(primary ?? command, selection === "selected" ? result.selectedTests : [])),
|
|
623
|
+
...extras,
|
|
466
624
|
] : [];
|
|
467
|
-
return { selection, command: commands.length ? commands.join(" && ") : command, commands, reason, outsideSuite };
|
|
625
|
+
return { selection, command: commands.length ? commands.join(" && ") : shard ? undefined : command, commands, reason, outsideSuite, unshardable };
|
|
468
626
|
}
|
|
469
627
|
/** A test-script phase as a standalone command. `npm test` puts `node_modules/.bin` on PATH; outside
|
|
470
628
|
* it a repository-local runner such as tsx is reached the way selected TypeScript tests are. */
|
|
@@ -10,7 +10,7 @@ var _isDigit = function isDigit(code) {
|
|
|
10
10
|
return code >= 48 && code <= 57;
|
|
11
11
|
};
|
|
12
12
|
const forbiddenNumericSeparatorSiblings = {
|
|
13
|
-
decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
|
|
13
|
+
decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111, 43, 45]),
|
|
14
14
|
hex: new Set([46, 88, 95, 120])
|
|
15
15
|
};
|
|
16
16
|
const isAllowedNumericSeparatorSibling = {
|
|
@@ -212,7 +212,7 @@ function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumS
|
|
|
212
212
|
pos
|
|
213
213
|
};
|
|
214
214
|
errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
|
|
215
|
-
} else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev)
|
|
215
|
+
} else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev)) {
|
|
216
216
|
if (bailOnError) return {
|
|
217
217
|
n: null,
|
|
218
218
|
pos
|
|
@@ -232,12 +232,12 @@ function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumS
|
|
|
232
232
|
val = Infinity;
|
|
233
233
|
}
|
|
234
234
|
if (val >= radix) {
|
|
235
|
-
if (val <= 9
|
|
236
|
-
return {
|
|
235
|
+
if (val <= 9) {
|
|
236
|
+
if (bailOnError) return {
|
|
237
237
|
n: null,
|
|
238
238
|
pos
|
|
239
239
|
};
|
|
240
|
-
|
|
240
|
+
errors.invalidDigit(pos, lineStart, curLine, radix);
|
|
241
241
|
val = 0;
|
|
242
242
|
} else if (forceLen) {
|
|
243
243
|
val = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isDigit","code","forbiddenNumericSeparatorSiblings","decBinOct","Set","hex","isAllowedNumericSeparatorSibling","bin","ch","oct","dec","readStringContents","type","input","pos","lineStart","curLine","errors","initialPos","initialLineStart","initialCurLine","out","firstInvalidLoc","chunkStart","length","unterminated","slice","charCodeAt","isStringEnd","res","readEscapedChar","str","containsInvalid","inTemplate","throwOnInvalid","readHexChar","String","fromCharCode","readCodePoint","fromCodePoint","strictNumericEscape","startPos","match","exec","octalStr","octal","parseInt","next","len","forceLen","n","readInt","invalidEscapeSequence","radix","allowNumSeparator","bailOnError","start","forbiddenSiblings","isAllowedSibling","invalid","total","i","e","Infinity","val","prev","numericSeparatorInEscapeSequence","Number","isNaN","has","unexpectedNumericSeparator","_isDigit","invalidDigit","indexOf","invalidCodePoint"],"sources":["../src/index.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set<number>([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set<number>([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n"],"mappings":";;;;;;;;eAAA,SAASA,OAAOA,CAACC,IAAI,EAAE;EACrB,OAAOA,IAAI,MAAU,IAAIA,IAAI,MAAU;AACzC,CAAC;AAID,MAAMC,iCAAiC,GAAG;EACxCC,SAAS,EAAE,IAAIC,GAAG,CAAS,kCAS1B,CAAC;EACFC,GAAG,EAAE,IAAID,GAAG,CAAS,iBAKpB;AACH,CAAC;AAED,MAAME,gCAAgC,GAAG;EAEvCC,GAAG,EAAGC,EAAU,IAAKA,EAAE,OAAqB,IAAIA,EAAE,OAAqB;EAGvEC,GAAG,EAAGD,EAAU,IAAKA,EAAE,MAAoB,IAAIA,EAAE,MAAoB;EAGrEE,GAAG,EAAGF,EAAU,IAAKA,EAAE,MAAoB,IAAIA,EAAE,MAAoB;EAGrEH,GAAG,EAAGG,EAAU,IACbA,EAAE,MAAoB,IAAIA,EAAE,MAAoB,IAChDA,EAAE,MAAwB,IAAIA,EAAE,MAAyB,IACzDA,EAAE,MAAwB,IAAIA,EAAE;AACrC,CAAC;AAUM,SAASG,kBAAkBA,CAChCC,IAAsC,EACtCC,KAAa,EACbC,GAAW,EACXC,SAAiB,EACjBC,OAAe,EACfC,MAAmC,EACnC;EACA,MAAMC,UAAU,GAAGJ,GAAG;EACtB,MAAMK,gBAAgB,GAAGJ,SAAS;EAClC,MAAMK,cAAc,GAAGJ,OAAO;EA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;IACL,IAAIb,IAAI,KAAK,IAAI,IAAIA,IAAI,GAAG,QAAQ,EAAE;MACpC,IAAIiC,cAAc,EAAE;QAClBjB,MAAM,CAACyD,gBAAgB,CAAC5D,GAAG,EAAEC,SAAS,EAAEC,OAAO,CAAC;MAClD,CAAC,MAAM;QACL,OAAO;UAAEf,IAAI,EAAE,IAAI;UAAEa;QAAI,CAAC;MAC5B;IACF;EACF,CAAC,MAAM;IACL,CAAC;MAAEb,IAAI;MAAEa;IAAI,CAAC,GAAGqB,WAAW,CAC1BtB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACP,CAAC,EACD,KAAK,EACLkB,cAAc,EACdjB,MACF,CAAC;EACH;EACA,OAAO;IAAEhB,IAAI;IAAEa;EAAI,CAAC;AACtB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isDigit","code","forbiddenNumericSeparatorSiblings","decBinOct","Set","hex","isAllowedNumericSeparatorSibling","bin","ch","oct","dec","readStringContents","type","input","pos","lineStart","curLine","errors","initialPos","initialLineStart","initialCurLine","out","firstInvalidLoc","chunkStart","length","unterminated","slice","charCodeAt","isStringEnd","res","readEscapedChar","str","containsInvalid","inTemplate","throwOnInvalid","readHexChar","String","fromCharCode","readCodePoint","fromCodePoint","strictNumericEscape","startPos","match","exec","octalStr","octal","parseInt","next","len","forceLen","n","readInt","invalidEscapeSequence","radix","allowNumSeparator","bailOnError","start","forbiddenSiblings","isAllowedSibling","invalid","total","i","e","Infinity","val","prev","numericSeparatorInEscapeSequence","Number","isNaN","has","unexpectedNumericSeparator","_isDigit","invalidDigit","indexOf","invalidCodePoint"],"sources":["../src/index.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set<number>([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n // exponent sign, e.g. 1e+_1\n charCodes.plusSign,\n charCodes.dash,\n ]),\n hex: new Set<number>([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): void;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9) {\n if (bailOnError) return { n: null, pos };\n errors.invalidDigit(pos, lineStart, curLine, radix);\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n"],"mappings":";;;;;;;;eAAA,SAASA,OAAOA,CAACC,IAAI,EAAE;EACrB,OAAOA,IAAI,MAAU,IAAIA,IAAI,MAAU;AACzC,CAAC;AAID,MAAMC,iCAA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