Skip to content

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.

LocationRole 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.tomlThe 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.jsonHas an overrides block using no-restricted-imports for solutions/ontological/lib/**. Nothing covers path helpers
Known hitszoo 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)

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 = "…")].

  1. Add the root clippy.toml and [workspace.lints.clippy]. Add [lints] workspace = true to member crates that lack it.
  2. Copy the list into determined-platform/clippy.toml, with a comment on why.
  3. Add #[expect] at fleet’s and fleet-tauri’s OS reads.
  4. Add the oxlint override, scoped to exclude packages/ts/fleet/**.
  5. 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.
AreaNote
clippy.toml, Cargo.tomlNew guard
solutions/determined/crates/determined-platform/clippy.tomlRepeat the list
packages/rust/fleet/, packages/rust/fleet-tauri/#[expect] opt-outs
.oxlintrc.jsonTS override
  • AC-1: Adding dirs::data_dir() to any workspace crate, determined-platform included, produces a clippy warning that names the reason.
  • AC-2: Adding os.homedir() to a TS file outside packages/ts/fleet produces an oxlint warning.
  • AC-3: cargo clippy -D warnings in CI stays green: every existing hit is fixed or carries an #[expect] with a reason.
  • Flipping to deny (T-2THY).
  • Shipping the config to template-tauri-nuxt (T-GQ9Y).
  • A build.rs scan was rejected: lint config is the standard tool and runs in the existing clippy gate.

← Back to Tasks