Cidiff

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.2更新於 Oct 27, 2026

Base-vs-head CI differ: which PR failures are introduced, pre-existing, external, or fixed.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

比對 GitHub PR 的 CI 檢查與其基準提交,將每項失敗歸類為本次引入、既有、外部、已修復或無法判定。

可以做什麼
  • 分類 PR 檢查:diff_pr_ci 比對 PR 的頭提交與基準提交,以 JSON 回傳完整報告。
  • 直接比較兩個提交:diff_ci_runs 在沒有 PR 編號時,用頭與基準的 SHA 做相同分類。
  • 區分真實失敗與雜訊:檢查被歸為本次引入、既有、外部(部署預覽或等待維護者核准的檢查)、已修復、通過、無法判定與進行中。
  • 標記不穩定檢查:同一檢查多次執行結果不一致時標記為 flaky,並暫緩給出對比結論。
  • 合併舊式 commit status 與 check run,名稱衝突時以 check run 為準。
適用情境
適合在排查一個有多項失敗檢查的紅色 PR 時使用,先釐清哪些失敗確實是該 PR 造成的。也適合維護者或 CI 腳本需要依證據快速判斷 PR 是否引入失敗。
執行需求
透過 npx(npm 套件)或 Docker 以 stdio 在本機執行。需要可存取 GitHub API 的網路連線。設定 GITHUB_TOKEN 可提高 API 速率上限;公開儲存庫不需其他憑證。
安裝前請注意
對 GitHub 僅讀取,但會將儲存庫與提交資料傳送給 GitHub API。未設定 GITHUB_TOKEN 時可能因速率限制導致結果不完整。分類依賴檢查名稱完全相符與 PR 中記錄的基準提交,重新命名的檢查會被視為刪除加新增。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Cidiff,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

cidiff

Which of these CI failures are actually yours?

A red PR with 12 failing checks usually has one real problem. The rest were already failing on the base branch, belong to a deploy preview service, or are waiting on a maintainer to approve the workflow run. Today you find that out by clicking through every check twice, once on the PR and once on the base, and comparing by eye.

cidiff does that comparison for you. It reads the check runs and commit statuses on the PR head commit and on its base commit, and classifies every check:

categorymeaning
introducedPassing on base, failing on head. This one is the PR's to fix
pre-existingFailing on both head and base with the same check name
externalA hosted or deploy surface (Vercel, Netlify, Cloudflare, and friends, matched by check name), or a check waiting on maintainer approval (action_required)
fixedFailing on base, passing on head, or gone while other head checks ran
passingPassing on head
indeterminateFailing, but there is no usable base evidence to prove it either way
pendingThe head run has not finished

Exit code 1 when introduced failures exist, 0 otherwise, so it drops straight into a CI gate or a maintainer's triage script.

The honesty rules

