# Coder result contract

Write one result artifact at the Native dispatch path, reporting the assigned worktree and scope.
It grants no integration custody.

## Required shape

```yaml
schema: shepherd.coder-result/1
run: <run-id>
lane: <lane-id>
node: <node-id>
role: coder
outcome: <one measurable behavior>
task_digest: <sha256>
startup_skill: implementing
skill_bundle_digest: <sha256>
worktree: <descriptor-bound path>
baseline_commit: <full commit>
owned_paths: [<sorted exact paths>]
changed_paths: [<sorted exact paths>]
result_artifact: <Native-allocated result path>
evidence: [{path, sha256, bytes, command, exit_status}]
status: green|blocked|needs-amendment
```

## Required evidence

Record exact `red`/`green` commands, actual exit/status/reason, fresh output hashes, refactor
reruns, paired `eval` kind/input/hash/threshold, final diff hash, `review` readiness, risk and next action.

Root-owned gate execution adds requesting dispatch, root executor, native host message
correlation, task digest, source snapshot before/after, command/environment, raw output
paths/hashes, timing and semantic result. Match real process evidence, never fabricated Native
receipts or parental assertions. Changed inputs require rerun; no child shell or parent source authority.

Missing tests, process-exit-only/mock proof, hidden paths or wrong baseline/worktree/task/role/bundle
invalidate the result. The result artifact must be the Native-allocated path and evidence paths
must be exact files inside the selected run. Native reopens and hashes each declared evidence
file before the child can become terminal; fabricated or changed evidence is RED. Parent retains
version-control custody.
