Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b62d3c7
Add recurring scheduled blocks via launchd user agents
max4c Mar 16, 2026
77f0934
Scaffold Swift rewrite: 3-target Xcode project via XcodeGen
max4c Mar 16, 2026
6767727
Implement block enforcement, XPC layer, schedule manager, and full CLI
max4c Mar 16, 2026
7e90ba5
Add complete app UI: main window, timer, domain list, schedules, prefs
max4c Mar 16, 2026
cf2b6be
Update progress file with rewrite status
max4c Mar 16, 2026
726a9c5
Fix app launch crash: remove NSMainNibFile, add programmatic menu bar
max4c Mar 16, 2026
4f66bc4
Fix 11 bugs from code review: XPC auth, race conditions, security
max4c Mar 16, 2026
6fd9a6c
Fix main window not appearing: makeKeyAndOrderFront + activate
max4c Mar 16, 2026
6023cdd
Fix window not appearing on launch
max4c Mar 16, 2026
524865f
Fix window not appearing: set activation policy to .regular
max4c Mar 16, 2026
2f998d6
Replace AppKit window management with SwiftUI WindowGroup
max4c Mar 16, 2026
381f5ae
Wire up blocklist editor and schedule manager as SwiftUI sheets
max4c Mar 16, 2026
e43d927
Polish UI: centered hero layout, refined typography, intentional spacing
max4c Mar 16, 2026
37aaa31
Wire Start Block button to AppController.startBlock()
max4c Mar 16, 2026
fbf611d
Configure code signing with Team ID H9N9P29TX5
max4c Mar 17, 2026
0c9eb86
Add DEBUG mode that simulates block without privileged daemon
max4c Mar 17, 2026
0ac8b9f
Fix debug mode: writable SCSettings, SwiftUI timer view, no duplicate…
max4c Mar 17, 2026
c1be58b
Fix SMJobBless: embed Info.plist and launchd.plist in daemon binary
max4c Mar 17, 2026
780a71a
Remove debug bypass: use real daemon path for block enforcement
max4c Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .go/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Go Run — 2026-03-16

## Summary
Clean Swift rewrite of SelfControl → Stone. **31 Swift files, ~3,650 lines.** All three targets compile with zero errors and zero warnings.

Branch: `swift-rewrite` (3 commits ahead of master)

## What was built

### Project Infrastructure
- XcodeGen-based project with 3 targets: Stone (app), stonectld (daemon), stone-cli (CLI)
- Deployment target macOS 12.0, Swift 5.9
- Info.plists with SMJobBless/SMAuthorizedClients for privileged helper
- ObjC bridging header for audit token access (1 .m file)

### Common Layer (shared across all targets)
- `SCError` — error enum with localized descriptions
- `StoneConstants` — bundle IDs, sentinel strings, default preferences
- `BlockEntry` — hostname/IP parser with pf rule and hosts line generation
- `SCSchedule` — Codable recurring schedule model
- `SCDaemonProtocol` — @objc XPC protocol
- `SCSettings` — cross-process settings store (root-owned binary plist)
- `SCBlockUtilities` — block state checks
- `SCBlockFileReaderWriter` — .stone blocklist file I/O
- `SCFileWatcher` — FSEvents wrapper
- `SCMiscUtilities` — serial number, SHA1, utilities

### Block Enforcement
- `PacketFilter` — pf rules via pfctl, anchor management, token persistence
- `HostFileBlocker` — /etc/hosts editing with sentinel markers
- `HostFileBlockerSet` — multi-hosts-file coordinator
- `BlockManager` — orchestrates PF + hosts, DNS resolution, subdomain expansion

### XPC Communication
- `SCXPCAuthorization` — AuthorizationServices wrapper
- `SCXPCClient` — SMJobBless + NSXPCConnection lifecycle

### Daemon
- `SCDaemon` — XPC listener, 1s checkup timer, 2min inactivity exit
- `SCDaemonXPC` — protocol implementation with auth validation
- `SCDaemonBlockMethods` — block start/checkup/integrity/update logic
- `SCHelperToolUtilities` — settings ↔ enforcement bridge

### Schedule Manager
- `SCScheduleManager` — Codable CRUD with UserDefaults, launchd sync
- `LaunchAgentWriter` — plist generation, launchctl operations

### CLI
- Full argument parsing: --blocklist, --enddate, --duration, --settings, --uid
- Legacy positional arg fallback, UserDefaults fallback
- XPC-based block start

### App UI (all programmatic, no xibs)
- `AppController` — block start/stop flow, window lifecycle, notification observation
- `MainWindowController` — duration slider, start button, blocklist toggle
- `TimerWindowController` — countdown, add-to-block, extend time, dock badge
- `DomainListWindowController` — editable table, add/remove, quick-add
- `ScheduleListWindowController` — 5-column table, add/edit/remove with sheet
- `PreferencesWindowController` — General + Advanced tabs

## What's NOT done yet
- No app icon / assets
- No localization (English only)
- Code signing not configured (needs your Apple Developer Team ID)
- No Sentry integration
- No "move to Applications" prompt
- No migration from SelfControl settings
- No unit tests
- UI is functional but not polished (no custom styling)

## To test

```bash
cd /Users/maxforsey/Code/selfcontrol
git checkout swift-rewrite
open Stone.xcodeproj
# Set signing team in Xcode, then Build & Run
```
Loading