Merge pull request 'feat(delivery): read a failing dry-run-gated check as a human gate' (#226) from feat/delivery-gated-failure into main

Reviewed-on: #226
This commit was merged in pull request #226.
This commit is contained in:
Defame1297 committed 2026-11-26 18:58:00 +00:00
commit bf86679d42
11 files changed
+58 -43

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@
{ {
"name": "delivery", "name": "delivery",
"description": "Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.", "description": "Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.",
"version": "0.7.0", "version": "0.8.0",
"category": "Developer Tools", "category": "Developer Tools",
"source": "./plugins/delivery" "source": "./plugins/delivery"
}, },
+1 -1
View File
@@ -73,7 +73,7 @@ executables:
bin: true bin: true
# delivery ships the guard hook (ADR-0032 enforcement layer 2). Same # delivery ships the guard hook (ADR-0032 enforcement layer 2). Same
# version-in-key convention as above, kept by the same sync check. # version-in-key convention as above, kept by the same sync check.
delivery#0.7.0: delivery#0.8.0:
hooks: true hooks: true
marketplace: marketplace:
@@ -119,11 +119,12 @@ with blocking findings. On a PR, the issue is the one its body's `Closes #<n>` n
- `stop` → Stop with its reason: a missing or malformed check is not the implementer's to fix. - `stop` → Stop with its reason: a missing or malformed check is not the implementer's to fix.
9. Run `delivery-handoff` Step 5: one Handoff comment on the PR, Decisions and Rejected taken from 9. Run `delivery-handoff` Step 5: one Handoff comment on the PR, Decisions and Rejected taken from
the role agents' reports and every step 6 and step 7 verdict, Evidence linking the PR, the the role agents' reports and every step 6 and step 7 verdict, Evidence linking the PR, the
commits and the CI runs QA cited, and Open questions one line "awaiting human gate: `<check>`" commits and the CI runs QA cited, and Open questions one line "human gate: `<check>` —
per name on QA's last `awaiting-gate` line (else `none`). Then remove the `WIP:` prefix from `<state>`", plus ": `<cause>`" for a `gated-failure`, per name on QA's last `human-gate` line
the PR title with `gitea-prs`, which makes the PR eligible for the review stage. The comment (else `none`). Then remove the `WIP:` prefix from the PR title with `gitea-prs`, which makes the
goes first so a crash between the two leaves a recorded hand-off on a PR still in `WIP:`, never PR eligible for the review stage. The comment goes first so a crash between the two leaves a
a review-eligible PR with no Handoff comment for the reviewer's Required inbound check. recorded hand-off on a PR still in `WIP:`, never a review-eligible PR with no Handoff comment for
the reviewer's Required inbound check.
## Output ## Output
@@ -34,26 +34,27 @@ the tool skill names.
2. Load each tool skill the lead named, then invoke `delivery-ci-checks` to read the head commit's 2. Load each tool skill the lead named, then invoke `delivery-ci-checks` to read the head commit's
check results. Its verdict maps to yours: `pending` → `pending`; `fail` → `fail`, the failed check results. Its verdict maps to yours: `pending` → `pending`; `fail` → `fail`, the failed
run linked; `missing` (a listed check never reported) or `malformed: <reason>` → `stop`, because run linked; `missing` (a listed check never reported) or `malformed: <reason>` → `stop`, because
no implementer commit can fix either. `awaiting-gate` rows are never a fail: list them under no implementer commit can fix either. `awaiting-gate` and `gated-failure` rows are never a
`awaiting-gate` and judge the rest. fail, because only a human can clear a gated dry run: list each under `human-gate` with its
state and cause, and judge the rest.
3. With CI green, judge against this checklist; each miss is a finding: 3. With CI green, judge against this checklist; each miss is a finding:
- Every acceptance criterion is met by a check that actually exercises it, not one that would - Every acceptance criterion is met by a check that actually exercises it, not one that would
pass without the change. pass without the change.
- Edge cases the ticket implies that no check covers. - Edge cases the ticket implies that no check covers.
- Every `dry-run` and `dry-run-gated` check that has output: its diff or render does what the - Every `dry-run` and `dry-run-gated` check in state `success`: its diff or render does what the
ticket meant — read it. ticket meant — read it. A `gated-failure` log is the human's to read, never a finding.
- Idempotence, and effects check mode cannot simulate, are covered or named as post-merge - Idempotence, and effects check mode cannot simulate, are covered or named as post-merge
assertions. assertions.
- No test was weakened, skipped or deleted since the test author's commit. - No test was weakened, skipped or deleted since the test author's commit.
- Every `skipped` status is legitimately path-filtered: its workflow's paths do not match the - Every `skipped` status is legitimately path-filtered: its workflow's paths do not match the
diff. A gated check never reaches you as `skipped`; `delivery-ci-checks` reports it as diff. A gated check never reaches you as `skipped`; `delivery-ci-checks` reports it as
`awaiting-gate`. `awaiting-gate` or `gated-failure`.
## Output ## Output
```text ```text
verdict: pass | fail | pending | stop verdict: pass | fail | pending | stop
awaiting-gate: <comma-separated check names> | none human-gate: <check> — <awaiting-gate | gated-failure: <cause>>; … | none
findings: findings:
- <what is wrong or uncovered> — <link> - <what is wrong or uncovered> — <link>
``` ```
@@ -9,7 +9,7 @@ compatibility: Requires a Gitea forge with Actions reached through the Gitea MCP
allowed-tools: Read mcp__gitea__pull_request_read mcp__gitea__commit_read mcp__gitea__actions_run_read allowed-tools: Read mcp__gitea__pull_request_read mcp__gitea__commit_read mcp__gitea__actions_run_read
metadata: metadata:
category: delivery category: delivery
version: "0.2.0" version: "0.3.0"
--- ---
## Gotchas ## Gotchas
@@ -21,7 +21,8 @@ metadata:
- Match check names verbatim, event suffix included: `Lint / lint (push)` is not - Match check names verbatim, event suffix included: `Lint / lint (push)` is not
`Lint / lint (pull_request)`. Never fuzzy-match or substitute a similar name. `Lint / lint (pull_request)`. Never fuzzy-match or substitute a similar name.
- `skipped` counts as passing (path-filtered workflows report it). A listed check with no status on - `skipped` counts as passing (path-filtered workflows report it). A listed check with no status on
the commit is never passing; only a `dry-run-gated` one is excused, as `awaiting-gate`. the commit is never passing; only a `dry-run-gated` one is excused, as `awaiting-gate`. A
gated check's failure is `gated-failure`, also passing: a human reads it, never the implementer.
- Never add, remove or re-add a dry run's gate label: it is the human gate. - Never add, remove or re-add a dry run's gate label: it is the human gate.
## Step 1 — Read the listed checks ## Step 1 — Read the listed checks
@@ -52,34 +53,35 @@ Only statuses on this SHA count; an older commit's are stale and ignored.
Read `references/statuses.md` now. Read the pinned SHA's statuses with Read `references/statuses.md` now. Read the pinned SHA's statuses with
`mcp__gitea__commit_read` method `get_status`, `ref` set to the SHA, and classify each listed `mcp__gitea__commit_read` method `get_status`, `ref` set to the SHA, and classify each listed
check as `success`, `failure`, `skipped`, `pending`, `missing` or `awaiting-gate` per its check as `success`, `failure`, `skipped`, `pending`, `missing`, `awaiting-gate` or
mapping and §Gated dry runs. `gated-failure` per its mapping and §Gated dry runs.
Re-read while any listed check is `pending`, or while no ungated listed check has reported yet; Re-read while any listed check is `pending`, or while no ungated listed check has reported yet;
never for an `awaiting-gate` check. With a caller-supplied list, also re-read while any is never for an `awaiting-gate` or `gated-failure` check. With a caller-supplied list, also re-read
`missing`: workflows on a fresh commit start late. Each re-read passes `wait_seconds: 45`. For a while any is `missing`: workflows on a fresh commit start late. Each re-read passes
PR, re-read `head.sha` first; if it moved, go back to Step 2 with the new SHA. The hard cap, across `wait_seconds: 45`. For a PR, re-read `head.sha` first; if it moved, go back to Step 2 with the
all SHAs, is **20 reads, about 15 minutes**. A caller's wait cap in minutes replaces it: the new SHA. The hard cap, across all SHAs, is **20 reads, about 15 minutes**. A caller's wait cap in
caller's minutes, at most ⌈minutes×4/3⌉ reads, whichever comes first. At the cap, report what you minutes replaces it: the caller's minutes, at most ⌈minutes×4/3⌉ reads, whichever comes first. At
have; never wait past it. the cap, report what you have; never wait past it.
## Step 4 — Explain failures ## Step 4 — Explain failures
For each `failure`, write its one-line cause per `references/statuses.md` §Failure cause. For each `failure` and `gated-failure`, write its one-line cause per `references/statuses.md`
§Failure cause.
## Step 5 — Return the result ## Step 5 — Return the result
Overall verdict, first match wins: any `failure` → `fail`; any `missing` → `missing`; any Overall verdict, first match wins: any `failure` → `fail`; any `missing` → `missing`; any
`pending` → `pending`; else → `pass`. `awaiting-gate` passes like `skipped`. `pending` → `pending`; else → `pass`. `awaiting-gate` and `gated-failure` pass like `skipped`.
Output format: Output format:
```text ```text
Commit: <full SHA> Verdict: <pass|fail|pending|missing> Commit: <full SHA> Verdict: <pass|fail|pending|missing>
Awaiting gate: <comma-separated check names> | none Human gate: <name> (<awaiting-gate|gated-failure>), … | none
| Check | Role | State | Run | Cause | | Check | Role | State | Run | Cause |
``` ```
One row per listed check, in the doc's or the caller's order. `Run` is the absolute job link, or One row per listed check, in the doc's or the caller's order. `Run` is the absolute job link, or
`none` for a check with no job. `Cause` is the one-line failure cause, else empty. On `pending` or `none` for a check with no job. `Cause` is the one-line cause of a `failure` or `gated-failure`,
`missing` the caller decides what follows; you do not. else empty. On `pending` or `missing` the caller decides what follows; you do not.
@@ -26,7 +26,8 @@
|---|---| |---|---|
| `success` | `success` | | `success` | `success` |
| `skipped` | `skipped`, passing | | `skipped` | `skipped`, passing |
| `failure`, `error`, `warning` | `failure` | | `failure`, `error`, `warning`, role `dry-run-gated` | `gated-failure`, passing |
| `failure`, `error`, `warning`, any other role | `failure` |
| `pending` (Gitea Actions reports queued and running jobs as this), any other value | `pending` | | `pending` (Gitea Actions reports queued and running jobs as this), any other value | `pending` |
| no status whose `context` equals the listed name, role `dry-run-gated` | `awaiting-gate`, passing | | no status whose `context` equals the listed name, role `dry-run-gated` | `awaiting-gate`, passing |
| no status whose `context` equals the listed name, any other role | `missing` | | no status whose `context` equals the listed name, any other role | `missing` |
@@ -34,20 +35,28 @@
When two statuses share a `context`, use the one with the latest `updated_at`. For role When two statuses share a `context`, use the one with the latest `updated_at`. For role
`dry-run-gated`, ignore its `skipped` statuses first and take the latest of the rest; none left → `dry-run-gated`, ignore its `skipped` statuses first and take the latest of the rest; none left →
`awaiting-gate`. A gated job whose label condition is unmet posts `skipped`, and a later label `awaiting-gate`. A gated job whose label condition is unmet posts `skipped`, and a later label
event on the same SHA posts a newer `skipped` that would otherwise mask an earlier gated event on the same SHA posts a newer `skipped` that would otherwise mask an earlier
`failure`. `gated-failure`.
## Gated dry runs ## Gated dry runs
- `awaiting-gate` is a `dry-run-gated` check with no non-`skipped` status on the pinned SHA: no - `awaiting-gate` is a `dry-run-gated` check with no non-`skipped` status on the pinned SHA: no
human has added its label yet, and only a human can, so waiting for it is pointless. It is never human has added its label yet, and only a human can, so waiting for it is pointless. It is never
`missing`. `missing`.
- A gated check that has a `pending`, `failure` or `success` status is classified like any other - A gated check whose latest non-`skipped` status is `pending` or `success` is classified like any
check. other check.
- Only the delivery doc gives roles, so a caller-supplied list never yields `awaiting-gate`. - `gated-failure` is a gated check whose latest non-`skipped` status is `failure`, `error` or
`warning`. The workflow may fail on purpose while it awaits its label, or the dry run itself may
have failed; either way a human reads it, never the implementer, and it is never waited on. Its
`Run` is the job link and its `Cause` follows §Failure cause, e.g. "Awaiting the Dry run label
from an allowlisted human" or "Infrastructure error in at least one stage".
- Only the delivery doc gives roles, so a caller-supplied list never yields `awaiting-gate` or
`gated-failure`.
- A gated status on an older commit is stale like any other. The label is needed fresh per push, - A gated status on an older commit is stale like any other. The label is needed fresh per push,
so after a push the check is `awaiting-gate` again until a human re-adds it. so after a push the check is `awaiting-gate` again until a human re-adds it.
- The `Awaiting gate:` line names every `awaiting-gate` row, else `none`. - The `Human gate:` line names every `awaiting-gate` and `gated-failure` row with its state, e.g.
`Human gate: Ansible Dry Run / ansible_dry_run (pull_request_target) (gated-failure)`, else
`none`.
## Links ## Links
@@ -9,7 +9,7 @@ compatibility: Requires git and a forge remote. Gitea needs the Gitea MCP server
allowed-tools: Bash Read Write Edit allowed-tools: Bash Read Write Edit
metadata: metadata:
category: delivery category: delivery
version: "0.3.0" version: "0.4.0"
--- ---
## Gotchas ## Gotchas
@@ -53,10 +53,10 @@ syntax. A format change is an edit here, plus every consumer's restatement.
`other`. `other`.
- `dry-run` appears on one or more items unless the section is `- none`. `test-path` appears on at - `dry-run` appears on one or more items unless the section is `- none`. `test-path` appears on at
most one item, and on exactly one when the repo has a test-path check. most one item, and on exactly one when the repo has a test-path check.
- `dry-run-gated` (zero or more items) is a dry run that posts its status only after a user on the - `dry-run-gated` (zero or more items) is a dry run that runs only after a user on the human
human allowlist adds a label to the PR. Its workflow runs only on that one named gate label, so allowlist adds its gate label to the PR. Until then its status on the head commit may be absent,
no other label event starts it. Until then its status is absent or `skipped` on the head commit, `skipped` or a failure, and other events may post a status that does not reflect a dry run.
and consumers read either as awaiting the human gate, not as missing or passing. Consumers never send its failure to the implementer: a human reads it.
- Whatever its role, except `dry-run-gated`, a consumer treats a check reported as "skipped" (a - Whatever its role, except `dry-run-gated`, a consumer treats a check reported as "skipped" (a
path-filtered workflow whose paths did not match) as passing. path-filtered workflow whose paths did not match) as passing.
@@ -9,7 +9,7 @@ compatibility: Requires a Gitea forge with Actions reached through the Gitea MCP
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 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: metadata:
category: delivery category: delivery
version: "0.2.0" version: "0.3.0"
--- ---
## Gotchas ## Gotchas
@@ -141,7 +141,9 @@ Apply this to every `dry-run` and `dry-run-gated` row in the `delivery-ci-checks
row (its CI checks are `- none`) → add nothing. `failure` is already a blocking finding from row (its CI checks are `- none`) → add nothing. `failure` is already a blocking finding from
check 1. `skipped` → no output to judge; add nothing. `awaiting-gate` → non-blocking, "gated dry check 1. `skipped` → no output to judge; add nothing. `awaiting-gate` → non-blocking, "gated dry
run `<name>` has not run yet; the approver judges its output once it does", linking run `<name>` has not run yet; the approver judges its output once it does", linking
`<PR html_url>/files`. `<PR html_url>/files`. `gated-failure` → non-blocking, never sent back to the implementer: "gated
dry run `<name>` did not pass: `<cause>`; the approver reads it before approving", linking its
`Run` job link.
`success` → read its job log: `success` → read its job log:
```text ```text
+1 -1
View File
@@ -1,5 +1,5 @@
name: delivery name: delivery
version: 0.7.0 version: 0.8.0
description: Agents and skills for taking a change from spec to a verified merge through tracker-gated stages. description: Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.
author: author:
name: Mortis name: Mortis