# Try Equipo review fixes: controller report

All C1–C4, I1–I4 and M1–M6 changes are implemented on the existing try-equipo
branch. The replacement full CI and final setup timing check passed.
No real sign-ins, provider runs, additional agents,
copy-review server, release, merge or deployment were used. README is unchanged.

Sign-in and live-gate subprocesses retain the terminal process group. Other
guide commands retain process-group cancellation. The official CLI receives
terminal file descriptors directly for stdin, stdout and stderr; login output
never passes through a guide buffer. Codex uses device authentication, and both
providers receive SHET_BRIDGE. Pseudo-terminal tests send input through /dev/tty
and check both output streams.

The guide resolves and hashes the provider executables, copies them into private
try/bin files with mode 0700, then uses those copies for version checks, sign-in,
identity probes, runner configuration and live certification. The code-mode host
is resolved beside the original resolved Codex executable. Executables under
interactive or ZeroSub homes, including symlink aliases, are refused before use.

Every guide failure prints its phase, cause and retry guidance. Startup errors
also print diagnostics. The missing-Go shell refusal reads the same copy catalog.
Build diagnostics and live-test stderr are retained in the appropriate output.
The live go test uses -timeout=0; the configured calibration deadline still
limits the driver.

Confirmed homes pass the provider's OpenAccount and Validate checks before use.
Account maintenance triggers a fresh official sign-in. The identity must still
match after sign-in. All homes are validated, including accounts outside the
primary certification pair. Unconfirmed homes do not increase the minimum;
reducing a count drops them from setup state while leaving their directories on
disk. Confirmed homes and IDs are retained. Base paths use the operating system
account's home rather than the HOME environment variable.

Resume and driver startup remove change-source-* and change-policy-* scratch
only after checking recorded controllers and retiring their namespaces. The
check compares boot identity, PID and start ticks, so PID reuse cannot block
cleanup or cause an unrelated process to be stopped. Both providers' second
homes and every additional connected home receive isolation sentinels and probes.
Known tools that cannot request a filesystem read record not-applicable evidence;
unknown tools and filesystem readers still require denied-read observations.

The obsolete refresh branches in both launchers are removed. Runtime credential
changes require account maintenance even if an old test policy names an auth host.
Existing low-level AccountLease refresh tests remain, but launchers no longer
call that operation. Stale v1 refresh comments were corrected.

During implementation, containment's same-executable check exposed another
blocker in the original guide: both go test and resume tried to create the
manager outside the runner executable. These callers now invoke explicit
direct-live runner entry points. The live child retains terminal access; resume
uses process-group cancellation. The opt-in is required, configuration bytes
must match the caller's configuration, and failures retain their actual cause.
A test builds the runner and resumes empty fixture scratch in that process,
without starting providers.

## Verification

New tests were written first. Initial failures included missing helper symbols,
the existing rejection of not-applicable tool evidence. Early test runs also
caught an error in dropping sparse unconfirmed homes. Two fixture errors were
corrected: Python requires
os.open for the bidirectional terminal descriptor, and synthetic recovery records
need a manifest hash. Behavioral mutation checks below then verified the guards.

All commands below use CGO_ENABLED=0. Tests use Go-managed temporary directories
and do not require TMPDIR. Session scratch uses the supplied on-disk TMPDIR;
Go caches remain at their defaults.

Passing targeted commands:

- go test ./internal/tryequipo ./internal/directlive ./internal/runner/provider/... ./internal/plan3test -run 'TestReview|TestAccount|TestConnectAll|TestDuplicateAccount|TestLiveConfig|TestUpgradeOriginal|TestDirectLiveGateEvidence|TestPlan3ReleaseBoundaries/inventory|Test.*Refresh' -count=1
- go test ./internal/directlive -run '^TestDirectDriverFakeCLI/Engineering$' -count=1
- go test -tags direct_live ./cmd/equipo-runner -count=1

