# Controller report: try-equipo re-check fixes

Brief: CODEX-BRIEF-try-equipo-4.md. Work continues on try-equipo from
`d754720`, which adds the brief after `a7a507c`.

## Changes

R1: Codex and its sibling code-mode host may be sourced from the packages
subdirectory of the system Codex home or CODEX_HOME. Both the submitted and
resolved source paths are checked. The exception preserves other interactive
home restrictions and the ZeroSub restriction, including overlapping homes.
Other tools do not receive the exception. The bytes must match their pin before
a private independent copy is written. Copy destinations receive the original
home restrictions without the packages exception. EQUIPO_CODEX_PATH still
selects the source, and the host still comes from beside the resolved Codex.

R2: docs/live-gate.md now says that the guide disables the Go test timeout with
`-timeout=0`; the live driver enforces the calibration duration.

R3: Each new runtime marker and the matching guided-setup inventory rows use
Paul's exact 2026-11-04 acceptance marker. The guide carries the equivalent
document marker. Runtime string values are unchanged. Historical reports and
older inventory rows retain their original status. No existing reference hash
changed; three exact allowances were added for the new ZeroSub test fixtures.
The separate release copy check still rejects older pending Plan 3 inventory
rows, as it did at the starting revision. That check is outside this brief's
full CI gate; this work does not certify a release.

## Verification

All commands use CGO_ENABLED=0 and the default Go caches. New fixtures use
`t.TempDir()` and do not read or require TMPDIR.

- Before implementation: `go test ./internal/tryequipo -run '^TestReviewPrivateExecutables$' -count=1`
  exited 1. Matching packages, outside symlinks, and configured sibling discovery
  were refused by the original implementation.
- After implementation: `go test ./internal/tryequipo -run '^TestReview(PrivateExecutables|CodexSiblingHost)$' -count=1`
  exited 0.
- `go test ./internal/tryequipo -count=1` initially exited 0 in 4.319s.
  A later run exited 1 in TestUpgradeOriginalThreeHomes with
  provider_account_busy. The isolated rerun below passed; no unrelated login
  behavior was changed.
- `go test ./internal/tryequipo -run '^Test(UpgradeOriginalThreeHomes|ReviewPrivateExecutables|ReviewCodexSiblingHost)$' -count=1`
  exited 0 in 1.610s, including the final default-home coverage.
- `python3 scripts/runner-dead-references.py` exited 0 after the new test
  references were inventoried.

Each mutation below ran through a Go overlay, leaving the working source
unchanged. The command for each row was:

```sh
CGO_ENABLED=0 go test -overlay=<scratch>/<mutation>.json ./internal/tryequipo -run '^TestReviewPrivateExecutables$/packages/<case>' -count=1
```

| Mutation | Case | Observed result |
| --- | --- | --- |
| deny-packages | matching | Exit 1: matching package source refused |
| allow-other-home | non-packages | Exit 1: forbidden executable copied |
| skip-hash | wrong-hash | Exit 1: wrong hash copied |
| allow-destination | destination | Exit 1: all four protected destinations accepted |
| skip-real-path | symlink-escape | Exit 1: package symlink escaped to config |
| skip-lexical-path | symlink-from-config | Exit 1: config alias accepted |
| allow-unpinned-tool | unpinned-tool | Exit 1: unhashed tool accepted from packages |
| allow-prefix | packages-prefix | Exit 1: sibling directory mistaken for packages |

The first isolated symlink mutation runs exposed shared fixture setup between
subtests. Each symlink case now creates its own target and parent directory.
Both isolated cases passed without mutation, then failed at their intended
security assertions with the relevant guard removed.

## Corrections required by the first full gate

The first `make -k ci` completed with exit 2. Gitleaks reported two historical
occurrences of the same unsigned expired-token fixture in `a7a507c`. Its exact
value is now allowed in .gitleaks.toml; no rule, file, or directory is exempted.
The isolated scan then exited 0 with no findings.

The full test step ran 25 packages uncached in 5m1.535s and failed two packages:

- TestPlan3ReleaseBoundaries/inventory still required every entry to be pending.
  It now also accepts Paul's exact dated marker for the guided-setup rows.
  Other rows keep the previous requirement. The isolated inventory test passed.
- TestAccountResumeAndMismatch failed with provider_account_busy. A duplicate
  descriptor can retain a flock after its owner's descriptor closes, including
  the interval between a concurrent fork and exec. Deterministic regressions
  reproduced this for both AccountLease.Close and the guide's home-lock cleanup.
  Both now explicitly unlock before closing. The existing concurrent-lease
  refusal remains tested. A run with only the lease correction still failed
  during an unconfirmed-account retry; after both corrections,
  `go test ./internal/tryequipo -count=3` passed in 12.366s.

Build, vet, formatting, static analysis, vulnerability checks, size budgets,
adapter checks, namespace checks, migrations and performance passed in the
first full run. No reachable vulnerability was found. Cold boot measured
104ms against 500ms; all screen measurements passed.

Additional commands, with CGO_ENABLED=0:

| Command | Before fix | After fix |
| --- | --- | --- |
| `go test ./internal/runner/provider -run '^TestAccountHomeMutation$/lock_release_with_inherited_descriptor$' -count=1` | Exit 1, account busy | Included in passing lock checks below |
| `go test ./internal/runner/provider -run '^TestAccountHomeMutation$/lock' -count=1` | Not run | Exit 0 |
| `go test ./internal/tryequipo -run '^TestHomeLockReleaseWithInheritedDescriptor$' -count=1` | Exit 1, lock retained | Included in the three passing package runs |
| `go test ./internal/plan3test -run '^TestPlan3ReleaseBoundaries$/inventory$' -count=1` | Failed in full gate | Exit 0 |

The lease-unlock and guide-unlock overlays remove each explicit unlock. Running
its regression command above with `-overlay=<scratch>/<name>.json` exited 1 at
the intended lock assertion in both cases. Working source was unchanged. All
ten deliberate mutations were caught.

## Final gate

R4: Run `make -k ci` after freezing all tracked changes, including this report.
The final exit status and any retry are recorded in the commit body and the
three-line handoff, so recording the outcome does not change the tested tree.
No live gate, real sign-in, deployment, or copy-review server is authorized or
started. Session scratch and mutation overlays are removed before handoff.
