Repository navigation
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between c0ff1a22ce1f9f188c46d5dfb6130b7a9cb5545b and c0dbff1be4bd98e3699fefffde2fc8241c26c3e0. 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds macOS code-identity inspection and uses the result to classify daemon TCC attribution. It records deferred daemon replacements with reasons, session counts, timestamps, and trace events. The management API exposes this state to the renderer. The settings notice now reports preserved live sessions and updated permission details in English and French. Tests cover identity parsing, attribution, replacement state, IPC data, and notification rendering. Priority: ⬆️ High 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 8271b761-2d7f-41ff-8553-ec905c451a8a
📥 Commits
Reviewing files that changed from the base of the PR and between 68b1128 and c0ff1a22ce1f9f188c46d5dfb6130b7a9cb5545b.
📒 Files selected for processing (17)
src/main/daemon/daemon-mac-code-identity.test.tssrc/main/daemon/daemon-mac-code-identity.tssrc/main/daemon/daemon-pty-adapter-daemon-recovery.test.tssrc/main/daemon/daemon-pty-daemon-recovery.tssrc/main/daemon/daemon-replacement-deferral.test.tssrc/main/daemon/daemon-replacement-deferral.tssrc/main/daemon/daemon-replacement-preflight.tssrc/main/daemon/daemon-tcc-attribution-main-thread.test.tssrc/main/daemon/daemon-tcc-attribution.test.tssrc/main/daemon/daemon-tcc-attribution.tssrc/main/ipc/pty-management.tssrc/preload/api-types.tssrc/preload/api/pty-management-api.tssrc/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsxsrc/renderer/src/components/settings/TerminalTccAttributionNotice.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/fr.json
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — the detection logic, its cache invalidation, and the deferral plumbing are sound and well covered. Two minor points below.
Reviewed changes
- Severed TCC judged by the daemon's own executable —
getMacDaemonTccAttributionHealthnow resolves the daemon's code identity throughcodesign -d +<pid>(daemon-mac-code-identity.ts) and callsclassifyMacDaemonCodeIdentity, so a daemon running from a Squirrel-parked bundle readsseveredinstead ofintact. - Per-generation cache remembers the resolved executable path — a cached verdict is re-probed once that path disappears, without waiting for a pid-record change.
- Deferred replacements become visible —
daemon-replacement-deferral.tsrecords each preserve-with-live-sessions decision, emits adaemon.replacement_deferredtrace span, and exposes the record throughpty:management:macTccAttribution. - Settings notice names the denied resources and the preserved count —
TerminalTccAttributionNoticeadds the live-session line for the severed reason; en/fr strings updated. - Tests — parser/runner classification, the real-
codesigntwo-update E2E, cache re-probe, deferral record/clear/trace, adapter preserve/respawn paths, and the notice count.
ℹ️ Legacy pid records skip the parked-bundle check
classifyMacDaemonCodeIdentity only runs the bundle-containment test when spawnerExecPath is present. A daemon launched by an Orca version that predates that field records null, and the resolved-path-missing branch doesn't fire while the parked copy still exists. For such a daemon after one in-place update the probe resolves to the parked (still-present) path, so the verdict stays intact — the single-update Local Network breakage is only caught after the second update deletes the parked bundle. This matches the backwards-compatibility note in the PR description; flagging it only so the residual coverage is explicit, in case the maintainers want to rely on the pid-record field being ubiquitous before considering the issue fully closed.
Technical details
# Legacy-record coverage gap
## Affected sites
- src/main/daemon/daemon-tcc-attribution.ts:95 — `const bundleRoot = spawnerExecPath ? findMacAppBundleRoot(spawnerExecPath) : null`
- src/main/daemon/daemon-tcc-attribution.ts:156 — resolved path is recorded only, so with `bundleRoot === null` and an existing path the verdict is `intact`.
## Required outcome
- Confirm that shipped daemons (the population this fix targets) all carry `spawnerExecPath`, or accept that a legacy daemon's first post-update window is undetected.
## Open questions for the human
- How long has `spawnerExecPath` been written to the pid record? If it predates the versions in the wild, no action is needed.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Answering the informational point in the pullfrog review — how long It predates the population this fix targets. My clone was shallow, so I deepened it to 3207 commits (back to 2026-08-09) and the field is already present in So the residual gap is a daemon that has been running continuously since before that field shipped, which is older than any build still in circulation. I have left the |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Narrowed the unlinked-executable signal to ENOENT —
UNLINKED_EXECUTABLE_PATTERNis now/No such file or directory/, anderrSecCSNoSuchCode("host has no guest with the requested attributes") is treated asunavailable(fail open), since on the--displaypath it means the pid is exiting rather than its executable being unlinked. This resolves the prior review's inline concern; the live-daemon--displayvs--verifyevidence confirms the narrowed pattern still classifies the severed daemon. - Recorded the derived live-session count in the recovery-path deferral branches —
daemon-pty-daemon-recovery.tsnow passesnullwhen the daemon's inventory is unavailable and the derivedmax(activeSessionIds, daemon)count otherwise, so the recorded count matches what the warning prints and what the preflight path already reports.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
A reviewer read `resolved` as a claim that the executable sits inside the installed app and asked for that to be validated. It is not that claim, and we are not making it: proving containment needs the pid record's spawner path, and deciding anything from where the code lives is #21826's proposed behaviour rather than this measurement. The enum doc now spells out all four verdicts in the terms the probe can actually support, and says plainly why `resolved` stops at "exists and is not parked". A matching note sits beside the parked-path pattern.
…y control `daemon_pty_cwd_denied` gives code_identity's hit rate on denials, but a readable spawn emitted nothing, so an `unresolvable` adoption with no denial could not be told apart from a user who never opened a terminal in Documents, Desktop, or Downloads. The false-positive rate that gates #21826's auto-replacement was unmeasurable. `daemon_pty_cwd_readable` now fires when a daemon reads a TCC-gated cwd, once per daemon and folder class per app run, with the same origin properties as the denial event. The read-out becomes a 2x2 of code_identity against readable/denied on protected-folder spawns. Fire-and-forget on the spawn path like the denial emit, and no app-side directory read.
… dedupe state The once-per-daemon dedupe on `daemon_pty_cwd_readable` was keyed before the probe ran, so a daemon first seen readable while `parked` never reported again once it turned `unresolvable` — the one cell that would count most against #21826. It also counted per daemon while denials count per spawn, so the 2x2 mixed units. Readable now reports every spawn, like denied, and both events share one emitter (`trackDaemonPtyCwdVerdict`) and one schema. The TCC-folder gate lives in the verdict branch. The origin fields are one shape spread into both schemas. The codesign probe calls `runProcess` directly and tests mock it, replacing a test-only runner parameter. The repeated "never cached" rationale is now said once.
…and folder-denial events (#22171) * feat(daemon): import the macOS process code-identity probe from PR #21826 Takes `daemon-mac-code-identity.ts` and its test verbatim from David Bebawy's community PR #21826 (stablyai/orca). The probe asks Security.framework, via `codesign --display --verbose=1 +<pid>`, where a live process's code lives on disk — the question Node cannot answer, and the one that decides whether tccd can still resolve a running daemon's code identity after an app update. Imported unchanged here so the adaptation that follows is reviewable as a diff against the author's original. Co-authored-by: David Bebawy <[email protected]> * feat(telemetry): report the daemon pid's macOS code identity on the two adoption events Community PR #21826 argues that macOS terminal daemons lose Documents/Desktop/ Downloads access after an update because the daemon's own executable is unlinked — Squirrel parks the outgoing bundle under a ShipIt staging directory and later deletes it — so tccd can no longer map the daemon pid to on-disk code. Today's `spawner_path_class` and `tcc_attribution` read the binary that forked the daemon, which an in-place update deletes and recreates, so neither can see that state. This adds the detector as a measurement only. `code_identity` rides on `daemon_adopted` and `daemon_pty_cwd_denied`, the two events that already describe an adopted daemon, so denied daemons can be cross-tabbed against healthy ones. Nothing reads the verdict: no replacement, no notice, no UI. The probe is David Bebawy's, narrowed from a path-carrying union to the closed enum the wire allows, and memoised per pid so one codesign spawn answers for a whole daemon generation. Off macOS, or with no pid, it reports `probe-failed`, which keeps both schemas strict and non-optional. Co-authored-by: David Bebawy <[email protected]> * fix(telemetry): read the daemon's code identity fresh on every adoption event The probe memoised its verdict per pid and never expired it, so `daemon_pty_cwd_denied` reported whatever the probe saw at adoption rather than what was true at the denial. That breaks the measurement in both directions: a transient codesign failure during startup pinned `probe-failed` for the rest of the run, and the `parked` to `unresolvable` transition became invisible. Squirrel leaves the parked bundle in place until the next update, which can be days, so a daemon adopted as `parked` and denied as `unresolvable` is the exact crossover this study exists to catch, and the cache hid it. Now every ask runs its own codesign. Only concurrent asks about the same pid share a probe, and that entry is cleared as soon as it settles, so nothing survives to be reported later. Both events are rare enough that one spawn each is not worth a cache. * fix(telemetry): drop the dead existence check from the code-identity probe The classifier stat'd the path codesign displayed and called a missing one unresolvable. That path is unreachable: once the executable is unlinked, `codesign --display` prints no `Executable=` line at all and exits 1 with "No such file or directory", which the fallback below already classifies as unresolvable. Verified directly on Darwin 25.5 against a signed binary deleted out from under a running pid. All the branch actually covered was the window between codesign reading the path and this process stat'ing it, and it paid for that with a synchronous stat on the main thread. * fix(telemetry): never classify a timed-out codesign probe as a verdict `runProcess` kills the child at the deadline and reports `timedOut`, but the runner type dropped that field, so a codesign killed mid-display could still have printed an `Executable=` line and been read as `resolved` or `parked`. A half-written display proves nothing about where the daemon's code lives. The runner result now carries `timedOut`, and a timed-out probe returns `probe-failed` before the output is looked at. * docs(telemetry): state what each code-identity verdict actually asserts A reviewer read `resolved` as a claim that the executable sits inside the installed app and asked for that to be validated. It is not that claim, and we are not making it: proving containment needs the pid record's spawner path, and deciding anything from where the code lives is #21826's proposed behaviour rather than this measurement. The enum doc now spells out all four verdicts in the terms the probe can actually support, and says plainly why `resolved` stops at "exists and is not parked". A matching note sits beside the parked-path pattern. * docs(telemetry): stop asserting how long a parked bundle survives The probe's rationale claimed Squirrel keeps the parked bundle "until the next update". A reviewer claimed the opposite, that it is deleted at the end of the same install. Neither holds up against this Mac's ShipIt log: the install moves the outgoing bundle to a TMPDIR ShipIt directory and logs no removal of it at all, and the one "Couldn't remove owned bundle" line names the incoming download staging copy, not the parked one. Every parked bundle from the last two days is nevertheless gone now. So the rationale in the probe doc, the enum doc, and the reprobe test comment now assert only what is established: the outgoing bundle is moved aside at install and disappears later on a schedule we have not pinned down. That is already enough to justify the design, since one pid's verdict can change within an app run, which is exactly why every ask reads fresh. * feat(telemetry): report readable TCC-gated spawns as the code-identity control `daemon_pty_cwd_denied` gives code_identity's hit rate on denials, but a readable spawn emitted nothing, so an `unresolvable` adoption with no denial could not be told apart from a user who never opened a terminal in Documents, Desktop, or Downloads. The false-positive rate that gates #21826's auto-replacement was unmeasurable. `daemon_pty_cwd_readable` now fires when a daemon reads a TCC-gated cwd, once per daemon and folder class per app run, with the same origin properties as the denial event. The read-out becomes a 2x2 of code_identity against readable/denied on protected-folder spawns. Fire-and-forget on the spawn path like the denial emit, and no app-side directory read. * refactor(telemetry): one emitter and schema for both cwd verdicts, no dedupe state The once-per-daemon dedupe on `daemon_pty_cwd_readable` was keyed before the probe ran, so a daemon first seen readable while `parked` never reported again once it turned `unresolvable` — the one cell that would count most against #21826. It also counted per daemon while denials count per spawn, so the 2x2 mixed units. Readable now reports every spawn, like denied, and both events share one emitter (`trackDaemonPtyCwdVerdict`) and one schema. The TCC-folder gate lives in the verdict branch. The origin fields are one shape spread into both schemas. The codesign probe calls `runProcess` directly and tests mock it, replacing a test-only runner parameter. The repeated "never cached" rationale is now said once. * fix(telemetry): rename the shared origin schema fields for the anti-slop gate no-shape-in-symbol-names rejects daemonOriginShape; the fields are event props. --------- Co-authored-by: David Bebawy <[email protected]>
…executable The severed check compared `spawnerExecPath`, which every in-place update deletes and recreates, so a daemon running from a bundle Squirrel parked and later deleted was always reported `intact`. Read the daemon pid's own executable through the code-identity probe stablyai#22171 added for telemetry (`inspectDaemonMacCodeIdentity`, which now also returns the resolved path, so both readers share one coalesced `codesign` spawn) and report `severed` when the identity is `unresolvable` or `parked`, when the resolved path no longer exists, or when it lies outside the installed app bundle. A failed probe keeps the old spawner-binary verdict. Re-probe a cached verdict once the resolved executable path disappears. When replacement is declined because the daemon owns live sessions, record the reason and count, emit it as a `daemon.replacement_deferred` trace span so it reaches diagnostic bundles, and expose it through the management IPC beside the folder-access evidence, so the Settings attribution notice can say why Orca did not restart the daemon. Fixes stablyai#20007
c0dbff1 to
979d39d
Compare
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Reused #22171's shared code-identity module —
daemon-mac-code-identity.tsnow builds on main'sDaemonCodeIdentitytypes, addinginspectDaemonMacCodeIdentity(returns the resolved path beside the verdict) and sharing one coalescedcodesign --displayspawn between adoption telemetry and the attribution check. parkednow decides severing directly — the probe classifies an executable inside a…ShipIt…directory asparked, andclassifyMacDaemonCodeIdentitymapsparkedtoseveredwithout requiringspawnerExecPath. This closes the prior review's legacy-record gap: a daemon launched beforespawnerExecPathwas recorded, parked by a single in-place update, is now caught.- Tests reworked around the shared probe — injected-probe verdicts, resolved-path-missing, parked-inside-installed-bundle, cache re-probe on path disappearance, the real-
codesigntwo-update E2E, and the classifier table; the main-thread suite mocks the module to keep itspsspawn budget pinned.
The ENOENT narrowing from the prior review survived the rebase (UNLINKED_EXECUTABLE_PATTERN stays /No such file or directory/, host has no guest fails open as probe-failed), and no thread remains open. The deferral module, recovery paths, and Settings notice are unchanged since the last review.
ℹ️ DaemonCodeIdentity still documented as "Measurement only"
src/shared/daemon-adoption-telemetry.ts describes the DaemonCodeIdentity enum as Measurement only (#21826), but this PR now makes that same verdict the input that decides whether Orca replaces a daemon. The module header in daemon-mac-code-identity.ts was updated to say it is read by the TCC attribution check, so the shared enum doc is the one spot left implying the value is observational only.
Technical details
# Update the shared enum doc to reflect the decisioning reader
## Affected sites
- `src/shared/daemon-adoption-telemetry.ts:26` — `Where macOS says the daemon pid's own executable is now (#21826). Measurement only.`
## Required outcome
- The comment should note that `getDaemonMacCodeIdentity` (telemetry) and
`classifyMacDaemonCodeIdentity` (replacement decision) both read it, matching the updated
header at `src/main/daemon/daemon-mac-code-identity.ts:1-2`.
## Open questions for the human
- If #20452 is still expected to fold this into a broader at-risk/severed model, leaving the doc
as-is may be intentional; otherwise a one-line doc update is enough.deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
… record current - Settings shows the preserved-session count for any declined replacement. After an update the stale-bundle check usually declines first, so keying the line on `severed_tcc_attribution` hid it in the common case. - A Manage Sessions restart clears the deferral record, so the new daemon is never paired with the old daemon's decision. - A repeated identical deferral (one per new terminal while sessions are kept) no longer emits a span and forces a synchronous trace flush. - While a folder denial is measured for the severed daemon, the app-wide severed toast stays down and the folder toast with its Fix dialog owns the cause. Severed without a denial (Local Network) still toasts. - The shared `DaemonCodeIdentity` doc names its second reader.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- One notice per cause — while a measured folder denial (
folderAccessMismatch) is present, the severed toast stays down (and is taken down if already up) so the folder Fix dialog is the only remedy; severed with no denial (Local Network) still toasts. - Deferral record stays current — cleared on a successful manual restart (
runRestartDaemon) in addition to the existing replacement/respawn clears, and deduplicated so a repeated identical decision (same reason + live count, one per new terminal) no longer emits another span or flush. - Preserved-session count for any deferral reason — the Settings notice shows the kept-session line even when the
stale_bundlecheck declined first, since it is the same daemon and the same sessions. - Doc/copy updates —
DaemonCodeIdentityno longer reads "Measurement only" (resolves the prior review's nit), and the notice body now names the folder + Local Network denials.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…nger owns the remedy The one-notice rule had two holes. Yielding to the folder toast left the once-per-session latch set, so the severed toast could not re-raise after the folder denial cleared. And a folder notice the user dismissed still held the severed toast down, though it can never come back, leaving no remedy shown. Reset the latch on yield, and let only a non-dismissed folder notice own the cause.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Severed toast yields and can return — when a live folder denial owns the cause,
applySeveredNoticenow dismisses the severed toast and clearstoastedThisSession.current, so the notice is eligible again once the denial clears while attribution stays severed. - A dismissed folder notice stops owning the remedy —
folderNoticeOwnsCauseis nowmismatch !== null && phase !== 'dismissed', so once the user closes the folder notice the severed (Local Network) toast still fires. - Two tests added — re-raise after the denial clears, and raise after the user already dismissed the folder notice; the shared
noticeCalls(id)helper lets assertions target either toast.
The prior inline finding is addressed; I replied to it and resolved its thread. All 27 hook tests pass locally, and both new tests fail without the corresponding source change.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Yielding to the folder notice reset the once-per-session latch even when the user had already dismissed or acted on the severed toast, so a transient folder denial brought the dismissed warning back. Track whether the toast is still on screen and reset the latch only when it yields from there.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- A user-dismissed severed toast stays dismissed — the ownership-takedown branch now resets
toastedThisSessiononly when the severed toast is actually on screen, tracked by a newseveredToastOnScreenref that is set on raise and cleared by amarkHandledcallback wired to the action, cancel, andonDismisshandlers. Previously the previous delta's unconditional latch reset re-armed a toast the user had already dismissed, so a transient folder denial could bring it back. - Regression test added —
keeps a severed toast the user dismissed down after a transient folder denialdrives severed → user dismiss → folder denial → denial clears and asserts the severed toast is not re-raised; it fails against the previous commit'stoastedThisSessioncheck.
The prior inline finding is addressed and its thread was resolved in the previous run. No open threads remain.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
@Jinwoo-H I rebased this onto main and reworked it around your two PRs:
One question: has the |

ELI5
Orca keeps a background helper (the terminal daemon) running across app updates so your terminals survive. On macOS, an update moves the old app bundle aside and later deletes it, so the helper ends up running from a program file that no longer exists. macOS then can no longer tell that the helper belongs to Orca, and every shell it hosts silently loses access to Documents, Desktop, Downloads and the local network. Orca already has a guard that should notice this and restart the helper. But the guard looks at the wrong file (the app binary, which the update recreates), so it never fires. This PR makes the guard look at the helper's own program file, and makes Orca say so in Settings when it decides not to restart the helper because terminals are still running.
What Changed
Before: after two auto-updates (or one, for Local Network),
ls ~/Documentsin every Orca terminal fails withOperation not permitted,node/adb/Homebrew Python getEHOSTUNREACHon the LAN, and the attribution check reports the daemon asintact. Nothing in the app points at the Local Network variant; the only fix is a manual daemon restart.After: the attribution check detects the condition. With no live sessions, Orca replaces the daemon at launch or before the next terminal spawn (existing behaviour, now reachable). With live sessions, it keeps them, writes a
daemon.replacement_deferredtrace span (reason and session count) to the trace file, and the existing Settings attribution notice names the folders and Local Network and shows how many live sessions Orca declined to kill.Mechanism:
getMacDaemonTccAttributionHealthdecided withexistsSync(spawnerExecPath).spawnerExecPathis/Applications/Orca.app/Contents/MacOS/Orca, which every in-place update deletes and recreates, so the verdict was alwaysintact. It now also reads the daemon pid's own executable through the code-identity probe that feat(telemetry): report the macOS daemon's code identity on adoption and folder-denial events #22171 added for telemetry (daemon-mac-code-identity.ts,codesign --display --verbose=1 +<pid>). The verdict isseveredwhen the identity isunresolvable(executable unlinked) orparked(inside a SquirrelShipItdirectory), when the resolved path no longer exists, or when it lies outside the installed app bundle recorded inspawnerExecPath. A failed probe keeps the old spawner check, so nothing gets stricter wherecodesigncannot answer.inspectDaemonMacCodeIdentity, which returns the resolved path beside the verdict.getDaemonMacCodeIdentity(telemetry) now maps from it, so both readers share the same coalesced spawn and classifier. Telemetry output is unchanged.daemon-replacement-deferral.tsrecords every "wanted to replace, kept it because of live sessions" decision from the launch preflight and the pre-spawn recovery paths, and exposes it throughpty:management:macTccAttributionnext to the existingfolderAccessMismatch. The Settings notice shows the kept-session count for any declined reason, because after an update the stale-bundle check usually declines first. Replacement, a successful respawn or a Manage Sessions restart clears it. A repeated identical decision (one per new terminal) does not emit again.intact. With the check fixed, a user with a measured folder denial would get both the severed toast and fix(macos): tell the user when Orca's terminal service can't read their folder, and walk them through the fix #21923's folder toast for one daemon. While a folder notice the user has not dismissed is up forfolderAccessMismatch, the severed toast now stays down (and is taken down if already up), and the folder toast with its Fix dialog owns the cause. Severed with no folder denial, which is the Local Network case, still toasts. This replaces fix(macos): tell the user when Orca's terminal service can't read their folder, and walk them through the fix #21923'sraises both noticestest with a one-notice test.Off macOS nothing changes: the check returns
unknownbefore any probe, and the deferral record is read only by the macOS notice.Why
The signal that predicts the failure is the daemon's code identity, not the spawner path. On the reporter machines in #20007 and on the author's (Orca 1.4.205, daemon 1.4.201, macOS 27.0),
codesign --display +<daemon pid>fails withNo such file or directory,responsibility_get_pid_responsible_for_pid()returns the pid itself for every shell under the daemon, tccd logsPlatform binary prompting is 'Deny', and unbundled tools hit the Local Network default-deny while Apple-signedcurl/ncwork. A fresh daemon fixes all of it.Relationship to merged work:
code_identitydata disagrees with this detector, the decision is in one function (classifyMacDaemonCodeIdentity).at-riskand requires a measured denial forsevered. This PR stays small and independently mergeable. The cost of a false positive is bounded: a replacement only when the daemon owns zero sessions, a notice otherwise.Alternatives considered:
ps -o comm=echoes argv[0] as spawned, so it cannot see the parked copy;lsof -p(#20072) can take seconds on a busy machine; a nativeproc_pidpathaddon is a new build target for one syscall.Linked Issue
Fixes #20007. Builds on #22171; complements #21923.
Visual Proof
N/A for the detection change. The only UI change is text inside the existing amber attribution notice: the body names Documents/Desktop/Downloads and Local Network, and a second line shows the live-session count when Orca declined to restart the daemon. No layout or component changes.
Testing
Platform tested: macOS only (Apple Silicon, macOS 27.0). Linux and Windows are unaffected by construction (
process.platform !== 'darwin'returnsunknownbefore any probe); CI covers their suites.pnpm tc:node,pnpm tc:webandcheck:code-quality:changed(0 new findings) pass on the rebased branch.src/main,src/sharedand the touched renderer suites: 18814 passed. 2 tests inrepro-13767-shell-ready-marker-lost-to-exec.test.tsfail identically on a cleanupstream/maincheckout on this machine and touch nothing here.daemon-tcc-attribution.test.ts(#20007block). Againstmain's check, the first five fail withexpected 'intact' to be 'severed':unresolvable) ->severedseveredcom.stablyai.orca.ShipIt.*bundle ->severedintactis inspected again once the executable disappears ->severedcodesign(1): a daemon-shaped copy of the test's node binary runs from a fakeOrca.app; the bundle is renamed aside and a fresh spawner written (update 1) ->severed; the parked copy is deleted (update 2) ->severedparked,probe-failedfallback and an unbundled spawner.daemon-mac-code-identity.test.ts: feat(telemetry): report the macOS daemon's code identity on adoption and folder-denial events #22171's cases unchanged and passing, plus the path returned byinspectDaemonMacCodeIdentity.daemon-replacement-deferral.test.ts(record, clear, trace, one emit for a repeated decision),daemon-pty-adapter-daemon-recovery.test.ts,daemon-adoption-telemetry-event.test.ts: pass.daemon-init-restart-sequence.test.ts: a Manage Sessions restart clears the deferral record (fails without the fix).TerminalTccAttributionNotice.test.tsx: the count shows for astale_bundledeferral and hides when attribution is intact.useMacTccAttributionSeveredNotice.test.tsx: severed plus a folder denial raises only the folder toast; a severed toast already up is taken down when the denial arrives. It comes back if the denial clears while attribution stays severed (unless the user had already dismissed it), and it shows when the user has already closed the folder notice, which cannot come back.Manual, read-only, against a live severed daemon on the author's Mac (spawner path present,
lsofmaps a deletedShipIt.*bundle):codesign --display --verbose=1 +<pid>->No such file or directory, which classifies asunresolvable->severed. The daemon was not restarted.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude (Anthropic, via Claude Code), directed and reviewed by the author.
Review
process.platform === 'darwin'.codesignruns throughrunProcessfromsrc/shared/child-process/. Bundle detection usesnode:path./usr/bin/codesignwith a pid argument only. The trace record carries a reason enum and a session count; no paths or user data.spawnerExecPathare now judged by the daemon executable (intactwhen it resolves) instead of alwaysunknown; they trigger a replacement only when the executable is gone or parked.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
A more prominent banner listing the affected sessions, and keeping sessions across a replacement (issue suggestions 2 and 3), are follow-ups.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)