Expand description
Git revision materialization (decided.services.revisions) — the only
git-consuming module of the watchkeeper path (ADR-043). A revision name
becomes a temporary directory holding the corpus subpath at that
revision, via git archive --format=tar (never mutates .git: no
worktree registration, no locks) piped through a minimal in-process tar
reader (no tar binary, no new dependencies).
Contract mirrored from the oracle:
git rev-parse --show-toplevel(cwd = the corpus directory) finds the work-tree root; failure ->not a git repository: <directory>; a missing git binary ->git executable not found(both exit 2 at the CLI asdecided: <msg>).git rev-parse --verify --quiet <rev>^{commit}(cwd = repo root); nonzero ->unknown revision: <rev>.git archive --format=tar <rev> -- <pathspec>(cwd = repo root); a NONZERO exit is not an error — the subpath does not exist at that revision and an EMPTY corpus is materialized (the fresh-adoption “everything added” comparison).- The temporary directory is prefixed
decided-watchkeeper-and removed when the materialization guard drops. Its path never appears in any output surface (all reported paths are corpus-relative).
Structs§
- Materialized
Revision - One materialized revision: the guard owns the temporary directory and
removes it (best effort) on drop, like the oracle’s
tempfile.TemporaryDirectorycontext.
Enums§
- Revision
Error - The two usage-error surfaces of revision resolution;
message()is the text after the CLI’sdecided:prefix.
Functions§
- materialize_
revision materialized_revision(repo_root, rev, subpath)— verify the commit, archive the subpath, extract into a temp tree, and yieldtmp/<subpath>(created empty when the archive had nothing to say).- repository_
root repository_root(directory)— the work-tree root containingdirectory.