--- name: verify description: > Use ONLY after all work items in an iteration have passed code review. The Verifier (Worker) runs the iteration's DoD matrix, integration tests, NFR validation, and regression checks. The iteration is not Done until all DoD items pass. stage: verify triggers: - verify iteration - 验证迭代 - iteration verification - 检查迭代完成 - validate iteration - DoD check role: Verifier --- > Core 中立版(Increment 6a 改写,原 deferHard verbatimDir)。机制、结构与 frontmatter 保持;实例术语(工具名、路径、工单号)按 `core/adapters/TERMINOLOGY.md` 绑定到具体实例。 # Iteration Verification Systematically verify that all work items in the current iteration integrate correctly and satisfy every Definition-of-Done criterion. This is the iteration-level quality gate — individual work items may have passed code review, but the iteration is not complete until integration is verified. ## Process Overview Every diamond is a gate the Verifier rationalizes waiving — most often by confusing "nothing failed yet" with "verified passing". ```dot digraph verify { rankdir=TB; node [shape=box, fontname="Helvetica"]; pre [shape=diamond, label="Reviews converged?\n(code + review-dag for DAG runs)"]; abort [label="ABORT: list un-converged\nreviews / missing artifacts"]; exec [label="Phase 2: Execute\n(full suite + typecheck + lint\n+ perf + security + regression)"]; dod [shape=diamond, label="Any DoD criterion\nFAIL?"]; nfr [shape=diamond, label="Any NFR threshold\nviolated?"]; td [shape=diamond, label="Every tech-debt trigger\nobjectively verifiable?"]; tdgap [label="Not tech debt →\niteration verdict = FAIL"]; commit [shape=diamond, label="Commits exist\nfor this iteration?"]; done [shape=doublecircle, label="Iteration Done"]; pre -> abort [label="no"]; pre -> exec [label="yes"]; exec -> dod; dod -> exec [label="yes: route to Developer"]; dod -> nfr [label="all PASS"]; nfr -> exec [label="yes"]; nfr -> td [label="all PASS"]; td -> tdgap [label="no"]; td -> commit [label="yes"]; commit -> done [label="yes"]; commit -> abort [label="no: must commit first"]; } ``` ## Agent Role > **Progressive disclosure ([org-internal #3722], [org-internal #3734], [org-internal #3745])**: when dispatching a Verifier > scoped to one phase, pass `skills: ["verify:phase-2"]` (preamble + that > phase only) instead of the full body; multi-phase dispatches may union. > Phase 5 is subdivided ([org-internal #3734]): `phase-5` covers the report template only; > each mandatory filing subsection carries its own marker (`phase-5.5` tech > debt, `phase-5.55` baseline failures, `phase-5.56` flaky tests, > `phase-5.6` checklist sync, `phase-5.7` CI sync). Dispatch recipes: > FAIL verdict → `"verify:phase-5,phase-5.5,phase-5.6"` (union `phase-5.55` > / `phase-5.56` when baseline failures / flaky tests are present); PASS > close-out → > `"verify:phase-5,phase-5.5,phase-5.55,phase-5.56,phase-5.6,phase-5.7,phase-6"`. > The DAG branch is separately marked ([org-internal #3745]): `phase-6` narrows to > Approval + Commit Gate, and the tail References rides `dag-branch` (same > tail rule as review-code's phase-e). Non-DAG dispatches thereby drop the > ~175-line DAG branch; DAG milestone/task verify → union `dag-branch` onto > the close-out family (`"…,phase-6,dag-branch"`) — the branch's override > clauses take precedence over the unioned phase bodies. > Sections not listed here (Process Overview, Preconditions, …) are unmarked > preamble and always inject. Full-body remains the default when no selector > is passed. The verification is owned and executed by the **Verifier** (Worker). The Verifier is a dedicated sub-agent that validates — it does not write code. The Verifier is responsible for: - Reading the iteration's DoD matrix from the plan. - Running the full test suite (unit + integration) for the iteration. - Validating non-functional requirements against quantified thresholds. - Running regression tests to confirm no prior iteration is broken. - Producing a pass/fail verdict per DoD criterion with evidence. - Reporting failures back for the Developer to fix. The Orchestrator's role is to present the verification result and, on failure, route findings back to a new implementation cycle. The Verifier MUST NOT modify code, tests, or configuration files — only validate and report. **Context compaction**: verify is a stage boundary in the main session's pipeline. The orchestrator compacts at this clean boundary ONLY when a capacity/projection trigger holds, per the L1 rule `core/rules/compact.md` §"Stage-boundary compaction" (long multi-stage runs — DAG Epic orchestration — keep the legacy every-boundary compaction; short runs — bugfix / DAG task — and standalone runs default to NOT compacting). The Verifier sub-agent itself is single-phase: it persists its verdict to `{slug}/05-verify-iteration-{N}` as it goes, so a mid-run compaction loses nothing — re-read the DoD matrix and the verify wiki page to resume (see the Verifier role's `compact.preserve` list in `core/skills/_shared/roles/verifier.yaml`). ## Greenfield vs. Brownfield **Greenfield** (new project): Verify the current iteration's DoD matrix only. No prior iterations exist. **Brownfield** (existing project + new feature): - **Regression is PRIMARY.** Run the FULL test suite (all prior iterations + new code). A regression failure blocks the iteration regardless of new feature DoD status. - If no prior verification report exists (check Gitea wiki for `{slug}/05-verify-iteration-{N}` pages — this replaces the deprecated `.artifacts/{slug}/verification/` directory), run the full test suite first to establish a baseline BEFORE verifying the new iteration. Baseline failures that pre-date this iteration are **filed as `baseline-failure` Gitea issues in Phase 5.55** — they do not block the iteration verdict, but the iteration is NOT Done until every pre-existing failure is registered (an un-filed baseline failure is a process gap). Only new regressions (caused by this iteration) block the verdict. - New NFR thresholds must not degrade existing system metrics. If a new feature increases P99 latency from 150ms to 180ms (still under 200ms threshold), log it as a warning — the trend is toward the limit. - In brownfield mode the Phase 2.1 full-suite run executes FIRST (before DoD evaluation) so its output doubles as the regression baseline for Phase 2.6 — still a single execution per tree state (2.6 reuses it; see Phase 2.1). --- ## Preconditions Before starting verification, confirm: - [ ] All work items in the current iteration have passed code review AND code review has **converged**. Run `octopus review status --stage code` — the `pipeline/review-code` commit status must show state `success`. Auto-approve does not guarantee convergence; a review that found BLOCKERs and stopped before resolution is not converged. - [ ] Code review final report exists at `{slug}/reviews/code/final/report` (Gitea wiki page; deprecated: `.artifacts/{slug}/reviews/code/final/report.md`) and final verdict is PASS (or user-approved WARN with no unresolved BLOCKERs). - [ ] The work spec exists. DAG task/milestone mode (the live path — see the DAG branch below): the frozen DAG copy `{epic-slug}/dag` supplies the node spec, its `acceptance_criteria` + `test_id` declarations, and the DoD slice. (Legacy tier rule — `{slug}/04-plan-*` wiki pages / issue comment, and the design-space + iteration-plan convergence checks that used to follow here — was archived 2026-08-21, [org-internal #3072] phase 3; historical plan/AC pages stay readable via `_shared/gitea-read-patterns.md`.) - [ ] `core/checklists/verification.md` is accessible. - [ ] `slug` matches the run's slug (DAG: `{epic-slug}`). - [ ] Upstream dependencies are complete. DAG task mode: the node's cross-session in-edge source nodes are at terminal state (task `done` / milestone `green`). If any dependency is not complete → abort, listing the blocked nodes. - [ ] Carried items from the previous iteration are closed: every carried item must have an explicit Target Iteration and must have been handled in the current iteration or have a fresh deferral record. If any carried item is not closed → warn and list the open items. - [ ] Carried risks from the previous iteration are updated: each carried risk recorded by the prior iteration (historically the plan's Carried Risks table) is marked `open` or `closed` with a current status. A risk left `open` without an explicit reactivation note is a gap → warn and list it. If the user asks to verify an iteration that still has unreviewed work items, warn and ask via the `question` tool, passing `stage: "verify"`: ``` Work items {list} have not passed code review. All work items in an iteration must be code-reviewed before integration verification. → Run code review first? (yes / no) ``` The `question` tool auto-approves per `core/rules/auto-approve.md` (stage `"verify"`). For any other precondition failure (missing artifacts, un-converged reviews, incomplete dependency chunks, open carried items), abort and inform the user. Refer to `core/checklists/pipeline-gate.md` — both the Failure Protocol and the Recovery Protocol — to determine which skill to run next to fix each missing item. --- ## Phase 1 — Load Verification Context > **Pipeline stage**: if the source issue exists, move it to the `verify` > column on the Pipeline Stages board per `_shared/gitea-write-patterns.md` > Pattern 7.5. Skip if no source issue exists. Read the upstream artifacts. DAG task/milestone mode (the live path — see the DAG branch below for its read map): 1. **Work scope** — the node(s) under verification in the frozen DAG copy `{epic-slug}/dag` (+ `{epic-slug}/dag-nodes/{node-id}` subpages when AC detail is sunk) and the node ticket's issue body: - Node ACs, `size_attrs`, and the milestone DoD slice (milestone mode). 2. **DoD matrix** — the node `acceptance_criteria` with each AC's declared `test_id` (`{file-path}::{test-name}` / `MANUAL` / `BENCH: