feat(delivery): add the verify stage: delivery-operator and delivery-verify

delivery-operator (opus; no Edit, Write, NotebookEdit or Agent) is the
verify-stage lead. After a human approves and merges, it reads the
delivery doc at the merge commit's first parent, proves its kubeconfig
cannot write (four auth can-i probes), loads the routed tool skills and
runs delivery-verify. It posts the operator report as its own comment,
then the final Handoff (Next command none on pass).

delivery-verify:
- stops first if the change was already reverted;
- waits for Flux through flux-diagnose's Applied check (15-minute cap)
  and reads post-merge CI per workflow through delivery-ci-checks
  (45-minute cap), accepting a later cumulative run as cover;
- checks the PR's post-merge assertions with Read-tier commands only;
- ties a failure to the change only when that is established, and
  otherwise stops. A tied failure opens a revert PR (Ready for Human,
  built in a temporary worktree); it never reverts on its own.
For Flux the guarantee is bounded: the merge commit applied and the
inventory HelmReleases are Ready. The assertions prove a values or chart
change took effect.

The delivery doc format gains a seventh parsed section, Post-merge
checks (glob -> push-event status names, or none when Flux pulls the
change), so delivery-repo-doc goes to 0.2.0. delivery-ci-checks takes a
caller check list and wait cap; delivery-handoff carries the verify
stops.

delivery 0.6.0.

Refs: #194

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-24 20:35:04 +00:00
1 parent 277d6f5826
commit 5081206c45
19 files changed
+788 -34

No files matched your search

@@ -1,30 +1,31 @@
# The `docs/agents/delivery.md` format
This file is the single source of truth for the format. These files read `docs/agents/delivery.md`:
the skills `delivery-handoff`, `delivery-ci-checks`, `delivery-test-first` and `delivery-review`,
and the agents `delivery-reviewer`, `delivery-implement-lead`, `delivery-implementer`,
`delivery-test-author` and `delivery-qa`. Those that parse a section cite this file as
"`delivery-repo-doc`'s `references/format.md`" and restate only the minimum they parse —
`delivery-handoff`, for example, restates the first line and section 4's syntax. A format change is
an edit here, plus every consumer's restatement.
the skills `delivery-handoff`, `delivery-ci-checks`, `delivery-test-first`, `delivery-review` and
`delivery-verify`, and the agents `delivery-reviewer`, `delivery-implement-lead`,
`delivery-implementer`, `delivery-test-author`, `delivery-qa` and `delivery-operator`. Those that
parse a section cite this file as "`delivery-repo-doc`'s `references/format.md`" and restate only
the minimum they parse — `delivery-handoff`, for example, restates the first line and section 4's
syntax. A format change is an edit here, plus every consumer's restatement.
## File rules
- Path: `docs/agents/delivery.md` at the consuming repo's root. One file per repo.
- First line: `# Delivery`.
- Exactly six `##` sections, with these headings verbatim and in this order:
- Exactly seven `##` sections, with these headings verbatim and in this order:
1. `## Contents → skills`
2. `## CI checks`
3. `## Test paths`
4. `## Human allowlist`
5. `## Credential boundary`
6. `## Conventions`
- No other `##` headings, and no `###` headings inside sections 1–4.
- Sections 1–4 are **parsed**: they contain only list items in the item syntax below, one per line,
starting `- ` at column 0. Blank lines are allowed; prose, sub-bullets, tables and comments are
not. Every backticked value is taken verbatim, with no escaping.
7. `## Post-merge checks`
- No other `##` headings, and no `###` headings inside a parsed section.
- The **parsed** sections are 1–4 and 7. They contain only list items in the item syntax below,
one per line, starting `- ` at column 0. Blank lines are allowed; prose, sub-bullets, tables and
comments are not. Every backticked value is taken verbatim, with no escaping.
- An empty parsed section holds the single item `- none`. Section 4 is never empty.
- Sections 5–6 are read by agents, not parsers; their item labels below are a convention.
- Sections 5 and 6 are read by agents, not parsers; their item labels below are a convention.
## Item syntax
@@ -89,14 +90,34 @@ is checked by whatever launches the stage: in step mode the human launching it i
- Accepted risks: [<title>](<url>), … | none
```
Every link in this section is a markdown link. Delivery sessions export the kubeconfig path as
`KUBECONFIG`. The value is a path only. Accepted risks are linked, never restated.
Every link in this section is a markdown link. The value is a path only: `delivery-operator`
checks it cannot write, then sets `KUBECONFIG=<path>` on each cluster command, never an `export`.
Accepted risks are linked, never restated.
### 6. Conventions
Short prose or bullets pointing at the repo's own docs (`AGENTS.md`, ADRs, contributing guides) for
anything else a delivery agent needs. Pointers only; no restating.
### 7. Post-merge checks
```text
- `<glob>`: `<exact status name>`, `<exact status name>`
- `<glob>`: none
```
- `<glob>` is a repo-relative path glob as in section 1: one glob per line, no brace globs.
- `<exact status name>` is the string the forge shows on a commit of the default branch after a
merge, event suffix included (`Provision / provision (push)`), never a section 2 PR name.
- Every listed check is cumulative: a green run on a later default-branch commit re-applies
everything since that check's last success, so the verify stage may count it for an earlier
merge whose own run failed or was cancelled. A workflow that applies only its own commit's diff
is not cumulative and is not listed.
- `none` marks a path applied by being pulled, not by a CI run (Flux): the verify stage waits for
the pull to reach the merge commit instead of reading a check.
- The checks for a merge are the union over every glob a changed path matches. A path matching
no glob has nothing to check after merge, the same rule as section 1.
## AGENTS.md pointer line
The consuming repo's root `AGENTS.md` carries this line verbatim, exactly once:
@@ -146,14 +167,19 @@ Placement only decides where the line sits; the line itself never changes:
## Conventions
Repo conventions live in `AGENTS.md`; decisions in `docs/adr/`.
## Post-merge checks
- `clusters/**`: none
- `roles/**`: `ci / provision (push)`
```
The values in the skeleton are illustrative only; every real value comes from the repo or the human.
## Validation checklist
- [ ] First line `# Delivery`; six `##` headings, verbatim, in order.
- [ ] Sections 1–4 hold only items in the syntax above, or `- none`.
- [ ] First line `# Delivery`; seven `##` headings, verbatim, in order.
- [ ] 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
@@ -161,6 +187,8 @@ The values in the skeleton are illustrative only; every real value comes from th
- [ ] 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.
- [ ] Section 7 names post-merge (`push`) statuses only, each confirmed on a default-branch commit
or named as derived in the PR body, and every pulled area is `none`.
- [ ] Root `AGENTS.md` carries the pointer line exactly once.
- [ ] On Gitea, the repo's `Status/Ready for Agent` and `Status/Ready for Human` labels are not
in an exclusive scope (read via `gitea-labels-milestones`), or the PR body names it as open;