---
applyTo: "**/*.rs"
---
# Rust code
- Every module (`//!`), type, field, variant, function, constant and macro has a doc
comment, private and `pub(crate)` items included. Docs state intent, invariants, units and
error/panic conditions (`# Errors`, `# Panics`, `# Safety`). They do not restate the name.
- No `mod.rs`: modules with children are `foo.rs` plus `foo/`. Integration tests live under
`tests/it/`.
- No separator comments (`// -----`, `// =====`). If a file needs sections, split it into
submodules.
- Leave a blank line after the closing `}` of a block statement when another statement
follows, and between logical phases of a function. No lumped code.
- One level of abstraction per function. Long loops (simulations, game ticks, solvers) are
short drivers that call documented step functions. If a block needs a "what" comment,
extract it into a function named after that comment.
- `clippy::pedantic` clean. Suppression only with a scoped
`#[expect(lint, reason = "...")]`. Never `#[allow]`, and never crate-level suppression.
- No `unsafe` unless the crate opts out of `#![forbid(unsafe_code)]` with a documented
reason. Each unsafe block has one operation and a `// SAFETY:` comment.
- Search code keeps `WidthProblem` independent of PDDL and SAS+. SAS+-specific code lives in
`src/sas.rs` behind the `sas-plus` feature.
- Changes to `NoveltyTable` must keep `tests/it/novelty_properties.rs` (oracle) and the
`novelty` fuzz target passing; changes to IW or BFWS must keep plans valid
(`tests/it/search_properties.rs`).