(Distinct from a skill's result: postcondition gate — this types a
subagent's return value, the success/error tracks of the railway.)
The literal field shapes are PRESERVED in the return type (const inference),
not erased to Record<string, OutputFieldType> — this is what lets pipe
cross-reference one agent's ok against the next agent's needs at tsc time.
The return is still an OutputContract, so every existing consumer (the
output: field, renderOutputContract, parseAgentResult) is unchanged.
Declare a subagent's success/error result contract.
result( { files: "string[]", summary: "string" }, // rich success { reason: "string", retryable: "boolean" }, // rich error )
(Distinct from a skill's
result:postcondition gate — this types a subagent's return value, the success/error tracks of the railway.)The literal field shapes are PRESERVED in the return type (
constinference), not erased toRecord<string, OutputFieldType>— this is what letspipecross-reference one agent'sokagainst the next agent's needs attsctime. The return is still anOutputContract, so every existing consumer (theoutput:field,renderOutputContract,parseAgentResult) is unchanged.