Skip to content

Official Codebase of 3DCodeVerse

Python

contracts: BuildResult.gates — the build's own gate reports join the round's gates

gaoypeng17e16871301e
diff --git a/harness/codeverse3d/contracts/artifacts.py b/harness/codeverse3d/contracts/artifacts.py
index 206dea6d..44ba1920 100644
--- a/harness/codeverse3d/contracts/artifacts.py
+++ b/harness/codeverse3d/contracts/artifacts.py
@@ -83,6 +83,11 @@ class BuildResult(BaseModel):
error_line: int | None = None
duration_ms: int = 0
census: dict[str, Any] = Field(default_factory=dict, description="language-native census (objects, materials ...)")
+ gates: list[GateReport] = Field(
+ default_factory=list,
+ description="the build's own gate reports (scene_threejs: scene_probe + shader_preflight; the graphics "
+ "languages: gl_frames) — tracks/steps appends them to the round's gates, built or not",
+ )
harness_failure: bool = Field(
default=False,
description="the build did not fail on the model's code — the harness could not run it "
diff --git a/harness/codeverse3d/languages/_gl_common.py b/harness/codeverse3d/languages/_gl_common.py
index 190d16ae..78a31f2b 100644
--- a/harness/codeverse3d/languages/_gl_common.py
+++ b/harness/codeverse3d/languages/_gl_common.py
@@ -4,7 +4,8 @@
``artifacts/frames/*.png`` (written by the runner), ``artifacts/frames_sheet.png``,
``artifacts/preview.gif``, ``artifacts/metrics.json`` (frame stats + the
``gl_frames`` gate), ``artifacts/build.json`` — and a typed :class:`BuildResult`
-(``glb_path`` is always None: the deliverable is code + frames).
+(``glb_path`` is always None: the deliverable is code + frames; ``gates`` carries the
+``gl_frames`` report, which the round takes from there).
``judge_times`` derives the judged times from the plan's duration.
``make_host`` is the one place a runtime turns settings into a :class:`GlHost`.
@@ -102,6 +103,7 @@ def finish_build(ws: Workspace, res: GlResult, *, language: str, error_file: str
art = ws.artifacts
art.mkdir(parents=True, exist_ok=True)
extras: dict[str, str] = {}
+ gates: list[GateReport] = []
cen: dict = {"renderer": res.renderer, "gpu": res.gpu, "feedback": res.feedback, "n_frames": len(res.frames),
"gl_duration_ms": res.duration_ms, **(census or {})}
if res.ok and res.judge_frames:
@@ -114,6 +116,7 @@ def finish_build(ws: Workspace, res: GlResult, *, language: str, error_file: str
extras["gif"] = str(gif)
seq = sequence_stats([(f.time, f.path) for f in frames], nan_counts=[(f.nan, f.inf) for f in frames])
gate = frame_gate(seq, motion_expected=motion_expected)
+ gates.append(gate)
metrics = art / METRICS_NAME
metrics.write_text(json.dumps({"stats": seq.model_dump(mode="json"), "gate": gate.model_dump(mode="json")}, indent=1))
extras["metrics"] = str(metrics)
@@ -125,7 +128,7 @@ def finish_build(ws: Workspace, res: GlResult, *, language: str, error_file: str
error_type="" if res.ok else (res.error_type or "RenderError"),
error_message="" if res.ok else (error_message if error_message is not None else res.error_message)[:4000],
error_file=error_file if not res.ok else "", error_line=error_line if not res.ok else None,
- duration_ms=res.duration_ms, census=cen,
+ duration_ms=res.duration_ms, census=cen, gates=gates,
)
if res.ok and not res.judge_frames:
result.error_type, result.error_message = "NoFrames", "the renderer produced no frames"
diff --git a/harness/codeverse3d/languages/scene_threejs/__init__.py b/harness/codeverse3d/languages/scene_threejs/__init__.py
index add041e0..f967d2c8 100644
--- a/harness/codeverse3d/languages/scene_threejs/__init__.py
+++ b/harness/codeverse3d/languages/scene_threejs/__init__.py
@@ -767,8 +767,9 @@ class SceneThreeJsRuntime:
def build(self, ws: Workspace, *, timeout_s: int | None = None) -> BuildResult:
"""Probe + shader preflight (one browser boot); ok iff the module loads
- and no shader errors. External contract unchanged: the same two
- GateReports land under ``artifacts/gates/``."""
+ and no shader errors. The two GateReports are the build's own
+ (``BuildResult.gates``, which the round appends to its gates) and land
+ under ``artifacts/gates/`` as well."""
t0 = time.time()
tmo = min(float(timeout_s or get_settings().limits.build_timeout_s), 120.0)
ws.artifacts.mkdir(parents=True, exist_ok=True)
@@ -801,6 +802,7 @@ class SceneThreeJsRuntime:
error_line=_target_line(first.target) if first else None,
duration_ms=int((time.time() - t0) * 1000),
census=census,
+ gates=[probe, shaders],
# a driver that could not run is not a defect in the scene; `probes.probe_report`
# and `_probe_and_preflight` already mark it, and `build_with_repair` reads this
# so the round does not spend its repair budget rewriting working code
diff --git a/harness/codeverse3d/tracks/graphics.py b/harness/codeverse3d/tracks/graphics.py
index fa046b92..d76c8103 100644
--- a/harness/codeverse3d/tracks/graphics.py
+++ b/harness/codeverse3d/tracks/graphics.py
@@ -3,11 +3,11 @@
Languages: glsl_shader (Shadertoy-style fragment shader) · opengl_python (raw
moderngl program). Reuses ``BaseTrack`` (lifecycle) and ``run_round`` (steps)
unchanged; the track-specific pieces are the recipe seeding, the prompt context
-(no 3D frame), the ``gl_frames`` gate (frame statistics from the build) and the render
-step (the sampled frames + contact sheet as the RenderSet the ``shader_v2`` judge sees).
-Planning is ``tracks/planner.py``'s, like every track's (template, worked example,
-T = 0.5, acceptance: all dispatched on the track there). Refinement is always one
-whole-program task.
+(no 3D frame) and the render step (the sampled frames + contact sheet as the RenderSet
+the ``shader_v2`` judge sees); the ``gl_frames`` gate is the build's own
+(``BuildResult.gates``). Planning is ``tracks/planner.py``'s, like every track's
+(template, worked example, T = 0.5, acceptance: all dispatched on the track there).
+Refinement is always one whole-program task.
"""
from __future__ import annotations
@@ -343,16 +343,14 @@ def frame_stats_text(ws: Workspace) -> str:
class GraphicsPipeline:
- """No measurement; gates = gl_frames (from artifacts/metrics.json); render = the frames."""
+ """No measurement; no gates of its own — the build's ``gl_frames`` report is the round's
+ gate (``BuildResult.gates``, appended by ``steps``); render = the frames."""
def measure(self, ctx: RunContext, build: BuildResult) -> Measurement | None:
return None
def gates(self, ctx: RunContext, round_index: int, build: BuildResult, measurement: Measurement | None) -> list[GateReport]:
- m = read_metrics(ctx.ws)
- if m is None:
- return []
- return [m[1]]
+ return []
def render(self, ctx: RunContext, round_index: int, build: BuildResult, measurement: Measurement | None) -> RenderSet:
return frames_render_set(ctx.ws, build, round_index)
diff --git a/harness/codeverse3d/tracks/scene.py b/harness/codeverse3d/tracks/scene.py
index 367bf2af..b9881535 100644
--- a/harness/codeverse3d/tracks/scene.py
+++ b/harness/codeverse3d/tracks/scene.py
@@ -1,7 +1,8 @@
"""SceneTrack: plan → skeleton → (assets ∥ env) → zones → assemble → rounds.
Language: scene_threejs. Generation is staged (each stage cached by
-``StageRunner`` for resume); the round loop then builds (probe + shaders),
+``StageRunner`` for resume); the round loop then builds (probe + shaders — the
+build's two gate reports join the round's gates),
renders authored cameras + orbit at t=0 and t=1.5, judges with ``scene_v1``
(console/shader errors become gate ERRORS) and dispatches refine tasks per
zone / asset / env / camera, in parallel when file-disjoint.
@@ -93,16 +94,14 @@ REFINE_TIMEOUT_S = 900
class ScenePipeline:
- """No GLB measurement; gates from the build census + runtime; render_scene; console caps."""
+ """No GLB measurement; the placement gate from the build's census (the build's own probe and
+ preflight reports join the round through ``BuildResult.gates``); render_scene; console caps."""
def measure(self, ctx: RunContext, build: BuildResult) -> Measurement | None:
return None
def gates(self, ctx: RunContext, round_index: int, build: BuildResult, measurement: Measurement | None) -> list[GateReport]:
out: list[GateReport] = []
- census_gate = census_gate_report(build)
- if census_gate is not None:
- out.append(census_gate)
# scene_placement (2026-08-26): floating / sunken / unsupported / interpenetrating assets from
# the probe census's placement table — the first deterministic placement gate on this track
# (before it, the scene_v1 floating_part cap could never fire). Advisory instrumentation:
@@ -441,19 +440,18 @@ class SceneTrack(BaseTrack):
timeout_s=ctx.budget.timeout_s(REFINE_TIMEOUT_S, floor_s=180, soft=False))
def _rebuild_task(self, ctx: RunContext, last: RoundRecord, index: int) -> GenerationTask:
- """One repair task carrying the structured error report (build + lint + census
- errors), targeted at the failing module when the build names one."""
+ """One repair task carrying the structured error report (build + lint; the probe's
+ and the preflight's findings are the build's log tail), targeted at the failing
+ module when the build names one."""
lint = next((g for g in last.gates if g.gate.startswith("lint")), GateReport(gate="lint", passed=True))
report = format_error_report(last.build, lint, ctx.cookbook_text) if last.build else "build did not run"
- census = census_gate_report(last.build) if last.build else None
- lines = [report] + [f"- {f.as_line()}" for f in (census.errors if census else [])][:8]
files: list[str] = []
if last.build is not None and last.build.error_file:
rel = last.build.error_file.removeprefix(str(ctx.ws.root)).lstrip("/")
if (ctx.ws.root / rel).is_file():
files = [rel]
files = files or ctx.runtime.expected_files(ctx.plan)
- prompt = render("tracks/scene_refine.j2", **self._ctx(ctx, recipes="", round_index=index, tasks=lines, targets=["build"],
+ prompt = render("tracks/scene_refine.j2", **self._ctx(ctx, recipes="", 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, scoped=False)))
@@ -497,20 +495,6 @@ def _touched(path: Any, since: float) -> bool:
return False
-def census_gate_report(build: BuildResult) -> GateReport | None:
- """Turn scene census error lists (console/shader) into a gate, when present."""
- c = build.census or {}
- findings: list[GateFinding] = []
- for key, gate in (("console_errors", "scene_probe"), ("shader_errors", "shader_probe"), ("errors", "scene_probe")):
- for e in c.get(key, []) or []:
- text = e if isinstance(e, str) else str(e)
- findings.append(GateFinding(gate=gate, severity=Severity.ERROR, message=text[:300],
- fix_hint="fix the module named in the error; rerun the build tool until the probe is clean"))
- if not findings and not c:
- return None
- return GateReport(gate="scene_census", passed=not findings, findings=findings)
-
-
def _guess_target(error: str, plan: Any) -> str:
low = error.lower()
for attr in ("zones", "assets"):
diff --git a/harness/codeverse3d/tracks/steps.py b/harness/codeverse3d/tracks/steps.py
index eeeab956..2e79464d 100644
--- a/harness/codeverse3d/tracks/steps.py
+++ b/harness/codeverse3d/tracks/steps.py
@@ -305,6 +305,9 @@ def _run_round(
post = getattr(pipeline, "post_render_gates", None)
if callable(post) and rec.renders is not None:
gates.extend(post(ctx, index, rec.renders))
+ # the build's own reports (scene_probe + shader_preflight, gl_frames) after the
+ # track's: the judge's warning list is capped and reads them in this order
+ gates.extend(outcome.build.gates)
n_err = sum(len(g.errors) for g in gates)
ctx.events.emit("gates.done", round=index, n_gates=len(gates), n_errors=n_err,
tri_count=rec.measurement.tri_count if rec.measurement else None)
@@ -327,6 +330,8 @@ def _run_round(
# (the loop stops at its next budget check instead).
ctx.budget.add(rec.judgment.usage, stage="judge")
else:
+ # a failed build's own reports say why (a shader error lives in shader_preflight)
+ gates.extend(outcome.build.gates)
notes.append(f"build failed: {outcome.build.error_type}: {outcome.build.error_message[:200]}")
rec.gates = gates
rec.skills = skills_hook.record_usage(ctx, index=index, kind=skill_kind)
diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.md
index 737cd0c5..40674004 100644
--- a/harness/docs/ARCHITECTURE.md
+++ b/harness/docs/ARCHITECTURE.md
@@ -78,7 +78,8 @@ codeverse3d/
default_candidates=1)
contracts/ pydantic: common (Track, Language, Usage, Budget, Backends, TRACK_INFO registry,
ENTRY_FILE/code_file/LANGUAGE_LABEL tables), spec (+ RunOptions), plan, artifacts
- (GateFinding.as_line, RenderView.judge, RenderSet.out_dir, + Judgment), run
+ (GateFinding.as_line, GateReport.of, BuildResult.gates, RenderView.judge,
+ RenderSet.out_dir, + Judgment), run
(+ SkillsUsage/SkillRead: what was attached, what was read), chat,
agent (typed AgentJob)
workspace.py run-dir layout + git snapshots
@@ -483,8 +484,7 @@ after the run (`3dcode make`, unless --no-pick): addons/select.pick(by="score")
```
Track-specific gates: static `connectivity` + `contract` (+ `reference_silhouette`),
articulated + `joint_sweep` + `motion_direction` (URDF axis vs plan motion text),
-scene `scene_placement` (`spatial/scene_placement.py`, appended after the census gate in
-`ScenePipeline.gates`: per placed asset, foot-column gap to the surface beneath, burial depth,
+scene `scene_placement` (`spatial/scene_placement.py`, `ScenePipeline.gates`' one gate: per placed asset, foot-column gap to the surface beneath, burial depth,
water, contacts and 3-D interpenetration pairs from `runtime_js/lib/host_placement.mjs` — the
first deterministic placement check on the track; before 2026-08-26 the scene_v1
`floating_part` cap could never fire and floating/sunken was left to the VLM) +
@@ -498,6 +498,11 @@ water was rippling, and **`unused_glb_asset`** — the scene host wraps `loaders
records each GLB's geometry UUIDs, so the census can say whether any of it reached the
rendered frame; `Object3D.clone()` shares geometry, so a cloned hero still counts and only
a discarded load does not), graphics `gl_frames` (NaN/black/blown/static/flicker).
+A build's OWN gate reports ride `BuildResult.gates` — scene `scene_probe` + `shader_preflight`
+(one browser boot), graphics `gl_frames` — and `steps._run_round` appends them to the round's
+gates after the track's (a failed build's too: a shader compile error is what routes the
+shader-traps skill); before 2026-09-22 the scene's two never reached a round, and an always-empty
+`scene_census` gate parsed census keys the probe had stopped writing.
## 8. Texturing (derived asset pack)
diff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.md
index 19105d38..c6e4cb9e 100644
--- a/harness/docs/INTERFACES.md
+++ b/harness/docs/INTERFACES.md
@@ -31,6 +31,9 @@ from codeverse3d.contracts.common import ENTRY_FILE, code_file, LANGUAGE_LABEL
from codeverse3d.contracts.spec import RunOptions # Spec.options: candidates (int|None, ≥1), texture (bool)
GateFinding.as_line(with_gate=False, with_severity=False, with_target=False, with_hint=True) -> str
# "GATE <gate>: [<sev>] <message> [<target>] FIX: <hint>" — flags opt in; no leading "- "
+GateReport.of(gate, findings=(), *, duration_ms=0) -> GateReport # passed iff no ERROR — every gate whose verdict IS its findings
+BuildResult.gates: list[GateReport] # the build's own reports (scene_probe + shader_preflight; gl_frames);
+ # tracks/steps appends them to the round's gates, after the track's, built or not
RenderView.judge: bool | None # stamped True/False at render time; None = legacy round (every stored view is judged)
RenderSet.out_dir: str # directory the views (+ views.json/metrics.json) were written to ("" on old rounds)
from codeverse3d.config import get_settings, env_flag # env_flag(env, fallback) -> bool: on/off/1/0/true/false/yes/no;
@@ -231,7 +234,7 @@ BuildResult.error_type spellings (languages/_common.py): MISSING_ENTRY = "Missin
| `CadQueryRuntime` | `src/model.py` | trailing selector on the stack → parent solid exported + warning (ExportError when no solid exists); helper-module errors map to `src/<file>.py:line`; object.glb/stl/step |
| `ThreeJsRuntime` | `src/object.js`, `src/parts/*.js` | **Δ export as authored** (census `placement_offset`); InstancedMesh baked to `<Name>_<i>` meshes (`instanced_meshes_baked`); exported `selfcheck(THREE, root)` is called (throw → SelfCheckError); NaN geometry errors name mesh/part → routed to `src/parts/<snake>.js` |
| `UrdfBlenderRuntime` | `src/model.py`, `src/robot.urdf` | object.glb (Y-up, node=link, joint extras), meshes/<link>.glb (raw Z-up link frames); link name `world` is reserved (lint ERROR + UrdfError); robot GLB root gets `__root` suffix on name clash |
-| `SceneThreeJsRuntime` | `src/scene.js`, `src/zones/*.js`, `src/assets/*.js`, `src/env.js`, `src/shaders/*.js` | glb_path=None; ok iff `probe_scene` + `check_shaders` pass |
+| `SceneThreeJsRuntime` | `src/scene.js`, `src/zones/*.js`, `src/assets/*.js`, `src/env.js`, `src/shaders/*.js` | glb_path=None; ok iff the probe and the shader preflight (one `probe_scene.mjs --compile` boot) both pass; both reports ride `BuildResult.gates` |
| `GlslShaderRuntime` | `src/shader.frag`, `src/common.glsl`, `src/buffer_a.frag` (+ the harness-owned `src/recipes.glsl` when seeded) | harness owns `#version`/uniforms/`out` (wrap.HEADER: u_time/u_resolution/u_mouse/u_frame/u_prev/u_noise + iTime/iChannel* aliases); `wrap.compose(shader, common, recipes_src=…)` pastes header < recipes < common < shader; build renders judge frames via GlHost; compile errors → GlslCompileError at mapped src file:line (recipes.glsl included); lint ERROR `redefines_recipe` when an agent file defines a recipes.glsl name; artifacts frames/, frames_sheet.png, preview.gif, metrics.json |
| `OpenGLPythonRuntime` | `src/program.py`, `src/*.glsl` | `setup(ctx,w,h)->state` + `render(ctx,state,t,frame,fbo)` run in a moderngl subprocess (`wrappers/run_gl.py`); exceptions map to src/program.py:line, in-string GLSL errors carry both line numbers |
@@ -523,7 +526,7 @@ plan(spec, model_id, plan_model, ws, *, model=None, events=None, budget=None) ->
# planner hooks and plan()'s template / example / temperature / max_output_tokens / finalise / event_stats are gone
```
`run_round` = generate → commit → `build_with_repair` → measure → gates → render →
-post-render gates → judge → commit. Post-render gates: static `reference_silhouette`
+post-render gates → the build's own `BuildResult.gates` (also when the build failed) → judge → commit. Post-render gates: static `reference_silhouette`
(when references), articulated `joint_sweep` + `motion_direction`, scene
`render_console` + `scene_frames` (via `ctx.services.frame_gate` ->
`frame_gate_from_renders`; advisory, a failure is logged not raised), graphics `gl_frames`. Reference specs get a
diff --git a/harness/docs/SKILLS.md b/harness/docs/SKILLS.md
index 68a04c32..fd85a64d 100644
--- a/harness/docs/SKILLS.md
+++ b/harness/docs/SKILLS.md
@@ -660,10 +660,11 @@ so; the rest are live.
`contract_findings` regressed on `n_parts` gives R² = 0.103, and a pinned A/A pair scored
0.450 vs 0.654 on identical arms. The spread is *generation* noise at fixed plan size.
Do not budget an A/B on the assumption that pinning buys power.
-* **`shader_preflight` is not a gate.** `check_shaders` is an agent-invocable tool, never a
- pipeline step, so it reaches no `record.json`. `c3d-threejs-shader-traps` is therefore
- **not instrumented**, which is a stronger statement than "always clean". Merge it into
- `rounds[].gates` before spending anything on that bundle.
+* ~~**`shader_preflight` is not a gate.**~~ **Fixed 2026-09-22**: the scene build's
+ `scene_probe` + `shader_preflight` reports ride `BuildResult.gates`, and every round
+ (a failed build's included) appends them to `rounds[].gates`, so R21 can fire and
+ `c3d-threejs-shader-traps` is instrumented from that date on. Runs recorded before it carry
+ no `shader_preflight` gate: a readout across the date must not mix the two.
* ~~**`eval/bench/_fixed_eval.FixedEvaluator` is blender-only.**~~ Fixed 2026-08-26; the entry
lives in `docs/SKILLS_LEDGER.md` §4.
* ~~**The atime probe is blind in any git workspace, and its control proves it.**~~ **Worked
diff --git a/harness/docs/SKILLS_LEDGER.md b/harness/docs/SKILLS_LEDGER.md
index 752141bf..27f6c06f 100644
--- a/harness/docs/SKILLS_LEDGER.md
+++ b/harness/docs/SKILLS_LEDGER.md
@@ -310,7 +310,9 @@ it lands these four rows stay `mixed`, not `measured`.
`artifacts/shader_preflight.json` files, all clean. "Not instrumented" and "measured,
always clean" must not print the same number — the readout now returns `None` when the
artefact is absent, so the row's denominator is 8 and not 198. Rule of three puts the 95%
- upper bound on the base rate at 0.43/run.
+ upper bound on the base rate at 0.43/run. **Since 2026-09-22** every scene round carries
+ it (`BuildResult.gates`, appended by the round built or not); runs before that date still
+ do not.
* **A run is a sample iff it has a round carrying a gate report.** `RunRecord.status` says
how the round loop *ended* (`passed`/`plateau`/`budget`/`failed`), not whether gates ran.
Filtering on status dropped every `budget` run — about half the corpus — and would have
diff --git a/harness/tests/orchestrator_tracks/test_tracks.py b/harness/tests/orchestrator_tracks/test_tracks.py
index e8495708..f8eb6cb4 100644
--- a/harness/tests/orchestrator_tracks/test_tracks.py
+++ b/harness/tests/orchestrator_tracks/test_tracks.py
@@ -7,6 +7,7 @@ import json
import pytest
from codeverse3d.addons import select
+from codeverse3d.contracts.artifacts import GateFinding, GateReport, Severity
from codeverse3d.contracts.common import Language, Track
from codeverse3d.contracts.plan import ArticulatedPlan, ScenePlan
from codeverse3d.contracts.run import RunRecord, RunStatus
@@ -303,6 +304,45 @@ def test_a_mood_only_replan_invalidates_the_env_stage(tmp_path, settings):
assert "env" in [j.label for j in agent.jobs] # a stale cached env must not be served
+class _ProbedSceneRuntime(FakeRuntime):
+ """The fake scene build, carrying the two reports the real one returns in ``BuildResult.gates``."""
+
+ def build(self, ws, *, timeout_s=None):
+ res = super().build(ws, timeout_s=timeout_s)
+ sev = Severity.WARN if res.ok else Severity.ERROR
+ shader = GateFinding(gate="shader_preflight", severity=sev, target="src/zones/quay.js:3",
+ message="uniform uTime is read but never bound")
+ return res.model_copy(update={"gates": [GateReport.of("scene_probe"), GateReport.of("shader_preflight", [shader])]})
+
+
[email protected]("broken", [False, True])
+def test_the_builds_own_gate_reports_join_the_round(tmp_path, settings, broken):
+ """scene_probe + shader_preflight reach the round's gates: after the track's own on a built round
+ (the judge's warning list is capped in gate order), and on a failed build too — where the shader
+ error is what routes the shader skill (R21) into the next round."""
+ from codeverse3d.skills.registry import SHADER_COMPILE_OR_BINDING, finding_kinds
+
+ plan = _small_scene_plan()
+ spec = make_spec(Track.SCENE, Language.SCENE_THREEJS, max_rounds=0)
+ ws = Workspace(tmp_path / "runs" / "probed")
+
+ def _writer(job, ws_):
+ files = _scene_writer(job, ws_)
+ return {k: v + f"// {FAIL_MARK}\n" for k, v in files.items()} if broken and job.label.startswith("zones_") else files
+
+ track = SceneTrack(services=FakeServices(assemble=True), judge=FakeJudge(scores=(0.6,)), agent=FakeAgent(_writer),
+ planner_model=_planner(plan.model_dump(mode="json")), settings=settings,
+ runtime=_ProbedSceneRuntime(Language.SCENE_THREEJS))
+ r0 = track.run(spec, ws).rounds[0]
+ names = [g.gate for g in r0.gates]
+ assert r0.build.ok is not broken
+ assert names[0] == "lint:scene_threejs" and names[-2:] == ["scene_probe", "shader_preflight"]
+ if broken: # nothing but lint ran besides the build
+ assert names == ["lint:scene_threejs", "scene_probe", "shader_preflight"]
+ assert (ws.gates_dir(0) / "shader_preflight.json").is_file()
+ assert SHADER_COMPILE_OR_BINDING in finding_kinds(r0.gates)
+
+
def test_get_track_dispatch():
assert isinstance(get_track("static_object"), StaticObjectTrack)
assert isinstance(get_track(Track.SCENE), SceneTrack)
diff --git a/harness/tests/scene_gates/test_placement.py b/harness/tests/scene_gates/test_placement.py
index 48a03da1..6d218004 100644
--- a/harness/tests/scene_gates/test_placement.py
+++ b/harness/tests/scene_gates/test_placement.py
@@ -148,12 +148,12 @@ def test_error_findings_become_zone_routed_refine_tasks_one_per_asset():
assert all(t.kind == f"gate:{GATE}" and "lower " in t.instruction for t in tasks)
-def test_pipeline_gates_append_placement_after_census_and_never_raise():
+def test_pipeline_gates_are_placement_alone_and_never_raise():
plan = _plan()
ctx = SimpleNamespace(runtime=SimpleNamespace(), plan=plan, extra={})
build = BuildResult(ok=True, language="scene_threejs", census={"totals": {"meshes": 3}, "placement": _table(_row("Lantern", gap=0.3))})
gates = ScenePipeline().gates(ctx, 0, build, None)
- assert [g.gate for g in gates] == ["scene_census", GATE] and not gates[-1].passed
+ assert [g.gate for g in gates] == [GATE] and not gates[-1].passed
# no table (scene did not boot / old driver) → no placement gate at all
assert [g.gate for g in ScenePipeline().gates(ctx, 0, BuildResult(ok=False, language="scene_threejs", census={}), None)] == []
# a broken table is a WARN, not an exception