Could a gate consume a workflow input on resume? #3717
Replies: 2 comments
|
Thanks for the thorough write-up — the framing against #2593/#2594/#2667 and the "compose existing primitives" lens is exactly right, and it makes this easy to reason about. Answering your three questions directly: 1. Is the terminal-only verdict source intentional? 2. Does an optional 3. Should an unset value retain today's TTY-or-pause behavior?
One wrinkle worth pinning down: If that semantics question lands where I think it will, this looks like a small, backward-compatible addition to |
|
Thank you very much for your response! Does this meet your expectations? #3725 |
Uh oh!
There was an error while loading. Please reload this page.
Gate verdicts currently come exclusively from an interactive terminal prompt.
GateStep.execute()currently checkssys.stdin.isatty():PAUSED.One use case that is not directly represented by the gate today is an approval
verdict delivered through another channel—for example, a web UI, Slack, a PR
check, or an API. In that flow, the workflow run pauses and exits, an external
system collects the verdict, and the run is later resumed without a terminal.
The existing workflow primitives can support this use case, but the composition
is more indirect than it may need to be. There may be room to let the gate
consume the resume-time input itself while preserving its current behavior by
default.
This differs from earlier proposals:
gate-on-conditionstep kind (auto-fire on condition) #2593).ifandci_mode; that removes theapproval checkpoint.
--gate-answeror--gate-script([Feature]: Document a test harness for scripting gate verdicts non-interactively #2594 and feat(workflows): add --gate-script for non-interactive gate testing #2667).What works today
The behavior can be composed from existing primitives using a workflow input,
a
switch, a nestedgate, and resume-time inputs (#2812):The initial non-interactive run pauses at
await-approval. The--jsonoutputsurfaces the gate message and options (#2964), allowing an external system to
render the approval request. After a human decides, that system can continue
the workflow with:
This works, but the gate's decision semantics are bypassed. Its message and
options still provide useful metadata, but its own
output.choiceandon_rejectbehavior do not participate. The external verdict is insteadinterpreted by a parallel
switch, and rejection behavior must be recreated inanother step.
Possible improvement: bind a gate verdict to a workflow input
Allow a gate to name a declared workflow input that may provide its verdict:
The external approval flow then becomes:
The resumed gate would consume
spec_verdict, recordapproveinoutput.choice, and apply its existing gate semantics. No parallelswitchorgate-specific CLI option would be needed.
Suggested behavior:
verdict_inputis absent, preserve today's behavior exactly.a TTY, as today.
optionscase-insensitively.than silently pausing or selecting a fallback.
output.choice.on_rejectbehavior forrejectorabort.resume --inputvalidation and merge behavior.--jsongate representation.Internally, this could remain a small gate-specific resolver or be implemented
behind an input-provider seam—for example, a terminal provider plus a workflow
input provider. The requested public behavior is the workflow-input binding;
the internal abstraction can stay as small as the current implementation
requires.
Why this fits the existing-primitives direction
This reuses capabilities already shipped:
options,output.choice, andon_rejectsemantics.It adds no new gate-specific CLI argument or verdict-file format. The only new
surface would be an optional gate field connecting two existing primitives:
workflow inputs and gate decisions.
Questions
GateStepintentional, or is it animplementation constraint that could be relaxed?
verdict_inputfield fit the project's preference forcomposing existing workflow primitives?
TTY-or-pause behavior described above?
All reactions