Three small cleanups grouped into one ticket. Each is independent; can be split into separate PRs if convenient.
1. vcad-kernel-stocksim is built but unused
crates/vcad-kernel-stocksim/src/{lib,collision,marching_cubes,octree,subtract}.rs exists and CLAUDE.md (line ~150) explicitly notes it as "WIP, no consumers yet." A repo-wide grep for vcad_kernel_stocksim outside its own files returns zero hits. It's pulling its weight in compile time and member-list noise.
Action: either wire it into the CAM crate (it was presumably built for stock simulation during CNC toolpath planning) or move it to a archive/ directory until there's a consumer. Don't ship dead crates indefinitely.
2. vcad-kernel-dfm::geom::face_midpoint_and_normal duplicates raytrace helpers
crates/vcad-kernel-dfm/src/geom/mod.rs::face_midpoint_and_normal reimplements logic that already exists in vcad-kernel-raytrace::trim::{face_normal, point_in_face}. The DFM version was written before the raytrace feature was wired in (the v1 code had a non-raytrace fallback as the only path).
Action: With the raytrace feature on (default), call vcad_kernel_raytrace::trim::face_normal directly. Keep a local fallback only behind cfg(not(feature = "raytrace")). Same applies anywhere else in geom/ that recomputed surface evaluation.
3. DFM rule-pack TOML has no schema validation
crates/vcad-kernel-dfm/src/rules/mod.rs::Rule uses #[serde(flatten)] params: HashMap<String, toml::Value> so unknown fields are silently absorbed. A user typing min_wall_mn = 1.0 (typo) instead of min_wall_mm = 1.0 gets the silent default of 0.8mm and no warning. Worse, the field name pull_dir only matters on mold.insufficient_draft — putting it on a different rule is a silent no-op.
Action: validate rule params per rule_id against an expected-keys list (a small Rule::expected_keys() -> &'static [&'static str] lookup), and emit a warning (or hard error in --strict mode) on unknown keys. Add a CLI subcommand vcad dfm validate <pack.toml> for shop authors to lint their forks before deployment.
Why now
These don't block anything, but they're the kind of things that quietly accumulate. The DFM polish is especially worth doing while the crate is fresh and small (~12 source files); it'll be much harder once external rule packs start getting forked.
References
crates/vcad-kernel-stocksim/ — orphan crate
CLAUDE.md ~line 150 — "WIP crates" note
crates/vcad-kernel-dfm/src/geom/mod.rs::face_midpoint_and_normal
crates/vcad-kernel-raytrace/src/trim.rs::face_normal
crates/vcad-kernel-dfm/src/rules/mod.rs::Rule (the serde(flatten) site)
lib/dfm/*.toml — the seven default packs that would benefit from validation
Three small cleanups grouped into one ticket. Each is independent; can be split into separate PRs if convenient.
1.
vcad-kernel-stocksimis built but unusedcrates/vcad-kernel-stocksim/src/{lib,collision,marching_cubes,octree,subtract}.rsexists and CLAUDE.md (line ~150) explicitly notes it as "WIP, no consumers yet." A repo-wide grep forvcad_kernel_stocksimoutside its own files returns zero hits. It's pulling its weight in compile time and member-list noise.Action: either wire it into the CAM crate (it was presumably built for stock simulation during CNC toolpath planning) or move it to a
archive/directory until there's a consumer. Don't ship dead crates indefinitely.2.
vcad-kernel-dfm::geom::face_midpoint_and_normalduplicates raytrace helperscrates/vcad-kernel-dfm/src/geom/mod.rs::face_midpoint_and_normalreimplements logic that already exists invcad-kernel-raytrace::trim::{face_normal, point_in_face}. The DFM version was written before the raytrace feature was wired in (the v1 code had a non-raytrace fallback as the only path).Action: With the
raytracefeature on (default), callvcad_kernel_raytrace::trim::face_normaldirectly. Keep a local fallback only behindcfg(not(feature = "raytrace")). Same applies anywhere else ingeom/that recomputed surface evaluation.3. DFM rule-pack TOML has no schema validation
crates/vcad-kernel-dfm/src/rules/mod.rs::Ruleuses#[serde(flatten)] params: HashMap<String, toml::Value>so unknown fields are silently absorbed. A user typingmin_wall_mn = 1.0(typo) instead ofmin_wall_mm = 1.0gets the silent default of 0.8mm and no warning. Worse, the field namepull_dironly matters onmold.insufficient_draft— putting it on a different rule is a silent no-op.Action: validate rule params per rule_id against an expected-keys list (a small
Rule::expected_keys() -> &'static [&'static str]lookup), and emit a warning (or hard error in--strictmode) on unknown keys. Add a CLI subcommandvcad dfm validate <pack.toml>for shop authors to lint their forks before deployment.Why now
These don't block anything, but they're the kind of things that quietly accumulate. The DFM polish is especially worth doing while the crate is fresh and small (~12 source files); it'll be much harder once external rule packs start getting forked.
References
crates/vcad-kernel-stocksim/— orphan crateCLAUDE.md~line 150 — "WIP crates" notecrates/vcad-kernel-dfm/src/geom/mod.rs::face_midpoint_and_normalcrates/vcad-kernel-raytrace/src/trim.rs::face_normalcrates/vcad-kernel-dfm/src/rules/mod.rs::Rule(theserde(flatten)site)lib/dfm/*.toml— the seven default packs that would benefit from validation