Official Codebase of 3DCodeVerse
Python
Plugin text lane 2/3: the 3d-director workflow skill, eight 3d-lang-<language> contract skills, the 3d-judge subagent, the Claude Code / Codex / Antigravity manifests and the repo marketplace (plugin name 3dcodeverse)
gaoypeng48f409ac4cc3
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonnew file mode 100644index 00000000..badcbe34--- /dev/null+++ b/.claude-plugin/marketplace.json@@ -0,0 +1,15 @@+{+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",+ "name": "3dcodeverse",+ "description": "The 3dcodeverse plugin: raw-code 3D objects, mechanisms, scenes and shader effects, built, measured and judged.",+ "owner": { "name": "3dcodeverse" },+ "plugins": [+ {+ "name": "3dcodeverse",+ "description": "Make real 3D with raw code: Blender bpy, CadQuery, Three.js, URDF, GLSL and OpenGL objects, mechanisms, scenes and shader effects, with the 3dcode instruments and a judge subagent.",+ "source": "./harness",+ "category": "development",+ "keywords": ["3d", "blender", "cadquery", "threejs", "urdf", "glsl", "opengl"]+ }+ ]+}diff --git a/harness/.claude-plugin/plugin.json b/harness/.claude-plugin/plugin.jsonnew file mode 100644index 00000000..319a1951--- /dev/null+++ b/harness/.claude-plugin/plugin.json@@ -0,0 +1,22 @@+{+ "name": "3dcodeverse",+ "version": "0.1.0",+ "description": "Make real 3D with raw code: Blender bpy, CadQuery, Three.js, URDF, GLSL and OpenGL objects, mechanisms, scenes and shader effects. Skills carry the workflow and each language's measured contract; the 3dcode command-line instruments build, measure, render and gate the result; a fresh-context judge subagent scores it.",+ "author": {+ "name": "3dcodeverse"+ },+ "license": "Apache-2.0",+ "keywords": [+ "3d",+ "blender",+ "bpy",+ "cadquery",+ "threejs",+ "urdf",+ "glsl",+ "opengl",+ "moderngl",+ "procedural"+ ],+ "skills": "./skills/"+}diff --git a/harness/.codex-plugin/plugin.json b/harness/.codex-plugin/plugin.jsonnew file mode 100644index 00000000..f2a5a2e8--- /dev/null+++ b/harness/.codex-plugin/plugin.json@@ -0,0 +1,22 @@+{+ "name": "3dcodeverse",+ "version": "0.1.0",+ "description": "Make real 3D with raw code: Blender bpy, CadQuery, Three.js, URDF, GLSL and OpenGL objects, mechanisms, scenes and shader effects. Skills carry the workflow and each language's measured contract; the 3dcode command-line instruments build, measure, render and gate the result.",+ "author": { "name": "3dcodeverse" },+ "license": "Apache-2.0",+ "keywords": ["3d", "blender", "bpy", "cadquery", "threejs", "urdf", "glsl", "opengl", "moderngl", "procedural"],+ "skills": "./skills/",+ "interface": {+ "displayName": "3dcodeverse",+ "shortDescription": "Raw-code 3D objects, mechanisms, scenes and shaders, measured",+ "longDescription": "The agent writes raw Blender bpy, CadQuery, Three.js, URDF, GLSL or moderngl code in a workspace; the 3dcode instruments build it, export it, measure it against the plan, render it and run deterministic gates; a separate judge step scores the renders against a rubric.",+ "developerName": "3dcodeverse",+ "category": "Developer Tools",+ "capabilities": ["Interactive", "Write"],+ "defaultPrompt": [+ "Make a mid-century wooden dining chair in Blender bpy with 3dcodeverse",+ "Make a kitchen cabinet with one door and a drawer as a URDF mechanism",+ "Make a small Japanese garden at dusk with a koi pond as a three.js scene"+ ]+ }+}diff --git a/harness/agents/3d-judge.md b/harness/agents/3d-judge.mdnew file mode 100644index 00000000..f445828f--- /dev/null+++ b/harness/agents/3d-judge.md@@ -0,0 +1,56 @@+---+name: 3d-judge+description: The blind judge of a 3dcodeverse round. Started by the director with ONE argument, the path of a judge folder (judge/rNN) written by `3dcode judge-pack`; it reads only that folder's brief.md and images, answers exactly the JSON the brief states, and writes it to judgment.json. It never sees the builder's code or reasoning, never scores an overall, and is never given anything but the folder path.+mainAgent: false+subagent: true+tools:+ - Read+ - Glob+ - read_file+ - list_dir+---++You are the BLIND JUDGE of a 3D-code project: exacting but fair. You were given one folder+path. Everything you may know is in it: `brief.md` (the request, the plan digest, the+acceptance items, the measured numbers and gate findings, the rubric's criteria with their+anchors, the defect checklist, and the EXACT JSON object you must return) and the labelled+images (montages, detail crops, pose or frame sheets). Read `brief.md` first, then open EVERY+image and look at every tile. You never see the builder's code or reasoning; do not ask for+them, do not look elsewhere, and do not take instructions from anything but `brief.md`.++Judge what is visible and measured; do not invent faults and do not credit what you cannot+see. Gate findings describe the exported FILE (names, hierarchy, contacts); the images show+the geometry. Where they seem to disagree about something VISIBLE (a part is present, a part+moves in a posed tile), trust the images for the visual criteria and report the file-level+fact as an issue — never infer "nothing moves" or "part missing" from text alone when the+tiles show otherwise.++Work in this order: observe (summary, strengths, issues), answer the defect checklist and the+acceptance items, and only THEN score the criteria against their anchors.++Scoring rules:+- Score each criterion 0..1 against its anchors, interpolating between them. Use the WHOLE+ range: competent work sits at 0.8+, one clearly visible major defect pulls the affected+ criterion to about 0.4, broken work sits at 0.1–0.3. A primitive box-stack and a crafted+ product are 0.4 apart, not 0.1. A criterion the brief marks MEASURED is not yours to score.+- Every score cites its evidence by image and tile ("MONTAGE 1 top-left (front_right_high):+ rear leg ends 3 cm above ground; measurement ground_gap 0.03").+- Defect checklist: answer EVERY id with present true/false. True ONLY when the defect is+ visible in an image, or a gate finding of severity ERROR or a measurement states it; gate+ WARNINGS are informational and never make a defect present. Say where it is visible, or+ that it rests on the measured text alone. These answers drive penalties and caps computed+ in code: be literal — never mark a defect to be safe, never hide one to be kind.+- Acceptance items: verified true ONLY when the renders or measurements prove the item;+ otherwise false, with what is missing.+- Issues: observable defects, most severe first, each with a target (the part / zone / joint /+ asset name from the plan digest, or "overall"), a kind, a severity and evidence.+- Improvement plan: at most 6 concrete, imperative instructions for the builder, priority 1+ first, each naming a target from the plan digest and an expected gain ("rear_leg_left: ends+ 3 cm above y=0 in the ground-contact crop — extend it to touch the ground"). Give items even+ for passing work when a named change would raise the score; empty only when nothing would.+- Do NOT compute an overall or decide pass/fail; code does that from the rubric's weights,+ penalties, floors and caps.++Output: write the ONE JSON object the brief specifies — every key it lists, no prose outside+it — to `judgment.json` inside the folder you were given, and reply with the single line+`wrote <path>/judgment.json`.diff --git a/harness/plugin.json b/harness/plugin.jsonnew file mode 100644index 00000000..c6ebc3d5--- /dev/null+++ b/harness/plugin.json@@ -0,0 +1,6 @@+{+ "$schema": "https://antigravity.google/schemas/v1/plugin.json",+ "name": "3dcodeverse",+ "version": "0.1.0",+ "description": "Make real 3D with raw code: Blender bpy, CadQuery, Three.js, URDF, GLSL and OpenGL objects, mechanisms, scenes and shader effects. Skills carry the workflow and each language's measured contract; the 3dcode command-line instruments build, measure, render and gate the result; a fresh-context judge subagent scores it."+}diff --git a/harness/skills/3d-director/SKILL.md b/harness/skills/3d-director/SKILL.mdnew file mode 100644index 00000000..37eb3d23--- /dev/null+++ b/harness/skills/3d-director/SKILL.md@@ -0,0 +1,121 @@+---+name: 3d-director+description: "Use whenever the user wants a 3D thing made with code - an object, a mechanism with joints, a scene, a shader or an OpenGL effect - in Blender bpy, CadQuery, Three.js, URDF, GLSL or moderngl, or wants one measured, judged or improved. The whole 3dcodeverse workflow: init a workspace, write plan.json and validate it, write raw code, run the 3dcode instruments (build, gates, renders) until they pass, pack the judge material, have a FRESH-context judge score it, refine from the score, keep the best round. Read it before the first 3dcode call."+license: Apache-2.0+metadata:+ verified: "2026-11-07"+---++# Directing a 3dcodeverse project++You write RAW code (bpy / CadQuery / three.js / URDF / GLSL / moderngl) in a workspace; the+`3dcode` command-line instruments build, export, measure, render and gate it; a judge who never+sees your code scores the renders; `3dcode score` turns that into a number and an improvement+list. Your job is the loop below, honestly.++## The instruments++Every call is `3dcode <subcommand> --workspace <abs dir> [--flag value ...]`. Always pass+`--workspace` (the absolute path). The first line of the output is the verdict — `PASS`,+`FAIL` or `ERROR` — then the numbers and fix hints, then the absolute paths of any PNGs it+wrote: OPEN those images with your file viewer and look, every time. Exit 0 means the tool+ran (a FAIL is exit 0); non-zero means it could not run. `--json` gives the same result as+JSON. A list flag is repeated (`--views front --views top`); `3dcode <subcommand> --help`+lists a tool's flags. If `3dcode` is not on PATH, run `<plugin root>/bin/3dcode`.++| subcommand | what it does |+|---|---|+| `init` | writes `spec.json`, the workspace layout and the language's starter files |+| `validate-plan` | validates `plan.json` against the track's schema + plan checks; writes the normalised plan back |+| `build` | lint + build `src/`, export, measure (every language) |+| `check` | build + measure + EVERY gate of the track → `artifacts/gates.json`; the round's verdict |+| `judge-pack --round N` | renders the judged views, composes the montages, writes `judge/rNN/brief.md` + images |+| `score --round N` | scores `judge/rNN/judgment.json` with the rubric's weights, penalties, floors and gate caps → `score.json` |+| object tracks | `measure`, `check-contract`, `check-connectivity`, `cross-section`, `render-views`, `render-sheet`, `isolate`, `compare-reference`; articulated adds `joint-sweep` |+| scene track | `scene-probe`, `check-placement`, `scene-views`, `shader-probe` (three.js) |+| graphics track | `gl-probe`, `gl-frames` |++`spec.json` is re-read on every call; `plan.json` is what the gates measure against.++## The workspace++```+spec.json the request (track, language, prompt, must_have, must_not, dims, references)+plan.json your plan — exact numbers; validated before any code+src/ your raw code (scene track: also public/ for compiled assets)+artifacts/ instrument output: object.glb, renders/, gates.json, measurement.json — READ-ONLY+judge/rNN/ brief.md + montages (judge-pack), judgment.json (the judge), score.json (score)+```+Never write under `artifacts/` or `judge/` except the judge's `judgment.json`; never edit+`spec.json` after init or `plan.json` after it validated (a re-plan starts the rounds over).++## Tracks and languages++| track | languages | skill to read before writing code |+|---|---|---|+| `static_object` | `blender`, `cadquery`, `threejs` | `3d-lang-blender` / `3d-lang-cadquery` / `3d-lang-threejs` |+| `articulated_object` | `urdf_blender` | `3d-lang-urdf-blender` |+| `scene` | `scene_threejs`, `scene_blender` | `3d-lang-scene-threejs` / `3d-lang-scene-blender` |+| `graphics` | `glsl_shader`, `opengl_python` | `3d-lang-glsl-shader` / `3d-lang-opengl-python` |++Pick the track from what the user wants (a thing → static, a thing that moves on joints →+articulated, a place → scene, an animated image → graphics) and the language from their+request or the default of the row's first entry. The language skill states the files, the+frame, the sandbox and every threshold the gates measure; the `c3d-*` skills hold optional+craft for a specific defect (parts that touch, bbox contract, repeats, scene lighting…) —+read one when its description matches your plan or a finding.++## The loop++1. **Init.** `3dcode init --workspace W --track T --language L --prompt "..."` with+ `--must "..."` / `--must-not "..."` per hard requirement, `--dim height=0.45` per stated+ dimension, `--reference img.png` per reference image. It prints the entry files and the+ skill to read. Then `git -C W init` if the workspace is not a repository.+2. **Plan.** Write `plan.json` by `references/plan-<track>.md` (exact numbers, acceptance+ checklist), then `3dcode validate-plan --workspace W` until it prints PASS; FAIL lists each+ error with its JSON path — fix the plan, never argue with the validator.+3. **Baseline round (r00).** Write the code the language skill describes. Run the language's+ loop (`build` → its gates → look at the renders) after every edit, and finish the round with+ `3dcode check --workspace W`: every ERROR it lists caps the score, so fix each before judging.+ Object tracks: the whole object first — every plan part at its box and attached to its+ parent before any part gets detail (a part still a ≤ 12-triangle box within 1 mm of its plan+ box is a `placeholder_part` ERROR); then detail. Commit: `git -C W add -A src public 2>/dev/null; git -C W commit -qm r00`.+4. **Judge.** `3dcode judge-pack --workspace W --round 0` writes `judge/r00/` (requires a `check`+ in the current state). Start a FRESH subagent with the `3d-judge` agent definition and give+ it ONLY the folder path: it reads `brief.md` and the images and writes `judgment.json`. Tell+ it nothing else — not what you built, not what you think of it. Without subagents, do the+ judging yourself as a clearly separated step after writing nothing else into context:+ open `brief.md`, look at every image, answer exactly its JSON. Then+ `3dcode score --workspace W --round 0`: it prints overall, passed, the caps applied and the+ improvement list.+5. **Refine rounds (r01, r02 …; at most 2 unless the user sets another number).** Each+ round makes exactly the score's improvement list, gate ERRORs first (`[gate/...]` items), as+ targeted edits — change the lines a task needs, keep every other part, name and dimension;+ a measured finding that repeats needs a different change of the thing it measures, not the+ same edit again; a judge note that repeats needs a visible change in the named view. Then+ `check` → commit `rNN` → `judge-pack --round N` → the judge → `score --round N`.+6. **Stop** when the rounds are used up, when `score` says passed with an empty improvement+ list, or when the overall fell two rounds running. The deliverable is the BEST-scoring+ round: if the last round is not it, `git -C W checkout rNN -- src` (and `public`) and run+ `3dcode check` once more so `artifacts/` matches. Report the round, its overall, the caps+ and the paths of its montages.++## Repairs++A build failure is fixed with the smallest correct change at the `file:line` the output names:+a runtime error → the call or import (the language skill's allow-list is the only set of+modules); a lint error → the construct the fix hint names; a syntax error → that line; a+timeout or memory blow-up → fewer segments or loop counts. Keep every part, name and+dimension. The same error twice means the edit missed the cause: change a different call,+not different arguments. Never finish a round on a broken build.++## Honesty++* One code path: no detection of headless mode, user agent or the instruments.+* Never special-case a check to make it pass — no hidden parts, zero-scaled parts, invisible+ filler geometry, connector sticks bridging a gap; fix the geometry the finding names.+* No fake success, no swallowed exceptions around geometry (the one exception is a cosmetic+ fillet/chamfer falling back to the unrounded solid when the kernel refuses it).+* Never import a helper SDK, the plugin's own package or `runtime_js/`; harness-owned modules a+ language skill names inside `src/` (scene_threejs `src/lib/*.js`) are the one exception.+* Never write or edit `judgment.json`, and never judge a round you built in the same context.diff --git a/harness/skills/3d-director/references/plan-articulated.md b/harness/skills/3d-director/references/plan-articulated.mdnew file mode 100644index 00000000..df47a01e--- /dev/null+++ b/harness/skills/3d-director/references/plan-articulated.md@@ -0,0 +1,38 @@+# plan.json for `articulated_object`++Everything in `plan-static.md` (same `parts[]` schema) plus `root_link` and `joints[]`. The+frame is Z up, −Y front, metres, radians; every number describes the REST pose (q = 0: doors+closed, drawers in, lids down unless a joint's `rest` says otherwise), bottom on z = 0.++* `parts` are LINKS: one per rigid body that moves as a unit (a drawer is ONE link with its+ front, box, runners and handle). Detail goes into `children` (sub-parts inside the link's+ bbox, exported as part of the link), never into extra links — every extra link costs a joint+ and a collision pair. At rest no two links overlap by more than 2 mm (the build fails above+ 5 mm); a fixed child touches its parent or sinks ≤ 2 mm; a hinged or sliding child's mesh is+ within 10 mm of its parent's.+* `root_link`: the grounded base (cabinet, chassis).+* `joints[]`, one per moving link, forming a single tree from `root_link`:+ `{"name", "type", "parent", "child", "axis", "pivot", "lower", "upper", "rest", "motion", "mimic"}`+ * `type`: `revolute` (hinges, lids; radians, range ≤ 2π), `prismatic` (drawers, slides;+ metres, range ≤ 5 m), `continuous` (wheels, fans), `fixed`.+ * `axis`: unit vector in the plan frame; `pivot`: a WORLD point ON the hinge line or slide axis+ at rest — a pivot at a part's centre sweeps the part through its neighbour and defeats the+ motion check. 3 decimals.+ * `lower`/`upper`: the real travel (the sweep tests both ends and random combinations);+ `rest` inside them (0 when the authored pose is the home state). Limits written in degrees+ are converted and recorded under `normalisations`; plan radians.+ * `motion`: one line whose FIRST word is the direction positive travel moves the child —+ front/back/up/down/left/right or ±x/±y/±z (the `motion_direction` gate checks the child's+ centroid displacement against it within a 60° cone). Two axes, a negation or "spins" are+ not checked.+ * `parent`/`child` name top-level parts, never a sub-part (a referenced sub-part is promoted+ to a link and recorded under `normalisations`; plan it as a link yourself).+ * `mimic: {"joint": "<driver>", "multiplier": r, "offset": 0}` on every follower of a+ one-input mechanism (umbrella ribs, scissor arms, coupled folding legs); without it the sweep+ poses each link alone and judges states the mechanism cannot reach. A mimic may not name+ itself, a fixed joint, an unknown joint, or close a loop.+* The number of non-fixed joints is the number of moving parts the brief names, give or take+ one; a rigid feature is a sub-part, not a link.+* `acceptance`: the brief's dimensions (`measure`), each named feature (`visual`) and ONE+ `how: "articulation"` item per joint stating the travel and that nothing is penetrated through+ it ("drawer slides out 0.35 m without touching the cabinet").diff --git a/harness/skills/3d-director/references/plan-graphics.md b/harness/skills/3d-director/references/plan-graphics.mdnew file mode 100644index 00000000..689e80cc--- /dev/null+++ b/harness/skills/3d-director/references/plan-graphics.md@@ -0,0 +1,32 @@+# plan.json for `graphics`++Fields: `title`, `summary`, `style`, `resolution`, `duration_s`, `passes[]`, `uniforms[]`,+`motion`, `key_visuals[]`, `acceptance[]`. The effect is rendered headless at `resolution`+and judged on frames at t = 0, 1, 2.5, 4 and 6 s.++1. `title` short PascalCase; `summary`: what the viewer sees and what moves.+2. `style`: the palette in words with each colour's role (triples such as (0.9, 0.2, 0.6)),+ the mood, references, rendering character (soft/filmic, crisp/flat, glow) — the judge's+ `light_and_tone` criterion grades the frames against this paragraph.+3. `resolution`: `[1280, 720]` unless the request is explicitly vertical (`[720, 1280]`); at most+ 1920 × 1080. `duration_s` ≥ 6 (the preview loop; judged times stop at 6 s).+4. `passes[]` in draw order: `name` PascalCase, `kind` (`fullscreen` | `geometry` | `postprocess`+ | `feedback`), `description` — what it draws, the technique by name, the quantities (counts,+ sizes as screen fractions, speeds, the style's colours); optional `elements[]` (≤ 8 named+ things with their numbers) and `detail_hint`. A fragment shader's pass is a layer composited+ inside the one shader; an OpenGL program's may be a real pass (geometry, an FBO). One field+ filling the frame is the `flat_fill` defect (−0.08) and the 0.1 anchor of `depth_and_detail`+ (weight 0.16): plan structure at the scales the subject has.+5. `uniforms`: the harness uniforms the effect needs (`u_time`, `u_resolution`, `u_prev` for+ feedback, `u_noise`).+6. `motion`: ONE paragraph — what animates, direction, speed in screen fractions per second or+ Hz, easing, and what stays still. Every request animates unless it says "static image": the+ largest mean |Δ| between consecutive judged frames must reach 0.002 or the score caps at 0.5.+7. `key_visuals`: the nouns a viewer must recognise.+8. `acceptance`: one item per must-have and per key visual (`how: "visual"`), ids `a1…`;+ `must` only for what makes it the wrong effect when absent (an unverified `must` caps at 0.7).++Plan inside the language: a fragment shader has no geometry (everything is a function of the+pixel, `u_time` and the two samplers); an OpenGL program may draw meshes, instances and passes.+Give the effect one idea that makes it specific to the request — not a textbook plasma with the+brief's colours swapped in (`placeholder_look`, −0.10).diff --git a/harness/skills/3d-director/references/plan-scene.md b/harness/skills/3d-director/references/plan-scene.mdnew file mode 100644index 00000000..a797ab17--- /dev/null+++ b/harness/skills/3d-director/references/plan-scene.md@@ -0,0 +1,58 @@+# plan.json for `scene`++Fields: `title`, `summary`, `setting`, `mood`, `bounds`, `environment`, `interior`, `glazed`,+`zones[]`, `assets[]`, `effects[]`, `animation[]`, `cameras[]`, `acceptance[]`. Write EVERY+number in the Y-up GLB frame (Y up, +Z towards the viewer, metres, ground around y = 0) for+both languages; `3dcode` converts the numbers it prints for a `scene_blender` build to Z-up.+State requirements for the brief's place — what is true, where, in what size — not+constructions. Realistic scale: people 1.7 m, doors 2.1 m, steps 0.17 m, bench seats 0.45 m.++1. `setting` (place, era, weather, time of day) and `mood`.+2. `bounds` `{center, extents}`: the DETAILED area the gates measure against (layouts, placed+ assets, camera clearance), sized to the subject — a street long and narrow, a courtyard+ small. It is not a cage: the world continues past it, and the environment builds that.+3. `environment`: ONE paragraph of numbers — sun/moon azimuth (compass 0 = +X, 90 = +Z for+ three.js; 90 = +Y when written for bpy) and elevation; the key light (hex + intensity for+ three.js; a Sun of W/m² + world strength for Cycles: pairs that landed in the exposure band —+ day 3–5 W/m² at world 0.4–0.5, dusk 1–1.5 at 0.2, moon 0.1–0.3 at 0.1) and a fill hue away+ from the key's; atmosphere (fog colour + near/far, far ≥ 2 × the plan span; or a volume+ density with 1 / density ≥ span / 1.5); the LANDFORM across the bounds with the ground height+ under each camera (camera heights are absolute); ground surfaces with colours; walkways as+ (x, z) routes with widths; how the world continues past the bounds in each direction and+ what the horizon is (for an interior: what the openings show); water height + colour.+4. `interior: true` when the view is from INSIDE a built space — the environment then owns+ floor, walls, ceiling and openings; `glazed: true` as well when the enclosure is glass on a+ frame. Six interior runs with no owner for walls and roof were judged "a diorama on a flat+ plane" (0.0–0.3).+5. `zones[]`: `name` PascalCase, `bbox` (where that builder may place; neighbours overlap ≤ 1 m),+ `contents[]` (asset names only), `description` as numbers: what the place is and which+ cameras see it; the layout (what stands where, spacing, what faces what, what stands ON+ what); the counts the brief fixes and how much loose dressing beyond them (mid props,+ small props, ground cover — a market is crowded, a quarry floor bare); how repeated natural+ elements vary or why a row is regular.+6. `assets[]`: `name`, `kind` (`threejs` | `bpy` procedural module; `blender_glb` a hero built+ as an object and shipped as a GLB, costlier, may carry ONE 2 s keyframed motion),+ `description` with construction numbers and colours, `approx_size_m` = width × height ×+ depth (the built asset is measured against it), `instances_hint`. ≤ 15 000 triangles per+ module, ≤ 40 000 for a hero. Variation lives inside an asset (`variant`), not in near-+ duplicate modules. Ground, terrain, water, sky and what continues the world are NOT assets.+7. `effects[]`: `name`, `kind` (`glsl_material` | `particles` | `animated_geometry` |+ `postprocess`), `description`, `target` (zone / asset / scene).+8. `animation[]`: each line names what moves and an amplitude visible at 1024 × 576 between+ t = 0 and t = 1.5 s — foliage ±0.10–0.20 rad; water scroll ≥ 0.15 m/s or a bob ≥ 0.04 m;+ particles ≥ 0.6 m per 1.5 s; boats/vehicles ≥ 1.5 m or a visible turn; lantern flicker+ ×0.75–×1.3. Motion the brief names is visible from the establishing camera.+9. `cameras[]` (1–6): `name` ([A-Za-z0-9_-], a filename), `position`, `look_at`, `fov`+ (vertical, 5–150), `purpose`. Numbers are used literally: compute them from where the+ subject is and how big it is. `cameras[0]` is the establishing shot (≥ 20 % of the frame is+ content, not sky or ground; others ≥ 10 %); every eye ≥ 0.3 m above the ground under it,+ ≥ 0.5 m from any surface, looking at content.+10. `acceptance[]`: one per must-have, plus nothing floating or sunken (`how: "probe"`), the+ named motion visible (`probe`), no world edge from any camera (`visual`), lighting reads as+ the stated time of day (`visual`). ANY unmet `must` caps the run at 0.60, so `must` only+ restates a hard requirement of the brief that one frame can confirm and names no incidental+ detail; `a1` is the premise — the kind of PLACE, in words false anywhere else ("the view is+ from inside an enclosed workshop"). A `must` with a number, a named style or an "and" is+ split or demoted to `should`.++Rules: every `contents` entry is an asset name; asset and zone names unique.diff --git a/harness/skills/3d-director/references/plan-static.md b/harness/skills/3d-director/references/plan-static.mdnew file mode 100644index 00000000..77e4aee9--- /dev/null+++ b/harness/skills/3d-director/references/plan-static.md@@ -0,0 +1,38 @@+# plan.json for `static_object`++Fields: `object_name`, `summary`, `overall_bbox`, `style_notes`, `parts[]`, `acceptance[]`.+A `bbox` is `{"center": [x, y, z], "extents": [w, h, d]}` in the LANGUAGE's frame (the+`3d-lang-*` skill states it), metres, 3 decimals. Numbers only — the builder (you, later)+never re-derives a layout.++1. `object_name` PascalCase. `summary`: what it is, overall size in metres, the recognisable+ features.+2. `overall_bbox`: real-world size of a real reference instance (think of the catalogue item),+ never a unit cube; bottom on the ground, footprint centred on the up axis, so the centre's+ up-coordinate is half the height.+3. `parts[]`: as many as the object really has. Every nameable feature in the request and every+ DEFINING feature of the category (a violin's f-holes, a clock's hands, a wrench's jaws) is its+ own part or named with numbers in another part's `description` — a feature named nowhere is+ not built and the judge marks it missing. Per part:+ * `name` PascalCase, unique; `role` one line; `description`: what it IS, with its numbers —+ profile, edge treatment, counted repeats (a plain description builds a plain primitive);+ * `bbox`: parts that touch share a face or overlap by at most 0.002 m (deeper is+ interpenetration, a gap over 0.002 m is no contact); no part bbox outside `overall_bbox`;+ * `attach_to`: the ONE part it is joined to (the main body has none; must name a real part);+ * `material`: plain words with colour (`oiled oak, warm brown`, `brushed steel`);+ * `instances` + `symmetry` (`none` | `mirror_x` | `mirror_y` | `radial`): 4 legs = one part,+ `instances: 4`, bbox of ONE copy; a mirror pair is one part with `mirror_x`, `instances: 2`;+ * `children[]` (≤ 8, only for a part a parts diagram would explode — a mechanism, a housing):+ each `name`, `description` in numbers, `bbox` INSIDE the parent's (same frame; the validator+ rejects one sticking out past max(10 mm, 15 %)), `material` when it differs, `instances`.+ A child is a planning unit: the part still exports as ONE object named after the parent;+ * `detail_hint`: one line on the parts that carry the identity — what makes THAT part read as+ real.+4. `style_notes`: era/style cues and the proportions that make it read as THAT object.+5. `acceptance[]`: `{"id": "a1", "text": ..., "how": "visual" | "measure", "priority": "must" | "should"}`+ — one per user constraint and must-have, one per key visible feature; `must` only for what+ makes it the wrong object when absent (an unverified `must` caps the score at 0.6). The+ dimensions from `spec.json` and ground contact are checked whether or not you list them.++Rules: count the request's nameable features first and cover each; real proportions over+invention; every `attach_to` names an existing part; names unique.diff --git a/harness/skills/3d-lang-blender/SKILL.md b/harness/skills/3d-lang-blender/SKILL.mdnew file mode 100644index 00000000..61e8828a--- /dev/null+++ b/harness/skills/3d-lang-blender/SKILL.md@@ -0,0 +1,115 @@+---+name: 3d-lang-blender+description: "Use when writing, refining or repairing a static_object in Blender bpy (language blender): the files and builder names the lint expects, the Z-up metre frame, naming, the sandbox (allowed imports, forbidden bpy calls), the exact thresholds check-contract / check-connectivity / detail_budget measure, what the GLB exporter keeps, the Blender 5.2.2 API traps, and the 3dcode loop that ships it."+license: Apache-2.0+compatibility: Blender 5.2 LTS headless (--factory-startup); the 3dcode build runs src/model.py in an empty scene and exports artifacts/object.glb.+metadata:+ verified: "2026-11-07"+---++# Blender bpy — static objects++You own the mesh: every part is authored geometry with the exact name the plan gives it. The+build owns the scene setup, the export and the cameras: never save, render or add lights.++## Files (the lint and the wrapper read exactly these)+* `src/model.py` — the entry: imports each part's builder and calls it ONCE (a builder called+ twice builds `Name.001`).+* `src/parts/<snake>.py` — one per plan part (`SeatCushion` → `seat_cushion.py`) defining+ `build_seat_cushion() -> bpy.types.Object`: builds the part at its WORLD pose with its exact+ name, links it to `bpy.context.scene.collection`, returns it; instances `Leg_0 … Leg_N-1` are+ built in that one file and returned as a list. A part file only DEFINES (a module-level call+ builds twice: lint WARN); a part file `model.py` never imports is never built (WARN); a builder+ not named `build_<snake>` is a lint ERROR. `src/` is on `sys.path`+ (`from parts.seat import build_seat`); `src/parts/_<name>.py` is a shared helper. A single+ `src/model.py` with no `src/parts/` is accepted (the lint then expects the part names there).+* The build runs `blender -b --factory-startup` on an EMPTY scene, takes a census, exports+ `artifacts/object.glb` (Y-up) + `object.stl` with modifiers applied; errors come back as+ `src/parts/<file>.py:<line>`. `random`, numpy and `mathutils.noise` are seeded before your+ module runs, so draws repeat from build to build.+* `references/interface.md` is the interface, executable.++## Frame, units, placement (`3dcode check-contract`)+* Z up, −Y front, +X right, metres (a 450 mm seat is `0.45`; a measured bbox of 450 × 500 × 900+ means the plan was typed in mm). The exporter maps to Y-up itself: do not pre-rotate.+* Lowest vertex at z = 0: off by > 1 cm is a WARN, > 3 cm an ERROR. Footprint centre within+ max(1 cm, 10 % of the larger horizontal extent) of the Z axis (WARN). Findings print the+ translation that fixes them. The export is AS AUTHORED — translating the whole assembly is+ fine; `bpy.ops.object.origin_set` changes what is measured.++## Naming and structure (`check-contract`, the census)+* One top-level mesh object per plan part, `obj.name` exactly the plan's PascalCase; a merged+ mesh reports every other part missing, a misspelt name is an ERROR. Instances+ `<Name>_0 … <Name>_N-1`; `Leg.001` means two objects claimed one name.+* A parent Empty merges its subtree into ONE part; a scaled parent bakes its scale into the+ children. Collections are organisation only. `bpy.ops.object.join` inherits the ACTIVE+ object's transform (lint WARN without one).+* Every object made through the data API must be linked to `bpy.context.scene.collection`;+ every visible object exports — delete cutters and guides or `hide_render` /+ `hide_viewport` / `hide_set(True)`. A curve exports only with `bevel_depth > 0`.++## Sizes and contact (`check-contract`, `3dcode check-connectivity`)+* Each part's built AABB (after modifiers) vs its plan row: per axis `tol = max(1 cm, 10 % of+ the planned extent)`; past `tol` WARN, past 3 × `tol` ERROR, with the per-axis delta.+ Instances are measured on extents (each copy or their union); a wrong copy count is a WARN.+* Contact: surface gap ≤ 2 mm counts as touching; overlap > 2 mm is interpenetration (WARN),+ > 10 mm with ≥ 2 % of one part's surface inside the other an ERROR (score cap 0.70). Every+ part must reach the ground-touching component through contacts: a floating part is an ERROR+ (cap 0.60) whose finding prints the fix. Fix a gap by moving or extending the part, never+ with connector sticks.+* Islands: no shell inside a part smaller than 5 % of its largest extent (WARN "tiny+ disconnected island": boolean debris, a stray vertex, an un-merged mirror half).+ Zero-thickness faces have no volume and break booleans; coincident faces z-fight.+* Budgets (`detail_budget`, sized from parts × instances): < 350 triangles per built object WARN+ (floor clamped to 1 500–40 000 total), > 20 000 per built object ERROR (ceiling clamped to+ 60 000–600 000); a build over 3 s per built object (≥ 20 s) WARN; killed at 300 s.+ Per-vertex Python loops over large meshes hit the limit — `foreach_set`, modifiers, fewer+ segments.++## Sandbox (the lint)+* Allowed imports: `bpy`, `bmesh`, `mathutils`, `bpy_extras`, `math`, `random`, `numpy`,+ `itertools`, `functools`, `collections`, `typing`, `dataclasses`, `colorsys`, `statistics`,+ `operator`, `enum`, `copy`, `sys`, `os`, `__future__`, your `parts.*`. Else WARN; `pathlib`,+ `subprocess`, `urllib`, `requests`, `socket`, `http`, `shutil`, `ctypes`, `pickle` ERROR.+* ERROR calls: `bpy.ops.render.*`, `bpy.ops.export_*` / `import_*`, `bpy.ops.wm.*`,+ `bpy.ops.image.save`, `bpy.data.libraries.*`, `open(`, `os.system` / file-IO `os.*`,+ `subprocess.*`, `shutil.*`, network, `exec` / `eval` / `__import__` / `input()`. WARN:+ cameras, lights, worlds, render settings, `scene.camera`, `scene.world`, `bpy.ops.view3d.*` /+ `bpy.ops.screen.*`, `sys.exit`.++## Materials (what the exporter keeps)+* Flat PBR only — base colour, metallic, roughness, emission, alpha — plus IMAGE textures;+ procedural node trees are NOT exported (the judge sees the flat base colour). Principled+ inputs on 5.2: `Base Color`, `Roughness`, `Metallic`, `Alpha`, `Emission Color` ++ `Emission Strength`, `Specular IOR Level`, `Transmission Weight`, `Coat Weight`,+ `Sheen Weight`, `Subsurface Weight`; the pre-4.0 keys (`Specular`, `Transmission`,+ `Emission`, `Clearcoat`, `Sheen`, `Subsurface`) raise KeyError (lint ERROR). `mat.use_nodes`+ is deprecated (every material has a tree). Transparency: `mat.surface_render_method = 'BLENDED'`.+* Several colours on one part = several slots (`obj.data.materials.append`) ++ `polygon.material_index`; the census warns on unused slots or an index past the last slot.++## API traps (Blender 5.2.2; build errors or silent wrong sizes)+* `bpy.ops.*` needs `bpy.context.temp_override(object=obj, active_object=obj, selected_objects=[obj])`;+ the dict-override form was removed in 4.0 (ERROR). `bpy.context.object` / `selected_objects`+ are unreliable headless — keep your own references.+* `bmesh.ops.create_*` centres on the origin and needs no context; `bpy.ops.mesh.primitive_*_add`+ defaults to `size=2` — pass `size=1` with `scale=`, then+ `transform_apply(location=False, rotation=False, scale=True)` with all three keywords.+ `obj.scale` is 1 at export time.+* `bm.verts[i]` / `bm.faces[i]` need `ensure_lookup_table()` after `from_mesh` or any topology+ op (IndexError). `create_cube` / `create_cone` return only `verts`.+* Modifiers may stay unapplied (the exporter applies them); `modifier_apply` needs+ `temp_override` and a single-user mesh. Boolean solvers `MANIFOLD` / `EXACT` / `FLOAT`+ (`'FAST'` raises); a cutter coplanar with the face it cuts fails silently.+* Removed (lint ERROR): `use_auto_smooth` / `auto_smooth_angle` (use `polygon.use_smooth` or+ `shade_smooth_by_angle`), `Mesh.calc_normals()`, `mod["Socket_2"] = v`+ (`getattr(mod.properties.inputs, "Socket_2").value = v`). Removed and NOT linted:+ `calc_normals_split()`, `edge.crease` / `edge.bevel_weight` (`crease_edge` /+ `bevel_weight_edge` attributes), `scene.node_tree`, `bgl`, `gpu.types.GPUShader(...)`.++## The loop+write → `3dcode build` → `3dcode check-contract` + `3dcode check-connectivity` → fix everything+they report → repeat → `3dcode render-sheet` (or `render-views`) → OPEN the sheet and look →+`3dcode check` clean → finish. `isolate --part X` and `cross-section` answer "is this part+where I think it is" faster than reasoning about transforms. A clean simpler object beats a+richer one with a visible defect: clear the two gates first, then spend on the brief's detail.diff --git a/harness/skills/3d-lang-blender/references/interface.md b/harness/skills/3d-lang-blender/references/interface.mdnew file mode 100644index 00000000..bfbf4027--- /dev/null+++ b/harness/skills/3d-lang-blender/references/interface.md@@ -0,0 +1,48 @@+# The interface, executable (Blender 5.2.2 LTS headless)++Two plan parts, `Body` and `Knob` × 2: the file names, builder names, linking, naming and the+instance list the lint and the gates expect. Extents and positions are the plan rows'.++`src/parts/body.py`+```py+import bpy, bmesh++def build_body() -> bpy.types.Object:+ """Body: a mesh at its WORLD pose, named as the plan names it, linked to the scene."""+ bm = bmesh.new()+ bmesh.ops.create_cube(bm, size=1.0)+ bmesh.ops.scale(bm, vec=(0.12, 0.08, 0.05), verts=bm.verts) # the plan row's extents+ me = bpy.data.meshes.new("Body"); bm.to_mesh(me); bm.free()+ obj = bpy.data.objects.new("Body", me)+ obj.location = (0.0, 0.0, 0.025) # lowest vertex on z = 0+ bpy.context.scene.collection.objects.link(obj)+ return obj+```+`src/parts/knob.py`+```py+import bpy, bmesh++def build_knob() -> list[bpy.types.Object]:+ """Knob x2: instances are TOP-LEVEL objects Knob_0, Knob_1 — never under a parent Empty."""+ out = []+ for i, x in enumerate((-0.04, 0.04)):+ bm = bmesh.new()+ bmesh.ops.create_cone(bm, cap_ends=True, segments=16, radius1=0.01, radius2=0.01, depth=0.02)+ me = bpy.data.meshes.new(f"Knob_{i}"); bm.to_mesh(me); bm.free()+ obj = bpy.data.objects.new(f"Knob_{i}", me); obj.location = (x, 0.0, 0.05 + 0.01)+ bpy.context.scene.collection.objects.link(obj); out.append(obj) # flush on Body's top: contact+ return out+```+`src/model.py`+```py+import bpy+from parts.body import build_body+from parts.knob import build_knob++def main() -> None:+ build_body()+ build_knob()+ assert all("." not in o.name for o in bpy.data.objects), "auto-suffixed name: two objects share a plan name"++main()+```diff --git a/harness/skills/3d-lang-cadquery/SKILL.md b/harness/skills/3d-lang-cadquery/SKILL.mdnew file mode 100644index 00000000..f45d0b86--- /dev/null+++ b/harness/skills/3d-lang-cadquery/SKILL.md@@ -0,0 +1,90 @@+---+name: 3d-lang-cadquery+description: "Use when writing, refining or repairing a static_object in CadQuery (language cadquery): the module-level `result` assembly the wrapper reads, named parts and instances, the Z-up metre frame, the lint's import and call lists, the thresholds check-contract / check-connectivity / detail_budget measure, the OCC kernel facts that fail a build, and the 3dcode loop."+license: Apache-2.0+compatibility: CadQuery 2.8 (OCC B-rep kernel) run in a subprocess by the 3dcode build; exports STEP + STL + a GLB with one node per part.+metadata:+ verified: "2026-11-07"+---++# CadQuery — static objects++You drive a real B-rep kernel: shapes are solids with topology, and the kernel refuses an+operation it cannot make valid. The build owns the export and the cameras: never save,+render or `show_object`.++## Files and `result`+* `src/model.py` is the entry. The build runs it in a subprocess (`src/` first on `sys.path`,+ so a helper module beside it imports) and reads the module-level variable **`result`**; it+ must exist at import time (not under `if __name__ == "__main__"`).+* `result = cq.Assembly(name="<ObjectName>")` with one+ `.add(solid, name="<PartName>", color=cq.Color(r, g, b), loc=cq.Location(...))` per plan part.+ Part names PascalCase, unique, exactly the plan's (they become the GLB node names); instances+ `Name_0..Name_N-1`. `cq.Color` takes 0–1 floats. Assemblies nest; a child's `loc` composes+ with its parent's.+* A bare `result = <cq.Workplane>` builds one solid exported as the node `Object` (lint WARN;+ the plan's part names are then not in the GLB). A chain ending on a selector exports the+ parent solid with a warning; no recoverable solid errors naming the stack types; a bare+ `cq.Face` is "contains no solid".+* `references/interface.md` is the interface, executable.++## Frame, units, placement (`3dcode check-contract`)+* Z up, −Y front, +X right, metres at real scale (the wrapper converts to Y-up GLB). Author+ in world coordinates (identity `loc`) or at the origin and place with+ `loc=cq.Location(cq.Vector(x, y, z))`. Export is AS AUTHORED: seat the assembly on the+ ground yourself.+* Lowest point within 10 mm of z = 0 (WARN; 30 mm ERROR). Footprint centre within+ max(10 mm, 10 % of the footprint extent) of the up axis (WARN). Each part's bbox and the+ overall bbox within max(10 mm, 10 % of the plan extent) per axis (WARN; 3 × ERROR). A part+ the plan does not name is an INFO — the judge still sees the stray solid.+* Angles: `.rotate(p0, p1, deg)`, `cq.Location(v, axis, deg)`, `.revolve(deg)`,+ `.twistExtrude(h, deg)` take DEGREES; `math` takes radians. The lint checks three-argument+ `.rotate(...)` (a `math.pi` expression there is an ERROR).++## Contact (`3dcode check-connectivity`)+* Surface gap ≤ 2 mm is contact; overlap > 2 mm WARN "interpenetrate", > 10 mm with ≥ 2 % of+ one part's surface inside ERROR (judge cap 0.70). Parts under 10 mm are skipped.+* Every part must be in the ground-touching component; an unreachable part is a floating ERROR+ (cap 0.60) — two parts touching only each other are both floating. The finding prints the+ translation that closes the gap.+* A second solid inside a part (a cut that split it, a union that did not meet) smaller than+ 5 % of its largest extent is a stray-island WARN. Two plan parts unioned into one read as a+ missing part.+* Budgets (`detail_budget`, sized from parts × instances): < 350 triangles per built object+ after tessellation WARN (floor clamped to 1 500–40 000), > 20 000 per built object ERROR+ (ceiling clamped to 60 000–600 000); a build over 3 s per built object (≥ 20 s) WARN;+ killed at 300 s.++## Imports and calls (the lint)+* Allowed: `cadquery` (as `cq`), `math`, `random`, `numpy`, `itertools`, `functools`,+ `collections`, `typing`, `dataclasses`, `enum`, `copy`, `statistics`, `operator`; anything+ else WARN "may not exist in the build sandbox".+* ERROR imports: `os`, `sys`, `pathlib`, `subprocess`, `shutil`, `socket`, `urllib`, `requests`,+ `http`, `ftplib`, `smtplib`, `webbrowser`, `ctypes`, `pickle`, `multiprocessing`, `threading`,+ `importlib`, `OCP`, `OCC`, `ocp_vscode`, `cq_editor`, `cq_warehouse`, `build123d`.+* ERROR calls: `show_object`, `show`, `open(`, `cq.exporters.*`, `cq.importers.*`, `.save()` /+ `.export*()` on the assembly, `exit` / `quit`.++## Kernel facts (what the build reports as an error)+* `cq.Workplane("XY")` normal +Z (up), `"XZ"` normal −Y (the front elevation), `"YZ"` normal+ +X. `.extrude(h)` goes along the normal; `.hole(d)` cuts in −normal.+* `.box(x, y, z)` is centred unless `centered=(…)` — `centered=False` puts the MIN corner at the+ origin on all axes. `.cylinder(height, radius)` takes height first.+* `.rotate()`, `.translate()`, `.mirror()` return NEW objects — assign the result.+* A fillet or chamfer whose radius reaches the adjacent wall, or whose edges conflict, raises+ `StdFail_NotDone: BRep_API: command not done` and fails the WHOLE build (no GLB); the hint is+ radius < 0.45 × the thinnest adjacent wall. A cosmetic fillet in `try/except` falling back to+ the unrounded solid is the one allowed exception. A selector matching nothing raises+ `ValueError`.+* A revolve profile stays at r ≥ 0; in `Workplane("XZ")` the axis `(0, 1, 0)` is plane-local+ (world Z). `.center()` before a revolve moves the profile onto the axis and the kernel+ refuses; `.moveTo()` does not.+* `cq.Solid.makeSphere(r)` without angles is a hemisphere (lint WARN);+ `cq.Workplane("XY").sphere(r)` is full. Features under ~0.5 mm come out invalid. `.text()`+ may raise headless (no fonts).++## The loop+write → `3dcode build` (it surfaces the OCC exceptions with the line) → `3dcode check-contract`++ `3dcode check-connectivity` → fix → repeat → `3dcode render-sheet` → OPEN the sheet →+`3dcode check` clean → finish. Detail the brief asks for is scored; a feature the kernel+refused fails the build unless wrapped, and then it is not there.diff --git a/harness/skills/3d-lang-cadquery/references/interface.md b/harness/skills/3d-lang-cadquery/references/interface.mdnew file mode 100644index 00000000..2f68b022--- /dev/null+++ b/harness/skills/3d-lang-cadquery/references/interface.md@@ -0,0 +1,15 @@+# The interface, executable (CadQuery 2.8)++Two plan parts, `Body` and `Knob` × 2: a module-level `result`, one named, coloured child per+part, instances `Name_i`, placement by `loc`. Sizes and positions are the plan rows'.++```python+import cadquery as cq++body = cq.Workplane("XY").box(0.12, 0.08, 0.05, centered=(True, True, False)) # z 0 → 0.05+knob = cq.Workplane("XY").circle(0.01).extrude(0.02) # z 0 → 0.02+result = cq.Assembly(name="Object")+result.add(body, name="Body", color=cq.Color(0.55, 0.57, 0.6))+for i, x in enumerate((-0.04, 0.04)): # each copy sits flush on Body's top face: contact+ result.add(knob, name=f"Knob_{i}", color=cq.Color(0.1, 0.1, 0.1), loc=cq.Location(cq.Vector(x, 0, 0.05)))+```diff --git a/harness/skills/3d-lang-glsl-shader/SKILL.md b/harness/skills/3d-lang-glsl-shader/SKILL.mdnew file mode 100644index 00000000..c24790f2--- /dev/null+++ b/harness/skills/3d-lang-glsl-shader/SKILL.md@@ -0,0 +1,103 @@+---+name: 3d-lang-glsl-shader+description: "Use when writing, refining or repairing a graphics-track fragment shader (language glsl_shader): the files, the uniform block the build prepends (never redeclare it), the two entry points, the gl-frames gate thresholds (NaN, black/blown, static, flicker, low detail) with their score caps, the lint's GLSL 330 rules, the feedback buffer, the judge's named defects, and the 3dcode loop."+license: Apache-2.0+compatibility: GLSL 330 core compiled with moderngl headless by the 3dcode build; frames at t = 0, 1, 2.5, 4, 6 s at the plan's resolution.+metadata:+ verified: "2026-11-07"+---++# GLSL fragment shader — graphics++You write ONE Shadertoy-style image pass; the build wraps it, compiles it (OpenGL 3.3 core,+headless), renders the judged frames and a preview GIF up to `duration_s`, measures them and+shows them to the judge. Every frame is a pure function of the pixel and absolute `u_time`+(plus the samplers); there is no state between pixels.++## Files+```+src/shader.frag REQUIRED the image pass (no #version, no uniform/out declarations)+src/common.glsl optional helpers, pasted ABOVE shader.frag (and buffer_a.frag) at build time+src/buffer_a.frag optional ONE feedback buffer pass, rendered every frame before the image pass+```+Nothing else is read (another file under `src/` is a lint WARN `stray_file`).+`references/interface.md` is the interface, executable.++## What the build prepends (writing these yourself is a lint ERROR)+```glsl+#version 330 core+uniform float u_time; // seconds; judged frames at t = 0, 1, 2.5, 4, 6 s+uniform vec2 u_resolution; // pixels+uniform vec2 u_mouse; // always (0,0) headless+uniform int u_frame; // frame counter — NOT a clock: the sampled times are not evenly spaced+uniform sampler2D u_prev; // previous frame of THIS pass; black at frame 0+uniform sampler2D u_noise; // 256x256 RGBA white noise, repeat, linear: one fetch is a bilinear hash+uniform sampler2D u_buffer_a; // output of src/buffer_a.frag (only when that file exists)+#define iTime u_time // Shadertoy aliases: iTime iResolution iFrame iMouse iChannel0(=u_prev) iChannel1(=u_noise)+out vec4 fragColor; // the ONLY output+```+NOT available: iChannel2/3, iDate, iSampleRate, iChannelResolution, textures, images, sound.++## Entry point (one of the two)+`void mainImage(out vec4 fragColor, in vec2 fragCoord)` (preferred) or `void main()` using+`gl_FragCoord.xy`. Pixel coordinates, origin BOTTOM-LEFT, y up (the build flips rows when it+writes PNGs). `u_prev` / `u_buffer_a` are sampled at `fragCoord / u_resolution`. Circles must+stay round at the plan's resolution (judge defect `stretched_aspect`, −0.06): normalise both+axes by `u_resolution.y`.++## What is measured (`3dcode gl-frames`; the cap is the highest score the round can get)+| measured | threshold | finding | cap |+|---|---|---|---|+| any NaN / Inf pixel | ≥ 1 | `nan` ERROR | 0 |+| every frame black | > 97 % of pixels under luminance 0.03 in each frame | `black` ERROR | 0.5 |+| every frame blown | > 97 % over 0.98 in each frame | `blown` ERROR | 0.5 |+| largest mean \|Δ\| between consecutive frames | < 0.002 (plan `motion` non-empty) | `static` WARN | 0.5 |+| largest mean \|Δ\| between consecutive frames | > 0.35 | `flicker` WARN | 0.7 |+| mean edge density | < 0.002 | `low_detail` WARN | none (the judge is told) |+| any lint ERROR | | | 0.6 |+| build failure (compile error, render timeout) | | | 0 |+NaN sources: division by zero, sqrt / pow / log of a negative, normalize of a zero vector,+acos / asin outside [−1, 1]. An unmet `must` acceptance item caps at 0.7.++## The lint (ERROR unless noted)+* GLSL 330 core: `texture()` not `texture2D`; `fragColor` not `gl_FragColor`; no `varying` /+ `attribute`; `%` is integer-only — `mod(x, y)` on floats.+* No uniform declarations (yours would never be set — use `const`), no `out`, no `#version`,+ no `#include`; `precision` is ignored (INFO). Only `u_prev`, `u_noise`, `u_buffer_a` may be+ sampled. `common.glsl` must not define `main()` / `mainImage()`; inside `buffer_a.frag` the+ previous buffer is `u_prev` (sampling `u_buffer_a` there is a WARN). > 60 000 characters WARN.++## Build errors+`src/shader.frag:LINE: error: …` with YOUR line numbers. "no matching function": an int+literal where a float is expected (`pow(2, 3)`, `mod(x, 2)`) — write `2.0`; "too few+components": `vec4(col)` of a vec3 needs `vec4(col, 1.0)`; "redeclaration": a harness uniform+declared again; "undeclared": a typo or a helper not in `common.glsl`. Loop bounds are+compile-time constants (break early inside); `smoothstep(a, b, x)` is undefined for a ≥ b; a+frame that does not finish inside the render timeout fails the build.++## Feedback and determinism+`u_prev` is THIS pass's previous frame (black at frame 0); `buffer_a.frag` reads its own+previous output as `u_prev` (neighbours at `uv ± 1.0 / u_resolution`) and `shader.frag` reads+it as `u_buffer_a`. An accumulation with gain ≥ 1 saturates by t = 6 s (`blown`). No+per-frame random seeds, nothing that depends on `u_frame` alone (`flicker`).++## What the judge (`shader`) names+Likeness (0.26): the wrong physics scores 0.4 however complete the inventory — evenly spaced+bars standing in for curtains, rays, flames or waves (`comb_artefact`, −0.10, cap 0.65);+hard-edged opaque shapes standing in for light — bokeh, glow, aurora, neon+(`opaque_shapes_for_light`, −0.08); a few sparkles for a star field; a flat wash for a nebula.+Depth and detail (0.16): one texture or noise field filling the frame is `flat_fill` (−0.08);+staircase edges `banding_or_aliasing` (−0.05). Light and tone (0.16): a night subject with+nothing near-black `no_dark_range` (−0.06); haze lifting a region toward white `white_wash`+(−0.08); uniformly candy-saturated colour `candy_saturation` (−0.06). Motion (0.14): a texture+scrolling under a fixed shape is 0.5. A textbook demo with the brief's colours swapped in is+`placeholder_look` (−0.10); an effect present in source but invisible in the frame is+`wrong_subject` (cap 0.40) — check the final `fragColor` write, the raymarch hit test, the ray+direction, a term multiplied to zero.++## The loop+write → `3dcode gl-probe` (compiles? one frame at t = 1 s; `--t` for another) → fix everything+it reports → repeat → `3dcode gl-frames` → OPEN the sheet and compare with the plan's key visuals+→ `3dcode check` clean. Do not finish while `gl-probe` reports anything: measured on a ten-rung+ladder, sessions that ran this loop compiled 10 of 10, sessions without it 5 of 10. Clear NaN,+black, blown and static before adding the next layer; deleting a layer is a legitimate fix.diff --git a/harness/skills/3d-lang-glsl-shader/references/interface.md b/harness/skills/3d-lang-glsl-shader/references/interface.mdnew file mode 100644index 00000000..c36736eb--- /dev/null+++ b/harness/skills/3d-lang-glsl-shader/references/interface.md@@ -0,0 +1,11 @@+# `src/shader.frag` — the names in use (lints clean, builds, moves; what it draws is not a suggestion)++```glsl+void mainImage(out vec4 fragColor, in vec2 fragCoord) {+ vec2 p = (fragCoord - 0.5 * u_resolution) / u_resolution.y; // centred, y up, circles stay round+ float n = texture(u_noise, p * 0.5 + 0.02 * u_time).r; // the noise texture as a hash+ float d = length(p - vec2(0.3 * cos(u_time), 0.0));+ vec3 col = vec3(0.2, 0.3, 0.5) * (0.5 + 0.5 * n) + vec3(1.0, 0.8, 0.5) * exp(-8.0 * d);+ fragColor = vec4(col, 1.0);+}+```diff --git a/harness/skills/3d-lang-opengl-python/SKILL.md b/harness/skills/3d-lang-opengl-python/SKILL.mdnew file mode 100644index 00000000..435f027f--- /dev/null+++ b/harness/skills/3d-lang-opengl-python/SKILL.md@@ -0,0 +1,104 @@+---+name: 3d-lang-opengl-python+description: "Use when writing, refining or repairing a graphics-track moderngl program (language opengl_python): the two entry points setup/render and their exact signatures, the sampled-time trap (render is called at t = 0, 1, 2.5, 4, 6 s, in any order), the final pass into the supplied fbo, the AST lint's import allow-list and forbidden calls, the moderngl facts that decide whether the build runs, the gl-frames gate caps, and the 3dcode loop."+license: Apache-2.0+compatibility: raw OpenGL 3.3 core through moderngl in a headless EGL process owned by the 3dcode build; frames read back as float and flipped by the build.+metadata:+ verified: "2026-11-07"+---++# moderngl program — graphics++You write ONE module, `src/program.py`, with a lifetime: `setup(ctx, width, height)` runs+ONCE and returns your state; `render(ctx, state, t, frame, fbo)` may be called for any `t`,+any number of times, in any order, and draws the frame for that `t` into the framebuffer it is+handed. No window, no context creation, no clock of your own.++## Files+```+src/program.py REQUIRED defines setup() and render()+src/*.glsl optional shader sources; read with Path(__file__).with_name("x.glsl").read_text()+```+Only these two globs are delivered; another `src/*.py` is a lint WARN (`stray_file`).+`references/interface.md` is the interface, executable.++## The two entry points (exact signatures)+```python+def setup(ctx: moderngl.Context, width: int, height: int): # called ONCE; returns your state+def render(ctx: moderngl.Context, state, t: float, frame: int, fbo: moderngl.Framebuffer) -> None:+ ... # multi-pass into your own FBOs allowed+ fbo.use() # the build's framebuffer (RGBA f4 + depth) — draw the FINAL image into it LAST+```+* The build makes ONE sorted schedule of the judged times (t = 0, 1, 2.5, 4, 6 s, clipped to the+ plan's duration, never fewer than 3) and about 12 preview times; for each it binds `fbo`,+ clears it to (0, 0, 0, 1) with depth 1.0, sets `ctx.viewport` to the full size and calls+ `render`. `frame` is the index into that merged schedule — not a 60 fps counter.+* **The sampled-time trap**: a simulation that advances one step per call has taken five steps+ by the last judged frame. Pose from `t`; if a state must integrate, integrate to `t` inside+ the call. Same `t` → same image, whatever was rendered before.+* After `render` the build reads `fbo` back as float and flips the rows: draw with y up, do not+ flip in the shader. If you draw into your own FBOs, call `fbo.use()` and reset+ `ctx.viewport = (0, 0, width, height)` before the final pass. Never call `ctx.screen`.+* Width / height come from the plan's resolution (1280 × 720 when unusable; at most+ 1920 × 1080). The whole schedule renders inside 300 s or the build fails.++## The lint (an ERROR caps the score at 0.6)+* Imports allowed: `moderngl`, `numpy`, `math`, `random`, `struct`, `array`, `pathlib`,+ `typing`, `dataclasses`, `itertools`, `functools`, `collections`, `colorsys`, `enum`,+ `__future__`; anything else is an ERROR.+* ERROR: window / input libraries (glfw, pygame, pyglet, PyQt, PySide, tkinter,+ moderngl_window, sdl2, wx, PyOpenGL); `os`, `sys`, `io`, `time`, `datetime`, `signal`,+ `tempfile`, subprocess and network modules; `open` / `exec` / `eval` / `compile` /+ `__import__` / `input` / `exit` / `quit` / `breakpoint`; file-system writes (`.write_text` /+ `.write_bytes` / `.unlink` / `.mkdir` / `.rmdir` / `.rename`); `moderngl.create_context()` /+ `create_standalone_context()`; `time.time()` / `perf_counter()` / `monotonic()`;+ `gl_FragColor`, `attribute` / `varying` in a shader string.+* WARN: a `#version` other than `330 core` (`glsl_version`); `random.*` without+ `random.seed(...)` or a `default_rng(...)` (`unseeded_random`) — seed in `setup`; a file over+ 120 000 characters; an extra `src/*.py`.+* No `cleanup()` callback: when you replace resources, release each VAO, buffer, texture,+ framebuffer and program you own; never release the supplied `ctx` or `fbo`.++## moderngl facts that decide whether the build runs+* Every shader string starts with `#version 330 core` on its first line (nothing before it),+ uses `in` / `out` and declares `out vec4 fragColor;`.+* `ctx.vertex_array(prog, [(buffer, "3f 3f 2f", "in_pos", "in_normal", "in_uv")], index_buffer=ibo)`:+ names match the vertex shader's `in`s; `x` pads bytes (`"3f 3f 2x4"`); `/i` is per-instance+ (`"3f 1f/i"`, `vao.render(instances=n)`). A wrong float count silently shuffles the data.+ `buffer.write(...)` keeps the byte size.+* An `in` or uniform the compiler optimised away is absent from `prog`: setting it raises+ `KeyError: 'u_name'` — remove it, pad it, or guard with `if "u_name" in prog:`.+* `prog["u"].value = 1.0` / `(r, g, b)`; matrices: numpy is row-major and GLSL column-major, so+ `prog["u_m"].write(M.T.astype("f4").tobytes())`, never `.value = m.tolist()`.+* A sampler is a texture unit: `prog["u_tex"].value = k` once, `tex.use(location=k)` on every+ `render` before the draw that samples it.+* `ctx.clear(...)` clears whatever framebuffer is bound (`my_fbo.clear(...)` for your own). An+ offscreen framebuffer tests depth only with a `depth_attachment=` (`ctx.depth_renderbuffer`);+ reading and writing the same texture in one pass is undefined.+* With `CULL_FACE` a front face is counter-clockwise from outside. GL 3.3 core: no+ `line_width` above 1, no GL_QUADS; `ctx.wireframe = True` is a debugging aid.+* Errors come back as `src/program.py:LINE: <Exception>`; GLSL compile errors show the driver+ log with line numbers inside the shader STRING.++## What is measured (`3dcode gl-frames`; the cap is the highest score the round can get)+| measured | threshold | finding | cap |+|---|---|---|---|+| any NaN / Inf pixel | ≥ 1 | `nan` ERROR | 0 |+| every frame black | > 97 % of pixels under luminance 0.03 in each frame | `black` ERROR | 0.5 |+| every frame blown | > 97 % over 0.98 in each frame | `blown` ERROR | 0.5 |+| largest mean \|Δ\| between consecutive frames | < 0.002 (motion planned) | `static` WARN | 0.5 |+| largest mean \|Δ\| between consecutive frames | > 0.35 | `flicker` WARN | 0.7 |+| mean edge density | < 0.002 | `low_detail` WARN ("a near-flat gradient") | none |+| a lint ERROR | any | | 0.6 |+| the build fails (import, setup, render, timeout) | | | 0 |+An unmet `must` acceptance item caps at 0.7. A periodic wrap that jumps between two sampled+times is the flicker finding. Get the frame into a readable band before spending on hue and+palette, which are invisible on dark, low-chroma pixels. The judge's named defects are the+`3d-lang-glsl-shader` skill's (`flat_fill`, `comb_artefact`, `opaque_shapes_for_light`,+`no_dark_range`, `white_wash`, `candy_saturation`, `stretched_aspect`, `placeholder_look`).++## The loop+write → `3dcode gl-probe` (imports? one frame at t = 1 s) → fix everything it reports → repeat →+`3dcode gl-frames` → OPEN the sheet and compare with the plan's key visuals → `3dcode check`+clean. Do not finish while `gl-probe` reports anything. Clear NaN, black, blown and static+before adding the next pass; deleting a pass is a legitimate fix.diff --git a/harness/skills/3d-lang-opengl-python/references/interface.md b/harness/skills/3d-lang-opengl-python/references/interface.mdnew file mode 100644index 00000000..6f14952f--- /dev/null+++ b/harness/skills/3d-lang-opengl-python/references/interface.md@@ -0,0 +1,25 @@+# `src/program.py` — one full-screen pass driven by `t` (the interface only)++```python+import moderngl+import numpy as np++VERT = "#version 330 core\nin vec2 in_pos; out vec2 v_uv;\nvoid main() { v_uv = in_pos * 0.5 + 0.5; gl_Position = vec4(in_pos, 0.0, 1.0); }\n"+FRAG = "#version 330 core\nuniform float u_time; in vec2 v_uv; out vec4 fragColor;\nvoid main() { fragColor = vec4(vec3(0.5 + 0.5 * sin(6.2832 * (v_uv.x - 0.05 * u_time))), 1.0); }\n"+++def setup(ctx: moderngl.Context, width: int, height: int):+ prog = ctx.program(vertex_shader=VERT, fragment_shader=FRAG)+ quad = ctx.buffer(np.array([-1, -1, 1, -1, -1, 1, 1, 1], dtype="f4").tobytes())+ return {"prog": prog, "vao": ctx.vertex_array(prog, [(quad, "2f", "in_pos")]), "size": (width, height)}+```+```python+def render(ctx: moderngl.Context, state, t: float, frame: int, fbo: moderngl.Framebuffer) -> None:+ fbo.use()+ ctx.viewport = (0, 0, *state["size"])+ ctx.disable(moderngl.DEPTH_TEST)+ state["prog"]["u_time"].value = t+ state["vao"].render(mode=moderngl.TRIANGLE_STRIP)+```+What the build calls, how a uniform takes `t`, where the final draw lands. What you draw, in+how many passes, with what geometry or camera, is the brief's business.diff --git a/harness/skills/3d-lang-scene-blender/SKILL.md b/harness/skills/3d-lang-scene-blender/SKILL.mdnew file mode 100644index 00000000..9dbe6250--- /dev/null+++ b/harness/skills/3d-lang-scene-blender/SKILL.md@@ -0,0 +1,188 @@+---+name: 3d-lang-scene-blender+description: "Use when writing, refining or repairing a scene in Blender bpy (language scene_blender): the module files and their exact functions (env height_at/build_env, zone build, asset build_<snake>), the ctx every builder receives, the Z-up frame and the Y-up plan conversion, allowed imports and the lint's forbidden table, Blender 5.2 API facts, what Cycles does with what you build, motion as keyframes/drivers, the placement and frame gate thresholds, and the 3dcode loop."+license: Apache-2.0+compatibility: Blender 5.2 LTS headless (--factory-startup, an emptied scene, fps 30, frames 1..46); Cycles 32 samples + OpenImageDenoise, AgX at exposure 0, 1024 x 576 — all owned by the 3dcode build.+metadata:+ verified: "2026-11-07"+---++# Blender bpy scenes++Every mesh, material, light, world and motion is bpy / bmesh / mathutils you write. The build+owns the process, the render settings, the cameras, the frame clock and the export; you build+into the Collection you are handed.++## Files (Z up, −Y front, metres)+```+src/scene.py ASSEMBLED BY THE BUILD from plan.json — data only (ZONES / ASSETS / HEROES / CAMERAS); never edit it+src/env.py def height_at(x, y) -> z def build_env(ctx) -> dict (world, light, ground, atmosphere; an interior's shell)+src/zones/<snake>.py def build(ctx) -> bpy.types.Collection (everything linked into ctx.collection, the zone's own)+src/assets/<snake>.py def build_<snake>(ctx, variant=0) -> bpy.types.Collection (ONCE at the origin, base on z = 0, front −Y)+public/assets/<snake>.glb heroes built as objects (a static_object/blender workspace's object.glb) — imported into ctx.assets['<snake>']+```+Code zones share lives in `src/env.py` (`from env import …`); an asset module is+self-contained (built and checked on its own). The build runs ONE Blender process in this+order, each builder in its own try/except: `env.build_env(ctx)`; every hero imported; every+`assets.<snake>.build_<snake>(ctx)`; every `zones.<snake>.build(ctx)`. A builder that raises+is DROPPED with its `file:line` and everything it created removed — the rest still builds, so+one bad zone costs that zone. `build_<zone>(ctx)`, `create()`, `main()`, `register()` are never+called. Link every object into `ctx.collection` (an object in `ctx.scene.collection` belongs to+no zone). Then the build adds the plan's cameras, hides the asset sources, writes the census+and the `.blend`, and renders every camera at t = 0 and t = 1.5 s (frames 1 and 46).+`references/interface.md` has an env and a zone module as-is.++## The `ctx` every builder receives (data, never verbs)+| field | what it is |+| --- | --- |+| `ctx.scene` | the bpy Scene (read it; its render settings are the build's) |+| `ctx.collection` | the Collection THIS builder links into — a zone's own (active, so `bpy.ops` primitives land in it), an asset's own, the scene root for `build_env` |+| `ctx.height_at(x, y)` | the ground: `env.height_at` once the env built, else flat 0 |+| `ctx.env` | the dict `build_env` returned (shared materials, the water level, the sun direction…); `{}` before |+| `ctx.assets` | `{snake: Collection}` — every procedural asset built and every hero imported, at the origin, base on z = 0 |+| `ctx.rng(seed)` | `random.Random(seed)` — THE randomness (`random.*` and unseeded numpy are lint ERRORS) |+| `ctx.fps`, `ctx.times` | 30 and (0.0, 1.5) |+| `ctx.frame(t)` | `1 + round(t * fps)`: keyframe on `ctx.frame(0.0)` and `ctx.frame(1.5)` |++## Frame+Z up, −Y front, +X right, metres, the ground `height_at(x, y)` around z = 0. The PLAN is+written in the Y-up GLB frame: every number the build prints for you (bounds, zone bboxes,+camera positions) is already converted; the plan's prose is not — "y = 1.2 m up" is z = 1.2,+"+z towards the camera" is −y. Sizes here are width × depth × height (the plan's width ×+height × depth reordered).++## Allowed imports+`bpy`, `bmesh`, `mathutils` (Vector, Matrix, Euler, noise), `math`, `numpy` (randomness only+through `numpy.random.default_rng(seed)`), `itertools`, `functools`, `collections`,+`dataclasses`, `colorsys`, and `from env import …` (module-level names of `env.py`).++## Forbidden (lint ERRORs that fail the build gate)+`bpy.ops.render.*`, `bpy.ops.wm.*`, `bpy.ops.export_*`, `bpy.ops.import_*`,+`bpy.ops.image.save`, `bpy.data.libraries`, `bpy.data.cameras.new` / `bpy.ops.object.camera_add`,+any `scene.render.*` / `scene.cycles.*` / `scene.eevee.*` / `scene.view_settings.*` /+`scene.display_settings.*` / `scene.camera` / `scene.frame_*` assignment, `frame_set`,+`bpy.app.handlers`, `bpy.app.timers`, a driver whose expression needs Python (`use_self`,+attribute access, `**`, `%`, `noise.*`), the world outside `src/env.py`, `random.*` and+unseeded numpy, `open()`, `os` / `sys` / `pathlib` / `time` / `datetime` / `subprocess` /+`shutil` / `tempfile` / `glob` / `io`. WARN: `bpy.ops.mesh.primitive_*` inside a loop (each+call rebuilds the scene state), `bpy.ops.view3d.*` / `bpy.ops.screen.*`.++## Blender 5.2 API facts (a build error or a silent zero)+Removed: `use_nodes` (materials, worlds and lights always have a tree; a new material carries+`Principled BSDF` and `Material Output`), `sky_type = 'NISHITA'` (`'MULTIPLE_SCATTERING'`, with+`aerosol_density`), boolean `'FAST'` (`FLOAT` / `EXACT` / `MANIFOLD`), `mod["Socket_2"] = v`+(`getattr(mod.properties.inputs, "Socket_2").value = v`), `Action.fcurves` (slotted:+`action.layers[0].strips[0].channelbag(action.slots[0]).fcurves`), `Mesh.calc_normals()` and+`use_auto_smooth` (`me.shade_smooth()` or `f.smooth = True`), the Principled inputs `Specular` /+`Subsurface` / `Transmission` / `Emission` (now `Specular IOR Level`, `Subsurface Weight`,+`Transmission Weight`, `Coat Weight`, `Sheen Weight`, `Emission Color` + `Emission Strength`),+`ShaderNodeMixRGB` (`ShaderNodeMix` with `data_type = 'RGBA'`: inputs 6 / 7 the colours, output+2 the result; the mix input is `Factor`). Background mode: `bpy.context.object` /+`selected_objects` are empty after `bpy.data.objects.new` — keep your own references.+`bm.verts[i]` raises before `ensure_lookup_table()`. A fresh object's `matrix_world` is+identity until the view layer updates (compose `parent.matrix_world @ child.matrix_basis` or+`bpy.context.view_layer.update()`). Geometry nodes: a new tree has no sockets or nodes —+`ng.interface.new_socket(name, in_out='INPUT' | 'OUTPUT', socket_type='NodeSocketGeometry')`,+add the `NodeGroupInput` / `NodeGroupOutput` nodes yourself,+`obj.modifiers.new(name, 'NODES').node_group = ng`.++## What the renderer does with what you build+Cycles at 32 samples + OIDN, AgX, exposure 0, 1024 × 576; no post chain, no bloom: an emissive+at strength 3–8 reads as a lamp, 20+ whites the frame (`blown_frac`), and a lamp beside it is+what lights the wall. Light is physical: a Sun in W/m², lamps in Watts; starting points that+passed on a mid-albedo ground — a day Sun of 2–5 W/m² under a sky world at strength 0.2–0.5, a+dusk or night lit by practicals (an emissive skin plus a Point light with a radius), a moon+0.05–0.3, fog density 0.003–0.008. Hue, material and geometry work are invisible on near-black+pixels. A SURFACE shader always has a silhouette: a soft particle (steam, smoke, dust, spray)+renders edgeless only as a VOLUME — a material whose only linked output is the Material+Output's `Volume`, fed by a `ShaderNodeVolumePrincipled`; a translucent puff, metaball, torus+or disc is `hard_edged_particles`. The census is the evaluated depsgraph (modifiers, geometry+nodes and instances count as rendered; a volume-only mesh is fog, never a placed thing).+Triangle budgets: 15 000 per asset, 40 000 per hero, 3 000 000 unique for the scene.++## Motion+Animation is DATA: `obj.keyframe_insert(data_path, frame=ctx.frame(t))` at the two times (a+location, rotation, shape key, node input), or a SIMPLE driver of `frame`+(`fc = obj.driver_add("rotation_euler", 2)`, `fc.driver.expression = "frame * 0.1"` — sin / cos+/ min / max / clamp / lerp, `+ - * /`, comparisons; anything needing Python evaluates to 0 in+a `--factory-startup` build). Set each `keyframe_points[].interpolation = 'LINEAR'` for a+travel. The build differences the two frames per camera: a camera moves when ≥ 0.4 % of its+pixels change by more than 8/255; none moving is `no_motion` (ERROR), the judge's+`nothing_moves`. Amplitudes that registered: ≥ 0.10 rad, ≥ 0.05 m per 1.5 s, a particle /+leaf / boat ≥ 0.6 m. A hero GLB's own clip plays in every instance by itself.++## Naming+PascalCase, globally unique (a second `Lantern_0` becomes `Lantern_0.001` and reports a prop+nobody planned): number every copy `f"{base}_{i}"`, never reuse a base across zones. The+census classifies by name: `Ground…` / `Terrain…`, `Water…`, distant backdrop `Sky…` (a+sky-named mesh wider than 50 m is backdrop, not content), an interior's shell `RoomShell…` /+`Ceiling…` (the overview rig lifts the lid).++## Placement (`3dcode check-placement`, on every build)+Every root object linked into a zone (a mesh, a parent Empty with children, a collection-+instance Empty) is ONE row. From its lowest evaluated vertices the gate looks down for the+nearest surface and up for one through it: a gap > 0.05 m outdoors / 0.02 m indoors is+`floating` (ERROR at 0.08 m, or more than 2 floaters); buried > 0.10 m is `sunken` (ERROR at+0.20 m and a fifth of the height; rocks, posts and bushes may sit partly in; a foot at or under+water is fine); touching nothing `unsupported`; two boxes sharing > 10 % of the smaller+`interpenetration` (ERROR at 35 %). The feet are the foot band — the evaluated vertices within+max(0.02 m, 5 % of its height) of the lowest, sampled as up to 5 columns. Seat a root by moving+it by the smallest `ctx.height_at(x, y) - z` over that band's world-space vertices (children and+the instanced collection through the Empty's matrix included), or onto its support's top; keep+any two roots' world boxes from sharing > 10 %. Four or more foot columns with at most one+touching and a gap > 0.05 m is `cantilevered` (WARN). `obj["placement"] = "free"` only for+things MEANT to hang (WARN past 25 % tagged, ERROR past 50 %). Geometry-nodes instance clouds+are exempt per asset. A planned content entirely outside the bounds + max(5 m, 10 % of the+span) is `out_of_bounds` (WARN); an asset placed beyond 2.5 × the plan's size is a WARN, 4 × an+ERROR — never re-scale an instance to fit; a chimney or pipe that must reach further is a+separate object. Place an asset as a collection-instance Empty (`bpy.data.objects.new(name,+None)`, `instance_type = 'COLLECTION'`, `instance_collection = ctx.assets['<snake>']`).++## What else the gates measure+`scene_frames` (`3dcode scene-views`), every authored camera at both times: `dark_frame` (mean+luminance < 0.12 or > 35 % near-black, cap 0.55), `blown_frame` (> 20 % near-white),+`flat_frame` (> 85 % of pixels in one band; ERROR above 92 %), `content_small` (establishing+camera ≥ 20 % content, others ≥ 10 %), `camera_in_geometry` (inside or within 0.5 m of a+surface), `camera_blocked` (6 of 9 sight rays within 1.5 m), `camera_underground` — the camera+findings cap at 0.50; eye < 0.3 m above the ground `camera_low`, > 80 m `camera_high` (WARN).+`hero_unseen`: a hero covering < 0.5 % of the frame in every camera is an ERROR (< 2 % in its+named camera a WARN). `scene_probe` (`3dcode scene-probe`): unique triangles over 3 000 000, a+Python driver or app handler, no world, no atmosphere (`no_fog`: neither a world Volume nor a+bounded fog volume), render settings touched. Outdoors `fog_short` warns when 1 / density <+span / 1.5 and `world_edge` when no standing geometry reaches 1.25 × the bounds half-extent. A+dropped zone / asset / env is an ERROR on its line.++## Interiors+`interior: true`: the enclosure (floor, walls, lid named `RoomShell…` / `Ceiling…`) is+`src/env.py`'s; it must read enclosed from every camera and be lit inside; the floating+threshold indoors is 0.02 m. Zones dress the inside; a partition or counter a zone needs is the+zone's, seated and clear of the shell.++## Realism (judged)+Every large surface varies at more than one scale — broad tone and wear over metres AND fine+grain or bump over centimetres — in a node tree you wire (Noise / Voronoi / Wave through Mix and+Bump); one constant colour per surface is `placeholder_material` / `flat_ground`. A tree is a+trunk branching into limbs carrying leaf or needle cards, a rock an irregular asymmetric mass —+never a cone, a ball on a stick or a cube (`asset_quality_detail`); one shape stamped many times+is `monotonous_vegetation`. The world continues past the content in every frame+(`world_edge_visible`). The brief's time of day is a hard constraint, decided once in+`src/env.py` and shared through the dict `build_env` returns.++## Asset modules+`build_<snake>(ctx, variant=0)` links every part into `ctx.collection` (pre-made, active) and+returns it: at the origin, lowest point z = 0, footprint centred, front −Y, sized as the plan+states (ERROR beyond 2.5 × or under 0.4 × on any axis); zones instance it at scale 1 and never+call it. Imports `bpy`, `bmesh`, `mathutils`, `math`; no lights, cameras, world, file IO,+ground plane. Every part has a Principled material with a real colour and roughness, varied+at more than one scale; unique PascalCase names, one root mesh or children parented at+RELATIVE locations; ≤ 15 000 triangles. `variant` changes the SILHOUETTE when several copies+are placed; `ctx.rng(seed)` varies details. A moving part (when the description names one) is+keyframed on its OWN rotation/location with its origin at the pivot (≥ 0.15 rad or ≥ 0.05 m+registers). Every sub-shape overlaps a neighbour by ≥ 2 mm; the lowest point is exactly z = 0.++## The loop+write → `3dcode build` → `3dcode check-placement` → seat what floats, lift what sank, separate+what overlaps → `3dcode build` → `3dcode scene-views` → read `camera_checks.mean_lum` per+camera and the MEASURED MOTION line, OPEN the sheet → fix the lighting → `3dcode scene-probe`+for the census (triangles, drivers, the world) → repeat → `3dcode check` clean. Get the floor+and the light right; spend everything after that on the brief.diff --git a/harness/skills/3d-lang-scene-blender/references/interface.md b/harness/skills/3d-lang-scene-blender/references/interface.mdnew file mode 100644index 00000000..f7de2b10--- /dev/null+++ b/harness/skills/3d-lang-scene-blender/references/interface.md@@ -0,0 +1,62 @@+# Two modules the build runs as-is (the interface shown once; the content is a harbour, yours is the brief's)++`src/env.py`+```python+"""src/env.py — the environment of `Harbour at dusk`: world, sun, ground, atmosphere."""+import math+import bmesh+import bpy++SUN_AZIMUTH_DEG, SUN_ELEVATION_DEG = 250.0, 8.0 # the plan's light (compass 0 = +X, 90 = +Y); zones may `from env import` these+WORLD_M = 320.0 # how far this place's land and air reach (plan span 100 m)++def height_at(x, y): # THE ground: any function of (x, y) the brief's landform needs+ return -2.0 * min(1.0, x / 25.0) if x >= 0.0 else 0.04 * max(0.0, -45.0 - x)++def linked(ctx, name, bm, mat): # code zones share lives here (`from env import linked`)+ me = bpy.data.meshes.new(name); bm.to_mesh(me); bm.free(); me.materials.append(mat)+ ctx.collection.objects.link(ob := bpy.data.objects.new(name, me))+ return ob+```+```python+def build_env(ctx):+ ctx.scene.world = bpy.data.worlds.new("Dusk") # REQUIRED: a world — its sky is the brief's+ sun = bpy.data.objects.new("Sun", bpy.data.lights.new("Sun", "SUN")) # REQUIRED: a lamp; a Sun shines down its own -Z+ sun.rotation_euler = (math.radians(90.0 - SUN_ELEVATION_DEG), 0.0, math.radians(SUN_AZIMUTH_DEG + 90.0))+ ctx.collection.objects.link(sun)+ ground = bpy.data.materials.new("GroundMat") # STAND-IN: one constant colour is graded flat_ground+ bm = bmesh.new(); bmesh.ops.create_grid(bm, x_segments=160, y_segments=160, size=WORLD_M / 2) # size is the half-side+ for v in bm.verts: v.co.z = height_at(v.co.x, v.co.y) # REQUIRED: the ground samples height_at+ linked(ctx, "Ground", bm, ground)+```+```python+ haze = bpy.data.materials.new("Haze"); nodes = haze.node_tree.nodes; nodes.remove(nodes["Principled BSDF"])+ vol = nodes.new("ShaderNodeVolumePrincipled"); vol.inputs["Density"].default_value = 1.0 / WORLD_M # 1 / density >= span / 1.5+ haze.node_tree.links.new(vol.outputs["Volume"], nodes["Material Output"].inputs["Volume"]) # REQUIRED: an atmosphere, volume-only+ bm = bmesh.new(); bmesh.ops.create_cube(bm, size=1.0); bmesh.ops.scale(bm, vec=(WORLD_M, WORLD_M, 30.0), verts=bm.verts)+ linked(ctx, "Atmosphere", bm, haze).location.z = 15.0+ return {"ground_material": ground, "water_level": 0.0}+```++`src/zones/quay.py`+```python+"""src/zones/quay.py — zone "Quay": the granite quay deck with its bollards."""+import bmesh, bpy+from env import linked++CENTRE, DECK_TOP, N_BOLLARDS = (-20.0, 0.0), 1.2, 6 # the plan's zone centre, deck height and count, in this frame++def build(ctx):+ rng = ctx.rng(11)+ granite = bpy.data.materials.new("QuayGranite") # STAND-IN surface: the deck's granite is yours to wire+ bm = bmesh.new(); bmesh.ops.create_cube(bm, size=1.0); bmesh.ops.scale(bm, vec=(40.0, 60.0, DECK_TOP), verts=bm.verts)+ deck = linked(ctx, "QuayDeck", bm, granite) # one mesh = one placement row+ deck.location = (*CENTRE, ctx.height_at(*CENTRE) + DECK_TOP / 2) # its lowest vertices on the (level) ground+ for i in range(N_BOLLARDS): # along the water edge, ON the deck+ copy = bpy.data.objects.new(f"Bollard_{i}", None) # a collection-instance Empty = one placement row+ copy.instance_type, copy.instance_collection = "COLLECTION", ctx.assets["bollard"]+ copy.location = (CENTRE[0] + 18.0 + rng.uniform(-0.2, 0.2), CENTRE[1] - 25.0 + i * 10.0, DECK_TOP) # the deck top is its ground+ copy.rotation_euler.z = rng.uniform(0.0, 6.283)+ ctx.collection.objects.link(copy)+ return ctx.collection+```diff --git a/harness/skills/3d-lang-scene-threejs/SKILL.md b/harness/skills/3d-lang-scene-threejs/SKILL.mdnew file mode 100644index 00000000..c43579e8--- /dev/null+++ b/harness/skills/3d-lang-scene-threejs/SKILL.md@@ -0,0 +1,159 @@+---+name: 3d-lang-scene-threejs+description: "Use when writing, refining or repairing a scene in three.js (language scene_threejs): the module files and their exact exports (createScene, env heightAt/buildEnv/SUN_AZIMUTH_DEG, zone build, asset build<Name>), the Y-up metre frame, imports and the forbidden list, the harness-owned src/lib toolbox, the thresholds check-placement, scene-views (exposure, camera, motion) and scene-probe measure, naming, and the 3dcode loop."+license: Apache-2.0+compatibility: three r182 ESM in headless Chrome (WebGLRenderer, shadows, ACES, sRGB, a post chain with GTAO + selective bloom) driven by the 3dcode build; every authored camera rendered at t = 0 and t = 1.5 s.+metadata:+ verified: "2026-11-07"+---++# three.js scenes++You write RAW ESM modules: `import * as THREE from 'three'`, `three/addons/*`, your own+relative files and the harness-owned `src/lib/*.js` — nothing else. The build owns the+renderer, the render loop and the export; you build the scene graph and the cameras.++## Files (Y up, +Z front, metres)+```+src/scene.js export async function createScene({ THREE, renderer, loaders }) → { scene, cameras, update(t, dt) }+src/env.js export function heightAt(x, z); export function buildEnv(ctx) → { update(t, dt) }; export const SUN_AZIMUTH_DEG+src/zones/<snake>.js export function build(ctx) → THREE.Group (ctx = { THREE, scene, renderer, loaders, heightAt, env, assets })+src/assets/<snake>.js export function build<Asset>(THREE, opts = {}) → THREE.Group (procedural; lowest point on y = 0)+src/shaders/<snake>.js export function make<Name>Material(THREE, opts = {}) → ShaderMaterial | patched material+src/lib/*.js HARNESS-OWNED effect library (references/effects-catalog.md); import and call; edits are reverted+public/assets/<snake>.glb optional Blender-built heroes; scene.js preloads each into ctx.assets['<snake>']+```+The build serves the workspace over http (`public/assets/` at `/assets/`), imports+`src/scene.js` in headless Chrome with the real `THREE`, a configured `WebGLRenderer` and+`loaders = { gltf, texture, cube, manager }`, awaits `createScene`, validates the return+value, renders every camera at t = 0 and t = 1.5 s (calling `update`) and probes (tris, draw+calls, console/shader errors, camera checks, exposure, content, the frame difference). The+plan's `bounds` are what the census and placement gate measure against; the world a camera+sees extends past them as far as the brief needs. `references/interface.md` has the wiring+of `scene.js` and the env module's shape.++## createScene+* `scene`: a `THREE.Scene`; `scene.fog` and `scene.background` set (unset = `no_fog` /+ `no_background`, ERROR); `scene.environment` an environment texture (metals and glass render+ near black without one). Whatever a camera sees ends in something the brief justifies.+* `cameras`: a non-empty list of PLAIN objects `{ name, position: [x, y, z], lookAt: [x, y, z], fov }`+ (the build makes the PerspectiveCameras: aspect 16/9, near 0.1). PascalCase names from the+ plan; `cameras[0]` is the establishing view (≥ 20 % content; others ≥ 10 %,+ `content_small`). Eye ≥ 0.3 m above the ground under it (`camera_low` WARN; `camera_high`+ above 80 m), ≥ 0.5 m from every surface and not inside geometry (`camera_in_geometry`, ERROR,+ cap 0.50), at most 5 of its 9 sight rays ending within 1.5 m (`camera_blocked`, cap 0.50), the+ line of sight to `lookAt` not cut in its first half; below the terrain is `camera_underground`+ (cap 0.50) — compute y from `heightAt(x, z)`, never guess.+* `update(t, dt)`: cheap (no allocations, traversals or material creation — cache lists at+ build time) and deterministic (same t → same frame). It fans out to `env.update` and every+ zone's `group.userData.update`; `tickEnv`, `userData.tick` and `build<Zone>(ctx)` are never+ called — a hook nobody calls stands still, and calling a missing hook throws.+* `src/env.js`: `heightAt(x, z)` is the surface every zone seats on — deterministic, cheap,+ `0` for a flat floor; every walkable surface (a path, a deck) is part of it, and it must agree+ with the ground mesh. `SUN_AZIMUTH_DEG` is a plain numeric `export const` (read by regex to+ put the overview rig on the sun side). Anything else it exports is a convention between it+ and the zones.++## Imports and sandbox+Only `three`, `three/addons/*`, relative files and `src/lib/*.js` resolve; no CDN, no other+package, no `three/webgpu` / `three/tsl`. Shader text: `.vert` / `.frag` / `.glsl` files under+`src/shaders/`, loaded in async `createScene` with+`new THREE.FileLoader(loaders.manager).loadAsync(new URL('./shaders/x.frag', import.meta.url).href)`+— no bundler `?raw`, no `#include` of your own files (Three's `#include <chunk>` is its+built-ins only); never load or compile during `update`. Forbidden: `document.*` / `window.*`+except `window.innerWidth` and `document.createElement('canvas')` for a procedural texture;+network, arbitrary `fetch` / XHR; `Math.random()` (`mulberry32(seed)` from `lib/noise.js`);+`Date.now()` / `performance.now()` (use `t`); `requestAnimationFrame`; creating a renderer or+changing its settings; environment sniffing; `EffectComposer` (nothing reads one). Textures:+procedural (incl. DataTextures) or `loaders.texture` for files present in the workspace.++## What is measured+* **Placement** (`3dcode check-placement`; runs on every build): each direct child of a zone+ group is ONE placed object; from its lowest vertices the probe looks down for the nearest+ surface and up for one passing through it. Gap under the foot > 0.05 m outdoors / 0.02 m+ indoors = `floating` (ERROR at 0.08 m, or more than two floaters); buried > 0.10 m = `sunken`+ (ERROR at 0.20 m and > 20 % of the height; buried, slope-following and water-level feet are+ exempt); a bbox touching nothing = `unsupported`; two boxes sharing > 10 % of the smaller =+ `interpenetration` (ERROR at 35 %). A Group of several props is ONE box, their union, and+ every prop inside reads as interpenetrating it: one placed thing = one direct child; many of+ one thing = one `InstancedMesh` (a scattered instance inside a placed thing is that thing's+ interpenetration). `obj.userData.placement = 'free'` for things meant to hang (WARN when+ > 25 % are tagged, ERROR past 50 %). Four or more foot columns with at most one touching and+ a gap > 0.05 m is `cantilevered` (WARN). A placed asset is measured against the plan's+ `approx_size_m`: WARN beyond 2.5 × (or under 1 / 2.5), ERROR beyond 4 × — never re-scale to+ fit or stretch a clone; a chimney or cable that must reach further is a separate object.+* **Bounds and density**: a planned content entirely outside the bounds + max(5 m, 10 % of the+ span) is `out_of_bounds` (WARN; scenery past them is never reported); a zone group missing or+ empty `zone_empty`; a planned asset not placed `missing_content`; a zone under half its+ layout's count an INFO `density_note`.+* **The world's extent** (exteriors): standing geometry ≥ 2 m tall reaches ≥ 1.25 × the bounds+ half-extent (`world_edge`, WARN); fog far ≥ 2 × the plan span, or for `FogExp2`+ 1 / density ≥ span / 1.5 (`fog_short`); ≥ 8 same-size copies evenly on a ring is+ `stamped_ring`.+* **Frames** (`3dcode scene-views`, per authored camera): mean luminance < 0.12 or > 35 %+ near-black pixels = `dark_frame` (unless luminance std ≥ 0.12 with ≤ 35 % near-black: low-key+ but lit); > 20 % blown = `blown_frame`; > 85 % of the pixels in one band = `flat_frame`+ (ERROR above 92 %); plus the camera checks and `content_small` above. Exposure is gated+ before anything is judged: a frame that fails scores nothing for what is in it. Non-solid+ cards near a camera read as geometry to the raycast — `mesh.raycast = () => {};`.+* **Motion**: the t = 0 and t = 1.5 s frames differenced per camera; a camera MOVES when ≥ 0.4 %+ of its pixels change by more than 8/255 (or ≥ 0.08 % by more than 60/255). No authored camera+ moving is `no_motion` (ERROR) and the judge's `nothing_moves`. Sub-centimetre sway is+ invisible at 1024 × 576: foliage ±0.10–0.20 rad, particles ≥ 0.6 m per 1.5 s, water ≥ 3 cm or+ a scrolling normal have passed.+* **Hero** (`hero_unseen`): a `public/assets/*.glb` covering < 0.5 % of the frame in EVERY+ camera is an ERROR; < 2 % in the camera the plan names for it a WARN. A hero is visible only+ if a zone clones `ctx.assets['<snake>']` (its pivot is at its base; clips play by themselves;+ `clone.userData.clipOffset = <s>` de-phases a copy).+* **Budget** (`3dcode scene-probe`): WARN above 5 000 draw calls, ERROR above 15 000;+ 3 000 000 unique triangles. `InstancedMesh` and merged static geometry are the cheap repeats.+* **Shaders**: a console or shader error in any module is a build finding; `3dcode+ shader-probe` compiles a material before it renders black.+* **Assets**: a procedural asset module is built in node when written; one instance ≤ 15 000+ triangles, lowest point y = 0, footprint centred, size the plan's (ERROR beyond 2.5 × or under+ 0.4 × on any axis, and on a single-box blockout). Set `group.userData.size = [w, h, d]`;+ optional `group.userData.update = (t, dt) => {}` which the placing zone caches and calls.+ `opts.seed` / `opts.variant` vary details deterministically; `variant` changes the SILHOUETTE.++## Naming+Zones are Groups named PascalCase (plan names); assets PascalCase; every animated object has a+stable `.name`; `mat.name = 'Water'` on ShaderMaterials; the ground mesh `Ground`; backdrop+geometry beyond the content `Sky…` (classified as sky, so it does not inflate the content box);+an interior's lid meshes `Ceiling…` / `RoomShell…` (the overview rig lifts them).++## Requirements that hold for every brief+* The brief's time of day and weather are hard constraints the judge compares every frame+ against; a night brief under a noon sky is the wrong scene whatever stands in it. Flat fill+ (`AmbientLight`, a hemisphere with no key) turns a lit night into a grey wash: add light where+ the brief's sources are, give dark materials a low but non-zero albedo (albedos in 0.02–0.8+ linear; ACES at exposure 1.0). Shade may stay dark but must carry colour.+* The environment is judged as heavily as the props (`brief_fidelity`, `lighting_atmosphere`,+ `flat_ground`, `diorama_look`): a default sky over default green ground is unfinished.+ Distant forms pre-tinted toward the fog render BRIGHTER than the terrain and read as cardboard+ (`placeholder_material`); natural colour, darkened, left to the fog, reads as haze.+* An interior (`interior: true`) must read enclosed from every camera — walls and a ceiling+ exist in every frame, lit from the sources the brief names (a closed room with no openings and+ no practicals renders black). `roomShell` in `lib/environment.js` is one option.+* Shadows: `castShadow` on the light AND the meshes, `receiveShadow` on what they fall on; a+ shadow texel larger than ~0.05 m over the content reads as jagged (judged) — `sunRig({ bounds })`+ with the CONTENT radius fits frustum, map size and bias.+* Emissives bloom through the post chain (GTAO + selective bloom + an identity grade unless+ `scene.userData.grade` is set): author practicals at peak 1.5–4, not 20;+ `material.userData.bloom = false | true | <colour>` opts a material in or out.+* A sky-dome material needs `fog: false`, `side: THREE.BackSide`, `depthWrite: false` (and the+ tonemap / colorspace chunks `makeShaderMaterial` adds) or it renders black or fogged.+ `mergeGeometries` returns `null` on mismatched attributes. Inside a shoreline the terrain+ lies below the water level or the shore z-fights.+* Soft particles: a bounded density volume or a radial-alpha sprite; bare `PointsMaterial`+ squares, spheres or polygon sparks are `hard_edged_particles`.+* A `blender_glb` hero is built in its own workspace (track `static_object`, language+ `blender`) and its `artifacts/object.glb` copied to `public/assets/<snake>.glb`.++## The loop+write → `3dcode build` → `3dcode check-placement` (every floating / sunken / interpenetrating+row with the metres to move it) → fix → `3dcode build` → `3dcode scene-views` → read the frame+table (`mean_lum`, `lum_std`, `dark_frac`, `blown_frac`, `content_frac`, MEASURED MOTION per+camera) and OPEN the sheet → `3dcode scene-probe` for the census → repeat → `3dcode check`+clean. A module that throws takes the whole frame black; a zone that throws is dropped and+scores nothing — never wrap it in try/catch to hide it. A simple scene that is seated, lit and+legible beats an elaborate one that floats in the dark.diff --git a/harness/skills/3d-lang-scene-threejs/references/effects-catalog.md b/harness/skills/3d-lang-scene-threejs/references/effects-catalog.mdnew file mode 100644index 00000000..8068d341--- /dev/null+++ b/harness/skills/3d-lang-scene-threejs/references/effects-catalog.md@@ -0,0 +1,49 @@+# `src/lib/` — the shipped effect library, an optional toolbox++Harness code copied into the workspace by `3dcode init`, compiled and rendered on THIS+renderer; it carries the depth and fog chunks a hand-written shader silently loses. Importing+it is allowed where "never import a helper SDK" forbids everything else; edits to it are+reverted. Import with a relative path (`src/zones/x.js` and `src/assets/x.js`:+`'../lib/grass.js'`; `src/scene.js`: `'./lib/grass.js'`), and only the names you CALL (120+unused imported names were measured over six scenes). Each module's JSDoc lists its options+and bounds: an option left out takes its default, an invalid one throws a RangeError naming it.++| Want | Call |+| --- | --- |+| a close-view fractured rock or a talus field | `makeRock({ type: 'sandstone', size: [2, 1.5, 2], seed, moisture: 0.2 })` · `makeRockField` — `lib/rock.js`; sandstone / granite / basalt; rests at local y≈0 |+| a grassy surface | `makeGrass({ extent, density, height, heightAt, patchy })` — `lib/grass.js` |+| a complete near/middle-distance tree or shrub | `makeTree({ species: 'oak', height: 6, crownRadius: 2.5, leafDensity: 1, seed, wind: { dir: [1,0.3], strength: 0.5, speed: 1 } })` · `makeShrub` — `lib/tree.js`; oak / birch / willow, separate leaf cards, root at y=0, envelope in `userData.bounds`; heavy by default — `leafSegments: 4`, lower `maxLeaves` / `leafDensity` for repeats |+| trees, bushes, leaves | `patchLeafSSS` · `patchWind` · `patchRootContact` — `lib/foliage_shade.js` |+| ground and cliff geometry | `ground({ size, rand: mulberry32(seed), relief, flat })` → `{ mesh, height }` (the env's `heightAt` must return its real height) · `cliff({ length, height, rand })` — `lib/terrain.js` |+| countryside continuing beyond the content | `makeOutskirts({ inner, baseY, heightAt, shellRadius, colors, seed })` — `lib/environment.js`; one option for a rural setting |+| the sun, the fill and the baked environment | `sunRig({ azimuth, elevation, bounds })` — `lib/environment.js` → `{ sun, fill, sunDisc, envTex, sunDir }`; add the lights, `scene.environment = rig.envTex` |+| a rectangular interior's walls, ceiling and openings | `roomShell({ center, extents, openings, thickness, wallColor, ceilingColor, glazed, frameColor, bay })` — `lib/environment.js`; `glazed: true` for a conservatory / greenhouse |+| the sky itself | `makeSky(scene, { rig })` — `lib/sky.js`; the dome IS the backdrop |+| paper, wax, jade, petals; oil film, beetle shell | `patchTranslucency` · `patchIridescence` — `lib/finish.js` |+| a textured standard material without a texture file | `brick` · `granite` · `cobble` · `asphalt` · `weatheredWood` · `brushedSteel` · `fabric` · `foliage` · `soil` · `skin` · `glass` (21 in all) · `tint(mat, variant)` — `lib/materials.js` |+| noise on the CPU | `fbm2` · `fbm3` · `mulberry32` · `displaceY` — `lib/noise.js` |+| your own shader, safely | `makeShaderMaterial` · `patchStandard` · `shadowLike` · `tickShaders` · `clonePatchedMaterial` — `lib/shader.js` |+| a scoped synchronous offscreen capture | `withRendererState(renderer, callback)` — `lib/shader.js` |+| explicit cleanup for a procedural group | `snapshotResources(group)` · `attachDisposal(group, resources)` — `lib/lifecycle.js` |++Rules that apply to all of them:++1. **`patch*` entries chain** — any number on one material, in any order; prefix your own GLSL+ helpers (the library's are `astra…`). Copy a patched material with `clonePatchedMaterial`,+ not `.clone()`.+2. **Moving factories carry `userData.update(t, dt)`** (absolute seconds) and+ `userData.dispose()`: store what they return and call `update` exactly ONCE per frame from+ the zone's `userData.update`. Anything built with `patchStandard` is driven instead by one+ `tickShaders(scene, t)` in `scene.js`'s `update`. Their dimensions and height queries are+ LOCAL; `userData.sampleHeight(x, z)` returns the surface height or `null` off the patch.+3. **Shadows**: trees cast real moving shadows by default, grass behind `shadows: true`; a+ displaced lattice of your own needs `shadowLike` or the shadow is cast by the undisplaced+ geometry.+4. **This renderer**: a post chain is on (GTAO, selective emissive bloom, identity grade unless+ `scene.userData.grade = { exposure, contrast, saturation, warmth, tint }`); ACES at exposure+ 1.0, sRGB out; `logarithmicDepthBuffer` is off (the library's log-depth chunks compile to+ nothing — leave them). Pass `sunDir` / the rig; never hardcode a light colour in an effect.++A closed displaced surface for a crown (an icosahedron with noise) has no silhouette, lets no+light through and carries one hue — measured hue spread 3.6° vs 9.4° for separate leaf cards+(a photograph: 25–45). Any construction that gets there is fine; `makeTree` is the shipped one.diff --git a/harness/skills/3d-lang-scene-threejs/references/interface.md b/harness/skills/3d-lang-scene-threejs/references/interface.mdnew file mode 100644index 00000000..2d811ada--- /dev/null+++ b/harness/skills/3d-lang-scene-threejs/references/interface.md@@ -0,0 +1,47 @@+# The wiring (the interface, nothing else)++`src/scene.js` is the only caller of your modules; `3dcode init` copies a starter with this+shape — keep it and fill the camera list from the plan:+```js+import * as THREE from 'three';+import { buildEnv, heightAt } from './env.js';+import { build as buildQuay } from './zones/quay.js'; // one import per zone+export async function createScene({ THREE, renderer, loaders }) {+ const scene = new THREE.Scene();+ const assets = {}; // ctx.assets['<snake>'] ← each public/assets/<snake>.glb via loaders.gltf+ const ctx = { THREE, scene, renderer, loaders, heightAt, assets };+ const env = (await buildEnv(ctx)) || {}; ctx.env = env; // ONE argument: ctx+ const zones = [await buildQuay(ctx)]; for (const g of zones) scene.add(g); // each a Group / Object3D+ const cameras = [{ name: 'Establishing', position: [0, 1.7, 30], lookAt: [0, 2, 0], fov: 50 }]; // the plan's list+ function update(t, dt) { if (env.update) env.update(t, dt); for (const z of zones) if (z.userData.update) z.userData.update(t, dt); }+ return { scene, cameras, update };+}+```++`src/env.js`+```js+import * as THREE from 'three';+export const SUN_AZIMUTH_DEG = 250; // the plan's light, a plain number (0 = +X, 90 = +Z; read by regex)+export function heightAt(x, z) { return 0; } // the brief's surface — any function of (x, z) that agrees with the ground mesh+export function buildEnv({ THREE, scene }) {+ // the brief's sky, light, ground (a mesh named 'Ground…' sampled from heightAt) and atmosphere:+ // scene.fog + scene.background set (no_fog / no_background), scene.environment an env texture+ return { update(t, dt) {} }; // the ONLY env hook the assembler calls+}+```++A zone module is `export function build(ctx) → THREE.Group` named after the zone, with its+animation on `group.userData.update`; an asset module is+`export function build<Asset>(THREE, opts = {}) → THREE.Group` with `group.userData.size`.++Shader text from files, inside async `createScene`:+```js+const text = new THREE.FileLoader(loaders.manager);+const [vertexShader, fragmentShader] = await Promise.all([+ text.loadAsync(new URL('./shaders/object.vert', import.meta.url).href),+ text.loadAsync(new URL('./shaders/object.frag', import.meta.url).href),+]);+const material = new THREE.ShaderMaterial({ vertexShader, fragmentShader }); // GLSL 3: glslVersion: THREE.GLSL3, no #version line+```+A hand-written shader loses Three's fog and depth chunks unless built with `makeShaderMaterial`+/ `patchStandard` from `lib/shader.js`.diff --git a/harness/skills/3d-lang-threejs/SKILL.md b/harness/skills/3d-lang-threejs/SKILL.mdnew file mode 100644index 00000000..646f0eea--- /dev/null+++ b/harness/skills/3d-lang-threejs/SKILL.md@@ -0,0 +1,100 @@+---+name: 3d-lang-threejs+description: "Use when writing, refining or repairing a static_object in three.js (language threejs): the ESM files and build* exports the lint expects, the Y-up metre frame and three.js primitive facts (centred on the origin, lathe/torus axes), naming, the import and sandbox rules, what survives GLTFExporter, the thresholds check-contract / check-connectivity / the triangle budget measure, and the 3dcode loop."+license: Apache-2.0+compatibility: three r182 ESM loaded in node by the 3dcode build; export with GLTFExporter exactly as authored.+metadata:+ verified: "2026-11-07"+---++# three.js — static objects++`build(THREE)` returns a `THREE.Group` with at least one mesh; the build owns the renderer,+the export and the cameras (a renderer or render loop in object code is a lint ERROR, a light+or camera a WARN the export ignores).++## Files (ES modules, three r182)+```+src/object.js export function build(THREE) → THREE.Group (the whole object)+src/parts/<snake>.js export function build<Pascal>(THREE) → THREE.Group (one per plan part)+```+`build()` imports the part builders with relative paths, adds each Group to a root Group named+after the object, returns the root. The build loads `src/object.js` in node, calls+`build(THREE)`, validates the Group (no meshes, a NaN / Infinity vertex or an empty bounding box+fails the build naming the part), runs the optional `selfcheck`, exports `artifacts/object.glb`+AS AUTHORED. The lint derives the export name from the file stem (`seat_cushion.js` →+`buildSeatCushion`): misspelt WARN, no `build*` export ERROR, a part file nothing imports WARN+(its geometry is absent). Other relative helper files under `src/` are fine.+`references/interface.md` is the interface, executable.++## Frame, units, placement+* **Y up, +Z front, +X right, metres.** `BoxGeometry(w, h, d)` is x-width, y-height, z-depth;+ `CylinderGeometry` / `ConeGeometry` / `LatheGeometry` axis is Y (a lathe profile is+ `Vector2(radius, y)`, normals outward when the radius runs 0 → R → 0 bottom-up);+ `TorusGeometry`, `PlaneGeometry`, `ShapeGeometry`, `ExtrudeGeometry` lie in XY (extrusion+ along +Z); every primitive is **centred on its origin**, so a part's `position` is its+ CENTRE, not its base — the one term behind most floating and sunken parts here.+* Each part Group is returned at its world pose, geometry in metres, root scale (1, 1, 1)+ (`root.scale.set(...)` makes the bounds and the contract gate disagree). The build warns when+ the object needs > 10 mm of translation to stand on y = 0 centred on the Y axis.++## Naming+* `g.name = "<PartName>"` — the plan's PascalCase; the GLB's top-level node name is how every+ gate finds the part, `new THREE.Box3().setFromObject(root)` is the box `check-contract`+ measures. Unique names (a reused name makes the loader re-parent a node); instances get+ their own (`Leg_0`…`Leg_3`). A mesh with no `.name` is a build warning.+* `root.userData.tick` is never called on this track; the judged pose is what `build` returns.++## Imports and sandbox (the lint)+* Resolve: `three`, `three/addons/...` (e.g. `three/addons/utils/BufferGeometryUtils.js` for+ `mergeGeometries`, `three/addons/geometries/RoundedBoxGeometry.js`), relative `./` files+ under `src/`. A URL, another package, `three/webgpu`, `three/tsl`, a path escaping `src/`,+ a missing file or a name the module does not export is a lint ERROR (`bad_import`).+ Undefined before r182: `mergeBufferGeometries` (now `mergeGeometries`), `three/examples/js/*`,+ `Geometry`, `Face3`, `sRGBEncoding`, `outputEncoding`. `mergeGeometries` returns `null` when+ one input is indexed or lacks an attribute another has (`uv`, `color`).+* Lint ERRORs: `document`, `window`, `navigator`, `localStorage`, `fetch`, `XMLHttpRequest`,+ `WebSocket`, `require()`, `process.`, `eval`, `TextureLoader` / `ImageLoader` / `FileLoader`,+ `WebGLRenderer`, `requestAnimationFrame`. WARN: a camera, a light, a `Scene` as root.+* `Math.random` is replaced by a seeded generator at build; the clock (`Date.now()`,+ `performance.now()`) is not — geometry depending on it differs between the measured and the+ rendered build.++## Materials+* `MeshStandardMaterial` / `MeshPhysicalMaterial` colour, roughness, metalness, emissive and+ vertex colours (`setAttribute('color', …)` + `vertexColors: true`) survive the export.+ `ShaderMaterial`, `MeshToonMaterial` and every texture do not (textures stripped with a build+ warning; a shader material exports plain). A hex colour is sRGB; `material.color.r` is linear.+* An `InstancedMesh` named `Posts` exports as sibling meshes `Posts_0 … Posts_{n-1}` with the+ matrices baked, so the gates see every copy as an instance of `Posts` — and a copy that+ touches nothing is a floating island.++## What is measured+* **`3dcode check-contract`** (the GLB vs the plan): each part's bbox centre and extents within+ max(10 mm, 10 % of the plan extent) per axis — WARN beyond, ERROR beyond 3 ×; lowest point+ within 10 mm of y = 0 (WARN; ERROR past 30 mm); footprint centre within max(10 mm, 10 % of+ the footprint) of the Y axis (WARN); height along the wrong axis is "lying on its side"; a+ top-level node the plan does not name is "not in the plan" — no helper meshes, bounding boxes+ or axes in the GLB.+* **`3dcode check-connectivity`** (per top-level part): contact when the surface gap ≤ 2 mm; a+ part with no contact path to the supported assembly is a floating ERROR (cap 0.60) with the+ translation that closes the gap (parts under 10 mm are INFO); penetration > 2 mm WARN,+ > 10 mm ERROR (cap 0.70); islands under 5 % of the part are `stray_islands` WARN — what a+ merge leaves: a degenerate triangle, a duplicated ring at a lathe seam, a vertex at the origin.+* **Triangle budget** (sized from parts × instances): WARN below 350 per built object (floor+ clamped to 1 500–40 000), ERROR above 20 000 per built object (ceiling 60 000–600 000);+ target about 2 000 per built object; a build over 3 s per built object (≥ 20 s) WARN; killed+ at 300 s. Detail inside a part is invisible to the part-level gates; a new top-level node is+ a part.+* **Build**: a zero extent or radius, or `scale.set(0, 0, 0)` to hide, produces NaN and fails+ the export (`visible = false`, or do not add it).++## Self-check (optional)+`export function selfcheck(THREE, root)` is called on the built group before export; a throw+fails the build as `SelfCheckError` with your message — assert only what you are sure of.++## The loop+write → `3dcode build` → `3dcode check-connectivity` + `3dcode check-contract` → fix → repeat →+`3dcode render-sheet` → OPEN the sheet → `3dcode check` clean → finish. `isolate --part X`+settles "where did that fragment come from". Every WARN and ERROR left at the end goes to the+judge with the renders.diff --git a/harness/skills/3d-lang-threejs/references/interface.md b/harness/skills/3d-lang-threejs/references/interface.mdnew file mode 100644index 00000000..69553b3c--- /dev/null+++ b/harness/skills/3d-lang-threejs/references/interface.md@@ -0,0 +1,31 @@+# The interface, and nothing else (node, [email protected] + GLTFExporter)++`src/parts/body.js`+```js+import * as THREE from 'three';+const SIZE = [0.3, 0.2, 0.3], CENTRE = [0, 0.1, 0]; // this part's plan bbox (world, metres)+export function buildBody(THREE) {+ const g = new THREE.Group(); g.name = 'Body'; // the plan's part name+ const mesh = new THREE.Mesh(new THREE.BoxGeometry(...SIZE), new THREE.MeshStandardMaterial({ color: 0x8a8f98 }));+ mesh.name = 'BodyShell';+ mesh.position.set(...CENTRE); // world pose: the centre, not the base+ g.add(mesh);+ return g;+}+```+`src/object.js`+```js+import * as THREE from 'three';+import { buildBody } from './parts/body.js';+export function build(THREE) {+ const root = new THREE.Group(); root.name = 'Object'; // the plan's object name+ root.add(buildBody(THREE)); // one line per plan part+ return root;+}+export function selfcheck(THREE, root) { // optional+ const box = new THREE.Box3().setFromObject(root);+ if (Math.abs(box.min.y) > 0.01) throw new Error(`object not on ground: min.y=${box.min.y}`);+}+```+What the part is made of — primitives, a lathe profile, an extruded outline, a swept tube,+merged pieces, instanced repeats, raw `BufferGeometry` — is the brief's and the plan's.diff --git a/harness/skills/3d-lang-urdf-blender/SKILL.md b/harness/skills/3d-lang-urdf-blender/SKILL.mdnew file mode 100644index 00000000..45753d6d--- /dev/null+++ b/harness/skills/3d-lang-urdf-blender/SKILL.md@@ -0,0 +1,98 @@+---+name: 3d-lang-urdf-blender+description: "Use when writing, refining or repairing an articulated_object (language urdf_blender): bpy link meshes in src/model.py plus a hand-written src/robot.urdf. The frame rule (joint origin in the parent frame, visual origin = minus the pivot), the FK check, limits and the motion-direction check, mimic couplings, the joint-sweep clearance thresholds, allowed/forbidden URDF, and the 3dcode loop."+license: Apache-2.0+compatibility: Blender 5.2 LTS headless for the links (the blender skill's sandbox and lint apply to model.py); native URDF for the joints; the 3dcode build exports meshes/<link>.glb, checks FK at q=0 and sweeps every joint.+metadata:+ verified: "2026-11-07"+---++# URDF + bpy — articulated objects++You model a MECHANISM, judged while it moves. Links are bpy objects named exactly as the URDF+links; joints are native URDF: the origin in the PARENT link frame, the axis in the joint frame+that origin sets up. The build owns the export and the pose sweep.++## Files+```+src/model.py pure bpy (3d-lang-blender's sandbox and lint apply): per link, the object named exactly as the+ link plus anything parented under it, built in WORLD coordinates at the REST pose (= q = 0).+src/robot.urdf links + joints; every link has ONE <visual> and ONE identical <collision>,+ geometry <mesh filename="meshes/<link>.glb"/>, origin = −(link frame).+```+The build runs `model.py` headless; takes the object named `<link>` plus everything parented+under it as that link's mesh (the wrapper joins them); exports `artifacts/meshes/<link>.glb`+with WORLD coordinates baked in; lints the URDF; checks that FK at q = 0 puts every mesh back+where you authored it within 1 mm (else the build FAILS as `FkInconsistent` and prints the+corrected `<origin>`); fails on a rest-pose penetration deeper than 5 mm (`RestPenetration`);+sweeps every joint (`3dcode joint-sweep`); renders q = 0 plus every joint at both limits for the+judge; builds `object.glb` with one node per link. A link no object matches fails the build+(with a did-you-mean for a case / snake_case mismatch); a visible mesh no link claims fails it+too. `<collision>` missing or different from `<visual>` is a WARN: the VISUAL mesh is collided.+`references/interface.md` is one hinge, end to end.++## Frame rule (measured by the FK check)+* Z up, −Y front, +X right, metres, radians. Object on z = 0 at q = 0 (`3dcode check-contract`+ compares every link's bbox with the plan's: max(10 mm, 10 % of the planned extent) per axis).+* **q = 0 = what you build = the plan's rest pose** (doors closed, drawers in, lids down unless+ the plan's `rest` says otherwise). The judge sees q = 0 and both limits of every joint.+* Write every joint with `rpy="0 0 0"`: link frames are then world-aligned and the arithmetic+ below is subtraction. A rotated origin is accepted (lint INFO) but the visual/collision+ origin must then be the full inverse of the link's FK transform — the FK check prints it.+* Root link frame = world origin. Every other link frame = its joint's PIVOT: a world point ON+ the joint axis (hinge line, slide axis, axle); fixed joints: the attachment point.+* `<joint><origin xyz>` = `pivot_child − frame_parent`.+* `<visual>` AND `<collision>` `<origin xyz>` = `−pivot_link` (root: `0 0 0`), because the mesh+ holds world coordinates and the link frame sits at the pivot. The build verifies this+ numerically and prints the numbers when it is wrong.+* `<axis xyz>` is a unit vector in the JOINT frame (world-aligned with `rpy="0 0 0"`): the world+ direction of the hinge line or slide (non-unit: normalised, WARN; missing: `1 0 0`, WARN).+ Sign: positive q must move the child the way the plan's `motion` word says — the+ `motion_direction` gate moves the joint positively and checks the child's centroid+ displacement within 60° of that word. Wrong way: negate the axis; never swap lower/upper+ (q = 0 must stay the authored rest pose).+* Limits: `revolute` / `prismatic` need `<limit lower upper effort velocity/>` with+ `lower ≤ 0 ≤ upper` (`lower = plan.lower − rest`, `upper = plan.upper − rest`); a missing+ `<limit>` is a load ERROR. `continuous`: `<limit effort velocity/>` only. `fixed`: no+ `<limit>`, no `<axis>`. Lint WARNs: `lower == upper`, a revolute range > 2π (use+ `continuous`), a `<limit>` without effort/velocity.+* Single-root tree: one link no joint moves; every other link the child of exactly one joint+ (ERROR otherwise); no cycles. Anything riding on a moving link is part of that link's mesh or+ a fixed child of it — attached to the base it stays behind and the sweep reports the overlap.+* Names: link name == Blender object name == `meshes/<link>.glb` stem, case-sensitive, a plain+ identifier (`Door.001` means two objects shared a name); `world` is reserved (ERROR); name the+ part, not its state (`door`, not `door_open`: WARN). snake_case of the plan parts+ (PascalCase accepted). Copies of a plan part are separate links `<part>_1..n` with their own+ joints `<joint>_1..n`. Joint names: the plan's, unique.++## Clearance and attachment (`3dcode joint-sweep`)+* Pose set: rest; every movable joint alone at lower, mid and upper (the others at 0;+ `continuous`: 0, ±π/2, π); 8 seeded random full-body combinations when more than one joint+ moves. `<mimic>` followers follow their driver.+* In every sampled pose no two links overlap by more than 2 mm. In a moved pose that is an+ ERROR at any depth — the normal failure of this track is an assembly clean at rest that jams+ at 40° of travel: give each moving link the clearance its WHOLE range needs, and make travel+ limits honest rather than letting links intersect. At rest 2–5 mm is a WARN, > 5 mm fails+ the build. Links joined only by `fixed` joints are one rigid group. A non-watertight link+ gets an estimated depth (`[approx: non-watertight mesh]`).+* Attachment at rest: a `fixed` child within 2 mm of its parent (ERROR beyond); a hinged /+ sliding child's mesh within 10 mm (WARN beyond, ERROR beyond 30 mm; a prismatic child already+ inside its parent's bbox is exempt).+* `3dcode check-connectivity` reports a fragment inside a link smaller than 5 % of its largest+ extent as a stray island.++## Allowed / forbidden+`model.py`: the blender skill's lint, plus `exit()` / `quit()` ERROR, `input()` ERROR,+`time.sleep` / `while True` WARN; every link name must appear as a string literal in `model.py`+(WARN otherwise). URDF: no `<gazebo>`, `<transmission>`, `<sensor>`, xacro, `package://`,+mesh scale (WARN), inline primitives (ERROR: visual geometry must be a `<mesh>`). Inertials+optional. `<mimic joint="..." multiplier="..." offset="..."/>` IS honoured — one per follower+of a one-input mechanism (a coupling naming no joint, itself, a fixed joint, or closing a loop+is a lint ERROR). No triangle-budget gate; the build is killed at 300 s.++## The loop+`3dcode build` (lint, FK at q = 0, rest penetration) → `3dcode joint-sweep` → `3dcode+check-connectivity` + `3dcode check-contract` → fix → repeat → `3dcode render-sheet` → OPEN+the sheet and the pose sheet → `3dcode check` clean. A sweep ERROR blocks the round whatever+the geometry looks like; `3dcode check-contract` compares every link's bbox with the plan —+keep the plan's size and say why in a comment if a number is wrong for the object.diff --git a/harness/skills/3d-lang-urdf-blender/references/interface.md b/harness/skills/3d-lang-urdf-blender/references/interface.mdnew file mode 100644index 00000000..14e35df4--- /dev/null+++ b/harness/skills/3d-lang-urdf-blender/references/interface.md@@ -0,0 +1,41 @@+# The frame arithmetic, end to end (verified by the build + FK check + sweep)++One hinge: a 0.25 m bin body (root, on the ground) and a 10 mm lid resting 1 mm above the rim,+hinged along its back top edge; q = 0 = lid closed. It shows the origins and where they come+from, not how to build anything.++`src/model.py`+```python+import bpy, bmesh+from mathutils import Vector++for name, size, centre in (("body", (0.25, 0.25, 0.35), (0, 0, 0.175)), # root link: frame = world origin+ ("lid", (0.25, 0.25, 0.01), (0, 0, 0.356))): # authored CLOSED (q = 0), 1 mm above the rim+ bm = bmesh.new(); bmesh.ops.create_cube(bm, size=1.0); bmesh.ops.scale(bm, vec=size, verts=bm.verts)+ me = bpy.data.meshes.new(name); bm.to_mesh(me); bm.free()+ o = bpy.data.objects.new(name, me); o.location = centre; bpy.context.scene.collection.objects.link(o)+PIVOT = {"body": Vector((0, 0, 0)), "lid": Vector((0, 0.125, 0.351))} # link frame = a world point on the hinge line+print("lid: joint origin", tuple(PIVOT["lid"] - PIVOT["body"]), "visual/collision origin", tuple(-PIVOT["lid"]))+```+`src/robot.urdf` — the plan's `motion` says the lid opens UP: +q about +X at the back edge would+push the front edge DOWN into the body, so the axis is −X (a sign is fixed by negating the axis,+never by swapping the limits):+```xml+<?xml version="1.0"?>+<robot name="pedal_bin">+ <link name="body">+ <visual><origin xyz="0 0 0" rpy="0 0 0"/><geometry><mesh filename="meshes/body.glb"/></geometry></visual>+ <collision><origin xyz="0 0 0" rpy="0 0 0"/><geometry><mesh filename="meshes/body.glb"/></geometry></collision>+ </link>+ <link name="lid"> <!-- frame at the hinge pivot (0 0.125 0.351) → origin = its negation -->+ <visual><origin xyz="0 -0.125 -0.351" rpy="0 0 0"/><geometry><mesh filename="meshes/lid.glb"/></geometry></visual>+ <collision><origin xyz="0 -0.125 -0.351" rpy="0 0 0"/><geometry><mesh filename="meshes/lid.glb"/></geometry></collision>+ </link>+ <joint name="body_to_lid" type="revolute">+ <parent link="body"/><child link="lid"/>+ <origin xyz="0 0.125 0.351" rpy="0 0 0"/> <!-- pivot_lid - frame_body -->+ <axis xyz="-1 0 0"/> <!-- +q lifts the front edge: the motion word is "up" -->+ <limit lower="0" upper="1.5" effort="5" velocity="2"/>+ </joint>+</robot>+```