Skip to content

Official Codebase of 3DCodeVerse

Python

integration: harness_contract carve-outs for sessions without a GLB (N44), the dark-frame hint points at PRACTICAL, graphics judge_times from JUDGE_TIMES

gaoypengc4cde31a59b7
diff --git a/harness/codeverse3d/prompts/system/harness_contract.md b/harness/codeverse3d/prompts/system/harness_contract.md
index 829cb524..1ccdbd02 100644
--- a/harness/codeverse3d/prompts/system/harness_contract.md
+++ b/harness/codeverse3d/prompts/system/harness_contract.md
@@ -19,6 +19,10 @@ artifacts/ harness output (object.glb, renders/, gates/, measurement.json). RE
imports are listed in the language contract (bpy/bmesh/mathutils/math/random/… ;
`cadquery` + stdlib ; `three` + `three/addons/*`). Nothing else. No network, no DOM,
no file I/O from generated code (except `src/robot.urdf` for the articulated track).
+ Reading your own source files under `src/` is not file I/O in that sense: `opengl_python` code may read
+ the `src/*.glsl` it ships (`Path(__file__).with_name(...).read_text()`), and scene code loads its `src/`
+ shader files with `THREE.FileLoader` — exactly as your language contract shows. Writing files stays
+ forbidden everywhere.
A language contract may ALSO ship harness-owned modules inside your own `src/` and tell
you to call them (`scene_threejs`: `src/lib/*.js`). Those are not an SDK import — they
are code the harness wrote into your workspace. Call them; never rewrite them.
@@ -61,6 +65,9 @@ Before declaring done you MUST look at what you built: `build` → `render_sheet
→ `compare_reference` if a reference image exists (each step whose tool is in your tool
list). Read the numbers (bbox, islands, tri count) and the images. "It should be fine"
is not evidence; a render is.
+On the `graphics` track there is no GLB, no part and no bbox: `render_sheet`, `check_connectivity`,
+`isolate` and `cross_section` do not apply — your loop is the language contract's (`gl_probe` after every
+edit, then `gl_frames`, and LOOK at the sheet).
## 5. Honesty rules
@@ -81,6 +88,11 @@ is not evidence; a render is.
## 7. Definition of done (all boxes, in order)
+Items 2–4 and 6's mesh checks are for GLB tracks. On the `scene` track they apply to each compiled asset
+under `public/assets/`, and the scene itself is checked with `scene_probe`, `scene_views` and
+`check_placement` against the plan's declared bounds. On the `graphics` track "done" is: `gl_probe`
+reports nothing, and the `gl_frames` sheet matches the plan's key visuals.
+
1. [ ] `build` succeeds with zero errors (exit 0, GLB written).
2. [ ] Every plan part exists by exact name; no extra junk objects (`Cube`, `Camera`).
3. [ ] Measured overall bbox matches the plan's `overall_bbox` (objects) / declared bounds (scenes).
diff --git a/harness/codeverse3d/spatial/frame_metrics.py b/harness/codeverse3d/spatial/frame_metrics.py
index a1f803e1..9b5584d0 100644
--- a/harness/codeverse3d/spatial/frame_metrics.py
+++ b/harness/codeverse3d/spatial/frame_metrics.py
@@ -53,10 +53,10 @@ EYE_MAX_ABOVE_GROUND_M = 80.0
_DARK_HINT = (
"raise the light through the rig env.js already builds — `sunRig({ mood: 'day'|'golden'|'night'|'overcast', "
"intensity, fill, … })`: pick the brief's mood (a set sun, elevation < 0, is the night rig), raise `intensity` (key, "
- "the rig clamps requests below its floor UP) and `fill` (hemisphere, 1.0–2.0) — do not add a second sun on top; "
- "add emissive lights where the brief has them (lantern glow: MeshStandardMaterial emissive + emissiveIntensity 2–6, "
- "a PointLight 0.5–2 per lantern); scene.fog colour must match the sky colour; dusk/night is orange/purple/deep blue, "
- "NOT black — keep mean luminance ≥ 0.15 (check with scene_views: camera_checks.mean_lum)"
+ "the rig clamps requests below its floor UP) and `fill` (the hemisphere) — do not add a second sun on top; "
+ "add emissive lights where the brief has them (lantern glow: the cookbook's practical-light recipe, `PRACTICAL` "
+ "from lib/environment.js — an emissive face plus one PointLight per lantern); scene.fog colour must match the sky "
+ "colour; dusk/night is orange/purple/deep blue, NOT black (check with scene_views: camera_checks.mean_lum)"
)
#: for a frame that is dark but CONTRASTY -- something IS lit, so adding fill is the
#: wrong move and actively destroys the picture. Measured 2026-08-25: temple_night was
diff --git a/harness/codeverse3d/tracks/graphics.py b/harness/codeverse3d/tracks/graphics.py
index f485fe62..ea690d40 100644
--- a/harness/codeverse3d/tracks/graphics.py
+++ b/harness/codeverse3d/tracks/graphics.py
@@ -31,7 +31,7 @@ from codeverse3d.contracts.artifacts import (
from codeverse3d.contracts.common import HARNESS_OWNED_SRC, TRACK_INFO, Language, Track
from codeverse3d.contracts.plan import GraphicsPlan, Plan
from codeverse3d.contracts.run import RoundRecord
-from codeverse3d.languages._gl_common import METRICS_NAME, SHEET_NAME, read_metrics
+from codeverse3d.languages._gl_common import JUDGE_TIMES, METRICS_NAME, SHEET_NAME, read_metrics
from codeverse3d.languages.glsl_shader import (
COMMON,
COMMON_GLSL,
@@ -305,7 +305,7 @@ def graphics_prompt_context(ctx: RunContext, **extra: Any) -> dict[str, Any]:
"style": plan.style if plan else "", "resolution": f"{res[0]}x{res[1]}", "duration": f"{plan.duration_s:g}" if plan else "8",
"passes_table": passes_table(plan), "motion": plan.motion if plan else "", "key_visuals": list(plan.key_visuals) if plan else [],
"uniforms": ", ".join(plan.uniforms) if plan and plan.uniforms else "u_time, u_resolution",
- "expected_files": ctx.runtime.expected_files(ctx.plan), "judge_times": "0, 1, 2.5, 4, 6 s", **extra})
+ "expected_files": ctx.runtime.expected_files(ctx.plan), "judge_times": ", ".join(f"{t:g}" for t in JUDGE_TIMES) + " s", **extra})
# ----------------------------------------------------------------------------- renders / gates