@diffci.com/diffci 0.2.8 → 0.2.10

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