# Live turn failures

Both providers now complete a specialist's first turn and focused sandbox
probes. Both coordinator fixtures complete their single structured question
with the exact expected tool inventory. This is debugging evidence, not release
certification. The full live gate was not run.

## Causes and fixes

The saved run `run-2006336109` identifies Claude's first failure without
another model call: its `system/init` frame reports `permissionMode: default`
and omits `mcp__equipo__permission` from the model-visible tools. The launcher
expected `manual` and counted that callback as a visible tool. It rejected the
frame and cancelled the process before any assistant response. The caller then
replaced the reason with `provider_uncertain`.

The launcher still requests manual permissions and uses the same permission
callback, sandbox settings and exact tool policy. Init validation now requires
the pinned binary's observed `default` value and exact visible inventory. It
rejects other modes, missing tools, extra tools and duplicate tools. The direct
fixture's readback and coordinator inventory use the same observed convention.
Its specialist probe inventory records the permission callback as non-exposed.

Claude failures now emit a structured terminal payload after process cleanup:
fixed reason category, last frame category, exit code, signal, stderr category
and egress-denial count. Unknown measurements remain null. Raw stderr and
untrusted frame-type text never enter that payload. Policy rejection is retained
instead of being overwritten by incomplete-turn cleanup. The journal retains
the event, and the direct driver saves `turn-N-failure.json` before returning an
error that names it. The egress relay counts rejected CONNECT requests without
recording their submitted destinations.

Codex's original mount error was caused by redundant denials, rather than a
missing outer `/dev` mount. Both the earlier nesting probe and production use
`--dev /dev` and `--proc /proc`. The earlier probe denied an ordinary sentinel;
it did not combine the production denials. Codex masks `/proc`, then tries to
mask `/dev/fd`, whose symlink now points into the masked tree. Removing that
redundant entry exposed a second failure: masking `/tool` read-only before
creating a child mask for `/tool/equipo.sock`. The policy now denies the parent
directories. The same protected paths remain inaccessible. A nested bubblewrap
test reproduces both original mount failures when either child entry returns.
No device binds, mount propagation changes or sandbox bypasses were needed.

Once those failures were fixed, the live launches exposed these additional
pinned behaviors:

- Claude writes `.last-cleanup` after a turn. Only that exact 24-byte regular
  file is accepted, under version 2.1.312.
- Codex writes a three-byte `.sandbox_migration`, an empty coordination lock,
  empty UUIDv7 thread locks, and the three `thread_history_1.sqlite` database
  files. These names, kinds and applicable sizes are checked under 0.165.0;
  existing owner, hard-link, symlink and policy-file checks still apply.
- A fresh Codex thread has no rollout to resume before turn 1. The first turn
  uses the effective policy already verified by `thread/start`, with fresh
  account/config/source checks. Later turns still reassert and validate the
  saved thread's policy. Resume requests exclude old turns.
- Resume emits the completed turn's usage snapshot again. One exact snapshot
  replay is accepted per resume, compared with the previously observed
  thread, turn and counters. It is retained in capture but not counted again
  or assigned to the next turn. Changed snapshots still fail closed.
- Codex discovers an empty disabled `/workspace/.codex` project layer lazily.
  Validation accepts one such layer with the exact observed disabled reason.
  Enabled, nonempty, duplicated or differently located layers remain rejected.
- Subscription rate-limit notifications have no session ID. They remain in
  capture and are not projected as session events. Requests and malformed
  envelopes are rejected. The five exact deprecation notices generated by the
  coordinator's disabled legacy flags receive the same treatment. Other
  notices and account-change events remain rejected.

## Live launches

All times below are UTC on 2026-11-05. Only `claude-a` and `codex`, both confirmed
as `paul@tito.io`, were selected. Their source homes were
`account-1004981892` and `account-2598223264` under the existing accounts directory.
The other five homes were not launched or read. The bindings and setup-state
files were read only. No sign-in or configuration change was performed.

