fix: restore nightly CLI compilation after Cursor approvals

Merged
AU
3mo ago
+29-3

Summary

  • Restore cmux-cli compilation under Xcode 26.5 / Swift 6.3 by explicitly encoding the persisted PendingCursorShellApproval fields while keeping the legacy command key decode-only.
  • Rename the mutable project-root discovery variable so the final resolved projectRoot binding is not an invalid redeclaration.
  • Preserve the existing Cursor approval persistence/config behavior and all #10787 worktree filesystem-identity safety behavior.
  • This complete two-diagnostic repair supersedes the one-error-only open PR #10808.
  • Workspace identity: cmux163: #10787 nightly worktree compilation.

Testing

  • Extended CLINotifyProcessIntegrationRegressionTests.testCursorShellApprovalDistinguishesUnsandboxedAndSandboxedPayloads to assert that persisted approval metadata round-trips through the real CLI hook path and does not emit the legacy decode-only key.
  • Test-only commit: ef4670da0f.
  • Fix commit: 3704118e5f.
  • Static repository guards pass (git diff --check, pbxproj normalization, package-resolved policy, workspace package grouping, and test wiring). The mandated file-length script/TSV is absent from this checkout; no budget file was created or changed.
  • Full Xcode validation will run on the shared GitHub macOS lane; no local app build or XCUITest was run.

Demo Video

Not applicable: compiler-only repair.

Review Trigger (Copy/Paste as PR comment)

@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

Checklist

  • I added or updated tests for behavior changes
  • I updated docs/changelog if needed (not applicable)
  • I requested bot reviews after my latest commit
  • All code review bot comments are resolved
  • All human review comments are resolved

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Improved persistence of shell-command approvals.
    • Approval records now retain the command’s UTF-8 length without storing the raw command text.
    • Project-root detection continues to fall back to the current working directory when no repository root is found.