# Harness Binding

A binding selects the harness that executes a portable dirtyloop. Creation defaults to `codex`; conversion always requires an explicit destination.

## Sources Of Truth

- `runtime/binding.json` is the generated active binding.
- `runtime/generation.json` identifies the complete deterministic generated contract and hashes every deterministic artifact plus adapter identity. Mutable lifecycle sidecars such as `loop-state.md` and `runtime/activation.json` participate in transactional rollback but are not generation inputs.
- `runtime/adapter.json` is generated Pi-only adapter policy; `dirtyloops update` and `convert` replace it from the current template rather than treating it as authored state.
- Beads mirrors `target`, `binding_schema`, and `adapter_contract` as canonical loop metadata.
- A runtime manifest reports the current harness and certified capabilities.
- The runtime manifest reports a captured loaded-adapter closure hash and a stable current coordinator id; material operations record the source id separately in `runtime/activation.json`.

Validate the generation, binding, and optional Pi adapter JSON documents against the bundled schemas. Verify every artifact hash before trusting the binding or run prompt. Agreement requires the same target harness, generation, and adapter contract. Detected plugins and current capabilities remain runtime facts and never enter Beads.

## Certified Capabilities

Adapters expose only capabilities they implement completely. Unknown contracts, missing handshakes, partial implementations, and ambiguous capabilities are unavailable. Select a strategy from the remaining capabilities or block when an invariant such as independent review cannot be satisfied.

Portable docs use `session`, `delegate`, and `completion`. Harness references map those concepts to local implementations without adding product versions or raw child-tool parameters to the binding.

Completion criterion: the binding, Beads metadata, and current runtime manifest either agree exactly or produce a concrete incompatibility with the required create, update, or convert command.
