Repository navigation
refactor(macos): deslop macOS app - #158516
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 1:21 AM ET / 05:21 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch simplifies macOS Gateway, dashboard, Quick Chat, capture, onboarding, and voice code, and guards JSON extraction against malformed CLI output. Merge readiness✅ Ready for maintainer review Keep open. Current main and the latest release lack the malformed-output crash guard, and this branch remains distinct useful work. I found no actionable defect in the reviewed head. Priority: P2 Review scores
Verification
How this fits togetherThe macOS app receives Gateway messages, CLI output, and local device events. Its native services turn those inputs into connection state, dashboard and chat interactions, device actions, and diagnostics. flowchart LR
A[Gateway messages and CLI output] --> C[macOS app services]
B[Local devices and permissions] --> C
C --> D{Parse and route}
D --> E[Dashboard and Quick Chat]
D --> F[Native actions and diagnostics]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther -1226. Total -1226 across 69 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the simplified native owners and the brace-order guard while preserving existing settings, bridge contracts, and approval checks. Do we have a high-confidence way to reproduce the issue? Yes for the included crash: reversed braces reach an unchecked Swift range on current main. The broader refactor is cleanup rather than a separate bug reproduction. Is this the best way to solve the issue? Yes. The range guard belongs at the extractor, and the consolidation generally reuses existing native owners without adding a competing contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0d7a4e817abc. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
6669963 to
ffd01f0
Compare
|
The optional The complete app build and native test compilation passed after the scope reduction. The prior reviewed head passed both hosted macOS jobs and the required CI gate; the final head is being checked. The PR body records the compiler/lint corrections, original-failing parser regression, unchanged localization, protocol check, and remote changed-file gate. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
The node-service runner and its update-facing dependencies are now unchanged from the base: The remaining parser guard is independently proven against malformed output, and the app rebuild passed after the scope reduction. There is no changed restart/status/update control path in those owners. The PR body records this boundary and the retained proof; final native CI is being refreshed. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
* refactor(macos): deslop macOS app * style(macos): align closure captures with opening braces * fix(macos): isolate model menu invalidation on MainActor * refactor(macos): leave upgrade and preference paths unchanged * refactor(macos): preserve installed service lifecycle owners
What Problem This Solves
This maintainer-directed macOS sweep (lane l62) reduces repeated command parsing, connection bookkeeping, native menu plumbing, and value-copying code across related paths.
User Impact
The refactor preserves rendering, user-visible strings, Gateway wire behavior, authentication/pairing, Keychain and permission flows, persisted state, public URLs, and update configuration. No dependencies or shared Apple sources change.
Malformed CLI output containing a closing brace before an opening brace now falls back to normal diagnostic handling instead of crashing the app's JSON extractor.
Why This Change Was Made
Fixes found along the way
The CLI JSON extractor selected the first opening brace and last closing brace without checking their order. A reversed pair constructed an invalid Swift range. The regression covers malformed output and retained noisy service-error extraction.
Compatibility boundary
The update controller, node-service runner, launchd parsing, process environment helpers, runtime lookup, Gateway process manager, and their coupled app-state/command-resolution helpers are unchanged from the main base. The preference-selection path is also unchanged. Their optional cleanup was removed to keep the installed-update path outside this PR. Persisted keys and formats remain unchanged; the retained onboarding receipt cleanup preserves decoded values and serialized keys.
Evidence
Production: 1,134 net lines removed, counting production sources only and excluding Tests and generated code.
Blacksmith Testbox
tbx_01m3dvq4xbx6fkmkrx0gh2375q(run) passednode scripts/check-changed.mjswith all then-changed paths,pnpm native:i18n:verify(4,055 entries, unchanged), andpnpm protocol:check:swifton the rebased source. The changed gate ran macOS packaging/lifecycle TypeScript tests in 143.90 seconds. The final scope reductions restore update/service-facing files to that tested main base. All five generated Mermaid resources match a fresh remote build. The lease is stopped.The parser regression trapped on the original code with
Range requires lowerBound <= upperBound(exit 132), then passed both Swift Testing tests, including five malformed-output arguments, on the fixed source. Isolated Foundationswift testwall time was 4.913 seconds including compilation; test execution was 0.001 seconds. The same test file is in the native target.Apple proof ran locally under the explicit exception, sequentially with
nice -n 10and two jobs. The CLI build passed. The full app rebuild after the scope reduction passed in 128.34 seconds. Native test compilation passed after the final lifecycle scope reduction in 315.29 seconds.--disable-build-manifest-cachingcorrects SwiftPM's stale source list after a rebase. No app or full native suite ran against operator state. The full suite ran on disposable hosted macOS CI.Exact-head hosted CI passed on
40976f8821be71bc7bdcfb8698ef5b4a80f2dc7d, including both macOS jobs and the required CI gate. The native test job took 696 seconds including build and the full suite. Earlier validation found two closure-layout lint violations and a non-Sendable menu capture. The fixes preserve layout and carry cancellation through a MainActor-bound Sendable function. No unchecked conformance or suppression was added.Independent Codex reviews cover the complete refactor and the focused formatting, actor-isolation, and scope-reduction corrections. No accepted actionable findings remain. The initial full review's two claims were rejected against the existing owners:
TalkStopReasonhas only speech/userTap/manual cases, and the Tailscale snapshot initializer already trims passwords.ClawSweeper's review of the final head reports no actionable findings, no security issues, and no before-merge items. It confirms that the update/service owners behind the earlier compatibility concern are no longer in the patch. This PR remains unmerged for the maintainer handoff.
Remote lease history
All leases used Blacksmith Testbox and are stopped.
tbx_01m3d8sm7773d3s4r8swm2rx2bpassed the initial localization check, then expired during source preparation.tbx_01m3ddt2w4kt0kvemr53cjybb3passed the original-failing/fixed-passing Swift parser regression, localization, protocol drift, and changed-file checks.tbx_01m3dvq4xbx6fkmkrx0gh2375qrefreshed the rebased-source checks and generated-resource hashes; one harness assertion incorrectly expected the source commit inHEADrather than the wrapper's transport carrier, and was corrected to check the source bytes while retaining the wrapper's complete source verification.