feat(delivery): add the delivery-handoff stage protocol skill #213

Merged
Defame1297 merged 5 commits from feat/delivery-handoff into main 2026-11-23 18:07:48 +00:00
Owner

Closes #191.

Adds delivery-handoff, the protocol every delivery stage lead loads: entry (repo delivery doc, inbound Handoff comment, gate check), exit (fixed-shape Handoff comment with launch lines for Claude Code and Copilot CLI), and Stop.

Changes

  • New skill plugins/delivery/.apm/skills/delivery-handoff/ (0.1.0): SKILL.md, references/gates.md (per-stage gates, inbound rule, stop reasons), references/handoff-comment.md (six headings, template, Next command lines, examples).
  • ADR-0032 amended: in step mode the human launching a stage is the approval; stage leads check gate state only. The who-set-the-label check moves to the run-mode launcher (event sender vs allowlist). Why: gitea-mcp v1.13.0 has no timeline method, the timeline needs a token on private repos, and step mode already has a human launching each stage.
  • delivery-repo-doc 0.1.2: format.md drops the timeline check, allows consumers to restate the minimum they parse, and its checklist gains "the two Status/Ready for * labels are not in an exclusive scope".
  • GLOSSARY: Handoff comment entry gains the launch command; new Step mode and Run mode entries.
  • Version: delivery 0.3.0 (plugin apm.yml, root apm.yml executables key, marketplace.json).

