feat: add native read-only macOS experience - #18
Merged
Conversation
Add apps/macos, a SwiftPM package that makes the complete local loop inspectable natively without JSON output or a raw SQLite browser. The app opens the database strictly read-only (SQLITE_OPEN_READONLY plus PRAGMA query_only = ON) and holds no SQL write path of its own. It resolves the same default database path as the CLI, validates the file is an Autophagy database, and tolerates older/newer schema versions by classifying the schema and checking table existence before every query. Views cover sessions and their event timelines (with exact event IDs), deterministic findings preserved inside registered candidates (with exact supporting and counterexample event IDs), the mutation candidate registry with lifecycle audit and read-only replay/shadow/installation records, and an honest privacy view. Deletion is delegated to the autophagy CLI behind multi-step confirmation: the exact command is shown and run via Process, or displayed when no CLI binary is found. Structured as a testable AutophagyKit library plus a thin SwiftUI executable. Builds, tests (swift-testing), and bundles under the Command Line Tools with no full Xcode. Adds a path-filtered macos-latest CI workflow, ADR 0005, a guide, and repository-map and roadmap updates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Run the destructive-action subprocess off the main actor via Task.detached and marshal state back to @mainactor, so the spinner renders and a slow/hung CLI cannot freeze the UI. Mark CLICommand, DestructiveAction, and RunResult Sendable for the crossing. - Add schema-tolerance tests with a v2-era foundation-only database (missing later mutation/conflict/signature tables) and a mutation_candidates table missing a selected column, asserting the reader degrades to empty instead of throwing. - Make Database.execute() private so the no-write-path guarantee is enforced at the API surface, not only by connection flags; the read-only test now exercises the public query() path. - Note in DatabaseReader.count() that table names are hardcoded constants (with a fixed-allow-list guard if that ever changes). - Align ADR 0005 wording with swift-tools-version:6.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
karngyan
added a commit
that referenced
this pull request
Jul 16, 2026
Prepare the repository for its first release without performing one. No tag, published version, or version bump is created here. - Add a Keep-a-Changelog `CHANGELOG.md` with a single `[Unreleased]` section summarizing pull requests #1–#18 grouped by Added/Changed and by milestone. - Add `.github/workflows/release.yml`, triggered only on `v*` tag pushes (plus a build-only `workflow_dispatch`). It builds the `autophagy` CLI for macOS (arm64) and Linux (x86_64) via the mise-pinned toolchain, builds the macOS app bundle with `swift build -c release` through `make-app-bundle.sh`, uploads everything as workflow artifacts, and creates a DRAFT GitHub release for a human to publish. All actions are SHA-pinned. It stays dormant until tagged. - Update the README Status section to reflect the completed alpha (retrieval, synthesis boundary, macOS read-only app) and add an "Install / Build from source" section (mise + cargo + swift). - Add a release-readiness closing note to the alpha roadmap. Version audit: all 14 workspace crates use `version.workspace = true`, resolving to `0.1.0-alpha.1` in the root `Cargo.toml`. Left unchanged. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claim
Alpha PR 5 — the complete local loop (sessions, deterministic findings, mutation candidates, and their lifecycle audit) is now inspectable in a native macOS app without JSON output or a raw SQLite browser, and the app never writes the database.
apps/macosis a SwiftPM package (no Xcode required): a testableAutophagyKitlibrary plus a thin SwiftUI executable. It builds and tests under the Command Line Tools withswift build/swift test, and a small script wraps the binary into a launchable.app.What it does
SQLITE_OPEN_READONLYand setsPRAGMA query_only = ON; the app has no SQL write path.~/Library/Application Support/sh.autophagy.Autophagy/autophagy.db), lets the user pick another.db, validates it is an Autophagy database, and remembers the choice inUserDefaultsonly.user_version+schema_migrations, and checks table existence before each query so an off-version database degrades to empty views and a clear message instead of crashing.autophagyCLI behind multi-step confirmation (including thedelete-allphrase mirroring the CLI guard). The exact command is shown and run viaProcess, or displayed when no binary is found.Evidence
swift test— 23 tests pass (swift-testing) covering:swift build— exit 0 for both the library and the SwiftUI target.mise run check— exit 0 (Rust untouched; docs/actionlint/fmt/lint/test stay green, including the new guide and workflow).evals/fixtures/**with the existing CLI into a demo database, then droveAutophagyKitagainst it: it reports schema v6 supported, 15 sessions, working event timelines, 3 findings, and 3 mutations. The SwiftUI executable launches and runs its event loop; the.appbundle produced byscripts/make-app-bundle.shvalidates withplutil.Privacy
The app is a read-only viewer: it opens a local database, sends nothing off the machine, adds no export path, and cannot mutate stored data. Deletion is delegated to the CLI, so the app never becomes an unaudited way to remove or leak evidence. Details in ADR
docs/decisions/0005-macos-read-only-app.md.Roadmap
Satisfies PR 5's exit criterion — "the complete local loop is inspectable without using JSON output or raw SQLite tools" — and marks that section complete.
🤖 Generated with Claude Code