cidiff was extracted from the CI triage inside Greenlight, where it classified 89 failing checks across 46 open PRs in one sweep and found zero introduced. Getting that number right depends on refusing to guess:

  • No base evidence means indeterminate, never a verdict. A failing head check with no base run is reported as unproven, in both directions.
  • Base failures are only "fixed" when the head actually ran checks. On day one, dogfooding against a real fork PR (usebruno/bruno #9569) showed the trap: the PR's check suites were stuck at action_required, waiting for a maintainer to approve the workflow, so the head commit had zero check runs. A naive differ reported every base failure as fixed and every base pass as passing. cidiff detects the empty head, reads the check suites, and says in plain warnings: CI has not run on this head, these failures cannot be classified yet.
  • Legacy commit statuses count as evidence. Snyk, CodeRabbit, and older CI systems report through the Statuses API, not check runs. cidiff merges both, with real check runs winning on name collisions.
  • External blockers classify first. A failing Vercel preview is not a test failure, and a check that needs maintainer approval is not a code failure. Both are reported as external before any base comparison happens.
  • Flaky evidence is not an attribution. If completed runs for the same check on the same commit disagree (one passed, one failed, same code), the check is unstable. Comparative verdicts that would rest on a single outcome from an unstable side (introduced, pre-existing, fixed) are withheld as indeterminate and flagged flaky in the report, with the attempt counts recorded; a passing latest outcome keeps its passing verdict, flagged. The text report names flaky checks on a [FLAKY] line.

Usage

CLI

bash
# Classify a PR's checks against its basenpx @reneturcios/cidiff pr usebruno/bruno 9569
# Machine readable outputnpx @reneturcios/cidiff pr owner/repo 123 --json
# Compare two commits directlynpx @reneturcios/cidiff runs owner/repo --head <sha> --base <sha>

Example output (the fork PR case above, real output):

cidiff usebruno/bruno PR #9569: 0 introduced, 0 pre-existing, 0 external, 0 fixed, 6 indeterminate, 0 pending, 2 passing  [WARNING] No check runs on head commit 885c6fafed1e (only 2 commit status(es)). The workflow system has produced no evidence to diff against; base check failures below are indeterminate, not fixed.  [WARNING] 3 check suite(s) on the head commit are action_required: CI is waiting on maintainer approval to run (typical for fork PRs). The failures cannot be classified until CI actually runs.  [INDETERMINATE] Unit Tests (Linux): Failing on base, and the head commit has no check runs, so there is nothing to compare. CI may not have run on the head yet  [PASSING] CodeRabbit, security/snyk (Bruno)Verdict: no introduced failures. Any failing checks are pre-existing, external, or unproven either way (indeterminate).

Known limit, stated plainly: the base comparison uses the check evidence recorded for the PR's base commit (the base branch tip stored in the PR object), and checks are matched by exact name. A renamed check looks like a removal plus an addition. Both limits are visible in the output rather than hidden.

Set GITHUB_TOKEN for the higher authenticated GitHub API rate limit. No other credentials are needed for public repos.

MCP server

Add to your MCP client config:

json
{  "mcpServers": {    "cidiff": {      "command": "npx",      "args": ["-y", "@reneturcios/cidiff", "mcp"]    }  }}

Tools:

  • diff_pr_ci: repo plus PR number, returns the full classified report as JSON.
  • diff_ci_runs: repo plus head and base SHAs, same classification without a PR.

Docker

bash
docker run -i ghcr.io/cloudcorprecords/cidiff mcpdocker run --rm ghcr.io/cloudcorprecords/cidiff pr owner/repo 123

The toolkit

cidiff is Wave 1, package 2 of a planned family of small, single-purpose developer tools by the same author, all built the same way: one bin that serves a CLI and an MCP server, deterministic checks with evidence, no invented answers. Its sibling shipcheck verifies finished releases, and it verifies cidiff's own releases in return.

  • greenlight: pre-flight checks for open-source contributions: is this issue actually landable?
  • shipcheck: release verification: git tag, release, npm, MCP Registry, and GHCR must agree, or NO-GO.
  • prwatch: attention report for your open PRs: what needs you right now.
  • claimcheck: stale-claim states and parked fixes on forks.
  • gatefile: extract hidden contribution gates into machine-readable contribution-gates.json.
  • pkgverdict: pre-install verdicts for npm packages: GO, RISKY, FAKE, or MISSING.

Development

bash
npm installnpm run buildnpm test   # 31 tests, classification logic runs on fixtures, no network

License

MIT

來源:README.md,提交 4af496a

工具

2

diff_pr_ci

Compare a GitHub PR's check runs against its base commit and classify every check: introduced (passing on base, failing on head), pre-existing (failing on both), external (deploy or hosted surface, or waiting on maintainer approval), fixed, passing, indeterminate (no usable base evidence), or pending. Answers the question every red PR actually asks: which of these failures are mine?

輸入參數pr必填repo必填

diff_ci_runs

Compare check runs between two commits in a repo (head vs base) with the same classification as diff_pr_ci, for cases where you have SHAs instead of a PR number.

輸入參數repo必填baseSha必填headSha必填

版本歷史

3
  1. v0.1.2最新Oct 26, 2026
  2. v0.1.1Oct 23, 2026
  3. v0.1.0Oct 19, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分