@diffci.com/diffci 0.2.8 → 0.2.9

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/LICENSE CHANGED
@@ -668,4 +668,4 @@ specific requirements.
668
668
  if any, to sign a "copyright disclaimer" for the program, if necessary.
669
669
  For more information on this, and how to apply and follow the GNU AGPL, see
670
670
  <https://www.gnu.org/licenses/>.
671
-
671
+
package/README.md CHANGED
@@ -2,324 +2,324 @@
2
2
 
3
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
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
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
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
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
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
28
+
29
+ To add instructions for coding agents, run:
30
+
31
+ ```bash
32
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
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
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
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
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
-
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@5458e133a549b24f7224b1364811ef487fa4e153
110
+ ```
111
+
112
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
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.9` 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
140
  npx "@diffci.com/diffci@latest" init
141
- ```
142
-
143
- Then ask your coding agent to run:
144
-
145
- ```bash
141
+ ```
142
+
143
+ Then ask your coding agent to run:
144
+
145
+ ```bash
146
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:
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:
157
157
  [`llms.txt`](https://diffci.com/llms.txt) ·
158
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
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
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
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@5458e133a549b24f7224b1364811ef487fa4e153
312
+ ```
313
+
314
+ ```bash
315
315
  npx "@diffci.com/diffci@latest" observe
316
316
  npx "@diffci.com/diffci@latest" check
317
317
  npx "@diffci.com/diffci@latest" init
318
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.
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.