Skip to content

Evidence

A pull request is done when its safety evidence is complete. wuwei evidence owner/repo#n lists one PR's safety gaps; wuwei status lists every open item's. Each gap is actionable (the team can close it now), waiting (CI running, CI not started at a code head with no checks yet, the code host unreadable, an andon) or yours (an owner review).

WUWEI never asks how the work was done. A test is in the diff or it is not; a reviewer passed this head or did not.

Evidence Applies Kind Why
The WUWEI footer naming the item every PR process work outside the plan is visible, and the audit can trace each change to a goal
The repository's PR template sections when the repo has a template process the repository's own process comes first
A test in the diff, or No test: <reason> code changes safety test first is the cheapest defect filter there is
Under about 400 changed lines, or Size: <reason> every PR, generated files aside process small batches fail less and are reviewed better
Rollback: <how to undo> full tier, or owner_paths touched process a change you cannot undo deserves a plan for undoing it
The spec engine's steps, judged by their artifacts at the head standard and full, when the repo has .specify/ or openspec/ process at standard, safety at full the agreement about what to build is part of the change
A breaking change: an Announcement: link, then the owner's confirmation at the head a declared break, or one the arch gate finds safety clients you break should hear it from you first, and you decide whether it ships
The gates the diff needs, passed before the PR turned ready the diff, under the tier's ceiling safety independent review before anyone else reads the code, and only the reviews the change calls for
CI green every PR safety the repository's own checks
Every check the base branch requires ran (see required checks) a base branch with protection or rulesets that require checks safety a check that never ran is not a pass, and an admin can merge past GitHub's own hold
A review status settled (see review statuses) a commit status from a workflow the repo runs on pull_request_review safety a gate waiting on a reviewer needs someone to act; it is not a build
Every review thread answered every PR safety people's questions are obligations
A reviewer requested every PR process a PR nobody is asked to read is not reviewed
Owner review: your approving review, or your owner review: answer, at the head (a breaking: or exception: answer is not one) owner_paths touched and the latest arch verdict says Breaking: yes, the latest security verdict says Trust: widened, either is missing, or the entry starts always:; and any change to the owner-review rule or a verdict shape. Otherwise the gates carry it and the day report lists the merge with its gates safety what you chose to review yourself
Not stale (under three days open) every PR process inventory rots; flow over stock

Review statuses

