An output contract defines an acceptable result

An output contract describes the response that can be accepted: format, evidence, uncertainty labels, and stop conditions. “Review the diff” leaves too many decisions to the subagent.

It differs from a handoff note: a handoff transfers state of a long task, while an output contract evaluates a completed agent result.

PartRequired content
SummaryChecked scope and conclusion
FindingsProblem, severity, location, suggested action
EvidenceFile and line, diff, log, test, or other check
ChecksCommand, result, and exit code
UncertaintyFacts separate from [hypothesis]
BoundaryChanged files and checked scope
Next actionConcrete owner step
StopWhen the agent returns control

Hard fields and judgment fields

Path, line, command, exit code, and changed-file list are easy to verify. Severity, risk, and recommendation require judgment. A useful contract includes both without presenting judgment as fact.

Finding schema
Finding:
- severity: high | medium | low
- location: path/to/file.ts:42
- evidence: test, log, diff, or code path
- suggested action: concrete action
- confidence: confirmed | [hypothesis]

Reviewer contract

  1. Define one flow or module.
  2. State the focus: regressions, tests, API, or compatibility.
  3. Forbid edits.
  4. Require severity, file:line, and evidence.
  5. Require checks and exit codes.
  6. Set a stop condition such as a diff-size limit.

Accepting the result

Confident tone is not evidence. An unverified statement remains a hypothesis until checked in code, trace, test, or another factual source.

DecisionUse it when
AcceptEvidence exists, scope is respected, and next step is clear
Return for clarificationUseful conclusion but missing evidence, severity, or uncertainty labels
RejectForbidden files changed, stop ignored, or findings lack a verifiable basis

Canonical lesson source · JavaRush

Open JavaRush material