git-strata
Per-session workspaces over shared base snapshots, for macOS (APFS, FSEvents,
launchd). Every coding session (human or agent) gets its own APFS clone of
each repo plus its dependency set. Edits are recorded as checkpoints,
committed by publish, and sent to the remote only by git-strata push or a
publish whose repo is configured to push.
This README is written so an agent can run git-strata without asking a human.
Everything here describes the current code. When in doubt, the binary's
git-strata <command> --help is the authority (-h is the one-line summary).
Design documents (Chinese) are in docs/; the agent skill is
skills/git-strata/SKILL.md (install it for your
agents with npx skills add, see Agent skill).
git-strata ... and git strata ... are the same binary.
Contents
Install and daemon
Requirements: macOS 13 or later (Apple silicon or Intel), the repos and the
data root on one APFS volume. macOS only: git-strata uses APFS clones,
FSEvents and launchd.
Homebrew
Updating the app
These desktop instructions apply to GIT STRATA 0.3.0 and later in
/Applications. The status bar shows the app and running daemon versions.
To use in-app updates, first move your existing daemon
or set it up from the app.
Choose Check for updates… from the menu bar or the ⌘K command menu.
Check for updates automatically is on by default in Settings. Choose
Update to … to review and install a newer stable release. The app waits
for daemon work to finish before replacing the bundle. New writes may get
Busy with reason draining while the app waits. Busy with reason
daemon_down is expected during the restart. Agents should report the
interruption and let the app finish. Retry any unrecorded checkpoints once
git-strata daemon status reports data.running: true.
Use the in-app updater after the move. If Homebrew replaces the app, follow
the app's Restart daemon prompt and review any store schema warning. A
daemon crash before that restart can cause launchd to start the new bundled
binary before you confirm the change. If the app fails to open after an
interruption, see macOS troubleshooting for 0.3.0 and later.
Move the daemon into the app
If your desktop install uses the Homebrew formula's daemon, keep agents
idle while you switch. Before upgrading the cask to 0.3.0, run
brew tab --installed-on-request dickwu/tap/git-strata to keep Homebrew from
autoremoving the formula. Use the named cask upgrade
brew upgrade --cask dickwu/tap/git-strata-desktop and verify both packages'
versions before restarting the formula's daemon. Follow the
0.3.0 transition steps.
In the Daemon panel, choose Move the daemon into the app. Once the app
confirms the bundled daemon is running, remove the unused formula with
brew uninstall dickwu/tap/git-strata. Leave the daemon running and keep
~/Library/LaunchAgents/com.gwd.git-stratad.plist. Immediately choose
Install command-line tool so hooks and agents can find git-strata again.
Set up daemon
For a fresh desktop installation on Apple silicon, run
brew install --cask dickwu/tap/git-strata-desktop and open GIT STRATA from
/Applications. If macOS blocks the first open, see
macOS troubleshooting for 0.3.0 and later.
In the Daemon panel, choose Set up daemon. Select your data root and
repository folders on the same APFS volume to create a configuration. If you
already have a configuration, the app keeps it and asks for confirmation
before starting with the retained store. The app validates the configuration
before starting the daemon.
macOS troubleshooting for 0.3.0 and later
If macOS blocks the first open, choose Open Anyway in System Settings →
Privacy & Security. If that option is unavailable on a fresh cask install,
see the first-open instructions in brew info --cask dickwu/tap/git-strata-desktop.
If the app still won't open, quit it if it's running, move these folders to
the Trash if present, then reopen the app.
~/Library/Caches/io.github.dickwu.git-strata/
~/Library/Saved Application State/io.github.dickwu.git-strata.savedState/
Keep ~/Library/Application Support/io.github.dickwu.git-strata/. It holds
update.json, the rollback archive under previous/ and the saved
LaunchAgent plist under legacy/. Reopen the installed app after an
interruption so it can reconcile its update or move records.
Command-line tool
Choose Install command-line tool in the app to put git-strata and
git-stratad on PATH. It links both names to the bundle in /opt/homebrew/bin.
On a Mac without /opt/homebrew, it uses /usr/local/bin and asks for
administrator permission. The app uses vacant paths or dangling symlinks and
leaves existing formula links alone. A subsequent formula install can fail to
link while the app's links are present. In-app updates keep the bundle at the
same path, so the links follow the new version.
Uninstall the desktop app
If the LaunchAgent runs the bundled daemon, quit GIT STRATA and run
git-strata daemon stop. If the command-line tool is off PATH, run
"/Applications/GIT STRATA.app/Contents/MacOS/git-strata" daemon stop instead.
If the stop times out, leave the files in place and wait for daemon work to
finish. Resolve any other stop error before continuing. Check the job with
launchctl print gui/$(id -u)/com.gwd.git-stratad. If the job is still loaded
after a timeout, retry the stop and check again. Continue only if print
explicitly reports that the service could not be found in this domain (exit 113).
Remove ~/Library/LaunchAgents/com.gwd.git-stratad.plist and the git-strata
and git-stratad symlinks in /opt/homebrew/bin or /usr/local/bin that point
into this app. Then run brew uninstall --cask dickwu/tap/git-strata-desktop
or move the app to the Trash. Keep the config, store and sessions.
With the 0.3.0 desktop cask, brew uninstall --zap keeps the app's Application
Support folder and its recovery records.
CLI-only or headless installation
Install the formula with brew install dickwu/tap/git-strata. Run
brew info dickwu/tap/git-strata and follow its caveats to set up, upgrade
or uninstall the daemon. The setup commands create only missing files, so
you can keep your existing LaunchAgent plist and configuration on reinstall.
Formula-backed desktop releases through 0.2.x
The legacy setup below is for a fresh 0.2.x installation with no existing
LaunchAgent plist or config. For current installations and reinstalls, use
the formula caveats.
brew install dickwu/tap/git-strata # CLI + daemon (prebuilt, Apple silicon)
# the LaunchAgent is a human step (see below); write it once, pointing at the
# stable opt path so upgrades need no plist edit:
mkdir -p ~/Library/LaunchAgents
t=$(mktemp ~/Library/LaunchAgents/.git-stratad.XXXXXX) \
&& git-stratad --print-plist "$(brew --prefix)/opt/git-strata/bin/git-stratad" > "$t" \
&& mv "$t" ~/Library/LaunchAgents/com.gwd.git-stratad.plist
mkdir -p ~/Library/Application\ Support/git-strata
cp "$(brew --prefix)/share/git-strata/config.toml" \
~/Library/Application\ Support/git-strata/config.toml # then edit
git-strata daemon start
Set [paths] root in config.toml to a directory on the same APFS volume as
your repos (the default ~/.strata only works when they live on the startup
volume). After brew upgrade git-strata, restart the existing agent with
launchctl kickstart -k gui/$(id -u)/com.gwd.git-stratad, check
git-strata daemon status, then run npx skills update git-strata -g. macOS
may ask again for the daemon's access to a removable volume after an upgrade
(see docs/release.md). To uninstall, run
git-strata daemon stop; only after it succeeds, remove
~/Library/LaunchAgents/com.gwd.git-stratad.plist, then brew uninstall git-strata
(otherwise launchd keeps restarting a missing binary). If stop fails or times
out, do not continue.
Use the single agent com.gwd.git-stratad above, not brew services: a
second (homebrew.mxcl.*) agent would run a second daemon on the same socket
and lock, and neither the CLI nor the GUI manages it.
Desktop releases through 0.2.x use the formula's daemon. If macOS blocks the
first open on those releases, see Legacy macOS installation and reset.
For release builds, signing modes and tap updates, see docs/release.md.
git-stratad --version prints the version. git-stratad --print-plist [BIN]
renders the LaunchAgent for this HOME, using the running binary when BIN is
omitted. git-stratad --check-config PATH validates the config, its canonical
paths and volume compatibility without opening a store or socket.
A sample config is examples/config.toml (the formula
installs it as $(brew --prefix)/share/git-strata/config.toml);
the reference is docs/config.md.
The daemon
Two binaries: git-strata (the CLI) and git-stratad (the per-user daemon).
Write commands go through the daemon over a unix socket.
The daemon runs as the LaunchAgent com.gwd.git-stratad, from
~/Library/LaunchAgents/com.gwd.git-stratad.plist. The CLI never writes this
plist; installing it is a human step. Its content (from
strata_daemon::plist::plist_text):
Label com.gwd.git-stratad; ProgramArguments the absolute path of git-stratad
RunAtLoad true, KeepAlive with SuccessfulExit false, LimitLoadToSessionType Aqua, ProcessType Interactive, ExitTimeOut 900 (a stop waits for in-flight writes)
EnvironmentVariables.PATH ~/.bun/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
StandardErrorPath ~/Library/Application Support/git-strata/daemon.err.log
| Command |
What it does |
Result |
git-strata daemon status |
Asks the socket; never fails for a down daemon or missing config |
{running, socket, session?, holders:[], unknown_publishes:[], alerts:[], config?:{generation,hash,loaded_at,last_attempt,restart_required}, version?, pid?, started?, activity?, busy?, volume?, scan?, draining?, inflight?, store_schema?} |
git-strata daemon start |
Bootstraps an unloaded agent or kickstarts a loaded, stopped agent |
{} on start, {already:true} if running. InvalidInput no_plist if the plist is missing. A disabled agent returns Unsupported (agent_disabled). Open GIT STRATA to finish an app update if one is in progress. See foreign_home / foreign_agent below. |
git-strata daemon stop |
launchctl bootout, then waits up to 10 s for launchd to confirm the label is absent |
{} after unload or {already:true} if absent. Unknown launchctl at step: print for a failed initial probe or step: bootout_wait on timeout. See foreign_home / foreign_agent below. |
draining, inflight and store_schema are optional status fields from
daemons with daemon.drain