Skip to content

feat(telemetry): report the macOS daemon's code identity on adoption and folder-denial events - #22171

Merged
Jinwoo-H merged 10 commits into
mainfrom
daemon-code-identity-telemetry
Sep 23, 2026
Merged

Jinwoo-H merged 10 commits into
mainfrom
daemon-code-identity-telemetry

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​218 $\color{#cf222e}{\Huge{\mathbf{−}}}$​39 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​179
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​136 $\color{#cf222e}{\Huge{\mathbf{−}}}$​28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​108

ELI5

Community PR #21826 says macOS terminals lose access to Documents, Desktop, and Downloads after an update because the terminal daemon keeps running from a program file the updater has since moved aside and deleted, so macOS can no longer tell the daemon belongs to Orca. That PR also proposes an automatic fix. Before we let Orca act on that signal, this PR only measures it: on every daemon adoption and every folder denial we already report, we now also record where macOS says the daemon's executable is. A week of data tells us whether the signal predicts the failure.

What Changed

Before: daemon_adopted and daemon_pty_cwd_denied carry the daemon's app-version match and where its spawner binary lives. Neither says whether the daemon's own executable still exists on disk.

After: both events carry one more closed-enum property, code_identity, and a new control event, daemon_pty_cwd_readable, carries it too on every spawn where the daemon can read a Documents/Desktop/Downloads cwd, counted per spawn like the denial event:

Value Meaning
resolved macOS maps the pid to an executable that still exists and is not under a Squirrel ShipIt parking directory
parked the executable resolves inside a Squirrel …ShipIt… directory, i.e. the old bundle the updater moved aside
unresolvable macOS cannot map the pid to on-disk code (the file was unlinked)
probe-failed not macOS, no pid, codesign missing, timeout, or unparseable output

Mechanism: daemon-mac-code-identity.ts, imported from #21826 with co-author credit, runs /usr/bin/codesign --display --verbose=1 +<pid> through runProcess (3 s deadline, args only) and classifies the Executable= line or its absence. It runs fresh on every ask, with concurrent asks for one pid sharing a single spawn, and a timed-out spawn reads probe-failed regardless of partial output; nothing is cached across events, because the outgoing bundle is moved aside at install and disappears later on a schedule we have not pinned down (this Mac's ShipIt log records the move but no removal, yet every parked bundle from the last two days is gone), so one pid's verdict can change within an app run and that crossover is worth dating. Both emits stay off the hot path: adoption already emits after connect, and the denial emit already runs fire-and-forget after the spawn; the folder-access notice is recorded before the awaited emit so the user-facing path never waits on codesign.

The readable event is emitted from the existing readable branch of the same fire-and-forget verdict path, with no app-side directory read. Without it, an unresolvable adoption with no denial cannot be told apart from a user who never opened a terminal in a protected folder, so the false-positive rate would be unmeasurable.

Nothing reads the verdict. No UI, no daemon replacement, no admission change, on any platform.

Why

We have two competing explanations for the field data (1,438 users in three weeks, 96% on a daemon from an older install): #21826's unlinked-executable theory, and our September lab matrix where deleting the spawner under a running daemon kept folder access. Two machines versus one lab run is not enough to turn on an automatic daemon replacement. This property, on the denied event and on the healthy adoption event alike, gives the false-positive and false-negative rates directly: if nearly every denial is unresolvable/parked and nearly every healthy daemon is resolved, #21826's detector is right and its behaviour can ship with confidence. If healthy daemons also read unresolvable, we learned it before killing anyone's terminals.

Alternatives: adopting #21826 as is (acts on an unverified trigger; replacement is bounded to zero-session daemons, but the Settings notice would fire on every false positive); lsof -p (seconds on a busy machine; #20072 tried it); ps -o comm (echoes argv[0], cannot see the parked copy); a native proc_pidpath addon (a new build target for one syscall).

Linked Issue

Relates to #20007 and #21826. Follow-up to #21923.

Visual Proof

N/A: telemetry property only, no UI.

Testing

  • macOS only by construction: the probe returns probe-failed before spawning anything on other platforms, and both events were already macOS-only.

  • Classifier verified against real codesign output on Darwin 25.5 for all four shapes: a live Electron helper → resolved; the same executable moved into a …ShipIt…-named directory → parked; the executable unlinked → no Executable= line, exit 1, No such file or directory → unresolvable; a dead pid → probe-failed. A dev build reads resolved, so there is no false finding from unsigned or ad hoc code.

  • Automated: probe classification for each output shape, fresh read per ask and coalescing of concurrent asks, both event schemas reject an unknown value, emit ordering keeps the folder-access notice ahead of the awaited spawn. pnpm tc:node, check:code-quality:changed (0 new findings), the touched suites and the full src/main/daemon suite pass.

  • Cost: one ~20 ms async spawn per event; adoption happens once per launch, denial once per denied spawn.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Implemented and reviewed with Claude (Claude Code, Opus and Fable 5.1), directed by the author. The probe module is David Bebawy's from #21826 (co-author trailer on both commits).

Review

  • Cross-platform: non-darwin short-circuits to probe-failed before any spawn. Child process via src/shared/child-process/.
  • SSH/remote: the daemon is a local-host concern; nothing touches the remote wire.
  • Security: codesign runs with a fixed program path and a pid argument only; only the enum reaches the wire, never a path.
  • Wire compatibility: new required property on two .strict() main-process telemetry schemas; no IPC or remote wire change.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Read-out plan, after ~7 days: on protected-folder spawns only, cross-tab code_identity against daemon_pty_cwd_denied vs daemon_pty_cwd_readable, deduped per user and daemon (denials fire per spawn). Keep parked and unresolvable as separate rows: a parked executable still exists, and whether it alone predicts denial is part of the question. Watch the probe-failed share by macOS version, since an older codesign may print the unlinked case differently. If denials are mostly unresolvable/parked and readable spawns mostly resolved, #21826's auto-replacement ships.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Jinwoo-H and others added 4 commits September 22, 2026 03:04
…1826

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]>
…wo 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]>
…on 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.
…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.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e72c40e8-78ef-4f3f-86f7-7630505e517f

