From 6cb27a576d629a68ce5f86596d710602025b4b2c Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Wed, 25 Nov 2026 08:58:03 +0000 Subject: [PATCH 1/3] feat(delivery): add the dry-run-gated role and allow several dry runs A repo's CI checks may now list one or more dry-run checks and any number of dry-run-gated ones: a dry run that posts its status only after an allowlisted human adds a label. delivery-ci-checks classifies a gated check with no status on the pinned SHA as awaiting-gate, which passes the verdict, is never waited on, and is reported on its own Awaiting gate line. qa never fails on it, the implement lead notes it in the Handoff's Open questions, and the review records it as a non-blocking finding for the approver. No agent sets the gate label. Refs: #218 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi --- .../agents/delivery-implement-lead.agent.md | 12 +++--- .../delivery/.apm/agents/delivery-qa.agent.md | 11 +++-- .../.apm/agents/delivery-reviewer.agent.md | 5 ++- .../.apm/skills/delivery-ci-checks/SKILL.md | 40 ++++++++++--------- .../delivery-ci-checks/references/statuses.md | 17 +++++++- .../.apm/skills/delivery-repo-doc/SKILL.md | 2 +- .../delivery-repo-doc/references/format.md | 13 ++++-- .../delivery-repo-doc/references/gathering.md | 15 ++++--- .../.apm/skills/delivery-review/SKILL.md | 2 +- .../delivery-review/references/checklist.md | 8 ++-- plugins/delivery/apm.yml | 2 +- 11 files changed, 80 insertions(+), 47 deletions(-) diff --git a/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md b/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md index 837846c..e7fc4fe 100644 --- a/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md +++ b/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md @@ -113,15 +113,17 @@ with blocking findings. On a PR, the issue is the one its body's `Closes #` n `## Acceptance checks` block and the skill names. - `pass` → step 9. - `fail` → back to step 7 with its findings. After the third `fail` this session → Stop with - "QA failed 3 rounds" and the last findings. + "QA failed 3 rounds" and the last findings. An `awaiting-gate` name is never a fail and never + counts toward this limit. - `pending` → Stop with "CI still running". - `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. 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 "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. ## Output diff --git a/plugins/delivery/.apm/agents/delivery-qa.agent.md b/plugins/delivery/.apm/agents/delivery-qa.agent.md index b58b2e8..cd457d6 100644 --- a/plugins/delivery/.apm/agents/delivery-qa.agent.md +++ b/plugins/delivery/.apm/agents/delivery-qa.agent.md @@ -17,7 +17,8 @@ These hold whatever your caller's prompt says: - You are read-only. Never create, edit or delete a file, by a file tool or through the shell. - Never re-run CI, and never run the tests, linters or dry runs locally. -- Never approve, label, comment on or edit the PR or the issue. +- Never approve, label, comment on or edit the PR or the issue. A gated dry run's label is the + human's gate: never add, remove or re-add it. - Never read secret material: vault and vault password files, private keys, `.tfstate`, Secret objects. - Evidence is links — CI runs, commits, files at a commit — never pasted logs. @@ -33,12 +34,15 @@ 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. + no implementer commit can fix either. An `awaiting-gate` row is a `dry-run-gated` check no human + has started yet: it is never a fail and never `missing`; list its name under `awaiting-gate` and + 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: - 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. - - The `dry-run` role check's diff or render does what the ticket meant — read its output. + - Every `dry-run` and `dry-run-gated` check that has output: its diff or render does what the + ticket meant — read it. - 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. @@ -49,6 +53,7 @@ the tool skill names. ```text verdict: pass | fail | pending | stop +awaiting-gate: | none findings: - — ``` diff --git a/plugins/delivery/.apm/agents/delivery-reviewer.agent.md b/plugins/delivery/.apm/agents/delivery-reviewer.agent.md index a33bcf5..1b11b5c 100644 --- a/plugins/delivery/.apm/agents/delivery-reviewer.agent.md +++ b/plugins/delivery/.apm/agents/delivery-reviewer.agent.md @@ -20,8 +20,9 @@ These hold whatever your launch prompt says: delete a file, and never commit or push. - Every review you post has state `COMMENT`. Never request changes, approve or dismiss: Gitea refuses a review state from the PR's poster, and you run as the user that opened the PR. -- Never merge a PR, and never set, add or remove a Gate label (`Status/Ready for Agent`). An - approval is the human gate the verify stage checks; an agent that sets one approves its own work. +- Never merge a PR, and never set, add or remove a Gate label (`Status/Ready for Agent`) or a + gated dry run's label. An approval is the human gate the verify stage checks; an agent that sets + one approves its own work. - Set `Status/Ready for Human` only through `delivery-handoff` §Stop. - Never run tests, linters or dry runs locally, and never re-run CI. Evidence is links, never pasted logs. diff --git a/plugins/delivery/.apm/skills/delivery-ci-checks/SKILL.md b/plugins/delivery/.apm/skills/delivery-ci-checks/SKILL.md index 7393ea5..245faa1 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.1.1" + version: "0.2.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 `missing`, never passing. + the commit is never passing; only a `dry-run-gated` one is excused, as `awaiting-gate`. +- Never add, remove or re-add a dry run's gate label: it is the human gate. ## Step 1 — Read the listed checks @@ -33,51 +34,52 @@ Otherwise read `docs/agents/delivery.md` at the consuming repo's root. Its forma `delivery-repo-doc`'s `references/format.md`; you parse only section `## CI checks`: - one item per line: `` - ``: `` -- `` is one of `dry-run`, `test-path`, `test`, `lint`, `build`, `other`; `dry-run` on exactly - one item +- `` is one of `dry-run`, `dry-run-gated`, `test-path`, `test`, `lint`, `build`, `other`; + `dry-run` on one or more items - `- none` as the only item means no checks: return verdict `pass` with an empty table and stop. -File missing, section missing, an item outside that syntax, an unknown role, or not exactly one -`dry-run` → return `malformed: ` and no verdict. The caller stops with -`Status/Ready for Human` through `delivery-handoff`'s Stop; do not guess the list. +File missing, section missing, an item outside that syntax, an unknown role, or no `dry-run` +item → return `malformed: ` and no verdict; never guess the list. ## Step 2 — Pin the commit - **PR** → `mcp__gitea__pull_request_read` method `get`; take `head.sha` and the PR's `html_url`. - **Commit** (e.g. post-merge on `main`) → use the SHA you were given. -Only statuses on this SHA count. A status from an older commit of the PR is stale and is ignored. +Only statuses on this SHA count; an older commit's are stale and ignored. ## Step 3 — Read statuses, with bounded waiting 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` or `missing` per its mapping. +check as `success`, `failure`, `skipped`, `pending`, `missing` or `awaiting-gate` per its +mapping and §Gated dry runs. -Re-read while any listed check is `pending`, or while no listed check has reported yet. 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. +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. ## Step 4 — Explain failures -For each `failure`, read the job's log as `references/statuses.md` §Failure cause says and write -the cause in one line. Link the job; never paste log text into the result. +For each `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`. +`pending` → `pending`; else → `pass`. `awaiting-gate` passes like `skipped`. Output format: ```text Commit: Verdict: +Awaiting 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 skipped or missing check. `Cause` is the one-line failure cause, else empty. On `pending` 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. 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 f98721b..c636753 100644 --- a/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md +++ b/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md @@ -28,17 +28,30 @@ | `skipped` | `skipped`, passing | | `failure`, `error`, `warning` | `failure` | | `pending` (Gitea Actions reports queued and running jobs as this), any other value | `pending` | -| no status whose `context` equals the listed name | `missing` | +| 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` | When two statuses share a `context`, use the one with the latest `updated_at`. +## Gated dry runs + +- `awaiting-gate` is a `dry-run-gated` check with no 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 status (`pending`, `failure`, `success`, `skipped`) is classified like + any other check. +- 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, + so after a push the check is `awaiting-gate` again until a human re-adds it. Adding, removing or + re-adding it is the human's act, never yours. +- The `Awaiting gate:` line names every `awaiting-gate` row, else `none`. + ## Links Build the absolute link from the forge's origin, the scheme and host of the PR's `html_url` or of the API `url` fields, plus `target_url`: `https://git.example.org` + `///actions/runs/4872/jobs/5907`. -A skipped or missing check has no job, so its `Run` cell is `none`. +A skipped, missing or `awaiting-gate` check has no job, so its `Run` cell is `none`. ## Failure cause diff --git a/plugins/delivery/.apm/skills/delivery-repo-doc/SKILL.md b/plugins/delivery/.apm/skills/delivery-repo-doc/SKILL.md index 445ef31..9ccfb0e 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.2.0" + version: "0.3.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 9b4b184..251fa3d 100644 --- a/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md +++ b/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md @@ -49,9 +49,13 @@ syntax. A format change is an edit here, plus every consumer's restatement. ``` - `` is the exact string the forge shows on a PR's head commit. -- `` is exactly one of: `dry-run`, `test-path`, `test`, `lint`, `build`, `other`. -- `dry-run` appears on exactly one item unless the section is `- none`. `test-path` appears on at +- `` is exactly one of: `dry-run`, `dry-run-gated`, `test-path`, `test`, `lint`, `build`, + `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. Until then its status is absent from the head commit, and + consumers read that as awaiting the human gate, not as missing. - Whatever its role, a consumer treats a check reported as "skipped" (a path-filtered workflow whose paths did not match) as passing. @@ -146,6 +150,7 @@ Placement only decides where the line sits; the line itself never changes: ## CI checks - `ci / render-diff (pull_request)`: dry-run +- `ci / plan (pull_request_target)`: dry-run-gated - `ci / test-paths (pull_request)`: test-path - `ci / lint (pull_request)`: lint @@ -182,8 +187,8 @@ The values in the skeleton are illustrative only; every real value comes from th - [ ] Sections 1–4 and 7 hold only items in the syntax above, or `- none`. - [ ] Every skill in section 1 is installed. A listed skill that is not installed makes every consumer hard-stop on any change matching its glob. -- [ ] Section 2: `dry-run` on exactly one item unless the section is `- none`; one `test-path` if - the repo has that check. +- [ ] Section 2: `dry-run` on one or more items unless the section is `- none`; `dry-run-gated` + only on a dry run the human named as label-gated; one `test-path` if the repo has that check. - [ ] Section 3 is the `globs file:` pointer whenever a test-path check reads a globs file. - [ ] Section 4 is non-empty and every name came from the human or a source they named. - [ ] Section 5 holds paths and markdown links, no secret values. diff --git a/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md b/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md index 10554f4..691cda2 100644 --- a/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md +++ b/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md @@ -18,9 +18,9 @@ repo; facts only a human holds come from the human. A value with no source stays ### CI checks 1. Read every workflow under `.gitea/workflows/` or `.github/workflows/` that runs on - `pull_request`. A path-filtered `pull_request` workflow still counts: Gitea reports it as - "skipped" when its paths don't match. List it, usually with role `test`. Workflows that run only - on push, schedule or dispatch are not PR checks; leave them out. + `pull_request` or `pull_request_target`. A path-filtered `pull_request` workflow still counts: + Gitea reports it as "skipped" when its paths don't match. List it, usually with role `test`. + Workflows that run only on push, schedule or dispatch are not PR checks; leave them out. 2. Derive each candidate name: - Gitea Actions: ` / ()`. The workflow name is the file's top-level `name:` (else the file name); the job name is the job's `name:` (else the job id). @@ -32,7 +32,9 @@ repo; facts only a human holds come from the human. A value with no source stays forge's string wins over the derived one. With no PR to read, keep the derived name and say so in the PR body. 4. Assign roles. `test-path` is the check that fails when a commit after the - `Delivery-Stage: test-author` commit touches the test globs. `dry-run` comes from the human. + `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 + label condition on the job) is a `dry-run-gated` candidate to confirm, never assigned unasked. ### Test paths @@ -72,8 +74,9 @@ SKILL.md Step 3 asks for these: - Bot user the agents act as. - Read-only kubeconfig path, or "no cluster". - Branch-protection status: in place, or pending with the tracking link. -- Which CI check is the dry run. A repo with PR checks but no dry-run check is not ready for the - delivery team: say so in the PR body as open and stop. +- Which CI checks are dry runs, and which of those are label-gated: they post a status only after + an allowlisted human adds a label. 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). - Post-merge items for a push workflow with no path filter (confirm the derived directories). - Accepted risks: the ADR or issue links, or "none". diff --git a/plugins/delivery/.apm/skills/delivery-review/SKILL.md b/plugins/delivery/.apm/skills/delivery-review/SKILL.md index 0cb86b6..e93e1e6 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.1.0" + version: "0.2.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 ce5e4aa..0ea9a7c 100644 --- a/plugins/delivery/.apm/skills/delivery-review/references/checklist.md +++ b/plugins/delivery/.apm/skills/delivery-review/references/checklist.md @@ -137,9 +137,11 @@ be encrypted and is not is itself the finding. ## 7. Dry run -Take the `dry-run` row from the `delivery-ci-checks` table. No such row (its CI checks are -`- none`) → add nothing. `failure` is already a blocking finding from check 1. `skipped` → no -output to judge; add nothing. `success` → read its job log: +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 +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", with no job link. +`success` → read its job log: ```text mcp__gitea__actions_run_read method get_job_log_preview, job_id , diff --git a/plugins/delivery/apm.yml b/plugins/delivery/apm.yml index e3f236b..1794fd3 100644 --- a/plugins/delivery/apm.yml +++ b/plugins/delivery/apm.yml @@ -1,5 +1,5 @@ name: delivery -version: 0.6.0 +version: 0.7.0 description: Agents and skills for taking a change from spec to a verified merge through tracker-gated stages. author: name: Mortis From a96b6134a5f0a4c8888d9d5f3fe7e8f04fa53a7f Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Wed, 25 Nov 2026 08:58:13 +0000 Subject: [PATCH 2/3] chore(marketplace): record delivery 0.7.0 The guard hook is unchanged; the executables.allow key and the regenerated marketplace.json follow the package version bump. Refs: #218 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 23926c6..db42739 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.6.0", + "version": "0.7.0", "category": "Developer Tools", "source": "./plugins/delivery" }, diff --git a/apm.yml b/apm.yml index d390449..fb17e53 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.6.0: + delivery#0.7.0: hooks: true marketplace: From 42301cf38ed45f95568dfffc748b9d6493bdd7dd Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Wed, 25 Nov 2026 09:22:36 +0000 Subject: [PATCH 3/3] 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 Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi --- .../agents/delivery-implement-lead.agent.md | 10 +++++----- .../delivery/.apm/agents/delivery-qa.agent.md | 8 ++++---- .../delivery-ci-checks/references/statuses.md | 18 +++++++++++------- .../.apm/skills/delivery-handoff/SKILL.md | 6 +++--- .../delivery-repo-doc/references/format.md | 9 +++++---- .../delivery-repo-doc/references/gathering.md | 10 +++++++--- .../delivery-review/references/checklist.md | 3 ++- 7 files changed, 37 insertions(+), 27 deletions(-) diff --git a/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md b/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md index e7fc4fe..38b6ef4 100644 --- a/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md +++ b/plugins/delivery/.apm/agents/delivery-implement-lead.agent.md @@ -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`, `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 mark the PR ready except by removing `WIP:` after `delivery-qa` returns `pass`. Gates are - human approval recorded in the tracker; an agent that sets one approves its own work. +- Never set, add or remove a Gate label (`Status/Ready for Agent`) or a gated dry run's label, never + approve or merge a PR, and never mark the PR ready except by removing `WIP:` after `delivery-qa` + 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 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 @@ -113,8 +114,7 @@ with blocking findings. On a PR, the issue is the one its body's `Closes #` n `## Acceptance checks` block and the skill names. - `pass` → step 9. - `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 - counts toward this limit. + "QA failed 3 rounds" and the last findings. - `pending` → Stop with "CI still running". - `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 diff --git a/plugins/delivery/.apm/agents/delivery-qa.agent.md b/plugins/delivery/.apm/agents/delivery-qa.agent.md index cd457d6..5dad0e4 100644 --- a/plugins/delivery/.apm/agents/delivery-qa.agent.md +++ b/plugins/delivery/.apm/agents/delivery-qa.agent.md @@ -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 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. An `awaiting-gate` row is a `dry-run-gated` check no human - has started yet: it is never a fail and never `missing`; list its name under `awaiting-gate` and - judge the rest. A gated check that ran is judged like any other row. + no implementer commit can fix either. `awaiting-gate` rows are never a fail: list them under + `awaiting-gate` 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. @@ -47,7 +46,8 @@ the tool skill names. 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. + diff. A gated check never reaches you as `skipped`; `delivery-ci-checks` reports it as + `awaiting-gate`. ## Output 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 c636753..597e330 100644 --- a/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md +++ b/plugins/delivery/.apm/skills/delivery-ci-checks/references/statuses.md @@ -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, 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 -- `awaiting-gate` is a `dry-run-gated` check with no 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 status (`pending`, `failure`, `success`, `skipped`) is classified like - any other check. +- `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 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 - re-adding it is the human's act, never yours. + 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`. ## Links diff --git a/plugins/delivery/.apm/skills/delivery-handoff/SKILL.md b/plugins/delivery/.apm/skills/delivery-handoff/SKILL.md index 2b053f2..2c69930 100644 --- a/plugins/delivery/.apm/skills/delivery-handoff/SKILL.md +++ b/plugins/delivery/.apm/skills/delivery-handoff/SKILL.md @@ -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 metadata: category: delivery - version: "0.2.1" + version: "0.2.2" --- ## Gotchas - `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, - and never approve a PR. + `Status/Ready for Agent`, a gated dry run's label, a PR approval — is human-only: never set, add + 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. Do not read the issue timeline. - `Status/Ready for Agent` and `Status/Ready for Human` must not share an exclusive label scope: 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 251fa3d..a8861b6 100644 --- a/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md +++ b/plugins/delivery/.apm/skills/delivery-repo-doc/references/format.md @@ -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 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. Until then its status is absent from the head commit, and - consumers read that as awaiting the human gate, not as missing. -- Whatever its role, a consumer treats a check reported as "skipped" (a path-filtered workflow - whose paths did not match) as passing. + 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. +- 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 diff --git a/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md b/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md index 691cda2..aa0479a 100644 --- a/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md +++ b/plugins/delivery/.apm/skills/delivery-repo-doc/references/gathering.md @@ -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` 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. + 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 @@ -74,9 +77,10 @@ SKILL.md Step 3 asks for these: - Bot user the agents act as. - Read-only kubeconfig path, or "no cluster". - 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 - an allowlisted human adds a label. 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. +- Which CI checks are dry runs, and which of those are label-gated: they post a status only after an + allowlisted human adds a label. For each gated one, confirm its workflow runs only on that one + 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). - Post-merge items for a push workflow with no path filter (confirm the derived directories). - Accepted risks: the ADR or issue links, or "none". diff --git a/plugins/delivery/.apm/skills/delivery-review/references/checklist.md b/plugins/delivery/.apm/skills/delivery-review/references/checklist.md index 0ea9a7c..61c0700 100644 --- a/plugins/delivery/.apm/skills/delivery-review/references/checklist.md +++ b/plugins/delivery/.apm/skills/delivery-review/references/checklist.md @@ -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 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", with no job link. +run `` has not run yet; the approver judges its output once it does", linking +`/files`. `success` → read its job log: ```text