@diffci.com/diffci 0.2.4 → 0.2.5

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