Official Codebase of 3DCodeVerse
Python
tests: scene host tests keep their regressions, lose the history — the catalog test checks only catalog == lib_files
gaoypeng4f3f01e9c5a9
diff --git a/harness/tests/scene_runtime/test_camera_inside_volume.py b/harness/tests/scene_runtime/test_camera_inside_volume.pyindex 79207062..f2192072 100644--- a/harness/tests/scene_runtime/test_camera_inside_volume.py+++ b/harness/tests/scene_runtime/test_camera_inside_volume.py@@ -1,11 +1,8 @@-"""A lens is "inside" a mesh's VOLUME, not its bounding box (2026-09-07).--Measured on loop 9's windmill (`l9_windmill_hero`, three rounds): the `MillDetail` camera-stood 4.9 m from the nearest surface (`nearest_hit_m` 4.941, `BrickBase_7`) and was still-`camera_in_geometry` because the 22 m lattice sails' world bbox contained the eye — a 22 x-22 m box that is nearly all air. The repair moved the camera twice for nothing and the judge-marked "camera inside Sails_1" critical both rounds. `eyeInsideMesh` decides by ray parity-over the mesh's own triangles; the bbox is only the pre-filter.+"""A lens is "inside" a mesh's VOLUME, not its bounding box.++Regression: a camera 4.9 m from the nearest surface was `camera_in_geometry` because a+windmill's 22 m lattice sails' bbox contained the eye; the repair moved it for nothing.+`eyeInsideMesh` decides by ray parity over the mesh's triangles; the bbox is a pre-filter."""from __future__ import annotationsdiff --git a/harness/tests/scene_runtime/test_camera_volumetric.py b/harness/tests/scene_runtime/test_camera_volumetric.pyindex 10f284fb..fd1d393d 100644--- a/harness/tests/scene_runtime/test_camera_volumetric.py+++ b/harness/tests/scene_runtime/test_camera_volumetric.py@@ -1,17 +1,8 @@"""A lens is never "inside" a god ray.-Measured on `bench/out/scene_baseline` (2026-09-05). greenhouse's `scene_frames`-raised, on authored cameras:-- camera inside / touching geometry: inside ['SunShaft_0', 'SunShaft_3']- camera inside / touching geometry: inside ['SunShaft_2']--`SunShaft` is three slabs of MeshBasicMaterial at opacity 0.075 with-`depthWrite: false` and AdditiveBlending — a shaft of light through a greenhouse roof.-Standing in one is what the shot is; you see straight through it. The near-geometry-probe counted them because it raycast and bbox-tested every visible mesh.--Same rule as the placement gate (`backdrop.nonSolid`, D55), one spelling for both.+Regression: the near-geometry probe raycast and bbox-tested every visible mesh, so a+camera standing in an additive, depthWrite:false light shaft was "inside" it and the+repair moved it. Same rule as the placement gate (`backdrop.nonSolid`, D55)."""from __future__ import annotationsdiff --git a/harness/tests/scene_runtime/test_driver_flags.py b/harness/tests/scene_runtime/test_driver_flags.pyindex f95795c7..354c409b 100644--- a/harness/tests/scene_runtime/test_driver_flags.py+++ b/harness/tests/scene_runtime/test_driver_flags.py@@ -1,11 +1,9 @@"""Every documented driver flag must PARSE.-Postmortem 2026-08-30: --no-settle / --camera-repair / --auto-exposure were read-via args[...] but never declared in the parseArgs whitelist, so the first battery-to enable them (scene_px_v1) crashed every render with ERR_PARSE_ARGS_UNKNOWN_OPTION-and four runs' generation cost was lost. This guard invokes each driver with all-optional flags and no workspace: it must die on OUR '--ws is required' error,-never in the argument parser.+Regression: --no-settle / --camera-repair / --auto-exposure were read but never declared+in the parseArgs whitelist, so the first battery to enable them crashed every render.+Each driver runs with all optional flags and no workspace: it must die on OUR+'--ws is required', never in the argument parser."""from __future__ import annotationsdiff --git a/harness/tests/scene_runtime/test_glb_asset_naming.py b/harness/tests/scene_runtime/test_glb_asset_naming.pyindex dcf89e78..476db51c 100644--- a/harness/tests/scene_runtime/test_glb_asset_naming.py+++ b/harness/tests/scene_runtime/test_glb_asset_naming.py@@ -1,18 +1,8 @@"""A loaded GLB root is named after its asset, or nothing can find it.-Measured on `bench/out/scene_baseline` (2026-09-05). rooftop_garden's plan asked for-one `blender_glb` asset, `LoungeSofa`; the Blender sub-run built it (asset judge-0.618), the assembler wrote the loader, the browser loaded it and put it in the scene--- `glb_assets: {meshes_in_scene: 1, in_scene: true}` -- and `scene_placement` still-raised two ERRORs:-- zone PergolaLounge is missing planned contents: LoungeSofa- zone BotanicalAlley is missing planned contents: LoungeSofa--because the object standing in both zones was called **`Scene`**. A glTF root carries-whatever the exporter wrote, and Blender writes "Scene"; the assembler handed that-straight to the zones. Re-probing the recorded workspace with the naming in place-takes those two ERRORs to zero.+Regression: a glTF root carries whatever the exporter wrote ("Scene" from Blender),+and the assembler handed that to the zones, so `scene_placement` reported a loaded+`LoungeSofa` as missing from both zones that held it."""from __future__ import annotationsdiff --git a/harness/tests/scene_runtime/test_placement_volumetric.py b/harness/tests/scene_runtime/test_placement_volumetric.pyindex 1984a96f..5a46597b 100644--- a/harness/tests/scene_runtime/test_placement_volumetric.py+++ b/harness/tests/scene_runtime/test_placement_volumetric.py@@ -1,18 +1,9 @@"""A mesh that writes no depth is fog, not matter: it supports nothing, swallowsnothing and overlaps nothing.-Measured on `bench/out/scene_baseline` (2026-09-05). Two of six scene cells failed-`scene_placement` on nothing but their own atmosphere:-- japanese_garden BambooGroveBorder/BlackPine_5 is sunken 3.46 m into AtmosphereHaze- cozy_cabin WindowSnowView/Mesh_49 and Environment/MoonlightShaft overlap- (100% of the smaller box)--Both scenes were correct. `AtmosphereHaze` is four DoubleSide shells of-MeshBasicMaterial at opacity 0.035 with `depthWrite: false`; `MoonlightShaft` is the-same idiom at 0.04 with AdditiveBlending. Every one of the nine recorded scenes uses-`depthWrite: false` 34-42 times, so this is the generator's standard way to write a-volumetric — not an outlier worth a special case.+Regression: two correct scenes failed `scene_placement` on their own atmosphere — a+pine "sunken 3.46 m into AtmosphereHaze", a window overlapping a MoonlightShaft.+DepthWrite:false shells are the generator's standard way to write a volumetric."""from __future__ import annotationsdiff --git a/harness/tests/scene_runtime/test_scene_driver_retry.py b/harness/tests/scene_runtime/test_scene_driver_retry.pyindex 39872d34..5a3ebf36 100644--- a/harness/tests/scene_runtime/test_scene_driver_retry.py+++ b/harness/tests/scene_runtime/test_scene_driver_retry.py@@ -1,11 +1,7 @@"""A scene driver that LOST ITS BROWSER is retried once on a browser of its own.-Measured 2026-09-05 on `bench/out/scene_baseline`: with the box at load 93 and swap-full, Chrome reaped the render tab of four cells. Each driver exited 2 with-"Attempted to use detached Frame …", `run_scene_script` raised, the round kept zero-renders and the judge was skipped — after the generator had already been paid for.-The object path had retried a transient render since 2026-08-28; the scene path,-which is the only one whose renders the scene judge reads, had no retry at all.+Regression: under load Chrome reaped render tabs ("Attempted to use detached Frame"),+the round kept zero renders and the judge was skipped after the generator was paid."""from __future__ import annotationsdiff --git a/harness/tests/scene_runtime/test_skeleton.py b/harness/tests/scene_runtime/test_skeleton.pyindex f68fd274..43e14c18 100644--- a/harness/tests/scene_runtime/test_skeleton.py+++ b/harness/tests/scene_runtime/test_skeleton.py@@ -142,34 +142,15 @@ def test_the_effects_catalog_reaches_the_scene_prompts_and_only_those():assert "effects_catalog" not in (tpl / "scene_asset.j2").read_text()-def test_every_call_the_catalog_advertises_is_a_real_export():- """The catalog is the agent's only index of 44 modules. One stale name and a- session writes an import that cannot resolve — and the reference catalog this- was ported from already carried five (`makeFigure`, `makeCreature`, `place`,- `instanceAll`, `hash` are none of them exports here)."""+def test_the_catalog_names_every_library_module_and_no_other():+ """The catalog is the agent's only index of the library. That every call+ it names is a real export is checked at runtime in lib/test_library.py."""import refrom codeverse3d.languages.scene_threejs import lib_filesfrom codeverse3d.prompts import PROMPTS_DIR- exports: set[str] = set()- modules = {p.name for p in lib_files()}- for p in lib_files():- src = p.read_text()- exports |= set(re.findall(r"^export\s+(?:async\s+)?function\s+([A-Za-z0-9_]+)", src, re.M))- exports |= set(re.findall(r"^export\s+const\s+([A-Za-z0-9_]+)", src, re.M))-catalog = (PROMPTS_DIR / "scene_threejs" / "effects_catalog.md").read_text()- # option names and prose words that appear in backticks but name no export- prose = {"js", "true", "false", "material", "scene", "g", "t", "dt", "update", "tick",- "logarithmicDepthBuffer", "sunDir", "ambient", "elevation", "color"}- unknown, named = [], set()- for row in catalog.splitlines():- if not row.startswith("|") or row.startswith(("| ---", "| Want")):- continue- named |= set(re.findall(r"`lib/([a-z_]+\.js)`", row))- for fn in re.findall(r"`([a-zA-Z][A-Za-z0-9_]*)(?:\(|`| )", row):- if fn not in prose and fn not in exports:- unknown.append(fn)- assert not unknown, sorted(set(unknown))- assert named == modules, sorted(modules - named)+ named = set(re.findall(r"`lib/([a-z_]+\.js)`", catalog))+ modules = {p.name for p in lib_files()}+ assert named == modules, (sorted(modules - named), sorted(named - modules))