062. A harness comes with everything a session has, cages included

Status: accepted 2026-10-16, and built the same day. Cageable is the interface, Claude Code and pi moved behind it unchanged, and OpenCode implements it, CageEnv and Gatewayed, with a real-podman test.

Untouched tests were not enough to show "unchanged", and that is worth recording. They passed while caged pi was broken: nothing in the suite executes a caged pi, and no test read what a cage is started with, so the one behaviour that changed was the one no test looked at. What catches it now is a rule tested for every cageable harness — a cage program is either an absolute path the mounts provide, or a bare name on the cage's PATH — and a real-podman test that execs each harness's program in the cages' own image.

Context

OpenCode came in as a harness (ADR-061) that runs sessions well and cannot be caged. With the small free models it is offered with, the cage matters more, not less: a model that may do random things is the one to keep in its folder.

The plug-in point (ADR-054) made a harness's conversation pluggable: a codec, the event shape, the model, the mesh's tools. A session is more than that. It can be caged (ADR-037) and sealed (ADR-045), reach its model through the agent with no key in the cage (ADR-059), keep a private home (ADR-060), show usage and say when it is out of quota. Each of those was built for Claude Code and pi by name, in cage.go, limited.go and usage.go. A third harness gets none of them without editing those files, and OpenCode didn't.

Decision

A harness is offered with every feature a session has, or the missing feature is refused by name with this ADR's number. It is never offered and then fails partway. What a harness must provide:

FeatureRequiredHow a harness provides it
Sessions, streamed turns, interruptyesHarness, Codec (ADR-054)
The mesh's tools and the session's noteyesStartOptions.MCP, Note
The model, per sessionyesStartOptions.Model
Usage: tokens, cost (0 when free)yesthe result event's usage
CagedyesCageable (below), CageEnv
SealedyesGatewayed (ADR-059): no key in the cage
Out of quota, and until whenyes where the provider says soLimits (to come, out of limited.go)
Approve before a tool runswhere the harness can askCaps.Approve; if it can't, the docs say so
Takeover of a terminal's conversationwhere the harness keeps themTranscripts, Caps.Takeover

Caging moves behind an interface. What cage.go knows about each harness by name becomes the harness's to say:

A harness that doesn't implement it is refused caging. That replaces cageableHarness's check by name. Claude Code and pi move behind it first, unchanged, with their tests showing they are; then OpenCode.

A new harness isn't merged without caged and sealed. OpenCode came in before this rule and was the exception; it is caged now, and it is the worked example of what the interface asks for.

Consequences