A subagent's typed result contract: the shape it must return on success
(ok) and on failure (err). Rich on both tracks — an error is structured
detail, not a bare pass/fail bit. Compiles into the worker's system prompt
(the vigiles:ok / vigiles:err block it must emit) and is the schema the
parseAgentResult parser + the assertAgentOk/Err test helpers validate.
Generic over its ok/err field shapes so a typed value REMEMBERS them at
the type level (the basis of typed composition — see pipe). The default
type parameters widen to the historical erased Shape, so an OutputContract
named with no arguments behaves exactly as before — backwards-compatible.
A subagent's typed result contract: the shape it must return on success (
ok) and on failure (err). Rich on both tracks — an error is structured detail, not a bare pass/fail bit. Compiles into the worker's system prompt (thevigiles:ok/vigiles:errblock it must emit) and is the schema theparseAgentResultparser + theassertAgentOk/Errtest helpers validate.Generic over its
ok/errfield shapes so a typed value REMEMBERS them at the type level (the basis of typed composition — seepipe). The default type parameters widen to the historical erasedShape, so anOutputContractnamed with no arguments behaves exactly as before — backwards-compatible.