Gates (decided in #191)

Stage Gate
implement issue has Status/Ready for Agent; inbound Handoff optional
review no human gate; inbound Handoff required; PR title not WIP:
verify PR merged + an APPROVED, non-stale, non-dismissed review by an allowlisted human
spec, tickets none in v1 (slice 4); the planner stops

Stops before the inbound check passes post a plain comment (never a Handoff), so a stage can't satisfy its own Required inbound by stopping. Stops after it passes post a Handoff that relaunches the same stage.

Gitea facts verified live (Gitea 28.3.0): timeline label events are type: "label", body "1" added / "" removed; reviews carry state, user.login, stale, dismissed (PR #154).

Verification

  • factory-audit: PASS on both skills (build, independent audit, and after each fix round); validate.sh / validate-provenance.sh / Vale clean.
  • Two code reviews (code-review, Standards + Spec) and two adversarial protocol walkthroughs (first run, stop and relaunch, previous stage's stop, foreign/quoted Handoff, wrong agent, repeated relaunch); all blocking findings fixed in the follow-up commits.
  • bash tests/run-tests.sh: 22 passed, 0 failed. Pre-commit hooks passed.

Not done

  • No eval for the skill (no eval convention for delivery skills yet).
  • Deferred to other tickets: duplicate-PR guard on implement relaunch (#192), the review → implement changes loop (#193), Handoff author not checked (run mode).

🤖 Generated with Claude Code

https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN

Closes #191. Adds `delivery-handoff`, the protocol every delivery stage lead loads: entry (repo delivery doc, inbound Handoff comment, gate check), exit (fixed-shape Handoff comment with launch lines for Claude Code and Copilot CLI), and Stop. ## Changes - **New skill** `plugins/delivery/.apm/skills/delivery-handoff/` (0.1.0): `SKILL.md`, `references/gates.md` (per-stage gates, inbound rule, stop reasons), `references/handoff-comment.md` (six headings, template, Next command lines, examples). - **ADR-0032 amended:** in step mode the human launching a stage is the approval; stage leads check gate *state* only. The who-set-the-label check moves to the run-mode launcher (event sender vs allowlist). Why: gitea-mcp v1.13.0 has no timeline method, the timeline needs a token on private repos, and step mode already has a human launching each stage. - **`delivery-repo-doc` 0.1.2:** `format.md` drops the timeline check, allows consumers to restate the minimum they parse, and its checklist gains "the two `Status/Ready for *` labels are not in an exclusive scope". - **GLOSSARY:** Handoff comment entry gains the launch command; new **Step mode** and **Run mode** entries. - **Version:** `delivery` 0.3.0 (plugin `apm.yml`, root `apm.yml` executables key, `marketplace.json`). ## Gates (decided in #191) | Stage | Gate | |---|---| | implement | issue has `Status/Ready for Agent`; inbound Handoff optional | | review | no human gate; inbound Handoff required; PR title not `WIP:` | | verify | PR merged + an APPROVED, non-stale, non-dismissed review by an allowlisted human | | spec, tickets | none in v1 (slice 4); the planner stops | Stops before the inbound check passes post a plain comment (never a Handoff), so a stage can't satisfy its own Required inbound by stopping. Stops after it passes post a Handoff that relaunches the same stage. Gitea facts verified live (Gitea 28.3.0): timeline label events are `type: "label"`, `body` `"1"` added / `""` removed; reviews carry `state`, `user.login`, `stale`, `dismissed` (PR #154). ## Verification - `factory-audit`: PASS on both skills (build, independent audit, and after each fix round); `validate.sh` / `validate-provenance.sh` / Vale clean. - Two code reviews (`code-review`, Standards + Spec) and two adversarial protocol walkthroughs (first run, stop and relaunch, previous stage's stop, foreign/quoted Handoff, wrong agent, repeated relaunch); all blocking findings fixed in the follow-up commits. - `bash tests/run-tests.sh`: 22 passed, 0 failed. Pre-commit hooks passed. ## Not done - No eval for the skill (no eval convention for delivery skills yet). - Deferred to other tickets: duplicate-PR guard on implement relaunch (#192), the review → implement changes loop (#193), Handoff author not checked (run mode). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
Claude added 5 commits 2026-11-23 17:47:36 +00:00
Every delivery Stage lead needs the same entry and exit discipline: read
the repo's delivery doc, read the inbound Handoff comment, check the
stage's gate, and end with one fixed-shape Handoff comment that tells the
human the exact launch line for the next stage.

- delivery-handoff: entry checks, per-stage gate table (implement label,
  review non-WIP PR, verify merged PR with a non-stale, non-dismissed
  allowlisted approval), the Status/Ready for Human stop path, and the
  Handoff template with Claude Code and Copilot CLI Next commands
- ADR-0032 amended: stage leads check gate state only in step mode; the
  who-set-the-label check moves to the run-mode launcher (gitea-mcp has
  no timeline method and the human already launches each stage)
- delivery-repo-doc format.md aligned with the amendment (0.1.2)
- delivery package 0.2.0 -> 0.3.0, with the executables.allow key and
  marketplace entry kept in step

Refs #191

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
Define the inbound Handoff comment as the latest one whose Next command
launches this stage, and stop when the latest has Next command none.
Name the six headings in Step 2, keep the required/optional rule in the
gates table and the posting location in handoff-comment.md only, narrow
the description to one capability clause, and declare the Gitea MCP
tools the skill uses. Let delivery-repo-doc's format consumers restate
the minimum they parse, and add the next stage's command to the
glossary's Handoff comment entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
A Stop wrote Next command `none`, and the inbound rule stopped on a
latest `none`, so a stage that stopped once stopped on every relaunch.
A Stop's Next command now relaunches the stage that stopped, `none`
means only the final stage, and the inbound rule stops only when the
latest Handoff comment does not launch this stage's agent. Gate checks
still run on a relaunch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
Why: every Stop posted a Handoff comment whose Next command relaunched the
stopping agent, including stops raised by the inbound rule itself. A second
launch then passed the inbound check, and a wrong-agent stop buried the
correct pointer.

Implementation Notes:
- Stops before the inbound check passed (Steps 1-2) post a plain comment;
  later stops keep the relaunching Handoff comment.
- gates.md defines a Handoff comment strictly and owns the inbound stop
  wordings; the planner stops at the inbound check in v1.
- Heading names and where-to-post live once, in handoff-comment.md.
- Gotcha and delivery-repo-doc checklist item: the two Status labels must
  not share an exclusive scope.
- GLOSSARY gains Step mode and Run mode; ADR-0032 scopes the gate-label
  check to stages that have one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
An agent with no gate-table row had no defined stop; it now stops first
in the inbound check with a plain comment. The item kind is checked
before the Handoff lookup, 'latest' means newest by creation time, and an
allowlist of '- none' counts as empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
Defame1297 approved these changes 2026-11-23 18:07:42 +00:00
Defame1297 merged commit cbd6033ee4 into main 2026-11-23 18:07:48 +00:00
Defame1297 deleted branch feat/delivery-handoff 2026-11-23 18:07:49 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Holocron#213