# Owner mode controller report

Branch `owner-mode` starts at `e953698`, after the coordinator merge. The work
is for commit only. Production data, the installed service and release
certifications were not changed. No copy-review server was started.

## Behavior

An owner connection becomes available after pinned executable verification,
production policy construction and account preflight. Its report carries an
owner-mode marker. Instance selection checks the current runner and roster in
the transaction; the runner repeats the person and runner-ID comparison against
its credential before launching. Unknown actions still fail profile lookup.
Non-owner launches still require the release action and exact policy certificate.

Owner mode skips certificate matching, including certified path matching. It
keeps the production policy builder, account lease and identity checks,
executable digests, bubblewrap namespaces, deny rules, protected paths, egress
relay, native-tool inventory checks, fenced tool proxy and containment. Publishing
and the human merge boundary are unchanged. The release/install manifest and its
certification evidence are unchanged.

Connections show the owner-mode label and explanation. Claims and launches carry
that mode into the journal. Coordinator turns get an owner-mode conversation
note. Task steps and publication evidence retain the mode; evidence cannot erase
it by relabelling the same isolation tuple.

Both a new message and coordinator polling can replace an unusable binding with
an available connection on that person's own runner. This uses the existing
binding-change transaction, generations, cancellation and containment checks.
It posts the existing auto-bound note. Pending requests survive the change.
Task polling waits at most two seconds, so it no longer holds up coordinator
polling for 25 seconds. Waiting states produce conversation updates and plain
notes. Admission-paused and other pre-claim refusals have a visible denial state.

## Saved defaults

Only verified, available subscription connections in owner mode trigger defaults.
Heartbeat and coordinator admission use the same transaction-bound operation.
Existing settings are preserved; errors never become an unset budget.

| Monthly limit | Team | Person's coordinator |
| --- | ---: | ---: |
| Calls | 500 | 100 |
| Input tokens | 16,000,000 | 3,200,000 |
| Output tokens | 2,000,000 | 400,000 |
| Seconds | 360,000 | 120,000 |

Coordinator defaults are capped by each existing team limit. The ordinary team
budget record and coordinator-limit record are saved with revisions and audit
events, so the existing settings forms can edit them. There is no currency cap
for subscription use. Non-owner connections do not create defaults.

## Verification

The initial discovery test failed because an uncertified owner connection was
unavailable. The initial instance test failed because an owner turn received no
offer. Both passed after implementation.

Targeted commands:

- `CGO_ENABLED=0 go test ./internal/ownermodetest ./internal/equipo/ownermode ./internal/runner/certified/... -run '^TestOwner' -count=1`
- `CGO_ENABLED=0 go test ./internal/plan3test ./internal/runnerproto ./internal/runner/certified/... ./internal/equipo/conversation ./internal/equipo/team -run 'TestOwner|TestCoordinator|TestConnectionAvailable|TestStarterDispatch|TestIsolation|TestPublication' -count=1`

Mutation checks deliberately removed binary verification, preflight, cleanup
failure propagation, person matching, runner matching, taint rejection, instance
ownership, evidence mode retention, default budgets, fallback and denial notes.
Each corresponding test failed, then passed with the guard restored. The first
cleanup mutation matched part of `err` and failed to compile; the corrected,
exact-line mutation produced the intended assertion failure. No mutation remains.

`TestOwnerPublicationLabels` also failed first when a description retained owner
metadata but changed its displayed label to confined. Publication and evidence
labels now retain owner mode or the stronger unconfined warning. The targeted
team publication, Git and isolation tests passed after that change.

The owner live harness builds the real instance and runner without a certificate
overlay, signs in normally, enrols a disposable runner and uses only `claude-a`.
It verifies a coordinator reply and `propose_project` through the HTTP forms,
runner protocol and rendered conversation. It starts with no budgets and checks
that defaults were saved. The implementation leg runs the production launch
path, Claude adapter, namespace, tool proxy and journal in a separate harness
process against a local Git repository. Claude writes the requested change;
the harness commits it on `equipo/owner-mode` and checks that `main` is unchanged.
That repository has no remote. This leg does not exercise remote publication or
the complete queued task workflow.

