fix(delivery): close the skipped-gate hole in dry-run-gated

A gated workflow whose job-level label condition is unmet posts
skipped, and a later label event on the same SHA posts a newer skipped
that would mask an earlier gated failure. delivery-ci-checks now
ignores skipped statuses for a dry-run-gated check and takes the latest
of the rest, reading none as awaiting-gate. The format exempts
dry-run-gated from the skipped-passes rule and requires the workflow
to run only on its named gate label; the gatherer confirms that filter
and takes a gated check's name from the forge or lists it as open.

The review's awaiting-gate finding links the PR's files view, the
implement lead and delivery-handoff name the gated dry run's label as
human-only, and qa's and the lead's restatements are trimmed.

Refs: #218

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-11-25 09:22:36 +00:00
1 parent a96b6134a5
commit 42301cf38e
7 files changed
+37 -27

No files matched your search

@@ -17,9 +17,10 @@ they do the work.
- Never edit, create or delete a file — not with a file tool and not through the shell (`>`, `tee`, - Never edit, create or delete a file — not with a file tool and not through the shell (`>`, `tee`,
`sed -i`, `git mv`, `git rm`). Every change to the repo is a role agent's commit. `sed -i`, `git mv`, `git rm`). Every change to the repo is a role agent's commit.
- Never set, add or remove a Gate label (`Status/Ready for Agent`), never approve or merge a PR, and - Never set, add or remove a Gate label (`Status/Ready for Agent`) or a gated dry run's label, never
never mark the PR ready except by removing `WIP:` after `delivery-qa` returns `pass`. Gates are approve or merge a PR, and never mark the PR ready except by removing `WIP:` after `delivery-qa`
human approval recorded in the tracker; an agent that sets one approves its own work. returns `pass`. Gates are human approval recorded in the tracker; an agent that sets one approves
its own work.
- Never tell a role agent to relax one of its rules. Your delegation prompt overrides its body, so a - Never tell a role agent to relax one of its rules. Your delegation prompt overrides its body, so a
prompt that says "edit the test" or "skip the hook" removes the guard. Pass inputs, not policy. prompt that says "edit the test" or "skip the hook" removes the guard. Pass inputs, not policy.
- Never run apply-by-merge, odd-job or Never-tier commands (ADR-0032), and never read secret - Never run apply-by-merge, odd-job or Never-tier commands (ADR-0032), and never read secret
@@ -113,8 +114,7 @@ with blocking findings. On a PR, the issue is the one its body's `Closes #<n>` n
`## Acceptance checks` block and the skill names. `## Acceptance checks` block and the skill names.
- `pass` → step 9. - `pass` → step 9.
- `fail` → back to step 7 with its findings. After the third `fail` this session → Stop with - `fail` → back to step 7 with its findings. After the third `fail` this session → Stop with
"QA failed 3 rounds" and the last findings. An `awaiting-gate` name is never a fail and never "QA failed 3 rounds" and the last findings.
counts toward this limit.
- `pending` → Stop with "CI still running". - `pending` → Stop with "CI still running".
- `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
@@ -34,9 +34,8 @@ 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. An `awaiting-gate` row is a `dry-run-gated` check no human no implementer commit can fix either. `awaiting-gate` rows are never a fail: list them under
has started yet: it is never a fail and never `missing`; list its name under `awaiting-gate` and `awaiting-gate` and judge the rest.
judge the rest. A gated check that ran is judged like any other row.
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.
@@ -47,7 +46,8 @@ the tool skill names.
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. diff. A gated check never reaches you as `skipped`; `delivery-ci-checks` reports it as
`awaiting-gate`.
## Output ## Output
@@ -31,18 +31,22 @@
| 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` |
When two statuses share a `context`, use the one with the latest `updated_at`. 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`.
## Gated dry runs ## Gated dry runs
- `awaiting-gate` is a `dry-run-gated` check with no status on the pinned SHA: no human has added - `awaiting-gate` is a `dry-run-gated` check with no non-`skipped` status on the pinned SHA: no
its label yet, and only a human can, so waiting for it is pointless. It is never `missing`. human has added its label yet, and only a human can, so waiting for it is pointless. It is never
- A gated check that has a status (`pending`, `failure`, `success`, `skipped`) is classified like `missing`.
any other check. - 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`. - Only the delivery doc gives roles, so a caller-supplied list never yields `awaiting-gate`.
- 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. Adding, removing or so after a push the check is `awaiting-gate` again until a human re-adds it.
re-adding it is the human's act, never yours.
- The `Awaiting gate:` line names every `awaiting-gate` row, else `none`. - The `Awaiting gate:` line names every `awaiting-gate` row, else `none`.
## Links ## Links
@@ -9,14 +9,14 @@ compatibility: Requires a Gitea forge reached through the Gitea MCP server (via
allowed-tools: Read mcp__gitea__issue_read mcp__gitea__issue_write mcp__gitea__pull_request_read allowed-tools: Read mcp__gitea__issue_read mcp__gitea__issue_write mcp__gitea__pull_request_read
metadata: metadata:
category: delivery category: delivery
version: "0.2.1" version: "0.2.2"
--- ---
## Gotchas ## Gotchas
- `Status/Ready for Human` is a stop signal, not a Gate, so you may set it. Every real gate — - `Status/Ready for Human` is a stop signal, not a Gate, so you may set it. Every real gate —
`Status/Ready for Agent`, a PR approval — is human-only: never set, add or remove a gate label, `Status/Ready for Agent`, a gated dry run's label, a PR approval — is human-only: never set, add
and never approve a PR. or remove a gate label, and never approve a PR.
- Check gate *state*, not who set it: in step mode the human launching your stage is the approval. - Check gate *state*, not who set it: in step mode the human launching your stage is the approval.
Do not read the issue timeline. Do not read the issue timeline.
- `Status/Ready for Agent` and `Status/Ready for Human` must not share an exclusive label scope: - `Status/Ready for Agent` and `Status/Ready for Human` must not share an exclusive label scope:
@@ -54,10 +54,11 @@ syntax. A format change is an edit here, plus every consumer's restatement.
- `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 posts its status only after a user on the
human allowlist adds a label to the PR. Until then its status is absent from the head commit, and human allowlist adds a label to the PR. Its workflow runs only on that one named gate label, so
consumers read that as awaiting the human gate, not as missing. no other label event starts it. Until then its status is absent or `skipped` on the head commit,
- Whatever its role, a consumer treats a check reported as "skipped" (a path-filtered workflow and consumers read either as awaiting the human gate, not as missing or passing.
whose paths did not match) as passing. - 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.
### 3. Test paths ### 3. Test paths
@@ -35,6 +35,9 @@ repo; facts only a human holds come from the human. A value with no source stays
`Delivery-Stage: test-author` commit touches the test globs. `dry-run` and `dry-run-gated` `Delivery-Stage: test-author` commit touches the test globs. `dry-run` and `dry-run-gated`
come from the human: a dry run whose workflow waits for a label (a `labeled` trigger or a come from the human: a dry run whose workflow waits for a label (a `labeled` trigger or a
label condition on the job) is a `dry-run-gated` candidate to confirm, never assigned unasked. label condition on the job) is a `dry-run-gated` candidate to confirm, never assigned unasked.
A gated check's name must come from the forge, read on a PR where the gated job ran (step 3).
With no such PR, list it as open in the PR body instead: a wrong name stays `awaiting-gate`
forever and never blocks.
### Test paths ### Test paths
@@ -74,9 +77,10 @@ SKILL.md Step 3 asks for these:
- Bot user the agents act as. - Bot user the agents act as.
- Read-only kubeconfig path, or "no cluster". - Read-only kubeconfig path, or "no cluster".
- Branch-protection status: in place, or pending with the tracking link. - Branch-protection status: in place, or pending with the tracking link.
- Which CI checks are dry runs, and which of those are label-gated: they post a status only after - Which CI checks are dry runs, and which of those are label-gated: they post a status only after an
an allowlisted human adds a label. A repo with PR checks but no ungated dry-run check is not allowlisted human adds a label. For each gated one, confirm its workflow runs only on that one
ready for the delivery team: say so in the PR body as open and stop. named label (the filter read from the workflow). A repo with PR checks but no ungated dry-run
check is not ready for the delivery team: say so in the PR body as open and stop.
- Test-path globs, when no globs file exists (confirm the derived list). - Test-path globs, when no globs file exists (confirm the derived list).
- Post-merge items for a push workflow with no path filter (confirm the derived directories). - Post-merge items for a push workflow with no path filter (confirm the derived directories).
- Accepted risks: the ADR or issue links, or "none". - Accepted risks: the ADR or issue links, or "none".
@@ -140,7 +140,8 @@ be encrypted and is not is itself the finding.
Apply this to every `dry-run` and `dry-run-gated` row in the `delivery-ci-checks` table. No such Apply this to every `dry-run` and `dry-run-gated` row in the `delivery-ci-checks` table. No such
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", with no job link. run `<name>` has not run yet; the approver judges its output once it does", linking
`<PR html_url>/files`.
`success` → read its job log: `success` → read its job log:
```text ```text