Skip to content

Official Codebase of 3DCodeVerse

Python

skills: four measured bundles — part contact, blender forms, scene composition, glsl craft

gaoypeng744260e068ea
diff --git a/harness/codeverse/skills/_claims/cv3d-glsl-craft.toml b/harness/codeverse/skills/_claims/cv3d-glsl-craft.toml
new file mode 100644
index 00000000..706e9fb0
--- /dev/null
+++ b/harness/codeverse/skills/_claims/cv3d-glsl-craft.toml
@@ -0,0 +1,36 @@
+# gl_frames thresholds quoted in the body, pinned to spatial/frame_stats.py.
+
+[[claim]]
+key = "static_diff"
+text = "0.002"
+python = "codeverse.spatial.frame_stats:STATIC_DIFF"
+scale = 1
+format = "{:.3f}"
+
+[[claim]]
+key = "flicker_diff"
+text = "0.35"
+python = "codeverse.spatial.frame_stats:FLICKER_DIFF"
+scale = 1
+format = "{:.2f}"
+
+[[claim]]
+key = "low_detail_edge"
+text = "0.002"
+python = "codeverse.spatial.frame_stats:LOW_DETAIL_EDGE"
+scale = 1
+format = "{:.3f}"
+
+[[claim]]
+key = "black_lum"
+text = "0.03"
+python = "codeverse.spatial.frame_stats:BLACK_LUM"
+scale = 1
+format = "{:.2f}"
+
+[[claim]]
+key = "blown_lum"
+text = "0.98"
+python = "codeverse.spatial.frame_stats:BLOWN_LUM"
+scale = 1
+format = "{:.2f}"
diff --git a/harness/codeverse/skills/_claims/cv3d-part-contact.toml b/harness/codeverse/skills/_claims/cv3d-part-contact.toml
new file mode 100644
index 00000000..3d5782be
--- /dev/null
+++ b/harness/codeverse/skills/_claims/cv3d-part-contact.toml
@@ -0,0 +1,51 @@
+# Numbers this bundle quotes, pinned to the constants that produce them.
+# Changing a constant must break the test that ships the skill quoting it.
+
+[[claim]]
+key = "contact_gap"
+text = "2 mm"
+python = "codeverse.conventions:CONTACT_GAP_M"
+scale = 1000
+format = "{:.0f} mm"
+
+[[claim]]
+key = "penetration_warn"
+text = "2 mm"
+python = "codeverse.spatial.connectivity:PENETRATION_WARN_M"
+scale = 1000
+format = "{:.0f} mm"
+
+[[claim]]
+key = "penetration_error"
+text = "10 mm"
+python = "codeverse.spatial.connectivity:PENETRATION_ERROR_M"
+scale = 1000
+format = "{:.0f} mm"
+
+[[claim]]
+key = "penetration_min_fraction"
+text = "2%"
+python = "codeverse.spatial.connectivity:PENETRATION_MIN_FRACTION"
+scale = 100
+format = "{:.0f}%"
+
+[[claim]]
+key = "n_samples"
+text = "600"
+python = "codeverse.spatial.connectivity:N_SAMPLES"
+scale = 1
+format = "{:.0f}"
+
+[[claim]]
+key = "tiny_island_fraction"
+text = "5%"
+python = "codeverse.spatial.connectivity:TINY_ISLAND_FRACTION"
+scale = 100
+format = "{:.0f}%"
+
+[[claim]]
+key = "min_part_size"
+text = "10 mm"
+python = "codeverse.spatial.connectivity:MIN_PART_SIZE_M"
+scale = 1000
+format = "{:.0f} mm"
diff --git a/harness/codeverse/skills/_claims/cv3d-scene-composition.toml b/harness/codeverse/skills/_claims/cv3d-scene-composition.toml
new file mode 100644
index 00000000..48cd9b6f
--- /dev/null
+++ b/harness/codeverse/skills/_claims/cv3d-scene-composition.toml
@@ -0,0 +1,50 @@
+# scene_frames thresholds quoted in the body, pinned to spatial/frame_metrics.py.
+
+[[claim]]
+key = "near_hit"
+text = "0.5 m"
+python = "codeverse.spatial.frame_metrics:NEAR_HIT_M"
+scale = 1
+format = "{:.1f} m"
+
+[[claim]]
+key = "content_min_establishing"
+text = "20%"
+python = "codeverse.spatial.frame_metrics:CONTENT_MIN_ESTABLISHING"
+scale = 100
+format = "{:.0f}%"
+
+[[claim]]
+key = "content_min_authored"
+text = "10%"
+python = "codeverse.spatial.frame_metrics:CONTENT_MIN_AUTHORED"
+scale = 100
+format = "{:.0f}%"
+
+[[claim]]
+key = "eye_min_above_ground"
+text = "0.3 m"
+python = "codeverse.spatial.frame_metrics:EYE_MIN_ABOVE_GROUND_M"
+scale = 1
+format = "{:.1f} m"
+
+[[claim]]
+key = "eye_max_above_ground"
+text = "80 m"
+python = "codeverse.spatial.frame_metrics:EYE_MAX_ABOVE_GROUND_M"
+scale = 1
+format = "{:.0f} m"
+
+[[claim]]
+key = "flat_modal_warn"
+text = "85%"
+python = "codeverse.spatial.frame_metrics:FLAT_MODAL_FRAC"
+scale = 100
+format = "{:.0f}%"
+
+[[claim]]
+key = "flat_modal_error"
+text = "92%"
+python = "codeverse.spatial.frame_metrics:FLAT_MODAL_ERROR"
+scale = 100
+format = "{:.0f}%"
diff --git a/harness/codeverse/skills/cv3d-blender-forms/SKILL.md b/harness/codeverse/skills/cv3d-blender-forms/SKILL.md
new file mode 100644
index 00000000..b910fde2
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-blender-forms/SKILL.md
@@ -0,0 +1,107 @@
+---
+name: cv3d-blender-forms
+description: Turn a described shape into the right bpy technique, and avoid the five bpy traps this harness's lint and exporter actually catch (join without an active object, a part file model.py never imports, no PascalCase names, modifier_apply out of context, primitive_cube_add scale doubling the extents). Use in any session writing Blender python — static_object with language blender, or articulated_object with language urdf_blender — when building, detailing, refining or repairing geometry.
+license: Apache-2.0
+compatibility: Blender 5.0.1 headless, run by codeverse/languages/blender/wrappers/run_bpy.py. bpy, bmesh, mathutils, math, random, numpy only.
+metadata:
+ evidence: measured
+ verified: "2026-08-25"
+ corpus: "102 graded blender runs + 23 urdf_blender runs with gate artefacts, mined 2026-08-25"
+---
+
+# Shapes to bpy, and the traps the lint counts
+
+**Read this if** you are about to write `bpy` code. It is two things: a form-to-technique
+table so you do not build everything out of boxes, and the five traps that a static lint
+already caught in this corpus, with how often.
+
+blender is the biggest language here (102 of 142 graded runs with gate artefacts) and its
+two weakest judge criteria are `assembly_fit` (0.60) and `geometry_detail` (0.67), means
+over 246 judged rounds, mined 2026-08-25. `geometry_detail` is what the table below moves;
+`assembly_fit` belongs to `cv3d-part-contact`, whose contact and weld numbers this skill
+defers to rather than restating.
+
+## Form to technique
+
+Name the form first (this is what `cv3d-form-manifest` writes), then pick the row. Never
+start from "what primitive is nearest".
+
+| form | technique | notes |
+|---|---|---|
+| revolved profile (bottle, knob, vase, wheel hub) | `bmesh.ops.spin` on a profile, or a SCREW modifier | a lathe is one line and reads instantly better than a stack of cylinders |
+| thread, coil, spring | SCREW modifier with `screw_offset` and `iterations` | not a stack of tori |
+| swept tube (rail, cable, handle, hose) | curve with a non-zero `bevel_depth`; evaluate it to a mesh when a later step needs real geometry | `bevel_depth = 0` is a path with no surface: the node exports with no faces and the part is reported **missing** |
+| extruded outline with softened edges | `bmesh.ops.extrude_face_region` then BEVEL modifier | `width` must be under half the thinnest wall or the bevel eats the part |
+| shell / sheet metal / panel with wall thickness | build the surface, add SOLIDIFY | `offset=-1` grows inward, so the outer surface stays on the plan bbox |
+| cavity, slot, groove, hole | BOOLEAN DIFFERENCE, solver EXACT or MANIFOLD | cutter must overshoot the pierced face and never be coplanar with it |
+| small detail welded onto a body | BOOLEAN UNION, or build it into the same `bmesh` | overlapping is not merging: see `cv3d-part-contact` |
+| N identical features on one part | ARRAY or MIRROR modifier, or one python loop into one `bmesh` | array/mirror/screw results are ONE object, which is what you want for in-part detail |
+| N identical *parts* | a loop that creates N top-level objects named `Name_0 .. Name_N-1` | never a parent Empty; see `cv3d-repeats-and-mirrors` |
+| taper, bend, twist | `bmesh` vertex maths, or SIMPLE_DEFORM | cheap and it reads |
+| smooth organic body with sharp seams | SUBSURF plus edge creases | subsurf shrinks the part: measured on Blender 5.0.1 a subsurfed cube loses **16%** of every extent, a 32-segment cylinder 4-6%. The exporter applies it, so the contract gate sees the shrunk size |
+| beam between two points | build along one axis, then place from the endpoints | do **not** rotate a cylinder with Euler angles; see `references/form-recipes.md` |
+
+Code for every row: `read_cookbook(section="Modifiers")`, `"Screw and lathe"`,
+`"Curves"`, `"Deformation"`, `"Boolean detailing"`, `"Parametric repetition"`.
+
+## The five traps, with counts
+
+Counted over the 102 graded blender runs (mined 2026-08-25); each is a real `lint:blender`
+finding, emitted before the build even runs.
+
+1. **`bpy.ops.object.join` — 17 runs (17%).** The join result inherits the *active* object's
+ transform, and in background mode the selection is not what you think. Either set
+ `bpy.context.view_layer.objects.active` to an object with an identity transform first, or
+ do not join at all: build the whole part in one `bmesh` and skip the operator.
+2. **A part file `src/model.py` never imports — 7 runs (7%).** `src/parts/backrest.py` that
+ nobody imports ships *nothing*, silently: no build error, just a missing part and a
+ `contract/missing_part` finding two gates later. `model.py` must `from parts.backrest
+ import build_backrest` and call it exactly once. The mirror trap: a part file that calls
+ its own builder at module level builds the part twice and you get `Backrest.001`.
+3. **No PascalCase object names — 14 runs (14%).** Every visible mesh takes its plan part's
+ name exactly; instances are `Leg_0 .. Leg_3`. An auto-suffixed `Leg.001` is a different
+ part as far as the contract gate is concerned. (urdf_blender instead names each object
+ after its URDF link, and `lint:urdf` checks the link name appears verbatim in
+ `model.py`.)
+4. **`bpy.ops.object.modifier_apply` out of context — 7 runs (7%).** It needs the object
+ active and selected in OBJECT mode. **Usually you should not apply at all**: the exporter
+ runs with `export_apply=True`, so bevels, solidifies, arrays and mirrors are evaluated
+ for you. Apply only when a later step needs the real mesh — a boolean, a join, a vertex
+ loop — and then wrap it: `with bpy.context.temp_override(object=obj, active_object=obj,
+ selected_objects=[obj]):`.
+5. **`primitive_cube_add(scale=...)` without `size=1` — the extents come out doubled.**
+ Verified on Blender 5.0.1: `primitive_cube_add(scale=(0.3, 0.2, 0.1))` gives dimensions
+ 0.6 x 0.4 x 0.2; adding `size=1` gives exactly 0.3 x 0.2 x 0.1. Pass `size=1` and the
+ scale vector **is** the plan's extents, so you can paste the plan numbers in. Then bake
+ it: `transform_apply(location=False, rotation=False, scale=True)` — all three keywords,
+ always, because the ones you omit default to `True` and will bake the location too.
+
+Two more from the same lint that cost a whole run when they fire: indexing
+`bm.verts[i]` without `ensure_lookup_table()` is an ERROR (IndexError at build time), and
+`bsdf.inputs["Specular"]` is an ERROR (renamed to `"Specular IOR Level"` in 4.x/5.x).
+
+## Rules that are not in the lint but should be in your head
+
+* **Never rotate a cylinder into place.** Build a beam from its two world endpoints —
+ direction, length, and a quaternion from `(0,0,1)` to that direction. Euler order will
+ betray you on the second axis. Recipe in `references/form-recipes.md`.
+* **Derive spanning dimensions from the neighbour's plan bbox**, not from a typed literal.
+ A cross-brace's length is `right.bbox.min.x - left.bbox.max.x + 2 * weld`.
+* **Keep `obj.scale` at 1 by export time.** A scaled object bevels unevenly and exports its
+ scale baked; `apply_transforms` before any bevel or boolean.
+* **`bpy.context.selected_objects` and `bpy.context.object` are unreliable headless.** Keep
+ your own references to everything you create. (1 run lost time to this.)
+* **The exporter takes every *visible* mesh.** A leftover cutter, a construction guide or a
+ duplicate ships as a part. Delete it or set `hide_render`/`hide_viewport`.
+* **Detail budget over triangle count.** The prompt gives a target/floor/ceiling; a bevel
+ and a chamfer on the right edges read as more refinement than 200k triangles of subsurf.
+
+## Before you finish
+
+`build` -> `render_sheet` -> `check_connectivity` -> `check_contract`, and read the
+`lint:blender` findings in the build report first: they are free, static, and every one of
+the five above was reported *before* the model was wrong.
+
+Worked code — the beam helper, the lathe, the sweep, the solidify shell, the boolean with
+its cutter cleaned up, and the multi-file wiring skeleton — is in
+`references/form-recipes.md`.
diff --git a/harness/codeverse/skills/cv3d-blender-forms/references/form-recipes.md b/harness/codeverse/skills/cv3d-blender-forms/references/form-recipes.md
new file mode 100644
index 00000000..3af7df11
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-blender-forms/references/form-recipes.md
@@ -0,0 +1,154 @@
+# bpy form recipes
+
+Companion to `cv3d-blender-forms`. Every snippet was written against the harness's own
+runtime (Blender 5.0.1, `blender -b --factory-startup`, no operator context you did not
+create yourself) and uses only the allowed imports. Longer copyable code lives in the
+cookbook: `read_cookbook(section="Modifiers")` and friends.
+
+## 1. A beam between two world points (instead of rotating a cylinder)
+
+Euler order is the single most reliable way to place a strut wrong. Build along +Z and
+rotate once, with a quaternion derived from the endpoints:
+
+```python
+import bpy, bmesh
+from mathutils import Vector, Matrix
+
+def beam(name, p0, p1, radius, segments=16):
+ """A capsule-less cylinder from p0 to p1, correct for any direction."""
+ a, b = Vector(p0), Vector(p1)
+ d = b - a
+ length = d.length
+ bm = bmesh.new()
+ bmesh.ops.create_cone(bm, cap_ends=True, segments=segments,
+ radius1=radius, radius2=radius, depth=length)
+ me = bpy.data.meshes.new(name); bm.to_mesh(me); bm.free()
+ obj = bpy.data.objects.new(name, me)
+ obj.matrix_world = (Matrix.Translation((a + b) / 2.0)
+ @ Vector((0.0, 0.0, 1.0)).rotation_difference(d.normalized()).to_matrix().to_4x4())
+ bpy.context.scene.collection.objects.link(obj)
+ return obj
+```
+
+The length is the distance between the two points, so it cannot disagree with them, and the
+endpoints are where you say they are. Compute `p0`/`p1` from the neighbours' plan bboxes
+plus the 1 mm weld from `cv3d-part-contact`.
+
+## 2. Revolved profile (lathe)
+
+```python
+def lathe(name, profile_xy, segments=48, axis=(0, 0, 1)):
+ """profile_xy: [(radius, z)] from bottom to top, in metres, from the plan."""
+ bm = bmesh.new()
+ verts = [bm.verts.new((r, 0.0, z)) for r, z in profile_xy]
+ for v0, v1 in zip(verts, verts[1:]):
+ bm.edges.new((v0, v1))
+ bmesh.ops.spin(bm, geom=bm.verts[:] + bm.edges[:], axis=axis, cent=(0, 0, 0),
+ dvec=(0, 0, 0), angle=6.283185, steps=segments, use_merge=True)
+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
+ me = bpy.data.meshes.new(name); bm.to_mesh(me); bm.free()
+ obj = bpy.data.objects.new(name, me)
+ bpy.context.scene.collection.objects.link(obj)
+ return obj
+```
+
+A profile of six or eight `(radius, z)` pairs is what turns "a jug" from a cylinder into a
+jug. That is the `geometry_detail` criterion in one function.
+
+## 3. Swept tube along a path — and the real export trap
+
+Verified on Blender 5.0.1 against the harness's own export call: a curve object with a
+`bevel_depth` **does** export (the glTF writer evaluates it), so the old advice "always
+convert or it exports nothing" is not the failure. The failure is a curve with
+`bevel_depth = 0` — a zero-thickness path has no surface, the node exports with no faces,
+`spatial/measure.py::solid_parts` drops it, and the contract gate reports the part missing.
+
+Give every curve a bevel, and convert to a mesh whenever a later step needs real geometry
+(a boolean, a vertex loop, a measurement). Convert without operators — `bpy.ops.object.convert`
+needs the object to be a *selected editable* object in the view layer and fails silently in
+background mode with "No editable objects to convert":
+
+```python
+def curve_to_mesh(obj):
+ """Ops-free CURVE -> MESH: evaluate the bevel and swap the data. Keeps the name."""
+ dg = bpy.context.evaluated_depsgraph_get()
+ me = bpy.data.meshes.new_from_object(obj.evaluated_get(dg))
+ name = obj.name
+ bpy.data.objects.remove(obj, do_unlink=True)
+ new = bpy.data.objects.new(name, me)
+ bpy.context.scene.collection.objects.link(new)
+ return new
+
+def tube(name, points, radius, resolution=6):
+ cu = bpy.data.curves.new(name + "Data", 'CURVE'); cu.dimensions = '3D'
+ cu.bevel_depth = radius # never 0: that is the part-goes-missing bug
+ cu.bevel_resolution = resolution; cu.use_fill_caps = True
+ sp = cu.splines.new('POLY'); sp.points.add(len(points) - 1)
+ for i, (x, y, z) in enumerate(points):
+ sp.points[i].co = (x, y, z, 1.0)
+ obj = bpy.data.objects.new(name, cu)
+ bpy.context.scene.collection.objects.link(obj)
+ return curve_to_mesh(obj)
+```
+
+## 4. Shell with a wall thickness
+
+```python
+sol = obj.modifiers.new("Solidify", 'SOLIDIFY')
+sol.thickness = 0.003 # 3 mm wall
+sol.offset = -1 # grow INWARD: the outer surface stays on the plan bbox
+sol.use_even_offset = True
+```
+
+Leave it unapplied. The exporter evaluates modifiers (`export_apply=True`), so the gate
+measures the solidified result without you touching operator context.
+
+## 5. Cavity, and cleaning up after it
+
+```python
+def cut(obj, cutter, solver='MANIFOLD'):
+ m = obj.modifiers.new("Cut", 'BOOLEAN'); m.operation = 'DIFFERENCE'; m.object = cutter
+ if solver not in m.bl_rna.properties["solver"].enum_items.keys():
+ solver = 'EXACT'
+ m.solver = solver
+ with bpy.context.temp_override(object=obj, active_object=obj, selected_objects=[obj]):
+ bpy.ops.object.modifier_apply(modifier=m.name)
+ bpy.data.objects.remove(cutter, do_unlink=True) # or it exports as its own part
+```
+
+The cutter must overshoot the face it pierces and must never be coplanar with it. If you
+leave the modifier for the exporter instead of applying it, you must keep the cutter alive
+*and* hidden (`hide_render = hide_viewport = True`); both were verified on Blender 5.0.1 to
+keep it out of the GLB while the cut still happens.
+
+## 6. Multi-file wiring (static_object/blender only)
+
+```
+src/model.py imports every builder, calls each ONCE, then self-checks
+src/parts/seat_cushion.py def build_seat_cushion() -> bpy.types.Object (defines only)
+src/parts/_common.py shared helpers; the underscore means "not a part"
+```
+
+Three failure modes the lint reports, all of them silent at build time:
+
+* the part file exists but `model.py` never imports it -> the part is simply absent;
+* the part file calls its own builder at module level -> the part is built twice and the
+ second copy is named `SeatCushion.001`;
+* the builder is named something other than `build_<snake of the plan name>` -> ImportError
+ with a hint naming the exact function it expected.
+
+`urdf_blender` does not use this layout: one `src/model.py`, one mesh object per URDF link,
+object name equal to the link name, and `lint:urdf` checks that each link name appears
+verbatim in the file.
+
+## 7. A self-check worth writing
+
+```python
+def selfcheck(expected):
+ names = sorted(o.name for o in bpy.data.objects if o.type == 'MESH')
+ assert not [n for n in names if '.' in n], f"auto-suffixed: {names}"
+ assert sorted(expected) == names, f"expected {sorted(expected)}, built {names}"
+```
+
+Two asserts, run at the end of `main()`, catch the missing part and the duplicated part
+before the build report does.
diff --git a/harness/codeverse/skills/cv3d-glsl-craft/SKILL.md b/harness/codeverse/skills/cv3d-glsl-craft/SKILL.md
new file mode 100644
index 00000000..c9742536
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-glsl-craft/SKILL.md
@@ -0,0 +1,151 @@
+---
+name: cv3d-glsl-craft
+description: Craft rules for the fragment shaders this harness judges — what the five sampled frames measure and where the real operating band is, how to build multi-scale structure that does not alias, how to make motion come from the mechanism instead of a uv scroll, and why an added radial falloff reads as a uniform glow instead of light shafts. Use in any graphics session with language glsl_shader when writing, refining, repairing or rebuilding the shader, and whenever gl_frames reports static, flicker or low detail.
+license: Apache-2.0
+compatibility: GLSL 330 core via moderngl, headless. One image pass (src/shader.frag), an optional src/common.glsl and one feedback pass (src/buffer_a.frag). The harness declares the uniforms; the contract lists them.
+metadata:
+ evidence: mixed
+ evidence_note: "Gate thresholds and rubric weights are read from live code (spatial/frame_stats.py, judges/rubrics/shader_v1.yaml). The corpus is thin: 9 graded glsl_shader runs, so every count below names its n and no rate is generalised."
+ verified: "2026-08-25"
+ corpus: "9 graded glsl_shader runs (18 judged rounds) + 5 opengl_python runs, mined 2026-08-25"
+---
+
+# What separates a graded shader from a demo
+
+**Read this if** you are writing `src/shader.frag`. The contract already tells you which
+uniforms exist and how to keep the maths NaN-free. This is the layer above that: what the
+measurement can and cannot see, and the four craft rules that the judge's complaints in this
+corpus actually name.
+
+## The gate is a floor, not the bar
+
+`spatial/frame_stats.py` renders five frames — t = 0, 1, 2.5, 4, 6 s — and measures them:
+
+| what | constant | fires at |
+|---|---|---|
+| static | `STATIC_DIFF` | mean absolute pixel difference between consecutive frames **< 0.002** |
+| flicker | `FLICKER_DIFF` | any consecutive pair **> 0.35** |
+| duplicate frames | `DUPLICATE_DIFF` | a pair under 1e-4 (INFO) |
+| near-flat image | `LOW_DETAIL_EDGE` | mean edge density **< 0.002** (fraction of pixels whose luminance gradient exceeds 0.02) |
+| black / blown | `BLACK_LUM` 0.03, `BLOWN_LUM` 0.98 | > 97% of pixels in every frame; ERROR, and the gate hint asks for mean luminance 0.2-0.6 |
+
+Measured over the 9 graded glsl runs (mined 2026-08-25), **the gate fired zero findings**:
+mean frame-to-frame difference ranged 0.013 to 0.182 (median 0.082) and edge density 0.031
+to 0.464 (median 0.186). The three flicker warnings and one low-detail warning in the whole
+graphics corpus came from `opengl_python`, not from shaders. So clearing the gate proves
+nothing. What is actually low is the judge: over 18 judged rounds the weakest criteria are
+`technical_cleanliness` 0.597, `originality` 0.600, `colour_light` 0.606 and
+`visual_richness` 0.619 — and `visual_richness` carries the largest weight of the four
+(0.18) in `shader_v1`.
+
+One more measured hint, and it is only a hint at this n: across those 9 runs the rank
+correlation between the harness's **colourfulness** metric and the final score is **+0.75**,
+while edge density manages only +0.40 and frame-to-frame motion +0.20. With n = 9 that is
+not a law, but it says the palette is worth more attention than another fbm octave. The
+best-scoring run (0.92) is also the most colourful and the most detailed; the worst (0.30)
+is the flattest and greyest of the nine.
+
+The four rules below are aimed at exactly those four criteria.
+
+## 1. Structure at several scales, or it aliases
+
+`visual_richness` asks for "structure at several scales", and `technical_cleanliness`
+penalises aliasing and banding. In this corpus those are the *same* mistake seen twice — a
+recorded major issue reads: *the wall displacement is uniform high-frequency noise rather
+than multi-scale fractal relief, causing severe aliasing.* One octave at one frequency is
+both flat (no scales) and shimmery (nothing filters it).
+
+* Build relief as fbm and let the amplitude fall with the distance the pixel represents:
+ drop octaves as `1/(1 + k*t)` where `t` is the ray distance or the screen-space scale.
+* Anti-alias every edge with a width, not a step: `smoothstep(-w, w, d)` with
+ `w = 1.5 / u_resolution.y`, scaled by the local derivative if the feature is in
+ perspective.
+* Raymarchers: grow the hit tolerance with distance (`eps = max(4e-4, 1.5e-3 * t)`) and take
+ the normal with the same epsilon. The lowest-scoring run of the nine (0.30) was graded with
+ a *critical* bug for "bright cyan/white pixels along the edges of all geometry at grazing
+ angles" — that is a tangential overshoot feeding a central-difference normal.
+* Grade with a palette function, not a `mix` of two constants, and dither the last step
+ (`col += (hash12(fragCoord) - 0.5) / 255.0`) — banding in a large gradient is a named
+ `technical_cleanliness` deduction and one line removes it.
+
+## 2. Structure runs across the flow, not along it
+
+Water, wood, marble, cloth and stone all read wrong when the pattern is stretched *along*
+the direction of movement, because that is what a scrolling texture looks like. Warp the
+domain perpendicular to the flow and advect only the phase:
+
+```glsl
+vec2 flow = normalize(vec2(1.0, 0.35));
+vec2 across = vec2(-flow.y, flow.x);
+float band = fbm(p * vec2(2.0, 9.0) * mat2(across, flow) - flow * u_time * 0.6);
+```
+
+The high-frequency axis is the one across the flow. This is the difference between "a
+surface moving" and "a texture sliding", and it costs nothing.
+
+## 3. Motion comes from the mechanism
+
+`motion_quality` grades "the way the brief says … continuous, paced and plausible", and the
+frames it compares are 1 to 2 seconds apart. A single `uv + u_time * k` scroll gives the
+same delta everywhere and reads as a conveyor belt.
+
+* Drive each element from its own quantity: a drop falls with `t*t`, a flame's tips lag its
+ base, a pendulum is `sin`, a spark is a hash-seeded lifetime.
+* Give every instance a phase from its id, `hash12(id) * 6.2831`, or the whole field pulses
+ in lockstep and t = 0 is a suspiciously symmetric frame.
+* Keep it continuous. `fract()` and `mod()` of `u_time` are cuts; wrap through a smooth
+ function or cross-fade the wrap. A cut between two sampled times is the `flicker` warning
+ and a `technical_cleanliness` deduction.
+* Nothing may depend on `u_frame` alone: the sampled times are not evenly spaced.
+
+## 4. Light is a path through a volume, not a falloff around a point
+
+The sharpest recorded effect complaint in this corpus is: *distinct volumetric light shafts
+are missing; the lighting appears as a diffuse, uniform spherical glow rather than
+directional rays.* That is exactly what `col += A * exp(-k * dist)` produces — a radially
+symmetric blob, because the term has no direction and no occluder in it.
+
+A shaft is the integral of scattering along the view ray, so march the ray and, at each
+step, weight by the phase angle to the light and by whether that point is shadowed:
+
+```glsl
+float shaft = 0.0, t = 0.0;
+for (int i = 0; i < 48; i++) {
+ vec3 pos = ro + rd * t;
+ float vis = step(0.0, sdScene(pos + lightDir * 0.35)); // cheap occlusion probe
+ float phase = 0.6 + 0.4 * pow(max(dot(rd, lightDir), 0.0), 8.0);
+ shaft += vis * phase * exp(-0.08 * t);
+ t += 0.12;
+}
+col += lightCol * shaft * 0.02;
+```
+
+The same principle covers the other "reads as the thing" cases: a lit cloud is brighter
+where the shell is *thin toward the light* (sample the density a short step toward the sun
+and take the difference), and a glass or water surface is a dielectric — a Fresnel-weighted
+reflection plus a tinted transmission, never a metallic tint.
+
+## The three uniforms worth designing around
+
+The contract declares them; what they are *for* is the craft:
+
+* `u_noise` — a 256x256 repeating RGBA noise texture with linear filtering. One `texture()`
+ fetch replaces a hash and interpolation, so an fbm built on it is several times cheaper
+ and lets you afford more octaves. Scale the uv, do not scale the result.
+* `u_prev` — this pass's previous frame. Trails, motion blur and accumulation, always with
+ a decay under 1.0 and preferably a sub-pixel drift, or it saturates by t = 6 s.
+* `u_buffer_a` — a whole extra pass. Use it when the effect *is* a simulation (advection,
+ reaction-diffusion, a height field): simulate in `buffer_a.frag`, shade in `shader.frag`.
+ **No graded glsl run in this corpus used it (0 of 9)**, while **all five** critical effect
+ failures recorded in the sibling opengl_python runs are simulations with nowhere to keep
+ their state.
+
+## Before you finish
+
+`gl_probe` compiles and shows frame 0; `gl_frames` renders all five judged times and prints
+mean luminance, colourfulness, edge density and the per-pair deltas. Look at the contact
+sheet, then read the numbers: a mean delta near the bottom of the 0.013-0.182 band with a
+brief that promised motion means the motion is there but invisible.
+
+Worked snippets — fbm with distance-faded octaves, the flow-aligned warp, hash-phased
+instances and the dither — are in `references/shader-recipes.md`.
diff --git a/harness/codeverse/skills/cv3d-glsl-craft/references/shader-recipes.md b/harness/codeverse/skills/cv3d-glsl-craft/references/shader-recipes.md
new file mode 100644
index 00000000..a34d635c
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-glsl-craft/references/shader-recipes.md
@@ -0,0 +1,151 @@
+# Shader recipes
+
+Companion to `cv3d-glsl-craft`. Every snippet below was composed with the harness's own
+`codeverse.languages.glsl_shader.wrap.compose`, compiled on moderngl 5.12 / OpenGL 3.3 core
+and linted with `lint_text` on 2026-08-25: **compiles clean, zero lint findings**. Drop the
+helpers into `src/common.glsl` and call them from `src/shader.frag`.
+
+Assumed present (write them once in `common.glsl`):
+
+```glsl
+float hash12(vec2 p){ vec3 p3=fract(vec3(p.xyx)*0.1031); p3+=dot(p3,p3.yzx+33.33); return fract((p3.x+p3.y)*p3.z); }
+float vnoise(vec2 p){ vec2 i=floor(p), f=fract(p); vec2 u=f*f*(3.0-2.0*f);
+ return mix(mix(hash12(i), hash12(i+vec2(1,0)), u.x),
+ mix(hash12(i+vec2(0,1)), hash12(i+vec2(1,1)), u.x), u.y); }
+```
+
+Cheaper alternative for the base noise: `texture(u_noise, p * 0.004).r`. The harness's
+`u_noise` is a 256x256 repeating RGBA texture with linear filtering, so one fetch buys you a
+bilinear-interpolated hash and lets you afford two more octaves.
+
+## 1. fbm whose fine octaves fade with distance
+
+The fix for "uniform high-frequency noise causing severe aliasing". Pass the ray distance
+(raymarch) or the screen-space footprint (2D); far pixels get the low octaves only.
+
+```glsl
+float fbmFade(vec2 p, float dist){
+ float v = 0.0, a = 0.5, w = 1.0;
+ for (int i = 0; i < 6; i++) {
+ float fade = 1.0 / (1.0 + 0.35 * dist * float(i));
+ v += a * fade * vnoise(p); w += a * fade;
+ p = p * 2.03 + 0.31; a *= 0.5;
+ }
+ return v / max(w, 1e-4);
+}
+```
+
+Normalising by the accumulated weight keeps the mean brightness constant as octaves drop
+out, so the horizon does not darken.
+
+## 2. Structure across the flow
+
+```glsl
+float acrossFlow(vec2 p, vec2 flow, float t){
+ vec2 across = vec2(-flow.y, flow.x);
+ mat2 basis = mat2(across, flow); // column 0 = across, column 1 = along
+ return fbmFade((p * vec2(2.0, 9.0)) * basis - flow * t * 0.6, 0.0);
+}
+```
+
+`vec2(2.0, 9.0)` is the anisotropy: fine detail across, stretched along. Swap the two and
+the same code reads as a sliding texture instead of a moving surface. Wood grain, brushed
+metal, water and cloth are all this function with a different pair of numbers.
+
+## 3. Instances with their own phase and lifetime
+
+```glsl
+float sparks(vec2 p, float t){
+ float acc = 0.0;
+ for (int i = 0; i < 24; i++) {
+ float id = float(i);
+ float ph = hash12(vec2(id, 7.0)) * 6.2831;
+ float life = fract(t * 0.4 + hash12(vec2(id, 3.0))); // each starts at its own point
+ vec2 c = vec2(cos(ph), sin(ph)) * (0.15 + 0.35 * life);
+ acc += smoothstep(0.02, 0.0, length(p - c)) * (1.0 - life);
+ }
+ return acc;
+}
+```
+
+Two things make it read: the per-id phase (so t = 0 is not a symmetric ring) and the
+`(1.0 - life)` fade, which hides the `fract` wrap. A wrap you can see is the `flicker`
+warning waiting to happen.
+
+## 4. A light shaft is a marched integral
+
+```glsl
+float shaft(vec3 ro, vec3 rd, vec3 lightDir){
+ float s = 0.0, t = 0.0;
+ for (int i = 0; i < 48; i++) {
+ vec3 pos = ro + rd * t;
+ float vis = step(0.0, sdScene(pos + lightDir * 0.35)); // is this point lit?
+ float phase = 0.6 + 0.4 * pow(max(dot(rd, lightDir), 0.0), 8.0);
+ s += vis * phase * exp(-0.08 * t);
+ t += 0.12;
+ }
+ return s;
+}
+```
+
+`phase` is what makes the shaft directional — it peaks when you look toward the light — and
+`vis` is what makes it a *shaft* rather than a haze, because the beam is bright only where
+nothing occludes it. Replace `sdScene` with your own distance field, or with a shadow test
+against whatever is casting.
+
+The lit-cloud variant of the same idea: sample your density once at the point and once a
+short step toward the light, and light the difference.
+
+```glsl
+float dens = cloud(pos);
+float lit = cloud(pos + lightDir * 0.08);
+vec3 col = mix(SHADOW_COL, LIT_COL, clamp(0.9 - 3.0 * (lit - dens), 0.0, 1.0));
+```
+
+Thin toward the light means bright: that is the physical rule, and it is why a cloud lit
+this way has a silver edge and a flat `exp()` glow does not.
+
+## 5. The artifact that cost the worst run in this corpus
+
+The lowest-scoring glsl run (0.30 of 1.0) was graded with a **critical** bug: *severe
+raymarching artifacts (bright cyan/white pixels) along the edges of all geometry,
+particularly at grazing angles*. That is the march overshooting a surface it hits almost
+tangentially, so the central-difference normal is taken across the discontinuity and the
+shading term explodes. Three changes remove it:
+
+```glsl
+float eps = max(0.0004, 0.0015 * t); // hit tolerance grows with distance
+t += max(d * 0.85, eps); // relax the step; never step by the raw distance
+vec3 n = normalize(vec3(sdScene(pos + e.xyy) - sdScene(pos - e.xyy),
+ sdScene(pos + e.yxy) - sdScene(pos - e.yxy),
+ sdScene(pos + e.yyx) - sdScene(pos - e.yyx))); // e = vec2(eps, 0)
+```
+
+Use the *same* `eps` for the hit test and for the normal offset, and clamp the final colour.
+The same run also scored the lowest colourfulness of the nine (0.050) and was described as
+"washed-out, monochromatic greyish" — the two defects together are most of the 0.30.
+
+## 6. Two one-liners that move `technical_cleanliness`
+
+```glsl
+float w = 1.5 / u_resolution.y; // one pixel, in the centred p space
+float edge = smoothstep(-w, w, d); // never step(0.0, d)
+col += (hash12(fragCoord) - 0.5) / 255.0; // dither, kills gradient banding
+```
+
+Tone-map once, at the very end (`col = col / (1.0 + col)`), and never twice. Accumulated
+glow and bokeh sums blow past 1.0 quickly, and a blown frame is an ERROR.
+
+## 7. When to reach for `buffer_a.frag`
+
+Use the second pass when the effect **is** a simulation whose state must persist: advection,
+reaction-diffusion, a wave height field, a particle field with collisions. `buffer_a.frag`
+reads its own previous frame as `u_prev` and its four neighbours at `uv +- 1.0/u_resolution`;
+`shader.frag` then reads the result as `u_buffer_a` and only colours it.
+
+Zero of the 9 graded glsl runs in this corpus used it. In the sibling `opengl_python` runs,
+which have the same feedback mechanism, all five recorded critical effect issues are
+simulations that produced "expanding rings with empty interiors" or "high-frequency noise,
+black speckles and aliasing instead of smooth fluid filaments" — a simulation whose state
+does not persist between frames cannot advect anything. If the brief says "swirling ink",
+"advection" or "reaction diffusion", the state belongs in `buffer_a.frag`.
diff --git a/harness/codeverse/skills/cv3d-part-contact/SKILL.md b/harness/codeverse/skills/cv3d-part-contact/SKILL.md
new file mode 100644
index 00000000..c497d557
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-part-contact/SKILL.md
@@ -0,0 +1,135 @@
+---
+name: cv3d-part-contact
+description: How multi-part objects must touch in this harness — the contact, weld-overlap, penetration and stray-island numbers the connectivity gate actually measures, and how to add detail without creating new contact pairs. Use when writing or fixing the geometry of an object with two or more parts (static_object or articulated_object, any language), before the first build, and on every repair round where a connectivity or joint_sweep finding fired.
+license: Apache-2.0
+compatibility: Object tracks only (static_object, articulated_object). Needs the connectivity gate, i.e. an exported object.glb; scene and graphics tracks have no part graph.
+metadata:
+ evidence: measured
+ verified: "2026-08-25"
+ corpus: "142 graded runs with gate artefacts (102 blender, 23 urdf_blender), mined 2026-08-25"
+---
+
+# Parts that touch
+
+**Read this if** your plan has two or more parts and you are about to write, move or resize
+any of them. It is the one defect class that costs the most score here and the one that
+repair rounds are worst at removing.
+
+## Why this is the first thing to get right
+
+Measured on the 102 graded blender runs that have a connectivity report (mined 2026-08-25):
+
+| | first gated round | last gated round |
+|---|---|---|
+| runs with interpenetrating parts | 88 (86%) | **67 (66%)** |
+| runs with a floating part | 10 (10%) | 3 (3%) |
+| runs with tiny stray islands | 56 (55%) | 52 (51%) |
+
+Floating parts get fixed, because they are ERRORs. Interpenetration and crumbs mostly do
+not: three quarters of the runs that started buried shipped buried. And it is expensive —
+`docs/COMPLEXITY.md` section 6, over 160 recorded rounds with both a score and a
+connectivity report, mean `assembly_fit` falls 0.709 (nothing buried) to 0.505 (a part more
+than half buried), and the plain **count of penetrating pairs** is the strongest single
+predictor of that criterion (r = -0.258). `assembly_fit` is already the lowest-scoring
+criterion in blender (mean 0.60 over 246 judged rounds, 102 runs).
+
+So: fewer pairs in contact, and each contact within the band below.
+
+## The band — every number is a live constant
+
+`codeverse/spatial/connectivity.py` + `codeverse/conventions.py`:
+
+| what | constant | value | consequence |
+|---|---|---|---|
+| two parts count as touching | `CONTACT_GAP_M` | surface distance ≤ **2 mm** | further apart = no edge in the contact graph |
+| overlap that is still a weld | `PENETRATION_WARN_M` | depth ≤ **2 mm** | above it: WARN "interpenetrate by ~N mm" |
+| overlap that is a defect | `PENETRATION_ERROR_M` | depth > **10 mm** | ERROR, and the judge rubric caps the run at **0.70** |
+| how much has to be inside | `PENETRATION_MIN_FRACTION` | **2%** of surface samples | below it nothing is reported at any depth |
+| samples per part | `N_SAMPLES` | 600 | the depth you see is the deepest sampled point |
+| a part too small to check | `MIN_PART_SIZE_M` | largest extent < **10 mm** | skipped for contact, penetration and islands (INFO only) |
+| a crumb inside one part | `TINY_ISLAND_FRACTION` | island extent < **5%** of the part's largest extent | WARN "stray geometry" |
+
+**The whole legal window for a joint is 2 mm of gap to 2 mm of overlap.** Aim for
+**0.5-1.5 mm of overlap** and you are inside it with margin on both sides. Two traps follow
+directly:
+
+* Do not "fix" an interpenetration WARN by pulling the parts apart. Past 2 mm of gap the
+ contact edge disappears and the part can drop out of the support component — a WARN
+ becomes an ERROR that caps the run at 0.60.
+* Do not use a fat weld. Measured by running the gate's own `penetration_depth` on the
+ stool geometry the blender contract's example builds — a rod driven into a seat disc:
+
+ | weld overlap | reported depth | fraction inside | gate |
+ |---|---|---|---|
+ | 4.0 mm | 4.00 mm | 2.8% | **WARN** |
+ | 2.0 mm | 2.00 mm | 2.7% | **WARN** (right on the line) |
+ | 1.0 mm | 1.00 mm | 2.5% | clean |
+ | 0.5 mm | 0.50 mm | 2.3% | clean |
+
+## Floating parts: never guess the fix
+
+A part outside the *support component* (the ground-touching component with the most faces)
+is always an ERROR, and the finding already contains the answer:
+
+```
+ERROR part 'door_leaf' is floating: nearest supported part is 'frame' at 4.0 mm
+ fix: translate 'door_leaf' by (0.0000, -0.0040, 0.0000) m -- or extend it by
+ 4.0 mm towards 'frame' -- so the surfaces touch
+```
+
+The vector is converted into **your** authoring frame before it is printed, and the
+alternative ("extend it by N mm") is usually the better one: translating a leg leaves a gap
+at its other end. Apply one of the two literally. Do not eyeball a new position.
+
+## Plan the contacts before you write code
+
+For every part with `attach_to` set, write one line first:
+
+ <part> meets <neighbour> on <which face/axis>, at <coordinate>, overlap 1 mm
+
+Then derive the part's span **from the neighbour's plan bbox**, never from a re-typed
+number: a leg's top is `seat.bbox.min.z + 0.001`, not `0.451`. Any hand-typed span is a
+future contract finding as soon as the neighbour moves. (`cv3d-bbox-contract` owns the
+tolerance arithmetic; this skill only says where the number comes from.)
+
+## Detail belongs INSIDE a part, not as more parts
+
+N top-level parts create N(N-1)/2 candidate contact pairs, and the count of penetrating
+pairs is what predicts the score. Sub-shapes inside one part create **none**.
+
+`PartPlan.children` is exactly this device — the docstring says sub-parts of an assembly
+part are "still ONE named object in the export" — and `spatial/measure.py::part_meshes`
+backs it up: a part is an effective top-level node and *its whole subtree is merged* into
+one mesh before any pairwise test runs. Verified on Blender 5.0.1: three disjoint sub-shapes built
+into one mesh named `Housing` export as a single part.
+
+**But fusing is not optional.** Islands are split by *face connectivity*, not by overlap —
+verified against the gate: a rivet placed so it geometrically overlaps a panel, without shared
+topology, is still a separate island. So a sub-shape must be either
+
+* **welded into the body** — one boolean UNION, or an array / mirror / screw result (those
+ are one object by construction), or built into the same `bmesh`; or
+* **at least 5% of the part's largest extent**, which is what `TINY_ISLAND_FRACTION` asks.
+ On a 1.0 m panel that is 50 mm: a 15 mm rivet dropped in loose is a stray-island WARN.
+
+## Where crumbs actually come from
+
+* **A cutter object left in the scene.** Verified on Blender 5.0.1: the exporter selects every
+ visible mesh, so an un-hidden boolean cutter exports as its own part — with its own
+ interpenetration and its own floating ERROR. Apply the boolean and delete the cutter, or
+ set `hide_render` / `hide_viewport` / `hide_set(True)` on it; all three keep it out of the
+ export and the boolean still evaluates.
+* Boolean leftovers and slivers — use the EXACT or MANIFOLD solver, never FLOAT/FAST.
+* A mirrored half that was never merged, and zero-thickness or coincident faces.
+
+## Verify with the gate, do not re-implement it
+
+Call `check_connectivity` (no arguments — it reads your workspace and answers in your
+authoring frame). It runs an fcl exact-distance contact graph, a per-island parity
+containment test and the island split. A hand-written centroid or bounding-box check in
+your own build script is strictly weaker and will disagree with the gate that scores you.
+Then `check_contract`, then rebuild. Do not finish on a run whose last
+`check_connectivity` still lists an ERROR.
+
+Worked recipes (bpy, CadQuery, URDF) and the full finding-to-fix table are in
+`references/contact-recipes.md`.
diff --git a/harness/codeverse/skills/cv3d-part-contact/references/contact-recipes.md b/harness/codeverse/skills/cv3d-part-contact/references/contact-recipes.md
new file mode 100644
index 00000000..77494ce8
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-part-contact/references/contact-recipes.md
@@ -0,0 +1,113 @@
+# Contact recipes and the finding-to-fix table
+
+Companion to `cv3d-part-contact`. Everything here was checked against
+`codeverse/spatial/connectivity.py`, `codeverse/spatial/measure.py`, the Blender 5.0.1
+wrapper in `codeverse/languages/blender/wrappers/run_bpy.py`, and the recorded gate
+findings under `bench/out/**/artifacts/gates/**` (mined 2026-08-25).
+
+## 1. Finding to fix
+
+| finding (verbatim shape) | severity | what it means | do this |
+|---|---|---|---|
+| `'A' and 'B' interpenetrate by ~N mm (F% of surface samples inside)` | WARN below 10 mm, ERROR above | the deepest sampled point of one part is N mm inside the other, and at least 2% of one part's surface samples are inside | shorten or move the *smaller* part so the overlap is 0.5-1.5 mm; if N is large the two parts are modelling the same volume twice, so delete one |
+| `part 'X' is floating: nearest supported part is 'Y' at N mm` | always ERROR (cap 0.60) | X is not in the ground-touching component | apply the printed translation, or extend X by N mm toward Y; prefer extending |
+| `part 'X' is floating: touches nothing` | ERROR | X shares no AABB neighbourhood with anything | it is in the wrong place by more than its own size — recompute its origin from its neighbour's plan bbox |
+| `no part touches the ground (z=0)` | WARN | the whole model is off the floor | move the assembly, not one part |
+| `part 'X' contains N tiny disconnected island(s) (< 5% of the part size)` | WARN | N loose shells inside one part's mesh | union them into the body, grow them past 5% of the part's largest extent, or delete them (usually boolean debris) |
+| `part 'X' is tiny (N mm) - skipped for contact checks` | INFO | largest extent under 10 mm | not a defect; be aware this part is invisible to the contact graph, so it can neither support nor be reported as floating |
+
+Recorded example depths, all real (`bench/out`, mined 2026-08-25): the median reported
+interpenetration is **5.0 mm** over 1,088 findings, and **86%** of them are under the 10 mm
+ERROR line — i.e. the typical failure is a WARN that nobody fixed, not a catastrophe.
+
+## 2. bpy: derive the span, weld 1 mm
+
+```python
+SEAT_Z, SEAT_T = 0.45, 0.04 # from plan.parts["Seat"].bbox
+WELD = 0.001 # 1 mm: inside CONTACT_GAP_M, under PENETRATION_WARN_M
+LEG_H = SEAT_Z - SEAT_T + WELD # reaches 1 mm into the seat -- NOT a re-typed 0.411
+```
+
+The point is `SEAT_Z - SEAT_T`: when the seat moves in a later round the leg follows. A
+literal `0.411` is a `contract/part_bbox` finding waiting to happen.
+
+## 3. bpy: three sub-shapes, ONE part
+
+Verified on Blender 5.0.1: this exports as a single node `Housing`, so no pair-wise
+penetration test can ever run inside it.
+
+```python
+import bpy, bmesh
+from mathutils import Matrix
+
+bm = bmesh.new()
+bmesh.ops.create_cube(bm, size=0.2, matrix=Matrix.Translation((0, 0, 0.1)))
+bmesh.ops.create_cone(bm, cap_ends=True, segments=24, radius1=0.03, radius2=0.03,
+ depth=0.25, matrix=Matrix.Translation((0.06, 0, 0.30)))
+bmesh.ops.create_uvsphere(bm, u_segments=16, v_segments=8, radius=0.04,
+ matrix=Matrix.Translation((-0.06, 0, 0.30)))
+me = bpy.data.meshes.new("Housing"); bm.to_mesh(me); bm.free()
+housing = bpy.data.objects.new("Housing", me)
+bpy.context.scene.collection.objects.link(housing)
+```
+
+The three shapes are still three *islands* of that one mesh. That is fine here because each
+is well over 5% of the part's largest extent (0.425 m, so the cutoff is 21 mm). Drop a 15 mm
+boss in the same way and you buy a stray-island WARN — fuse it instead (section 4).
+
+## 4. bpy: fuse small detail, and never leave the cutter
+
+```python
+def fuse(obj, other):
+ """other becomes part of obj's mesh: one island, no stray-island warning."""
+ m = obj.modifiers.new("Union", 'BOOLEAN'); m.operation = 'UNION'; m.object = other
+ m.solver = 'EXACT'
+ with bpy.context.temp_override(object=obj, active_object=obj, selected_objects=[obj]):
+ bpy.ops.object.modifier_apply(modifier=m.name)
+ bpy.data.objects.remove(other, do_unlink=True)
+```
+
+For a DIFFERENCE the same shape applies. If you would rather leave the modifier for the
+exporter to evaluate (it exports with `export_apply=True`, so unapplied modifiers are
+applied at export), you must hide the cutter or it ships as its own part:
+
+```python
+cutter.hide_render = True # any of hide_render / hide_viewport / hide_set(True)
+cutter.hide_viewport = True # keeps it out of the export; the boolean still evaluates
+```
+
+Verified on Blender 5.0.1 with the harness's exact export call: with no flag set, the GLB
+came back with two parts (`Base`, `Cutter`); with any one flag set it came back with one,
+and the notch was still cut.
+
+## 5. CadQuery
+
+Not corpus-backed — this language has **zero graded bench runs**; the rules below are read
+off `codeverse/prompts/cadquery/cookbook.md` and the same gate constants.
+
+* One `Workplane` result per plan part, and `len(result.solids().vals()) == 1` after every
+ cut: a cut that splits a part into two solids is exactly the stray-island WARN in advance.
+* Weld with `.union(other).clean()` — `clean()` merges the coplanar faces so the result is
+ one solid, not two touching ones.
+* Cutters must overshoot the face they pierce (the cookbook says >= 0.1 mm; coplanar faces
+ make the boolean fail silently), but the *part-to-part* overlap still has to land in the
+ 0.5-1.5 mm band.
+
+## 6. URDF (articulated_object)
+
+`check_connectivity` runs on the rest pose (q = 0) exactly as above, over the link meshes.
+Clearance across the joint *sweep* is a different gate (`joint_sweep`) and belongs to
+`cv3d-urdf-joints`; a rest pose that is already 5 mm overlapped will fail both. Recorded
+`joint_sweep` overlaps in this corpus run 3-5 mm already at the rest pose and reach 20 mm at
+a joint limit, which is the signature of a hinge whose two links were welded like static
+parts instead of being given running clearance.
+
+## 7. The loop
+
+```
+build -> check_connectivity -> fix the ERRORs, then the deepest WARN -> build
+```
+
+`check_connectivity` takes no arguments and answers in your authoring frame. `isolate` the
+part you doubt and `cross_section` through it when a finding does not make sense. Never
+finish a round on an ERROR.
diff --git a/harness/codeverse/skills/cv3d-scene-composition/SKILL.md b/harness/codeverse/skills/cv3d-scene-composition/SKILL.md
new file mode 100644
index 00000000..30627561
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-scene-composition/SKILL.md
@@ -0,0 +1,129 @@
+---
+name: cv3d-scene-composition
+description: Lay out a three.js scene so the harness's deterministic instruments agree with the picture — one height function everything samples, a world that does not end in shot, and cameras computed from measured bounds instead of guessed. Includes the sky/ground/content classifier that silently decides two gate findings, and the exact scene_frames thresholds and score caps for camera placement and frame coverage. Use in any scene_threejs session that owns the environment, a zone's placement, or the camera list, and on any repair round where scene_frames reported a camera problem.
+license: Apache-2.0
+compatibility: track scene, language scene_threejs (three r182, headless Chrome, the harness builds the cameras from your plain camera objects).
+metadata:
+ evidence: mixed
+ evidence_note: "Gate thresholds, score caps and the backdrop classifier are read from live code (spatial/frame_metrics.py, judges/rubrics/scene_v1.yaml, runtime_js/lib/backdrop.mjs, runtime_js/lib/scene_host.mjs). The corpus behind them is thin: only 3 graded scene runs exist, so every count below names its n."
+ verified: "2026-08-25"
+ corpus: "3 graded scene_threejs runs with gate artefacts, mined 2026-08-25"
+---
+
+# Composing a scene the instruments can read
+
+**Read this if** you are writing `env.js`, placing a zone, or returning the `cameras`
+array. Two of the three graded scene runs in this corpus carry a composition issue and it is
+the same one in both — a visible world edge — and one of those two also placed three
+authored cameras below the ground. Both failures are arithmetic, not taste.
+
+## Build in this order
+
+1. **Bounds** — read `BOUNDS` from the plan. Everything below is derived from its
+ horizontal diagonal `diag`.
+2. **One height function.** `heightAt(x, z)` in `env.js` is the only terrain authority.
+ The ground mesh samples it, every zone samples it, every camera samples it. A zone that
+ invents its own ground level is how props end up buried and cameras end up underground.
+3. **Ground**, then **horizon**, then zones, then cameras. Cameras last, because they are
+ computed from what exists.
+
+## The classifier nobody tells you about
+
+`runtime_js/lib/backdrop.mjs` sorts every drawable into **sky / ground / content** from its
+*name* and its *world box shape*, and that classification decides `content_frac` (the
+coverage gate) and `ground_y` (the camera-height gate). The rules, in order:
+
+| rule | class |
+|---|---|
+| name matches sky, skydome, skybox, stars, clouds, sun, moon, atmosphere **and** span > 50 m | sky |
+| span > 2000 m, or height > 300 m with span > 300 m | sky |
+| any `InstancedMesh` | **content** (always) |
+| name matches ground, terrain, floor, water, ocean, sea, lake, river, plane, sand, grass, land **and** span > 20 m and height < 6% of span | ground |
+| span > 40 m and height < 2% of span (any name) | ground |
+| everything else | content |
+
+Three consequences you must design around:
+
+* **A wide flat slab is ground whatever you call it.** A 50 m plaza deck or a big pond is
+ classified ground, so it stops counting as content, and its *top* raises `ground_y`.
+* **`ground_y` is the top of every ground mesh unioned**, so a raised terrace or a hill sets
+ the floor that camera heights are checked against. In this corpus a garden reported
+ `ground_y = 6.21 m` and three authored cameras placed at absolute eye height came back as
+ `camera is 1.0 / 4.6 / 4.8 m below the ground level` — three ERRORs in one run.
+* **Instanced scatter always counts as content.** The cheapest way to lift a thin
+ establishing shot over the 20% content floor is more instanced planting and props, not a
+ bigger ground plane (which counts against you).
+
+## Cameras are measured, and the numbers are hard
+
+`codeverse/spatial/frame_metrics.py` runs on the authored cameras, where every finding is an
+**ERROR** (the harness's own orbit rig only gets WARNs). `judges/rubrics/scene_v1.yaml`
+turns those ERRORs into score ceilings:
+
+| condition | constant | finding | cap on the run |
+|---|---|---|---|
+| nearest surface < 0.5 m, or the camera is inside a mesh box | `NEAR_HIT_M` | `camera inside / touching geometry` | **0.50** |
+| eye below ground and the frame corroborates it (dark, empty or one-colour) | — | `camera_underground` | **0.50** |
+| establishing shot with content < 20% of the pixels | `CONTENT_MIN_ESTABLISHING` | `establishing shot shows too little content` | **0.60** |
+| any authored shot with content < 10% | `CONTENT_MIN_AUTHORED` | `shot shows little content` | WARN |
+| eye less than 0.3 m above ground | `EYE_MIN_ABOVE_GROUND_M` | `ant's-eye view` | WARN |
+| eye more than 80 m above ground | `EYE_MAX_ABOVE_GROUND_M` | `satellite view, not a shot` | WARN |
+| one luminance band holds > 85% of the frame | `FLAT_MODAL_FRAC` | `flat frame` | WARN, ERROR and **0.65** past 92% |
+
+So compute, never guess:
+
+```js
+const y = heightAt(x, z) + 1.6; // human shot: terrain FIRST, then eye height
+const d = Math.max(size.x, size.z); // measured content span, sky dome excluded
+const establishing = { name: 'Establishing', fov: 42,
+ position: [c.x + d * 0.55, size.y * 1.1 + 6, c.z + d * 0.6], lookAt: [c.x, 2, c.z] };
+```
+
+Two notes that save a wasted repair round:
+
+* `camera is N m below the scene's highest ground surface` is downgraded to a **WARN** when
+ the frame itself renders fine — that usually means a hill or a raised bed reaches above a
+ camera standing in the open, not a buried camera. Check the frame before you move it.
+* Do **not** set `near` or `far`. `runtime_js/lib/scene_host.mjs` computes
+ `far = max(1000, farthest scene-bbox corner * 1.25 + 10)` from the *whole* scene, so a
+ distant horizon ring or sky dome is never clipped.
+
+## The world must not end in shot
+
+This is the most repeated judge complaint on the track and **no gate catches it** — all 4
+composition issues recorded across the 3 graded scene runs (2 major, 2 minor, mined
+2026-08-25) are the same sentence: *a hard world edge is visible where the ground plane ends
+and meets the sky*. The arithmetic that kills it, all derived from `diag`:
+
+```
+fogScale = clamp(diag / 100, 0.3, 2.5) // the cookbook's fog table is for 100 m
+fogFar = fogScale * (the time-of-day row's far)
+groundSize >= 2.4 * fogFar // ground reaches past the fog
+ringRadius = max(0.6 * fogFar, 2 * (diag / 2)) // silhouette ring, 24-40 solid shapes
+skyRadius > ringRadius // the dome has to contain the ring
+fog colour == the sky's horizon colour // or the ground ends AT the sky, not IN it
+```
+
+Solid shapes, never plane billboards, and never hand-tint the ring toward the fog colour —
+`scene.fog` already does that by distance, and doing it twice produces the pale cardboard
+the judge grades as a placeholder material. Code: `read_cookbook(section="Horizon: the world
+must not end")` and `read_cookbook(section="Atmosphere: time-of-day triads with numbers")`
+for the fog row.
+
+## What you have already been given, and what you have not
+
+`env` sessions receive the *Ground that reads real*, *Horizon*, *Atmosphere* and *Dusk /
+night lighting* chapters inlined in the prompt. **Zone, compose and refine sessions do
+not** — if you own a zone or the camera list, this skill plus `read_cookbook` is the whole
+of your guidance on the horizon and on camera placement.
+
+## Verify before you finish
+
+`scene_views` renders the authored cameras and prints `camera_checks` per camera —
+`mean_lum`, `modal_frac`, `content_frac`, `nearest_hit_m`, `eye_height_m`, `ground_y`. Read
+those six numbers against the table above rather than judging the thumbnails by eye, and
+`scene_probe` for triangles, draw calls and fps. A camera that fails the table fails it
+deterministically; there is nothing to argue with.
+
+Worked derivations — bounds to fog to ring to the three cameras, and the coverage-repair
+checklist — are in `references/measured-cameras.md`.
diff --git a/harness/codeverse/skills/cv3d-scene-composition/references/measured-cameras.md b/harness/codeverse/skills/cv3d-scene-composition/references/measured-cameras.md
new file mode 100644
index 00000000..65f3f638
--- /dev/null
+++ b/harness/codeverse/skills/cv3d-scene-composition/references/measured-cameras.md
@@ -0,0 +1,83 @@
+# From bounds to cameras, by arithmetic
+
+Companion to `cv3d-scene-composition`. Constants read from
+`codeverse/spatial/frame_metrics.py`, `codeverse/judges/rubrics/scene_v1.yaml`,
+`runtime_js/lib/backdrop.mjs`, `runtime_js/lib/host_census.mjs` and
+`runtime_js/lib/scene_host.mjs` on 2026-08-25.
+
+## 1. One derivation, top to bottom
+
+```js
+import { BOUNDS, heightAt } from './env.js';
+
+const span = [BOUNDS.max[0] - BOUNDS.min[0], BOUNDS.max[2] - BOUNDS.min[2]];
+const diag = Math.hypot(span[0], span[1]); // horizontal diagonal of the plan bounds
+const fogSc = Math.min(2.5, Math.max(0.3, diag / 100)); // the cookbook fog table is for 100 m
+const fogFar = FOG_FAR_FOR_TIME_OF_DAY * fogSc; // e.g. dusk = 140 * fogSc
+const ground = 2.4 * fogFar; // ground plane side length, minimum
+const ringR = Math.max(0.6 * fogFar, diag); // silhouette ring radius (2 x half-diagonal)
+const skyR = ringR * 1.35; // the dome must contain the ring
+```
+
+A 45 m garden at dusk: `fogSc = 0.45`, `fogFar = 63 m`, ground >= 151 m, ring at 38 m, dome
+at 51 m. A 240 m valley at noon: `fogSc = 2.4`, `fogFar = 528 m`, ground >= 1267 m, ring at
+317 m. Those are the numbers; do not carry the 100 m table across unscaled.
+
+## 2. The three cameras, computed
+
+```js
+function planCameras(THREE, scene, heightAt, hero /* {x, z} of the hero prop */) {
+ const box = new THREE.Box3();
+ scene.traverse(o => { if (o.isMesh && !/sky|dome|horizon/i.test(o.name)) box.expandByObject(o); });
+ const size = box.getSize(new THREE.Vector3()), c = box.getCenter(new THREE.Vector3());
+ const d = Math.max(size.x, size.z);
+ const eye = (x, z) => heightAt(x, z) + 1.6;
+ return [
+ { name: 'Establishing', fov: 42,
+ position: [c.x + d * 0.55, size.y * 1.1 + 6, c.z + d * 0.6], lookAt: [c.x, 2, c.z] },
+ { name: 'CourtyardMid', fov: 50,
+ position: [c.x + 8, eye(c.x + 8, c.z + 6), c.z + 6], lookAt: [c.x, 2, c.z - 6] },
+ { name: 'LanternDetail', fov: 45,
+ position: [hero.x + 2.5, eye(hero.x + 2.5, hero.z + 1.5), hero.z + 1.5],
+ lookAt: [hero.x, 0.6, hero.z] },
+ ];
+}
+```
+
+`hero` is the hero prop's own position — take it from the zone that built it, not from a
+number you remember. Then check each one against the table in the skill before you
+build anything else.
+
+## 3. When a finding fires: what to change
+
+| finding | the number that is wrong | change |
+|---|---|---|
+| `camera inside / touching geometry: inside ['CityTower']` (cap 0.50) | the camera sits in a mesh box | move it out along the lookAt direction until `nearest_hit_m >= 0.5`; do not shrink the building |
+| `camera is N m below the ground level` with a dark or empty frame (cap 0.50) | you used an absolute y | `position[1] = heightAt(x, z) + 1.6` |
+| same finding but the frame renders fine | nothing, probably | a hill or terrace is above the camera; verify with the frame, then leave it |
+| `establishing shot shows too little content: content 11% (sky 52%, ground 37%)` (cap 0.60) | the shot is mostly backdrop | pull the camera in to about 1.2 x the content span, lower it, or add instanced content — a bigger ground plane makes this **worse**, because ground is not content |
+| `flat frame: one luminance band holds 100% of the pixels` | no tonal range | aim at content, add a shadow-casting key, vary materials; recorded twice in one desert-canyon run at 85% and 100% |
+| `frame too dark: mean luminance 0.06` | exposure | that is `cv3d-scene-lighting`'s table, not composition |
+
+## 4. Naming, because names change the classification
+
+| you want it to be | name it | and shape it |
+|---|---|---|
+| ground | `Ground`, `Terrain`, `Water`, `Sand`, `Grass` | span > 20 m, height < 6% of span |
+| sky | `SkyDome`, `Stars`, `Clouds` | span > 50 m |
+| content (counts toward `content_frac`) | anything else | or make it an `InstancedMesh`, which is content unconditionally |
+
+The trap is the accidental one: a wide flat mesh over 40 m across and flatter than 2% of its
+span is classified **ground whatever its name**, so a big deck, jetty or plaza silently stops
+counting as content, and its top surface becomes `ground_y` for every camera check.
+
+## 5. Cheap self-check before you finish
+
+```
+scene_probe -> triangles, draw calls, fps, console errors, custom-shader mesh count
+scene_views -> camera_checks per camera: mean_lum, modal_frac, content_frac,
+ nearest_hit_m, eye_height_m, ground_y
+```
+
+Six numbers per camera. Read them against the thresholds; the gate that scores you reads
+exactly the same six.