feat: add verified delivery interruption recovery

This commit is contained in:
Magnus Hedemark
2026-08-28 17:24:57 -04:00
parent bb57268a68
commit d7bd0953df
8 changed files with 476 additions and 0 deletions
+9
View File
@@ -1328,6 +1328,15 @@
"strict": false, "strict": false,
"description": "Verify work against explicit criteria using direct, source-faithful evidence, reproducible checks, and clear verdicts. Use before declaring an artifact, implementation, or claim complete; do not use for exploratory research without pass/fail criteria." "description": "Verify work against explicit criteria using direct, source-faithful evidence, reproducible checks, and clear verdicts. Use before declaring an artifact, implementation, or claim complete; do not use for exploratory research without pass/fail criteria."
}, },
{
"name": "verified-delivery",
"source": "./",
"skills": [
"./verified-delivery"
],
"strict": false,
"description": "Deliver an authorized change end to end — implement, verify, open the PR, merge, and confirm post-merge state — using live-state gates, durable interruption handoffs, and live-state-first resumption. Use when a user grants end-to-end delivery authority for a specific change and the work may cross tool-call limits, context exhaustion, worker loss, or session interruptions before the delivery boundary is reached. Do not use for plain fixes with no delivery directive, for granting merge or post-merge authority the user did not grant, or for designing release pipelines (use release-engineering for that)."
},
{ {
"name": "vllm", "name": "vllm",
"source": "./", "source": "./",
+1
View File
@@ -165,6 +165,7 @@
"./travel-guide", "./travel-guide",
"./vercel-eve", "./vercel-eve",
"./verification-methodology", "./verification-methodology",
"./verified-delivery",
"./vllm", "./vllm",
"./web-accessibility", "./web-accessibility",
"./woodpecker-ci", "./woodpecker-ci",
+4
View File
@@ -604,6 +604,10 @@ Build, deploy, self-host, secure, and troubleshoot durable backend AI agents wit
Replace completion claims with a disciplined evidence trail that shows what was checked, what passed, and what remains uncertain. Replace completion claims with a disciplined evidence trail that shows what was checked, what passed, and what remains uncertain.
### [verified-delivery](verified-delivery/SKILL.md)
Deliver an authorized change end to end — implement, verify, merge, and confirm the merged state — without losing the thread when a hard limit interrupts the work.
### [vllm](vllm/SKILL.md) ### [vllm](vllm/SKILL.md)
Operate, configure, benchmark, and troubleshoot vLLM inference servers: Docker and Kubernetes deployment, quantization-aware model configuration (tensor parallelism, KV cache), the OpenAI-compatible API surface, throughput/latency benchmarking, continuous batching tuning, GPU operation, and upgrade/rollback. Ships a read-only `vllm-health` probe (`--json`), serving-config and benchmark-run-record templates, 7 dated references, tests, and 6 evals. Routes serving methodology to ml-engineering and the llama.cpp stack to llama-cpp. Operate, configure, benchmark, and troubleshoot vLLM inference servers: Docker and Kubernetes deployment, quantization-aware model configuration (tensor parallelism, KV cache), the OpenAI-compatible API surface, throughput/latency benchmarking, continuous batching tuning, GPU operation, and upgrade/rollback. Ships a read-only `vllm-health` probe (`--json`), serving-config and benchmark-run-record templates, 7 dated references, tests, and 6 evals. Routes serving methodology to ml-engineering and the llama.cpp stack to llama-cpp.
+1
View File
@@ -149,6 +149,7 @@
- [travel-guide](travel-guide/SKILL.md): Create personalized, source-grounded travel dossiers from a destination, dates, duration, travelers, and constraints. Ask only the questions that change the plan, use explicitly permitted personal context without exposing it, research current logistics, and produce a cited, visually coherent PDF or responsive companion web page. Use when someone wants an individualized itinerary, trip brief, travel field guide, or shareable travel website. Do not use for real-time booking, ticket purchasing, visa or legal advice, or generic destination summaries without a specific traveler and trip. - [travel-guide](travel-guide/SKILL.md): Create personalized, source-grounded travel dossiers from a destination, dates, duration, travelers, and constraints. Ask only the questions that change the plan, use explicitly permitted personal context without exposing it, research current logistics, and produce a cited, visually coherent PDF or responsive companion web page. Use when someone wants an individualized itinerary, trip brief, travel field guide, or shareable travel website. Do not use for real-time booking, ticket purchasing, visa or legal advice, or generic destination summaries without a specific traveler and trip.
- [vercel-eve](vercel-eve/SKILL.md): Build, develop, deploy, self-host, secure, and troubleshoot durable backend AI agents with Vercel Eve. Use when creating an Eve agent, adding tools, skills, subagents, channels, schedules, sandboxing, durable sessions, observability, or deploying Eve on Vercel or a Node host. Do not use for the separate Vercel AI SDK Agent APIs such as ToolLoopAgent or WorkflowAgent; use an AI SDK-specific skill for those. - [vercel-eve](vercel-eve/SKILL.md): Build, develop, deploy, self-host, secure, and troubleshoot durable backend AI agents with Vercel Eve. Use when creating an Eve agent, adding tools, skills, subagents, channels, schedules, sandboxing, durable sessions, observability, or deploying Eve on Vercel or a Node host. Do not use for the separate Vercel AI SDK Agent APIs such as ToolLoopAgent or WorkflowAgent; use an AI SDK-specific skill for those.
- [verification-methodology](verification-methodology/SKILL.md): Verify work against explicit criteria using direct, source-faithful evidence, reproducible checks, and clear verdicts. Use before declaring an artifact, implementation, or claim complete; do not use for exploratory research without pass/fail criteria. - [verification-methodology](verification-methodology/SKILL.md): Verify work against explicit criteria using direct, source-faithful evidence, reproducible checks, and clear verdicts. Use before declaring an artifact, implementation, or claim complete; do not use for exploratory research without pass/fail criteria.
- [verified-delivery](verified-delivery/SKILL.md): Deliver an authorized change end to end — implement, verify, open the PR, merge, and confirm post-merge state — using live-state gates, durable interruption handoffs, and live-state-first resumption. Use when a user grants end-to-end delivery authority for a specific change and the work may cross tool-call limits, context exhaustion, worker loss, or session interruptions before the delivery boundary is reached. Do not use for plain fixes with no delivery directive, for granting merge or post-merge authority the user did not grant, or for designing release pipelines (use release-engineering for that).
- [vllm](vllm/SKILL.md): Operate, configure, benchmark, and troubleshoot vLLM inference servers: Docker and Kubernetes deployment, quantization-aware model configuration (tensor parallelism, KV cache), OpenAI-compatible API serving, throughput and latency benchmarking, continuous batching tuning, GPU operation, and upgrade/rollback. Use when deploying or running a vLLM server (vllm serve, vllm/vllm-openai), sizing a model and its KV cache for GPUs, selecting quantization and parallelism, serving via /v1 endpoints, measuring serving throughput or latency, tuning batching, or diagnosing GPU, OOM, or startup failures in a vLLM deployment. Do not use for model training, fine-tuning, evaluation-set design, or engine-selection methodology (that is ml-engineering), or for operating the llama.cpp stack with GGUF models (that is llama-cpp); other inference engines (TGI, Ollama, Triton) are out of scope. - [vllm](vllm/SKILL.md): Operate, configure, benchmark, and troubleshoot vLLM inference servers: Docker and Kubernetes deployment, quantization-aware model configuration (tensor parallelism, KV cache), OpenAI-compatible API serving, throughput and latency benchmarking, continuous batching tuning, GPU operation, and upgrade/rollback. Use when deploying or running a vLLM server (vllm serve, vllm/vllm-openai), sizing a model and its KV cache for GPUs, selecting quantization and parallelism, serving via /v1 endpoints, measuring serving throughput or latency, tuning batching, or diagnosing GPU, OOM, or startup failures in a vLLM deployment. Do not use for model training, fine-tuning, evaluation-set design, or engine-selection methodology (that is ml-engineering), or for operating the llama.cpp stack with GGUF models (that is llama-cpp); other inference engines (TGI, Ollama, Triton) are out of scope.
- [web-accessibility](web-accessibility/SKILL.md): Design, build, and review accessible web interfaces with native semantics, keyboard and focus behavior, forms and recovery, responsive input, motion, assistive-technology testing, and WCAG 2.2-informed evidence. Use for a11y, WCAG, ARIA, screen-reader, keyboard, focus, dialog, form, widget, or accessibility review work across frameworks. - [web-accessibility](web-accessibility/SKILL.md): Design, build, and review accessible web interfaces with native semantics, keyboard and focus behavior, forms and recovery, responsive input, motion, assistive-technology testing, and WCAG 2.2-informed evidence. Use for a11y, WCAG, ARIA, screen-reader, keyboard, focus, dialog, form, widget, or accessibility review work across frameworks.
- [woodpecker-ci](woodpecker-ci/SKILL.md): Operate Woodpecker CI from installation through production troubleshooting: configure servers and agents, connect Forgejo/Gitea or another forge, write and validate pipelines, manage secrets and plugins, use Docker or Kubernetes backends, run the CLI, and diagnose failed builds. Use when setting up, administering, or debugging Woodpecker CI. - [woodpecker-ci](woodpecker-ci/SKILL.md): Operate Woodpecker CI from installation through production troubleshooting: configure servers and agents, connect Forgejo/Gitea or another forge, write and validate pipelines, manage secrets and plugins, use Docker or Kubernetes backends, run the CLI, and diagnose failed builds. Use when setting up, administering, or debugging Woodpecker CI.
+38
View File
@@ -0,0 +1,38 @@
# Verified Delivery
Deliver an authorized change end to end — implement, verify, merge, and confirm the merged state — without losing the thread when a hard limit interrupts the work.
## Why Install This Skill
End-to-end delivery directives ("fix this, open a PR, and merge when it's green") routinely die halfway: the agent runs out of tool calls, the context window fills, a worker is replaced, or the session ends. The agent reports the remaining steps, and the user has to re-type the whole instruction in a fresh session — hoping nothing was lost in translation.
This skill fixes both halves of that failure. Before any interrupted ending, the agent writes a durable, machine-readable handoff (directive, repository and PR identity, head SHA, completed and pending gated steps, authorization boundary, active watchers) so nothing lives only in the conversation. On the next re-entry, the agent treats the open handoff as a resume: it verifies live repository, PR, CI, review, and watcher state first — read-only — and then continues the next already-authorized gated step on its own. No re-instruction, no re-planning, no guessing.
Just as importantly, the skill never manufactures authority. It preserves explicit boundaries for merge, review, security findings, exact-head verification, non-convergence, and post-merge verification, and it stops at a boundary with the exact reason rather than inferring permission. A "remaining steps" report is never presented as done.
## What You Get
| Path | What it provides |
|---|---|
| `SKILL.md` | The authorization boundary, delivery gates, interruption handoff requirement, resumption protocol, and stop-at-boundary rules. |
| `references/interruption-handoff.md` | Handoff field schema, store durability rules, validation and reconciliation rules, and a worked example. |
| `evals/evals.json` | Regression cases covering the interruption-resume signature, the positive control for uninterrupted delivery, and the boundary-stop behaviors. |
## Quick Start
No setup or credentials required. Expose this directory through your agent's standard skills mechanism, then grant an end-to-end directive that names its boundaries, for example:
> Implement the retry-backoff fix, open a PR, and run it end to end: merge when CI is green and reviews are satisfied, then verify the post-merge state.
If the session is interrupted before the delivery boundary, re-enter and simply continue — the agent picks up from the recorded handoff and verified live state.
## Triggers
- A user grants an end-to-end delivery directive for a specific change (implement → PR → merge → post-merge verification).
- A delivery was interrupted by tool-call limits, context exhaustion, worker loss, or a session end, and work is re-entered.
- A session is about to end while an authorized delivery still has gated steps outstanding.
- Deciding whether a remaining-steps report can count as delivery completion (it cannot, without a recorded handoff and an explicit next trigger).
## Requirements
No runtime dependency. Live-state verification works best when the environment can read repository, PR, CI, and review state through the tools the host already provides.
+199
View File
@@ -0,0 +1,199 @@
---
name: verified-delivery
description: >-
Deliver an authorized change end to end — implement, verify, open the PR, merge,
and confirm post-merge state — using live-state gates, durable interruption
handoffs, and live-state-first resumption. Use when a user grants end-to-end
delivery authority for a specific change and the work may cross tool-call
limits, context exhaustion, worker loss, or session interruptions before the
delivery boundary is reached. Do not use for plain fixes with no delivery
directive, for granting merge or post-merge authority the user did not grant,
or for designing release pipelines (use release-engineering for that).
license: MIT
compatibility: No runtime dependency.
---
# Verified Delivery
Carry an authorized change from implementation through merge and post-merge
verification through a sequence of live-state gates. Every gate is verified
against the actual state of the repository, PR, CI, and review system before
the next step runs, and every gate verdict is bound to the exact head SHA it
was verified on. Because hard limits (tool-call budgets, context exhaustion,
worker replacement, session interruptions) can end the work before the
delivery boundary is reached, this skill defines a durable interruption
handoff and a resumption protocol that treats the next re-entry as a resume
of the same directive — not a request to restate it.
## Authorization boundary
Delivery proceeds only under an explicit user directive that names the change
and the gates it authorizes. Never infer permission from context, tone, or a
partial handoff.
- The directive states which gated steps are authorized (for example: open a
PR, merge when CI is green and reviews are satisfied, verify post-merge).
- Steps outside the stated boundary stop at their gate with the exact missing
authorization reported. Asking the user for an explicit new decision is the
correct response to a gap; acting anyway is not.
- The authorization travels with the work: it is restated verbatim in the
interruption handoff (below) so a resumed session inherits the same
boundary, never a wider one.
Preserved boundaries at every gate:
- **Merge boundary** — merge only when merge is explicitly authorized and the
CI and review gates pass on the exact head being merged.
- **Review boundary** — address review feedback inside a bounded loop; never
force past unresolved review objections.
- **Security boundary** — security findings from CI or review are gates, not
warnings; they are never bypassed, weakened, or retried until clean by
suppression.
- **Exact-head boundary** — all gate evidence binds to the exact head SHA.
A moved head invalidates prior evidence until it is re-verified on the new
head.
- **Non-convergence boundary** — after three non-converging fix or review
passes at any gate, stop and report the evidence.
- **Post-merge verification boundary** — the delivery is not complete until
the merged state is verified after the merge.
## Delivery gates
Run the gates in order. At each gate, check live state first, then act, then
record evidence bound to the current head SHA.
1. **Change ready** — implementation complete and local verification passes
at the working head.
2. **PR open** — the PR exists and its identity and head SHA are recorded.
3. **CI green** — CI passes on the exact PR head SHA.
4. **Review satisfied** — review requirements of the repository's policy are
met on the exact head SHA.
5. **Merge** — only when gates 3 and 4 hold on the exact head and merge is
within the granted authorization.
6. **Post-merge verification** — the merged state is confirmed (branch,
PR status, post-merge checks) before any completion claim.
## Interruption handoff
Any ending — session end, turn end, worker shutdown, or an approaching hard
limit — while a delivery directive is still authorized and gated steps remain
must first record a durable handoff. Ending with remaining steps and no
durable handoff is a protocol failure, even if the remaining steps are
reported clearly. A remaining-steps report is never terminal success for an
end-to-end directive.
The handoff is machine-readable JSON stored durably: by default as a file at
`.verified-delivery/handoff.json` in the repository working tree (kept
untracked so it never becomes part of the delivered change); alternatively in
a fenced machine-readable block in the PR description, or in host-provided
durable storage when configured. The record names its own store. Durability
means the next re-entry can find and read it without user assistance.
Required fields — `directive` (verbatim user directive), `authorization_boundary`
(gates authorized, and anything explicitly out of scope), `repository` (remote
identity), `pull_request` (PR identity or null), `head_sha` (head at handoff
time), `completed_steps` (gates done, with SHA-bound evidence), `pending_steps`
(next authorized gated steps in order), `watchers` (active watcher, process,
or worker identifiers, or empty), `stop_reason` (observed interruption class),
`status` (`open` or `closed`), and `updated_at`. The full field schema,
durability rules, and worked examples are in
[references/interruption-handoff.md](references/interruption-handoff.md).
## Resumption on re-entry
Re-entry means a new session, turn, or worker touching the repository while a
handoff with `status: open` exists. Scan the documented store locations at
re-entry. An open handoff makes the re-entry a resume of the recorded
directive: do not ask the user to restate or repeat the instruction, and do
not re-plan from scratch.
First action: read-only live-state verification. No mutation before it
completes.
1. Repository — the remote matches the handoff's `repository`; branch state
is identified.
2. PR — it exists, is open, and its head SHA is compared with the handoff's
`head_sha`.
3. CI — status on the exact head.
4. Reviews — state against the repository's policy on the exact head.
5. Watchers — whether recorded watchers, processes, or workers are still
alive; never spawn a duplicate of a live one.
Then continue with the next already-authorized gated step. Gate evidence
recorded in the handoff stays valid only for the head it was verified on.
If the head moved (new commits, rebase, force push), reconcile first: fetch,
re-verify CI and review on the new head, update the handoff's `head_sha`, and
only then continue. Mutations — commits, pushes, merges, comments — happen
only after verification.
## Stop at the boundary
Stop and report the exact reason, taking no further action, when:
- there is no directive and no open handoff (treat the input as a fresh
request, not a resume);
- the handoff is corrupt — unparseable, missing required fields, or
internally inconsistent;
- the handoff is stale — the PR was merged, closed, or rolled back by
someone else, the repository does not match, or the recorded authorization
no longer applies;
- authorization for the next step is absent or ambiguous;
- live state is ambiguous — a gate result or the merge state cannot be
determined.
Never infer permission from a partial or stale handoff. The stop report
states what was found, what could not be verified, and the exact reason for
stopping.
## Closing an end-to-end directive
- **Delivery boundary reached** — close the handoff (`status: closed`) and
report the SHA-bound evidence for the boundary.
- **Steps remain** — record the handoff first, then close with a message that
names the handoff store and the explicit next trigger: the next re-entry
resumes the directive. This is the only acceptable way to end with steps
outstanding.
## Runtime honesty
No skill content can force a host runtime to continue past a hard tool-call
or context limit, and this protocol never promises that. What it guarantees
is observable behavior: a durable handoff written before the limit lands, and
a resumption path that the next re-entry can follow from verified live state.
Do not claim that the runtime will resume automatically — the next trigger is
an explicit re-entry.
## Completion and exit conditions
Exit when one of these holds:
- the delivery boundary is reached, the handoff is closed, and the evidence
is reported; or
- work stopped at a boundary, the exact reason is reported, and — when steps
remain — an open durable handoff exists.
After three non-converging passes at any gate, stop and report rather than
looping.
## When not to use
Do not use this skill for a plain fix, refactor, or review that carries no
end-to-end delivery directive — a normal change workflow is the nearest
alternative. Do not use it to design release pipelines, trains, or
progressive-delivery mechanics — use [release-engineering](../release-engineering/SKILL.md).
Do not use it to manufacture authority: this skill executes only what the
user explicitly granted.
## Related skills
- [release-engineering](../release-engineering/SKILL.md) — release pipeline
mechanics, progressive delivery, and rollback planning beyond a single
authorized change.
- [verification-methodology](../verification-methodology/SKILL.md) — evidence
and verdict standards for the live-state checks at each gate.
## Reference files
| Reference | When to load |
|-----------|-------------|
| `references/interruption-handoff.md` | You are recording, locating, validating, or reconciling an interruption handoff — field schema, durability rules, and worked examples |
+80
View File
@@ -0,0 +1,80 @@
{
"schema_version": 1,
"skill_name": "verified-delivery",
"evals": [
{
"id": "resume-after-tool-limit-interruption",
"case_set": "regression",
"prompt": "In a prior session, the user granted an end-to-end directive: implement the retry-backoff fix, open a PR, and run it to the delivery boundary — merge when CI is green and reviews are satisfied, then verify the post-merge state. That session hit the host tool-call limit after opening the PR and starting CI, with a CI watcher process active, and recorded a durable open handoff before ending. A new session now starts in the same repository worktree. The user adds no new instruction beyond re-entering. What should the agent do?",
"expected_output": "The re-entry is treated as a resumption of the recorded directive, not a request for re-instruction. The first action is read-only live-state verification: repository remote matches the handoff, the PR is open and its head SHA is compared with the handoff's head SHA, CI status is read for that exact head, review state is read against repository policy, and the recorded CI watcher is checked for liveness without spawning a duplicate. Only after verification confirms the state does the agent continue the next already-authorized gated step autonomously — confirming CI green on the exact head, review satisfaction, then the authorized merge and post-merge verification — closing the handoff and reporting boundary evidence. The agent never asks the user to repeat 'merge when green' and performs no mutation before live-state verification completes.",
"assertions": [
"Treats the re-entry as a resumption of the recorded directive and does not ask the user to restate or repeat the original end-to-end instruction.",
"Performs read-only live-state verification of the repository, PR identity, branch head SHA, CI status, review state, and watcher liveness before any mutation.",
"Continues the next already-authorized gated step autonomously after verification confirms the live state.",
"Merges only after CI and review gates are verified on the exact head SHA recorded in the handoff, within the recorded authorization boundary.",
"Closes the handoff and reports SHA-bound evidence after post-merge verification instead of presenting a remaining-steps report."
]
},
{
"id": "uninterrupted-delivery-positive-control",
"case_set": "release",
"prompt": "The user grants an end-to-end directive for a small, well-understood fix: implement it, open a PR, and run it to the delivery boundary — merge when CI is green and reviews are satisfied, then verify the post-merge state. The session has ample tool budget, CI passes on the first run, one review round approves without changes requested, and no interruption occurs at any point. Describe the trajectory the agent should follow and how it should end.",
"expected_output": "The agent works the delivery gates in order, verifying live state before each step and binding every verdict to the exact head SHA: implementation and local verification, PR creation, CI green on the PR head, review satisfaction per repository policy on the same head, the authorized merge, and post-merge verification of the merged state. No interruption handoff is required because the delivery never ends with authorized steps outstanding. The final report states that the delivery boundary was reached, with SHA-bound evidence for the merge and post-merge checks, and closes out the delivery — it does not present remaining steps, because none remain, and it does not leave an open handoff behind.",
"assertions": [
"Verifies each delivery gate against live state before the next step, with every verdict bound to the exact head SHA.",
"Performs the merge only after CI green and review satisfaction are confirmed on the exact head and merge is within the granted authorization.",
"Runs post-merge verification of the merged state before any completion claim.",
"Reports the delivery boundary as reached with SHA-bound evidence rather than a remaining-steps report.",
"Does not record a pending open handoff as a substitute for completing the authorized delivery."
]
},
{
"id": "ending-without-handoff-not-terminal",
"case_set": "regression",
"prompt": "The agent is delivering an authorized end-to-end directive and the context window is nearly exhausted. The PR is open, CI is still running, and review, merge, and post-merge verification are all still outstanding. The agent is about to end the session. Is a clear report of the remaining steps an acceptable way to end, and what must happen before the session ends?",
"expected_output": "No. For an end-to-end directive, a remaining-steps report is not terminal success. Before ending, the agent records a durable machine-readable handoff containing the verbatim directive, the authorization boundary, repository and PR identity, the current head SHA, the completed gated steps with their SHA-bound evidence, the pending gated steps in order, any active watcher or process identifiers, the observed interruption class, and an open status. The closing message names where the handoff is stored and states the explicit next trigger: the next re-entry resumes the directive from verified live state. The agent does not claim the host runtime will automatically continue the work.",
"assertions": [
"Records a durable machine-readable handoff with the directive, authorization boundary, repository and PR identity, current head SHA, completed and pending gated steps, and watcher or process identifiers before ending.",
"Does not present the remaining-steps report as terminal success for the end-to-end directive.",
"Closes with a message that names the handoff store and the explicit next trigger for resumption.",
"Does not claim the host runtime will automatically continue the delivery past the interruption."
]
},
{
"id": "stale-handoff-stop-at-boundary",
"case_set": "regression",
"prompt": "A session re-enters a repository and finds an open handoff from a prior interrupted delivery whose pending steps are CI verification and merge. Read-only live-state verification reveals that the recorded PR was merged by a teammate the previous evening, the branch was deleted, and the recorded head SHA no longer exists on any branch. The user is not present and has given no new instruction. What should the agent do?",
"expected_output": "The handoff is stale: the recorded pending steps no longer describe reality, because the change was merged outside this handoff. The agent stops at that boundary and reports the exact reason — the recorded PR is already merged by another actor and the recorded head no longer exists — along with what verification showed. It does not continue the recorded pending steps, does not re-deliver or reopen anything, does not revert the merge, and does not infer permission for any follow-up action from the stale handoff. Any further action, such as post-merge checks or cleanup, requires a fresh explicit user decision.",
"assertions": [
"Performs read-only live-state verification first and detects the condition that makes the handoff stale before any mutation.",
"Stops at the boundary and reports the exact reason instead of continuing the recorded pending steps.",
"Does not mutate the repository or PR — no reopen, revert, re-delivery, or branch restoration — on the basis of the stale handoff.",
"Does not infer permission for follow-up actions from the stale handoff and awaits an explicit user decision."
]
},
{
"id": "head-drift-reconciliation-on-resume",
"case_set": "dev",
"prompt": "A session resumes an interrupted end-to-end delivery from an open handoff. Read-only verification shows the repository and PR match the handoff, but the branch head has advanced since the handoff was recorded: a teammate's fix commit was pushed to the delivery branch, so the CI result recorded in the handoff was produced for the older head. What should the agent do before continuing the delivery?",
"expected_output": "The head drift is detected during read-only live-state verification, before any mutation. Because gate evidence binds to the exact head it was verified on, the recorded CI evidence is invalid for the new head. The agent re-verifies CI and review state on the current head, updates the handoff's head SHA and completed-steps evidence to the reconciled head, and only then continues the next already-authorized gated step. No commit, push, merge, or other mutation happens before verification and reconciliation complete.",
"assertions": [
"Detects the head drift during read-only live-state verification before any mutation.",
"Treats head-bound gate evidence from the handoff as invalid for the new head and re-verifies CI and review state on the current head.",
"Updates the handoff record to the reconciled head SHA before continuing.",
"Continues the next already-authorized gated step only after the affected gates pass on the new head."
]
},
{
"id": "authorization-gap-stops-at-gate",
"case_set": "regression",
"prompt": "A session resumes an interrupted end-to-end delivery from an open handoff. Read-only verification confirms the repository, PR, head SHA, and CI all match the handoff. The next recorded pending step is merge, but the authorization boundary recorded in the handoff authorized only opening the PR and verifying CI and review state — the user never authorized the merge itself. What should the agent do?",
"expected_output": "The agent compares the next pending step against the recorded authorization boundary before acting, identifies that the merge is not covered, and stops at the merge gate. It reports the exact reason — the recorded boundary authorizes PR verification but not merge — and does not perform the merge, schedule it, or otherwise act around the gap. It does not infer permission from the directive's overall end-to-end framing. Awaiting an explicit user decision on whether to grant merge authority is the correct next move.",
"assertions": [
"Compares the next pending step against the recorded authorization boundary before acting on it.",
"Stops at the merge gate and reports the exact missing authorization.",
"Does not perform, schedule, or work around the merge in any way.",
"Awaits an explicit user decision instead of inferring merge permission from the end-to-end framing of the original directive."
]
}
]
}
@@ -0,0 +1,144 @@
# Interruption Handoff Reference
Field schema, durability rules, validation, and worked examples for the
verified-delivery interruption handoff. Load this file when recording,
locating, validating, or reconciling a handoff.
## Store locations and durability
A handoff is durable when the next re-entry can find and read it without user
assistance. Choose the first available store:
1. **Repository working-tree file (default).** `.verified-delivery/handoff.json`
in the repository root. Keep it untracked so it never becomes part of the
delivered change. Survives session and worker replacement on the same
working tree.
2. **PR description block.** A fenced machine-readable block in the PR
description, usable when a PR exists and working-tree state may not
survive (ephemeral runners, disposable containers). Survives local loss
because it lives on the forge.
3. **Host-provided durable storage**, when the host documents a store that
survives session and worker replacement.
The handoff's `store` field names the location actually used. On re-entry,
scan in the same order; the first open handoff found governs. Never rely on
volatile session memory, chat scrollback, or a stale copy in a screenshot or
summary as the handoff store.
## Field schema
| Field | Type | Required | Meaning |
|-------|------|----------|---------|
| `schema` | string | yes | Literal `verified-delivery/handoff-v1` |
| `status` | string | yes | `open` while steps remain; `closed` at the delivery boundary or an authorized stop |
| `store` | string | yes | Where this record lives (path, PR block, or host store name) |
| `directive` | string | yes | The user's delivery directive, verbatim |
| `authorization_boundary` | object | yes | `authorized`: gated steps granted; `out_of_scope`: steps explicitly withheld |
| `repository` | string | yes | Remote identity of the repository (remote URL or `host/org/repo` form) |
| `pull_request` | string or null | yes | PR identity, or `null` before a PR exists |
| `branch` | string | yes | Delivery branch name |
| `head_sha` | string | yes | Full head SHA at handoff time |
| `completed_steps` | array | yes | Gates completed; each entry names the gate, its verdict, and SHA-bound evidence |
| `pending_steps` | array | yes | Next authorized gated steps, in order |
| `watchers` | array | yes | Active watcher, process, or worker identifiers; empty array when none |
| `stop_reason` | string | yes | Observed interruption class: `tool-limit`, `context-limit`, `worker-loss`, `session-end`, `user-pause`, `boundary-stop` |
| `stop_detail` | string | no | Exact reason when `stop_reason` is `boundary-stop` |
| `updated_at` | string | yes | UTC timestamp of the last update |
## Example: open handoff at a tool-limit interruption
The directive authorized implementation, PR creation, merge when green, and
post-merge verification. The session hit the tool-call limit after opening
the PR and starting CI, with a CI watcher running.
```json
{
"schema": "verified-delivery/handoff-v1",
"status": "open",
"store": ".verified-delivery/handoff.json",
"directive": "Implement the retry-backoff fix, open a PR, and run it end to end: merge when CI is green and reviews are satisfied, then verify post-merge state.",
"authorization_boundary": {
"authorized": ["open-pr", "merge-when-green", "post-merge-verify"],
"out_of_scope": []
},
"repository": "git.example.com/example-org/example-repo",
"pull_request": "<pr-number>",
"branch": "fix/retry-backoff",
"head_sha": "<40-character-head-sha>",
"completed_steps": [
{
"gate": "change-ready",
"verdict": "pass",
"evidence": "local verification suite passed at head <40-character-head-sha>"
},
{
"gate": "pr-open",
"verdict": "pass",
"evidence": "PR <pr-number> open with head <40-character-head-sha>"
}
],
"pending_steps": [
"ci-green",
"review-satisfied",
"merge",
"post-merge-verify"
],
"watchers": ["ci-watch:pr-<pr-number>@head-<40-character-head-sha>"],
"stop_reason": "tool-limit",
"updated_at": "<utc-timestamp>"
}
```
Placeholder values in angle brackets stand in for real identifiers; a real
handoff carries the actual values.
## Closing the handoff
- **Delivery boundary reached:** set `status` to `closed`, move the
post-merge evidence into `completed_steps`, and empty `pending_steps`.
- **Authorized stop with steps remaining** (for example, the non-convergence
boundary): set `stop_reason` to `boundary-stop`, describe the exact reason
in `stop_detail`, keep `pending_steps` as recorded, and leave `status`
`open` only if resumption remains authorized; otherwise close it.
- A closed handoff never resumes. A new directive is a new delivery.
## Validation on re-entry
An open handoff is usable only when all of these hold. Any failure stops the
resumption at that boundary with the exact reason reported:
- **Parseable and complete** — valid JSON; every required field present;
`schema` is `verified-delivery/handoff-v1`. Otherwise: corrupt handoff.
- **Repository match** — the live remote equals `repository`. Otherwise:
stale handoff.
- **Authorization current** — the recorded `authorization_boundary` still
reflects a directive the user has not withdrawn. Otherwise: absent or
ambiguous authorization.
- **Live state consistent** — the PR (when recorded) exists and is open, and
the merge state is determinable. A PR merged or closed by someone else, or
a rolled-back change, makes the handoff stale: the recorded pending steps
no longer describe reality.
- **Head reconciliation** — if the live branch head differs from
`head_sha`, head-bound evidence in `completed_steps` is invalid. Re-verify
CI and review on the new head, update `head_sha` and `completed_steps`,
then continue.
## Re-entry scan order
1. Check the default store (`.verified-delivery/handoff.json`).
2. If absent or closed, check the PR description block for an open handoff
(fetch the PR live; do not trust a remembered copy).
3. If absent, check host-provided durable storage when configured.
4. If no open handoff exists anywhere, treat the input as a fresh request —
there is nothing to resume.
## Reconciliation rules
- Read-only verification always precedes mutation on a resume.
- Gate evidence binds to the head it was verified on; a moved head
invalidates it until re-verified.
- A live watcher recorded in `watchers` is never duplicated; wait on it or
supersede it explicitly and record the change.
- Every mutation after resumption updates the handoff (`head_sha`,
`completed_steps`, `pending_steps`, `updated_at`) so the next interruption
resumes from an accurate record.