Underlying git diff --numstat subprocess didn’t return a usable
result. Callers map this to LayerState::ScanFailed so the
renderer can surface the failure. The variants carry enough
classification to triage from the log emitted by run_git;
downstream callers don’t differentiate them today but the type
keeps the option open.
One scan’s worst case for the shape SCAN_CHILDREN counts, which is what a
test waiting on a scan derives its own bound from. Test-only: production
reads the per-child budget, never the count.
How many files cwd’s worktree has changed against HEAD: tracked
modifications plus untracked files, one --porcelain line each. Err
carries the repo gate, so a caller can tell “not a repo” from a git
that would not run rather than reading either as a clean tree.
Run the full scan sequence against cwd and return a snapshot.
Always succeeds - every failure path collapses to a non-InRepo
repo_gate and a log line naming the step that failed. Callers
should treat the snapshot as authoritative for rendering
regardless of which variant came back.
This checkout’s last completed refresh of default_branch. None until
one has completed; a reader applies measurement_in_window itself, since
the store only prunes on write.
Point cwd’s git spawns at program: the testing feature’s seam, so a
crate whose fixtures need a held child drives the same wrapper this crate’s
own tests do. Pair with clear_git_point_for_tests.
env is cwd’s project’s own declared environment, carried as the
identity of every gh call the scan makes, so the PR row reads as
the project rather than as the server’s ambient login.
A read pinned to one base revision: the branch-ahead layer is computed
against base (a sha a refresh just resolved) rather than against the
ref’s name, so this read and a content read taken beside it describe one
commit even if the ref moves between them. Never fetches and never looks
the PR up: the caller has already refreshed the base and is drawing it.
scan for a read a client is waiting on: a PR cache past its window is
served for the branch and sha it belongs to rather than looked up, so the
read never waits on the network; a cache from another branch or push
answers nothing. The seat’s own loop scans with scan and pushes the
refreshed row.
scan for a read that will fetch the base itself a moment later: the
same local scan with none of the background kick, so one read of a
sessionless seat pays one fetch - its own - and never queues that fetch
behind forge’s on the shared per-repository gate.