docs: document interrupt resume contracts

This commit is contained in:
lda
2026-07-01 06:05:49 +07:00 Verified
parent c379789977
commit 5dd56d286f
4 changed files with 23 additions and 2 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ Design contracts:
Implementation order: Implementation order:
1. Add self-describing interrupt request/resume schemas to the core run/inspect 1. Completed: self-describing interrupt request/resume schemas are carried
contract. through core execution, persisted run inspection, and resume validation.
2. Add a deterministic `examples/lda_report_workflow/` case study with local 2. Add a deterministic `examples/lda_report_workflow/` case study with local
document, report, and issue-board sources. document, report, and issue-board sources.
3. Add a top-level `web/` Astro/Effect app with loopback JSON-RPC connection and 3. Add a top-level `web/` Astro/Effect app with loopback JSON-RPC connection and
+11
View File
@@ -630,6 +630,17 @@ wf run trace run_123 --from 0 --limit 25
Trace output can be large. Always request a bounded range. Trace output can be large. Always request a bounded range.
### Interrupt Resume Schemas
Interrupted runs may include `interrupt.request_schema` and
`interrupt.resume_schema` in `wf run inspect` output. The request schema
describes the payload shown to the operator. The resume schema describes the
payload accepted by `wf run resume --payload` or `--payload-file`.
Resume payload validation happens before workflow state mutation. If validation
fails, inspect the schema and retry with a payload that matches the declared
shape.
## Explain ## Explain
Explain stable diagnostic/error codes: Explain stable diagnostic/error codes:
+3
View File
@@ -125,6 +125,9 @@ top-level `compiled_plan` key from the CLI output.
## Rules ## Rules
- For interrupted runs, call `wf run inspect <run_id>` before resuming. If the
interrupt includes `resume_schema`, shape `wf run resume --payload` to that
schema instead of guessing field names.
- Use explicit `--config <path>` for examples, challenge workspaces, and - Use explicit `--config <path>` for examples, challenge workspaces, and
non-root configs. The default is `wf.config.json` in the current working non-root configs. The default is `wf.config.json` in the current working
directory. directory.
@@ -100,3 +100,10 @@ completed or failed runs. Use:
- `wf run resume <run_id>` only for interrupted runs. - `wf run resume <run_id>` only for interrupted runs.
Do not ask for unbounded traces. Do not ask for unbounded traces.
## Interrupt Resume Contracts
An interrupted run can carry a self-describing resume contract. Treat
`interrupt.resume_schema` from `wf run inspect` as the source of truth for the
payload you pass to `wf run resume`. Do not read workflow source code just to
guess approval fields when the schema is present.