Wrapup Gates — What Each Check Does and Doesn't Cover
canon's close path runs a series of gates before a ticket can close. Some are advisory; two
(reviewer, evaluator) run as fresh subagents with no implementation history; one (evaluator)
is the binding gate that blocks the close. This page is a reference for what each gate checks and,
just as importantly, what it does not — so a passing close is never mistaken for a guarantee it
was never designed to make.
See the README for the lifecycle overview,
docs/how-it-works.md for the CLI/agent split, and
skills/sprint/reference/complete.md for the authoritative
close-path logic. Each gate's own definition lives in skills/wrapup/gates/*.md,
skills/doc-audit/SKILL.md, skills/sprint/reference/review.md (the advisory reviewer gate), and skills/sprint/reference/eval.md.
The wrapup pipeline itself is code-simplifier → code-reviewer → doc-audit → refresh docs;
security-review runs after the advisory reviewer and its fixes, on the final diff, just before the evaluator.
The gate and step names live in one file, skills/sprint/pipeline.yaml, read with tools/pipeline.sh resolve; a project can switch off an optional node or reorder the three wrapup gates, from the Cockpit's Factory › Pipeline tab or by editing canon-config/pipeline.yaml (tools/pipeline.sh says how; the tab rewrites the whole file, so comments you add by hand are not kept), and tests/pipeline.sh fails when a doc names a gate the file lacks. "Preview a ticket" on that tab (Normal, Lite, Manual, Manual + Lite) also draws the Sprint progress card beside the list: each step with what that kind of ticket skips, waits for or runs read-only, display only (t-2755). sprint approve pins it and sprint complete requires a row, a summary line and an event for each removed node (complete.md, "Project pipeline"). The reviewer, evaluator, and the advisory skill-eval and non-binding mutation-test gates are driven
from complete.md, not the wrapup pipeline, but they surface together on the board's Wrapup Gates
table, so they're included here.
Demo mode. When a ticket carries demo: true (a user-elected light-close for a live demo or a
docs/research/UX sprint — see complete.md's "Demo mode"),
sprint complete keeps only security-review + the binding evaluator and skips every other
gate below (advisory reviewer, code-simplifier, code-reviewer, doc-audit) — a
superset of what the bugfix tier trims. security-review always runs even with no security surface
(its ran row records that), and the evaluator is forced to Haiku. Each skipped gate's Wrapup Gates
row reads skipped | demo mode, so a demo close never looks like a full close.
Manual mode. When a ticket carries manual: true (tkt manual <id> on, or the board's Manual
chip; see complete.md's "Manual mode"), you test by hand and
the gates re-test nothing: the advisory reviewer and the mutation sweep are skipped (rows read
skipped | Manual mode), the full-suite stamp is not required, and the evaluator runs read-only,
checking your recorded testing (sprint manual-qa) against the diff and the acceptance. The other
wrapup gates still run unless the ticket is also Lite; security-review and the evaluator always run.
sprint check-evidence waits for your test, and refuses Manual mode for a high-risk plan or a gate-file
change. The close question reads your record back, and your yes is the sign-off.
What each gate checks
| Gate | Checks | Does NOT check / out of scope | Skips when |
|---|---|---|---|
| code-simplifier | Structure & clarity of code touched this session: reduces nesting/redundancy, better names, no nested ternaries; behavior must stay identical | Correctness/behavior changes, security, tests, docs; untouched code | Single-line/trivial rename; docs/comments/config-only |
| code-reviewer (inline, advisory) | 8 dimensions on session code: plan/acceptance alignment (scope drift), correct solution, design fit [SRP][OCP][LSP][ISP][DIP][DRY][LoD][CoC] + GoF [pattern-fit] (misapplied/missing patterns, default-to-silence), bugs/edge cases, test coverage, shallow security, efficiency, style; in a canon checkout, skills lint, CATALOG.md drift, orphan scripts and the board render (moved here from the removed repo-check gate); a syntax check on changed files (bash -n, py_compile when python3 works) |
Deep security (deferred to security-review), runtime behavior, repo/doc consistency; does not mandate patterns — forcing an abstraction is itself flagged [KISS]/[YAGNI]; advisory — doesn't block close |
Single-line fix, no design implications; purely mechanical |
| reviewer (fresh subagent, advisory) | Independent clean-context review of the diff vs approved plan/acceptance; YES/NO verdict on quality, scope, standards | Binding authority — a NO is advisory only; has no implementation history | Trivial/bugfix tiers (normal+ only); also skipped in demo mode |
| security-review (static, diff-scoped) | HIGH/MED-confidence exploitable vulns in changed files: injection, XSS, authz bypass, weak crypto, unsafe deserialization, SSRF/CSRF, broken auth, secrets/hardcoded creds, agent/MCP security (tool over-provisioning, permission scope, MCP config exposure; prompt injection: outside text reaching an agent as instructions, Low unless it reaches a tool, permission or secret), CI and supply chain (CI config as authorization code), third-party data egress, destructive action endpoints. Each finding names its attacker, survives a refute step, and is capped at the impact shown | Never runs the system (no runtime posture); credential blast radius; anomaly/behavioral detection; rate-limiting/DoS; regex DoS; log spoofing; missing audit logs; general hardening gaps; env vars/CLI flags (trusted); framework-safe XSS; LOW/theoretical; test/dead code | No security-sensitive files/patterns changed (but in demo mode it always runs — it is the one wrapup gate demo retains) |
| doc-audit | After tools/doc-check (no model: relative links resolve, named files exist, sprint/tkt subcommands exist), user-facing doc accuracy: overstated automation, missing prerequisites, absolute claims, scope inflation, internal consistency, affected-doc coverage, workflow-gate accuracy, heading case, private content/PII |
Code correctness; doc completeness beyond accuracy; won't auto-write findings or redact without confirmation | No user-facing docs changed and no skill/standards frontmatter changed |
| eval / evaluator (fresh subagent, binding) | Each acceptance criterion + test-plan item graded pass/fail/partial/not-run from clean context against actual changed files, with file:line + quoted-text evidence; runs executable specs, renders visual criteria, rejects weak evidence. Any partial or not-run → fail; only ^pass: closes |
Anything outside acceptance.md scope (must not over-reach); the "Tested locally" QA checkbox; files outside the changed list; semantic truth if the criteria themselves are wrong |
Trivial tier only (runs on bugfix/normal+) |
| skill-eval (advisory) | Behaviour of an edited skill: runs that skill's own evals/evals.json (a fresh executor and grader per case) when the diff touches skills/<name>/**/*.md or agents/*.md, and records the pass rate per model in skills/<name>/evals/history.jsonl |
Whether the skill is good: evals are simulations and noisy on small models, a rate is only compared with the same model's last run; never close-gated | No skill or gate agent changed, or the skill has no evals.json |
| mutation-test (non-binding, after the reviewer and security-review, before the evaluator, t-087c) | Test sensitivity: mutant-sweep mutates the sprint's changed shell, JS, Python and Go lines with a fixed operator table, runs each mutant's covering test in a throwaway copy, and lists survivors with file:line; each survivor is killed or triaged (test fixed, check deleted, or equivalent with a reason) and the final sweep is stamped into evidence/mutant-sweep.log before the evaluator runs |
Semantic correctness (sensitivity ≠ truth); never close-gated | Only with a reason in its row: no logic files changed, or no working Python 3 (mutant-sweep --check exits 3: skipped | no python3, t-a5f6), or another stated reason |
What none of them check
Every gate above is either static or diff-scoped — none of them execute the running system,
make deployment/install-time trust decisions, or watch behavior over time. security-review states
this explicitly: it is a static, diff-scoped review that never runs the system, and "enforcement
lives in ongoing management, not at sign-in."
So install-time and runtime security — the concerns in an AI extension security policy (vetting an MCP server before installing, deciding whether to grant a Skill Bash/Write access, reviewing what a plugin bundles, minimum-permission tokens, production write-access, credential blast radius, rate-limiting) — are out of scope for the close pipeline. The gates will catch a diff that hardcodes a token or over-provisions a tool in code, but they will not make the trust decision to install an extension, nor enforce anything at runtime. Per canon's own docs, that surface belongs to:
- the human install decision (canon does not self-merge; commit and push stay human-confirmed),
docs/production-incident-playbook.md— runtime posture, blast radius, and anomaly detection, andskills/ai-audit/SKILL.md— the static AI-app risk surfaces (agency-scope/resource-control/observability).
How gate results are recorded
At close, each gate is logged on the ticket's Wrapup Gates table as ran or skipped, always
with a one-line reason — a skip is a reasoned, auditable verdict, not a silent shortcut. The
reviewer and eval rows additionally record the model that ran them as (model: <id>); which
model runs those two gates is decided by the rules in the README's
Which model runs the close gates table and
complete.md's "Model tier for gates."
When the close succeeds, sprint complete also records what the ticket cost: one sprint.cost event (tokens by phase, turns, gate runs, models; numbers, model ids and gate names only) and the line cost: 576k tokens (gates 533k, 93%), 3 gate runs. It is read from Claude Code's transcripts, so it is skipped when none cover the sprint; sprint token-spend --ticket <id> shows it later. When the reviewer or the evaluator ran on the model that built the change (the model with the most implementation tokens in those transcripts, compared with the model its row in .claude/subagent-runs.jsonl logged), the close adds one line, note: the evaluator ran on <model>, the model that built this change, so it is not independent of it (advisory, never a block). (when both ran on it: the reviewer and the evaluator … so neither is independent of it), and the event carries builder (that model) and same_model (the gate or gates on it; absent when none). A builder or a logged model that cannot be read gives no line.
On the board the table is the Wrapup Gates entry under Acceptance on a closed ticket; Sprint and gates on getcanon.dev shows one.
The distinction that matters: the CLI mechanically enforces that the gates ran and that the binding
evaluator verdict is pass; the agents and evaluator judge whether the work behind the gates is
actually true. A gate that only ever passes is theatre; a gate that only ever fails is noise — canon's
are designed to do neither.