Skip to content

refactor(apple): deslop macOS and iOS apps third pass - #159778

Merged
steipete merged 1 commit into
mainfrom
deslop/l116-apple-apps3
Sep 28, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l116-apple-apps3

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Third-pass cleanup of the macOS and iOS app targets after the earlier platform sweeps. Repeated projection, dispatch, rendering, and forwarding code made the same behavior harder to maintain.

User Impact

The refactors preserve appearance, strings, Gateway wire models, signing, entitlements, and installer behavior. Fixes found during the sweep prevent malformed health output and extreme usage values from crashing the Mac app, and preserve session model-scope/runtime metadata in native chat in the final candidate. Temporary proof wiring captured the fixed native menu and exercised expanded native suites; it is removed from the final diff.

Why This Change Was Made

  • Consolidate window keyboard dispatch and reuse prepared accessibility budgets while retaining each execution-authority check.
  • Keep onboarding candidate metadata with its decoded owner; share identical provider rows, artwork, and feature actions without changing their layout.
  • Reuse endpoint-to-route projection, CLI credential precedence, canonical payload decoding, and existing string normalization; remove pass-through types and methods.
  • Consolidate iOS approval-notification dispatch under its existing descriptor owner; remove duplicated app-model projections and optional settlement plumbing.
  • Share Watch message admission and activation handling; synthesize unchanged encoding while retaining explicit legacy decoding.
  • Consolidate browser request admission/replies, Canvas presentation, speech startup, and CoreAudio array decoding; simplify private view helpers and mirrored state.

The final production diff removes 1,067 net production lines. The sweep read all 212 production files over 200 lines in the original census and the smaller source files; protected generated, signing, installer, and migration contracts remain unchanged. No Periphery retain annotation or baseline entry is added.

Fixes found along the way

  • The health decoder sliced between the first { and last } without checking their order. It now uses the existing JSON extraction owner. Exact original source traps on reversed braces; the fixed parser preserves clean/noisy valid JSON and rejects malformed input.
  • Usage and session percentages converted large finite numbers to Int before clamping. The existing projection now bounds usage before rendering; session percentages clamp before conversion. Original extreme-value probes trap, fixed probes pass, and ordinary fractional rounding is unchanged.
  • Native chat rebuilt sessions.list defaults and dropped modelSelectionTarget and agentRuntime. It now preserves the decoded defaults while installing the captured main-session key. A real transport regression covers the metadata round trip.

Evidence

READY-TO-LAND at 6599f9e. Exact-head PR CI passed on attempt 3, including both Mac jobs, iOS smoke, both screenshot shards, screenshot evidence and the final aggregate. The PR remains unarmed. The refreshed candidate retains 94 files, +990/-2001 overall and 1,067 net Swift production lines removed.

  • Local Apple builds ran serially under nice priority 10 with two jobs: macOS 1,264.19 seconds; iOS plus embedded Watch 1,809.162 seconds.
  • Blacksmith Testbox tbx_01m3kzyp9rwn7s7p1tdh1yry7t (provider run) verified the exact source and passed frozen installation, app-scoped check-changed, full protocol checks, native localization verification (4,087 entries, no drift), and all 39 fs-safe/plugin-boundary assertions. Remote command time was 341.723 seconds; the lease is stopped.
  • Current-head Mac proof passed 2,309 Swift tests, 2 rendered tests, 6 named-profile tests and its XCTest case. Metadata projection, native/web send ownership, window lifetime and NativeConversation suites executed. Packages passed 1,886 OpenClawKit tests, 16 NativeState tests and 12 Swabble tests.
  • Current-head main-tier iOS integration passed 381 lifecycle Swift tests, 6 logic tests and 9 XCTests, plus 87 voice/media Swift tests and 13 XCTests. IOSGatewayChatTransport and NodeAppModelInvoke executed. Watch RTC passed all 13 Rust tests. This broad manual run had non-native failures described below; it is not claimed as wholly green.
  • Earlier expanded native proof also exercised the notification, Gateway settings, Watch transport/localization and Watch inbox suites. Their inspected direct owners/tests remain unchanged. The old Watch receipt is historical; current dependency integration is covered by the fresh Rust run above.
  • The original native sessions-list projection failed three metadata assertions and lost the existing scope caption. The fixed real transport regression and inspected synthetic captures establish the repair. The captures below show the custom-transport native renderer, not main's new default web renderer; all images were delivered in chat and verified rendering inline in GitHub.
  • Exact-source health and numeric probes failed on the original defects and passed after repair. Valid/noisy JSON and ordinary fractional rounding remain unchanged. No Periphery baseline/retain annotations, localization IDs or source strings changed; the canonical inventory change records only Archive/Unarchive source-site kind.
  • Fresh independent review completed. Its sole pairing-name trimming concern was rejected against String+NonEmpty.swift, whose existing helper trims whitespace and returns nil when empty. No accepted/actionable finding remains.

