| 1 | # Try Equipo review fixes: controller report |
| 2 | |
| 3 | All C1–C4, I1–I4 and M1–M6 changes are implemented on the existing try-equipo |
| 4 | branch. The replacement full CI and final setup timing check passed. |
| 5 | No real sign-ins, provider runs, additional agents, |
| 6 | copy-review server, release, merge or deployment were used. README is unchanged. |
| 7 | |
| 8 | Sign-in and live-gate subprocesses retain the terminal process group. Other |
| 9 | guide commands retain process-group cancellation. The official CLI receives |
| 10 | terminal file descriptors directly for stdin, stdout and stderr; login output |
| 11 | never passes through a guide buffer. Codex uses device authentication, and both |
| 12 | providers receive SHET_BRIDGE. Pseudo-terminal tests send input through /dev/tty |
| 13 | and check both output streams. |
| 14 | |
| 15 | The guide resolves and hashes the provider executables, copies them into private |
| 16 | try/bin files with mode 0700, then uses those copies for version checks, sign-in, |
| 17 | identity probes, runner configuration and live certification. The code-mode host |
| 18 | is resolved beside the original resolved Codex executable. Executables under |
| 19 | interactive or ZeroSub homes, including symlink aliases, are refused before use. |
| 20 | |
| 21 | Every guide failure prints its phase, cause and retry guidance. Startup errors |
| 22 | also print diagnostics. The missing-Go shell refusal reads the same copy catalog. |
| 23 | Build diagnostics and live-test stderr are retained in the appropriate output. |
| 24 | The live go test uses -timeout=0; the configured calibration deadline still |
| 25 | limits the driver. |
| 26 | |
| 27 | Confirmed homes pass the provider's OpenAccount and Validate checks before use. |
| 28 | Account maintenance triggers a fresh official sign-in. The identity must still |
| 29 | match after sign-in. All homes are validated, including accounts outside the |
| 30 | primary certification pair. Unconfirmed homes do not increase the minimum; |
| 31 | reducing a count drops them from setup state while leaving their directories on |
| 32 | disk. Confirmed homes and IDs are retained. Base paths use the operating system |
| 33 | account's home rather than the HOME environment variable. |
| 34 | |
| 35 | Resume and driver startup remove change-source-* and change-policy-* scratch |
| 36 | only after checking recorded controllers and retiring their namespaces. The |
| 37 | check compares boot identity, PID and start ticks, so PID reuse cannot block |
| 38 | cleanup or cause an unrelated process to be stopped. Both providers' second |
| 39 | homes and every additional connected home receive isolation sentinels and probes. |
| 40 | Known tools that cannot request a filesystem read record not-applicable evidence; |
| 41 | unknown tools and filesystem readers still require denied-read observations. |
| 42 | |
| 43 | The obsolete refresh branches in both launchers are removed. Runtime credential |
| 44 | changes require account maintenance even if an old test policy names an auth host. |
| 45 | Existing low-level AccountLease refresh tests remain, but launchers no longer |
| 46 | call that operation. Stale v1 refresh comments were corrected. |
| 47 | |
| 48 | During implementation, containment's same-executable check exposed another |
| 49 | blocker in the original guide: both go test and resume tried to create the |
| 50 | manager outside the runner executable. These callers now invoke explicit |
| 51 | direct-live runner entry points. The live child retains terminal access; resume |
| 52 | uses process-group cancellation. The opt-in is required, configuration bytes |
| 53 | must match the caller's configuration, and failures retain their actual cause. |
| 54 | A test builds the runner and resumes empty fixture scratch in that process, |
| 55 | without starting providers. |
| 56 | |
| 57 | ## Verification |
| 58 | |
| 59 | New tests were written first. Initial failures included missing helper symbols, |
| 60 | the existing rejection of not-applicable tool evidence. Early test runs also |
| 61 | caught an error in dropping sparse unconfirmed homes. Two fixture errors were |
| 62 | corrected: Python requires |
| 63 | os.open for the bidirectional terminal descriptor, and synthetic recovery records |
| 64 | need a manifest hash. Behavioral mutation checks below then verified the guards. |
| 65 | |
| 66 | All commands below use CGO_ENABLED=0. Tests use Go-managed temporary directories |
| 67 | and do not require TMPDIR. Session scratch uses the supplied on-disk TMPDIR; |
| 68 | Go caches remain at their defaults. |
| 69 | |
| 70 | Passing targeted commands: |
| 71 | |
| 72 | - 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 |
| 73 | - go test ./internal/directlive -run '^TestDirectDriverFakeCLI/Engineering$' -count=1 |
| 74 | - go test -tags direct_live ./cmd/equipo-runner -count=1 |
| 75 | |
| 76 | The fake Engineering run passed in 48.811s. It checks both providers' second-home |
| 77 | observations, pathless-tool evidence, source preservation and scratch cleanup. |
| 78 | The final targeted package run passed: directlive 1.172s, tryequipo 12.620s, |
| 79 | provider 3.074s, Claude 2.359s, Codex 0.755s, and plan3test 0.202s. |
| 80 | The tagged runner tests passed in 3.374s. |
| 81 | |
| 82 | Each mutation was compile-valid, caused its targeted test to fail with exit 1, |
| 83 | and was restored. In C1, the background child printed tty-ready but could not |
| 84 | read the answer; the test killed it on timeout. Removing driver cleanup left |
| 85 | both injected scratch directories and failed the fake Engineering run. |
| 86 | |
| 87 | | Broken guard | Command | Result | |
| 88 | | --- | --- | --- | |
| 89 | | C1 foreground | `go test ./internal/tryequipo -run ^TestReviewForegroundTerminal$ -count=1` | Failed, exit 1; restored | |
| 90 | | C2 device auth | `go test ./internal/tryequipo -run ^TestCodexAccountOfficialFlow$ -count=1` | Failed, exit 1; restored | |
| 91 | | C2 bridge | `go test ./internal/tryequipo -run ^TestDuplicateAccountRefusedAndRetryable$ -count=1` | Failed, exit 1; restored | |
| 92 | | C2 terminal output | `go test ./internal/tryequipo -run ^TestReviewForegroundTerminal/login$ -count=1` | Failed, exit 1; restored | |
| 93 | | C3 hashes | `go test ./internal/tryequipo -run ^TestReviewPrivateExecutables$ -count=1` | Failed, exit 1; restored | |
| 94 | | C3 forbidden homes | `go test ./internal/tryequipo -run ^TestReviewPrivateExecutables$ -count=1` | Failed, exit 1; restored | |
| 95 | | C3 sibling host | `go test ./internal/tryequipo -run ^TestReviewCodexSiblingHost$ -count=1` | Failed, exit 1; restored | |
| 96 | | C4 timeout | `go test ./internal/tryequipo -run ^TestReviewGateDeadlineAndGroups$ -count=1` | Failed, exit 1; restored | |
| 97 | | I1 cause | `go test ./internal/tryequipo -run ^TestReviewRefusalExplainsCause$ -count=1` | Failed, exit 1; restored | |
| 98 | | I2 validate homes | `go test ./internal/tryequipo -run ^TestReviewExpiredAccountSignsIn$ -count=1` | Failed, exit 1; restored | |
| 99 | | I3 resume scratch | `go test ./internal/directlive -run ^TestReviewResumeScratchAndParentIdentity$ -count=1` | Failed, exit 1; restored | |
| 100 | | I3 driver scratch | `go test ./internal/directlive -run ^TestDirectDriverFakeCLI/Engineering$ -count=1` | Failed, exit 1; restored | |
| 101 | | I4 Codex other home | `go test ./internal/directlive -run ^TestReviewAllOtherHomesProbed$ -count=1` | Failed, exit 1; restored | |
| 102 | | I4 all connected homes | `go test ./internal/tryequipo -run ^TestLiveConfigAccountChangeBothProviders$ -count=1` | Failed, exit 1; restored | |
| 103 | | M1 confirmed minimum | `go test ./internal/tryequipo -run ^TestReviewDropUnconfirmedHome$ -count=1` | Failed, exit 1; restored | |
| 104 | | M1 drop unconfirmed | `go test ./internal/tryequipo -run ^TestReviewDropUnconfirmedHome$ -count=1` | Failed, exit 1; restored | |
| 105 | | M2 system home | `go test ./internal/tryequipo -run ^TestReviewSystemHome$ -count=1` | Failed, exit 1; restored | |
| 106 | | M3 claude refresh | `go test ./internal/runner/provider/claude -run ^TestClaudeRefreshBeforeTurn$ -count=1` | Failed, exit 1; restored | |
| 107 | | M3 codex refresh | `go test ./internal/runner/provider/codex -run ^TestCodexRefreshAndAdmission$ -count=1` | Failed, exit 1; restored | |
| 108 | | M4 gate stderr | `go test ./internal/tryequipo -run ^TestReviewForegroundTerminal/gate$ -count=1` | Failed, exit 1; restored | |
| 109 | | M5 start ticks | `go test ./internal/directlive -run ^TestReviewResumeScratchAndParentIdentity$ -count=1` | Failed, exit 1; restored | |
| 110 | | M6 applicability | `go test ./internal/runner/provider -run ^TestReviewPathlessToolEvidence$ -count=1` | Failed, exit 1; restored | |
| 111 | | Runner delegation | `go test ./internal/directlive -run ^TestReviewControllerUsesRunner$ -count=1` | Failed, exit 1; restored | |
| 112 | |
| 113 | |
| 114 | The first size check exceeded the app's existing allowance by 23 lines. |
| 115 | Combining each pending copy annotation with its entry restored the budget; |
| 116 | no budget allowance changed. The changed guide path also required updating its |
| 117 | exact reference-inventory hash. |
| 118 | |
| 119 | While CI was running, review found an unconfirmed expired home could be confirmed |
| 120 | and then fail validation without starting sign-in. The new regression failed |
| 121 | for both providers before the fix. A just-confirmed home now gets one additional |
| 122 | pass through validation and sign-in; another maintenance failure stops it. |
| 123 | The full tryequipo package passed after this final change (27.671s while CI ran), |
| 124 | and go vet ./internal/tryequipo passed. An overlay mutation disabling that retry |
| 125 | failed TestReviewUnconfirmedExpiredAccountSignsIn for both providers. The overlay |
| 126 | left the working source intact. |
| 127 | |
| 128 | | Broken guard | Command | Result | |
| 129 | | --- | --- | --- | |
| 130 | | Unconfirmed maintenance | `go test -overlay=<scratch>/mutation-24.json ./internal/tryequipo -run '^TestReviewUnconfirmedExpiredAccountSignsIn$' -count=1` | Failed, exit 1; working source unchanged | |
| 131 | |
| 132 | The first background make ci completed with exit 2. Its test step ran all 26 |
| 133 | packages in 7m43.656s; the only failure was |
| 134 | TestFinalFixLiveGateRunnerEnvironment, which requires the literal installer |
| 135 | path using $HOME in the guide. The guide now retains that usual path and |
| 136 | explains that the setup uses the system home even when HOME differs. Several |
| 137 | existing timing limits produced advisory notes under shared load; no limit was |
| 138 | changed. The brief requested one complete CI run, but this failed result could |
| 139 | not satisfy the required passing gate, so a second full run was necessary. |
| 140 | |
| 141 | A second resume regression was reproduced while the replacement CI run was |
| 142 | underway: interruption after saving confirmation but before writing the identity |
| 143 | marker caused validation to stop. The guide now finishes that missing marker |
| 144 | write while holding the home lock, after the provider observes the saved account |
| 145 | and version. It refuses a different identity without writing a marker. The |
| 146 | pre-fix test failed with provider_account_containment. The complete setup package |
| 147 | then passed in 15.213s, followed by its vet check; the final marker identity test |
| 148 | passed in 0.478s. A targeted staticcheck of internal/tryequipo also passed. |
| 149 | These supplemental checks cover the correction made after the replacement |
| 150 | full-suite invocation started. |
| 151 | |
| 152 | | Broken guard | Command | Result | |
| 153 | | --- | --- | --- | |
| 154 | | Finish the interrupted marker write | `go test -overlay=<scratch>/mutation-25.json ./internal/tryequipo -run '^TestReviewResumeBeforeIdentityMarker$' -count=1` | Failed, exit 1; working source unchanged | |
| 155 | | 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 | |
| 156 | |
| 157 | All 26 deliberate mutations were caught. Session overlays and logs are removed |
| 158 | at handoff. Both full CI outcomes are recorded; no failed result is treated as passing. |
| 159 | |
| 160 | ## Final CI result |
| 161 | |
| 162 | The replacement background make ci finished with exit 0. Its full test step ran |
| 163 | 27 packages without cached results or failures in 5m27.323s. Build, vet, |
| 164 | formatting, staticcheck, govulncheck, gitleaks, size budgets, adapter checks, |
| 165 | namespace checks, migrations and performance all passed. No reachable |
| 166 | vulnerabilities or leaked secrets were reported. Cold boot had a 124ms median |
| 167 | against 500ms, and every measured GET stayed below 150ms. |
| 168 | |
| 169 | The setup package took 14.944s in that run, above its 10s CI timing limit |
| 170 | (reported locally as an advisory). Independent fake-account tests now run in |
| 171 | parallel. Their bridge fixture is fixed once in the test process; tests that |
| 172 | change other environment values remain serial. No assertions or limits changed. |
| 173 | The final test-only scheduling change was verified with: |
| 174 | |
| 175 | `CI=1 CGO_ENABLED=0 go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -count=1 ./internal/tryequipo` |
| 176 | |
| 177 | Result: exit 0, one uncached package, zero failures; package time 5.021s and |
| 178 | whole step 5.580s. The final package vet check also passed. The full CI rerun was |
| 179 | not repeated after this test-only scheduling change. |
| 180 | |
| 181 | ## Copy and limits |
| 182 | |
| 183 | Changed runtime messages remain individually marked COPY REVIEW PENDING in |
| 184 | internal/equipo/copy.go. Their current text is in the existing Plan 3 copy |
| 185 | inventory. Guide changes are flagged as pending copy review. The controller |
| 186 | report records implementation and test evidence; no copy-review server was run. |
| 187 | Live provider certification still has to be performed by Paul before release. |
| 188 | |