Expand description
Isolation and checkpoints.
speccoder works in a git worktree on speccoder/<feature> under its own
state directory, so the user’s checkout is never touched. A checkpoint is a
git tree object of the whole working tree (tracked and untracked, not
ignored), written through a temporary index: HEAD, the index and refs never
move. Restoring a checkpoint rewrites only the paths that differ.
Structs§
- Artifacts
- Spec Kit paths a worktree must contain.
- Change
- One changed path (repository-relative).
- Checkpoint
- A snapshot of a working tree: a git tree object id.
- Leftovers
- What checks leave behind in
dirthat git does not know: build output.gitignoredoes not list (target/,node_modules/, caches), and lockfiles never committed. No one’s edits — the setup’s gaps. - Refusal
- Why speccoder will not work in a worktree here.
- Scratch
- A detached worktree of a checkout’s
HEADfor one check (the review’s red check): never the person’s checkout, never the feature’s worktree. Removed when dropped — on every way out. - Worktree
- A worktree speccoder works in.
Enums§
- Change
Kind - What happened to a path between two checkpoints.
Constants§
- LOCKFILES
- Lockfiles a toolchain writes when the repository has none committed.
- SETUP
- What the checks run with besides the spec: a change in the checkout reaches the feature’s branch before a run.
Functions§
- build_
output - The build output a check’s toolchain writes into the tree it runs in.
- checkpoint
- Snapshots the working tree of
dir.tmpholds the temporary index (inside speccoder’s state directory). - diff
- Paths that differ from
fromtoto. - ensure_
lane - A fresh lane worktree for
laneoffeature, started atstart(the feature branch’s tip). A lane left behind is replaced: lanes are speccoder’s scratch space; their work reaches the feature branch only by merging. - ensure_
worktree - Creates or reuses the worktree for
feature. - files
- Every file path in a checkpoint.
- keep_
ticks theirswith every checkboxoursticked ticked too, where the line’s words are the same.- lane_
branch - The branch of a lane: one task of
featurerun in parallel. - leftovers
Leftoversindir.- only_
ticked - Whether
oursisbasewith boxes ticked and nothing else changed. - patch
- The textual diff between two checkpoints, without context lines.
- project_
state_ dir - A project’s directory under the state dir: per git repository when the project is in one (shared by its worktrees), else per canonical path.
- remove_
lane - Removes
lane’s worktree and branch, if there are any. - repo_
state_ dir - A repository’s directory under the state dir, keyed by its canonical common git directory (shared by all of its worktrees).
- require_
clean - Refuses when the working tree has any uncommitted change (for in-place mode).
- restore
- Makes the working tree of
direqual totarget: differing paths are rewritten from the checkpoint, paths the checkpoint lacks are removed. HEAD, the index and refs are not touched. Returns what changed. - scratch
- A scratch worktree of
checkout’sHEADunderunder. - state_
dir - speccoder’s state directory:
$SPECCODER_STATE_DIR, else$XDG_STATE_HOME/speccoder, else~/.local/state/speccoder. - worktree_
for - The worktree checked out on
branch, if any.