Processes
- tracerook-hookRuns once per hook call: bounded stdin, normalization, emergency rules, a deadline-bound request to the service and host-format output.
- TraceRookAgentThe per-user LaunchAgent: local policy, pending reviews and deadlines, private SQLite history and the TraceRook Cloud client.
- TraceRook.appSwiftUI dashboard, menu bar companion and the review window.
- TraceRook CloudA Cloudflare Worker at api.tracerook.dev that authenticates devices, scans requests and runs Claude Haiku 5.5.
Swift modules
| Module | Responsibility |
|---|---|
| TraceRookContracts | Event envelopes, bounded JSON, IPC v2 framing, replies, budgets and typed errors |
| TraceRookPrivacy | Redaction, remote preflight and status-code logging |
| TraceRookAgentAdapters | Claude Code and Codex normalization, denial output and action fingerprints |
| TraceRookRules | Deterministic policy shared by the service and the hook bridge |
| TraceRookCore | Domain records, review transitions, analysis providers and Cloud DTOs |
| TraceRookFixtures | Sample data for demo mode |
Transports
- Hook socket: a private Unix socket (
0700directory,0600socket) with kernel peer credentials. It carries events and decisions only. - XPC: code-signing requirements on both sides. It carries status, Cloud controls and review resolutions.
- Cloud: HTTPS with an opaque bearer device token, strict JSON and a 32 KiB body limit.
Concurrency and state
Service state lives in Swift actors and UI state on the main actor, under Swift 6 strict concurrency. The service is the single writer of local history and uses transactional compare-and-swap updates for reviews. In TraceRook Cloud, a SQLite Durable Object serializes usage accounting and device-scoped idempotency, and D1 holds account and device digests.
Dependencies
The Mac app has no third-party runtime dependencies, no root daemon and no system extension, and needs no Full Disk Access, Accessibility or Screen Recording permission. The Cloud Worker has no runtime npm dependencies.