Fix audited persistence, filter lifecycle, and Safari compatibility issues - #780
Conversation
…explicit empty state
…variable handling
…verflowing rule output
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d5b54918f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 13851b3. Configure here.

Summary
Implements the 26 actionable findings from the audit of
35834142, plus the verified popup-owner and staged-marker races, in 18 incremental commits on top ofccb29f23.The coverage matrix, source-level explanations, dependency decisions, and remaining investigations are in docs/audit-reliability-2026-09.md.
Reliability fixes
Safari quota correction and OS compatibility
Current Safari's combined dynamic/session quota is 30,000, confirmed in WebKit's implementation. This PR preserves that capacity. It consults the runtime quota and uses a conservative fallback only for older runtimes that do not expose it. Native generation and runtime admission both retain exceptions before redirects; a late exception beyond the source-order cutoff must not disappear. If protections alone consume capacity, no stripping rules are admitted.
The separate Safari content-blocker limit remains 150,000 per extension. Overflow no longer silently publishes truncated target output.
macOS 12.3 and iOS/iPadOS 15.4 deployment targets and compatibility fallbacks are unchanged. The existing
XROS_DEPLOYMENT_TARGET = 2.0setting is unchanged, but the scheme offers no native visionOS destination in this environment; no successful visionOS build is claimed.Seven verified dependency/tool updates
Bundled compiler provenance, checksums, and licenses are retained and verified. Offline WebKit Worker isolation and the Safari 15 JavaScript output target remain intact. SafariConverterLib 4.3.0 and SwiftProtobuf 1.38.1 are unchanged. Swift Argument Parser remains 1.5.0 because SafariConverterLib pins it exactly; no incompatible lockfile-only upgrade is attempted.
Validation
Local validation on Xcode 26.6, using the existing signed wBlock DerivedData:
scripts/run-ci-tests.sh: passed.git diff --check: passed.GitHub check results below apply to the current pushed revision. Local logs remain under
/Users/skula/.cache/wblock-audit.YCnL7g/implementation/.Explicit remaining investigations
R01 (MAIN-world privileged GM authority) and R04 (XPC work lifetime after early reply/client disconnect) are not represented as fixed. R01 needs a compatible sandbox/settings-bridge redesign: blindly moving all privileged scripts out of the page would break Tube Cleaner's page hooks. R04 has not been reproduced as an actual service-termination defect, so no speculative ownership change was made.
No oldest-supported-OS runtime validation, live CloudKit account exchange, real Safari exploit demonstration, or battery benchmark is claimed. The original main worktree, existing user data, and sibling userscript repository were left untouched.
Note
High Risk
Wide changes to on-disk protobuf/backup state, Cloud sync, DNR rule installation, userscript privilege boundaries, and XPC filter-update lifetime—areas where regressions directly affect data integrity or extension security.
Overview
This PR lands the September 2026 reliability audit: durable protobuf migration/recovery, safer filter download/publication and pending-revision handling, backup restore with rollback, Cloud sync reconciliation fixes, and compile-time metadata refresh—backed by a large expansion of focused regression tests and a new audit write-up in
docs/audit-reliability-2026-09.md.Extension and service behavior routes No Autoplay and Zapper state/mutations through the background script instead of page-native calls. Removeparam DNR installation now validates chunked loads, respects runtime quota (30k with a legacy 5k fallback), prioritizes protective rules, downgrades or skips unrepresentable legacy conditions, and replaces rules in one atomic
updateDynamicRulescall. The filter-update XPC service holds work viaFilterUpdateWorkLifetimeand owner-token popup claims so early replies and disconnects cannot drop in-flight updates.Userscript security and matching shifts privileged GM networking/storage to the isolated world (page wrappers no longer carry bridge tokens), tightens Tube Cleaner’s bounded page preference channel, and broadens metadata/matching tests (fragments, regex includes, authoritative refresh equality). CI pins
actions/checkoutandactions/cache, adds a dedicated iOS 26+ simulator job for rules-viewer UI gestures, and skips that suite from the default shell-test glob unlessWBLOCK_UI_TEST_SIMULATORis set. Tooling bumps include esbuild 0.28.2 and Dart Sass 1.104.0 bundle paths in test scripts.Reviewed by Cursor Bugbot for commit 0cd7543. Bugbot is set up for automated code reviews on this repo. Configure here.