Earlier harness attempts caught two setup mistakes: supplying a different
executable to the containment manager, and omitting the implement profile's
`submit_render` tool. The exact process-identity and tool-inventory guards rejected
both. The harness was fixed; neither production guard was relaxed.

The complete live gate passed twice consecutively in **51.75 s and 52.51 s**.
The final follow-up run passed in **49.57 s** after the certificate checks were
made explicit short-circuits and unused harness configuration was removed.
Across eight harness invocations there were **18 attempted turns**, conservatively
including two turns rejected during CLI initialization. Twelve coordinator turns
and four implementation turns completed. The other harness failure happened
before an implementation turn. This stays below the authorized 25-turn ceiling;
all live model use was through the harness and only on `claude-a`.

The first full `make -k ci` found an unused alias, review-inventory rows placed
outside the inventory section, and missing timing entry points in the two new
test packages. Those were corrected. A later targeted test also exposed a stale
binding revision that returned a refusal without posting a waiting note; it now
keeps the authority refusal and posts `admission_denied`. The second full run
caught an older test expecting the turn to remain silently queued. The revised
test requires both the original forbidden error and the visible denial state.
Known missing connections still use `waiting_connection`; failed database lookups
still roll back. The focused tests pass. No admission check was removed.

The first run's other gates passed. Its test receipt covered 37 packages with
one failing package, the copy inventory. Local timing warnings were runner
349.601 s (330 s limit), discovery 10.144 s (10 s), provider 21.420 s (15 s),
Claude 46.618 s (45 s) and Codex 39.033 s (35 s). These are warnings locally but
failures when CI enforces timing. No limit was raised. The third and final full invocation ran **38 test packages with zero failed**.
Adapter, namespace, migration and performance checks passed; cold boot was
104 ms against 500 ms. It exited **2 solely because the size gate had already
seen the conversation package at 5,005 lines against 5,000**. The shared blocked
turn query was moved into the helper package. On the final files,
`make build vet fmt-check staticcheck budget` exited **0**, with all 50 directories
inside their unchanged limits. Focused owner/coordinator polling and acceptance
tests passed after that move, as did the reference scan. There was no fourth
full invocation, respecting the brief's two-rerun limit. Do not describe this as
a clean exit from the complete CI command.

Final local timing warnings were runner 354.056 s, discovery 10.238 s, provider
22.234 s, Claude 47.484 s and Codex 39.758 s against the same limits above.
The controller must retain that hosted-CI timing caveat.

The recorded coordinator contracts passed with
`CGO_ENABLED=0 go test ./internal/runner/transporttest ./internal/runnerproto -run '^TestCoordinatorRecorded' -count=1`.
The publication-label regression was checked with
`CGO_ENABLED=0 go test ./internal/equipo/team -run 'TestOwnerPublicationLabels|TestPublication|TestGit|TestIsolation' -count=1`.

Mutation commands used `CGO_ENABLED=0 go test <package> -run <filter> -count=1`,
one guard at a time. Each row below failed with its guard broken and passed after
restoration:

| Package | Individual filters |
| --- | --- |
| `./internal/runner/certified/discoverytest` | `^TestOwnerConnectionGuards/binary$`, `^TestOwnerConnectionGuards/preflight$`, `^TestOwnerConnectionGuards/cleanup$` |
| `./internal/runner/certified` | `^TestOwnerRouteGuards/person$`, `^TestOwnerRouteGuards/runner$`, `^TestOwnerRouteGuards/tainted$` |
| `./internal/equipo/ownermode` | `^TestOwnerEligibilityGuards/foreign$`, `^TestOwnerEvidenceCannotLoseMode$` |
| `./internal/ownermodetest` | `^TestOwnerModeSelectionAndDefaults$`, `^TestOwnerModeFallback$`, `^TestOwnerModeDenialNote$` |

## Pending copy and controller action

Three new entries in `internal/equipo/copy.go` are individually marked
`COPY REVIEW PENDING`: `isolation.owner_mode`, `connections.owner_mode` and
`coordinator.admission_denied`. They are also in the existing review inventory.
They remain a release review item under the brief's explicit no-server instruction.
The README is unchanged.

Review and push the resulting commit through the controller. No merge, push or
deployment is authorized by this brief. All harness processes stopped and their scratch directories were removed. Session
logs are removed after their results are recorded here.
