Skip to content

docs: prioritize macOS daemon recovery - #21740

Closed
AmethystLiang wants to merge 11 commits into
mainfrom
debug-p0-plus
Closed

AmethystLiang wants to merge 11 commits into
mainfrom
debug-p0-plus

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1967 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1967

Summary

STA-7948: on macOS, Orca's terminal daemon can lose the ability to read a workspace under Documents, Desktop, or Downloads while the Orca app itself still can. Terminals in that folder fail with "Operation not permitted" and agents like Codex die reading their cwd. This PR lands the finalized plan and the evidence behind it. Docs only, no production code.

What the evidence says

  • It is common and tied to updates. PostHog daemon_pty_cwd_denied (shipped 2026-09-01) fired for 1,438 users in 21 days, 96% of them on a daemon forked by an older app build. That is 2.8% of users who adopted a different-version daemon. 528 users hit it on two or more days.
  • The daemon's existing check already detects it. That field data comes from the current accessSync verdict, so no new daemon code is needed to observe the failure.
  • A fresh daemon fixes most cases, not all. Among denied users with visible follow-up, 69% stopped being denied after a daemon forked by the current app appeared; 31% were denied again and need the folder grant repaired.
  • On a healthy adopted daemon, the daemon's verdict, a login-wrapped shell, and a control shell agree; spawned shells carry the daemon's grant. A grant-less probe on ~/Documents shows a second TCC mode where access() passes but opendir fails, so the plan hardens the check to real enumeration.

The plan

Record app-versus-daemon divergence in main from the existing verdict, expose it on the existing macTccAttribution poll, and show a second toast pointing at the existing Manage Sessions restart, with copy that also says to re-allow the folder if the restart is not enough. Harden the daemon check from access() to opendir. The signed-helper PTY probe from the first revision is dropped: it only covered daemons without the verdict, and that population is already shrinking to zero.

Files

  • docs/plans/macos-tcc-explicit-recovery-design.md: finalized plan.
  • docs/plans/validation/README.md: transport validation, 2026-09-21 live machine evidence, PostHog field data.
  • docs/plans/validation/live-2026-09-21/: the three scripts used.
  • docs/plans/macos-tcc-durable-relocation-design.md: unchanged; the field numbers argue for reopening prevention separately.

Validation

Docs only. No daemon restarted, no TCC state changed, no window shown during evidence collection. Raw evidence with account paths is kept off-repo.

Follow-up

Implement the plan against main in one PR. The remaining open item (a three-step check on one affected machine) only confirms the notice copy.

AmethystLiang and others added 3 commits September 19, 2026 16:29
…evidence

Replace the helper-first recovery design with a two-layer plan: an in-daemon
opendir verdict plus a notice on the existing attribution poll (ship now), and
the helper probe for already-deployed old daemons (evidence-gated). Record the
2026-09-21 measurements: on Documents, access(2) passes while opendir gets
EPERM, so the current accessSync verdict is blind to the incident's folder
class; daemon-spawned login shells carry the daemon's grant; the login wrapper
is unconditional in production.
…the helper probe

daemon_pty_cwd_denied fired for 1,438 users in 21 days (2.8% of users adopting
a different-version daemon, 96% on Documents/Desktop/Downloads), so the daemon's
existing verdict already observes the failure and the helper probe for old
daemons has no population left to cover. A fresh same-version daemon ended the
denial for about 69% of observable users; the notice copy now tells the rest to
re-allow the folder.
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Closing as a stale design draft from September. The macOS daemon/TCC code it plans for has changed since.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants