DiffCI

io.github.DiffCI由 GitHub 账号 DiffCI 发布v0.3.35更新于 Nov 7, 2026

Fail-closed, change-aware verification for AI coding agents with affected-test guidance.

已验证Streamable HTTP可网页运行开发者工具安全与监控

概览

AI 生成的概览

DiffCI 为编码助手提供只读指导:变更影响哪些测试,以及 GitHub Actions 工作流是否安全可加。

可以做什么
  • 规划变更感知的 CI 验证与受影响测试选择,返回安全的本地 DiffCI 命令而不访问检出目录
  • 校验并汇总 DiffCI 观测报告,包括选择性或全量模式、受影响测试数量、回退原因与保守的下一步操作
  • 对 GitHub Actions YAML 做静态安全检查,涵盖观察作业隔离、continue-on-error、只读权限与不可变的 DiffCI 引用
适用场景
当助手需要在推送前判断应运行哪些测试,或在把 DiffCI CI 作业加入工作流前做初步安全检查时使用。公共端点仅提供指导;要检查或执行真实检出目录需使用本地服务器。
运行要求
远程 streamable HTTP 端点,或在本地通过 stdio 运行 npm 包。本地服务器需要 Node.js 22.5 或更高版本,以及它所指向的 Git 检出目录。未声明需要账号、API 密钥或环境变量。
安装前请注意
公共端点只读,不访问检出目录;只有本地 stdio 服务器才能检查或对检出目录执行操作。计划仅供参考,不能视为跳过 CI 检查的许可,静态分析也不能证明某个测试可以省略。应保持完整 CI 为权威。

安装

在 SourceWeft 中

  1. 打开 控制台中的 DiffCI,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.DiffCI%2Fdiffci/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "diffci": {
      "type": "http",
      "url": "https://diffci.com/mcp/v1"
    }
  }
}

README

DiffCI Core

[npm] [GitHub Marketplace] [License: MIT] [OpenSSF Scorecard]

Affected checks before push, for AI coding agents. DiffCI tells Claude Code, Codex, Cursor (or you) which tests and checks a change affects, so they run before the push instead of failing at the full CI gate afterwards. MIT licensed, runs locally, sends nothing by default, and falls back to the full suite whenever the evidence is incomplete.

sh
npx "@diffci.com/diffci@latest" check

Run it in any Git checkout with Node.js 22.5+. What the output means.

On every pull request, add one job beside your existing CI. Its job summary shows which tests the change affects and why, or that the full suite is needed and why. It runs no tests and skips or changes nothing:

yaml
- uses: actions/checkout@v7  with:    fetch-depth: 0 # DiffCI needs the base commit- uses: DiffCI/[email protected]

Add with: comment: "true" (and pull-requests: write on the job) and the same answer appears on the pull request itself, updated in place on each push:

[DiffCI pull request comment: 18 of 624 test files are affected by 1 changed file, with a table of each test and why it was selected]

Full workflow · GitLab CI/CD component

[DiffCI demo video]

▶ Watch the demo on YouTube

Why

Coding agents pass the narrow check they picked and miss wider breakage, then rerun the whole suite when they are unsure. We measured this on our own agent-built production app (about 1,100 commits in two months, most of them co-authored by Claude):

  • 104 pushes failed the full gates after push. Each passed whatever the agent ran locally.
  • Agents chose their own test files 928 times and ran the full suite 282 times, but asked a tool which tests were affected only 24 times.
  • When DiffCI could narrow the run, it selected 2.2% of test files, cutting test time by 93%. None of those commits had a failing test, so this shows speed, not regression catching.
  • DiffCI still fell back to the full suite on 58% of commits, mostly because a config file or package.json changed. Narrowing those safely is the main open problem, and a good place to contribute.

MCP server

This repository contains DiffCI's MCP server. It is implemented in packages/diffci-cli/src/client/mcp.ts and published as the diffci-mcp binary of @diffci.com/diffci: a local stdio server speaking JSON-RPC 2.0 (initialize, tools/list, tools/call) that runs against the checkout it is pointed at. It needs no account and sends nothing by default.

