From 244f4de1bd63fc88fb9972069e4e9440ec07947b Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 26 Nov 2026 18:36:09 +0000 Subject: [PATCH 1/2] feat(delivery): read a failing dry-run-gated check as a human gate A gated dry run fails on purpose while it awaits its label, and no bot commit can satisfy a gate that needs a fresh human label per push, so sending its failure to the implementer loops. delivery-ci-checks now classifies a failure, error or warning on a dry-run-gated check as gated-failure: passing, never waited on, with its job link and one-line log cause. The Awaiting gate line becomes Human gate, carrying each check's state. The 0.7.0 rule ignoring skipped statuses on a gated check is unchanged. qa never fails on a gated-failure and reads dry-run output only on success; its human-gate line feeds the implement lead's Open questions. Review check 7 records a gated-failure as a non-blocking finding for the approver. The format's dry-run-gated definition is loosened to allow a failing status before the label. Refs: #225 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi --- .../agents/delivery-implement-lead.agent.md | 11 ++++--- .../delivery/.apm/agents/delivery-qa.agent.md | 13 ++++---- .../.apm/skills/delivery-ci-checks/SKILL.md | 32 ++++++++++--------- .../delivery-ci-checks/references/statuses.md | 23 +++++++++---- .../.apm/skills/delivery-repo-doc/SKILL.md | 2 +- .../delivery-repo-doc/references/format.md | 8 ++--- .../.apm/skills/delivery-review/SKILL.md | 2 +- .../delivery-review/references/checklist.md | 4 ++- plugins/delivery/apm.yml | 2 +- 9 files changed, 56 insertions(+), 41 deletions(-) diff --git a/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md b/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md index 38b6ef4..5335b32 100644 --- a/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md +++ b/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md @@ -119,11 +119,12 @@ with blocking findings. On a PR, the issue is the one its body's `Closes #` n - `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 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: ``" - per name on QA's last `awaiting-gate` line (else `none`). Then remove the `WIP:` prefix from - the PR title with `gitea-prs`, which makes the PR eligible for the review stage. The comment - goes first so a crash between the two leaves a 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. + commits and the CI runs QA cited, and Open questions one line "human gate: `` — + ``", plus ": ``" for a `gated-failure`, per name on QA's last `human-gate` line + (else `none`). Then remove the `WIP:` prefix from the PR title with `gitea-prs`, which makes the + PR eligible for the review stage. The comment goes first so a crash between the two leaves a + 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 diff --git a/plugins/delivery/.apm/agents/delivery-qa.agent.md b/plugins/delivery/.apm/agents/delivery-qa.agent.md index 5dad0e4..04a1f0d 100644 --- a/plugins/delivery/.apm/agents/delivery-qa.agent.md +++ b/plugins/delivery/.apm/agents/delivery-qa.agent.md @@ -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 check results. Its verdict maps to yours: `pending` → `pending`; `fail` → `fail`, the failed run linked; `missing` (a listed check never reported) or `malformed: ` → `stop`, because - no implementer commit can fix either. `awaiting-gate` rows are never a fail: list them under - `awaiting-gate` and judge the rest. + no implementer commit can fix either. `awaiting-gate` and `gated-failure` rows are never a + 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: - Every acceptance criterion is met by a check that actually exercises it, not one that would pass without the change. - 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 - ticket meant — read it. + - Every `dry-run` and `dry-run-gated` check in state `success`: its diff or render does what the + 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 assertions. - 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 diff. A gated check never reaches you as `skipped`; `delivery-ci-checks` reports it as - `awaiting-gate`. + `awaiting-gate` or `gated-failure`. ## Output ```text verdict: pass | fail | pending | stop -awaiting-gate: | none +human-gate: — >; … | none findings: - — ``` diff --git a/plugins/delivery/.apm/skills/delivery-ci-checks/SKILL.md b/plugins/delivery/.apm/skills/delivery-ci-checks/SKILL.md index 245faa1..3c1a4d6 100644 --- a/plugins/delivery/.apm/skills/delivery-ci-checks/SKILL.md +++ b/plugins/delivery/.apm/skills/delivery-ci-checks/SKILL.md @@ -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 metadata: category: delivery - version: "0.2.0" + version: "0.3.0" --- ## Gotchas @@ -21,7 +21,8 @@ metadata: - Match check names verbatim, event suffix included: `Lint / lint (push)` is not `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 - 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. ## 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 `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 -mapping and §Gated dry runs. +check as `success`, `failure`, `skipped`, `pending`, `missing`, `awaiting-gate` or +`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; -never for an `awaiting-gate` check. With a caller-supplied list, also re-read while any is -`missing`: workflows on a fresh commit start late. Each re-read passes `wait_seconds: 45`. For a -PR, re-read `head.sha` first; if it moved, go back to Step 2 with the new SHA. The hard cap, across -all SHAs, is **20 reads, about 15 minutes**. A caller's wait cap in minutes replaces it: the -caller's minutes, at most ⌈minutes×4/3⌉ reads, whichever comes first. At the cap, report what you -have; never wait past it. +never for an `awaiting-gate` or `gated-failure` check. With a caller-supplied list, also re-read +while any is `missing`: workflows on a fresh commit start late. Each re-read passes +`wait_seconds: 45`. For a PR, re-read `head.sha` first; if it moved, go back to Step 2 with the +new SHA. The hard cap, across all SHAs, is **20 reads, about 15 minutes**. A caller's wait cap in +minutes replaces it: the caller's minutes, at most ⌈minutes×4/3⌉ reads, whichever comes first. At +the cap, report what you have; never wait past it. ## 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 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: ```text Commit: Verdict: -Awaiting gate: | none +Human gate: (), … | none | 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 -`none` for a check with no job. `Cause` is the one-line failure cause, else empty. On `pending` or -`missing` the caller decides what follows; you do not. +`none` for a check with no job. `Cause` is the one-line cause of a `failure` or `gated-failure`, +else empty. On `pending` or `missing` the caller decides what follows; you do not. diff --git a/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md b/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md index 597e330..574f137 100644 --- a/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md +++ b/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md @@ -26,7 +26,8 @@ |---|---| | `success` | `success` | | `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` | | 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` | @@ -34,20 +35,28 @@ 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 → `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 -`failure`. +event on the same SHA posts a newer `skipped` that would otherwise mask an earlier +`gated-failure`. ## Gated dry runs - `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 `missing`. -- A gated check that has a `pending`, `failure` or `success` status is classified like any other - check. -- Only the delivery doc gives roles, so a caller-supplied list never yields `awaiting-gate`. +- A gated check whose latest non-`skipped` status is `pending` or `success` is classified like any + other check. +- `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, 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 diff --git a/plugins/delivery/.apm/skills/delivery-repo-doc/SKILL.md b/plugins/delivery/.apm/skills/delivery-repo-doc/SKILL.md index 9ccfb0e..243bcf2 100644 --- a/plugins/delivery/.apm/skills/delivery-repo-doc/SKILL.md +++ b/plugins/delivery/.apm/skills/delivery-repo-doc/SKILL.md @@ -9,7 +9,7 @@ compatibility: Requires git and a forge remote. Gitea needs the Gitea MCP server allowed-tools: Bash Read Write Edit metadata: category: delivery - version: "0.3.0" + version: "0.4.0" --- ## Gotchas diff --git a/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md b/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md index a8861b6..86f99df 100644 --- a/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md +++ b/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md @@ -53,10 +53,10 @@ syntax. A format change is an edit here, plus every consumer's restatement. `other`. - `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. -- `dry-run-gated` (zero or more items) is a dry run that posts its status only after a user on the - human allowlist adds a label to the PR. Its workflow runs only on that one named gate label, so - no other label event starts it. Until then its status is absent or `skipped` on the head commit, - and consumers read either as awaiting the human gate, not as missing or passing. +- `dry-run-gated` (zero or more items) is a dry run that runs only after a user on the human + allowlist adds its gate label to the PR. Until then its status on the head commit may be absent, + `skipped` or a failure, and other events may post a status that does not reflect a dry run. + 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 path-filtered workflow whose paths did not match) as passing. diff --git a/plugins/delivery/.apm/skills/delivery-review/SKILL.md b/plugins/delivery/.apm/skills/delivery-review/SKILL.md index e93e1e6..63da813 100644 --- a/plugins/delivery/.apm/skills/delivery-review/SKILL.md +++ b/plugins/delivery/.apm/skills/delivery-review/SKILL.md @@ -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 metadata: category: delivery - version: "0.2.0" + version: "0.3.0" --- ## Gotchas diff --git a/plugins/delivery/.apm/skills/delivery-review/references/checklist.md b/plugins/delivery/.apm/skills/delivery-review/references/checklist.md index 61c0700..5e37307 100644 --- a/plugins/delivery/.apm/skills/delivery-review/references/checklist.md +++ b/plugins/delivery/.apm/skills/delivery-review/references/checklist.md @@ -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 check 1. `skipped` → no output to judge; add nothing. `awaiting-gate` → non-blocking, "gated dry run `` has not run yet; the approver judges its output once it does", linking -`/files`. +`/files`. `gated-failure` → non-blocking, never sent back to the implementer: "gated +dry run `` did not pass: ``; the approver reads it before approving", linking its +`Run` job link. `success` → read its job log: ```text diff --git a/plugins/delivery/apm.yml b/plugins/delivery/apm.yml index 1794fd3..33a6f4b 100644 --- a/plugins/delivery/apm.yml +++ b/plugins/delivery/apm.yml @@ -1,5 +1,5 @@ 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. author: name: Mortis -- 2.43.0 From 0d53fc69819835763b9a0f78b3e87c468a50b98e Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 26 Nov 2026 18:36:27 +0000 Subject: [PATCH 2/2] chore(marketplace): record delivery 0.8.0 The guard hook is unchanged; the executables.allow key and the regenerated marketplace.json follow the package version bump. Refs: #225 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi --- .claude-plugin/marketplace.json | 2 +- apm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index db42739..ca8af15 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -59,7 +59,7 @@ { "name": "delivery", "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", "source": "./plugins/delivery" }, diff --git a/apm.yml b/apm.yml index fb17e53..bcb2d38 100644 --- a/apm.yml +++ b/apm.yml @@ -73,7 +73,7 @@ executables: bin: true # delivery ships the guard hook (ADR-0032 enforcement layer 2). Same # version-in-key convention as above, kept by the same sync check. - delivery#0.7.0: + delivery#0.8.0: hooks: true marketplace: -- 2.43.0