@diffci.com/diffci 0.2.4 → 0.2.6

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.
@@ -1,4 +1,5 @@
1
- import { spawnSync } from "node:child_process";
1
+ import { execFileSync, spawnSync } from "node:child_process";
2
+ import { createHash } from "node:crypto";
2
3
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
4
  import { dirname, resolve } from "node:path";
4
5
  function tail(value, bytes) {
@@ -8,7 +9,8 @@ function tail(value, bytes) {
8
9
  }
9
10
  function readSelectionFromObservation(path) {
10
11
  const absolutePath = resolve(path);
11
- const parsed = JSON.parse(readFileSync(absolutePath, "utf8"));
12
+ const bytes = readFileSync(absolutePath);
13
+ const parsed = JSON.parse(bytes.toString("utf8"));
12
14
  if (parsed.status !== "OBSERVED")
13
15
  throw new Error(`--selected-from-report requires an OBSERVED report; got ${String(parsed.status)}`);
14
16
  const commands = parsed.result?.proposedCommands;
@@ -24,6 +26,47 @@ function readSelectionFromObservation(path) {
24
26
  selectedTestCount: selectedTests?.length,
25
27
  totalTestCount: typeof parsed.result?.totalTestCount === "number" ? parsed.result.totalTestCount : undefined,
26
28
  analysisOverheadMs: typeof parsed.timings?.totalMs === "number" ? parsed.timings.totalMs : undefined,
29
+ baseSha: typeof parsed.commitRange?.baseSha === "string" ? parsed.commitRange.baseSha : undefined,
30
+ headSha: typeof parsed.commitRange?.headSha === "string" ? parsed.commitRange.headSha : undefined,
31
+ observationSha256: createHash("sha256").update(bytes).digest("hex"),
32
+ observerVersion: typeof parsed.observer?.version === "string" ? parsed.observer.version : undefined,
33
+ };
34
+ }
35
+ function checkoutSnapshot(cwd) {
36
+ const capturedAt = new Date().toISOString();
37
+ try {
38
+ const headSha = execFileSync("git", ["rev-parse", "HEAD"], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
39
+ const status = execFileSync("git", ["status", "--porcelain=v1", "-z", "--untracked-files=all"], { cwd, encoding: "buffer", stdio: ["ignore", "pipe", "ignore"] });
40
+ return { capturedAt, headSha, worktreeDigest: createHash("sha256").update(status).digest("hex") };
41
+ }
42
+ catch {
43
+ return { capturedAt };
44
+ }
45
+ }
46
+ function buildProvenance(selection, beforeFull, afterFull, afterSelected) {
47
+ const invalidReasons = [];
48
+ const snapshots = [beforeFull, afterFull, afterSelected];
49
+ const expectedHeadSha = selection.headSha ?? (selection.source === "manual" ? beforeFull.headSha : undefined);
50
+ if (snapshots.some(snapshot => !snapshot.headSha || !snapshot.worktreeDigest))
51
+ invalidReasons.push("checkout identity could not be captured for every execution boundary");
52
+ if (expectedHeadSha && snapshots.some(snapshot => snapshot.headSha !== expectedHeadSha))
53
+ invalidReasons.push("executed checkout HEAD did not match the bound head SHA at every boundary");
54
+ if (!expectedHeadSha)
55
+ invalidReasons.push("no head SHA was available to bind the execution");
56
+ if (new Set(snapshots.map(snapshot => snapshot.headSha)).size !== 1)
57
+ invalidReasons.push("checkout HEAD changed during paired execution");
58
+ if (new Set(snapshots.map(snapshot => snapshot.worktreeDigest)).size !== 1)
59
+ invalidReasons.push("worktree changed during paired execution");
60
+ return {
61
+ baseSha: selection.baseSha,
62
+ headSha: expectedHeadSha,
63
+ observationSha256: selection.observationSha256,
64
+ observerVersion: selection.observerVersion,
65
+ beforeFull,
66
+ afterFull,
67
+ afterSelected,
68
+ checkoutStable: invalidReasons.length === 0,
69
+ invalidReasons,
27
70
  };
28
71
  }
29
72
  function resolveSelection(options) {
@@ -76,6 +119,7 @@ export function buildVerifySavingsReport(input) {
76
119
  const fullCommandSucceeded = input.full.exitCode === 0 && !input.full.timedOut;
77
120
  const selectedCommandSucceeded = input.selected.exitCode === 0 && !input.selected.timedOut;
78
121
  const missedFailureSignal = !fullCommandSucceeded && selectedCommandSucceeded;
122
+ const evidenceValid = fullCommandSucceeded && selectedCommandSucceeded && (input.provenance?.checkoutStable ?? false);
79
123
  const notes = [
80
124
  "This is paired runtime evidence, not a production-savings claim.",
81
125
  "Full and selected commands were run sequentially in the same checkout.",
@@ -85,8 +129,10 @@ export function buildVerifySavingsReport(input) {
85
129
  ];
86
130
  if (missedFailureSignal)
87
131
  notes.push("Full failed while selected passed; inspect outputs before treating the selection as safe.");
132
+ if (input.provenance && !input.provenance.checkoutStable)
133
+ notes.push(`Checkout provenance invalid: ${input.provenance.invalidReasons.join("; ")}.`);
88
134
  return {
89
- schema: "diffci.verifySavings.v1",
135
+ schema: "diffci.verifySavings.v2",
90
136
  producedAt: input.producedAt ?? new Date().toISOString(),
91
137
  label: input.label,
92
138
  cwd: input.cwd,
@@ -96,6 +142,13 @@ export function buildVerifySavingsReport(input) {
96
142
  observationReportPath: input.selection.observationReportPath,
97
143
  selectedTestCount: input.selection.selectedTestCount,
98
144
  totalTestCount: input.selection.totalTestCount,
145
+ provenance: input.provenance ?? {
146
+ beforeFull: { capturedAt: input.full.startedAt },
147
+ afterFull: { capturedAt: input.full.finishedAt },
148
+ afterSelected: { capturedAt: input.selected.finishedAt },
149
+ checkoutStable: false,
150
+ invalidReasons: ["checkout provenance was not captured"],
151
+ },
99
152
  full: input.full,
100
153
  selected: input.selected,
101
154
  comparison: {
@@ -108,6 +161,7 @@ export function buildVerifySavingsReport(input) {
108
161
  selectedCommandSucceeded,
109
162
  fullCommandSucceeded,
110
163
  missedFailureSignal,
164
+ evidenceValid,
111
165
  },
112
166
  notes,
113
167
  };
@@ -128,7 +182,9 @@ export function renderVerifySavingsMarkdown(report) {
128
182
  ? "\n> WARNING: Full failed while selected passed. Do not treat this selected command as safe until the full-run failure is understood.\n"
129
183
  : !report.comparison.fullCommandSucceeded || !report.comparison.selectedCommandSucceeded
130
184
  ? "\n> WARNING: One or both commands failed. This comparison is invalid as savings evidence; timings below are diagnostic only.\n"
131
- : "";
185
+ : !report.comparison.evidenceValid
186
+ ? `\n> WARNING: Checkout provenance validation failed: ${report.provenance.invalidReasons.join("; ")}. Timings are diagnostic only.\n`
187
+ : "";
132
188
  const selectionCounts = report.selectedTestCount !== undefined && report.totalTestCount !== undefined
133
189
  ? `\nSelected tests: ${report.selectedTestCount} of ${report.totalTestCount}\n`
134
190
  : "";
@@ -143,7 +199,7 @@ This report compares a full command with a selected command on the same checkout
143
199
 
144
200
  ## Result
145
201
 
146
- ${!report.comparison.fullCommandSucceeded || !report.comparison.selectedCommandSucceeded ? "Comparison invalid: command failure. Do not interpret the timing difference as savings.\n" : ""}
202
+ ${!report.comparison.fullCommandSucceeded || !report.comparison.selectedCommandSucceeded ? "Comparison invalid: command failure. Do not interpret the timing difference as savings.\n" : !report.comparison.evidenceValid ? "Comparison invalid: checkout identity changed or could not be verified. Do not interpret the timing difference as savings.\n" : ""}
147
203
  | Measure | Value |
148
204
  | --- | ---: |
149
205
  | Full runtime | ${formatMs(report.comparison.fullWallMs)} |
@@ -154,6 +210,16 @@ ${!report.comparison.fullCommandSucceeded || !report.comparison.selectedCommandS
154
210
  | Delta vs full | ${formatMs(report.comparison.deltaMs)} ${deltaLabel} |
155
211
  | Percent change vs full | ${formatPercent(report.comparison.percentChange)} |
156
212
 
213
+ ## Provenance
214
+
215
+ | Field | Value |
216
+ | --- | --- |
217
+ | Base SHA | \`${report.provenance.baseSha ?? "unavailable"}\` |
218
+ | Head SHA | \`${report.provenance.headSha ?? "unavailable"}\` |
219
+ | Observation SHA-256 | \`${report.provenance.observationSha256 ?? "unavailable"}\` |
220
+ | DiffCI observer version | ${report.provenance.observerVersion ?? "unavailable"} |
221
+ | Checkout stable across both arms | ${report.provenance.checkoutStable ? "yes" : "no"} |
222
+
157
223
  ## Commands
158
224
 
159
225
  | Arm | Exit | Timed out | Command |
@@ -173,8 +239,12 @@ function writeText(path, value) {
173
239
  export function runVerifySavings(options) {
174
240
  const selection = resolveSelection(options);
175
241
  const analysisOverheadMs = options.analysisOverheadMs ?? selection.analysisOverheadMs;
242
+ const beforeFull = checkoutSnapshot(options.cwd);
176
243
  const full = measureCommand(options.full, options);
244
+ const afterFull = checkoutSnapshot(options.cwd);
177
245
  const selected = measureCommand(selection.command, options);
246
+ const afterSelected = checkoutSnapshot(options.cwd);
247
+ const provenance = buildProvenance(selection, beforeFull, afterFull, afterSelected);
178
248
  return buildVerifySavingsReport({
179
249
  label: options.label,
180
250
  cwd: options.cwd,
@@ -183,6 +253,7 @@ export function runVerifySavings(options) {
183
253
  selection,
184
254
  full,
185
255
  selected,
256
+ provenance,
186
257
  });
187
258
  }
188
259
  export function writeVerifySavingsReport(report, paths) {
@@ -195,6 +266,9 @@ export function formatVerifySavingsSummary(report) {
195
266
  return "DiffCI verify-savings: comparison invalid because one or both commands failed" +
196
267
  (report.comparison.missedFailureSignal ? "\n warning: full failed while selected passed; inspect outputs before claiming safety" : "");
197
268
  }
269
+ if (!report.comparison.evidenceValid) {
270
+ return `DiffCI verify-savings: comparison invalid because checkout provenance failed\n ${report.provenance.invalidReasons.join("; ")}`;
271
+ }
198
272
  const lines = [
199
273
  `DiffCI verify-savings: test execution ${Math.abs(report.comparison.grossPercentChange).toFixed(1)}% ${report.comparison.grossPercentChange >= 0 ? "faster" : "slower"} in this paired run`,
200
274
  ` full: ${formatMs(report.comparison.fullWallMs)}`,
@@ -1,39 +1,39 @@
1
- # DiffCI Adoption Metrics
2
-
3
- Track adoption weekly after each outreach batch.
4
-
5
- ## Package
6
-
7
- - npm latest version: `npm view "@diffci.com/diffci" version`
8
- - npm weekly downloads: `npm view "@diffci.com/diffci" downloads`
9
- - MCP binary presence: `npm view "@diffci.com/diffci" bin --json`
10
-
11
- ## Repository
12
-
13
- - GitHub stars, forks, watchers, and release views.
14
- - Issues or PRs opened by users asking about `diffci check`, `diffci init`, or `diffci-mcp`.
15
- - External PRs merged that mention DiffCI agent validation.
16
-
17
- ## Site
18
-
19
- - Visits to `https://diffci.com/docs/ai-agents.html`.
20
- - Visits to `https://diffci.com/llms.txt`.
21
- - Clicks from the homepage agent and MCP links.
22
- - Referrers from MCP directories, awesome lists, and agent-template repositories.
23
-
24
- ## Outreach
25
-
26
- Record each submission in `docs/agent-adoption-targets.md` or a dated note:
27
-
28
- | Date | Target | Type | Link | Status | Follow-up |
29
- | --- | --- | --- | --- | --- | --- |
30
- | 2026-09-22 | agentsmd/agents.md | Issue | https://github.com/agentsmd/agents.md/issues/245 | Open | Watch for maintainer preference: issue, PR, or no listing. |
31
- | 2026-09-22 | FerroxLabs/agents-md | Issue | https://github.com/FerroxLabs/agents-md/issues/2 | Open | Offer a PR if maintainer wants exact wording. |
32
- | 2026-09-22 | ciembor/agent-rules-books | Issue | https://github.com/ciembor/agent-rules-books/issues/8 | Open | Offer a PR if maintainer wants exact wording. |
33
- | 2026-09-22 | jbarbier/CLAUDE.md | Issue | https://github.com/jbarbier/CLAUDE.md/issues/12 | Open | Offer a PR if maintainer wants exact wording. |
34
- | 2026-09-22 | Official MCP Registry | Directory | TBD | Planned | Prepare publisher metadata. |
35
- | 2026-09-22 | Glama | Directory | TBD | Planned | Submit repository URL. |
36
- | 2026-09-22 | Smithery | Directory | TBD | Blocked | Needs Smithery account/API key. |
37
-
38
- Use merged PRs and accepted directory listings as the primary adoption signal. Use stars, downloads,
39
- and page views as supporting indicators, not proof that agents are actually using DiffCI.
1
+ # DiffCI Adoption Metrics
2
+
3
+ Track adoption weekly after each outreach batch.
4
+
5
+ ## Package
6
+
7
+ - npm latest version: `npm view "@diffci.com/diffci" version`
8
+ - npm weekly downloads: `npm view "@diffci.com/diffci" downloads`
9
+ - MCP binary presence: `npm view "@diffci.com/diffci" bin --json`
10
+
11
+ ## Repository
12
+
13
+ - GitHub stars, forks, watchers, and release views.
14
+ - Issues or PRs opened by users asking about `diffci check`, `diffci init`, or `diffci-mcp`.
15
+ - External PRs merged that mention DiffCI agent validation.
16
+
17
+ ## Site
18
+
19
+ - Visits to `https://diffci.com/docs/ai-agents.html`.
20
+ - Visits to `https://diffci.com/llms.txt`.
21
+ - Clicks from the homepage agent and MCP links.
22
+ - Referrers from MCP directories, awesome lists, and agent-template repositories.
23
+
24
+ ## Outreach
25
+
26
+ Record each submission in `docs/agent-adoption-targets.md` or a dated note:
27
+
28
+ | Date | Target | Type | Link | Status | Follow-up |
29
+ | --- | --- | --- | --- | --- | --- |
30
+ | 2026-09-22 | agentsmd/agents.md | Issue | https://github.com/agentsmd/agents.md/issues/245 | Open | Watch for maintainer preference: issue, PR, or no listing. |
31
+ | 2026-09-22 | FerroxLabs/agents-md | Issue | https://github.com/FerroxLabs/agents-md/issues/2 | Open | Offer a PR if maintainer wants exact wording. |
32
+ | 2026-09-22 | ciembor/agent-rules-books | Issue | https://github.com/ciembor/agent-rules-books/issues/8 | Open | Offer a PR if maintainer wants exact wording. |
33
+ | 2026-09-22 | jbarbier/CLAUDE.md | Issue | https://github.com/jbarbier/CLAUDE.md/issues/12 | Open | Offer a PR if maintainer wants exact wording. |
34
+ | 2026-09-22 | Official MCP Registry | Directory | `io.github.adityankale190895/diffci` | Published | Consider moving to `io.github.DiffCI/diffci` after GitHub org namespace authorization is available. |
35
+ | 2026-09-22 | Glama | Directory | TBD | Planned | Submit repository URL. |
36
+ | 2026-09-22 | Smithery | Directory | TBD | Blocked | Needs Smithery account/API key. |
37
+
38
+ Use merged PRs and accepted directory listings as the primary adoption signal. Use stars, downloads,
39
+ and page views as supporting indicators, not proof that agents are actually using DiffCI.
@@ -1,84 +1,84 @@
1
- # DiffCI Adoption Outreach
2
-
3
- Use this page as the canonical copy source for directory submissions, issues, and pull requests.
4
-
5
- ## One-Line Description
6
-
7
- DiffCI is an observation-only CI/CD validation tool and MCP server for AI coding agents.
8
-
9
- ## Short Description
10
-
11
- DiffCI gives coding agents a safe validation lens before they call work PR-ready. It analyzes the
12
- current checkout, explains affected tests, can run inferred local validation through `diffci check`,
13
- and leaves required CI authoritative.
14
-
15
- ## Links
16
-
17
- - Website: https://diffci.com/
18
- - Agent docs: https://diffci.com/docs/ai-agents.html
19
- - MCP docs: https://github.com/DiffCI/DiffCI.com/blob/main/docs/mcp.md
20
- - LLM discovery: https://diffci.com/llms.txt
21
- - npm: https://www.npmjs.com/package/@diffci.com/diffci
22
- - GitHub: https://github.com/DiffCI/DiffCI.com
23
-
24
- ## Commands
25
-
26
- CLI:
27
-
28
- ```bash
29
- npx @diffci.com/diffci@latest check
30
- ```
31
-
32
- MCP:
33
-
34
- ```bash
35
- npx -p @diffci.com/diffci@latest diffci-mcp
36
- ```
37
-
38
- ## Issue Template
39
-
40
- Title:
41
-
42
- ```text
43
- Add DiffCI as an optional AI-agent CI validation tool
44
- ```
45
-
46
- Body:
47
-
48
- ```md
49
- DiffCI now ships an npm CLI and stdio MCP server for AI coding agents:
50
-
51
- - CLI: `npx @diffci.com/diffci@latest check`
52
- - MCP: `npx -p @diffci.com/diffci@latest diffci-mcp`
53
-
54
- It is intended as an optional validation lens before agents mark work PR-ready. DiffCI analyzes the
55
- current checkout, explains affected tests, can run inferred local validation through `diffci check`,
56
- and does not skip, cancel, reorder, or modify required CI.
57
-
58
- Docs:
59
-
60
- - https://diffci.com/docs/ai-agents.html
61
- - https://github.com/DiffCI/DiffCI.com/blob/main/docs/mcp.md
62
-
63
- Would you be open to adding DiffCI as an optional validation command/example for AI coding agents?
64
- ```
65
-
66
- ## PR Snippet
67
-
68
- ~~~md
69
- ### Optional AI-agent validation
70
-
71
- Before marking changes PR-ready, agents can run:
72
-
73
- ```bash
74
- npx @diffci.com/diffci@latest check
75
- ```
76
-
77
- Agents with MCP support can configure:
78
-
79
- ```bash
80
- npx -p @diffci.com/diffci@latest diffci-mcp
81
- ```
82
-
83
- DiffCI is a validation lens: it explains affected tests and keeps required CI authoritative.
84
- ~~~
1
+ # DiffCI Adoption Outreach
2
+
3
+ Use this page as the canonical copy source for directory submissions, issues, and pull requests.
4
+
5
+ ## One-Line Description
6
+
7
+ DiffCI is an observation-only CI/CD validation tool and MCP server for AI coding agents.
8
+
9
+ ## Short Description
10
+
11
+ DiffCI gives coding agents a safe validation lens before they call work PR-ready. It analyzes the
12
+ current checkout, explains affected tests, can run inferred local validation through `diffci check`,
13
+ and leaves required CI authoritative.
14
+
15
+ ## Links
16
+
17
+ - Website: https://diffci.com/
18
+ - Agent docs: https://diffci.com/docs/ai-agents.html
19
+ - MCP docs: https://github.com/DiffCI/DiffCI.com/blob/main/docs/mcp.md
20
+ - LLM discovery: https://diffci.com/llms.txt
21
+ - npm: https://www.npmjs.com/package/@diffci.com/diffci
22
+ - GitHub: https://github.com/DiffCI/DiffCI.com
23
+
24
+ ## Commands
25
+
26
+ CLI:
27
+
28
+ ```bash
29
+ npx @diffci.com/diffci@latest check
30
+ ```
31
+
32
+ MCP:
33
+
34
+ ```bash
35
+ npx -p @diffci.com/diffci@latest diffci-mcp
36
+ ```
37
+
38
+ ## Issue Template
39
+
40
+ Title:
41
+
42
+ ```text
43
+ Add DiffCI as an optional AI-agent CI validation tool
44
+ ```
45
+
46
+ Body:
47
+
48
+ ```md
49
+ DiffCI now ships an npm CLI and stdio MCP server for AI coding agents:
50
+
51
+ - CLI: `npx @diffci.com/diffci@latest check`
52
+ - MCP: `npx -p @diffci.com/diffci@latest diffci-mcp`
53
+
54
+ It is intended as an optional validation lens before agents mark work PR-ready. DiffCI analyzes the
55
+ current checkout, explains affected tests, can run inferred local validation through `diffci check`,
56
+ and does not skip, cancel, reorder, or modify required CI.
57
+
58
+ Docs:
59
+
60
+ - https://diffci.com/docs/ai-agents.html
61
+ - https://github.com/DiffCI/DiffCI.com/blob/main/docs/mcp.md
62
+
63
+ Would you be open to adding DiffCI as an optional validation command/example for AI coding agents?
64
+ ```
65
+
66
+ ## PR Snippet
67
+
68
+ ~~~md
69
+ ### Optional AI-agent validation
70
+
71
+ Before marking changes PR-ready, agents can run:
72
+
73
+ ```bash
74
+ npx @diffci.com/diffci@latest check
75
+ ```
76
+
77
+ Agents with MCP support can configure:
78
+
79
+ ```bash
80
+ npx -p @diffci.com/diffci@latest diffci-mcp
81
+ ```
82
+
83
+ DiffCI is a validation lens: it explains affected tests and keeps required CI authoritative.
84
+ ~~~
@@ -1,96 +1,72 @@
1
- # DiffCI Agent Adoption Kit
1
+ # DiffCI adoption kit
2
2
 
3
- Use this when adding DiffCI to a repository or opening a small adoption PR.
3
+ Copy only the integration your repository needs. DiffCI does not replace required CI.
4
4
 
5
- ## One-Sentence Positioning
5
+ ## Agent instruction
6
6
 
7
- DiffCI gives AI coding agents a safe default CI/CD validation command.
7
+ Add this to `AGENTS.md` or the equivalent agent instruction file:
8
8
 
9
- ## Maintainer Install Snippet
9
+ > Before calling a change PR-ready, run `npx @diffci.com/diffci@latest check` from the repository
10
+ > root. Use its output to understand affected tests and fallback reasons. Keep the repository's
11
+ > required CI authoritative. If DiffCI reports `REFUSED` or `ERROR`, run the normal tests.
10
12
 
11
- ```md
12
- ## Add DiffCI for AI coding agents
13
+ `check` may execute the repository's full and selected test commands, which may write generated
14
+ files. For analysis without executing tests, run `npx @diffci.com/diffci@latest observe --no-send`.
13
15
 
14
- Run:
16
+ ## GitHub Action
15
17
 
16
- ```bash
17
- npx @diffci.com/diffci@latest init
18
- ```
19
-
20
- Then ask your coding agent to run:
18
+ Save this as `.github/workflows/diffci.yml` to observe changes in a separate, non-blocking job:
21
19
 
22
- ```bash
23
- npx @diffci.com/diffci@latest check
20
+ ```yaml
21
+ name: DiffCI observation
22
+ on: [push, pull_request]
23
+ permissions:
24
+ contents: read
25
+ jobs:
26
+ diffci:
27
+ runs-on: ubuntu-latest
28
+ continue-on-error: true
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 0
33
+ - uses: DiffCI/DiffCI.com@3aa76a84919691cf7e8f9d1f1f6a80399325d1ae # v0.2.2
24
34
  ```
25
35
 
26
- DiffCI check analyzes the change and runs inferred full and selected test commands to measure time.
27
- It writes reports outside the checkout and sends nothing. Test commands may write generated files.
28
- Use `observe --no-send` for analysis only.
29
- ```
30
-
31
- ## Agent Instruction Snippet
32
-
33
- ```md
34
- Before marking changes PR-ready, run:
35
-
36
- ```bash
37
- npx @diffci.com/diffci@latest check
38
- ```
39
-
40
- Use DiffCI output to understand which tests and CI paths are relevant. Do not treat a DiffCI selection
41
- as permission to skip required project CI.
42
- ```
36
+ Run `npx @diffci.com/diffci@latest verify-workflow` before starting a pilot. The Action uploads a
37
+ GitHub artifact by default; it sends nothing to DiffCI Cloud without an explicit endpoint and token.
43
38
 
44
- ## GitHub Search Queries
39
+ ## MCP client
45
40
 
46
- Find repositories already prepared for coding agents:
41
+ For a client that accepts stdio MCP JSON, set `cwd` to the repository checkout:
47
42
 
48
- ```text
49
- filename:AGENTS.md
50
- filename:CLAUDE.md
51
- path:.cursor/rules
52
- filename:copilot-instructions.md
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "diffci": {
47
+ "command": "npx",
48
+ "args": ["-p", "@diffci.com/diffci@latest", "diffci-mcp"],
49
+ "cwd": "/path/to/repository"
50
+ }
51
+ }
52
+ }
53
53
  ```
54
54
 
55
- Prioritize repositories that:
55
+ See [MCP setup](mcp.md) for Windows paths and the available tools.
56
56
 
57
- - use JavaScript, TypeScript, Vue, or Go in a normal GitHub Actions workflow;
58
- - already accept small docs/config PRs;
59
- - have active maintainers and recent CI runs;
60
- - already document agent behavior.
57
+ ## Small adoption PR
61
58
 
62
- Avoid repositories where:
59
+ Suggested title: **Add optional DiffCI validation for coding agents**
63
60
 
64
- - CI is security-sensitive and maintainers ask not to add tools;
65
- - there is no clear test command or GitHub Actions setup;
66
- - the project is inactive.
61
+ Suggested description:
67
62
 
68
- ## Small PR Template
69
-
70
- ```md
71
- Title: Add optional DiffCI instructions for AI coding agents
72
-
73
- This adds an optional instruction for coding agents to run DiffCI before marking changes PR-ready.
74
-
75
- DiffCI check runs a paired test comparison when commands can be inferred:
76
-
77
- - it analyzes the change and writes a local report;
78
- - it sends nothing without explicit configuration;
79
- - it runs full and selected test commands but does not skip required CI;
80
- - the repository's existing required CI remains authoritative.
81
-
82
- Default command:
83
-
84
- ```bash
85
- npx @diffci.com/diffci@latest check
86
- ```
87
-
88
- This PR does not make DiffCI a required check.
89
- ```
63
+ > This adds an optional DiffCI instruction or observation job. DiffCI analyzes the change and
64
+ > reports affected tests. Its `check` command compares full and selected test commands when it can
65
+ > infer them; the GitHub Action only observes. Required CI continues to run as before.
90
66
 
91
- ## Links
67
+ ## Where to point maintainers
92
68
 
93
- - Agent docs: https://diffci.com/docs/ai-agents.html
94
- - llms.txt: https://diffci.com/llms.txt
95
- - npm: https://www.npmjs.com/package/@diffci.com/diffci
96
- - GitHub release: https://github.com/DiffCI/DiffCI.com/releases/latest
69
+ - [npm package](https://www.npmjs.com/package/@diffci.com/diffci)
70
+ - [GitHub Marketplace Action](https://github.com/marketplace/actions/diffci-observer)
71
+ - [Agent guide](https://diffci.com/docs/ai-agents.html)
72
+ - [Context7 CLI documentation](https://context7.com/diffci/diffci.com)