The temporary harness used `CertificationInputs`, production account leases,
launchers, capture/journal, tool broker, namespace manager and turn dispatch.
It used the pinned executables and a test executable running the production
namespace entry point. It did not call a provider CLI with hand-built flags.
It used synthetic markers in disposable workspaces and staged homes, never
source-home sentinels. Runtime investigations inspected names, sizes and modes
only. No credential contents were inspected, printed, copied manually or hashed
by the harness. Credential staging was performed only by the product lease.

Each row is one sequential tuple invocation, including its production
preflights. A launched Claude tuple includes auth-status, empty-input dependency
preflight and session processes; Codex includes preflight and session processes.
The three setup-only rows started no provider process. The interval bounds all
subprocess launches for that row. No tuples ran concurrently.

The Calls column charges admissions conservatively, including those rejected
before a model prompt reached the provider. Its total is **26 of 40**. Sixteen
turns are directly visible as Claude result frames or Codex turn-start frames;
additional cancelled or rejected admissions remain charged in the 26.

| UTC interval | Tuple | Debug ID | Calls | Outcome |
|---|---|---:|---:|---|
| 07:40:40–07:40:41 | Claude Engineering | 2828611459 | 0 | Harness executable identity check; no provider launch |
| 07:41:05–07:41:06 | Claude Engineering | 1814237159 | 0 | Harness bindings path correction; no provider launch |
| 07:41:55–07:42:10 | Claude Engineering | 4019389454 | 3 | Two turns completed; cleanup marker blocked next admission |
| 07:42:54–07:42:55 | Codex Engineering | 3811154342 | 0 | Binary source-path guard; no provider launch |
| 07:43:26–07:43:38 | Claude Engineering | 3507904384 | 3 | Reproduced cleanup marker; captured metadata |
| 07:44:05–07:44:12 | Codex Engineering | 357022885 | 0 | `/dev/fd` fixed; redundant socket mask failed |
| 07:44:29–07:44:54 | Claude Engineering | 109350906 | 3 | First turn, native Read probes and Bash probes completed |
| 07:45:26–07:45:34 | Codex Engineering | 1726159049 | 1 | Mounts fixed; runtime thread state rejected |
| 07:46:25–07:46:31 | Codex Engineering | 3087197226 | 1 | Transient per-thread lock rejected |
| 07:47:02–07:47:08 | Codex Engineering | 3078603337 | 1 | Captured active lock metadata before shutdown |
| 07:47:42–07:47:50 | Codex Engineering | 1095714057 | 1 | Premature resume: no rollout found |
| 07:49:27–07:49:39 | Codex Engineering | 660293223 | 1 | Model answered; unscoped rate notice rejected |
| 07:51:10–07:51:19 | Codex Engineering | 2991876854 | 2 | Turn 1 completed; thread-history files blocked next admission |
| 07:51:52–07:51:59 | Codex Engineering | 1455404923 | 1 | Empty disabled project layer rejected |
| 07:53:12–07:53:23 | Codex Engineering | 4077550212 | 2 | Turn 1 completed; resume usage replay raced with turn 2 |
| 07:55:03–07:55:35 | Codex Engineering | 2919593894 | 2 | Two turns completed; workspace read succeeded |
| 07:56:02–07:56:11 | Claude Coordinator | 748372905 | 1 | One question, exact inventory, fixture passed |
| 07:56:20–07:56:27 | Codex Coordinator | 1600362866 | 1 | Unscoped legacy-flag notices rejected |
| 07:57:54–07:58:11 | Codex Coordinator | 2683324626 | 1 | One question, exact inventory, fixture passed |
| 07:59:13–07:59:44 | Codex Engineering | 1870392552 | 2 | First turn and deterministic access probe completed |

Claude's native Read returned the synthetic workspace marker and rejected the
staged-home marker, `/proc/1/root` and `/dev/fd/0` through configured permission
rules. Bash read the workspace marker; the staged-home marker was hidden and
`/proc/1/root` returned permission denied. Its own stdin through `/dev/fd/0`
was empty, not a denied handle; that is not claimed as a protected-file denial.

