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.
| Location | Role today |
|---|---|
.moon/tasks/rust.yml | The 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.yml | 21 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.yml | lint 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.yml | lint/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.yml | lint/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.yml | 21 more crates, same -p <crate> / merge: 'replace' shape, cargo name equal to project id. |
packages/rust/slug/moon.yml | Overrides 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.yml | Overrides 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.yml | Overrides 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.yml | Overrides 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.yml | Overrides 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.yml | 6 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. |
Proposed
Section titled “Proposed”.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 --):
packages/rust/slug/moon.yml—--manifest-path Cargo.toml, crates.io ambiguity.apps/pumice/crates/pumice/moon.yml—-p pumice, project idpumice-corehas no alias.tools/cage/moon.yml—-p cage-core -p cage-cli, two crates under one moon project; mechanic normalized frommergeArgs: 'replace'tomerge: 'replace'.apps/legacy-polish/moon.yml—-p vaultpolish-core -p vaultpolish-agent -p vaultpolish-search -p vaultpolish-taurionfmt/fmt-checkonly; dialect normalized from-- --checkto--check.determined-engine-client/moon.ymlanddetermined-models/moon.yml—lint/testkeep 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.
Approach
Section titled “Approach”- Update
.moon/tasks/rust.yml: changefmt/fmt-check/lint/testfrom--all/--workspaceto-p $project; add--all-featurestolintandtest; add the newlint-fixtask; normalize thefmt-checkdialect to plain--check. - 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. - For each of the ~42 non-exception crates, delete the now-redundant
fmt/fmt-check/lint/testkeys from itstasks:block (drop the whole block where nothing else remains in it). - Update the 5 exception locations: normalize
tools/cagefrommergeArgs: 'replace'tomerge: 'replace'; normalizeapps/legacy-polish’sfmt-checkdialect from-- --checkto--check; confirmpackages/rust/slugandapps/pumice/crates/pumiceneed no command change, only re-verification against the new aspect defaults. - Update
apps/ontological-legacy/moon.yml: addmerge: 'replace'to itsfmt-checkoverride, normalize its dialect to--check. - Add a
lint-fixoverride to every location that already overrideslint(the 5 exceptions plusapps/ontological-legacy, which has nolintoverride and so needs none), mirroring that location’s-p/--manifest-pathscoping with--fix --allow-dirtyin place of-D warnings. - Run
moon task <target> --jsonacross one project per group (a collapsed crate,cage,slug,pumice,determined-engine-client,ontological-legacy) to confirm each resolved command matches the Proposed section. - Run
moon run :fmt-check :lint :test(or a representative--affectedslice) to confirm the gates still pass with the new commands.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
.moon/tasks/rust.yml | modify | fmt/fmt-check/lint/test switch to -p $project; lint/test gain --all-features; add lint-fix; dialect normalized to --check. |
solutions/determined/crates/*/moon.yml | modify | Remove 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.yml | modify | Remove the now-redundant override keys from every crate except packages/rust/slug. |
solutions/agent-pants/crates/*/moon.yml | modify | Remove the now-redundant override keys. |
solutions/ontological/crates/*/moon.yml | modify | Remove the now-redundant override keys. |
apps/pumice/crates/pumice-desktop/moon.yml | modify | Remove the now-redundant override keys. |
apps/pumice/crates/pumice-config/moon.yml | modify | Remove the now-redundant override keys. |
solutions/determined/crates/determined-agent/moon.yml | modify | Remove 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.yml | modify | Keep 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.yml | modify | Same shape as determined-engine-client. |
packages/rust/slug/moon.yml | modify | Add 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.yml | modify | Add a lint-fix override using -p pumice --fix --allow-dirty. |
tools/cage/moon.yml | modify | Normalize mergeArgs: 'replace' to merge: 'replace' on all four tasks; add lint-fix. |
apps/legacy-polish/moon.yml | modify | Normalize 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.yml | modify | Add 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.
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
moon task determined-authoring:fmt --json(a crate with no remaining local override) resolvesargsto["fmt", "-p", "determined-authoring"]— the shared aspect alone delegates correctly. - AC-2:
moon task determined-agent:test --jsonresolvesargsto 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-configreturns onlydetermined-engine-client/moon.ymlanddetermined-models/moon.yml(each withlint/testonly, notfmt/fmt-check). - AC-4:
moon task cage:lint-fix --jsonresolvesargsto["clippy", "-p", "cage-core", "-p", "cage-cli", "--fix", "--allow-dirty", "--all-targets", "--all-features"]—lint-fixexists and is scoped likelint. - AC-5:
grep -c "mergeArgs" tools/cage/moon.yml apps/legacy-polish/moon.ymlreturns 0 for both — themergeArgs: '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.ymlreturns 0 for both — the-- --checkdialect is normalized to--checkin everymoon.ymlthis task touches. - AC-7:
grep -n "merge:" apps/ontological-legacy/moon.ymlmatches — the “neither” override (previously declaring no merge mechanic at all) now declares one. - AC-8:
moon run :fmt-check :lint :test --affected(or a fullmoon run :fmt-check :lint :testif nothing is locally affected) exits 0 across the Rust projects touched by this task.
Out of scope
Section titled “Out of scope”- Tauri apps whose Rust lives under
src-tauri/(augmented-books,vimit,solutions/ontological/desktop,agentpants,pumice,zoo): their gates already route throughbash scripts/backend-*, not this aspect, and stay untouched. Normalizing those scripts’-- --checkdialect, or giving them alint-fix, is a Tauri-aspect concern, not this task’s. apps/legacy-polish/moon.yml’slint/testtasks: they already inherit--workspacecorrectly (an isolated cargo workspace), so nothing to collapse there beyond thelint-fixaddition.- Rewriting
.moon/tasks/tauri.ymlor anylayer: tool/layer: applicationaspect 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).
Dependencies
Section titled “Dependencies”- Depends on T-VAF5-a-standard-for-the-baseline-task-vocabulary: its
$project/$projectAliassubstitution spike (57 Rust moon projects, 47 withid == alias == cargo package name, 1 with no alias (apps/pumice/crates/pumice), 9 with noCargo.tomlat their moon-project root (the Tauri apps)) is the evidence this collapse is safe, and itsS-0013standard is what this task implements against.
Discovery context
Section titled “Discovery context”- 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), twofmt-checkflag dialects, and--all-featuresmissing fromdetermined-{agent,engine-client,models}. Verifying against the live repo confirmed the mechanic and dialect counts, and refined the--all-featuresfinding:determined-agent’s omission is unexplained drift (itslinthas the flag, itstestdoes not), whiledetermined-engine-clientanddetermined-modelsomit 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.
Depends on
Section titled “Depends on”T-VAF5-a-standard-for-the-baseline-task-vocabulary