Skip to content

fix: remove stored identity defaults from worktree result - #10787

Merged
azooz2003-bit merged 1 commit into
mainfrom
fix-nightly-worktree-init-defaults-v2
Aug 26, 2026
Merged

azooz2003-bit merged 1 commit into
mainfrom
fix-nightly-worktree-init-defaults-v2

Conversation

@austinywang

@austinywang austinywang commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to merged PR #10781. Its explicit initializer assigns the two
filesystem identity let properties, but the stored declarations still had
= nil defaults. Xcode 26.5's nightly compiler therefore reports that each
immutable property may only be initialized once in Sources/ExtensionWorktreePrototype.swift.

This fix removes those stored-value defaults while keeping = nil on the
explicit initializer parameters, so callers that omit identity values remain
source-compatible. The component-wise optional identity comparison from #10781
and its existing behavior test asserting that captured identity values survive
initialization are unchanged.

This is a focused post-merge repair, not a duplicate of open PR #10777. The
remote PTY overlap is limited to the stale bridge lease and reattach work owned
by #10367/#10368, #10173/#10327/#10350; no remote PTY code is changed here.

Verification

  • git diff --check
  • ./scripts/check-pbxproj.sh
  • python3 scripts/check-package-resolved-policy.py
  • python3 scripts/check-workspace-package-groups.py --check
  • Swift 6.3.3 type-check of legacy (omitted identity) and captured-identity
    initializer call forms
  • GitHub Actions nightly run 32927112366 reproduced the Xcode 26.5 diagnostics;
    the PR's CI run will provide the real Xcode compiler proof for this repair.

The repository has no .github/swift-file-length-budget.tsv,
swift-warning-budget.tsv, or scripts/swift_file_length_budget.py on this
base, so no budget files were created or modified.


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

  • Refactor
    • Updated internal initialization behavior for optional worktree identifiers without changing the user-visible functionality.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a5289e74-c4d7-409e-ba64-e8812e919206

📥 Commits

Reviewing files that changed from the base of the PR and between 12430de and 20d255b.

📒 Files selected for processing (1)
  • Sources/ExtensionWorktreePrototype.swift

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


📝 Walkthrough

Walkthrough

The worktree prototype removes stored-property nil defaults from worktreeDeviceID and worktreeFileID. Both fields remain optional and use defaults from the explicit memberwise initializer.

Changes

Worktree identity initialization

Layer / File(s) Summary
Identity field declarations
Sources/ExtensionWorktreePrototype.swift
The optional worktree filesystem identity fields no longer have stored-property defaults. The memberwise initializer continues to provide nil defaults.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 20d25