📥 Commits

Reviewing files that changed from the base of the PR and between 96e534f and 8aff34c.

📒 Files selected for processing (1)
  • src/shared/telemetry-daemon-event-schemas.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/shared/telemetry-daemon-event-schemas.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The change adds macOS daemon code-identity probing through codesign. Adoption and PTY cwd telemetry now include code_identity. Separate PTY cwd emitters are replaced by one verdict emitter and shared schema. Readable verdicts report each TCC-gated macOS spawn without per-daemon deduplication. Tests cover probing, schemas, concurrency, fail-open behavior, and event handling.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 8aff3

Rapid interleaved requests for different daemon PIDs can perform a redundant codesign probe for one PID. This is a bounded telemetry overhead issue, but should be addressed when practical.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main telemetry change: reporting the macOS daemon code identity during adoption and folder-denial events.
Description check ✅ Passed The description is complete and directly matches the pull request objectives. It includes the required sections, explains the change and rationale, lists linked issues, documents testing and platform …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 4ae87f22-d275-4eb3-bd90-cae00e2e9a41

📥 Commits

Reviewing files that changed from the base of the PR and between 90d363a and 675ef15.

📒 Files selected for processing (8)
  • src/main/daemon/daemon-adoption-telemetry-event.test.ts
  • src/main/daemon/daemon-adoption-telemetry-event.ts
  • src/main/daemon/daemon-mac-code-identity.test.ts
  • src/main/daemon/daemon-mac-code-identity.ts
  • src/main/daemon/daemon-provider-init.ts
  • src/shared/daemon-adoption-telemetry.test.ts
  • src/shared/daemon-adoption-telemetry.ts
  • src/shared/telemetry-daemon-event-schemas.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor doc fix inline.

Reviewed changes

  • New macOS code-identity probe. daemon-mac-code-identity.ts resolves a daemon pid's on-disk executable via /usr/bin/codesign --display --verbose=1 +<pid> and classifies it as resolved / parked / unresolvable / probe-failed; concurrent asks for one pid share a single spawn and nothing is cached across events.
  • Telemetry plumbing. classifyDaemonAdoptionOrigin is now async and adds code_identity; trackDaemonAdopted / trackDaemonPtyCwdDenied became async; reportDaemonPtyCwdVerdict records the user-facing mismatch notice before awaiting the probe.
  • Schema. code_identity added as a required enum to the .strict() daemon_adopted / daemon_pty_cwd_denied schemas; enum defined in daemon-adoption-telemetry.ts. Both are MAIN_OWNED and emitted in-process, so the new required field has no IPC/remote consumer to break.
  • Callers and tests. daemon-provider-init.ts awaits trackDaemonAdopted; three suites updated and a new probe suite added.

I verified the load-bearing external contracts: +<pid> is the documented codesign pid form and Executable= is emitted to stderr at verbosity level 0 (Apple cs_dump.cpp / cs_utils.cpp), the unlinked case exits 1 with a perror-formatted No such file or directory, and XNU's proc_pidpath returns ENOENT once the executable's vnode is unlinked. The classifier matches that behavior, and the coalescing / fresh-read logic is correct.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