The refresh preserves main's new conversation owner from #159946 while retaining the lane's removal of unused relay storage. The merged fixture keeps both inputs, both response cases and both independent regressions. Temporary native proof wiring is absent.

The first refreshed iPad screenshot job aborted while XCTest loaded Accessibility, before the selected test, setup or app launch. Its result contained only a System Failures runner node. A targeted same-head infrastructure rerun passed; the fail-fast-cancelled iPhone row was then resumed and passed, followed by screenshot evidence and the aggregate. No source, assertion, workload or timeout changed for these recoveries.

Broader manual failures and bounded investigation

These non-native failures are outside the Apple diff. They are retained as limitations, not relabeled as passing proof or automatically called pre-existing:

  • The macOS elevation metadata fixture reported strict process-group cleanup EPERM. The same-head ordinary job and preceding main job passed, which is not a repair. Source inspection found an intentional regression protecting signal-denial errors even after eventual closure. XNU supplies a possible zombie-only transition, but this occurrence lacks membership/UID/state evidence. Ignoring the error would weaken the contract; no safe fix is established.
  • The leaf-config planner timeout is owned by fix(ci): prevent leaf-config ownership check timeouts #160458, which targets directory probes without increasing the 120-second timeout; no duplicate repair was added here.
  • The UI session-progress liveness test failed. An unrelated current run failed the same test at an adjacent assertion; that corroborates instability but is not identical-assertion pre-existence proof. No UI fix is claimed.
  • Two isolated-heartbeat mirror tests missed a five-second delivery hook. One unchanged original-order replay on exact 6599f9e, Node 24.21.0 and frozen dependencies passed all three groups: 229 files / 4,274 tests, with 3 existing skipped files / 15 existing skipped tests, in 406.915 seconds. Heartbeat itself passed 30 files / 469 tests; the two cases took 1.880 and 2.480 seconds. Testbox tbx_01m3m4m59ajtmb6gwpnmqsj42d (provider run) had 8 CPUs/32 GB versus the failing hosted runner's 4 CPUs/16 GB. The original result is obscured by the timeout, so delayed delivery versus early skip/failure remains unresolved. This passing replay is not a fix; no limits, retries or assertions changed. The lease is stopped.

Related separately proved follow-ups: iOS bootstrap-refusal preservation #160218 (ready, unarmed); native heap-test collection repair #160414 (merged after Testbox proof).

Compatibility review

No config key, default, persisted schema, migration, retention rule, entitlement, signing setting, installer, or upgrade path changes in this PR.

The removed onboarding preferred-Gateway State copy could only return the canonical persisted value. Its callers now read GatewayDiscoveryPreferences.preferredStableID directly; that owner still normalizes values, reads the same legacy key, and performs the same existing writes and clears.

Watch snapshot, approval-record, and terminal-tombstone encoding retain the same emitted CodingKeys and optional-field omission. Read-only legacy keys remain in the custom decoders; the old encoders did not emit those legacy text fields either. Existing legacy JSON/semantic encoding tests and the native Watch operation suites passed. The ClawSweeper serialized-state/truncated-file-list flags do not identify a material storage or configuration change.

Native session model menu

Inspected, synthetic-only captures from the original projection and the fixed projection. The existing scope caption becomes visible when the Mac transport preserves the Gateway metadata.

Mac session model menu before the metadata fix

Mac session model menu after the metadata fix

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
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.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios app: macos App: macos size: XL scripts Repository scripts labels Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 16:27
@steipete
steipete force-pushed the deslop/l116-apple-apps3 branch from d2ac094 to 6e2ad0a Compare September 27, 2026 16:50
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 11:01 AM ET / 15:01 UTC (Revision 14).

ClawSweeper review

What this changes

The branch consolidates macOS, iOS, and Watch app code and repairs malformed health decoding, extreme percentage handling, and native chat session metadata.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open. Current main still has the native health, percentage, and chat-metadata defects addressed by the branch. The prior compatibility concern is resolved by the canonical preference read and unchanged Watch serialization contract; this review found no actionable introduced defect.

