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.
| Part | Required content |
|---|---|
| Summary | Checked scope and conclusion |
| Findings | Problem, severity, location, suggested action |
| Evidence | File and line, diff, log, test, or other check |
| Checks | Command, result, and exit code |
| Uncertainty | Facts separate from [hypothesis] |
| Boundary | Changed files and checked scope |
| Next action | Concrete owner step |
| Stop | When 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:
- 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
- Define one flow or module.
- State the focus: regressions, tests, API, or compatibility.
- Forbid edits.
- Require severity, file:line, and evidence.
- Require checks and exit codes.
- 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.
| Decision | Use it when |
|---|---|
| Accept | Evidence exists, scope is respected, and next step is clear |
| Return for clarification | Useful conclusion but missing evidence, severity, or uncertainty labels |
| Reject | Forbidden files changed, stop ignored, or findings lack a verifiable basis |
Canonical lesson source · JavaRush
Open JavaRush material