The fake Engineering run passed in 48.811s. It checks both providers' second-home
observations, pathless-tool evidence, source preservation and scratch cleanup.
The final targeted package run passed: directlive 1.172s, tryequipo 12.620s,
provider 3.074s, Claude 2.359s, Codex 0.755s, and plan3test 0.202s.
The tagged runner tests passed in 3.374s.

Each mutation was compile-valid, caused its targeted test to fail with exit 1,
and was restored. In C1, the background child printed tty-ready but could not
read the answer; the test killed it on timeout. Removing driver cleanup left
both injected scratch directories and failed the fake Engineering run.

| Broken guard | Command | Result |
| --- | --- | --- |
| C1 foreground | `go test ./internal/tryequipo -run ^TestReviewForegroundTerminal$ -count=1` | Failed, exit 1; restored |
| C2 device auth | `go test ./internal/tryequipo -run ^TestCodexAccountOfficialFlow$ -count=1` | Failed, exit 1; restored |
| C2 bridge | `go test ./internal/tryequipo -run ^TestDuplicateAccountRefusedAndRetryable$ -count=1` | Failed, exit 1; restored |
| C2 terminal output | `go test ./internal/tryequipo -run ^TestReviewForegroundTerminal/login$ -count=1` | Failed, exit 1; restored |
| C3 hashes | `go test ./internal/tryequipo -run ^TestReviewPrivateExecutables$ -count=1` | Failed, exit 1; restored |
| C3 forbidden homes | `go test ./internal/tryequipo -run ^TestReviewPrivateExecutables$ -count=1` | Failed, exit 1; restored |
| C3 sibling host | `go test ./internal/tryequipo -run ^TestReviewCodexSiblingHost$ -count=1` | Failed, exit 1; restored |
| C4 timeout | `go test ./internal/tryequipo -run ^TestReviewGateDeadlineAndGroups$ -count=1` | Failed, exit 1; restored |
| I1 cause | `go test ./internal/tryequipo -run ^TestReviewRefusalExplainsCause$ -count=1` | Failed, exit 1; restored |
| I2 validate homes | `go test ./internal/tryequipo -run ^TestReviewExpiredAccountSignsIn$ -count=1` | Failed, exit 1; restored |
| I3 resume scratch | `go test ./internal/directlive -run ^TestReviewResumeScratchAndParentIdentity$ -count=1` | Failed, exit 1; restored |
| I3 driver scratch | `go test ./internal/directlive -run ^TestDirectDriverFakeCLI/Engineering$ -count=1` | Failed, exit 1; restored |
| I4 Codex other home | `go test ./internal/directlive -run ^TestReviewAllOtherHomesProbed$ -count=1` | Failed, exit 1; restored |
| I4 all connected homes | `go test ./internal/tryequipo -run ^TestLiveConfigAccountChangeBothProviders$ -count=1` | Failed, exit 1; restored |
| M1 confirmed minimum | `go test ./internal/tryequipo -run ^TestReviewDropUnconfirmedHome$ -count=1` | Failed, exit 1; restored |
| M1 drop unconfirmed | `go test ./internal/tryequipo -run ^TestReviewDropUnconfirmedHome$ -count=1` | Failed, exit 1; restored |
| M2 system home | `go test ./internal/tryequipo -run ^TestReviewSystemHome$ -count=1` | Failed, exit 1; restored |
| M3 claude refresh | `go test ./internal/runner/provider/claude -run ^TestClaudeRefreshBeforeTurn$ -count=1` | Failed, exit 1; restored |
| M3 codex refresh | `go test ./internal/runner/provider/codex -run ^TestCodexRefreshAndAdmission$ -count=1` | Failed, exit 1; restored |
| M4 gate stderr | `go test ./internal/tryequipo -run ^TestReviewForegroundTerminal/gate$ -count=1` | Failed, exit 1; restored |
| M5 start ticks | `go test ./internal/directlive -run ^TestReviewResumeScratchAndParentIdentity$ -count=1` | Failed, exit 1; restored |
| M6 applicability | `go test ./internal/runner/provider -run ^TestReviewPathlessToolEvidence$ -count=1` | Failed, exit 1; restored |
| Runner delegation | `go test ./internal/directlive -run ^TestReviewControllerUsesRunner$ -count=1` | Failed, exit 1; restored |