`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.
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.
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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Discarded a timed-out codesign probe. probe now checks runProcess's timedOut flag and returns probe-failed before classifying, so a deadline-killed codesign that already printed a partial Executable= line can no longer be reported as resolved/parked. runProcess does set timedOut: true on deadline (run-process.ts:255), so the guard is load-bearing.
  • Corrected the verdict docs. The getDaemonMacCodeIdentity JSDoc no longer claims the parked copy survives "until the next update"; the probe, enum, and test comments now assert only the move, the later disappearance, and the explicitly unknown schedule. This retires the one open pullfrog thread on the file.
  • Added a regression test. A timed-out probe that printed Executable=/x first resolves to probe-failed.

The classifier, coalescing, and no-cache behavior are otherwise unchanged and remain correct.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior Pullfrog review (ffa1c47bad): one commit (53fcf82) adding the daemon_pty_cwd_readable control event.

  • Added the readable control event. trackDaemonPtyCwdReadable emits daemon_pty_cwd_readable for a TCC-gated cwd the daemon could read, carrying the same enum origin tuple as the denial event. It is darwin-only, gated to MAC_TCC_FOLDER_CLASSES, requires a daemon identity, does no app-side directory read, and dedups once per daemon incarnation × folder class per app run via module-level reportedReadable (reset for tests).
  • Wired it into the readable verdict branch. The cwdReadableByDaemon === true branch of reportDaemonPtyCwdVerdict now clears the mismatch notice first, then awaits the control emit. Since the caller voids reportDaemonPtyCwdVerdict (daemon-pty-session-spawn.ts:257), the added codesign probe adds no spawn latency.
  • Registered the event. daemonPtyCwdReadableSchema added to eventSchemas, and the name added to MAIN_OWNED_TELEMETRY_EVENTS so a compromised renderer cannot spoof it. Tests assert the exact payload, the dedup sequence, the skip conditions (non-TCC, null identity, non-darwin), and throw swallowing; the touched suites (31 tests) and pnpm tc:node pass.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

… 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior Pullfrog review (53fcf82): one commit (96e534f) consolidating the two cwd-verdict emitters and schemas.

  • Merged the two emitters into trackDaemonPtyCwdVerdict. trackDaemonPtyCwdDenied and trackDaemonPtyCwdReadable collapse into one async function taking the event name; reportDaemonPtyCwdVerdict calls it from both the readable and denied branches.
  • Dropped the readable dedup state. reportedReadable and resetDaemonPtyCwdReadableForTests are gone, so daemon_pty_cwd_readable now fires on every readable TCC-gated spawn — matching the PR body's "counted per spawn like the denial event" and giving the read-out a per-spawn denominator.
  • Merged the schemas. daemonPtyCwdDeniedSchema and daemonPtyCwdReadableSchema become one daemonPtyCwdVerdictSchema sharing daemonOriginShape; both registry entries point at it. The readable emit stays gated to the three TCC classes in reportDaemonPtyCwdVerdict, so the broader cwd_class enum only loosens the wire validator, which this MAIN_OWNED emitter alone feeds.
  • Test seam moved to module mocking. The probe no longer takes an injected runCommand; daemon-mac-code-identity.test.ts mocks runProcess, and the event suite mocks getDaemonMacCodeIdentity, so no unit test spawns codesign.

Verified pnpm tc:node and the three touched suites (40 tests) pass. The readable branch no longer requires a daemon identity; the payload is derived from the pid record, which makes it consistent with the denied branch rather than a regression.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 40fdb0b5-a6c0-4bbf-9489-07348a959321

📥 Commits

Reviewing files that changed from the base of the PR and between 53fcf82 and 96e534f.

📒 Files selected for processing (7)
  • src/main/daemon/daemon-adoption-telemetry-event.test.ts
  • src/main/daemon/daemon-adoption-telemetry-event.ts
  • src/main/daemon/daemon-mac-code-identity.test.ts
  • src/main/daemon/daemon-mac-code-identity.ts
  • src/shared/daemon-adoption-telemetry.ts
  • src/shared/telemetry-daemon-event-schemas.ts
  • src/shared/telemetry-event-registry.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/daemon/daemon-mac-code-identity.ts
  • src/shared/daemon-adoption-telemetry.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

// Why: `daemon_pty_cwd_denied` is the #17696 symptom — the daemon cannot read a cwd the app can,
// on proven divergence only. `daemon_pty_cwd_readable` is its control, on TCC-gated folders only.
export const daemonPtyCwdVerdictSchema = z
.object({ cwd_class: z.enum(DAEMON_PTY_CWD_CLASSES), ...daemonOriginShape })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Preserve the TCC-only contract for readable events.

This schema now accepts other-home and outside-home for daemon_pty_cwd_readable. The current producer filters these values, but EventProps and the central validator now permit them for any direct caller. Such events would contaminate the readable control population.

Keep the origin fields shared, but use an event-specific schema with MAC_TCC_FOLDER_CLASSES for daemon_pty_cwd_readable.

🧰 Tools
🪛 GitHub Check: static analysis

[failure] 80-80: anti-slop(no-shape-in-symbol-names)
src/shared/telemetry-daemon-event-schemas.ts:80:59: Rename symbol "daemonOriginShape" for its domain role; "shape" describes structure rather than ownership.

…lop gate

no-shape-in-symbol-names rejects daemonOriginShape; the fields are event props.
@Jinwoo-H
Jinwoo-H merged commit 7c46a69 into main Sep 23, 2026
35 checks passed
davbebawy added a commit to davbebawy/orca that referenced this pull request Oct 1, 2026
…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
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.

1 participant