Worktree: a checked-out tree with its state in one wtlog

A worktree is a checked-out tree on disk, with its per-call state in one append-only <wt>/.be/wtlog. The goal is cheap, disposable worktrees over one hard-to-break Store — a machine needs only one store per upstream repo, and every extra worktree is just a dir pointing back. The method: row 0 anchors the store, later get/post rows track the branch and tip, Sniff stamps each file it touches with the row's timestamp, and POST reads those stamps back to classify files at commit time.

The wtlog and the anchor

Per-wt state — base branch, base tip, and pending PATCH parents — lives in <wt>/.be/wtlog; the current branch is the latest get/post row's ?branch, never a fixed field, so switching just appends a row.

The --at coordinate

Every be invocation relays exactly one coordinate to each sub-dog on argv — --at <branch-uri>#<sha> — and the worker derives everything else itself, so the dogs share no out-of-band state.

File classification by stamps

Every sniff row stamps each file it touched with the row's ts via utimensat; at commit time POST reads each file's mtime, finds the owning row, and decides KEEP vs REWRITE in selective or implicit (commit-all) mode.

Eager branching replaces stash

Branches are mkdir-cheap, so the idiom is to fork preventively: mint a sub-branch before anything speculative, experiment freely, then bring the result home as one squash — there is never a reason to stash.