| 1 | # Controller report: Codex startup notice |
| 2 | |
| 3 | Brief: CODEX-BRIEF-codex-startup-notice.md. Branch: codex-startup-notice. |
| 4 | Starting revision: a127a14, which contains the brief above main 85d9ea8. |
| 5 | |
| 6 | ## Changes and path trace |
| 7 | |
| 8 | R1: The terminal login probe, launcher preflight, and session handler accept |
| 9 | one account/updated notification per process, with no id and authMode equal |
| 10 | to chatgpt. planType is ignored. A shared predicate checks the frame shape; |
| 11 | each process reader owns its allowance. The probe stops at the account/read |
| 12 | response. Preflight never sends turn/start. The session closes its allowance |
| 13 | under its mutex before its first turn/start call and never reopens it, including |
| 14 | after a completed turn. Duplicate notices, other or missing auth modes, and |
| 15 | ID-bearing frames remain refused. |
| 16 | |
| 17 | The session path is reachable: Open starts a preflight process, then a separate |
| 18 | session process whose handler is installed before initialize and account/read. |
| 19 | Both processes receive the recorded startup sequence. The direct-live driver |
| 20 | constructs this same Codex launcher for its exercises and certification, so it |
| 21 | inherits both fixes. Its policy-readback collector only inspects result frames; |
| 22 | its certificate validation does not dispatch account events. There is no second |
| 23 | account-event exception to change. Its fake CLI now emits the recorded sequence. |
| 24 | |
| 25 | R2: LoginEnvironment omits TMPDIR for both providers when unset or empty, and |
| 26 | preserves a nonempty value. The prerequisites version command uses a bounded |
| 27 | stdout-only helper; command failure still fails the check. Other command output |
| 28 | handling is unchanged. |
| 29 | |
| 30 | R3: Fixtures include the recorded disabled remote-control frame with a fake |
| 31 | installation ID, followed by the ChatGPT/promax notice. Coverage includes the |
| 32 | probe, preflight, session, official login, guided account setup, multiple-account |
| 33 | setup, and direct-live fake CLI. Tests cover ID values (including empty and null), |
| 34 | missing/null/other auth modes, duplicates, arbitrary planType, notices before |
| 35 | initialize, duplicates across initialize, notices during config/thread setup, |
| 36 | and notices both during and after a completed turn. TestCodexPreflightNotification |
| 37 | also checks the shared startup predicate. No runtime copy or README changed. |
| 38 | |
| 39 | ## Verification |
| 40 | |
| 41 | All Go commands use CGO_ENABLED=0 and the default Go caches. New tests use |
| 42 | `t.TempDir()` and do not require TMPDIR. Environment tests explicitly cover |
| 43 | unset, empty and nonempty values. Scratch is under the on-disk TMPDIR. |
| 44 | |
| 45 | Before implementation, this command exited 1 at the intended assertions: |
| 46 | |
| 47 | ```sh |
| 48 | go test ./internal/runner/provider ./internal/runner/provider/codex ./internal/tryequipo -run 'TestCodex(LoginStartupNotice|StartupNotice|SessionStartup|AccountOfficialFlow)|TestLoginEnvironmentTMPDIR|TestOnboardingOfficialLogin$' -count=1 |
| 49 | ``` |
| 50 | |
| 51 | The recorded notice was refused in all three readers and the guide; empty and |
| 52 | unset TMPDIR produced an unwanted TMPDIR= entry. The initial test compilation |
| 53 | was corrected to use the concrete terminal driver before recording these failures. |
| 54 | |
| 55 | `go test ./internal/tryequipo -run '^TestVersionStdout$' -count=1` also exited 1 |
| 56 | with the old merged-output behavior: the version contained the stderr warning. |
| 57 | |
| 58 | After implementation: |
| 59 | |
| 60 | - `go test ./internal/runner/provider ./internal/runner/provider/codex ./internal/tryequipo ./internal/directlive -count=1` |
| 61 | exited 0 for all four packages (9.155s, 29.808s, 5.825s and 150.708s). |
| 62 | - `go test ./internal/runner/provider/codex -run '^TestCodex(Startup|SessionStartup|PreflightNotification)' -count=1` |
| 63 | exited 0, including the final first-turn timing tests. |
| 64 | - `go test ./internal/runner/provider ./internal/tryequipo -run 'TestCodexLoginStartupNotice|TestVersionStdout|TestLoginEnvironmentTMPDIR' -count=1` |
| 65 | exited 0, including the final cross-initialize probe tests. |
| 66 | - `git diff --check` and `python3 scripts/runner-dead-references.py` exited 0. |
| 67 | No reference hashes needed remapping. |
| 68 | |
| 69 | Each guard mutation used a Go overlay, leaving working source unchanged. The |
| 70 | command form was `go test -overlay=<scratch>/<mutation>.json <packages> -run <pattern> -count=1`. |
| 71 | Every row below exited 1 at the intended test assertion, with no build failures. |
| 72 | |
| 73 | | Mutation | Packages | Pattern | |
| 74 | | --- | --- | --- | |
| 75 | | notice-id: allow IDs | ./internal/runner/provider | ^TestCodexLoginStartupNotice$/.*id$ | |
| 76 | | notice-id: allow IDs | ./internal/runner/provider/codex | ^TestCodexStartupNotice$/(preflight\|session)/(id\|empty-id)$ | |
| 77 | | notice-mode: allow another nonempty auth mode | ./internal/runner/provider | ^TestCodexLoginStartupNotice$/api-key$ | |
| 78 | | notice-mode: allow another nonempty auth mode | ./internal/runner/provider/codex | ^TestCodexStartupNotice$/(preflight\|session)/api-key$ | |
| 79 | | probe-duplicate: ignore consumed allowance | ./internal/runner/provider | ^TestCodexLoginStartupNotice$/duplicate$ | |
| 80 | | preflight-duplicate: ignore consumed allowance | ./internal/runner/provider/codex | ^TestCodexStartupNotice$/preflight/duplicate$ | |
| 81 | | session-duplicate: ignore consumed allowance | ./internal/runner/provider/codex | ^TestCodexSessionStartupNoticeConsumed$ | |
| 82 | | turn-cutoff: leave allowance open | ./internal/runner/provider/codex | ^TestCodex(SessionStartupBeforeFirstTurn\|StartupAfterCompletedTurn)$ | |
| 83 | | empty-tmpdir: append even when empty | ./internal/runner/provider | ^TestLoginEnvironmentTMPDIR$ | |
| 84 | |
| 85 | The initial shared-predicate mutation commands also selected the launcher |
| 86 | package without matching its nested subtests. The explicit launcher commands |
| 87 | above then verified both preflight and session refusals separately. |
| 88 | |
| 89 | ## Full gate and delivery |
| 90 | |
| 91 | R4: Run one full `make -k ci` after staging the complete candidate, including |
| 92 | this report. The result and any permitted retry are recorded in the commit |
| 93 | body and the required three-line summary. Scratch overlays and logs are removed |
| 94 | before handoff. No live gate, real sign-in, deployment, copy-review server, or |
| 95 | access to the live equipo data directory was performed. |
| 96 | |