Skip to content

Commit df7dc1b

Browse files
authored
docs(devlog): record the desktop-restart verification outcome (#4520)
PR #4510 merged as d7c7b49. Records the three-host proof, the two Windows defects the live hosts found that ten audit rounds of code review did not, the two things hosted CI caught that local runs could not, and the three limitations carried forward.
1 parent cb2e15b commit df7dc1b

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# wp4 execution record
2+
3+
Terminal outcome for this unit. PR #4510 merged into `dev` as
4+
`d7c7b493bfc8e9248b8bb98c692203d74c2ee6cc` on 2026-09-13T13:23:25Z.
5+
6+
## 1. Live three-host proof
7+
8+
All three runs were made at `c8c1c1a9cc`. Only `tests/` and `devlog/` changed between
9+
that commit and the merged head, so the runtime proven here is byte-identical to the one
10+
CI was green on.
11+
12+
| platform | host | root pid before -> after | corroboration |
13+
|---|---|---|---|
14+
| Linux | `lidge` | 3425189 -> 3431091 | reparented to init, so the relaunch came from the detached `setsid` spawn and not a human; a live `--type=gpu-process --ozone-platform=x11` child confirms the app reached the compositor |
15+
| macOS | `macmini-cf` | 74114 -> 99260 | bundled app-server respawned under the new root; singleton lock released |
16+
| Windows | `mini` | 29132 -> 23136 | `{"attempted":true,"stopped":[29132],"surviving":[],"relaunch":"started"}` matching the observed tree |
17+
18+
The Linux corroboration carries the most weight. `001` §2.2 measured the root zeroing its
19+
own environment block, so the session variables must come from a child. Had that been
20+
wrong, the pid would still have changed and the command would still have reported
21+
success, while the user got no visible app. The GPU process is what separates those two
22+
outcomes, and a pid table alone cannot.
23+
24+
## 2. What running it found that ten audit rounds did not
25+
26+
Five work phases and ten audit rounds found eighteen blockers by reading code. Windows
27+
held two more, and both surfaced within seconds of a real host.
28+
29+
**A false success.** The ladder returned
30+
`{"stopped":[27788],"surviving":[],"relaunch":"started"}` while the app kept its original
31+
pid **and** start time throughout. Two causes in one helper: a stop was claimed on
32+
pid-liveness alone, and `stillSameProcess` returned a boolean over three distinct
33+
situations, so a re-probe that merely **failed** was read as "already exited". Reporting a
34+
restart that did not happen is worse than the stale picker this unit exists to fix.
35+
36+
**Then its mirror image.** Requiring the enumeration to confirm exposed the opposite
37+
defect: `Win32_Process` lags after a kill, so the single confirming query still listed a
38+
process that was already dead. The ladder declared `targets_survived`, skipped the
39+
relaunch, and left the host with the app killed and never restarted. It was restored
40+
immediately.
41+
42+
Both came from treating one weak reading as proof. Confirmation now polls until the
43+
platform's own process list agrees, with a final look after the deadline, and a probe that
44+
cannot run keeps the loop going rather than deciding either way. The kill and relaunch
45+
primitives were correct on Windows the whole time; only the confirmation was wrong, in
46+
both directions.
47+
48+
The lesson generalises past this unit: a design that says "fails closed" is not evidence
49+
that the code does, and neither is a green focused test whose double models the world
50+
more simply than the world behaves. The doubles here modelled exit purely through
51+
`isAlive` and kept listing terminated processes, which is precisely why no amount of
52+
review could surface either defect. They now drop a process from the enumeration once
53+
liveness reports it dead.
54+
55+
## 3. What hosted CI found that local runs could not
56+
57+
- The macOS cases pointed at `/Applications/ChatGPT.app`, and discovery resolves the
58+
bundle through `realpathSync`, which touches the real filesystem and cannot be
59+
intercepted by the exec seam. They passed locally only because that machine has Codex
60+
installed. They now build a real bundle under a temp directory, realpathed there so the
61+
fixture and the adapter agree across the `/var` symlink.
62+
- `privacy:scan` found a second user's home path in two files of this unit.
63+
64+
Neither was visible locally: the first because of what the machine happened to have
65+
installed, the second because the scan was never run there.
66+
67+
## 4. Gate status at the merged head
68+
69+
- Hosted CI at `156e10776b`: 24 pass, 0 fail, 2 skipping.
70+
- Local product suite, build and typecheck: **NOT RUN**, per `000` §2.
71+
- Focused desktop-restart files: 50 pass / 0 fail.
72+
73+
## 5. Carried forward
74+
75+
- **Windows app-server exclusion is a no-op.** The probe enumerates `ChatGPT.exe` while
76+
Windows app-servers run as `codex.exe` / `codex-code-mode-host`, so they still receive
77+
SIGTERM before the app quits. The restart is correct; the cost is one extra interrupted
78+
turn. Widening that query changes what may be killed, so it needs its own verification.
79+
Documented at the decision point in `src/cli/restart-scope.ts`.
80+
- **`ocx system codex-restart` refuses rather than handing off** when the proxy itself runs
81+
inside the Codex app, because a proxy never exits and the handoff waits for the caller.
82+
- **The local-macOS handoff path is unproven on a live host.** It is implemented and
83+
unit-tested, and proving it ends the session that issues it, so it is deliberately the
84+
last action rather than an omission.

0 commit comments

Comments
 (0)