Expand description
The plumbing a view reaches the core’s reads through, re-exported so a
view depends on this crate and forge-primitives and no further.
The chain under these is longer than the one above them: the workspace
re-exports the agent’s git plumbing and wire parsers wholesale, so
git_diff::current_branch and translate::state_parsing are agent
code reached through two wildcard facades. The view names this crate,
which is the discipline that matters here; it is not a claim that the
code beneath is the workspace’s own.
Modules§
- content
- Bounded content read beside the stats scan: what a seat’s changed files say, as raw unified-diff hunks.
- file
- One file’s whole content at a revision, as its lines.
- hunks
- Per-file hunk scanner for the
/diffoverlay. - resolver
- Re-anchoring resolver for durable review threads.
Structs§
- Base
Measurement - One completed base refresh: when it measured, what it found, and git’s own words when it could not run.
- Base
Refresh - What one base refresh answered.
Enums§
- Numstat
Error - Underlying
git diff --numstatsubprocess didn’t return a usable result. Callers map this toLayerState::ScanFailedso the renderer can surface the failure. The variants carry enough classification to triage from the log emitted byrun_git; downstream callers don’t differentiate them today but the type keeps the option open.
Constants§
- SCAN_
WORST_ CASE - One scan’s worst case for the shape
SCAN_CHILDRENcounts, 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.
Functions§
- changed_
file_ count - How many files
cwd’s worktree has changed against HEAD: tracked modifications plus untracked files, one--porcelainline each.Errcarries 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. - clear_
git_ point_ for_ tests - Drop
cwd’s pointer, back to the machine’sgit. - current_
branch - Run the full scan sequence against
cwdand return a snapshot. Always succeeds - every failure path collapses to a non-InReporepo_gateand a log line naming the step that failed. Callers should treat the snapshot as authoritative for rendering regardless of which variant came back. - last_
base_ measurement - This checkout’s last completed refresh of
default_branch.Noneuntil one has completed; a reader appliesmeasurement_in_windowitself, since the store only prunes on write. - point_
git_ at_ for_ tests - Point
cwd’sgitspawns atprogram: thetestingfeature’s seam, so a crate whose fixtures need a held child drives the same wrapper this crate’s own tests do. Pair withclear_git_point_for_tests. - pr_
refresh_ due - Whether a scan’s PR block is past its refetch window, so a scan that may reach the network would look it up again.
- refresh_
base_ for_ display - Answer the base a drawn branch diff is measured against, and keep it fresh off the read.
- refresh_
base_ now - Answer the base by running the refresh on this call: the one path that waits, for a seat with no session.
- scan
enviscwd’s project’s own declared environment, carried as the identity of everyghcall the scan makes, so the PR row reads as the project rather than as the server’s ambient login.- scan_
pinned - 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_
serving_ cached_ pr scanfor 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 withscanand pushes the refreshed row.- scan_
without_ base_ fetch scanfor 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.