The first size check exceeded the app's existing allowance by 23 lines.
Combining each pending copy annotation with its entry restored the budget;
no budget allowance changed. The changed guide path also required updating its
exact reference-inventory hash.

While CI was running, review found an unconfirmed expired home could be confirmed
and then fail validation without starting sign-in. The new regression failed
for both providers before the fix. A just-confirmed home now gets one additional
pass through validation and sign-in; another maintenance failure stops it.
The full tryequipo package passed after this final change (27.671s while CI ran),
and go vet ./internal/tryequipo passed. An overlay mutation disabling that retry
failed TestReviewUnconfirmedExpiredAccountSignsIn for both providers. The overlay
left the working source intact.

| Broken guard | Command | Result |
| --- | --- | --- |
| Unconfirmed maintenance | `go test -overlay=<scratch>/mutation-24.json ./internal/tryequipo -run '^TestReviewUnconfirmedExpiredAccountSignsIn$' -count=1` | Failed, exit 1; working source unchanged |

The first background make ci completed with exit 2. Its test step ran all 26
packages in 7m43.656s; the only failure was
TestFinalFixLiveGateRunnerEnvironment, which requires the literal installer
path using $HOME in the guide. The guide now retains that usual path and
explains that the setup uses the system home even when HOME differs. Several
existing timing limits produced advisory notes under shared load; no limit was
changed. The brief requested one complete CI run, but this failed result could
not satisfy the required passing gate, so a second full run was necessary.

A second resume regression was reproduced while the replacement CI run was
underway: interruption after saving confirmation but before writing the identity
marker caused validation to stop. The guide now finishes that missing marker
write while holding the home lock, after the provider observes the saved account
and version. It refuses a different identity without writing a marker. The
pre-fix test failed with provider_account_containment. The complete setup package
then passed in 15.213s, followed by its vet check; the final marker identity test
passed in 0.478s. A targeted staticcheck of internal/tryequipo also passed.
These supplemental checks cover the correction made after the replacement
full-suite invocation started.

| Broken guard | Command | Result |
| --- | --- | --- |
| Finish the interrupted marker write | `go test -overlay=<scratch>/mutation-25.json ./internal/tryequipo -run '^TestReviewResumeBeforeIdentityMarker$' -count=1` | Failed, exit 1; working source unchanged |
| Verify identity before restoring the marker | `go test -overlay=<scratch>/mutation-26.json ./internal/tryequipo -run '^TestReviewResumeBeforeIdentityMarker$' -count=1` | Failed, exit 1; working source unchanged |

All 26 deliberate mutations were caught. Session overlays and logs are removed
at handoff. Both full CI outcomes are recorded; no failed result is treated as passing.

## Final CI result

The replacement background make ci finished with exit 0. Its full test step ran
27 packages without cached results or failures in 5m27.323s. Build, vet,
formatting, staticcheck, govulncheck, gitleaks, size budgets, adapter checks,
namespace checks, migrations and performance all passed. No reachable
vulnerabilities or leaked secrets were reported. Cold boot had a 124ms median
against 500ms, and every measured GET stayed below 150ms.

The setup package took 14.944s in that run, above its 10s CI timing limit
(reported locally as an advisory). Independent fake-account tests now run in
parallel. Their bridge fixture is fixed once in the test process; tests that
change other environment values remain serial. No assertions or limits changed.
The final test-only scheduling change was verified with:

`CI=1 CGO_ENABLED=0 go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -count=1 ./internal/tryequipo`

Result: exit 0, one uncached package, zero failures; package time 5.021s and
whole step 5.580s. The final package vet check also passed. The full CI rerun was
not repeated after this test-only scheduling change.

## Copy and limits

Changed runtime messages remain individually marked COPY REVIEW PENDING in
internal/equipo/copy.go. Their current text is in the existing Plan 3 copy
inventory. Guide changes are flagged as pending copy review. The controller
report records implementation and test evidence; no copy-review server was run.
Live provider certification still has to be performed by Paul before release.
