fix: smooth draft schema projection ux

This commit is contained in:
lda
2026-06-29 18:55:22 +07:00 Verified
parent 664beec837
commit 5f520d74bd
15 changed files with 335 additions and 16 deletions
+9 -2
View File
@@ -55,8 +55,15 @@ wf draft validate <workspace_id>
wf draft save <workspace_id> --artifact <artifact_id> --version <n> --title <title>
Draft creation auto-binds required capability inputs only. Optional inputs are
reported in wrapper-hint notes; bind them explicitly with `wf draft bind` or
`wf draft set-input --merge` only when the workflow should expose them.
reported in wrapper-hint notes; bind them explicitly only when the workflow
should expose them. Use `wf draft bind --from input.x --to local.x` for an
existing step, or `wf draft add-step --input input.x=x` while adding a step;
both project the workflow input schema for top-level fields.
`wf draft set-workflow-output` projects missing public output schema fields for
single-field `input.*` and `state.*` sources. Prefer it for final workflow
outputs; use `wf draft bind --from local.x --to output.y` when the source is a
step-local capability output.
When `wf draft validate` returns a `repair_hint`, run that exact focused command
before writing JSON Patch manually. To make one capability output public, use
@@ -115,7 +115,8 @@ wf draft add-step <workspace_id> --revision <n> --step <step_id> --capability <q
`set-workflow-output` maps a graph source path (`input.*`, `state.*`, or
`context.*`) to one public workflow output field. It edits top-level
`WorkflowDraft.output`; `set-output` edits one step's local-to-state bindings.
The public output field must already exist in `output_schema`.
For single-field `input.*` and `state.*` sources, missing public output schema
fields are projected automatically from the source schema.
`set-input` direction: `input.text=text` means graph source `input.text` maps to
node-local target `local.text`.
@@ -158,6 +159,9 @@ wf draft validate <workspace_id>
capabilities require exact route coverage; missing or unknown outcomes are
rejected before mutation. It still requires explicit choices; if you do not
know a map, inspect the capability or run validation rather than guessing.
Explicit top-level `--input input.x=x` and `--input state.x=x` mappings
project the corresponding workflow input/state schema fields from the
capability input schema.
```bash
wf draft add-step <workspace_id> --revision <n> --step <step_id> --capability <qualified_name> --from-step <prev> --from-outcome ok --route ok=__end__ --route error=fail --input input.text=text --input input.other=other --bind-output result=state.result --bind-output title=state.title