@diffci.com/diffci 0.3.52 → 0.3.54
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/agent-selection.d.ts +74 -1
- package/dist-client/src/client/agent-selection.js +94 -3
- package/dist-client/src/client/cli.js +125 -14
- package/dist-client/src/client/context.d.ts +3 -1
- package/dist-client/src/client/context.js +83 -2
- package/dist-client/src/client/install.js +1 -0
- package/dist-client/src/client/isolated-worktree.d.ts +31 -0
- package/dist-client/src/client/isolated-worktree.js +130 -0
- package/dist-client/src/client/mcp.js +20 -5
- package/dist-client/src/client/observe.d.ts +2 -0
- package/dist-client/src/client/observe.js +4 -0
- package/dist-client/src/client/report.d.ts +1 -1
- package/dist-client/src/client/telemetry.js +1 -1
- package/dist-client/src/client/verify.d.ts +47 -3
- package/dist-client/src/client/verify.js +121 -1
- package/dist-client/src/client/working-tree.d.ts +22 -0
- package/dist-client/src/client/working-tree.js +45 -6
- package/node_modules/@diffci.com/core/README.md +3 -3
- package/node_modules/@diffci.com/core/dist/git/git-diff.js +6 -0
- package/node_modules/@diffci.com/core/dist/git/git-diff.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/impact.d.ts +9 -0
- package/node_modules/@diffci.com/core/dist/repo/impact.js +34 -0
- package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
- package/node_modules/@diffci.com/core/src/git/git-diff.ts +6 -0
- package/node_modules/@diffci.com/core/src/repo/impact.ts +37 -0
- package/package.json +2 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, lstatSync, mkdtempSync, readdirSync, realpathSync, rmSync, symlinkSync, unlinkSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
const LOCKFILES = ["package-lock.json", "npm-shrinkwrap.json", "pnpm-lock.yaml", "yarn.lock", "bun.lock", "bun.lockb"];
|
|
6
|
+
function git(cwd, args, input) {
|
|
7
|
+
const result = spawnSync("git", args, { cwd, input, encoding: "utf8", maxBuffer: 64 * 1024 * 1024, windowsHide: true });
|
|
8
|
+
return { ok: result.status === 0, stdout: (result.stdout ?? "").trim(), stderr: (result.stderr ?? "").trim() };
|
|
9
|
+
}
|
|
10
|
+
/** Root lockfiles whose content in `treeSha` differs from the checkout's file on disk. */
|
|
11
|
+
export function lockfileMismatches(repoPath, treeSha) {
|
|
12
|
+
const mismatched = [];
|
|
13
|
+
for (const lock of LOCKFILES) {
|
|
14
|
+
const onDisk = existsSync(join(repoPath, lock)) ? git(repoPath, ["hash-object", "--", lock]).stdout : "";
|
|
15
|
+
const inTree = git(repoPath, ["rev-parse", "-q", "--verify", `${treeSha}:${lock}`]).stdout;
|
|
16
|
+
// Blob ids, not bytes: Git applies the same line-ending normalization on both sides.
|
|
17
|
+
if ((onDisk || inTree) && onDisk !== inTree)
|
|
18
|
+
mismatched.push(lock);
|
|
19
|
+
}
|
|
20
|
+
return mismatched;
|
|
21
|
+
}
|
|
22
|
+
/** Checkout-relative `node_modules` directories, at most four levels deep, never inside one another. */
|
|
23
|
+
export function dependencyDirectories(repoPath, maxDepth = 4) {
|
|
24
|
+
const found = [];
|
|
25
|
+
const walk = (relative, depth) => {
|
|
26
|
+
let entries;
|
|
27
|
+
try {
|
|
28
|
+
entries = readdirSync(join(repoPath, relative), { withFileTypes: true });
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
if (!entry.isDirectory() || entry.name === ".git")
|
|
35
|
+
continue;
|
|
36
|
+
const child = relative ? `${relative}/${entry.name}` : entry.name;
|
|
37
|
+
if (entry.name === "node_modules") {
|
|
38
|
+
found.push(child);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (depth < maxDepth)
|
|
42
|
+
walk(child, depth + 1);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
walk("", 1);
|
|
46
|
+
return found.sort();
|
|
47
|
+
}
|
|
48
|
+
function removeLink(path) {
|
|
49
|
+
try {
|
|
50
|
+
if (!lstatSync(path).isSymbolicLink())
|
|
51
|
+
return false;
|
|
52
|
+
// A junction is a symbolic link to Node; unlink removes the link, never the target's contents.
|
|
53
|
+
unlinkSync(path);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
return error.code === "ENOENT";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function createIsolatedWorktree(repoPathInput, baseSha, treeSha) {
|
|
61
|
+
const repoPath = resolve(repoPathInput);
|
|
62
|
+
const mismatched = lockfileMismatches(repoPath, treeSha);
|
|
63
|
+
if (mismatched.length) {
|
|
64
|
+
return { error: `${mismatched.join(", ")} in the verified files differs from this checkout's, so its installed dependencies do not match; install dependencies for it, or include the lockfile change the installed dependencies were made from` };
|
|
65
|
+
}
|
|
66
|
+
// The long form of the path: an 8.3 temporary directory (C:\Users\ABCDEF~1) would not match the
|
|
67
|
+
// repository root Git reports inside the worktree.
|
|
68
|
+
const temporary = realpathSync.native(mkdtempSync(join(tmpdir(), "diffci-scoped-")));
|
|
69
|
+
const path = join(temporary, "tree");
|
|
70
|
+
const added = git(repoPath, ["worktree", "add", "--quiet", "--detach", "--no-checkout", path, baseSha]);
|
|
71
|
+
if (!added.ok) {
|
|
72
|
+
rmSync(temporary, { recursive: true, force: true });
|
|
73
|
+
return { error: `could not create a temporary worktree: ${added.stderr.split("\n")[0] ?? "git worktree add failed"}` };
|
|
74
|
+
}
|
|
75
|
+
const linked = [];
|
|
76
|
+
let disposed = false;
|
|
77
|
+
const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
78
|
+
const onSignal = (signal) => {
|
|
79
|
+
dispose();
|
|
80
|
+
process.exit(signal === "SIGINT" ? 130 : 143);
|
|
81
|
+
};
|
|
82
|
+
const onExit = () => { dispose(); };
|
|
83
|
+
function dispose() {
|
|
84
|
+
if (disposed)
|
|
85
|
+
return true;
|
|
86
|
+
disposed = true;
|
|
87
|
+
for (const signal of signals)
|
|
88
|
+
process.removeListener(signal, onSignal);
|
|
89
|
+
process.removeListener("exit", onExit);
|
|
90
|
+
// Links first: removing the worktree must never reach through a link into the checkout.
|
|
91
|
+
const unlinked = linked.every((relative) => removeLink(join(path, relative)));
|
|
92
|
+
let removed = git(repoPath, ["worktree", "remove", "--force", path]).ok;
|
|
93
|
+
if (!removed && unlinked) {
|
|
94
|
+
try {
|
|
95
|
+
rmSync(path, { recursive: true, force: true, maxRetries: 3 });
|
|
96
|
+
removed = !existsSync(path);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
removed = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
git(repoPath, ["worktree", "prune"]);
|
|
103
|
+
if (removed) {
|
|
104
|
+
try {
|
|
105
|
+
rmSync(temporary, { recursive: true, force: true });
|
|
106
|
+
}
|
|
107
|
+
catch { /* an empty directory left in the temp folder is harmless */ }
|
|
108
|
+
}
|
|
109
|
+
return removed && unlinked;
|
|
110
|
+
}
|
|
111
|
+
for (const signal of signals)
|
|
112
|
+
process.once(signal, onSignal);
|
|
113
|
+
process.once("exit", onExit);
|
|
114
|
+
const checkout = git(path, ["read-tree", "--reset", "-u", treeSha]);
|
|
115
|
+
if (!checkout.ok) {
|
|
116
|
+
dispose();
|
|
117
|
+
return { error: `could not check out the verified files in the temporary worktree: ${checkout.stderr.split("\n")[0] ?? "git read-tree failed"}` };
|
|
118
|
+
}
|
|
119
|
+
for (const relative of dependencyDirectories(repoPath)) {
|
|
120
|
+
const target = join(path, relative);
|
|
121
|
+
if (!existsSync(dirname(target)) || existsSync(target))
|
|
122
|
+
continue;
|
|
123
|
+
try {
|
|
124
|
+
symlinkSync(join(repoPath, relative), target, "junction");
|
|
125
|
+
linked.push(relative);
|
|
126
|
+
}
|
|
127
|
+
catch { /* a missing dependency link shows up as a failing or unrunnable test, never as a pass */ }
|
|
128
|
+
}
|
|
129
|
+
return { path, linked, dispose };
|
|
130
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { execFile } from "node:child_process";
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { StringDecoder } from "node:string_decoder";
|
|
5
|
-
import { agentChangedFiles, agentSelection, selectionInstruction } from "./agent-selection.js";
|
|
5
|
+
import { agentChangedFiles, agentScopedSelection, agentSelection, selectionInstruction } from "./agent-selection.js";
|
|
6
6
|
import { requireDiffciPackageIdentity } from "./package-identity.js";
|
|
7
7
|
const SERVER_INFO = { name: "diffci-mcp", version: requireDiffciPackageIdentity().version };
|
|
8
8
|
const tools = [
|
|
@@ -12,12 +12,16 @@ const tools = [
|
|
|
12
12
|
? "Reanalyze and verify the current working-tree snapshot with affected tests or conservative full fallback. Required CI remains authoritative."
|
|
13
13
|
: name === "diffci_changed_files"
|
|
14
14
|
? "List staged, unstaged and non-ignored untracked changed paths relative to HEAD, with a snapshot identity. Builds no dependency graph and runs no tests."
|
|
15
|
-
: "Inspect current staged, unstaged and non-ignored untracked changes and return a snapshot-bound affected-test plan and fallback reasons. Runs no tests; a plan is not a passing receipt.",
|
|
15
|
+
: "Inspect current staged, unstaged and non-ignored untracked changes and return a snapshot-bound affected-test plan and fallback reasons. Runs no tests; a plan is not a passing receipt. With scope \"staged\" or \"paths\", plans HEAD plus only the index or only the given files in a temporary worktree, and returns the one `diffci verify --staged`/`--paths` command to run; use it before a commit when other sessions share the checkout.",
|
|
16
16
|
inputSchema: {
|
|
17
17
|
type: "object",
|
|
18
18
|
properties: {
|
|
19
19
|
repo: { type: "string", description: "Absolute repository path; defaults to server working directory. Always pass the edited repository when using a plugin." },
|
|
20
20
|
...(name === "diffci_run_affected_tests" ? { timeoutMs: { type: "number", minimum: 0 } } : {}),
|
|
21
|
+
...(name === "diffci_select_tests" || name === "diffci_explain_selection" ? {
|
|
22
|
+
scope: { type: "string", enum: ["working-tree", "staged", "paths"], description: "working-tree (default): every uncommitted change. staged: HEAD plus the index only. paths: HEAD plus only `paths`." },
|
|
23
|
+
paths: { type: "array", items: { type: "string" }, description: "Repository-relative files for scope \"paths\"." },
|
|
24
|
+
} : {}),
|
|
21
25
|
},
|
|
22
26
|
additionalProperties: false,
|
|
23
27
|
},
|
|
@@ -62,7 +66,7 @@ const tools = [
|
|
|
62
66
|
head: { type: "string", description: "Optional head commit SHA." },
|
|
63
67
|
json: { type: "boolean", description: "Print the full JSON observation report." },
|
|
64
68
|
quiet: { type: "boolean", description: "Suppress the human summary." },
|
|
65
|
-
redactPaths: { type: "boolean", description: "Replace paths with stable digests
|
|
69
|
+
redactPaths: { type: "boolean", description: "Replace paths in the analysis result with stable digests. Workflow findings and some fallback details can still name files." },
|
|
66
70
|
},
|
|
67
71
|
additionalProperties: false,
|
|
68
72
|
},
|
|
@@ -241,7 +245,10 @@ async function handle(request) {
|
|
|
241
245
|
const properties = tool.inputSchema.properties;
|
|
242
246
|
for (const [key, value] of Object.entries(args)) {
|
|
243
247
|
const property = properties[key];
|
|
244
|
-
|
|
248
|
+
const typed = property?.type === "array"
|
|
249
|
+
? Array.isArray(value) && value.every((item) => typeof item === "string" && item.trim() !== "")
|
|
250
|
+
: property !== undefined && typeof value === property.type && (!property.enum || property.enum.includes(value));
|
|
251
|
+
if (!typed || (key === "timeoutMs" && (!Number.isFinite(value) || value < 0))) {
|
|
245
252
|
failure(id, -32602, `invalid argument: ${key}`);
|
|
246
253
|
return;
|
|
247
254
|
}
|
|
@@ -253,7 +260,15 @@ async function handle(request) {
|
|
|
253
260
|
success(id, { content: [{ type: "text", text: JSON.stringify(changes) }], structuredContent: changes, isError: changes.status === "blocked" });
|
|
254
261
|
return;
|
|
255
262
|
}
|
|
256
|
-
const
|
|
263
|
+
const scope = stringArg(args, "scope") ?? "working-tree";
|
|
264
|
+
const paths = Array.isArray(args.paths) ? args.paths : undefined;
|
|
265
|
+
if ((scope === "paths") !== (paths !== undefined && paths.length > 0)) {
|
|
266
|
+
failure(id, -32602, scope === "paths" ? "scope \"paths\" needs a non-empty paths array" : "paths applies only to scope \"paths\"");
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const plan = scope === "staged" ? await agentScopedSelection(repo, { kind: "staged" })
|
|
270
|
+
: scope === "paths" ? await agentScopedSelection(repo, { kind: "paths", paths: paths.map((path) => path.replace(/\\/g, "/")) })
|
|
271
|
+
: await agentSelection(repo);
|
|
257
272
|
success(id, { content: [{ type: "text", text: `${selectionInstruction(plan)}\n\n${JSON.stringify(plan)}` }], structuredContent: plan, isError: plan.status === "blocked" });
|
|
258
273
|
return;
|
|
259
274
|
}
|
|
@@ -40,6 +40,8 @@ export interface ObserveOptions {
|
|
|
40
40
|
};
|
|
41
41
|
/** Opt-in agent identity (src/client/agent-identity.ts); absent means the report carries none. */
|
|
42
42
|
agent?: ObservationAgent;
|
|
43
|
+
/** Called with the dependency graph once built, for callers that read its edges (scoped verify). */
|
|
44
|
+
onGraph?: (result: DependencyGraphResult) => void;
|
|
43
45
|
}
|
|
44
46
|
export declare function makeGitRunner(repoPath: string): GitRunner;
|
|
45
47
|
/**
|
|
@@ -224,6 +224,10 @@ export async function observe(options) {
|
|
|
224
224
|
catch { /* caching never fails an observation */ }
|
|
225
225
|
}
|
|
226
226
|
markPhase(cachedGraph ? "graphCached" : "graph");
|
|
227
|
+
try {
|
|
228
|
+
options.onGraph?.(graphResult);
|
|
229
|
+
}
|
|
230
|
+
catch { /* a reader of the graph never fails an observation */ }
|
|
227
231
|
if (graphResult.graph.nodes.length === 0) {
|
|
228
232
|
return finish("REFUSED", "graph", {
|
|
229
233
|
reason: "the dependency graph came back empty - DiffCI will not propose a selection from a graph that sees none of this repository" +
|
|
@@ -44,7 +44,7 @@ export interface ObservationRepository {
|
|
|
44
44
|
providerRepositoryId?: string;
|
|
45
45
|
}
|
|
46
46
|
export interface ObservationCi {
|
|
47
|
-
provider: "github-actions" | "gitlab-ci" | "local" | "unknown";
|
|
47
|
+
provider: "github-actions" | "gitlab-ci" | "azure-pipelines" | "local" | "unknown";
|
|
48
48
|
runId?: string;
|
|
49
49
|
runAttempt?: string;
|
|
50
50
|
workflow?: string;
|
|
@@ -101,7 +101,7 @@ function surfaceOf(env) {
|
|
|
101
101
|
return "cli";
|
|
102
102
|
}
|
|
103
103
|
function isCi(env) {
|
|
104
|
-
return Boolean(env.CI && env.CI !== "false" && env.CI !== "0") || Boolean(env.GITHUB_ACTIONS || env.GITLAB_CI || env.BUILDKITE || env.CIRCLECI);
|
|
104
|
+
return Boolean(env.CI && env.CI !== "false" && env.CI !== "0") || Boolean(env.GITHUB_ACTIONS || env.GITLAB_CI || env.TF_BUILD || env.BUILDKITE || env.CIRCLECI);
|
|
105
105
|
}
|
|
106
106
|
export function telemetryNotice(mode) {
|
|
107
107
|
return mode === "repo"
|
|
@@ -1,13 +1,34 @@
|
|
|
1
|
+
import type { DependencyGraphResult } from "@diffci.com/core/repo/types";
|
|
1
2
|
import { type FailureBaseline } from "./failure-baseline.js";
|
|
2
3
|
import { type EnforcementDecision } from "./enforce-policy.js";
|
|
3
4
|
import { type CheckResult } from "./gate-checks.js";
|
|
4
|
-
import type
|
|
5
|
+
import { type ObservationCommitRange, type ObservationReport, type SelectionReason } from "./report.js";
|
|
5
6
|
import { type ShardSpec, type TimingsFile } from "./test-shards.js";
|
|
6
7
|
import type { CommandMeasurement } from "./verify-savings.js";
|
|
7
|
-
import { type SnapshotChange } from "./working-tree.js";
|
|
8
|
+
import { type SnapshotChange, type VerificationTreeScope, type WorkingTreeSnapshot } from "./working-tree.js";
|
|
8
9
|
export declare const VERIFICATION_SCHEMA: "diffci.verification.v1";
|
|
9
10
|
export type VerificationStatus = "passed" | "failed" | "blocked";
|
|
10
|
-
|
|
11
|
+
/** `staged` and `paths` (2026-11-17) verify HEAD plus only the index, or only the named files, in a temporary worktree. */
|
|
12
|
+
export type VerificationScope = "working-tree" | "commit-range" | "staged" | "paths";
|
|
13
|
+
/** What a `staged` or `paths` receipt covered, and what in the checkout it left out (verifyScoped). */
|
|
14
|
+
export interface ScopedVerification {
|
|
15
|
+
kind: "staged" | "paths";
|
|
16
|
+
/** Always a temporary worktree of HEAD plus the verified files. */
|
|
17
|
+
isolation: "temporary-worktree";
|
|
18
|
+
/** Files that differ from HEAD in the verified tree (digests under --redact-paths). */
|
|
19
|
+
verified_files: string[];
|
|
20
|
+
/** Files in the checkout that differ from the verified tree: other work left out, verified at HEAD. */
|
|
21
|
+
excluded_dirty_files: number;
|
|
22
|
+
/** The first 50 of them. */
|
|
23
|
+
excluded_dirty_paths: string[];
|
|
24
|
+
/** Verified files that import an excluded dirty file, which was verified at its HEAD version. */
|
|
25
|
+
head_version_imports?: Array<{
|
|
26
|
+
file: string;
|
|
27
|
+
imports: string[];
|
|
28
|
+
}>;
|
|
29
|
+
/** Set when the temporary worktree could not be removed; `git worktree prune` after deleting it. */
|
|
30
|
+
cleanup_failed?: string;
|
|
31
|
+
}
|
|
11
32
|
export interface VerificationReport {
|
|
12
33
|
schema: typeof VERIFICATION_SCHEMA;
|
|
13
34
|
schema_version: "1";
|
|
@@ -98,6 +119,8 @@ export interface VerificationReport {
|
|
|
98
119
|
};
|
|
99
120
|
/** Tests the coverage map added to the selection (coverage-map.ts), when it added any. */
|
|
100
121
|
coverage_added?: string[];
|
|
122
|
+
/** Present for `--staged` and `--paths`: the verified files and the excluded dirty ones. */
|
|
123
|
+
scoped?: ScopedVerification;
|
|
101
124
|
}
|
|
102
125
|
interface VerifyOptions {
|
|
103
126
|
repoPath: string;
|
|
@@ -122,9 +145,14 @@ interface VerifyOptions {
|
|
|
122
145
|
timings?: TimingsFile;
|
|
123
146
|
/** False ignores the coverage map (`--no-coverage`). */
|
|
124
147
|
coverage?: boolean;
|
|
148
|
+
/** Receives the dependency graph the analysis built (verifyScoped reads its edges). */
|
|
149
|
+
onGraph?: (result: DependencyGraphResult) => void;
|
|
125
150
|
}
|
|
126
151
|
export interface VerifyChangedOptions extends VerifyOptions {
|
|
127
152
|
}
|
|
153
|
+
export interface VerifyScopedOptions extends VerifyOptions {
|
|
154
|
+
scope: VerificationTreeScope;
|
|
155
|
+
}
|
|
128
156
|
export interface VerifyRangeOptions extends VerifyOptions {
|
|
129
157
|
baseOverride?: string;
|
|
130
158
|
headOverride?: string;
|
|
@@ -133,6 +161,22 @@ export interface VerifyRangeOptions extends VerifyOptions {
|
|
|
133
161
|
}
|
|
134
162
|
/** Verify exactly the staged, unstaged, and non-ignored untracked content currently on disk. */
|
|
135
163
|
export declare function verifyChanged(options: VerifyChangedOptions): Promise<VerificationReport>;
|
|
164
|
+
/**
|
|
165
|
+
* Verify HEAD plus only the staged content (`--staged`) or only the named files (`--paths`), 2026-11-17.
|
|
166
|
+
*
|
|
167
|
+
* The scoped tree is checked out in a temporary worktree of HEAD (isolated-worktree.ts) and verified
|
|
168
|
+
* there exactly as `--changed` verifies a checkout, so every other uncommitted file in this checkout is
|
|
169
|
+
* at its HEAD version for analysis and for the tests: it can neither fail nor rescue the result. The
|
|
170
|
+
* receipt names the verified files and the excluded dirty ones. Its tree is the tree a commit of the
|
|
171
|
+
* staged files has, so the pre-push hook reuses a pass of it (outcome-log.ts, reusablePass).
|
|
172
|
+
*/
|
|
173
|
+
/** The scoped tree, the files it changes from HEAD, and the checkout's other changed files (excluded). */
|
|
174
|
+
export declare function scopedChanges(repoPath: string, scope: VerificationTreeScope): {
|
|
175
|
+
scoped: WorkingTreeSnapshot;
|
|
176
|
+
verified: SnapshotChange[];
|
|
177
|
+
excluded: SnapshotChange[];
|
|
178
|
+
};
|
|
179
|
+
export declare function verifyScoped(options: VerifyScopedOptions): Promise<VerificationReport>;
|
|
136
180
|
/** Verify a real commit range and bind the receipt to the clean commit that was actually executed. */
|
|
137
181
|
export declare function verifyRange(options: VerifyRangeOptions): Promise<VerificationReport>;
|
|
138
182
|
export declare function verificationExitCode(report: VerificationReport): number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
import { mkdtempSync, rmSync } from "node:fs";
|
|
2
3
|
import { tmpdir } from "node:os";
|
|
3
4
|
import { join, resolve } from "node:path";
|
|
@@ -8,12 +9,14 @@ import { collectEnforcementContext, evaluateEnforcement } from "./enforce-policy
|
|
|
8
9
|
import { inferFullCommand, inferPlannedCommands, inferSelectedCommand, inferSelectedCommands } from "./full-command.js";
|
|
9
10
|
import { plannedChecks, runChecks } from "./gate-checks.js";
|
|
10
11
|
import { makeGitRunner, observe } from "./observe.js";
|
|
12
|
+
import { redactPath } from "./report.js";
|
|
13
|
+
import { createIsolatedWorktree } from "./isolated-worktree.js";
|
|
11
14
|
import { selectedNodeTests, traceNodeTestFiles, unmatchedNodeTests, unstartedNodeTests } from "./selected-coverage.js";
|
|
12
15
|
import { outcomeLogPath, readOutcomes, reusablePass } from "./outcome-log.js";
|
|
13
16
|
import { likelyFailures, rankTests, testHistory } from "./test-ranking.js";
|
|
14
17
|
import { assignShards } from "./test-shards.js";
|
|
15
18
|
import { mergeTestFileResults } from "./test-results.js";
|
|
16
|
-
import { captureWorkingTreeSnapshot, snapshotChanges } from "./working-tree.js";
|
|
19
|
+
import { captureScopedTree, captureWorkingTreeSnapshot, snapshotChanges } from "./working-tree.js";
|
|
17
20
|
export const VERIFICATION_SCHEMA = "diffci.verification.v1";
|
|
18
21
|
function receiptRange(range) {
|
|
19
22
|
if (!range)
|
|
@@ -404,6 +407,7 @@ async function verifyChangedSnapshot(options) {
|
|
|
404
407
|
redactPaths: options.redactPaths,
|
|
405
408
|
reportPath: join(temporaryDirectory, "observation.json"),
|
|
406
409
|
selectTestPhases: true,
|
|
410
|
+
...(options.onGraph ? { onGraph: options.onGraph } : {}),
|
|
407
411
|
});
|
|
408
412
|
return await executeObservation({ ...options, repoPath }, "working-tree", before, observation);
|
|
409
413
|
}
|
|
@@ -411,6 +415,113 @@ async function verifyChangedSnapshot(options) {
|
|
|
411
415
|
rmSync(temporaryDirectory, { recursive: true, force: true });
|
|
412
416
|
}
|
|
413
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* Verify HEAD plus only the staged content (`--staged`) or only the named files (`--paths`), 2026-11-17.
|
|
420
|
+
*
|
|
421
|
+
* The scoped tree is checked out in a temporary worktree of HEAD (isolated-worktree.ts) and verified
|
|
422
|
+
* there exactly as `--changed` verifies a checkout, so every other uncommitted file in this checkout is
|
|
423
|
+
* at its HEAD version for analysis and for the tests: it can neither fail nor rescue the result. The
|
|
424
|
+
* receipt names the verified files and the excluded dirty ones. Its tree is the tree a commit of the
|
|
425
|
+
* staged files has, so the pre-push hook reuses a pass of it (outcome-log.ts, reusablePass).
|
|
426
|
+
*/
|
|
427
|
+
/** The scoped tree, the files it changes from HEAD, and the checkout's other changed files (excluded). */
|
|
428
|
+
export function scopedChanges(repoPath, scope) {
|
|
429
|
+
const scoped = captureScopedTree(repoPath, scope);
|
|
430
|
+
const checkout = captureWorkingTreeSnapshot(repoPath);
|
|
431
|
+
return {
|
|
432
|
+
scoped,
|
|
433
|
+
verified: snapshotChanges(repoPath, `${scoped.baseSha}^{tree}`, scoped.treeSha),
|
|
434
|
+
excluded: snapshotChanges(repoPath, scoped.treeSha, checkout.treeSha),
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
export async function verifyScoped(options) {
|
|
438
|
+
return stamped(await verifyScopedTree(options), options.version);
|
|
439
|
+
}
|
|
440
|
+
async function verifyScopedTree(options) {
|
|
441
|
+
const repoPath = resolve(options.repoPath);
|
|
442
|
+
const kind = options.scope.kind;
|
|
443
|
+
const shown = (path) => options.redactPaths ? redactPath(path, (input) => createHash("sha256").update(input).digest("hex")) : path;
|
|
444
|
+
let scoped;
|
|
445
|
+
let verified;
|
|
446
|
+
let excluded;
|
|
447
|
+
try {
|
|
448
|
+
({ scoped, verified, excluded } = scopedChanges(repoPath, options.scope));
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
452
|
+
return blocked(unknownSnapshot(), kind, message, { status: "ERROR", stage: "context", fallback_reasons: [], error: message });
|
|
453
|
+
}
|
|
454
|
+
const scopedField = {
|
|
455
|
+
kind,
|
|
456
|
+
isolation: "temporary-worktree",
|
|
457
|
+
verified_files: verified.map((change) => shown(change.path)),
|
|
458
|
+
excluded_dirty_files: excluded.length,
|
|
459
|
+
excluded_dirty_paths: excluded.slice(0, 50).map((change) => shown(change.path)),
|
|
460
|
+
};
|
|
461
|
+
if (!scoped.changed) {
|
|
462
|
+
return {
|
|
463
|
+
...baseReport(scoped, kind),
|
|
464
|
+
verification: "passed",
|
|
465
|
+
safe_to_continue: true,
|
|
466
|
+
reason: kind === "staged" ? "nothing is staged: the index matches HEAD" : "the given paths do not differ from HEAD",
|
|
467
|
+
changed_files: 0,
|
|
468
|
+
tests_available: 0,
|
|
469
|
+
tests_selected: 0,
|
|
470
|
+
selection: "none",
|
|
471
|
+
snapshot: { ...baseReport(scoped, kind).snapshot, after_base_sha: scoped.baseSha, after_tree_sha: scoped.treeSha, unchanged: true },
|
|
472
|
+
analysis: { status: "not_needed", fallback_reasons: [] },
|
|
473
|
+
required_actions: [],
|
|
474
|
+
scoped: scopedField,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
const worktree = createIsolatedWorktree(repoPath, scoped.baseSha, scoped.treeSha);
|
|
478
|
+
if ("error" in worktree) {
|
|
479
|
+
return { ...blocked(scoped, kind, worktree.error, { status: "not_needed", fallback_reasons: [] }, { changedFiles: verified.length }), scoped: scopedField };
|
|
480
|
+
}
|
|
481
|
+
let forward;
|
|
482
|
+
let inner;
|
|
483
|
+
let cleaned;
|
|
484
|
+
try {
|
|
485
|
+
inner = await verifyChangedSnapshot({ ...options, repoPath: worktree.path, onGraph: (graph) => { forward = graph.graph.forward; } });
|
|
486
|
+
}
|
|
487
|
+
finally {
|
|
488
|
+
cleaned = worktree.dispose();
|
|
489
|
+
}
|
|
490
|
+
if (!cleaned)
|
|
491
|
+
scopedField.cleanup_failed = worktree.path;
|
|
492
|
+
// Excluded dirty files a verified file imports were verified at their HEAD version: say which.
|
|
493
|
+
const excludedPaths = new Set(excluded.map((change) => change.path));
|
|
494
|
+
const imports = forward
|
|
495
|
+
? verified.flatMap((change) => {
|
|
496
|
+
const targets = (forward[change.path] ?? []).filter((target) => excludedPaths.has(target));
|
|
497
|
+
return targets.length ? [{ file: shown(change.path), imports: [...new Set(targets)].sort().map(shown) }] : [];
|
|
498
|
+
})
|
|
499
|
+
: [];
|
|
500
|
+
if (imports.length)
|
|
501
|
+
scopedField.head_version_imports = imports;
|
|
502
|
+
// The verdict is for the tree captured at the start: HEAD and the scoped files must still be it.
|
|
503
|
+
let after;
|
|
504
|
+
try {
|
|
505
|
+
after = captureScopedTree(repoPath, options.scope);
|
|
506
|
+
}
|
|
507
|
+
catch {
|
|
508
|
+
after = undefined;
|
|
509
|
+
}
|
|
510
|
+
const moved = !after ? "could not re-read the verified files after the run"
|
|
511
|
+
: after.baseSha !== scoped.baseSha ? "HEAD moved while verification was running"
|
|
512
|
+
: after.treeSha !== scoped.treeSha ? (kind === "staged" ? "the index changed while verification was running (another session may have staged files)" : "the given files changed while verification was running")
|
|
513
|
+
: inner.snapshot.before_tree_sha !== scoped.treeSha ? "the temporary worktree did not reproduce the verified files"
|
|
514
|
+
: undefined;
|
|
515
|
+
const importNote = imports.length
|
|
516
|
+
? `; ${imports.length} verified file(s) import files changed outside the scope, verified at their HEAD version (${imports.slice(0, 3).map((entry) => `${entry.file} -> ${entry.imports.join(", ")}`).join("; ")})`
|
|
517
|
+
: "";
|
|
518
|
+
const report = { ...inner, scope: kind, reason: `${inner.reason}${importNote}`, scoped: scopedField };
|
|
519
|
+
if (moved) {
|
|
520
|
+
const reason = `${moved}; rerun DiffCI for the new ${kind === "staged" ? "index" : "files"}`;
|
|
521
|
+
return { ...report, verification: "blocked", safe_to_continue: false, reason, required_actions: [reason] };
|
|
522
|
+
}
|
|
523
|
+
return report;
|
|
524
|
+
}
|
|
414
525
|
/** Verify a real commit range and bind the receipt to the clean commit that was actually executed. */
|
|
415
526
|
export async function verifyRange(options) {
|
|
416
527
|
return stamped(await verifyCommitRange(options), options.version);
|
|
@@ -472,6 +583,15 @@ export function formatVerificationSummary(report) {
|
|
|
472
583
|
];
|
|
473
584
|
if (report.commit_range)
|
|
474
585
|
lines.splice(2, 0, ` range: ${report.commit_range.base_sha.slice(0, 12)}..${report.commit_range.head_sha.slice(0, 12)}`);
|
|
586
|
+
const scoped = report.scoped;
|
|
587
|
+
if (scoped) {
|
|
588
|
+
const list = (paths, total) => `${paths.slice(0, 5).join(", ")}${total > 5 ? `, ${total - 5} more` : ""}`;
|
|
589
|
+
lines.splice(2, 0, ` verified files (HEAD + ${scoped.kind === "staged" ? "index" : "given paths"}, temporary worktree): ${scoped.verified_files.length}${scoped.verified_files.length ? ` (${list(scoped.verified_files, scoped.verified_files.length)})` : ""}`);
|
|
590
|
+
if (scoped.excluded_dirty_files)
|
|
591
|
+
lines.splice(3, 0, ` excluded: ${scoped.excluded_dirty_files} other changed file(s) in this checkout, verified at HEAD (${list(scoped.excluded_dirty_paths, scoped.excluded_dirty_files)})`);
|
|
592
|
+
if (scoped.cleanup_failed)
|
|
593
|
+
lines.push(` warning: could not remove the temporary worktree ${scoped.cleanup_failed}; delete it and run git worktree prune`);
|
|
594
|
+
}
|
|
475
595
|
const lineEndings = report.snapshot.line_ending_only_changes;
|
|
476
596
|
if (lineEndings?.length) {
|
|
477
597
|
lines.push(` line endings only: ${lineEndings.length}${lineEndings.length === 20 ? "+" : ""} checked-out file(s) differ from HEAD only by CRLF (${lineEndings.slice(0, 3).join(", ")}${lineEndings.length > 3 ? ", ..." : ""}); verified as checked out`);
|
|
@@ -24,5 +24,27 @@ export interface SnapshotChange {
|
|
|
24
24
|
* used only by DiffCI's existing commit-to-commit analyzer.
|
|
25
25
|
*/
|
|
26
26
|
export declare function captureWorkingTreeSnapshot(repoPathInput: string): WorkingTreeSnapshot;
|
|
27
|
+
/** What a scoped verification covers: HEAD plus the index (`--staged`), or HEAD plus these working-tree paths (`--paths`). */
|
|
28
|
+
export type VerificationTreeScope = {
|
|
29
|
+
kind: "staged";
|
|
30
|
+
} | {
|
|
31
|
+
kind: "paths";
|
|
32
|
+
paths: readonly string[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The tree a scoped verification checks (2026-11-17): HEAD plus only the staged content, or HEAD plus only
|
|
36
|
+
* the named working-tree paths, built in a temporary index like the working-tree snapshot.
|
|
37
|
+
*
|
|
38
|
+
* WHY. Several agent sessions shared one DentalPresence checkout; `verify --changed` before a 3-file commit
|
|
39
|
+
* verified another session's 30 uncommitted files too (341 of 638 test files, about 8 minutes, failed on
|
|
40
|
+
* the other session's code). HEAD plus those 3 files alone selected 12 test files and passed in 12 s.
|
|
41
|
+
*
|
|
42
|
+
* `--staged` reads a copy of the real index, so another session staging at the same moment can never see a
|
|
43
|
+
* half-written index of ours, and ours is never rewritten. `--paths` are literal pathspecs: Next.js route
|
|
44
|
+
* folders such as `app/[slug]` are names, not globs. A path deleted in the working tree is a deletion.
|
|
45
|
+
*/
|
|
46
|
+
export declare function captureScopedTree(repoPathInput: string, scope: VerificationTreeScope): WorkingTreeSnapshot;
|
|
47
|
+
/** The tree of HEAD, for comparing a snapshot with the checked-out commit. */
|
|
48
|
+
export declare function headTree(repoPathInput: string): string;
|
|
27
49
|
/** The paths that differ between two snapshot trees of the same repository. */
|
|
28
50
|
export declare function snapshotChanges(repoPathInput: string, beforeTreeSha: string, afterTreeSha: string): SnapshotChange[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
2
|
+
import { copyFileSync, existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
5
5
|
function runGit(repoPath, args, env, input) {
|
|
@@ -90,6 +90,24 @@ function crlfCheckouts(repoPath, baseTreeSha, indexEnvironment) {
|
|
|
90
90
|
* used only by DiffCI's existing commit-to-commit analyzer.
|
|
91
91
|
*/
|
|
92
92
|
export function captureWorkingTreeSnapshot(repoPathInput) {
|
|
93
|
+
return captureTree(repoPathInput, { kind: "working-tree" });
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The tree a scoped verification checks (2026-11-17): HEAD plus only the staged content, or HEAD plus only
|
|
97
|
+
* the named working-tree paths, built in a temporary index like the working-tree snapshot.
|
|
98
|
+
*
|
|
99
|
+
* WHY. Several agent sessions shared one DentalPresence checkout; `verify --changed` before a 3-file commit
|
|
100
|
+
* verified another session's 30 uncommitted files too (341 of 638 test files, about 8 minutes, failed on
|
|
101
|
+
* the other session's code). HEAD plus those 3 files alone selected 12 test files and passed in 12 s.
|
|
102
|
+
*
|
|
103
|
+
* `--staged` reads a copy of the real index, so another session staging at the same moment can never see a
|
|
104
|
+
* half-written index of ours, and ours is never rewritten. `--paths` are literal pathspecs: Next.js route
|
|
105
|
+
* folders such as `app/[slug]` are names, not globs. A path deleted in the working tree is a deletion.
|
|
106
|
+
*/
|
|
107
|
+
export function captureScopedTree(repoPathInput, scope) {
|
|
108
|
+
return captureTree(repoPathInput, scope);
|
|
109
|
+
}
|
|
110
|
+
function captureTree(repoPathInput, scope) {
|
|
93
111
|
const repoPath = resolve(repoPathInput);
|
|
94
112
|
const baseSha = requireGit(repoPath, ["rev-parse", "--verify", "HEAD^{commit}"], "could not resolve repository HEAD");
|
|
95
113
|
const baseTreeSha = requireGit(repoPath, ["rev-parse", "--verify", "HEAD^{tree}"], "could not resolve repository HEAD tree");
|
|
@@ -100,11 +118,28 @@ export function captureWorkingTreeSnapshot(repoPathInput) {
|
|
|
100
118
|
const temporaryIndex = join(temporaryDirectory, "index");
|
|
101
119
|
const indexEnvironment = { GIT_INDEX_FILE: temporaryIndex };
|
|
102
120
|
try {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
121
|
+
let lineEndingOnly = [];
|
|
122
|
+
if (scope.kind === "staged") {
|
|
123
|
+
const indexPath = resolve(repoPath, requireGit(repoPath, ["rev-parse", "--git-path", "index"], "could not locate the repository index"));
|
|
124
|
+
if (existsSync(indexPath))
|
|
125
|
+
copyFileSync(indexPath, temporaryIndex);
|
|
126
|
+
else
|
|
127
|
+
requireGit(repoPath, ["read-tree", baseSha], "could not initialize the verification snapshot", indexEnvironment);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
requireGit(repoPath, ["read-tree", baseSha], "could not initialize the verification snapshot", indexEnvironment);
|
|
131
|
+
if (scope.kind === "working-tree") {
|
|
132
|
+
requireGit(repoPath, ["add", "-A", "--", "."], "could not capture the working tree", indexEnvironment);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
if (scope.paths.length === 0)
|
|
136
|
+
throw new Error("--paths needs at least one path");
|
|
137
|
+
requireGit(repoPath, ["--literal-pathspecs", "add", "-A", "--pathspec-from-file=-", "--pathspec-file-nul"], "could not capture the given paths", indexEnvironment, `${scope.paths.join("\0")}\0`);
|
|
138
|
+
}
|
|
139
|
+
lineEndingOnly = crlfCheckouts(repoPath, baseTreeSha, indexEnvironment);
|
|
140
|
+
if (lineEndingOnly.length > 0) {
|
|
141
|
+
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`);
|
|
142
|
+
}
|
|
108
143
|
}
|
|
109
144
|
const treeSha = requireGit(repoPath, ["write-tree"], "could not write the verification tree", indexEnvironment);
|
|
110
145
|
const identityEnvironment = {
|
|
@@ -122,6 +157,10 @@ export function captureWorkingTreeSnapshot(repoPathInput) {
|
|
|
122
157
|
rmSync(temporaryDirectory, { recursive: true, force: true });
|
|
123
158
|
}
|
|
124
159
|
}
|
|
160
|
+
/** The tree of HEAD, for comparing a snapshot with the checked-out commit. */
|
|
161
|
+
export function headTree(repoPathInput) {
|
|
162
|
+
return requireGit(resolve(repoPathInput), ["rev-parse", "--verify", "HEAD^{tree}"], "could not resolve repository HEAD tree");
|
|
163
|
+
}
|
|
125
164
|
/** The paths that differ between two snapshot trees of the same repository. */
|
|
126
165
|
export function snapshotChanges(repoPathInput, beforeTreeSha, afterTreeSha) {
|
|
127
166
|
if (beforeTreeSha === afterTreeSha)
|
|
@@ -21,7 +21,7 @@ If DiffCI saves you CI time, a ⭐ helps others find it.
|
|
|
21
21
|
|
|
22
22
|
```yaml
|
|
23
23
|
- uses: actions/checkout@v7
|
|
24
|
-
- uses: DiffCI/core@v0.3.
|
|
24
|
+
- uses: DiffCI/core@v0.3.52
|
|
25
25
|
```
|
|
26
26
|
|
|
27
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:
|
|
@@ -279,11 +279,11 @@ Thank you to everyone who has improved DiffCI:
|
|
|
279
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)**: the [Rust (Cargo) adapter](https://github.com/DiffCI/core/issues/62), from Cargo package and test-target mapping ([#91](https://github.com/DiffCI/core/pull/91)) through crate-dependency selection ([#92](https://github.com/DiffCI/core/pull/92)), conservative `cargo test` commands ([#93](https://github.com/DiffCI/core/pull/93)), registration inside the release boundary ([#94](https://github.com/DiffCI/core/pull/94)) and a pinned public replay on hosted CI ([#95](https://github.com/DiffCI/core/pull/95)), and five safety fixes for runtime module dependencies, Maven module resources, runner suites, deleted assets and Go runtime inputs ([#32](https://github.com/DiffCI/core/pull/32)–[#36](https://github.com/DiffCI/core/pull/36)).
|
|
280
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)).
|
|
281
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)).
|
|
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)**: lockfile and config-file signals. One shared lockfile list replaced every hand-written copy in `src/` ([#97](https://github.com/DiffCI/core/issues/97)): reference resolution, impact analysis and the lockfile-free dependency check ([#118](https://github.com/DiffCI/core/pull/118)–[#120](https://github.com/DiffCI/core/pull/120)), config-file discovery and impact classification, where `npm-shrinkwrap.json` is now a config change like every other lockfile ([#151](https://github.com/DiffCI/core/pull/151), [#152](https://github.com/DiffCI/core/pull/152)), the Vue analysis cache ([#107](https://github.com/DiffCI/core/pull/107)), CI inference ([#105](https://github.com/DiffCI/core/pull/105), [#146](https://github.com/DiffCI/core/pull/146)) and both path baselines, which now also fall back on `npm-shrinkwrap.json` ([#147](https://github.com/DiffCI/core/pull/147), [#148](https://github.com/DiffCI/core/pull/148)). A full run when only `babel.config.*` or `.babelrc*` changes ([#108](https://github.com/DiffCI/core/pull/108)) or a package's Jest, Vitest or Babel config changes ([#121](https://github.com/DiffCI/core/pull/121)), where these files used to select no tests. Regression tests for `vite.config`-only changes in Vitest projects ([#109](https://github.com/DiffCI/core/pull/109)) and for a root Vitest config that turns isolation off ([#149](https://github.com/DiffCI/core/pull/149)), and removal of dead config-file patterns with a test for every entry ([#106](https://github.com/DiffCI/core/pull/106)). Go `replace` targets inside the repository modelled under root-module scope instead of forcing the full suite ([#110](https://github.com/DiffCI/core/pull/110)). The [no-runnable-command reasons](docs/using-diffci.md#no-runnable-command), documented with a test that keeps the table complete ([#150](https://github.com/DiffCI/core/pull/150)), and `"\0"` escapes in place of raw NUL bytes, so git and ripgrep can search those source files again ([#145](https://github.com/DiffCI/core/pull/145)).
|
|
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)**: lockfile and config-file signals. One shared lockfile list replaced every hand-written copy in `src/` ([#97](https://github.com/DiffCI/core/issues/97)): reference resolution, impact analysis and the lockfile-free dependency check ([#118](https://github.com/DiffCI/core/pull/118)–[#120](https://github.com/DiffCI/core/pull/120)), config-file discovery and impact classification, where `npm-shrinkwrap.json` is now a config change like every other lockfile ([#151](https://github.com/DiffCI/core/pull/151), [#152](https://github.com/DiffCI/core/pull/152)), the Vue analysis cache ([#107](https://github.com/DiffCI/core/pull/107)), CI inference ([#105](https://github.com/DiffCI/core/pull/105), [#146](https://github.com/DiffCI/core/pull/146)) and both path baselines, which now also fall back on `npm-shrinkwrap.json` ([#147](https://github.com/DiffCI/core/pull/147), [#148](https://github.com/DiffCI/core/pull/148)). A full run when only `babel.config.*` or `.babelrc*` changes ([#108](https://github.com/DiffCI/core/pull/108)) or a package's Jest, Vitest or Babel config changes ([#121](https://github.com/DiffCI/core/pull/121)), where these files used to select no tests. Regression tests for `vite.config`-only changes in Vitest projects ([#109](https://github.com/DiffCI/core/pull/109)) and for a root Vitest config that turns isolation off ([#149](https://github.com/DiffCI/core/pull/149)), and removal of dead config-file patterns with a test for every entry ([#106](https://github.com/DiffCI/core/pull/106)). Go `replace` targets inside the repository modelled under root-module scope instead of forcing the full suite ([#110](https://github.com/DiffCI/core/pull/110)). The [no-runnable-command reasons](docs/using-diffci.md#no-runnable-command), documented with a test that keeps the table complete ([#150](https://github.com/DiffCI/core/pull/150)), and `"\0"` escapes in place of raw NUL bytes, so git and ripgrep can search those source files again ([#145](https://github.com/DiffCI/core/pull/145)); document verify-workflow, pilot-packet, validate-specs and telemetry ([#153](https://github.com/DiffCI/core/pull/153)).
|
|
283
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)).
|
|
284
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
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)).
|
|
286
|
-
- <a href="https://github.com/tyza66"><img src="https://github.com/tyza66.png?size=80" width="40" height="40" alt="@tyza66"></a> **[@tyza66](https://github.com/tyza66)**: name the tool configuration behind a fallback instead of "Unknown changed file" ([#144](https://github.com/DiffCI/core/pull/144)).
|
|
286
|
+
- <a href="https://github.com/tyza66"><img src="https://github.com/tyza66.png?size=80" width="40" height="40" alt="@tyza66"></a> **[@tyza66](https://github.com/tyza66)**: name the tool configuration behind a fallback instead of "Unknown changed file" ([#144](https://github.com/DiffCI/core/pull/144)); name a tsconfig variant as TypeScript configuration instead of unknown ([#155](https://github.com/DiffCI/core/pull/155)).
|
|
287
287
|
|
|
288
288
|
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.
|
|
289
289
|
|