Rebuild the object in a reference image as a code-only, procedural, quality-gated, animation-ready Three.js model. Token-efficient image-to-3D.
Python 3dai-agentsclaude-codecomputer-graphicsgenerativeimage-to-3dprocedural-generationthreejstypescriptwebgl
feat: enhance skill and strict cs2 component render
kokorolx512433141818
diff --git a/SKILL.md b/SKILL.mdindex c4a6e94..6321a7d 100644--- a/SKILL.md+++ b/SKILL.md@@ -270,6 +270,20 @@ evidence caused it, what still differs, and choose exactly one next action:Details + per-layer scorecard: `grimoire/feedback/render_capture.md`.- **Action-ready**: build a runtime hierarchy (pivots, sockets, colliders, destruction groups),never an inert lump; expose `root.userData.sculptRuntime`. `grimoire/readiness/action_rigging.md`.+- **Assembly gate (structure, not pixels) — every model ships explodable AND clickable**: this is+ a build requirement, not a per-project extra. Name every mesh; flag surface relief+ `userData.explodeWithParent` so it rides its shell; let a named group of *anonymous* meshes be one+ part while a named group of *named* parts stays a container. Explode and part-picking must share+ one definition of "a part" — if they disagree, both are wrong. Separate parts by SCALING the+ layout about the model centre, never by pushing every part the same distance (that translates the+ arrangement without opening any gap). Then run+ `forge/stage4_review/check_part_coverage.py --spec <spec> --manifest <parts.json>`: it FAILS on a+ specified component that was never built and on two components fused onto one mesh; it warns on+ inventoried details that never reached the spec and on meshes belonging to no named part. This is+ the only gate that scores STRUCTURE — every other one scores pixels, and a single fused mesh+ wearing a projected photo passes all of those. Its limit is honest and must be stated when+ reporting: it proves you built what you specified, never that you specified enough.+ Full contract + the two rules it took a wrong pass to learn: `grimoire/build/geometry_patterns.md`.- **Attachment**: child appendages (branches/limbs/handles/tubes) need `attachment.parentSocket`,`localStart`, `localEnd`, `contactType`, `embedDepth`/`overlap`, `gapTolerance` — no mid-air parts.`grimoire/readiness/joint_attachment.md`.diff --git a/forge/stage2_spec/cs2_adapters.py b/forge/stage2_spec/cs2_adapters.pyindex d94198a..502f887 100644--- a/forge/stage2_spec/cs2_adapters.py+++ b/forge/stage2_spec/cs2_adapters.py@@ -30,10 +30,33 @@ _KNIFE = FamilyAdapter()SUPPORTED_KNIFE_SUBTYPES = frozenset({"karambit", "butterfly", "bayonet", "m9", "flip", "gut", "falchion", "bowie", "navaja", "talon", "classic"})+# A pistol is not a knife with different proportions: it is a two-body assembly (slide riding a+# frame) with a through-hole in the trigger guard, an internal mechanism the shell may reveal,+# and controls that stand proud of the broad faces. It gets its own tree rather than the knife+# tree with renamed parts.+_PISTOL = FamilyAdapter(+ "pistol", "generic-supported",+ ("extrude-traced-outline", "outline-with-hole", "assembled-solid", "revolve"),+ ("slide-painted", "frame-painted", "magazine-painted", "grip-panel-painted",+ "breech-bare-metal", "barrel-bare-metal", "controls-bare-polymer"),+ ("skin-finish", "substrate", "translucent-shell", "internal-mechanism"),+ ("silhouette", "slide-frame-parting-line", "ejection-port", "sights",+ "trigger-and-safety-blade", "trigger-guard-loop", "grip-rake-and-panel",+ "magazine-extension", "pin-and-control-placement", "muzzle-and-barrel"),+ ("slide-to-frame", "magazine-to-magwell", "trigger-to-pin",+ "grip-panel-to-frame", "internals-inside-shell"),+ ("reference", "orbit-left", "orbit-right", "muzzle-on", "top-down"),+)+SUPPORTED_PISTOL_SUBTYPES = frozenset({"glock-18"})++_ADAPTERS = {"knife": (_KNIFE, SUPPORTED_KNIFE_SUBTYPES), "pistol": (_PISTOL, SUPPORTED_PISTOL_SUBTYPES)}+def get_family_adapter(family: str, subtype: str | None = None) -> FamilyAdapter:- if family != "knife":+ entry = _ADAPTERS.get(family)+ if entry is None:raise ValueError(f"unsupported-family: {family}")- if subtype and subtype not in SUPPORTED_KNIFE_SUBTYPES:+ adapter, supported = entry+ if subtype and subtype not in supported:raise ValueError(f"unsupported-subtype: {subtype}")- return _KNIFE if subtype is None else replace(_KNIFE, subtype=subtype)+ return adapter if subtype is None else replace(adapter, subtype=subtype)diff --git a/forge/stage4_review/check_part_coverage.py b/forge/stage4_review/check_part_coverage.pynew file mode 100644index 0000000..950b105--- /dev/null+++ b/forge/stage4_review/check_part_coverage.py@@ -0,0 +1,298 @@+#!/usr/bin/env python3+"""Assembly gate: does the BUILT model actually contain the parts the spec promised?++Every other gate in this pipeline scores pixels. This one scores the part tree, because a+reconstruction can pass every silhouette and colour gate while being one fused mesh wearing a+photograph — and because a component that was specified and then quietly never built leaves no+trace in a render the reviewer is looking at from the reference angle.++Three independent checks:++ A. componentTree -> model every specified component exists as a named, selectable part;+ no two components collapse onto the same part (fused)+ B. detailInventory -> spec every inventoried detail still resolves to a component or+ material field (`mapsTo`), so an observed feature cannot be+ dropped silently between intake and spec+ C. model hygiene meshes that belong to no named part cannot be selected or+ exploded, so they are reported with a count++WHAT THIS CANNOT DO: it compares the model against the spec, and the spec against the detail+inventory. It cannot invent domain knowledge that intake never captured. A Glock-18 whose fire+selector was never observed, never inventoried and never specified will pass every check here.+Closing that gap is the job of the detail inventory and the family adapter, not of this script.++Usage:+ check_part_coverage.py --spec object-sculpt-spec.json --manifest parts.json+ check_part_coverage.py --spec spec.json --manifest parts.json --json coverage.json+ check_part_coverage.py --spec spec.json --manifest parts.json --require fire-selector,rear-sight++The manifest is a runtime dump of the built part tree, produced by the viewer:++ {+ "model": "glock-ghost-protocol",+ "parts": [{"name": "slide", "kind": "part", "module": "slide", "triangles": 18588}],+ "unnamedMeshes": 0,+ "integralMeshes": 61+ }++Exit code 1 when any error-severity finding survives (use --warn-only to always exit 0).+"""++from __future__ import annotations++import argparse+import json+import re+import sys+from pathlib import Path+from typing import Any+++def norm(text: str) -> str:+ """Fold naming conventions together: 'rear-sight', 'rearSight', 'Rear Sight' -> 'rearsight'."""+ return re.sub(r"[^a-z0-9]", "", str(text).lower())+++def load(path: str) -> Any:+ try:+ return json.loads(Path(path).read_text(encoding="utf-8"))+ except FileNotFoundError:+ sys.exit(f"check_part_coverage: no such file: {path}")+ except json.JSONDecodeError as exc:+ sys.exit(f"check_part_coverage: {path} is not valid JSON: {exc}")+++def severity_for(component: dict[str, Any]) -> str:+ """A macro component or an explicitly important one is a build failure when absent.++ Micro detail is a warning: it is often legitimately folded into a parent's relief rather+ than built as a separate mesh, and failing the build for that would punish the correct+ choice.+ """+ importance = component.get("importance")+ if isinstance(importance, (int, float)):+ return "error" if importance >= 0.7 else "warning"+ return "error" if component.get("level", "meso") in {"macro", "meso"} else "warning"+++def collect_local_feature_keys(spec: dict[str, Any]) -> set[str]:+ keys: set[str] = set()+ for component in spec.get("componentTree", []):+ if not isinstance(component, dict):+ continue+ for field in ("id", "name"):+ if component.get(field):+ keys.add(norm(component[field]))+ for feature in component.get("localFeatures", []) or []:+ if isinstance(feature, dict):+ for field in ("id", "name", "feature"):+ if feature.get(field):+ keys.add(norm(feature[field]))+ elif isinstance(feature, str):+ keys.add(norm(feature))+ for material in spec.get("materials", []) or []:+ if not isinstance(material, dict):+ continue+ for override in material.get("localOverrides", []) or []:+ if isinstance(override, dict):+ for field in ("id", "name", "region"):+ if override.get(field):+ keys.add(norm(override[field]))+ elif isinstance(override, str):+ keys.add(norm(override))+ return keys+++def find_inventory(spec: dict[str, Any], inventory_arg: str | None) -> list[dict[str, Any]]:+ if inventory_arg:+ blob = load(inventory_arg)+ else:+ blob = spec.get("preSpecAssessment", {}) or {}+ entries = blob.get("detailInventory")+ if isinstance(entries, dict):+ entries = entries.get("details")+ return [e for e in (entries or []) if isinstance(e, dict)]+++def main() -> int:+ ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)+ ap.add_argument("--spec", required=True, help="object-sculpt-spec.json")+ ap.add_argument("--manifest", required=True, help="runtime part-tree dump from the viewer")+ ap.add_argument("--inventory", help="standalone detail-inventory.json (default: read from spec)")+ ap.add_argument("--require", help="comma-separated part names that MUST exist, whatever the spec says")+ ap.add_argument("--json", dest="json_out", help="write the findings as JSON")+ ap.add_argument("--warn-only", action="store_true", help="always exit 0")+ args = ap.parse_args()++ spec = load(args.spec)+ manifest = load(args.manifest)++ parts = [p for p in manifest.get("parts", []) if isinstance(p, dict) and p.get("name")]+ if not parts:+ print("FAIL model exposes no named parts at all — nothing is selectable or separable")+ print(" the factory must name its meshes; see the assembly contract in SKILL.md")+ return 0 if args.warn_only else 1++ by_norm: dict[str, list[str]] = {}+ for part in parts:+ by_norm.setdefault(norm(part["name"]), []).append(part["name"])++ findings: list[dict[str, str]] = []+ claimed: dict[str, list[str]] = {}++ # ---- A. componentTree -> model -------------------------------------------------+ all_components = [c for c in spec.get("componentTree", []) if isinstance(c, dict) and c.get("id")]+ # Exclude only the TREE ROOT — a parentless component that everything else hangs off. It+ # is the spec's stand-in for the model group, and the viewer likewise never lists its root+ # as a part. Do NOT treat every parent as a container: in a real spec the blade and the+ # grip are both genuine geometry AND the parents of their own relief features, so the+ # broader rule silently drops the most important components from the check.+ parent_ids = {c["parent"] for c in all_components if c.get("parent")}+ roots = {c["id"] for c in all_components if not c.get("parent") and c["id"] in parent_ids}+ components = [c for c in all_components if c["id"] not in roots]++ missing: list[dict[str, Any]] = []+ matched: dict[str, str] = {}+ for component in components:+ cid = component["id"]+ candidates = [norm(cid)]+ if component.get("name"):+ candidates.append(norm(component["name"]))+ hit = next((c for c in candidates if c in by_norm), None)+ if hit is None:+ missing.append(component)+ else:+ matched[cid] = hit+ claimed.setdefault(hit, []).append(cid)++ for component in missing:+ cid = component["id"]+ severity = severity_for(component)+ parent = component.get("parent")+ # The tree root is not a part and is never "missing" — treat it as present so the+ # message below does not blame a top-level component's absence on its own root.+ parent_built = bool(parent) and (parent in roots or parent in matched or norm(parent) in by_norm)+ if parent_built and severity != "error":+ # The normal, CORRECT case: a bevel, a jimping band or a choil is relief cut into+ # the part it belongs to, not a mesh of its own. Report it so the coverage is+ # visible, but do not call a right answer a defect.+ findings.append({+ "check": "component-folded",+ "severity": "info",+ "subject": cid,+ "detail": f"no mesh of its own — folded into {parent!r}, which is built. Correct "+ f"for relief; a real gap only if this needed to be separable.",+ })+ else:+ findings.append({+ "check": "component-missing",+ "severity": severity,+ "subject": cid,+ "detail": f"specified component {cid!r} has no matching part in the built model"+ + ("" if not parent else f", and its parent {parent!r} is missing too"),+ })++ for part_key, owners in claimed.items():+ if len(owners) > 1:+ findings.append({+ "check": "components-fused",+ "severity": "error",+ "subject": by_norm[part_key][0],+ "detail": f"components {', '.join(sorted(owners))} all resolve to the single part "+ f"{by_norm[part_key][0]!r} — they are fused, not separable",+ })++ for name in filter(None, (args.require or "").split(",")):+ if norm(name) not in by_norm:+ findings.append({+ "check": "required-part-missing",+ "severity": "error",+ "subject": name.strip(),+ "detail": f"required part {name.strip()!r} is absent from the built model",+ })++ # ---- B. detailInventory -> spec ------------------------------------------------+ keys = collect_local_feature_keys(spec)+ for index, entry in enumerate(find_inventory(spec, args.inventory)):+ maps_to = entry.get("mapsTo")+ # The scaffolder writes mapsTo as {"ref": ..., "via": ...}; hand-authored specs+ # sometimes use a bare string. Accept both rather than failing the honest one.+ if isinstance(maps_to, dict):+ maps_to = maps_to.get("ref") or maps_to.get("id") or ""+ label = entry.get("id") or entry.get("description") or f"detail[{index}]"+ if not maps_to or not str(maps_to).strip():+ findings.append({+ "check": "detail-unmapped",+ "severity": "warning",+ "subject": str(label)[:60],+ "detail": "inventoried detail has no mapsTo — it was observed but never assigned "+ "to a component or material field",+ })+ elif norm(maps_to) not in keys:+ findings.append({+ "check": "detail-dangling",+ "severity": "warning",+ "subject": str(label)[:60],+ "detail": f"mapsTo {maps_to!r} matches no component, localFeature or localOverride",+ })++ # ---- C. model hygiene ----------------------------------------------------------+ unnamed = int(manifest.get("unnamedMeshes") or 0)+ if unnamed:+ findings.append({+ "check": "unnamed-meshes",+ "severity": "warning",+ "subject": f"{unnamed} mesh(es)",+ "detail": "meshes belonging to no named part: they cannot be selected, and each one "+ "explodes on its own instead of riding the part it decorates",+ })++ extras = sorted(set(by_norm) - set(claimed))+ for key in extras:+ findings.append({+ "check": "part-not-specified",+ "severity": "info",+ "subject": by_norm[key][0],+ "detail": "built part has no matching component in the spec (fine for detail groups; "+ "a sign of spec drift for anything larger)",+ })++ # ---- report --------------------------------------------------------------------+ rank = {"error": 0, "warning": 1, "info": 2}+ findings.sort(key=lambda f: rank[f["severity"]])+ errors = sum(1 for f in findings if f["severity"] == "error")+ warnings = sum(1 for f in findings if f["severity"] == "warning")++ label = {"error": "FAIL", "warning": "WARN", "info": "note"}+ for finding in findings:+ print(f"{label[finding['severity']]:<5} {finding['check']}: {finding['subject']}")+ print(f" {finding['detail']}")++ print(+ f"\ncheck_part_coverage: {len(components)} specified, {len(parts)} built, "+ f"{errors} error(s), {warnings} warning(s)"+ )++ if args.json_out:+ Path(args.json_out).write_text(+ json.dumps(+ {+ "model": manifest.get("model"),+ "specifiedComponents": len(components),+ "builtParts": len(parts),+ "errors": errors,+ "warnings": warnings,+ "result": "fail" if errors else "pass",+ "findings": findings,+ },+ indent=2,+ )+ + "\n",+ encoding="utf-8",+ )++ return 1 if errors and not args.warn_only else 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/grimoire/build/geometry_patterns.md b/grimoire/build/geometry_patterns.mdindex 26fe85e..edb0b7d 100644--- a/grimoire/build/geometry_patterns.md+++ b/grimoire/build/geometry_patterns.md@@ -173,8 +173,202 @@ credit so each failure is visible at the pass that owns it.- Fix: extend one or both shapes so they overlap by at least 0.02-0.05 world units at the seam- Verify overlap by checking that `partA.end >= partB.start` for each axis where they meet+### Failure record: Glock-18 Ghost Protocol — separable parts, still 2.5D (2026-07)++The build scored 0.986 silhouette IoU on both references, matched 6 of 8 colour zones to+within ±3.3 counts, held across five non-degenerate orbit views — and still read as "just a+projection" to the user. Every gate passed because **no gate measures cross-section**.++**The distinctZ test — run it before declaring a pass.** For each mesh, count the distinct+Z values its vertices take (rounded to ~1e-3). A planar extrusion with a bevel lands on+6–10 planes no matter how many triangles it has; a genuinely revolved or lofted part lands+on 11+. On the Glock: slide 856 tris / **10** planes, frame 4900 tris / **10**, magazine 876 /+**10**, trigger 476 / **10** — while barrel 57 tris / **15**, bore 49 / **13** were the only parts+that read as real. Triangle count is not evidence of form; plane count is.++ zs = set(); for i in range(pos.count): zs.add(round(pos.getZ(i), 3))+ # <= 10 on a part that should have a profile => it is a slab, not a solid++**A high silhouette IoU actively hides this.** IoU is computed from the broadside view, which+is exactly the view a flat extrusion nails perfectly. The tell-tales are elsewhere:+- top-down / muzzle-on render is a plain rectangle with no interior modelling+- an axis-aligned cross-section render shows constant width top to bottom+- the object looks right at 0° and progressively more like cardboard as it rotates++**"Separable" and "3D" are different properties — do not conflate them.** The Glock had 29+named meshes in 4 pivot groups, every one explodable and addressable via `sculptRuntime.nodes`.+Separation was perfect. That bought nothing, because each separated part was itself a slab.+When a user says details look fake, audit cross-section first, part hierarchy second.++**Internals must be mechanism, not primitives.** Hiding the translucent shell exposed the+"internals" as an 8-triangle box for the magazine body, an 8-triangle box for the breech, and+a plain tube for the barrel with no chamber, hood, lug or feed ramp. A shell at transmission+0.3 over dark internals reveals ~20–30% of them, so placeholder boxes survive every 2D gate+while contributing nothing but a vague smudge. Either model the mechanism or drop it and say+the interior is not reconstructed — a box that reads as a box is worse than an honest absence.++**Watch for `[top, bottom]` where the helper wants `[min, max]`.** A block helper computing+`y[1] - y[0]` silently accepts a negative height and produces an inside-out mesh with flipped+normals. It renders — you see the far interior wall — so it never throws and never fails a+colour gate. Assert `y[1] > y[0]` in the helper.+**Projection core poke-through prevention.** When using photo-projected face plates over a solid core:- A solid core behind photo-projected face plates bleeds onto the blade face in the grind-transition band- Keep the core a thin spine rail (top ~18% of blade height) raised well above the red/black boundary- Translate the core to sit safely inside the plates: `translate(0, 0, -HALF * 0.525)` for ±0.021 plates- Ensure the core never reaches the red/black boundary or the grind zone so it never shows on the blade face++### Fix record: the variable-thickness loft that fixed it (2026-07)++The repair for the 2.5D failure above. Replace `ExtrudeGeometry` with a loft: sweep the traced+outline through ~11 rings whose Z is `t * halfWidth(x, y)`, where `halfWidth` is a hand-authored+field naming each anatomical feature (dust cover thinner than receiver, palm swell, raised grip+panel plateau, slide-deck break, magazine floorplate flare). Groups come back as +Z cap / -Z cap /+walls, so each broad face keeps its own reference projection. Result on the Glock: distinct-Z per+shell went 10 → 693 (frame) / 363 (slide) / 231 (magazine) with silhouette IoU held at 0.985.++Four traps, each of which cost a debugging cycle:++1. **The cap has no interior vertices.** `ShapeUtils.triangulateShape` puts vertices only on the+ outline, so a swell in the MIDDLE of a part has nothing to displace and collapses to flat+ facets. Subdivide cap triangles 4-way and re-sample the field at each new interior vertex.+ Midpoints landing on a boundary edge must keep the straight-line interpolation of their+ parents, or they leave the wall and crack the seam.+2. **Never take cap normals from the triangulation.** Ear-clipping returns slivers; three nearly+ collinear samples of a curved field give an averaged normal that swings wildly, and the grip+ renders as a fan of hard creases radiating across it. Compute the normal analytically from the+ field gradient (`normalize(-f_x, -f_y, 1) * sign(t)`) for interior vertices only — boundary+ vertices are shared with the wall and carry the rolled rim. Laplacian relaxation of the mesh is+ NOT a substitute; it made it worse.+3. **Roll must be per-vertex, off the LOCAL half-width.** A roll sized off nominal thickness turns+ a locally slim section (a trigger-guard bow at 58% of the receiver) almost entirely into roll,+ and it renders as a white tube.+4. **A sloped cap surface is scored by the BROADSIDE gate, and what it reads is the SLOPE, not the+ depth.** An over-scaled slide-deck break put that zone +23 luma over the reference. Halving the+ guard bow's ramp — a steeper slope for a *shallower* waist — took it from +19 to +54. Widen the+ shoulder to dim it. Sanity-check every new bevel against the reference before keeping it.++Measure the baseline before claiming a photometric regression: `git stash` the rewritten factory,+re-render, diff per zone. Two of eight zones here were genuine regressions; two others were+pre-existing and the rework improved them.++### Diagnosis record: the reviewer names the SYMPTOM, not the cause (2026-07)++Across three review rounds on the Glock, every reported symptom was real and the stated cause was+wrong more often than right. Acting on the stated cause would have made the model worse twice.++| Reported cause | Actual cause |+| --- | --- |+| "floating micro-meshes used for serrations — use normal maps instead" | ribs are half-sunk in the shell; the EXPLODE was giving each its own offset and scattering them |+| "trigger ghost is a projection artefact — apply an isolation mask to the albedo" | the traced guard hole wrapped AROUND the trigger, so the frame carried a solid trigger tongue. Masking the albedo would have changed nothing |+| "no normal map on the serrations" | there was one, at normalScale 0.42 |+| "set transmission 0.8 / roughness 0.1" | transmission was solved at 0.3 against the reference; roughness is a per-pixel authored map, not a scalar |++Self-inflicted too: the ejection-port zone was mis-attributed twice (blamed the rib material, then+the raceway colour — each moved it by ~0.1) before the real cause turned out to be opening the+slide's underside. **Two failed attributions in a row means stop guessing and run a discriminating+test.**++Four cheap tests that each settled a question in one shot:++- **Flat-material render** — hide everything but the part, swap in `MeshBasicMaterial` with no maps,+ render. Anything still visible is GEOMETRY, not texture. Settled the trigger ghost instantly.+- **Axis raycast** — for any "the hole is blocked" report, cast a ray down the axis from outside and+ print the ordered hit list with object names. It names the blocker. `[email protected]` ended the+ guesswork about the bore in one call.+- **`git stash` the rewrite, re-render** — before conceding a photometric regression, measure the+ baseline. Half the "regressions" were pre-existing and the rework had improved them.+- **Bracket the parameter** — change the suspect the WRONG way. If the symptom does not worsen, it is+ not the cause. Tightening the guard-bow ramp took it +19 → +54, which proved the slope was the+ driver and pointed at the fix.++### Failure record: a loft's cavities are not all holes (2026-07)++A loft swept along Z has caps at ±Z and WALLS around the XY silhouette. That decides the mechanism:++- cavity opening along ±Z → a **hole in the outline**+- cavity opening along any other axis → **missing wall**, a different operation++The slide's muzzle bore opens along +X and the U-channel opens along -Y, so neither is a hole; both+needed wall-skipping. Modelled as outline holes they would have been cut on the wrong axis. This is+usually what a reviewer means by "it is solid / it cannot be assembled".++Negative result worth not repeating: a cavity whose inner surface is a back-faces-only mesh does NOT+work inside a translucent shell of varying thickness — the magwell attempt ghosted through the grip+as a grey slab and was reverted. Cutting the mouth is only half the job; the cavity needs a surface+that stays contained, and a simple inverted box will not.++### Failure record: the trace absorbs adjacent opaque parts (2026-07)++Alpha-tracing a photo where part B is opaque and touches part A gives an A-outline that swallows B+as a solid tongue. Model B separately as well and the build carries TWO Bs — one real, one fake and+full-thickness. Here the traced trigger-guard hole wrapped around the trigger, so the frame kept a+trigger-shaped tongue at full receiver thickness under the real shoe.++Fix at the trace, never downstream: punch B's footprint out of the mask BEFORE tracing A's holes.+`build_geo.py` now does this; the guard hole went 114 pts → 75 and every other field in `geo.json`+stayed byte-identical. Audit for it by rendering each shell alone with a flat material.++**A 2D gate can reward the defect.** Removing the tongue dropped front IoU 0.9855 → 0.9834, because+the tongue had been padding the silhouette. Do not defend a metric that was earned by wrong+geometry — report the drop as the correction it is.++### Explode contract: surface detail is not a part++Serrations, stria, inner raceways, port floors and muzzle faces belong TO a part; they are not parts.+Give them a flag (`userData.explodeWithParent`), parent them to their shell, and have the explode+skip them so they ride it. Without it a disassembly shatters into a comb of loose slivers and reads+as broken geometry — which is exactly how it was reported. The corollary is the positive one: a real+sub-assembly (trigger shoe + safety lever + bar + connector) should move as ONE module, so parent+those to the shoe and flag them too.++### Assembly contract: every model ships explodable and clickable (2026-07)++Not optional, not one-demo-only. Both are cheap once the naming is right, and together they are the+only *structural* check in a pipeline whose every other gate scores pixels: a model that can be+taken apart and clicked part-by-part cannot be one fused mesh wearing a photograph. Build them from+a single definition of "a part" — if the explode and the picker disagree about what one part is,+both are wrong.++**Naming rules the runtime depends on.** These are the whole contract; get them right and the+viewer needs no per-demo configuration:++1. **Name every mesh.** An unnamed mesh cannot be selected, cannot be reported, and explodes on its+ own. The manifest counts them and the assembly gate warns.+2. **`userData.explodeWithParent` on surface detail**, as above. It now does double duty: it makes+ a click on a serration resolve *up* to the comb instead of selecting one sliver.+3. **A named Group means one of two things**, and the runtime tells them apart by what is inside: a+ group holding *named parts* is a container/pivot (`slideAssembly`, `triggerPivot`) and is+ descended through; a group holding *anonymous* meshes is itself the part and travels whole. So a+ bracket set authored as eight unnamed meshes under `corner-brackets` explodes as one bracket set+ — what the author meant — instead of bursting into twenty slivers.+4. **Publish `sculptRuntime.destructionGroups`** when the object has assemblies; the part list+ groups by it for free.++**Separation is a layout SCALE, not a uniform push.** Displacing every part the same distance+outward slides the whole arrangement without opening the gaps between neighbours — parts that+touched still touch, and are neither readable nor clickable. Scale each part's distance from the+model centre (≈2×), add a base clearance for parts near the middle where the scaling term vanishes,+fan concentric stacks (a barrel inside a slide) along the model's THINNEST axis in alternating+growing steps, then dolly the camera by how much the layout actually grew rather than a fixed guess.++### Assembly gate: `forge/stage4_review/check_part_coverage.py`++Compares the BUILT part tree against the spec's `componentTree`, and the spec against its own+`detailInventory`. Catches a specified component that was never built, two components fused onto one+mesh, an inventoried detail that never reached the spec, and meshes belonging to no named part.+Feed it a manifest dumped from the running page; the script's docstring gives the shape.++Two rules it took a wrong pass to learn, both about not punishing correct work:++- **A missing component whose parent IS built is usually right.** A bevel, a jimping band, a choil+ is relief cut into the part it belongs to. Report it as a note; reserve failure for an important+ component whose branch is absent entirely.+- **"Has children" does not mean "is a container".** In a real spec the blade and the grip are+ genuine geometry *and* the parents of their own relief features; that rule silently drops the most+ important components from the check. Only the parentless tree root is a container.++**Its honest limit:** it compares model → spec → inventory. It cannot invent knowledge intake never+captured. The Glock-18 fire selector — never observed, never inventoried, never specified — passes+every check here. Closing *that* gap is the detail inventory's job and the family adapter's job. A+coverage gate proves you built what you said; it cannot prove you said enough.