Repository navigation
Conversation
…ck off permission retries (#58) ClosedLidPermission owns the fixed /private/etc/sudoers.d/dilated rule, detects notInstalled, needsRepair, blocked, ready and notAdmin, and installs or removes it through an injected admin-prompt runner. The local transport tick loop now backs off from 1s to 30s while sudo refuses, still failed and still retrying.
* docs(readme): align with the CodesWhat product README shape * docs(readme): drop the empty screenshots section and tighten the intro
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
|
| Layer / File(s) | Summary |
|---|---|
Permission state and privileged operations Sources/DilatedCore/ClosedLidPermission.swift, Tests/DilatedCoreTests/ClosedLidPermissionTests.swift |
Adds permission-state checks and privileged install and removal operations for the sudoers rule. Tests cover state detection, script contents, and operation outcomes. |
Permission failure state Sources/DilatedCore/ClosedLidService.swift |
ClosedLidService records permission-related reset failures and exposes isRetryingForPermission. |
Transport retry backoff Sources/DilatedUI/ClosedLid/LocalClosedLidTransport.swift, Tests/DilatedUITests/LocalClosedLidTransportTests.swift |
The transport increases retry delays after permission failures, up to 30 seconds, and resets the backoff when permission retrying stops. Tests check the delay sequence and reset behavior. |
README Reorganization
| Layer / File(s) | Summary |
|---|---|
Product overview and project guidance README.md |
Reorganizes the README with product and installation information, feature and privacy summaries, development guidance, support links, ecosystem details, and license information. |
Website Discoverability
| Layer / File(s) | Summary |
|---|---|
Discoverability resources and validation website/social/*, website/e2e/serve.mjs, website/e2e/site.spec.mjs, website/tests/discoverability.test.mjs, website/vercel.json |
Adds a social card and renderer, sets content types for discoverability routes, and tests website metadata, resource contents, and served responses. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant LocalClosedLidTransport
participant TickLoop
participant ClosedLidService
participant RetryBackoff
TickLoop->>ClosedLidService: perform periodic reset
ClosedLidService-->>TickLoop: report permission retry state
TickLoop->>RetryBackoff: request next delay after permission failure
RetryBackoff-->>TickLoop: return capped delay
TickLoop->>TickLoop: sleep for selected delay
Possibly related PRs
- CodesWhat/dilated#57: Adds the permission error and local transport that this PR extends with permission-state reporting and retry backoff.
Suggested reviewers: biggest-littlest
Merge Risk: 
Low · previous review 3ffa6
-
Document the Chromium installation step so contributors can render the social card on a fresh machine. This does not block merging.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 10 functions across 9 files. (3 skipped: 3 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…udo rule (#60) * feat(closed-lid): revert sleep after a crash with a session marker and watchdog On the local sudo path, write closed-lid-session.json before disabling sleep and clear it only after a confirmed revert. A relaunch reverts a marker whose app is gone or whose pid was reused, and leaves sleep alone when there is no marker. A detached dilated closed-lid-watchdog process waits for the app to exit via kqueue and restores sleep. * fix(closed-lid): lock the revert, drop the watchdog lifetime cap and back off failed reverts The watchdog now waits as long as the marker is ours, so an AC session isn't stranded after a day. App and watchdog serialize on an flock next to the marker, and the watchdog re-checks the generation under it before reverting. Failed reverts retry from 5s doubling to 5 minutes. A failed enable drops the marker and session, and a start time that can't be read refuses to start. * feat(closed-lid): add permission settings group and lid-permission CLI behind the flag With DilatedLocalClosedLidTransport on, Settings shows a PERMISSION group with set up, repair and remove actions, recovery states and a password-backed restore. dilated lid-permission status|install|remove goes through the control socket, and helper commands map to it with a deprecation note. Flag off keeps the HELPER group. * fix(closed-lid): run the admin prompt off the main actor, recognize other apps' sudo rules, stop replaced watchdogs * fix(closed-lid): install rule 0440 and verify only our own sudoers file * fix(closed-lid): drop the task group from the watchdog and keep test children short and quiet CI aborted with 'freed pointer was not the last allocation' in the watchdog's task group, and the orphaned sleep 300 test children held the log pipe open for five minutes. The watchdog now races two plain tasks over a stream, and test children run 20 seconds at most with no inherited output. * ci: upload macOS crash reports when verify fails * fix(closed-lid): avoid try? await in the watchdog poll loop The CI crash report put the swift_task_dealloc abort on the poll task's `(try? await sleep(...)) != nil` line under the macOS 26 runtime. * fix(closed-lid): wait on dispatch sources instead of child tasks in the watchdog
biggest-littlest
left a comment
There was a problem hiding this comment.
Reviewed. CI is green on 3344736. CodeRabbit's first pass left one minor doc note, tracked as a follow-up, and its second pass was rate limited.
Promotes the README rework (#61) and the site's structured data, crawl files and social card (#62), so the site can be redeployed from main.
Also brings over the second closed-lid sudo-rule step (#58). It's behind the default-off flag, so the app is unchanged, and no app release is cut from this.
Summary by CodeRabbit