Skip to content

feat(native): select call-control backend without retiring the helper - #53

Merged
steipete merged 1 commit into
mainfrom
steipete/runtime-helper-selection-r7
Oct 2, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/runtime-helper-selection-r7

Conversation

@steipete

@steipete steipete commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

On stock macOS, protected-process attachment is unavailable; on other systems, successful attachment can still end in AMFI/library-validation rejection. Removing the injected helper for every system loses working private call control. This replacement for #50 retains both native artifacts and adds facetime-audio-capture --select-backend [--app FaceTime|Phone].

The selector checks SIP and existing Developer Tools authorization, verifies the running target's Apple identity, and selects injection only after a bounded load confirms helper initialization. Every unavailable state selects out-of-process capture. It does not modify security policy. The private IPC key is passed only through the existing one-use sidecar; the Gateway must still authenticate the helper and admit callers. The seven-file archive and native protocol remain unchanged.

Apple documents debugger restrictions and library validation separately. Full SIP disablement alone is not evidence that the release dylib will load. Backend documentation links Apple's sources, explains the runtime decision and operator-assisted capture contract, and records the live-proof limit. The canonical OpenClaw plugin owns lifecycle/admission and must consume this new native operation; this PR does not alter an installed plugin's policy. The coordinated host work referenced by #50 is openclaw/openclaw#158392.

Also fixes a reproduced parser error: an explicit Debugging Restrictions: enabled was ignored when a disabled SIP summary appeared elsewhere. Synthetic regression cases now verify explicit restrictions, malformed/contradictory output, full disablement, custom configuration, command failure, loader rejection, and successful initialization.