Priority: P2
Reviewed head: 6599f9e0eb07e04e335b489dc7c9b5aad3eb016e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct native-menu evidence and substantial current-head validation support a broad refactor with no established patch defect.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected native-menu before and after captures show the restored session-scope caption; the PR also reports current-head hosted native runs and a transport regression for the changed Mac projection. Watch encoding retains its emitted keys and legacy decoding, so no stored-data contract change was identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected native-menu before and after captures show the restored session-scope caption; the PR also reports current-head hosted native runs and a transport regression for the changed Mac projection. Watch encoding retains its emitted keys and legacy decoding, so no stored-data contract change was identified.
Evidence reviewed 8 items Current-main health defect: Fetched main still slices text from the first opening brace through the last closing brace without checking their order.
Current-main numeric and metadata paths: Main converts the session percentage before clamping, passes provider usage through unbounded, and rebuilds native chat defaults without model-selection scope or agent-runtime metadata.
Introduced repairs: The pinned branch uses the existing JSON extraction helper, bounds displayed provider usage, clamps session percentages before integer conversion, and carries Gateway session metadata into native chat.
Findings None None.
Security None None.

How this fits together

The native Apple apps turn Gateway responses, saved device state, and notifications into chat and status screens, Watch messages, and device actions. The changed adapters sit between those inputs and the rendered or dispatched result.

flowchart LR
A[Gateway responses] --> C[Native adapters]
B[Saved device state] --> C
C --> D[Mac chat and status]
C --> E[iOS screens]
E --> F[Watch inbox]
G[Approval notifications] --> H[Authority checks and actions]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: apps/macos/Sources/OpenClaw/OnboardingView+Actions.swift, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Retain the repairs in their existing native owners, with canonical Gateway preference reads and the existing Watch saved-state format.

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

Yes. Current-main source gives precise paths for reversed-brace health output, extreme percentages, and omitted native chat metadata; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes. The repairs use existing decoding and projection owners, while the preference and Watch changes preserve their existing contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The branch repairs bounded native-app failures and reduces maintenance cost without evidence of an emergency.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected native-menu before and after captures show the restored session-scope caption; the PR also reports current-head hosted native runs and a transport regression for the changed Mac projection. Watch encoding retains its emitted keys and legacy decoding, so no stored-data contract change was identified.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected native-menu before and after captures show the restored session-scope caption; the PR also reports current-head hosted native runs and a transport regression for the changed Mac projection. Watch encoding retains its emitted keys and legacy decoding, so no stored-data contract change was identified.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected native-menu before and after captures show the restored session-scope caption; the PR also reports current-head hosted native runs and a transport regression for the changed Mac projection. Watch encoding retains its emitted keys and legacy decoding, so no stored-data contract change was identified.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ef9be3d adds apps/ios/WatchApp/Sources/WatchInboxChatDelivery.swift:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ef9be3d8cfa5; files: apps/ios/WatchApp/Sources/WatchInboxChatDelivery.swift)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vitor Cepeda Lopes: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-27T23:24:46.376Z sha d93d3f4 :: blocked before merge. :: none
  • reviewed 2026-09-28T00:09:08.405Z sha d93d3f4 :: blocked before merge. :: none
  • reviewed 2026-09-28T00:38:03.030Z sha d93d3f4 :: blocked before merge. :: none
  • reviewed 2026-09-28T01:12:16.503Z sha d93d3f4 :: blocked before merge. :: none
  • reviewed 2026-09-28T11:28:21.717Z sha d93d3f4 :: blocked before merge. :: none
  • reviewed 2026-09-28T12:44:43.295Z sha 6599f9e :: blocked before merge. :: none
  • reviewed 2026-09-28T12:54:18.839Z sha 6599f9e :: blocked before merge. :: none
  • reviewed 2026-09-28T14:07:23.974Z sha 6599f9e :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 27, 2026
@steipete
steipete marked this pull request as draft September 27, 2026 18:44
@steipete
steipete force-pushed the deslop/l116-apple-apps3 branch from 4724d63 to 08c0866 Compare September 27, 2026 18:48
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 27, 2026
@steipete
steipete force-pushed the deslop/l116-apple-apps3 branch from 08c0866 to d93d3f4 Compare September 27, 2026 23:10
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 23:16
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 27, 2026
@steipete
steipete force-pushed the deslop/l116-apple-apps3 branch from d93d3f4 to 6599f9e Compare September 28, 2026 12:33
@steipete
steipete enabled auto-merge (squash) September 28, 2026 16:25
@steipete
steipete merged commit 648fd69 into main Sep 28, 2026
327 of 339 checks passed
@steipete
steipete deleted the deslop/l116-apple-apps3 branch September 28, 2026 16:26
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios app: macos App: macos P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant