--- name: delivery-review description: > Use when the delivery review stage must judge a PR against its ticket and Acceptance checks. Owns the review checklist and the review-body format. Not posting the review -> `gitea-prs`. Not the CI verdict alone -> `delivery-ci-checks`. compatibility: Requires a Gitea forge with Actions reached through the Gitea MCP server, and a consuming repo carrying docs/agents/delivery.md. allowed-tools: Read mcp__gitea__pull_request_read mcp__gitea__issue_read mcp__gitea__commit_read mcp__gitea__actions_run_read mcp__gitea__get_file_contents metadata: category: delivery version: "0.3.0" --- ## Gotchas - A green CI is not test integrity. The test-path freeze takes the *newest* `Delivery-Stage: test-author` commit as its boundary, so a dispute round's amend commit un-checks implementer commits made before it. Judge every test-path change on the PR yourself. ## Common gates Apply on every step: - Read-only. Never post, comment, label or edit anything: return findings; the caller posts them. - Never run tests, linters or dry runs locally, and never re-run CI. CI output is the evidence. - Evidence is a link (job, issue, PR file view), never pasted log text. - Never read or decrypt secret material (vault files, private keys, `.tfstate`, Secret objects) to check it; judge from the diff alone. - A stop ends the run at once: return `result: stop: ` and nothing else. ## Step 1 — Read the inputs The caller passes the PR URL, the issue URL and the tool skills it loaded. - PR: `mcp__gitea__pull_request_read` `get` (head SHA, base ref, body, `html_url`), `get_files`, `get_diff`, `get_commits`, reading every page. - Handoff comments: `mcp__gitea__issue_read` `get_comments` on the PR and on the issue, every page of each (a first run that stopped before the PR existed posted its Handoff on the issue). Keep every `- Dispute verdict:` line; `references/checklist.md` §Keys and verdicts uses them. - Issue: `mcp__gitea__issue_read` `get`. No acceptance criteria, or contradictory ones → one blocking `[human]` finding, "issue has no usable acceptance criteria", linking the issue; skip checklist checks 2 and 3, which judge against the criteria, and run the rest. - `docs/agents/delivery.md` and any globs file it names, both read with `mcp__gitea__get_file_contents` at the PR's **base** ref, never the head: a PR must not loosen the rules it is judged by. Its format is owned by `delivery-repo-doc`'s `references/format.md`; parse only `## Test paths`: either the single item `` - globs file: `` `` (read the globs, one per line, from that file) or one `` - `` `` per line. Missing or unparseable → stop with "`docs/agents/delivery.md` ". `- none` → stop: "no test paths in docs/agents/delivery.md". ## Step 2 — Count the rounds Read `references/review-body.md` §Round counting and compute `round` and `blocking-rounds-before`. ## Step 3 — CI Invoke `delivery-ci-checks` on the PR. Keep its `Commit:` SHA as `commit` and its table for Step 4. | Verdict | Action | |---|---| | `fail` | one blocking finding per failed check: its cause, linking its job; owner per `references/checklist.md` §Owners | | `pending` | stop: "CI still running" | | `missing` | stop: "CI check missing: ``" | | `malformed: ` | stop: `` | | `pass` | no finding | ## Step 4 — Judge the change Read `references/checklist.md` and apply checks 2–7 in order, recording each finding as blocking or non-blocking by its definitions, and each blocking finding's owner by §Owners. Apply the loaded tool skills' conventions where they cover a changed file. ## Step 5 — Return Output format, the run's only output: ```text result: findings round: blocking-rounds-before: commit: blocking: - [test-author] — : — — - [test-author] — — - [] : — — non-blocking: - : — — ``` `` is `implementer` or `human`, or `test-author` for that keyless finding: check 3's missing `## Acceptance checks` block. Every other `[test-author]` finding carries its `` (`references/checklist.md` §Keys and verdicts) so the dispute round matches on it, never re-derives it. An empty list is `- none`. Omit `: — ` for a finding with no line. The caller posts the review per `references/review-body.md` §Body and §Inline comments.