sh
npx -y -p @diffci.com/diffci@latest diffci-mcp
json
{  "mcpServers": {    "diffci": { "command": "npx", "args": ["-y", "-p", "@diffci.com/diffci@latest", "diffci-mcp"] }  }}
ToolWhat it does
diffci_changed_filesLists staged, unstaged and untracked changes; runs no tests
diffci_select_testsReturns the affected-test plan for the current changes, with fallback reasons; runs no tests
diffci_explain_selectionThe same plan, for explaining why each test is in it
diffci_run_affected_testsVerifies the current snapshot with the affected tests, or the full suite as a fallback
diffci_verify_changedVerifies the exact working-tree snapshot; fails closed
diffci_verifyVerifies a clean commit range and returns a receipt bound to HEAD
diffci_checkCompares full and selected test runs and reports paired runtime
diffci_initSeeds agent instructions, MCP configs, the verify skill and a pre-push hook
diffci_verify_workflowChecks that a DiffCI GitHub Actions job cannot affect the rest of CI

Use it from your coding agent

The public integrations/agent-plugin package packages the MCP server above as a checkout-aware local plugin for agent marketplaces: marketplace metadata, skills, and a launcher pinned to the published diffci-mcp binary. It does not include product services or private source. The cross-agent installation guide covers Codex, Claude Code, Cursor, Grok, Meta Muse Code, and generic MCP hosts.

sh
# Codexcodex plugin marketplace add DiffCI/corecodex plugin add diffci@diffci-local
# Claude Codeclaude plugin marketplace add DiffCI/coreclaude plugin install diffci@diffci-marketplace

Cursor Marketplace reads .cursor-plugin/marketplace.json from this repository. Meta Muse Code reads the native root marketplace.json. Before a public listing is approved, use the local MCP configuration in the agent-plugin package or visit https://diffci.com/mcp-server.

Installing the plugin does not make an agent use it. Paste the short agent-instructions snippet into CLAUDE.md or AGENTS.md so it runs DiffCI before pushing.

GitHub Action

The public action.yml ("DiffCI change impact") shows, in the job summary of every pull request, which tests the change affects and why, or that the full suite is needed and why. It is observation only: it runs the pinned published DiffCI CLI outside the observed checkout, retains existing CI jobs, skips nothing, and uploads the report as an artifact. See the observer Action guide and workflow example.

Set comment: "true" (with pull-requests: write) to also keep one comment on the pull request up to date with the answer, where reviewers see it. Outputs such as full-suite-required and affected-tests let a workflow act on the answer; see outputs.

The v0.3.10 corresponding source remains publicly available at tagged Core commit 4c76be14 (cli-v0.3.10-source) while distribution migrates to the Core-native CLI package.

diffci check compares full and selected runtime when safe to measure, writes reports outside the checkout, and sends nothing by default. Test commands can generate files; keep required CI authoritative.

Measured example: one controlled Cal.com sandbox replay measured 44.2% net reduction in install + pretest + test runtime including analysis overhead. This is a job-equivalent comparison, not production savings or a forecast for your repository. Method and limitations.

[Recorded Cal.com sandbox comparison]

Star Core · Volunteer a pilot repository · Find a first contribution. Watch → Custom → Releases and Discussions for benchmark results and support updates. Public roadmap.

This is the standalone Core engine. It analyzes local JavaScript/TypeScript repositories, supported Vue components, root Go modules, conventional Maven reactors and Python projects tested with pytest, traces dependency impact, infers GitHub Actions structure and proposes test selections with evidence and full-run fallbacks. It works without a DiffCI account, hosted service or API key. See the release boundary for support limits.

Want to try DiffCI in an existing repository? Use the published CLI: npx @diffci.com/diffci@latest check. See the CLI quickstart for a no-execution analysis option, prerequisites, and result interpretation. The commands below build the standalone engine from source.

Run locally

Requires Git and Node.js 22.5 or later.

sh
git clone https://github.com/DiffCI/core.gitcd corenpm cinpm run buildnpm testnode dist/cli.js plan --repo /path/to/clean-checkout --base HEAD~1 --head HEAD