Codex initially declined to call tools on paths described as denied. That
model refusal was not treated as proof. A later real shell call checked
`os.access(path, os.R_OK)` without reading contents. Its output was:

```text
/workspace/sentinel                                      True
/home/runner/equipo-read-sentinel                         False
/proc/1/root/home/runner/equipo-read-sentinel               False
/tool/equipo.sock                                        False
```

These are focused debugging probes, not certification of every tool or account.
The coordinator runs used the existing fixture line, not a real team operation.
Temporary captures and fixture observations were removed, with no certification
bundle, release evidence or installed capability change.

## Tests and guard checks

Every behavior change began with a failing targeted test. Initial failures were:
`TestPinnedLiveInit` rejected the recorded init; `TestClaudeFailureDiagnostics`
received opaque failures; `TestEgressDenialCount` had no counter; and
`TestNestedProcDeny` reproduced the nested mount errors. The cleanup-marker,
thread-state, first-turn, rate-notice, disabled-project, resume-usage and
coordinator-notice tests each failed before their corresponding fix.

Targeted commands used `CGO_ENABLED=0 go test <package> -run <test> -count=1`.
The complete Claude and Codex adapter suites passed after restoration, as did
the focused provider, relay, containment and coordinator-inventory tests.

For each row below, the listed expression was deliberately broken, the named
test failed, and the source was restored. The mutation runs all exited 1.

| Broken behavior | Package under `internal/runner/` | Test |
|---|---|---|
| Accept other permission modes | `provider/claude` | `TestPinnedLiveInit` |
| Ignore visible tool inventory | `provider/claude` | `TestPinnedLiveInit` |
| Emit raw stderr | `provider/claude` | `TestFailurePayloadSanitized` |
| Stop counting relay denials | `egress` | `TestEgressDenialCount` |
| Restore redundant `/dev/fd` mask | `provider/codex` | `TestNestedProcDeny` |
| Restore redundant socket mask | `provider/codex` | `TestNestedProcDeny` |
| Accept other cleanup-marker sizes | `provider` | `TestClaudeLiveCleanupMarker` |
| Accept nonempty thread locks | `provider` | `TestCodexLiveThreadState` |
| Resume a fresh unpersisted thread | `provider/codex` | `TestCodexFirstTurnDoesNotResumeUnpersistedThread` |
| Accept changed replayed counters | `provider/codex` | `TestCodexResumeUsageSnapshot` |
| Accept nonempty disabled project config | `provider/codex` | `TestCodexDisabledEmptyProjectLayer` |
| Accept extra notice parameters | `provider/codex` | `TestPinnedCoordinatorNotices` |

The first `make -k ci` completed with exit 2. Build, vet, formatting,
staticcheck, govulncheck, gitleaks, size budgets, migration and performance passed.
The reference scanner found the supplied brief's unclassified runtime reference;
that exact line was added to its inventory. Nine Codex constructor hashes changed
with the parent-directory denial fix. Their entries in the release manifest were
updated, retaining `uncertified` status and empty certification/evidence lists.
The inventory tests then passed.

The full fake driver also exposed its remaining assumption that Claude's
permission callback was model-visible. Specialist probes now record that callback
as non-exposed, matching the launcher and coordinator checks. One unrelated
`TestReviewUnconfirmedExpiredAccountSignsIn/claude` run returned `account_busy`;
its isolated rerun passed, without a product change. Local timing notes exceeded
some package budgets; those notes are not a claim that CI timing limits passed.

The second `make -k ci` passed with exit 0. All 27 test packages passed,
followed by provider/check-sandbox, namespace and migration checks. Performance
checks also passed. There were two full gate invocations in total, one initial
run and one permitted rerun. No checks or timing budgets were weakened.

The final scratch cleanup removed the temporary harness, binaries, logs,
mutation script and captures from the task-owned directory under `$TMPDIR`.
No staged account homes, namespace state or debugging processes remained.
No copy-review server was started. The branch is `live-turn-failures`; no merge,
default-branch push or deployment was performed.
