Once Rust Review
This skill is intentionally narrow. Generic Rust style, formatting,
naming, and most lint hygiene are already covered by rustfmt and
clippy in CI, so do not flag those. Focus on the repo-specific
rules below.
For each finding, cite path:line and quote the relevant snippet.
1. Build graph work follows the RFC and keeps scripts first-class
Once starts with cacheable and remotely executable scripts plus the runtime
API, and is expanding toward typed build graph capabilities. Scripts remain the
migration ramp into the graph. Build graph work should follow
rfcs/0001-build-graph.md, keep the agent-facing graph model typed,
queryable, and structurally editable, and preserve the existing script
workflow.
Flag
- Build graph CLI, rule, or query surfaces that are not tied to the RFC
model, lack a clear migration path from scripts, or make scripts
second-class. Severity: high.
- Docs or CLI help that position Once as Buck-compatible, Bazel-compatible,
or as a drop-in replacement for Buck, Bazel, or Cargo. Severity:
medium.
- Manifest parsing that accepts non-script target rules without a
clear migration path and tests. Severity: high.
- Build graph changes that bypass Once's action cache, CAS, remote execution,
or runtime API instead of using them as the execution substrate.
Severity: medium.
Do not flag
- Script or runtime features that make individual commands cacheable,
observable, or remotely executable.
- Build graph commands, providers, capabilities, queries, Starlark rule
metadata, or Apple target modeling that align with
rfcs/0001-build-graph.md
and include focused Rust tests or ShellSpec coverage.
2. Project manifests live in once.toml
Per-project configuration is once.toml. Runtime cache state and output
directories are not source-controlled manifest locations.
Flag
- A new checked-in manifest under runtime cache or output directories,
or code that treats generated cache contents as source manifests.
Severity: high.
- Docs or tests that instruct contributors to edit cache directories
as canonical project config. Severity: medium.
- A change that reintroduces
fabrik.toml as a supported project
manifest. Severity: high.
Do not flag
- Tests that intentionally assert cache and output directories are
skipped during workspace discovery.
3. Toolchain pinning and command invocation must stay aligned
The repo deliberately pins Rust in both mise.toml and the workspace
Cargo.toml, and contributor-facing commands should use mise exec --.
Flag
- A diff that changes
mise.toml rust = "..."
without the matching workspace rust-version change in Cargo.toml,
or vice versa. Severity: medium.
- A toolchain bump without matching spec updates or without any
explanation in the diff. Severity: medium.
- Contributor docs, scripts, or tests that invoke
cargo directly for
this repo instead of mise exec -- cargo .... Severity: medium.
Do not flag
- Internal implementation code that shells out to Cargo as product
behavior rather than contributor workflow documentation.
4. CLI contract changes need ShellSpec coverage
spec/*.sh is the end-to-end contract for the CLI.
Flag
- A change under
crates/once-cli/src/ that alters user-visible
command behavior, help text, stdout/stderr, exit status, or declared
cache/runtime behavior without matching ShellSpec coverage.
Severity: medium.
- A new CLI subcommand or error message path without an end-to-end spec
exercising it. Severity: medium.
Do not flag
- Pure refactors that do not change observable CLI behavior.
5. Runtime and cache behavior changes need focused tests nearby
Most semantic behavior in this repo is verifiable with in-process Rust
tests next to the module that changed.
Flag
- A semantic change in
crates/once-core, once-frontend,
once-cli, or once-cas without focused unit tests near the changed
code or a strong end-to-end spec covering the same behavior.
Severity: medium.
- Changes to digest stability, manifest parsing, cache keys, runtime
descriptors, remote execution selection, or toolchain resolution that
land without tests. Severity: medium.
Do not flag
- Test-only refactors or comment-only changes.
6. Keep lib.rs and main.rs as dispatch tables
This repo prefers crate roots that read like a table of contents:
mod declarations, re-exports, and light dispatch, not mixed
implementation.
Flag
- A new or heavily expanded
lib.rs / main.rs that mixes unrelated
logic or grows into a monolith instead of splitting modules.
Severity: low.
Do not flag
- Small crate roots that remain mostly declarations and re-exports.
7. No em dashes in user-facing text
README copy, CLI help, error messages, commit text, and docs should not
use em dashes in this repo.
Flag
- New user-facing strings or documentation that introduce an em dash
character. Severity: low.
Out of scope
- Generic naming, formatting, or lint nits already enforced by
rustfmt/clippy
- Suggestions to add comments where the code is already clear
- Suggestions to move tests away from the module they exercise
1---2name: once-rust-review3description: Project-specific PR-review rules for the tuist/once Rust workspace. Focuses on script caching, build graph work, runtime execution, `once.toml` placement, toolchain pinning, shellspec coverage, and crate structure.4---56# Once Rust Review78This skill is intentionally narrow. **Generic Rust style, formatting,9naming, and most lint hygiene are already covered by `rustfmt` and10`clippy` in CI, so do not flag those.** Focus on the repo-specific11rules below.1213For each finding, cite `path:line` and quote the relevant snippet.1415---1617## 1. Build graph work follows the RFC and keeps scripts first-class1819Once starts with cacheable and remotely executable scripts plus the runtime20API, and is expanding toward typed build graph capabilities. Scripts remain the21migration ramp into the graph. Build graph work should follow22`rfcs/0001-build-graph.md`, keep the agent-facing graph model typed,23queryable, and structurally editable, and preserve the existing script24workflow.2526### Flag2728- **Build graph CLI, rule, or query surfaces that are not tied to the RFC29 model, lack a clear migration path from scripts, or make scripts30 second-class.** **Severity: high.**31- **Docs or CLI help that position Once as Buck-compatible, Bazel-compatible,32 or as a drop-in replacement for Buck, Bazel, or Cargo.** **Severity:33 medium.**34- **Manifest parsing that accepts non-script target rules without a35 clear migration path and tests.** **Severity: high.**36- **Build graph changes that bypass Once's action cache, CAS, remote execution,37 or runtime API instead of using them as the execution substrate.**38 **Severity: medium.**3940### Do not flag4142- Script or runtime features that make individual commands cacheable,43 observable, or remotely executable.44- Build graph commands, providers, capabilities, queries, Starlark rule45 metadata, or Apple target modeling that align with `rfcs/0001-build-graph.md`46 and include focused Rust tests or ShellSpec coverage.4748---4950## 2. Project manifests live in `once.toml`5152Per-project configuration is `once.toml`. Runtime cache state and output53directories are not source-controlled manifest locations.5455### Flag5657- **A new checked-in manifest under runtime cache or output directories,58 or code that treats generated cache contents as source manifests.**59 **Severity: high.**60- **Docs or tests that instruct contributors to edit cache directories61 as canonical project config.** **Severity: medium.**62- **A change that reintroduces `fabrik.toml` as a supported project63 manifest.** **Severity: high.**6465### Do not flag6667- Tests that intentionally assert cache and output directories are68 skipped during workspace discovery.6970---7172## 3. Toolchain pinning and command invocation must stay aligned7374The repo deliberately pins Rust in both `mise.toml` and the workspace75`Cargo.toml`, and contributor-facing commands should use `mise exec --`.7677### Flag7879- **A diff that changes `mise.toml` `rust = "..."`80 without the matching workspace `rust-version` change in `Cargo.toml`,81 or vice versa.** **Severity: medium.**82- **A toolchain bump without matching spec updates or without any83 explanation in the diff.** **Severity: medium.**84- **Contributor docs, scripts, or tests that invoke `cargo` directly for85 this repo instead of `mise exec -- cargo ...`.** **Severity: medium.**8687### Do not flag8889- Internal implementation code that shells out to Cargo as product90 behavior rather than contributor workflow documentation.9192---9394## 4. CLI contract changes need ShellSpec coverage9596`spec/*.sh` is the end-to-end contract for the CLI.9798### Flag99100- **A change under `crates/once-cli/src/` that alters user-visible101 command behavior, help text, stdout/stderr, exit status, or declared102 cache/runtime behavior without matching ShellSpec coverage.**103 **Severity: medium.**104- **A new CLI subcommand or error message path without an end-to-end spec105 exercising it.** **Severity: medium.**106107### Do not flag108109- Pure refactors that do not change observable CLI behavior.110111---112113## 5. Runtime and cache behavior changes need focused tests nearby114115Most semantic behavior in this repo is verifiable with in-process Rust116tests next to the module that changed.117118### Flag119120- **A semantic change in `crates/once-core`, `once-frontend`,121 `once-cli`, or `once-cas` without focused unit tests near the changed122 code or a strong end-to-end spec covering the same behavior.**123 **Severity: medium.**124- **Changes to digest stability, manifest parsing, cache keys, runtime125 descriptors, remote execution selection, or toolchain resolution that126 land without tests.** **Severity: medium.**127128### Do not flag129130- Test-only refactors or comment-only changes.131132---133134## 6. Keep `lib.rs` and `main.rs` as dispatch tables135136This repo prefers crate roots that read like a table of contents:137`mod` declarations, re-exports, and light dispatch, not mixed138implementation.139140### Flag141142- **A new or heavily expanded `lib.rs` / `main.rs` that mixes unrelated143 logic or grows into a monolith instead of splitting modules.**144 **Severity: low.**145146### Do not flag147148- Small crate roots that remain mostly declarations and re-exports.149150---151152## 7. No em dashes in user-facing text153154README copy, CLI help, error messages, commit text, and docs should not155use em dashes in this repo.156157### Flag158159- **New user-facing strings or documentation that introduce an em dash160 character.** **Severity: low.**161162---163164## Out of scope165166- Generic naming, formatting, or lint nits already enforced by167 `rustfmt`/`clippy`168- Suggestions to add comments where the code is already clear169- Suggestions to move tests away from the module they exercise