T-1KOY-state-path-lint-guard
State: closed/done · Impact: medium · Complexity: small
Make a state path that bypasses fleet visible at lint time. An override only reaches paths that resolve through fleet, so every direct OS path call is a place a test can write to the real home.
| Location | Role today |
|---|---|
Cargo.toml (root) | No [workspace.lints] table. Only apps/ontological-legacy/src-tauri/Cargo.toml has a [lints.clippy] |
solutions/determined/crates/determined-platform/clippy.toml | The only clippy.toml: too-many-arguments-threshold = 8. Clippy reads the nearest file and does not merge, so a root file would not apply to this crate |
.oxlintrc.json | Has an overrides block using no-restricted-imports for solutions/ontological/lib/**. Nothing covers path helpers |
| Known hits | zoo calls dirs::home_dir() in spec/engine.rs, bin/zoo-cli.rs and commands/mappings.rs, for content-plane paths (expanding ~, browsing a host directory), not state. dir-aspect calls dirs::config_dir(). Raw var_os("HOME") reads in six crates are invisible to clippy. About 18 TS hits sit outside fleet and every app (see T-2THY) |
Proposed
Section titled “Proposed”A root clippy.toml lists disallowed-methods with a reason each:
tauri::path::PathResolver::{app_data_dir, app_config_dir, app_cache_dir, app_local_data_dir, app_log_dir}, dirs::{data_dir, config_dir, cache_dir, home_dir, state_dir, runtime_dir, data_local_dir}, std::env::home_dir. [workspace.lints.clippy] sets
disallowed_methods = "warn" and member crates inherit it. determined-platform/clippy.toml
repeats the list. oxlint no-restricted-imports bans @tauri-apps/api/path dir helpers and a
named homedir import, and no-restricted-properties bans os.homedir, outside
packages/ts/fleet. oxlint has no rule that matches process.env.HOME. Fleet’s own OS reads carry
#[expect(clippy::disallowed_methods, reason = "…")].
Approach
Section titled “Approach”- Add the root
clippy.tomland[workspace.lints.clippy]. Add[lints] workspace = trueto member crates that lack it. - Copy the list into
determined-platform/clippy.toml, with a comment on why. - Add
#[expect]at fleet’s and fleet-tauri’s OS reads. - Add the oxlint override, scoped to exclude
packages/ts/fleet/**. - Run clippy and oxlint and list remaining hits in the PR body. Content-plane uses, such as zoo’s
~expansion, get an#[expect]with a reason rather than a fleet call.
| Area | Note |
|---|---|
clippy.toml, Cargo.toml | New guard |
solutions/determined/crates/determined-platform/clippy.toml | Repeat the list |
packages/rust/fleet/, packages/rust/fleet-tauri/ | #[expect] opt-outs |
.oxlintrc.json | TS override |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: Adding
dirs::data_dir()to any workspace crate,determined-platformincluded, produces a clippy warning that names the reason. - AC-2: Adding
os.homedir()to a TS file outsidepackages/ts/fleetproduces an oxlint warning. - AC-3:
cargo clippy -D warningsin CI stays green: every existing hit is fixed or carries an#[expect]with a reason.
Out of scope
Section titled “Out of scope”- Flipping to deny (
T-2THY). - Shipping the config to
template-tauri-nuxt(T-GQ9Y).
Dependencies
Section titled “Dependencies”- none. S-0011-application-state-locations and S-0020-desktop-apps-tested-web-first-in-scratch-root land in the same PR as this task.
Discovery context
Section titled “Discovery context”- A
build.rsscan was rejected: lint config is the standard tool and runs in the existing clippy gate.