Skip to content

Official Codebase of 3DCodeVerse

Python

Merge the plan_scene and scene_refine bpy template twins into one template each (rendered text byte-identical)

gaoypenge418e9590a7a
diff --git a/harness/codeverse3d/prompts/tracks/plan_scene.j2 b/harness/codeverse3d/prompts/tracks/plan_scene.j2
index aec2863a..7c636401 100644
--- a/harness/codeverse3d/prompts/tracks/plan_scene.j2
+++ b/harness/codeverse3d/prompts/tracks/plan_scene.j2
@@ -1,16 +1,43 @@
+{% if language == 'scene_blender' %}
+You are the SCENE DIRECTOR for a Blender (bpy, Cycles) scene that several code-writing models will
+build in parallel from your plan alone (one per asset, one for every zone, one for the environment).
+{% else %}
You are the SCENE DIRECTOR for a real-time three.js scene that several code-writing models will
build in parallel from your plan alone (one per asset, one per zone, one for the environment).
+{% endif %}
Write the plan as exact numbers and concrete nouns; keep it lean (cost matters). The plan states
REQUIREMENTS for the brief's place — what is true, where, in what size — and leaves the
construction to the builders.
+{% if language == 'scene_blender' %}
+THE PLAN'S FRAME: write every number — bounds, zone bboxes, asset sizes (width × height × depth),
+camera positions — in the Y-up GLB frame (Y up, +Z towards the viewer, metres, the ground around
+y = 0 unless the plan puts it elsewhere), exactly as a three.js director would. The builders
+author Blender Z-up modules, and the HARNESS converts every number it prints for them (their
+skeleton, their briefs, the layouts): you never write Z-up numbers, and `environment` prose says
+"y" for up. (The language frame the builders see, for reference: {{ frame_doc }})
+{% else %}
{{ frame_doc }}
The scene uses the same frame: Y up, meters; say where the ground is (it is around y=0 unless
the plan puts it elsewhere).
+{% endif %}
LANGUAGE CONTRACT THE BUILDERS WILL FOLLOW:
{{ contract }}
+{% if language == 'scene_blender' %}
+DESCRIBE, DO NOT PRESCRIBE — every mesh, material, lamp, world and motion is `bpy` / `bmesh` the
+builders write, so describe each thing by what it IS — dimensions, parts,
+materials with colours and how they vary (broad wear and fine grain), and the silhouette features a
+person would name (a pine's whorled limbs carrying needle cards, a boulder's irregular facets) —
+never by a call or a module. A thing repeated across zones (a tree species, a lamp post, a crate)
+is an asset within the triangle budget below. Zone `contents` lists only actual
+asset names; scenery a zone builds itself belongs in its prose, not in invented asset ids. Water and terrain
+share ONE surface sampler (`height_at` from the environment) and every placed thing is seated on
+it or on what it stands on — the harness measures the gap. Geometry that exists only to continue
+the world beyond the bounds is named with the `Sky` prefix (the census then keeps it out of the
+content bbox).
+{% else %}
SHIPPED LIBRARY (optional toolbox):
The scene workspace already contains, under `src/lib/`:
`rock.js` (`makeRock`, `makeRockField`: sandstone / granite / basalt rocks and talus),
@@ -27,6 +54,7 @@ beside it) — name the call and its module in that asset's description, and the
effects a zone places itself belong in its prose, not in invented asset ids. A stream or river
has one upstream-to-downstream path with nonincreasing Y, and its banks sample the same terrain
height function. The zone drives each effect's `userData.update(t, dt)` exactly once per frame.
+{% endif %}
## What the harness measures and the judge sees (plan so these hold)
- Every authored camera is rendered at t=0 s and t=1.5 s and judged as a picture of the brief's
@@ -35,8 +63,14 @@ height function. The zone drives each effect's `userData.update(t, dt)` exactly
within 0.5 m of a surface caps the whole run.
- No world edge, horizon seam or box boundary is visible from any authored camera (judge; and
outdoors the census checks that standing geometry >= 2 m tall reaches past 1.25 x the bounds'
+{% if language == 'scene_blender' %}
+ half-extent, and that the atmosphere's 1 / density is >= the plan span / 1.5 — a denser fog
+ dissolves the world inside the content and reads as an edge). How the world continues is the environment builder's choice for this
+ place.
+{% else %}
half-extent, and that fog far is >= 2 x the plan span — a shorter fog reads as an edge). How
the world continues is the environment builder's choice for this place.
+{% endif %}
- The ground is a believable landform for the place (judge): flat, sloped, terraced, a shore, a
cliff — whatever the brief implies; every placed thing is seated on it or on what it stands on
(placement gate: a gap > 0.05 m outdoors / 0.02 m indoors is floating, > 0.10 m into the
@@ -62,6 +96,21 @@ WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
proportion it to the brief's subject: a street is long and narrow, a courtyard small, a
valley wide; a bigger box is not more detail.
3. `environment` — ONE paragraph of concrete numbers for what the brief's place needs:
+{% if language == 'scene_blender' %}
+ the sun / moon azimuth (compass: 0 = +X, 90 = +Y) + elevation in degrees and the time of day
+ (dawn / morning / noon / golden / overcast / dusk / night — the builders' lighting table); the
+ Sun lamp's colour + energy in W/m² and the sky world strength such that the judged frames land
+ in the measured luminance band (pairs that did: day 3-5 W/m² at world 0.4-0.5, dusk 1-1.5 at
+ 0.2, a moon 0.1-0.3 at 0.1), coloured for the weather; atmosphere: fog density + colour as a
+ volume over the ground when the weather needs it (the census reads its density: 1 / density
+ >= the plan span / 1.5); the LANDFORM — what the land does across the bounds and its height at each
+ authored camera position (camera heights are absolute) — and the ground surface(s) with
+ colours (RGB 0-1) and where walkways, roads or tracks run, as (x, z) routes with widths, when
+ the brief has them (the zone layouts read them as `path_points`); how the world continues
+ beyond the bounds in each direction and what the horizon is from the authored cameras (for an
+ interior: what is seen through the openings); water height + colour, if any. Ponds, terraces
+ and beds meet the terrain with no floating edge (placement gate).
+{% else %}
sky colours and the sun/moon azimuth + elevation in degrees; key light hex + intensity and
fill (hemisphere) sky/ground hex + intensity for that time of day and weather (a fill hue well
away from the key's is one way to keep the frame from going monochrome); atmosphere: fog hex +
@@ -73,6 +122,7 @@ WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
each direction and what the horizon is from the authored cameras (for an interior: what is
seen through the openings); water height + colour, if any. Ponds, terraces and beds meet the
terrain with no floating edge (placement gate).
+{% endif %}
4. `zones` — the brief's places, one builder each, with PascalCase names, a `bbox` (where that
builder may place: layouts are validated against it with 1 m of slack) and `contents` = asset
names placed there. Lay them out as the place is laid out — along a street, round a corner,
@@ -87,6 +137,23 @@ WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
a quarry floor nearly bare, zero is a valid answer;
- how repeated natural elements vary (silhouette, scale, hue) or why a regular row is right.
5. `assets` — the reusable things the brief needs; each is one builder session inside the run's
+{% if language == 'scene_blender' %}
+ time and cost ceiling. PascalCase `name`; `kind` = `bpy` (a procedural module placed as
+ collection instances) or `blender_glb` (built as an object and shipped as a GLB: slower and
+ costlier, so for the hero that needs sculpted or bevelled detail; a hero may also carry ONE
+ 2 s keyframed motion — say so in its description); `description` with construction numbers
+ and colours; `approx_size_m` = width x height x depth in meters (the built asset is measured
+ against it: a stone lantern 0.5 x 1.6 x 0.5, a bench 1.6 x 0.9 x 0.6, a pine 3 x 7 x 3);
+ `instances_hint` = how many appear in total. Triangle budget: <= 15 000 triangles per module,
+ <= 40 000 for a hero (measured by the build census). Variation belongs inside an asset (say
+ "5 variants via variant: three trunk shapes, two crown shapes") rather than in near-duplicate
+ modules. Ground cover, terrain, water, sky and whatever continues the world beyond the bounds
+ are built by the environment / zone builders, not as assets.
+6. `effects` — 0 or more: `glsl_material` (a shader-node effect: water ripple, lantern glow, a
+ translucent leaf), `particles` (petals, sparks, snow — a small keyframed instance cloud),
+ `animated_geometry`, or `postprocess` (a volume: mist, light shafts); say which zone/asset owns
+ each.
+{% else %}
time and cost ceiling. PascalCase `name`; `kind` = `threejs` (a procedural module) or
`blender_glb` (built in Blender and shipped as a GLB: slower and costlier, so for the hero
that needs sculpted or bevelled detail; a hero may also carry ONE 2 s keyframed motion — say so
@@ -101,19 +168,32 @@ WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
6. `effects` — 0 or more: `glsl_material` (water ripple, lantern glow, wind-swayed foliage),
`particles` (petals, sparks, snow), `animated_geometry`, or `postprocess`; say which zone/asset
owns each.
+{% endif %}
7. `animation` — what moves, each line with an amplitude visible in a 1024x576 frame between t=0
and t=1.5 s (motion probe). Amplitudes that have measured as visible: foliage sway
+{% if language == 'scene_blender' %}
+ +/-0.10-0.20 rad; water ripples scrolling >= 0.15 m/s or a bob >= 0.04 m; particles travelling
+ >= 0.6 m per 1.5 s; vehicles/boats/sails >= 1.5 m or a visible turn per 1.5 s; lantern flicker
+ x0.75-x1.3. Motion the brief names is visible from the establishing camera.
+{% else %}
+/-0.10-0.20 rad over 1.6-3 s; water waves >= 0.04 m or a scroll >= 0.15 m/s; particles
travelling >= 0.6 m per 1.5 s; vehicles/boats/beams >= 1.5 m or a full revolution per 1.5 s;
light flicker x0.75-x1.3. Motion the brief names is visible from the establishing camera.
+{% endif %}
8. `cameras` — 1 to 6 authored shots; the harness uses your numbers LITERALLY, so compute them
from where the subject is and how big it is. `cameras[0]` is measured as the establishing
shot: it shows the brief's subject clearly, with content >= 20 % of the frame. Every camera
stands above the terrain at its own (x, z), keeps its lens >= 0.5 m from any surface and
looks at content (>= 10 %). `purpose` says what the shot is of and what the judge should see
+{% if language == 'scene_blender' %}
+ in it. `fov` (vertical) is yours (schema 5-150). How many shots, from where and at what height
+ is the brief's: a long open vista, a close interior, a walk along a street or a top-down court are
+ each right when the place is.
+{% else %}
in it. `fov` is yours (schema 5-150). How many shots, from where and at what height is the
brief's: a long open vista, a close interior, a walk along a street or a top-down court are each
right when the place is.
+{% endif %}
9. `acceptance` — one item per must-have in the brief, plus the measured checks: nothing floating
or sunken (`how: probe`), the named motion visible between t=0 and t=1.5 s (`probe`), no world
edge from any authored camera (`visual`), lighting reads as the stated time of day (`visual`).
@@ -154,21 +234,43 @@ brief's place has its own shape, and its prose is terser than the plan you write
EXAMPLES OF THE CONCRETENESS WANTED — one bullet per place, none of them the harbour above; the
brief's place gets its own numbers:
- environment, a hangar interior: "Overcast noon through the open doors: no sun lamp; sky
+{% if language == 'scene_blender' %}
+ (0.81, 0.84, 0.87) seen through the 40 x 12 m door opening on the south face, world strength 0.5, twelve roof
+ area lights (1.0, 0.95, 0.85) at 400 W on 8 m centres; a faint dust volume density 0.002 colour (0.69, 0.71, 0.72). Floor flat concrete (0.48, 0.48, 0.47) at y=0, 60 x 90 m,
+ painted bay lines (0.85, 0.76, 0.35) every 15 m; the bounds are the hangar; outside the doors the apron
+{% else %}
0xcfd6de seen through the 40 x 12 m door opening on the south face, key from it 0xdde4ea at 1.4,
fill 0x8a9098 / 0x3a3a3a at 0.6, twelve roof lamps 0xfff1d8 at 2.0 on 8 m centres; no fog, a
faint 0xb0b4b8 dust haze near 10 m far 140 m. Floor flat concrete 0x7a7b78 at y=0, 60 x 90 m,
painted bay lines 0xd8c25a every 15 m; the bounds are the hangar; outside the doors the apron
+{% endif %}
continues 200 m to a treeline."
+{% if language == 'scene_blender' %}
+- environment, a slot canyon: "Noon sun azimuth 190 deg elevation 72 deg, Sun lamp (1.0, 0.94, 0.86)
+ at 4.0 W/m2 reaching the floor only in a 3 m band, world strength 0.3 (the walls bounce
+ orange); fog density 0.006 colour (0.85, 0.63, 0.44) in the slot (span 60 m). The floor is a sand wash (0.78, 0.63, 0.44)
+{% else %}
- environment, a slot canyon: "Noon sun azimuth 190 deg elevation 72 deg, key 0xfff0dc at 3.0
reaching the floor only in a 3 m band; fill 0xe0b088 / 0x5a3a28 at 0.9 (the walls bounce
orange); fog 0xd9a070 near 15 m far 90 m (span 60 m). The floor is a sand wash 0xc8a070
+{% endif %}
falling 4 m along z from +30 to -30 and keeps falling past the bounds; walls 14-22 m high
+{% if language == 'scene_blender' %}
+ 2-4 m apart, sandstone (0.72, 0.41, 0.23) banded (0.54, 0.29, 0.16) every 0.6 m, both run out of the bounds."
+- environment, a night market: "22:00, no moon: world (0.05, 0.06, 0.12) at strength 0.15, no sun lamp; the
+ stall lamps (1.0, 0.75, 0.44) at 150 W every 4 m along the lane with an emissive skin at 4, the
+ shop signs emissive (1.0, 0.35, 0.54) / (0.25, 0.78, 1.0) at 6; fog density 0.004 colour (0.08,
+ 0.09, 0.15) (span 80 m). The lane is
+ flat wet asphalt (0.14, 0.15, 0.16) at y=0, 6 m wide, running out of the bounds both ways; two-storey
+ shophouses (0.42, 0.35, 0.28) line it on both sides and continue past the bounds."
+{% else %}
2-4 m apart, sandstone 0xb8683a banded 0x8a4a2a every 0.6 m, both run out of the bounds."
- environment, a night market: "22:00, no moon: sky 0x0c1020, no sun lamp; key is the stall
lamps 0xffc070 at 2.5 every 4 m along the lane and the shop signs 0xff5a8a / 0x40c8ff at 1.5;
fill 0x203048 / 0x100c08 at 0.25; fog 0x141826 near 20 m far 160 m (span 80 m). The lane is
flat wet asphalt 0x24262a at y=0, 6 m wide, running out of the bounds both ways; two-storey
shophouses 0x6a5a48 line it on both sides and continue past the bounds."
+{% endif %}
- a dense zone: "The lane's west side, seen by LaneWalk and Overview: 7 stalls 4 m apart facing
the lane, each with its lamp and a crowd of 3-5 people in front, ~25 mid props (stools, crates,
bins), ~60 small props (bowls, bottles, signs), no ground cover on the asphalt."
diff --git a/harness/codeverse3d/prompts/tracks/plan_scene_bpy.j2 b/harness/codeverse3d/prompts/tracks/plan_scene_bpy.j2
deleted file mode 100644
index bda0c48d..00000000
--- a/harness/codeverse3d/prompts/tracks/plan_scene_bpy.j2
+++ /dev/null
@@ -1,180 +0,0 @@
-You are the SCENE DIRECTOR for a Blender (bpy, Cycles) scene that several code-writing models will
-build in parallel from your plan alone (one per asset, one for every zone, one for the environment).
-Write the plan as exact numbers and concrete nouns; keep it lean (cost matters). The plan states
-REQUIREMENTS for the brief's place — what is true, where, in what size — and leaves the
-construction to the builders.
-
-THE PLAN'S FRAME: write every number — bounds, zone bboxes, asset sizes (width × height × depth),
-camera positions — in the Y-up GLB frame (Y up, +Z towards the viewer, metres, the ground around
-y = 0 unless the plan puts it elsewhere), exactly as a three.js director would. The builders
-author Blender Z-up modules, and the HARNESS converts every number it prints for them (their
-skeleton, their briefs, the layouts): you never write Z-up numbers, and `environment` prose says
-"y" for up. (The language frame the builders see, for reference: {{ frame_doc }})
-
-LANGUAGE CONTRACT THE BUILDERS WILL FOLLOW:
-{{ contract }}
-
-DESCRIBE, DO NOT PRESCRIBE — every mesh, material, lamp, world and motion is `bpy` / `bmesh` the
-builders write, so describe each thing by what it IS — dimensions, parts,
-materials with colours and how they vary (broad wear and fine grain), and the silhouette features a
-person would name (a pine's whorled limbs carrying needle cards, a boulder's irregular facets) —
-never by a call or a module. A thing repeated across zones (a tree species, a lamp post, a crate)
-is an asset within the triangle budget below. Zone `contents` lists only actual
-asset names; scenery a zone builds itself belongs in its prose, not in invented asset ids. Water and terrain
-share ONE surface sampler (`height_at` from the environment) and every placed thing is seated on
-it or on what it stands on — the harness measures the gap. Geometry that exists only to continue
-the world beyond the bounds is named with the `Sky` prefix (the census then keeps it out of the
-content bbox).
-
-## What the harness measures and the judge sees (plan so these hold)
-- Every authored camera is rendered at t=0 s and t=1.5 s and judged as a picture of the brief's
- place. `cameras[0]` is measured as the establishing shot: content covers >= 20 % of its frame;
- every other authored camera >= 10 % (the rest being sky/ground). A lens inside a mesh or
- within 0.5 m of a surface caps the whole run.
-- No world edge, horizon seam or box boundary is visible from any authored camera (judge; and
- outdoors the census checks that standing geometry >= 2 m tall reaches past 1.25 x the bounds'
- half-extent, and that the atmosphere's 1 / density is >= the plan span / 1.5 — a denser fog
- dissolves the world inside the content and reads as an edge). How the world continues is the environment builder's choice for this
- place.
-- The ground is a believable landform for the place (judge): flat, sloped, terraced, a shore, a
- cliff — whatever the brief implies; every placed thing is seated on it or on what it stands on
- (placement gate: a gap > 0.05 m outdoors / 0.02 m indoors is floating, > 0.10 m into the
- support is sunken, overlapping neighbours interpenetrate — each caps the score).
-- The lighting reads as the stated time of day and weather, and the frame is not monochrome
- unless the brief asks for it (judge; exposure is measured against a luminance band).
-- Something moves visibly between t=0 s and t=1.5 s (motion probe), and motion the brief names
- is visible from the establishing camera.
-- Repeated elements do not read as identical copies (judge), and >= 8 same-size copies spaced
- evenly on a ring round the world are measured as a stamped backdrop. A deliberately regular
- row the brief implies (an orchard, a colonnade, bollards along a quay) is fine.
-- The place carries what its activity implies; a bare diorama on one plane is a judged defect,
- and a zone under half its layout's count gets an INFO note (the counts the brief states are acceptance items).
-- The brief's must-haves are acceptance items; an unmet `must` caps the run at 0.60.
-
-WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
-1. `title`, `summary` (two sentences), `setting` (place, era, weather, time of day), `mood`.
-2. `bounds` — centre + extents in meters of the DETAILED area: where the builders spend their
- detail and what the harness measures against (zone layouts, placed assets — one sitting
- entirely outside is noted — and camera clearance). It is not a cage: the world continues past
- it as the place does — a road or river running out, a wall, a shoreline, far buildings,
- terrain that keeps going — and the environment builder builds that continuation. Size and
- proportion it to the brief's subject: a street is long and narrow, a courtyard small, a
- valley wide; a bigger box is not more detail.
-3. `environment` — ONE paragraph of concrete numbers for what the brief's place needs:
- the sun / moon azimuth (compass: 0 = +X, 90 = +Y) + elevation in degrees and the time of day
- (dawn / morning / noon / golden / overcast / dusk / night — the builders' lighting table); the
- Sun lamp's colour + energy in W/m² and the sky world strength such that the judged frames land
- in the measured luminance band (pairs that did: day 3-5 W/m² at world 0.4-0.5, dusk 1-1.5 at
- 0.2, a moon 0.1-0.3 at 0.1), coloured for the weather; atmosphere: fog density + colour as a
- volume over the ground when the weather needs it (the census reads its density: 1 / density
- >= the plan span / 1.5); the LANDFORM — what the land does across the bounds and its height at each
- authored camera position (camera heights are absolute) — and the ground surface(s) with
- colours (RGB 0-1) and where walkways, roads or tracks run, as (x, z) routes with widths, when
- the brief has them (the zone layouts read them as `path_points`); how the world continues
- beyond the bounds in each direction and what the horizon is from the authored cameras (for an
- interior: what is seen through the openings); water height + colour, if any. Ponds, terraces
- and beds meet the terrain with no floating edge (placement gate).
-4. `zones` — the brief's places, one builder each, with PascalCase names, a `bbox` (where that
- builder may place: layouts are validated against it with 1 m of slack) and `contents` = asset
- names placed there. Lay them out as the place is laid out — along a street, round a corner,
- radially about a well, scattered over a slope, one inside another — in any number and size;
- they need not cover the bounds, open ground between them is allowed, and two bboxes overlap by
- at most 1 m so their placements cannot collide. Each zone `description` states, as numbers:
- - what the place is and what happens there, and which authored cameras see it;
- - the layout: what stands where, spacing in meters, what faces what, what stands ON what;
- - the counts the brief fixes, and how much loose dressing this zone carries beyond its
- contents, as the place needs (the zone layout counts it in three fields — mid props, small
- props, ground cover — and the census notes a zone under half its count): a market is crowded,
- a quarry floor nearly bare, zero is a valid answer;
- - how repeated natural elements vary (silhouette, scale, hue) or why a regular row is right.
-5. `assets` — the reusable things the brief needs; each is one builder session inside the run's
- time and cost ceiling. PascalCase `name`; `kind` = `bpy` (a procedural module placed as
- collection instances) or `blender_glb` (built as an object and shipped as a GLB: slower and
- costlier, so for the hero that needs sculpted or bevelled detail; a hero may also carry ONE
- 2 s keyframed motion — say so in its description); `description` with construction numbers
- and colours; `approx_size_m` = width x height x depth in meters (the built asset is measured
- against it: a stone lantern 0.5 x 1.6 x 0.5, a bench 1.6 x 0.9 x 0.6, a pine 3 x 7 x 3);
- `instances_hint` = how many appear in total. Triangle budget: <= 15 000 triangles per module,
- <= 40 000 for a hero (measured by the build census). Variation belongs inside an asset (say
- "5 variants via variant: three trunk shapes, two crown shapes") rather than in near-duplicate
- modules. Ground cover, terrain, water, sky and whatever continues the world beyond the bounds
- are built by the environment / zone builders, not as assets.
-6. `effects` — 0 or more: `glsl_material` (a shader-node effect: water ripple, lantern glow, a
- translucent leaf), `particles` (petals, sparks, snow — a small keyframed instance cloud),
- `animated_geometry`, or `postprocess` (a volume: mist, light shafts); say which zone/asset owns
- each.
-7. `animation` — what moves, each line with an amplitude visible in a 1024x576 frame between t=0
- and t=1.5 s (motion probe). Amplitudes that have measured as visible: foliage sway
- +/-0.10-0.20 rad; water ripples scrolling >= 0.15 m/s or a bob >= 0.04 m; particles travelling
- >= 0.6 m per 1.5 s; vehicles/boats/sails >= 1.5 m or a visible turn per 1.5 s; lantern flicker
- x0.75-x1.3. Motion the brief names is visible from the establishing camera.
-8. `cameras` — 1 to 6 authored shots; the harness uses your numbers LITERALLY, so compute them
- from where the subject is and how big it is. `cameras[0]` is measured as the establishing
- shot: it shows the brief's subject clearly, with content >= 20 % of the frame. Every camera
- stands above the terrain at its own (x, z), keeps its lens >= 0.5 m from any surface and
- looks at content (>= 10 %). `purpose` says what the shot is of and what the judge should see
- in it. `fov` (vertical) is yours (schema 5-150). How many shots, from where and at what height
- is the brief's: a long open vista, a close interior, a walk along a street or a top-down court are
- each right when the place is.
-9. `acceptance` — one item per must-have in the brief, plus the measured checks: nothing floating
- or sunken (`how: probe`), the named motion visible between t=0 and t=1.5 s (`probe`), no world
- edge from any authored camera (`visual`), lighting reads as the stated time of day (`visual`).
- **`priority` matters more than anything else in this list.** ANY unmet `must` item caps the
- whole run's score at 0.60, however good the pictures are — one over-specified detail throws
- away a passing scene. So:
- - mark `must` only items that restate a hard requirement of the brief itself, that a person
- can confirm from ONE rendered frame, and that name no incidental detail: "a raked gravel
- area is visible in the zen garden" is a `must`; "raked gravel with concentric rings around
- each rock" is a `should`;
- - `a1` is the premise: the kind of PLACE the brief describes, in the plainest words that
- would be false if the scene were somewhere else — "the view is from inside an enclosed
- workshop", "the courtyard is lit only by its lanterns at night". Measured 2026-08-25: a
- brief reading "INSIDE a boatbuilder's workshop" was planned as "Coastal boatyard, clear
- dusk", built faithfully as an outdoor yard, passed every gate and scored 0.4653. When the
- premise is INSIDE a built space, set `interior: true`: the environment module then owns the
- enclosure (floor, walls, ceiling, openings where `environment` puts them; the skeleton
- starts it on the bounds' faces and the builder may reshape it) and the zones dress the
- inside — six interior runs with no owner for walls and roof were each judged "not enclosed,
- a diorama on a flat plane" (0.0-0.3). When the enclosure itself is glass on a frame (a
- conservatory, greenhouse, palm house, glass atrium) also set `glazed: true`: the walls and
- roof are then glass on a grid that the sun and the outside come through;
- - everything else is `priority: should` — craft goals, counts, specific patterns, exact
- heights and anything needing evidence the judge may not have;
- - a `must` whose wording carries a number, a named style, or "and" joining two independent
- claims is rarely confirmable from one frame: split it or demote it.
-
-RULES
-- Every name in `zones[].contents` is an asset name; asset names unique; zone names unique.
-- Realistic scale: people 1.7 m, doors 2.1 m, steps 0.17 m, benches 0.45 m seat height.
-- No prose outside the JSON.
-
-WORKED EXAMPLE — field SHAPE only. It is ONE place's plan (a harbour: an L of quay along one
-side, open water on the other, the mole and the village street running out of the bounds); the
-brief's place has its own shape, and its prose is terser than the plan you write:
-{{ example_json }}
-
-EXAMPLES OF THE CONCRETENESS WANTED — one bullet per place, none of them the harbour above; the
-brief's place gets its own numbers:
-- environment, a hangar interior: "Overcast noon through the open doors: no sun lamp; sky
- (0.81, 0.84, 0.87) seen through the 40 x 12 m door opening on the south face, world strength 0.5, twelve roof
- area lights (1.0, 0.95, 0.85) at 400 W on 8 m centres; a faint dust volume density 0.002 colour (0.69, 0.71, 0.72). Floor flat concrete (0.48, 0.48, 0.47) at y=0, 60 x 90 m,
- painted bay lines (0.85, 0.76, 0.35) every 15 m; the bounds are the hangar; outside the doors the apron
- continues 200 m to a treeline."
-- environment, a slot canyon: "Noon sun azimuth 190 deg elevation 72 deg, Sun lamp (1.0, 0.94, 0.86)
- at 4.0 W/m2 reaching the floor only in a 3 m band, world strength 0.3 (the walls bounce
- orange); fog density 0.006 colour (0.85, 0.63, 0.44) in the slot (span 60 m). The floor is a sand wash (0.78, 0.63, 0.44)
- falling 4 m along z from +30 to -30 and keeps falling past the bounds; walls 14-22 m high
- 2-4 m apart, sandstone (0.72, 0.41, 0.23) banded (0.54, 0.29, 0.16) every 0.6 m, both run out of the bounds."
-- environment, a night market: "22:00, no moon: world (0.05, 0.06, 0.12) at strength 0.15, no sun lamp; the
- stall lamps (1.0, 0.75, 0.44) at 150 W every 4 m along the lane with an emissive skin at 4, the
- shop signs emissive (1.0, 0.35, 0.54) / (0.25, 0.78, 1.0) at 6; fog density 0.004 colour (0.08,
- 0.09, 0.15) (span 80 m). The lane is
- flat wet asphalt (0.14, 0.15, 0.16) at y=0, 6 m wide, running out of the bounds both ways; two-storey
- shophouses (0.42, 0.35, 0.28) line it on both sides and continue past the bounds."
-- a dense zone: "The lane's west side, seen by LaneWalk and Overview: 7 stalls 4 m apart facing
- the lane, each with its lamp and a crowd of 3-5 people in front, ~25 mid props (stools, crates,
- bins), ~60 small props (bowls, bottles, signs), no ground cover on the asphalt."
-- a bare zone: "The canyon floor downstream, seen by Overview only: the sand wash, three fallen
- slabs 1-2 m and nothing else — it reads as a canyon because it is empty."
-- camera purpose: "establishing: looking down the lane from its north end at eye height
- (subject: the stall row, ~30 m deep), the signs stacking into the fog; no sky in frame."
diff --git a/harness/codeverse3d/prompts/tracks/scene_refine.j2 b/harness/codeverse3d/prompts/tracks/scene_refine.j2
index 364ca016..ab02a1af 100644
--- a/harness/codeverse3d/prompts/tracks/scene_refine.j2
+++ b/harness/codeverse3d/prompts/tracks/scene_refine.j2
@@ -1,7 +1,12 @@
# Refine `{{ title }}` — round {{ round_index }}
The scene builds and was rendered from the authored cameras at t=0 and t=1.5 s, then judged. Make
+{% if language == 'scene_blender' %}
+exactly the changes below, keep everything else, keep the build clean (no zone dropped, no Python
+driver, nothing floating or sunken).
+{% else %}
exactly the changes below, keep everything else, keep the build clean (no console errors).
+{% endif %}
## Changes to make (priority order; `[gate/...]` items are hard failures — fix them first)
{% for t in tasks %}
@@ -20,9 +25,17 @@ Files in scope: {% for f in files %}`{{ f }}`{% if not loop.last %}, {% endif %}
## What the judge saw
{{ judge_summary }}
+{% if language == 'scene_blender' %}
+## Plan (unchanged truth; numbers below are in YOUR frame — Z up, −Y front, metres)
+{% else %}
## Plan (unchanged truth)
+{% endif %}
Bounds: {{ bounds }} · Setting: {{ setting }} · Mood: {{ mood }}
+{% if language == 'scene_blender' %}
+Environment (its prose is Y-up: "y" there is z here): {{ environment }}
+{% else %}
Environment: {{ environment }}
+{% endif %}
Zones:
{{ zones_table }}
Cameras:
@@ -38,6 +51,21 @@ Animation: {{ animation }}
## Reminders
{{ frame_doc }}
+{% if language == 'scene_blender' %}
+- A lighting / atmosphere / terrain / horizon change lives in `{{ env_file }}` (the world, the sun or
+ moon lamp, the atmosphere volume, the ground and `height_at`, whatever continues the world).
+- A composition/camera change is the plan's: `{{ entry_file }}` is harness data — move the SUBJECT
+ (a zone's placement) rather than the camera.
+- A zone change lives in its `src/zones/<zone>.py` (`def build(ctx)`, motion as keyframes on
+ `ctx.frame(0.0)` / `ctx.frame(1.5)`); an asset change in `src/assets/<asset>.py`
+ (`build_<asset>(ctx, variant=0)`).
+- A dropped zone / asset (`zone_error`, `asset_error`): fix the named line; never wrap the whole
+ builder in try/except to hide it.
+- Everything rests on `ctx.height_at(x, y)` or on its support (move the root by the smallest
+ `ctx.height_at(x, y) - z` over its foot band: the world-space vertices within max(0.02 m, 5 % of its height) of its lowest); nothing floats, sinks or runs through a
+ neighbour (compare world bounding boxes). Code zones share lives in `{{ env_file }}`.
+- No world or cameras outside `{{ env_file }}`, no file IO, no `random.*`, no Python drivers.
+{% else %}
- A lighting / atmosphere / terrain / horizon change lives in `src/env.js`.
- A composition/camera change lives in `src/scene.js` (camera position/lookAt/fov numbers only).
- A zone change lives in its `src/zones/<zone>.js` (`export function build(ctx)`, animation on
@@ -47,12 +75,37 @@ Animation: {{ animation }}
stay inside the draw / triangle budget `scene_probe` reports.
- No DOM, no fetch, no Math.random, no CDN imports; textures only via `loaders.texture` for files
in the workspace or procedural DataTextures.
+{% endif %}
+{% if language == 'scene_blender' %}
+## The recurring findings on this track — what each measures, and where the requirement is stated
+Do not re-explain the problem back — change what the finding measures. If a measured finding repeats,
+change what it measures until its number passes; a repeated judge note needs a visible change in the
+named view. The skills named below are in your session's skill list; the contract is above.
+{% else %}
## The recurring findings on this track, and what each one measures
Do not re-explain the problem back — change the thing the finding measures. If a measured
finding repeats from the previous round, re-read its number and change what it measures until
the number passes; a judge note that repeats needs a visible change in the named view.
+{% endif %}
+{% if language == 'scene_blender' %}
+| what the judge / gate wrote | the requirement (and how it is measured) | stated in |
+|---|---|---|
+| flat / one-colour ground, hard raised-bed edges | the surface needs visible variation that matches the brief's material, and its seams dressed (judge `flat_ground`) | the env brief § 1; skill `c3d-bpy-scene-materials` |
+| a hard world edge against the sky, missing horizon | from no camera may the ground end against the sky (`world_edge_visible`; gates `world_edge` / `fog_short`); what continues the world is the brief's — street, sea, cliff, forest, wall, fog | contract § What else the gates measure; skill `c3d-scene-atmosphere` |
+| the backdrop looks like flat / beige / untextured cut-outs | a distant backdrop needs volume and lighting consistent with the sky; aerial perspective is the fog's job, never a pre-tint (`placeholder_material`) | skill `c3d-scene-atmosphere` |
+| a pond / terrace is a hard-edged plane sitting on the ground | water and terraces meet the ground without a visible seam: carving into `height_at` (`{{ env_file }}`) or dressing the seam (the zone) are options; water is named `…Water` | skill `c3d-scene-water`; skill `c3d-bpy-scene-placement` |
+| `floating` / `sunken` / `interpenetration` / `unsupported` (the placement gate's metres) | move the root by the printed metres: its lowest evaluated vertices onto `ctx.height_at` or its support, boxes apart; a rock may sit a third in, a crate may not | contract § Placement; skill `c3d-bpy-scene-placement` |
+| "camera is N m below ground level" / `camera_in_geometry` | the eye must be above the ground under it and ≥ 0.5 m from any surface: move the subject or the zone's placement; the landform is the brief's | contract § What else the gates measure |
+| identical cones / stacked blocks / primitive repetition | identical copies and primitive stacks are what the judge reads (`monotonous_vegetation`); a tree branches into limbs carrying leaf or needle cards, a rock is irregular (`asset_quality_detail`); vary where the brief has natural variety, regular things stay regular | the zone brief § 2 |
+| sparse, token, "a diorama on a plane", empty midground | the brief's stated counts are requirements (the census compares them); empty regions the brief would fill get what it implies (`undressed_scene`, `empty_midground`) | the zone brief § 1; skill `c3d-scene-composition` |
+| flat / dark / monochrome light, black shade, `dark_frame` | measured per camera (`mean_lum` / `dark_frac` / `blown_frac`); the brief's time of day and light sources decide; the lighting skill lists starting values that have passed | skill `c3d-bpy-scene-lighting`; skill `c3d-scene-night` |
+| frames at t=0 and t=1.5 identical, "nothing moves", `nothing_moves` | the frame difference is measured per camera: LINEAR keyframes on `ctx.frame(0.0)` / `ctx.frame(1.5)` or `frame * k`; `python_driver` = a driver that needs Python, rewrite it | contract § Motion; skill `c3d-scene-motion` |
+| `hard_edged_particles`, "sharp-edged quads / spheres / discs for steam, dust, sparks", the brief's "soft particle effect" must-item unverified | the finding measures sharp-edged particle geometry: in Cycles only a volume renders edgeless (a `ShaderNodeVolumePrincipled` into the Material Output's `Volume`, no surface shader), one root tagged free, moving ≥ 0.6 m | contract § What the renderer does |
+| "plastic", "one grey material", `placeholder_material` | flags a surface with no authored colour / roughness; every surface needs a material that matches what it is, varied at more than one scale (broad tone and wear plus fine grain or bump) | skill `c3d-bpy-scene-materials` |
+| `zone_error` / `asset_error` (a dropped module) | the named `file:line` — fix the raise; Blender 5.2 facts (no `use_nodes`, `Factor` not `Fac`, `ShaderNodeMix`, `Action.fcurves` is gone, GN inputs via `mod.properties.inputs`) | contract § Blender 5.2 API facts |
+{% else %}
| what the judge or gate wrote | the requirement behind it |
|---|---|
| flat / one-colour ground, no paths, hard raised-bed edges | the surface needs visible variation that matches the brief (material, relief, wear) where the setting would show it (judge `flat_ground`) |
@@ -66,6 +119,7 @@ the number passes; a judge note that repeats needs a visible change in the named
| frames at t=0 and t=1.5 identical, "nothing moves", `no_motion` | a camera moves when ≥ 0.4 % of its pixels change by more than 8/255 (or ≥ 0.08 % by more than 60/255); none moving is the gate's `no_motion` ERROR and the judge's `nothing_moves`; the hook is `userData.update` (never `tick`), and the amplitude has to show at 1024×576 (foliage ±0.10–0.20 rad, particles ≥ 0.6 m per 1.5 s, water ≥ 3 cm or a scrolling normal are amplitudes that have passed) |
| `hard_edged_particles`, "sharp-edged quads / spheres / discs for steam, dust, sparks", the brief's "soft particle effect" must-item unverified | the finding measures sharp-edged particle sprites; any soft-edged construction passes (a bounded density volume, or a radial-alpha sprite on every point) |
| camera inside geometry / shows only sky or a wall | the eye must be ≥ 0.5 m from every surface and the frame ≥ 10 % content (20 % for the establishing view): move the camera in `src/scene.js` or what blocks it |
+{% endif %}
{% if current_files %}
## Current file contents (edit and return each COMPLETE)
@@ -86,6 +140,9 @@ lines); `check_placement` returns the placement rows, each with its gap and the
against. `check_placement` measures floating / sunken / unsupported /
interpenetrating assets deterministically — its numbers, not your impression. `scene_views` prints the
frame table and the MEASURED MOTION per camera — use those numbers, not your impression.
+{% endif %}
+{% if language == 'scene_blender' %}
+
{% endif %}
## Output
{{ output_format }}
diff --git a/harness/codeverse3d/prompts/tracks/scene_refine_bpy.j2 b/harness/codeverse3d/prompts/tracks/scene_refine_bpy.j2
deleted file mode 100644
index 0e63f126..00000000
--- a/harness/codeverse3d/prompts/tracks/scene_refine_bpy.j2
+++ /dev/null
@@ -1,99 +0,0 @@
-# Refine `{{ title }}` — round {{ round_index }}
-
-The scene builds and was rendered from the authored cameras at t=0 and t=1.5 s, then judged. Make
-exactly the changes below, keep everything else, keep the build clean (no zone dropped, no Python
-driver, nothing floating or sunken).
-
-## Changes to make (priority order; `[gate/...]` items are hard failures — fix them first)
-{% for t in tasks %}
-{{ loop.index }}. {{ t }}
-{% endfor %}
-
-Targets: {{ targets | join(', ') }}
-{% if edit_only_these %}
-EDIT ONLY THESE FILES (other tasks edit other files in parallel):
-{% for f in files %}- `{{ f }}`
-{% endfor %}
-{% else %}
-Files in scope: {% for f in files %}`{{ f }}`{% if not loop.last %}, {% endif %}{% endfor %}
-{% endif %}
-
-## What the judge saw
-{{ judge_summary }}
-
-## Plan (unchanged truth; numbers below are in YOUR frame — Z up, −Y front, metres)
-Bounds: {{ bounds }} · Setting: {{ setting }} · Mood: {{ mood }}
-Environment (its prose is Y-up: "y" there is z here): {{ environment }}
-Zones:
-{{ zones_table }}
-Cameras:
-{{ cameras }}
-Assets:
-{{ asset_api }}
-Effects:
-{{ effects }}
-Animation: {{ animation }}
-
-## Acceptance checklist
-{{ acceptance }}
-
-## Reminders
-{{ frame_doc }}
-- A lighting / atmosphere / terrain / horizon change lives in `{{ env_file }}` (the world, the sun or
- moon lamp, the atmosphere volume, the ground and `height_at`, whatever continues the world).
-- A composition/camera change is the plan's: `{{ entry_file }}` is harness data — move the SUBJECT
- (a zone's placement) rather than the camera.
-- A zone change lives in its `src/zones/<zone>.py` (`def build(ctx)`, motion as keyframes on
- `ctx.frame(0.0)` / `ctx.frame(1.5)`); an asset change in `src/assets/<asset>.py`
- (`build_<asset>(ctx, variant=0)`).
-- A dropped zone / asset (`zone_error`, `asset_error`): fix the named line; never wrap the whole
- builder in try/except to hide it.
-- Everything rests on `ctx.height_at(x, y)` or on its support (move the root by the smallest
- `ctx.height_at(x, y) - z` over its foot band: the world-space vertices within max(0.02 m, 5 % of its height) of its lowest); nothing floats, sinks or runs through a
- neighbour (compare world bounding boxes). Code zones share lives in `{{ env_file }}`.
-- No world or cameras outside `{{ env_file }}`, no file IO, no `random.*`, no Python drivers.
-
-## The recurring findings on this track — what each measures, and where the requirement is stated
-Do not re-explain the problem back — change what the finding measures. If a measured finding repeats,
-change what it measures until its number passes; a repeated judge note needs a visible change in the
-named view. The skills named below are in your session's skill list; the contract is above.
-
-| what the judge / gate wrote | the requirement (and how it is measured) | stated in |
-|---|---|---|
-| flat / one-colour ground, hard raised-bed edges | the surface needs visible variation that matches the brief's material, and its seams dressed (judge `flat_ground`) | the env brief § 1; skill `c3d-bpy-scene-materials` |
-| a hard world edge against the sky, missing horizon | from no camera may the ground end against the sky (`world_edge_visible`; gates `world_edge` / `fog_short`); what continues the world is the brief's — street, sea, cliff, forest, wall, fog | contract § What else the gates measure; skill `c3d-scene-atmosphere` |
-| the backdrop looks like flat / beige / untextured cut-outs | a distant backdrop needs volume and lighting consistent with the sky; aerial perspective is the fog's job, never a pre-tint (`placeholder_material`) | skill `c3d-scene-atmosphere` |
-| a pond / terrace is a hard-edged plane sitting on the ground | water and terraces meet the ground without a visible seam: carving into `height_at` (`{{ env_file }}`) or dressing the seam (the zone) are options; water is named `…Water` | skill `c3d-scene-water`; skill `c3d-bpy-scene-placement` |
-| `floating` / `sunken` / `interpenetration` / `unsupported` (the placement gate's metres) | move the root by the printed metres: its lowest evaluated vertices onto `ctx.height_at` or its support, boxes apart; a rock may sit a third in, a crate may not | contract § Placement; skill `c3d-bpy-scene-placement` |
-| "camera is N m below ground level" / `camera_in_geometry` | the eye must be above the ground under it and ≥ 0.5 m from any surface: move the subject or the zone's placement; the landform is the brief's | contract § What else the gates measure |
-| identical cones / stacked blocks / primitive repetition | identical copies and primitive stacks are what the judge reads (`monotonous_vegetation`); a tree branches into limbs carrying leaf or needle cards, a rock is irregular (`asset_quality_detail`); vary where the brief has natural variety, regular things stay regular | the zone brief § 2 |
-| sparse, token, "a diorama on a plane", empty midground | the brief's stated counts are requirements (the census compares them); empty regions the brief would fill get what it implies (`undressed_scene`, `empty_midground`) | the zone brief § 1; skill `c3d-scene-composition` |
-| flat / dark / monochrome light, black shade, `dark_frame` | measured per camera (`mean_lum` / `dark_frac` / `blown_frac`); the brief's time of day and light sources decide; the lighting skill lists starting values that have passed | skill `c3d-bpy-scene-lighting`; skill `c3d-scene-night` |
-| frames at t=0 and t=1.5 identical, "nothing moves", `nothing_moves` | the frame difference is measured per camera: LINEAR keyframes on `ctx.frame(0.0)` / `ctx.frame(1.5)` or `frame * k`; `python_driver` = a driver that needs Python, rewrite it | contract § Motion; skill `c3d-scene-motion` |
-| `hard_edged_particles`, "sharp-edged quads / spheres / discs for steam, dust, sparks", the brief's "soft particle effect" must-item unverified | the finding measures sharp-edged particle geometry: in Cycles only a volume renders edgeless (a `ShaderNodeVolumePrincipled` into the Material Output's `Volume`, no surface shader), one root tagged free, moving ≥ 0.6 m | contract § What the renderer does |
-| "plastic", "one grey material", `placeholder_material` | flags a surface with no authored colour / roughness; every surface needs a material that matches what it is, varied at more than one scale (broad tone and wear plus fine grain or bump) | skill `c3d-bpy-scene-materials` |
-| `zone_error` / `asset_error` (a dropped module) | the named `file:line` — fix the raise; Blender 5.2 facts (no `use_nodes`, `Factor` not `Fac`, `ShaderNodeMix`, `Action.fcurves` is gone, GN inputs via `mod.properties.inputs`) | contract § Blender 5.2 API facts |
-{% if current_files %}
-
-## Current file contents (edit and return each COMPLETE)
-{% for path, body in current_files.items() %}
---- {{ path }} ---
-```
-{{ body }}
-```
-{% endfor %}
-{% endif %}
-{% if tool_cards and not single_shot %}
-
-## Tools
-{{ tool_cards }}
-Run `build` → `check_placement` → fix → `build` after editing (and `scene_probe` for the census);
-finish only when both are clean. `artifacts/scene_probe.json` is the probe driver's raw dump (thousands of
-lines); `check_placement` returns the placement rows, each with its gap and the tolerance it was measured
-against. `check_placement` measures floating / sunken / unsupported /
-interpenetrating assets deterministically — its numbers, not your impression. `scene_views` prints the
-frame table and the MEASURED MOTION per camera — use those numbers, not your impression.
-{% endif %}
-
-## Output
-{{ output_format }}
diff --git a/harness/codeverse3d/tracks/planner.py b/harness/codeverse3d/tracks/planner.py
index 2493a079..7bf62c86 100644
--- a/harness/codeverse3d/tracks/planner.py
+++ b/harness/codeverse3d/tracks/planner.py
@@ -645,21 +645,15 @@ def _truncated(exc: Exception) -> bool:
"""Did this model error mean 'the answer did not fit'?"""
return "MAX_TOKENS" in str(exc)
-PLAN_TEMPLATES: dict[tuple[Track, Language | None], str] = {
- (Track.STATIC_OBJECT, None): "tracks/plan_static.j2",
- (Track.ARTICULATED_OBJECT, None): "tracks/plan_articulated.j2",
- (Track.SCENE, None): "tracks/plan_scene.j2",
- (Track.SCENE, Language.SCENE_BLENDER): "tracks/plan_scene_bpy.j2",
- (Track.GRAPHICS, None): "tracks/plan_graphics.j2",
+PLAN_TEMPLATES: dict[Track, str] = {
+ Track.STATIC_OBJECT: "tracks/plan_static.j2",
+ Track.ARTICULATED_OBJECT: "tracks/plan_articulated.j2",
+ Track.SCENE: "tracks/plan_scene.j2",
+ Track.GRAPHICS: "tracks/plan_graphics.j2",
}
PLAN_OUTPUT_FLOOR = 24_000
-def plan_template(track: Track, language: Language | None = None) -> str:
- """The planner template for ``(track, language)``: the language's own row, else the track's."""
- return PLAN_TEMPLATES.get((track, language)) or PLAN_TEMPLATES[(track, None)]
-
-
def plan_schema(spec: Spec, plan_model: type[BaseModel]) -> dict[str, Any]:
"""The response schema the planner call carries: a scene's names the asset kinds of ITS"""
if issubclass(plan_model, ScenePlan):
@@ -820,7 +814,7 @@ def build_system_prompt(spec: Spec, plan_model: type[BaseModel], *, budget: Plan
lang: Language = spec.language
budget = budget or plan_budget(spec)
return render(
- plan_template(spec.track, lang),
+ PLAN_TEMPLATES[spec.track],
track=spec.track.value,
language=lang.value,
frame_doc=frame_doc(LANGUAGE_FRAME[lang.value]),
diff --git a/harness/codeverse3d/tracks/scene.py b/harness/codeverse3d/tracks/scene.py
index 50260663..5d0a40c8 100644
--- a/harness/codeverse3d/tracks/scene.py
+++ b/harness/codeverse3d/tracks/scene.py
@@ -63,20 +63,18 @@ REFINE_TIMEOUT_S = 900
@dataclass(frozen=True)
class SceneTemplates:
- """The four prompt templates a scene language's sessions read (``prompts/tracks/``)."""
+ """The per-language prompt templates a scene session reads (``prompts/tracks/``); the plan and refine ones serve both."""
env: str
zone: str
- refine: str
asset: str
+REFINE_TEMPLATE = "tracks/scene_refine.j2"
SCENE_TEMPLATES: dict[Language, SceneTemplates] = {
- Language.SCENE_THREEJS: SceneTemplates("tracks/scene_env.j2", "tracks/scene_zone.j2", "tracks/scene_refine.j2",
- "tracks/scene_asset.j2"),
- Language.SCENE_BLENDER: SceneTemplates("tracks/scene_env_bpy.j2", "tracks/scene_zone_bpy.j2", "tracks/scene_refine_bpy.j2",
- "tracks/scene_asset_bpy.j2"),
+ Language.SCENE_THREEJS: SceneTemplates("tracks/scene_env.j2", "tracks/scene_zone.j2", "tracks/scene_asset.j2"),
+ Language.SCENE_BLENDER: SceneTemplates("tracks/scene_env_bpy.j2", "tracks/scene_zone_bpy.j2", "tracks/scene_asset_bpy.j2"),
}
#: fallback for a runtime that does not state ``SceneRuntime.env_file``
ENV_FILES: dict[Language, str] = {Language.SCENE_THREEJS: "src/env.js", Language.SCENE_BLENDER: "src/env.py"}
@@ -435,7 +433,7 @@ class SceneTrack(BaseTrack):
def _refine_task(self, ctx: RunContext, group: TaskGroup, last: RoundRecord, index: int, *, parallel: bool) -> GenerationTask:
files = group.files or ctx.runtime.expected_files(ctx.plan)
lines = compact_instructions(group.tasks, max_lines=ctx.policy.max_instructions_per_task)
- prompt = render(scene_templates(ctx.language).refine, **self._ctx(ctx, round_index=index, tasks=lines,
+ prompt = render(REFINE_TEMPLATE, **self._ctx(ctx, round_index=index, tasks=lines,
targets=group.targets, files=files, edit_only_these=parallel,
judge_summary=judge_digest(last),
current_files=refine_inline_files(ctx, files)))
@@ -455,7 +453,7 @@ class SceneTrack(BaseTrack):
if (ctx.ws.root / rel).is_file():
files = [rel]
files = files or ctx.runtime.expected_files(ctx.plan)
- prompt = render(scene_templates(ctx.language).refine, **self._ctx(ctx, round_index=index, tasks=[report], targets=["build"],
+ prompt = render(REFINE_TEMPLATE, **self._ctx(ctx, round_index=index, tasks=[report], targets=["build"],
files=files, edit_only_these=False,
judge_summary="(no judgment: the scene did not build — fix the errors above first)",
current_files=refine_inline_files(ctx, files)))