refactor: prune unused iOS code#91996
Conversation
5242ebc to
6a161ec
Compare
|
Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 4:27 AM ET / 08:27 UTC. Summary PR surface: Tests +676, Config +599, Other -1319. Total -44 across 44 files. Reproducibility: not applicable. as a bug report; the cleanup and CI behavior instead have source inspection, real GitHub workflow proof, and focused workflow tests. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the dead-code cleanup and guarded Periphery reporting workflow after iOS and automation owners explicitly accept the gate’s availability tradeoff and preserve the exact-head, bounded-artifact, and comment-sanitization checks. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug report; the cleanup and CI behavior instead have source inspection, real GitHub workflow proof, and focused workflow tests. Is this the best way to solve the issue? Yes, with maintainer acceptance of the tradeoffs: Periphery is the right whole-Xcode-graph tool for Swift dead-code pruning, and the split read-only scan plus tightly validated workflow_run commenter is the right trust-boundary shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 44bf1c6d728a. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Tests +676, Config +599, Other -1319. Total -44 across 44 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
6a161ec to
9ceefe2
Compare
25fcfe7 to
42b7247
Compare
42b7247 to
af76bfd
Compare
|
Land-ready verification for
Local full Periphery execution was blocked only by this Mac lacking the watchOS 26.5 runtime; the exact-head GitHub Periphery run passed. The prerequisite Swift protocol generator/type-guard repairs are on |
Prune unused iOS surfaces and regenerate the Xcode project. Add a scoped Periphery PR gate with hardened artifact handling and stale-status cleanup. Co-authored-by: Sash Zats <[email protected]>
Prune unused iOS surfaces and regenerate the Xcode project. Add a scoped Periphery PR gate with hardened artifact handling and stale-status cleanup. Co-authored-by: Sash Zats <[email protected]>
Prune unused iOS surfaces and regenerate the Xcode project. Add a scoped Periphery PR gate with hardened artifact handling and stale-status cleanup. Co-authored-by: Sash Zats <[email protected]>
Summary
apps/ios/**changes.Why Periphery in GitHub PR CI
SwiftLint is the wrong source of truth for this gate. Its dead-code rules are lint-style checks and do not model the full Xcode/Swift build graph well enough for high-trust cleanup. Periphery indexes the real iOS Xcode project and is designed to find unused Swift declarations/files across the compiled target graph, so it is the tool we use for both cleanup and regression prevention.
This is a PR workflow instead of a pre-commit hook because Periphery requires Xcode project generation and an Xcode build/index pass. That is too slow and environment-dependent to rely on for every contributor locally, and hooks are optional. The GitHub check is the authoritative enforcement point before merge.
The PR comment is handled by a separate
workflow_runworkflow so untrusted PR code runs without a writable token. The scan workflow uploads sanitized Periphery output as an artifact; the trusted commenter reads that artifact and updates one bot comment with the dead-code table.Verification
DEVELOPER_DIR=/Applications/Xcode-26.5.0.app/Contents/Developer periphery scan --config apps/ios/.periphery.yml --strict --format json-> clean[]PeripheryProofProbe: https://github.com/openclaw/openclaw/actions/runs/27423633308/job/81055461401 -> expected failureruby -e 'require "yaml"; ARGV.each { |f| YAML.load_file(f) }' .github/workflows/ios-periphery.yml .github/workflows/ios-periphery-comment.yml apps/ios/.periphery.yml-> passAsyncFunction-> passshould-fail=1.agents/skills/autoreview/scripts/autoreview --mode local-> clean, no accepted/actionable findings after scope fixxcodebuild test -project apps/ios/OpenClaw.xcodeproj -scheme OpenClawLogicTests -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.5' CODE_SIGNING_ALLOWED=NO->TEST SUCCEEDEDBuild Note
A full
OpenClawapp build with Xcode 27 beta is blocked on currentmainby the deprecated WatchKit product typecom.apple.product-type.watchkit2-extension. For build-only confirmation during cleanup, I temporarily removed the generated watch targets, regenerated the Xcode project, and verifiedxcodebuild build -scheme OpenClaw -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO->BUILD SUCCEEDED; that temporary watch-target removal was reverted before this PR.Real behavior proof
Behavior addressed: unused iOS code was removed, and future PRs touching
apps/ios/**are gated against reintroducing Periphery-detected dead Swift code.Real environment tested: local macOS with Xcode 26.5, plus GitHub Actions macOS runner using the generated
apps/ios/OpenClaw.xcodeprojandapps/ios/.periphery.yml.Exact steps or command run after this patch: Periphery scan, workflow YAML parse, comment JavaScript parse, synthetic failing-report check, GitHub synthetic failure run, GitHub clean-head run after probe removal, autoreview, and the iOS logic test command above.
Evidence after fix: Periphery reports an empty JSON array for the cleaned iOS app scope; the clean-head GitHub Periphery check passes; the temporary proof probe made the GitHub check fail with a Periphery annotation and uploaded report artifact; active iOS logic tests pass.
Screenshot 1 shows the expected failing GitHub job from the temporary
PeripheryProofProbe: Periphery reported the unused Swift symbol, uploaded the dead-code artifact, and the finalFail on dead codestep failed the PR check.Screenshot 2 shows the PR comment path: the workflow surfaced the Periphery finding back on the PR so reviewers can see which Swift declaration is dead.
Observed result after fix: After removing
PeripheryProofProbe, the latest PR-headScan iOS dead codejob passed on GitHub at commit8b6bfc021578f500ef21c7d3036fef1ea0114653. The earlier proof run failed only after Periphery reported the intentionally unusedPeripheryProofProbesymbol and uploaded the dead-code report artifact.What was not tested: external-fork contributor PR behavior after these workflows land on
main.