Some repositories publish their approval rule as a commit status, from a workflow that runs on pull_request_review (ai-stacks' Review Gate). WUWEI follows the status's target_url to its workflow run and compares the run's workflow with the workflows the repository has run on pull_request_review (its last 100 such runs, read once a day, and only when a head has an unsettled status). A match is review evidence, not CI:

Status Gap
pending waiting on review: <context>
failure change request outstanding: <context>

Both are actionable safety gaps: someone has to ask for a review or answer the change request. A direct merge waits for either gap. Arming auto-merge may wait on pending review and permitted CI waits; GitHub holds the eventual merge. Failed review still holds auto-merge. An unreadable review classifier produces evidence unreadable: review status classification unreadable, which holds both merge routes. A status without a matching review workflow remains ordinary CI.

Why: a review gate read as CI tells the team to wait for a build that already finished, or to fix a build that is not red.

Required checks

WUWEI reads the checks the PR's base branch requires: from branch protection (through the branch read, which needs only read access) and from the rulesets that apply to the branch. It keeps the answer 15 minutes per repository and branch.

What WUWEI finds Gap Arming auto-merge
CI settled, and a required check has no check run and no status of that name on the head required check not run at <sha7>: <names> held
CI still running, and a required check has no run yet required check not run yet at <sha7>: <names> (waiting) passes
the protection or rulesets read fails or is malformed required checks unreadable on <branch>: <error> (waiting) held
GitHub reports the PR's mergeable_state blocked, and WUWEI has no other safety gap for it GitHub reports the merge blocked for a reason WUWEI cannot name: read the merge box on the PR (waiting; not raised with allow = ["admin-merge"]) passes

Every one of these gaps holds a direct merge. GitHub creates a job's check run only once the job is queued, so while CI runs a missing check may simply not exist yet. GitHub's auto-merge waits on its own required checks and its own hold, so arming it then is safe. A required check that ran and failed or is still running reads as CI failing or CI running. A failed read is read again next time.

Release PRs. release-please pushes with the workflow token, and a push with that token starts no workflow. Its PR then carries required checks not run, with a pointer to this remedy. The way through:

  1. Set a repository secret the release workflow passes to release-please as its token. In this repository that is RELEASE_PAT, which .github/workflows/release.yml already reads before the workflow token. Use a fine-grained token or a GitHub App token with contents and pull-requests write. Its pushes start the Tests workflow on the release PR.
  2. Until then, close and reopen the release PR. A reopen by a person starts the pull_request workflows at its head.
  3. Or record an owner exception: at that head.

A release PR sometimes does get its checks (when a person's push or reopen started them), so one release PR with green checks does not show the secret is set.

Why: release-please pushed with the workflow token, so release PRs #1156 and #1157 had none of main's required checks on their heads. GitHub reported them blocked, but an admin could merge past that, and WUWEI read only the checks that reported.

The spec engine

When a repository uses a spec engine, its steps are part of the evidence at standard and full. WUWEI does not watch the steps run; it reads their artifacts at the PR head, in every feature directory the diff touches, so a later commit that only updates tasks.md still counts.

Engine standard full adds
spec-kit (.specify/, features in specs/<feature>/) spec.md, plan.md, tasks.md with every task checked (implement done) a ## Clarifications section in spec.md (clarify ran), analysis.md with no open CRITICAL or HIGH row (analyze ran clean), every item in checklists/ checked
OpenSpec (openspec/, changes in openspec/changes/<change>/) proposal.md, at least one capability spec under specs/, tasks.md with every task checked

Each open CRITICAL or HIGH row is its own gap, and so is each checklist with an unchecked box. A row longer than 100 characters is cut at its last cell edge within them, unless another open row would print the same text; then both print whole. An owner who accepts one has seen the gap that the exception waives.

Why: a spec nobody finished is worse than no spec, because it looks like agreement. Checking the artifacts, not the commands, keeps the rule true whichever way the steps were run.

At standard the steps are process fit: a misfit is recorded, never blocking. At full they are safety gaps and hold the merge, because full is the tier for work where building the wrong thing is expensive.

Breaking changes

A breaking change is a major version under SemVer 2.0.0: an incompatible change to the public API a project declares. Its clients cannot be un-broken, so it is close to a one-way door. In a repository WUWEI audits, the arch gate reads that repository's declared public API, or what it documents for clients when it declares none.

WUWEI's own public API is:

  • the CLI commands, flags, exit codes and the output documented for scripts;
  • the config keys and their defaults;
  • the ledger, state and verdict file formats;
  • the PR body lines and owner question shapes that seats and owners write;
  • the hook input and output contract;
  • the skill names (/wuwei-run, /wuwei-watch, /wuwei-close, /wuwei-rules, and the old name of a renamed skill while its alias ships), the plugin name and the marketplace name;
  • the agent role names, which the config's models rows name;
  • the owner-written files: .wuwei/goals.md, .wuwei/standards.md and the plan file format.

The gate reads this list, or a project's own declaration, at the base commit, never from the PR's own head, so a PR cannot shrink the API it is judged by. A change is classified by what it does to that API:

Bump The change
major a documented element is removed, renamed or given a different meaning or shape; an input every client must now give; a documented exit code changes meaning
minor a new capability that existing clients need not use; a new check that is off by default or only adds information
patch a fix of behaviour that contradicted the documented public API at the base, including a closed guard bypass and a gap the docs already promised; docs; internals

A fix makes the code do what the docs already said, so it is a patch even when WUWEI now refuses or reports more. Refusing or reporting more is a patch only under that condition: the old behaviour contradicted the documented public API. A new rule that asks every PR for something the docs never asked is an input every client must now give, so a major. An exit code is judged by its meaning, not by which inputs reach it: when wuwei evidence exits 1 on one more PR because a documented rule is now checked strictly, 1 still means gaps, so that is a patch. A change with any major part is a major. When the gate is unsure which bump applies, it escalates to you with Breaking: yes.

Versions 2.0.0 to 4.0.0 were bumped under the earlier rule, where any visible change in behaviour counted as breaking, and from 4.1.0 the SemVer policy applies.

WUWEI finds a breaking change three ways: the PR declares it (a ! in the title, a BREAKING CHANGE: line), the architecture gate states it (every arch verdict carries Breaking: no or Breaking: yes: <what breaks for which clients>, and yes means a major), and a change to a contract file (OpenAPI, protobuf, GraphQL, JSON schema) takes the arch gate at any tier so it looks. A patch is a fix: commit and a minor a feat:, as release-please bumps them; only a major takes a !.

Before a major merges it needs evidence, in order:

  1. An Announcement: <url> line: one http(s) URL alone on the line, without brackets. It points at a client communication that already exists: a PR or issue comment, or a published release note or migration guide. A changelog entry written at release does not count.
  2. Your confirmation, asked once the announcement exists: breaking: owner/repo#n at <sha7>: <what breaks>. Announced at <link>. Proceed?. It binds to that head; a change after it asks again.

Before an announcement, the team can ask whether a change breaks at all: breaking: owner/repo#n at <sha7>: <what changes>. Treat as breaking?, with the options Breaking and Not breaking. Any other answer records nothing. Your no clears the break at that head, unless the PR declares it (! or BREAKING CHANGE:). Your yes makes it a break; it is never the confirmation in step 2.

Why: a break nobody announced is an outage for someone else. The team does the work of finding and announcing it; you decide whether it ships. A major that is not one costs clients an upgrade review for nothing, so a fix of a documented rule ships as a patch, with release notes.

Gates before the PR, chosen by the diff

The gates run before review: the PR opens as a draft, the gates read its head while CI runs, and gh pr ready and reviewer requests are refused until the gates pass at its head, so reviewers and the merge only ever see gated code. They also wait for green CI at the head, naming what holds it (a review-triggered status is review evidence, not CI); a red check found after the gates pass goes back to the builder, and its fix is a new head.

The tier is a ceiling and the diff decides what runs under it:

The diff Gates
prose only, at any size (.md, .rst and .adoc files outside the spec folders, other than the files seats load such as AGENTS.md, CLAUDE.md, charters, agents and skills; LICENSE; NOTICE), or specs of 200 lines or fewer with no contract none
code quality
risky paths (auth, sessions, tokens, secrets, crypto, SQL, migrations, policies, infrastructure, CI, dependency manifests) or owner_paths, at standard + security
a contract file or a spec contract (a file under a spec's contracts/ folder) at any tier, or at standard more than 200 changed lines that are not prose (code, specs, .txt files, code under docs/, the files seats load) or 10 code files + arch
full tier all four

The smart tier

smart is the default for new items. The lead classifies each item with Cynefin and records the domain with one line of evidence (--domain "clear: <why>"); the gates start from the standard rows above and the domain and the measured signals at the head only add to them:

Domain or signal Gates
clear the standard rows above
complicated, on a trust path (auth, sessions, tokens, secrets, permissions, grants, policies) + arch
complex, or no domain recorded, or a domain in another spelling all four gates, a short How this fails and the spec engine's artifacts, which hold the merge
a changed Python function whose decision nodes (if, loop, except, assert, boolean operator, comprehension, match case, conditional expression), read with ast at the base and the head and summed over functions of one name, rise to 10 or more (McCabe complexity over 10); a head that cannot be read or parsed counts as a rise + security
a code patch that names what a guard waives or refuses (deny, ask, allow, refuse, waive, excepted, exception, permissionDecision, PROCESS, DUTY), or a code file with no patch + arch
owner or risky paths, or the promise marked in doubt (--in-doubt) + goal

A model-written or seat-written field can only raise the set: a clear domain on an owner path still takes security and goal, and on a guard change still takes arch. The goal gate is the red team: it names the three likeliest ways the change fails its promise in real use and runs each as a probe in a git archive copy of the head.

A one-line config flag costs one gate. After a fix round only the gate that found the problem re-reads. After review comments, a delta of docs, or of at most 20 lines off risky paths, carries the earlier passes; a larger one is re-read by the one gate it needs (security for risky paths, arch for a contract, quality otherwise). The delta is what moved in the PR's own diff against its base, not everything between the two heads. A merge of the base that leaves the PR's own patches alone (line numbers aside) carries the passes, as does a change only to files the workspace declares generated with a dated line in .wuwei/standards.md, such as - Generated (acme/app, 2026-10-22): guide/* src/version.py. The line applies off risky, owner and contract paths: a file there still counts, whatever the line names. When the error budget is overrun (smart rises to standard), or a light item touches a trust path (auth, sessions, tokens, secrets, permissions, grants, policies) outside docs, the raised tier takes its full gate set.

Why: gates that run after the PR opens race the merge, and four gates on a one-line change cost more than they find. Review cost follows risk.

Attested verdicts

A verdict counts only when WUWEI attested it. When a sentinel stops, the SubagentStop hook reads the file it names (Verdict file: <path>), checks its shape, and records its hash, gate, item, head, confidence and the agent that wrote it. A malformed verdict goes back to the reviewer once with the format. A file edited after attestation no longer counts, except that a finding (FIX or ESCALATE) still holds as recorded: replacing it cannot turn it into a pass. A verdict counts only at an ancestor of the PR head. A pass counts only for this PR, for its repository alone, or when no PR is named (an imported 0.34 verdict); a finding holds from any PR of the item in this repository. A later pass at an older head never clears a finding. At the same head it clears a FIX only when it names that file on a Supersedes: <item>/<file> line, for a finding closed outside the diff; an ESCALATE stays the owner's. Otherwise only a pass at a newer head on the PR's line clears it. Supersedes: clears gates only: an arch Breaking: no clears a Breaking: yes only from a newer head on the PR's line, for this PR or its repository alone. The create and ready doors read no PR yet, so there a pass for any PR of the item in that repository counts. A gate whose only pass named another PR reads missing: re-run it with PR: <owner/repo>#<n>. A seat that writes over another seat's verdict is sent back to write its own file beside it. When the stop cannot read the seat's last message, the handback to the lead carries it, and the verdict is attested from there. A verdict file that does not count is never silent: the board names it and why (its shape, or that no sentinel attested it). An attested pass that does not count for this PR or head shows only as the gate missing.

Why: a review is evidence only if a reviewer wrote it and it has not changed since. The hook checks the file at stop, however it was written, so a shell edit cannot slip past the lint.

Duties

A duty is work the team owes that does not hold the merge but reaches the team until it is done: asking for review where the team asks (see review requests), and, when a check is red, re-requesting an approval given at an older commit (the approval is named with its commit, so nobody re-runs a review gate that wants an approval at the head). One team row, first on the board, names the seats nobody runs: orchestration: open PRs with no shepherd seat running when more than two PRs are open, and orchestration: gates owed with no gate seat running when a gate is missing at a head with no failing check: gates start at push, while CI runs or before it starts, and a red head goes to its builder first. A seat runs when this session started it today and no stop or unconfirmed row followed; a Codex job writes no seat row and never counts. The lines carry no count, so a Stop reminds once while the state holds. Duties show on the board and in the Stop reminder, like safety gaps.

Safety and process

Only safety gaps hold a merge and reach the team while it works: a test, the gates at the head, green CI, answered threads, owner review, a breaking change's announcement and confirmation, the spec engine's steps at full, and evidence that can be read. Everything else is process fit: the plan link, the PR template, small batches, the Rollback: line, the spec engine's steps below full, a requested reviewer, staleness. Process fit never blocks and is never shown on the board or asked about; the merge records it, the report lists it, and the steward turns a rule that keeps misfiring, or keeps being skipped, into a fix.

Why: continuous flow. Neither you nor the model should be distracted by a rule that does not fit this change. The audit still sees every misfit, and the process learns from them.

Exceptions

For a safety gap only, you can accept one gap at one head as an exception (see decisions). The gap disappears from that head's evidence, the exception stays on the record, and a follow-up item in the plan closes it later. Only the gap the exception names exactly disappears; a part of a gap waives nothing. When it is a gate gap, the verdict ... not counted lines under it go too, and the ready door lets that draft turn ready or ask reviewers at that head.

When evidence cannot be read

An unreadable code host is a waiting gap, never a pass. A merge whose evidence cannot be read stays refused.