跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

whose-red

Decide whether a failing test run is the change's fault or was already broken on main, before retrying, reverting or blaming anyone. A red is a measurement, not a verdict; the verdict needs a clean-main control on the same test files. Use when tests fail on a branch or PR, when an agent says 'this failure is pre-existing', or before spending another attempt on a fix.

Grit-77 · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add Grit-77/done-is-a-claim --skill whose-red

技能说明


name: whose-red description: "Decide whether a failing test run is the change's fault or was already broken on main, before retrying, reverting or blaming anyone. A red is a measurement, not a verdict; the verdict needs a clean-main control on the same test files. Use when tests fail on a branch or PR, when an agent says 'this failure is pre-existing', or before spending another attempt on a fix."

Whose red is it

A red says the suite failed, not who failed it. Nothing in the branch's own log separates "the change is wrong" from "main was already broken". Only a control does. Settle it before you retry, revert or block on the red.

Procedure

  1. Read the error text first. Some failures belong to the machine or the test command on sight, not to the change:

    • command not found, exit 127, a missing interpreter or tool;
    • file or directory not found for the test path itself (exit 4 in pytest);
    • no tests ran / nothing collected (exit 5 in pytest);
    • network, disk-full or permission errors. Fix the environment or the command; do not count these against the change.
  2. Prepare a clean control. A scratch worktree detached at an explicit main commit, never your working checkout:

    git fetch origin
    git worktree add --detach ../control origin/main
    cd ../control && git rev-parse HEAD && git status --porcelain
    

    Quote the printed commit. git status --porcelain must print nothing.

  3. Run only the failing test files there, with the same command, flags and environment the branch used. The narrow run takes seconds.

  4. Compare named tests, not counts.

    Control on mainVerdictDo
    Fails the same named testMain's; the change is innocentRecord it, report main's red, spend no attempt on the change
    Same error, different countMain's, load-sensitiveThe same, and note that the count varies with load
    Green on those filesThe change'sRecord both runs; fix the change with the cause named
    The files exist only on the branchThe change's by constructionNo control is possible or needed
  5. Before retrying a change-owned red, rule out a stale base: rebase on current main and run again first.

  6. Record both runs. A verdict with one number in it is a guess:

    red: <test id> — <error line>
    branch <commit>: FAIL   control main <commit>: PASS|FAIL
    verdict: change | main | environment
    

Main's own reds

Keep a short list of tests that are red on main and why. One entry explains other branches' reds for as long as it stands. Remove the entry when main is green on it again, and re-check any decision that rested on it.