Skip to content

docs: promote the README layout and site discoverability to main - #63

Merged
scttbnsn merged 4 commits into
mainfrom
dev/m2
Nov 2, 2026
Merged

scttbnsn merged 4 commits into
mainfrom
dev/m2

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

  • New Features
    • Added a permission status and setup flow for closed-lid mode, including clear feedback when administrator access is unavailable or permission needs attention.
    • Closed-lid mode now retries permission-related failures with increasing delays, capped at 30 seconds.
    • Added a branded social sharing image and improved website metadata and discoverability.
  • Documentation
    • Reorganized the README with installation guidance, feature and privacy summaries, roadmap, support links, and links to detailed documentation.

…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
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6b129b8f-69f1-4602-9773-30274f39e885
Commits

Reviewing files that changed from the base of the PR and between 3ffa6a4 and 3344736.

Files selected for processing: 22
  • .github/workflows/ci.yml
  • Package.swift
  • Sources/DilatedCLI/DilatedCommand.swift
  • Sources/DilatedControl/LocalSocket.swift
  • Sources/DilatedControl/Protocol.swift
  • Sources/DilatedCore/ClosedLidPermission.swift
  • Sources/DilatedCore/ClosedLidSession.swift
  • Sources/DilatedCore/ClosedLidWatchdog.swift
  • Sources/DilatedUI/AppModel.swift
  • Sources/DilatedUI/Automation/AutomationService.swift
  • Sources/DilatedUI/ClosedLid/ClosedLidController.swift
  • Sources/DilatedUI/ClosedLid/ClosedLidPermissionModel.swift
  • Sources/DilatedUI/ClosedLid/ClosedLidSettings.swift
  • Sources/DilatedUI/ClosedLid/ClosedLidWatchdogSpawner.swift
  • Sources/DilatedUI/ClosedLid/LocalClosedLidTransport.swift
  • Tests/DilatedControlTests/ControlTests.swift
  • Tests/DilatedCoreTests/ClosedLidPermissionTests.swift
  • Tests/DilatedCoreTests/ClosedLidSessionTests.swift
  • Tests/DilatedCoreTests/ClosedLidWatchdogTests.swift
  • Tests/DilatedUITests/ClosedLidPermissionUITests.swift
  • Tests/DilatedUITests/ClosedLidWatchdogSpawnerTests.swift
  • Tests/DilatedUITests/LocalClosedLidTransportTests.swift
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a2e56751-c354-4be8-8112-152553ca6780
Commits

Reviewing files that changed from the base of the PR and between 75f52de and 3ffa6a4.

Files ignored due to path filters: 5
  • website/dist/assets/social-card.png is excluded by !**/dist/**, !**/*.png
  • website/dist/index.html is excluded by !**/dist/**
  • website/dist/llms.txt is excluded by !**/dist/**
  • website/dist/robots.txt is excluded by !**/dist/**
  • website/dist/sitemap.xml is excluded by !**/dist/**
Files selected for processing: 12
  • README.md
  • Sources/DilatedCore/ClosedLidPermission.swift
  • Sources/DilatedCore/ClosedLidService.swift
  • Sources/DilatedUI/ClosedLid/LocalClosedLidTransport.swift
  • Tests/DilatedCoreTests/ClosedLidPermissionTests.swift
  • Tests/DilatedUITests/LocalClosedLidTransportTests.swift
  • website/e2e/serve.mjs
  • website/e2e/site.spec.mjs
  • website/social/card.html
  • website/social/render-card.mjs
  • website/tests/discoverability.test.mjs
  • website/vercel.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

This PR adds closed-lid permission management and permission retry backoff. It reorganizes the README into a product landing page and adds website discoverability resources, content-type handling, and tests.

Changes: Closed-Lid Permission and Retry

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
Loading

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately describes the README and website discoverability changes. It omits the closed-lid permission work, but the title does not need to cover every change.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full 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.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread website/social/render-card.mjs Resolved
…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 biggest-littlest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@scttbnsn
scttbnsn merged commit 41a95cb into main Nov 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants