Skip to content

T-7VPK-the-rust-aspect-collapses-its-per-crate-overrides

State: closed/done · Impact: medium · Complexity: medium

.moon/tasks/rust.yml supplies fmt, fmt-check, lint and test for every language: 'rust' moon project, but all 55 Rust moon.yml files override at least one of them — the aspect’s cargo … --workspace resolves to the entire monorepo cargo workspace from a root-workspace member, so every crate pins itself to -p <crate> instead. What the aspect delivers today is the task names, not the commands. moon task <target> resolving $project to the moon project id (T-VAF5’s spike) lets most of those per-crate overrides collapse into the shared aspect, leaving only the handful of projects where the crate name genuinely does not match the project id.

LocationRole today
.moon/tasks/rust.ymlThe aspect. fmt/fmt-check run cargo fmt --all[--check], lint runs cargo clippy --workspace --all-targets -- -D warnings, test runs cargo test --workspace. All four resolve to the entire root cargo workspace from any member, so every inheriting project overrides.
solutions/determined/crates/*/moon.yml21 crates, each overriding fmt/fmt-check/lint/test to -p <crate> with options: { merge: 'replace' }. Cargo package name equals the moon project id in every case.
solutions/determined/crates/determined-agent/moon.ymllint passes --all-features, test does not — an unexplained asymmetry within the crate’s own override (moon task determined-agent:test --json confirms --all-features is absent today).
solutions/determined/crates/determined-engine-client/moon.ymllint/test deliberately omit --all-features: the crate’s engine-port feature raises compile_error! by design (D-0006), so building with all features guarantees a failing gate. Documented in-file.
solutions/determined/crates/determined-models/moon.ymllint/test deliberately omit --all-features: the onnx feature links a native runtime fetched from a CDN at build time. Documented in-file.
packages/rust/*/moon.yml, solutions/agent-pants/crates/*/moon.yml, solutions/ontological/crates/*/moon.yml, apps/pumice/crates/{pumice-desktop,pumice-config}/moon.yml21 more crates, same -p <crate> / merge: 'replace' shape, cargo name equal to project id.
packages/rust/slug/moon.ymlOverrides all four to --manifest-path Cargo.toml instead of -p slug: crates.io also publishes a slug, resolved in this workspace at 0.1.6 through tera (apps/pumice/crates/pumice), so -p slug is ambiguous. Documented in-file.
apps/pumice/crates/pumice/moon.ymlOverrides all four to -p pumice: the moon project id is pumice-core (renamed to dodge a collision with the apps/pumice app project), so $project would not match the crate name. Documented in-file.
tools/cage/moon.ymlOverrides all four to -p cage-core -p cage-cli with options: { mergeArgs: 'replace' } — a different merge key than the merge: 'replace' the other 47 use. Two crates share one moon project; no single $project value names both.
apps/legacy-polish/moon.ymlOverrides fmt/fmt-check to -p vaultpolish-core -p vaultpolish-agent -p vaultpolish-search -p vaultpolish-tauri with merge: 'replace'; fmt-check uses the -- --check dialect. lint/test are NOT overridden — they inherit the aspect’s --workspace default, which is correct here only because apps/legacy-polish/Cargo.toml is its own self-contained workspace, isolated from the root one.
apps/ontological-legacy/moon.ymlOverrides only fmt-check, as an inline script: block (build-then-check self-heal) using -p ontological -p agent-mcp-config -p mcp_proxy -- --check. Declares neither merge: 'replace' nor mergeArgs: 'replace' — the one project in the survey using neither override mechanic. fmt/lint/test are uncovered by any override, correct for the same isolated-workspace reason as apps/legacy-polish.
solutions/augmented/apps/augmented-books/moon.yml, solutions/augmented/apps/vimit/moon.yml, solutions/ontological/desktop/moon.yml, apps/agentpants/moon.yml, apps/pumice/moon.yml, apps/zoo/moon.yml6 Tauri apps: fmt-check/lint/test shell to bash scripts/backend-* (or .scripts/backend-*), which run cargo with --manifest-path src-tauri/Cargo.toml — the project root itself carries no Cargo.toml (Rust lives under src-tauri/). All 7 backend-format-check scripts use the -- --check dialect.

.moon/tasks/rust.yml’s fmt, fmt-check, lint and test use -p $project (moon substitutes the resolved project id into command:) in place of --all/--workspace. A new lint-fix task runs cargo clippy -p $project --fix --allow-dirty --all-targets --all-features. lint and test both carry --all-features by default, matching the majority pattern already in use. Task names are unchanged.

The ~42 crates whose moon project id equals their cargo package name (the solutions/determined/crates, packages/rust, solutions/agent-pants/crates, solutions/ontological/crates and apps/pumice/crates/{pumice-desktop,pumice-config} groups, minus determined-engine-client and determined-models) drop their fmt/fmt-check/lint/test override blocks entirely — the aspect now covers them. determined-agent’s test-task --all-features gap disappears the same way: once its override is gone, the aspect’s uniform default covers both lint and test.

Exactly five kinds of location keep an explicit override, each retaining (or gaining, where missing) an in-file comment explaining why, and all normalized to one override mechanic (options: { merge: 'replace' }) and one fmt-check flag dialect (--check, no leading --):

  1. packages/rust/slug/moon.yml — --manifest-path Cargo.toml, crates.io ambiguity.
  2. apps/pumice/crates/pumice/moon.yml — -p pumice, project id pumice-core has no alias.
  3. tools/cage/moon.yml — -p cage-core -p cage-cli, two crates under one moon project; mechanic normalized from mergeArgs: 'replace' to merge: 'replace'.
  4. apps/legacy-polish/moon.yml — -p vaultpolish-core -p vaultpolish-agent -p vaultpolish-search -p vaultpolish-tauri on fmt/fmt-check only; dialect normalized from -- --check to --check.
  5. determined-engine-client/moon.yml and determined-models/moon.yml — lint/test keep their existing -p <crate> form without --all-features, each with its documented reason preserved.

apps/ontological-legacy/moon.yml’s fmt-check override gains options: { merge: 'replace' } (currently declares neither mechanic — the “neither” case the survey found) and its dialect normalizes to --check; its fmt/lint/test stay uncovered by any override, unchanged, since they are correct today for the same isolated-cargo-workspace reason as apps/legacy-polish.

The 6 Tauri apps whose Rust lives under src-tauri/ (augmented-books, vimit, solutions/ontological/desktop, agentpants, pumice, zoo) are untouched — their fmt-check/lint/test already route through bash scripts/backend-*, outside this aspect, and stay that way.

  1. Update .moon/tasks/rust.yml: change fmt/fmt-check/lint/test from --all/--workspace to -p $project; add --all-features to lint and test; add the new lint-fix task; normalize the fmt-check dialect to plain --check.
  2. Verify substitution on a sample project with no local override (moon task determined-authoring:fmt --json) before touching any per-crate file — confirms the aspect change alone is correct.
  3. For each of the ~42 non-exception crates, delete the now-redundant fmt/fmt-check/lint/test keys from its tasks: block (drop the whole block where nothing else remains in it).
  4. Update the 5 exception locations: normalize tools/cage from mergeArgs: 'replace' to merge: 'replace'; normalize apps/legacy-polish’s fmt-check dialect from -- --check to --check; confirm packages/rust/slug and apps/pumice/crates/pumice need no command change, only re-verification against the new aspect defaults.
  5. Update apps/ontological-legacy/moon.yml: add merge: 'replace' to its fmt-check override, normalize its dialect to --check.
  6. Add a lint-fix override to every location that already overrides lint (the 5 exceptions plus apps/ontological-legacy, which has no lint override and so needs none), mirroring that location’s -p/ --manifest-path scoping with --fix --allow-dirty in place of -D warnings.
  7. Run moon task <target> --json across one project per group (a collapsed crate, cage, slug, pumice, determined-engine-client, ontological-legacy) to confirm each resolved command matches the Proposed section.
  8. Run moon run :fmt-check :lint :test (or a representative --affected slice) to confirm the gates still pass with the new commands.
LocationKindChange
.moon/tasks/rust.ymlmodifyfmt/fmt-check/lint/test switch to -p $project; lint/test gain --all-features; add lint-fix; dialect normalized to --check.
solutions/determined/crates/*/moon.ymlmodifyRemove the now-redundant fmt/fmt-check/lint/test override keys from the ~19 crates whose id matches the cargo package name (all except determined-engine-client and determined-models).
packages/rust/*/moon.ymlmodifyRemove the now-redundant override keys from every crate except packages/rust/slug.
solutions/agent-pants/crates/*/moon.ymlmodifyRemove the now-redundant override keys.
solutions/ontological/crates/*/moon.ymlmodifyRemove the now-redundant override keys.
apps/pumice/crates/pumice-desktop/moon.ymlmodifyRemove the now-redundant override keys.
apps/pumice/crates/pumice-config/moon.ymlmodifyRemove the now-redundant override keys.
solutions/determined/crates/determined-agent/moon.ymlmodifyRemove the override block; the aspect default now covers lint and test symmetrically, closing the --all-features gap on test.
solutions/determined/crates/determined-engine-client/moon.ymlmodifyKeep the lint/test override (no --all-features), normalize to merge: 'replace' (already used), add lint-fix without --all-features; drop fmt/fmt-check (aspect now covers them).
solutions/determined/crates/determined-models/moon.ymlmodifySame shape as determined-engine-client.
packages/rust/slug/moon.ymlmodifyAdd a lint-fix override using --manifest-path Cargo.toml --fix --allow-dirty; confirm fmt/fmt-check/lint/test need no command change.
apps/pumice/crates/pumice/moon.ymlmodifyAdd a lint-fix override using -p pumice --fix --allow-dirty.
tools/cage/moon.ymlmodifyNormalize mergeArgs: 'replace' to merge: 'replace' on all four tasks; add lint-fix.
apps/legacy-polish/moon.ymlmodifyNormalize fmt-check’s -- --check to --check; add a lint-fix override (no existing lint override to mirror, since lint inherits --workspace correctly here — add lint-fix scoped the same way).
apps/ontological-legacy/moon.ymlmodifyAdd options: { merge: 'replace' } to the fmt-check override; normalize its dialect from -- --check to --check.

Tauri-app files (solutions/augmented/apps/augmented-books/moon.yml, solutions/augmented/apps/vimit/moon.yml, solutions/ontological/desktop/moon.yml, apps/agentpants/moon.yml, apps/pumice/moon.yml, apps/zoo/moon.yml, and their scripts/backend-* / .scripts/backend-* scripts) are not touched — see Out of scope.

  • AC-1: moon task determined-authoring:fmt --json (a crate with no remaining local override) resolves args to ["fmt", "-p", "determined-authoring"] — the shared aspect alone delegates correctly.
  • AC-2: moon task determined-agent:test --json resolves args to include --all-features — the drift found live today (cargo test -p determined-agent, no --all-features) is closed.
  • AC-3: grep -rlE "^\s*(fmt|fmt-check|lint|test):" --include=moon.yml solutions/determined/crates packages/rust solutions/agent-pants/crates solutions/ontological/crates apps/pumice/crates/pumice-desktop apps/pumice/crates/pumice-config returns only determined-engine-client/moon.yml and determined-models/moon.yml (each with lint/test only, not fmt/fmt-check).
  • AC-4: moon task cage:lint-fix --json resolves args to ["clippy", "-p", "cage-core", "-p", "cage-cli", "--fix", "--allow-dirty", "--all-targets", "--all-features"] — lint-fix exists and is scoped like lint.
  • AC-5: grep -c "mergeArgs" tools/cage/moon.yml apps/legacy-polish/moon.yml returns 0 for both — the mergeArgs: 'replace' mechanic is gone from the two files that used it.
  • AC-6: grep -c -- "-- --check" apps/legacy-polish/moon.yml apps/ontological-legacy/moon.yml returns 0 for both — the -- --check dialect is normalized to --check in every moon.yml this task touches.
  • AC-7: grep -n "merge:" apps/ontological-legacy/moon.yml matches — the “neither” override (previously declaring no merge mechanic at all) now declares one.
  • AC-8: moon run :fmt-check :lint :test --affected (or a full moon run :fmt-check :lint :test if nothing is locally affected) exits 0 across the Rust projects touched by this task.
  • Tauri apps whose Rust lives under src-tauri/ (augmented-books, vimit, solutions/ontological/desktop, agentpants, pumice, zoo): their gates already route through bash scripts/backend-*, not this aspect, and stay untouched. Normalizing those scripts’ -- --check dialect, or giving them a lint-fix, is a Tauri-aspect concern, not this task’s.
  • apps/legacy-polish/moon.yml’s lint/test tasks: they already inherit --workspace correctly (an isolated cargo workspace), so nothing to collapse there beyond the lint-fix addition.
  • Rewriting .moon/tasks/tauri.yml or any layer: tool/layer: application aspect other than .moon/tasks/rust.yml.
  • The TypeScript side of the vocabulary (T-076A, T-0DSA) and the conformance guard (task 11 in the M-3MGB plan).
  • Depends on T-VAF5-a-standard-for-the-baseline-task-vocabulary: its $project/$projectAlias substitution spike (57 Rust moon projects, 47 with id == alias == cargo package name, 1 with no alias (apps/pumice/crates/pumice), 9 with no Cargo.toml at their moon-project root (the Tauri apps)) is the evidence this collapse is safe, and its S-0013 standard is what this task implements against.
  • The M-3MGB plan’s task 7 row names the drift this task fixes: three override mechanics in use (merge: 'replace' ×47, mergeArgs: 'replace' ×7, neither ×1), two fmt-check flag dialects, and --all-features missing from determined-{agent,engine-client,models}. Verifying against the live repo confirmed the mechanic and dialect counts, and refined the --all-features finding: determined-agent’s omission is unexplained drift (its lint has the flag, its test does not), while determined-engine-client and determined-models omit it deliberately, each with an in-file comment — those two need a preserved override, not a fix, once the aspect’s own default gains --all-features.

T-VAF5-a-standard-for-the-baseline-task-vocabulary


← Back to Tasks