This focused change removes redundant stored identity defaults while preserving optional initializer behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: removing stored identity defaults from the worktree result.
Description check ✅ Passed The description provides a detailed summary and verification results. It does not include the template checklist or review-trigger block, but the core required information is complete and the Demo Vid…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Cmux Swift Actor Isolation ✅ Passed PASS. The committed diff changes only two stored optional property declarations in CmuxExtensionWorktreeCreationResult, removing = nil. It adds no actor annotations, protocols, reference types, UI…
Cmux Swift Blocking Runtime ✅ Passed PASS: The pull request changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil from worktreeDeviceID and worktreeFileID. The diff adds no sema…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request changes only Sources/ExtensionWorktreePrototype.swift, removing two stored = nil defaults. The diff contains no browser socket commands, WebKit/AppKit access, routing change…
Cmux Expensive Synchronous Load ✅ Passed PASS — the commit changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil from worktreeDeviceID and worktreeFileID. The diff adds or moves no …
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. It does not replace any authoritative read with a cached or opport…
Cmux No Hacky Sleeps ✅ Passed PASS: The commit changes only Sources/ExtensionWorktreePrototype.swift, removing two = nil stored-property defaults. The custom rule applies only to TypeScript, JavaScript, shell, and non-Swift bu…
Cmux Algorithmic Complexity ✅ Passed PASS: The diff changes only two stored optional property declarations in Sources/ExtensionWorktreePrototype.swift (lines 15–16). It adds no loops, collection scans, sorting, filtering, joins, or bat…
Cmux Swift Concurrency ✅ Passed PASS: The pull request changes only two stored optional property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. The exact diff adds no DispatchQueue, Combine, completi…
Cmux Swift @Concurrent ✅ Passed PASS — The exact HEAD diff changes only the stored declarations of worktreeDeviceID and worktreeFileID from = nil to optional properties without defaults. It changes no async, nonisolated, `…
Cmux Swift Package Boundaries ✅ Passed PASS: The diff changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift. It removes = nil from worktreeDeviceID and worktreeFileID; it does not add or expand d…
Cmux Swiftpm Lockfiles ✅ Passed PASS: The pull request changes only Sources/ExtensionWorktreePrototype.swift (2 additions and 2 deletions). It does not change a Package.swift, package dependency, .gitignore, workflow, Xcode pa…
Cmux Swift Logging ✅ Passed PASS: The diff changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. It adds no print, debugPrint, dump, NSLog, file/stdout logging, `L…
Cmux User-Facing Error Privacy ✅ Passed PASS. The only production diff removes stored = nil defaults from two optional filesystem identity properties. It adds no user-facing error, alert, command output, API body, or recovery copy, and th…
Cmux Full Internationalization ✅ Passed PASS. The exact commit diff changes one file and only removes stored = nil defaults from worktreeDeviceID and worktreeFileID. The initializer parameter defaults remain unchanged. The diff adds o…
Cmux Swiftui State Layout ✅ Passed PASS: The pull request changes only two stored optional property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. The file is not a SwiftUI view and contains no `Observabl…
Cmux Architecture Rethink ✅ Passed PASS: The pull request changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil from let worktreeDeviceID and let worktreeFileID. The explicit …
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: The diff only removes stored = nil defaults from two UInt64? properties in CmuxExtensionWorktreeCreationResult. It adds or changes no NSWindow, NSPanel, NSWindowController, SwiftUI w…
Cmux Source Artifacts ✅ Passed PASS. The only changed path is Sources/ExtensionWorktreePrototype.swift. The diff removes stored = nil defaults from two handwritten Swift source properties and keeps the initializer parameter def…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS. The PR changes only Sources/ExtensionWorktreePrototype.swift, a production source file. The diff removes = nil from two stored properties and adds no #if guard, test/debug-named member, vi…
Cmux No Ambient Global State ✅ Passed PASS. The diff changes only two existing stored let properties in CmuxExtensionWorktreeCreationResult at lines 15–16 by removing = nil. It adds no top-level function, mutable global, namespace t…
Full details: Description check

Explanation

The description provides a detailed summary and verification results. It does not include the template checklist or review-trigger block, but the core required information is complete and the Demo Video section is not needed for this compiler-fix change.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Cmux Swift Actor Isolation

Explanation

PASS. The committed diff changes only two stored optional property declarations in CmuxExtensionWorktreeCreationResult, removing = nil. It adds no actor annotations, protocols, reference types, UI stores, loggers, or background accesses. The type remains the same Sendable value model, and its explicit initializer and Sendable conformance are unchanged. Therefore the diff does not introduce or materially worsen any listed Swift 6 actor-isolation mistake.

Full details: Cmux Swift Blocking Runtime

Explanation

PASS: The pull request changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil from worktreeDeviceID and worktreeFileID. The diff adds no semaphores, waits, sleeps, delayed dispatch, polling, synchronous main-queue calls, or locks. The existing NSLock implementation is unchanged, so the check's explicit allowance for existing blocking code applies.

Full details: Cmux Browser Automation Off-Main

Explanation

PASS: The pull request changes only Sources/ExtensionWorktreePrototype.swift, removing two stored = nil defaults. The diff contains no browser socket commands, WebKit/AppKit access, routing changes, or policy tests. The rule's target files remain unchanged, so the browser automation check is not applicable.

Full details: Cmux Expensive Synchronous Load

Explanation

PASS — the commit changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil from worktreeDeviceID and worktreeFileID. The diff adds or moves no synchronous load, filesystem scan, JSON/JSONL parsing, transcript/history access, main-actor work, or interactive-path handler. The existing initializer defaults remain, and the existing background rollback path is unchanged.

Full details: Cmux Cache Substitution Correctness

Explanation

PASS: The pull request changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. It does not replace any authoritative read with a cached or opportunistic value, and it does not alter a persistence, history, undo, or snapshot path. The initializer parameter defaults and explicit assignments remain unchanged.

Full details: Cmux No Hacky Sleeps

Explanation

PASS: The commit changes only Sources/ExtensionWorktreePrototype.swift, removing two = nil stored-property defaults. The custom rule applies only to TypeScript, JavaScript, shell, and non-Swift build/runtime scripts. No covered file or timing construct was added.

Full details: Cmux Algorithmic Complexity

Explanation

PASS: The diff changes only two stored optional property declarations in Sources/ExtensionWorktreePrototype.swift (lines 15–16). It adds no loops, collection scans, sorting, filtering, joins, or batch-action logic. The related initializer and existing identity-handling code remain unchanged. The algorithmic-complexity failure conditions do not apply.

Full details: Cmux Swift Concurrency

Explanation

PASS: The pull request changes only two stored optional property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. The exact diff adds no DispatchQueue, Combine, completion-handler, or fire-and-forget Task code. Existing Task.detached and async code is identical in the parent and head revisions, so the pull request does not introduce or materially expand a legacy async pattern.

Full details: Cmux Swift `@Concurrent`

Explanation

PASS — The exact HEAD diff changes only the stored declarations of worktreeDeviceID and worktreeFileID from = nil to optional properties without defaults. It changes no async, nonisolated, @concurrent, actor isolation, or async call site. The existing @concurrent annotation on rollbackUnclaimedWorktree() and its detached file/process work are identical to the parent revision. No stated Swift concurrency failure condition is introduced.

Full details: Cmux Swift Package Boundaries

Explanation

PASS: The diff changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift. It removes = nil from worktreeDeviceID and worktreeFileID; it does not add or expand domain logic, a public API, or a reusable feature boundary. The file and type are explicitly prototype code (ExtensionWorktreePrototype / CmuxExtensionWorktreePrototype), which the rule allows. The explicit initializer still owns the optional defaults.

Full details: Cmux Swiftpm Lockfiles

Explanation

PASS: The pull request changes only Sources/ExtensionWorktreePrototype.swift (2 additions and 2 deletions). It does not change a Package.swift, package dependency, .gitignore, workflow, Xcode package reference, or any Package.resolved file. Therefore the SwiftPM lockfile policy does not apply, and no stated failure condition is introduced.

Full details: Cmux Swift Logging

Explanation

PASS: The diff changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. It adds no print, debugPrint, dump, NSLog, file/stdout logging, Logger, or sensitive-data logging. Existing OSLog calls are unchanged, and the diff does not introduce or materially change a file-scoped logger.

Full details: Cmux User-Facing Error Privacy

Explanation

PASS. The only production diff removes stored = nil defaults from two optional filesystem identity properties. It adds no user-facing error, alert, command output, API body, or recovery copy, and the changed lines contain no sensitive implementation details. The explicit initializer parameters retain = nil; identity values remain internal fields used for rollback checks and are not interpolated into user-visible text. Existing error strings and private logging are unchanged.

Full details: Cmux Full Internationalization

Explanation

PASS. The exact commit diff changes one file and only removes stored = nil defaults from worktreeDeviceID and worktreeFileID. The initializer parameter defaults remain unchanged. The diff adds or changes no user-facing text, localization key, catalog entry, web message, metadata, API response, markdown, or changelog content. Therefore no stated full-internationalization failure condition applies.

Full details: Cmux Swiftui State Layout

Explanation

PASS: The pull request changes only two stored optional property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil. The file is not a SwiftUI view and contains no ObservableObject, @Published, @Observable, GeometryReader, lazy/list row, or render-time state mutation changes. The custom SwiftUI state-layout failure conditions do not apply.

Full details: Cmux Architecture Rethink

Explanation

PASS: The pull request changes only two stored-property declarations in Sources/ExtensionWorktreePrototype.swift, removing = nil from let worktreeDeviceID and let worktreeFileID. The explicit initializer still provides = nil parameter defaults and assigns both properties. The diff adds no sleeps, polling, locks, observers, side channels, duplicate wiring, or UI lifecycle ownership. This is a small local compiler-correctness fix with the existing owner and identity invariant unchanged.

Full details: Cmux Swift Auxiliary Window Close Shortcuts

Explanation

PASS: The diff only removes stored = nil defaults from two UInt64? properties in CmuxExtensionWorktreeCreationResult. It adds or changes no NSWindow, NSPanel, NSWindowController, SwiftUI window, identifier, or close-shortcut code. The auxiliary-window lint also passes.

Full details: Cmux Source Artifacts

Explanation

PASS. The only changed path is Sources/ExtensionWorktreePrototype.swift. The diff removes stored = nil defaults from two handwritten Swift source properties and keeps the initializer parameter defaults. It adds no logs, screenshots, recordings, temporary directories, caches, build output, dependency checkouts, or other source-control artifacts.

Full details: Cmux No Test Or Debug Seam In Production Source

Explanation

PASS. The PR changes only Sources/ExtensionWorktreePrototype.swift, a production source file. The diff removes = nil from two stored properties and adds no #if guard, test/debug-named member, visibility change, or wrapper accessor. The explicit initializer parameter defaults remain unchanged.

Full details: Cmux No Ambient Global State

Explanation

PASS. The diff changes only two existing stored let properties in CmuxExtensionWorktreeCreationResult at lines 15–16 by removing = nil. It adds no top-level function, mutable global, namespace type, singleton, or app-delegate state. Existing static helpers and types remain unchanged.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-nightly-worktree-init-defaults-v2

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.

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