# Core Craftsmanship & Agent Piloting Blueprint - **Status:** Blueprint / Help Wanted (not yet implemented) - **Target:** Core (`forma-core` & `forma-lang`) - **Core Impact:** Strictly zero ML weights, `< 5 ms` deterministic checks, `0` extra base tokens on `forma-mcp` - **Design Review:** Required per feature PR (see [`CONTRIBUTING.md`](../CONTRIBUTING.md)) --- ## Architectural Principle Do **not** bundle a local neural critique model into core `forma` — that would destroy the ~1.7–1.8 MB native / ~0.8 MB WASM / zero-GPU footprint while still having weaker 3D spatial judgment than the host frontier model. Instead, split quality feedback into: - **Layer A (Deterministic, inside `forma-core`, 0 KB weights, `< 5 ms`):** Fast geometric linting, spatial assertions, and cutaway/wireframe diagnostic views. - **Layer B (Host VLM visual loop):** The calling agent inspects the 4-view render and deterministic lint notes to refine geometry. --- ## Prioritized Craftsmanship Features 1. **Deterministic Geometric Craftsmanship Critic (`forma lint` / `--critique`, `invariants.rs`):** - Emits zero tokens on clean builds. - Flags unintended floating shells, grazing contacts (`0 <= clearance < 1e-3`), thin walls via inward BVH rays, center-of-mass stability/tipping overhang, and an opt-in "un-beveled raw 90° box" lint. 2. **Declarative Spatial Assertions (`assert` in `Forma-Pipe`):** - 1-line engineering contracts that auto-rollback with exact deltas on failure: ```text assert clearance(shaft, bore) >= 0.005 assert connected(assembly) assert grounded(base, z=0) assert section_loops(flange, z=0) == 6 ``` 3. **Pure Parametric Macros (`def`) + Lazy Industrial-Design Stdlib (`inspect(topic="stdlib")`):** - Reusable sub-assemblies (`def standoff(r_out, r_in, h) = ...`). - On-demand high-craft detail recipes (counterbored bosses, gusset ribs, snap-fit lips, flanged collars, Gothic arches) loaded lazily via `inspect(topic=...)` at **0 base-schema tokens**. 4. **Visual-Critique Renderer Modes (`render.rs`):** - `mode="section|wire|scale"` — mid-plane cutaways (exposing internal walls and clearances), clay+wireframe overlays, and orthographic ruler ticks for a tight 2-pass visual refinement loop. 5. **Actionable Grazing-Boolean Diagnostics (`boolean.rs`):** - Pinpoint the exact offending edge centroid `(x, y, z)` and suggest a concrete overlap/extension fix whenever `--strict` rolls back a grazing coplanar boolean.