@diffci.com/diffci 0.2.7 → 0.2.8

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/README.md CHANGED
@@ -1,323 +1,325 @@
1
1
  # DiffCI
2
2
 
3
-
4
- [![npm version](https://img.shields.io/npm/v/@diffci.com/diffci.svg)](https://www.npmjs.com/package/@diffci.com/diffci)
5
- [![npm provenance](https://img.shields.io/badge/npm-provenance-blue)](https://docs.npmjs.com/generating-provenance-statements)
6
- [![MCP server](https://img.shields.io/badge/MCP-server-5f6fff)](docs/mcp.md)
7
- [![Agent safe](https://img.shields.io/badge/agent--safe-observation--only-0f766e)](docs/ai-agents.md)
8
- [![GitHub Marketplace](https://img.shields.io/badge/GitHub-Marketplace-blue)](https://github.com/marketplace/actions/diffci-observer)
9
-
10
- **Find test-selection opportunities in your CI before changing what it runs.** DiffCI analyzes a
11
- commit's changes and dependency graph, then reports which test files it would select, why it falls
12
- back to a full run, and whether it can propose a test command. `check` also runs paired full and
13
- selected commands when it can infer them. The `observe` command and Action remain observation-only.
14
-
15
- ## Try DiffCI
16
-
17
- From a Git repository checkout, with Node.js 22.5+ and Git installed, run:
18
-
19
- ```bash
20
- npx @diffci.com/diffci@latest check
21
- ```
22
-
23
- `check` explains affected tests and, when it can infer safe commands, runs both the full and selected
24
- test commands to measure the difference. It sends nothing to DiffCI. Test commands can create files
25
- in the checkout. For analysis without test execution, use `npx @diffci.com/diffci@latest observe --no-send`.
26
-
27
- To add instructions for coding agents, run:
28
-
29
- ```bash
30
- npx @diffci.com/diffci@latest init
31
- ```
32
-
33
- To also pin DiffCI as a development dependency and update the detected npm, pnpm, Yarn, or Bun
34
- lockfile, pass `--install`. Add `--workflow` for a separate non-blocking observation job:
35
-
36
- ```bash
37
- npx @diffci.com/diffci@latest init --install --workflow
38
- ```
39
-
40
- `--install` also adds `diffci:check` and `diffci:observe` package scripts. It preserves same-named
41
- scripts that the project already owns. After installation, CI or contributors can run
42
- `npm run diffci:check` or `npm run diffci:observe` without knowing the package name or version.
43
-
44
- On Windows PowerShell, quote the package name:
45
-
46
- ```powershell
47
- npx '@diffci.com/diffci@latest' check
48
- ```
49
-
50
- The [copyable adoption kit](docs/agent-adoption-kit.md) includes an `AGENTS.md` instruction and
51
- maintainer PR text. AI-readable documentation is on [Context7 CLI](https://context7.com/diffci/diffci.com)
52
- and [Context7 Core](https://context7.com/diffci/core). Use the [GitHub Marketplace Action](https://github.com/marketplace/actions/diffci-observer)
53
- for a separate, non-blocking observation job. Required project CI remains authoritative.
54
-
55
- One paired run is preliminary evidence; repeat comparisons and account for cache effects before
56
- claiming CI savings. On a full-validation fallback, `check` runs the full command once and reports
57
- 0% reduction.
58
-
59
- **Upgrade from 0.1.3:** tests excluded by a source-only `tsconfig.json` could be discovered without
60
- their dependency edges, producing an incomplete selection. This is fixed in **0.1.4**. Revalidate
61
- affected observations before using them as opportunity evidence; see the
62
- [historical validation](docs/evidence/growth-history-01/README.md) and
63
- [release qualification](docs/evidence/release-0.1.4/README.md).
64
-
65
- The local default compares `HEAD` with its first parent; both commits must be available. For a specific
66
- comparison, add `--base <base-sha> --head <head-sha>`. DiffCI prints the selection, fallback reasons,
67
- and the path to a JSON report outside your checkout. `REFUSED` or `ERROR` is not a successful analysis;
68
- check the reported status even when the command exits successfully. See the
69
- [support matrix](docs/language-support.md) for setup requirements and supported workloads.
70
- `check` runs inferred full and selected commands in the checkout and sends nothing by default.
71
- The commands may write generated files. Use `observe --no-send` for analysis without execution.
72
- See [`docs/ai-agents.md`](docs/ai-agents.md) for Claude Code, Codex,
73
- Cursor, GitHub Copilot, and similar tools.
74
-
75
- **Measured example:** a controlled Cal.com replay showed **44.2% net reduction in a job-equivalent
76
- install + pretest + test workload**, including analysis overhead. This is one sandbox comparison,
77
- not Cal.com's production savings or a prediction for your repository.
78
- [Read the timings and method](docs/research/2026-08-24-calcom-execution-observability/11-frozen-identity-and-complete-job-savings.md).
79
-
80
- Selection counts alone do not establish runtime savings. `check` reports a measured percentage only
81
- when both commands pass and the checked-out commit and worktree remain identical across both arms.
82
- The savings artifact embeds the base/head SHAs, observation SHA-256, commands, timings, and checkout
83
- snapshots; `observe` does not execute tests.
84
-
85
- For an advanced paired runtime check, you can still run `observe` first and then run `verify-savings`
86
- against the observation report. It compares your normal full command with
87
- DiffCI's proposed selected command and writes JSON plus Markdown evidence; see
88
- [`docs/npm-adoption.md`](docs/npm-adoption.md#self-serve-runtime-pilot).
89
-
90
- ## Observe in GitHub Actions
91
-
92
- Save this as `.github/workflows/diffci.yml` to add a dedicated, non-blocking observation job:
93
-
94
- ```yaml
95
- name: DiffCI observation
96
- on: [push, pull_request]
97
- permissions:
98
- contents: read
99
- jobs:
100
- diffci:
101
- runs-on: ubuntu-latest
102
- continue-on-error: true
103
- steps:
104
- - uses: actions/checkout@v4
105
- with:
106
- fetch-depth: 0
107
- - uses: DiffCI/DiffCI.com@e852523fade14bf5e0457a6331e97c8a76eedc2b
108
- ```
109
-
110
- Then check the workflow locally with `npx @diffci.com/diffci@latest verify-workflow`. Keep the observer
111
- out of required checks and other jobs' `needs` lists. The Action adds a job summary and a
112
- `diffci-observation` artifact to the run; it does not alter which tests your other jobs execute.
113
- The example pins release `v0.2.7` to its qualified feature commit SHA for reproducibility.
114
-
115
- The CLI sends no report with `--no-send`. The Action uploads a GitHub artifact by default; sending to
116
- DiffCI's hosted service requires an explicitly configured endpoint and token.
117
- [Installation details](docs/distribution.md) · [Seven-day pilot](docs/shadow-pilot-runbook.md)
118
-
119
- ## Use DiffCI
120
-
121
- | Surface | Use it for | Current distribution |
122
- | --- | --- | --- |
123
- | [`@diffci.com/diffci`](https://www.npmjs.com/package/@diffci.com/diffci) | Try `observe` locally, run an opt-in runtime pilot, or install the GitHub Action from this repository | Published npm CLI and Action |
124
-
125
- The CLI bundles a pinned revision of the [Core engine](https://github.com/DiffCI/core) from GitHub. Users install only
126
- `@diffci.com/diffci`; the `check` command above uses it directly. Core performs Git analysis,
127
- dependency graphs, impact, path baseline, and selected-command planning. The report format and
128
- non-interfering GitHub Action remain in this repository. See
129
- [`docs/package-relationship.md`](docs/package-relationship.md) for the source relationship.
130
- For evaluation results and their limits, start with
131
- [`docs/adoption-evidence.md`](docs/adoption-evidence.md).
132
-
133
- ## Agent Adoption
134
-
135
- Add DiffCI instructions to a repository:
136
-
137
- ```bash
138
- npx @diffci.com/diffci@latest init
139
- ```
140
-
141
- Then ask your coding agent to run:
142
-
143
- ```bash
144
- npx @diffci.com/diffci@latest check
145
- ```
146
-
147
- Agent-specific docs:
148
- [`Codex`](docs/codex.md) ·
149
- [`Claude Code`](docs/claude-code.md) ·
150
- [`Cursor`](docs/cursor.md) ·
151
- [`GitHub Copilot`](docs/copilot.md) ·
152
- [`Grok`](docs/grok.md).
153
-
154
- Live discovery files:
3
+ [Website](https://diffci.com/) · [Test impact analysis guide](https://diffci.com/test-impact-analysis/github-actions) · [Open evidence study](https://diffci.com/research/diffci-open-evidence-2026)
4
+
5
+
6
+ [![npm version](https://img.shields.io/npm/v/@diffci.com/diffci.svg)](https://www.npmjs.com/package/@diffci.com/diffci)
7
+ [![npm provenance](https://img.shields.io/badge/npm-provenance-blue)](https://docs.npmjs.com/generating-provenance-statements)
8
+ [![MCP server](https://img.shields.io/badge/MCP-server-5f6fff)](docs/mcp.md)
9
+ [![Agent safe](https://img.shields.io/badge/agent--safe-observation--only-0f766e)](docs/ai-agents.md)
10
+ [![GitHub Marketplace](https://img.shields.io/badge/GitHub-Marketplace-blue)](https://github.com/marketplace/actions/diffci-observer)
11
+
12
+ **Find test-selection opportunities in your CI before changing what it runs.** DiffCI analyzes a
13
+ commit's changes and dependency graph, then reports which test files it would select, why it falls
14
+ back to a full run, and whether it can propose a test command. `check` also runs paired full and
15
+ selected commands when it can infer them. The `observe` command and Action remain observation-only.
16
+
17
+ ## Try DiffCI
18
+
19
+ From a Git repository checkout, with Node.js 22.5+ and Git installed, run:
20
+
21
+ ```bash
22
+ npx "@diffci.com/diffci@latest" check
23
+ ```
24
+
25
+ `check` explains affected tests and, when it can infer safe commands, runs both the full and selected
26
+ test commands to measure the difference. It sends nothing to DiffCI. Test commands can create files
27
+ in the checkout. For analysis without test execution, use `npx "@diffci.com/diffci@latest" observe --no-send`.
28
+
29
+ To add instructions for coding agents, run:
30
+
31
+ ```bash
32
+ npx "@diffci.com/diffci@latest" init
33
+ ```
34
+
35
+ To also pin DiffCI as a development dependency and update the detected npm, pnpm, Yarn, or Bun
36
+ lockfile, pass `--install`. Add `--workflow` for a separate non-blocking observation job:
37
+
38
+ ```bash
39
+ npx "@diffci.com/diffci@latest" init --install --workflow
40
+ ```
41
+
42
+ `--install` also adds `diffci:check` and `diffci:observe` package scripts. It preserves same-named
43
+ scripts that the project already owns. After installation, CI or contributors can run
44
+ `npm run diffci:check` or `npm run diffci:observe` without knowing the package name or version.
45
+
46
+ On Windows PowerShell, quote the package name:
47
+
48
+ ```powershell
49
+ npx "@diffci.com/diffci@latest" check
50
+ ```
51
+
52
+ The [copyable adoption kit](docs/agent-adoption-kit.md) includes an `AGENTS.md` instruction and
53
+ maintainer PR text. AI-readable documentation is on [Context7 CLI](https://context7.com/diffci/diffci.com)
54
+ and [Context7 Core](https://context7.com/diffci/core). Use the [GitHub Marketplace Action](https://github.com/marketplace/actions/diffci-observer)
55
+ for a separate, non-blocking observation job. Required project CI remains authoritative.
56
+
57
+ One paired run is preliminary evidence; repeat comparisons and account for cache effects before
58
+ claiming CI savings. On a full-validation fallback, `check` runs the full command once and reports
59
+ 0% reduction.
60
+
61
+ **Upgrade from 0.1.3:** tests excluded by a source-only `tsconfig.json` could be discovered without
62
+ their dependency edges, producing an incomplete selection. This is fixed in **0.1.4**. Revalidate
63
+ affected observations before using them as opportunity evidence; see the
64
+ [historical validation](docs/evidence/growth-history-01/README.md) and
65
+ [release qualification](docs/evidence/release-0.1.4/README.md).
66
+
67
+ The local default compares `HEAD` with its first parent; both commits must be available. For a specific
68
+ comparison, add `--base <base-sha> --head <head-sha>`. DiffCI prints the selection, fallback reasons,
69
+ and the path to a JSON report outside your checkout. `REFUSED` or `ERROR` is not a successful analysis;
70
+ check the reported status even when the command exits successfully. See the
71
+ [support matrix](docs/language-support.md) for setup requirements and supported workloads.
72
+ `check` runs inferred full and selected commands in the checkout and sends nothing by default.
73
+ The commands may write generated files. Use `observe --no-send` for analysis without execution.
74
+ See [`docs/ai-agents.md`](docs/ai-agents.md) for Claude Code, Codex,
75
+ Cursor, GitHub Copilot, and similar tools.
76
+
77
+ **Measured example:** a controlled Cal.com replay showed **44.2% net reduction in a job-equivalent
78
+ install + pretest + test workload**, including analysis overhead. This is one sandbox comparison,
79
+ not Cal.com's production savings or a prediction for your repository.
80
+ [Read the timings and method](docs/research/2026-08-24-calcom-execution-observability/11-frozen-identity-and-complete-job-savings.md).
81
+
82
+ Selection counts alone do not establish runtime savings. `check` reports a measured percentage only
83
+ when both commands pass and the checked-out commit and worktree remain identical across both arms.
84
+ The savings artifact embeds the base/head SHAs, observation SHA-256, commands, timings, and checkout
85
+ snapshots; `observe` does not execute tests.
86
+
87
+ For an advanced paired runtime check, you can still run `observe` first and then run `verify-savings`
88
+ against the observation report. It compares your normal full command with
89
+ DiffCI's proposed selected command and writes JSON plus Markdown evidence; see
90
+ [`docs/npm-adoption.md`](docs/npm-adoption.md#self-serve-runtime-pilot).
91
+
92
+ ## Observe in GitHub Actions
93
+
94
+ Save this as `.github/workflows/diffci.yml` to add a dedicated, non-blocking observation job:
95
+
96
+ ```yaml
97
+ name: DiffCI observation
98
+ on: [push, pull_request]
99
+ permissions:
100
+ contents: read
101
+ jobs:
102
+ diffci:
103
+ runs-on: ubuntu-latest
104
+ continue-on-error: true
105
+ steps:
106
+ - uses: actions/checkout@v4
107
+ with:
108
+ fetch-depth: 0
109
+ - uses: DiffCI/DiffCI.com@e852523fade14bf5e0457a6331e97c8a76eedc2b
110
+ ```
111
+
112
+ Then check the workflow locally with `npx "@diffci.com/diffci@latest" verify-workflow`. Keep the observer
113
+ out of required checks and other jobs' `needs` lists. The Action adds a job summary and a
114
+ `diffci-observation` artifact to the run; it does not alter which tests your other jobs execute.
115
+ The example pins release `v0.2.7` to its qualified feature commit SHA for reproducibility.
116
+
117
+ The CLI sends no report with `--no-send`. The Action uploads a GitHub artifact by default; sending to
118
+ DiffCI's hosted service requires an explicitly configured endpoint and token.
119
+ [Installation details](docs/distribution.md) · [Seven-day pilot](docs/shadow-pilot-runbook.md)
120
+
121
+ ## Use DiffCI
122
+
123
+ | Surface | Use it for | Current distribution |
124
+ | --- | --- | --- |
125
+ | [`@diffci.com/diffci`](https://www.npmjs.com/package/@diffci.com/diffci) | Try `observe` locally, run an opt-in runtime pilot, or install the GitHub Action from this repository | Published npm CLI and Action |
126
+
127
+ The CLI bundles a pinned revision of the [Core engine](https://github.com/DiffCI/core) from GitHub. Users install only
128
+ `@diffci.com/diffci`; the `check` command above uses it directly. Core performs Git analysis,
129
+ dependency graphs, impact, path baseline, and selected-command planning. The report format and
130
+ non-interfering GitHub Action remain in this repository. See
131
+ [`docs/package-relationship.md`](docs/package-relationship.md) for the source relationship.
132
+ For evaluation results and their limits, start with
133
+ [`docs/adoption-evidence.md`](docs/adoption-evidence.md).
134
+
135
+ ## Agent Adoption
136
+
137
+ Add DiffCI instructions to a repository:
138
+
139
+ ```bash
140
+ npx "@diffci.com/diffci@latest" init
141
+ ```
142
+
143
+ Then ask your coding agent to run:
144
+
145
+ ```bash
146
+ npx "@diffci.com/diffci@latest" check
147
+ ```
148
+
149
+ Agent-specific docs:
150
+ [`Codex`](docs/codex.md) ·
151
+ [`Claude Code`](docs/claude-code.md) ·
152
+ [`Cursor`](docs/cursor.md) ·
153
+ [`GitHub Copilot`](docs/copilot.md) ·
154
+ [`Grok`](docs/grok.md).
155
+
156
+ Live discovery files:
155
157
  [`llms.txt`](https://diffci.com/llms.txt) ·
156
- [`AI agents`](https://diffci.com/docs/ai-agents.html).
157
-
158
- Adoption materials:
159
- [`outreach copy`](docs/adoption-outreach.md) ·
160
- [`metrics`](docs/adoption-metrics.md) ·
161
- [`targets`](docs/agent-adoption-targets.md).
162
-
163
- For native agent integrations, DiffCI also ships a stdio MCP server:
164
-
165
- ```bash
166
- npx -p @diffci.com/diffci@latest diffci-mcp
167
- ```
168
-
169
- See [`docs/mcp.md`](docs/mcp.md) for Claude, Cursor, Codex, and generic MCP config snippets.
170
-
171
- ## Project background
172
-
173
- ## Public Core and private Cloud
174
-
175
- DiffCI's public-good analysis engine is released separately from its commercial hosted product.
176
- The project lives in the [DiffCI GitHub organization](https://github.com/DiffCI).
177
- This repository was transferred to `DiffCI/DiffCI.com` on 2026-09-16.
178
-
179
- | Component | Scope | Licensing |
180
- | --- | --- | --- |
181
- | [DiffCI Core](https://github.com/DiffCI/core) | Standalone dependency/change analysis, CI graph inference, safety/fallback, advisory test selection, synthetic benchmarking and local compute measurement | AGPL-3.0-only; public |
182
- | DiffCI Cloud | Hosted infrastructure, billing, enterprise dashboard, organization management, proprietary data/services, and managed acceleration | Proprietary |
183
- | Optional enterprise code | Separately scoped, visible and auditable enterprise capabilities | Source available, with commercial production rights controlled by DiffCI |
184
-
185
- **This mixed repository is public.** The reviewed Core extraction was published separately, with
186
- fresh Git history. This repository retains its existing engine snapshot while package integration is
187
- migrated separately. No blanket AGPL license applies to this repository. Public Core is advisory-only;
188
- energy/carbon/cost are modeled estimates, not verified environmental savings. The exact extraction is
189
- recorded in [the Core release audit](docs/core-release-audit.md).
190
-
191
- The funded Core should run independently of DiffCI Cloud. AGPL permits commercial use and competing
192
- hosting; it adds source-sharing obligations for covered modifications, including qualifying remote
193
- network use. Grant eligibility depends on each grant's agreement and funded deliverables.
194
-
195
- See the [licensing boundaries](docs/licensing.md), [organization and migration plan](docs/github-organization.md),
196
- and [prepared organization profile](docs/github-org/profile/README.md).
197
-
198
-
199
-
200
- **This repository moved out of the [DentalPresence.in](https://github.com/adityankale190895/DentalPresence.in)
201
- monorepo** (previously `diffci/` there) into its own repo on 2026-08-21, once the project outgrew being a
202
- subfolder. DentalPresence.in remains DiffCI's original dogfooding target - some code (the `planner`
203
- DentalPresence-specific PATH baseline/task registry, a few fixture tests) still reflects that origin - but
204
- the research and shadow-validation pipelines are generic and have been exercised against dozens of
205
- real third-party repositories.
206
-
207
- ## Current state
208
-
209
- Language expansion: initial Vue SFC, Go package-level, and conventional Maven reactor analysis is implemented through repository
210
- adapters. See [the support matrix and setup requirements](docs/language-support.md) for exact scope,
211
- fallback behavior, and validation boundaries.
212
-
213
- Three completed research stages plus an in-progress prospective-validation stage, in order:
214
-
215
- - **Stage 0** - a 2,000-delta historical benchmark across 20 real repositories, run through a real
216
- Cloudflare orchestrator. Verdict: **GO WITH CONDITIONS**.
217
- - **Stage 1A** - forensic root-cause investigation of every repository/delta where Stage 0's confidence
218
- model degraded to UNSAFE, and of every historical "unsafe miss" candidate. Identified the top 3
219
- highest-leverage fixes.
220
- - **Stage 1B** - implemented those 3 fixes (reachability-aware confidence narrowing, an improved
221
- historical safety-measurement methodology, a tsconfig-scope + package.json-diffing fix), validated them
222
- live against real repositories (coverage improved, zero contradicted safety cases), and ran a real
223
- wall-clock FULL/PATH/DiffCI runtime pilot.
224
- - **Stage 2** (current) - prospective shadow validation on real, currently-arriving CI events, not more
225
- historical benchmarking. A live pipeline (Cloudflare Sandbox Containers + Worker, D1 + R2) observes real
226
- repositories, predicts *before* their outcome is known, and later reconciles against the real CI result.
227
- Current verdict: **EXTEND SHADOW VALIDATION** - the pipeline is real and defect-free, and since
228
- 2026-08-21 it runs **autonomously**: a Cron Trigger polls enrolled repositories every 10 minutes
229
- (`src/research/cloudflare/shadow-cron.ts`), and the registered **DiffCI Shadow GitHub App**
230
- (read-only; see [`docs/github-app-registration.md`](docs/github-app-registration.md)) delivers
231
- push/workflow events to `/v1/shadow/webhook` for instant predictions and exactly-on-time
232
- reconciliation - this repository shadow-observes itself through that App. See
233
- [`docs/research/2026-08-21-stage2-final-report.md`](docs/research/2026-08-21-stage2-final-report.md)
234
- for the full picture; what's honestly still missing is real observation volume, working GitHub
235
- Actions on our own repositories (account billing), and real design-partner repositories.
236
-
237
- Every dated report behind these stages lives in [`docs/research/`](docs/research/) - start with
238
- `2026-08-21-stage2-architecture.md` for the fullest current picture of what's built vs not, or the
239
- Stage 0/1A/1B reports for the historical-validation story.
240
-
241
- For the next product milestone, see [`docs/alpha-readiness.md`](docs/alpha-readiness.md). It tracks the
242
- private-alpha bar: install DiffCI, keep CI unchanged, collect real shadow observations, and render a
243
- trustworthy potential-savings report.
244
-
245
- ## Architecture
246
-
247
- DiffCI is now framed as an open-core product:
248
-
249
- ```text
250
- DiffCI
251
- |
252
- ├── Open-source core
253
- | ├── DiffCI engine
254
- | ├── CLI / npm package
255
- | ├── Local analysis
256
- | └── Basic GitHub Action
257
- | |
258
- | └── Tidelift package support
259
- |
260
- └── Commercial DiffCI
261
- ├── Hosted service / DiffCI Cloud
262
- ├── Organization dashboard
263
- ├── Historical analytics
264
- ├── Advanced CI/CD optimization
265
- ├── Enterprise policies
266
- ├── Managed runners
267
- ├── Team features
268
- └── Support / enterprise services
269
- ```
270
-
271
- The open-source core is the trust and adoption surface. It runs locally or in the host repository's own
272
- CI, writes a report, and changes nothing about CI execution. Commercial DiffCI adds hosted history,
273
- organization views, policy, managed operations, runners, and support. Tidelift belongs to the supported
274
- open-source package path, not the hosted product feature boundary. See
275
- [`docs/open-core-packaging.md`](docs/open-core-packaging.md) and
276
- [`docs/tidelift-package-support.md`](docs/tidelift-package-support.md).
277
-
278
- The source tree follows that split:
279
-
280
- - `src/git/`, `src/repo/`, `src/planner/`, and `src/client/` are the installable OSS observer path.
281
- - `action.yml` wraps the observer as a basic non-blocking GitHub Action.
282
- - `src/research/` and `src/shadow/` run validation, GitHub App shadow observation, and reconciliation.
283
- - `src/product/`, `src/auth/`, `src/billing/`, `src/ingest/`, `src/ledger/`, `src/runner/`, and
284
- `src/usage/` are the commercial/control-plane layer.
285
- - `docs/oss-boundary.md` records what is allowed into the npm package.
286
-
287
- ## Commands
288
-
289
- ```bash
290
- # Type-check and run the full test suite
291
- npm run check
292
-
293
- # Generate an example delta / impact / plan for the current repo's latest commit
294
- npm run diffci
295
- npm run impact
296
-
297
- # Run a real Stage 0-style historical benchmark locally
298
- npm run research:stage0
299
-
300
- # Deploy the Cloudflare research/shadow Worker (D1 + R2 + Sandbox Containers)
301
- npm run research:sandbox:deploy
302
- ```
303
-
304
- ## Install Surfaces
305
-
306
- DiffCI is intended to be installable as infrastructure, not only as a hosted shadow experiment:
307
-
308
- ```yaml
309
- - uses: DiffCI/DiffCI.com@e852523fade14bf5e0457a6331e97c8a76eedc2b
310
- ```
311
-
312
- ```bash
313
- npx @diffci.com/diffci@latest observe
314
- npx @diffci.com/diffci@latest check
315
- npx @diffci.com/diffci@latest init
316
- npx @diffci.com/diffci@latest verify-workflow
317
- ```
318
-
319
- The GitHub Action and npm CLI establish the OSS/package distribution path. The hosted GitHub App and
320
- DiffCI Cloud build on that trust boundary for teams that want shared reports and history. See
321
- [`docs/distribution.md`](docs/distribution.md) for the package and Action positioning,
322
- [`docs/open-core-packaging.md`](docs/open-core-packaging.md) for the commercial split, and
323
- [`docs/npm-adoption.md`](docs/npm-adoption.md) for copy-paste pilot material.
158
+ [`AI agents`](https://diffci.com/docs/ai-agents).
159
+
160
+ Adoption materials:
161
+ [`outreach copy`](docs/adoption-outreach.md) ·
162
+ [`metrics`](docs/adoption-metrics.md) ·
163
+ [`targets`](docs/agent-adoption-targets.md).
164
+
165
+ For native agent integrations, DiffCI also ships a stdio MCP server:
166
+
167
+ ```bash
168
+ npx -p "@diffci.com/diffci@latest" diffci-mcp
169
+ ```
170
+
171
+ See [`docs/mcp.md`](docs/mcp.md) for Claude, Cursor, Codex, and generic MCP config snippets.
172
+
173
+ ## Project background
174
+
175
+ ## Public Core and private Cloud
176
+
177
+ DiffCI's public-good analysis engine is released separately from its commercial hosted product.
178
+ The project lives in the [DiffCI GitHub organization](https://github.com/DiffCI).
179
+ This repository was transferred to `DiffCI/DiffCI.com` on 2026-09-16.
180
+
181
+ | Component | Scope | Licensing |
182
+ | --- | --- | --- |
183
+ | [DiffCI Core](https://github.com/DiffCI/core) | Standalone dependency/change analysis, CI graph inference, safety/fallback, advisory test selection, synthetic benchmarking and local compute measurement | AGPL-3.0-only; public |
184
+ | DiffCI Cloud | Hosted infrastructure, billing, enterprise dashboard, organization management, proprietary data/services, and managed acceleration | Proprietary |
185
+ | Optional enterprise code | Separately scoped, visible and auditable enterprise capabilities | Source available, with commercial production rights controlled by DiffCI |
186
+
187
+ **This mixed repository is public.** The reviewed Core extraction was published separately, with
188
+ fresh Git history. This repository retains its existing engine snapshot while package integration is
189
+ migrated separately. No blanket AGPL license applies to this repository. Public Core is advisory-only;
190
+ energy/carbon/cost are modeled estimates, not verified environmental savings. The exact extraction is
191
+ recorded in [the Core release audit](docs/core-release-audit.md).
192
+
193
+ The funded Core should run independently of DiffCI Cloud. AGPL permits commercial use and competing
194
+ hosting; it adds source-sharing obligations for covered modifications, including qualifying remote
195
+ network use. Grant eligibility depends on each grant's agreement and funded deliverables.
196
+
197
+ See the [licensing boundaries](docs/licensing.md), [organization and migration plan](docs/github-organization.md),
198
+ and [prepared organization profile](docs/github-org/profile/README.md).
199
+
200
+
201
+
202
+ **This repository moved out of the [DentalPresence.in](https://github.com/adityankale190895/DentalPresence.in)
203
+ monorepo** (previously `diffci/` there) into its own repo on 2026-08-21, once the project outgrew being a
204
+ subfolder. DentalPresence.in remains DiffCI's original dogfooding target - some code (the `planner`
205
+ DentalPresence-specific PATH baseline/task registry, a few fixture tests) still reflects that origin - but
206
+ the research and shadow-validation pipelines are generic and have been exercised against dozens of
207
+ real third-party repositories.
208
+
209
+ ## Current state
210
+
211
+ Language expansion: initial Vue SFC, Go package-level, and conventional Maven reactor analysis is implemented through repository
212
+ adapters. See [the support matrix and setup requirements](docs/language-support.md) for exact scope,
213
+ fallback behavior, and validation boundaries.
214
+
215
+ Three completed research stages plus an in-progress prospective-validation stage, in order:
216
+
217
+ - **Stage 0** - a 2,000-delta historical benchmark across 20 real repositories, run through a real
218
+ Cloudflare orchestrator. Verdict: **GO WITH CONDITIONS**.
219
+ - **Stage 1A** - forensic root-cause investigation of every repository/delta where Stage 0's confidence
220
+ model degraded to UNSAFE, and of every historical "unsafe miss" candidate. Identified the top 3
221
+ highest-leverage fixes.
222
+ - **Stage 1B** - implemented those 3 fixes (reachability-aware confidence narrowing, an improved
223
+ historical safety-measurement methodology, a tsconfig-scope + package.json-diffing fix), validated them
224
+ live against real repositories (coverage improved, zero contradicted safety cases), and ran a real
225
+ wall-clock FULL/PATH/DiffCI runtime pilot.
226
+ - **Stage 2** (current) - prospective shadow validation on real, currently-arriving CI events, not more
227
+ historical benchmarking. A live pipeline (Cloudflare Sandbox Containers + Worker, D1 + R2) observes real
228
+ repositories, predicts *before* their outcome is known, and later reconciles against the real CI result.
229
+ Current verdict: **EXTEND SHADOW VALIDATION** - the pipeline is real and defect-free, and since
230
+ 2026-08-21 it runs **autonomously**: a Cron Trigger polls enrolled repositories every 10 minutes
231
+ (`src/research/cloudflare/shadow-cron.ts`), and the registered **DiffCI Shadow GitHub App**
232
+ (read-only; see [`docs/github-app-registration.md`](docs/github-app-registration.md)) delivers
233
+ push/workflow events to `/v1/shadow/webhook` for instant predictions and exactly-on-time
234
+ reconciliation - this repository shadow-observes itself through that App. See
235
+ [`docs/research/2026-08-21-stage2-final-report.md`](docs/research/2026-08-21-stage2-final-report.md)
236
+ for the full picture; what's honestly still missing is real observation volume, working GitHub
237
+ Actions on our own repositories (account billing), and real design-partner repositories.
238
+
239
+ Every dated report behind these stages lives in [`docs/research/`](docs/research/) - start with
240
+ `2026-08-21-stage2-architecture.md` for the fullest current picture of what's built vs not, or the
241
+ Stage 0/1A/1B reports for the historical-validation story.
242
+
243
+ For the next product milestone, see [`docs/alpha-readiness.md`](docs/alpha-readiness.md). It tracks the
244
+ private-alpha bar: install DiffCI, keep CI unchanged, collect real shadow observations, and render a
245
+ trustworthy potential-savings report.
246
+
247
+ ## Architecture
248
+
249
+ DiffCI is now framed as an open-core product:
250
+
251
+ ```text
252
+ DiffCI
253
+ |
254
+ ├── Open-source core
255
+ | ├── DiffCI engine
256
+ | ├── CLI / npm package
257
+ | ├── Local analysis
258
+ | └── Basic GitHub Action
259
+ | |
260
+ | └── Tidelift package support
261
+ |
262
+ └── Commercial DiffCI
263
+ ├── Hosted service / DiffCI Cloud
264
+ ├── Organization dashboard
265
+ ├── Historical analytics
266
+ ├── Advanced CI/CD optimization
267
+ ├── Enterprise policies
268
+ ├── Managed runners
269
+ ├── Team features
270
+ └── Support / enterprise services
271
+ ```
272
+
273
+ The open-source core is the trust and adoption surface. It runs locally or in the host repository's own
274
+ CI, writes a report, and changes nothing about CI execution. Commercial DiffCI adds hosted history,
275
+ organization views, policy, managed operations, runners, and support. Tidelift belongs to the supported
276
+ open-source package path, not the hosted product feature boundary. See
277
+ [`docs/open-core-packaging.md`](docs/open-core-packaging.md) and
278
+ [`docs/tidelift-package-support.md`](docs/tidelift-package-support.md).
279
+
280
+ The source tree follows that split:
281
+
282
+ - `src/git/`, `src/repo/`, `src/planner/`, and `src/client/` are the installable OSS observer path.
283
+ - `action.yml` wraps the observer as a basic non-blocking GitHub Action.
284
+ - `src/research/` and `src/shadow/` run validation, GitHub App shadow observation, and reconciliation.
285
+ - `src/product/`, `src/auth/`, `src/billing/`, `src/ingest/`, `src/ledger/`, `src/runner/`, and
286
+ `src/usage/` are the commercial/control-plane layer.
287
+ - `docs/oss-boundary.md` records what is allowed into the npm package.
288
+
289
+ ## Commands
290
+
291
+ ```bash
292
+ # Type-check and run the full test suite
293
+ npm run check
294
+
295
+ # Generate an example delta / impact / plan for the current repo's latest commit
296
+ npm run diffci
297
+ npm run impact
298
+
299
+ # Run a real Stage 0-style historical benchmark locally
300
+ npm run research:stage0
301
+
302
+ # Deploy the Cloudflare research/shadow Worker (D1 + R2 + Sandbox Containers)
303
+ npm run research:sandbox:deploy
304
+ ```
305
+
306
+ ## Install Surfaces
307
+
308
+ DiffCI is intended to be installable as infrastructure, not only as a hosted shadow experiment:
309
+
310
+ ```yaml
311
+ - uses: DiffCI/DiffCI.com@e852523fade14bf5e0457a6331e97c8a76eedc2b
312
+ ```
313
+
314
+ ```bash
315
+ npx "@diffci.com/diffci@latest" observe
316
+ npx "@diffci.com/diffci@latest" check
317
+ npx "@diffci.com/diffci@latest" init
318
+ npx "@diffci.com/diffci@latest" verify-workflow
319
+ ```
320
+
321
+ The GitHub Action and npm CLI establish the OSS/package distribution path. The hosted GitHub App and
322
+ DiffCI Cloud build on that trust boundary for teams that want shared reports and history. See
323
+ [`docs/distribution.md`](docs/distribution.md) for the package and Action positioning,
324
+ [`docs/open-core-packaging.md`](docs/open-core-packaging.md) for the commercial split, and
325
+ [`docs/npm-adoption.md`](docs/npm-adoption.md) for copy-paste pilot material.