Validation:

  • nice -n 19 swift build --package-path native -c debug -j 2: passed.
  • nice -n 19 bash scripts/test-native.sh: passed, including selector policy, credential/timeout fixtures, PCM pipe-loss and process-generation checks.
  • Shell syntax checks: passed for every scripts/*.sh.
  • Built selector on a SIP-enabled Mac: both FaceTime and Phone returned out-of-process / sip-enabled; invalid app returned exit 2. No injection or system security changes were performed.
  • One AWS Crabbox lease: frozen install passed; 55 portable Vitest tests passed. The initial full Linux run could not execute six macOS Objective-C checks; the full macOS harness and build/archive gates are covered by PR Actions.
  • Independent Codex review: scoped-clean at P0–P2. Its staged-image cleanup finding was fixed and covered with successful/failed initialization fixtures.
  • Exact head 4ae4d55ce4e3c8b287caacb5166bc4e596c1cd69: CI passed workflow lint, all three supported Node.js harnesses, native checks, capture build, and archive build/verification. CodeQL passed all four languages; the aggregate CodeQL check also passed.

No disabled-SIP/relaxed-AMFI live call is claimed. Both selector branches have synthetic regression coverage; actual permissive-system loading remains OS-dependent. Thanks @RomneyDa for identifying the platform-library-validation failure and developing the capture-only proposal. This preserves that fallback without retiring the helper.

Requires the repository's code-owner approval; no ruleset bypass or release is part of this PR.

Keep the injected helper and out-of-process capture in the native archive.
Require actual initialization after security checks before choosing injection,
and select capture when the target's current policy rejects it. Document the
host admission boundary and the limits of SIP-only compatibility checks.

Fix explicit SIP debugging restriction precedence and cover loader outcomes,
private credential handling, bounded subprocesses, and staging cleanup.

Co-authored-by: Dallin Romney <[email protected]>
@steipete
steipete requested a review from a team as a code owner October 1, 2026 01:35
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed September 30, 2026, 9:59 PM ET / October 1, 2026, 01:59 UTC (Revision 2).

ClawSweeper review

What this changes

Adds a native command that checks macOS security state, tries to initialize the FaceTime or Phone helper when eligible, and otherwise selects out-of-process capture; it also updates injector diagnostics, checks, and documentation.

Merge readiness

⛔ Blocked before merge - 7 items remain

Keep this PR open. The new selector misses an existing FaceTime helper target, the coordinated OpenClaw host PR still proposes a capture-only contract, and the privileged attach path lacks final-effect identity proof.

Priority: P2
Reviewed head: 4ae4d55ce4e3c8b287caacb5166bc4e596c1cd69
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation has focused checks and reported native validation, but the surviving fallback defect and missing final-effect authority proof limit readiness.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: The PR reports that the built selector returned out-of-process capture on a SIP-enabled Mac, which exercises the blocked branch. It does not show an eligible verified target initializing the helper or a replaced or unauthorized target being rejected before LLDB load. Add redacted final-effect terminal evidence from an operator-authorized setup, without changing macOS security policy; redact private paths, keys, identifiers, and endpoints. Updating the PR body should trigger re-review, or a repository writer can request @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: The PR reports that the built selector returned out-of-process capture on a SIP-enabled Mac, which exercises the blocked branch. It does not show an eligible verified target initializing the helper or a replaced or unauthorized target being rejected before LLDB load. Add redacted final-effect terminal evidence from an operator-authorized setup, without changing macOS security policy; redact private paths, keys, identifiers, and endpoints. Updating the PR body should trigger re-review, or a repository writer can request @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 11 items Repository boundary: The native package owns the two artifacts; the OpenClaw plugin owns higher-level policy and runtime decisions.
Existing helper target: The current-main injector falls back to the FaceTime conversation service when the FaceTime app is unavailable.
Helper accepts the service: The existing helper explicitly initializes in the FaceTime conversation service.
Findings 1 actionable finding [P2] Preserve the FaceTime conversation-service fallback
Security Needs attention Bind verified identity to the helper load: A process can change or a PID can be reassigned between signature validation and LLDB attach. The available evidence does not show rejection of the nearest replacement target before the staged helper is loaded.

How this fits together

The native FaceTime package supplies a call-control helper and a Core Audio capture executable. The OpenClaw plugin owns caller admission and call lifecycle, and would consume the new backend choice during setup.

flowchart LR
A[Setup request] --> B[Native backend selector]
B --> C[Mac security checks]
C --> D{Helper eligible?}
D -->|Yes| E[Verified helper load]
D -->|No| F[Out-of-process capture]
E --> G[OpenClaw plugin admission]
F --> G
Loading

Decision needed

Question Recommendation
Should the OpenClaw host retain an authenticated injected-helper path and consume this native selector, given that the linked open host PR currently removes that path? Coordinate both backends: Update the host work to consume the native result, preserve authenticated helper admission, and use operator-assisted capture when selection rejects injection.

Why: The two open branches describe incompatible end-to-end call-control contracts; selecting and sequencing that contract requires the owners of both repositories.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: The PR reports that the built selector returned out-of-process capture on a SIP-enabled Mac, which exercises the blocked branch. It does not show an eligible verified target initializing the helper or a replaced or unauthorized target being rejected before LLDB load. Add redacted final-effect terminal evidence from an operator-authorized setup, without changing macOS security policy; redact private paths, keys, identifiers, and endpoints. Updating the PR body should trigger re-review, or a repository writer can request @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve the FaceTime conversation-service fallback (P2) - The existing injector falls back to com.apple.FaceTime.FTConversationService when the FaceTime app is unavailable, and the helper accepts that service. This selector looks up only the app bundle ID, so the same eligible setup reports capture instead of retaining private call control. The prior review raised this finding on the same head.
  • Resolve security concern: Bind verified identity to the helper load - A process can change or a PID can be reassigned between signature validation and LLDB attach. The available evidence does not show rejection of the nearest replacement target before the staged helper is loaded.
  • Resolve merge risk (P1) - If the verified FaceTime process exits or its PID is reassigned before LLDB attaches, the new path has no demonstrated final-effect check that rejects the replacement before loading the staged helper.
  • Resolve merge risk (P1) - The linked OpenClaw host PR removes helper RPC and injection setup, while this PR requires a host that consumes and authenticates the native selection; the intended cross-repository rollout is unresolved.
  • Complete next step (P2) - Preserve conversation-service selection, provide allowed and rejected final-effect attach proof, and resolve the linked OpenClaw host contract before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P2] Preserve the FaceTime conversation-service fallback — native/Sources/FaceTimeAudioCapture/HelperBackendRuntime.swift:101-108
  • [medium] Bind verified identity to the helper load — native/Sources/FaceTimeAudioCapture/HelperBackendRuntime.swift:131
Agent review details

Security

Needs attention: The privileged load path checks a process identity before staging and attaching, but final-effect identity for the LLDB target remains unproven.

Review metrics

Metric Value Why it matters
Code growth production +264/−14 lines; tests +156/−1 lines The new native operation adds a substantial privileged load path with focused synthetic coverage.

Root-cause cluster

Relationship: canonical
Canonical: #53
Summary: The closed, unmerged capture-only proposal was expressly replaced by this branch, which retains the helper while adding a capture fallback.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Repair and coordinate the selector (recommended)
    Retain the conversation-service fallback, establish final-effect target proof, and agree on the OpenClaw host contract before merge.
  2. Pause the native operation
    Hold the new setup operation while the host owners decide whether injected call control remains supported.

Technical review

Best possible solution:

Preserve the conversation-service target, bind target identity to the final helper load, and coordinate a host setup path that consumes the selection and authenticates the helper before call control.

Do we have a high-confidence way to reproduce the issue?

Yes for the review finding: source shows the existing conversation-service fallback and the selector's app-only lookup when that service is the available target. No live macOS run of that case is recorded.

Is this the best way to solve the issue?

No, not yet. Keeping both native artifacts is coherent, but the selector needs the existing target fallback, final-effect identity assurance, and a compatible host contract.

Full review comments:

  • [P2] Preserve the FaceTime conversation-service fallback — native/Sources/FaceTimeAudioCapture/HelperBackendRuntime.swift:101-108
    The existing injector falls back to com.apple.FaceTime.FTConversationService when the FaceTime app is unavailable, and the helper accepts that service. This selector looks up only the app bundle ID, so the same eligible setup reports capture instead of retaining private call control. The prior review raised this finding on the same head.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.89

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6bdd4f73a26f.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This bounded native feature has a concrete fallback defect and unresolved integration, without evidence of a present production outage.
  • merge-risk: 🚨 compatibility: The selector misses a supported helper target and the linked host branch currently follows a different call-control contract.
  • merge-risk: 🚨 security-boundary: The new command reads a private Gateway key and attaches a debugger to a PID after an earlier identity check.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: The PR reports that the built selector returned out-of-process capture on a SIP-enabled Mac, which exercises the blocked branch. It does not show an eligible verified target initializing the helper or a replaced or unauthorized target being rejected before LLDB load. Add redacted final-effect terminal evidence from an operator-authorized setup, without changing macOS security policy; redact private paths, keys, identifiers, and endpoints. Updating the PR body should trigger re-review, or a repository writer can request @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Bind verified identity to the helper load — native/Sources/FaceTimeAudioCapture/HelperBackendRuntime.swift:131
    A process can change or a PID can be reassigned between signature validation and LLDB attach. The available evidence does not show rejection of the nearest replacement target before the staged helper is loaded.
    Confidence: 0.82

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Sebastien Tardif: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Omar Shahine: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Cover the existing FaceTime conversation-service fallback in the selector and focused checks.
  • Show that an eligible verified target initializes successfully and that the nearest replaced or unauthorized target is rejected before helper loading.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-01T01:39:01.438Z sha 4ae4d55 :: needs real behavior proof before merge. :: [P2] Preserve selection of the FaceTime conversation service

@steipete
steipete merged commit 60b0ab9 into main Oct 2, 2026
14 checks passed
@steipete
steipete deleted the steipete/runtime-helper-selection-r7 branch October 2, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant