Reference Beta 0.1.0-beta.1

Architecture

Three native processes, one hosted service, and the transports between them.

Processes

  1. tracerook-hookRuns once per hook call: bounded stdin, normalization, emergency rules, a deadline-bound request to the service and host-format output.
  2. TraceRookAgentThe per-user LaunchAgent: local policy, pending reviews and deadlines, private SQLite history and the TraceRook Cloud client.
  3. TraceRook.appSwiftUI dashboard, menu bar companion and the review window.
  4. TraceRook CloudA Cloudflare Worker at api.tracerook.dev that authenticates devices, scans requests and runs Claude Haiku 5.5.

Swift modules

ModuleResponsibility
TraceRookContractsEvent envelopes, bounded JSON, IPC v2 framing, replies, budgets and typed errors
TraceRookPrivacyRedaction, remote preflight and status-code logging
TraceRookAgentAdaptersClaude Code and Codex normalization, denial output and action fingerprints
TraceRookRulesDeterministic policy shared by the service and the hook bridge
TraceRookCoreDomain records, review transitions, analysis providers and Cloud DTOs
TraceRookFixturesSample data for demo mode

Transports

  • Hook socket: a private Unix socket (0700 directory, 0600 socket) 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.