The target must be a clean Git repository root checked out at --head. Fetch the base commit beforehand if using a shallow clone. JSON goes to stdout; analysis errors exit nonzero and recommend full CI. Core does not execute repository scripts, contact a DiffCI backend or send telemetry. Installation requires the npm registry.

To evaluate the same command on pull requests without changing required jobs, copy the advisory GitHub Actions example.

Plans are advisory. This release does not execute, skip or cancel CI jobs. SKIP_CANDIDATE is a candidate, not permission to bypass a check. Keep full CI authoritative while evaluating Core. Missing command synthesis, unsupported configuration and incomplete evidence must not be treated as an empty test suite. Static analysis is not proof that a test can safely be omitted.

For Maven jobs whose CI runs a lifecycle goal or profiles other than test, declare them in diffci.json (or the diffci key in package.json):

json
{ "maven": { "goal": "verify", "profiles": ["run-its"] } }

This changes the proposed command, such as mvn -pl tools -am verify -P run-its; Core still does not run it. Confirm the command against the repository's CI workflow before using it for execution.

What is included

Declared pnpm workspaces with a single Vitest test phase can receive package-local command plans. Each selected path must belong to a discovered test in a declared package. Runtime selections are batched to keep commands below Windows limits; packages declaring --typecheck retain a separate full type-test phase. Packages with compound scripts, lifecycle hooks, overlapping ownership or discovery blind spots refuse selective execution. Commands remain advisory and must be executed separately; CLI automatic timing of multiple commands requires additional integration.

AreaImplementation
Changes and dependenciesGit deltas, repository inventory, JS/TS dependency graph, impact traversal
Safety and planningRisk signals, conservative fallback, always-run policy, test selection and command synthesis
CI analysisGitHub Actions evidence, job/reference graphs, conditions and matrix inference
Reproducible evaluationSynthetic benchmark and portable regression tests
MeasurementCurrent-process wall time, CPU time and ending RSS; explicit-input cost/energy/carbon estimates

The library entry point exports analyzeCheckout, buildDependencyGraph, ImpactAnalyzer, DefaultCIPlanner, collectEvidence, inferPipeline, measure and estimateImpact. Lower-level modules are available as package subpaths. This repository is the engine source, and the published @diffci.com/diffci CLI is released from it. The corresponding source for the previously published v0.3.10 package is retained in the source archive at tagged commit 4c76be14.

sh
npm run typechecknpm run audit:boundarynpm run benchmark

The benchmark constructs one temporary synthetic repository containing 100 chained modules and 100 importing test files. In one Node.js process it builds that same dependency graph three times, sequentially, and removes the fixture afterward. Install dependencies first with npm ci, then run npm run benchmark under Node.js 22.5 or later. Record the emitted node and platform alongside the machine CPU, memory, operating system, and competing workload when comparing runs. The three builds share process, operating-system, and compiler warmup effects; they are not independent repetitions with controlled cold caches.

Each entry in runs has these fields:

FieldInterpretation
basis: "measured"The process counters were observed rather than estimated.
scope: "current-process"Only the benchmark's Node.js process is covered, not the whole host, container, or CI job.
wallSecondsElapsed wall-clock time around one buildDependencyGraph call.
cpuSecondsUser plus system CPU time consumed by the current process during that call; it can differ from wall time.
rssBytesAtEndResident-set size sampled after the call. It is neither peak memory nor the memory allocated by that call alone.
nodes, edgesGraph size. The current fixture should produce 200 nodes and 199 dependency edges.
confidenceDependency-graph confidence for this synthetic fixture. COMPLETE does not prove that a real repository can safely skip tests.

For example, wallSeconds: 0.79, cpuSeconds: 0.84, and rssBytesAtEnd: 327868416 mean that one graph build elapsed for about 0.79 seconds, consumed about 0.84 current-process CPU seconds, and ended with roughly 328 MB RSS. They do not mean that CI became 0.79 seconds faster or saved 328 MB. The script does not execute tests, installation, builds, or a full-versus-selected comparison, so its timings must not be reported as CI savings.

