Hive
Code quality pass: streaming hashing, permit hygiene, eval state guard, CLI cleanup
GitHub issue · Closed
Source
tuist/once #12
Updated
Jun 24, 2026
Domains
Once
Summary
A principal-engineer-style code-quality pass over the four crates. Four focused commits, each with regression tests, none changing CLI surface.
refactor(cas): add a streamingDigest::of_readerso input hashing is bounded-memory regardless of file size, and clean up leakedscratch/stream-*files whenput_streamerrors mid-stream.fix(core):Runner::runwas acquiring theSemaphorepermit before checking the action cache, so concurrent cache hits queued behind real subprocess slots. Lookup is now outside the permit, with a re-check under the permit to keep parallel writers consistent.fix(frontend): the per-thread StarlarkSTATEwas set/cleared by hand, so a panic between install andtake()would leak the slot into the next call. Replaced with aStateGuardwhoseDropunconditionally clears.refactor(cli): centralize the.fabrikliteral behindCACHE_DIR, fold the eight-argexec()into anExecArgsstruct (drops thetoo_many_argumentsallow), splittool_envinto a pureselect_tool_env(vars)filter, and switchinput_digestto the new streaming hasher. Adds the previously-missing unit-test module forrun.rsinternals (env filtering,source_pathescapes,input_digeststability and content-sensitivity, action shape per target kind, unsupported-kind rejection).
Net test delta: +14 Rust tests (72 → 86). Shellspec is unchanged at 50 examples, all still passing.
Testing
mise exec -- cargo test --workspace --all-targets— 86 passedmise exec -- cargo clippy --workspace --all-targets -- -D warnings— cleanmise exec -- cargo fmt --all -- --check— cleanmise exec -- cargo build --release— succeedsmise exec -- shellspec— 50 examples, 0 failures
No GitHub comments yet.