@diffci.com/diffci 0.3.46 → 0.3.48
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/red-builds.d.ts +1 -1
- package/dist-client/src/client/red-builds.js +19 -8
- package/dist-client/src/client/verify.d.ts +1 -1
- package/dist-client/src/client/verify.js +3 -6
- package/dist-client/src/client/working-tree.d.ts +1 -12
- package/dist-client/src/client/working-tree.js +60 -40
- package/node_modules/@diffci.com/core/README.md +34 -5
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust.d.ts +23 -0
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust.js +180 -0
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust.js.map +1 -0
- package/node_modules/@diffci.com/core/dist/repo/adapters/types.d.ts +5 -0
- package/node_modules/@diffci.com/core/dist/repo/adapters/types.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/file-references.js +43 -6
- 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 +1 -1
- package/node_modules/@diffci.com/core/dist/repo/impact.d.ts +5 -0
- package/node_modules/@diffci.com/core/dist/repo/impact.js +22 -0
- package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/types.d.ts +9 -0
- package/node_modules/@diffci.com/core/src/repo/adapters/rust.ts +195 -0
- package/node_modules/@diffci.com/core/src/repo/adapters/types.ts +2 -0
- package/node_modules/@diffci.com/core/src/repo/file-references.ts +41 -6
- package/node_modules/@diffci.com/core/src/repo/impact-types.ts +1 -0
- package/node_modules/@diffci.com/core/src/repo/impact.ts +22 -0
- package/node_modules/@diffci.com/core/src/repo/types.ts +6 -0
- package/package.json +2 -2
|
@@ -134,7 +134,7 @@ export type GitHubGet = (path: string) => Promise<{
|
|
|
134
134
|
}>;
|
|
135
135
|
export declare class StopCollection extends Error {
|
|
136
136
|
}
|
|
137
|
-
/** Paced, read-only GitHub REST client: >= 1.2 s between calls, stops on Retry-After or a
|
|
137
|
+
/** Paced, read-only GitHub REST client: >= 1.2 s between calls, stops on Retry-After, a low quota or a network that stays down. */
|
|
138
138
|
export declare function githubClient(token: string, options?: {
|
|
139
139
|
minIntervalMs?: number;
|
|
140
140
|
minRemaining?: number;
|
|
@@ -335,7 +335,9 @@ export function formatReport(report) {
|
|
|
335
335
|
}
|
|
336
336
|
export class StopCollection extends Error {
|
|
337
337
|
}
|
|
338
|
-
/**
|
|
338
|
+
/** Waits before each retry of a dropped connection or a GitHub 5xx (about 3.5 minutes in all). */
|
|
339
|
+
const NETWORK_RETRY_MS = [10_000, 30_000, 60_000, 120_000];
|
|
340
|
+
/** Paced, read-only GitHub REST client: >= 1.2 s between calls, stops on Retry-After, a low quota or a network that stays down. */
|
|
339
341
|
export function githubClient(token, options = {}) {
|
|
340
342
|
const interval = options.minIntervalMs ?? 1200;
|
|
341
343
|
const floor = options.minRemaining ?? 1000;
|
|
@@ -350,15 +352,24 @@ export function githubClient(token, options = {}) {
|
|
|
350
352
|
const request = () => fetchFn(`https://api.github.com/${path}`, {
|
|
351
353
|
headers: { Accept: "application/vnd.github+json", Authorization: `Bearer ${token}`, "User-Agent": "diffci-red-builds", "X-GitHub-Api-Version": "2022-11-28" },
|
|
352
354
|
});
|
|
355
|
+
// A dropped connection ("fetch failed") or a GitHub 5xx is not an answer: retry with growing waits, then stop
|
|
356
|
+
// and report what was read, as on a low quota. One bad minute of network must not discard an hour of calls.
|
|
353
357
|
let res;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
let failure = "";
|
|
359
|
+
for (let attempt = 0;; attempt++) {
|
|
360
|
+
try {
|
|
361
|
+
res = await request();
|
|
362
|
+
if (res.status < 500)
|
|
363
|
+
break;
|
|
364
|
+
failure = `GitHub answered HTTP ${res.status}`;
|
|
365
|
+
}
|
|
366
|
+
catch (error) {
|
|
367
|
+
failure = error?.message || "the connection failed";
|
|
368
|
+
}
|
|
369
|
+
if (attempt === NETWORK_RETRY_MS.length)
|
|
370
|
+
throw new StopCollection(`${failure} on ${path.split("?")[0]}, ${attempt + 1} times`);
|
|
371
|
+
await sleep(NETWORK_RETRY_MS[attempt]);
|
|
360
372
|
last = Date.now();
|
|
361
|
-
res = await request();
|
|
362
373
|
}
|
|
363
374
|
if (res.headers.get("retry-after"))
|
|
364
375
|
throw new StopCollection(`GitHub asked to slow down (Retry-After on ${path.split("?")[0]})`);
|
|
@@ -52,7 +52,7 @@ export interface VerificationReport {
|
|
|
52
52
|
written_during_verification?: string[];
|
|
53
53
|
/** Files that existed before the run and changed during it, at most 20. Their presence blocks the verdict. */
|
|
54
54
|
changed_during_verification?: SnapshotChange[];
|
|
55
|
-
/**
|
|
55
|
+
/** Checked-out files left out of the snapshot because they differ from HEAD only by CRLF line endings, at most 20. */
|
|
56
56
|
line_ending_only_changes?: string[];
|
|
57
57
|
};
|
|
58
58
|
analysis: {
|
|
@@ -13,7 +13,7 @@ import { outcomeLogPath, readOutcomes, reusablePass } from "./outcome-log.js";
|
|
|
13
13
|
import { likelyFailures, rankTests, testHistory } from "./test-ranking.js";
|
|
14
14
|
import { assignShards } from "./test-shards.js";
|
|
15
15
|
import { mergeTestFileResults } from "./test-results.js";
|
|
16
|
-
import { captureWorkingTreeSnapshot,
|
|
16
|
+
import { captureWorkingTreeSnapshot, snapshotChanges } from "./working-tree.js";
|
|
17
17
|
export const VERIFICATION_SCHEMA = "diffci.verification.v1";
|
|
18
18
|
function receiptRange(range) {
|
|
19
19
|
if (!range)
|
|
@@ -425,12 +425,9 @@ async function verifyCommitRange(options) {
|
|
|
425
425
|
const message = error instanceof Error ? error.message : String(error);
|
|
426
426
|
return blocked(unknownSnapshot(), "commit-range", message, { status: "ERROR", stage: "context", fallback_reasons: [], error: message });
|
|
427
427
|
}
|
|
428
|
+
// A checkout that differs from HEAD only by CRLF line endings is clean: the snapshot leaves those files out.
|
|
428
429
|
if (before.changed) {
|
|
429
|
-
|
|
430
|
-
if (!lineEndingOnly) {
|
|
431
|
-
return blocked(before, "commit-range", "commit-range verification requires a clean checkout; use verify --changed for uncommitted changes", { status: "not_needed", fallback_reasons: [] });
|
|
432
|
-
}
|
|
433
|
-
before = { ...before, lineEndingOnly };
|
|
430
|
+
return blocked(before, "commit-range", "commit-range verification requires a clean checkout; use verify --changed for uncommitted changes", { status: "not_needed", fallback_reasons: [] });
|
|
434
431
|
}
|
|
435
432
|
const temporaryDirectory = mkdtempSync(join(tmpdir(), "diffci-verify-"));
|
|
436
433
|
try {
|
|
@@ -6,20 +6,9 @@ export interface WorkingTreeSnapshot {
|
|
|
6
6
|
/** Unreachable commit used only so the existing commit-range analyzer can inspect the tree. */
|
|
7
7
|
commitSha: string;
|
|
8
8
|
changed: boolean;
|
|
9
|
-
/**
|
|
9
|
+
/** Files left out of the snapshot because they differ from HEAD only by a CRLF checkout of LF content (crlfCheckouts). */
|
|
10
10
|
lineEndingOnly?: string[];
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* The paths, when every difference between HEAD and the snapshot is only CRLF line endings on files
|
|
14
|
-
* committed with LF; otherwise undefined.
|
|
15
|
-
*
|
|
16
|
-
* WHY (2026-11-06). On DentalPresence the pre-push hook could not verify any push: 268 files had been
|
|
17
|
-
* checked out with CRLF under Git for Windows' system-wide `core.autocrlf=true` before the repository
|
|
18
|
-
* set it to false. `git status` called the checkout clean because its stat cache still matched, while
|
|
19
|
-
* the snapshot re-reads every file and saw 268 changes. Git's own view decides "clean" for the user, so
|
|
20
|
-
* a CRLF-only checkout is verified rather than blocked, and the receipt names the files.
|
|
21
|
-
*/
|
|
22
|
-
export declare function lineEndingOnlyChanges(repoPathInput: string, snapshot: WorkingTreeSnapshot): string[] | undefined;
|
|
23
12
|
/** One path that differs between two snapshots. A rename is a deletion plus an addition. */
|
|
24
13
|
export interface SnapshotChange {
|
|
25
14
|
path: string;
|
|
@@ -2,45 +2,6 @@ import { spawnSync } from "node:child_process";
|
|
|
2
2
|
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
5
|
-
/**
|
|
6
|
-
* The paths, when every difference between HEAD and the snapshot is only CRLF line endings on files
|
|
7
|
-
* committed with LF; otherwise undefined.
|
|
8
|
-
*
|
|
9
|
-
* WHY (2026-11-06). On DentalPresence the pre-push hook could not verify any push: 268 files had been
|
|
10
|
-
* checked out with CRLF under Git for Windows' system-wide `core.autocrlf=true` before the repository
|
|
11
|
-
* set it to false. `git status` called the checkout clean because its stat cache still matched, while
|
|
12
|
-
* the snapshot re-reads every file and saw 268 changes. Git's own view decides "clean" for the user, so
|
|
13
|
-
* a CRLF-only checkout is verified rather than blocked, and the receipt names the files.
|
|
14
|
-
*/
|
|
15
|
-
export function lineEndingOnlyChanges(repoPathInput, snapshot) {
|
|
16
|
-
const repoPath = resolve(repoPathInput);
|
|
17
|
-
const baseTreeSha = requireGit(repoPath, ["rev-parse", "--verify", `${snapshot.baseSha}^{tree}`], "could not resolve the snapshot base tree");
|
|
18
|
-
const changes = snapshotChanges(repoPath, baseTreeSha, snapshot.treeSha);
|
|
19
|
-
if (changes.length === 0 || changes.some((change) => change.status !== "modified"))
|
|
20
|
-
return undefined;
|
|
21
|
-
for (const change of changes) {
|
|
22
|
-
const committed = spawnSync("git", ["cat-file", "blob", `${baseTreeSha}:${change.path}`], {
|
|
23
|
-
cwd: repoPath,
|
|
24
|
-
maxBuffer: 256 * 1024 * 1024,
|
|
25
|
-
windowsHide: true,
|
|
26
|
-
});
|
|
27
|
-
if (committed.status !== 0 || committed.stdout.includes(13))
|
|
28
|
-
return undefined;
|
|
29
|
-
let checkedOut;
|
|
30
|
-
try {
|
|
31
|
-
checkedOut = readFileSync(join(repoPath, change.path));
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
if (!checkedOut.includes(13))
|
|
37
|
-
return undefined;
|
|
38
|
-
const normalized = Buffer.from(checkedOut.toString("latin1").replace(/\r\n/g, "\n"), "latin1");
|
|
39
|
-
if (!normalized.equals(committed.stdout))
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
return changes.map((change) => change.path);
|
|
43
|
-
}
|
|
44
5
|
function runGit(repoPath, args, env, input) {
|
|
45
6
|
const result = spawnSync("git", args, {
|
|
46
7
|
cwd: repoPath,
|
|
@@ -64,6 +25,61 @@ function requireGit(repoPath, args, context, env, input) {
|
|
|
64
25
|
}
|
|
65
26
|
return result.stdout.trim();
|
|
66
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Files staged in the temporary index that differ from the base tree only because the checkout has CRLF
|
|
30
|
+
* where the commit has LF (2026-11-15). On diffci.com, 968 of 1,020 "changed" files were such checkouts
|
|
31
|
+
* next to 52 real changes. The earlier rule (2026-11-06, DentalPresence's pre-push hook) cleared them only
|
|
32
|
+
* when nothing else had changed, so the analysis
|
|
33
|
+
* resolved readers for every one, chose the full suite, and verify took 15 minutes. `git status` calls
|
|
34
|
+
* these files clean, and so does the snapshot now, whatever else changed; the receipt lists them.
|
|
35
|
+
*/
|
|
36
|
+
function crlfCheckouts(repoPath, baseTreeSha, indexEnvironment) {
|
|
37
|
+
const modified = requireGit(repoPath, ["diff-index", "--cached", "--no-renames", "--diff-filter=M", "--name-only", "-z", baseTreeSha], "could not compare the working tree with HEAD", indexEnvironment)
|
|
38
|
+
.split("\0").filter(Boolean);
|
|
39
|
+
const candidates = [];
|
|
40
|
+
for (const path of modified) {
|
|
41
|
+
let checkedOut;
|
|
42
|
+
try {
|
|
43
|
+
checkedOut = readFileSync(join(repoPath, path));
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!checkedOut.includes(13))
|
|
49
|
+
continue;
|
|
50
|
+
candidates.push({ path, normalized: Buffer.from(checkedOut.toString("latin1").replace(/\r\n/g, "\n"), "latin1") });
|
|
51
|
+
}
|
|
52
|
+
if (candidates.length === 0)
|
|
53
|
+
return [];
|
|
54
|
+
// One batch read of the committed blobs: `--batch` prints "<sha> blob <size>\n<bytes>\n" per object.
|
|
55
|
+
const batch = spawnSync("git", ["cat-file", "--batch"], {
|
|
56
|
+
cwd: repoPath,
|
|
57
|
+
input: candidates.map(({ path }) => `${baseTreeSha}:${path}\n`).join(""),
|
|
58
|
+
maxBuffer: 1024 * 1024 * 1024,
|
|
59
|
+
windowsHide: true,
|
|
60
|
+
});
|
|
61
|
+
if (batch.status !== 0)
|
|
62
|
+
return [];
|
|
63
|
+
const output = batch.stdout;
|
|
64
|
+
const found = [];
|
|
65
|
+
let offset = 0;
|
|
66
|
+
for (const { path, normalized } of candidates) {
|
|
67
|
+
const headerEnd = output.indexOf(10, offset);
|
|
68
|
+
if (headerEnd < 0)
|
|
69
|
+
break;
|
|
70
|
+
const header = output.subarray(offset, headerEnd).toString("utf8").split(" ");
|
|
71
|
+
if (header[1] !== "blob") {
|
|
72
|
+
offset = headerEnd + 1;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const size = Number(header[2]);
|
|
76
|
+
const committed = output.subarray(headerEnd + 1, headerEnd + 1 + size);
|
|
77
|
+
offset = headerEnd + 1 + size + 1;
|
|
78
|
+
if (!committed.includes(13) && normalized.equals(committed))
|
|
79
|
+
found.push(path);
|
|
80
|
+
}
|
|
81
|
+
return found;
|
|
82
|
+
}
|
|
67
83
|
/**
|
|
68
84
|
* Materialize the current worktree as a Git tree without changing the user's index or checkout.
|
|
69
85
|
*
|
|
@@ -86,6 +102,10 @@ export function captureWorkingTreeSnapshot(repoPathInput) {
|
|
|
86
102
|
try {
|
|
87
103
|
requireGit(repoPath, ["read-tree", baseSha], "could not initialize the verification snapshot", indexEnvironment);
|
|
88
104
|
requireGit(repoPath, ["add", "-A", "--", "."], "could not capture the working tree", indexEnvironment);
|
|
105
|
+
const lineEndingOnly = crlfCheckouts(repoPath, baseTreeSha, indexEnvironment);
|
|
106
|
+
if (lineEndingOnly.length > 0) {
|
|
107
|
+
requireGit(repoPath, ["reset", "-q", baseSha, "--pathspec-from-file=-", "--pathspec-file-nul"], "could not leave line-ending-only files out of the snapshot", indexEnvironment, `${lineEndingOnly.join("\0")}\0`);
|
|
108
|
+
}
|
|
89
109
|
const treeSha = requireGit(repoPath, ["write-tree"], "could not write the verification tree", indexEnvironment);
|
|
90
110
|
const identityEnvironment = {
|
|
91
111
|
GIT_AUTHOR_NAME: "DiffCI",
|
|
@@ -96,7 +116,7 @@ export function captureWorkingTreeSnapshot(repoPathInput) {
|
|
|
96
116
|
GIT_COMMITTER_DATE: "2000-01-01T00:00:00Z",
|
|
97
117
|
};
|
|
98
118
|
const commitSha = requireGit(repoPath, ["commit-tree", treeSha, "-p", baseSha], "could not create the verification snapshot", identityEnvironment, "DiffCI working tree snapshot\n");
|
|
99
|
-
return { baseSha, treeSha, commitSha, changed: treeSha !== baseTreeSha };
|
|
119
|
+
return { baseSha, treeSha, commitSha, changed: treeSha !== baseTreeSha, ...(lineEndingOnly.length > 0 ? { lineEndingOnly } : {}) };
|
|
100
120
|
}
|
|
101
121
|
finally {
|
|
102
122
|
rmSync(temporaryDirectory, { recursive: true, force: true });
|
|
@@ -15,11 +15,13 @@ Run it in any Git checkout with Node.js 22.5+. [What the output means](docs/usin
|
|
|
15
15
|
|
|
16
16
|
If DiffCI saves you CI time, a ⭐ helps others find it.
|
|
17
17
|
|
|
18
|
-
**On every pull request
|
|
18
|
+
**On every pull request, with no workflow file:** [install the DiffCI GitHub App](https://github.com/apps/diffci/installations/new). On each pull request of a public repository it posts one "DiffCI change impact" check listing the affected tests and why. The check is always neutral, so it never blocks a merge. The App reads code and Actions runs and its only write permission is that check run; it never skips tests or changes required checks. [Data handling](https://diffci.com/data-handling).
|
|
19
|
+
|
|
20
|
+
**Or in your own workflow** (including private repositories), add one job beside your existing CI. Its job summary shows which tests the change affects and why, or that the full suite is needed and why. It runs no tests and skips or changes nothing:
|
|
19
21
|
|
|
20
22
|
```yaml
|
|
21
23
|
- uses: actions/checkout@v7
|
|
22
|
-
- uses: DiffCI/core@v0.3.
|
|
24
|
+
- uses: DiffCI/core@v0.3.46
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
Add `with: comment: "true"` (and `pull-requests: write` on the job) and the same answer appears on the pull request itself, updated in place on each push:
|
|
@@ -41,6 +43,12 @@ Coding agents pass the narrow check they picked and miss wider breakage, then re
|
|
|
41
43
|
- **When DiffCI could narrow the run, it selected 2.2% of test files**, cutting test time by 93%. None of those commits had a failing test, so this shows speed, not regression catching.
|
|
42
44
|
- **DiffCI still fell back to the full suite on 58% of commits**, mostly because a config file or `package.json` changed. Narrowing those safely is the main open problem, and [a good place to contribute](#contributing).
|
|
43
45
|
|
|
46
|
+
**Check your own repository.** How many of its red pull request builds failed on checks the author could have run before pushing? This reads GitHub Actions history only, runs nothing, and needs a GitHub token ([method](docs/red-builds.md)):
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
npx "@diffci.com/diffci@latest" red-builds owner/repo
|
|
50
|
+
```
|
|
51
|
+
|
|
44
52
|
## MCP server
|
|
45
53
|
|
|
46
54
|
This repository contains DiffCI's MCP server. It is implemented in
|
|
@@ -125,6 +133,11 @@ first, and fails within minutes when one breaks. It adds a job and skips
|
|
|
125
133
|
nothing, so your full test job stays as it is
|
|
126
134
|
([example](examples/github-actions-fast-check.yml)).
|
|
127
135
|
|
|
136
|
+
Add `check-run: "true"` for a [merge gate](docs/github-action-observer.md#merge-gate):
|
|
137
|
+
a "DiffCI merge gate" check run that branch protection can require. It passes
|
|
138
|
+
when the affected tests passed, fails when they failed, stays neutral when
|
|
139
|
+
DiffCI is unsure, and names the AI coding agent that wrote the change.
|
|
140
|
+
|
|
128
141
|
The [v0.3.10 corresponding source](https://github.com/DiffCI/core/tree/4c76be14cec37d94eb7df93922f3c29d202f4e65/packages/diffci-cli)
|
|
129
142
|
remains publicly available at tagged Core commit `4c76be14` (`cli-v0.3.10-source`)
|
|
130
143
|
while distribution migrates to the Core-native CLI package.
|
|
@@ -135,6 +148,19 @@ while distribution migrates to the Core-native CLI package.
|
|
|
135
148
|
|
|
136
149
|

|
|
137
150
|
|
|
151
|
+
### Case studies
|
|
152
|
+
|
|
153
|
+
Each study is a replay on real repositories, with its method, raw data and limitations on the linked page. None is a forecast for your repository.
|
|
154
|
+
|
|
155
|
+
| Study | Result |
|
|
156
|
+
|---|---|
|
|
157
|
+
| [Agent breakage replay](https://diffci.com/case-studies/agent-breakage-replay) | Every red CI commit in two agent-built repositories: 32 of 38 introduced breakages caught before push; about 70% of red commits only inherited a broken main |
|
|
158
|
+
| [LobeHub vs a Vitest planner](https://diffci.com/case-studies/lobehub) | 40 commits against the maintainers' own affected-test planner: same share of tests, no planner-picked test missed, 15 of 18 introduced failures caught before push |
|
|
159
|
+
| [Paperclip red builds](https://diffci.com/case-studies/paperclip) | 74 red PR builds classified job by job: 12 failed only on the PR's own pre-push checks (11 agent-written), about 15% of red runs |
|
|
160
|
+
| [Cal.com](https://diffci.com/case-studies/calcom) | Six real merges, executed and timed: 86–91.6% test-stage reduction, 44.2% at job level |
|
|
161
|
+
| [deepseek-harness](https://diffci.com/case-studies/deepseek-harness) | Five merges on a dirty baseline: 79.5–89.5% job-level reduction; one result withheld because the selection was not honored |
|
|
162
|
+
| [DiffCI's own CI](https://diffci.com/case-studies/diffci-own-ci) | Cost per job on ephemeral containers, and the bug our own green CI was hiding |
|
|
163
|
+
|
|
138
164
|
[Star Core](https://github.com/DiffCI/core) · [Volunteer a pilot repository](https://diffci.com/#pilot) · [Find a first contribution](https://github.com/DiffCI/core/issues?q=is%3Aopen+label%3A%22good+first+issue%22).
|
|
139
165
|
Watch → Custom → Releases and Discussions for benchmark results and support updates. [Public roadmap](docs/roadmap.md).
|
|
140
166
|
|
|
@@ -157,6 +183,8 @@ node dist/cli.js plan --repo /path/to/clean-checkout --base HEAD~1 --head HEAD
|
|
|
157
183
|
|
|
158
184
|
The target must be a clean Git repository root checked out at `--head`. Fetch the base commit beforehand if using a shallow clone. JSON goes to stdout; analysis errors exit nonzero and recommend full CI. Core does not execute repository scripts, contact a DiffCI backend or send telemetry. Installation requires the npm registry.
|
|
159
185
|
|
|
186
|
+
The `diffci` CLI, the GitHub Action and the MCP server count runs with the repository name (host/owner/repo), never its content. `diffci telemetry --mode count-only` drops the name; `DO_NOT_TRACK=1` stops counting. Details: [usage counting](docs/telemetry.md).
|
|
187
|
+
|
|
160
188
|
To evaluate the same command on pull requests without changing required jobs, copy the [advisory GitHub Actions example](examples/README.md).
|
|
161
189
|
|
|
162
190
|
**Plans are advisory.** This release does not execute, skip or cancel CI jobs. `SKIP_CANDIDATE` is a candidate, not permission to bypass a check. Keep full CI authoritative while evaluating Core. Missing command synthesis, unsupported configuration and incomplete evidence must not be treated as an empty test suite. Static analysis is not proof that a test can safely be omitted.
|
|
@@ -248,14 +276,15 @@ Most open work is teaching DiffCI to narrow changes it currently treats as "run
|
|
|
248
276
|
Thank you to everyone who has improved DiffCI:
|
|
249
277
|
|
|
250
278
|
- <a href="https://github.com/KingEmma7"><img src="https://github.com/KingEmma7.png?size=80" width="40" height="40" alt="@KingEmma7"></a> **[Emmanuel Mawulolo Tagbor](https://github.com/KingEmma7)**: [`diffci check-plan`](docs/using-diffci.md#compare-a-plan-with-a-full-suite-junit-report) for comparing a saved plan with full-suite JUnit results ([#74](https://github.com/DiffCI/core/pull/74)), Yarn Classic lockfile narrowing ([#63](https://github.com/DiffCI/core/pull/63)), and follow-ups ([#67](https://github.com/DiffCI/core/pull/67), [#70](https://github.com/DiffCI/core/pull/70)).
|
|
251
|
-
- <a href="https://github.com/FredApps"><img src="https://github.com/FredApps.png?size=80" width="40" height="40" alt="@FredApps"></a> **[@FredApps](https://github.com/FredApps)**: five safety fixes for runtime module dependencies, Maven module resources, runner suites, deleted assets and Go runtime inputs ([#32](https://github.com/DiffCI/core/pull/32)–[#36](https://github.com/DiffCI/core/pull/36)).
|
|
279
|
+
- <a href="https://github.com/FredApps"><img src="https://github.com/FredApps.png?size=80" width="40" height="40" alt="@FredApps"></a> **[@FredApps](https://github.com/FredApps)**, **[Area maintainer: Rust](CONTRIBUTING.md#contributor-tiers)**: Cargo package and test-target mapping, the foundation for [Rust support](https://github.com/DiffCI/core/issues/62) ([#91](https://github.com/DiffCI/core/pull/91)), and five safety fixes for runtime module dependencies, Maven module resources, runner suites, deleted assets and Go runtime inputs ([#32](https://github.com/DiffCI/core/pull/32)–[#36](https://github.com/DiffCI/core/pull/36)).
|
|
252
280
|
- <a href="https://github.com/shounakjoshi88-a11y"><img src="https://github.com/shounakjoshi88-a11y.png?size=80" width="40" height="40" alt="@shounakjoshi88-a11y"></a> **[Shounak Joshi](https://github.com/shounakjoshi88-a11y)**: Go package-owned `testdata` selection, so a golden-file edit runs the owning package's tests instead of the full suite ([#85](https://github.com/DiffCI/core/pull/85)).
|
|
253
281
|
- <a href="https://github.com/bfs2021"><img src="https://github.com/bfs2021.png?size=80" width="40" height="40" alt="@bfs2021"></a> **[@bfs2021](https://github.com/bfs2021)**: `bun.lock` and `npm-shrinkwrap.json` recognition in the lockfile signal ([#64](https://github.com/DiffCI/core/pull/64)).
|
|
254
|
-
- <a href="https://github.com/sarankumar1325"><img src="https://github.com/sarankumar1325.png?size=80" width="40" height="40" alt="@sarankumar1325"></a> **[@sarankumar1325](https://github.com/sarankumar1325)**: `bun.lock` detection in CI inference ([#105](https://github.com/DiffCI/core/pull/105)), removal of dead config-file patterns with a test for every entry ([#106](https://github.com/DiffCI/core/pull/106)), a shared lockfile list so every lockfile invalidates the Vue analysis cache ([#107](https://github.com/DiffCI/core/pull/107)), a regression test for `vite.config`-only changes in Vitest projects ([#109](https://github.com/DiffCI/core/pull/109)), Go `replace` targets inside the repository modelled under root-module scope instead of forcing the full suite ([#110](https://github.com/DiffCI/core/pull/110)), a full run when only `babel.config.*` or `.babelrc*` changes, where these files used to select no tests ([#108](https://github.com/DiffCI/core/pull/108)), and the shared lockfile names in reference resolution, impact analysis and the lockfile-free dependency check, replacing three hand-written copies ([#118](https://github.com/DiffCI/core/pull/118)–[#120](https://github.com/DiffCI/core/pull/120)).
|
|
282
|
+
- <a href="https://github.com/sarankumar1325"><img src="https://github.com/sarankumar1325.png?size=80" width="40" height="40" alt="@sarankumar1325"></a> **[@sarankumar1325](https://github.com/sarankumar1325)**: `bun.lock` detection in CI inference ([#105](https://github.com/DiffCI/core/pull/105)), removal of dead config-file patterns with a test for every entry ([#106](https://github.com/DiffCI/core/pull/106)), a shared lockfile list so every lockfile invalidates the Vue analysis cache ([#107](https://github.com/DiffCI/core/pull/107)), a regression test for `vite.config`-only changes in Vitest projects ([#109](https://github.com/DiffCI/core/pull/109)), Go `replace` targets inside the repository modelled under root-module scope instead of forcing the full suite ([#110](https://github.com/DiffCI/core/pull/110)), a full run when only `babel.config.*` or `.babelrc*` changes, where these files used to select no tests ([#108](https://github.com/DiffCI/core/pull/108)), and the shared lockfile names in reference resolution, impact analysis and the lockfile-free dependency check, replacing three hand-written copies ([#118](https://github.com/DiffCI/core/pull/118)–[#120](https://github.com/DiffCI/core/pull/120)), and a full-suite fallback when a package's Jest, Vitest or Babel config changes ([#121](https://github.com/DiffCI/core/pull/121)).
|
|
255
283
|
- <a href="https://github.com/robertwmccarty-caelum"><img src="https://github.com/robertwmccarty-caelum.png?size=80" width="40" height="40" alt="@robertwmccarty-caelum"></a> **[@robertwmccarty-caelum](https://github.com/robertwmccarty-caelum)**: the Vitest reporter/timeout config fixture and its narrowing conditions ([#53](https://github.com/DiffCI/core/issues/53#issuecomment-6514436312), landed in [#65](https://github.com/DiffCI/core/pull/65)).
|
|
256
284
|
- <a href="https://github.com/varshith84"><img src="https://github.com/varshith84.png?size=80" width="40" height="40" alt="@varshith84"></a> **[Varshith Sai Pasupuleti](https://github.com/varshith84)**: tests for transitive Vue selection and full fallback ([#16](https://github.com/DiffCI/core/pull/16)).
|
|
285
|
+
- <a href="https://github.com/aniKet0753"><img src="https://github.com/aniKet0753.png?size=80" width="40" height="40" alt="@aniKet0753"></a> **[@aniKet0753](https://github.com/aniKet0753)**: a `diffci help` command list and `USAGE` text that match the commands the CLI runs, with a test that fails when a command is missing ([#130](https://github.com/DiffCI/core/pull/130)).
|
|
257
286
|
|
|
258
|
-
Every merged contribution is credited in the release notes, here, and next to the feature in the docs.
|
|
287
|
+
Every merged contribution is credited in the release notes, here, on [diffci.com/contributors](https://diffci.com/contributors), and next to the feature in the docs. The README and website entries are added automatically when a pull request merges. A [contributor tier](CONTRIBUTING.md#contributor-tiers) above Contributor is written after the name, as in **[Area maintainer: Rust](CONTRIBUTING.md#contributor-tiers)**, and diffci.com copies it from here.
|
|
259
288
|
|
|
260
289
|
## License
|
|
261
290
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AdapterContext, type AdapterContribution, type RepositoryAdapter } from "./types.js";
|
|
2
|
+
export interface CargoTarget {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: string[];
|
|
5
|
+
src_path: string;
|
|
6
|
+
test: boolean;
|
|
7
|
+
doctest: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface CargoPackage {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
manifest_path: string;
|
|
13
|
+
targets: CargoTarget[];
|
|
14
|
+
}
|
|
15
|
+
export interface CargoMetadata {
|
|
16
|
+
packages: CargoPackage[];
|
|
17
|
+
workspace_members: string[];
|
|
18
|
+
workspace_root: string;
|
|
19
|
+
}
|
|
20
|
+
/** Metadata is external input: incomplete output is not an empty successful graph. */
|
|
21
|
+
export declare function parseCargoMetadata(output: string): CargoMetadata;
|
|
22
|
+
export declare function analyzeRustMetadata(context: AdapterContext, output: string): AdapterContribution;
|
|
23
|
+
export declare const rustAdapter: RepositoryAdapter;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import { dirname, isAbsolute, relative, resolve } from "node:path";
|
|
4
|
+
import { contribution } from "./types.js";
|
|
5
|
+
function object(value) {
|
|
6
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function strings(value) {
|
|
9
|
+
return Array.isArray(value) && value.every(item => typeof item === "string");
|
|
10
|
+
}
|
|
11
|
+
/** Metadata is external input: incomplete output is not an empty successful graph. */
|
|
12
|
+
export function parseCargoMetadata(output) {
|
|
13
|
+
const value = JSON.parse(output);
|
|
14
|
+
if (!object(value) || !Array.isArray(value.packages) || !strings(value.workspace_members)
|
|
15
|
+
|| !value.workspace_members.length || typeof value.workspace_root !== "string" || !isAbsolute(value.workspace_root)) {
|
|
16
|
+
throw new Error("Invalid Cargo workspace metadata");
|
|
17
|
+
}
|
|
18
|
+
for (const pkg of value.packages) {
|
|
19
|
+
if (!object(pkg) || typeof pkg.id !== "string" || !pkg.id || typeof pkg.name !== "string"
|
|
20
|
+
|| !/^[A-Za-z0-9_][A-Za-z0-9_-]*$/.test(pkg.name) || typeof pkg.manifest_path !== "string"
|
|
21
|
+
|| !isAbsolute(pkg.manifest_path) || !Array.isArray(pkg.targets) || !pkg.targets.length) {
|
|
22
|
+
throw new Error("Invalid Cargo package metadata");
|
|
23
|
+
}
|
|
24
|
+
for (const target of pkg.targets) {
|
|
25
|
+
if (!object(target) || typeof target.name !== "string" || !/^[A-Za-z0-9_][A-Za-z0-9_-]*$/.test(target.name)
|
|
26
|
+
|| !strings(target.kind) || !target.kind.length || typeof target.src_path !== "string"
|
|
27
|
+
|| !isAbsolute(target.src_path) || typeof target.test !== "boolean" || typeof target.doctest !== "boolean") {
|
|
28
|
+
throw new Error("Invalid Cargo target metadata");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const ids = value.packages.map(pkg => pkg.id);
|
|
33
|
+
if (new Set(ids).size !== ids.length || new Set(value.workspace_members).size !== value.workspace_members.length
|
|
34
|
+
|| value.workspace_members.some(id => !ids.includes(id)))
|
|
35
|
+
throw new Error("Incomplete Cargo workspace membership");
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function internalPath(root, path) {
|
|
39
|
+
const rel = relative(root, path).replace(/\\/g, "/");
|
|
40
|
+
return rel === ".." || rel.startsWith("../") || isAbsolute(rel) ? undefined : rel;
|
|
41
|
+
}
|
|
42
|
+
/** Resolve a metadata or checkout path against a realpath'd workspace root. */
|
|
43
|
+
function resolvedPath(root, path) {
|
|
44
|
+
try {
|
|
45
|
+
return internalPath(root, realpathSync(path));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Refuse symlink escapes as well as lexical escapes before using a metadata path. */
|
|
52
|
+
function repositoryPath(root, path, known) {
|
|
53
|
+
const rel = resolvedPath(root, path);
|
|
54
|
+
return rel && known.has(rel) ? rel : undefined;
|
|
55
|
+
}
|
|
56
|
+
function under(path, directory) {
|
|
57
|
+
return directory === "" || path.startsWith(`${directory}/`);
|
|
58
|
+
}
|
|
59
|
+
export function analyzeRustMetadata(context, output) {
|
|
60
|
+
const result = contribution(rustAdapter);
|
|
61
|
+
// This first milestone only establishes ownership. Keep it fail-closed until
|
|
62
|
+
// workspace dependency edges are added, even if called before registration.
|
|
63
|
+
result.blockers.push("Rust crate dependency analysis is not available; full validation required");
|
|
64
|
+
try {
|
|
65
|
+
const metadata = parseCargoMetadata(output);
|
|
66
|
+
const root = realpathSync(resolve(context.repoPath));
|
|
67
|
+
if (realpathSync(metadata.workspace_root) !== root) {
|
|
68
|
+
result.blockers.push("Rust support requires a Cargo workspace or crate at the repository root");
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
const known = new Set(context.files);
|
|
72
|
+
const members = metadata.packages.filter(pkg => metadata.workspace_members.includes(pkg.id));
|
|
73
|
+
if (new Set(members.map(pkg => pkg.name)).size !== members.length) {
|
|
74
|
+
result.blockers.push("Ambiguous Cargo workspace package names require full validation");
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
const packages = [];
|
|
78
|
+
for (const pkg of members) {
|
|
79
|
+
const manifest = repositoryPath(root, pkg.manifest_path, known);
|
|
80
|
+
if (!manifest || !/(?:^|\/)Cargo\.toml$/.test(manifest)) {
|
|
81
|
+
result.blockers.push(`Rust package ${pkg.name} has an unavailable or external manifest`);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const directory = dirname(manifest) === "." ? "" : dirname(manifest);
|
|
85
|
+
packages.push({ pkg, manifest, directory });
|
|
86
|
+
result.sourcePaths.push(manifest);
|
|
87
|
+
}
|
|
88
|
+
// Deepest package wins, regardless of Cargo's package ordering.
|
|
89
|
+
packages.sort((a, b) => b.directory.length - a.directory.length || a.directory.localeCompare(b.directory));
|
|
90
|
+
const manifests = new Set(packages.map(pkg => pkg.manifest));
|
|
91
|
+
const unmodeledManifests = context.files.filter(file => /(?:^|\/)Cargo\.toml$/.test(file)
|
|
92
|
+
&& file !== "Cargo.toml" && !manifests.has(file));
|
|
93
|
+
if (unmodeledManifests.length)
|
|
94
|
+
result.blockers.push(`Cargo manifests outside workspace membership require full validation: ${unmodeledManifests.join(", ")}`);
|
|
95
|
+
if (manifests.size !== packages.length)
|
|
96
|
+
result.blockers.push("Cargo packages share a manifest; ownership is ambiguous");
|
|
97
|
+
const owner = (file) => {
|
|
98
|
+
const candidate = packages.find(pkg => under(file, pkg.directory));
|
|
99
|
+
if (!candidate || unmodeledManifests.some(manifest => {
|
|
100
|
+
const boundary = manifest.slice(0, -"/Cargo.toml".length);
|
|
101
|
+
return boundary.length > candidate.directory.length && under(file, boundary);
|
|
102
|
+
}))
|
|
103
|
+
return undefined;
|
|
104
|
+
return candidate;
|
|
105
|
+
};
|
|
106
|
+
for (const file of context.files.filter(file => file.endsWith(".rs"))) {
|
|
107
|
+
if (!owner(file) || !repositoryPath(root, resolve(root, file), known)) {
|
|
108
|
+
result.blockers.push(`Rust file has no verified Cargo package: ${file}`);
|
|
109
|
+
}
|
|
110
|
+
else
|
|
111
|
+
result.sourcePaths.push(file);
|
|
112
|
+
}
|
|
113
|
+
result.rustTestTargets = {};
|
|
114
|
+
for (const { pkg } of packages) {
|
|
115
|
+
for (const target of pkg.targets) {
|
|
116
|
+
const path = repositoryPath(root, target.src_path, known);
|
|
117
|
+
if (!path || owner(path)?.pkg.id !== pkg.id) {
|
|
118
|
+
result.blockers.push(`Rust target ${pkg.name}/${target.name} has an unavailable, external or differently owned source`);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (target.kind.includes("custom-build"))
|
|
122
|
+
continue;
|
|
123
|
+
const kind = target.kind.includes("test") ? "test"
|
|
124
|
+
: target.kind.includes("bin") ? "bin"
|
|
125
|
+
: target.kind.includes("example") ? "example"
|
|
126
|
+
: target.kind.includes("bench") ? "bench"
|
|
127
|
+
: target.kind.some(kind => ["lib", "rlib", "dylib", "cdylib", "staticlib", "proc-macro"].includes(kind)) ? "lib" : undefined;
|
|
128
|
+
if (!kind) {
|
|
129
|
+
result.blockers.push(`Unsupported Cargo target kind: ${pkg.name}/${target.name}`);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
result.sourcePaths.push(path);
|
|
133
|
+
// Cargo's test/doctest flags are authoritative. A crate's lib/bin root
|
|
134
|
+
// represents its unit tests, including #[cfg(test)] modules in other files.
|
|
135
|
+
if (!target.test && !target.doctest)
|
|
136
|
+
continue;
|
|
137
|
+
if (Object.hasOwn(result.rustTestTargets, path)) {
|
|
138
|
+
result.blockers.push(`Multiple Cargo test targets share a source path: ${path}`);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
result.testFiles.push(path);
|
|
142
|
+
result.testPackages[path] = pkg.name;
|
|
143
|
+
result.rustTestTargets[path] = { name: target.name, kind };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
result.sourcePaths = [...new Set(result.sourcePaths)].sort();
|
|
147
|
+
result.testFiles.sort();
|
|
148
|
+
if (!result.testFiles.length)
|
|
149
|
+
result.blockers.push("Cargo metadata found no supported test targets");
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
result.blockers.push("Invalid or incomplete Cargo metadata requires full validation");
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
export const rustAdapter = {
|
|
157
|
+
id: "rust", version: "1", kind: "language",
|
|
158
|
+
detect: ({ files }) => files.some(file => /(?:^|\/)Cargo\.toml$/.test(file) || file.endsWith(".rs")),
|
|
159
|
+
analyze(context) {
|
|
160
|
+
const failure = contribution(this);
|
|
161
|
+
if (!context.files.includes("Cargo.toml")) {
|
|
162
|
+
failure.blockers.push("Rust support requires a root Cargo.toml");
|
|
163
|
+
return failure;
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
// Metadata does not execute repository code. Offline + locked prevents
|
|
167
|
+
// dependency downloads and changes to the repository's Cargo.lock.
|
|
168
|
+
const output = execFileSync("cargo", ["metadata", "--format-version", "1", "--no-deps", "--offline", "--locked"], {
|
|
169
|
+
cwd: context.repoPath, encoding: "utf8", timeout: 60_000, maxBuffer: 64 * 1024 * 1024,
|
|
170
|
+
windowsHide: true, stdio: ["ignore", "pipe", "pipe"],
|
|
171
|
+
});
|
|
172
|
+
return analyzeRustMetadata(context, output);
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
failure.blockers.push("Cargo metadata unavailable: install Rust and repository dependencies; offline, locked metadata must succeed");
|
|
176
|
+
return failure;
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=rust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rust.js","sourceRoot":"","sources":["../../../src/repo/adapters/rust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EA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K,CAAC,CAAC;IACpG,OAAO,CAAC,OAAO;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;YACjE,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,IAAI,CAAC;YACH,uEAAuE;YACvE,mEAAmE;YACnE,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE;gBAChH,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;gBACrF,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;aACrD,CAAC,CAAC;YACH,OAAO,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,6GAA6G,CAAC,CAAC;YACrI,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -21,6 +21,11 @@ export interface AdapterContribution {
|
|
|
21
21
|
}>;
|
|
22
22
|
testFiles: string[];
|
|
23
23
|
testPackages: Record<string, string>;
|
|
24
|
+
/** Cargo target roots; a lib/bin root represents the crate's unit tests. */
|
|
25
|
+
rustTestTargets?: Record<string, {
|
|
26
|
+
name: string;
|
|
27
|
+
kind: "lib" | "bin" | "test" | "bench" | "example";
|
|
28
|
+
}>;
|
|
24
29
|
executionEnv?: Record<string, string>;
|
|
25
30
|
/** The interpreter the adapter analysed with and its runner should use, such as ["python3"]. */
|
|
26
31
|
interpreter?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/repo/adapters/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/repo/adapters/types.ts"],"names":[],"mappings":"AAgDA,MAAM,UAAU,YAAY,CAAC,OAAkD;IAC7E,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AACrK,CAAC"}
|