The separate estimateImpact API can calculate estimatedUsd, estimatedKwh, and estimatedKgCo2e only from caller-supplied computeSeconds, price, power, and grid-intensity assumptions. Those values have basis: "estimated"; they are modeled scenarios, not benchmark output, physical measurements, billing records, or verified avoided emissions.

Sponsors

DiffCI Core is supported by its GitHub Sponsors. Sponsorship funds maintenance, broader language and CI support, and reproducible benchmarks.

Partners

No Partner sponsors yet. Become the first.

Team Sponsors

No Team Sponsors yet. Team Sponsor logos also appear on diffci.com/sponsors.

Backers

No Backers yet. Backers at $25/month or above are listed here.

Sponsors' bug reports are labelled sponsor and triaged first.

Core and Cloud

ComponentAvailabilityLicense
This Core repositoryPublic sourceMIT
DiffCI Cloud: hosting, billing, organization management, dashboard, managed servicesPrivate sourceProprietary; not included here
Optional enterprise modulesNot released hereA separate source-available license would apply if offered

Only the explicitly extracted Core files and standalone tooling are in this repository. There is no private monorepo history, customer data, deployment configuration or Cloud implementation here. Core is usable independently; it is not a promise that the private product has already migrated to consume this package.

DiffCI Cloud's team features are free for public open-source repositories: an organization whose connected repositories are all public on GitHub gets them at no cost.

What stays in Core, and never moves to Cloud, is set out in STEWARDSHIP.md. The plan DiffCI writes for each change is an open format other tools can produce or consume: the change plan. Report vulnerabilities privately as described in SECURITY.md.

Contributing

Most open work is teaching DiffCI to narrow changes it currently treats as "run everything": config files, package.json edits and lockfiles. Each case is small and comes with a synthetic fixture, so you don't need to learn the whole engine. Python and Rust support are next and split into one-PR steps: see the Python and Rust tracking issues. Pick a good first issue and see CONTRIBUTING.md; a dev container is included.

Contributors

Thank you to everyone who has improved DiffCI:

Every merged contribution is credited in the release notes, here, and next to the feature in the docs.

License

See LICENSE, NOTICE and CONTRIBUTING.md. Releases before the MIT switch were published under AGPL-3.0-only and are now also available under MIT; see LICENSE-HISTORY.md. Grant eligibility depends on the particular grant agreement. No eligibility or legal separation is guaranteed by this repository layout.

See the release boundary for scope and current limitations.

Useful? Star the engine and share a reproducible pilot result.

来源:README.md,提交 8e4de58

工具

3

diffci_validation_plan

Create a local DiffCI validation plan

Plan change-aware CI validation, affected-test selection, test impact analysis, or GitHub Actions workflow checks. Returns a safe local DiffCI command without accessing the checkout or executing it.

输入参数repoactionplatform

diffci_interpret_report

Interpret a DiffCI observation report

Validate and summarize a DiffCI observation report, including selective or full mode, affected-test counts, fallbacks, non-interference evidence, and the conservative next action.

输入参数report必填

diffci_verify_workflow_text

Check a GitHub Actions workflow for DiffCI isolation

Perform a stateless preliminary safety check of GitHub Actions YAML: dedicated observer job, continue-on-error, dependency isolation, read-only permissions, and immutable DiffCI references.

输入参数workflow必填

版本历史

16
  1. v0.3.35最新Nov 7, 2026
  2. v0.3.31Nov 6, 2026
  3. v0.3.29Nov 5, 2026
  4. v0.3.26Nov 5, 2026
  5. v0.3.24Nov 4, 2026
  6. v0.3.23Nov 3, 2026
  7. v0.3.22Nov 1, 2026
  8. v0.3.21Oct 30, 2026
  9. v0.3.20Oct 30, 2026
  10. v0.3.18Oct 29, 2026
  11. v0.3.13Oct 20, 2026
  12. v0.3.12Oct 18, 2026
  13. v0.3.11Oct 18, 2026
  14. v0.3.1Oct 2, 2026
  15. v0.2.11Sep 25, 2026
  16. v0.2.3Sep 22, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分