feat(workflow): declared workflow outputs for wait:true callers

A workflow declares named, typed outputs beside its inputs
(task.WorkflowInterface.Outputs). A run writes each one once through a
capture tool named after the output, or from a deterministic Go stage via
TaskContext.WriteOutput; the finish write persists them on tasks.outputs
before the outcome transition. A wait:true caller receives its successful
callee's outputs through WorkflowCallStatus and publishes one as its own
through a call step's outputs assignment.

Build authority: docs/prds/workflow-call-outputs.md.

- save time: WorkflowInterface.Validate checks output names and types;
  checkCallOutputs checks a call's assignment against both declarations
  and refuses outputs over a wait:false call.
- run time: undeclared, mistyped and required-but-missing values park the
  run; published callee values are re-checked against the caller's type.
- storage/wire: tasks.outputs (goose 0024), reset by each claim so the set
  is attempt-scoped; an encoded set past the structured-payload bound is
  refused, not clipped. Task.outputs_json and
  WorkflowCallStatusResponse.outputs_json carry it; task.Caller keeps its
  two methods.
- examples: firewall-contain calls firewall-investigate and publishes its
  summary as its own output.
This commit is contained in:
sam committed 2026-10-02 02:09:03 +10:00
1 parent e190e58c3d
commit 4afefe087e
29 files changed
+1381 -82

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
# The containment workflow a firewall-investigate run calls:
# firewall-investigate (workflow.call, wait: true) hands its findings upward
# from its declared summary, and this workflow's own agent stage decides and
# records the containment as its own declared outputs. Paste it into the
# dashboard's workflow definitions alongside firewall-investigate
# (docs/prds/workflow-call-outputs.md).
id: firewall-contain
repository: none
profile: network-investigator
inputs:
src_ip: { type: string, required: true }
outputs:
contained: { type: bool, required: true }
summary: { type: string }
steps:
- type: workflow.call
settings:
workflow: firewall-investigate
wait: true
inputs: { src_ip: "inputs.src_ip" }
outputs: { summary: "outputs.summary" }
- type: agent.run
settings:
mission: >-
Using the investigation summary the called workflow returned, decide
whether the source address in the inputs should be contained. Write
your decision with the contained tool, and a one-line rationale with
the summary tool.
+8 -1
View File
@@ -2,17 +2,24 @@
# src_ip from a mapped parameter and runs one agent mission in a scratch
# workspace under the network-investigator profile. Paste it into the
# dashboard's workflow definitions.
#
# Its declared output (summary) is offered to the agent stages as a capture
# tool named after it; a wait:true caller publishes it as one of its own
# outputs (docs/prds/workflow-call-outputs.md).
id: firewall-investigate
repository: none
profile: network-investigator
inputs:
src_ip: { type: string, required: true }
severity: { type: string }
outputs:
summary: { type: string }
steps:
- type: agent.run
settings:
mission: >-
Investigate the source address in the inputs: who owns it, what it
resolves to, and whether it is reachable. Report what you found and
how serious it looks given the severity.
how serious it looks given the severity, and write your one-line
conclusion with the summary tool.
read_only: true