Official Codebase of 3DCodeVerse
Python
Drop retired Gemini models, the cost-profile dial and all image generation
gaoypengac10c111ac18
diff --git a/eval/README.md b/eval/README.mdindex 089e4173..6fab82e8 100644--- a/eval/README.md+++ b/eval/README.md@@ -19,7 +19,7 @@ cd evalpip install -e ../harness # once; both evaluations import codeverse3dpython -m bench.run_bench bench/prompts/static_objects_v1.yaml --generator agy:gemini-4-argonpython -m bench.report bench/out/static_objects_v1 # rebuild report.md + report.html-python bench/compare_backends.py --prompts bench/prompts/compare_v1.yaml --arms harness:agy:gemini-4-argon,oneshot:gemini:gemini-3.7-flash --out bench/out/compare_v1+python bench/compare_backends.py --prompts bench/prompts/compare_v1.yaml --arms harness:agy:gemini-4-argon,oneshot:gemini:gemini-3.8-flash --out bench/out/compare_v1python -m bench.run_bench bench/prompts/scenes_v2.yaml --variant argon --judge gemini:gemini-4-argon # a per-model prompt/skill variant (D105) on every runpython -m bench.loop init --name argon_scene --out bench/out/loop_argon --variant argon --languages scene_threejs,scene_blender \--generator agy:gemini-4-argon --judge gemini:gemini-4-argon --judge-thinking medium --parallel 15 --rounds 2 --max-minutes 90diff --git a/eval/bench/compare_backends.py b/eval/bench/compare_backends.pyindex 5bbc9abc..96cc185d 100644--- a/eval/bench/compare_backends.py+++ b/eval/bench/compare_backends.py@@ -1,8 +1,8 @@"""Harness vs raw one-shot generation under ONE fixed judge (methodology bench).python bench/compare_backends.py --prompts bench/prompts/compare_v1.yaml \\- --arms harness:agy:gemini-3.6-flash,harness:agy:gemini-4-argon,\\-oneshot:claude-code,oneshot:codex,oneshot:gemini:gemini-3.7-flash \\+ --arms harness:agy:gemini-3.8-flash,harness:agy:gemini-4-argon,\\+oneshot:claude-code,oneshot:codex,oneshot:gemini:gemini-3.8-flash \\--judge gemini:gemini-3.1-pro-preview --out <dir> [--parallel 8] [--limit N]Armsdiff --git a/eval/bench/concurrency_probe.py b/eval/bench/concurrency_probe.pyindex d178e204..a887268f 100644--- a/eval/bench/concurrency_probe.py+++ b/eval/bench/concurrency_probe.py@@ -164,7 +164,7 @@ def run_level(def main() -> None:ap = argparse.ArgumentParser(description=__doc__)- ap.add_argument("--model", default="gemini-3.7-flash")+ ap.add_argument("--model", default="gemini-3.8-flash")ap.add_argument("--levels", default="4,8,16,32,64")ap.add_argument("--calls", type=int, default=48, help="calls per level (the fixed workload)")ap.add_argument("--in-tokens", type=int, default=12000, help="prompt size (a generator call)")diff --git a/eval/bench/plan_stage_bench.py b/eval/bench/plan_stage_bench.pyindex 048fc991..82a41031 100644--- a/eval/bench/plan_stage_bench.py+++ b/eval/bench/plan_stage_bench.py@@ -31,7 +31,7 @@ import timefrom pathlib import PathDEFAULT_BATTERY = "bench/prompts/articulated_v2.yaml"-DEFAULT_PLANNER = "gemini:gemini-3.7-flash"+DEFAULT_PLANNER = "gemini:gemini-3.8-flash"DEFAULT_GENERATOR = "agy:gemini-4-argon"DEFAULT_JUDGE = "gemini:gemini-3.1-pro-preview"diff --git a/eval/bench/run_bench.py b/eval/bench/run_bench.pyindex 08b2c897..2d3e5df3 100644--- a/eval/bench/run_bench.py+++ b/eval/bench/run_bench.py@@ -136,7 +136,7 @@ class BenchOptions(BaseModel):ids: list[str] = Field(default_factory=list)tiers: list[str] = Field(default_factory=list)# No "start over" switch: --redo-status is the ONE way to re-run a recorded prompt,- # because it archives the old tree first (RUNBOOK 7.u). The `resume` flag it replaced+ # because it archives the old tree first (RUNBOOK 6.u). The `resume` flag it replaced# skipped that archive and resumed the old workspace, spec and clock (dropped 2026-08-30).redo_status: list[str] = Field(default_factory=list,description="re-run prompts already recorded with one of these statuses "@@ -424,7 +424,7 @@ def main(argv: Sequence[str] | None = None) -> int:"0 = all at once); a cell that starts when another finishes is staggered by itself")ap.add_argument("--rounds", type=int, default=4)ap.add_argument("--max-minutes", type=float, default=60.0,- help="wall-clock budget per run; size it to the weather (RUNBOOK 7.x: 120 in a 503 storm, "+ help="wall-clock budget per run; size it to the weather (RUNBOOK 6.x: 120 in a 503 storm, ""else runs burn the hour with no judged round)")ap.add_argument("--limit", type=int, default=None)ap.add_argument("--id", dest="ids", action="append", default=[], help="only this prompt id (repeatable)")diff --git a/eval/docs/EVAL.md b/eval/docs/EVAL.mdindex 0147a745..9bac3588 100644--- a/eval/docs/EVAL.md+++ b/eval/docs/EVAL.md@@ -14,7 +14,7 @@ fooling ourselves. Tools: `bench/run_bench.py`, `bench/compare_backends.py`,1. **Fixed judge.** One judge model + rubric + `n_samples` for every arm of acomparison, never the in-loop judge's own score. Default for decisive runs:`gemini:gemini-3.1-pro-preview` (the settings default), `n_samples≥2`;- `gemini-3.7-flash` is fine for the loop but is lenient/noisy on fine+ `gemini-3.8-flash` is fine for the loop but is lenient/noisy on finedistinctions (overall std ≈ 0.08–0.12 at n=3) — its dynamic range comes fromthe rubric defect checklist, not the criteria.2. **Same evidence for every arm.** The evaluator rebuilds from code: lint+build →@@ -110,9 +110,9 @@ cheaply.```bashpython bench/compare_backends.py --prompts bench/prompts/compare_v1.yaml \- --arms harness:agy:gemini-3.6-flash,harness:agy:gemini-4-argon,oneshot:claude-code,oneshot:codex,oneshot:gemini:gemini-3.7-flash,oneshot+repair:gemini:gemini-3.7-flash \+ --arms harness:agy:gemini-3.6-flash,harness:agy:gemini-4-argon,oneshot:claude-code,oneshot:codex,oneshot:gemini:gemini-3.8-flash,oneshot+repair:gemini:gemini-3.8-flash \--judge gemini:gemini-3.1-pro-preview --out bench/out/compare_v1 [--parallel 3] [--limit N] [--ids a,b]- [--rounds 3] [--loop-judge gemini:gemini-3.7-flash] [--repair-attempts 2] [--gen-timeout 900]+ [--rounds 3] [--loop-judge gemini:gemini-3.8-flash] [--repair-attempts 2] [--gen-timeout 900][--no-pairwise] [--no-resume] [--report-only]```Arms:diff --git a/eval/docs/PAPER_WRITING.md b/eval/docs/PAPER_WRITING.mdindex a33e194e..82144185 100644--- a/eval/docs/PAPER_WRITING.md+++ b/eval/docs/PAPER_WRITING.md@@ -576,7 +576,7 @@ is why ab_plan refuses one.| `C3D_LEAN_PROMPT` | drop duplicated contract/tool cards, select cookbook chapters, focus the refine prompt | **off** | +0.030 ±0.076, no cost saving (§4); **removed from the tree 2026-09-03**; last carried on `ziyao/articulated-wave-2` before commit `4cbb28c`. || `C3D_FEWER_TURNS` (pre-existing) | fold gate checks into build, inline refine files | **off** | +0.015 ±0.126, dollars flat (§4) || `C3D_AXIS_REPAIR` (upstream) | deterministic axis rewrite from the measured motion | on | upstream's, kept |-| `C3D_SCENE_TEXTURES` | wire the scene texture pack into the loop: a stage before env/zones, and `texture_pack_prompt` in both prompts | **off** | added 2026-09-05 (D58) and NOT yet measured. Four of five scored cells of the first scene battery complain the ground is a flat untextured colour, in near-identical words; the pack generator existed and had never been called from the loop. Costs an image-model call per run (measured $0.15 for two 512 px textures, seam 0.001) |+| `C3D_SCENE_TEXTURES` | the scene texture pack stage before env/zones | **off** | never measured; **removed from the tree 2026-11-03** with all image generation (owner: not a feature for now) |Not switched, because they are bug fixes rather than levers: the MCP verdict/failed split(§5.2), `<mimic>` support (§5.3), the provider-failure markers and retries (§5.4), thediff --git a/eval/tests/conftest.py b/eval/tests/conftest.pyindex 9aaa3e75..cfca99bc 100644--- a/eval/tests/conftest.py+++ b/eval/tests/conftest.py@@ -65,12 +65,12 @@ def _score_of(code: str) -> float:class GeminiChat:- """A chat model that bills like gemini-3.7-flash (1 000 tokens in, 10 out): a priced ledger row."""+ """A chat model that bills like gemini-3.8-flash (1 000 tokens in, 10 out): a priced ledger row."""- provider, model, id = "gemini", "gemini-3.7-flash", "gemini:gemini-3.7-flash"+ provider, model, id = "gemini", "gemini-3.8-flash", "gemini:gemini-3.8-flash"def generate(self, request: ChatRequest) -> ChatResponse:- return ChatResponse(text="ok", usage=Usage(backend="gemini", model="gemini-3.7-flash", input_tokens=1000, output_tokens=10))+ return ChatResponse(text="ok", usage=Usage(backend="gemini", model="gemini-3.8-flash", input_tokens=1000, output_tokens=10))class FakeEvaluator:diff --git a/eval/tests/test_bench.py b/eval/tests/test_bench.pyindex 3e3bcf38..ea2558ac 100644--- a/eval/tests/test_bench.py+++ b/eval/tests/test_bench.py@@ -53,7 +53,7 @@ def test_run_battery_resume_and_report(tmp_path: Path):battery = REPO / "bench" / "prompts" / "static_objects_v1.yaml"out = tmp_path / "bench_out"scores = {"furn_easy_stool": (0.6, 0.85), "furn_med_dining_chair": (0.5, 0.7), "furn_hard_rolltop_desk": (0.4, 0.6)}- opts = BenchOptions(parallel=2, limit=4, judge="gemini:gemini-3.7-flash", generator="agy:gemini-3.6-flash")+ opts = BenchOptions(parallel=2, limit=4, judge="gemini:gemini-3.8-flash", generator="agy:gemini-3.8-flash")res = run_battery(battery, out, opts, run_fn=_fake_run_fn(scores, fail_ids={"veh_easy_toy_car"}))assert len(res) == 4by_id = {r.id: r for r in res}@@ -65,7 +65,7 @@ def test_run_battery_resume_and_report(tmp_path: Path):assert (out / "results.csv").is_file() and len(load_results(out)) == 4assert (out / "runs" / "furn_easy_stool" / "spec.json").is_file()spec = json.loads((out / "runs" / "furn_easy_stool" / "spec.json").read_text())- assert spec["backends"]["judge"] == "gemini:gemini-3.7-flash" and "bench" in spec["tags"]+ assert spec["backends"]["judge"] == "gemini:gemini-3.8-flash" and "bench" in spec["tags"]# resume: already-done prompts are not re-run; the failed one is re-run (it is in results → also skipped)calls = []diff --git a/eval/tests/test_compare_matrix.py b/eval/tests/test_compare_matrix.pyindex 6edc8ea1..b729b665 100644--- a/eval/tests/test_compare_matrix.py+++ b/eval/tests/test_compare_matrix.py@@ -40,13 +40,13 @@ from tests.conftest import ( # noqa: E402fake_run_track,)-ARMS = "harness:agy:gemini-3.6-flash,oneshot:claude-code,oneshot+repair:codex,oneshot:gemini:gemini-3.7-flash"+ARMS = "harness:agy:gemini-3.8-flash,oneshot:claude-code,oneshot+repair:codex,oneshot:gemini:gemini-3.8-flash"def test_parse_arms():arms = parse_arms(ARMS)assert [a.kind for a in arms] == ["harness", "oneshot", "oneshot+repair", "oneshot"]- assert arms[0].target == "agy:gemini-3.6-flash" and arms[2].target == "codex"+ assert arms[0].target == "agy:gemini-3.8-flash" and arms[2].target == "codex"assert arms[2].slug == "oneshot_plus_repair_codex"for bad in ("harness", "foo:bar", "oneshot:gemini-cli:x", "oneshot:nope"):with pytest.raises(ValueError):@@ -57,10 +57,10 @@ def test_parse_arms():def test_spec_for_and_acceptance():b = Battery.load(BATTERY)- opts = CompareOptions(judge="gemini:gemini-3.1-pro-preview", loop_judge="gemini:gemini-3.7-flash")+ opts = CompareOptions(judge="gemini:gemini-3.1-pro-preview", loop_judge="gemini:gemini-3.8-flash")harness = spec_for(b, b.prompts[0], parse_arm("harness:agy:gemini-4-argon"), opts)one = spec_for(b, b.prompts[0], parse_arm("oneshot:codex"), opts)- assert harness.backends.generator == "agy:gemini-4-argon" and harness.backends.judge == "gemini:gemini-3.7-flash"+ assert harness.backends.generator == "agy:gemini-4-argon" and harness.backends.judge == "gemini:gemini-3.8-flash"assert harness.budget.max_rounds == 3assert one.backends.generator == "single-shot:codex" and one.constraints.must_have == b.prompts[0].must_have@@ -82,7 +82,7 @@ def test_matrix_end_to_end_with_fakes(tmp_path: Path):backends = {"claude-code": FakeBackend(["```python\n" + GOOD.format(score=0.6) + "```"]),"codex": FakeBackend([BAD, BAD, GOOD.format(score=0.75)]), # repair arm: 2 retries fix it- "gemini:gemini-3.7-flash": FakeBackend(["I refuse."]), # unparseable → score 0+ "gemini:gemini-3.8-flash": FakeBackend(["I refuse."]), # unparseable → score 0}run_track = fake_run_track(0.9)deps = _deps(ev, backends, run_track)@@ -91,7 +91,7 @@ def test_matrix_end_to_end_with_fakes(tmp_path: Path):rows = run_matrix(BATTERY, out, parse_arms(ARMS), opts, deps)assert len(rows) == 8 and (out / "matrix.json").is_file()by = {(r.prompt_id, r.arm): r for r in rows}- h = by[("cmp_easy_stool", "harness:agy:gemini-3.6-flash")]+ h = by[("cmp_easy_stool", "harness:agy:gemini-3.8-flash")]assert h.status == "scored" and h.score == pytest.approx(0.9) and h.passed and h.build_okassert h.gen_cost_usd == pytest.approx(0.9) and h.harness_status == "max_rounds" and h.harness_loop_score == pytest.approx(0.8)assert h.judge_cost_usd == pytest.approx(0.01) and h.tris == 900 and Path(h.sheet).is_file()@@ -102,7 +102,7 @@ def test_matrix_end_to_end_with_fakes(tmp_path: Path):assert c.gen_cost_usd == pytest.approx(0.02) and c.kind == "oneshot"x = by[("cmp_easy_stool", "oneshot+repair:codex")]assert x.status == "scored" and x.score == pytest.approx(0.75) and x.attempts == 3 and x.gen_cost_usd == pytest.approx(0.06)- g = by[("cmp_easy_stool", "oneshot:gemini:gemini-3.7-flash")]+ g = by[("cmp_easy_stool", "oneshot:gemini:gemini-3.8-flash")]assert g.status == "no_code" and g.score == 0.0 and g.passed is False and not g.build_ok and "unparseable" in g.error# the repair prompts carried the error reportrepairs = [c for c in backends["codex"].calls if "BUILD FAILED" in c]@@ -112,7 +112,7 @@ def test_matrix_end_to_end_with_fakes(tmp_path: Path):# pairwise: 1 harness arm × 3 one-shot arms × 2 prompts = 6 rows; the no-code arm is auto-decidedpairs = list(latest(read_jsonl(out / "pairwise.jsonl", PairRow)).values())assert len(pairs) == 6- auto = [p for p in pairs if p.arm_b == "oneshot:gemini:gemini-3.7-flash"]+ auto = [p for p in pairs if p.arm_b == "oneshot:gemini:gemini-3.8-flash"]assert all(p.winner == "a" and not p.judged for p in auto)judged = [p for p in pairs if p.judged]assert len(judged) == 4 and all(p.winner == "a" and p.cost_usd == pytest.approx(0.03) for p in judged)@@ -123,11 +123,11 @@ def test_matrix_end_to_end_with_fakes(tmp_path: Path):# the arm row is n | dropped | over budget | mean: the two loss columns stay blank when# nothing was lost, but must always be PRESENT so a drop can never hide (docs/EVAL.md §7)assert "| arm | kind | n | dropped | over budget | mean |" in md, md- assert "| harness:agy:gemini-3.6-flash | harness | 2 | | | 0.900 |" in md, md+ assert "| harness:agy:gemini-3.8-flash | harness | 2 | | | 0.900 |" in md, mdassert "| cmp_easy_stool | easy | 0.90✓ | 0.60 | 0.75✓ | 0.00 ✗build |" in md- assert "| harness:agy:gemini-3.6-flash | oneshot:claude-code | 2 | 2 | 0 | 0 | 100% |" in md+ assert "| harness:agy:gemini-3.8-flash | oneshot:claude-code | 2 | 2 | 0 | 0 | 100% |" in mdpage = (out / "report.html").read_text()- assert "report_assets/cmp_easy_stool__harness_agy_gemini-3.6-flash.png" in page+ assert "report_assets/cmp_easy_stool__harness_agy_gemini-3.8-flash.png" in pageassert len(list((out / "report_assets").glob("*.png"))) == 6# ---- resume: nothing re-runs, nothing re-judged, results identical@@ -155,10 +155,10 @@ def test_cell_errors_are_recorded_not_raised(tmp_path: Path):deps = CompareDeps(Exploding(), run_track=failing_track, oneshot_backend=lambda t: FakeBackend([GOOD.format(score=0.5)]),pairwise_judge=FakePairwise)- rows = run_matrix(BATTERY, tmp_path / "o", parse_arms("harness:agy:gemini-3.6-flash,oneshot:codex"),+ rows = run_matrix(BATTERY, tmp_path / "o", parse_arms("harness:agy:gemini-3.8-flash,oneshot:codex"),CompareOptions(limit=1, parallel=1), deps)by = {r.arm: r for r in rows}- assert by["harness:agy:gemini-3.6-flash"].status == "error" and "planner down" in by["harness:agy:gemini-3.6-flash"].error+ assert by["harness:agy:gemini-3.8-flash"].status == "error" and "planner down" in by["harness:agy:gemini-3.8-flash"].errorassert by["oneshot:codex"].status == "error" and "blender missing" in by["oneshot:codex"].errorassert (tmp_path / "o" / "report.md").is_file()@@ -233,11 +233,11 @@ def test_every_cell_and_its_harness_run_open_a_ledger(tmp_path: Path):deps = _deps(ev, {"claude-code": FakeBackend(["```python\n" + GOOD.format(score=0.6) + "```"])}, run_track)out = tmp_path / "cmp"opts = CompareOptions(judge="gemini:fixed", limit=1, parallel=2, pairwise=False)- rows = run_matrix(BATTERY, out, parse_arms("harness:agy:gemini-3.6-flash,oneshot:claude-code"),+ rows = run_matrix(BATTERY, out, parse_arms("harness:agy:gemini-3.8-flash,oneshot:claude-code"),opts, deps)assert len(rows) == 2cells = {r.arm: Path(r.workspace) for r in rows}- harness = cells["harness:agy:gemini-3.6-flash"]+ harness = cells["harness:agy:gemini-3.8-flash"]assert [r.label for r in load_ledger(harness / "run")] == ["baseline"]assert [r.label for r in load_ledger(harness)] == ["judge:static_object:r00:s0"]oneshot = cells["oneshot:claude-code"]@@ -256,7 +256,7 @@ def test_no_resume_starts_the_harness_arm_fresh(tmp_path: Path):return inner(spec, ws, resume)out = tmp_path / "cmp"- arms = parse_arms("harness:agy:gemini-3.6-flash")+ arms = parse_arms("harness:agy:gemini-3.8-flash")deps = _deps(ev, {}, run)opts = CompareOptions(judge="gemini:fixed", limit=1, parallel=1, pairwise=False)cell = Path(run_matrix(BATTERY, out, arms, opts, deps)[0].workspace)diff --git a/eval/tests/test_degraded.py b/eval/tests/test_degraded.pyindex d73a4f2f..19f33d08 100644--- a/eval/tests/test_degraded.py+++ b/eval/tests/test_degraded.py@@ -47,7 +47,7 @@ def test_flag_degraded_rule(tmp_path, status, stop, rounds, cost, aborted, expecbattery = Battery.load(BATTERY)opts = CompareOptions(judge="gemini:x", loop_judge="gemini:x", degraded_min_wall_s=0)deps = CompareDeps(FakeEvaluator(), run_track=_track(status, stop, rounds, cost, aborted))- r = run_cell(battery, battery.prompts[0], parse_arm("harness:agy:gemini-3.6-flash"), tmp_path, opts, deps)+ r = run_cell(battery, battery.prompts[0], parse_arm("harness:agy:gemini-3.8-flash"), tmp_path, opts, deps)assert r.status == "scored" and r.score is not Noneassert (r.harness_stop_reason, r.harness_rounds, r.harness_aborted_rounds) == (stop, rounds, aborted)assert r.degraded is expect, rdiff --git a/eval/tests/test_infra_failures.py b/eval/tests/test_infra_failures.pyindex 4db51263..b018c2c6 100644--- a/eval/tests/test_infra_failures.py+++ b/eval/tests/test_infra_failures.py@@ -136,7 +136,7 @@ def test_both_failure_paths_classify_the_same_way(tmp_path):def verdicts(outage: Exception, out: Path) -> dict[str, tuple[str, float | None]]:class DeadModel: # the real ApiOneShot around a model that raises the outage- provider, model = "gemini", "gemini-3.7-flash"+ provider, model = "gemini", "gemini-3.8-flash"def generate(self, request):raise outage@@ -146,10 +146,10 @@ def test_both_failure_paths_classify_the_same_way(tmp_path):battery = Battery.load(BATTERY)deps = CompareDeps(FakeEvaluator(), run_track=dying_track,- oneshot_backend=lambda t: ApiOneShot("gemini:gemini-3.7-flash", chat_model=DeadModel()))+ oneshot_backend=lambda t: ApiOneShot("gemini:gemini-3.8-flash", chat_model=DeadModel()))opts = CompareOptions(judge="gemini:x", loop_judge="gemini:x")got = {}- for raw in ("harness:agy:gemini-3.6-flash", "oneshot:gemini:gemini-3.7-flash"):+ for raw in ("harness:agy:gemini-3.8-flash", "oneshot:gemini:gemini-3.8-flash"):arm = parse_arm(raw)r = run_cell(battery, battery.prompts[0], arm, out, opts, deps)got[arm.kind] = (r.status, r.score)@@ -241,7 +241,7 @@ def test_a_repair_lost_to_an_outage_drops_the_cell_instead_of_scoring_the_pre_rebattery = Battery.load(BATTERY)opts = CompareOptions(judge="gemini:x", loop_judge="gemini:x", repair_attempts=1)- arm = parse_arm("oneshot+repair:gemini:gemini-3.7-flash")+ arm = parse_arm("oneshot+repair:gemini:gemini-3.8-flash")ev = FakeEvaluator()r = run_cell(battery, battery.prompts[0], arm, tmp_path / "storm", opts,@@ -270,7 +270,7 @@ def test_a_harness_planning_failure_is_a_zero_not_a_dropped_cell(tmp_path):battery = Battery.load(BATTERY)opts = CompareOptions(judge="gemini:x", loop_judge="gemini:x")- r = run_cell(battery, battery.prompts[0], parse_arm("harness:agy:gemini-3.6-flash"), tmp_path, opts,+ r = run_cell(battery, battery.prompts[0], parse_arm("harness:agy:gemini-3.8-flash"), tmp_path, opts,CompareDeps(FakeEvaluator(), run_track=no_plan))assert (r.status, r.score, r.passed, r.build_ok) == ("no_code", 0.0, False, False)assert r.error.startswith("PlanningError:")@@ -297,7 +297,7 @@ def test_a_classifier_crash_still_records_the_cell(tmp_path):raise ClassifierTrap("planner died")battery = Battery.load(BATTERY)- r = cb.run_cell(battery, battery.prompts[0], cb.parse_arm("harness:agy:gemini-3.6-flash"), tmp_path,+ r = cb.run_cell(battery, battery.prompts[0], cb.parse_arm("harness:agy:gemini-3.8-flash"), tmp_path,cb.CompareOptions(judge="gemini:x", loop_judge="gemini:x"), cb.CompareDeps(FakeEvaluator(), run_track=boom))assert r.status == "error" and "planner died" in r.errorassert (Path(r.workspace) / "cell.json").is_file()diff --git a/eval/tests/test_live_compare.py b/eval/tests/test_live_compare.pyindex 0969f1c0..6cb8c22c 100644--- a/eval/tests/test_live_compare.py+++ b/eval/tests/test_live_compare.py@@ -20,10 +20,10 @@ pytestmark = [pytest.mark.live, pytest.mark.blender, pytest.mark.node]@pytest.mark.skipif(not get_settings().gemini_api_keys, reason="no gemini keys")def test_oneshot_gemini_cell_scores(tmp_path: Path):- opts = CompareOptions(judge="gemini:gemini-3.7-flash", n_samples=1, limit=1, parallel=1, pairwise=False)+ opts = CompareOptions(judge="gemini:gemini-3.8-flash", n_samples=1, limit=1, parallel=1, pairwise=False)deps = CompareDeps(FixedEvaluator(opts.judge, n_samples=1))rows = run_matrix(REPO / "bench" / "prompts" / "compare_v1.yaml", tmp_path / "o",- parse_arms("oneshot:gemini:gemini-3.7-flash"), opts, deps)+ parse_arms("oneshot:gemini:gemini-3.8-flash"), opts, deps)assert len(rows) == 1r = rows[0]assert r.status in ("scored", "build_failed"), r.errordiff --git a/eval/tests/test_paired_compare.py b/eval/tests/test_paired_compare.pyindex 449cecab..b907f3b2 100644--- a/eval/tests/test_paired_compare.py+++ b/eval/tests/test_paired_compare.py@@ -15,7 +15,7 @@ from bench._jsonl import latest # noqa: E402from bench.paired_compare import analyse, main, paired, rows_from_bench_run # noqa: E402from bench.stats import t975 # noqa: E402-HA, OA = "harness:agy:gemini-3.6-flash", "oneshot:gemini:x"+HA, OA = "harness:agy:gemini-3.8-flash", "oneshot:gemini:x"def _cell(pid: str, arm: str, score: float | None, *, tier: str = "hard", status: str = "scored",diff --git a/eval/tests/test_session_stats.py b/eval/tests/test_session_stats.pyindex b27e2ea0..4bc842b8 100644--- a/eval/tests/test_session_stats.py+++ b/eval/tests/test_session_stats.py@@ -13,7 +13,7 @@ def _session(run: Path, label: str, *, tools: dict[str, tuple[int, int]], promptd = run / "trajectories" / labeld.mkdir(parents=True, exist_ok=True)(d / "stdout.json").write_text(json.dumps({"stats": {- "models": {"gemini-3.7-flash": {"tokens": {"prompt": prompt, "cached": cached},+ "models": {"gemini-3.8-flash": {"tokens": {"prompt": prompt, "cached": cached},"api": {"totalRequests": requests}}},"tools": {"byName": {f"mcp_3dcode_{name}": {"count": c, "fail": f}for name, (c, f) in tools.items()} | {"read_file": {"count": 9, "fail": 9}}},diff --git a/harness/CLAUDE.md b/harness/CLAUDE.mdindex 1fe0c1f2..a739846d 100644--- a/harness/CLAUDE.md+++ b/harness/CLAUDE.md@@ -8,11 +8,11 @@ backends. **The coding agent is always a VENDOR's** — antigravity (`agy`, Goomodels) / claude-code / codex — and the harness supplies the workspace, the prompt and the3D tools its track can use (over MCP; 16 in the registry, filtered per track — D48review), then reads the result. The harness's OWN api use is planning,-judging, single-shot file generation and the texture pass (Gemini/Anthropic/OpenAI).+judging, and single-shot file generation (Gemini/Anthropic/OpenAI).It does not implement an agent loop: the in-process `api-agent` was deleted2026-08-28 (owner's call — reimplementing what the vendors already ship was never-this project's job). Plus an optional text-to-image texture pass and a-data-flywheel record per run.+this project's job). Plus a data-flywheel record per run. There is no+image-generation step (owner, 2026-11-03: not a feature for now).Read `docs/ARCHITECTURE.md` (design, package map, authoring contracts, what a runreally does, known limits), `docs/INTERFACES.md` (binding cross-package signatures as@@ -73,9 +73,9 @@ push, with `set -o pipefail` so a `| tail` cannot swallow a red exit. The versi`default_tools_approval_mode="approve"`) and `claude` run on local subscriptions: testlightly. No Anthropic/OpenAI API keys here. `setup.sh` keeps all three at their latest release(`--no-clis` skips); no version is pinned or required — `doctor` prints what it found (owner, 2026-11-03; D115).-- DEFAULT generator: `agy:gemini-4-argon` (D103, 2026-10-13; `gemini-cli:gemini-3.7-flash` before); planner and+- DEFAULT generator: `agy:gemini-4-argon` (D103, 2026-10-13); planner andcaptioner default to `gemini:gemini-4-argon` too.- `gemini-3.7-flash` stays the cheap API model (single-shot / economy, flash judge — lenient; needs+ `gemini-3.8-flash` is the cheap API model (single-shot, flash judge — lenient; needsthe defect checklist for range). Judge default `gemini-3.1-pro-preview` (`Settings.default_judge`; tracks usen_samples=1); flash + `--n 3` is the cheap fallback, pro for calibration/eval. The argon loop judges with`gemini:gemini-4-argon` at `judge.thinking=medium` (argon does not think at 'low'; D105) on rubric `scene`.@@ -90,7 +90,6 @@ pip install -e harness # once, from the 3dcodeverse checkout (entry points: 3dcd harness3dcodeverse doctor [--live] [--no-gpu] [--json]3dcodeverse make "a mid-century wooden dining chair" --track static_object --language blender-3dcodeverse make "..." --profile economy|balanced|quality # one dial: models, judge n, rounds, candidates, texture, ceilings (--profile == C3D_PROFILE)3dcodeverse make "..." --track static_object --language threejs --generator agy:gemini-4-argon3dcodeverse make "..." --track articulated_object --language urdf_blender3dcodeverse make "..." --track scene --language scene_threejs --rounds 2 --max-minutes 60@@ -101,14 +100,13 @@ cd harness3dcodeverse make "..." --variant argon # per-model prompt/skill overlay: prompts/variants/<name>/ + skills/variants/<name>/ (D105; C3D_VARIANT, C3D_VARIANTS='{"agy:gemini-4-argon": "argon"}')3dcodeverse make "..." --track scene --language scene_blender --variant argon_raw # RAW mode (D113): no src/lib ships, argon writes every line of bpy ([knobs] scene_lib = false; C3D_SCENE_LIB)3dcodeverse make "neon rain on a window" --track graphics --language glsl_shader-3dcodeverse make "..." --image ref.png --candidates 3 --rounds 2 --dim height=0.45 --must "three legs" --texture --no-run+3dcodeverse make "..." --image ref.png --candidates 3 --rounds 2 --dim height=0.45 --must "three legs" --no-run3dcodeverse make "..." --no-pick # a run = baseline + --rounds refine rounds (fixed); make then picks a round → deliverable/ unless --no-pick-3dcode pick <slug> [--by score|pairwise] [--round N] [--texture] [--judge MODEL] # hand over a round (codeverse3d/addons/select.py)+3dcode pick <slug> [--by score|pairwise] [--round N] [--judge MODEL] # hand over a round (codeverse3d/addons/select.py)3dcode resume <slug> · 3dcode show <slug> [--section status] (`status` = its STATUS section) · 3dcode render <slug> [--mode wire] · 3dcode judge <slug> [--model ... --n 3 --thinking medium]-3dcode texture pass <slug> [--no-judge] · 3dcode texture scene-pack <slug> · 3dcode texture show <slug>3dcode tools list · 3dcode tools measure --workspace runs/<slug> · 3dcode mcp --workspace runs/<slug>3dcode cost <slug> · 3dcode cost --runs-dir ../eval/bench/out/<battery> · 3dcode cost cache <slug>-3dcode cost prices [--stale] · 3dcode cost profiles · 3dcode cost estimate gemini:gemini-3.1-pro-preview --in 12000+3dcode cost prices [--stale] · 3dcode cost estimate gemini:gemini-3.1-pro-preview --in 120003dcode flywheel export runs/ dataset/ [--pack --drop-duplicates --captions-dir d/] · 3dcode flywheel pairs runs/ pairs.jsonl3dcode flywheel caption <slug> [--out dir] # the gallery is `3dcode gallery build --embed`3dcode gallery serve [ROOTS...] [--port 8765] [--reload] · 3dcode gallery build --out gallery.html [--embed]@@ -116,8 +114,8 @@ cd harnesspython -m codeverse3d.addons.calibration runs/<slug>... --model gemini:gemini-3.1-pro-preview --n 3 --out out/(cd ../eval && python -m bench.loop init --name argon_scene --out bench/out/loop_argon --variant argon --languages scene_threejs,scene_blender --judge gemini:gemini-4-argon --judge-thinking medium --parallel 15 && python -m bench.loop generate --iter 0 && python -m bench.loop run --iter 0 && python -m bench.loop diagnose --iter 0) # the argon loop (eval/docs/EVAL.md §10): then compare --iter N --against M · judge-calib --iter N · accept|rollback --iter N · statuspython ../eval/bench/complexity_report.py ../eval/bench/out --recursive # score-vs-complexity + $/complexity point (eval/docs/COMPLEXITY.md)-python ../eval/bench/compare_backends.py --prompts ../eval/bench/prompts/compare_v1.yaml --arms harness:agy:gemini-3.6-flash,oneshot:claude-code --judge gemini:gemini-3.1-pro-preview --out ../eval/bench/out/compare_v1-python -m tests.prompts.manifest [--bless | --dump DIR] # what every model is shown, pinned (RUNBOOK §8): bless only a change a model is MEANT to see+python ../eval/bench/compare_backends.py --prompts ../eval/bench/prompts/compare_v1.yaml --arms harness:agy:gemini-4-argon,oneshot:claude-code --judge gemini:gemini-3.1-pro-preview --out ../eval/bench/out/compare_v1+python -m tests.prompts.manifest [--bless | --dump DIR] # what every model is shown, pinned (RUNBOOK §7): bless only a change a model is MEANT to seepython -m pytest tests -q -m "not live" # the offline suite (real Blender + headless Chrome + CadQuery)python -m pytest tests -q -m "not live and not blender and not node" # pure python (the bench tests: `cd ../eval && python -m pytest`)# (how many: `--collect-only`; a count written here drifts every commit)diff --git a/harness/README.md b/harness/README.mdindex 1532740f..eba594c2 100644--- a/harness/README.md+++ b/harness/README.md@@ -2,7 +2,7 @@A backend harness in which LLMs write **raw, executable 3D code** — Blender `bpy`,CadQuery, Three.js, URDF, GLSL / OpenGL — and the harness plans, builds, measures,-renders, judges, refines, textures and records every run as data-flywheel material.+renders, judges, refines and records every run as data-flywheel material.* **Tracks:** `static_object` · `articulated_object` · `scene` · `graphics`* **Languages:** `blender` · `cadquery` · `threejs` · `urdf_blender` ·@@ -17,9 +17,6 @@ renders, judges, refines, textures and records every run as data-flywheel materimontages with binary defect checklists; code-computed scores, floors and caps fromdeterministic gates; pairwise, reference and likeness judges; best-of-N candidates;a calibration harness (`addons/calibration.py`).-* **Texturing:** optional text-to-image pass — VLM material plan → seamless tiles →- world-metre UVs → `object_textured.glb`, shipped only when a before/after judge- gate agrees; scene texture packs for prompts.* **Flywheel:** git-versioned `src/` per round, `record.json`, sample export withquality tiers + dedupe (+ parquet, tar locators), preference/repair/cross-backendpairs, captions, sqlite index, HTML gallery.@@ -32,8 +29,7 @@ renders, judges, refines, textures and records every run as data-flywheel materi## ArchitectureEvery run is **spec → plan → skeleton → [scene stages] → baseline round (best-of-N-optional) → refine rounds → finalise → record**, with an optional post-hoc texture-pass. The package tree:+optional) → refine rounds → finalise → record**. The package tree:```codeverse3d/@@ -53,9 +49,9 @@ codeverse3d/streaming with stall detection, IPv4-pinned transport, pricing, healthspatial/ the measurement/render toolbox behind every gate and MCP tooljudges/ rubric VLM judge on labelled montages, pairwise, reference/likeness- reference.py reference grounding: synthesis, plausibility gate, proportions, diff- texturing/ material plan → seamless tiles → world-metre UVs → object_textured.glb- cost/ append-only ledger, metering, per-block tallies, profiles, pre-call estimates+ reference.py a user `--image` against the render: proportion check, mismatch diff+ texturing/ the PBR material-family table (languages/blender reads it)+ cost/ append-only ledger, metering, per-block tallies, pre-call estimatesskills/ typed skill routes + materialisation + read telemetryrecord/ what every run writes: record.json, deliverable/, telemetryaddons/ optional tools that READ finished runs — nothing a run needs:@@ -91,7 +87,7 @@ python -m pytest tests -q -m "not live"```Expected cost and time per track: `docs/RUNBOOK.md` §2. Inspect actual run costs with-`3dcode cost <slug>` and configured profiles with `3dcode cost profiles`.+`3dcode cost <slug>` and a call's expected price with `3dcode cost estimate`.Docs: `docs/INSTALL.md` (install / prerequisites / doctor troubleshooting) ·`docs/ARCHITECTURE.md` (design + what a run does) · `docs/INTERFACES.md`diff --git a/harness/codeverse3d/addons/dataset/export.py b/harness/codeverse3d/addons/dataset/export.pyindex a652ebf8..ab9429d2 100644--- a/harness/codeverse3d/addons/dataset/export.py+++ b/harness/codeverse3d/addons/dataset/export.py@@ -126,10 +126,9 @@ def export_one(raise S.SampleError(f"entry file {ENTRY_FILE[record.spec.language]} missing at {code_source}")renders = S.copy_renders(ws, rnd, dest)meshes = S.copy_link_meshes(ws, rnd, dest) if record.spec.language is Language.URDF_BLENDER else []- textured = S.copy_textured(ws, record, rnd, dest)captions = load_captions(ws, record, captions_dir, slug=key)write_json_atomic(dest / "captions.json", _caption_texts(captions))- all_files = sorted(written + renders + meshes + textured + ["captions.json", "meta.json"])+ all_files = sorted(written + renders + meshes + ["captions.json", "meta.json"])meta = S.build_meta(ws, record, key=key, entry=entry, files=all_files, renders=renders, rnd=rnd, code_source=code_source,code=files, captions=captions,diff --git a/harness/codeverse3d/addons/dataset/refine.py b/harness/codeverse3d/addons/dataset/refine.pyindex b085de45..a2fe43bb 100644--- a/harness/codeverse3d/addons/dataset/refine.py+++ b/harness/codeverse3d/addons/dataset/refine.py@@ -39,7 +39,7 @@ from codeverse3d.record.git_history import (from codeverse3d.record.record import effective_judgment, effective_score, iter_runsfrom codeverse3d.workspace import Workspace-#: rounds that answer a judgment. A texture or asset round is driven by its own pass, and+#: rounds that answer a judgment. An asset round is driven by its own pass, and#: a repair round by a build error the judge never saw.REFINE_KINDS: tuple[str, ...] = ("refine", "rewrite", "detail")#: a diff longer than this is truncated, with the untruncated size kept on the rowdiff --git a/harness/codeverse3d/addons/dataset/sample.py b/harness/codeverse3d/addons/dataset/sample.pyindex e1a859d4..22db94f4 100644--- a/harness/codeverse3d/addons/dataset/sample.py+++ b/harness/codeverse3d/addons/dataset/sample.py@@ -38,7 +38,7 @@ from codeverse3d.contracts.common import ()from codeverse3d.contracts.run import RoundRecord, RunRecordfrom codeverse3d.record import git_history-from codeverse3d.record.deliverable import deliverable_path, round_outputs, texture_shipped_for+from codeverse3d.record.deliverable import round_outputsfrom codeverse3d.record.record import effective_judgment, round_summary, stop_reasonfrom codeverse3d.workspace import Workspace@@ -225,32 +225,6 @@ def copy_renders(ws: Workspace, rnd: RoundRecord | None, dest: Path) -> list[strreturn out-def copy_textured(ws: Workspace, record: RunRecord, rnd: RoundRecord | None, dest: Path) -> list[str]:- """When a texture pass shipped from round ``rnd``'s own GLB (``texture_shipped_for``; a pack- made for another round is not this sample's): copy the generated ``textures/*.png`` and- ``object_textured.glb`` into the sample."""- tex = record.extra.get("texturing") or {}- if not texture_shipped_for(ws, record, round_outputs(ws, rnd)):- return []- out: list[str] = []- tex_dir = ws.root / str(tex.get("textures_dir") or "artifacts/textures")- if not tex_dir.is_dir() and (ws.deliverable / "textures").is_dir():- tex_dir = ws.deliverable / "textures" # packaged copy (new layout)- if tex_dir.is_dir():- for p in sorted(tex_dir.glob("*.png")):- (dest / "textures").mkdir(parents=True, exist_ok=True)- shutil.copy2(p, dest / "textures" / p.name)- out.append(f"textures/{p.name}")- glb = ws.rebase(str(tex.get("glb_textured") or ""))- if not glb.is_file():- glb = deliverable_path(ws, "object_textured.glb")- if glb is not None and glb.stat().st_size < MAX_GLB_BYTES:- (dest / "renders").mkdir(parents=True, exist_ok=True)- shutil.copy2(glb, dest / "renders" / "object_textured.glb")- out.append("renders/object_textured.glb")- return out--def copy_link_meshes(ws: Workspace, rnd: RoundRecord | None, dest: Path) -> list[str]:"""(urdf_blender) copy the round's own per-link meshes so the sample's robot.urdf resolves."""out_dir = round_outputs(ws, rnd)diff --git a/harness/codeverse3d/addons/gallery/cards.py b/harness/codeverse3d/addons/gallery/cards.pyindex d64ab194..60c7e416 100644--- a/harness/codeverse3d/addons/gallery/cards.py+++ b/harness/codeverse3d/addons/gallery/cards.py@@ -20,7 +20,7 @@ from codeverse3d.addons.gallery.urls import UrlMaker#: links promoted next to ``detail`` on the card, best-first — the one artifact#: you actually open for that track-PRIMARY_LINKS = ("glb", "textured glb", "preview.gif", "articulation", "src/")+PRIMARY_LINKS = ("glb", "preview.gif", "articulation", "src/")def fmt(value: float | None, digits: int = 3, dash: str = "—") -> str:diff --git a/harness/codeverse3d/addons/gallery/index.py b/harness/codeverse3d/addons/gallery/index.pyindex 82e1a62f..7d7dd11d 100644--- a/harness/codeverse3d/addons/gallery/index.py+++ b/harness/codeverse3d/addons/gallery/index.py@@ -29,7 +29,7 @@ from codeverse3d.addons.gallery.model import (from codeverse3d.contracts.run import RunId, RunRecordfrom codeverse3d.conventions import views_by_preferencefrom codeverse3d.proc import read_json_or_none-from codeverse3d.record.deliverable import round_outputs, texture_shipped_for+from codeverse3d.record.deliverable import round_outputsfrom codeverse3d.record.record import (RecordError,battery_label,@@ -137,11 +137,6 @@ def entry_links(ws: Workspace, rec: RunRecord | None, picked: int | None) -> lisown = [run_rel(ws, out / name)] if out is not None else []return _first_file(run, f"deliverable/{name}", *own, *extra)- # the texture pack is a link only when a pass SHIPPED from this round's GLB — a stray file- # from a rejected pass (or an older harness that leaked one), or another round's pack, is not- tex = (rec.extra.get("texturing") or {}) if rec is not None else {}- shipped = texture_shipped_for(ws, rec, out) if rnd is not None and rec is not None else bool(tex.get("shipped"))-links = [RunLink(label="workspace", rel="", kind="dir"),RunLink(label="record.json", rel="record.json")]for name in ("spec.json", "plan.json"):@@ -155,10 +150,6 @@ def entry_links(ws: Workspace, rec: RunRecord | None, picked: int | None) -> lisglb = artifact("object.glb")if glb:links.append(RunLink(label="glb", rel=glb, kind="viewer"))- if shipped:- textured = _first_file(run, "deliverable/object_textured.glb", "artifacts/object_textured.glb")- if textured:- links.append(RunLink(label="textured glb", rel=textured, kind="viewer"))urdf = artifact("robot.urdf", "src/robot.urdf")if urdf:links.append(RunLink(label="robot.urdf", rel=urdf))@@ -174,10 +165,6 @@ def entry_links(ws: Workspace, rec: RunRecord | None, picked: int | None) -> lisframes_rel = next((f for f in frames if any((run / f).glob("f*_t*.png")) or any((run / f).glob("frame_t*.png"))), "")if frames_rel:links.append(RunLink(label="frames/", rel=frames_rel, kind="dir"))- for tex_rel in ("deliverable/textures", "artifacts/textures" if shipped else "", "public/textures"):- if tex_rel and (run / tex_rel).is_dir():- links.append(RunLink(label="textures/", rel=tex_rel, kind="dir"))- breakif (run / "public" / "assets").is_dir():links.append(RunLink(label="assets/", rel="public/assets", kind="dir"))if (run / "telemetry" / "cost.json").is_file():diff --git a/harness/codeverse3d/addons/select.py b/harness/codeverse3d/addons/select.pyindex 01b2e08b..45e3c471 100644--- a/harness/codeverse3d/addons/select.py+++ b/harness/codeverse3d/addons/select.py@@ -20,9 +20,8 @@ other reader asks (gallery, dataset, cost report, calibration, the CLI, eval/benround that built and has renders;* :func:`round_file` a round's OWN build output (its GLB, GIF), never the last build's —and :func:`round_complexity_block` its complexity vector;-* :func:`package` ``deliverable/`` for one round, the texture pass on it when asked- (:func:`texture_round`, also ``3dcode texture pass``), and- ``selection.json`` (round, method, scores) beside ``record.json``.+* :func:`package` ``deliverable/`` for one round and ``selection.json`` (round, method,+ scores) beside ``record.json``.Nothing here runs during a run: ``3dcode make`` calls :func:`pick` + :func:`package` after thetrack returns (unless ``--no-pick``).@@ -45,7 +44,7 @@ from codeverse3d.cost.context import call_contextfrom codeverse3d.cost.types import Role, Stagefrom codeverse3d.judges.base import judged_subset, resolve_pathsfrom codeverse3d.proc import EventLog, read_json_or_none, sha256_file-from codeverse3d.record.deliverable import build_deliverable, round_outputs, texture_report_for+from codeverse3d.record.deliverable import build_deliverable, round_outputsfrom codeverse3d.record.record import (effective_judgment,load_record,@@ -104,7 +103,6 @@ class Selection(BaseModel):round: intmethod: Methodscores: dict[int, float | None] = Field(default_factory=dict, description="every round's effective score")- textured: bool = Field(default=False, description="the deliverable carries a shipped texture pack of this round")selected_at: datetime = Field(default_factory=lambda: datetime.now(UTC))@@ -262,64 +260,20 @@ def summarise(run_dir: Path | str, *, record: RunRecord | None = None) -> RunSum# --------------------------------------------------------------------------- package-def package(run_dir: Path | str, round_index: int, *, texture: bool = False, method: Method = "round",- image_model: Any | None = None) -> Path:+def package(run_dir: Path | str, round_index: int, *, method: Method = "round") -> Path:"""Write ``deliverable/`` for round ``round_index`` (from its commit and ``artifacts/rNN/``,no rebuild) and ``selection.json``; returns the deliverable directory.- ``texture=True`` runs the texture pass on that round's own GLB first (:func:`texture_round`);- a pack ships into the deliverable only when its judge gate shipped it. The record is- re-packaged (``record.repackage``), so its total takes in what the hand-over paid — the- texture pass, a pairwise verdict — the run's money is its ledger's."""+ The record is re-packaged (``record.repackage``), so its total takes in what the hand-over+ paid — a pairwise verdict; the run's money is its ledger's."""ws = Workspace(run_dir)rec = load_record(ws)if not any(r.index == round_index for r in rec.rounds):raise ValueError(f"no round {round_index} in {ws.root} (rounds: {[r.index for r in rec.rounds]})")- if texture:- texture_glb(ws, rec, round_index) # nothing to texture is the caller's error; a failed pass is not- try:- texture_round(ws, rec, round_index, image_model=image_model)- except Exception as e: # noqa: BLE001 — a derived asset pack: the hand-over goes out without it- log.warning("texture pass failed on round %d: %s", round_index, e)- EventLog(ws.events_path).emit("texture.failed", round=round_index, error=f"{type(e).__name__}: {e}")- rec = repackage(ws) or load_record(ws) # a pass wrote extra["texturing"]+ rec = repackage(ws) or load_record(ws)manifest = build_deliverable(ws, rec, round_index)- sel = Selection(round=round_index, method=method, scores={r.index: r.score for r in round_rows(ws.root, record=rec)},- textured=any(f.path == "deliverable/object_textured.glb" for f in manifest.files))+ sel = Selection(round=round_index, method=method, scores={r.index: r.score for r in round_rows(ws.root, record=rec)})ws.write_json(ws.root / SELECTION_NAME, sel)- EventLog(ws.events_path).emit("pick.packaged", round=round_index, method=method, textured=sel.textured,+ EventLog(ws.events_path).emit("pick.packaged", round=round_index, method=method,files=len(manifest.files))return ws.deliverable---def texture_glb(ws: Workspace, rec: RunRecord, index: int) -> tuple[RoundRecord, Path]:- """Round ``index`` and its own GLB — what a texture pass on it starts from. ValueError when- the track has no GLB or the round kept none."""- from codeverse3d.texturing.run import texture_supported-- if not texture_supported(rec.spec.track):- raise ValueError(f"the texture pass is for object tracks; {rec.spec.track.value} runs have no GLB to texture")- rnd = next((r for r in rec.rounds if r.index == index), None)- glb = round_file(ws, rnd)- if rnd is None or glb is None:- raise ValueError(f"round {index} kept no object.glb to texture (artifacts/r{index:02d}/)")- return rnd, glb---def texture_round(ws: Workspace, rec: RunRecord, index: int, *, image_model: Any | None = None,- model_id: str | None = None, judge: bool = True, judge_model_id: str | None = None,- size: int = 1024, force: bool = False) -> Any | None:- """The texture pass on round ``index``'s own GLB (it records itself on ``record.json``), or None- when a pass already started from those exact bytes — a paid pass is never bought twice unless- ``force``. ValueError from :func:`texture_glb`; the pass's own failures propagate."""- from codeverse3d.texturing.run import texture_pass-- rnd, glb = texture_glb(ws, rec, index)- events = EventLog(ws.events_path)- if not force and texture_report_for(ws, glb) is not None:- events.emit("texture.skipped", reason="already_textured_this_artifact", round=index)- return None- sheet = ws.rebase(rnd.renders.contact_sheet) if rnd.renders is not None and rnd.renders.contact_sheet else None- return texture_pass(ws, rec.spec, rec.plan, model_id=model_id or rec.spec.backends.planner, image_model=image_model,- judge=judge, judge_model_id=judge_model_id or rec.spec.backends.judge, size=size, glb_in=glb,- sheet=sheet, events=events)diff --git a/harness/codeverse3d/agents/materialize.py b/harness/codeverse3d/agents/materialize.pyindex c8313273..697cb0d5 100644--- a/harness/codeverse3d/agents/materialize.py+++ b/harness/codeverse3d/agents/materialize.py@@ -102,9 +102,11 @@ def _body(agent_kind: str, contract_md: str, spatial_tools: bool, mcp_command: l"exception — call them, never rewrite them); do not install packages; do not use the network; do not write ""camera / render / export / file-output code unless the contract explicitly asks for it — ""the harness owns export and rendering.\n"- "3. Do not run `git`; the harness snapshots your work before and after the session.\n"- "4. Keep dimensions explicit and in meters; follow the coordinate frame stated in the contract.\n"- "5. When you are done, reply with a SHORT summary of what you changed and what you verified. "+ "3. After a file's first write, change it only with your edit tool, even for large changes; "+ "never write the whole file again.\n"+ "4. Do not run `git`; the harness snapshots your work before and after the session.\n"+ "5. Keep dimensions explicit and in meters; follow the coordinate frame stated in the contract.\n"+ "6. When you are done, reply with a SHORT summary of what you changed and what you verified. ""Do not ask questions — there is no human in the loop; make a reasonable decision and proceed.\n\n"f"{_tool_section(agent_kind, spatial_tools, mcp_command, ws)}\n"f"## Language contract\n\n{contract_md.strip()}\n"diff --git a/harness/codeverse3d/cli/_common.py b/harness/codeverse3d/cli/_common.pyindex 0d8c45ac..3409f076 100644--- a/harness/codeverse3d/cli/_common.py+++ b/harness/codeverse3d/cli/_common.py@@ -265,80 +265,6 @@ def check_backends(backends: Any) -> None:raise CliError(f"--{role} {value!r}: {e}", code=2) from None-# --------------------------------------------------------------------------- cost profile-def active_profile(settings: Any | None = None) -> Any:- """The :class:`~codeverse3d.cost.profiles.Profile` the current settings name."""- from codeverse3d.cost.profiles import get_profile-- return get_profile((settings or get_settings()).profile)---@dataclass(frozen=True)-class ResolvedDial:- """Every profile-controlled value, after the profile and the user's own- settings/flags have been folded together. This is what a run actually gets."""-- profile: str- generator: str- planner: str- judge: str- captioner: str- judge_samples: int- judge_max_px: int- judge_montages: int- judge_detail_crops: int- agent_max_turns: int- rounds: int- candidates: int- texture: bool- max_minutes: float---def resolve_dial(- settings: Any | None = None,- profile_flag: str | None = None,- *,- rounds: int | None = None,- candidates: int | None = None,- max_minutes: float | None = None,- texture: bool = False,-) -> ResolvedDial:- """The single resolver for the cost dial — used by ``3dcode make`` and by the tests.-- ``--profile X`` (``profile_flag``) *forces* the dial over anything the user- stated in ``config.yaml`` / ``C3D_*``; ``C3D_PROFILE=X`` set the same dial- as a *default* when :func:`codeverse3d.config.get_settings` built the settings.- With nothing else stated the two paths therefore resolve **identically** —- that equality is what ``tests/cost/test_profiles.py`` asserts, and it- is the bug this function exists to prevent: the run shape (candidates, the- texture pass) used to be read off the flag and so applied to only one path.-- An explicit CLI flag (``--rounds`` / ``--candidates`` / ``--max-minutes`` /- ``--texture``) always wins over both.- """- settings = settings or get_settings()- try:- prof = settings.apply_profile(profile_flag, force=True) if profile_flag else active_profile(settings)- except ValueError as e: # e.g. `--profile bogus`: a typed error, not a raw traceback- raise CliError(str(e), code=2) from e- return ResolvedDial(- profile=prof.name,- generator=settings.default_generator,- planner=settings.default_planner,- judge=settings.default_judge,- captioner=settings.default_captioner,- judge_samples=int(settings.judge.samples),- judge_max_px=int(settings.judge.max_px),- judge_montages=int(settings.judge.montages),- judge_detail_crops=int(settings.judge.detail_crops),- agent_max_turns=int(settings.limits.agent_max_turns),- rounds=prof.rounds if rounds is None else int(rounds),- candidates=int(settings.default_candidates if candidates is None else candidates),- texture=bool(texture or prof.texture),- max_minutes=prof.max_minutes if max_minutes is None else float(max_minutes),- )--# --------------------------------------------------------------------------- the variant (D105)@dataclass(frozen=True)class ResolvedVariant:@@ -357,7 +283,7 @@ class ResolvedVariant:def resolve_variant(settings: Any | None, generator: str, flag: str | None = None) -> ResolvedVariant:- """THE resolver for the variant (a sibling of :func:`resolve_dial`): ``--variant NAME`` (``flag``)+ """THE resolver for the variant (): ``--variant NAME`` (``flag``)over ``settings.variant`` (``C3D_VARIANT``) over ``settings.variants[<generator>]`` — the id astyped, then by ``<kind>:<served model>`` — over the base. An unknown name is the typed'bad configuration' refusal (exit 2) BEFORE a run directory exists, never a traceback afterdiff --git a/harness/codeverse3d/cli/cost_cmd.py b/harness/codeverse3d/cli/cost_cmd.pyindex 941ce9f9..81f686d4 100644--- a/harness/codeverse3d/cli/cost_cmd.py+++ b/harness/codeverse3d/cli/cost_cmd.py@@ -6,7 +6,6 @@3dcode cost show runs/ --md report.md # the same, explicit + full markdown3dcode cost runs/ --recheck # re-price with today's table (drift vs what was billed)3dcode cost prices [--stale] [--unverified]- 3dcode cost profiles # the economy / balanced / quality dial3dcode cost estimate gemini:… --in 12000 --out 800Every run is read from its own ledger (``telemetry/cost.jsonl``) — one priced row per@@ -24,7 +23,6 @@ import typerfrom typer.core import TyperGroupfrom codeverse3d.cli._common import console, ok, runs_root, warn-from codeverse3d.config import get_settings#: a price row older than this needs re-checking against the provider's pageSTALE_AFTER_DAYS = 90@@ -139,10 +137,10 @@ def prices(p = row.priceassert p is not Nonerows.append((f"{prov}:{model}", f"{p.input:g}", f"{p.cached:g}", f"{p.output:g}",- f"{p.image_usd:g}" if p.image_usd else "-", row.status, row.checked,+ row.status, row.checked,"-" if age is None else str(age), ",".join(problems) or "-",p.note[:52]))- header = ("model", "in/M", "cached/M", "out/M", "$/img", "status", "checked", "age_d", "flags", "note")+ header = ("model", "in/M", "cached/M", "out/M", "status", "checked", "age_d", "flags", "note")widths = [max(len(str(r[i])) for r in [header, *rows]) for i in range(len(header))] if rows else \[len(h) for h in header]console.print(" ".join(h.ljust(w) for h, w in zip(header, widths, strict=True)), soft_wrap=True)@@ -150,8 +148,8 @@ def prices(console.print(" ".join(str(c).ljust(w) for c, w in zip(r, widths, strict=True)), soft_wrap=True)if flagged:warn(f"{flagged} of {len(rows)} row(s) flagged: re-check them against the provider's pricing page")- elif rows:- ok(f"{len(rows)} price row(s), none older than {days} days or approximate")+ elif rows or stale: # --stale filters to the flagged rows: none left is the good answer+ ok(f"{len(rows)} price row(s) shown, none older than {days} days or approximate")def _price_flags(row: object, age: int | None, days: int) -> list[str]:@@ -209,22 +207,6 @@ def cache(f"cold heads cost ${sum(s.cold_usd for s in sessions):.4f}\n")-# --------------------------------------------------------------------------- profiles-@cost_app.command("profiles")-def profiles() -> None:- """The economy / balanced / quality dial and what each is measured to cost."""- from codeverse3d.cost.profiles import profile_table-- header = ("profile", "generator", "judge", "shape", "$/run", "measured quality")- rows = [tuple(str(c) for c in r) for r in profile_table()]- widths = [max(len(r[i]) for r in [header, *rows]) for i in range(5)]- for r in [header, *rows]:- console.print(" ".join(c.ljust(w) for c, w in zip(r[:5], widths, strict=True)) + " " + r[5],- soft_wrap=True)- console.print(f"\n[dim]active profile: {get_settings().profile} · "- f"`3dcode make ... --profile quality` to switch one run[/dim]")--# --------------------------------------------------------------------------- estimate@cost_app.command("estimate")def estimate(diff --git a/harness/codeverse3d/cli/layout_cmd.py b/harness/codeverse3d/cli/layout_cmd.pyindex a7eb354c..7ccbe9c2 100644--- a/harness/codeverse3d/cli/layout_cmd.py+++ b/harness/codeverse3d/cli/layout_cmd.py@@ -1,7 +1,7 @@"""``3dcode show`` — THE single-run view, in four sections (docs/RUN_LAYOUT.md):* **STATUS** — where the run stands: the run, the rounds, the process holding the run- lock, run_state, best-of-N candidates, a texture pass, the latest events. It needs no+ lock, run_state, best-of-N candidates, the latest events. It needs norecord.json, so it works mid-run; ``3dcode status`` is ``show --section status``;* **DELIVERABLE** — what the run produced and where to find it;* **QUALITY EVIDENCE** — why we believe it is good (score, rubric, gates, acceptance);@@ -84,10 +84,6 @@ def print_status(ws: Workspace, record: RunRecord | None, n_events: int) -> Nonerows[f"{c.get('label', c.get('index'))}{' *' if c.get('index') == cands.get('selected') else ''}"] = (f"score {score if score is None else round(score, 3)} build_ok={c.get('build_ok')}")console.print(kv_table("candidates (best-of-N, * = selected)", rows))- if record is not None and (t := record.extra.get("texturing")):- console.print(kv_table("texturing", {- "shipped": t.get("shipped"), "delta": t.get("delta"), "reason": t.get("reason", ""),- "textures": t.get("n_textures", len(t.get("textures", {}) or {})), "glb": t.get("glb_textured", "") or "-"}))evs = EventLog(ws.events_path).read()if evs:console.print(f"[dim]last {min(n_events, len(evs))} of {len(evs)} events:[/dim]")@@ -132,7 +128,7 @@ def _deliverable_table(d: RunDeliverable) -> Table:def _unpackaged_artifact_rows(ws: Workspace) -> dict[str, Any]:"""A run not yet packaged: show physical artifacts instead of ``deliverable/``."""rows: dict[str, Any] = {}- for name in ("object.glb", "object.stl", "object.step", "robot.urdf", "object_textured.glb", "preview.gif"):+ for name in ("object.glb", "object.stl", "object.step", "robot.urdf", "preview.gif"):p = ws.artifacts / nameif p.is_file():rows[name] = f"{p} ({_human_bytes(p.stat().st_size)})"@@ -252,7 +248,6 @@ def print_cost_and_settings(ws: Workspace, record: RunRecord) -> None:console.print(kv_table("settings", {"budget": " · ".join(f"{k}={v}" for k, v in settings.budget.items()),"candidates": settings.candidates or 1,- "texture pass": settings.texture,"seed": settings.seed,"rubric": f"{settings.rubric} (hash {settings.rubric_hash or '-'})","prompt hashes": " · ".join(f"{k}={v}" for k, v in settings.prompt_hashes.items()) or "-",diff --git a/harness/codeverse3d/cli/main.py b/harness/codeverse3d/cli/main.pyindex 6468e6da..d505f517 100644--- a/harness/codeverse3d/cli/main.py+++ b/harness/codeverse3d/cli/main.py@@ -4,7 +4,7 @@ Thin by design: every command builds typed inputs and calls into the harnesspackages through function-local imports, so ``3dcode --help`` loads none of them.Owns the typer app and every registration, the run-starting commands ``make`` /-``resume`` (spec building, reference grounding, track dispatch, budget raising, and the+``resume`` (spec building, track dispatch, budget raising, and thehand-over after the run), ``pick`` and ``mcp``. ``render`` / ``judge`` live in the sibling``cli/inspect_cmd.py``, the single-run view ``show`` (and its ``status`` alias) in``cli/layout_cmd.py``; all are registered here.@@ -39,7 +39,6 @@ from codeverse3d.cli.cost_cmd import cost_appfrom codeverse3d.cli.doctor import doctor_appfrom codeverse3d.cli.flywheel_cmd import flywheel_appfrom codeverse3d.cli.skills_cmd import skills_app-from codeverse3d.cli.texture_cmd import texture_appfrom codeverse3d.config import get_settingsfrom codeverse3d.contracts.common import TRACK_INFO, TRACK_LANGUAGES, Budget, Language, Trackfrom codeverse3d.contracts.spec import Constraints, ReferenceImage, RunOptions, Spec@@ -188,9 +187,6 @@ app.add_typer(doctor_app, name="doctor", help="Environment checks.")app.add_typer(skills_app, name="skills", help="The skill library: list / show / validate / read-rate report.")-app.add_typer(- texture_app, name="texture", help="Text-to-image texturing: object pass / scene pack."-)app.command("tools",help="List spatial tools or run one: `3dcode tools list` | `3dcode tools <name> --json '{...}' --workspace ws`.",@@ -247,35 +243,6 @@ def make(judge: Annotated[str | None, typer.Option()] = None,captioner: Annotated[str | None, typer.Option()] = None,image: Annotated[list[Path] | None, typer.Option("--image", help="reference image(s)")] = None,- reference: Annotated[- bool,- typer.Option(- "--reference/--no-reference",- help="reference grounding: synthesize a "- "neutral studio product shot of the prompt with the image model, validate it, and use it as "- "the fidelity anchor for planning, the compare_reference tool, the silhouette gate and the "- "judge. Ignored when --image is given (your own references always win); ~$0.15 for 2 views",- ),- ] = False,- reference_views: Annotated[- int | None,- typer.Option(- "--reference-views",- min=1,- max=4,- help="how many reference views to "- "synthesize (1 = 3/4 only, 2 = + straight front elevation; default 2); needs --reference",- ),- ] = None,- profile: Annotated[- str | None,- typer.Option(- "--profile",- help="cost/quality dial: economy | balanced | quality "- "(sets models, judge samples, rounds, candidates, turn cap, "- "montage size and the texture pass together)",- ),- ] = None,variant: Annotated[str,typer.Option(@@ -288,7 +255,7 @@ def make(rounds: Annotated[int | None,typer.Option(- "--rounds", min=0, help="refine rounds after the baseline (default: the profile's)"+ "--rounds", min=0, help="refine rounds after the baseline (default: 4)"),] = None,max_minutes: Annotated[float | None, typer.Option("--max-minutes", min=0)] = None,@@ -311,13 +278,6 @@ def make(must_not: Annotated[list[str] | None, typer.Option("--must-not")] = None,style: Annotated[str, typer.Option("--style")] = "",tag: Annotated[list[str] | None, typer.Option("--tag")] = None,- texture: Annotated[- bool,- typer.Option(- "--texture",- help="texture the picked round after the run (frozen on spec.options)",- ),- ] = False,no_pick: Annotated[bool,typer.Option(@@ -330,9 +290,8 @@ def make(int,typer.Option("--seed",- help="a run label, not a sampling seed: another value re-plans (it keys the plan cache) and "- "re-draws the --reference images; the models, the coding agent, the judge and the builds "- "(always seed 0) do not read it",+ help="a run label, not a sampling seed: another value re-plans (it keys the plan cache); "+ "the models, the coding agent, the judge and the builds (always seed 0) do not read it",),] = 0,force: Annotated[bool, typer.Option("--force", help="overwrite an existing run dir")] = False,@@ -340,9 +299,7 @@ def make(bool,typer.Option("--no-run",- help="only create the workspace + spec.json and stop "- "(with --reference the reference pass still runs first: it makes model calls and writes "- "the grounded spec)",+ help="only create the workspace + spec.json and stop",),] = False,) -> None:@@ -351,9 +308,6 @@ def make(if not prompt.strip(): # a blank prompt was planned, generated and judged as israise C.CliError("the prompt is empty: say what to build", code=2)C.check_minutes(max_minutes)- if reference_views is not None and not reference: # it was dropped without a word- raise C.CliError("--reference-views needs --reference", code=2)- reference_views = reference_views or 2for p in image:if not p.is_file():raise C.CliError(f"reference image not found: {p}")@@ -368,36 +322,10 @@ def make(language = TRACK_LANGUAGES[track][0]run_slug = C.make_slug(prompt, track.value, language.value, slug)settings = get_settings()- texture_arg, candidates_arg = texture, candidates # the dial folds the profile in below; remember what the USER asked- # ONE resolver for the whole dial, so `--profile X` and `C3D_PROFILE=X` land the same- # values (they used to disagree on candidates + texture); an explicit flag beats both.- dial = C.resolve_dial(- settings,- profile,- rounds=rounds,- candidates=candidates,- max_minutes=max_minutes,- texture=texture,- )- rounds, max_minutes = dial.rounds, dial.max_minutes- candidates, texture = dial.candidates, dial.texture- # A run must not record and display a pass it cannot run. `3dcode texture pass` already- # refuses non-object tracks; `3dcode make` accepted --texture (and --profile quality,- # which forces it) on scene/graphics, froze it on the spec, printed "texture True",- # and then emitted a spurious texture.failed at finalise because there is no GLB.- from codeverse3d.texturing.run import texture_supported-- if texture and not texture_supported(track):- if texture_arg: # the user asked for it explicitly: say no, and say where to go- hint = " — use `3dcode texture scene-pack`" if track is Track.SCENE else ""- raise C.CliError(- f"--texture is for object tracks; {track.value} runs have no GLB to texture{hint}"- )- texture = False # profile-implied: quality simply has no texture pass on this track+ if candidates is None:+ candidates = settings.default_candidatesif candidates > 1 and not TRACK_INFO[track].best_of_n: # the same rule for best-of-N- if candidates_arg:- raise _no_best_of_n(track)- candidates = 1+ raise _no_best_of_n(track)backends = settings.backends(generator=generator, planner=planner, judge=judge, captioner=captioner)@@ -420,19 +348,17 @@ def make(must_not=must_not,style=style,),- budget=Budget(max_rounds=rounds, max_minutes=max_minutes),- # options.profile records the dial this run resolved to, whichever way it was- # named (flag, C3D_PROFILE, config.yaml), so `3dcode resume` re-applies it+ budget=Budget(**{k: v for k, v in+ {"max_rounds": rounds, "max_minutes": max_minutes}.items() if v is not None}),backends=backends,- options=RunOptions(candidates=candidates, texture=texture, profile=dial.profile,- variant=chosen.name),+ options=RunOptions(candidates=candidates, variant=chosen.name),seed=seed,tags=tag,)except ValueError as e:raise C.CliError(f"invalid run spec: {e}") from e# THE run mutex, taken BEFORE the workspace is created (or --force wipes one) and- # held through the paid reference call and the run itself: everything below mutates+ # held through the run itself: everything below mutates# this run directory, and two 3dcode on one slug corrupt each other (runlock.py).with C.mutating(C.runs_root(runs_dir) / run_slug, what=f"3dcode make {run_slug}", action="create"):ws = C.create_workspace(C.runs_root(runs_dir) / run_slug, force=force)@@ -447,65 +373,20 @@ def make("track": track.value,"language": language.value,"generator": backends.generator,- "profile": f"{dial.profile} ({C.active_profile(settings).expectation()})",- "judge": f"{backends.judge} n={dial.judge_samples} "- f"({dial.judge_max_px}px/{dial.judge_detail_crops}crop)",- "rounds": rounds,+ "judge": f"{backends.judge} n={settings.judge.samples} "+ f"({settings.judge.max_px}px/{settings.judge.detail_crops}crop)",+ "rounds": spec.budget.max_rounds,"candidates": candidates,- "texture": texture,"variant": chosen.label,},))- if reference:- # --reference runs even under --no-run, because the grounded spec IS the artifact- # it produces (reference/run.py writes it back to spec.json) — but the combination- # is otherwise read as "filesystem only", so say out loud that this part spends- # money and can block on a degraded provider before anything is written.- if no_run:- warn(- f"--reference makes model calls now (1 planner call + {reference_views} image generation(s) "- f"+ {reference_views} vision check(s), ~$0.15 for 2 views) — --no-run stops after that"- )- spec = _ground_in_reference(spec, ws, n_views=reference_views)if no_run:ok(f"spec written: {ws.spec_path} (not run; `3dcode resume {run_slug}` to start)")return_run_track(spec, ws, resume=False, candidates=candidates, pick=not no_pick)-def _ground_in_reference(spec: Spec, ws, *, n_views: int) -> Spec:- """`--reference`: synthesize + validate a reference image and attach it to the spec.-- Never fatal — a run that cannot get a usable reference simply runs without one.- """- from codeverse3d.cost import Role, Stage, call_context- from codeverse3d.cost.instrument import run_ledger- from codeverse3d.proc import EventLog- from codeverse3d.reference import ground_spec-- events = EventLog(ws.events_path)- with (- run_ledger(ws.root, run=ws.root.name),- call_context(stage=Stage.PLAN, role=Role.PLANNER, label="reference"),- ):- grounded, refset, why = ground_spec(spec, ws, n_views=n_views, events=events)- (ok if grounded is not spec else warn)(f"reference grounding: {why}")- for v in refset.views:- detail = (- v.verdict.failure()- if v.verdict and not v.accepted- else (Path(v.path).name if v.path else "-")- )- if v.accepted and v.dimension_conflict:- got = f"{v.aspect:.2f}" if v.aspect else "?"- detail += f" (aspect {got} disagrees with the stated dimensions — shape target only)"- console.print(f" {'KEPT ' if v.accepted else 'REJECTED'} {v.view}: {detail}")- if refset.usage.cost_usd:- console.print(f" reference cost ${refset.usage.cost_usd:.4f} ({refset.source})")- return grounded--def _no_best_of_n(track: Track) -> C.CliError:return C.CliError(f"--candidates is for tracks whose baseline is one session; a {track.value} run ""writes its baseline in its pre-round stages")@@ -543,21 +424,15 @@ def _run_track(spec: Spec, ws, *, resume: bool, candidates: int | None = None, fraise C.CliError(f"run failed: {type(e).__name__}: {e} (workspace {ws.root}; see events.jsonl)") from e- if pick: # the hand-over: the best-scored round → deliverable/ (+ its texture pass)+ if pick: # the hand-over: the best-scored round → deliverable/with run_ledger(ws.root, run=ws.root.name):- _pick_and_package(ws, by="score", texture=_texture_requested(spec))+ _pick_and_package(ws, by="score")print_record_summary(record, ws.root)if record.status.value == "failed":raise typer.Exit(code=1)-def _texture_requested(spec: Spec) -> bool:- from codeverse3d.texturing.run import texture_requested-- return texture_requested(spec)---def _pick_and_package(ws, *, by: str, texture: bool, round_index: int | None = None,+def _pick_and_package(ws, *, by: str, round_index: int | None = None,judge_model: str | None = None) -> int | None:"""``codeverse3d.addons.select``: choose the round (or take ``round_index``) and package it."""from codeverse3d.addons import select@@ -567,13 +442,10 @@ def _pick_and_package(ws, *, by: str, texture: bool, round_index: int | None = Nwarn("no round was judged, so none was picked: name one with `3dcode pick <slug> --round N`")return Nonetry:- select.package(ws.root, idx, texture=texture, method="round" if round_index is not None else by)+ select.package(ws.root, idx, method="round" if round_index is not None else by)except ValueError as e:raise C.CliError(str(e), code=2) from eok(f"picked round {idx} ({'named' if round_index is not None else f'by {by}'}) → {ws.deliverable}")- sel = select.load_selection(ws)- if texture and sel is not None and not sel.textured:- warn("the texture pass did not ship a pack for this round (see `3dcode texture show` / events.jsonl)")return idx@@ -669,13 +541,6 @@ def resume(spec = C.load_spec(ws)if candidates and candidates > 1 and not TRACK_INFO[spec.track].best_of_n:raise _no_best_of_n(spec.track)- if (- spec.options.profile- ): # the dial the run was created with (judge samples, montage px, turn cap)- try:- get_settings().apply_profile(spec.options.profile, force=True)- except ValueError as e: # a spec.json naming a profile this build no longer has- raise C.CliError(f"{ws.spec_path}: {e}", code=2) from eraised = {k: vfor k, v in {"max_minutes": max_minutes, "max_rounds": rounds}.items()@@ -705,7 +570,6 @@ def pick(by: Annotated[str, typer.Option("--by", help="score | pairwise (the pairwise judge decides ""between the top two when they are within judge noise)")] = "score",round_index: Annotated[int | None, typer.Option("--round", min=0, help="hand over this round instead")] = None,- texture: Annotated[bool, typer.Option("--texture", help="texture the picked round first (object tracks)")] = False,judge: Annotated[str | None, typer.Option("--judge", help="pairwise judge model (default: the run's judge)")] = None,runs_dir: RunsDirOpt = None,) -> None:@@ -719,12 +583,12 @@ def pick(if judge and (by != "pairwise" or round_index is not None): # no pairwise verdict is bought: it was droppedraise C.CliError("--judge is the pairwise judge: it goes with --by pairwise (and no --round)", code=2)ws = C.open_workspace(slug, runs_dir)- # writes deliverable/ + selection.json (a texture pass or a pairwise verdict is paid):+ # writes deliverable/ + selection.json (a pairwise verdict is paid):# one writer per run dir, and the money joins the run's ledgerwith (C.mutating(ws, what=f"3dcode pick {ws.root.name}", action="pick"),run_ledger(ws.root, run=ws.root.name, create=False)):try:- idx = _pick_and_package(ws, by=by, texture=texture, round_index=round_index, judge_model=judge)+ idx = _pick_and_package(ws, by=by, round_index=round_index, judge_model=judge)rows = select.round_rows(ws.root)except RecordError as e:raise C.CliError(str(e), code=2) from ediff --git a/harness/codeverse3d/cli/texture_cmd.py b/harness/codeverse3d/cli/texture_cmd.pydeleted file mode 100644index 35fa97b9..00000000--- a/harness/codeverse3d/cli/texture_cmd.py+++ /dev/null@@ -1,133 +0,0 @@-"""``3dcode texture`` — text-to-image texturing commands.-- 3dcode texture pass <slug> [--no-judge] [--model gemini:gemini-4-argon] [--image-model MODEL]- 3dcode texture scene-pack <slug> [--n 8] [--model ...]- 3dcode texture show <slug>-"""--from __future__ import annotations--from pathlib import Path-from typing import Annotated--import typer--from codeverse3d.cli import _common as C-from codeverse3d.cli._common import console, kv_table, warn-from codeverse3d.contracts.common import DEFAULT_IMAGE_MODEL-from codeverse3d.contracts.plan import ScenePlan--texture_app = typer.Typer(name="texture", help="Text-to-image texturing: object pass + scene texture pack.",- no_args_is_help=True)--RunsDirOpt = C.RunsDirOpt---@texture_app.command("pass")-def pass_(- slug: str,- judge: Annotated[bool, typer.Option("--judge/--no-judge", help="before/after VLM ship gate")] = True,- model: Annotated[str | None, typer.Option("--model", help="material-plan chat model id (default: spec planner)")] = None,- judge_model: Annotated[str | None, typer.Option("--judge-model", help="judge chat model id (default: spec judge)")] = None,- image_model: Annotated[str | None, typer.Option("--image-model", help=f"gemini image model (default {DEFAULT_IMAGE_MODEL})")] = None,- size: Annotated[int, typer.Option("--size", min=256, max=2048)] = 1024,- force: Annotated[bool, typer.Option("--force", help="buy a new pass even if one already started from this GLB")] = False,- runs_dir: RunsDirOpt = None,-) -> None:- """Texture the picked round's object.glb (``addons.select.texture_round``) → artifacts/object_textured.glb- (+ textures/); a packaged hand-over of that round is refreshed."""- from codeverse3d import reference- from codeverse3d.addons import select- from codeverse3d.record.record import RecordError, join_post_run, load_record- from codeverse3d.texturing.run import load_report-- ws = C.open_workspace(slug, runs_dir)- try:- rec = load_record(ws)- except RecordError as e:- raise C.CliError(str(e), code=2) from e- picked = select.summarise(ws.root, record=rec).picked_round- if picked is None:- raise C.CliError(f"no picked round to texture in {ws.root.name}: `3dcode pick {ws.root.name} --round N` names one")- # a post-hoc pass joins the run's ledger (and its record's total) when it has one; it- # rewrites the run's artifacts, so it holds the run mutex (one writer per run dir)- with C.mutating(ws, what=f"3dcode texture pass {ws.root.name}", action="texture"), join_post_run(ws):- try:- rep = select.texture_round(ws, rec, picked, image_model=reference.get_image_model(image_model or ""),- model_id=model, judge=judge, judge_model_id=judge_model, size=size, force=force)- except ValueError as e:- raise C.CliError(str(e)) from e- sel = select.load_selection(ws)- if sel is not None and sel.round == picked: # the hand-over carries the pack only if it is refreshed- select.package(ws.root, picked, method=sel.method)- if rep is None:- warn("a pass already started from this round's GLB: its report is below (--force buys a new one)")- rep = load_report(ws)- _print_report(rep, ws)---@texture_app.command("show")-def show(slug: str, runs_dir: RunsDirOpt = None) -> None:- """Print the last texturing report of a run."""- from codeverse3d.texturing.run import load_report-- ws = C.open_workspace(slug, runs_dir)- try:- rep = load_report(ws)- except FileNotFoundError as e:- raise C.CliError(str(e)) from e- _print_report(rep, ws)---def _print_report(rep, ws) -> None:- from codeverse3d.texturing.plan import plan_table-- console.print(plan_table(rep.plan))- rows = {tid: f"{Path(a.path).name} seam={a.seam_score:.3f} (raw {a.seam_score_raw:.3f}) cached={a.cached}"- + (f" ERROR {a.error}" if a.error else "") for tid, a in rep.textures.textures.items()}- console.print(kv_table("textures", rows or {"-": "none"}))- s = rep.summary()- if s.get("glb_out"):- s["glb_out"] = str(ws.rebase(str(s["glb_out"]))) # stored absolute; see print_evidence- if rep.gate is not None and rep.gate.overall_before is not None:- def _f(v: float | None) -> str: # a judge outage leaves per-criterion fields None- return "—" if v is None else f"{v:.3f}"- s.update({"before": _f(rep.gate.overall_before), "after": _f(rep.gate.overall_after),- "materials": f"{_f(rep.gate.materials_before)} → {_f(rep.gate.materials_after)}"})- console.print(kv_table("texture pass", s))- for n in rep.notes:- warn(n)---@texture_app.command("scene-pack")-def scene_pack(- slug: str,- n: Annotated[int, typer.Option("--n", min=1, max=16, help="max textures")] = 10,- model: Annotated[str | None, typer.Option("--model", help="pack-plan chat model id (default: spec planner; '' = heuristic)")] = None,- image_model: Annotated[str | None, typer.Option("--image-model")] = None,- size: Annotated[int, typer.Option("--size", min=256, max=2048)] = 1024,- out: Annotated[Path | None, typer.Option("--out", help="output dir (default <ws>/public/textures)")] = None,- runs_dir: RunsDirOpt = None,-) -> None:- """Generate the scene's tileable texture pack into public/textures/ (+ manifest.json)."""- from codeverse3d import reference- from codeverse3d.record.record import join_post_run- from codeverse3d.spatial.tool_common import load_plan- from codeverse3d.texturing.plan import scene_texture_pack, texture_pack_prompt-- ws = C.open_workspace(slug, runs_dir)- spec = C.load_spec(ws)- plan = load_plan(ws.plan_path)- if not isinstance(plan, ScenePlan):- raise C.CliError("scene-pack needs a scene run (plan.json with zones)")- model_id = spec.backends.planner if model is None else model-- # like `pass`: the pack's plan + image spend joins the run's ledger when it has one- with C.mutating(ws, what=f"3dcode texture scene-pack {ws.root.name}", action="texture"), join_post_run(ws):- pack = scene_texture_pack(plan, out or ws.public / "textures", reference.get_image_model(image_model or ""), model_id, size=size, n_max=n)- rows = {name: f"{e.file or 'FAILED'} tile={e.tile_size_m:.2f}m {e.material_family}/{e.role} seam={e.seam_score:.3f}"- + (f" {e.error}" if e.error else "") for name, e in pack.entries.items()}- console.print(kv_table("scene texture pack", rows))- console.print(kv_table("summary", {"dir": pack.out_dir, "manifest": pack.manifest_path, "source": pack.source,- "cost": f"${pack.usage.cost_usd:.4f}", "n": len(pack.manifest())}))- console.print(texture_pack_prompt(pack.manifest()))diff --git a/harness/codeverse3d/config.py b/harness/codeverse3d/config.pyindex 20bc1218..6ed871d1 100644--- a/harness/codeverse3d/config.py+++ b/harness/codeverse3d/config.py@@ -119,8 +119,8 @@ class Render(BaseModel):default=20.0, ge=0, description="Cycles time cap per judged frame, seconds (0 = none): a heavy scene stops ""sampling early instead of eating the render timeout (C3D_RENDER__BLENDER_FRAME_TIME_LIMIT_S)")blender_samples: int = Field(- default=32, ge=1, description="Cycles samples (adaptive + OIDN) / EEVEE TAA samples; the profile dial sets "- "economy 16 · balanced 32 · quality 64 (C3D_RENDER__BLENDER_SAMPLES)")+ default=32, ge=1, description="Cycles samples (adaptive + OIDN) / EEVEE TAA samples "+ "(C3D_RENDER__BLENDER_SAMPLES)")blender_device: Annotated[Literal["gpu", "cpu"], BeforeValidator(lambda v: str(v).strip().lower())] = Field(default="gpu", description="'gpu' takes a machine-wide GPU slot and falls back to the CPU when none frees ""within blender_gpu_wait_s or the GPU render dies; 'cpu' never touches the GPU")@@ -291,8 +291,6 @@ class Settings(BaseSettings):default_captioner: str = Field(default_factory=lambda: Backends().captioner)default_candidates: int = Field(default=1, description="best-of-N baseline candidates (tracks read it)")- # Cost dial: one name that sets model-per-role, judge samples, rounds, candidates- # and the texture pass together (codeverse3d/cost/profiles.py).model_timeout_s: float = Field(default=1200.0,description="HTTP read timeout for ONE API model call (per attempt). It is a CEILING: the "@@ -301,7 +299,6 @@ class Settings(BaseSettings):"65 536 ceiling — measured 2026-08-27, output streams at 145 tok/s p50 and 60 tok/s p10, so ""a 55 800-token plan needs ~930 s and died at the socket, its tokens billed and discarded. ""Owner's rule 2026-08-27: time may be generous, errors may not.")- profile: str = Field(default="balanced", description="economy | balanced | quality")# Per-model prompt/skill variants (D105, 2026-10-14): an overlay directory# codeverse3d/prompts/variants/<name>/ (prompt files that shadow the base ones) plus@@ -341,10 +338,6 @@ class Settings(BaseSettings):"(D113): no library ships, `lib.*` imports are lint ERRORs and the model writes ""every mesh, material, light, world and motion in raw bpy / bmesh (variant ""argon_raw sets it through its [knobs])")- scene_textures: Flag = Field(default=False, description="scene track: generate a texture pack before "- "env/zones and describe it in both prompts. OFF: an image-model call per "- "run, unmeasured — though 4 of 5 scored cells of scene_baseline "- "(2026-09-05) complained about a flat, untextured ground")axis_repair: Flag = Field(default=True, description="articulated track: rewrite a joint axis the ""measured motion proves wrong, before the sweep renders")settle: Flag = Field(default=True, description="scene driver: the boot-time auto-seat")@@ -379,54 +372,6 @@ class Settings(BaseSettings):base[role] = valuereturn Backends(**base)- def apply_profile(self, name: str | None = None, *, force: bool = False) -> Any:- """Set every profile-controlled default on this Settings object and return- the :class:`~codeverse3d.cost.profiles.Profile`.-- A field the user stated themselves (config file / ``C3D_*`` env) is left- alone unless ``force`` — so a profile is a *default* dial, while- ``3dcode make --profile X`` (which forces) is an instruction. The CLI's own- flags are applied after this and always win."""- from codeverse3d.cost.profiles import get_profile-- p = get_profile(name or self.profile)- stated = set() if force else set(self.model_fields_set)-- def put(field: str, value: Any) -> None:- if field not in stated and value not in (None, ""):- setattr(self, field, value)-- def put_section(section: str, values: dict[str, Any]) -> None:- """Per-FIELD statedness inside a sub-model.-- ``Settings.model_fields_set`` is SECTION-granular — pydantic marks the whole- ``judge`` sub-model as set when any ``C3D_JUDGE__*`` is present — so testing- it here let one stated field suppress the profile's every other dial:- ``C3D_PROFILE=quality C3D_JUDGE__MAX_PX=800`` judged at n=1 instead of n=3,- silently, while `3dcode make` printed "judge sigma 0.017 at n=3". The sub-model- has its own ``model_fields_set``, which is the per-field answer. The values a- profile writes are DEFAULTS, not statements, so the field-set is restored- afterwards and re-applying a profile stays idempotent.- """- sub = getattr(self, section)- keep = set() if force else set(sub.model_fields_set)- update = {k: v for k, v in values.items() if k not in keep}- if not update:- return- new_sub = sub.model_copy(update=update)- new_sub.__pydantic_fields_set__ = keep- setattr(self, section, new_sub)-- self.profile = p.name- put("default_generator", p.generator)- put("default_planner", p.planner)- put("default_judge", p.judge)- put("default_captioner", p.captioner)- put("default_candidates", p.candidates)- put_section("judge", {"samples": p.judge_samples})- put_section("render", {"blender_samples": p.blender_samples})- return p-def resolve_blender(self) -> str:"""The configured binary (a path or a name on PATH), else the first Blender on PATH. Aconfigured one that is not there is "none", never a silent substitute for it."""@@ -524,8 +469,4 @@ def get_settings() -> Settings:# de-dupe keys preserving orderseen: set[str] = set()s.gemini_api_keys = [k for k in s.gemini_api_keys if not (k in seen or seen.add(k))]- # the dial named in config.yaml / C3D_PROFILE, applied as a *default*: a value the- # user stated themselves survives it. `3dcode make --profile X` forces the same dial- # (codeverse3d.cli._common.resolve_dial is the one resolver both paths go through).- s.apply_profile(s.profile)return sdiff --git a/harness/codeverse3d/contracts/common.py b/harness/codeverse3d/contracts/common.pyindex 1b61de74..ec88a771 100644--- a/harness/codeverse3d/contracts/common.py+++ b/harness/codeverse3d/contracts/common.py@@ -46,7 +46,7 @@ class TrackInfo(BaseModel):"""Per-track registry row: default judge rubric + human label.THE single source for what used to be restated as ``TRACK_RUBRIC`` /- ``RUBRIC_BY_TRACK`` / ``TYPE_LABEL`` in judges, texturing, flywheel and cli.+ ``RUBRIC_BY_TRACK`` / ``TYPE_LABEL`` in judges, flywheel and cli."""model_config = ConfigDict(frozen=True)@@ -195,10 +195,6 @@ class Backends(BaseModel):captioner: str = "gemini:gemini-4-argon"-#: The text-to-image model (texture pass, scene texture pack, synthetic references) when none is named.-DEFAULT_IMAGE_MODEL = "gemini-3.1-flash-image"--# ------------------------------------------------------------------ joint coupling#: |multiplier| below this is a coupling that transmits no motion. ONE value: the plan#: validator used 1e-9 while the URDF loader and lint used 1e-12, so a coupling thediff --git a/harness/codeverse3d/contracts/run.py b/harness/codeverse3d/contracts/run.pyindex ecd2e2dd..b17bb920 100644--- a/harness/codeverse3d/contracts/run.py+++ b/harness/codeverse3d/contracts/run.py@@ -188,7 +188,7 @@ class StepTime(BaseModel):Parallel work — fan-out sessions, judge samples, the scene's assets beside its env — isONE step, so no second of the clock is counted twice."""- step: str = Field(description="plan | skeleton | textures | assets+env+layouts | zones | assemble | candidates"+ step: str = Field(description="plan | skeleton | assets+env+layouts | zones | assemble | candidates"" | generate | build | gates | render | judge")round: int | None = Field(default=None, description="the round the step belongs to; None = a run-level stage")wall_s: float = 0.0@@ -201,7 +201,7 @@ class StepTime(BaseModel):class RoundRecord(BaseModel):index: int- kind: str = Field(description="baseline | refine | repair | texture | asset:<name> ...")+ kind: str = Field(description="baseline | refine | repair | asset:<name> ...")commit: str = Field(default="", description="git commit of src/ after this round")agent_backend: str = ""instructions: list[str] = Field(default_factory=list, description="what the agent was asked to change")@@ -254,7 +254,6 @@ class SettingsSnapshot(BaseModel):roles: list[RoleSettings] = Field(default_factory=list)budget: dict[str, Any] = Field(default_factory=dict, description="max_rounds / max_minutes / max_repair_attempts")candidates: int | None = Field(default=None, description="best-of-N baseline width, resolved")- texture: bool = Falseseed: int = 0rubric: str = ""rubric_hash: str = Field(default="", description="content hash of the judge rubric YAML")diff --git a/harness/codeverse3d/contracts/spec.py b/harness/codeverse3d/contracts/spec.pyindex 0d6e43e1..a68cda7e 100644--- a/harness/codeverse3d/contracts/spec.py+++ b/harness/codeverse3d/contracts/spec.py@@ -32,14 +32,10 @@ class RunOptions(BaseModel):"""Run-shape options frozen on the spec (distinct from Budget and Backends).``None`` / ``False`` means "not stated": the resolver falls through to its- ``Settings`` default (``BaseTrack._resolve_candidates``, ``cost.profiles``).+ ``Settings`` default (``BaseTrack._resolve_candidates``)."""candidates: int | None = Field(default=None, ge=1, description="best-of-N baseline candidates")- texture: bool = Field(default=False, description="run the derived texture pass after the loop")- profile: str = Field(default="", description="cost/quality dial this run was created with "- "(codeverse3d/cost/profiles.py); '' = the settings default, and a resume "- "re-applies it so judge samples / montage size / turn cap survive")variant: str = Field(default="", description="per-model prompt/skill variant this run was created with ""(codeverse3d/prompts/variants/<name>/, D105); '' = the base prompts and skills; ""frozen here so a resume and the record name the same overlay")diff --git a/harness/codeverse3d/conventions.py b/harness/codeverse3d/conventions.pyindex 2a1482fa..20f2c50e 100644--- a/harness/codeverse3d/conventions.py+++ b/harness/codeverse3d/conventions.py@@ -154,7 +154,7 @@ OBJECT_CLAY_VIEWS: tuple[ViewPreset, ...] = (_OBJECT_VIEW_BY_NAME: dict[str, ViewPreset] = {v.name: v for v in OBJECT_VIEWS}-#: Quick 4-view subset (cheap gates, agent contact sheets, texture pass, candidates,+#: Quick 4-view subset (cheap gates, agent contact sheets, candidates,#: scene assets) — by NAME so a rig reorder cannot silently change it.OBJECT_VIEWS_QUICK: tuple[ViewPreset, ...] = tuple(_OBJECT_VIEW_BY_NAME[n] for n in ("front_right_high", "back_left_high", "front", "top")@@ -269,7 +269,7 @@ def part_key(node: str, plan_keys: Collection[str]) -> str | None:"""The plan part (a snake key in ``plan_keys``) a GLB node belongs to, or None: thenode's own name, else its link (``Link__2`` → ``link``), else that name's instance base(``Leg_0`` / ``Arm-2`` / ``Handle.001`` → ``leg`` / ``arm`` / ``handle``, one copy or- many). The texture pass and the material normaliser both read it; the contract gate's+ many). The contract gate's``match_parts`` applies the same :func:`split_instance` rule."""own = to_snake(node.split(LINK_PIECE_SEP, 1)[0])return next((k for k in (to_snake(node), own, split_instance(own)[0]) if k in plan_keys), None)diff --git a/harness/codeverse3d/cost/__init__.py b/harness/codeverse3d/cost/__init__.pyindex 77f5f69a..e11f280b 100644--- a/harness/codeverse3d/cost/__init__.py+++ b/harness/codeverse3d/cost/__init__.py@@ -3,11 +3,9 @@ top of ``models/pricing.py``, and a pre-send cost guard. (The audit of FINISHEDits report are ``codeverse3d.addons.costreport``.)This package re-exports only the names other packages actually import through it.-Everything else lives in — and is imported from — its own module: ``cost.profiles``-(get_profile/PROFILES), ``cost.instrument`` (metered_chat_model/MeteredAgent),-``cost.types`` (CallCost/CostBucket/Summary), ``cost.tally`` (the step clock).-Reading the ledgers of finished runs back is ``codeverse3d.addons.costreport``. Keeping the shim narrow also keeps profiles out of the eager import graph of-``import codeverse3d.cost``.+Everything else lives in — and is imported from — its own module: ``cost.instrument``+(metered_chat_model/MeteredAgent), ``cost.types`` (CallCost/CostBucket/Summary), ``cost.tally`` (the step clock).+Reading the ledgers of finished runs back is ``codeverse3d.addons.costreport``.Nothing here imports tracks/ or orchestrator/, so any layer may use it."""diff --git a/harness/codeverse3d/cost/context.py b/harness/codeverse3d/cost/context.pyindex fe12964b..e8acfdb0 100644--- a/harness/codeverse3d/cost/context.py+++ b/harness/codeverse3d/cost/context.py@@ -5,11 +5,11 @@ role" for the call that is about to happen. Precedence:1. what the caller passed explicitly (a judge knows it is judging) — always wins;2. a label that names a **job of its own** (``judge:…``, ``planner``,- ``texture_gate``, ``caption…``, ``pairwise:…`` — :data:`SELF_DESCRIBING`).+ ``caption…``, ``pairwise:…`` — :data:`SELF_DESCRIBING`).Such a call is not the work of whatever agent session happens to surround it,so it outranks the ambient context. This is the fix for a measuredmis-attribution: an in-process tool that bills a model *inside* an agent- session (a texture pass, a captioner, a judge invoked as a tool) was filed+ session (a captioner, a judge invoked as a tool) was filedunder the session's ``stage=refine / role=generator``;3. the ambient context (:func:`call_context`) — set by:mod:`codeverse3d.cost.instrument` around an agent session. It beats a@@ -150,9 +150,6 @@ _LABEL_HINTS: tuple[tuple[str, Stage, Role], ...] = (("plan", Stage.PLAN, Role.PLANNER),("judge", Stage.JUDGE, Role.JUDGE),("pairwise", Stage.PAIRWISE, Role.JUDGE),- ("texture_gate", Stage.TEXTURE, Role.JUDGE),- ("texture", Stage.TEXTURE, Role.OTHER),- ("scene_texture", Stage.TEXTURE, Role.OTHER),("caption", Stage.CAPTION, Role.CAPTIONER),("calibrate", Stage.JUDGE, Role.JUDGE),)@@ -160,7 +157,7 @@ _LABEL_HINTS: tuple[tuple[str, Stage, Role], ...] = (def context_from_label(label: str) -> CallContext:"""Best-effort attribution from a ``ChatRequest.label``: its head names the job- (``judge:…``, ``texture_plan``, a generation stage) and the judge's+ (``judge:…``, a generation stage) and the judge's``…:r<NN>:s<k>`` tag carries the round."""low = (label or "").strip()if not low:@@ -192,11 +189,11 @@ def _round_from_label(label: str) -> int | None:#: Stages a label can name that describe a job of their own. A call whose label-#: says "judge" / "plan" / "texture" / "caption" / "pairwise" is doing that job+#: says "judge" / "plan" / "caption" / "pairwise" is doing that job#: even when an agent session surrounds it, so it outranks the ambient context;#: a generation stage in a label does not (see the module docstring).SELF_DESCRIBING: frozenset[Stage] = frozenset(- {Stage.PLAN, Stage.JUDGE, Stage.PAIRWISE, Stage.TEXTURE, Stage.CAPTION})+ {Stage.PLAN, Stage.JUDGE, Stage.PAIRWISE, Stage.CAPTION})def attribute(explicit: CallContext | None = None, *, label: str = "") -> CallContext:diff --git a/harness/codeverse3d/cost/guard.py b/harness/codeverse3d/cost/guard.pyindex 573befc9..e1c5bc2b 100644--- a/harness/codeverse3d/cost/guard.py+++ b/harness/codeverse3d/cost/guard.py@@ -17,7 +17,7 @@ from dataclasses import dataclassfrom codeverse3d.contracts.common import Usagefrom codeverse3d.cost.types import normalise_ids-from codeverse3d.models.pricing import estimate_cost, per_image_usd, price_provenance+from codeverse3d.models.pricing import estimate_cost, price_provenance#: characters per token — Gemini/OpenAI English prose and code both sit near 4CHARS_PER_TOKEN = 4.0@@ -50,7 +50,6 @@ class CostEstimate:input_tokens: intcached_tokens: intoutput_tokens: int- n_images_out: int = 0usd: float = 0.0price_source: str = "unknown"approximate: bool = True@@ -69,12 +68,11 @@ def estimate_call(cached_tokens: int = 0,prompt: str | Sequence[str] = "",n_images: int = 0,- n_images_out: int = 0,) -> CostEstimate:"""Price a call that has not happened yet.- ``model_id`` is any harness id (``gemini:gemini-3.7-flash``,- ``api-agent:gemini:gemini-3.7-flash``). Give either token counts or the+ ``model_id`` is any harness id (``gemini:gemini-3.8-flash``,+ ``api-agent:gemini:gemini-3.8-flash``). Give either token counts or the``prompt`` text, plus ``n_images`` vision parts (1024 px) either way."""kind, provider, model = normalise_ids("", model_id)if not provider:@@ -82,11 +80,9 @@ def estimate_call(tokens_in = (input_tokens or text_tokens(prompt)) + image_tokens(n_images)cached = max(0, min(cached_tokens, tokens_in))usd = estimate_cost(provider, model, Usage(input_tokens=tokens_in, cached_tokens=cached, output_tokens=output_tokens))- if n_images_out:- usd += n_images_out * per_image_usd(provider, model)row = price_provenance(provider, model)return CostEstimate(model_id=model_id, provider=provider, model=model, input_tokens=tokens_in,- cached_tokens=cached, output_tokens=output_tokens, n_images_out=n_images_out,+ cached_tokens=cached, output_tokens=output_tokens,usd=usd, price_source=row.match if row.price else "unknown",approximate=row.approximate)diff --git a/harness/codeverse3d/cost/instrument.py b/harness/codeverse3d/cost/instrument.pyindex 47aab454..8ee8dfe5 100644--- a/harness/codeverse3d/cost/instrument.py+++ b/harness/codeverse3d/cost/instrument.py@@ -270,7 +270,7 @@ def run_ledger(workspace: str | Path, *, run: str = "", create: bool = True) ->run's ledger for the duration of the block.``create=False`` is for work done *after* a run finished (``3dcode judge``,- a post-hoc texture pass): it appends only when the run already keeps a+ a re-pick): it appends only when the run already keeps aledger, because a ledger holding nothing but the re-judge would be read asthe whole run's cost and hide everything the run really spent. Without onethe rows go to the per-process log instead.diff --git a/harness/codeverse3d/cost/profiles.py b/harness/codeverse3d/cost/profiles.pydeleted file mode 100644index 994c3e40..00000000--- a/harness/codeverse3d/cost/profiles.py+++ /dev/null@@ -1,162 +0,0 @@-"""Cost/quality profiles — one name that sets the whole dial coherently.--``3dcode make --profile economy|balanced|quality`` picks a :class:`Profile`; it-resolves the model per role, the judge sample count, the number of refine-rounds, the best-of-N width, the texture pass and the budget ceilings in one-consistent move. Mixing knobs by hand is how a run ends up-paying for a pro judge on a single-shot artifact, or running four refine rounds-on a graphics shader that passed at round 0.--``--profile X`` and ``C3D_PROFILE=X`` (or ``profile:`` in ``config.yaml``)-resolve to the **same** dial: ``codeverse3d.cli._common.resolve_dial`` is the one-place that reads it, and ``tests/cost/test_profiles.py`` asserts every-field of the resolved dial from both entry points. The only difference is-precedence — the flag forces the dial over a value you stated yourself, the-env var yields to it.--Every number is taken from the measurements in ``docs/COST.md``:--* **economy** — single-shot generation (graphics: 5/6 passed at $0.10/run; a- one-file generator plus compiler feedback needs no tool loop), the flash judge- at ``n=2`` (σ 0.083/√2 ≈ 0.059 — enough to rank two rounds, not enough for a- pass/fail that persists) and **2 refine rounds** (r01 buys a score point for- $4.93, r02 for $6.80, r03 for $33.49). It does **not** shrink the judge- payload and does **not** carry its own turn cap — both were measured and- neither paid (see the note on :class:`Profile`).-* **balanced** — exactly today's defaults (agy generator, pro judge at- n=1, 4 rounds, no best-of-N, no texture): the arm every number in the audit- was measured on.-* **quality** — agy + the pro judge at ``n=3`` (σ 0.030/√3 ≈ 0.017),- best-of-2 baselines and the texture pass behind its before/after gate.--The expected $ per profile comes from the same 61 runs; see-:func:`Profile.expectation` and ``docs/COST.md`` §8–9.-"""--from __future__ import annotations--from dataclasses import dataclass--from codeverse3d.contracts.common import Backends--#: profile names in increasing order of spend-PROFILE_NAMES = ("economy", "balanced", "quality")--DEFAULT_PROFILE = "balanced"---@dataclass(frozen=True)-class Profile:- """One coherent setting of the cost/quality dial.-- NOT dials: the judge payload (``Settings.judge`` max_px / montages / detail_crops) and- the agent turn cap (``Settings.limits.agent_max_turns``) are the same under every- profile, because each cut was measured and none paid. 768 px bills a montage the same- as 1024 (156,834 vs 156,874 input tokens over 16 verdicts) and raised the judge's σ- 0.033 → 0.042; one detail crop instead of two saves 1,198 tokens ($0.0024/verdict on- pro) but two draws of it disagreed by 0.048 = 1.6x the pro judge's σ (INCONCLUSIVE,- docs/COST.md §14); 3 montages drop the 14-view rig's low ring + poles (D47); a 28-turn- cap cost $0.02 MORE and 0.205 of a score point (§17).- """-- name: str- #: model per role ("" = leave the settings default alone)- generator: str = ""- planner: str = ""- judge: str = ""- captioner: str = ""- #: run shape- rounds: int = 4 # refine rounds after the baseline- candidates: int = 1 # best-of-N baselines- judge_samples: int = 1 # VLM judge samples per verdict- texture: bool = False # run the derived texture pass- #: scene_blender judged frames: Cycles samples (adaptive + OIDN), owner D1 2026-09-24- blender_samples: int = 32- #: budget ceilings a run of this shape should not need to exceed- max_minutes: float = 60.0- #: measured expectation (docs/COST.md) — reported by ``3dcode cost profiles``- expected_usd: float = 0.0- expected_score: str = ""- note: str = ""-- def expectation(self) -> str:- return f"~${self.expected_usd:.2f}/run, {self.expected_score}"---#: the backend defaults (``contracts.common.Backends``, the one place they are written): a-#: row names a model literally only where it departs from them.-_D = Backends()--#: the three dials. Generator ids are harness backend ids; judge/planner ids are-#: ``<provider>:<model>``.-PROFILES: dict[str, Profile] = {- "economy": Profile(- name="economy",- generator="single-shot:gemini:gemini-3.7-flash",- planner=_D.planner,- judge="gemini:gemini-3.7-flash",- captioner=_D.captioner,- rounds=2, candidates=1, judge_samples=2, texture=False, blender_samples=16,- max_minutes=30.0,- expected_usd=0.30,- expected_score="graphics 0.81 median (5/6 passed); objects clear the gates less often "- "— a one-shot flash generator scored 0.14 on compare_v1's hard cells",- note="single-shot generator + flash judge n=2 + 2 refine rounds; no best-of-N, no texture, "- "full judge payload",- ),- "balanced": Profile(- name="balanced",- generator=_D.generator,- planner=_D.planner,- judge=_D.judge,- captioner=_D.captioner,- rounds=4, candidates=1, judge_samples=1, texture=False,- max_minutes=60.0,- expected_usd=1.47,- expected_score="0.835 mean on compare_v1, 36/61 runs passed ($2.50 per passing artifact) "- "— MEASURED ON gemini-cli:gemini-3.6-flash, not on this dial's generator",- note="today's defaults. The generator moved to 3.7-flash on 2026-08-28 and to "- "agy:gemini-4-argon on 2026-10-13 (D103), and these two expectations have NOT been "- "re-measured on it: argon lists at $2.00/$10.00 per M tokens against 3.6-flash's "- "$0.75/$3.75, so expect this run to cost more until a battery says otherwise",- ),- "quality": Profile(- name="quality",- generator=_D.generator,- planner=_D.planner,- judge=_D.judge,- captioner=_D.captioner,- rounds=4, candidates=2, judge_samples=3, texture=True, blender_samples=64,- max_minutes=90.0,- expected_usd=3.20,- expected_score="best-of-2 lifted the stool baseline 0.563 → 0.612 and the texture pass "- "0.686 → 0.701; judge σ 0.017 at n=3 "- "— MEASURED ON gemini-cli:gemini-3.6-flash, not on this dial's generator",- note="agy:gemini-4-argon + pro judge n=3 + 4 rounds + best-of-2 + texture pass. The "- "generator moved to agy:gemini-4-argon on 2026-10-13 (D103), and the $3.20 / score "- "expectations above have NOT been re-measured on it (same caveat as balanced: argon "- "lists at ~2.7x 3.6-flash's per-token price), so expect this dial to cost more until "- "a battery says otherwise",- ),-}---def get_profile(name: str | None) -> Profile:- """The named profile (case-insensitive). Unknown names raise ``ValueError``."""- key = (name or DEFAULT_PROFILE).strip().lower()- if key not in PROFILES:- raise ValueError(f"unknown profile {name!r}; known: {', '.join(PROFILE_NAMES)}")- return PROFILES[key]---def profile_table() -> list[tuple[str, str, str, str, str, str]]:- """Rows for ``3dcode cost profiles``: name, generator, judge, shape (+texture), $, note."""- rows = []- for name in PROFILE_NAMES:- p = PROFILES[name]- shape = f"{p.rounds}r × {p.candidates}cand, judge n={p.judge_samples}" + (" +texture" if p.texture else "")- rows.append((p.name, p.generator, p.judge, shape, f"${p.expected_usd:.2f}", p.expected_score))- return rows---__all__ = ["DEFAULT_PROFILE", "PROFILES", "PROFILE_NAMES", "Profile", "get_profile", "profile_table"]diff --git a/harness/codeverse3d/cost/types.py b/harness/codeverse3d/cost/types.pyindex f4d8045e..92eb5073 100644--- a/harness/codeverse3d/cost/types.py+++ b/harness/codeverse3d/cost/types.py@@ -5,7 +5,7 @@ append-only (``ledger.py``) and aggregated into :class:`Summary` buckets(``ledger.summarise``).Nothing here imports the orchestrator or the tracks: the cost package is a-leaf so any caller (track, judge, texturing, bench script) can use it.+leaf so any caller (track, judge, bench script) can use it."""from __future__ import annotations@@ -38,7 +38,7 @@ class Stage(StrEnum):RENDER = "render"JUDGE = "judge"PAIRWISE = "pairwise"- TEXTURE = "texture"+ TEXTURE = "texture" # historical: ledgers of runs that had a texture pass still carry itCAPTION = "caption"OTHER = "other"@@ -48,13 +48,13 @@ STAGE_ORDER: tuple[str, ...] = tuple(s.value for s in Stage)class Role(StrEnum):- """Which job the model was doing (``Backends`` roles + the image model)."""+ """Which job the model was doing (``Backends`` roles)."""PLANNER = "planner"GENERATOR = "generator"JUDGE = "judge"CAPTIONER = "captioner"- IMAGE = "image"+ IMAGE = "image" # historical: rows booked by the removed image modelOTHER = "other"@@ -88,7 +88,6 @@ _LABEL_STAGES: tuple[tuple[str, Stage], ...] = (("zone-layout", Stage.PLAN),("plan", Stage.PLAN),("judge", Stage.JUDGE),- ("texture", Stage.TEXTURE),("caption", Stage.CAPTION),)@@ -128,7 +127,6 @@ def role_for_stage(stage: Stage) -> Role:_BACKEND_PROVIDER: dict[str, str] = {"gemini": "gemini","gemini-cli": "gemini",- "gemini-image": "gemini","codex": "openai","openai": "openai","claude-code": "anthropic",@@ -139,7 +137,7 @@ _BACKEND_PROVIDER: dict[str, str] = {def split_model_id(backend: str, model: str) -> tuple[str, str]:- """``("api-agent", "gemini:gemini-3.7-flash") -> ("gemini", "gemini-3.7-flash")``.+ """``("api-agent", "gemini:gemini-3.8-flash") -> ("gemini", "gemini-3.8-flash")``.Falls back to the backend kind when the id carries no provider prefix(``("codex", "gpt-6.1-sol") -> ("openai", "gpt-6.1-sol")``); an unknown@@ -148,7 +146,7 @@ def split_model_id(backend: str, model: str) -> tuple[str, str]:m = (model or "").strip()if ":" in m:provider, _, rest = m.partition(":")- while ":" in rest: # api-agent:gemini:gemini-3.7-flash+ while ":" in rest: # api-agent:gemini:gemini-3.8-flashprovider, _, rest = rest.partition(":")return provider.strip().lower(), rest.strip()kind = (backend or "").strip().lower()@@ -159,13 +157,13 @@ def split_model_id(backend: str, model: str) -> tuple[str, str]:#: agent session kinds that are not themselves an API providerAGENT_KINDS = frozenset({"api-agent", "gemini-cli", "claude-code", "codex", "agy", "antigravity",- "single-shot", "gemini-image"})+ "single-shot"})def normalise_ids(backend: str, model: str) -> tuple[str, str, str]:"""``("gemini:gemini-3.1-pro-preview", "")`` → ``(backend, provider, model)`` with- one canonical spelling per model, so ``gemini:gemini-3.7-flash`` (judge id) and- ``gemini-3.7-flash`` (per-call usage) bucket together."""+ one canonical spelling per model, so ``gemini:gemini-3.8-flash`` (judge id) and+ ``gemini-3.8-flash`` (per-call usage) bucket together."""provider, bare = split_model_id(backend, model)kind = (backend or "").strip().lower()if ":" in kind:diff --git a/harness/codeverse3d/judges/rubrics.py b/harness/codeverse3d/judges/rubrics.pyindex dcaf9cf1..6e0246a8 100644--- a/harness/codeverse3d/judges/rubrics.py+++ b/harness/codeverse3d/judges/rubrics.py@@ -68,7 +68,6 @@ class Criterion(BaseModel):anchors: dict[str, str] = Field(description="score level → what it looks like; keys 1.0/0.7/0.4/0.1")floor: float | None = Field(default=None, ge=0.0, le=1.0, description="hard floor: below → verdict fails")kind: Literal["visual", "measured"] = "visual"- materials: bool = Field(default=False, description="this criterion judges the surfaces: the texture gate reads it")@field_validator("id")@classmethod@@ -190,8 +189,6 @@ class Rubric(BaseModel):d_ids = [d.id for d in self.defects]if len(d_ids) != len(set(d_ids)):raise ValueError(f"duplicate defect ids in rubric {self.name}")- if sum(c.materials for c in self.criteria) > 1:- raise ValueError(f"rubric {self.name}: more than one criterion is flagged materials")return self# ------------------------------------------------------------------ helpers@@ -199,11 +196,6 @@ class Rubric(BaseModel):def weights(self) -> dict[str, float]:return {c.id: c.weight for c in self.criteria}- @property- def materials_criterion(self) -> str:- """The id of the criterion flagged ``materials``, or "" when the rubric has none."""- return next((c.id for c in self.criteria if c.materials), "")-def criterion(self, cid: str) -> Criterion:for c in self.criteria:if c.id == cid:diff --git a/harness/codeverse3d/judges/rubrics/asset.yaml b/harness/codeverse3d/judges/rubrics/asset.yamlindex 1e71182a..cd348555 100644--- a/harness/codeverse3d/judges/rubrics/asset.yaml+++ b/harness/codeverse3d/judges/rubrics/asset.yaml@@ -92,7 +92,6 @@ criteria:- id: material_truthweight: 0.10- materials: truetitle: Material truthdescription: >Do the surfaces read as the right materials (stone, wood, glass, foliage, metal)diff --git a/harness/codeverse3d/judges/rubrics/reference.yaml b/harness/codeverse3d/judges/rubrics/reference.yamlindex c3779324..83fdd238 100644--- a/harness/codeverse3d/judges/rubrics/reference.yaml+++ b/harness/codeverse3d/judges/rubrics/reference.yaml@@ -58,7 +58,6 @@ criteria:- id: material_colorweight: 0.15- materials: truetitle: Material and colourdescription: >Do the colours and material types match the reference per part (wood vs metal,diff --git a/harness/codeverse3d/judges/rubrics/scene.yaml b/harness/codeverse3d/judges/rubrics/scene.yamlindex cc854f06..e6111f31 100644--- a/harness/codeverse3d/judges/rubrics/scene.yaml+++ b/harness/codeverse3d/judges/rubrics/scene.yaml@@ -181,7 +181,6 @@ criteria:- id: materials_shaders_effectsweight: 0.12- materials: truetitle: Materials, shaders and effectsdescription: >Do surfaces read as materials (water with specular life, glass, foliage,diff --git a/harness/codeverse3d/judges/rubrics/static_object.yaml b/harness/codeverse3d/judges/rubrics/static_object.yamlindex 1cddc763..a9c17458 100644--- a/harness/codeverse3d/judges/rubrics/static_object.yaml+++ b/harness/codeverse3d/judges/rubrics/static_object.yaml@@ -120,7 +120,6 @@ criteria:- id: materialsweight: 0.10- materials: truetitle: Materialsdescription: >Do surfaces read as sensible materials for each part (colour, roughness,diff --git a/harness/codeverse3d/judges/vlm_judge.py b/harness/codeverse3d/judges/vlm_judge.pyindex f80e2dc9..05a46342 100644--- a/harness/codeverse3d/judges/vlm_judge.py+++ b/harness/codeverse3d/judges/vlm_judge.py@@ -375,10 +375,6 @@ def _diff_enabled(flag: bool) -> bool:return flag and get_settings().reference_diff-def _is_synth(note: str) -> bool:- return note.startswith("SYNTHESIZED")--class ReferenceJudge(VlmJudge):"""VlmJudge + reference images + measured silhouette + named mismatches."""@@ -406,18 +402,11 @@ class ReferenceJudge(VlmJudge):# ------------------------------------------------------------------ hookdef context(self, inp: JudgeInput) -> JudgeContext:refs = [r for r in inp.spec.references if Path(r.path).is_file()]- synth = bool(refs) and all(_is_synth(r.note) for r in refs)images: list[tuple[str, str]] = []for i, r in enumerate(refs[:3], 1):- tag = "SYNTHESIZED " if _is_synth(r.note) else ""note = f" — {r.note}" if r.note else ""- images.append((f"{tag}REFERENCE {i}/{min(len(refs), 3)} ({r.role}){note}", r.path))+ images.append((f"REFERENCE {i}/{min(len(refs), 3)} ({r.role}){note}", r.path))blocks: list[str] = []- if synth:- blocks.append(- "NOTE ON THE REFERENCE: it was SYNTHESIZED from the brief by an image model, not photographed. "- "It is a shape/part-inventory target only. Where it disagrees with the brief or the stated "- "dimensions, the BRIEF is correct and the render must follow the brief.")conflict = self.dimension_conflict(inp, refs)note = conflict_note(conflict)if note:@@ -435,7 +424,7 @@ class ReferenceJudge(VlmJudge):blocks.append(f"MEASURED SILHOUETTE (harness): {match.view} render vs reference {Path(match.reference).name}: "f"IoU {match.iou:.3f} → silhouette_match score {score:.2f}{why}. extra: {extra}")- diff = self.reference_diff(inp, refs, match, synthesized=synth) if refs else None+ diff = self.reference_diff(inp, refs, match) if refs else Noneif diff is not None and diff.as_text():blocks.append(diff.as_text())return JudgeContext(measured_scores=measured_scores, extra_text="\n\n".join(blocks), extra_images=images,@@ -467,7 +456,7 @@ class ReferenceJudge(VlmJudge):return iou_to_score(match.iou), ""# ------------------------------------------------------------------ mismatch pass- def reference_diff(self, inp: JudgeInput, refs: list[Any], match: ReferenceMatch | None, *, synthesized: bool) -> Any | None:+ def reference_diff(self, inp: JudgeInput, refs: list[Any], match: ReferenceMatch | None) -> Any | None:"""One extra vision call naming concrete mismatches. ``None`` when disabled;never raises (a failed diff simply contributes no text)."""if not _diff_enabled(self.diff):@@ -478,7 +467,7 @@ class ReferenceJudge(VlmJudge):"view": match.view, "reference": Path(match.reference).name}try:return compare(inp.spec, targets, renders, model=self._pick_diff_model(),- part_names=inp.part_names, measured=measured, synthesized=synthesized)+ part_names=inp.part_names, measured=measured)except Exception as e: # noqa: BLE001 — an advisory pass must never fail a verdictlog.warning("reference diff pass failed: %s", e)return Nonediff --git a/harness/codeverse3d/models/gemini.py b/harness/codeverse3d/models/gemini.pyindex a546af76..6ebdd5a0 100644--- a/harness/codeverse3d/models/gemini.py+++ b/harness/codeverse3d/models/gemini.py@@ -5,28 +5,22 @@* ``GeminiModel`` — the ``ChatModel``: a shared ``KeyPool`` over the configured keys,``rotate_with_retries`` with the hedge, streaming with stall detection, per-attemptledger rows;-* ``GeminiImageModel`` — text(+reference images) → PIL images on the same pool and- retry machine, priced per generated image (``pricing.per_image_usd``), with a- fallback model when the primary is missing."""from __future__ import annotations-import ioimport loggingimport randomimport reimport threadingimport time-from collections.abc import Callable, Iterable, Sequence-from pathlib import Path+from collections.abc import Callable, Iterablefrom typing import Anyimport httpxfrom google import genaifrom google.genai import errors as genai_errorsfrom google.genai import types-from PIL import Imagefrom codeverse3d.config import Rate, get_settingsfrom codeverse3d.contracts.chat import (@@ -35,10 +29,8 @@ from codeverse3d.contracts.chat import (ChatResponse,ImagePart,)-from codeverse3d.contracts.common import DEFAULT_IMAGE_MODEL, Usage+from codeverse3d.contracts.common import Usagefrom codeverse3d.cost.context import AttemptRecord, attempt_sink-from codeverse3d.cost.ledger import record_call-from codeverse3d.cost.types import Role, Stagefrom codeverse3d.models.base import ModelErrorfrom codeverse3d.models.parts import (Stopwatch,@@ -49,7 +41,7 @@ from codeverse3d.models.parts import (retry_budget_s,retryable_status,)-from codeverse3d.models.pricing import estimate_cost, per_image_usd+from codeverse3d.models.pricing import estimate_costfrom codeverse3d.models.retry import KeyPool, KeyPoolExhausted, OnAttempt, _Try, rotate_with_retriesfrom codeverse3d.models.schema_utils import JsonParseError, parse_json_lenient, to_gemini_schema@@ -535,204 +527,3 @@ class GeminiModel:if warnings:raw["warnings"] = list(warnings)return ChatResponse(text=text, parsed=parsed, finish_reason=finish, usage=usage, raw=raw)---# ===================================================================== gemini_image--FALLBACK_IMAGE_MODEL = "gemini-2.5-flash-image"--#: requested pixel size → Gemini ``image_size`` token; a 512 request GENERATES a 1K-#: image (resized locally), so it is billed as one — ``_GENERATED_PX`` is the size-#: ``pricing.per_image_usd`` is asked for-_IMAGE_SIZE_TOKEN: dict[int, str] = {512: "1K", 1024: "1K", 2048: "2K", 4096: "4K"}-_GENERATED_PX: dict[str, int] = {"1K": 1024, "2K": 2048, "4K": 4096}---def _to_part(ref: Image.Image | Path | str) -> types.Part:- if isinstance(ref, Image.Image):- buf = io.BytesIO()- ref.convert("RGB").save(buf, format="PNG")- return types.Part.from_bytes(data=buf.getvalue(), mime_type="image/png")- data, mime = image_bytes(ImagePart(path=str(ref)))- return types.Part.from_bytes(data=data, mime_type=mime)---def _is_model_missing(err: ModelError) -> bool:- s = str(err).lower()- return err.status == 404 or (err.status == 400 and ("not found" in s or "not supported" in s))---def _record(usage: Usage, n_images: int) -> None:- """One ledger row per image batch (the image model is not a ChatModel, so- ``models.registry`` cannot meter it). ``record_call`` never raises."""- record_call(usage, stage=Stage.TEXTURE, role=Role.IMAGE, label="image",- backend="gemini-image", model=usage.model, n_calls=max(1, n_images))---class GeminiImageModel:- """Text (+ reference images) → PIL images on the shared key pool and retry machine.- ``model`` is the primary; ``fallback`` the second try once the primary is missing- or fails retryably. Not a ``ChatModel``: it meters itself (``_record``)."""-- provider = "gemini"-- def __init__(- self,- model: str = DEFAULT_IMAGE_MODEL,- *,- fallback: str | None = FALLBACK_IMAGE_MODEL,- keys: list[str] | None = None,- pool: KeyPool | None = None,- timeout_s: float = 180.0,- max_attempts: int = 4,- hedge: int = 1,- sleep: Callable[[float], None] = time.sleep,- client_factory: Callable[[str], Any] | None = None,- ) -> None:- self.model = model- self.fallback = fallback if fallback and fallback != model else None- #: no 503 hedge by default: an image is billed per image, so a hedge that- #: lands twice pays for two of them (the chat models default to 2)- self.hedge = max(1, int(hedge))- keys = _keys_or_raise(keys, pool)- self.pool = pool or shared_pool(keys)- self.timeout_s = timeout_s- self.max_attempts = max(1, max_attempts)- self._sleep = sleep- self._client_factory = client_factory- self._lock = threading.Lock()- self._primary_dead = False-- @property- def id(self) -> str:- return f"gemini-image:{self.model}"-- # ------------------------------------------------------------------ API- def generate_with_usage(- self,- prompt: str,- *,- size: int = 1024,- n: int = 1,- seed: int | None = None,- reference_images: Sequence[Image.Image | Path | str] = (),- max_wait_s: float | None = None,- ) -> tuple[list[Image.Image], Usage]:- """``max_wait_s`` is the caller's retry budget for ONE image (each of the- ``n`` images gets its own window, and a fallback model too), exactly like- ``ChatRequest.max_wait_s`` clips ``GeminiModel.generate``; ``None`` = the- full ``retry.RETRY_DEADLINE_S`` (1800 s)."""- if not prompt.strip():- raise ModelError("empty image prompt")- if n < 1:- raise ModelError("n must be >= 1")- images: list[Image.Image] = []- usage = Usage(backend="gemini-image", model=self.model)- for i in range(n):- got, u = self._one(prompt, size=size, seed=None if seed is None else seed + i,- refs=reference_images, max_wait_s=max_wait_s)- images.extend(got)- usage = usage + u- if len(images) > n:- images = images[:n]- _record(usage, len(images))- return images, usage-- # ------------------------------------------------------------------ internals- def _models(self) -> list[str]:- with self._lock:- dead = self._primary_dead- order = [self.model] if not dead else []- if self.fallback:- order.append(self.fallback)- return order-- def _one(- self, prompt: str, *, size: int, seed: int | None,- refs: Sequence[Image.Image | Path | str], max_wait_s: float | None = None,- ) -> tuple[list[Image.Image], Usage]:- last: ModelError | None = None- for model in self._models():- try:- return self._attempts(model, prompt, size=size, seed=seed, refs=refs,- max_wait_s=max_wait_s)- except ModelError as err:- last = err- if model == self.model and self.fallback and (err.retryable or _is_model_missing(err)):- if _is_model_missing(err):- with self._lock:- self._primary_dead = True- log.warning("image model %s failed (%s); falling back to %s", model, err, self.fallback)- continue- raise- assert last is not None- raise last-- def _attempts(- self, model: str, prompt: str, *, size: int, seed: int | None,- refs: Sequence[Image.Image | Path | str], max_wait_s: float | None = None,- ) -> tuple[list[Image.Image], Usage]:- parts: list[types.Part] = [_to_part(r) for r in refs]- parts.append(types.Part.from_text(text=prompt))- contents = [types.Content(role="user", parts=parts)]- token = _IMAGE_SIZE_TOKEN.get(int(size), "1K")- config = types.GenerateContentConfig(- response_modalities=["IMAGE"],- image_config=types.ImageConfig(aspect_ratio="1:1", image_size=token),- seed=seed,- http_options=types.HttpOptions(timeout=int(self.timeout_s * 1000)),- )- # the caller's budget clips the retry deadline, never extends it (the same- # contract as GeminiModel.generate with ChatRequest.max_wait_s), and each- # attempt's HTTP read timeout is the REMAINING budget, floored like- # GeminiModel._attempt_config — a 60 s image budget no longer holds a- # 180 s socket past its deadline.- budget = retry_budget_s(max_wait_s)- deadline = time.monotonic() + budget-- def _attempt_config() -> types.GenerateContentConfig:- return clip_timeout(config, int(attempt_timeout_s(deadline, self.timeout_s) * 1000))-- return rotate_with_retries(- self.pool,- lambda key: self._call(key, model, contents, _attempt_config(), size, _GENERATED_PX[token]),- classify=classify_exception,- max_attempts=self.max_attempts,- max_total_s=budget,- hedge=self.hedge,- sleep=self._sleep,- retry_after=_retry_after_s,- label=f"image {model}",- )-- def _call(- self, key: str, model: str, contents: list[types.Content], config: types.GenerateContentConfig,- size: int, generated_px: int,- ) -> tuple[list[Image.Image], Usage]:- client = _client_for(key, self.timeout_s, self._client_factory)- with Stopwatch() as sw:- resp = client.models.generate_content(model=model, contents=contents, config=config)- usage = parse_usage(resp, model) # parsed first: the raises below were billed too- usage.backend = "gemini-image"- usage.latency_ms = sw.ms- cand = _guard_candidates(resp, usage, "image model")- finish = str(cand.finish_reason.name if cand.finish_reason is not None else "")- images: list[Image.Image] = []- for part in (cand.content.parts if cand.content and cand.content.parts else []):- blob = getattr(part, "inline_data", None)- if blob is not None and blob.data:- img = Image.open(io.BytesIO(blob.data))- img.load()- images.append(img.convert("RGB"))- if not images:- if finish in FATAL_FINISH:- raise ModelError(f"image generation refused (finish_reason={finish})",- retryable=False, usage=usage)- raise ModelError(f"image model returned no image (finish_reason={finish or 'unknown'})",- retryable=True, usage=usage)- # token-priced cost floored by the per-image price of the size that was GENERATED- usage.cost_usd = max(estimate_cost("gemini", model, usage),- per_image_usd("gemini", model, size=generated_px) * len(images))- if int(size) not in (0, 1024) and images[0].size != (size, size):- images = [im.resize((int(size), int(size)), Image.LANCZOS) for im in images]- return images, usagediff --git a/harness/codeverse3d/models/pricing.py b/harness/codeverse3d/models/pricing.pyindex a3186cda..fc2a4630 100644--- a/harness/codeverse3d/models/pricing.py+++ b/harness/codeverse3d/models/pricing.py@@ -52,8 +52,7 @@ class LongContext:class Price:"""USD per 1M tokens, and where the number came from. ``cached`` = cache-read input;``cache_write`` = cache creation (Anthropic explicit caching, 5-minute TTL);- ``thoughts`` are billed at the output rate. ``image_usd`` = per generated 1024² image- for image-output models (their image tokens are billed per image, not per token).+ ``thoughts`` are billed at the output rate.Provenance: ``source`` is a :data:`SOURCES` key ("" = the provider's own pricing page),``checked`` the day it was last read there, and ``status``:@@ -68,7 +67,6 @@ class Price:cached: float = 0.0cache_write: float | None = Noneapproximate: bool = False- image_usd: float = 0.0long_context: LongContext | None = Nonesource: str = ""checked: str = CHECKED@@ -83,22 +81,13 @@ PRICES: dict[tuple[str, str], Price] = {# ($4.00 / $20.00 / $0.20). Update then. No >200k tier; output includes thinking.("gemini", "gemini-4-argon"): Price(2.00, 10.00, 0.10, checked="2026-10-13",note="intro rate through 2026-11-30, then 4.00/20.00/0.20"),- # 3.6 / 3.7 / 3.8 flash: introductory rates valid through 2026-12-31; they double+ # 3.8 flash: introductory rates valid through 2026-12-31; they double# on 2027-01-01 ($1.50 / $7.50 / $0.15). Update then. No >200k surcharge.("gemini", "gemini-3.8-flash"): Price(0.75, 3.75, 0.075, checked="2026-09-21",note="intro rate through 2026-12-31, then 1.50/7.50/0.15"),- ("gemini", "gemini-3.7-flash"): Price(0.75, 3.75, 0.075,- note="intro rate through 2026-12-31, then 1.50/7.50/0.15"),- ("gemini", "gemini-3.6-flash"): Price(0.75, 3.75, 0.075, note="intro rate through 2026-12-31"),- ("gemini", "gemini-3.5-flash"): Price(1.50, 9.00, 0.15),("gemini", "gemini-3.1-pro-preview"): Price(2.00, 12.00, 0.20,long_context=LongContext(200_000, 4.00, 18.00, 0.40),note=">200k prompts: 4.00/18.00/0.40 (modelled)"),- ("gemini", "gemini-3.1-flash-lite"): Price(0.25, 1.50, 0.025, note="audio input is 2x; text/image/video modelled"),- # image-output model: text/thinking output $3/M, IMAGE output $60/M ≈ $0.067- # per 1K image (1290 tokens); 0.5K $0.045, 2K $0.134, 4K $0.151. No cache row.- ("gemini", "gemini-3.1-flash-image"): Price(0.50, 3.00, 0.05, image_usd=0.067,- note="image output $60/M ≈ $0.067 per 1K image; 0.5K $0.045, 4K $0.151"),("gemini", "gemini-3-pro-preview"): Price(2.00, 12.00, 0.20,long_context=LongContext(200_000, 4.00, 18.00, 0.40),note=">200k prompts: 4.00/18.00 (modelled)"),@@ -108,9 +97,6 @@ PRICES: dict[tuple[str, str], Price] = {note=">200k prompts: 2.50/15.00/0.25 (modelled)"),("gemini", "gemini-2.5-flash"): Price(0.30, 2.50, 0.03, note="cached was 0.075 here until 2026-08-23; published 0.03"),("gemini", "gemini-2.5-flash-lite"): Price(0.10, 0.40, 0.01, note="cached was 0.025 here until 2026-08-23; published 0.01"),- # image tokens are billed per image: 1024² = 1290 tokens = $0.039 ⇒ $30.23/M- ("gemini", "gemini-2.5-flash-image"): Price(0.30, 30.00, 0.03, image_usd=0.039, status="inferred",- note="output/M derived from $0.039 per 1290-token 1024² image"),# ------------------------------------------------------------- anthropic# Only the current generation is kept (owner, 2026-10-13): a model no longer# here prices at $0 with a warning; a recorded run keeps the cost it was booked at.@@ -139,13 +125,6 @@ PRICES: dict[tuple[str, str], Price] = {}# fmt: on-#: per-image USD by requested pixel size, for models whose image output is billed-#: per image rather than per token (``Price.image_usd`` is the 1024² entry).-IMAGE_USD_BY_SIZE: dict[tuple[str, str], dict[int, float]] = {- ("gemini", "gemini-3.1-flash-image"): {512: 0.045, 1024: 0.067, 2048: 0.134, 4096: 0.151},- ("gemini", "gemini-2.5-flash-image"): {512: 0.039, 1024: 0.039, 2048: 0.039, 4096: 0.039},-}-_warned: set[tuple[str, str]] = set()_warned_lock = threading.Lock()@@ -154,7 +133,7 @@ def _normalise(model: str) -> str:return model.strip().lower()-#: the reasoning efforts agy spells into its model ids (``gemini-3.7-flash-medium``): the same+#: the reasoning efforts agy spells into its model ids (``gemini-3.8-flash-medium``): the same#: model at the same per-token rate — unmatched, every agy session was priced $0 (live, 2026-09-23)EFFORTS = ("low", "medium", "high")# words that may follow a priced model id without changing which model it is@@ -188,7 +167,7 @@ def _match(provider: str, model: str) -> tuple[tuple[str, str], Price] | None:def lookup_price(provider: str, model: str) -> Price | None:"""Exact match first, then the longest table key that ``model`` extends by a- pure version/date suffix (``claude-opus-5-20260301``, ``gemini-3.7-flash-preview-09``).+ pure version/date suffix (``claude-opus-5-20260301``, ``gemini-3.8-flash-preview-09``).A different family name after the key (``gpt-6.1-sol-mini`` vs ``gpt-6.1-sol``) is NOT amatch: unknown → ``None`` so the caller prices 0.0 and warns, never a sibling's rate."""found = _match(provider, model)@@ -245,19 +224,6 @@ def unit_prices(provider: str, model: str, *, prompt_tokens: int = 0) -> tuple[freturn (price.input, price.cached, price.output)-def per_image_usd(provider: str, model: str, *, size: int = 1024) -> float:- """Per-generated-image price for image-output models (0.0 when the model- bills images as ordinary output tokens)."""- found = _match((provider or "").strip().lower(), model)- if not found:- return 0.0- key, price = found- by_size = IMAGE_USD_BY_SIZE.get(key)- if by_size:- return by_size.get(size, price.image_usd)- return price.image_usd--def estimate_cost(provider: str, model: str, usage: Usage) -> float:"""USD for one call. ``usage.input_tokens`` is the TOTAL prompt size (cachedtokens included); cached tokens are re-priced at the cache-read rate.diff --git a/harness/codeverse3d/models/retry.py b/harness/codeverse3d/models/retry.pyindex 17deda8d..eac7c74e 100644--- a/harness/codeverse3d/models/retry.py+++ b/harness/codeverse3d/models/retry.py@@ -591,7 +591,7 @@ def rotate_with_retries[T]() -> T:"""Run ``call(key)`` against a rotating :class:`KeyPool` until it succeeds.- The state machine (shared by ``GeminiModel`` / ``GeminiImageModel``):+ The state machine (used by ``GeminiModel``):* success → ``pool.report(key, "ok")``; keys that looked dead during this call arebenched (another key proved the request itself is fine) and the result is returned.@@ -632,8 +632,7 @@ def rotate_with_retries[T](storm streaks averaged **4.7 attempts** — racing two keys cuts the expected numberof rounds to ~1.7. A 503 bills nothing, so while it is storming the hedge is free;the price is paid only when BOTH keys answer: the second success is discarded and- that call's tokens are wasted (a few cents for a chat turn — which is why- ``GeminiImageModel`` passes ``hedge=1``: an image is billed per image).+ that call's tokens are wasted (a few cents for a chat turn).Mechanics: the attempt's first key is acquired as usual (it may wait for a slot ora cooldown); the extra keys come from :meth:`KeyPool.try_acquire` and are simplyskipped when no fresh key or ``max_in_flight`` slot is free *right now*, so a hedgediff --git a/harness/codeverse3d/models/schema_utils.py b/harness/codeverse3d/models/schema_utils.pyindex f893bdb6..acec1e2f 100644--- a/harness/codeverse3d/models/schema_utils.py+++ b/harness/codeverse3d/models/schema_utils.py@@ -362,8 +362,7 @@ def ask_structured(model: Any, schema: type[BaseModel], *, system: str, text: stlabel: str) -> tuple[Any, Usage, str]:"""One structured call → ``(validated object | None, usage, error)``.- Six callers (reference gate / image-prompt plan / mismatch diff, the texture- material plan, the scene texture pack and the planner's brief) built the same ChatRequest+ Several callers (the reference mismatch diff, the planner's brief, ...) built the same ChatRequest(thinking="low", the 65 536 ceiling, the 900 s wait), caught the same two failurefamilies and parsed the same two ways. They differ only in what they RETURN onfailure, which is why this hands the error back rather than raising or deciding.diff --git a/harness/codeverse3d/prompts/texturing/material_plan.md b/harness/codeverse3d/prompts/texturing/material_plan.mddeleted file mode 100644index 62d1a88c..00000000--- a/harness/codeverse3d/prompts/texturing/material_plan.md+++ /dev/null@@ -1,49 +0,0 @@-You are the MATERIAL PLANNER of a 3D pipeline. You see labelled renders of a finished-3D model (flat colours, no textures yet) plus its part list. Your job: decide, per part,-which SEAMLESS TILEABLE ALBEDO TEXTURE (a flat photo-like pattern, generated by a-text-to-image model) should be mapped onto it, and with which PBR factors.--Return ONLY JSON matching the schema. One entry per plan part (use the exact part-names from the table; instances such as Leg_0/Leg_1 are ONE plan part "Leg").--## Rules-* `material_family`: one of wood | metal | fabric | stone | plastic | leather | glass |- ceramic | painted | rubber | other.-* Parts made of the SAME material share the SAME `texture_id` (short snake_case, e.g.- `walnut_wood`, `brushed_steel`, `grey_linen`). Fewer distinct textures is better:- aim for 1-4 per object.-* `subject`: 6-20 words describing ONLY the surface pattern for the image model, e.g.- "oiled walnut wood grain, straight figure, warm brown" or "brushed stainless steel,- fine horizontal grain" or "grey-blue woven linen upholstery, visible weave".- Do NOT mention the object, its shape, lighting, or 3D — the harness appends the- "seamless, tileable, top-down, flat lighting, no shadows, no text, photoreal" suffix.- Describe colour explicitly (the texture is the final colour; there is no tint unless- you set `tint_rgb`). Patterns must be statistically uniform (no centred motif, no- single knot or logo, no radial composition) so they repeat invisibly.-* `projection`: how the flat texture wraps the part — `box` (slabs, frames, boxes;- default), `cylinder` (legs, rods, poles, bottles — around the long axis), `planar_y`- (flat horizontal tops/ground seen from above), `planar_z` (flat vertical panels- seen from the front), or `auto` (let the harness decide from the shape).-* `tile_size_m`: the real-world size (m) one texture tile covers — wood planks 0.3-0.6,- fine wood grain 0.2-0.35, fabric/leather 0.15-0.3, brushed metal 0.2-0.4, stone- 0.4-0.8, painted/plastic 0.3-0.5. Small objects (< 0.3 m) use 0.05-0.15.-* `roughness` 0-1 (matte fabric 0.9, oiled wood 0.5, satin metal 0.35, plastic 0.4),- `metallic` 0 or 1 (1 ONLY for real metals).-* `skip: true` for parts that should keep their current flat material: glass, mirrors,- chrome / polished metal (a flat photo cannot fake a reflection), emissive parts,- tiny parts (< 3 cm), and anything the brief says must stay a solid colour. Give a- one-line `reason`.-* Be faithful to the brief and the part materials in the table: a "walnut" chair gets- walnut, not oak; an "upholstered" seat gets fabric, the frame stays wood.--## Brief-{{ spec_prompt }}-{% if style_notes %}-## Plan style notes-{{ style_notes }}-{% endif %}-## Parts ({{ n_parts }}) — name · role · material (from the plan) · extents w×d×h (m) · instances-{{ parts_table }}--The attached image(s) are the current renders (labelled views). Use them to see each-part's shape (for `projection`) and current colour. Output the JSON now.diff --git a/harness/codeverse3d/prompts/texturing/scene_pack.md b/harness/codeverse3d/prompts/texturing/scene_pack.mddeleted file mode 100644index b023f53f..00000000--- a/harness/codeverse3d/prompts/texturing/scene_pack.md+++ /dev/null@@ -1,34 +0,0 @@-You are the MATERIAL PLANNER of a 3D SCENE pipeline. Before any scene code is-written you choose the small set of SEAMLESS TILEABLE ALBEDO TEXTURES (flat photo-like-patterns generated by a text-to-image model) that the scene code will be able to load-and repeat over ground, walls, roofs, paths, water beds, fabric, rock, wood, etc.--Return ONLY JSON matching the schema: {{ n_min }}-{{ n_max }} textures. Each has:-* `name`: short snake_case identifier used as the file name (e.g. `moss_ground`,- `granite_gravel`, `cedar_planks`, `slate_roof`, `red_lacquer`, `bamboo_poles`).-* `material_family`: wood | metal | fabric | stone | plastic | leather | glass |- ceramic | painted | rubber | other (use `other` for soil, grass, moss, sand, water- bed, foliage).-* `subject`: 6-20 words describing ONLY the surface pattern and colour, scale-free and- statistically uniform: no objects, no horizon, no single large feature, NO centred or- radial/concentric composition (raked gravel = straight parallel ridges, not rings). The harness appends the- "seamless tileable, top-down, flat lighting, no shadows, no text, photoreal" suffix.-* `tile_size_m`: real-world size one tile covers when repeated — ground covers- 1.0-3.0 m, gravel/sand 0.5-1.0 m, stone walls 0.8-1.5 m, planks 0.5-1.0 m, roof- tiles 0.6-1.2 m, fabric 0.2-0.4 m, bark 0.3-0.6 m.-* `role`: what in the scene uses it (ground | path | wall | roof | water_bed | prop |- foliage | fabric | trim), one word.-* `roughness` 0-1 and `metallic` 0/1.--Cover every large visible surface the plan implies (ground types per zone first, then-built structures, then prop materials). Prefer textures several zones can share.--## Scene plan-Title: {{ title }}-Setting: {{ setting }}-Mood: {{ mood }}-Environment: {{ environment }}-Zones:-{{ zones }}-Assets:-{{ assets }}diff --git a/harness/codeverse3d/prompts/tracks/generate_articulated.j2 b/harness/codeverse3d/prompts/tracks/generate_articulated.j2index cdd0dbd7..5aebffd2 100644--- a/harness/codeverse3d/prompts/tracks/generate_articulated.j2+++ b/harness/codeverse3d/prompts/tracks/generate_articulated.j2@@ -45,13 +45,6 @@ detail: a session can be stopped at its window, and what it leaves must still beMeasured: a link still the skeleton's box (≤ 12 triangles, a closed solid filling itsbox, within 1 mm of the plan box) is a `placeholder_part` ERROR in `check_contract`; a link that doesnot meet its parent is an ERROR (the gaps are stated under DON'T below).-{% if not single_shot %}--Both files already exist (the skeleton). Replace a placeholder in one write, then change a file only-with targeted edits — never rewrite a whole file to change a few lines. Measured on this harness:-a dining chair whose files were rewritten whole (8 rewrites over 9 files) wrote ~136k characters,-drafted with each file written once ~49k, and a session's time follows the tokens it generates.-{% endif %}## DO- Build every link at its WORLD rest pose to the plan's bbox (`check_contract`: max(10 mm, 10 %) perdiff --git a/harness/codeverse3d/prompts/tracks/generate_graphics.j2 b/harness/codeverse3d/prompts/tracks/generate_graphics.j2index bbcba74d..5619dccd 100644--- a/harness/codeverse3d/prompts/tracks/generate_graphics.j2+++ b/harness/codeverse3d/prompts/tracks/generate_graphics.j2@@ -1,6 +1,6 @@# Build `{{ title }}` in raw {{ language }}-You write the COMPLETE code for one animated real-time effect from the plan below. A headless harness+{% if single_shot %}You write the COMPLETE code{% else %}You write the code{% endif %} for one animated real-time effect from the plan below. A headless harnesscompiles/runs it with moderngl, renders frames at t = {{ judge_times }} at {{ resolution }}, measures them(luminance, colourfulness, detail, motion between frames, NaN pixels) and shows a labelled contact sheetto a judge. You never see the harness: make the code correct by construction and MAKE IT MOVE.diff --git a/harness/codeverse3d/prompts/tracks/generate_static.j2 b/harness/codeverse3d/prompts/tracks/generate_static.j2index 618753c2..adedcc3d 100644--- a/harness/codeverse3d/prompts/tracks/generate_static.j2+++ b/harness/codeverse3d/prompts/tracks/generate_static.j2@@ -1,6 +1,6 @@# Build `{{ object_name }}` in raw {{ language }}-You write the COMPLETE code for one static 3D object from the plan below. A harness will execute+{% if single_shot %}You write the COMPLETE code{% else %}You write the code{% endif %} for one static 3D object from the plan below. A harness will executeyour code, export a GLB, measure every part against the plan and render it for a judge. You neversee the harness: make the code correct by construction, with the plan's exact numbers.@@ -38,13 +38,6 @@ part gets detail: a session can be stopped at its window, and what it leaves musobject. Measured: a part still the skeleton's box (≤ 12 triangles, a closed solid filling itsbox, within 1 mm of the plan box) is a `placeholder_part` ERROR in `check_contract`; a part not joinedto the ground-touching component is a floating ERROR in `check_connectivity`.-{% if not single_shot %}--Every file already exists (the skeleton). Replace a file's placeholder in one write, then change it-only with targeted edits — never rewrite a whole file to change a few lines. Measured on this harness:-a dining chair whose files were rewritten whole (8 rewrites over 9 files) wrote ~136k characters,-drafted with each file written once ~49k, and a session's time follows the tokens it generates.-{% endif %}## DO- Place each part so its bounding box CENTRE and EXTENTS equal the plan row. Computediff --git a/harness/codeverse3d/prompts/tracks/refine_object.j2 b/harness/codeverse3d/prompts/tracks/refine_object.j2index 6ecfde8f..63bb46f0 100644--- a/harness/codeverse3d/prompts/tracks/refine_object.j2+++ b/harness/codeverse3d/prompts/tracks/refine_object.j2@@ -20,10 +20,7 @@ Files in scope (the whole object; a change names its target's file where it has{% endif %}{% if not single_shot %}-Edit in place: change only the lines a task needs, with targeted edits — never rewrite a whole file to-change a few lines. Measured on this harness: a dining chair whose files were rewritten whole (8-rewrites over 9 files) wrote ~136k characters, drafted with each file written once ~49k, and a-session's time follows the tokens it generates.+Edit in place: change only the lines a task needs.{% endif %}## What the judge sawdiff --git a/harness/codeverse3d/prompts/tracks/scene_env.j2 b/harness/codeverse3d/prompts/tracks/scene_env.j2index 8c1ee323..5d23d2be 100644--- a/harness/codeverse3d/prompts/tracks/scene_env.j2+++ b/harness/codeverse3d/prompts/tracks/scene_env.j2@@ -98,7 +98,7 @@ and the zones, read by nothing in the harness.5. **Shadows are not jagged** (judged): a shadow texel ≤ ~0.05 m over the content.`sunRig({ bounds })` fits frustum, map size and bias to the radius it is given — pass thecontent radius, not the ground size; a hand-set `sun.shadow.*` must meet the same texel size.-6. No {% if not (textures is defined and textures) %}textures, no {% endif %}DOM, no fetch, no Math.random.+6. No textures, no DOM, no fetch, no Math.random.## DON'T- No assets/zones here (they come from other modules). No cameras. No `scene.background` image loads.@@ -117,10 +117,6 @@ table it prints: every authored camera must pass the exposure checks.{{ effects_catalog }}{% endif %}-{% if textures is defined and textures %}--{{ textures }}-{% endif %}{% if lib_interface is defined and lib_interface %}## What `src/lib/` exports (read from the files in this workspace)diff --git a/harness/codeverse3d/prompts/tracks/scene_env_bpy.j2 b/harness/codeverse3d/prompts/tracks/scene_env_bpy.j2index 350f7fb2..93c526d1 100644--- a/harness/codeverse3d/prompts/tracks/scene_env_bpy.j2+++ b/harness/codeverse3d/prompts/tracks/scene_env_bpy.j2@@ -77,7 +77,7 @@ fails the lint. No cameras (the plan's), no `scene.render.*`, no frame changes.5. **Shadows read and shade carries colour** (judge `unlit_or_blown`, `lighting_atmosphere`: "flatshadows", "black shade"; the gate's `dark_frac`): a Sun `angle` of 1–3° with the sky world as fill is oneway; any fill lamp you add is yours to justify by the frame table.-6. No {% if not (textures is defined and textures) %}image textures, no {% endif %}file IO, no unseeded randomness (`ctx.rng(seed)`); the lint warns on `bpy.ops.mesh.primitive_*` in a loop.+6. No image textures, no file IO, no unseeded randomness (`ctx.rng(seed)`); the lint warns on `bpy.ops.mesh.primitive_*` in a loop.## DON'T- No assets or zones here (they come from other modules). No cameras. No `scene.*` render / view settings.@@ -99,12 +99,6 @@ and the atmosphere were found.{{ effects_catalog }}{% endif %}-{% if textures is defined and textures %}--{{ textures }}-(These are PNG files under `public/textures/`: load one with `bpy.data.images.load("public/textures/<file>",-check_existing=True)` into an Image Texture node; the build runs with the workspace root as its working directory.)-{% endif %}{% if lib_interface is defined and lib_interface %}## What `src/lib/` exports (read from the files in this workspace)diff --git a/harness/codeverse3d/prompts/tracks/scene_zone.j2 b/harness/codeverse3d/prompts/tracks/scene_zone.j2index e17155e2..2ecaeeb8 100644--- a/harness/codeverse3d/prompts/tracks/scene_zone.j2+++ b/harness/codeverse3d/prompts/tracks/scene_zone.j2@@ -108,7 +108,7 @@ So `{{ zone_file }}` exports `export function build(ctx) → THREE.Group` named- Sun, sky, ground and cameras are the env's. This zone may add the practical lights its settingcontains (a lantern, a neon sign, a forge, a campfire), within the exposure band and the perfbudget — a shadow-casting light per practical is the usual budget blow-out.-- No DOM, {% if not (textures is defined and textures) %}no textures, {% endif %}no fetch, no Math.random (`mulberry32(seed)` from `lib/noise.js`).+- No DOM, no textures, no fetch, no Math.random (`mulberry32(seed)` from `lib/noise.js`).- Do not import assets marked NOT AVAILABLE; do not edit other files.{% if tool_cards and not single_shot %}@@ -125,10 +125,6 @@ STATIC, double the amplitude and render again.{{ effects_catalog }}{% endif %}-{% if textures is defined and textures %}--{{ textures }}-{% endif %}## Output{{ output_format }}diff --git a/harness/codeverse3d/prompts/tracks/scene_zone_bpy.j2 b/harness/codeverse3d/prompts/tracks/scene_zone_bpy.j2index 9e605b48..8eab96de 100644--- a/harness/codeverse3d/prompts/tracks/scene_zone_bpy.j2+++ b/harness/codeverse3d/prompts/tracks/scene_zone_bpy.j2@@ -103,7 +103,7 @@ Animation is DATA: keyframes on `ctx.frame(0.0)` / `ctx.frame(1.5)` and simple d## DON'T- No world, no sun, no cameras, no ground here (the env's; the lint rejects a world in a zone); the locallights the brief's place has are yours.-- No file IO, {% if not (textures is defined and textures) %}no image textures, {% endif %}no `random.*` (`ctx.rng(seed)`), no Python drivers, no `scene.*` settings.+- No file IO, no image textures, no `random.*` (`ctx.rng(seed)`), no Python drivers, no `scene.*` settings.- Do not place assets marked NOT AVAILABLE; do not edit other files.{% if tool_cards and not single_shot %}@@ -119,12 +119,6 @@ STATIC means this zone's motion is below the threshold.{{ effects_catalog }}{% endif %}-{% if textures is defined and textures %}--{{ textures }}-(These are PNG files under `public/textures/`: load one with `bpy.data.images.load("public/textures/<file>",-check_existing=True)` into an Image Texture node; the build runs with the workspace root as its working directory.)-{% endif %}## Output{{ output_format }}diff --git a/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_env_bpy.j2 b/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_env_bpy.j2index b1cdf8fc..e31fe8cb 100644--- a/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_env_bpy.j2+++ b/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_env_bpy.j2@@ -83,7 +83,7 @@ fails the lint. No cameras (the plan's), no `scene.render.*`, no frame changes.leaf or needle cards, far rocks and hills are irregular masses — never cones, balls on sticks or cubesstanding in for them (`asset_quality_detail`), and never one shape stamped in a ring (`stamped_ring`,`monotonous_vegetation`).-7. No {% if not (textures is defined and textures) %}image textures, no {% endif %}file IO, no unseeded randomness (`ctx.rng(seed)`); the lint warns on `bpy.ops.mesh.primitive_*` in a loop.+7. No image textures, no file IO, no unseeded randomness (`ctx.rng(seed)`); the lint warns on `bpy.ops.mesh.primitive_*` in a loop.## DON'T- No assets or zones here (they come from other modules). No cameras. No `scene.*` render / view settings.@@ -105,12 +105,6 @@ and the atmosphere were found.{{ effects_catalog }}{% endif %}-{% if textures is defined and textures %}--{{ textures }}-(These are PNG files under `public/textures/`: load one with `bpy.data.images.load("public/textures/<file>",-check_existing=True)` into an Image Texture node; the build runs with the workspace root as its working directory.)-{% endif %}{% if lib_interface is defined and lib_interface %}## What the workspace's harness modules export (read from the files in this workspace)diff --git a/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_zone_bpy.j2 b/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_zone_bpy.j2index 61ee2440..ef0d4d7e 100644--- a/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_zone_bpy.j2+++ b/harness/codeverse3d/prompts/variants/argon_raw/tracks/scene_zone_bpy.j2@@ -111,7 +111,7 @@ action: `action.layers[0].strips[0].channelbag(action.slots[0]).fcurves`) and si## DON'T- No world, no sun, no cameras, no ground here (the env's; the lint rejects a world in a zone); the locallights the brief's place has are yours.-- No file IO, {% if not (textures is defined and textures) %}no image textures, {% endif %}no `random.*` (`ctx.rng(seed)`), no Python drivers, no `scene.*` settings.+- No file IO, no image textures, no `random.*` (`ctx.rng(seed)`), no Python drivers, no `scene.*` settings.- Do not place assets marked NOT AVAILABLE; do not edit other files.{% if tool_cards and not single_shot %}@@ -127,12 +127,6 @@ STATIC means this zone's motion is below the threshold.{{ effects_catalog }}{% endif %}-{% if textures is defined and textures %}--{{ textures }}-(These are PNG files under `public/textures/`: load one with `bpy.data.images.load("public/textures/<file>",-check_existing=True)` into an Image Texture node; the build runs with the workspace root as its working directory.)-{% endif %}## Output{{ output_format }}diff --git a/harness/codeverse3d/record/deliverable.py b/harness/codeverse3d/record/deliverable.pyindex ad16dff8..c6640ea3 100644--- a/harness/codeverse3d/record/deliverable.py+++ b/harness/codeverse3d/record/deliverable.py@@ -6,7 +6,7 @@ be zipped and sent on its own:* ``src/**`` (+ ``public/**`` for scenes, their GLB assets included) — the raw code at theround's commit;-* the round's artifact — ``object.glb`` (+ ``.stl`` / ``.step`` / textured GLB), or+* the round's artifact — ``object.glb`` (+ ``.stl`` / ``.step``), or``robot.urdf`` + ``meshes/*.glb``, or ``frames/*.png`` (the judged frames) +``frames_sheet.png`` + ``preview.gif`` — from ``artifacts/rNN/`` (:func:`keep_round_artifacts`);* ``sheet.png`` — the round's contact sheet (one picture of the result);@@ -32,7 +32,7 @@ from pathlib import Pathfrom codeverse3d.contracts.common import ENTRY_FILE, Language, Trackfrom codeverse3d.contracts.run import DeliverableFile, RoundRecord, RunDeliverable, RunRecord-from codeverse3d.proc import read_json_or_none, sha256_file, write_json_atomic+from codeverse3d.proc import sha256_file, write_json_atomicfrom codeverse3d.record import git_historyfrom codeverse3d.workspace import Workspace@@ -149,30 +149,6 @@ def round_outputs(ws: Workspace, rnd: RoundRecord | None) -> Path | None:return kept if kept.is_dir() else None-def texture_report_for(ws: Workspace, glb: Path) -> dict | None:- """The texture report (raw ``artifacts/textures/texturing.json``) of a pass that started- from these exact GLB bytes, else None. The report names the GLB it consumed; a pack made- mid-round, or for another round, is not this round's."""- from codeverse3d.texturing.run import report_path-- rep = read_json_or_none(report_path(ws)) or {}- src = ws.rebase(str(rep["glb_in"])) if rep.get("glb_in") else None- if src is None or not src.is_file() or not glb.is_file() or sha256_file(src) != sha256_file(glb):- return None- return rep---def texture_shipped_for(ws: Workspace, record: RunRecord, out: Path | None) -> bool:- """Did a SHIPPED texture pass start from the round whose build outputs are ``out``- (``round_outputs``)? Old layout (``out`` is ``artifacts/``): the one canonical pack- belonged to the one round finalise rebuilt, so the record's flag answers."""- if out is None:- return False- if out == ws.artifacts:- return bool((record.extra.get("texturing") or {}).get("shipped"))- return bool((texture_report_for(ws, out / "object.glb") or {}).get("shipped"))--def _copy_artifacts(ws: Workspace, record: RunRecord, rnd: RoundRecord | None, out: Path | None, w: _Writer) -> None:if out is None:return@@ -185,12 +161,6 @@ def _copy_artifacts(ws: Workspace, record: RunRecord, rnd: RoundRecord | None, ofor v in rnd.renders.views: # the judged frames (renders/rNN), one per sampled timesrc = ws.rebase(v.path)w.add_file(src, f"frames/{src.name}", "frames")- tex = record.extra.get("texturing") or {}- if texture_shipped_for(ws, record, out):- w.add_file(ws.artifacts / "object_textured.glb", "object_textured.glb", "model")- tex_dir = ws.root / str(tex.get("textures_dir") or "artifacts/textures")- for p in sorted(tex_dir.glob("*.png")) if tex_dir.is_dir() else []:- w.add_file(p, f"textures/{p.name}", "texture")def _copy_sheet(ws: Workspace, rnd: RoundRecord | None, w: _Writer) -> None:diff --git a/harness/codeverse3d/record/record.py b/harness/codeverse3d/record/record.pyindex 421a93d4..32cd99fa 100644--- a/harness/codeverse3d/record/record.py+++ b/harness/codeverse3d/record/record.py@@ -228,7 +228,7 @@ def package_run(ws: Workspace, record: RunRecord) -> None:"""Read the run's total off its ledger, materialise ``telemetry/`` and mirror it onto therecord. ``record.total_usage`` is the sum of ``telemetry/cost.jsonl`` at list price — everybilled row once: the planner, an aborted round, a retried session, a round-trip the- provider billed and the call discarded, and post-run work (a pick's texture pass) once it+ provider billed and the call discarded, and post-run work (a pairwise pick) once itjoined the ledger. A run with no ledger keeps what it has.Best-effort by contract: a failure is logged and the run still gets its@@ -264,7 +264,7 @@ def repackage(ws: Workspace) -> RunRecord | None:@contextmanagerdef join_post_run(ws: Workspace) -> Iterator[None]:- """Work on a FINISHED run that may spend money (a re-judge, a texture pass or pack, a pairwise+ """Work on a FINISHED run that may spend money (a re-judge, a pairwisepick): its rows join the run's ledger when it keeps one (``run_ledger(create=False)``), andon the way out — also when the work raised after paying — the record is re-packaged, so``record.total_usage`` stays the ledger's sum (D84)."""diff --git a/harness/codeverse3d/record/telemetry.py b/harness/codeverse3d/record/telemetry.pyindex 921469e8..327a35dc 100644--- a/harness/codeverse3d/record/telemetry.py+++ b/harness/codeverse3d/record/telemetry.py@@ -58,7 +58,7 @@ def price_table_version() -> str:def backend_kind(model_id: str) -> str:- """``api-agent:gemini:gemini-3.7-flash`` → ``api-agent``; ``gemini:x`` → ``gemini``."""+ """``api-agent:gemini:gemini-3.8-flash`` → ``api-agent``; ``gemini:x`` → ``gemini``."""return model_id.split(":", 1)[0] if ":" in model_id else model_id@@ -114,7 +114,6 @@ def settings_snapshot(record: RunRecord) -> SettingsSnapshot:roles=_role_settings(record),budget=spec.budget.model_dump(mode="json"),candidates=spec.options.candidates,- texture=bool(spec.options.texture),seed=spec.seed,rubric=rubric,rubric_hash=rubric_hash(rubric),diff --git a/harness/codeverse3d/reference.py b/harness/codeverse3d/reference.pyindex 6fc9fdeb..df076fe9 100644--- a/harness/codeverse3d/reference.py+++ b/harness/codeverse3d/reference.py@@ -1,179 +1,38 @@-"""Reference grounding: give the pipeline a picture of what it is building.--Today a prompt goes to a planner that has never SEEN the object. This module-synthesizes a neutral studio product shot of the brief with the image model,-**validates** it (``check_plausible`` + ``decide``), and hands it to the rest of the harness as the-fidelity anchor: the planner sees it, the generator's ``compare_reference`` tool-sees it, the silhouette gate measures against it and the judge scores against it-(:class:`codeverse3d.judges.vlm_judge.ReferenceJudge`).--A synthesized reference is never ground truth and is marked as such everywhere-(``attach`` / ``SYNTH_NOTE``): the user's own ``--image`` wins, the brief's dimensions win,-and a picture that fails the gate is discarded rather than chased.--Entry points::-- from codeverse3d.reference import synth_reference, attach, compare-- refset = synth_reference(spec, model=chat, image_model=img, n_views=2)- spec, why = attach(spec, refset)--(Collapsed from the 11-file ``codeverse3d/reference/`` package on 2026-08-28: its-entire external surface was two call sites — ``cli/main.ground_spec`` and the-judge's lazy ``compare``/``proportions`` imports.)+"""Reference comparison: judge a render against the user's own ``--image`` pictures.++The user's reference images ride in ``spec.references``. This module is what+measures and names the distance between one of them and a render: the brief's+dimension band vs the picture's outline (:func:`dimension_conflict` — when they+disagree the BRIEF wins and the picture is a shape target only), and one vision+call that lists concrete mismatches (:func:`compare`). The planner, the+generator's ``compare_reference`` tool, the silhouette gate and the judge+(:class:`codeverse3d.judges.vlm_judge.ReferenceJudge`) all read it. Nothing here+generates an image: the harness has no image-generation step."""from __future__ import annotations-import hashlibimport logging-import shutilfrom collections.abc import Sequence-from datetime import UTC, datetimefrom pathlib import Pathfrom typing import Any, Literal-from pydantic import BaseModel, Field, ValidationError+from pydantic import BaseModel, Field-from codeverse3d.config import get_settingsfrom codeverse3d.contracts.chat import ImagePartfrom codeverse3d.contracts.common import Usage-from codeverse3d.contracts.spec import ReferenceImage, Spec-from codeverse3d.models import get_chat_model+from codeverse3d.contracts.spec import Specfrom codeverse3d.models.schema_utils import ask_structured-from codeverse3d.proc import write_text_atomic-from codeverse3d.prompts import prompt_hashlog = logging.getLogger(__name__)# ===================================================================== types-#: The note stamped on every synthesized ``ReferenceImage``. It travels into the-#: planner prompt label, the generator's reference note, the judge's image label-#: and ``spec.json`` — so nothing downstream can mistake it for ground truth.-SYNTH_NOTE = (- "SYNTHESIZED reference (AI-generated product shot of the brief, NOT a photo of a real object "- "and NOT ground truth) — use it for shape, part inventory and proportions; the written brief "- "and its stated dimensions always win where they disagree"-)--#: ``spec.tags`` marker so galleries / dataset meta can filter synthesized-reference runs.-SYNTH_TAG = "synthetic-reference"--ViewKind = Literal["three_quarter", "front", "side", "back", "detail"]-MismatchKind = Literal["missing_feature", "extra_feature", "wrong_part_count", "wrong_proportion","wrong_shape", "wrong_material", "wrong_placement",]--class GateAnswer(BaseModel):- """What the vision model reports (observations only — no verdict)."""-- depicted_object: str = ""- shows_requested_object: bool = False- single_object: bool = False- plain_background: bool = False- no_text_or_watermark: bool = False- is_photo_collage: bool = False- contradictions: list[str] = Field(default_factory=list)- reason: str = ""---class PlausibilityVerdict(GateAnswer):- """One vision call's answer about ONE candidate reference image: the model's- observations (``depicted_object`` — what it says the image shows; ``contradictions`` —- the explicit spec constraints the image contradicts) plus the verdict.-- ``ok`` is computed in code from the booleans + ``contradictions`` (see- :func:`decide`), never taken from the model.- """-- ok: bool = False- model_id: str = ""-- def failure(self) -> str:- """One-line why-rejected (empty when ``ok``)."""- if self.ok:- return ""- bits: list[str] = []- if not self.shows_requested_object:- bits.append(f"shows {self.depicted_object or 'something else'}")- if not self.single_object:- bits.append("not a single object")- if not self.plain_background:- bits.append("background not plain")- if self.is_photo_collage:- bits.append("collage/multi-panel")- if not self.no_text_or_watermark:- bits.append("text or watermark")- bits += [f"contradicts: {c}" for c in self.contradictions]- return "; ".join(bits) or (self.reason or "rejected")---class ReferenceView(BaseModel):- """One synthesized image plus the verdict that let it in (or kept it out)."""-- path: str- view: ViewKind = "three_quarter"- image_prompt: str = ""- accepted: bool = False- verdict: PlausibilityVerdict | None = None- aspect: float | None = Field(default=None, description="width/height of the image's own silhouette")- dimension_conflict: bool = Field(- default=False,- description="the image's proportions contradict the brief's stated dimensions; the BRIEF wins and "- "no numeric proportion signal from this picture may be used (reference.proportions)")---class ReferenceSet(BaseModel):- """The result of :func:`synth_reference`.-- ``accepted`` is what may be attached to a spec; ``rejected`` is kept only so- the run can record *why* the fallback to no-reference happened.- """-- prompt: str- key: str = Field(default="", description="cache key (prompt + constraints + models + template hash)")- synthesized: bool = True- object_name: str = ""- subject: str = Field(default="", description="the described target the image prompts were built from")- text_model: str = ""- image_model: str = ""- views: list[ReferenceView] = Field(default_factory=list)- usage: Usage = Field(default_factory=Usage)- source: Literal["fresh", "cache", "none"] = "none"- error: str = ""- created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))-- @property- def accepted(self) -> list[ReferenceView]:- return [v for v in self.views if v.accepted]-- @property- def rejected(self) -> list[ReferenceView]:- return [v for v in self.views if not v.accepted]-- @property- def ok(self) -> bool:- return bool(self.accepted)-- def summary(self) -> str:- if self.error:- return f"reference synthesis failed: {self.error}"- good, bad = len(self.accepted), len(self.rejected)- head = f"{good} accepted / {good + bad} generated ({self.source}, {self.image_model or 'no image model'})"- flagged = [v.view for v in self.accepted if v.dimension_conflict]- if flagged:- head += (f" — proportions of {', '.join(flagged)} disagree with the brief's dimensions "- "(shape target only; the brief's numbers win)")- if bad:- head += " — rejected: " + "; ".join(f"{v.view}: {v.verdict.failure() if v.verdict else 'no verdict'}"- for v in self.rejected)- return head--_SEVERITY_ORDER = {"critical": 0, "major": 1, "minor": 2}@@ -197,7 +56,6 @@ class ReferenceDiff(BaseModel):reliable: bool = Trueview: str = ""reference: str = ""- synthesized: bool = Falsemismatches: list[Mismatch] = Field(default_factory=list)matches: list[str] = Field(default_factory=list, description="what the render already gets right")model_id: str = ""@@ -212,8 +70,7 @@ class ReferenceDiff(BaseModel):"""Compact block for a judge / agent prompt (empty when nothing to say)."""if self.error or not (self.mismatches or self.matches):return ""- lines = ["REFERENCE DIFF (harness vision pass, target = the REFERENCE image"- + (", SYNTHESIZED — not ground truth" if self.synthesized else "") + "):"]+ lines = ["REFERENCE DIFF (harness vision pass, target = the REFERENCE image):"]if self.iou is not None:lines.append(f"- measured silhouette IoU {self.iou:.3f}"+ (f", aspect error {self.aspect_ratio_err:.0%}" if self.aspect_ratio_err is not None else "")@@ -227,7 +84,7 @@ class ReferenceDiff(BaseModel):# ===================================================================== spec_textdef brief_text(spec: Spec) -> str:- """Prompt + the constraints a photograph could show, as one block."""+ """The prompt + the constraints a picture could show, as one block."""lines = [spec.prompt.strip()]c = spec.constraintsif c.style:@@ -242,117 +99,6 @@ def brief_text(spec: Spec) -> str:return "\n".join(lines)-def visual_constraints(spec: Spec) -> str:- """The constraints the plausibility gate may hold an IMAGE to.-- Absolute dimensions are quoted as *ratios* only: a photograph with no scale- reference cannot contradict "height 0.30 m", but it can contradict- "twice as tall as it is wide". ``max_triangles`` is not visual at all.- """- c = spec.constraints- lines: list[str] = []- dims = c.dimensions_m or {}- height = dims.get("height")- for name in ("width", "depth", "length"):- other = dims.get(name)- if height and other:- lines.append(f"proportion: height : {name} ≈ {height / other:.2f} : 1")- for m in c.must_have:- lines.append(f"must be visible: {m}")- for m in c.must_not:- lines.append(f"must NOT be present: {m}")- if c.style:- lines.append(f"style: {c.style}")- return "\n".join(f"- {line}" for line in lines) or "- (none stated)"---# ===================================================================== prompts-# --------------------------------------------------------------------------- image prompt writer-IMAGE_PROMPT_SYSTEM = (- "You write prompts for a text-to-image model. You are given a 3D modelling brief. Your job is to "- "describe THE SAME OBJECT as a neutral studio product photograph, so a 3D modeller can use the picture "- "as a shape target. Describe only what a camera would see: the object's parts, their proportions and "- "their materials. Never invent brand names, never add props, people, hands, scale figures or scenery. "- "Answer with JSON only."-)--IMAGE_PROMPT_USER = """\-3D MODELLING BRIEF--------------------{brief}--Write ONE `subject` sentence (25-60 words) describing this object as it would look in a product catalogue:-its overall form, its named parts, their relative sizes, and the material of each part. Keep every explicit-requirement of the brief (part counts, features, materials). Do not mention the camera, the background or-the lighting — the harness adds those.--Then write `object_name`: 1-4 words naming the object (e.g. "hand-crank coffee grinder").--Then, for each of the {n_views} requested views {views}, write a `view_note`: at most 12 words saying what-that camera angle must make readable (e.g. "front face, crank handle silhouette, drawer front").-"""--#: Harness-owned camera/background clause appended to every image prompt — this is-#: what makes the picture usable as a silhouette target (plain backdrop, whole object-#: in frame, no crop, no styling).-STUDIO_SUFFIX = (- "neutral studio product photograph of a single object, isolated on a plain seamless light grey "- "background, the complete object fully inside the frame with a small even margin on all sides, "- "nothing cropped, standing upright in its natural resting orientation, soft even studio lighting, "- "no cast shadow on the backdrop, sharp focus throughout, no depth of field, no props, no hands, "- "no people, no scale figures, no scenery, no text, no labels, no logos, no watermark, no border, "- "no collage, no multiple views in one image, single frame only, photorealistic, colour photograph"-)--#: view name → the camera clause the harness owns for it-VIEW_CLAUSE: dict[str, str] = {- "three_quarter": "three-quarter view from slightly above, front and one side both visible",- "front": "straight-on front elevation, camera at object height, no perspective distortion",- "side": "straight-on side elevation, camera at object height, no perspective distortion",- "back": "straight-on rear elevation, camera at object height",- "detail": "close view of the most characteristic feature, whole feature in frame",-}--#: order views are requested in as ``n_views`` grows. The straight-on ``front``-#: elevation comes second on purpose: it is the SILHOUETTE TARGET, and a straight-on-#: elevation has a render camera to match (``silhouette.measure_reference`` takes the-#: best-matching view — the gate and the judge both). The 3/4 shot carries the part inventory.-VIEW_ORDER: tuple[str, ...] = ("three_quarter", "front", "side", "back")---# --------------------------------------------------------------------------- plausibility gate-GATE_SYSTEM = (- "You verify whether a generated image can be used as a modelling reference. You are strict and "- "literal: you report what the image actually shows, not what it was meant to show. Answer with JSON only."-)--GATE_USER = """\-The image was generated as a reference photo for this 3D modelling brief.--BRIEF-------{brief}--EXPLICIT CONSTRAINTS THE IMAGE MUST NOT CONTRADICT----------------------------------------------------{constraints}--Answer these questions about the IMAGE:-- `depicted_object`: 1-6 words naming what the image actually shows.-- `shows_requested_object`: true only if the depicted object IS the object the brief asks for- (a different object, or an unrecognisable blob, is false).-- `single_object`: true only if exactly ONE object is shown (a base/stand/tray that the brief itself- asks for counts as part of the object; a second copy of the object, extra props or accessories do not).-- `plain_background`: true only if the background is a plain, empty, untextured backdrop.-- `no_text_or_watermark`: true only if there is NO text, caption, label, dimension line, logo or watermark.-- `is_photo_collage`: true if the frame contains multiple panels, multiple views, a grid or a turnaround sheet.-- `contradictions`: for EACH constraint above that the image visibly contradicts, one short sentence naming- the constraint and what the image shows instead. Empty list if none. Only list what you can SEE — do not- guess at absolute dimensions from a photo with no scale reference.-- `reason`: one sentence summarising your verdict.-"""--# --------------------------------------------------------------------------- reference diffDIFF_SYSTEM = ("You compare a 3D render against a reference image and name concrete, fixable differences. "@@ -363,7 +109,6 @@ DIFF_SYSTEM = (DIFF_USER = """\The images labelled REFERENCE are the shape target. The images labelled RENDER are the current 3D model.-{synth_note}BRIEF-----@@ -388,59 +133,6 @@ Rules:"""-# ===================================================================== cache--CACHE_SUBDIR = "references"---def template_hash() -> str:- """One hash over every prompt constant that shapes a reference image."""- blob = "\x00".join([- IMAGE_PROMPT_SYSTEM, IMAGE_PROMPT_USER, STUDIO_SUFFIX, GATE_SYSTEM, GATE_USER,- *(f"{k}={v}" for k, v in sorted(VIEW_CLAUSE.items())),- ])- return prompt_hash(blob)---def cache_key(spec: Spec, *, n_views: int, text_model: str, image_model: str) -> str:- h = hashlib.sha256()- for part in (template_hash(), brief_text(spec), str(n_views), text_model, image_model):- h.update(part.encode())- h.update(b"\x00")- return h.hexdigest()[:20]---def cache_root(cache_dir: Path | None = None) -> Path:- return (cache_dir or get_settings().cache_dir) / CACHE_SUBDIR---def load(key: str, *, cache_dir: Path | None = None) -> ReferenceSet | None:- """Cached set whose image files all still exist, else ``None`` (self-healing)."""- path = cache_root(cache_dir) / key / "set.json"- if not path.is_file():- return None- try:- rs = ReferenceSet.model_validate_json(path.read_text())- except (ValidationError, ValueError) as e:- log.warning("reference cache %s unreadable (%s); ignoring", key, e)- return None- if any(not Path(v.path).is_file() for v in rs.views):- log.info("reference cache %s lost its images; regenerating", key)- return None- rs.source, rs.usage = "cache", Usage()- return rs---def store(rs: ReferenceSet, *, cache_dir: Path | None = None) -> Path:- return write_text_atomic(cache_root(cache_dir) / rs.key / "set.json", rs.model_dump_json(indent=2))---def image_dir(key: str, *, cache_dir: Path | None = None) -> Path:- d = cache_root(cache_dir) / key- d.mkdir(parents=True, exist_ok=True)- return d--# ===================================================================== proportions#: relative aspect disagreement above which the picture's proportions are not a target@@ -518,259 +210,9 @@ def conflict_note(info: dict[str, Any]) -> str:f"reference for the part inventory and the shape of each part, NOT for the overall proportions. "f"The measured silhouette score is therefore neutral and must not be read as a proportion verdict.")--# ===================================================================== gate---def decide(ans: GateAnswer, *, model_id: str = "") -> PlausibilityVerdict:- """Observations → verdict, in code. ALL of the checks must hold."""- ok = (- ans.shows_requested_object- and ans.single_object- and ans.plain_background- and ans.no_text_or_watermark- and not ans.is_photo_collage- and not ans.contradictions- )- return PlausibilityVerdict(**{- **ans.model_dump(),- "depicted_object": ans.depicted_object.strip()[:80],- "contradictions": [c.strip()[:200] for c in ans.contradictions if c.strip()][:6],- "reason": ans.reason.strip()[:300],- }, ok=ok, model_id=model_id)---def check_plausible(- image: Path | str,- spec: Spec,- *,- model: Any,- model_id: str = "",- temperature: float = 0.0,-) -> tuple[PlausibilityVerdict, Usage]:- """One vision call. A model/parse failure is a REJECTION, never an exception:- a reference we could not verify must not be used."""- path = Path(image)- if not path.is_file():- return PlausibilityVerdict(reason=f"image missing: {path.name}", model_id=model_id), Usage()- text = GATE_USER.format(brief=brief_text(spec), constraints=visual_constraints(spec))- ans, usage, err = ask_structured(model, GateAnswer, system=GATE_SYSTEM, text=text,- images=[ImagePart(path=str(path), label="CANDIDATE REFERENCE")],- temperature=temperature, label="reference_gate")- if err:- log.warning("reference gate on %s: %s", path.name, err)- return PlausibilityVerdict(reason=f"gate {err}", model_id=model_id), usage- return decide(ans, model_id=model_id or getattr(model, "id", "")), usage---# ===================================================================== attach-def has_user_references(spec: Spec) -> bool:- """True when the user supplied their own reference image(s) (``--image``)."""- return any(not is_synthetic(r) for r in spec.references)---def is_synthetic(ref: ReferenceImage) -> bool:- return ref.note.startswith("SYNTHESIZED")---#: view kinds that can serve as the silhouette ``target``, best first — the harness-#: measures IoU against a straight-on render, so a straight-on photo is the right-#: target and the three-quarter shot is only a detail/part-inventory image.-TARGET_PREFERENCE: tuple[str, ...] = ("front", "side", "back", "three_quarter")---def reference_images(refset: ReferenceSet) -> list[ReferenceImage]:- """Accepted views as spec references, ``target`` first.-- Exactly one view is the ``target`` (the only one the silhouette gate and the- measured ``silhouette_match`` criterion compare against); the rest are- ``detail`` images the planner, generator and judge still see.- """- usable = [v for v in refset.accepted if v.path and Path(v.path).is_file()]- if not usable:- return []- target = min(usable, key=lambda v: (TARGET_PREFERENCE.index(v.view)- if v.view in TARGET_PREFERENCE else len(TARGET_PREFERENCE)))- ordered = [target] + [v for v in usable if v is not target]- return [ReferenceImage(path=str(Path(v.path).resolve()), role="target" if v is target else "detail",- note=f"{SYNTH_NOTE} [{v.view} view, {refset.image_model or 'image model'}]")- for v in ordered]---def attach(spec: Spec, refset: ReferenceSet) -> tuple[Spec, str]:- """``(spec, why)`` — the spec to run with, and one line saying what happened.-- The returned spec is a copy; ``spec`` itself is never mutated.- """- if has_user_references(spec):- return spec, "user --image references win; synthesized reference not attached"- refs = reference_images(refset)- if not refs:- return spec, f"no usable synthesized reference ({refset.summary()}) — running without one"- tags = list(spec.tags) + ([SYNTH_TAG] if SYNTH_TAG not in spec.tags else [])- return spec.model_copy(update={"references": refs, "tags": tags}), (- f"attached {len(refs)} SYNTHESIZED reference image(s) ({refset.summary()})"- )---# ===================================================================== synth--MAX_VIEWS = len(VIEW_ORDER)-DEFAULT_SIZE = 1024---class ViewPrompt(BaseModel):- view: str- view_note: str = ""---class ImagePromptPlan(BaseModel):- object_name: str = ""- subject: str = ""- views: list[ViewPrompt] = Field(default_factory=list)---def views_for(n_views: int) -> list[str]:- return list(VIEW_ORDER[: max(1, min(int(n_views), MAX_VIEWS))])---def compose_image_prompt(subject: str, view: str, note: str = "") -> str:- """Harness-owned composition: subject + view clause + note + studio suffix."""- subject = " ".join(subject.strip().rstrip(".,;").split())- clause = VIEW_CLAUSE.get(view, VIEW_CLAUSE["three_quarter"])- note = " ".join(note.strip().rstrip(".,;").split())- bits = [subject, clause, *( [f"the picture must make readable: {note}"] if note else [] ), STUDIO_SUFFIX]- return ", ".join(bits)---def _fallback_plan(spec: Spec, view_names: list[str]) -> ImagePromptPlan:- """No text model (or it failed) → use the brief's own words as the subject."""- return ImagePromptPlan(object_name=spec.prompt.strip()[:60],- subject=brief_text(spec).replace("\n", ", "),- views=[ViewPrompt(view=v) for v in view_names])---def image_prompt_plan(spec: Spec, view_names: list[str], *, model: Any, temperature: float = 0.3) -> tuple[ImagePromptPlan, Usage]:- """ONE structured text call: brief → subject sentence + per-view notes."""- if model is None:- return _fallback_plan(spec, view_names), Usage()- text = IMAGE_PROMPT_USER.format(brief=brief_text(spec), n_views=len(view_names), views=", ".join(view_names))- plan, usage, err = ask_structured(model, ImagePromptPlan, system=IMAGE_PROMPT_SYSTEM, text=text,- temperature=temperature, label="reference_prompt")- if err:- log.warning("reference prompt writer %s; using the brief verbatim", err)- return _fallback_plan(spec, view_names), usage- if not plan.subject.strip():- plan.subject = brief_text(spec).replace("\n", ", ")- by_view = {v.view.strip().lower(): v for v in plan.views}- plan.views = [by_view.get(v, ViewPrompt(view=v)) for v in view_names]- for v, name in zip(plan.views, view_names, strict=True):- v.view = name- return plan, usage---def synth_reference(- spec: Spec,- *,- model: Any = None,- image_model: Any = None,- n_views: int = 2,- model_id: str = "",- cache_dir: Path | None = None,- use_cache: bool = True,- out_dir: Path | None = None,- size: int = DEFAULT_SIZE,-) -> ReferenceSet:- """Synthesize + validate reference images for ``spec``. Never raises.-- ``out_dir`` (a run's ``artifacts/reference``) receives a copy of every- accepted image so the run is self-contained; the cache keeps the originals.- """- view_names = views_for(n_views)- text_id = model_id or getattr(model, "id", "") or ""- image_id = getattr(image_model, "id", "") or getattr(image_model, "model", "") or ""- key = cache_key(spec, n_views=len(view_names), text_model=text_id, image_model=image_id)- if use_cache:- hit = load(key, cache_dir=cache_dir)- if hit is not None:- _refresh_conflicts(spec, hit) # the proportion check may have changed since it was cached- log.info("reference cache hit %s (%s)", key, hit.summary())- return _publish(hit, out_dir)- rs = ReferenceSet(prompt=spec.prompt, key=key, text_model=text_id, image_model=image_id, source="fresh")- if image_model is None:- rs.error = "no image model configured"- return rs- plan, usage = image_prompt_plan(spec, view_names, model=model)- rs.usage, rs.object_name, rs.subject = usage, plan.object_name.strip()[:80], plan.subject.strip()- out = image_dir(key, cache_dir=cache_dir)- for i, vp in enumerate(plan.views):- prompt = compose_image_prompt(plan.subject, vp.view, vp.view_note)- view = ReferenceView(path="", view=vp.view, image_prompt=prompt) # type: ignore[arg-type]- try:- images, u = image_model.generate_with_usage(prompt, size=size, n=1, seed=spec.seed + i)- except Exception as e: # noqa: BLE001 — a reference is optional; it must never fail the run- log.warning("reference image %s failed: %s", vp.view, e)- rs.error = rs.error or f"{type(e).__name__}: {e}"- continue- rs.usage = rs.usage + u- if not images:- continue- path = out / f"ref_{i}_{vp.view}.png"- images[0].save(path)- view.path = str(path)- verdict, gu = check_plausible(path, spec, model=model, model_id=text_id) if model is not None else (None, Usage())- rs.usage = rs.usage + gu- if verdict is not None:- view.verdict, view.accepted = verdict, verdict.ok- if verdict.ok:- info = dimension_conflict(spec, path)- view.aspect, view.dimension_conflict = info.get("image_aspect"), bool(info.get("conflict"))- else: # no text model to verify with → an unverified image is NOT used- view.accepted = False- rs.views.append(view)- if use_cache and rs.views:- store(rs, cache_dir=cache_dir)- log.info("reference synthesis %s: %s", key, rs.summary())- return _publish(rs, out_dir)---def _refresh_conflicts(spec: Spec, rs: ReferenceSet) -> None:- """Recompute the proportion flags of a cached set against today's rules."""- for v in rs.views:- if not v.accepted or not v.path or not Path(v.path).is_file():- continue- info = dimension_conflict(spec, v.path)- v.aspect, v.dimension_conflict = info.get("image_aspect"), bool(info.get("conflict"))---def _publish(rs: ReferenceSet, out_dir: Path | None) -> ReferenceSet:- """Copy accepted images into the run and repoint their paths (idempotent). The set- itself is written by ``ground_spec``, which records the all-rejected case too."""- if out_dir is None or not rs.accepted:- return rs- out_dir = Path(out_dir)- out_dir.mkdir(parents=True, exist_ok=True)- for v in rs.views:- if not v.accepted or not v.path:- continue- src = Path(v.path)- dst = out_dir / src.name- if src.resolve() == dst.resolve():- continue- try:- shutil.copy2(src, dst)- except OSError as e: # keep the cache path — still readable- log.warning("could not copy reference into the run (%s); using the cache path", e)- continue- v.path = str(dst)- return rs--# ===================================================================== mismatchMAX_MISMATCHES = 6-_SYNTH_LINE = ("The REFERENCE was SYNTHESIZED from the brief by an image model — it is a shape target, "- "not ground truth. Where it disagrees with the brief, the BRIEF wins and it is not a mismatch.")class DiffAnswer(BaseModel):@@ -786,7 +228,6 @@ def compare(model: Any,part_names: Sequence[str] = (),measured: dict[str, Any] | None = None,- synthesized: bool = False,temperature: float = 0.1,max_reference: int = 2,max_renders: int = 3,@@ -794,7 +235,7 @@ def compare("""One vision call: REFERENCE images + RENDER images → named mismatches."""refs = [Path(p) for p in reference_images if Path(p).is_file()][:max_reference]rens = [Path(p) for p in render_images if Path(p).is_file()][:max_renders]- diff = ReferenceDiff(synthesized=synthesized, model_id=getattr(model, "id", "") if model else "")+ diff = ReferenceDiff(model_id=getattr(model, "id", "") if model else "")if measured:diff.iou = _as_float(measured.get("iou"))diff.aspect_ratio_err = _as_float(measured.get("aspect_ratio_err"))@@ -809,7 +250,6 @@ def compare(return difftext = DIFF_USER.format(brief=brief_text(spec),- synth_note=_SYNTH_LINE if synthesized else "",measured=_measured_block(diff),parts=", ".join(list(part_names)[:40]) or "(no part list)",)@@ -843,77 +283,3 @@ def _measured_block(diff: ReferenceDiff) -> str:if not diff.reliable:line += " (background mask unreliable — trust your eyes over this number)"return line + ". This is a fact; do not re-estimate it.\n"---# ===================================================================== run--ARTIFACT_SUBDIR = "reference"---def ground_spec(- spec: Spec,- ws: Any,- *,- n_views: int = 2,- model: Any | None = None,- image_model: Any | None = None,- image_model_id: str = "",- events: Any | None = None,- cache_dir: Path | None = None,-) -> tuple[Spec, ReferenceSet, str]:- """``(spec, refset, why)``. ``spec`` is unchanged when no reference was attached."""- empty = ReferenceSet(prompt=spec.prompt)- if has_user_references(spec):- why = "user --image references win; no reference synthesized"- _emit(events, "reference.skipped", reason=why)- return spec, empty, why- try:- model = model if model is not None else _chat_model(spec.backends.planner)- image_model = image_model if image_model is not None else get_image_model(image_model_id)- except Exception as e: # noqa: BLE001 — no keys / no package → run without a reference- why = f"reference grounding unavailable: {type(e).__name__}: {e}"- log.warning("%s", why)- _emit(events, "reference.error", reason=why)- return spec, empty, why- out_dir = Path(ws.artifacts) / ARTIFACT_SUBDIR- _emit(events, "reference.start", n_views=n_views, image_model=getattr(image_model, "id", ""))- refset = synth_reference(spec, model=model, image_model=image_model, n_views=n_views,- model_id=spec.backends.planner, out_dir=out_dir, cache_dir=cache_dir)- grounded, why = attach(spec, refset)- if grounded is not spec:- ws.write_json(ws.spec_path, grounded)- ws.commit("reference")- out_dir.mkdir(parents=True, exist_ok=True)- (out_dir / "reference_set.json").write_text(refset.model_dump_json(indent=2))- _emit(events, "reference.done", accepted=len(refset.accepted), rejected=len(refset.rejected),- source=refset.source, cost_usd=round(refset.usage.cost_usd, 4), why=why,- rejected_reasons=[v.verdict.failure() if v.verdict else "" for v in refset.rejected])- return grounded, refset, why---def _chat_model(model_id: str) -> Any:- return get_chat_model(model_id)---def get_image_model(model_id: str = "") -> Any:- from codeverse3d.models.gemini import DEFAULT_IMAGE_MODEL, GeminiImageModel-- return GeminiImageModel(model_id or DEFAULT_IMAGE_MODEL)---def _emit(events: Any, name: str, **payload: Any) -> None:- if events is None:- return- try:- events.emit(name, **payload)- except Exception: # noqa: BLE001 - telemetry must never break a run- log.debug("could not emit %s", name, exc_info=True)---__all__ = [- "SYNTH_NOTE", "SYNTH_TAG", "Mismatch", "PlausibilityVerdict", "ReferenceDiff", "ReferenceSet",- "ReferenceView", "attach", "check_plausible", "compare", "compose_image_prompt", "conflict_note",- "decide", "dimension_conflict", "expected_aspect_range",- "ground_spec", "has_user_references", "is_synthetic", "reference_images",- "synth_reference", "views_for",-]diff --git a/harness/codeverse3d/spatial/measure.py b/harness/codeverse3d/spatial/measure.pyindex fd3b1c32..ca56e79a 100644--- a/harness/codeverse3d/spatial/measure.py+++ b/harness/codeverse3d/spatial/measure.py@@ -9,7 +9,7 @@ rows, islands, ground gap, footprint offset, materials). Degenerate inputworld-space ``trimesh.Trimesh`` per top-level node (all child meshes merged).``cached_parts`` is the memoized front door for gates that re-read the sameGLB (keyed on path + size + mtime_ns; ``load_scene`` itself is never cached —-texturing mutates scenes), and ``solid_parts`` is that front door minus the+a caller mutating a scene), and ``solid_parts`` is that front door minus theempty parts — what connectivity / sections want.``Measurement.extra["complexity"]`` carries the objective complexity vectordiff --git a/harness/codeverse3d/spatial/tools.py b/harness/codeverse3d/spatial/tools.pyindex c94fe357..b0b452bd 100644--- a/harness/codeverse3d/spatial/tools.py+++ b/harness/codeverse3d/spatial/tools.py@@ -643,11 +643,6 @@ CHECKLIST = ("5) materials — per-part colour and finish.")-_SYNTH_WARNING = ("This reference was SYNTHESIZED from the brief by an image model, not photographed: it is a "- "shape and part-inventory target only. Where it disagrees with the brief or the stated "- "dimensions, follow the BRIEF.")--class CompareReferenceArgs(BaseModel):view: str = Field(default="front_right_high", description="view to render for the comparison")reference_index: int = Field(default=0, ge=0, description="index into spec.references")@@ -684,8 +679,6 @@ def compare_reference(ctx: ToolContext, args: CompareReferenceArgs) -> Observatif"{res['ref_aspect']:.2f} (err {res['aspect_ratio_err']:.0%}).",f"Look at the sheet and check, in this order: {CHECKLIST}",]- if str(ref.get("note", "")).startswith("SYNTHESIZED"):- lines.append(_SYNTH_WARNING)lines.append(fmt_numbers({k: v for k, v in res.items() if k != "diff_png_path"}))images = image_budget([str(sheet), str(diff_png), shaded.views[0].path])return Observation(ok=True, text="\n".join(lines),diff --git a/harness/codeverse3d/texturing/__init__.py b/harness/codeverse3d/texturing/__init__.pyindex c465079e..3a97216a 100644--- a/harness/codeverse3d/texturing/__init__.py+++ b/harness/codeverse3d/texturing/__init__.py@@ -1,3 +1,2 @@-"""Text-to-image texturing: a language-agnostic pass on the canonical GLB-(objects, ``run.texture_pass``) and a scene texture pack (scenes,-``plan.scene_texture_pack``). Import from the submodules."""+"""The PBR material-family table (``materials``) that ``languages/blender`` reads. There is no+texture generation: the harness has no image-generation step."""diff --git a/harness/codeverse3d/texturing/apply.py b/harness/codeverse3d/texturing/apply.pydeleted file mode 100644index e1c2a4aa..00000000--- a/harness/codeverse3d/texturing/apply.py+++ /dev/null@@ -1,654 +0,0 @@-"""Derived PBR maps: roughness and normal, computed from a generated albedo tile.--The texture pass used to ship **albedo only** — one image per material, plus two-scalar factors. A flat roughness is exactly what the judge keeps calling out:-*"the blue material lacks roughness variation or bump mapping, making it look-like smooth plastic rather than cast iron"* (`tool_hard_bench_vise` r1),-*"materials are flat colors with no texture character (no wood grain, no leather-bump)"* (`furn_hard_rolltop_desk` r2). A grain that only changes colour is a-sticker; a grain that also changes how the light scatters is a material.--Both maps are derived from the albedo, so they cost nothing (no extra image-call), tile exactly like it does, and can never disagree with it:--* **roughness** — dark, recessed-looking pixels of a surface are its pores, its- end grain, its casting pits: rougher. Bright ones are the polished high- points: smoother. So roughness is the family's base value modulated by- ``-(luminance - mean)``, with the amplitude set per family (wood grain and- cast iron vary a lot, glazed ceramic almost not at all).-* **normal** — wrap-around central differences of that same detail signal, read- as a height field. Same reasoning: what is dark is low.--Written into the GLB as a glTF ``metallicRoughnessTexture`` (roughness in G,-metallic in B — the packing the spec mandates) and a ``normalTexture``.-"""--from __future__ import annotations--import logging-import time-from dataclasses import dataclass-from pathlib import Path-from typing import Any, NamedTuple--import numpy as np-import trimesh-from PIL import Image, ImageFilter-from pydantic import BaseModel, Field--from codeverse3d.contracts.plan import StaticPlan-from codeverse3d.conventions import part_key, to_snake-from codeverse3d.spatial.measure import GlbLoadError, load_scene-from codeverse3d.texturing.materials import (- COARSE_TO_FINE,- FamilyMatch,- family_for,- is_framework_default,- looks_painted,- out_of_band,- pbr_for,-)-from codeverse3d.texturing.plan import TexturePart, TexturePlan--#: family → (roughness amplitude, normal-map strength). Amplitude is the peak-#: deviation from the base roughness across the tile; strength scales the Sobel-#: gradient before it becomes a slope.-VARIATION: dict[str, tuple[float, float]] = {- "hardwood": (0.16, 0.55),- "softwood": (0.20, 0.85),- "painted_wood": (0.10, 0.35),- "cast_iron": (0.22, 0.90),- "brushed_metal": (0.12, 0.25),- "machined_steel": (0.10, 0.25),- "chrome": (0.05, 0.10),- "brass": (0.10, 0.25),- "copper_patina": (0.24, 0.90),- "painted_metal": (0.08, 0.25),- "rough_plastic": (0.12, 0.40),- "glossy_plastic": (0.07, 0.20),- "rubber": (0.10, 0.45),- "fabric": (0.14, 0.95),- "leather": (0.18, 0.90),- "ceramic": (0.06, 0.20),- "concrete": (0.20, 0.95),- "stone": (0.20, 0.90),- "paper": (0.10, 0.35),- "glass": (0.02, 0.05),-}-DEFAULT_VARIATION = (0.14, 0.55)--#: blur radius (as a fraction of the tile) used to separate the tile's large-scale-#: shading from the fine detail that actually is surface relief-_DETAIL_BLUR_FRAC = 0.06---def variation_for(family: str) -> tuple[float, float]:- return VARIATION.get(family, DEFAULT_VARIATION)---def _luminance(img: Image.Image) -> np.ndarray:- a = np.asarray(img.convert("RGB"), dtype=np.float32) / 255.0- return 0.2126 * a[..., 0] + 0.7152 * a[..., 1] + 0.0722 * a[..., 2]---def _blur(a: np.ndarray, radius: float) -> np.ndarray:- """Gaussian blur of a 0..1 float array (through PIL, so no scipy dependency)."""- img = Image.fromarray(np.round(np.clip(a, 0.0, 1.0) * 255).astype(np.uint8), mode="L")- return np.asarray(img.filter(ImageFilter.GaussianBlur(radius)), dtype=np.float32) / 255.0---def _detail(img: Image.Image) -> np.ndarray:- """Luminance with its low-frequency component removed, rescaled to ~[-1, 1].-- Removing the low frequencies matters: a generated tile often has a broad- lighting ramp baked in, and using raw luminance would turn that ramp into a- roughness gradient across the whole part. The blurred reference is built from- the SAME luminance array (not PIL's ``convert("L")``, which uses the ITU-R 601- weights and would leave a constant offset behind on a solid colour).- """- lum = _luminance(img)- d = lum - _blur(lum, max(1.0, _DETAIL_BLUR_FRAC * max(img.size)))- scale = float(np.percentile(np.abs(d), 98))- return np.clip(d / scale, -1.0, 1.0) if scale > 1e-6 else np.zeros_like(d)---def roughness_array(albedo: Image.Image, base_roughness: float, family: str) -> np.ndarray:- """Per-pixel roughness in 0..1: ``base - amplitude × detail`` (dark = rough)."""- amp = variation_for(family)[0]- return np.clip(float(base_roughness) - amp * _detail(albedo), 0.0, 1.0)---def metallic_roughness_image(- albedo: Image.Image, base_roughness: float, metallic: float, family: str-) -> Image.Image:- """glTF ``metallicRoughnessTexture``: R unused, **G = roughness**, **B = metallic**."""- rough = roughness_array(albedo, base_roughness, family)- h, w = rough.shape- out = np.zeros((h, w, 3), dtype=np.uint8)- out[..., 1] = np.round(rough * 255).astype(np.uint8)- out[..., 2] = np.uint8(round(float(np.clip(metallic, 0.0, 1.0)) * 255))- return Image.fromarray(out, mode="RGB")---def normal_image(albedo: Image.Image, family: str, *, strength: float | None = None) -> Image.Image:- """Tangent-space normal map from the albedo's detail, read as a height field.-- Gradients are taken with ``np.roll`` (wrap-around), so a tile that is seamless- in albedo stays seamless in its normals.- """- s = variation_for(family)[1] if strength is None else float(strength)- height = _detail(albedo)- # central differences, wrapping at the tile edges- dx = (np.roll(height, -1, axis=1) - np.roll(height, 1, axis=1)) * 0.5- dy = (np.roll(height, -1, axis=0) - np.roll(height, 1, axis=0)) * 0.5- nx, ny, nz = -dx * s * 4.0, dy * s * 4.0, np.ones_like(height)- norm = np.sqrt(nx * nx + ny * ny + nz * nz)- rgb = np.stack([nx / norm, ny / norm, nz / norm], axis=-1) * 0.5 + 0.5- return Image.fromarray(np.round(np.clip(rgb, 0.0, 1.0) * 255).astype(np.uint8), mode="RGB")---def is_flat(img: Image.Image, *, tol: float = 0.01) -> bool:- """A tile with no detail at all (a solid colour): derived maps would be noise."""- lum = _luminance(img)- return bool(np.percentile(np.abs(lum - float(lum.mean())), 99) < tol)---# ===================================================================== uv-#: long/mid extent ratio above which ``auto`` picks a cylinder projection ...-CYLINDER_ASPECT = 2.5-#: ... provided the cross-section is roughly round (mid/min below this); slabs → box-CYLINDER_SECTION = 2.0-#: |n · axis| above which a face is a cylinder cap (planar projected)-CAP_COS = 0.75---@dataclass-class Unwrapped:- vertices: np.ndarray # (N', 3) LOCAL coordinates (possibly split)- faces: np.ndarray # (F, 3)- normals: np.ndarray | None # (N', 3) local normals or None- uv: np.ndarray # (N', 2)- projection: str # box | cylinder | planar_y | planar_z- axis: int # projection axis (cylinder axis / planar normal axis)- n_split: int # vertices added by seam splitting---def choose_projection(extents_world: np.ndarray, requested: str) -> tuple[str, int]:- """Resolve ``auto`` → (projection, axis). Elongated with a round-ish section →- cylinder around the long axis; everything else (slabs, boxes, frames) → box. Explicit projections pass through (cylinder axis =- the longest world axis; planar axes are fixed: planar_y → 1, planar_z → 2)."""- e = np.asarray(extents_world, dtype=float)- order = np.argsort(e)[::-1]- long_axis = int(order[0])- if requested == "cylinder":- return "cylinder", long_axis- if requested == "planar_y":- return "planar_y", 1- if requested == "planar_z":- return "planar_z", 2- if requested == "box":- return "box", int(np.argmin(e))- mid = max(float(e[order[1]]), 1e-9)- small = max(float(e[order[2]]), 1e-9)- if float(e[order[0]]) / mid >= CYLINDER_ASPECT and mid / small <= CYLINDER_SECTION:- return "cylinder", long_axis- return "box", int(np.argmin(e))---def _face_normals(P: np.ndarray, F: np.ndarray) -> np.ndarray:- a, b, c = P[F[:, 0]], P[F[:, 1]], P[F[:, 2]]- n = np.cross(b - a, c - a)- ln = np.linalg.norm(n, axis=1, keepdims=True)- return n / np.maximum(ln, 1e-12)---def _box_uv(P: np.ndarray, F: np.ndarray, tile: float) -> tuple[np.ndarray, np.ndarray]:- """Per-face dominant axis of the face normal → planar projection on the other two."""- n = _face_normals(P, F)- axis = np.argmax(np.abs(n), axis=1) # (F,)- sign = np.sign(n[np.arange(len(F)), axis])- sign[sign == 0] = 1.0- other = np.array([[2, 1], [0, 2], [0, 1]]) # axis → (u axis, v axis)- corners = P[F] # (F,3,3)- ua, va = other[axis, 0], other[axis, 1]- u = np.take_along_axis(corners, ua[:, None, None].repeat(3, 1), axis=2)[:, :, 0]- v = np.take_along_axis(corners, va[:, None, None].repeat(3, 1), axis=2)[:, :, 0]- u = u * sign[:, None] # keep handedness consistent on opposite faces- uv = np.stack([u, v], axis=2) / tile- key = axis[:, None].repeat(3, 1) * 2 + (sign[:, None].repeat(3, 1) < 0).astype(int)- return uv, key---def _planar_uv(P: np.ndarray, F: np.ndarray, axis: int, tile: float) -> tuple[np.ndarray, np.ndarray]:- other = {0: (2, 1), 1: (0, 2), 2: (0, 1)}[axis]- corners = P[F]- uv = np.stack([corners[:, :, other[0]], corners[:, :, other[1]]], axis=2) / tile- return uv, np.zeros((len(F), 3), dtype=int)---def _cylinder_uv(P: np.ndarray, F: np.ndarray, axis: int, tile: float) -> tuple[np.ndarray, np.ndarray]:- a, b = [i for i in range(3) if i != axis]- center = 0.5 * (P.min(axis=0) + P.max(axis=0))- d = P - center- radius = float(np.mean(np.hypot(d[:, a], d[:, b])))- radius = max(radius, 1e-4)- circ = 2.0 * np.pi * radius- ang = np.arctan2(d[:, b], d[:, a]) # (-π, π]- u_v = (ang + np.pi) / (2.0 * np.pi) * circ / tile # 0..circ/tile- v_v = P[:, axis] / tile- u = u_v[F] # (F,3)- v = v_v[F]- key = np.zeros((len(F), 3), dtype=int)- # seam: faces straddling angle ±π have a u spread > half circumference → shift the low corners- span = u.max(axis=1) - u.min(axis=1)- wrap = span > 0.5 * circ / tile- if wrap.any():- low = u < (u.max(axis=1, keepdims=True) - 0.5 * circ / tile)- shift = wrap[:, None] & low- u = u + shift * (circ / tile)- key = key + shift.astype(int)- # caps: planar- n = _face_normals(P, F)- cap = np.abs(n[:, axis]) > CAP_COS- if cap.any():- corners = P[F]- u = np.where(cap[:, None], corners[:, :, a] / tile, u)- v = np.where(cap[:, None], corners[:, :, b] / tile, v)- key = np.where(cap[:, None], 2, key)- return np.stack([u, v], axis=2), key---def split_by_key(- vertices: np.ndarray, faces: np.ndarray, normals: np.ndarray | None, uv_corner: np.ndarray, key_corner: np.ndarray-) -> tuple[np.ndarray, np.ndarray, np.ndarray | None, np.ndarray, int]:- """Duplicate a vertex once per distinct (vertex, key) pair; UV per new vertex =- mean of its corner UVs (they agree within a key by construction)."""- F = faces- flat_v = F.reshape(-1)- flat_k = key_corner.reshape(-1)- pair = flat_v.astype(np.int64) * (int(flat_k.max()) + 1 if flat_k.size else 1) + flat_k- uniq, inverse = np.unique(pair, return_inverse=True)- n_new = len(uniq)- src = np.zeros(n_new, dtype=np.int64)- src[inverse] = flat_v- new_vertices = vertices[src]- new_normals = normals[src] if normals is not None else None- new_uv = np.zeros((n_new, 2), dtype=np.float64)- counts = np.zeros(n_new, dtype=np.float64)- np.add.at(new_uv, inverse, uv_corner.reshape(-1, 2))- np.add.at(counts, inverse, 1.0)- new_uv /= np.maximum(counts, 1.0)[:, None]- new_faces = inverse.reshape(-1, 3)- return new_vertices, new_faces, new_normals, new_uv, int(n_new - len(vertices))---def unwrap(- vertices_local: np.ndarray,- faces: np.ndarray,- transform: np.ndarray,- *,- projection: str = "auto",- tile_size_m: float = 0.3,- normals_local: np.ndarray | None = None,-) -> Unwrapped:- """Compute UVs for one mesh given its 4×4 world ``transform``. Returns the- (possibly vertex-split) mesh in LOCAL coordinates plus per-vertex UVs."""- V = np.asarray(vertices_local, dtype=np.float64)- F = np.asarray(faces, dtype=np.int64)- if V.ndim != 2 or V.shape[1] != 3 or F.ndim != 2 or F.shape[1] != 3 or len(F) == 0:- raise ValueError("unwrap needs (N,3) vertices and (F,3) triangles")- tile = float(tile_size_m)- if not tile > 0:- raise ValueError("tile_size_m must be > 0")- T = np.asarray(transform, dtype=np.float64)- P = V @ T[:3, :3].T + T[:3, 3]- ext = P.max(axis=0) - P.min(axis=0)- proj, axis = choose_projection(ext, projection)- if proj == "box":- uv_c, key_c = _box_uv(P, F, tile)- elif proj == "cylinder":- uv_c, key_c = _cylinder_uv(P, F, axis, tile)- else:- uv_c, key_c = _planar_uv(P, F, axis, tile)- nv, nf, nn, uv, n_split = split_by_key(V, F, normals_local, uv_c, key_c)- # keep numbers small for float32 TEXCOORD precision (pattern is periodic anyway)- uv = uv - np.floor(uv.min(axis=0))- return Unwrapped(vertices=nv, faces=nf, normals=nn, uv=uv, projection=proj, axis=axis, n_split=n_split)---# ===================================================================== apply-log = logging.getLogger(__name__)---class ApplyReport(BaseModel):- glb_out: str- parts_textured: list[str] = Field(default_factory=list)- parts_skipped: list[str] = Field(default_factory=list)- parts_unmatched: list[str] = Field(default_factory=list, description="scene nodes with no plan part")- projections: dict[str, str] = Field(default_factory=dict, description="node → projection used")- n_materials: int = 0- n_derived_maps: int = 0- n_split_vertices: int = 0- warnings: list[str] = Field(default_factory=list)- duration_ms: int = 0---def node_part_lookup(node_names: list[str], plan_parts: dict[str, TexturePart]) -> dict[str, TexturePart | None]:- """Map scene node names to plan parts by :func:`conventions.part_key`."""- return {n: plan_parts[k] if (k := part_key(n, plan_parts)) else None for n in node_names}---def _material(part: TexturePart, image: Image.Image) -> trimesh.visual.material.PBRMaterial:- """PBR material for one texture id.-- Beyond the albedo the material carries two maps DERIVED from that albedo (a flat- image gets none): a metallic/roughness texture so the grain also modulates the- specular lobe, and a normal map so it catches light in relief. They cost no extra- image call and cannot disagree with the colour.- """- tint = part.tint_rgb or (1.0, 1.0, 1.0)- factor = [int(round(255 * float(c))) for c in tint] + [255]- fine = COARSE_TO_FINE.get(part.material_family, part.material_family)- extra: dict[str, Any] = {}- if not is_flat(image):- extra["metallicRoughnessTexture"] = metallic_roughness_image(- image, float(part.roughness), float(part.metallic), fine)- extra["normalTexture"] = normal_image(image, fine)- return trimesh.visual.material.PBRMaterial(- name=part.texture_id,- baseColorTexture=image,- baseColorFactor=factor,- metallicFactor=float(part.metallic),- roughnessFactor=float(part.roughness),- doubleSided=False,- **extra,- )---def _node_transform(scene: trimesh.Scene, node: str) -> np.ndarray:- T, _ = scene.graph.get(node)- return np.asarray(T, dtype=np.float64)---def apply_textures(- glb_in: Path | str,- texture_plan: TexturePlan,- textures: dict[str, Path | str],- glb_out: Path | str,-) -> ApplyReport:- """Write ``glb_out`` = ``glb_in`` with textured PBR materials on the planned parts.- ``textures`` maps texture_id → PNG path (missing ids leave those parts untextured)."""- t0 = time.time()- glb_in, glb_out = Path(glb_in), Path(glb_out)- scene = load_scene(glb_in)- rep = ApplyReport(glb_out=str(glb_out))- parts = texture_plan.by_part()- nodes = list(scene.graph.nodes_geometry)- lookup = node_part_lookup(nodes, parts)- images: dict[str, Image.Image] = {}- for tid, p in textures.items():- p = Path(p)- if p.is_file():- images[tid] = Image.open(p).convert("RGB")- else:- rep.warnings.append(f"texture file missing for {tid}: {p.name}")- materials: dict[tuple[str, float, float, tuple[float, ...] | None], trimesh.visual.material.PBRMaterial] = {}- geom_proj: dict[str, str] = {}- for node in nodes:- part = lookup.get(node)- if part is None:- rep.parts_unmatched.append(node)- continue- if part.skip:- rep.parts_skipped.append(node)- continue- img = images.get(part.texture_id)- if img is None:- rep.parts_skipped.append(node)- rep.warnings.append(f"{node}: no image for texture {part.texture_id}")- continue- _, geom_name = scene.graph.get(node)- if geom_name is None:- continue- if geom_name in geom_proj: # instance sharing an already-unwrapped geometry- rep.parts_textured.append(node)- rep.projections[node] = geom_proj[geom_name]- continue- geom = scene.geometry.get(geom_name)- if not isinstance(geom, trimesh.Trimesh) or len(geom.faces) == 0:- rep.parts_unmatched.append(node)- continue- try:- uw = unwrap(geom.vertices, geom.faces, _node_transform(scene, node), projection=part.projection,- tile_size_m=part.tile_size_m, normals_local=np.asarray(geom.vertex_normals))- except ValueError as e:- rep.warnings.append(f"{node}: unwrap failed: {e}")- rep.parts_skipped.append(node)- continue- mkey = (part.texture_id, float(part.roughness), float(part.metallic), part.tint_rgb)- mat = materials.get(mkey)- if mat is None:- mat = materials[mkey] = _material(part, img)- mesh = trimesh.Trimesh(vertices=uw.vertices, faces=uw.faces, vertex_normals=uw.normals, process=False)- mesh.visual = trimesh.visual.TextureVisuals(uv=uw.uv, material=mat)- mesh.metadata = dict(geom.metadata or {})- scene.geometry[geom_name] = mesh- geom_proj[geom_name] = uw.projection- rep.parts_textured.append(node)- rep.projections[node] = uw.projection- rep.n_split_vertices += uw.n_split- rep.n_materials = len(materials)- rep.n_derived_maps = sum(1 for m in materials.values() if getattr(m, "normalTexture", None) is not None)- glb_out.parent.mkdir(parents=True, exist_ok=True)- scene.export(glb_out)- rep.warnings.extend(verify_textured_glb(glb_in, glb_out, expected_textured=len(rep.parts_textured)))- rep.duration_ms = int((time.time() - t0) * 1000)- return rep---def verify_textured_glb(glb_in: Path, glb_out: Path, *, expected_textured: int) -> list[str]:- """Reload and compare: same node-name set, textures present. Returns warnings- (empty = ok); raises ``GlbLoadError`` when the output does not load at all."""- warnings: list[str] = []- try:- a = load_scene(glb_in)- b = load_scene(glb_out)- except GlbLoadError as e:- raise GlbLoadError(f"textured GLB verification failed: {e}") from e- na, nb = set(a.graph.nodes_geometry), set(b.graph.nodes_geometry)- if na != nb:- warnings.append(f"node set changed: missing={sorted(na - nb)[:5]} extra={sorted(nb - na)[:5]}")- n_tex = sum(- 1 for g in b.geometry.values()- if isinstance(g.visual, trimesh.visual.TextureVisuals) and getattr(g.visual.material, "baseColorTexture", None) is not None- )- if expected_textured and n_tex == 0:- warnings.append("no textured geometry found after reload")- fa = sum(len(g.faces) for g in a.geometry.values() if isinstance(g, trimesh.Trimesh))- fb = sum(len(g.faces) for g in b.geometry.values() if isinstance(g, trimesh.Trimesh))- if fa != fb:- warnings.append(f"face count changed {fa} → {fb}")- return warnings---# ===================================================================== normalise---class MaterialChange(BaseModel):- node: str- material: str = ""- family: str- keyword: str = ""- reason: str # untouched | impossible- metallic: tuple[float, float] # before, after- roughness: tuple[float, float]---class NormaliseReport(BaseModel):- glb_out: str = ""- changes: list[MaterialChange] = Field(default_factory=list)- n_materials: int = 0- n_unchanged: int = 0- n_unresolved: int = 0- warnings: list[str] = Field(default_factory=list)- duration_ms: int = 0-- def changed(self) -> bool:- return bool(self.changes)-- def table(self) -> str:- if not self.changes:- return "no material needed normalising"- rows = [f"{'node':22} {'family':15} {'why':11} metallic roughness"]- for c in self.changes:- rows.append(f"{c.node[:22]:22} {c.family:15} {c.reason:11} "- f"{c.metallic[0]:.2f}→{c.metallic[1]:.2f} {c.roughness[0]:.2f}→{c.roughness[1]:.2f}")- return "\n".join(rows)---def _plan_materials(plan: StaticPlan | None) -> dict[str, str]:- """snake(part name) → the plan's ``material`` string for that part."""- if plan is None:- return {}- return {to_snake(p.name): (p.material or p.description or "") for p in plan.parts}---def _factors(mat: object) -> tuple[float | None, float | None]:- m = getattr(mat, "metallicFactor", None)- r = getattr(mat, "roughnessFactor", None)- return (None if m is None else float(m)), (None if r is None else float(r))---def _base_rgb(mat: object) -> tuple[float, float, float] | None:- """``baseColorFactor`` as 0..1 RGB (trimesh stores it as 0-255 RGBA)."""- f = getattr(mat, "baseColorFactor", None)- if f is None or len(f) < 3:- return None- vals = [float(c) for c in f[:3]]- scale = 255.0 if max(vals) > 1.0 else 1.0- return (vals[0] / scale, vals[1] / scale, vals[2] / scale)---def _has_texture(mat: object) -> bool:- return any(getattr(mat, k, None) is not None- for k in ("baseColorTexture", "metallicRoughnessTexture", "normalTexture"))---class Verdict(NamedTuple):- family: str- reason: str # untouched | impossible- keyword: str- metallic: float- roughness: float---def _clamp(v: float, lo: float, hi: float) -> float:- return round(min(hi, max(lo, v)), 3)---def _evidence(material_name: str, node: str, plan_text: str) -> tuple[FamilyMatch | None, str]:- """Best family match and WHERE it came from (``material`` > ``node`` > ``plan``)."""- for tier, text in (("material", material_name), ("node", node), ("plan", plan_text)):- hit = family_for(text)- if hit is not None:- return hit, tier- return None, ""---def classify(- node: str, material_name: str, plan_text: str, metallic: float | None, roughness: float | None,- base_rgb: tuple[float, float, float] | None = None,-) -> Verdict | None:- """What (if anything) to do with one material.-- ``untouched`` snaps to the family's canonical numbers; ``impossible`` only- *clamps* the offending factor to the nearest edge of the family's plausible- band, so an author's deliberate-but-extreme choice survives as far as physics- allows. ``None`` = leave it exactly as it is."""- hit, tier = _evidence(material_name, node, plan_text)- if hit is None:- return None- family = hit.family- if looks_painted(family, base_rgb):- # a saturated colour on a "cast iron" part means paint over the iron- family = "painted_wood" if family == "cast_iron" and (base_rgb or (0, 0, 0))[1] > 0.5 else "painted_metal"- target = pbr_for(family)- if target is None:- return None- if is_framework_default(metallic, roughness):- return Verdict(target.family, "untouched", hit.keyword, target.metallic, target.roughness)- if tier == "plan":- # the plan's prose covers a whole part, not one material: it is good enough to- # spot a never-configured default, never good enough to overrule real numbers- return None- bad = out_of_band(target, metallic, roughness)- if not bad:- return None- m = 1.0 if metallic is None else float(metallic)- r = 1.0 if roughness is None else float(roughness)- return Verdict(- target.family, "impossible", hit.keyword,- _clamp(m, *target.metallic_band) if "metallic" in bad else m,- _clamp(r, *target.roughness_band) if "roughness" in bad else r,- )---def normalise_materials(- glb_in: Path | str, glb_out: Path | str, *, plan: StaticPlan | None = None-) -> NormaliseReport:- """Rewrite the flat-default / impossible materials of ``glb_in`` into ``glb_out``.-- Geometry, node names, UVs and base colours are untouched; only- ``metallicFactor`` / ``roughnessFactor`` move. When nothing needs changing the- output is not written and ``report.glb_out`` stays empty.- """- t0 = time.time()- glb_in, glb_out = Path(glb_in), Path(glb_out)- scene = load_scene(glb_in)- rep = NormaliseReport()- plan_mats = _plan_materials(plan)- seen: dict[int, tuple[float, float] | None] = {}- for node in scene.graph.nodes_geometry:- _, geom_name = scene.graph.get(node)- geom = scene.geometry.get(geom_name) if geom_name else None- mat = getattr(getattr(geom, "visual", None), "material", None)- if mat is None:- rep.n_unresolved += 1- continue- if id(mat) in seen: # a material shared by several nodes is normalised once- continue- rep.n_materials += 1- if _has_texture(mat):- rep.n_unchanged += 1- seen[id(mat)] = None- continue- metallic, roughness = _factors(mat)- key = part_key(node, plan_mats)- plan_text = plan_mats[key] if key else ""- verdict = classify(node, str(getattr(mat, "name", "") or ""), plan_text, metallic, roughness,- _base_rgb(mat))- if verdict is None:- rep.n_unchanged += 1- seen[id(mat)] = None- continue- before = (1.0 if metallic is None else metallic, 1.0 if roughness is None else roughness)- mat.metallicFactor = float(verdict.metallic)- mat.roughnessFactor = float(verdict.roughness)- seen[id(mat)] = (verdict.metallic, verdict.roughness)- rep.changes.append(MaterialChange(- node=node, material=str(getattr(mat, "name", "") or ""), family=verdict.family,- keyword=verdict.keyword, reason=verdict.reason,- metallic=(round(before[0], 3), verdict.metallic), roughness=(round(before[1], 3), verdict.roughness),- ))- if rep.changes:- glb_out.parent.mkdir(parents=True, exist_ok=True)- scene.export(glb_out)- rep.glb_out = str(glb_out)- rep.warnings.extend(_verify(glb_in, glb_out))- rep.duration_ms = int((time.time() - t0) * 1000)- return rep---def _verify(glb_in: Path, glb_out: Path) -> list[str]:- """Same nodes, same triangles — this pass may only move two floats per material."""- return verify_textured_glb(glb_in, glb_out, expected_textured=0)diff --git a/harness/codeverse3d/texturing/generate.py b/harness/codeverse3d/texturing/generate.pydeleted file mode 100644index 4be0c2a3..00000000--- a/harness/codeverse3d/texturing/generate.py+++ /dev/null@@ -1,368 +0,0 @@-"""Tileability: seam scoring, mirror-blend seam fixing, resizing and saving.--* ``seam_score(img)``: mean absolute difference (0..1) between the left/right and- top/bottom wrap edges, normalised by the image's own local contrast so a noisy- texture is not penalised for being noisy. ≈0 = perfect wrap.-* ``make_tileable(img, border_frac)``: cross-fades each edge band with the mirrored- opposite band (a smoothstep ramp over ``border_frac`` of the width) so the wrap- seam disappears; content in the middle is untouched.-* ``fit_size`` / ``save_texture``: power-of-two downscale + PNG or JPEG q90.-"""--from __future__ import annotations--import hashlib-import logging-import shutil-import time-from collections.abc import Callable, Sequence-from pathlib import Path-from typing import Any--import numpy as np-from PIL import Image-from pydantic import BaseModel, Field--from codeverse3d.config import get_settings-from codeverse3d.contracts.artifacts import Judgment, Measurement, RenderSet-from codeverse3d.contracts.common import Usage-from codeverse3d.contracts.plan import AcceptanceItem, StaticPlan-from codeverse3d.contracts.spec import Spec-from codeverse3d.conventions import OBJECT_VIEWS_QUICK, ViewPreset-from codeverse3d.judges.base import JudgeInput, plan_summary-from codeverse3d.judges.rubrics import load_rubric-from codeverse3d.proc import fan_out, unique_tmp--#: seam score above which a texture is considered NOT tileable (after make_tileable)-SEAM_MAX = 0.08---def _arr(img: Image.Image) -> np.ndarray:- return np.asarray(img.convert("RGB"), dtype=np.float32) / 255.0---def seam_score(img: Image.Image | np.ndarray) -> float:- """Mean |Δ| across the wrap seams relative to the mean |Δ| between neighbouring- pixel columns/rows inside the image (so 1.0 ≈ 'the seam is as strong as the- texture's own detail'); clamped to [0, 1]."""- a = _arr(img) if isinstance(img, Image.Image) else np.asarray(img, dtype=np.float32)- if a.ndim == 2:- a = a[:, :, None]- h, w = a.shape[:2]- if h < 4 or w < 4:- return 0.0- seam_lr = np.abs(a[:, 0, :] - a[:, -1, :]).mean()- seam_tb = np.abs(a[0, :, :] - a[-1, :, :]).mean()- # typical one-step difference inside the image (excluding the seam)- inner_lr = np.abs(a[:, 1:, :] - a[:, :-1, :]).mean()- inner_tb = np.abs(a[1:, :, :] - a[:-1, :, :]).mean()- # a seam is bad when it exceeds the local detail noticeably; blend absolute + relative- rel = 0.5 * (seam_lr / max(inner_lr, 1e-3) + seam_tb / max(inner_tb, 1e-3))- absolute = 0.5 * (seam_lr + seam_tb)- score = 0.5 * absolute + 0.5 * min(1.0, max(0.0, (rel - 1.0) / 8.0))- return float(min(1.0, max(0.0, score)))---def _ramp(n: int) -> np.ndarray:- t = (np.arange(n, dtype=np.float32) + 0.5) / n- return t * t * (3.0 - 2.0 * t) # smoothstep 0 → 1---def make_tileable(img: Image.Image, border_frac: float = 0.12) -> Image.Image:- """Mirror-blend the wrap seams. Along X: the left band is cross-faded with the- mirrored right band and vice versa (weights symmetric so the wrap is exact);- then the same along Y. ``border_frac`` ∈ [0.05, 0.3] of the size."""- border_frac = float(min(0.3, max(0.05, border_frac)))- a = _arr(img)- h, w = a.shape[:2]- bw, bh = max(2, int(round(w * border_frac))), max(2, int(round(h * border_frac)))- out = a.copy()- # horizontal: blend left band with mirrored right band- r = _ramp(bw)[None, :, None] # 0 at the outer edge → 1 inside- left, right = a[:, :bw, :], a[:, w - bw:, :]- mir_right = right[:, ::-1, :] # right band mirrored so its outer edge meets the left edge- mir_left = left[:, ::-1, :]- out[:, :bw, :] = left * (0.5 + 0.5 * r) + mir_right * (0.5 - 0.5 * r)- out[:, w - bw:, :] = right * (0.5 + 0.5 * r[:, ::-1, :]) + mir_left * (0.5 - 0.5 * r[:, ::-1, :])- a = out.copy()- r = _ramp(bh)[:, None, None]- top, bottom = a[:bh, :, :], a[h - bh:, :, :]- mir_bottom, mir_top = bottom[::-1, :, :], top[::-1, :, :]- out[:bh, :, :] = top * (0.5 + 0.5 * r) + mir_bottom * (0.5 - 0.5 * r)- out[h - bh:, :, :] = bottom * (0.5 + 0.5 * r[::-1, :, :]) + mir_top * (0.5 - 0.5 * r[::-1, :, :])- return Image.fromarray((np.clip(out, 0.0, 1.0) * 255.0 + 0.5).astype(np.uint8), "RGB")---def fit_size(img: Image.Image, size: int) -> Image.Image:- """Square, power-of-two-ish downscale to ``size`` (never upscales)."""- w, h = img.size- if w != h:- s = min(w, h)- img = img.crop(((w - s) // 2, (h - s) // 2, (w - s) // 2 + s, (h - s) // 2 + s))- if img.size[0] > size:- img = img.resize((size, size), Image.LANCZOS)- return img.convert("RGB")---def save_texture(img: Image.Image, path: Path, *, fmt: str | None = None, quality: int = 90) -> Path:- path = Path(path)- path.parent.mkdir(parents=True, exist_ok=True)- fmt = (fmt or ("JPEG" if path.suffix.lower() in (".jpg", ".jpeg") else "PNG")).upper()- if fmt == "JPEG":- img.convert("RGB").save(path, "JPEG", quality=quality, optimize=True)- else:- img.convert("RGB").save(path, "PNG", optimize=True)- return path---# ===================================================================== generate-log = logging.getLogger(__name__)--#: bump when the cached raw image semantics change (prompt composition, model config)-CACHE_VERSION = 2 # v2: seed joined the key---class TextureAsset(BaseModel):- texture_id: str- path: str- prompt: str- prompt_hash: str- seam_score: float = 0.0- seam_score_raw: float = 0.0- size: int = 1024- cached: bool = False- model: str = ""- usage: Usage = Field(default_factory=Usage)- error: str = ""-- @property- def ok(self) -> bool:- return not self.error and Path(self.path).is_file()---class TextureSet(BaseModel):- textures: dict[str, TextureAsset] = Field(default_factory=dict)- usage: Usage = Field(default_factory=Usage)- duration_s: float = 0.0-- def paths(self) -> dict[str, Path]:- return {k: Path(v.path) for k, v in self.textures.items() if v.ok}-- def failed(self) -> dict[str, str]:- return {k: v.error for k, v in self.textures.items() if v.error}---def prompt_key(prompt: str, model_id: str, size: int, seed: int | None = 0) -> str:- # seed is in the key: seed=2 must not be served seed=1's cached pixels- return hashlib.sha256(f"v{CACHE_VERSION}|{model_id}|{size}|{seed}|{prompt.strip()}".encode()).hexdigest()[:24]---# --------------------------------------------------------------------------- generation-def _cache_dir(cache_dir: Path | None) -> Path:- d = (cache_dir or get_settings().cache_dir) / "textures"- d.mkdir(parents=True, exist_ok=True)- return d---def generate_one(- texture_id: str, prompt: str, out_dir: Path, image_model: Any, *, size: int = 1024, cache_dir: Path | None = None,- use_cache: bool = True, seed: int | None = 0,-) -> TextureAsset:- """Generate (or fetch from cache) one texture and deliver ``out_dir/<texture_id>.png``."""- model_id = getattr(image_model, "id", getattr(image_model, "model", "image"))- key = prompt_key(prompt, str(model_id), size, seed)- raw_path = _cache_dir(cache_dir) / f"{key}.png"- asset = TextureAsset(texture_id=texture_id, path=str(Path(out_dir) / f"{texture_id}.png"), prompt=prompt,- prompt_hash=key, size=size, model=str(model_id))- t0 = time.time()- if use_cache and raw_path.is_file():- raw = Image.open(raw_path).convert("RGB")- asset.cached = True- else:- images, usage = image_model.generate_with_usage(prompt, size=size, n=1, seed=seed)- if not images:- raise RuntimeError(f"image model returned no image for {texture_id}")- raw = images[0].convert("RGB")- asset.usage = usage- if use_cache:- # per-writer tmp (pid AND thread — candidates fan out over threads in ONE- # process, so a pid-only name is still a race: review of PR #3); tolerant- # replace like every other cache publish- tmp = unique_tmp(raw_path)- try:- raw.save(tmp, "PNG")- tmp.replace(raw_path)- finally:- tmp.unlink(missing_ok=True)- asset.seam_score_raw = seam_score(raw)- img = make_tileable(fit_size(raw, size))- asset.seam_score = seam_score(img)- save_texture(img, Path(asset.path))- asset.usage.latency_ms = asset.usage.latency_ms or int((time.time() - t0) * 1000)- return asset---def generate_textures(- prompts: dict[str, str] | Any,- out_dir: Path,- image_model: Any,- *,- size: int = 1024,- cache_dir: Path | None = None,- max_workers: int = 6,- use_cache: bool = True,- seed: int = 0,-) -> TextureSet:- """``prompts`` is ``{texture_id: prompt}`` or a ``TexturePlan`` (its ``.prompts()``).- Identical prompts are generated once and copied to every id. Failures are- recorded per texture (``TextureAsset.error``) — callers decide what to do."""- if hasattr(prompts, "prompts"):- prompts = prompts.prompts()- prompts = {str(k): str(v) for k, v in dict(prompts).items() if str(v).strip()}- out_dir = Path(out_dir)- out_dir.mkdir(parents=True, exist_ok=True)- t0 = time.time()- result = TextureSet()- if not prompts:- return result- # dedupe identical prompts → one generation, copies for the rest- leaders: dict[str, str] = {}- copies: dict[str, list[str]] = {}- for tid, pr in prompts.items():- k = pr.strip()- if k in leaders:- copies.setdefault(leaders[k], []).append(tid)- else:- leaders[k] = tid-- def _job(tid: str) -> TextureAsset:- try:- return generate_one(tid, prompts[tid], out_dir, image_model, size=size, cache_dir=cache_dir,- use_cache=use_cache, seed=seed)- except Exception as e: # noqa: BLE001 — per-texture failure is data, not a crash- log.warning("texture %s failed: %s: %s", tid, type(e).__name__, e)- return TextureAsset(texture_id=tid, path=str(out_dir / f"{tid}.png"), prompt=prompts[tid],- prompt_hash=prompt_key(prompts[tid], str(getattr(image_model, "id", "")), size, seed),- size=size, error=f"{type(e).__name__}: {e}")-- ids = list(leaders.values())- # fan_out, not a bare pool: its workers inherit the caller's context, so the image- # model's spend is billed to the run's ledger instead of the per-process log- # (codeverse3d.cost.context). ``_job`` swallows its own failures, so nothing here- # comes back as an Exception.- assets = [a for a in fan_out(ids, _job, max_workers=max_workers, label="texture", item_name=str)- if isinstance(a, TextureAsset)]- for a in assets:- result.textures[a.texture_id] = a- result.usage = result.usage + a.usage- for other in copies.get(a.texture_id, []):- dup = a.model_copy(update={"texture_id": other, "path": str(out_dir / f"{other}.png"), "usage": Usage(),- "cached": True})- if a.ok:- shutil.copy2(a.path, dup.path)- result.textures[other] = dup- result.duration_s = round(time.time() - t0, 2)- return result---# ===================================================================== gate--MIN_OVERALL_DELTA = -0.01-MIN_MATERIALS_DELTA = 0.0---class SeamGateResult(BaseModel):- passed: dict[str, float] = Field(default_factory=dict, description="texture_id → seam score (kept)")- failed: dict[str, float] = Field(default_factory=dict, description="texture_id → seam score (dropped)")- threshold: float = SEAM_MAX---def seam_gate(textures: dict[str, TextureAsset], *, max_seam: float = SEAM_MAX) -> SeamGateResult:- res = SeamGateResult(threshold=max_seam)- for tid, a in textures.items():- if not a.ok:- continue- (res.passed if a.seam_score <= max_seam else res.failed)[tid] = round(float(a.seam_score), 4)- return res---class GateResult(BaseModel):- shipped: bool- reason: str = ""- overall_before: float | None = None- overall_after: float | None = None- delta: float | None = None- materials_criterion: str = ""- materials_before: float | None = None- materials_after: float | None = None- materials_delta: float | None = None- renders_before: RenderSet | None = None- renders_after: RenderSet | None = None- judgment_before: Judgment | None = None- judgment_after: Judgment | None = None- usage: Usage = Field(default_factory=Usage)- duration_s: float = 0.0---def judge_gate(- spec: Spec,- plan: StaticPlan | None,- glb_before: Path,- glb_after: Path,- out_dir: Path,- *,- judge: Any,- measurement: Measurement | None = None,- views: Sequence[ViewPreset] = OBJECT_VIEWS_QUICK,- render: Callable[..., RenderSet] | None = None,- size: int = 512,- min_overall_delta: float = MIN_OVERALL_DELTA,- min_materials_delta: float = MIN_MATERIALS_DELTA,-) -> GateResult:- """Render + judge both GLBs; decide. ``judge`` is any object with- ``.judge(JudgeInput) -> Judgment`` (``VlmJudge`` or a fake)."""- t0 = time.time()- if render is None:- from codeverse3d.spatial.render import render_glb-- render = render_glb- out_dir = Path(out_dir)- rs_before = render(glb_before, out_dir / "before", views=list(views), width=size, height=size)- rs_after = render(glb_after, out_dir / "after", views=list(views), width=size, height=size)- acceptance: list[AcceptanceItem] = list(getattr(plan, "acceptance", []) or [])- summary = plan_summary(plan, spec.language)- res = GateResult(shipped=False, renders_before=rs_before, renders_after=rs_after)- jb = judge.judge(JudgeInput(spec=spec, renders=rs_before, measurement=measurement, acceptance=acceptance,- plan_summary=summary, round_index=0,- extra_context="Texture gate: BEFORE texturing (flat materials)."))- ja = judge.judge(JudgeInput(spec=spec, renders=rs_after, measurement=measurement, acceptance=acceptance,- plan_summary=summary, round_index=0,- extra_context="Texture gate: AFTER texturing (image textures applied)."))- res.judgment_before, res.judgment_after = jb, ja- res.usage = jb.usage + ja.usage- res.duration_s = round(time.time() - t0, 2)- if jb.degraded or ja.degraded:- res.reason = "judge degraded on one side — not shipped"- return res- res.overall_before, res.overall_after = float(jb.overall), float(ja.overall)- res.delta = round(res.overall_after - res.overall_before, 4)- crit = load_rubric(ja.rubric).materials_criterion # "" (articulated): Δoverall alone decides- res.materials_criterion = crit- if crit:- res.materials_before = float(jb.scores.get(crit, 0.0))- res.materials_after = float(ja.scores.get(crit, 0.0))- res.materials_delta = round(res.materials_after - res.materials_before, 4)- ok_overall = res.delta >= min_overall_delta- ok_mat = (res.materials_delta is None) or (res.materials_delta > min_materials_delta)- res.shipped = bool(ok_overall and ok_mat)- if res.shipped:- res.reason = f"Δoverall {res.delta:+.3f} ≥ {min_overall_delta:+.2f} and {crit or 'overall'} {res.materials_delta:+.3f}" if crit \- else f"Δoverall {res.delta:+.3f} ≥ {min_overall_delta:+.2f}"- else:- why = []- if not ok_overall:- why.append(f"Δoverall {res.delta:+.3f} < {min_overall_delta:+.2f}")- if not ok_mat:- why.append(f"{crit} {res.materials_delta:+.3f} did not improve")- res.reason = "; ".join(why)- return resdiff --git a/harness/codeverse3d/texturing/materials.py b/harness/codeverse3d/texturing/materials.pyindex 3666972b..19df4b21 100644--- a/harness/codeverse3d/texturing/materials.py+++ b/harness/codeverse3d/texturing/materials.py@@ -15,14 +15,8 @@ almost always one of two sentences:The numbers below are the ones a materials artist would type — measureddielectric IORs, the metallic/roughness pairs the glTF and Disney/Substanceguides publish, and the clear-coat that separates lacquered wood from raw-timber. They are used two ways:--1. as the target of the **post-build normaliser**- (:mod:`codeverse3d.texturing.apply`), which fixes a material whose numbers- are an untouched framework default or are impossible for the finish its own- name claims;-2. as the PBR factors the **texture pass** writes next to a generated albedo- (:mod:`codeverse3d.texturing.apply`).+timber. ``languages/blender`` reads them (``family_for`` / ``pbr_for``) to give a+part whose name or material names a finish its PBR factors.Everything here is data + pure functions; nothing imports a model or touches a file."""@@ -35,18 +29,6 @@ from pydantic import BaseModel, Fieldfrom codeverse3d.conventions import to_snake-#: glTF/Blender/three framework defaults, and the factors the harness's own writers put-#: on a material nobody authored. A material sitting exactly on one of these pairs was-#: never authored — see ``is_framework_default``. The two harness rows are pinned to their-#: writers by ``tests/texturing/test_normalise.py``.-FRAMEWORK_DEFAULTS: tuple[tuple[float, float], ...] = (- (1.0, 1.0), # glTF 2.0 material default (metallic 1, roughness 1) — renders as dark mud- (0.0, 1.0), # three.js MeshStandardMaterial default- (0.0, 0.5), # Blender Principled BSDF default- (0.0, 0.6), # languages/wrappers/run_cq.py: every CadQuery part's exported material- (0.05, 0.6), # the three.js part stub's placeholder before D107 (runs recorded before it carry it)-)-class Pbr(BaseModel):"""One material family's physically-plausible factors.@@ -86,7 +68,7 @@ def _m(roughness_band=rband, metallic_band=mband, note=note)-#: family -> factors (the texture pass's normaliser bands). Metals, woods, polymers, rest.+#: family -> PBR factors (with the plausible bands each value may take). Metals, woods, polymers, rest.MATERIALS: dict[str, Pbr] = {"painted_metal": _m("painted_metal", 0.0, 0.35, clearcoat=0.35, ccr=0.10, base=(0.30, 0.32, 0.36),rband=(0.08, 0.7), mband=(0.0, 0.35),@@ -207,8 +189,7 @@ _FINISH_ONLY: dict[str, str] = {"gloss": "glossy_plastic",}-#: the coarse families :mod:`codeverse3d.texturing.plan` speaks -> a representative-#: fine family here, so the texture pass and the normaliser agree on the numbers.+#: the coarse families (wood, metal, ...) -> a representative fine family, for ``pbr_for``.COARSE_TO_FINE: dict[str, str] = {"wood": "hardwood", "metal": "machined_steel", "fabric": "fabric", "stone": "stone","plastic": "rough_plastic", "leather": "leather", "glass": "glass", "ceramic": "ceramic",@@ -300,64 +281,4 @@ def pbr_for(family: str) -> Pbr | None:return MATERIALS.get(fine) if fine else None-def is_framework_default(metallic: float | None, roughness: float | None, *, eps: float = 1e-3) -> bool:- """True when (metallic, roughness) sits exactly on a framework default pair.-- ``None`` means the glTF exporter omitted the factor, which means the glTF- default (1.0) — that is precisely the untouched case.- """- m = 1.0 if metallic is None else float(metallic)- r = 1.0 if roughness is None else float(roughness)- return any(abs(m - dm) <= eps and abs(r - dr) <= eps for dm, dr in FRAMEWORK_DEFAULTS)---def out_of_band(pbr: Pbr, metallic: float | None, roughness: float | None) -> list[str]:- """Which of (metallic, roughness) are impossible for ``pbr``'s family."""- m = 1.0 if metallic is None else float(metallic)- r = 1.0 if roughness is None else float(roughness)- bad: list[str] = []- if not (pbr.metallic_band[0] - 1e-6 <= m <= pbr.metallic_band[1] + 1e-6):- bad.append("metallic")- if not (pbr.roughness_band[0] - 1e-6 <= r <= pbr.roughness_band[1] + 1e-6):- bad.append("roughness")- return bad---#: families that describe BARE metal. A strongly chromatic base colour contradicts-#: them — real cast iron, steel and chrome are neutral (or warm, for brass/copper);-#: "DarkGreenCastIron" is cast iron with PAINT on it, and paint is a dielectric.-BARE_METAL_FAMILIES = frozenset({"cast_iron", "machined_steel", "brushed_metal", "chrome"})-#: saturation above which a base colour cannot be a bare metal-PAINT_SATURATION = 0.30---def saturation(rgb: tuple[float, float, float]) -> float:- """HSV saturation of a 0..1 RGB triple."""- hi, lo = max(rgb), min(rgb)- return 0.0 if hi <= 1e-6 else (hi - lo) / hi---def is_warm_metal_hue(rgb: tuple[float, float, float]) -> bool:- """Gold / brass / copper / titanium-nitride hue: warm, with green sitting between- red and blue rather than collapsing onto blue the way a red paint does."""- r, g, b = rgb- if not (r > g > b):- return False- span = r - b- return span > 1e-6 and 0.28 <= (g - b) / span <= 0.88---def looks_painted(family: str, rgb: tuple[float, float, float] | None) -> bool:- """Does this base colour rule out the bare-metal family it claims?"""- if rgb is None or family not in BARE_METAL_FAMILIES:- return False- return saturation(rgb) > PAINT_SATURATION and not is_warm_metal_hue(rgb)---__all__ = [- "COARSE_TO_FINE", "FINISH_KEYWORDS", "FRAMEWORK_DEFAULTS", "MATERIALS", "SUBSTRATE_KEYWORDS",- "FamilyMatch", "Pbr",- "BARE_METAL_FAMILIES", "family_for", "is_framework_default",- "is_warm_metal_hue",- "looks_painted", "out_of_band", "pbr_for", "saturation",-]+__all__ = ["COARSE_TO_FINE", "FINISH_KEYWORDS", "MATERIALS", "SUBSTRATE_KEYWORDS", "FamilyMatch", "Pbr", "family_for", "pbr_for"]diff --git a/harness/codeverse3d/texturing/plan.py b/harness/codeverse3d/texturing/plan.pydeleted file mode 100644index 09e92b97..00000000--- a/harness/codeverse3d/texturing/plan.py+++ /dev/null@@ -1,550 +0,0 @@-"""Material plan: ONE vision call (contact sheet + plan parts table + brief) →-``TexturePlan`` (per part: family, image prompt, projection, tile size, PBR factors,-skip) validated in code with deterministic defaults, cached by content hash.--``default_plan(plan)`` is the no-model fallback (keyword heuristics on the plan's-``material`` strings) used by tests and when ``model_id`` is empty.-"""--from __future__ import annotations--import hashlib-import logging-from collections.abc import Sequence-from pathlib import Path-from typing import Any, Literal--from pydantic import BaseModel, Field, ValidationError--from codeverse3d.config import get_settings-from codeverse3d.contracts.artifacts import RenderSet-from codeverse3d.contracts.chat import ImagePart-from codeverse3d.contracts.common import Usage-from codeverse3d.contracts.plan import PartPlan, ScenePlan, StaticPlan-from codeverse3d.contracts.spec import Spec-from codeverse3d.conventions import to_snake-from codeverse3d.models import get_chat_model-from codeverse3d.models.schema_utils import ask_structured-from codeverse3d.proc import write_json_atomic, write_text_atomic-from codeverse3d.prompts import load_text, prompt_hash, render-from codeverse3d.texturing.generate import TextureSet, generate_textures-from codeverse3d.texturing.materials import COARSE_TO_FINE, MATERIALS, Pbr--log = logging.getLogger(__name__)--MaterialFamily = Literal[- "wood", "metal", "fabric", "stone", "plastic", "leather", "glass", "ceramic", "painted", "rubber", "other"-]-Projection = Literal["box", "cylinder", "planar_y", "planar_z", "auto"]--PLAN_TEMPLATE = "texturing/material_plan.md"-#: parts whose largest extent is below this keep their flat material-TINY_PART_M = 0.03--STYLE_SUFFIX = (- "seamless tileable texture, perfectly repeating at the edges, top-down orthographic view, "- "flat even diffuse lighting, no shadows, no specular highlights, no vignette, no depth of field, "- "no text, no watermark, no border, fills the whole frame edge to edge, photoreal, uniform scale, 1:1 square"-)---class FamilyDefault(BaseModel):- """A coarse family's IMAGE side (tile, prompt phrase, skip). Its PBR factors are- ``materials.pbr_for(family)`` — the one table the normaliser uses too (review 2 C5)."""-- tile_size_m: float- phrase: str- skip: bool = False---FAMILY_DEFAULTS: dict[str, FamilyDefault] = {- "wood": FamilyDefault(tile_size_m=0.35, phrase="natural wood surface, visible grain and subtle pores"),- "metal": FamilyDefault(tile_size_m=0.3, phrase="metal surface albedo only, matte base colour, no reflections or environment"),- "fabric": FamilyDefault(tile_size_m=0.2, phrase="woven textile close-up, visible thread weave, soft matte"),- "stone": FamilyDefault(tile_size_m=0.6, phrase="stone surface, natural mineral variation, matte"),- "plastic": FamilyDefault(tile_size_m=0.3, phrase="smooth plastic surface, subtle fine noise, uniform colour"),- "leather": FamilyDefault(tile_size_m=0.25, phrase="leather surface, fine natural grain and pores, matte"),- "glass": FamilyDefault(tile_size_m=0.3, phrase="clear glass", skip=True),- "ceramic": FamilyDefault(tile_size_m=0.3, phrase="glazed ceramic surface, subtle speckle, uniform colour"),- "painted": FamilyDefault(tile_size_m=0.4, phrase="painted surface, subtle brush or roller micro-texture, uniform colour"),- "rubber": FamilyDefault(tile_size_m=0.2, phrase="matte rubber surface, fine uniform grain"),- "other": FamilyDefault(tile_size_m=0.3, phrase="matte natural surface material, fine detail", skip=True),-}--_FAMILY_KEYWORDS: list[tuple[str, tuple[str, ...]]] = [- ("glass", ("glass", "acrylic", "crystal")),- ("metal", ("steel", "iron", "aluminum", "aluminium", "brass", "bronze", "copper", "chrome", "metal", "nickel", "gold", "silver")),- ("wood", ("wood", "oak", "walnut", "pine", "teak", "maple", "ash", "beech", "birch", "mahogany", "bamboo", "plywood", "timber")),- ("fabric", ("fabric", "linen", "cotton", "velvet", "wool", "upholster", "textile", "canvas", "felt", "cloth", "boucle")),- ("leather", ("leather", "suede", "hide")),- ("stone", ("stone", "marble", "granite", "concrete", "slate", "terrazzo", "brick", "rock")),- ("ceramic", ("ceramic", "porcelain", "terracotta", "clay", "glazed")),- ("rubber", ("rubber", "silicone", "foam")),- ("painted", ("paint", "lacquer", "enamel", "powder-coated", "powder coated", "varnish")),- ("plastic", ("plastic", "abs", "polypropylene", "nylon", "resin", "vinyl", "pvc", "polycarbonate")),-]-_SKIP_WORDS = ("chrome", "mirror", "mirrored", "polished", "glossy", "emissive", "led", "transparent", "glass")---def _words(text: str) -> set[str]:- return set(to_snake(text).split("_"))---def _pbr(family: str) -> Pbr:- """A coarse family's factors from THE material table (``COARSE_TO_FINE`` maps every one)."""- return MATERIALS[COARSE_TO_FINE[family]]---def family_from_text(text: str) -> str:- """Keyword → family on whole words (``oiled`` must not match ``led``)."""- ws = _words(text)- for fam, words in _FAMILY_KEYWORDS:- if any(w in ws for w in words):- return fam- return "other"---def has_skip_word(text: str) -> bool:- return bool(_words(text) & set(_SKIP_WORDS))---def compose_image_prompt(subject: str, family: str) -> str:- """Harness-owned composition: subject + family phrase + the style suffix."""- fam = FAMILY_DEFAULTS.get(family, FAMILY_DEFAULTS["other"])- subject = " ".join(subject.strip().rstrip(".,;").split())- return f"{subject}, {fam.phrase}, {STYLE_SUFFIX}"---# --------------------------------------------------------------------------- models-class TexturePart(BaseModel):- part: str = Field(description="plan part name (PascalCase)")- texture_id: str = Field(description="snake_case id; parts sharing a material share it")- material_family: MaterialFamily = "other"- prompt: str = Field(default="", description="full image prompt (harness-composed)")- subject: str = Field(default="", description="pattern description from the planner")- projection: Projection = "auto"- tile_size_m: float = Field(default=0.3, gt=0.0, le=20.0)- roughness: float = Field(default=0.6, ge=0.0, le=1.0)- metallic: float = Field(default=0.0, ge=0.0, le=1.0)- tint_rgb: tuple[float, float, float] | None = None- skip: bool = False- reason: str = ""---class TexturePlan(BaseModel):- object_name: str = ""- parts: list[TexturePart] = Field(default_factory=list)- notes: str = ""- model_id: str = ""- source: Literal["vlm", "default", "cache"] = "default"- usage: Usage = Field(default_factory=Usage)-- def textured(self) -> list[TexturePart]:- return [p for p in self.parts if not p.skip]-- def texture_ids(self) -> list[str]:- seen: list[str] = []- for p in self.textured():- if p.texture_id not in seen:- seen.append(p.texture_id)- return seen-- def prompts(self) -> dict[str, str]:- """texture_id → image prompt (first part wins; ids share prompts by construction)."""- out: dict[str, str] = {}- for p in self.textured():- out.setdefault(p.texture_id, p.prompt)- return out-- def by_part(self) -> dict[str, TexturePart]:- return {to_snake(p.part): p for p in self.parts}---class PlannerPart(BaseModel):- """What the VLM returns per part (all optional but part/texture_id/subject)."""-- part: str- texture_id: str- material_family: MaterialFamily = "other"- subject: str = ""- projection: Projection = "auto"- tile_size_m: float | None = None- roughness: float | None = None- metallic: float | None = None- tint_rgb: list[float] | None = None- skip: bool = False- reason: str = ""---class PlannerOutput(BaseModel):- parts: list[PlannerPart]- notes: str = ""---# --------------------------------------------------------------------------- finalise-def _max_extent(p: PartPlan) -> float:- return max(float(e) for e in p.bbox.extents)---def _clean_id(s: str, fallback: str) -> str:- return to_snake(s) if s.strip() else fallback---def finalize_part(raw: PlannerPart, plan_part: PartPlan) -> TexturePart:- fam = raw.material_family if raw.material_family in FAMILY_DEFAULTS else "other"- d, pbr = FAMILY_DEFAULTS[fam], _pbr(fam)- subject = raw.subject.strip() or (plan_part.material.strip() or f"{fam} surface")- skip, reason = bool(raw.skip), raw.reason- if _max_extent(plan_part) < TINY_PART_M:- skip, reason = True, reason or f"tiny part (< {TINY_PART_M * 100:.0f} cm)"- if fam == "glass" or d.skip and not raw.subject.strip():- skip, reason = True, reason or f"{fam} keeps its flat material"- if _words(plan_part.material + " " + subject) & {"chrome", "mirror", "mirrored"}:- skip, reason = True, reason or "mirror-like finish"- tint = None- if raw.tint_rgb and len(raw.tint_rgb) == 3:- tint = tuple(min(1.0, max(0.0, float(c))) for c in raw.tint_rgb) # type: ignore[assignment]- return TexturePart(- part=plan_part.name,- texture_id=_clean_id(raw.texture_id, f"{fam}_{to_snake(plan_part.name)}"),- material_family=fam, # type: ignore[arg-type]- subject=subject,- prompt=compose_image_prompt(subject, fam),- projection=raw.projection,- tile_size_m=float(raw.tile_size_m) if raw.tile_size_m and raw.tile_size_m > 0 else d.tile_size_m,- roughness=float(raw.roughness) if raw.roughness is not None else pbr.roughness,- metallic=float(raw.metallic) if raw.metallic is not None else pbr.metallic,- tint_rgb=tint,- skip=skip,- reason=reason,- )---def finalize_plan(out: PlannerOutput, plan: StaticPlan, *, model_id: str = "", usage: Usage | None = None,- source: Literal["vlm", "default", "cache"] = "vlm") -> TexturePlan:- """Validate against the plan parts; unknown names dropped, missing parts defaulted;- parts sharing a texture_id are forced onto ONE prompt/family (first wins)."""- by_name = {to_snake(p.part): p for p in out.parts}- parts: list[TexturePart] = []- for pp in plan.parts:- raw = by_name.get(to_snake(pp.name))- if raw is None:- raw = _default_raw(pp)- parts.append(finalize_part(raw, pp))- unknown = sorted(set(by_name) - {to_snake(p.name) for p in plan.parts})- if unknown:- log.warning("texture plan: dropping unknown parts %s", unknown)- first: dict[str, TexturePart] = {}- for tp in parts:- if tp.skip:- continue- head = first.setdefault(tp.texture_id, tp)- if head is not tp:- tp.prompt, tp.subject, tp.material_family = head.prompt, head.subject, head.material_family- return TexturePlan(object_name=plan.object_name, parts=parts, notes=out.notes, model_id=model_id,- source=source, usage=usage or Usage())---def _default_raw(pp: PartPlan) -> PlannerPart:- fam = family_from_text(pp.material or pp.description)- skip = fam in ("glass", "other") or has_skip_word(pp.material)- words = [w for w in to_snake(pp.material).split("_") if w][:2]- tid = "_".join([fam, *words]) if words else fam- return PlannerPart(part=pp.name, texture_id=tid, material_family=fam, subject=pp.material.strip(), # type: ignore[arg-type]- skip=skip, reason="default plan" if not skip else "default plan: unknown/glass/gloss material")---def default_plan(plan: StaticPlan) -> TexturePlan:- """Deterministic plan without any model call (keyword heuristics)."""- out = PlannerOutput(parts=[_default_raw(p) for p in plan.parts], notes="heuristic default plan")- return finalize_plan(out, plan, source="default")---# --------------------------------------------------------------------------- prompt + call-def parts_table(plan: StaticPlan) -> str:- rows = []- for p in plan.parts:- w, d, h = (f"{float(e):.3f}" for e in p.bbox.extents)- rows.append(f"- {p.name} · {p.role} · {p.material or '(unspecified)'} · {w}×{d}×{h} · ×{p.instances}")- return "\n".join(rows)---def _sheet_images(renders: RenderSet | Path | str | Sequence[Path | str] | None, max_views: int = 4) -> list[Path]:- if renders is None:- return []- if isinstance(renders, RenderSet):- if renders.contact_sheet and Path(renders.contact_sheet).is_file():- return [Path(renders.contact_sheet)]- return [Path(v.path) for v in renders.views[:max_views] if Path(v.path).is_file()]- if isinstance(renders, (str, Path)):- return [Path(renders)] if Path(renders).is_file() else []- return [Path(p) for p in renders if Path(p).is_file()][:max_views]---def plan_cache_key(spec: Spec, plan: StaticPlan, images: Sequence[Path], model_id: str) -> str:- h = hashlib.sha256()- h.update(prompt_hash(load_text(PLAN_TEMPLATE)).encode())- h.update(spec.prompt.encode())- h.update(plan.model_dump_json().encode())- h.update(model_id.encode())- for p in images:- h.update(hashlib.sha256(p.read_bytes()).hexdigest().encode())- return h.hexdigest()[:20]---def material_plan(- spec: Spec,- plan: StaticPlan,- renders: RenderSet | Path | str | Sequence[Path | str] | None,- model_id: str,- *,- model: Any | None = None,- cache_dir: Path | None = None,- use_cache: bool = True,- temperature: float = 0.3,-) -> TexturePlan:- """One structured vision call → validated ``TexturePlan``. ``model`` may be any- ``ChatModel`` (tests inject a fake); empty ``model_id`` and no model → default plan."""- if not model_id and model is None:- return default_plan(plan)- images = _sheet_images(renders)- cache_root = (cache_dir or get_settings().cache_dir) / "texture_plans"- key = plan_cache_key(spec, plan, images, model_id)- cached = cache_root / f"{key}.json"- if use_cache and cached.is_file():- try:- tp = TexturePlan.model_validate_json(cached.read_text())- tp.source, tp.usage = "cache", Usage()- return tp- except ValidationError:- cached.unlink(missing_ok=True)- if model is None:- model = get_chat_model(model_id)- text = render(PLAN_TEMPLATE, spec_prompt=spec.prompt, style_notes=getattr(plan, "style_notes", ""),- n_parts=len(plan.parts), parts_table=parts_table(plan))- out, usage, err = ask_structured(- model, PlannerOutput, system="You plan PBR textures for 3D assets. Answer with JSON only.", text=text,- images=[ImagePart(path=str(p), label=p.stem) for p in images], temperature=temperature, label="texture_plan",- )- if out is None:- raise ValueError(f"texture planner: {err}")- tp = finalize_plan(out, plan, model_id=model_id, usage=usage, source="vlm")- if use_cache:- # pid+thread tmp + rename (a torn sidecar re-bought the VLM call; a pid-only- # name raced between threads of one process — review of PR #3)- write_text_atomic(cached, tp.model_dump_json(indent=2))- return tp---def plan_table(tp: TexturePlan) -> str:- """Human-readable summary (CLI / report)."""- rows = [f"{'part':24} {'texture_id':20} {'family':8} {'proj':9} {'tile':6} {'rough':5} {'met':4} skip"]- for p in tp.parts:- rows.append(f"{p.part:24} {p.texture_id:20} {p.material_family:8} {p.projection:9} {p.tile_size_m:<6.2f} "- f"{p.roughness:<5.2f} {p.metallic:<4.1f} {'yes' if p.skip else 'no'}{(' — ' + p.reason) if p.skip and p.reason else ''}")- return "\n".join(rows)---# ===================================================================== scene_pack--PACK_TEMPLATE = "texturing/scene_pack.md"-DEFAULT_URL_PREFIX = "/public/textures"-MANIFEST_NAME = "manifest.json"---class PackEntry(BaseModel):- name: str- material_family: MaterialFamily = "other"- subject: str = ""- prompt: str = ""- tile_size_m: float = Field(default=1.0, gt=0.0, le=50.0)- role: str = "ground"- #: a scene SURFACE default (ground, walls, planks read rough), deliberately not the object table's- roughness: float = Field(default=0.8, ge=0.0, le=1.0)- #: left unset by the planner → the family's (``materials``), set by ``_finalize_entry``- metallic: float = Field(default=0.0, ge=0.0, le=1.0)- file: str = ""- seam_score: float = 0.0- error: str = ""---class PackOutput(BaseModel):- textures: list[PackEntry]- notes: str = ""---class ScenePack(BaseModel):- out_dir: str- entries: dict[str, PackEntry] = Field(default_factory=dict)- notes: str = ""- model_id: str = ""- source: str = "default"- usage: Usage = Field(default_factory=Usage)- manifest_path: str = ""-- def manifest(self) -> dict[str, dict[str, Any]]:- return {n: {"file": e.file, "tile_size_m": e.tile_size_m, "family": e.material_family, "role": e.role,- "prompt": e.prompt, "seam_score": e.seam_score, "roughness": e.roughness, "metallic": e.metallic}- for n, e in self.entries.items() if e.file and not e.error}---# --------------------------------------------------------------------------- planning-_GROUND_RULES: list[tuple[tuple[str, ...], PackEntry]] = [- (("grass", "lawn", "meadow", "garden", "park"), PackEntry(name="grass_ground", subject="short green lawn grass seen from above, fine blades, slight colour variation", tile_size_m=1.5, role="ground")),- (("moss", "mossy", "forest", "woodland"), PackEntry(name="moss_ground", subject="dense green moss carpet, soft velvety clumps", tile_size_m=1.0, role="ground")),- (("gravel", "karesansui", "zen", "raked"), PackEntry(name="fine_gravel", material_family="stone", subject="fine pale grey granite gravel, small even pebbles", tile_size_m=0.8, role="ground")),- (("sand", "beach", "desert", "dune"), PackEntry(name="sand_ground", subject="fine pale beige sand with soft ripples", tile_size_m=1.0, role="ground")),- (("soil", "dirt", "earth", "mud", "path", "trail"), PackEntry(name="packed_soil", subject="dark brown packed earth with small pebbles", tile_size_m=1.0, role="path")),- (("cobble", "pavement", "plaza", "street", "square", "town"), PackEntry(name="cobblestone", material_family="stone", subject="grey granite cobblestones with dark mortar joints", tile_size_m=1.2, role="path")),- (("stone", "rock", "boulder", "granite", "cliff"), PackEntry(name="rough_granite", material_family="stone", subject="rough grey granite rock with lichen speckles", tile_size_m=1.0, role="prop")),- (("wood", "plank", "bridge", "deck", "dock", "pier", "timber", "cabin", "fence"), PackEntry(name="weathered_planks", material_family="wood", subject="weathered grey-brown wooden planks, straight grain, narrow gaps", tile_size_m=0.8, role="prop")),- (("roof", "tile", "shingle", "house", "temple", "hut"), PackEntry(name="clay_roof_tiles", material_family="ceramic", subject="terracotta clay roof tiles in overlapping rows", tile_size_m=1.0, role="roof")),- (("brick", "wall"), PackEntry(name="red_brick", material_family="stone", subject="red clay bricks with light grey mortar, running bond", tile_size_m=1.0, role="wall")),- (("bark", "tree", "trunk", "maple", "oak", "pine"), PackEntry(name="tree_bark", material_family="wood", subject="dark grey-brown tree bark with vertical furrows", tile_size_m=0.5, role="prop")),- (("water", "pond", "lake", "river", "sea", "harbour", "harbor"), PackEntry(name="pond_bed", material_family="stone", subject="dark silty pond bed with scattered small pebbles and algae", tile_size_m=1.0, role="water_bed")),- (("fabric", "tent", "cloth", "banner", "awning", "canvas"), PackEntry(name="canvas_fabric", material_family="fabric", subject="natural off-white woven canvas", tile_size_m=0.3, role="fabric")),- (("metal", "steel", "iron", "rust"), PackEntry(name="rusty_steel", material_family="metal", subject="rust-streaked painted steel plate, matte", tile_size_m=0.5, role="prop")),- (("concrete", "asphalt", "road", "industrial"), PackEntry(name="concrete", material_family="stone", subject="smooth grey concrete with fine pores", tile_size_m=1.0, role="ground")),- (("bamboo",), PackEntry(name="bamboo_poles", material_family="wood", subject="vertical cured yellow bamboo poles with dark nodes", tile_size_m=0.5, role="prop")),-]---def _plan_text(plan: ScenePlan) -> str:- bits = [plan.title, plan.summary, plan.setting, plan.mood, plan.environment]- bits += [f"{z.name} {z.description}" for z in plan.zones]- bits += [f"{a.name} {a.description}" for a in plan.assets]- return " ".join(bits)---def _finalize_entry(e: PackEntry) -> PackEntry:- fam = e.material_family if e.material_family in FAMILY_DEFAULTS else "other"- name = to_snake(e.name) or f"{fam}_texture"- subject = e.subject.strip() or name.replace("_", " ")- return e.model_copy(update={- "name": name, "material_family": fam, "subject": subject, "prompt": compose_image_prompt(subject, fam),- # a "metal" pack the planner left unset shipped metallic 0.0 until 2026-09-23 (review 2 C5)- "metallic": e.metallic if "metallic" in e.model_fields_set else _pbr(fam).metallic,- })---def default_scene_pack_plan(plan: ScenePlan, *, n_min: int = 6, n_max: int = 12) -> list[PackEntry]:- """Keyword fallback: textures whose trigger words appear in the plan; always a- ground; padded with generic ground/stone/wood up to ``n_min``."""- words = set(to_snake(_plan_text(plan)).split("_"))- out: list[PackEntry] = []- for keys, entry in _GROUND_RULES:- if any(k in words for k in keys) and len(out) < n_max:- out.append(entry)- names = {e.name for e in out}- for _, entry in _GROUND_RULES:- if len(out) >= n_min:- break- if entry.name not in names:- out.append(entry)- names.add(entry.name)- return [_finalize_entry(e) for e in out[:n_max]]---def scene_pack_plan(- plan: ScenePlan, model_id: str, *, model: Any | None = None, n_min: int = 6, n_max: int = 12, temperature: float = 0.4,-) -> tuple[list[PackEntry], str, Usage]:- """Structured text call → entries. Empty ``model_id`` and no model → default plan."""- if not model_id and model is None:- return default_scene_pack_plan(plan, n_min=n_min, n_max=n_max), "default", Usage()- if model is None:- model = get_chat_model(model_id)- zones = "\n".join(f"- {z.name}: {z.description}" for z in plan.zones)- assets = "\n".join(f"- {a.name} ({a.kind}): {a.description}" for a in plan.assets) or "- (none)"- text = render(PACK_TEMPLATE, n_min=n_min, n_max=n_max, title=plan.title, setting=plan.setting, mood=plan.mood,- environment=plan.environment, zones=zones, assets=assets)- out, usage, err = ask_structured(model, PackOutput, system="You plan texture packs for 3D scenes. JSON only.",- text=text, temperature=temperature, label="scene_texture_pack")- if out is None:- raise ValueError(f"scene pack planner: {err}")- entries: list[PackEntry] = []- seen: set[str] = set()- for e in out.textures:- fe = _finalize_entry(e)- if fe.name in seen:- continue- seen.add(fe.name)- entries.append(fe)- if not entries:- raise ValueError("scene pack planner returned no textures")- return entries[:n_max], out.notes, usage---# --------------------------------------------------------------------------- generation-def scene_texture_pack(- scene_plan: ScenePlan,- out_dir: Path,- image_model: Any,- model_id: str = "",- *,- model: Any | None = None,- size: int = 1024,- cache_dir: Path | None = None,- n_min: int = 6,- n_max: int = 12,- max_workers: int = 6,- use_cache: bool = True,-) -> ScenePack:- """Plan + generate the pack into ``out_dir`` and write ``manifest.json``."""- out_dir = Path(out_dir)- entries, notes, usage = scene_pack_plan(scene_plan, model_id, model=model, n_min=n_min, n_max=n_max)- pack = ScenePack(out_dir=str(out_dir), notes=notes, model_id=model_id, source="vlm" if (model_id or model) else "default",- usage=usage)- ts: TextureSet = generate_textures({e.name: e.prompt for e in entries}, out_dir, image_model, size=size,- cache_dir=cache_dir, max_workers=max_workers, use_cache=use_cache)- pack.usage = pack.usage + ts.usage- for e in entries:- a = ts.textures.get(e.name)- if a is None:- continue- e = e.model_copy(update={"file": Path(a.path).name if a.ok else "", "seam_score": round(a.seam_score, 4), "error": a.error})- pack.entries[e.name] = e- pack.manifest_path = str(write_manifest(pack, out_dir))- return pack---def write_manifest(pack: ScenePack, out_dir: Path) -> Path:- p = Path(out_dir) / MANIFEST_NAME- write_json_atomic(p, pack.manifest())- return p---def texture_pack_prompt(manifest: dict[str, dict[str, Any]], *, url_prefix: str = DEFAULT_URL_PREFIX) -> str:- """Prompt snippet for zone/env generation: what exists and the exact loading idiom.-- The only material block in the env / zone briefs (``tracks/scene_env.j2`` / ``scene_zone.j2``,- D106): what exists, the loader idiom the renderer needs, and the judge's requirement the pack- answers. Measured 2026-09-05: the first two cells of the texture arm generated 8 and 9- textures, carried this block verbatim in their env prompt, and used **zero** of them across- `env.js` and six zone modules while the prompt around it taught a procedural colour blend —- a passive offer beside a recipe loses, so the block names the defect it is for.- """- if not manifest:- return ""- ground = [n for n, e in manifest.items() if str(e.get("role", "")).lower() in ("ground", "path")]- lines = ["## Available textures (seamless tileable albedo PNGs generated for this scene)"]- for name, e in manifest.items():- lines.append(f"- `{url_prefix}/{e['file']}` — {name} ({e.get('family', 'other')}, {e.get('role', '')}; "- f"one tile = {float(e['tile_size_m']):.2f} m; roughness {float(e.get('roughness', 0.8)):.2f})")- lines.append(- "Load with the provided loader ONLY (no TextureLoader of your own, no DataTexture):\n"- "```js\n"- f"const tex = loaders.texture.load('{url_prefix}/{next(iter(manifest.values()))['file']}');\n"- "tex.wrapS = tex.wrapT = THREE.RepeatWrapping;\n"- "tex.colorSpace = THREE.SRGBColorSpace;\n"- "tex.repeat.set(sizeX / TILE_M, sizeZ / TILE_M); // TILE_M = the tile size listed above, sizeX/Z = the surface's world size in m\n"- "```\n"- "Use `texture.clone()` (+ `needsUpdate = true`) when the same image needs a different repeat. "- "Never invent texture URLs, and keep procedural materials where no texture fits."- )- if ground:- lines.append(- "\nThe judge lists a ground that reads as one flat untextured colour as a defect; these "- "ground maps are for it: " + ", ".join(f"`{n}`" for n in ground)- + ". How you blend them (height, slope, noise, paths) is yours."- )- return "\n".join(lines)diff --git a/harness/codeverse3d/texturing/run.py b/harness/codeverse3d/texturing/run.pydeleted file mode 100644index 4a2e4211..00000000--- a/harness/codeverse3d/texturing/run.py+++ /dev/null@@ -1,313 +0,0 @@-"""``texture_pass``: the orchestrating entry for object texturing.-- renders (latest sheet or a quick render) → normalise_materials (free, deterministic)- → material_plan (1 vision call)- → generate_textures (image model, cached, parallel) → seam_gate- → apply_textures (+ derived roughness/normal maps) → artifacts/object_textured.glb- → judge_gate (before/after, n=1) → TextureReport (+ artifacts/texturing.json,- record.json extra["texturing"] when a record exists)--Code stays the truth: ``artifacts/object.glb`` is never overwritten; the textured-GLB and ``artifacts/textures/`` are a derived asset pack recorded with the run.-The textured GLB is built in an :class:`~codeverse3d.workspace.ArtifactStage` and-promoted to ``artifacts/object_textured.glb`` only when the pass ships — a-rejected pass leaves no canonical file for the deliverable/gallery to pick up.-"""--from __future__ import annotations--import logging-import time-from collections.abc import Sequence-from pathlib import Path-from typing import Any--from pydantic import BaseModel, Field--from codeverse3d.contracts.artifacts import Measurement, RenderSet-from codeverse3d.contracts.common import TRACK_INFO, Track, Usage-from codeverse3d.contracts.plan import StaticPlan-from codeverse3d.contracts.spec import Spec-from codeverse3d.conventions import OBJECT_VIEWS_QUICK, ViewPreset-from codeverse3d.proc import EventLog, read_json_or_none-from codeverse3d.texturing.apply import (- ApplyReport,- NormaliseReport,- apply_textures,- normalise_materials,-)-from codeverse3d.texturing.generate import (- GateResult,- SeamGateResult,- TextureSet,- generate_textures,- judge_gate,- seam_gate,-)-from codeverse3d.texturing.plan import TexturePlan, material_plan-from codeverse3d.workspace import Workspace--log = logging.getLogger(__name__)--TEXTURED_GLB = "object_textured.glb"-TEXTURES_DIR = "textures"-REPORT_NAME = "texturing.json"---class TextureReport(BaseModel):- plan: TexturePlan- textures: TextureSet- seam: SeamGateResult- normalise: NormaliseReport | None = None- apply: ApplyReport | None = None- gate: GateResult | None = None- glb_in: str- glb_out: str = ""- shipped: bool = False- delta: float | None = None- usage: Usage = Field(default_factory=Usage)- duration_s: float = 0.0- notes: list[str] = Field(default_factory=list)-- def summary(self) -> dict[str, Any]:- return {- "shipped": self.shipped, "delta": self.delta, "glb_out": self.glb_out,- "n_textures": len(self.textures.paths()), "seam_failed": sorted(self.seam.failed),- "parts_textured": len(self.apply.parts_textured) if self.apply else 0,- "materials_normalised": len(self.normalise.changes) if self.normalise else 0,- "derived_maps": self.apply.n_derived_maps if self.apply else 0,- "materials_delta": self.gate.materials_delta if self.gate else None,- "cost_usd": round(self.usage.cost_usd, 4), "duration_s": self.duration_s,- "plan_source": self.plan.source, "reason": self.gate.reason if self.gate else "; ".join(self.notes),- }---def _render_quick(glb: Path, out_dir: Path, views: Sequence[ViewPreset], render: Any | None) -> RenderSet:- if render is None:- from codeverse3d.spatial.render import render_glb-- render = render_glb- return render(glb, out_dir, views=list(views), width=512, height=512)---def _measure(glb: Path) -> Measurement | None:- try:- from codeverse3d.spatial.measure import measure_glb-- return measure_glb(glb)- except Exception as e: # noqa: BLE001 — measurement is judge context only- log.warning("measure_glb failed for texture gate: %s", e)- return None---#: the ONE owner of "does this run texture?". Three call sites used to answer it-#: independently — ``tracks.lifecycle.finalise`` (spec.options.texture / a "texture" tag /-#: ctx.extra), and the ``texture_pass`` spatial tool, which the coding agent could call in-#: any run because the tool is registered for every object track. That is how a-#: ``texture: false`` run still paid for a texture pass (docs/COST.md §15: the quality run's-#: ledger was +9.5% over record.total_usage because the pass ran twice, once from inside a-#: round-2 agent session). Both now ask this function.-#: the object tracks — the only ones with an ``artifacts/object.glb`` to texture. A scene-#: has no GLB deliverable (languages/scene_threejs/runtime.py: "BuildResult.glb_path stays-#: None") and neither graphics language produces one at all, so ``texture_pass`` on those-#: tracks can only ever raise FileNotFoundError. Scenes have their own command,-#: ``3dcode texture scene-pack``.-TEXTURE_TRACKS = (Track.STATIC_OBJECT, Track.ARTICULATED_OBJECT)---def texture_supported(track: Track) -> bool:- """Whether ``texture_pass`` can run on this track at all (is there a GLB?)."""- return track in TEXTURE_TRACKS---def texture_requested(spec: Spec) -> bool:- """True when the run asked for the derived texture pass AND the track can run one.-- ``Spec.options.texture`` is the switch. Nothing else may turn texturing- on; ``3dcode texture pass <slug>`` is an explicit user instruction that does- not go through here at all.-- The track scope belongs here too, for the same "one owner" reason: without it- ``--profile quality`` (which forces texture=True) made every scene and graphics run- call a pass that could only raise FileNotFoundError, swallowed at log.warning into a- spurious ``texture.failed`` event — quality's advertised "+texture" was a guaranteed- no-op on half the tracks, and scene runs never reached the command that would work.- """- return bool(spec.options.texture) and texture_supported(spec.track)---def texture_pass(- ws: Workspace,- spec: Spec,- plan: StaticPlan,- *,- model_id: str,- image_model: Any | None = None,- judge: bool = True,- judge_obj: Any | None = None,- judge_model_id: str | None = None,- rubric: str | None = None,- glb_in: Path | None = None,- sheet: Path | None = None,- views: Sequence[ViewPreset] = OBJECT_VIEWS_QUICK,- size: int = 1024,- plan_model: Any | None = None,- render: Any | None = None,- cache_dir: Path | None = None,- events: EventLog | None = None,- normalise: bool = True,-) -> TextureReport:- """Run the whole pass on ``ws``.-- ``judge=False`` skips the before/after VLM gate (ship iff something was- textured and no seam failed); ``judge_obj`` replaces the constructed- ``VlmJudge`` (tests; ``image_model`` / ``plan_model`` / ``render`` / ``cache_dir`` are- the other injection points). ``sheet`` is the contact sheet the material- planner looks at — the round being textured; a quick render of ``glb_in`` otherwise.-- ``normalise=True`` first runs the deterministic material normaliser- (:func:`codeverse3d.texturing.apply.normalise_materials`) over the input GLB,- so the parts the texture pass *skips* — chrome, glass, tiny hardware — still get- plausible metallic/roughness numbers. It costs no model call, and the same- before/after judge gate (BEFORE is always the untouched ``glb_in``) decides- whether the combined result ships."""- t0 = time.time()- events = EventLog(ws.events_path) if events is None else events- glb_in = Path(glb_in) if glb_in else ws.artifacts / "object.glb"- if not glb_in.is_file():- raise FileNotFoundError(f"no GLB to texture: {glb_in}")- tex_dir = ws.artifacts / TEXTURES_DIR- glb_out = ws.artifacts / TEXTURED_GLB- notes: list[str] = []- events.emit("texture.start", model=model_id, glb=glb_in.name)-- # 1. renders for the planner: the round's own sheet, else a quick render of glb_in — never- # another round's sheet (the planner would name materials for parts this GLB may not have)- sheet = sheet if sheet is not None and Path(sheet).is_file() else None- if sheet is None:- rs = _render_quick(glb_in, tex_dir / "planner_views", views, render)- sheet = Path(rs.contact_sheet) if rs.contact_sheet else (Path(rs.views[0].path) if rs.views else None)-- # 1b. deterministic material normalisation (free; the texture base, never the judged BEFORE)- texture_base = glb_in- norm = None- if normalise:- norm = normalise_materials(glb_in, tex_dir / "object_normalised.glb", plan=plan)- if norm.glb_out:- texture_base = Path(norm.glb_out)- events.emit("texture.normalised", changed=len(norm.changes), materials=norm.n_materials,- families=sorted({c.family for c in norm.changes}))-- # 2. material plan- tplan = material_plan(spec, plan, sheet, model_id, model=plan_model, cache_dir=cache_dir)- usage = tplan.usage- events.emit("texture.plan", source=tplan.source, n_parts=len(tplan.parts), n_textured=len(tplan.textured()),- n_textures=len(tplan.texture_ids()), cost_usd=round(tplan.usage.cost_usd, 4))- ws.write_json(tex_dir / "texture_plan.json", tplan)-- # 3. images- if image_model is None:- from codeverse3d.reference import get_image_model-- image_model = get_image_model()- tset = generate_textures(tplan, tex_dir, image_model, size=size, cache_dir=cache_dir)- usage = usage + tset.usage- seam = seam_gate(tset.textures)- events.emit("texture.generated", n=len(tset.textures), failed=sorted(tset.failed()), seam_failed=sorted(seam.failed),- cost_usd=round(tset.usage.cost_usd, 4), duration_s=tset.duration_s)- for tid, err in tset.failed().items():- notes.append(f"texture {tid} failed: {err}")- keep = {tid: Path(tset.textures[tid].path) for tid in seam.passed}- report = TextureReport(plan=tplan, textures=tset, seam=seam, glb_in=str(glb_in), usage=usage,- notes=notes, normalise=norm)- notes = report.notes # pydantic copied the list; keep appending to the report's own- if not keep:- notes.append("no usable textures (all failed or seams too strong) — nothing applied")- return _finish(ws, report, t0, events)-- # 4. apply — into staging: the canonical object_textured.glb exists on disk ONLY- # when the pass ships (entering the stage also removes any earlier pass's file)- with ws.stage_artifacts(TEXTURED_GLB) as stage:- staged_glb = stage.path(TEXTURED_GLB)- report.apply = apply_textures(texture_base, tplan, keep, staged_glb)- report.glb_out = str(glb_out) # the canonical home; a real file iff shipped- notes.extend(report.apply.warnings)- events.emit("texture.applied", parts=len(report.apply.parts_textured), skipped=len(report.apply.parts_skipped),- materials=report.apply.n_materials, warnings=len(report.apply.warnings))- if not report.apply.parts_textured:- notes.append("no part was textured")- return _finish(ws, report, t0, events)-- # 5. gate- if not judge:- report.shipped = True- notes.append("judge gate skipped (--no-judge): shipped on seam gate only")- stage.promote()- return _finish(ws, report, t0, events)- gate_judge = judge_obj if judge_obj is not None else _make_judge(spec, rubric, judge_model_id)- gate = judge_gate(spec, plan, glb_in, staged_glb, tex_dir / "gate", judge=gate_judge, measurement=_measure(glb_in),- views=views, render=render)- report.gate, report.shipped, report.delta = gate, gate.shipped, gate.delta- report.usage = report.usage + gate.usage- events.emit("texture.gate", shipped=gate.shipped, delta=gate.delta, materials_delta=gate.materials_delta,- before=gate.overall_before, after=gate.overall_after, reason=gate.reason,- cost_usd=round(gate.usage.cost_usd, 4))- if report.shipped:- stage.promote()- return _finish(ws, report, t0, events)---def _make_judge(spec: Spec, rubric: str | None, judge_model_id: str | None) -> Any:- from codeverse3d.judges.vlm_judge import VlmJudge-- # the track's own rubric even for a --image run, on purpose: this plain VlmJudge has no reference diff, so- # reference's measured silhouette_match could not be scored, and textures never move a silhouette anyway- return VlmJudge(rubric=rubric or TRACK_INFO[spec.track].rubric, model_id=judge_model_id or spec.backends.judge,- n_samples=1, label="texture_gate")---def _finish(ws: Workspace, report: TextureReport, t0: float, events: EventLog) -> TextureReport:- report.duration_s = round(time.time() - t0, 2)- if not report.shipped:- # a pass that did not ship leaves NO canonical textured GLB — including one- # left behind by an earlier shipped pass (the report keeps all its fields)- ws.stage_artifacts(TEXTURED_GLB).invalidate()- ws.write_json(ws.artifacts / TEXTURES_DIR / REPORT_NAME, report)- record_texturing(ws, report)- events.emit("texture.done", **report.summary())- return report---def report_path(ws: Workspace) -> Path:- """THE location of the texture report — ``addons.select``'s double-buy guard reads it too."""- return ws.artifacts / TEXTURES_DIR / REPORT_NAME---def record_texturing(ws: Workspace, report: TextureReport) -> bool:- """``record.json`` extra["texturing"] = summary (+ asset paths) when a record exists."""- data = read_json_or_none(ws.record_path)- if data is None:- return False- extra = data.setdefault("extra", {})- extra["texturing"] = texturing_extra(ws, report)- ws.write_json(ws.record_path, data)- return True---def texturing_extra(ws: Workspace, report: TextureReport) -> dict[str, Any]:- """The ``extra["texturing"]`` payload — ONE builder for the record write here and the- finalise-side collect (a tool-textured session no longer writes record.json itself)."""- return {- **report.summary(),- "glb_textured": str(Path(report.glb_out).relative_to(ws.root)) if report.glb_out else "",- "textures_dir": f"artifacts/{TEXTURES_DIR}",- "textures": {tid: Path(a.path).name for tid, a in report.textures.textures.items() if a.ok},- "texture_plan": {p.part: p.texture_id for p in report.plan.textured()},- }---def load_report(ws: Workspace) -> TextureReport:- p = report_path(ws)- if not p.is_file():- raise FileNotFoundError(f"no texturing report at {p}")- return TextureReport.model_validate_json(p.read_text())diff --git a/harness/codeverse3d/tracks/lifecycle.py b/harness/codeverse3d/tracks/lifecycle.pyindex cfed8fe6..06d186f3 100644--- a/harness/codeverse3d/tracks/lifecycle.py+++ b/harness/codeverse3d/tracks/lifecycle.py@@ -815,7 +815,7 @@ class BaseTrack:# in ``rounds``, so name them here (their dollars are in the ledger, the total).extra["aborted_rounds"] = ctx.extra["aborted_rounds"]# A resume rewrite must not drop what earlier sessions / other packages put on- # the record post-hoc (flywheel captions, texturing/run.record_texturing, prior+ # the record post-hoc (flywheel captions, prior# sessions' aborted_rounds, prompt hashes of stages not re-executed): seed from# the prior record — unknown keys preserved, this session's values win.# the variant this session ran under (D105): name/version/hash beside the prompt hashes, so twodiff --git a/harness/codeverse3d/tracks/planner.py b/harness/codeverse3d/tracks/planner.pyindex d0072301..ff5f124e 100644--- a/harness/codeverse3d/tracks/planner.py+++ b/harness/codeverse3d/tracks/planner.py@@ -74,8 +74,8 @@ def brief_cache_dir() -> Path:def _reference_digest(spec: Spec) -> list[dict[str, str]]:"""Identify the reference images by path AND content hash.- ``--reference`` synthesises a NEW image per run under the same spec fields, so- the path alone does not separate two runs; the bytes do. An unreadable file+ The same path can hold different bytes from one run to the next, so the path+ alone does not separate two runs; the bytes do. An unreadable filestill contributes its path, so it can never collapse onto "no references"."""out: list[dict[str, str]] = []for r in spec.references:diff --git a/harness/codeverse3d/tracks/repair.py b/harness/codeverse3d/tracks/repair.pyindex eec1e670..9bfff9ce 100644--- a/harness/codeverse3d/tracks/repair.py+++ b/harness/codeverse3d/tracks/repair.py@@ -137,7 +137,7 @@ def build_with_repair(ctx: RunContext, *, round_index: int, label: str, files_hiwhile not outcome.ok and (attempt < max_attempts or build.harness_failure):# A build that failed because the HARNESS could not run it is not a defect the# agent can fix, and handing it over costs the round its whole repair budget on- # working code. Measured 2026-09-05 (scene_textures/japanese_garden): three+ # working code. Measured 2026-09-05 (japanese_garden): three# repairs against "scene probe produced no result (driver output lost)" rewrote# 5, then 14, then 3 files — the 14 included env.js and every zone — and deleted# the texture use the arm existed to measure, before the fourth build passed ondiff --git a/harness/codeverse3d/tracks/scene.py b/harness/codeverse3d/tracks/scene.pyindex f1368663..e2c3258d 100644--- a/harness/codeverse3d/tracks/scene.py+++ b/harness/codeverse3d/tracks/scene.py@@ -45,7 +45,6 @@ from codeverse3d.orchestrator import BudgetExceeded, TaskGroup, compact_instructfrom codeverse3d.prompts import renderfrom codeverse3d.spatial.frame_motion import motion_text_forfrom codeverse3d.spatial.scene_placement import placement_gate-from codeverse3d.texturing.plan import texture_pack_promptfrom codeverse3d.tracks import skills_hookfrom codeverse3d.tracks.common import RunContext, generate_for, single_shot_ctxfrom codeverse3d.tracks.generation import GenerationResult, GenerationTask@@ -206,11 +205,6 @@ def _plan_agent(ctx: RunContext) -> dict[str, Any]:return {"plan": ctx.plan, "agent": ctx.agent_id}-def _pack(ctx: RunContext) -> dict[str, Any]:- # the texture pack is part of a key only when it has files: a run without one keeps its keys- return {"textures": ctx.extra["textures"]} if ctx.extra.get("textures") else {}--class SceneTrack(BaseTrack):track = Track.SCENErubric = TRACK_INFO[Track.SCENE].rubric@@ -218,20 +212,17 @@ class SceneTrack(BaseTrack):#: the pre-round graph writes the whole baseline; round 0 builds, renders and judges itstages = (SKELETON, MATERIALIZE,- # first and alone: env and zones name its files (Settings.scene_textures: off by default, and why)- StageNode("textures", lambda t, c: t._textures_stage(c), key=lambda c: {"plan": c.plan}, when=lambda s: s.scene_textures),# side by side (2026-08-30): the env brief reads no asset output — la_boulevard's 15 + 12 min ran# in max(15, 12), a whole refine round saved. Each is its OWN cached stage (2026-08-31): a failing# sibling never costs a succeeded one its paid result. Layouts: L2 zone layouts, an accelerator# (C3D_ZONE_LAYOUTS, default on), riding along at no wall clock (beb6605)(StageNode("assets", lambda t, c: run_asset_stage(c), key=_plan_agent),- StageNode("env", lambda t, c: t._env_stage(c), key=lambda c: {**_plan_agent(c), **_pack(c)}),+ StageNode("env", lambda t, c: t._env_stage(c), key=_plan_agent),StageNode("layouts", lambda t, c: t._layouts_stage(c), key=_plan_agent, when=lambda s: s.zone_layouts)),StageNode("asset_api", lambda t, c: t._asset_api(c)),# ONE session writes every zone (D70)StageNode("zones", lambda t, c: t._zones_stage(c), key=lambda c: {- "plan": c.plan, "asset_api": c.extra["asset_api"], "layouts": c.extra.get("layouts", {}), "agent": c.agent_id,- **_pack(c)}),+ "plan": c.plan, "asset_api": c.extra["asset_api"], "layouts": c.extra.get("layouts", {}), "agent": c.agent_id}),# after the zones are recorded: a run the clock stops here keeps them (salvage assembles# them; a resume serves them instead of paying the session again)CLOCK,@@ -329,27 +320,6 @@ class SceneTrack(BaseTrack):skills_hook.record_usage(gen, index=0, kind=kind)ctx.ws.commit(stage)- def _textures_stage(self, ctx: RunContext) -> dict[str, Any]:- """Generate the scene's tileable texture pack into ``public/textures/``.-- Runs BEFORE env / zones, because its whole point is that those prompts can name- the files. Advisory: a pack that cannot be generated leaves the run exactly as it- was before this stage existed (an empty manifest renders no prompt block)."""- from codeverse3d.reference import get_image_model- from codeverse3d.texturing.plan import scene_texture_pack-- plan: ScenePlan = ctx.plan # type: ignore[assignment]- try:- pack = scene_texture_pack(plan, ctx.ws.public / "textures", get_image_model(),- ctx.spec.backends.planner, cache_dir=ctx.settings.cache_dir / "textures")- except Exception as e: # noqa: BLE001 — textures accelerate, they must never kill a run- ctx.events.emit("textures.stage_failed", error=f"{type(e).__name__}: {e}"[:300])- return {}- manifest = pack.manifest()- ctx.ws.commit("textures")- ctx.events.emit("textures.done", n=len(manifest), cost_usd=round(pack.usage.cost_usd, 4), source=pack.source)- return manifest-def _env_stage(self, ctx: RunContext) -> dict[str, Any]:"""The env session, honest (D111): ``ok`` only when the env module ITSELF was written in thisstage — the session's ``files_changed`` (its ``files_hint`` alone: ``shared_tree``) or the@@ -641,7 +611,6 @@ class SceneTrack(BaseTrack):interior=plan.interior, glazed=plan.glazed,zones_table=zones_table, cameras=cameras, effects=effects, animation="; ".join(plan.animation) or "(none)",asset_api=ctx.extra.get("asset_api", "(no assets)"),- textures=texture_pack_prompt(ctx.extra.get("textures") or {}),env_file=env_file(ctx), entry_file=ENTRY_FILE[lang], **extra)diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.mdindex 31b7d13f..7a43d3d0 100644--- a/harness/docs/ARCHITECTURE.md+++ b/harness/docs/ARCHITECTURE.md@@ -33,7 +33,7 @@ Every run is: **spec → plan → skeleton → [scene stages] → baseline round(optionally best-of-N candidates) → `max_rounds` refine rounds → finalise → record**.Which round to hand over is decided AFTER the run, by the `addons/select` reader(`3dcode pick`; `3dcode make` calls it by score): it writes `deliverable/` for that-round and runs the optional **texture pass** on it. The record (plus git history of+round. The record (plus git history of`src/` and every round's kept build) is the flywheel unit.## 1. Design laws (from the reference post-mortems)@@ -41,8 +41,7 @@ round and runs the optional **texture pass** on it. The record (plus git histor1. **Code is truth; artifacts are derived.** Raw code in `src/` is thedeliverable; GLB/renders are regenerated from it. Every round is a commit andkeeps its own built files under `artifacts/rNN/`, so any round can be handed over- without a rebuild; the workspace ends at the last round. Textures are a *derived asset pack*- (`object_textured.glb` + `artifacts/textures/`); `object.glb` is never touched.+ without a rebuild; the workspace ends at the last round.2. **Requirements, never templates (D106 scene track, D107 every track, owner 2026-10-15).**The harness states what must be true, where, and how it is measured — interface (the files andfunctions the wrapper calls, frames / units / naming), sandbox rules, and measured requirements@@ -109,7 +108,7 @@ codeverse3d/(fan_out); sha256_file and version_line live here too — still a leaf:imports nothing from codeverse3dmodels/ ChatModel (base.py), parts.py; gemini.py (the whole Gemini stack:- request/response shapes, dead-key + free 429 rotation, the image model);+ request/response shapes, dead-key + free 429 rotation);anthropic.py openai.py (each with its own request/response shapes);retry.py (the scheduling machine: KeyPool with outcomes ok | 429 | 5xx |error | dead | skip and the max_in_flight cap as machine-wide flock'd@@ -182,27 +181,20 @@ codeverse3d/context.py (per-call > ambient attribution) instrument.py (MeteredChatModel /MeteredAgent — one row per ChatModel.generate; one session row only for a backendthat does NOT meter itself; run_ledger nests + is context-local so bench --parallel works)- profiles.py (economy|balanced|quality; cli._common.resolve_dial is THE resolver)- tally.py (a block's money = its ledger rows, its lost seconds → StepTime; COST §31)+ tally.py (a block's money = its ledger rows, its lost seconds → StepTime; COST §31)guard.py (a call's cost estimated before it is sent — `3dcode cost estimate`)judges/ base.py (JudgeInput; `round_input` + `plan_summary(plan, language)`, the ONE payload- builder and plan digest the in-run judge, `3dcode judge`, calibration, the texture- gate and eval all use; the pure replay helpers), rubrics.py + rubrics/*.yaml (defect checklists, the wire+ builder and plan digest the in-run judge, `3dcode judge`, calibration+ and eval all use; the pure replay helpers), rubrics.py + rubrics/*.yaml (defect checklists, the wireschema, caps and scoring), prompt_builder.py (image prep, montages, thejudge messages), vlm_judge.py (+ the reference/likeness judges),pairwise.py.No Judge Protocol: a judge isduck-typed `.judge(JudgeInput) -> Judgment`- reference.py reference GROUNDING — give the pipeline a picture of what it is building:- synthesis, THE plausibility gate that makes a synthesized- reference safe to use, Spec attachment + honesty guards, proportions- (does the picture agree with the brief?), render-vs-reference diff,- the content-addressed cache and ground_spec (the one call the CLI makes)- texturing/ plan.py (VLM material plan + the scene texture pack), generate.py- (generation + the tileable seam fix + the seam/judge gate), apply.py- (world-metre unwrap, PBR map set, application + material normalisation),- materials.py (named material library), run.py (texture_pass); __init__.py is- docstring-only — import from the submodules+ reference.py a user `--image` against the render: proportions (does the picture agree+ with the brief?) and the render-vs-reference mismatch diff+ texturing/ materials.py only: the named PBR material-family table `languages/blender` reads+ (no texture is generated: the harness has no image-generation step)orchestrator.py the round loop's LIBRARY, not the loop: the round knobs (RoundPolicy —no stop knob besides max_rounds), refine-task compilation + grouping,StageRunner + RunState (resume), BudgetGuard (the clock). The loop itself is@@ -257,7 +249,7 @@ codeverse3d/lives: <lang>/{system,contract}.md (incl. glsl_shader/,opengl_python/; NO language ships a cookbook, D106 / D107 — contract.mdand system.md carry the interface facts), system/* (harness contract, single-shot envelope,- role_{scope,asset,repair}.j2), texturing/*.md, tracks/*.j2.+ role_{scope,asset,repair}.j2), tracks/*.j2.catalog.py answers "what exists and how does each piece reach the model"— including the ONE per-language lookup, language_prompt(language, name) /language_text: contract.md, system.md, effects_catalog.md, asset.md@@ -279,7 +271,7 @@ codeverse3d/commands), inspect_cmd.py (render/judge on one existing run), layout_cmd.py(THE single-run view: `show` = STATUS / DELIVERABLE / QUALITY EVIDENCE / COST &SETTINGS; `status` = `show --section status`, which also reads a run in flight),- flywheel_cmd.py, texture_cmd.py, cost_cmd.py (`3dcode cost`), doctor.py+ flywheel_cmd.py, cost_cmd.py (`3dcode cost`), doctor.py(`--skills` checks the library + its discovery wiring),skills_cmd.py (`3dcode skills list|show|validate|report` — the read-rate report)eval/bench/ run_bench.py + report.py (the battery launcher, `python -m bench.run_bench` / `bench.report`;@@ -394,8 +386,7 @@ server (name `3dcode`) for the vendor CLIs, (c) a native tool schema for any emb`render_views`, `render_sheet`, `isolate`, `cross_section`, `check_connectivity`,`check_contract`, `compare_reference` (object tracks), `joint_sweep` (articulated),`shader_probe`, `scene_probe`, `scene_views`, `check_placement` (scene), `gl_probe`,-`gl_frames` (graphics). Texturing is not a tool: `3dcode pick --texture` or-`3dcode texture pass` after the run (2026-09-22: 1 call in 616 recorded sessions).+`gl_frames` (graphics).An `Observation` carries two different answers: `ok` is the **verdict** and `failed`says the tool **could not run** (exception, missing artefact, unusable arguments).@@ -471,13 +462,13 @@ fails when it drifts, printing the block to paste):```stage-graphstatic_object plan → skeleton → materialize* → round 0articulated_object plan → skeleton → materialize* → round 0-scene plan → skeleton → materialize* → textures? → (assets ∥ env ∥ layouts?) → asset_api* → zones → clock* → assemble → round 0+scene plan → skeleton → materialize* → (assets ∥ env ∥ layouts?) → asset_api* → zones → clock* → assemble → round 0graphics plan → skeleton → materialize* → round 0````→` in order; `(a ∥ b)` siblings side by side, each its own cached stage, timed as ONE step of therun's minutes, a failing sibling raised after every sibling has finished and cached; `?` runs under a-`Settings` switch (`textures`: `scene_textures`, off by default; `layouts`: `zone_layouts`, on); `*`+`Settings` switch (`layouts`: `zone_layouts`, on); `*`is not cached — it runs every session. Every other stage is cached under its key(`stages/<name>.json`): what its result depends on, named in the declaration. **Once rounds exist**a recorded stage is served whatever its key (`stage.frozen`), and the skeleton (`seeds_src`) never@@ -535,7 +526,7 @@ plateau, regression or diminishing-returns stop, no rewrite or surface-detail rothe files its tasks name, the only ones it is shown; graphics is one programgenerate (no HARNESS turn cap by default — claude-code runs under AgentJob.max_turns=60 (+6-turn wrap-up),the other vendor CLIs have no turn cap at all; 28 was A/B'd and rejected, +$0.02/−0.21 score, docs/COST.md §17;- a cap the machine sets (C3D_AGENT_MAX_TURNS / limits.agent_max_turns; no profile sets one) still buys a wrap-up session+ a cap the machine sets (C3D_AGENT_MAX_TURNS / limits.agent_max_turns) still buys a wrap-up sessionthat lands a final build + summary instead of being killed) → build+repair (error-focused,escalates on identical signatures) → gates → … → judge (SKIPPED only where the verdict is neverbought at all: no judge or no renders — a round that finishes past the clock is still judged)@@ -560,9 +551,9 @@ stop reasons: max_rounds | budget (the wall clock — BudgetGuard / max_minutes)round's sessions changed nothing) | no_refine_tasks | judge_unavailable | failed(a record from before 2026-09-22 may say passed / plateau: it loads as `stopped`)finalise: the workspace ENDS AT THE LAST ROUND — src/ a cut round left dirty is put back and that round rebuilt;- finalize_record → record.json. No best round, no deliverable/, no texture pass in the run.+ finalize_record → record.json. No best round, no deliverable/ in the run.after the run (`3dcode make`, unless --no-pick): addons/select.pick(by="score") — highest effective score, ties →- fewer gate errors → the earlier round — then package(): deliverable/ + selection.json (+ --texture)+ fewer gate errors → the earlier round — then package(): deliverable/ + selection.json```Track-specific gates: static `connectivity` + `contract` (+ `reference_silhouette`),articulated + `joint_sweep` + `motion_direction` (URDF axis vs plan motion text),@@ -592,32 +583,14 @@ shader-traps skill); before 2026-09-22 the scene's two never reached a round, an(D99): the census's `totals.draws` WARNs past `conventions.DRAWS_WARN_SCENE` and fails the build past`MAX_DRAWS_SCENE`, so the round's repair session gets it; no gate or judge reads fps.-## 8. Texturing (derived asset pack)--`texturing.run.texture_pass(ws, spec, plan, model_id=…)` — never inside a run: `3dcode pick---texture` (and `make --texture`, which picks after the run) texture the PICKED round's kept-`artifacts/rNN/object.glb`, and so does a standalone `3dcode texture pass` (the round-`addons.select` reports as picked):-one VLM **material plan** (parts → shared texture ids, family, projection,-`tile_size_m`; cached) → text-to-image tiles (`GeminiImageModel`,-gemini-3.1-flash-image; mirror cross-fade makes them tileable, `seam_score ≤ 0.08`-gate) → **world-metre UV unwrap** (planar/box/cylinder per part; texel density-identical across parts) → `artifacts/object_textured.glb` → before/after judge gate-(**ship iff** Δoverall ≥ −0.01 AND the materials criterion improved). Results land-in `record.extra["texturing"]` + `events texture.*`; `object.glb` and `src/` are-untouched. Scenes get `scene_texture_pack` instead: 6–12 named tiles +-`public/textures/manifest.json`, injected into zone prompts as an "Available-textures" block. Chair live check: plan $0.005 + 1 image $0.067 + gate $0.017,-judge 0.686 → 0.701, materials 0.60 → 0.69, shipped.--## 9. What a run costs and how long it takes+## 8. What a run costs and how long it takesRUNBOOK §2 gives expected cost and time per track. Use `3dcode cost <slug>` for a-run's recorded spend and `3dcode cost profiles` for profile expectations. Historical+run's recorded spend and `3dcode cost estimate` for a call's expected price. Historicalmeasurements cited elsewhere in this document are local experiment notes and arenot distributed with the repository.-## 10. Known limits+## 9. Known limits* Judge: flash is lenient/noisy on fine distinctions (overall std ≈ 0.08–0.12 atn=3); its dynamic range comes from the defect checklist. Use pro (default) or@@ -633,8 +606,7 @@ not distributed with the repository.followers through the chain); sweep is O(links² × poses).* Scenes: fps is a record only (machine- and load-dependent; the draw count is what is gated);camera-in-geometry can miss open-back enclosures.-* threejs: textures are stripped on GLB export (the texture pass re-adds them as a- derived pack); `userData.tick` cannot survive export.+* threejs: textures are stripped on GLB export; `userData.tick` cannot survive export.* agy has no per-workspace MCP: each session (Gemini-API mode, the only one the harness runs)gets a HOME of its own with the 3dcode server in it. A killed agy session books no usage (its tokens are in the envelope only). A killed codex session books an ESTIMATE(usage is per turn and `--ephemeral` leaves no rollout; `CodexEvents.estimated_usage` prices@@ -651,7 +623,7 @@ not distributed with the repository.storm-dead agent session gets the round loop's ONE transport retry (fresh key), nosingle-shot fallback (D103).-## 11. Flywheel+## 10. Flywheel`record.json` per run + git history; `3dcode flywheel export` writes sample folders(`<out>/<track>/<language>/<slug>/{code.<ext>, src/**, robot.urdf, meta.json,diff --git a/harness/docs/INSTALL.md b/harness/docs/INSTALL.mdindex ee2ed89e..409cffc2 100644--- a/harness/docs/INSTALL.md+++ b/harness/docs/INSTALL.md@@ -558,7 +558,7 @@ directory so you do not mix it into real data:cd harness3dcode make "a slow rotating neon hex grid" \--track graphics --language glsl_shader \- --generator single-shot:gemini:gemini-3.7-flash \+ --generator single-shot:gemini:gemini-3.8-flash \--rounds 0 --max-minutes 20 \--runs-dir /tmp/c3d_smoke3dcode status <slug> --runs-dir /tmp/c3d_smoke@@ -566,7 +566,7 @@ cd harnessIf node and Blender are installed, the equivalent object-track smoke is`3dcode make "a simple wooden stool" --track static_object --language blender---generator single-shot:gemini:gemini-3.7-flash --rounds 0` (~$0.1, a few+--generator single-shot:gemini:gemini-3.8-flash --rounds 0` (~$0.1, a fewminutes).Artifacts land in `<runs-dir>/<slug>/`:@@ -609,9 +609,7 @@ rm -rf harness/3dcodeverse.egg-info harness/.pytest_cache harness/.ruff_cache````~/.cache/codeverse3d` (or `cache_dir` / `C3D_CACHE_DIR`) holds only regenerable-things: `renders/` and `judge_images/` (render + montage cache), `textures/` and-`texture_plans/` (texture-pass cache — deleting these costs real money to-regenerate), `gpu_probe.json`, `browser_*.lock` (the shared+things: `renders/` and `judge_images/` (render + montage cache), `gpu_probe.json`, `browser_*.lock` (the sharedheadless-Chrome endpoint file — do not delete it while renders are running).**Your data is not in either cache.** `runs/`, `eval/bench/out/` and any exporteddiff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.mdindex 2fe8119c..277cf183 100644--- a/harness/docs/INTERFACES.md+++ b/harness/docs/INTERFACES.md@@ -18,18 +18,13 @@ test-pinned (`tests/core/test_interfaces_names.py`).* **Δ** Single-shot generation ids: `single-shot:<provider>:<model>` — handled onlyinside `tracks/generation.py` (`is_single_shot`, `single_shot_model_id`); neverregistered in `agents/`. `Spec.backends.generator` accepts any of the three.-* Image models: `models/gemini.py::GeminiImageModel` (default- `gemini-3.1-flash-image`, fallback `gemini-2.5-flash-image`); the one entry point- is `generate_with_usage(prompt, *, size=1024, n=1, seed=None, reference_images=(),- max_wait_s=None) -> (images, Usage)`, priced per GENERATED image via- `pricing.per_image_usd(size=<generated px>)` (no `ImageModel` protocol, no `generate`).## core (contracts · config · proc)```pythonfrom codeverse3d.contracts.common import TRACK_INFO, TrackInfo # {Track: TrackInfo(rubric, label, best_of_n, likeness_refs)} — THE track registryfrom codeverse3d.contracts.common import ENTRY_FILE, code_file, LANGUAGE_LABEL # {Language: "src/<entry>"}; code_file(lang) -> "code.<ext>"-from codeverse3d.contracts.spec import RunOptions # Spec.options: candidates (int|None, ≥1), texture (bool)+from codeverse3d.contracts.spec import RunOptions # Spec.options: candidates (int|None, ≥1), variant (str)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@@ -112,7 +107,7 @@ Rules that callers must know:(`-nano`, `-mini`, `-codex`, `-lite`) never inherit the parent's price — they areunknown (0.0 + warning) unless a row exists.-## cost/ (ledger · profiles · price provenance)+## cost/ (ledger · price provenance)```pythonfrom codeverse3d.cost import record_call, load_ledgerfrom codeverse3d.cost.ledger import summarise@@ -138,7 +133,7 @@ with run_ledger(ws.root, run=slug): # binds the run, points record_call a# agents.get_coding_agent returns a MeteredAgent (registry wrap, from the first call) → ambient# round/stage for the session and one source='session' row (n_calls, latency, outcome,# AgentResult.turns) — every backend is a vendor CLI whose calls the harness cannot see.- # These two (+ the image model's own row) are the ONLY ledger writers; BudgetGuard keeps no money.+ # These two are the ONLY ledger writers; BudgetGuard keeps no money.# The rule is the BACKEND, never "did a row get written while it ran": a CLI session with one# in-process tool call used to be dropped entirely.from codeverse3d.cost.context import CallContext, call_context, bound_run, context_from_label, SELF_DESCRIBING@@ -146,21 +141,13 @@ from codeverse3d.cost.ledger import bound_ledger, process_ledger_path # (Δ 20# managers holding a ContextVar token; there is no process-wide default any more — a thread that# may bill a model is spawned through proc.fan_out (which copies context), never a bare pool.# precedence: explicit > a label naming a job of its OWN (SELF_DESCRIBING = plan/judge/pairwise/- # texture/caption) > ambient (call_context) > the rest of the label > nothing. A judge or a- # texture pass that bills a model INSIDE an agent session is filed under its own stage, not the+ # caption) > ambient (call_context) > the rest of the label > nothing. A judge or a+ # captioner that bills a model INSIDE an agent session is filed under its own stage, not the# session's; a generation label yields to the session (best-of-N: kind="candidate" beats# label="baseline"); Stage.OTHER means "the label said nothing" and displaces nothing.- # labels understood: judge:<rubric>:r<NN>:s<k> · planner · pairwise:… · texture… · caption… (api-agent:<label>:t<turn> in historical ledgers only)+ # labels understood: judge:<rubric>:r<NN>:s<k> · planner · pairwise:… · caption… (api-agent:<label>:t<turn> in historical ledgers only)from codeverse3d.addons.costreport.caching import session_cache, session_keysession_cache(rows) -> [SessionCache] # per session: cold first call, cached share, saved_usd, cold_usd-from codeverse3d.cost.profiles import get_profile, PROFILES # economy | balanced | quality-get_settings().apply_profile(name, *, force=False) -> Profile- # sets default_{generator,planner,judge,captioner}, default_candidates and Settings.judge.samples- # (never the judge payload or the turn cap); a value the user stated in- # config.yaml / C3D_* survives unless force (3dcode make --profile forces).-from codeverse3d.cli._common import resolve_dial, ResolvedDial # THE resolver, one per `3dcode make`-resolve_dial(settings, profile_flag=None, *, rounds=None, candidates=None,- max_minutes=None, texture=False) -> ResolvedDialfrom codeverse3d.cli._common import resolve_variant, ResolvedVariant, record_variant, replay_variant # D105resolve_variant(settings, generator, flag=None) -> ResolvedVariant{name, version, hash, source, label}# `--variant` > settings.variant (C3D_VARIANT) > settings.variants[<generator>] (as typed, then by the served@@ -191,15 +178,10 @@ select(track, language, kind, *, signals=None, findings=(), library=None, max_sk# boosts: skill -> priority delta, clamped by effective_priority (a standing row stays below 90, a gate-fired# row never drops under it); disabled: rule ids skipped. SkillsMaterialized.variant, the skills.attached# event and the telemetry/skills.jsonl row name the variant the attach ran under- # profile/generator/planner/judge/captioner, judge_samples/judge_max_px/judge_montages/- # judge_detail_crops, agent_max_turns, rounds, candidates, texture, max_minutes.- # `--profile X` and `C3D_PROFILE=X` resolve to the SAME dial (they used to disagree on- # candidates + texture); an explicit flag beats both. Spec.options.profile always records the- # resolved name so `3dcode resume` re-applies it.from codeverse3d.models.pricing import price_provenance # (provider, model) -> PriceRow(price, match, status, checked)````3dcode cost <slug|path>…` · `3dcode cost --runs-dir <root>` · `3dcode cost cache <slug>` ·-`3dcode cost prices [--stale] [--days N] [--unverified]` · `3dcode cost profiles` · `3dcode cost estimate`.+`3dcode cost prices [--stale] [--days N] [--unverified]` · `3dcode cost estimate`.Every run is read from its ledger alone (`addons.costreport.audit.read_run` / `read_cell` /`find_runs`); `cost/reconstruct.py` and its rebuild of pre-ledger runs went on 2026-09-22.@@ -394,7 +376,7 @@ are the pure helpers `3dcode doctor` reuses for its `node` row.`tool_common.glb_path` refuses (`ToolUsageError`) when `artifacts/build.json` says the lastbuild failed — the one build status: every runtime publishes its final BuildResult there anda tool's lint refusal writes a `LintError` one (`build_last.json` is gone, 2026-09-22). Tools-never measure or texture a stale GLB; missing/unreadable status stays permissive (hand-placed GLBs).+never measure a stale GLB; missing/unreadable status stays permissive (hand-placed GLBs).```pythonfrom codeverse3d.spatial.render import render_glbfrom codeverse3d.contracts.artifacts import RENDER_MODES # ('shaded','wire','normals','silhouette','clay') — THE mode tuple (no 'depth')@@ -543,7 +525,6 @@ round_input(spec, plan, rnd, *, renders, gates, previous, extra_context, geometr# SLICE_TRACKS; eval's fixed judge (eval/bench/_fixed_eval.fixed_input, plan=None, acceptance = the brief's must_have) too. Δ 2026-09-22: replays used a dict digest of plan.json (a Z-up object read W×D×H, a shader lost# style / passes / key visuals / motion); cli/_judge.stored_plan types plan.json when record.json has no planplan_summary(plan, language) -> str # the digest for every track (object: "Overall W×H×D m" in the GLB frame);- # also the texture gate's (texturing/generate.judge_gate)from codeverse3d.judges.prompt_builder import plan_montages, render_montage, Montage # ≤5 2×2 montages (shaded/geometry/poses) + ≤2 detail# crops @≤1024px replace the sheet + the 14-view rig (D47); clay/normals views (RenderView.mode) auto-route to the GEOMETRY montage# Δ 2026-10-14 (scene): plan_montages(…, gates=()) / plan_detail_crops(shaded, *, scene, gates=(), limit) — a scene sends the@@ -730,24 +711,10 @@ post-render gates → the build's own `BuildResult.gates` (also when the build f`ReferenceJudge` (rubric `reference` for static_object; `LikenessJudge` on graphics/scene —`vlm_judge.judge_for`) and images attached to generation prompts.-## texturing/ (derived asset pack; code stays truth — object.glb is never touched)+## texturing/ (the PBR table only)```python-from codeverse3d.texturing.run import texture_pass, texture_requested, load_report-texture_requested(spec) -> bool # Uses Spec.options.texture and the supported track.- # Asked by the CLI hand-over after the run (make/resume → addons.select.package(- # texture=…), which textures the PICKED round — Δ 2026-09-22, finalise no longer does). No agent session can- # buy a pass: the texture_pass / texture_preview tools were deleted 2026-09-22.-texture_pass(ws, spec, plan, *, model_id, image_model=None, judge=True, judge_obj=None, judge_model_id=None, rubric=None,- glb_in=None, sheet=None, views=OBJECT_VIEWS_QUICK, size=1024, plan_model=None, render=None, cache_dir=None,- events=None, normalise=True) -> TextureReport # always writes record.json extra["texturing"] when a record exists-# 1 vision call material plan (cacheable) → tileable textures (mirror cross-fade, seam_score ≤ 0.08) → world-metre UV-# unwrap (planar/box/cylinder per part, tile_size_m) → artifacts/object_textured.glb → seam gate + before/after judge-# gate (ship iff Δoverall ≥ −0.01 AND materials criterion improved); record.extra["texturing"], events texture.*-from codeverse3d.texturing.plan import material_plan, default_plan, TexturePlan-from codeverse3d.texturing.generate import generate_textures # (Δ) FakeImageModel / procedural_texture- # moved to tests/texturing/conftest.py 2026-08-30 — no production path could construct them-from codeverse3d.texturing.plan import scene_texture_pack, texture_pack_prompt # 6–12 named tiles + manifest.json-# under public/textures/ for scene prompts (URL /public/textures/<name>.png)+from codeverse3d.texturing.materials import family_for, pbr_for, MATERIALS # family_for(*texts) -> FamilyMatch | None; pbr_for(family) -> Pbr | None+ # read by languages/blender; no texture is generated anywhere (the image-generation pass was removed 2026-11-03)```## record/ + addons/ + cli/@@ -761,8 +728,7 @@ from codeverse3d.record.deliverable import keep_round_artifacts, round_outputs,# round_outputs(ws, rnd) -> Path | None: artifacts/rNN/, else artifacts/ for the best round a pre-2026-09-22# record.json names, else None# build_deliverable(ws, record, round_index, *, clean=True) -> RunDeliverable: deliverable/ for ONE round —- # its commit's code + its kept files + its sheet (+ graphics: its judged frames; + a shipped texture pack- # whose report names this round's GLB); never rebuilds. Only addons.select.package calls it.+ # its commit's code + its kept files + its sheet (+ graphics: its judged frames); never rebuilds. Only addons.select.package calls it.from codeverse3d.addons import select # which round of a FINISHED run to hand over (cli/ + addons only)select.round_rows(run_dir, *, record=None) -> [RoundRow{index, kind, score (effective), passed (the judge's own# verdict for THAT round), gate_errors, build_ok, commit, cost_usd, minutes}]@@ -772,11 +738,10 @@ select.pick(run_dir, *, by="score"|"pairwise", pairwise_model=None, record=None,# wins at confidence ≥ 0.6; one paid verdict per (pair, model), cached at artifacts/judge/rAA_vs_rBB_pairwise.jsonselect.summarise(run_dir, *, record=None) -> RunSummary{rounds, stop_reason, baseline_score (r00's effective# score), picked_round, picked_score, delta, method}: selection.json's round when the run was packaged, else pick()-select.package(run_dir, round_index, *, texture=False, method="round", image_model=None) -> Path (deliverable/)- # + selection.json {round, method, scores, textured, selected_at}; texture=True runs the pass on that round's- # kept GLB unless a report already covers those bytes; a failed pass never fails the hand-over+select.package(run_dir, round_index, *, method="round") -> Path (deliverable/)+ # + selection.json {round, method, scores, selected_at}select.round_file(ws, rnd, name="object.glb") -> Path | None # the round's OWN output (round_outputs), never the- # canonical artifacts/<name> (the last build's): calibration, `3dcode judge`, `texture pass`, export, eval/bench+ # canonical artifacts/<name> (the last build's): calibration, `3dcode judge`, export, eval/benchselect.round_complexity_block(ws, rnd) -> dict | None # its own measurement's vector (legacy: measurement.json only# when the canonical build is this round's); gallery cards and dataset meta. Never record.extra["complexity"]from codeverse3d.addons.gallery.index import hero_view # (ws, rec, picked) -> (rel, label, n_views): the card image@@ -827,8 +792,8 @@ from codeverse3d.addons.gallery.urls import safe_join # (root, rel) ->from codeverse3d.addons.gallery.urls import content_type # .glb→model/gltf-binary, .py/.js/.frag→text/plain; charset=utf-8from codeverse3d.addons.dataset.index import build_index, query, summary # sqlite + parquet: adds quality_tier, gate_errors, cost_usd,# rounds, status, code_fingerprint, prompt_hash, duplicate_of, has_captions-3dcodeverse make [--profile economy|balanced|quality] [--no-pick]|resume [--no-pick]|pick|status|show|render|judge|tools|mcp- |texture {pass,scene-pack,show}|cost {<slug>,show,cache,prices,profiles,estimate}+3dcodeverse make [--no-pick]|resume [--no-pick]|pick|status|show|render|judge|tools|mcp+ |cost {<slug>,show,cache,prices,estimate}|flywheel {export,pairs,refine,caption,index}|gallery {serve,build}|skills {list,show,validate,report}|doctor # alias: 3dcode; batteries: eval/ (python -m bench.run_bench)```@@ -842,9 +807,9 @@ Event names: `run.start`, `stage.start/done`, `plan.done`, `workspace.materializ`zones.done`, `assemble.done`, `round.no_change`, `candidates.start`,`candidate.start/done/failed/retry/selected`, `resume.reconciled` (rounds, dropped, `restored_last_round`; Δ 2026-09-22 no`state_was_stale`: run_state.json keeps no copy of the round journal to go stale),-`texture.start/plan/generated/applied/gate/done`, `budget.exceeded`,+`budget.exceeded`,`finalise.rebuild`, `stop` (reason, rounds), `run.done` (status, rounds, last_score) / `run.failed`;-after the run: `pick.pairwise`, `pick.packaged`, `texture.skipped` / `texture.failed` (addons.select).+after the run: `pick.pairwise`, `pick.packaged` (addons.select).Cost events: `judge.skipped` (reason), `generate.turn_cap` (label, max_turns, turns, cost_usd);`run.done` carries the run's `cost_usd` (the ledger's) and `minutes`. Δ 2026-09-22: `cost.round` isgone — no reader, and its per-round {stage → $} restated the ledger (`summarise(rows)` by round and stage).@@ -855,9 +820,9 @@ rNN.json that carries one still loads, the key ignored). `PairwiseNote` lives itotal_usage, environment, steps (run-level StepTime rows; `minutes` = the property over all of them),prompt_hashes{contract, generate, refine, …} (Δ D107: no cookbook key), error, extra{stop_reason,rubric, budget{elapsed_min, max_minutes} (the clock), aborted_rounds?, candidates? (the-rounds/candidates.json payload), texturing?, captions?}. `total_usage` is the sum of telemetry/cost.jsonl at+rounds/candidates.json payload), captions?}. `total_usage` is the sum of telemetry/cost.jsonl atlist price — every billed row once, aborted rounds, retried sessions and billed-but-discarded round-trips-included; a texture pass a pick buys joins it when `select.package` re-packages the run.+included; what a pick buys (a pairwise verdict) joins it when `select.package` re-packages the run.Selection is stored separately; `RunRecord` carries no `best_round` field. Round outputsare read from `artifacts/rNN/`, and minutes come from `StepTime` rows. Historical status,manifest and timing migration is unsupported. A completed `status` names its stop reason:diff --git a/harness/docs/RUNBOOK.md b/harness/docs/RUNBOOK.mdindex 96e8c5dd..2f0152e5 100644--- a/harness/docs/RUNBOOK.md+++ b/harness/docs/RUNBOOK.md@@ -48,14 +48,11 @@ stops it; there is no pass / plateau / regression stop since 2026-09-22),`--candidates N` (best-of-N baseline: N parallel candidates in `<ws>/_cand/`,quick-judged, the highest quick score kept (fewer gate errors on a tie); multiplies baselinecost ≈ N; default from `settings.default_candidates`; object and graphics tracks only —-a scene writes its baseline in its stages, so `--candidates N>1` is refused there and a-profile's best-of-2 runs one), `--texture` (texture the PICKED round-after the run; see §6), `--no-pick` (package nothing: no `deliverable/`, no `selection.json` —+a scene writes its baseline in its stages, so `--candidates N>1` is refused there), `--no-pick` (package nothing: no `deliverable/`, no `selection.json` —`3dcode pick` later), `--max-minutes`, `--dim height=0.45`, `--must`,-`--must-not`, `--style`, `--tag`, `--seed` (a label: it re-keys the plan and the reference-images, nothing else is seeded by it), `--slug`, `--runs-dir`, `--force`,-`--no-run` (workspace + spec.json only — except that `--reference` still runs its-paid grounding pass first, since the grounded spec is what it writes),+`--must-not`, `--style`, `--tag`, `--seed` (a label: it re-keys the plan,+nothing else is seeded by it), `--slug`, `--runs-dir`, `--force`,+`--no-run` (workspace + spec.json only),`--variant NAME` (a per-model prompt/skill overlay — `codeverse3d/prompts/variants/<name>/` +`codeverse3d/skills/variants/<name>/`, D105 — frozen on `spec.options.variant` so `resume` and`judge` read the same files; default: `C3D_VARIANT`, else `C3D_VARIANTS` keyed by the exact@@ -64,7 +61,7 @@ refused before the run directory exists; the run table prints `variant: argon v1`--variant argon_raw` on `--language scene_blender` is RAW mode (D113): no harness bpy libraryships into the workspace and the model writes every mesh, material, light, world and motion.-Expected cost/time with gemini-3.7-flash: object tracks ≈ $0.7–0.9 and 12–36 min for+Expected cost/time with gemini-3.8-flash: object tracks ≈ $0.7–0.9 and 12–36 min forbaseline + 1 refine; best-of-2 single-shot ≈ $0.25 / 8 min; graphics single-shot≈ $0.05 / 2 min per judged round; scenes ≈ $2.3 and 30 min before the first judgedround, then ≈ $0.36 / ~7 min per refine (give scenes `--max-minutes 60`).@@ -74,7 +71,7 @@ round, then ≈ $0.36 / ~7 min per refine (give scenes `--max-minutes 60`).| id | what runs | notes ||---|---|---|| `agy:gemini-4-argon` (default) | `agy --dangerously-skip-permissions --print-timeout … --output-format json --add-dir ws --log-file trajectories/<label>_rNN/agy.log --model gemini-api://gemini-4-argon --effort high`, prompt on stdin (no `--print`: `--print -` sends "-") | Gemini-API mode only (Gemini keys required, Gemini models only): pool key, every spatial tool over MCP, priced; see gotchas below. Truncates a prompt past ~175 kB itself |-| `single-shot:gemini:gemini-3.7-flash` | one structured-output call → multi-file envelope, no tools | fastest/cheapest; baseline for "raw model" deltas |+| `single-shot:gemini:gemini-3.8-flash` | one structured-output call → multi-file envelope, no tools | fastest/cheapest; baseline for "raw model" deltas || `claude-code:<model>` | `claude -p --dangerously-skip-permissions --setting-sources project --settings '{"skillOverrides":…}' --mcp-config trajectories/<label>_rNN/mcp.json --strict-mcp-config …`, prompt on stdin, `CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1` | local subscription — test lightly; no user setting source, so `~/.claude/settings.json` (effortLevel, hooks, env) does not reach a session || `codex:<model>[@<effort>]` | `codex exec --json -C ws --sandbox workspace-write -c model_reasoning_effort=high -c skills.bundled.enabled=false -c mcp_servers.3dcode.… -`, prompt on stdin | subscription; MCP tools need `default_tools_approval_mode="approve"` (harness passes it); reasoning effort is always stated (`Settings.agents.codex_reasoning_effort`, default `high`; `codex:gpt-5.6-sol@medium` per id, `""` to defer to `~/.codex/config.toml`) || `gemini:* / anthropic:* / openai:*` | ChatModel for planner / judge / captioner / single-shot | Anthropic/OpenAI untested live here |@@ -141,7 +138,7 @@ the last events.**directories** too, so every link works: contact sheet, full-size renders, `record.json`,`plan.json`/`spec.json`, the `src/` tree (browsable, line-numbered, `raw` = text/plain),`object.glb` (orbit viewer on the vendored three.js — no network), articulation sheets,-`preview.gif`, frames, textures. The page has a live summary strip (n = judged · unjudged ·+`preview.gif`, frames. The page has a live summary strip (n = judged · unjudged ·error, mean/median score, total $, wall clock — **recomputed per filter**; no pass rate: a runis not passed or failed),filters (track / language / tier / backend / verdict / battery + text search over@@ -158,7 +155,7 @@ a run with no `record.json` yet shows as a *pending* card and a half-written one*broken*, never as a crash. The server binds `127.0.0.1` and refuses any other addressunless you type `--host` yourself; it never serves a path outside the declared roots.-## 5. Resume, re-render, re-judge, texture, export+## 5. Resume, re-render, re-judge, export```bash3dcode resume <slug> [--candidates N] [--no-pick]@@ -178,17 +175,15 @@ unless you type `--host` yourself; it never serves a path outside the declared r# `resume --force` regenerates a stage under them: it ALWAYS archives the round# journal + record.json to rounds/pre_force/ (spec changed or not) and the run# starts again at round 0, no stage frozen-3dcode pick <slug> [--by score|pairwise] [--round N] [--texture] [--judge MODEL]+3dcode pick <slug> [--by score|pairwise] [--round N] [--judge MODEL]# hand over a round: deliverable/ + selection.json (addons/select). score =# highest effective score, ties → fewer gate errors → the earlier round;# pairwise = the pairwise judge between the top two when within 0.03 (one- # paid verdict per pair, cached); --round N = that round; --texture = the- # texture pass on it first. `make`/`resume` run `pick --by score` for you+ # paid verdict per pair, cached); --round N = that round.+ # `make`/`resume` run `pick --by score` for you3dcode render <slug> [--round N] [--mode shaded|wire|normals|clay|silhouette] [--out dir]3dcode judge <slug> [--round N] [--rubric static_object] [--model gemini:gemini-3.1-pro-preview] [--n 3] [--thinking off|low|medium|high]# re-judges a round's recorded renders → artifacts/judge/rNN_cli.json-3dcode texture pass <slug> [--no-judge] [--model …] [--judge-model …] [--image-model …] [--size 1024]-3dcode texture scene-pack <slug> [--n 10] · 3dcode texture show <slug>3dcode tools list [--cards] · 3dcode tools measure --workspace runs/<slug> · 3dcode tools gl_frames --workspace … --json '{"times":[0,1,2.5]}'# panel says ok | FAIL (the verdict) | error (the tool could not run);# exit 1 on either non-ok state — `scene_probe` included since 2026-09-02@@ -299,26 +294,11 @@ threads' included — refuse new ones, record the stop, and end within `proc.STOif a worker is inside a long model call. Before 2026-10-13 a SIGTERM left the agy session runningand billing.-## 6. Texture pass--`3dcode pick <slug> --texture` (or `--texture` on `make`, which picks after the run) textures the-PICKED round's own `artifacts/rNN/object.glb` — once per round: a pass that already started from-those bytes is re-used, never re-bought; `3dcode texture pass <slug>` textures the same picked-round's GLB. Either way: one VLM material plan →-tileable texture images (gemini-3.1-flash-image, ~$0.07/tile, cached by prompt) →-world-metre UVs → `artifacts/object_textured.glb` → seam gate + before/after judge-gate (ships only when the score does not drop and the materials criterion improves).-`record.extra["texturing"]` holds shipped/delta/cost; `3dcode texture show <slug>`-prints it. Scenes: `3dcode texture scene-pack <slug>` writes 6–12 named tiles +-manifest under `public/textures/` for zone prompts. There is no texture tool in an-agent session (the `texture_pass` / `texture_preview` tools were deleted 2026-09-22:-one call in 616 recorded sessions).--## 7. Benchmarks+## 6. Benchmarks```bashcd ../eval # the battery launcher is the evaluation's (`3dcode bench` until 2026-09-22)-python -m bench.run_bench bench/prompts/static_objects_v1.yaml --generator single-shot:gemini:gemini-3.7-flash \+python -m bench.run_bench bench/prompts/static_objects_v1.yaml --generator single-shot:gemini:gemini-3.8-flash \--judge gemini:gemini-3.1-pro-preview --rounds 2 --parallel 4 [--tier easy] [--id furn_easy_stool] [--limit 6] [--out bench/out/x]python -m bench.report bench/out/static_objects_v1 # report.md + self-contained report.html (gallery)cd ../harness@@ -335,7 +315,7 @@ parks until it recovers instead; `--no-preflight` skips the check. Cells that aprovider outage kills anyway are recorded `infra_failed`, excluded from every rate,and re-run with `--redo-status infra_failed` (see `eval/docs/EVAL.md` §7).-### 7.v Templates are read at render time — a new required variable breaks live workers like a moved name+### 6.v Templates are read at render time — a new required variable breaks live workers like a moved nameMeasured 2026-08-26 13:45: the fewer-turns landing added `{{ turn_discipline }}` to four statictemplates; the four h2h drivers started 50 minutes earlier still ran the old python (no such@@ -344,7 +324,7 @@ undefined`, four prompts recorded `error` at 0 min. Rule: every new template vaguarded `{% if name is defined and name %}` for at least one wave, and the "Landing sourcechanges while a wave is running" rule covers `codeverse3d/prompts/**` as well as moved names.-### 7.u `run_bench --redo-status` starts the redo fresh (since c828637)+### 6.u `run_bench --redo-status` starts the redo fresh (since c828637)Before it, a redo resumed the old workspace — old `spec.json` (the old `max_minutes`) and theold clock — so a `budget` row redone with `--max-minutes 120` was over budget before its first@@ -358,7 +338,7 @@ flag — so a "fresh" rerun carried the old spec, rounds, spend and clock and apresults row for the same tree. `compare_backends --no-resume` kept its flag (it is documentedand has three readers) and now archives the harness cell's `run/` before re-running it.-### 7.w One driver per out dir — a second `run_bench` re-runs what the first is still running+### 6.w One driver per out dir — a second `run_bench` re-runs what the first is still runningMeasured 2026-08-26 (refs_v1_graphics): a redo driver (`--redo-status budget`) started while theoriginal driver was still working the same battery resumed a prompt the first driver had in@@ -370,7 +350,7 @@ with a live driver; wait for the driver to exit (exact pid, `kill -0`), then red`--redo-status infra_failed,error,budget --max-minutes 120`. `run_bench` grew `--max-minutes`the same day so the storm budget no longer needs `ab_plan`.-### 7.x Size `--max-minutes` to the weather+### 6.x Size `--max-minutes` to the weather`--max-minutes 60` is the right ceiling on a healthy provider. Under a 503 storm every modelcall waits through the retry budget first, an agent session spends its wall clock on 15–23@@ -382,7 +362,7 @@ turns, and a hard prompt burns the whole hour without one judged round — measumodel, produced the zero — check `cell.json`'s `error`). The rows' `minutes` stay comparable acrossweather: they leave the provider's errors out (docs/COST.md §31); the ceiling does not.-## 8. Extending (plugin paths)+## 7. Extending (plugin paths)* **New language**: enum in `contracts/common.py::Language` (+ `TRACK_LANGUAGES`,`ENTRY_FILE`, `LANGUAGE_LABEL`), frame in `conventions.LANGUAGE_FRAME`;@@ -411,7 +391,7 @@ weather: they leave the provider's errors out (docs/COST.md §31); the ceiling dscenario to `SCENARIOS`.* **A per-model variant** (D105): `codeverse3d/prompts/variants/<name>/variant.toml` (`[variant]`name = the directory name, version, generators, description; optional `[knobs]` — `skills_max`,- `skills_only`, `scene_lib` (D113) — applied like a profile, a user-stated field wins) beside the prompt files that+ `skills_only`, `scene_lib` (D113) — applied as defaults, a user-stated field wins) beside the prompt files thatshadow the base ones by relative path (a template there may `include` a base file), and`codeverse3d/skills/variants/<name>/` for bundles that shadow base bundles by name, their`_claims/`, and `routes.toml` (`[[boost]]` skill + delta, `[[disable]]` rule, `[[route]]` extradiff --git a/harness/docs/RUN_LAYOUT.md b/harness/docs/RUN_LAYOUT.mdindex df36fb4a..201e743c 100644--- a/harness/docs/RUN_LAYOUT.md+++ b/harness/docs/RUN_LAYOUT.md@@ -7,7 +7,7 @@ three separate buckets:| bucket | question | contents ||---|---|---|| `deliverable/` | **what did I get?** | ONE round, the one a pick chose (`3dcode pick`; `3dcode make` picks by score after the run): its code snapshot, its artifact (`object.glb` / `robot.urdf` + `meshes/` / `frames/` + `preview.gif` / the scene bundle), its contact sheet, `captions.json`, `manifest.json` |-| `evidence/` (= `artifacts/`) | **why should I believe it?** | every round's own build (`rNN/`), `renders/rNN/`, `gates/rNN/`, `judge/rNN.json`, `measurement.json`, `census.json`, `textures/`, `tool_renders/` |+| `evidence/` (= `artifacts/`) | **why should I believe it?** | every round's own build (`rNN/`), `renders/rNN/`, `gates/rNN/`, `judge/rNN.json`, `measurement.json`, `census.json`, `tool_renders/` || `telemetry/` | **what did it cost and how was it configured?** | `cost.jsonl` (the ledger), `settings.json`, `cost.json`, plus `events.jsonl`, `run_state.json`, `stages/`, `trajectories/` |The run's **identity** stays at the root, where every tool has always looked for it.@@ -22,13 +22,11 @@ runs/<slug>/rounds/rNN.json + each round's commit); the JSONL event logsrc/ agent-authored RAW code, the live working tree (git; commits: spec, skeleton, pre:/agent:<label>around every session, rNN <kind>; ends at the LAST round)- public/ (scene) compiled assets public/assets/<snake>.glb; (textured scenes) public/textures/*.png + manifest.json+ public/ (scene) compiled assets public/assets/<snake>.glbdeliverable/ (a) the hand-over — one round, written by a pickevidence/ -> artifacts/ (b) the proofartifacts/ the LAST round's build: object.glb object.stl|step robot.urdf meshes/ build.json census.json- measurement.json …; graphics: frames/fNN_tT.png frames_sheet.png preview.gif metrics.json;- texturing (a pick's --texture): object_textured.glb textures/{<id>.png, texture_plan.json,- texturing.json, gate/}+ measurement.json …; graphics: frames/fNN_tT.png frames_sheet.png preview.gif metrics.jsonrNN/ each round's own build, copied when it built (below)renders/rNN/ view_<name>.png sheet.png views.json (judge flags) (+ poses/ articulated; <cam>_t<t>.pngmetrics.json scenes; frame_t<t>.png metrics.json graphics — the round's own frame metrics)@@ -60,7 +58,7 @@ Only **one** physical copy of anything exists; the second name is a relativesymlink. Which side is physical was not a matter of taste:* **`artifacts/` stays physical, `evidence/` is the alias.** Six packages- (`spatial`, `languages`, `tracks`, `texturing`, `judges`, `flywheel`) write+ (`spatial`, `languages`, `tracks`, `judges`, `flywheel`) writeinto `ws.artifacts`, and ~50 completed runs have absolute `artifacts/...`paths frozen inside `record.json`, `rounds/rNN.json` and `views.json`.Moving the bytes would either break those paths or force a rewrite of files@@ -114,23 +112,22 @@ Built for ONE round by `codeverse3d.addons.select.package(run_dir, round)` →`record.deliverable.build_deliverable(ws, record, round)` — from that round's commit and its`artifacts/rNN/`, never a rebuild. `3dcode make` / `resume` package `select.pick(by="score")`after the run (highest effective judged score, ties → fewer gate errors → the earlier round;-`--no-pick` skips it); `3dcode pick <slug> [--by pairwise] [--round N] [--texture]` re-packages+`--no-pick` skips it); `3dcode pick <slug> [--by pairwise] [--round N]` re-packagesany round:```deliverable/src/** raw code at the round's commit (public/** too, for scenes)- object.glb object.stl object.step object_textured.glb+ object.glb object.stl object.steprobot.urdf meshes/<link>.glb (articulated)frames/*.png frames_sheet.png preview.gif (graphics: the round's judged frames)- textures/<id>.png (when a texture pass of THIS round shipped)sheet.png the round's contact sheetcaptions.json {detailed, instruction, factory} when captionedmanifest.json every file with role, size, sha256```Beside `record.json`, `selection.json` says which round that is and why: `{round, method-(score | pairwise | round), scores (every round's effective score), textured, selected_at}`.+(score | pairwise | round), scores (every round's effective score), selected_at}`.`addons.select.summarise` reads it, so every reader reports the round that was handed over.Every file is hashed with sha256 and is a real copy (never a hard link), so editing the@@ -143,7 +140,7 @@ produces no diff.* **`settings.json`** (`SettingsSnapshot`) — model id, thinking level,temperature and judge sample count per role; rounds + budget; candidates;- seed; texture flag; rubric name **and its content hash**; prompt / skill+ seed; rubric name **and its content hash**; prompt / skillhashes; tool versions (python, blender, node, three, chrome, puppeteer);harness version + git sha; key-pool size; **price-table hash**; resolvedrender and limit settings. Sampling values are what the track stamped as it ran,@@ -161,7 +158,7 @@ produces no diff.ledger's own `summarise`: the total (= `record.total_usage`, the ledger's sum at listprice — post-run work a pick buys joins it the next time the run is packaged), tokens, perstage (`plan / assets / env / zones / baseline / refine / repair / judge / pairwise /- texture / …`), per role, per model, per round, and the run's minutes against+ …`), per role, per model, per round, and the run's minutes against`max_minutes`.## `record.json`diff --git a/harness/tests/conftest.py b/harness/tests/conftest.pyindex 94e5a8ed..7000813f 100644--- a/harness/tests/conftest.py+++ b/harness/tests/conftest.py@@ -13,9 +13,7 @@ from codeverse3d.workspace import Workspace@pytest.fixture(autouse=True)def _fresh_settings():- """`3dcode make --profile X` applies the dial to the cached Settings singleton — right for- a process that runs one run, but in the test process it leaked into every later test on the- same xdist worker (`--profile quality` changed the next test's default max_minutes)."""+ """Settings is a cached singleton: a test that edits it must not leak into the next test on the same xdist worker."""from codeverse3d.config import get_settingsget_settings.cache_clear()diff --git a/harness/tests/core/test_cli_render_size.py b/harness/tests/core/test_cli_render_size.pyindex 7ebc9796..79dcfa9e 100644--- a/harness/tests/core/test_cli_render_size.py+++ b/harness/tests/core/test_cli_render_size.py@@ -52,7 +52,7 @@ def captured(monkeypatch) -> dict[str, Any]:def _run(runs: Path, slug: str, language: Language, track: Track) -> None:ws = Workspace(runs / slug).create()ws.write_json(ws.spec_path, Spec(id=slug, track=track, language=language, prompt="a stool",- backends=Backends(generator="gemini-cli:gemini-3.6-flash")))+ backends=Backends(generator="gemini-cli:gemini-3.8-flash")))(ws.artifacts / "object.glb").write_bytes(b"glTF\x02\x00\x00\x00")diff --git a/harness/tests/core/test_contract_additions.py b/harness/tests/core/test_contract_additions.pyindex 9441935d..7d76ced7 100644--- a/harness/tests/core/test_contract_additions.py+++ b/harness/tests/core/test_contract_additions.py@@ -12,7 +12,7 @@ def test_spec_options_do_not_change_the_plan_stage_hash():from codeverse3d.tracks.lifecycle import plan_stage_inputsplain = Spec(id="x", track=Track.STATIC_OBJECT, language=Language.BLENDER, prompt="a chair")- opted = plain.model_copy(update={"options": RunOptions(candidates=4, texture=True)})+ opted = plain.model_copy(update={"options": RunOptions(candidates=4)})assert hash_inputs(plan_stage_inputs(plain)) == hash_inputs(plan_stage_inputs(opted))@@ -24,7 +24,7 @@ def test_records_written_before_the_2026_08_30_field_retirements_still_load():d = Spec(id="x", track=Track.STATIC_OBJECT, language=Language.BLENDER, prompt="a chair").model_dump(mode="json")d.pop("options")s2 = Spec(**d) # old spec.json without options still parses- assert s2.options.candidates is None and s2.options.texture is False+ assert s2.options.candidates is Noners = RenderSet.model_validate({"renderer": "blender", "turntable": "renders/turntable.mp4","contact_sheet": "renders/sheet.png"})diff --git a/harness/tests/core/test_names.py b/harness/tests/core/test_names.pyindex 67b0cd6a..83f06832 100644--- a/harness/tests/core/test_names.py+++ b/harness/tests/core/test_names.py@@ -115,15 +115,9 @@ def test_one_instance_rule_for_every_reader():assert _canon_target("leg_1", {"leg": "Leg"}) == "Leg_1"-def test_one_part_rule_for_the_texture_pass_and_the_normaliser():- """N4: the texture pass stripped an instance suffix only when 2+ copies existed and the- normaliser never did, so a single ``Arm-2`` the contract gate accepts went untextured and- instanced legs kept their default factors. Both read ``conventions.part_key`` now."""- from codeverse3d.texturing.apply import node_part_lookup-+def test_one_part_rule_strips_an_instance_suffix_even_for_a_single_copy():+ """N4: a single ``Arm-2`` the contract gate accepts maps to its plan part too — ``conventions.part_key``."""plan = {"leg", "seat", "arm", "handle", "link", "cpu_2"}rows = {"Leg_0": "leg", "Arm-2": "arm", "Handle.001": "handle", "Link__2": "link", "Leg_0__1": "leg","Seat": "seat", "CPU_2": "cpu_2", "Shelf": None}assert {n: part_key(n, plan) for n in rows} == rows- parts = {k: k.upper() for k in plan}- assert node_part_lookup(list(rows), parts)["Arm-2"] == "ARM"diff --git a/harness/tests/core/test_run_layout.py b/harness/tests/core/test_run_layout.pyindex d08a4cf0..89267c48 100644--- a/harness/tests/core/test_run_layout.py+++ b/harness/tests/core/test_run_layout.py@@ -76,7 +76,7 @@ def _moved_run(tmp_path: Path):sheet_a = a / "artifacts" / "renders" / "r01" / "sheet.png"sheet_a.write_bytes(b"PNG")spec = Spec(id="run1", track=Track.STATIC_OBJECT, language=Language.BLENDER,- prompt="a wooden chair", backends=Backends(generator="gemini-cli:gemini-3.6-flash"))+ prompt="a wooden chair", backends=Backends(generator="gemini-cli:gemini-3.8-flash"))rec = RunRecord(spec=spec, workspace=str(a), status=RunStatus.MAX_ROUNDS,rounds=[RoundRecord(index=0, kind="generate",judgment=Judgment(rubric="r", scores={}, overall=0.6, passed=False),diff --git a/harness/tests/cost/conftest.py b/harness/tests/cost/conftest.pyindex 55147619..deaa4375 100644--- a/harness/tests/cost/conftest.py+++ b/harness/tests/cost/conftest.py@@ -18,10 +18,10 @@ def fake_run(tmp_path: Path) -> Path:"""plan + one gemini-cli baseline session + one judge verdict, each a ledger row."""ws = tmp_path / "fake_run"ledger = ws / "telemetry" / "cost.jsonl"- flash = {"backend": "gemini", "model": "gemini-3.7-flash"}+ flash = {"backend": "gemini", "model": "gemini-3.8-flash"}record_call(Usage(**flash, input_tokens=4_000, output_tokens=900, latency_ms=12_000), run=ws.name,stage="plan", label="planner", ledger=ledger)- record_call(Usage(backend="gemini-cli", model="gemini-3.7-flash", input_tokens=30_000, cached_tokens=10_000,+ record_call(Usage(backend="gemini-cli", model="gemini-3.8-flash", input_tokens=30_000, cached_tokens=10_000,output_tokens=300, latency_ms=30_000), run=ws.name, round=0, stage="baseline",label="baseline", source="session", n_calls=2, ledger=ledger)record_call(Usage(backend="gemini", model="gemini-3.1-pro-preview", input_tokens=12_000, output_tokens=1_000,diff --git a/harness/tests/cost/test_audit_read.py b/harness/tests/cost/test_audit_read.pyindex a9d76c03..61a23d0d 100644--- a/harness/tests/cost/test_audit_read.py+++ b/harness/tests/cost/test_audit_read.py@@ -64,7 +64,7 @@ def test_a_losing_candidate_is_waste(fake_run: Path, tmp_path: Path):shutil.copytree(fake_run, ws)(ws / "rounds").mkdir(exist_ok=True)(ws / "rounds" / "candidates.json").write_text(json.dumps({"n": 2, "selected": 1}))- usage = Usage(backend="gemini-cli", model="gemini-3.7-flash", input_tokens=10_000, output_tokens=500)+ usage = Usage(backend="gemini-cli", model="gemini-3.8-flash", input_tokens=10_000, output_tokens=500)for k in (0, 1):record_call(usage, stage=Stage.CANDIDATE, round=0, label=f"baseline_c{k}", source="session",ledger=ws / "telemetry" / "cost.jsonl")diff --git a/harness/tests/cost/test_audit_report.py b/harness/tests/cost/test_audit_report.pyindex 907d3909..82155331 100644--- a/harness/tests/cost/test_audit_report.py+++ b/harness/tests/cost/test_audit_report.py@@ -19,12 +19,12 @@ def test_a_run_that_booked_no_money_still_reports(tmp_path: Path):ws = tmp_path / "free_run"ws.mkdir()(ws / "record.json").write_text(json.dumps({- "spec": {"track": "static_object", "language": "blender", "backends": {"generator": "gemini-cli:gemini-3.7-flash"}},+ "spec": {"track": "static_object", "language": "blender", "backends": {"generator": "gemini-cli:gemini-3.8-flash"}},"status": "failed", "rounds": [], "total_usage": {}, "extra": {}}))ledger = ws / "telemetry" / "cost.jsonl"ledger.parent.mkdir()ledger.write_text(json.dumps({"run": ws.name, "round": 0, "stage": "baseline", "role": "generator", "backend": "gemini-cli",- "provider": "gemini", "model": "gemini-3.7-flash", "cost_usd": 0.0}) + "\n")+ "provider": "gemini", "model": "gemini-3.8-flash", "cost_usd": 0.0}) + "\n")audit = audit_runs([tmp_path])assert audit.n_runs == 1 and audit.total_usd == 0assert "0%" in console(audit) and "# Cost audit" in markdown(audit)@@ -46,7 +46,7 @@ def test_a_lower_scoring_round_is_not_waste_but_a_repair_that_never_built_is(fakledger = ws / "telemetry" / "cost.jsonl"ledger.parent.mkdir(exist_ok=True)ledger.write_text("\n".join(json.dumps({"run": ws.name, "round": i, "stage": stage, "role": "generator",- "label": label, "model": "gemini-3.7-flash", "cost_usd": 0.05})+ "label": label, "model": "gemini-3.8-flash", "cost_usd": 0.05})for i, stage, label in ((1, "refine", "refine"), (2, "repair", "r02_refine_repair1")))+ "\n")kinds = audit_runs([ws]).waste_by_kind()diff --git a/harness/tests/cost/test_cli.py b/harness/tests/cost/test_cli.pyindex 08a24ddc..1344fcca 100644--- a/harness/tests/cost/test_cli.py+++ b/harness/tests/cost/test_cli.py@@ -24,10 +24,10 @@ def test_cost_show_on_an_empty_tree_fails_cleanly(tmp_path: Path):def test_cost_prices_and_estimate():r = runner.invoke(app, ["cost", "prices", "--provider", "gemini"])- assert r.exit_code == 0 and "gemini:gemini-3.7-flash" in r.stdout and "verified" in r.stdout- r = runner.invoke(app, ["cost", "estimate", "gemini:gemini-3.7-flash", "--in", "100000", "--out", "1000"])+ assert r.exit_code == 0 and "gemini:gemini-3.8-flash" in r.stdout and "verified" in r.stdout+ r = runner.invoke(app, ["cost", "estimate", "gemini:gemini-3.8-flash", "--in", "100000", "--out", "1000"])assert r.exit_code == 0 and "$0.0788" in r.stdout- r = runner.invoke(app, ["cost", "estimate", "gemini:gemini-3.7-flash", "--in", "12000", "--images", "8"])+ r = runner.invoke(app, ["cost", "estimate", "gemini:gemini-3.8-flash", "--in", "12000", "--images", "8"])assert r.exit_code == 0 and "~22,320 in" in r.stdout, r.stdout # 12 000 + 8 x 1 290@@ -52,7 +52,7 @@ def test_the_ledger_is_the_money(fake_run: Path):"""The ledger rows are the money, whatever the record says (D84)."""_live_ledger(fake_run, [{"run": fake_run.name, "round": 0, "stage": "baseline", "role": "generator",- "backend": "gemini", "provider": "gemini", "model": "gemini-3.7-flash",+ "backend": "gemini", "provider": "gemini", "model": "gemini-3.8-flash","input_tokens": 30_000, "cached_tokens": 10_000, "output_tokens": 300,"cost_usd": 0.0201, "price_source": "exact"},{"run": fake_run.name, "round": 0, "stage": "judge", "role": "judge",@@ -66,7 +66,7 @@ def test_the_ledger_is_the_money(fake_run: Path):def test_cost_reports_the_calls_per_key_when_the_ledger_recorded_them(fake_run: Path, tmp_path: Path):base = {"run": fake_run.name, "round": 0, "stage": "baseline", "role": "generator", "backend": "gemini",- "provider": "gemini", "model": "gemini-3.7-flash", "input_tokens": 1_000, "output_tokens": 10,+ "provider": "gemini", "model": "gemini-3.8-flash", "input_tokens": 1_000, "output_tokens": 10,"cost_usd": 0.001, "price_source": "exact"}_live_ledger(fake_run, [dict(base, key="…k1", attempts=1), dict(base, key="…k1", attempts=3),dict(base, key="…k2", attempts=1)])@@ -80,10 +80,10 @@ def test_cost_reports_the_calls_per_key_when_the_ledger_recorded_them(fake_run:def test_cost_cache_reports_the_cold_head_of_every_session(fake_run: Path):_live_ledger(fake_run, [{"run": "x", "round": 0, "stage": "baseline", "label": "api-agent:baseline:t0",- "provider": "gemini", "model": "gemini-3.7-flash", "input_tokens": 12_000,+ "provider": "gemini", "model": "gemini-3.8-flash", "input_tokens": 12_000,"cached_tokens": 0, "cost_usd": 0.009, "price_input": 0.75, "price_cached": 0.075},{"run": "x", "round": 0, "stage": "baseline", "label": "api-agent:baseline:t1",- "provider": "gemini", "model": "gemini-3.7-flash", "input_tokens": 20_000,+ "provider": "gemini", "model": "gemini-3.8-flash", "input_tokens": 20_000,"cached_tokens": 12_000, "cost_usd": 0.007, "price_input": 0.75, "price_cached": 0.075},])r = runner.invoke(app, ["cost", "cache", str(fake_run)])diff --git a/harness/tests/cost/test_context.py b/harness/tests/cost/test_context.pyindex f7ea3663..0b75e2ea 100644--- a/harness/tests/cost/test_context.py+++ b/harness/tests/cost/test_context.py@@ -21,7 +21,6 @@ def test_label_tells_stage_role_and_round():assert c.stage is Stage.JUDGE and c.role is Role.JUDGE and c.round == 2assert context_from_label("planner-retry").stage is Stage.PLANassert context_from_label("pairwise:0v1:fwd").stage is Stage.PAIRWISE- assert context_from_label("texture_plan").stage is Stage.TEXTUREassert context_from_label("captioner").role is Role.CAPTIONERassert context_from_label("").stage is Noneassert context_from_label("baseline_repair1").stage is Stage.REPAIR # repair wins@@ -40,10 +39,6 @@ def test_session_beats_a_generation_label_a_named_job_beats_the_session_explicitassert forced.stage is Stage.REPAIR and forced.round == 9# a spatial tool that bills a model inside a refine session is not a refine callwith call_context(round=2, stage=Stage.REFINE, role=Role.GENERATOR, label="refine_seat"):- tex = attribute(label="texture_plan")- assert tex.stage is Stage.TEXTURE and tex.role is Role.OTHER and tex.round == 2- gate = attribute(label="texture_gate")- assert gate.stage is Stage.TEXTURE and gate.role is Role.JUDGEverdict = attribute(label="judge:static_object:r02:s0")assert verdict.stage is Stage.JUDGE and verdict.role is Role.JUDGE and verdict.round == 2cap = attribute(label="caption:best")diff --git a/harness/tests/cost/test_guard.py b/harness/tests/cost/test_guard.pyindex 7953ac77..16aacae8 100644--- a/harness/tests/cost/test_guard.py+++ b/harness/tests/cost/test_guard.py@@ -17,8 +17,3 @@ def test_estimate_from_text_and_images():# a token count and images add up: `cost estimate --in 12000 --images 8` dropped the imagesest = estimate_call("gemini:gemini-3.1-pro-preview", input_tokens=12_000, n_images=8)assert est.input_tokens == 12_000 + image_tokens(8)---def test_estimate_of_an_image_model_uses_the_per_image_price():- est = estimate_call("gemini:gemini-3.1-flash-image", input_tokens=500, n_images_out=2)- assert est.usd == pytest.approx(500 * 0.5 / 1e6 + 2 * 0.067)diff --git a/harness/tests/cost/test_instrument.py b/harness/tests/cost/test_instrument.pyindex 520a2e38..0c6d9cb9 100644--- a/harness/tests/cost/test_instrument.py+++ b/harness/tests/cost/test_instrument.py@@ -19,7 +19,7 @@ from codeverse3d.cost.types import Role, Stagedef _usage(**kw: object) -> Usage:- base = {"backend": "gemini", "model": "gemini-3.7-flash", "input_tokens": 12_000,+ base = {"backend": "gemini", "model": "gemini-3.8-flash", "input_tokens": 12_000,"cached_tokens": 8_000, "output_tokens": 300, "latency_ms": 1234}base.update(kw)return Usage(**base) # type: ignore[arg-type]@@ -27,7 +27,7 @@ def _usage(**kw: object) -> Usage:class FakeChat:provider = "gemini"- model = "gemini-3.7-flash"+ model = "gemini-3.8-flash"def __init__(self, error: Exception | None = None):self.error = error@@ -35,7 +35,7 @@ class FakeChat:@propertydef id(self) -> str:- return "gemini:gemini-3.7-flash"+ return "gemini:gemini-3.8-flash"def generate(self, request: ChatRequest) -> ChatResponse:self.requests.append(request)@@ -48,7 +48,7 @@ class FakeAgent:"""A backend whose individual calls already reach the ledger."""kind = "self-metering"- model = "gemini:gemini-3.6-flash"+ model = "gemini:gemini-3.8-flash"def __init__(self, chat, turns: int = 3):self.chat, self.turns, self.seen_turns = chat, turns, 0@@ -101,7 +101,7 @@ def test_both_registries_hand_out_metered_backends(monkeypatch: pytest.MonkeyPatmonkeypatch.setattr(model_registry, "build_chat_model", lambda mid: FakeChat())model_registry.get_chat_model.cache_clear()try:- assert isinstance(model_registry.get_chat_model("gemini:gemini-3.7-flash"), MeteredChatModel)+ assert isinstance(model_registry.get_chat_model("gemini:gemini-3.8-flash"), MeteredChatModel)finally:model_registry.get_chat_model.cache_clear()@@ -120,7 +120,7 @@ def test_the_proxy_forwards_everything_else():chat = FakeChat()chat.pool = "the-key-pool" # type: ignore[attr-defined]m = MeteredChatModel(chat)- assert m.id == "gemini:gemini-3.7-flash" and m.provider == "gemini"+ assert m.id == "gemini:gemini-3.8-flash" and m.provider == "gemini"assert m.pool == "the-key-pool"agent = MeteredAgent(FakeAgent(chat))assert agent.kind == "self-metering" and agent.available() == (True, "ok")@@ -160,7 +160,7 @@ def test_a_cli_session_is_recorded_even_when_a_tool_bills_a_model_inside_it(tmp_"""An unrelated inner model row never suppresses the CLI session."""def inner_model_call() -> None:MeteredChatModel(FakeChat()).generate(- ChatRequest(messages=[ChatMessage.user("x")], label="texture_plan"))+ ChatRequest(messages=[ChatMessage.user("x")], label="caption:best"))with run_ledger(tmp_path, run="r1"):MeteredAgent(SideEffectCliAgent(FakeChat(), inner_model_call)).run(@@ -170,7 +170,7 @@ def test_a_cli_session_is_recorded_even_when_a_tool_bills_a_model_inside_it(tmp_session = next(r for r in rows if r.source == "session")assert session.backend == "gemini-cli" and session.input_tokens == 50_000tool = next(r for r in rows if r.source != "session")- assert tool.stage is Stage.TEXTURE # and it is NOT filed under the session's stage+ assert tool.stage is Stage.CAPTION # and it is NOT filed under the session's stage# ------------------------------------------------------------------- nesting / parallelism@@ -247,8 +247,8 @@ def test_a_late_hedge_loser_keeps_its_stage_role_and_round(tmp_path: Path):loser_usage = _usage(cost_usd=0.30)class Hedging:- provider, model = "gemini", "gemini-3.7-flash"- id = "gemini:gemini-3.7-flash"+ provider, model = "gemini", "gemini-3.8-flash"+ id = "gemini:gemini-3.8-flash"late: threading.Thread | None = Nonedef generate(self, req):diff --git a/harness/tests/cost/test_ledger.py b/harness/tests/cost/test_ledger.pyindex d45e31e4..601460af 100644--- a/harness/tests/cost/test_ledger.py+++ b/harness/tests/cost/test_ledger.py@@ -10,7 +10,7 @@ from codeverse3d.cost.ledger import existing_ledger_path, open_run_ledgerdef _usage(**kw: object) -> Usage:- base = {"backend": "gemini", "model": "gemini-3.7-flash", "input_tokens": 100_000,+ base = {"backend": "gemini", "model": "gemini-3.8-flash", "input_tokens": 100_000,"cached_tokens": 80_000, "output_tokens": 1_000}base.update(kw)return Usage(**base) # type: ignore[arg-type]diff --git a/harness/tests/cost/test_live.py b/harness/tests/cost/test_live.pyindex 3723bc08..b8bc1f95 100644--- a/harness/tests/cost/test_live.py+++ b/harness/tests/cost/test_live.py@@ -41,8 +41,8 @@ def test_estimate_is_within_15_percent_of_the_bill():from codeverse3d.models import get_chat_modeltext = _stable_text()[:20_000]- est = estimate_call("gemini:gemini-3.7-flash", prompt=text, output_tokens=40)- usage = _send(get_chat_model("gemini:gemini-3.7-flash"),+ est = estimate_call("gemini:gemini-3.8-flash", prompt=text, output_tokens=40)+ usage = _send(get_chat_model("gemini:gemini-3.8-flash"),text + "\n\nReply with ONE JSON object {\"ok\": true}.")assert abs(est.input_tokens - usage.input_tokens) / usage.input_tokens < 0.15@@ -63,7 +63,7 @@ def test_a_metered_run_reconciles_with_its_own_record(tmp_path: Path):runs = tmp_path / "runs"r = CliRunner().invoke(app, ["make", "a smooth grey ceramic bowl", "--track", "static_object", "--language", "blender",- "--generator", "single-shot:gemini:gemini-3.7-flash", "--judge", "gemini:gemini-3.7-flash",+ "--generator", "single-shot:gemini:gemini-3.8-flash", "--judge", "gemini:gemini-3.8-flash","--rounds", "0", "--max-minutes", "15","--runs-dir", str(runs), "--slug", "cost_live_bowl"])assert r.exit_code in (0, 1), r.output # a failed judge/build is still a metered rundiff --git a/harness/tests/cost/test_price_hygiene.py b/harness/tests/cost/test_price_hygiene.pyindex 66d1d0e6..854adbba 100644--- a/harness/tests/cost/test_price_hygiene.py+++ b/harness/tests/cost/test_price_hygiene.py@@ -14,14 +14,8 @@ from codeverse3d.models.pricing import (#: model ids exposed by defaults, routes, CLI examples, and public backend contracts.#: They must stay priceable even when no recorded run happens to mention them.SUPPORTED_MODEL_IDS = (- "gemini:gemini-3.7-flash",- "gemini:gemini-3.6-flash",- "gemini:gemini-3.5-flash",- "gemini:gemini-3.1-pro-preview",- "gemini:gemini-3.1-flash-lite",- "gemini:gemini-3.1-flash-image",- "gemini:gemini-2.5-flash-image","gemini:gemini-3.8-flash",+ "gemini:gemini-3.1-pro-preview","gemini:gemini-4-argon","openai:gpt-6-astra","openai:gpt-6.1-sol",@@ -44,7 +38,7 @@ def test_long_context_tier_is_applied():assert estimate_cost("gemini", "gemini-3.1-pro-preview", big) > \3 * estimate_cost("gemini", "gemini-3.1-pro-preview", small)# flash has no long-context tier- assert unit_prices("gemini", "gemini-3.7-flash", prompt_tokens=900_000)[0] == 0.75+ assert unit_prices("gemini", "gemini-3.8-flash", prompt_tokens=900_000)[0] == 0.75def test_supported_model_ids_resolve_to_a_price():diff --git a/harness/tests/cost/test_profiles.py b/harness/tests/cost/test_profiles.pydeleted file mode 100644index ca7c3b11..00000000--- a/harness/tests/cost/test_profiles.py+++ /dev/null@@ -1,170 +0,0 @@-"""The economy / balanced / quality dial: one name, the whole cost/quality setting."""--from __future__ import annotations--import json-from pathlib import Path--import pytest-from typer.testing import CliRunner--from codeverse3d.cli._common import resolve_dial-from codeverse3d.cli.main import app-from codeverse3d.config import Settings, get_settings-from codeverse3d.cost.profiles import PROFILE_NAMES, profile_table--runner = CliRunner()--[email protected](autouse=True)-def _fresh_settings():- """A profile mutates the process-wide settings singleton; never leak that."""- get_settings.cache_clear()- yield- get_settings.cache_clear()---def test_a_value_the_user_configured_survives_the_profile_unless_forced(monkeypatch):- s = Settings(default_generator="codex:gpt-6.1-sol")- s.apply_profile("economy")- assert s.default_generator == "codex:gpt-6.1-sol" # config.yaml / C3D_* wins over a default dial- assert s.default_judge == "gemini:gemini-3.7-flash" # everything unstated still moves- s.apply_profile("economy", force=True)- assert s.default_generator == "single-shot:gemini:gemini-3.7-flash"- # a stated judge field freezes only itself, not the whole judge section- monkeypatch.setenv("C3D_JUDGE__MAX_PX", "800")- s = Settings()- s.apply_profile("quality")- assert s.judge.max_px == 800, "the field the user stated wins"- assert s.judge.samples == 3, "every field the user did NOT state still follows the profile"- assert s.judge.montages == 5 and s.judge.detail_crops == 2---def test_no_profile_touches_the_judge_payload_or_the_turn_cap(monkeypatch):- """Not dials (docs/COST.md §14, §17): even a forced profile leaves them alone."""- monkeypatch.setenv("C3D_JUDGE__MAX_PX", "800")- monkeypatch.setenv("C3D_LIMITS__AGENT_MAX_TURNS", "12")- for name in PROFILE_NAMES:- d = resolve_dial(Settings(), name)- assert (d.judge_max_px, d.judge_montages, d.judge_detail_crops, d.agent_max_turns) == (800, 5, 2, 12)---def test_a_bogus_profile_name_is_a_typed_cli_error_not_a_traceback(monkeypatch):- """An invalid environment profile yields one clean validation error."""- runner = CliRunner()- monkeypatch.setenv("C3D_PROFILE", "bogus")- get_settings.cache_clear()- try:- r = runner.invoke(app, ["doctor"])- out = " ".join(r.output.split()) # rich wraps at the console width- assert r.exit_code == 2 and r.exception.__class__.__name__ != "ValueError"- assert "unknown profile 'bogus'" in out and "economy, balanced, quality" in out- assert "Traceback" not in out- finally:- get_settings.cache_clear()- # `make --profile bogus`: flywheel_cli/test_cli.py test_an_unknown_profile_is_a_clean_error_not_a_traceback---def test_profile_table_and_cli():- rows = profile_table()- assert len(rows) == 3 and rows[0][0] == "economy"- r = runner.invoke(app, ["cost", "profiles"])- assert r.exit_code == 0 and "economy" in r.stdout and "quality" in r.stdout---def test_an_explicit_flag_beats_the_profile(tmp_path: Path):- runs = tmp_path / "runs"- r = runner.invoke(app, ["make", "a clay pot", "--runs-dir", str(runs), "--no-run", "--slug", "pot",- "--profile", "economy", "--rounds", "4",- "--generator", "agy:gemini-3.6-flash"])- assert r.exit_code == 0, r.output- spec = json.loads((runs / "pot" / "spec.json").read_text())- assert spec["budget"]["max_rounds"] == 4 and spec["budget"]["max_minutes"] > 0- assert spec["backends"]["generator"] == "agy:gemini-3.6-flash"- assert spec["backends"]["judge"] == "gemini:gemini-3.7-flash" # unstated → still the profile's---def test_the_track_judges_at_the_profiles_sample_count_however_it_was_built(tmp_path: Path):- """N74: resolved in ``BaseTrack.build_context`` — a bench battery builds its track with no- policy, and judged at n=1 under the quality profile while ``3dcode make`` judged at n=3."""- from codeverse3d.contracts.common import Language- from codeverse3d.orchestrator import RunState- from codeverse3d.proc import EventLog- from codeverse3d.tracks.static_object import StaticObjectTrack- from codeverse3d.workspace import Workspace- from tests.orchestrator_tracks.conftest import make_spec- from tests.orchestrator_tracks.fakes import FakeRuntime, FakeServices-- ws = Workspace(tmp_path / "runs" / "d").create()- for profile, samples in ((None, 1), ("quality", 3)):- s = Settings(runs_dir=tmp_path / "runs", cache_dir=tmp_path / "cache")- if profile:- s.apply_profile(profile, force=True)- track = StaticObjectTrack(services=FakeServices(), settings=s, runtime=FakeRuntime(Language.THREEJS))- ctx = track.build_context(make_spec(language=Language.THREEJS), ws, EventLog(ws.events_path), RunState(slug="d"))- assert ctx.policy.judge_samples == samples, profile---# --------------------------------------------------------------- flag == env var-def _dial_from_flag(name: str):- """The dial `3dcode make --profile <name>` resolves to."""- from codeverse3d.cli import _common as C-- return C.resolve_dial(Settings(), name)---def _dial_from_env(name: str, monkeypatch):- """The dial `C3D_PROFILE=<name> 3dcode make` resolves to (the real settings path)."""- from codeverse3d.cli import _common as C-- monkeypatch.setenv("C3D_PROFILE", name)- get_settings.cache_clear()- try:- return C.resolve_dial(get_settings(), None)- finally:- get_settings.cache_clear()--- ("name", "expected"),- [- ("economy", {"generator": "single-shot:gemini:gemini-3.7-flash",- "judge": "gemini:gemini-3.7-flash", "judge_samples": 2,- "rounds": 2, "candidates": 1, "texture": False,- "judge_max_px": 1024, "judge_montages": 5, "judge_detail_crops": 2,- "agent_max_turns": 0, "max_minutes": 30.0}),- ("balanced", {"generator": "agy:gemini-4-argon",- "judge": "gemini:gemini-3.1-pro-preview", "judge_samples": 1,- "rounds": 4, "candidates": 1, "texture": False,- "judge_max_px": 1024, "judge_montages": 5, "judge_detail_crops": 2,- "agent_max_turns": 0, "max_minutes": 60.0}),- ("quality", {"generator": "agy:gemini-4-argon",- "judge": "gemini:gemini-3.1-pro-preview", "judge_samples": 3,- "rounds": 4, "candidates": 2, "texture": True,- "judge_max_px": 1024, "judge_montages": 5, "judge_detail_crops": 2,- "agent_max_turns": 0, "max_minutes": 90.0}),- ],-)-def test_each_profile_resolves_to_its_documented_dial(name, expected, monkeypatch):- """Every dial value docs/COST.md §15 promises, from BOTH entry points."""- settings = Settings()- applied = settings.apply_profile(name)- assert applied.name == settings.profile == name- for dial in (_dial_from_flag(name), _dial_from_env(name, monkeypatch)):- assert dial.profile == name- for field, want in expected.items():- assert getattr(dial, field) == want, f"{name}.{field}"--[email protected](("name", "spp"), [("economy", 16), ("balanced", 32), ("quality", 64)])-def test_the_profile_sets_the_blender_samples_unless_the_user_stated_them(name, spp, monkeypatch):- """scene_blender's judged-frame samples are a profile dial (owner D1: economy 16 · 32 · quality 64)."""- s = Settings()- s.apply_profile(name)- assert s.render.blender_samples == spp- monkeypatch.setenv("C3D_RENDER__BLENDER_SAMPLES", "8")- stated = Settings()- stated.apply_profile(name)- assert stated.render.blender_samples == 8- stated.apply_profile(name, force=True)- assert stated.render.blender_samples == sppdiff --git a/harness/tests/cost/test_tally.py b/harness/tests/cost/test_tally.pyindex 391f91bd..5febd6c4 100644--- a/harness/tests/cost/test_tally.py+++ b/harness/tests/cost/test_tally.py@@ -21,7 +21,7 @@ REQ = ChatRequest(messages=[ChatMessage.user("x")], label="judge:static_object:rdef test_a_tally_holds_exactly_the_ledger_rows_booked_inside_it(tmp_path: Path):- u = Usage(backend="gemini", model="gemini-3.7-flash", input_tokens=1_000, output_tokens=10)+ u = Usage(backend="gemini", model="gemini-3.8-flash", input_tokens=1_000, output_tokens=10)with run_ledger(tmp_path, run="r"), tally() as outer:record_call(u, stage="plan")with tally() as inner:@@ -81,7 +81,7 @@ def test_a_timed_step_is_one_row_with_its_wall_and_what_it_lost():class SinkChat:"""A backend that reports its round-trips like ``GeminiModel`` does."""- provider, model, id = "gemini", "gemini-3.7-flash", "gemini:gemini-3.7-flash"+ provider, model, id = "gemini", "gemini-3.8-flash", "gemini:gemini-3.8-flash"def __init__(self, trips: list[tuple[str, int, float]]):self.trips = trips # (outcome, answered latency ms, seconds the round-trip holds)@@ -115,7 +115,7 @@ def test_a_clean_call_loses_nothing_and_a_503_before_the_answer_is_lost(tmp_pathdef test_an_agent_session_books_what_its_cli_lost_to_the_provider(tmp_path: Path):class Cli:- kind, model, id = "gemini-cli", "gemini-3.7-flash", "gemini-cli:gemini-3.7-flash"+ kind, model, id = "gemini-cli", "gemini-3.8-flash", "gemini-cli:gemini-3.8-flash"def run(self, job: AgentJob) -> AgentResult:time.sleep(0.02)diff --git a/harness/tests/flywheel_cli/conftest.py b/harness/tests/flywheel_cli/conftest.pyindex c3382d11..984bbe80 100644--- a/harness/tests/flywheel_cli/conftest.py+++ b/harness/tests/flywheel_cli/conftest.py@@ -45,17 +45,17 @@ def tiny_png(path: Path, rgb: tuple[int, int, int] = (200, 30, 30), size: int =def _judgment(score: float, passed: bool, plan: list[str]) -> Judgment:return Judgment(- rubric="static_object", judge_backend="gemini:gemini-3.7-flash",+ rubric="static_object", judge_backend="gemini:gemini-3.8-flash",scores={"fidelity": score, "geometry": score}, overall=score, passed=passed, summary=f"score {score}",issues=[JudgeIssue(target="Leg", kind="geometry", severity="major", detail="legs too thin")] if not passed else [],improvement_plan=[ImprovementItem(target="Leg", kind="geometry", instruction=s, priority=1) for s in plan],- acceptance_results={"a1": passed}, usage=Usage(backend="gemini", model="gemini-3.7-flash", cost_usd=0.01),+ acceptance_results={"a1": passed}, usage=Usage(backend="gemini", model="gemini-3.8-flash", cost_usd=0.01),)def make_fake_run(runs_dir: Path, slug: str = "wooden_chair_ab12cd34", *, prompt: str = "a wooden dining chair",- language: Language = Language.BLENDER, generator: str = "gemini-cli:gemini-3.6-flash",+ language: Language = Language.BLENDER, generator: str = "gemini-cli:gemini-3.8-flash",scores: tuple[float, float] = (0.55, 0.80), with_repair: bool = False,) -> tuple[Workspace, RunRecord]:ws = Workspace(runs_dir / slug).create()@@ -88,7 +88,7 @@ def make_fake_run(gates=[GateReport(gate="lint", passed=True)],renders=RenderSet(views=views, contact_sheet=str(sheet)),judgment=_judgment(sc, sc >= 0.75, ["thicken the legs", "add a back rail"]),- usage=Usage(backend="gemini", model="gemini-3.7-flash", input_tokens=1000, output_tokens=500, cost_usd=0.02),+ usage=Usage(backend="gemini", model="gemini-3.8-flash", input_tokens=1000, output_tokens=500, cost_usd=0.02),duration_s=12.0, steps=[StepTime(step="generate", wall_s=12.0)],))if with_repair:@@ -110,7 +110,7 @@ def make_fake_run((ws.artifacts / "object.glb").write_bytes(b"glTF\x02\x00\x00\x00" + bytes([len(scores) - 1]) * 16) # the last round# the ledger its calls wrote: the planner, then one session per round ($0.06, the record's total)ledger = ws.telemetry / "cost.jsonl"- record_call(Usage(backend="gemini", model="gemini-3.7-flash", input_tokens=500, cost_usd=0.02),+ record_call(Usage(backend="gemini", model="gemini-3.8-flash", input_tokens=500, cost_usd=0.02),run=slug, stage="plan", label="planner", ledger=ledger)for r in rounds[:2]:record_call(r.usage, run=slug, round=r.index, stage=r.kind, label=r.kind, source="session", ledger=ledger)diff --git a/harness/tests/flywheel_cli/test_captions.py b/harness/tests/flywheel_cli/test_captions.pyindex 447abe20..89175ca7 100644--- a/harness/tests/flywheel_cli/test_captions.py+++ b/harness/tests/flywheel_cli/test_captions.py@@ -71,7 +71,7 @@ def test_caption_live_gemini(fake_run):if not get_settings().gemini_api_keys:pytest.skip("no gemini keys")ws, rec = fake_run- caps = caption_sample(ws, rec, "gemini:gemini-3.7-flash")+ caps = caption_sample(ws, rec, "gemini:gemini-3.8-flash")assert len(caps.detailed) > 20 and "blender" in caps.instruction.lower()diff --git a/harness/tests/flywheel_cli/test_cli.py b/harness/tests/flywheel_cli/test_cli.pyindex 78581cfd..d1ff3668 100644--- a/harness/tests/flywheel_cli/test_cli.py+++ b/harness/tests/flywheel_cli/test_cli.py@@ -10,7 +10,6 @@ import pytestfrom typer.testing import CliRunnerfrom codeverse3d.cli.main import app-from codeverse3d.cli.main import make as make_cmdfrom codeverse3d.contracts.spec import Specrunner = CliRunner()@@ -58,7 +57,7 @@ def test_make_no_run_creates_valid_workspace(tmp_path: Path):runs = tmp_path / "runs"r = runner.invoke(app, ["make", "a wooden dining chair", "--track", "static_object", "--language", "blender","--runs-dir", str(runs), "--no-run", "--dim", "width=0.5", "--must", "four legs",- "--rounds", "2", "--generator", "agy:gemini-3.7-flash"])+ "--rounds", "2", "--generator", "agy:gemini-3.8-flash"])assert r.exit_code == 0, r.output# `.locks/` (runlock.exclusive) lives beside the run dirs on purpose — a lock inside# the directory a --force wipe deletes is no lock@@ -69,7 +68,7 @@ def test_make_no_run_creates_valid_workspace(tmp_path: Path):spec = Spec.model_validate_json((ws / "spec.json").read_text())assert spec.constraints.dimensions_m == {"width": 0.5} and spec.constraints.must_have == ["four legs"]assert spec.budget.max_rounds == 2 and spec.budget.max_minutes == 60.0- assert spec.backends.generator == "agy:gemini-3.7-flash"+ assert spec.backends.generator == "agy:gemini-3.8-flash"assert (ws / "src").is_dir() and (ws / "artifacts" / "renders").is_dir()# same prompt again → same slug → refuse without --forcer2 = runner.invoke(app, ["make", "a wooden dining chair", "--runs-dir", str(runs), "--no-run"])@@ -195,21 +194,16 @@ def test_commands_over_a_runs_dir(runs_dir: Path, tmp_path: Path, monkeypatch):assert r.exit_code == 1assert "judge failed" in r.output + str(getattr(r, "stderr", "") or "") and "Traceback" not in r.output- # status shows candidates and texturing+ # status shows candidates(ws.root / "rounds").mkdir(exist_ok=True)(ws.root / "rounds" / "candidates.json").write_text(json.dumps({"n": 2, "selected": 1,"candidates": [{"index": 0, "label": "c0", "score": 0.51, "build_ok": True},{"index": 1, "label": "c1", "score": 0.63, "build_ok": True}],"pairwise": {"a": "c0", "b": "c1", "winner": "b", "confidence": 0.8}}))- rec = json.loads(ws.record_path.read_text())- rec.setdefault("extra", {})["texturing"] = {"shipped": True, "delta": 0.01, "reason": "", "n_textures": 3,- "glb_textured": "artifacts/object_textured.glb"}- ws.record_path.write_text(json.dumps(rec))r = runner.invoke(app, ["status", "wooden_chair_ab12cd34", "--runs-dir", str(runs_dir)])assert r.exit_code == 0, r.outputassert "candidates" in r.output and "c1" in r.output and "pairwise" not in r.output- assert "texturing" in r.output and "shipped" in r.outputdef test_calibration_rubric_map_includes_graphics(tmp_path: Path):@@ -313,79 +307,8 @@ def test_render_graphics_regenerates_frames(tmp_path: Path, monkeypatch):assert "fake-gl" in r.output-def test_reference_with_no_run_says_it_is_about_to_spend_money(tmp_path: Path, monkeypatch):- """Reference preprocessing under --no-run must disclose its paid work."""- import codeverse3d.reference as REF-- calls = []-- def fake_ground_spec(spec, ws, *, n_views=2, events=None, **kw):- calls.append(n_views)- raise SystemExit(7) # stop before any real model work-- monkeypatch.setattr(REF, "ground_spec", fake_ground_spec)- runs = tmp_path / "runs"- r = runner.invoke(app, ["make", "a wooden stool", "--reference", "--no-run",- "--runs-dir", str(runs), "--slug", "refnorun"])- out = " ".join(r.output.split())- assert calls == [2], "the grounding pass still runs: the grounded spec is the artifact"- assert "--reference makes model calls now" in out and "$0.15" in out- import typing-- help_text = typing.get_type_hints(make_cmd, include_extras=True)["no_run"].__metadata__[0].help- assert "with --reference the reference pass still runs first" in help_text---def test_an_unknown_profile_is_a_clean_error_not_a_traceback(tmp_path: Path):- """An unknown profile is a clean user error."""- r = runner.invoke(app, ["make", "a chair", "--profile", "turbo", "--no-run",- "--runs-dir", str(tmp_path / "runs"), "--slug", "prof"])- assert r.exit_code == 2, "the CLI's typed configuration-error code (see SM-10)"- assert "unknown profile" in r.output and "economy, balanced, quality" in r.output- assert "Traceback" not in r.output and "ValueError" not in r.output- assert not (tmp_path / "runs" / "prof").exists(), "no workspace for a rejected flag"---def test_texture_is_not_offered_on_tracks_that_have_no_glb(tmp_path: Path):- """Impossible explicit texturing fails early; profiles degrade cleanly by track."""- from codeverse3d.contracts.common import Track- from codeverse3d.texturing.run import texture_requested, texture_supported-- runs = tmp_path / "runs"- # profile-implied: quality still works, it just has no texture pass on this track- r = runner.invoke(app, ["make", "a plasma shader", "--track", "graphics", "--profile", "quality",- "--no-run", "--runs-dir", str(runs), "--slug", "gfxq"])- assert r.exit_code == 0- opts = json.loads((runs / "gfxq" / "spec.json").read_text())["options"]- assert opts["texture"] is False, "a run must not record a pass it cannot run"- assert opts["profile"] == "quality", "the rest of the dial still applies"-- # explicit: refused, and pointed at the command that does work- r = runner.invoke(app, ["make", "a kitchen", "--track", "scene", "--texture",- "--no-run", "--runs-dir", str(runs), "--slug", "scnx"])- assert r.exit_code == 1 and "texture scene-pack" in r.output.replace("\n", "")- assert not (runs / "scnx").exists()-- # the object tracks are untouched- r = runner.invoke(app, ["make", "a chair", "--profile", "quality",- "--no-run", "--runs-dir", str(runs), "--slug", "objq"])- assert r.exit_code == 0- assert json.loads((runs / "objq" / "spec.json").read_text())["options"]["texture"] is True-- # and the single owner of the decision knows the track scope, so a spec that already- # carries texture=True on a scene track (recorded before this fix) is a no-op too- assert texture_supported(Track.STATIC_OBJECT) and not texture_supported(Track.SCENE)- stale = Spec.model_validate(json.loads((runs / "objq" / "spec.json").read_text()))- assert texture_requested(stale)- tagged = stale.model_copy(deep=True)- tagged.options.texture = False- tagged.tags = ["texture"]- assert not texture_requested(tagged), "tags cannot enable the texture pass"- assert not texture_requested(stale.model_copy(update={"track": Track.GRAPHICS}))--def test_best_of_n_is_not_offered_on_a_scene(tmp_path: Path):- """F1: explicit --candidates N on a scene is refused, a profile's is 1, a stale spec runs one."""+ """F1: explicit --candidates N on a scene is refused, the default is 1, a stale spec runs one."""from codeverse3d.config import get_settingsfrom codeverse3d.contracts.common import Trackfrom codeverse3d.tracks.scene import SceneTrack@@ -394,7 +317,7 @@ def test_best_of_n_is_not_offered_on_a_scene(tmp_path: Path):r = runner.invoke(app, ["make", "a kitchen", "--track", "scene", "--candidates", "2","--no-run", "--runs-dir", str(runs), "--slug", "scn2"])assert r.exit_code == 1 and "--candidates" in r.output and not (runs / "scn2").exists()- r = runner.invoke(app, ["make", "a kitchen", "--track", "scene", "--profile", "quality",+ r = runner.invoke(app, ["make", "a kitchen", "--track", "scene","--no-run", "--runs-dir", str(runs), "--slug", "scnq"])assert r.exit_code == 0spec = Spec.model_validate(json.loads((runs / "scnq" / "spec.json").read_text()))@@ -439,7 +362,7 @@ def test_render_only_labels_the_working_tree_round(tmp_path: Path):@pytest.mark.parametrize("flag,value", [- ("--generator", "antigravity:gemini-3.7-flash"), ("--generator", "gemini-cli:gemini-3.7-flash"), ("--generator", "nocolon"), ("--generator", "single-shot:nope"),+ ("--generator", "antigravity:gemini-3.8-flash"), ("--generator", "gemini-cli:gemini-3.8-flash"), ("--generator", "nocolon"), ("--generator", "single-shot:nope"),("--generator", "single-shot:gemini:"), ("--planner", "gemini"), ("--judge", "bogus:model"),("--captioner", "gemini:"),], ids=lambda v: v.strip("-"))@@ -471,7 +394,7 @@ def test_a_config_file_that_is_not_a_mapping_is_a_bad_configuration(tmp_path: Pamonkeypatch.chdir(tmp_path)config.get_settings.cache_clear()try:- r = runner.invoke(app, ["cost", "profiles"])+ r = runner.invoke(app, ["make", "a chair", "--no-run", "--runs-dir", str(tmp_path / "runs")])finally:config.get_settings.cache_clear()assert r.exit_code == 2 and "bad configuration" in r.output and "3dcodeverse.yaml" in r.output@@ -620,12 +543,10 @@ def test_a_reference_that_is_not_an_image_is_refused_before_the_run_exists(tmp_pdef test_an_option_that_would_be_dropped_is_refused(tmp_path: Path, runs_dir: Path):- """--reference-views without --reference, pick --judge without a pairwise verdict to buy, and- render --width/--height on a graphics run were accepted and silently did nothing."""+ """pick --judge without a pairwise verdict to buy, and render --width/--height on a graphics+ run were accepted and silently did nothing."""runs = tmp_path / "runs"- r = runner.invoke(app, ["make", "a cup", "--reference-views", "1", "--no-run", "--runs-dir", str(runs), "--slug", "rv"])- assert r.exit_code == 2 and "--reference-views needs --reference" in r.output and not (runs / "rv").exists()- for extra in (["--judge", "gemini:gemini-3.7-flash"], ["--by", "pairwise", "--round", "0", "--judge", "gemini:x"]):+ for extra in (["--judge", "gemini:gemini-3.8-flash"], ["--by", "pairwise", "--round", "0", "--judge", "gemini:x"]):r = runner.invoke(app, ["pick", "wooden_chair_ab12cd34", "--runs-dir", str(runs_dir), *extra])assert r.exit_code == 2 and "--judge is the pairwise judge" in r.outputassert runner.invoke(app, ["make", "a shader", "--track", "graphics", "--no-run", "--runs-dir", str(runs),@@ -679,7 +600,7 @@ def test_a_replay_judges_the_picked_round_on_the_runs_rubric_and_books_into_the_ledger = ws.telemetry / "cost.jsonl"def paid(cost: float) -> float: # a paid call booked into the run's ledger; returns the ledger total- record_call(Usage(backend="gemini", model="gemini-3.7-flash", cost_usd=cost), stage="judge", label="t", ledger=ledger)+ record_call(Usage(backend="gemini", model="gemini-3.8-flash", cost_usd=cost), stage="judge", label="t", ledger=ledger)return ledger_usage(load_ledger(ws.root)).cost_usdtotal = paid(0.03) # a pairwise verdict `pick` paid: the pick re-packages the recorddiff --git a/harness/tests/flywheel_cli/test_flywheel.py b/harness/tests/flywheel_cli/test_flywheel.pyindex d061f94a..3bdc91d3 100644--- a/harness/tests/flywheel_cli/test_flywheel.py+++ b/harness/tests/flywheel_cli/test_flywheel.py@@ -177,20 +177,11 @@ def test_export_pairs_and_a_core_only_install_over_a_runs_dir(runs_dir: Path, tmassert len(runs) == 3 and bad == ["broken"]-def test_export_of_one_run_with_captions_and_a_texture_pass_and_reexport(fake_run, tmp_path: Path):- from codeverse3d.texturing.run import report_path- from tests.flywheel_cli.conftest import tiny_png-+def test_export_of_one_run_with_captions_and_reexport(fake_run, tmp_path: Path):ws, rec = fake_runrec.extra["captions"] = {"detailed": "A chair.", "instruction": "Write a Blender Python script for a chair.","factory": "Build seat then legs.", "provenance": {"captioner": "gemini:x"}}- tiny_png(ws.artifacts / "textures" / "wood.png")- (ws.artifacts / "object_textured.glb").write_bytes(b"glTF\x02\x00\x00\x00" + b"\0" * 8)- rec.extra["texturing"] = {"shipped": True, "glb_textured": "artifacts/object_textured.glb",- "textures_dir": "artifacts/textures"}ws.write_json(ws.record_path, rec)- # the pass's report names the GLB it started from: the exported round's (r01, the pick)- ws.write_json(report_path(ws), {**rec.extra["texturing"], "glb_in": "artifacts/r01/object.glb"})out = tmp_path / "ds"export_samples(ws.root.parent, out)rep = export_samples(ws.root.parent, out) # re-export overwrites, index stays at 1 row@@ -198,18 +189,6 @@ def test_export_of_one_run_with_captions_and_a_texture_pass_and_reexport(fake_rurow = json.loads((out / "metadata.jsonl").read_text().splitlines()[0])assert row["captions"]["factory"] == "Build seat then legs."assert json.loads(row["meta_json"])["has_captions"] is True- sdir = next(out.rglob("meta.json")).parent- assert (sdir / "textures" / "wood.png").is_file()- assert (sdir / "renders" / "object_textured.glb").is_file()- meta = json.loads((sdir / "meta.json").read_text())- assert "textures/wood.png" in meta["files"] and "renders/object_textured.glb" in meta["files"]- # not shipped → nothing copied- rec.extra["texturing"]["shipped"] = False- ws.write_json(ws.record_path, rec)- ws.write_json(report_path(ws), {**rec.extra["texturing"], "glb_in": "artifacts/r01/object.glb"})- export_samples(ws.root.parent, tmp_path / "ds2")- sdir2 = next((tmp_path / "ds2").rglob("meta.json")).parent- assert not (sdir2 / "textures").exists()# --------------------------------------------------------------------------- finding: repair pairs (pairs.py:115)diff --git a/harness/tests/flywheel_cli/test_gemini_image.py b/harness/tests/flywheel_cli/test_gemini_image.pydeleted file mode 100644index 8db1ea4a..00000000--- a/harness/tests/flywheel_cli/test_gemini_image.py+++ /dev/null@@ -1,104 +0,0 @@-"""GeminiImageModel: key rotation, the per-attempt timeout and per-image pricing (fake clients)."""--from __future__ import annotations--import io-from types import SimpleNamespace--import pytest--pytest.importorskip("google.genai")-from PIL import Image--from codeverse3d.models.base import ModelError-from codeverse3d.models.gemini import GeminiImageModel-from codeverse3d.models.retry import KeyPool---def _png_bytes() -> bytes:- buf = io.BytesIO()- Image.new("RGB", (4, 4), (200, 30, 30)).save(buf, format="PNG")- return buf.getvalue()---def _image_response() -> SimpleNamespace:- part = SimpleNamespace(inline_data=SimpleNamespace(data=_png_bytes()))- cand = SimpleNamespace(finish_reason=SimpleNamespace(name="STOP"), content=SimpleNamespace(parts=[part]))- return SimpleNamespace(prompt_feedback=None, candidates=[cand], usage_metadata=None)---class _Client:- """Fake genai client: the shared script decides each call's outcome."""-- def __init__(self, key: str, script: list, used: list[str]):- self._key, self._script, self._used = key, script, used- self.models = SimpleNamespace(generate_content=self._generate)-- def _generate(self, *, model, contents, config):- self._used.append(self._key)- step = self._script.pop(0)- if isinstance(step, Exception):- raise step- return step---def _model(script: list, used: list[str], sleeps: list[float], *, max_attempts: int) -> tuple[GeminiImageModel, KeyPool]:- pool = KeyPool(["key_a", "key_b"])- m = GeminiImageModel(- "test-image", fallback=None, pool=pool, max_attempts=max_attempts,- sleep=sleeps.append, client_factory=lambda key: _Client(key, script, used),- )- return m, pool---def test_all_keys_dead_raises_the_key_error():- used: list[str] = []- sleeps: list[float] = []- script = [ModelError("PERMISSION_DENIED", retryable=False, status=403),- ModelError("PERMISSION_DENIED", retryable=False, status=403)]- m, _pool = _model(script, used, sleeps, max_attempts=4)- with pytest.raises(ModelError) as ei:- m.generate_with_usage("brushed steel")- assert ei.value.status == 403 and len(set(used)) == 2---def _captured_timeout(max_wait_s: float | None = None) -> int:- configs: list = []-- class _Capture(_Client):- def _generate(self, *, model, contents, config):- configs.append(config)- return super()._generate(model=model, contents=contents, config=config)-- used: list[str] = []- script = [_image_response()]- pool = KeyPool(["key_a", "key_b"])- m = GeminiImageModel("test-image", fallback=None, pool=pool, max_attempts=1,- sleep=lambda s: None, client_factory=lambda key: _Capture(key, script, used))- kw = {} if max_wait_s is None else {"max_wait_s": max_wait_s}- m.generate_with_usage("a red cube", size=512, **kw)- assert len(configs) == 1- return configs[0].http_options.timeout---def test_image_budget_bounds_the_per_attempt_http_timeout():- """A small budget clips the read timeout; no budget keeps the configured limit."""- clipped = _captured_timeout(60.0)- assert 20_000 <= clipped <= 60_000 # clipped to the budget, floored at 20 s- assert _captured_timeout() == 180_000---def test_images_are_priced_by_the_generated_size():- """A 2K request is billed at the 2K price (it was billed at the 1K rate); 512 is billed as 1K."""- from codeverse3d.models.pricing import per_image_usd-- def cost(size: int) -> float:- used: list[str] = []- m, _pool = _model([_image_response()], used, [], max_attempts=1)- m.model = "gemini-3.1-flash-image"- m.fallback = None- _images, usage = m.generate_with_usage("brushed steel", size=size)- return usage.cost_usd-- assert cost(2048) == pytest.approx(per_image_usd("gemini", "gemini-3.1-flash-image", size=2048)) == pytest.approx(0.134)- assert cost(512) == pytest.approx(0.067) and cost(1024) == pytest.approx(0.067)diff --git a/harness/tests/flywheel_cli/test_run_identity.py b/harness/tests/flywheel_cli/test_run_identity.pyindex f3e4d4f3..a00901bb 100644--- a/harness/tests/flywheel_cli/test_run_identity.py+++ b/harness/tests/flywheel_cli/test_run_identity.py@@ -29,13 +29,13 @@ def test_the_slug_rule_and_the_battery_layouts():# ab_plan: slug, arm, cell and the attempt suffixrid = RunId(battery="plan_loop",rel="C0/arms/control/cells/arch_hard_bay_window/"- "harness_api-agent_gemini_gemini-3.7-flash/run")- assert rid.slug == "C0__control__arch_hard_bay_window__harness_api-agent_gemini_gemini-3.7-flash"+ "harness_api-agent_gemini_gemini-3.8-flash/run")+ assert rid.slug == "C0__control__arch_hard_bay_window__harness_api-agent_gemini_gemini-3.8-flash"assert rid.arm == "control" and rid.cell == "arch_hard_bay_window"retry = RunId(battery="plan_loop",rel="heldout/arms/control/cells/comp_hard_drafting_table/"- "harness_api-agent_gemini_gemini-3.7-flash.attempt1/run")- assert retry.slug.endswith("harness_api-agent_gemini_gemini-3.7-flash.attempt1")+ "harness_api-agent_gemini_gemini-3.8-flash.attempt1/run")+ assert retry.slug.endswith("harness_api-agent_gemini_gemini-3.8-flash.attempt1")def test_unique_files_skips_subruns_below_the_root_not_above_it(tmp_path: Path):diff --git a/harness/tests/flywheel_cli/test_run_layout_cli.py b/harness/tests/flywheel_cli/test_run_layout_cli.pyindex cf3102da..59952930 100644--- a/harness/tests/flywheel_cli/test_run_layout_cli.py+++ b/harness/tests/flywheel_cli/test_run_layout_cli.py@@ -100,7 +100,7 @@ def test_telemetry_summarises_the_runs_own_ledger(fake_run):tele = build_telemetry(ws, rec, write=False)assert tele.cost is not None and tele.cost.n_calls == 0 and tele.settings is not Noneledger.write_text(json.dumps({"stage": "plan", "role": "planner", "label": "plan", "cost_usd": 0.5,- "model": "gemini-3.7-flash", "n_calls": 1}) + "\n")+ "model": "gemini-3.8-flash", "n_calls": 1}) + "\n")tele = build_telemetry(ws, rec)assert tele.cost is not None and tele.cost.by_stage[0].stage == "plan"assert {s.stage for s in tele.cost.by_stage} <= set(STAGE_ORDER)@@ -131,34 +131,6 @@ def test_the_settings_snapshot_records_the_temperature_the_track_planned_at(tmp_assert (roles["judge"].temperature, roles["judge"].thinking, roles["judge"].n_samples) == (0.2, "low", 3)-def test_rejected_texture_pass_is_not_delivered_or_linked(fake_run):- """Belt and braces: a stray canonical object_textured.glb from a rejected pass- is skipped by the deliverable AND by the gallery links (both gate on shipped)."""- from codeverse3d.texturing.run import report_path-- ws, rec = fake_run- (ws.artifacts / "object_textured.glb").write_bytes(b"glTF\x02" + b"\0" * 16)- report_path(ws).parent.mkdir(parents=True, exist_ok=True)-- def texturing(shipped: bool) -> None: # the pass report names the round GLB it started from- rec.extra["texturing"] = {"shipped": shipped, "glb_textured": "artifacts/object_textured.glb"}- ws.write_json(report_path(ws), {**rec.extra["texturing"], "glb_in": "artifacts/r01/object.glb"})-- texturing(False)- build_deliverable(ws, rec, 1)- assert not (ws.deliverable / "object_textured.glb").exists()- entry = entry_from_record("runs", ws, rec)- assert "textured glb" not in {ln.label for ln in entry.links}- # ... and a SHIPPED pass is delivered and linked — with the round it textured, only- texturing(True)- build_deliverable(ws, rec, 0)- assert not (ws.deliverable / "object_textured.glb").exists()- build_deliverable(ws, rec, 1)- assert (ws.deliverable / "object_textured.glb").is_file()- entry = entry_from_record("runs", ws, rec)- assert "textured glb" in {ln.label for ln in entry.links}--def test_a_cards_links_are_the_picked_rounds_never_the_last_builds(tmp_path):"""The gallery linked artifacts/object.glb and artifacts/frames/ — the LAST build's — when thepicked round had no copy of its own (and frames/ always)."""diff --git a/harness/tests/flywheel_cli/test_select.py b/harness/tests/flywheel_cli/test_select.pyindex 7f5b3c7c..24d8bec2 100644--- a/harness/tests/flywheel_cli/test_select.py+++ b/harness/tests/flywheel_cli/test_select.py@@ -26,7 +26,7 @@ from codeverse3d.contracts.run import RoundRecord, RunRecord, RunStatusfrom codeverse3d.contracts.spec import Specfrom codeverse3d.workspace import Workspace-from .conftest import make_fake_run, tiny_png+from .conftest import tiny_pngrunner = CliRunner()@@ -192,64 +192,6 @@ def test_a_scene_or_graphics_round_packages_from_its_own_commit_and_renders(tmp_assert (out / "frames_sheet.png").read_bytes() == (ws.round_artifacts(0) / "frames_sheet.png").read_bytes()-def _fake_texture_pass(calls: list, *, shipped: bool = True, fail: bool = False):- import codeverse3d.texturing.run as trun-- def run(ws, spec, plan, *, glb_in, sheet, **kw):- calls.append((Path(glb_in), Path(sheet)))- if fail:- raise RuntimeError("image model down")- report = trun.TextureReport(plan=trun.TexturePlan(), textures=trun.TextureSet(), seam=trun.SeamGateResult(),- glb_in=str(glb_in), shipped=shipped)- (ws.artifacts / trun.TEXTURED_GLB).write_bytes(b"glTF textured")- ws.write_json(trun.report_path(ws), report)- trun.record_texturing(ws, report)- return report-- return run---def test_package_textures_the_rounds_own_glb_once_and_a_failed_pass_still_hands_over(tmp_path, monkeypatch):- import codeverse3d.texturing.run as trun-- ws = _run(tmp_path / "r", [(0.5, 0), (0.8, 0)])- calls: list = []- monkeypatch.setattr(trun, "texture_pass", _fake_texture_pass(calls))- select.package(ws.root, 0, texture=True)- assert calls == [(ws.round_artifacts(0) / "object.glb", ws.renders_dir(0) / "sheet.png")] # round 0, not the last- assert (ws.deliverable / "object_textured.glb").is_file()- assert json.loads((ws.root / select.SELECTION_NAME).read_text())["textured"] is True- assert json.loads(ws.record_path.read_text())["extra"]["texturing"]["shipped"] is True- select.package(ws.root, 0, texture=True)- assert len(calls) == 1, "a pass already made from these bytes is never bought again"- # another round's hand-over does not carry round 0's pack- select.package(ws.root, 1)- assert not (ws.deliverable / "object_textured.glb").exists()- # a failed pass does not stop the hand-over- monkeypatch.setattr(trun, "texture_pass", _fake_texture_pass([], fail=True))- select.package(ws.root, 1, texture=True)- assert (ws.deliverable / "object.glb").is_file() and not (ws.deliverable / "object_textured.glb").exists()- assert json.loads((ws.root / select.SELECTION_NAME).read_text())["textured"] is False---def test_an_export_of_another_round_never_ships_the_pack_a_texture_pass_made_for_r02(tmp_path, monkeypatch):- """Texture r02, hand over r00, export: the r00 sample once carried r02's textured GLB."""- import codeverse3d.texturing.run as trun- from codeverse3d.addons.dataset.export import export_one- from codeverse3d.record.record import load_record-- ws = _run(tmp_path / "r", [(0.5, 0), (0.6, 0), (0.8, 0)])- monkeypatch.setattr(trun, "texture_pass", _fake_texture_pass([]))- select.package(ws.root, 2, texture=True)- assert (ws.deliverable / "object_textured.glb").is_file()- select.package(ws.root, 0)- sample = export_one(ws, load_record(ws), tmp_path / "ds")- assert "renders/object.glb" in sample.file_hashes and sample.meta.round == 0- assert not any("textured" in f or f.startswith("textures/") for f in sample.file_hashes)- select.package(ws.root, 2) # ... and the round it textured still ships it- assert "renders/object_textured.glb" in export_one(ws, load_record(ws), tmp_path / "ds2").file_hashes--# --------------------------------------------------------------------------- CLIdef test_pick_command_by_score_by_round_and_by_pairwise(tmp_path, monkeypatch):runs = tmp_path / "runs"@@ -315,31 +257,3 @@ def test_round_outputs_are_the_rounds_own_never_the_last_builds(tmp_path: Path):assert select.round_file(ws, rec.rounds[0]) is Noneassert select.round_file(ws, rec.rounds[1]) is Noneassert select.round_complexity_block(ws, rec.rounds[1]) is None---def test_cli_texture_pass_textures_the_picked_round_not_the_last_build(tmp_path: Path, monkeypatch):- """B5: `3dcode texture pass` textures the handed-over round's GLB, not the last build's — through- `select.texture_round` (N57): a pass that already started from those bytes is not bought again- (--force buys it), and the hand-over of that round is refreshed."""- from codeverse3d.texturing.run import report_path-- ws, _ = make_fake_run(tmp_path / "runs", "chair", scores=(0.90, 0.50)) # r00 is picked, r01 built last- select.package(ws.root, 0, method="score")- seen: list[dict] = []- monkeypatch.setattr("codeverse3d.texturing.run.texture_pass", lambda *a, **kw: seen.append(kw) or object())- monkeypatch.setattr("codeverse3d.texturing.run.load_report", lambda ws: object())- monkeypatch.setattr("codeverse3d.cli.texture_cmd._print_report", lambda rep, ws: None)- monkeypatch.setattr("codeverse3d.reference.get_image_model", lambda name: None)- packaged: list[int] = []- monkeypatch.setattr(select, "package", lambda run_dir, index, **kw: packaged.append(index))- cmd = ["texture", "pass", "chair", "--runs-dir", str(tmp_path / "runs"), "--no-judge"]- r = runner.invoke(app, cmd)- assert r.exit_code == 0, r.output- assert seen[0]["glb_in"] == ws.round_artifacts(0) / "object.glb" and seen[0]["judge"] is False- assert seen[0]["sheet"] is not None and seen[0]["sheet"].is_relative_to(ws.renders_dir(0))- assert packaged == [0] # the hand-over carries the new pack- ws.write_json(report_path(ws), {"glb_in": str(ws.round_artifacts(0) / "object.glb")})- r = runner.invoke(app, cmd)- assert r.exit_code == 0 and len(seen) == 1 and "already started" in r.output # never bought twice- r = runner.invoke(app, [*cmd, "--force"])- assert r.exit_code == 0 and len(seen) == 2diff --git a/harness/tests/graphics/test_live.py b/harness/tests/graphics/test_live.pyindex 3918afa8..5aa4b72b 100644--- a/harness/tests/graphics/test_live.py+++ b/harness/tests/graphics/test_live.py@@ -20,7 +20,7 @@ from codeverse3d.tracks.graphics import (from codeverse3d.workspace import Workspacepytestmark = pytest.mark.live-MODEL = "gemini:gemini-3.7-flash"+MODEL = "gemini:gemini-3.8-flash"@pytest.fixture(scope="module")diff --git a/harness/tests/install/test_hermetic.py b/harness/tests/install/test_hermetic.pyindex 8fb1bb1e..bd2f2a5a 100644--- a/harness/tests/install/test_hermetic.py+++ b/harness/tests/install/test_hermetic.py@@ -15,11 +15,8 @@ from tests.conftest import COLLECTEDHARNESS = Path(__file__).resolve().parents[2]KEY_ENVS = ("GEMINI_API_KEYS", "GEMINI_API_KEY", "GOOGLE_API_KEY", "GOOGLE_GENAI_API_KEY")-#: the two that PORT-2 caught; both are inside the offline (pure python) subset-CREDENTIAL_FREE = (- "tests/models/test_health.py::test_probe_model_treats_a_503_as_final",- "tests/texturing/test_tools_cli.py::test_texture_pass_runs_with_injected_fakes",-)+#: the one that PORT-2 caught (its texture-pass twin went with the texture pass); inside the offline (pure python) subset+CREDENTIAL_FREE = ("tests/models/test_health.py::test_probe_model_treats_a_503_as_final",)def test_passes_with_no_api_keys_in_the_environment(tmp_path: Path) -> None:diff --git a/harness/tests/judges/test_live.py b/harness/tests/judges/test_live.pyindex d9df86b0..dd209b88 100644--- a/harness/tests/judges/test_live.py+++ b/harness/tests/judges/test_live.py@@ -17,7 +17,7 @@ from codeverse3d.judges.vlm_judge import VlmJudgefrom tests.judges.conftest import make_measurement, make_renders, make_specpytestmark = pytest.mark.live-MODEL = "gemini:gemini-3.7-flash"+MODEL = "gemini:gemini-3.8-flash"def _stool_glb(out: Path) -> Path:diff --git a/harness/tests/judges/test_vlm_judge.py b/harness/tests/judges/test_vlm_judge.pyindex 01f83387..d6ec7fcd 100644--- a/harness/tests/judges/test_vlm_judge.py+++ b/harness/tests/judges/test_vlm_judge.py@@ -95,17 +95,15 @@ def test_judge_payload_size_comes_from_the_settings_dial(monkeypatch):from codeverse3d.judges.vlm_judge import VlmJudges = Settings()- s.apply_profile("economy", force=True)monkeypatch.setattr("codeverse3d.judges.vlm_judge.get_settings", lambda: s)j = VlmJudge(rubric="static_object", model_id="fake:fake-1")- # no profile shrinks the payload (docs/COST.md §14, D47)+ # nothing shrinks the payload (docs/COST.md §14, D47)assert j.max_px == 1024 and j.detail_crops == 2 and j.max_montages == 5# a caller that states a size still gets it — the dial is the default, not a capexplicit = VlmJudge(rubric="static_object", model_id="fake:fake-1", max_px=768, detail_crops=1)assert explicit.max_px == 768 and explicit.detail_crops == 1s2 = Settings(judge={"detail_crops": 0, "max_px": 512})monkeypatch.setattr("codeverse3d.judges.vlm_judge.get_settings", lambda: s2)- s2.apply_profile("economy") # a stated payload survives a profileassert VlmJudge(rubric="static_object", model_id="fake:fake-1").detail_crops == 0get_settings.cache_clear()diff --git a/harness/tests/models/test_gemini.py b/harness/tests/models/test_gemini.pyindex ff4edbee..82845818 100644--- a/harness/tests/models/test_gemini.py+++ b/harness/tests/models/test_gemini.py@@ -32,7 +32,7 @@ def text_response(text: str, *, finish: str = "STOP", thoughts: int = 3) -> types.GenerateContentResponse:return types.GenerateContentResponse(- model_version="gemini-3.7-flash",+ model_version="gemini-3.8-flash",candidates=[types.Candidate(content=types.Content(role="model", parts=[types.Part.from_text(text=text)]),@@ -73,7 +73,7 @@ def make_model(script: list[Any], keys=("k1", "k2", "k3"), pool: KeyPool | Nonelog: list[dict] = []pool = pool or KeyPool(list(keys), cooldown_s=30)m = GeminiModel(- "gemini-3.7-flash",+ "gemini-3.8-flash",pool=pool,sleep=lambda s: None,client_factory=lambda key: FakeClient(script, key, log),@@ -120,7 +120,7 @@ def test_text_usage_cost_and_raw():assert r.text == "hello" and r.finish_reason == "STOP" and r.parsed is Noneu = r.usageassert (u.input_tokens, u.output_tokens, u.thoughts_tokens, u.cached_tokens) == (100, 20, 3, 40)- assert u.cost_usd > 0 and u.backend == "gemini" and u.model == "gemini-3.7-flash"+ assert u.cost_usd > 0 and u.backend == "gemini" and u.model == "gemini-3.8-flash"cfg = log[0]["config"]assert cfg.system_instruction == "sys" and cfg.temperature == 0.2assert cfg.thinking_config.thinking_budget == 4096@@ -231,7 +231,7 @@ def test_to_contents_merges_same_role_and_requires_content():def test_no_keys_is_loud():with pytest.raises(ModelError):- GeminiModel("gemini-3.7-flash", keys=[])+ GeminiModel("gemini-3.8-flash", keys=[])def test_max_token_failures_are_not_retried():@@ -269,7 +269,7 @@ def test_a_charged_but_invalid_reply_carries_its_usage_on_the_error():def test_max_output_tokens_eaten_by_thinking_carries_the_thought_tokens():"""A MAX_TOKENS failure reports the thinking tokens it consumed."""resp = types.GenerateContentResponse(- model_version="gemini-3.7-flash",+ model_version="gemini-3.8-flash",candidates=[types.Candidate(content=types.Content(role="model", parts=[]), finish_reason="MAX_TOKENS"diff --git a/harness/tests/models/test_health.py b/harness/tests/models/test_health.pyindex 40173cb2..a0f305ab 100644--- a/harness/tests/models/test_health.py+++ b/harness/tests/models/test_health.py@@ -19,7 +19,7 @@ def test_health_threshold_requires_a_real_success_rate_and_names_the_reason():)# the doctor line carries the provider's reasonh = Health(- "gemini:gemini-3.7-flash",+ "gemini:gemini-3.8-flash",n_ok=0,n_tried=4,reasons=("ModelError: Gemini API error 504: Deadline expired",),@@ -48,7 +48,7 @@ def test_probe_never_raises_when_every_call_fails(monkeypatch):raise RuntimeError("provider on fire")monkeypatch.setattr(health, "_bare_model", lambda *a, **k: Boom())- h = health.probe("gemini:gemini-3.7-flash", sample=3, timeout_s=1)+ h = health.probe("gemini:gemini-3.8-flash", sample=3, timeout_s=1)assert not h.ok and h.n_ok == 0 and h.n_tried == 3assert h.reasons and "provider on fire" in h.reasons[0]@@ -67,7 +67,7 @@ def test_probe_model_treats_a_503_as_final(monkeypatch):monkeypatch.setattr(gm, "rotate_with_retries", fake_rotate)# a non-live test must pass with no credentials (PORT-2)monkeypatch.setattr(gm, "_default_keys", lambda: ["fake-key-for-tests"])- m = _bare_model("gemini:gemini-3.7-flash", 30.0)+ m = _bare_model("gemini:gemini-3.8-flash", 30.0)assert m.storm_attempts == 0 and m.max_attempts == 1import contextlibdiff --git a/harness/tests/models/test_live_gemini.py b/harness/tests/models/test_live_gemini.pyindex a69d54dd..e3d46fdc 100644--- a/harness/tests/models/test_live_gemini.py+++ b/harness/tests/models/test_live_gemini.py@@ -14,7 +14,7 @@ from codeverse3d.models import get_chat_modelpytestmark = pytest.mark.live-MODEL = "gemini:gemini-3.7-flash"+MODEL = "gemini:gemini-3.8-flash"@pytest.fixture(scope="module")diff --git a/harness/tests/models/test_pricing.py b/harness/tests/models/test_pricing.pyindex 18b47840..fe29139e 100644--- a/harness/tests/models/test_pricing.py+++ b/harness/tests/models/test_pricing.py@@ -15,7 +15,7 @@ def test_gemini_cost_math():input_tokens=1_000_000, cached_tokens=400_000, output_tokens=100_000, thoughts_tokens=50_000)# 600k*0.75 + 400k*0.075 + 150k*3.75 (per 1M)- assert abs(estimate_cost("gemini", "gemini-3.7-flash", u) - (0.45 + 0.03 + 0.5625)) < 1e-9+ assert abs(estimate_cost("gemini", "gemini-3.8-flash", u) - (0.45 + 0.03 + 0.5625)) < 1e-9def test_astra_prices_cached_input_reasoning_and_its_strict_long_prompt_tier():@@ -37,12 +37,12 @@ def test_astra_prices_cached_input_reasoning_and_its_strict_long_prompt_tier():("anthropic", "claude-haiku-4-5-20251001", "claude-haiku-4-5"),("openai", "gpt-6.1-sol-2026", "gpt-6.1-sol"),("openai", "gpt-6-sol", "gpt-6-sol"),- ("gemini", "gemini-3.7-flash-preview-09", "gemini-3.7-flash"),- ("gemini", "gemini-3.7-flash-latest", "gemini-3.7-flash"),- ("gemini", "gemini-2.5-flash-image-preview", "gemini-2.5-flash-image"),+ ("gemini", "gemini-3.8-flash-preview-09", "gemini-3.8-flash"),+ ("gemini", "gemini-3.8-flash-latest", "gemini-3.8-flash"),+ ("gemini", "gemini-2.5-flash-preview-05", "gemini-2.5-flash"),# agy's effort-suffixed ids (every agy session was priced $0 until 2026-09-23)- ("gemini", "gemini-3.7-flash-medium", "gemini-3.7-flash"),- ("gemini", "gemini-3.7-flash-high", "gemini-3.7-flash"),+ ("gemini", "gemini-3.8-flash-medium", "gemini-3.8-flash"),+ ("gemini", "gemini-3.8-flash-high", "gemini-3.8-flash"),("openai", "gpt-6-astra-2026-09-01", "gpt-6-astra"),],)@@ -55,7 +55,7 @@ def test_a_dated_or_tagged_id_prices_on_its_family_row(provider, model, row):[("openai", "gpt-55"),("openai", "gpt-5.7"), # ".7" is a different minor version, not a date tag- ("gemini", "gemini-3.7-flash-lite"),+ ("gemini", "gemini-3.8-flash-lite"),("anthropic", "claude-opus-5-5-turbo"),("anthropic", "claude-opus-5"), # an older generation is no longer priced("openai", "gpt-6.1-sol-mini"),diff --git a/harness/tests/orchestrator_tracks/data/offrecord_runs.json b/harness/tests/orchestrator_tracks/data/offrecord_runs.jsonindex 4b22633a..a95fe57a 100644--- a/harness/tests/orchestrator_tracks/data/offrecord_runs.json+++ b/harness/tests/orchestrator_tracks/data/offrecord_runs.json@@ -32,7 +32,7 @@"output_tokens": 66902,"cached_tokens": 2167020,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "baseline_r00",@@ -47,7 +47,7 @@"output_tokens": 59,"cached_tokens": 8119,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine.a2_r01",@@ -62,7 +62,7 @@"output_tokens": 15943,"cached_tokens": 1258366,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine.a2_r03",@@ -77,7 +77,7 @@"output_tokens": 51036,"cached_tokens": 1745205,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_r01",@@ -92,7 +92,7 @@"output_tokens": 79,"cached_tokens": 48796,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_r02",@@ -107,7 +107,7 @@"output_tokens": 20677,"cached_tokens": 654722,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_r03",@@ -122,7 +122,7 @@"output_tokens": 46718,"cached_tokens": 2132151,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"}],"judges": [@@ -184,7 +184,7 @@"output_tokens": 39110,"cached_tokens": 2705383,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_assembly_r02",@@ -199,7 +199,7 @@"output_tokens": 5733,"cached_tokens": 470929,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_drill_bit.a2_r01",@@ -214,7 +214,7 @@"output_tokens": 657,"cached_tokens": 4056,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_drill_bit_r01",@@ -229,7 +229,7 @@"output_tokens": 597,"cached_tokens": 20253,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_drill_bit_r02",@@ -244,7 +244,7 @@"output_tokens": 676,"cached_tokens": 117672,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_main_housing.a2_r01",@@ -259,7 +259,7 @@"output_tokens": 3374,"cached_tokens": 206972,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_main_housing_r01",@@ -274,7 +274,7 @@"output_tokens": 2065,"cached_tokens": 170369,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_main_housing_r02",@@ -289,7 +289,7 @@"output_tokens": 2745,"cached_tokens": 69091,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_overall.a2_r01",@@ -304,7 +304,7 @@"output_tokens": 7017,"cached_tokens": 755220,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_overall_r01",@@ -319,7 +319,7 @@"output_tokens": 49693,"cached_tokens": 2784983,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_rubber_overmold.a2_r01",@@ -334,7 +334,7 @@"output_tokens": 22979,"cached_tokens": 2022413,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_rubber_overmold_r01",@@ -349,7 +349,7 @@"output_tokens": 25188,"cached_tokens": 1923276,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_rubber_overmold_r02",@@ -364,7 +364,7 @@"output_tokens": 23083,"cached_tokens": 2295740,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"}],"judges": [@@ -414,7 +414,7 @@"output_tokens": 21382,"cached_tokens": 1870162,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_desk_top_r02",@@ -429,7 +429,7 @@"output_tokens": 1315,"cached_tokens": 0,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_drawer_front_r02",@@ -444,7 +444,7 @@"output_tokens": 3576,"cached_tokens": 320173,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_leather_inlay_r01",@@ -459,7 +459,7 @@"output_tokens": 1460,"cached_tokens": 20284,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_overall_r01",@@ -474,7 +474,7 @@"output_tokens": 504,"cached_tokens": 133228,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"},{"dir": "refine_overall_r02",@@ -489,7 +489,7 @@"output_tokens": 309,"cached_tokens": 4041,"backend": "api-agent",- "model": "gemini:gemini-3.7-flash"+ "model": "gemini:gemini-3.8-flash"}],"judges": [diff --git a/harness/tests/orchestrator_tracks/test_baseline_first.py b/harness/tests/orchestrator_tracks/test_baseline_first.pyindex 1def652a..a3196fd8 100644--- a/harness/tests/orchestrator_tracks/test_baseline_first.py+++ b/harness/tests/orchestrator_tracks/test_baseline_first.py@@ -53,7 +53,6 @@ def test_round0_is_one_session_owning_every_part_file_and_the_entry(tmp_path, se# the object tasks ask for no effort: the session runs at the backend's default (agy: high)assert draft.thinking == "" and session_effort(draft) is Noneassert "The whole object first" in draft.prompt and "placeholder_part" in draft.prompt- assert "targeted edits" in draft.promptdef _last(plan) -> RoundRecord:@@ -86,7 +85,7 @@ def test_refine_round_is_one_whole_object_session_with_placeholder_errors_first(assert "bolt heads" in lines[2] and "darker steel" in lines[3]body = refine.promptassert body.index("placeholder box") < body.index("floats 12 mm") < body.index("bolt heads")- assert "Edit in place" in body and "never rewrite a whole file" in body+ assert "Edit in place" in bodyassert "Measured vs planned" in bodydiff --git a/harness/tests/orchestrator_tracks/test_cost_accounting.py b/harness/tests/orchestrator_tracks/test_cost_accounting.pyindex bec438d0..6a6e09dc 100644--- a/harness/tests/orchestrator_tracks/test_cost_accounting.py+++ b/harness/tests/orchestrator_tracks/test_cost_accounting.py@@ -18,7 +18,7 @@ FIXTURES = json.loads((Path(__file__).parent / "data" / "offrecord_runs.json").rdef _usage(row: dict) -> Usage:- return Usage(backend=row.get("backend") or "api-agent", model=row.get("model") or "gemini:gemini-3.7-flash",+ return Usage(backend=row.get("backend") or "api-agent", model=row.get("model") or "gemini:gemini-3.8-flash",cost_usd=row["cost_usd"], input_tokens=row["input_tokens"], output_tokens=row["output_tokens"],cached_tokens=row.get("cached_tokens", 0))@@ -27,7 +27,7 @@ class _RecordedAgent:"""Replays the recorded sessions of one task, attempt by attempt."""kind = "api-agent"- model = "gemini:gemini-3.7-flash"+ model = "gemini:gemini-3.8-flash"def __init__(self, sessions: list[dict]):self.sessions = list(sessions)diff --git a/harness/tests/orchestrator_tracks/test_integrations2.py b/harness/tests/orchestrator_tracks/test_integrations2.pyindex 2c4e17c1..262092e7 100644--- a/harness/tests/orchestrator_tracks/test_integrations2.py+++ b/harness/tests/orchestrator_tracks/test_integrations2.py@@ -56,18 +56,10 @@ def test_each_runtime_states_which_file_owns_what(chair_plan):assert scene.files_for(plan, "Quay/Bollard") == ["src/zones/quay.js"] and scene.files_for(plan, "overall") == []-# --------------------------------------------------------------------- (f) no texture pass in the run-def test_the_run_itself_never_textures_even_when_asked(tmp_path, chair_plan, settings, monkeypatch):- """D31: the texture pass belongs to the hand-over of the PICKED round, not to finalise. The same- run shows the track handing the plan's attach_to pairs to the connectivity gate, spelled in the+# --------------------------------------------------------------------- (f) connectivity edges+def test_the_track_hands_the_plans_attach_to_pairs_to_the_connectivity_gate(tmp_path, chair_plan, settings):+ """The track hands the plan's attach_to pairs to the connectivity gate, spelled in theGLB's part names (the gate's contact ledger is the judge's assembly_fit ground truth)."""- import codeverse3d.texturing.run as trun-- def boom(*a, **kw):- raise AssertionError("texture_pass must not run inside a run")-- monkeypatch.setattr(trun, "texture_pass", boom)- rec, _ws, _judge, services = _static_run(tmp_path, chair_plan, settings, tags=["texture"])- assert "texturing" not in rec.extra+ _rec, _ws, _judge, services = _static_run(tmp_path, chair_plan, settings)# the fake build exports one node per plan part under the plan's own name (no instance copies)assert services.planned_edges == [[("FrontLeg", ("Seat",)), ("BackLeg", ("Seat",)), ("Backrest", ("BackLeg",)), ("Armrest", ("BackLeg",))]]diff --git a/harness/tests/orchestrator_tracks/test_round_economics.py b/harness/tests/orchestrator_tracks/test_round_economics.pyindex 94e3ac76..d6065e06 100644--- a/harness/tests/orchestrator_tracks/test_round_economics.py+++ b/harness/tests/orchestrator_tracks/test_round_economics.py@@ -34,7 +34,7 @@ class _TurnAgent:"""Burns turns; reports 'max_turns (N) reached' when it runs out."""kind = "fake"- model = "gemini:gemini-3.7-flash"+ model = "gemini:gemini-3.8-flash"def __init__(self, *, writes_on: int = 2, cost: float = 0.2):self.jobs: list[AgentJob] = []diff --git a/harness/tests/orchestrator_tracks/test_transport_retry.py b/harness/tests/orchestrator_tracks/test_transport_retry.pyindex 0dceb6ad..1faae7ca 100644--- a/harness/tests/orchestrator_tracks/test_transport_retry.py+++ b/harness/tests/orchestrator_tracks/test_transport_retry.py@@ -246,7 +246,7 @@ def test_hung_best_of_n_candidates_get_the_round_loops_retry(tmp_path, chair_pladef test_a_single_shot_refine_needs_only_the_judge_reserve(tmp_path, chair_plan, settings):- """The economy profile's refine is one API call, not a session: 270 s left (> the 240 s judge+ """A single-shot refine is one API call, not a session: 270 s left (> the 240 s judgereserve, < the 420 s an agent session needs) still opens the round and gets it judged."""from tests.orchestrator_tracks.conftest import FAKE_CLOCK, fake_clockdiff --git a/harness/tests/prompts/conftest.py b/harness/tests/prompts/conftest.pyindex 1e67c677..9d00757b 100644--- a/harness/tests/prompts/conftest.py+++ b/harness/tests/prompts/conftest.py@@ -28,9 +28,9 @@ PROMPT_FILES = sorted(p.relative_to(PROMPTS_DIR).as_posix() for p in PROMPTS_DIRdef is_template(rel: str) -> bool:- """Rendered with a context (jinja): the ``.j2`` files, each language's ``system.md`` and the- texturing prompts. Every other file is quoted verbatim and must stay jinja-inert."""- return rel.endswith(".j2") or rel.startswith("texturing/") or (rel.endswith("/system.md") and not rel.startswith("system/"))+ """Rendered with a context (jinja): the ``.j2`` files and each language's ``system.md``.+ Every other file is quoted verbatim and must stay jinja-inert."""+ return rel.endswith(".j2") or (rel.endswith("/system.md") and not rel.startswith("system/"))_FENCE = re.compile(r"```(\w[\w-]*)\n(.*?)```", re.DOTALL)diff --git a/harness/tests/prompts/manifest.json b/harness/tests/prompts/manifest.jsonindex 6f19c1b2..081fcf67 100644--- a/harness/tests/prompts/manifest.json+++ b/harness/tests/prompts/manifest.json@@ -11,18 +11,18 @@"chat:planner:planner/messages": {"bytes": 1328, "sha256": "313c87553cf38df423dc9245a8af4cca5a41a844b489e13a5dc08e8c44eabba5"},"chat:planner:planner/sampling": {"bytes": 10001, "sha256": "0ff37a3ae43fdf878dd0911a9954d57e49365ad788c84818ea01d350310ab401"},"chat:planner:planner/system": {"bytes": 20030, "sha256": "45dccfcf72b4c6e46b7ceeaae8af0ebddf6f6e6b5970cda5fe900aa47682bf06"},- "context:runs/run/files": {"bytes": 45536, "sha256": "754895270e93f3df8388927163e85613f5012f44b2c2c028b5cf651b42d8f095"},- "job:baseline@r00/prompt": {"bytes": 20078, "sha256": "d81c6b7a20cbaea5300ea8ceb1bfcac6d10b5a78b7a72e85787ac5cb54a988aa"},+ "context:runs/run/files": {"bytes": 45788, "sha256": "994ab7a132562070b8aaed99aec9b984eb871e3b3dd767b71c7b0aec2f0a222a"},+ "job:baseline@r00/prompt": {"bytes": 19680, "sha256": "60580670e903b8d76bdad9f76ffb88dcdd42b923a30348858cd5724dd4eb2e2d"},"job:baseline@r00/scope": {"bytes": 383, "sha256": "7187fd726a9f499668ae3df0399ed4a3e08b7cb7a9de5ba753b8775448ea876e"},"job:baseline@r00/system": {"bytes": 3271, "sha256": "29f5a9b2e7b9a879be58963ce95ae6fbec7460dae6785d542b214d6b850e21f4"},- "job:refine@r01/prompt": {"bytes": 7562, "sha256": "328c6f4ffce62283a158a78af4dd3f87b0322efdca2679da200b3b9139464e60"},+ "job:refine@r01/prompt": {"bytes": 7267, "sha256": "a718673dc59d566a5af561d8543756e0326057613430e6dae0cb13eb23b8234e"},"job:refine@r01/scope": {"bytes": 379, "sha256": "d17ae76997ec9443d52089e32ec81ecac3ba2c93529b227533942e84598113d9"},"job:refine@r01/system": {"bytes": 3271, "sha256": "29f5a9b2e7b9a879be58963ce95ae6fbec7460dae6785d542b214d6b850e21f4"},- "judge:articulated:runs/run/artifacts/renders/r00/input": {"bytes": 9884, "sha256": "b8b8e6c5f11f440a8563eb9bbb1c2dd9fd32f78da6d35078e1f54eb231cc80c0"},+ "judge:articulated:runs/run/artifacts/renders/r00/input": {"bytes": 9845, "sha256": "5929e0acefb1af7df0c1efa5407df21d151aa8301c9866df852a59371e9617ac"},"judge:articulated:runs/run/artifacts/renders/r00/messages": {"bytes": 7266, "sha256": "44869437393997f2107fdf0a59b70d830557064fa5958abfbee786e535323a2c"},"judge:articulated:runs/run/artifacts/renders/r00/sampling": {"bytes": 11989, "sha256": "e93c46f5a7a740cd7cf30206976488736804f2b016f39424b2f0e41bfbea1c29"},"judge:articulated:runs/run/artifacts/renders/r00/system": {"bytes": 13129, "sha256": "b6c7c917b035224ca53b1a3e1fcd0c838b8ac20563e687cd6521d8cab4a78ed6"},- "judge:articulated:runs/run/artifacts/renders/r01/input": {"bytes": 10787, "sha256": "ccb99967b785a412cbd6bdbf0b1ecfc92cb5ba25747e678bbcc6a8c4e56b83e1"},+ "judge:articulated:runs/run/artifacts/renders/r01/input": {"bytes": 10748, "sha256": "80c901eab99e958a3131ad7c772547149c5bba6e25b3ca1070a01ae63bfc66d5"},"judge:articulated:runs/run/artifacts/renders/r01/messages": {"bytes": 7591, "sha256": "a2e7394b1d8515b0256e914ceb6b07eaf526a634104ea03829c559e5fd7ebf67"},"judge:articulated:runs/run/artifacts/renders/r01/sampling": {"bytes": 11989, "sha256": "e93c46f5a7a740cd7cf30206976488736804f2b016f39424b2f0e41bfbea1c29"},"judge:articulated:runs/run/artifacts/renders/r01/system": {"bytes": 13129, "sha256": "b6c7c917b035224ca53b1a3e1fcd0c838b8ac20563e687cd6521d8cab4a78ed6"},@@ -51,11 +51,11 @@"chat:planner:planner/messages": {"bytes": 1328, "sha256": "313c87553cf38df423dc9245a8af4cca5a41a844b489e13a5dc08e8c44eabba5"},"chat:planner:planner/sampling": {"bytes": 10001, "sha256": "0ff37a3ae43fdf878dd0911a9954d57e49365ad788c84818ea01d350310ab401"},"chat:planner:planner/system": {"bytes": 20030, "sha256": "45dccfcf72b4c6e46b7ceeaae8af0ebddf6f6e6b5970cda5fe900aa47682bf06"},- "judge:articulated:runs/run/artifacts/renders/r00/input": {"bytes": 9604, "sha256": "80435bd0207e04f9d3384039b4b2c140056e8406af4c3616cfc019430969244b"},+ "judge:articulated:runs/run/artifacts/renders/r00/input": {"bytes": 9565, "sha256": "34d67889b35ec52b188668fe4c2982cc1f24675d1974dd11711b584fab28ebae"},"judge:articulated:runs/run/artifacts/renders/r00/messages": {"bytes": 7120, "sha256": "7a0ef8d51456faa2c38867eea6c502fbe1a7aa30d6cd9f23b44701a2d11846bf"},"judge:articulated:runs/run/artifacts/renders/r00/sampling": {"bytes": 11989, "sha256": "e93c46f5a7a740cd7cf30206976488736804f2b016f39424b2f0e41bfbea1c29"},"judge:articulated:runs/run/artifacts/renders/r00/system": {"bytes": 13129, "sha256": "b6c7c917b035224ca53b1a3e1fcd0c838b8ac20563e687cd6521d8cab4a78ed6"},- "judge:articulated:runs/run/artifacts/renders/r01/input": {"bytes": 10507, "sha256": "1dc1b1c082595444ef377d6bce19d98357d14450f414fca3dc0e80728a12da8d"},+ "judge:articulated:runs/run/artifacts/renders/r01/input": {"bytes": 10468, "sha256": "dd4d71680d8fae3259947cf894ba5ebfcaca9f5249df9f90d810b01ba56f69f5"},"judge:articulated:runs/run/artifacts/renders/r01/messages": {"bytes": 7445, "sha256": "2a654e5bb10f8a642367b40c8893a16dce24c4bc4f6941cfbba76ce348ad4f1c"},"judge:articulated:runs/run/artifacts/renders/r01/sampling": {"bytes": 11989, "sha256": "e93c46f5a7a740cd7cf30206976488736804f2b016f39424b2f0e41bfbea1c29"},"judge:articulated:runs/run/artifacts/renders/r01/system": {"bytes": 13129, "sha256": "b6c7c917b035224ca53b1a3e1fcd0c838b8ac20563e687cd6521d8cab4a78ed6"},@@ -72,24 +72,24 @@"chat:planner:planner/messages": {"bytes": 348, "sha256": "f50fc3cdf3a426fc9c9b830b6e68d2cfe9fd9b7125550362b018f9c9b454b25c"},"chat:planner:planner/sampling": {"bytes": 3421, "sha256": "918170272cea656e8c542c54b777c57d1a4567a8cc36a0c1cd825cb81a01b9bb"},"chat:planner:planner/system": {"bytes": 11919, "sha256": "194d0e2a724c4799816033228af15cac568dd51c14ed85bff9c94ae5ba281866"},- "context:runs/run/_cand/c0/files": {"bytes": 32156, "sha256": "072c694a9a953e9ac63302ccd0b3165f4560e3f104d16cdda58b65bb840f82c0"},- "context:runs/run/_cand/c1/files": {"bytes": 32156, "sha256": "072c694a9a953e9ac63302ccd0b3165f4560e3f104d16cdda58b65bb840f82c0"},- "context:runs/run/files": {"bytes": 32156, "sha256": "072c694a9a953e9ac63302ccd0b3165f4560e3f104d16cdda58b65bb840f82c0"},- "job:baseline_c0@r00/prompt": {"bytes": 11356, "sha256": "5e82c0438d0d084acbf0d2cfacfdde06ef2c7b9cd5675e258ac5a2c032a82fee"},+ "context:runs/run/_cand/c0/files": {"bytes": 32408, "sha256": "51c869ee3e50de5f07b165fd818af922c2e427ef818a2e31a3b22b3246571cfd"},+ "context:runs/run/_cand/c1/files": {"bytes": 32408, "sha256": "51c869ee3e50de5f07b165fd818af922c2e427ef818a2e31a3b22b3246571cfd"},+ "context:runs/run/files": {"bytes": 32408, "sha256": "51c869ee3e50de5f07b165fd818af922c2e427ef818a2e31a3b22b3246571cfd"},+ "job:baseline_c0@r00/prompt": {"bytes": 11347, "sha256": "5aca38cfae577e7e5e5974c2b6cd64e55ec35a1dfab33eaf62eff70652854df5"},"job:baseline_c0@r00/scope": {"bytes": 383, "sha256": "51d22961200ef987a7c652af48ff2897b910803baa672d3081f53c3fb819a685"},"job:baseline_c0@r00/system": {"bytes": 3173, "sha256": "c3879a563e2a512b82358d0c3927dcbfe9347725e592035a9b64c5d1b34e6654"},- "job:baseline_c1@r00/prompt": {"bytes": 11356, "sha256": "5e82c0438d0d084acbf0d2cfacfdde06ef2c7b9cd5675e258ac5a2c032a82fee"},+ "job:baseline_c1@r00/prompt": {"bytes": 11347, "sha256": "5aca38cfae577e7e5e5974c2b6cd64e55ec35a1dfab33eaf62eff70652854df5"},"job:baseline_c1@r00/scope": {"bytes": 383, "sha256": "831265b54627f1f6c1bfadebefa4e898d6b543b253bf6be0685b5383bd39fb57"},"job:baseline_c1@r00/system": {"bytes": 3173, "sha256": "c3879a563e2a512b82358d0c3927dcbfe9347725e592035a9b64c5d1b34e6654"},- "judge:shader:runs/run/_cand/c0/artifacts/renders/r00/input": {"bytes": 4078, "sha256": "e3dd787e6b7cc0aab8d35ce01ff5fbd42a3da389411b7402e6b15a0301f21f8a"},+ "judge:shader:runs/run/_cand/c0/artifacts/renders/r00/input": {"bytes": 4039, "sha256": "290042ab7a91ab3a8fc4130ce3d8be4517ffe6adbe651016103b06c55f5f9a06"},"judge:shader:runs/run/_cand/c0/artifacts/renders/r00/messages": {"bytes": 3727, "sha256": "d7deb2c4a1fa8e9b015a4e81439f9781e7618be6a01b013d18bb3acc4f6a32b9"},"judge:shader:runs/run/_cand/c0/artifacts/renders/r00/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/_cand/c0/artifacts/renders/r00/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},- "judge:shader:runs/run/_cand/c1/artifacts/renders/r00/input": {"bytes": 4078, "sha256": "c825f0fbe74ca0c4fd90b8b3ff2bc2177851d4598ef3878e6ed7753d87d772a3"},+ "judge:shader:runs/run/_cand/c1/artifacts/renders/r00/input": {"bytes": 4039, "sha256": "f60bf5a2af22996a5e6bc6ec6bfbd9404b9786066be3b9683c6acccd002b03dd"},"judge:shader:runs/run/_cand/c1/artifacts/renders/r00/messages": {"bytes": 3727, "sha256": "d7deb2c4a1fa8e9b015a4e81439f9781e7618be6a01b013d18bb3acc4f6a32b9"},"judge:shader:runs/run/_cand/c1/artifacts/renders/r00/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/_cand/c1/artifacts/renders/r00/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},- "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 4024, "sha256": "f7a7cf02a2ac234aa62fc4ab4e3be6cb6cf2305a24c07c66bafec8e728038efd"},+ "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 3985, "sha256": "f032a21cd4f5d9808da3e3279dfad3d98f5ef6014aa6665ec5aa86d082b03363"},"judge:shader:runs/run/artifacts/renders/r00/messages": {"bytes": 3727, "sha256": "d7deb2c4a1fa8e9b015a4e81439f9781e7618be6a01b013d18bb3acc4f6a32b9"},"judge:shader:runs/run/artifacts/renders/r00/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r00/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},@@ -107,8 +107,8 @@"chat:planner:planner/messages": {"bytes": 348, "sha256": "f50fc3cdf3a426fc9c9b830b6e68d2cfe9fd9b7125550362b018f9c9b454b25c"},"chat:planner:planner/sampling": {"bytes": 3421, "sha256": "918170272cea656e8c542c54b777c57d1a4567a8cc36a0c1cd825cb81a01b9bb"},"chat:planner:planner/system": {"bytes": 11919, "sha256": "194d0e2a724c4799816033228af15cac568dd51c14ed85bff9c94ae5ba281866"},- "context:runs/run/files": {"bytes": 32156, "sha256": "072c694a9a953e9ac63302ccd0b3165f4560e3f104d16cdda58b65bb840f82c0"},- "job:baseline@r00/prompt": {"bytes": 11356, "sha256": "5e82c0438d0d084acbf0d2cfacfdde06ef2c7b9cd5675e258ac5a2c032a82fee"},+ "context:runs/run/files": {"bytes": 32408, "sha256": "51c869ee3e50de5f07b165fd818af922c2e427ef818a2e31a3b22b3246571cfd"},+ "job:baseline@r00/prompt": {"bytes": 11347, "sha256": "5aca38cfae577e7e5e5974c2b6cd64e55ec35a1dfab33eaf62eff70652854df5"},"job:baseline@r00/scope": {"bytes": 379, "sha256": "831e9c99bdd04789b89bfddb89c97939a813323c9173d742adabbb5f1f8a7dc1"},"job:baseline@r00/system": {"bytes": 3173, "sha256": "c3879a563e2a512b82358d0c3927dcbfe9347725e592035a9b64c5d1b34e6654"},"job:refine@r01/prompt": {"bytes": 4829, "sha256": "701203307b2677078ab21caca6c39556b594c220e1642a242e45fad4caf905f1"},@@ -117,15 +117,15 @@"job:refine@r02/prompt": {"bytes": 4828, "sha256": "f02f3a218edb95d79000fd339cc556045baccd5087231dd293db83195c927fa7"},"job:refine@r02/scope": {"bytes": 375, "sha256": "c4a7fdb0b390ec75d595006e11b9982113e60c49f5a62a978153167053bbcd33"},"job:refine@r02/system": {"bytes": 3173, "sha256": "c3879a563e2a512b82358d0c3927dcbfe9347725e592035a9b64c5d1b34e6654"},- "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 4024, "sha256": "77a8a69c16f42514152b7169c1afc91bca46d4ececc6bf60e826020cfb87af09"},+ "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 3985, "sha256": "d870900cac8f2619531f77b97eeacdaa18a2422cfdc3648394ad2f9bc80bb513"},"judge:shader:runs/run/artifacts/renders/r00/messages": {"bytes": 3727, "sha256": "d7deb2c4a1fa8e9b015a4e81439f9781e7618be6a01b013d18bb3acc4f6a32b9"},"judge:shader:runs/run/artifacts/renders/r00/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r00/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},- "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 5077, "sha256": "91baae5de582cf7919bad97282b84d07db84fed38e5a2304e901dfd2a2748b0a"},+ "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 5038, "sha256": "86613ceff3c178c920863ab5c33e25efa6f3c8583b5acf1c0d756460a8d44598"},"judge:shader:runs/run/artifacts/renders/r01/messages": {"bytes": 4123, "sha256": "a1f0c207406de6f415fdb8516b695aaedf7f06d25598f33932d2ad728f8c881f"},"judge:shader:runs/run/artifacts/renders/r01/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r01/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},- "judge:shader:runs/run/artifacts/renders/r02/input": {"bytes": 5073, "sha256": "f441039d9cbbfd50ed5d1a38fb008fc63e2c19ed191a866351532a6a190e1c35"},+ "judge:shader:runs/run/artifacts/renders/r02/input": {"bytes": 5034, "sha256": "e5ef544b5dc0b6f46cab4ab5944402afa53871a09efbaf69d7992aec865cdbed"},"judge:shader:runs/run/artifacts/renders/r02/messages": {"bytes": 4123, "sha256": "5b81b09f9d6a7e3225549454099d07143f5bb726c3ccff263b4afc7bfe13d88b"},"judge:shader:runs/run/artifacts/renders/r02/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r02/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},@@ -143,8 +143,8 @@"chat:planner:planner/messages": {"bytes": 348, "sha256": "f50fc3cdf3a426fc9c9b830b6e68d2cfe9fd9b7125550362b018f9c9b454b25c"},"chat:planner:planner/sampling": {"bytes": 3421, "sha256": "918170272cea656e8c542c54b777c57d1a4567a8cc36a0c1cd825cb81a01b9bb"},"chat:planner:planner/system": {"bytes": 11919, "sha256": "194d0e2a724c4799816033228af15cac568dd51c14ed85bff9c94ae5ba281866"},- "context:runs/run/files": {"bytes": 32156, "sha256": "072c694a9a953e9ac63302ccd0b3165f4560e3f104d16cdda58b65bb840f82c0"},- "job:baseline@r00/prompt": {"bytes": 11356, "sha256": "5e82c0438d0d084acbf0d2cfacfdde06ef2c7b9cd5675e258ac5a2c032a82fee"},+ "context:runs/run/files": {"bytes": 32408, "sha256": "51c869ee3e50de5f07b165fd818af922c2e427ef818a2e31a3b22b3246571cfd"},+ "job:baseline@r00/prompt": {"bytes": 11347, "sha256": "5aca38cfae577e7e5e5974c2b6cd64e55ec35a1dfab33eaf62eff70652854df5"},"job:baseline@r00/scope": {"bytes": 379, "sha256": "831e9c99bdd04789b89bfddb89c97939a813323c9173d742adabbb5f1f8a7dc1"},"job:baseline@r00/system": {"bytes": 3173, "sha256": "c3879a563e2a512b82358d0c3927dcbfe9347725e592035a9b64c5d1b34e6654"},"job:r00_baseline_repair1@r00/prompt": {"bytes": 2407, "sha256": "056a91d52ba3c3b09efd2fe13f139c6953fe99205e7c7b53ffc26331b1701b72"},@@ -153,10 +153,10 @@"job:r00_baseline_repair2@r00/prompt": {"bytes": 2712, "sha256": "aa2cfd9457a008820bb834e4931277ad4e7d8826de45de18fd13c21045617991"},"job:r00_baseline_repair2@r00/scope": {"bytes": 391, "sha256": "7e0dbd43421db95ef9078ca03fd146cccc2cc8372380a72fd55fa12ff7217db0"},"job:r00_baseline_repair2@r00/system": {"bytes": 9634, "sha256": "53029a91abfcd13198024a81e77e6b50003f92a850c6c0e339e268a1a22319f9"},- "job:rebuild@r01/prompt": {"bytes": 11539, "sha256": "1feb154736db6ae50413fddd50641bdac992613a50bdc769980d515c842fd433"},+ "job:rebuild@r01/prompt": {"bytes": 11530, "sha256": "55b953a2ecd60c415cec8995694d1dc731bd0d8135bc594a1ba07d68b7f5f09f"},"job:rebuild@r01/scope": {"bytes": 379, "sha256": "471fba995682e47fe12099cb5881743a8aeae71a0243fa3598c72d69a5b31f98"},"job:rebuild@r01/system": {"bytes": 3173, "sha256": "c3879a563e2a512b82358d0c3927dcbfe9347725e592035a9b64c5d1b34e6654"},- "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 4024, "sha256": "f6637594bb85a4806d5e768a6467825652abb7855d33ae866733714bf4489f62"},+ "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 3985, "sha256": "e367200e402b03487531c1963f3a52a62e69c5ae4a444cd79cf533f5a20b97b8"},"judge:shader:runs/run/artifacts/renders/r01/messages": {"bytes": 3727, "sha256": "d7deb2c4a1fa8e9b015a4e81439f9781e7618be6a01b013d18bb3acc4f6a32b9"},"judge:shader:runs/run/artifacts/renders/r01/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r01/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},@@ -179,11 +179,11 @@"chat:planner:planner/messages": {"bytes": 348, "sha256": "f50fc3cdf3a426fc9c9b830b6e68d2cfe9fd9b7125550362b018f9c9b454b25c"},"chat:planner:planner/sampling": {"bytes": 3421, "sha256": "918170272cea656e8c542c54b777c57d1a4567a8cc36a0c1cd825cb81a01b9bb"},"chat:planner:planner/system": {"bytes": 11919, "sha256": "194d0e2a724c4799816033228af15cac568dd51c14ed85bff9c94ae5ba281866"},- "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 4041, "sha256": "b1c2c219851e29fdf3e2ef55acdcbd05f50f1306cb15e643990d5c550a860a0f"},+ "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 4002, "sha256": "6bdd0dcae0cec619608a8c249e0aa9758412fc38b37451e82672fac1734ee746"},"judge:shader:runs/run/artifacts/renders/r00/messages": {"bytes": 3727, "sha256": "d7deb2c4a1fa8e9b015a4e81439f9781e7618be6a01b013d18bb3acc4f6a32b9"},"judge:shader:runs/run/artifacts/renders/r00/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r00/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},- "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 5094, "sha256": "329efb6f51153caef8363b23519c03cff958df73f76dd6a6f0eb4a539efb97f2"},+ "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 5055, "sha256": "873209f50a5429d7bdcf4421b197b8919edee65df20f60670c2f3f7957081dac"},"judge:shader:runs/run/artifacts/renders/r01/messages": {"bytes": 4123, "sha256": "a1f0c207406de6f415fdb8516b695aaedf7f06d25598f33932d2ad728f8c881f"},"judge:shader:runs/run/artifacts/renders/r01/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r01/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},@@ -200,18 +200,18 @@"chat:planner:planner/messages": {"bytes": 348, "sha256": "f50fc3cdf3a426fc9c9b830b6e68d2cfe9fd9b7125550362b018f9c9b454b25c"},"chat:planner:planner/sampling": {"bytes": 3421, "sha256": "918170272cea656e8c542c54b777c57d1a4567a8cc36a0c1cd825cb81a01b9bb"},"chat:planner:planner/system": {"bytes": 14279, "sha256": "b9199fdf3a0bc64a88587f4b8c8efe1443bc20164e1b9e5eada29c7762adff2f"},- "context:runs/run/files": {"bytes": 37038, "sha256": "3e27549d87e15bcfade7e49453aa3d98c42af816dc415e1a77229059c6194ff2"},- "job:baseline@r00/prompt": {"bytes": 13696, "sha256": "b58dab6f7321774b49471e2ba461c767090d8a99fc9d546e194dffc551137e07"},+ "context:runs/run/files": {"bytes": 37290, "sha256": "9c39a1f207a2ebe75f92ae9da268b052e51a64e317cdd2a2566b1d21301a3323"},+ "job:baseline@r00/prompt": {"bytes": 13687, "sha256": "ac1b0fc66ea413b427ddc1e90d80bf967048ec80216aeaef9c4c104c1df5ada3"},"job:baseline@r00/scope": {"bytes": 358, "sha256": "b0e9a906ab8df3ff56acc08198289aa3958c470e5fd16a4e0225178a2d88e715"},"job:baseline@r00/system": {"bytes": 2729, "sha256": "d12d4891ce72156aa561bdfa0ed1fb20c5826412024b0be07b423949528e5df6"},"job:refine@r01/prompt": {"bytes": 4809, "sha256": "564c35401c05213d9906d0ecf84ead9e8c8a54ef51cae13eeb59fcb98e1b7275"},"job:refine@r01/scope": {"bytes": 354, "sha256": "81a4042ba077832530b2a9f64d3e1415da1b655b00caf1006ed51ee616a7b17b"},"job:refine@r01/system": {"bytes": 2729, "sha256": "d12d4891ce72156aa561bdfa0ed1fb20c5826412024b0be07b423949528e5df6"},- "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 4028, "sha256": "c73efe7b56d4885794e8bc52178cd5d56c0c1edc71cae0eb72159619e69e6d75"},+ "judge:shader:runs/run/artifacts/renders/r00/input": {"bytes": 3989, "sha256": "a22f16438978b5696a35336dc39c53140d2ef0ba3d20f8edd278dfbf6102c0fa"},"judge:shader:runs/run/artifacts/renders/r00/messages": {"bytes": 3731, "sha256": "355b5a5eb7617171897155fe818a3975dea97d127ae8416f1352a67bb6a84a19"},"judge:shader:runs/run/artifacts/renders/r00/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r00/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},- "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 5081, "sha256": "d780a48e47e0701679920bd7b03fb703275968f4d36ee59e257453d45942a00c"},+ "judge:shader:runs/run/artifacts/renders/r01/input": {"bytes": 5042, "sha256": "1c5de2d3c951c14714d0d911431c54742606fcf7d3ce3210725847f765c211fd"},"judge:shader:runs/run/artifacts/renders/r01/messages": {"bytes": 4127, "sha256": "a4c4a41eea8d4af3df6646d2aa757c01a0ab663614361e61e76e84e21f9d5378"},"judge:shader:runs/run/artifacts/renders/r01/sampling": {"bytes": 11659, "sha256": "2f41a011f9775b7aaf1ec8c1594be4e9172d23f6eb6dfc4b262c6e6bf1097792"},"judge:shader:runs/run/artifacts/renders/r01/system": {"bytes": 11253, "sha256": "dcf75b56942831a1db5074023dfdad4b4750a3842eb4233dc2d41adacd1de67b"},@@ -259,7 +259,7 @@"chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "context:runs/run/files": {"bytes": 54602, "sha256": "3436b3a05bb9589304ea215d21a50b25e0a26f27c3879f445f7749a5b8b9911f"},+ "context:runs/run/files": {"bytes": 54854, "sha256": "9821622650d6c16f9a4a9a93d3eebf5c6a10436059a027519f573ebeaef0da6f"},"job:asset_bollard@r00/prompt": {"bytes": 12995, "sha256": "06653ddff53c0086045d18d4920a0e504ae9472547a06262501b5fd30be8a05a"},"job:asset_bollard@r00/scope": {"bytes": 357, "sha256": "ac9f0a7bea99ed4a97d2a2d943a7949b7d27a7dac648d57df5712db049586c00"},"job:asset_bollard@r00/system": {"bytes": 2537, "sha256": "7e9f8a86b9f2d38b846e5caad4949915462a3ce3411edfeabe7ed58d245eccb0"},@@ -281,15 +281,15 @@"job:zones_quay_water@r00/prompt": {"bytes": 50923, "sha256": "0f6b6c68040e7d87ba4125f9dcd91823cfee0e47d6849aa41a3f1c4e0d3f4c25"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "d7cde9503b57c30d54062b7f12f1023f1510fad249cff287c3b771c306a065bf"},"job:zones_quay_water@r00/system": {"bytes": 6011, "sha256": "84a58b966fee66290cfdf85997e8ae0f25f840e457f4b331cac118873d2c5cef"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3755, "sha256": "11c9b8092135f98b61dfe0e47b77561a374ab89aaa22ed9472b9b731e3bf8e7f"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3716, "sha256": "fe258c1a4463f6af351f36b5ad19ff0b5bb9eeb66c923da13612dde6e8ccc3bc"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "676859b5172ea33c86195b543b5c80e49dc907598dbdddb57a9734e58df9e8a1"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4755, "sha256": "3788f8a25412e088c56476fd218179fa5dd0704ab1b8da7ae9dc8eb5551647e1"},+ "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4716, "sha256": "98c77461082228940b414255328f36b407574528ce5a1adafe6a215ef66a8fd9"},"judge:scene:runs/run/artifacts/renders/r01/messages": {"bytes": 5298, "sha256": "35679341c294b774ac1c228d9a2bc56f4792f8831dd1c216b513e4427e6cb0c1"},"judge:scene:runs/run/artifacts/renders/r01/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r01/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "judge:scene:runs/run/artifacts/renders/r02/input": {"bytes": 4751, "sha256": "0afb2dd38366bbb0bbb539c943ef4eeeaf4bea82f8748de687eda5af887da0fe"},+ "judge:scene:runs/run/artifacts/renders/r02/input": {"bytes": 4712, "sha256": "c1359d9418f423de52fe8de67878578f071f8c1941e1d1b277d7938b7e3404cc"},"judge:scene:runs/run/artifacts/renders/r02/messages": {"bytes": 5298, "sha256": "0b15d27d13b64c082c86c2e4cea5d85a7f0b3e9daef93b5cb62f698d06570437"},"judge:scene:runs/run/artifacts/renders/r02/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r02/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -329,7 +329,7 @@"chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "context:runs/run/files": {"bytes": 60478, "sha256": "6016dbaa5b9008112d07be60ac672fcede80635a530805c9a8f8c4b5bf4b0250"},+ "context:runs/run/files": {"bytes": 60730, "sha256": "ca95149fc321776a9fc93951b4bd23e6646a51484e29719078f5b418835ea3d0"},"job:env@r00/prompt": {"bytes": 31821, "sha256": "452285156323952fc678cadeca942364e31c196fab266b5c9cc2109daae102a5"},"job:env@r00/scope": {"bytes": 334, "sha256": "e47a619bae6cbaf0dd3d1feb2dc417f786a475434f454187f7446f3747c94ca5"},"job:env@r00/system": {"bytes": 7284, "sha256": "13fb6151a371cd11e8892f5b046bca581b917ccc1a267fef0aa4c189b26983f3"},@@ -342,11 +342,11 @@"job:zones_quay_water@r00/prompt": {"bytes": 38696, "sha256": "8524b350a4485277de24641c0a67881e56b7c25879100cee0210417af6403a62"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "d7cde9503b57c30d54062b7f12f1023f1510fad249cff287c3b771c306a065bf"},"job:zones_quay_water@r00/system": {"bytes": 7284, "sha256": "13fb6151a371cd11e8892f5b046bca581b917ccc1a267fef0aa4c189b26983f3"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3755, "sha256": "11c9b8092135f98b61dfe0e47b77561a374ab89aaa22ed9472b9b731e3bf8e7f"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3716, "sha256": "fe258c1a4463f6af351f36b5ad19ff0b5bb9eeb66c923da13612dde6e8ccc3bc"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "676859b5172ea33c86195b543b5c80e49dc907598dbdddb57a9734e58df9e8a1"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4755, "sha256": "3788f8a25412e088c56476fd218179fa5dd0704ab1b8da7ae9dc8eb5551647e1"},+ "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4716, "sha256": "98c77461082228940b414255328f36b407574528ce5a1adafe6a215ef66a8fd9"},"judge:scene:runs/run/artifacts/renders/r01/messages": {"bytes": 5298, "sha256": "35679341c294b774ac1c228d9a2bc56f4792f8831dd1c216b513e4427e6cb0c1"},"judge:scene:runs/run/artifacts/renders/r01/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r01/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -403,7 +403,7 @@"chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3772, "sha256": "ff1c9893cb3e5f4d8f726e4d35fd23a0532523af32df0ca593728608b89a34c3"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3733, "sha256": "2b7cec48dcea74e007c6358d8579fec0ec37ed1d189b8a042c0e13eee9fa1a0f"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "676859b5172ea33c86195b543b5c80e49dc907598dbdddb57a9734e58df9e8a1"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -414,12 +414,12 @@},"stage_keys": {"runs/run:assemble": "8cb488f00680",- "runs/run:assets": "65004503e9ac",- "runs/run:env": "65004503e9ac",- "runs/run:layouts": "65004503e9ac",+ "runs/run:assets": "1fe4141b3b47",+ "runs/run:env": "1fe4141b3b47",+ "runs/run:layouts": "1fe4141b3b47","runs/run:plan": "8e0191e2d157","runs/run:skeleton": "e42c2d2f88e0",- "runs/run:zones": "dd826357aa4a"+ "runs/run:zones": "d83624cb1257"}},"scene.scene_threejs.agent.fresh": {@@ -445,7 +445,7 @@"chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "context:runs/run/files": {"bytes": 55862, "sha256": "86406a7632ccef0cc564c8b96fafddfe0bb401dfeeeccfdb476e730ac5a1661b"},+ "context:runs/run/files": {"bytes": 56114, "sha256": "5f2b6a8aded7d754f30945bb62acdac9287caabef9fa56103e09962f6c669cda"},"job:asset_bollard@r00/prompt": {"bytes": 5182, "sha256": "eb2371d5d91daf0664ea4155eed95618b5798277e9b8e5cd118e48181aa499a3"},"job:asset_bollard@r00/scope": {"bytes": 357, "sha256": "450d659126efa73cdfe3371f18464e6ab40230af78367de6994d4712c9a8aaaf"},"job:asset_bollard@r00/system": {"bytes": 997, "sha256": "20d72b3bb074ab09ce4b2b6656b8bd0fcffef4fd3d437f2c171cb3efd96d475c"},@@ -467,15 +467,15 @@"job:zones_quay_water@r00/prompt": {"bytes": 53496, "sha256": "82b80505d5bb0ecc0ed5c7bc53f7d0bafdb8dc8102cb51c314e6628b3e7ffbcc"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3755, "sha256": "7fa5ae748295e277f0edb9fc51a241ac20ccf6c64a88431cb95bf08313fb661a"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3716, "sha256": "f1aef1e33eb9c801d1b02bf7028d4a4738a56455427eaef288b8b4ad7016eeaf"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "562ef4bfc6b24c34604482cb73a02fb4b01da5c0e70685e3a1a4e1dda616a827"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4755, "sha256": "b386a92b7164f283a376ee84122a5ab109a1b709e28ade5a269337fe8c587ae0"},+ "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4716, "sha256": "f86d30ec9fdd660eac0d9d4fdf9f445f523cc7d90c6bb8aa26ec5167e33fc351"},"judge:scene:runs/run/artifacts/renders/r01/messages": {"bytes": 5298, "sha256": "c9a488e3385bb803ce084eda9a1ad2ed58c338201f1ad6d7f416cf0070f1a9f1"},"judge:scene:runs/run/artifacts/renders/r01/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r01/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "judge:scene:runs/run/artifacts/renders/r02/input": {"bytes": 4751, "sha256": "2300148c08e41d46deca89c02bad3af6d0f0170538b7ab50c270c8ad09977938"},+ "judge:scene:runs/run/artifacts/renders/r02/input": {"bytes": 4712, "sha256": "dc6890544a07d3842f6c4577b6b3978211d9f32ec451b3b38a361bd43c0eddda"},"judge:scene:runs/run/artifacts/renders/r02/messages": {"bytes": 5298, "sha256": "d8e7af12d299bcc4d09f7b68a6cdf3de2816e89d0d785ff88153c9e3aa5ce8cd"},"judge:scene:runs/run/artifacts/renders/r02/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r02/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -530,8 +530,8 @@"chat:planner:zone-layout#2/messages": {"bytes": 338, "sha256": "cf35cdac8d52e9f3d5da4cb2419e4bc4292f83757f4f60afa75b94ab4bfea20f"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3361, "sha256": "9acfcedb047a4f1623c483cb99c1f8aa30fd1158e56f88d1c1518f138db1b34f"},- "context:runs/run/_assets/crate/files": {"bytes": 32490, "sha256": "6bba6c21d5e1c44df63b28444347a0322975c382acbc24df63c93830f972761c"},- "context:runs/run/files": {"bytes": 55862, "sha256": "86406a7632ccef0cc564c8b96fafddfe0bb401dfeeeccfdb476e730ac5a1661b"},+ "context:runs/run/_assets/crate/files": {"bytes": 32742, "sha256": "fee09c023ada7ce7895e070195596c0b5103ecc5dabf1cd86dbc5352775c90b2"},+ "context:runs/run/files": {"bytes": 56114, "sha256": "5f2b6a8aded7d754f30945bb62acdac9287caabef9fa56103e09962f6c669cda"},"job:asset_crate@r00/prompt": {"bytes": 18032, "sha256": "27dfd5f4bedcc036f93c844230347401da2c4c4f8b1d300bfaece147b704c3fc"},"job:asset_crate@r00/scope": {"bytes": 430, "sha256": "3c4b45fd7cc847cc6a6a5f3b83784cddab99440be445d61f924f56b834cd1476"},"job:asset_crate@r00/system": {"bytes": 3716, "sha256": "6068eff7b8c36b4edcc5d64ead79bd3de7386e0bbaf4fb141210883fb34f8518"},@@ -541,15 +541,15 @@"job:zones_quay_water@r00/prompt": {"bytes": 53676, "sha256": "3b2b4db061b894aca9121f762690c234369d83ea0d960bb5172ad2f4a5684726"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate/input": {"bytes": 3824, "sha256": "d2b8392354ef8ee0eaaa261eedb39f1c73fddc4373960c48d513e50b707daa57"},+ "judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate/input": {"bytes": 3785, "sha256": "21bd05c59f26de033b992c9980f979b2bb36e4de54f47998ed8e0d9dd93dcb28"},"judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate/messages": {"bytes": 3099, "sha256": "eee511c765a105054417cb3fa37bf67c24bcf9022da44dc086385878a61d5f67"},"judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate/sampling": {"bytes": 8355, "sha256": "a80299c8dfc30739d05a0274526c361cb406c78a1ab5e923fcdf78d8c78ea73a"},"judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate/system": {"bytes": 8834, "sha256": "8b52aa8a0e80ff6ba98f494c36013745f5dd07a4e1040d72ff7f55aeeb907ba5"},- "judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate_fix/input": {"bytes": 3844, "sha256": "f53c37a588a498c52a403ce9178c0aea6e599a0b8ec944c1a9a88baf0e6ef175"},+ "judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate_fix/input": {"bytes": 3805, "sha256": "b87ed064f9857cfd4d2c6555cc545a0dd87de441a988ecd3411a9e582d2c2a3e"},"judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate_fix/messages": {"bytes": 3099, "sha256": "eee511c765a105054417cb3fa37bf67c24bcf9022da44dc086385878a61d5f67"},"judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate_fix/sampling": {"bytes": 8355, "sha256": "a80299c8dfc30739d05a0274526c361cb406c78a1ab5e923fcdf78d8c78ea73a"},"judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate_fix/system": {"bytes": 8834, "sha256": "8b52aa8a0e80ff6ba98f494c36013745f5dd07a4e1040d72ff7f55aeeb907ba5"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3762, "sha256": "44cfcf9a5d4f9e2ccb999185652b82d5b75a589f088dedcce128cbe2e0d0b958"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3723, "sha256": "06066c33ccaef0d3151e448537ad71535fa1185a2c5b64794b15348d200e8b0e"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4937, "sha256": "407f918497c4e96ed25d4a9c5c968993644c2a43fadfcc1bc6a0c4f7e6a9d99f"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -578,14 +578,14 @@"chat:planner:planner/messages": {"bytes": 204, "sha256": "b91c27cbf7a8071bf320a68a6113bd25896bf0422f92b9087fb155bad18dbdc1"},"chat:planner:planner/sampling": {"bytes": 8047, "sha256": "ac5eba7173d30fcdfc0682ff102fc65e9f4325a5a4f1fbdaca4b0dcd4547d4b1"},"chat:planner:planner/system": {"bytes": 26885, "sha256": "1dd3bb7f2490e9e655149e12cffeebcb43c6b91559b78bc942a4e38f741f7223"},- "context:runs/run/files": {"bytes": 55862, "sha256": "86406a7632ccef0cc564c8b96fafddfe0bb401dfeeeccfdb476e730ac5a1661b"},+ "context:runs/run/files": {"bytes": 56114, "sha256": "5f2b6a8aded7d754f30945bb62acdac9287caabef9fa56103e09962f6c669cda"},"job:env@r00/prompt": {"bytes": 47541, "sha256": "9b99f01eaaca7ad62a4e0ba8210f3c6c6d70fc095631a0c616dbbf067f597fb6"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"job:zones_quay_water@r00/prompt": {"bytes": 52823, "sha256": "2a2e8d28955755da2036d29d9deb83a462d43e649e2e0845f0bab8cb746edf1c"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3755, "sha256": "c1ace02589db83a171c73e42785af63acd95ac141b2c40cb1439e12ded9bd12c"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3716, "sha256": "639e646848634abcb37fb477595515720276cf73aff3a00f963fbbd747c6c5c7"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "562ef4bfc6b24c34604482cb73a02fb4b01da5c0e70685e3a1a4e1dda616a827"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -622,7 +622,7 @@"chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "context:runs/run/files": {"bytes": 55862, "sha256": "86406a7632ccef0cc564c8b96fafddfe0bb401dfeeeccfdb476e730ac5a1661b"},+ "context:runs/run/files": {"bytes": 56114, "sha256": "5f2b6a8aded7d754f30945bb62acdac9287caabef9fa56103e09962f6c669cda"},"job:env@r00/prompt": {"bytes": 47541, "sha256": "9b99f01eaaca7ad62a4e0ba8210f3c6c6d70fc095631a0c616dbbf067f597fb6"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},@@ -659,63 +659,6 @@"runs/run:zones": "0526c0ee5233"}},- "scene.scene_threejs.agent.textures": {- "payloads": {- "chat:model:asset_bollard:r00/messages": {"bytes": 3327, "sha256": "1a2c11617634f2944f0e66819a64d644a0180612213856e98575191a481f2a5b"},- "chat:model:asset_bollard:r00/sampling": {"bytes": 92, "sha256": "08e72af1b4fb249378c5a151e019ded70a1014eafa4d50f70927bb225f695678"},- "chat:model:asset_bollard:r00/system": {"bytes": 3483, "sha256": "79f9f153926a1b9edee34e0fbc13767ff419319c18575fc0ad2bb553d9e6f3ad"},- "chat:model:asset_fishing_boat:r00/messages": {"bytes": 3365, "sha256": "583f9c5888c4ff1567e3cbb2d9e3e8701e31169fd30f295d89dae16e046e55cc"},- "chat:model:asset_fishing_boat:r00/sampling": {"bytes": 92, "sha256": "08e72af1b4fb249378c5a151e019ded70a1014eafa4d50f70927bb225f695678"},- "chat:model:asset_fishing_boat:r00/system": {"bytes": 3483, "sha256": "79f9f153926a1b9edee34e0fbc13767ff419319c18575fc0ad2bb553d9e6f3ad"},- "chat:planner:planner/messages": {"bytes": 204, "sha256": "b91c27cbf7a8071bf320a68a6113bd25896bf0422f92b9087fb155bad18dbdc1"},- "chat:planner:planner/sampling": {"bytes": 8047, "sha256": "ac5eba7173d30fcdfc0682ff102fc65e9f4325a5a4f1fbdaca4b0dcd4547d4b1"},- "chat:planner:planner/system": {"bytes": 26885, "sha256": "1dd3bb7f2490e9e655149e12cffeebcb43c6b91559b78bc942a4e38f741f7223"},- "chat:planner:zone-layout#0/messages": {"bytes": 331, "sha256": "eeefd42e9d8d37a901af0ae126aebf39fb2e7861fabe6208d3a9408e1a3c1b37"},- "chat:planner:zone-layout#0/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},- "chat:planner:zone-layout#0/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "chat:planner:zone-layout#1/messages": {"bytes": 401, "sha256": "73206223434695497c74e5f8f5bc0a0f1b147a7dc38147645c6cf42b5372484b"},- "chat:planner:zone-layout#1/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},- "chat:planner:zone-layout#1/system": {"bytes": 3391, "sha256": "fa6d28546a947ddc6ab8d0adb8af97a1605873109a47cf7f097f72d9788fd678"},- "chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},- "chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},- "chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "context:runs/run/files": {"bytes": 55862, "sha256": "86406a7632ccef0cc564c8b96fafddfe0bb401dfeeeccfdb476e730ac5a1661b"},- "job:env@r00/prompt": {"bytes": 48546, "sha256": "6108648e54442871662fc2e5d3d3df97856d185e5f06bbe3fef7915c4b7b54da"},- "job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},- "job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:refine_quay@r01/prompt": {"bytes": 10092, "sha256": "7424fa604c576ccaa58bb104174f27b1ff6b38ea9682f3335170b1d821e73bd0"},- "job:refine_quay@r01/scope": {"bytes": 352, "sha256": "95a620093126d95e34400b4879d58c03bb641810cf02cc497835c80890c54a01"},- "job:refine_quay@r01/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:refine_water@r01/prompt": {"bytes": 10097, "sha256": "2af3470e4b4cf5e411e22cc5402886696b2adc9eaf0460a7b934b5351ccb73e0"},- "job:refine_water@r01/scope": {"bytes": 354, "sha256": "5c7aa29b996f768b637082248e69fbe65f7ed49d9f5abff27c464da564365b74"},- "job:refine_water@r01/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:zones_quay_water@r00/prompt": {"bytes": 54501, "sha256": "daf87c38db35731f599f42c8028f4c1111a2d346ee7ac3c482f809208db9513a"},- "job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},- "job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3755, "sha256": "c1ace02589db83a171c73e42785af63acd95ac141b2c40cb1439e12ded9bd12c"},- "judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "562ef4bfc6b24c34604482cb73a02fb4b01da5c0e70685e3a1a4e1dda616a827"},- "judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},- "judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4755, "sha256": "b386a92b7164f283a376ee84122a5ab109a1b709e28ade5a269337fe8c587ae0"},- "judge:scene:runs/run/artifacts/renders/r01/messages": {"bytes": 5298, "sha256": "c9a488e3385bb803ce084eda9a1ad2ed58c338201f1ad6d7f416cf0070f1a9f1"},- "judge:scene:runs/run/artifacts/renders/r01/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},- "judge:scene:runs/run/artifacts/renders/r01/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "skills:runs/run:baseline@r00/routed": {"bytes": 156, "sha256": "cae5ab46c39f9f4efb7ae3c4758b05d768025f93d525d5e13812b916a583fd30"},- "skills:runs/run:env@r00/routed": {"bytes": 164, "sha256": "eb0e2aca5a76b26e49a2d2c862a9405ef2e3e1130e719cca9a1f23fe1b264402"},- "skills:runs/run:refine@r01/routed": {"bytes": 156, "sha256": "cae5ab46c39f9f4efb7ae3c4758b05d768025f93d525d5e13812b916a583fd30"},- "skills:runs/run:zone@r00/routed": {"bytes": 161, "sha256": "c2efc99419ed923cc9093c675fa27abc39d11613b9d2ac59e2cc5aea67d7d191"}- },- "stage_keys": {- "runs/run:assemble": "eb288074ac5b",- "runs/run:assets": "e3fcf2d29017",- "runs/run:env": "da005e145164",- "runs/run:layouts": "e3fcf2d29017",- "runs/run:plan": "28eda606da62",- "runs/run:skeleton": "6bd35d0cf375",- "runs/run:textures": "eb288074ac5b",- "runs/run:zones": "df7f829d5cce"- }- },"scene.scene_threejs.agent.variant_argon": {"payloads": {"chat:model:asset_bollard:r00/messages": {"bytes": 3327, "sha256": "1a2c11617634f2944f0e66819a64d644a0180612213856e98575191a481f2a5b"},@@ -736,7 +679,7 @@"chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "context:runs/run/files": {"bytes": 55862, "sha256": "86406a7632ccef0cc564c8b96fafddfe0bb401dfeeeccfdb476e730ac5a1661b"},+ "context:runs/run/files": {"bytes": 56114, "sha256": "5f2b6a8aded7d754f30945bb62acdac9287caabef9fa56103e09962f6c669cda"},"job:env@r00/prompt": {"bytes": 47541, "sha256": "9b99f01eaaca7ad62a4e0ba8210f3c6c6d70fc095631a0c616dbbf067f597fb6"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},@@ -749,11 +692,11 @@"job:zones_quay_water@r00/prompt": {"bytes": 53496, "sha256": "82b80505d5bb0ecc0ed5c7bc53f7d0bafdb8dc8102cb51c314e6628b3e7ffbcc"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3755, "sha256": "7fa5ae748295e277f0edb9fc51a241ac20ccf6c64a88431cb95bf08313fb661a"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3716, "sha256": "f1aef1e33eb9c801d1b02bf7028d4a4738a56455427eaef288b8b4ad7016eeaf"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "562ef4bfc6b24c34604482cb73a02fb4b01da5c0e70685e3a1a4e1dda616a827"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},- "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4755, "sha256": "b386a92b7164f283a376ee84122a5ab109a1b709e28ade5a269337fe8c587ae0"},+ "judge:scene:runs/run/artifacts/renders/r01/input": {"bytes": 4716, "sha256": "f86d30ec9fdd660eac0d9d4fdf9f445f523cc7d90c6bb8aa26ec5167e33fc351"},"judge:scene:runs/run/artifacts/renders/r01/messages": {"bytes": 5298, "sha256": "c9a488e3385bb803ce084eda9a1ad2ed58c338201f1ad6d7f416cf0070f1a9f1"},"judge:scene:runs/run/artifacts/renders/r01/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r01/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -810,7 +753,7 @@"chat:planner:zone-layout#2/messages": {"bytes": 485, "sha256": "67e917190ee227c5ed3415ab4b03c072af313d7040704e7de671e63c42e2ab52"},"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},- "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3772, "sha256": "b905874db5d6112f7b8a77387b6158354f02e473d901f29516e684e3d56b80ab"},+ "judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3733, "sha256": "ddb88a5a2eb5eb6ec089d4079b3a8609517bac917d2d51059562020b5250c1a5"},"judge:scene:runs/run/artifacts/renders/r00/messages": {"bytes": 4930, "sha256": "562ef4bfc6b24c34604482cb73a02fb4b01da5c0e70685e3a1a4e1dda616a827"},"judge:scene:runs/run/artifacts/renders/r00/sampling": {"bytes": 14066, "sha256": "1f67b211de491259bed48f1499b8dbd9fa2037a903a637ba53befda40ade693d"},"judge:scene:runs/run/artifacts/renders/r00/system": {"bytes": 21572, "sha256": "eee5e34a58a91720755be68ed4d39cf127c634a484a4948e77c77ecce7e8cd16"},@@ -821,12 +764,12 @@},"stage_keys": {"runs/run:assemble": "eb288074ac5b",- "runs/run:assets": "05ff6fdbf6e4",- "runs/run:env": "05ff6fdbf6e4",- "runs/run:layouts": "05ff6fdbf6e4",+ "runs/run:assets": "212efeee2ac5",+ "runs/run:env": "212efeee2ac5",+ "runs/run:layouts": "212efeee2ac5","runs/run:plan": "28eda606da62","runs/run:skeleton": "6bd35d0cf375",- "runs/run:zones": "f535201189a7"+ "runs/run:zones": "b12775da7b08"}},"static_object.blender.agent.best_of_2": {@@ -837,31 +780,31 @@"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},"chat:planner:planner/system": {"bytes": 20977, "sha256": "0a3c2ea2bfb39981a166952054d1dcc10dffdf097d493e89b03e0b8586d2ee8e"},- "context:runs/run/_cand/c0/files": {"bytes": 46888, "sha256": "ecc25aaa2d6ad33ac74a2f8379b2814e8f27e3c09e8fce879118fd31183a3d76"},- "context:runs/run/_cand/c1/files": {"bytes": 46888, "sha256": "ecc25aaa2d6ad33ac74a2f8379b2814e8f27e3c09e8fce879118fd31183a3d76"},- "context:runs/run/files": {"bytes": 46888, "sha256": "ecc25aaa2d6ad33ac74a2f8379b2814e8f27e3c09e8fce879118fd31183a3d76"},- "job:baseline_c0@r00/prompt": {"bytes": 20798, "sha256": "eb5375ddaa912a3cc1d7cb4abbad186e9a57dccd552b447681f82acd22e9b21a"},+ "context:runs/run/_cand/c0/files": {"bytes": 47140, "sha256": "3079f03e3f62bc0993b9cc8aa4f829cc901cf9b46debfa1ddc593986a0ae04c2"},+ "context:runs/run/_cand/c1/files": {"bytes": 47140, "sha256": "3079f03e3f62bc0993b9cc8aa4f829cc901cf9b46debfa1ddc593986a0ae04c2"},+ "context:runs/run/files": {"bytes": 47140, "sha256": "3079f03e3f62bc0993b9cc8aa4f829cc901cf9b46debfa1ddc593986a0ae04c2"},+ "job:baseline_c0@r00/prompt": {"bytes": 20387, "sha256": "158c7483180b37e34a73f10bf8cabd1f708d89920c60b791f3815bdf4703ef8d"},"job:baseline_c0@r00/scope": {"bytes": 434, "sha256": "2654f6339a446c7181633e50fb347ef3b3002dd0dc96cd6f88db21018f2fd4ba"},"job:baseline_c0@r00/system": {"bytes": 2865, "sha256": "e8bdde0b2251c9f422c9a02c8c457543798280f5215e740312ffb73f1d0d867f"},- "job:baseline_c1@r00/prompt": {"bytes": 20798, "sha256": "eb5375ddaa912a3cc1d7cb4abbad186e9a57dccd552b447681f82acd22e9b21a"},+ "job:baseline_c1@r00/prompt": {"bytes": 20387, "sha256": "158c7483180b37e34a73f10bf8cabd1f708d89920c60b791f3815bdf4703ef8d"},"job:baseline_c1@r00/scope": {"bytes": 434, "sha256": "ea7fa63b68b2e822ddab3b4fbe0fcd7db185a3127ef747f85616b2784fa63311"},"job:baseline_c1@r00/system": {"bytes": 2865, "sha256": "e8bdde0b2251c9f422c9a02c8c457543798280f5215e740312ffb73f1d0d867f"},- "job:refine@r01/prompt": {"bytes": 7333, "sha256": "d0c65719f1734b9f7ee2f082d1b772314daebebdbafde9fdb36694833aed20c1"},+ "job:refine@r01/prompt": {"bytes": 7038, "sha256": "7567826ea7793e5f05f355c236b5984aa89abde8942f86b2a9e8a2e1881096c6"},"job:refine@r01/scope": {"bytes": 426, "sha256": "3a39df2f37665e52ae78549431ea567fa9591605332e152cd7d41d2b58914893"},"job:refine@r01/system": {"bytes": 2865, "sha256": "e8bdde0b2251c9f422c9a02c8c457543798280f5215e740312ffb73f1d0d867f"},- "judge:static_object:runs/run/_cand/c0/artifacts/renders/r00/quick/input": {"bytes": 5545, "sha256": "6041286d7536f146c7f66b22021c7fcf38a73e1627be58ab10dd741251d9a242"},+ "judge:static_object:runs/run/_cand/c0/artifacts/renders/r00/quick/input": {"bytes": 5506, "sha256": "d02a6dd07a7c89ec86318d139d61f8642d01212c112170dd29a5107c020e701d"},"judge:static_object:runs/run/_cand/c0/artifacts/renders/r00/quick/messages": {"bytes": 4246, "sha256": "029c3c03fe1f78f6f0d8b6b1b6bb4825d2851b55595a3c15c1a03f052b0b9771"},"judge:static_object:runs/run/_cand/c0/artifacts/renders/r00/quick/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/_cand/c0/artifacts/renders/r00/quick/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/_cand/c1/artifacts/renders/r00/quick/input": {"bytes": 5545, "sha256": "cec8a9d579957e61327fef43f3d0a0568555b0b162ffea5e140d78a6f1714524"},+ "judge:static_object:runs/run/_cand/c1/artifacts/renders/r00/quick/input": {"bytes": 5506, "sha256": "737a9b37288d80c9b7a6c2ef0ce259ca210a69e16afd8adca2a180740555acc2"},"judge:static_object:runs/run/_cand/c1/artifacts/renders/r00/quick/messages": {"bytes": 4246, "sha256": "029c3c03fe1f78f6f0d8b6b1b6bb4825d2851b55595a3c15c1a03f052b0b9771"},"judge:static_object:runs/run/_cand/c1/artifacts/renders/r00/quick/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/_cand/c1/artifacts/renders/r00/quick/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9108, "sha256": "060f49684b12ce285d2616a38f07d5c1b01c6c0bf15ccc9408a74f5ab7fcaba0"},+ "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9069, "sha256": "bb74a30f22b7373eb8decd7c72a97787035333bb29c4b9abc11dfcc4ff71caac"},"judge:static_object:runs/run/artifacts/renders/r00/messages": {"bytes": 6699, "sha256": "7df542d34f969f456ab2fcd720b5ccf3a4547b1c57ed59a81df0a84a4d540b9a"},"judge:static_object:runs/run/artifacts/renders/r00/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r00/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10321, "sha256": "8d9c8fd2cf83b0c69df1888ac52b8021dec2b05af26ed4575ecf3d92d2d3c583"},+ "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10282, "sha256": "fef8a89f93d63c2c547092f93b3ad64e53d2d34ef1a844456cc66868503b2365"},"judge:static_object:runs/run/artifacts/renders/r01/messages": {"bytes": 7124, "sha256": "a800f572433fa02006cc5a02c883359497949586963a0edeb799e047048d8f2c"},"judge:static_object:runs/run/artifacts/renders/r01/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r01/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},@@ -883,8 +826,8 @@"chat:planner:planner/messages": {"bytes": 1354, "sha256": "8681af8220fc76fb89bbaacf34c658644272af66ace3045ccef202e75e29482f"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},"chat:planner:planner/system": {"bytes": 15857, "sha256": "faf1d558f09254b16c3f0680aa2117737c72dea402b3b7a0be721c46bdd169fe"},- "context:runs/run/files": {"bytes": 36504, "sha256": "578e4dc3d8c54ccbd30277ca69f1d07ec772db970fcc323f10489d6638b57f60"},- "job:baseline@r00/prompt": {"bytes": 15607, "sha256": "3254852ee1e82f9e70218f15256197a1254a53613724cf29db9f3d6bdd5959e4"},+ "context:runs/run/files": {"bytes": 36756, "sha256": "61eb91e2c6edecaf5bf121d3565afcc5fad9f8950959083aead80bbb14e55f08"},+ "job:baseline@r00/prompt": {"bytes": 15196, "sha256": "479f99ceb71d4bddfecbd0b62b61d92d3756aa69c2e67c260d33e93913c4e25f"},"job:baseline@r00/scope": {"bytes": 354, "sha256": "2b65c930399cda88341114c6d8289228fedde80a1d17568900e1fe5a055915bd"},"job:baseline@r00/system": {"bytes": 2205, "sha256": "2ca6cc8997115b5940dcef874355b65c82f25ee8000b964fe0ad96dce25ac0e8"},"job:r00_baseline_repair1@r00/prompt": {"bytes": 4263, "sha256": "29f3ed4e23f478da88b532f0466a296ebf3caa10b37a9165b0923b8a43c18561"},@@ -893,17 +836,17 @@"job:r00_baseline_repair2@r00/prompt": {"bytes": 4568, "sha256": "e99cc8438646c5bf900d1e7c52ec48e168915c98278aa24ca9cdfb642a5d812d"},"job:r00_baseline_repair2@r00/scope": {"bytes": 366, "sha256": "8376d6d1c2ec92f74c51f366e6b62aeb24d6874dc5dc3374a29947d6bbe70fc1"},"job:r00_baseline_repair2@r00/system": {"bytes": 8927, "sha256": "68a64536d16663f907c98fbaa27f8187acecc86c831acae03b02e43e02350b6d"},- "job:rebuild@r01/prompt": {"bytes": 15825, "sha256": "cd88de36ee94c5e6b9593082a3aff513b93a615177d7a83528570e86fd1c414c"},+ "job:rebuild@r01/prompt": {"bytes": 15414, "sha256": "1601c25caf757b8f1ab5fd013ee988ed643e10b22e94433d8ace28d112d83c49"},"job:rebuild@r01/scope": {"bytes": 354, "sha256": "a7a5b56da832d44db1fb9d7ce73874b02ac672544ad8cc045c987ba82d7e8872"},"job:rebuild@r01/system": {"bytes": 2205, "sha256": "2ca6cc8997115b5940dcef874355b65c82f25ee8000b964fe0ad96dce25ac0e8"},- "job:refine@r02/prompt": {"bytes": 7510, "sha256": "da99d8d8621d2de04fbd11e07303ba2ffe71b771338f95d5b2bf705e2002c682"},+ "job:refine@r02/prompt": {"bytes": 7215, "sha256": "7d084dc936a0ca89af24a348321c9a88fd523c8353a034fe3bb37df511bcfe8e"},"job:refine@r02/scope": {"bytes": 350, "sha256": "4e7e7adc88c67e32725d4fbf7d2f95b24d0166d57881f69cf543ab1c6936ea35"},"job:refine@r02/system": {"bytes": 2205, "sha256": "2ca6cc8997115b5940dcef874355b65c82f25ee8000b964fe0ad96dce25ac0e8"},- "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 9513, "sha256": "397a05e8b108eb96ce4df58b830bb9bfabf0d38468b77243008f0c43d12cd594"},+ "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 9474, "sha256": "d668346739953b6399d84d1b68e79839aac99431c4ecdf2df7f57d5191797d72"},"judge:static_object:runs/run/artifacts/renders/r01/messages": {"bytes": 6808, "sha256": "afe220b9286ff63c1e78b62cf853ead93c525947a873c6eaea80d9094a9d483e"},"judge:static_object:runs/run/artifacts/renders/r01/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r01/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r02/input": {"bytes": 10722, "sha256": "7b7dcb7f4afcb9e67f86062daa7ab7dd547a9fb54fae165c8a032c84c40cebaf"},+ "judge:static_object:runs/run/artifacts/renders/r02/input": {"bytes": 10683, "sha256": "cc853b23b3fb38d3b5056a01e023b40e1573f306768180cc6bd82238773f7b8b"},"judge:static_object:runs/run/artifacts/renders/r02/messages": {"bytes": 7233, "sha256": "d6a82300f22e09f4cc9f7d5a09ec89e5c6e9b300eab6b8899fc61648ac406c21"},"judge:static_object:runs/run/artifacts/renders/r02/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r02/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},@@ -924,25 +867,25 @@"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},"chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},- "context:runs/run/files": {"bytes": 41466, "sha256": "307c5e3ede2e759f1084c24ec5a52f6e31695d4302278577b98a434db5686e4a"},- "job:baseline@r00/prompt": {"bytes": 18120, "sha256": "0a20305dcfbe7b51bf9078f42be61d15c79316b65c4249651c7275e24351471e"},+ "context:runs/run/files": {"bytes": 41718, "sha256": "91c41f64049da39d2cf5cef06cf18c9cece087e66f0e0b5852c80f11a9bdb11b"},+ "job:baseline@r00/prompt": {"bytes": 17709, "sha256": "5a683ed53fc41f4b652ede3f8e8ef2c43ee1dff7815212407d0b4947267a9218"},"job:baseline@r00/scope": {"bytes": 432, "sha256": "b7970aa82707a446f41764e551d45617767914f38d6861453d2d61991d48ed05"},"job:baseline@r00/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},- "job:refine@r01/prompt": {"bytes": 7470, "sha256": "e4594e140c01ba0341cc17ad7606f0a7815963f324228caa29612390f3ff26b6"},+ "job:refine@r01/prompt": {"bytes": 7175, "sha256": "afdc25db6e97a95734a0b81c66b094fe15756d9ae4526ba46df4fc8ca439ce45"},"job:refine@r01/scope": {"bytes": 428, "sha256": "186e31cec33c5144bbc9713eb76374ef7608534682433c9a9288191efc417ec4"},"job:refine@r01/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},- "job:refine@r02/prompt": {"bytes": 7469, "sha256": "6670e07ec1dfbd701d3777c92d02e55a317bdd71c2e52e615973192828466a27"},+ "job:refine@r02/prompt": {"bytes": 7174, "sha256": "3474b8ace6d7212c7430b362f161485f9243cdc6ef3118dc5d342c8720b85de5"},"job:refine@r02/scope": {"bytes": 428, "sha256": "57e2f2633c63ce908a2842199385fe002439dcc7d6f68ffac0261d5be22cb8e1"},"job:refine@r02/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},- "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9307, "sha256": "1bab6f0b46195a81bcb86db47342c74c5a55d095435d24e05122a952253c3057"},+ "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9268, "sha256": "fc4f28df96ba174b164679ccfccd2b872f429d9aea3c27fdbc443b17a98603fb"},"judge:static_object:runs/run/artifacts/renders/r00/messages": {"bytes": 6756, "sha256": "447c252713a4d26c70c0b368c30217605f33543c3a329b6c32bee7099bdb1860"},"judge:static_object:runs/run/artifacts/renders/r00/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r00/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10520, "sha256": "bada44f0350738b015ac2a5dfea12eb03fc89080f48ec848c793e87964d3fea8"},+ "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10481, "sha256": "81c40cbc62148d817be68ae395caf69f59f50a475f3995f2c0e7463db43ce259"},"judge:static_object:runs/run/artifacts/renders/r01/messages": {"bytes": 7181, "sha256": "0ee41f64bf25c8490c05f3478f11afde83f2d8fc7f4753553d7497f1ef83543a"},"judge:static_object:runs/run/artifacts/renders/r01/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r01/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r02/input": {"bytes": 10516, "sha256": "e52a0b8b6bf1f9df4e18cd6289b2d80e98d4ae669cc0273e2e34f0ac7653a43b"},+ "judge:static_object:runs/run/artifacts/renders/r02/input": {"bytes": 10477, "sha256": "6fd11fb0202546333870a439938f8887593174fe5483785e7893b24baf117fc7"},"judge:static_object:runs/run/artifacts/renders/r02/messages": {"bytes": 7181, "sha256": "61b52dd59cc941e842e0e789faf595cd9ed24187eba10e7cc399e1ca792eb099"},"judge:static_object:runs/run/artifacts/renders/r02/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r02/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},@@ -963,18 +906,18 @@"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},"chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},- "context:runs/run/files": {"bytes": 41466, "sha256": "307c5e3ede2e759f1084c24ec5a52f6e31695d4302278577b98a434db5686e4a"},- "job:baseline@r00/prompt": {"bytes": 18089, "sha256": "04f9c0f40a2f4d04b973d0c75d76e577f8c406fbaf2f02495d8ee39d2a1dddb2"},+ "context:runs/run/files": {"bytes": 41718, "sha256": "91c41f64049da39d2cf5cef06cf18c9cece087e66f0e0b5852c80f11a9bdb11b"},+ "job:baseline@r00/prompt": {"bytes": 17678, "sha256": "f770776e04e5d37aca258b971db6eee596f72af5d25575f028cab8c45fbda98f"},"job:baseline@r00/scope": {"bytes": 648, "sha256": "eed11065615f36b3d1b869300d16518bd4ec6e258630c204fdeff14e676cc2d8"},"job:baseline@r00/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},- "job:refine@r01/prompt": {"bytes": 9156, "sha256": "f8e4ad5d4b7d1ccdc149f77b7e6302e6d364dc62ccb9e98a45fb8c190f3c7f7d"},+ "job:refine@r01/prompt": {"bytes": 8861, "sha256": "40ce1992b720f3a98f57dedeab35b70590f3f9a49ef111a544a300896fa39a35"},"job:refine@r01/scope": {"bytes": 644, "sha256": "f5e0c8fc1e3c0527734f358ad11929cedc505d872e61bbbfa4926d2cf5f4a1d0"},"job:refine@r01/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},- "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 11212, "sha256": "054fc9378fe72d6263cc8be55114c6ffcd74e380ac652375c8873c708e632c6b"},+ "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 11173, "sha256": "e9772a34126dd442236ffc8abf3bc52e81aadefb65131915fa8689fcc661144a"},"judge:static_object:runs/run/artifacts/renders/r00/messages": {"bytes": 7002, "sha256": "90d9f0c3e869c20608b23834b3a93df8242b1dd3324fdfda3b91de9542337eb0"},"judge:static_object:runs/run/artifacts/renders/r00/sampling": {"bytes": 11134, "sha256": "f825a8da4e119120216c23d2d3433cbf49ab7107bb97d58f7cd8359d7bd8eb45"},"judge:static_object:runs/run/artifacts/renders/r00/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 12397, "sha256": "942ff240dcba105727d8ff15dbc2e0b0535ae4958ec8731ea993d70d79b49bdc"},+ "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 12358, "sha256": "6f8bebf86689b3e4fc8b1b6c85abc6e6c616f562dcf001251f47aa0886e35610"},"judge:static_object:runs/run/artifacts/renders/r01/messages": {"bytes": 7429, "sha256": "70fca81684fcce477eadc3e0d5c329b3dcc31dcc527958abf29e484a0d555a7c"},"judge:static_object:runs/run/artifacts/renders/r01/sampling": {"bytes": 11134, "sha256": "f825a8da4e119120216c23d2d3433cbf49ab7107bb97d58f7cd8359d7bd8eb45"},"judge:static_object:runs/run/artifacts/renders/r01/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},@@ -994,18 +937,18 @@"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},"chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},- "context:runs/run/files": {"bytes": 41466, "sha256": "307c5e3ede2e759f1084c24ec5a52f6e31695d4302278577b98a434db5686e4a"},- "job:baseline@r00/prompt": {"bytes": 18120, "sha256": "0a20305dcfbe7b51bf9078f42be61d15c79316b65c4249651c7275e24351471e"},+ "context:runs/run/files": {"bytes": 41718, "sha256": "91c41f64049da39d2cf5cef06cf18c9cece087e66f0e0b5852c80f11a9bdb11b"},+ "job:baseline@r00/prompt": {"bytes": 17709, "sha256": "5a683ed53fc41f4b652ede3f8e8ef2c43ee1dff7815212407d0b4947267a9218"},"job:baseline@r00/scope": {"bytes": 432, "sha256": "b7970aa82707a446f41764e551d45617767914f38d6861453d2d61991d48ed05"},"job:baseline@r00/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},- "job:refine@r01/prompt": {"bytes": 7307, "sha256": "51c6293407b6d9352ac4e6c529907570d21b681e740f2f548c359f2d061c499c"},+ "job:refine@r01/prompt": {"bytes": 7012, "sha256": "9db3905eac671203349cd349d93748e1abadf89a9f584948cf3e64f0527abbcd"},"job:refine@r01/scope": {"bytes": 428, "sha256": "186e31cec33c5144bbc9713eb76374ef7608534682433c9a9288191efc417ec4"},"job:refine@r01/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},- "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9108, "sha256": "de6324c2e5fffad8f4ae1e87cb2e54e6c347b1f9cc8d0f07479274fd6acb4e31"},+ "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9069, "sha256": "112ee7ab4e72d2441c6734f37e7300ab81c61e83b98589096ffc795f0fd8405b"},"judge:static_object:runs/run/artifacts/renders/r00/messages": {"bytes": 6699, "sha256": "6e3964ce3478de892b3c5dde9eb3154e9a54c2a669315a8e6f4b808c15dd930c"},"judge:static_object:runs/run/artifacts/renders/r00/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r00/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10321, "sha256": "0bdbcf6b262451c2f914db0f1501ffa30d50795fc7f8c6dbea0fdaf8f1ed2d14"},+ "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10282, "sha256": "69e0340501fc86b997956c7cb421e8b6aae9b1e9eef6c86d385394677aadfc6f"},"judge:static_object:runs/run/artifacts/renders/r01/messages": {"bytes": 7124, "sha256": "0e3a5d3ed25799eec213d2d7fd92ae5009e4d88d5a818eeaf0aef3de8d47b932"},"judge:static_object:runs/run/artifacts/renders/r01/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r01/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},@@ -1034,11 +977,11 @@"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},"chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},- "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9125, "sha256": "cb85607f665756a289d7f4070a59cd5febf398ef289ec123c6060a3313d9c011"},+ "judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9086, "sha256": "669af81897f573fef5c38a2c09f1d8e73203916481cb746baa067414a9943982"},"judge:static_object:runs/run/artifacts/renders/r00/messages": {"bytes": 6699, "sha256": "6e3964ce3478de892b3c5dde9eb3154e9a54c2a669315a8e6f4b808c15dd930c"},"judge:static_object:runs/run/artifacts/renders/r00/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r00/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},- "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10338, "sha256": "a5ee63d3b5d902e5e111abce6463ff9a3fe1a1af21a3c6a9d284b76137b64b49"},+ "judge:static_object:runs/run/artifacts/renders/r01/input": {"bytes": 10299, "sha256": "8162ff275ce387f5741d6aa215e3666ee6f519eb0c84a1b4ec9df2e7b01a96dd"},"judge:static_object:runs/run/artifacts/renders/r01/messages": {"bytes": 7124, "sha256": "0e3a5d3ed25799eec213d2d7fd92ae5009e4d88d5a818eeaf0aef3de8d47b932"},"judge:static_object:runs/run/artifacts/renders/r01/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},"judge:static_object:runs/run/artifacts/renders/r01/system": {"bytes": 15178, "sha256": "1becebca9df2996a380a8bedede59de191c58f5021c6f687a3dfd5abc673c4bc"},diff --git a/harness/tests/prompts/manifest.py b/harness/tests/prompts/manifest.pyindex ca504d45..8d6f3739 100644--- a/harness/tests/prompts/manifest.py+++ b/harness/tests/prompts/manifest.py@@ -26,8 +26,7 @@ saying why::python -m tests.prompts.manifest --dump DIR # every payload as a file: diff two trees' dumpsNot covered (the fakes cannot drive it): reference-image runs (reference and likeness judges, the-silhouette gate), the texture pack's own planner (``texturing/scene_pack.md``: the scene is handed-a canned pack) and the texture pass (``texturing/material_plan.md``), replays (``3dcode judge``),+silhouette gate), replays (``3dcode judge``),the budget-stop salvage (the clock is frozen), the node asset checker (a python stand-in answers)and each vendor CLI's own framing of a session (only agy's workspace files are built)."""@@ -71,7 +70,6 @@ from codeverse3d.models.base import ModelErrorfrom codeverse3d.orchestrator import BudgetGuardfrom codeverse3d.spatial.gl_render import GlFrame, GlResult, gif_timesfrom codeverse3d.spatial.registry import list_tools-from codeverse3d.texturing.plan import PackEntry, ScenePackfrom codeverse3d.tracks import get_track, scene_assetsfrom codeverse3d.tracks.common import Servicesfrom codeverse3d.tracks.planner import plan_example@@ -91,7 +89,7 @@ from tests.orchestrator_tracks.fakes import (MANIFEST = Path(__file__).with_name("manifest.json")AGENT = "agy:gemini-4-argon" # the default generator (a vendor CLI; FakeAgent answers)-SINGLE_SHOT = "single-shot:gemini:gemini-3.7-flash"+SINGLE_SHOT = "single-shot:gemini:gemini-3.8-flash"#: what each track is asked forREQUESTS = {Track.STATIC_OBJECT: ("a mid-century wooden dining chair", Constraints(dimensions_m={"height": 0.82}, must_have=["armrests"])),Track.ARTICULATED_OBJECT: ("a bedside cabinet with one drawer", Constraints(must_have=["a round knob"])),@@ -382,25 +380,11 @@ def _example(track: Track) -> Plan:REBUILD = frozenset({"baseline", "r00_baseline_repair1", "r00_baseline_repair2"}) # round 0 never builds-def _textures(scene_plan: Any, out_dir: Path, image_model: Any, model_id: str = "", **kw: Any) -> ScenePack:- """The texture pack's generator, canned: the env and zone prompts see a two-texture pack."""- entries = {n: PackEntry(name=n, material_family=fam, subject=n, tile_size_m=1.2, role=role, file=f"{n}.png")- for n, fam, role in (("cobblestone", "stone", "path"), ("pond_bed", "stone", "water_bed"))}- return ScenePack(out_dir=str(out_dir), entries=entries, source="default")--def _switch(name: str, value: str) -> None:os.environ[name] = value # isolated() restores the environmentconfig.get_settings.cache_clear()-def _scene_textures(rig: Rig) -> None:- _switch("C3D_SCENE_TEXTURES", "on")- with mock.patch("codeverse3d.texturing.plan.scene_texture_pack", _textures), mock.patch("codeverse3d.reference.get_image_model"):- rig.run(rounds=0)- rig.run(rounds=1, resume=True)--def _two_runs(first: int, then: int) -> Callable[[Rig], None]:def go(rig: Rig) -> None:rig.run(rounds=first)@@ -434,7 +418,6 @@ SCENARIOS: dict[str, tuple[Track, Language, dict[str, Any], Callable[[Rig], Nonelambda r: r.run(rounds=1, single_shot=True)),"scene.scene_threejs.agent.fresh": (SC, Language.SCENE_THREEJS, {"plan": small_scene(), "broken_assets": frozenset({"Bollard"})},_two_runs(1, 2)),- "scene.scene_threejs.agent.textures": (SC, Language.SCENE_THREEJS, {"plan": small_scene()}, _scene_textures),"scene.scene_threejs.agent.no_layouts": (SC, Language.SCENE_THREEJS, {"plan": small_scene()}, _switched("C3D_ZONE_LAYOUTS", "off", 0)),# the argon variant (D105) ships EMPTY overlays: every payload equals the fresh scene's, only the# plan stage key carries the variant name — iteration 0 of the loop measures exactly this@@ -607,7 +590,7 @@ PAYLOAD_HINT = ("A code-only change leaves every payload byte-identical. To rea"A change a model is meant to see (a bug fix): re-bless in the same commit and say why — ""`python -m tests.prompts.manifest --bless`.")STAGE_HINT = ("A stage key names a stage's inputs: when it moves, a resumed run re-runs that stage (and every recorded "- "run dir with it). The default run's keys (textures off, zone layouts on) must never move; any other move is "+ "run dir with it). The default run's keys (zone layouts on) must never move; any other move is ""re-blessed on purpose (`python -m tests.prompts.manifest --bless`), saying why.")diff --git a/harness/tests/reference/conftest.py b/harness/tests/reference/conftest.pyindex 66167b04..292a4943 100644--- a/harness/tests/reference/conftest.py+++ b/harness/tests/reference/conftest.py@@ -1,4 +1,4 @@-"""Fakes for the reference package: an image model (chat: the shared FakeChatModel)."""+"""Fixtures for the reference package (chat: the shared FakeChatModel)."""from __future__ import annotations@@ -6,42 +6,9 @@ from pathlib import Pathfrom typing import Anyimport pytest-from PIL import Image, ImageDraw-from codeverse3d.contracts.common import Language, Track, Usage+from codeverse3d.contracts.common import Language, Trackfrom codeverse3d.contracts.spec import Constraints, Spec-from codeverse3d.models.base import ModelError---class FakeImageModel:- """ImageModel stand-in: paints a solid rectangle so the silhouette code has work."""-- provider = "fake"- model = "fake-image"-- def __init__(self, *, fail: bool = False, colour=(120, 80, 40)):- self.fail = fail- self.colour = colour- self.prompts: list[str] = []-- @property- def id(self) -> str:- return "fake-image:fake-image"-- def generate(self, prompt: str, **kw: Any) -> list[Image.Image]:- return self.generate_with_usage(prompt, **kw)[0]-- def generate_with_usage(self, prompt: str, *, size: int = 1024, n: int = 1, seed: int | None = None,- reference_images=()) -> tuple[list[Image.Image], Usage]:- self.prompts.append(prompt)- if self.fail:- raise ModelError("image model exploded", retryable=False)- out = []- for _ in range(n):- im = Image.new("RGB", (size, size), (240, 240, 238))- ImageDraw.Draw(im).rectangle([size * 0.3, size * 0.2, size * 0.7, size * 0.85], fill=self.colour)- out.append(im)- return out, Usage(backend="fake-image", model="fake-image", cost_usd=0.067 * n)def make_spec(**kw: Any) -> Spec:@@ -55,20 +22,6 @@ def make_spec(**kw: Any) -> Spec:return Spec(**base)-GOOD_GATE = {- "depicted_object": "hand-crank coffee grinder", "shows_requested_object": True, "single_object": True,- "plain_background": True, "no_text_or_watermark": True, "is_photo_collage": False,- "contradictions": [], "reason": "matches the brief",-}--PROMPT_PLAN = {- "object_name": "hand-crank coffee grinder",- "subject": "a hand-crank coffee grinder, square walnut box body, cast-iron cone hopper, steel crank",- "views": [{"view": "three_quarter", "view_note": "crank and hopper"},- {"view": "front", "view_note": "drawer front"}],-}--@pytest.fixturedef cache_dir(tmp_path: Path) -> Path:d = tmp_path / "cache"diff --git a/harness/tests/reference/test_attach.py b/harness/tests/reference/test_attach.pydeleted file mode 100644index 78cc05b5..00000000--- a/harness/tests/reference/test_attach.py+++ /dev/null@@ -1,56 +0,0 @@-"""The honesty guards: user images win, synthesized ones are marked, dims untouched."""--from __future__ import annotations--from pathlib import Path--import pytest--from codeverse3d.contracts.spec import ReferenceImage-from codeverse3d.reference import (- SYNTH_NOTE,- SYNTH_TAG,- PlausibilityVerdict,- ReferenceSet,- ReferenceView,- attach,- has_user_references,- is_synthetic,- reference_images,-)-from tests.reference.conftest import make_spec---def _set(tmp_path: Path, views=("three_quarter", "front"), accepted=(True, True)) -> ReferenceSet:- rs = ReferenceSet(prompt="p", image_model="gemini-image:x")- for v, ok in zip(views, accepted, strict=True):- p = tmp_path / f"{v}.png"- p.write_bytes(b"\x89PNG\r\n\x1a\n")- rs.views.append(ReferenceView(path=str(p), view=v, accepted=ok,- verdict=PlausibilityVerdict(ok=ok, reason="r")))- return rs---def test_user_images_win_and_synthesized_ones_are_marked_everywhere(tmp_path: Path):- mine = make_spec(references=[ReferenceImage(path=str(tmp_path / "mine.png"), note="my photo")])- assert has_user_references(mine)- out, why = attach(mine, _set(tmp_path))- assert out is mine and "user --image references win" in why-- spec = make_spec()- out, why = attach(spec, _set(tmp_path))- assert out is not spec and "synthesized" in why.lower() and len(out.references) == 2- assert all(r.note.startswith("SYNTHESIZED") and is_synthetic(r) for r in out.references)- assert all(SYNTH_NOTE in r.note for r in out.references)- assert SYNTH_TAG in out.tags- # never overrides the brief: constraints and prompt are byte-identical- assert out.constraints == spec.constraints and out.prompt == spec.prompt- assert spec.references == [] # the input spec is not mutated--[email protected](("accepted", "target"), [((True, True), "front.png"), ((True, False), "three_quarter.png")])-def test_the_straight_on_photo_is_the_silhouette_target(tmp_path: Path, accepted, target):- """The gate measures IoU against a straight-on render; the 3/4 shot is the target only when alone."""- refs = reference_images(_set(tmp_path, ("three_quarter", "front"), accepted=accepted))- assert refs[0].role == "target" and Path(refs[0].path).name == target- assert [r.role for r in refs[1:]] == ["detail"] * (len(refs) - 1) and len(refs) == sum(accepted)diff --git a/harness/tests/reference/test_judge_diff.py b/harness/tests/reference/test_judge_diff.pyindex 5990b973..6ec7703b 100644--- a/harness/tests/reference/test_judge_diff.py+++ b/harness/tests/reference/test_judge_diff.py@@ -1,4 +1,4 @@-"""ReferenceJudge: the synthesized labelling, the mismatch pass, best-view IoU."""+"""ReferenceJudge: the reference labelling, the mismatch pass, best-view IoU."""from __future__ import annotations@@ -9,7 +9,6 @@ from codeverse3d.contracts.spec import ReferenceImagefrom codeverse3d.judges.base import JudgeInputfrom codeverse3d.judges.rubrics import load_rubricfrom codeverse3d.judges.vlm_judge import ReferenceJudge-from codeverse3d.reference import SYNTH_NOTEfrom tests.judges.conftest import (FakeChatModel,draw_chair,@@ -31,7 +30,7 @@ DIFF = {"mismatches": [{"kind": "wrong_part_count", "target": "Legs",def ref_input(tmp_path):png = draw_chair(tmp_path / "ref.png", legs=4, color=(30, 30, 30))spec = make_spec(references=[ReferenceImage(path=str(png), role="target",- note=f"{SYNTH_NOTE} [front view, x]")])+ note="my photo")])return JudgeInput(spec=spec, renders=make_renders(tmp_path / "renders"), measurement=make_measurement(),acceptance=[AcceptanceItem(id="A1", text="four legs", how="measure", priority="must"),@@ -45,15 +44,14 @@ def _judge(model, **kw):**kw)-def test_the_diff_and_the_synthesized_caveat_reach_the_scoring_call(ref_input, cache_dir):+def test_the_diff_reaches_the_scoring_call(ref_input, cache_dir):model = FakeChatModel(by_label={"reference_diff": [DIFF], "judge": [good_reply(REF, ["A1", "A2"], 0.8)]})assert _judge(model, cache_dir=cache_dir).judge(ref_input).overall > 0scoring = [r for r in model.requests if r.label.startswith("judge")][0]text = scoring.messages[0].parts[0].textassert "REFERENCE DIFF" in text and "reference shows 4 legs, render shows 2" in textassert "already matching: the backrest slats are right" in text- assert image_parts(scoring)[0].label.startswith("SYNTHESIZED REFERENCE 1/1 (target)")- assert "SYNTHESIZED from the brief" in text and "the BRIEF is correct" in text+ assert image_parts(scoring)[0].label.startswith("REFERENCE 1/1 (target)")def test_a_failing_diff_never_breaks_the_verdict(ref_input, cache_dir):@@ -78,7 +76,7 @@ def test_reference_that_contradicts_the_brief_scores_neutral(tmp_path, cache_dirfrom codeverse3d.judges.vlm_judge import NEUTRAL_SCOREpng = draw_chair(tmp_path / "wide.png", legs=4) # ~2:1 wide silhouette- spec = make_spec(references=[ReferenceImage(path=str(png), role="target", note=f"{SYNTH_NOTE} [front, x]")],+ spec = make_spec(references=[ReferenceImage(path=str(png), role="target", note="my photo")],constraints=Constraints(dimensions_m={"width": 0.45, "height": 2.0})) # implies 0.22 w/hinp = JudgeInput(spec=spec, renders=make_renders(tmp_path / "r"), measurement=make_measurement(),acceptance=[AcceptanceItem(id="A1", text="t", how="visual", priority="must")])diff --git a/harness/tests/reference/test_mismatch.py b/harness/tests/reference/test_mismatch.pyindex fe480f72..08618f47 100644--- a/harness/tests/reference/test_mismatch.py+++ b/harness/tests/reference/test_mismatch.py@@ -33,17 +33,16 @@ def test_compare_names_mismatches_and_builds_text(tmp_path: Path):ref, ren = _png(tmp_path / "ref.png"), _png(tmp_path / "ren.png")chat = FakeChatModel(by_label={"reference_diff": [ANSWER]})d = compare(make_spec(), [ref], [ren], model=chat, part_names=["Hopper", "Body"],- measured={"iou": 0.42, "aspect_ratio_err": 0.13, "reliable": True, "view": "front"},- synthesized=True)+ measured={"iou": 0.42, "aspect_ratio_err": 0.13, "reliable": True, "view": "front"})assert len(d.mismatches) == 4 and d.iou == 0.42 and d.view == "front"text = d.as_text()- assert "IoU 0.420" in text and "8 flutes" in text and "SYNTHESIZED" in text+ assert "IoU 0.420" in text and "8 flutes" in textassert "already matching: the crank handle is present" in textreq = chat.requests[0]labels = [p.label for p in req.messages[0].parts if getattr(p, "label", None)]assert labels == ["REFERENCE 1", "RENDER 1 (ren)"]assert "Hopper, Body" in req.messages[0].parts[0].text- assert "the BRIEF wins" in req.messages[0].parts[0].text # synthesized caveat+ assert "Ignore anything the brief overrides" in req.messages[0].parts[0].textassert [m.severity for m in d.top(3)] == ["critical", "major", "minor"]diff --git a/harness/tests/reference/test_run_and_cli.py b/harness/tests/reference/test_run_and_cli.pydeleted file mode 100644index f34047c0..00000000--- a/harness/tests/reference/test_run_and_cli.py+++ /dev/null@@ -1,70 +0,0 @@-"""``ground_spec`` on a real workspace, and the ``3dcode make --reference`` wiring."""--from __future__ import annotations--import json-from pathlib import Path--from typer.testing import CliRunner--from codeverse3d.contracts.spec import ReferenceImage-from codeverse3d.proc import EventLog-from codeverse3d.reference import SYNTH_TAG, ground_spec-from codeverse3d.workspace import Workspace-from tests.orchestrator_tracks.fakes import FakeChatModel-from tests.reference.conftest import GOOD_GATE, PROMPT_PLAN, FakeImageModel, make_spec---def _chat(gates=None):- return FakeChatModel(by_label={"reference_prompt": [PROMPT_PLAN], "reference_gate": list(gates or [GOOD_GATE, GOOD_GATE])})---def test_ground_spec_rewrites_the_spec_and_records_everything(tmp_ws: Workspace, cache_dir: Path):- events = EventLog(tmp_ws.events_path)- spec = make_spec()- tmp_ws.write_json(tmp_ws.spec_path, spec)- out, refset, why = ground_spec(spec, tmp_ws, model=_chat(), image_model=FakeImageModel(),- events=events, cache_dir=cache_dir)- assert len(out.references) == 2 and SYNTH_TAG in out.tags and "attached 2" in why- on_disk = json.loads(tmp_ws.spec_path.read_text())- assert len(on_disk["references"]) == 2 and on_disk["tags"] == [SYNTH_TAG]- assert all(r["note"].startswith("SYNTHESIZED") for r in on_disk["references"])- # the whole set — verdicts included — is kept next to the run- saved = json.loads((tmp_ws.artifacts / "reference" / "reference_set.json").read_text())- assert len(saved["views"]) == 2 and saved["views"][0]["verdict"]["ok"] is True- names = [json.loads(line)["event"] for line in tmp_ws.events_path.read_text().splitlines()]- assert "reference.start" in names and "reference.done" in names---def test_ground_spec_leaves_a_user_reference_alone_and_survives_every_failure(tmp_ws: Workspace, monkeypatch,- cache_dir: Path):- spec = make_spec(references=[ReferenceImage(path=str(tmp_ws.root / "mine.png"), note="my photo")])- out, refset, why = ground_spec(spec, tmp_ws, model=_chat(), image_model=FakeImageModel(), cache_dir=cache_dir)- assert out is spec and refset.views == [] and "user --image references win" in why- # a rejected reference: the run goes on without one- bad = dict(GOOD_GATE, plain_background=False)- spec = make_spec()- out, refset, why = ground_spec(spec, tmp_ws, model=_chat([bad, bad]), image_model=FakeImageModel(),- cache_dir=cache_dir)- assert out is spec and not refset.ok and "running without one" in why- # a dead backend- monkeypatch.setattr("codeverse3d.reference._chat_model",- lambda mid: (_ for _ in ()).throw(RuntimeError("no keys")))- out, refset, why = ground_spec(spec, tmp_ws, cache_dir=cache_dir)- assert out is spec and "reference grounding unavailable" in why---def test_cli_flag_calls_the_grounding_and_never_kills_the_run(tmp_path: Path, monkeypatch):- from codeverse3d.cli.main import app-- seen = {}-- def fake_ground(spec, ws, *, n_views, model=None, image_model=None, image_model_id="", events=None, cache_dir=None):- seen["n_views"] = n_views- return spec, __import__("codeverse3d.reference", fromlist=["ReferenceSet"]).ReferenceSet(prompt=spec.prompt), "nope"-- monkeypatch.setattr("codeverse3d.reference.ground_spec", fake_ground)- res = CliRunner().invoke(app, ["make", "a stool", "--reference", "--reference-views", "1",- "--runs-dir", str(tmp_path), "--no-run"])- assert res.exit_code == 0, res.output- assert seen["n_views"] == 1 and "reference grounding: nope" in res.outputdiff --git a/harness/tests/reference/test_synth.py b/harness/tests/reference/test_synth.pydeleted file mode 100644index 285213e7..00000000--- a/harness/tests/reference/test_synth.py+++ /dev/null@@ -1,87 +0,0 @@-"""synth_reference: prompt composition, the plausibility gate, caching, fallbacks."""--from __future__ import annotations--from pathlib import Path--from codeverse3d.models.base import ModelError-from codeverse3d.reference import (- STUDIO_SUFFIX,- compose_image_prompt,- synth_reference,- views_for,-)-from tests.orchestrator_tracks.fakes import FakeChatModel-from tests.reference.conftest import GOOD_GATE, PROMPT_PLAN, FakeImageModel, make_spec---def _chat(gates=None, plan=PROMPT_PLAN):- return FakeChatModel(by_label={"reference_prompt": [plan], "reference_gate": list(gates or [GOOD_GATE, GOOD_GATE])})---def test_views_and_prompt_composition():- assert views_for(2) == ["three_quarter", "front"]- assert views_for(99) == ["three_quarter", "front", "side", "back"]- p = compose_image_prompt("a walnut coffee grinder", "front", "drawer front")- assert p.startswith("a walnut coffee grinder, straight-on front elevation")- assert "the picture must make readable: drawer front" in p and p.endswith(STUDIO_SUFFIX)---def test_synth_accepts_and_caches(cache_dir: Path):- spec = make_spec()- img = FakeImageModel()- rs = synth_reference(spec, model=_chat(), image_model=img, n_views=2, cache_dir=cache_dir)- assert rs.ok and len(rs.accepted) == 2 and rs.source == "fresh"- assert all(Path(v.path).is_file() for v in rs.accepted)- assert [v.view for v in rs.views] == ["three_quarter", "front"]- # every image prompt carries the harness-owned studio clause- assert all(STUDIO_SUFFIX in p for p in img.prompts)- # 1 text call + 2 gate calls + 2 images- assert rs.usage.cost_usd > 0.13-- again = synth_reference(spec, model=_chat(), image_model=FakeImageModel(), n_views=2, cache_dir=cache_dir)- assert again.source == "cache" and again.usage.cost_usd == 0.0- assert [v.path for v in again.accepted] == [v.path for v in rs.accepted]---def test_gate_rejects_wrong_object_collage_and_contradiction(cache_dir: Path):- bad = dict(GOOD_GATE, shows_requested_object=False, depicted_object="a pepper mill")- rs = synth_reference(make_spec(), model=_chat([bad, bad]), image_model=FakeImageModel(),- n_views=2, cache_dir=cache_dir)- assert not rs.ok and len(rs.rejected) == 2- assert "shows a pepper mill" in rs.rejected[0].verdict.failure()- replies = [dict(GOOD_GATE, is_photo_collage=True),- dict(GOOD_GATE, contradictions=["brief says a front drawer; the image shows no drawer"])]- rs = synth_reference(make_spec(), model=_chat(replies), image_model=FakeImageModel(),- n_views=2, cache_dir=cache_dir / "b") # the rejected set above is cached- assert not rs.ok- assert "collage" in rs.views[0].verdict.failure()- assert "contradicts:" in rs.views[1].verdict.failure()---def test_unverifiable_image_is_never_accepted(cache_dir: Path):- """No text model → nothing can validate the picture → it is not used."""- rs = synth_reference(make_spec(), model=None, image_model=FakeImageModel(), n_views=1, cache_dir=cache_dir)- assert not rs.ok and len(rs.views) == 1 and rs.views[0].verdict is None---def test_no_failure_is_fatal(cache_dir: Path):- rs = synth_reference(make_spec(), model=_chat(), image_model=FakeImageModel(fail=True),- n_views=2, cache_dir=cache_dir)- assert not rs.ok and "image model exploded" in rs.error- rs = synth_reference(make_spec(), model=_chat(), image_model=None, cache_dir=cache_dir)- assert not rs.ok and rs.error == "no image model configured"- # the prompt writer failed: the brief is the prompt- chat = FakeChatModel(by_label={"reference_prompt": [ModelError("boom")], "reference_gate": [GOOD_GATE]})- rs = synth_reference(make_spec(), model=chat, image_model=FakeImageModel(), n_views=1, cache_dir=cache_dir)- assert rs.ok and "coffee grinder" in rs.subject---def test_out_dir_copies_accepted_images(cache_dir: Path, tmp_path: Path):- """The copies only: ``ground_spec`` writes reference_set.json (test_run_and_cli), once,- including the all-rejected set ``_publish`` never saw."""- out = tmp_path / "run" / "artifacts" / "reference"- rs = synth_reference(make_spec(), model=_chat(), image_model=FakeImageModel(), n_views=2,- cache_dir=cache_dir, out_dir=out)- assert len(rs.accepted) == 2 and all(Path(v.path).parent == out for v in rs.accepted)- assert rs.synthesized and not (out / "reference_set.json").exists()diff --git a/harness/tests/reference/test_tool_compare_reference.py b/harness/tests/reference/test_tool_compare_reference.pyindex df125446..5c9cf20a 100644--- a/harness/tests/reference/test_tool_compare_reference.py+++ b/harness/tests/reference/test_tool_compare_reference.py@@ -10,7 +10,6 @@ from PIL import Image, ImageDrawimport codeverse3d.spatial.tools # noqa: F401 (registers every tool)from codeverse3d.contracts.artifacts import RenderSet, RenderView-from codeverse3d.reference import SYNTH_NOTEfrom codeverse3d.spatial.registry import ToolContext, get_toolfrom codeverse3d.workspace import Workspacefrom tests.spatial_tools.conftest import build_stool@@ -29,7 +28,7 @@ def ctx(tmp_ws: Workspace, tmp_path: Path, monkeypatch) -> ToolContext:ref = _ref_png(tmp_path / "ref.png")tmp_ws.spec_path.write_text(json.dumps({"id": "t", "track": "static_object", "language": "blender", "prompt": "a stool",- "references": [{"path": str(ref), "role": "target", "note": f"{SYNTH_NOTE} [front view, x]"}]}))+ "references": [{"path": str(ref), "role": "target", "note": "my photo"}]}))def fake_render(_ctx, glb, *, views, mode="shaded", size=512, **kw):out = []@@ -54,7 +53,6 @@ def test_compare_reference_builds_a_side_by_side_sheet(ctx: ToolContext):with Image.open(obs.images[0]) as sheet: # 3 tiles side by sideassert sheet.width > sheet.heightassert "part inventory" in obs.text and "counts" in obs.text- assert "SYNTHESIZED" in obs.text and "follow the BRIEF" in obs.textdef test_usage_errors_are_didactic(ctx: ToolContext):diff --git a/harness/tests/scene_gates/test_scene_textures_stage.py b/harness/tests/scene_gates/test_scene_textures_stage.pydeleted file mode 100644index 09210513..00000000--- a/harness/tests/scene_gates/test_scene_textures_stage.py+++ /dev/null@@ -1,42 +0,0 @@-"""The scene texture pack as the env and zone prompts see it (the wiring is pinned by the prompt manifest)."""--from __future__ import annotations--import pytest--from codeverse3d.config import Settings---def test_the_switch_is_off_by_default():- """D58: the pack costs an image-model call per run, so it is off unless switched on."""- assert Settings.model_fields["scene_textures"].default is False---def _render(name: str, **extra):- from codeverse3d.prompts import render-- base = dict(- title="t", setting="a yard", mood="calm", bounds="0 0 0 / 10 5 10", environment="sunny",- zones_table="- Yard: d", cameras="- overview", effects="(none)", animation="(none)",- asset_api="(no assets)", output_format="write the files", prompt="p", track="scene",- language="scene_threejs", tool_cards="", single_shot=False, recipes="", constraints="",- must_have="", dimensions="", zone_name="Yard", zone_description="d", zone_bbox="b",- zone_contents=[], zone_file="src/zones/yard.js", neighbours=[], layout="",- )- base.update(extra)- return render(f"tracks/{name}", **base)--[email protected]("template", ["scene_env.j2", "scene_zone.j2"])-def test_the_pack_renders_and_no_recipe_block_competes_with_it(template: str):- """The inlined cookbook chapters that used to sit above the pack are gone (D106): the pack- is the only material block, and a stray ``recipes`` variable renders nothing."""- out = _render(template, textures="TEXTURE_BLOCK_MARKER", recipes="RECIPE_MARKER")- assert "TEXTURE_BLOCK_MARKER" in out and "RECIPE_MARKER" not in out and "# Recipes" not in out--[email protected]("template", ["scene_env.j2", "scene_zone.j2"])-def test_a_prompt_with_the_pack_does_not_forbid_textures(template: str):- """The rules said "no textures" and the pack below them said "use them"."""- assert "no textures" not in _render(template, textures="TEXTURE_BLOCK_MARKER").lower()- assert "no textures" in _render(template).lower()diff --git a/harness/tests/skills/test_hook.py b/harness/tests/skills/test_hook.pyindex bc116fbb..631adf30 100644--- a/harness/tests/skills/test_hook.py+++ b/harness/tests/skills/test_hook.py@@ -27,7 +27,7 @@ def ctx(tmp_path: Path, library_dir: Path, monkeypatch):parts = [NS(name=f"P{i}", instances=1, symmetry="none", children=[]) for i in range(3)]hashes: dict[str, str] = {}return NS(ws=NS(root=root), spec=NS(track=NS(value="static_object")), language=NS(value="blender"),- agent_id="unknown-backend:gemini-3.7-flash", agent_kind="unknown-backend", plan=NS(parts=parts, summary="a chair"),+ agent_id="unknown-backend:gemini-3.8-flash", agent_kind="unknown-backend", plan=NS(parts=parts, summary="a chair"),single_shot=False, extra={}, events=Events(), prompt_hashes=hashes,record_prompt=lambda name, text: hashes.__setitem__(name, str(len(text))))diff --git a/harness/tests/skills/test_telemetry.py b/harness/tests/skills/test_telemetry.pyindex f2250a86..4e668c49 100644--- a/harness/tests/skills/test_telemetry.py+++ b/harness/tests/skills/test_telemetry.py@@ -221,7 +221,7 @@ def test_the_report_counts_exact_sessions_and_drops_only_blind_ones(tmp_path):tele = root / "run" / TELEMETRY_DIRtele.mkdir(parents=True)rows = [ # exact, the agent opened the control too: counted, and said so- {"agent": "gemini-cli:gemini-3.7-flash", "listed": ["c3d-a"], "evidence": "transcript",+ {"agent": "gemini-cli:gemini-3.8-flash", "listed": ["c3d-a"], "evidence": "transcript","control_present": True, "control_read": True, "reads": [{"name": "c3d-a", "surfaced": True, "deep": True}]},# atime, control fired: blind, dropped{"agent": "codex:gpt-6-luna", "listed": ["c3d-a"], "control_present": True, "control_read": True,diff --git a/harness/tests/texturing/conftest.py b/harness/tests/texturing/conftest.pydeleted file mode 100644index 0c99a5d7..00000000--- a/harness/tests/texturing/conftest.py+++ /dev/null@@ -1,180 +0,0 @@-"""Fixtures for the texturing tests: a small chair-like GLB (named nodes, instances),-its plan + spec, a fake image model, a fake render function and a fake judge."""--from __future__ import annotations--import hashlib-import threading-import time-from collections.abc import Sequence-from pathlib import Path-from typing import Any--import numpy as np-import pytest-import trimesh-from PIL import Image--from codeverse3d.contracts.artifacts import Judgment, RenderSet, RenderView-from codeverse3d.contracts.common import Language, Track, Usage-from codeverse3d.contracts.plan import BBox, PartPlan, StaticPlan-from codeverse3d.contracts.spec import Spec---def _box(ext: tuple[float, float, float], center: tuple[float, float, float]) -> trimesh.Trimesh:- m = trimesh.creation.box(extents=ext)- m.apply_translation(center)- return m---def chair_glb(tmp_path: Path) -> Path:- """Y-up chair: Seat slab, Back slab, 4 Leg_i cylinders (instances), a tiny glass Knob."""- scene = trimesh.Scene()- seat = _box((0.44, 0.03, 0.42), (0, 0.45, 0))- seat.visual = trimesh.visual.ColorVisuals(seat, face_colors=(150, 100, 60, 255))- scene.add_geometry(seat, node_name="Seat", geom_name="Seat")- back = _box((0.44, 0.35, 0.03), (0, 0.64, -0.195))- back.visual = trimesh.visual.ColorVisuals(back, face_colors=(150, 100, 60, 255))- scene.add_geometry(back, node_name="Back", geom_name="Back")- leg = trimesh.creation.cylinder(radius=0.02, height=0.45, sections=24)- leg.apply_transform(trimesh.transformations.rotation_matrix(np.pi / 2, (1, 0, 0))) # along Y- leg.apply_translation((0, 0.225, 0))- leg.visual = trimesh.visual.ColorVisuals(leg, face_colors=(90, 90, 95, 255))- for i, (x, z) in enumerate([(-0.2, -0.19), (0.2, -0.19), (-0.2, 0.19), (0.2, 0.19)]):- T = trimesh.transformations.translation_matrix((x, 0, z))- scene.add_geometry(leg.copy(), node_name=f"Leg_{i}", geom_name=f"Leg_{i}", transform=T)- knob = trimesh.creation.icosphere(subdivisions=1, radius=0.01)- knob.apply_translation((0.22, 0.47, 0))- knob.visual = trimesh.visual.ColorVisuals(knob, face_colors=(200, 220, 255, 255))- scene.add_geometry(knob, node_name="Knob", geom_name="Knob")- out = tmp_path / "object.glb"- scene.export(out)- return out---def _bbox(c: tuple[float, float, float], e: tuple[float, float, float]) -> BBox:- return BBox(center=c, extents=e)---def chair_plan() -> StaticPlan:- return StaticPlan(- object_name="TestChair", summary="a simple wooden chair with steel legs",- overall_bbox=_bbox((0, 0, 0.4), (0.44, 0.42, 0.82)),- parts=[- PartPlan(name="Seat", role="seat", description="slab", bbox=_bbox((0, 0, 0.45), (0.44, 0.42, 0.03)), material="oiled oak wood"),- PartPlan(name="Back", role="backrest", description="slab", bbox=_bbox((0, -0.2, 0.64), (0.44, 0.03, 0.35)), material="oiled oak wood"),- PartPlan(name="Leg", role="leg", description="round steel tube", bbox=_bbox((0.2, 0.19, 0.225), (0.04, 0.04, 0.45)),- material="brushed steel", attach_to="Seat", instances=4),- PartPlan(name="Knob", role="decor", description="tiny glass ball", bbox=_bbox((0.22, 0, 0.47), (0.02, 0.02, 0.02)),- material="clear glass", attach_to="Seat"),- ],- )---def chair_spec() -> Spec:- return Spec(id="t1", track=Track.STATIC_OBJECT, language=Language.BLENDER, prompt="a simple oak chair with brushed steel legs")---def fake_render(glb: Path | str, out_dir: Path | str, *, views: Any, width: int = 512, height: int = 512, **_: Any) -> RenderSet:- """Writes one flat PNG per view + a sheet; colour keyed by the GLB size (so before/after differ)."""- out_dir = Path(out_dir)- out_dir.mkdir(parents=True, exist_ok=True)- seed = Path(glb).stat().st_size % 200- rviews = []- for v in views:- p = out_dir / f"view_{v.name}.png"- Image.new("RGB", (64, 64), (seed + 30, 120, 160)).save(p)- rviews.append(RenderView(name=v.name, path=str(p), width=64, height=64))- sheet = out_dir / "sheet.png"- Image.new("RGB", (128, 64), (seed + 30, 120, 160)).save(sheet)- return RenderSet(views=rviews, contact_sheet=str(sheet), renderer="fake")---class FakeJudge:- """Returns scripted verdicts in order (cycles the last one)."""-- name = "fake"-- def __init__(self, verdicts: list[tuple[float, dict[str, float]]], *, degraded: bool = False):- self.verdicts = verdicts- self.calls = 0- self.degraded = degraded-- def judge(self, inp: Any) -> Judgment:- overall, scores = self.verdicts[min(self.calls, len(self.verdicts) - 1)]- self.calls += 1- summary = "judge_error: boom" if self.degraded else "ok"- return Judgment(rubric="static_object", scores=scores, overall=overall, passed=overall >= 0.72, summary=summary,- usage=Usage(cost_usd=0.01))---# the material-plan answer for ``texture_pass(plan_model=FakeChatModel(default=PLAN_REPLY))``: a test-# that leaves plan_model None makes ``material_plan`` build a REAL model from the spec's planner id-# and then only passes on a box that happens to have keys (PORT-2)-PLAN_REPLY = {"parts": [- {"part": "Seat", "texture_id": "oak_wood", "material_family": "wood",- "subject": "light oak", "projection": "planar_y", "tile_size_m": 0.4},- {"part": "Back", "texture_id": "oak_wood", "material_family": "wood",- "subject": "light oak", "projection": "box"},- {"part": "Leg", "texture_id": "steel", "material_family": "metal",- "subject": "brushed steel", "projection": "cylinder", "metallic": 1, "roughness": 0.3},-], "notes": "fake plan"}---# --------------------------------------------------------------------------- fake image model-class FakeImageModel:- """Deterministic procedural textures (seeded by the prompt) for offline tests.- Records every prompt it was asked for in ``calls``.-- Lived in ``codeverse3d.texturing.generate`` until 2026-08-30, where nothing in a- real run could reach it: no setting, env var or CLI flag selects it, and the- keyless path raises ``ModelError`` rather than falling back to a fake."""-- provider = "fake"-- def __init__(self, model: str = "fake-image", *, latency_s: float = 0.0, fail_on: Sequence[str] = (),- usd_per_image: float = 0.001) -> None:- self.model = model- self.latency_s = latency_s- self.fail_on = tuple(fail_on)- self.usd_per_image = usd_per_image- self.calls: list[str] = []- self._lock = threading.Lock()-- @property- def id(self) -> str:- return f"fake-image:{self.model}"-- def generate_with_usage(self, prompt: str, *, size: int = 1024, n: int = 1, seed: int | None = None,- reference_images: Sequence[Any] = ()) -> tuple[list[Image.Image], Usage]:- with self._lock:- self.calls.append(prompt)- if any(s in prompt for s in self.fail_on):- from codeverse3d.models.base import ModelError-- raise ModelError(f"fake image model refused: {prompt[:40]}", retryable=False)- if self.latency_s:- time.sleep(self.latency_s)- images = [procedural_texture(prompt, size=size, seed=(seed or 0) + i) for i in range(n)]- usage = Usage(backend="fake-image", model=self.model, input_tokens=len(prompt.split()), output_tokens=1290 * n,- cost_usd=self.usd_per_image * n, latency_ms=int(self.latency_s * 1000))- return images, usage---def procedural_texture(prompt: str, *, size: int = 256, seed: int = 0) -> Image.Image:- """Prompt-seeded noise + stripes in a prompt-derived colour. NOT tileable on- purpose (so tests exercise ``make_tileable``): a linear gradient is added."""- h = int(hashlib.sha256(prompt.encode()).hexdigest()[:8], 16)- rng = np.random.default_rng(h + seed)- base = np.array([(h >> 16) & 255, (h >> 8) & 255, h & 255], dtype=np.float32) / 255.0- base = 0.25 + 0.6 * base- y, x = np.mgrid[0:size, 0:size].astype(np.float32) / size- stripes = 0.08 * np.sin(2 * np.pi * (8 * x + 3 * np.sin(2 * np.pi * y)))- noise = 0.06 * rng.standard_normal((size, size)).astype(np.float32)- grad = 0.25 * x # seam-breaking gradient- lum = (stripes + noise + grad)[:, :, None]- img = np.clip(base[None, None, :] + lum, 0.0, 1.0)- return Image.fromarray((img * 255).astype(np.uint8), "RGB")diff --git a/harness/tests/texturing/test_apply.py b/harness/tests/texturing/test_apply.pydeleted file mode 100644index eef202f4..00000000--- a/harness/tests/texturing/test_apply.py+++ /dev/null@@ -1,41 +0,0 @@-"""apply.py: textured GLB keeps names/geometry, shares images, skips parts, reloads."""--from __future__ import annotations--from pathlib import Path--import numpy as np-import trimesh--from codeverse3d.spatial.measure import measure_glb-from codeverse3d.texturing.apply import apply_textures-from codeverse3d.texturing.generate import generate_textures-from codeverse3d.texturing.plan import default_plan-from tests.texturing.conftest import FakeImageModel---def test_apply_textures_end_to_end(tmp_path: Path, chair_glb: Path, chair_plan):- tp = default_plan(chair_plan)- ts = generate_textures(tp, tmp_path / "tex", FakeImageModel(), size=64, cache_dir=tmp_path / "c")- out = tmp_path / "object_textured.glb"- rep = apply_textures(chair_glb, tp, ts.paths(), out)- assert out.is_file() and rep.warnings == []- assert sorted(rep.parts_textured) == ["Back", "Leg_0", "Leg_1", "Leg_2", "Leg_3", "Seat"]- assert rep.parts_skipped == ["Knob"] and rep.parts_unmatched == []- assert rep.projections["Leg_0"] == "cylinder" and rep.projections["Seat"] == "box"- assert rep.n_materials == 2- # names + geometry preserved; measurement unchanged- a, b = measure_glb(chair_glb), measure_glb(out)- assert {p.name for p in a.parts} == {p.name for p in b.parts}- assert np.allclose(a.extents, b.extents, atol=1e-6) and a.tri_count == b.tri_count- # skipped part keeps its original (untextured) visual- s = trimesh.load(out, force="scene", process=False)- knob = s.geometry["Knob"]- assert getattr(getattr(knob.visual, "material", None), "baseColorTexture", None) is None- # UVs present and per-vertex on textured parts- seat = s.geometry["Seat"]- assert seat.visual.uv is not None and len(seat.visual.uv) == len(seat.vertices)- # a missing texture file warns and textures nothing- rep = apply_textures(chair_glb, tp, {tp.texture_ids()[0]: tmp_path / "missing.png"}, tmp_path / "o.glb")- assert any("missing" in w for w in rep.warnings)- assert rep.parts_textured == []diff --git a/harness/tests/texturing/test_gate.py b/harness/tests/texturing/test_gate.pydeleted file mode 100644index b26ab90a..00000000--- a/harness/tests/texturing/test_gate.py+++ /dev/null@@ -1,48 +0,0 @@-"""gate.py: seam gate + before/after judge gate decisions."""--from __future__ import annotations--from pathlib import Path--import pytest--from codeverse3d.judges.rubrics import load_rubric-from codeverse3d.texturing.generate import TextureAsset, judge_gate-from tests.texturing.conftest import FakeJudge, fake_render---def _asset(tid: str, seam: float, ok_path: Path) -> TextureAsset:- return TextureAsset(texture_id=tid, path=str(ok_path), prompt="p", prompt_hash="h", seam_score=seam)--[email protected](("rubric", "criterion"), [- ("static_object", "materials"), ("reference", "material_color"), ("asset", "material_truth"),- ("scene", "materials_shaders_effects"), ("articulated", ""), ("shader", ""),-])-def test_the_rubric_flags_its_materials_criterion(rubric, criterion):- """N64: the gate sniffed criterion ids by prefix (law 4); a rubric now says which one it is."""- assert load_rubric(rubric).materials_criterion == criterion---def _run(tmp_path, chair_spec, chair_plan, chair_glb, verdicts, **kw):- judge = FakeJudge(verdicts)- after = tmp_path / "after.glb"- after.write_bytes(chair_glb.read_bytes() + b"\0" * 7) # different size → different fake render colour- res = judge_gate(chair_spec, chair_plan, chair_glb, after, tmp_path / "gate", judge=judge, render=fake_render, **kw)- assert judge.calls == 2- return res---def test_judge_gate_rejects_overall_drop_or_flat_materials(tmp_path, chair_spec, chair_plan, chair_glb):- res = _run(tmp_path, chair_spec, chair_plan, chair_glb, [(0.70, {"materials": 0.6}), (0.65, {"materials": 0.9})])- assert not res.shipped and "Δoverall" in res.reason- res = _run(tmp_path, chair_spec, chair_plan, chair_glb, [(0.70, {"materials": 0.6}), (0.72, {"materials": 0.6})])- assert not res.shipped and "did not improve" in res.reason- res = _run(tmp_path, chair_spec, chair_plan, chair_glb, [(0.70, {"materials": 0.6}), (0.695, {"materials": 0.7})])- assert res.shipped # −0.005 is within the −0.01 tolerance---def test_judge_gate_degraded_never_ships(tmp_path, chair_spec, chair_plan, chair_glb):- judge = FakeJudge([(0.0, {"materials": 0.0})], degraded=True)- res = judge_gate(chair_spec, chair_plan, chair_glb, chair_glb, tmp_path / "g", judge=judge, render=fake_render)- assert not res.shipped and "degraded" in res.reasondiff --git a/harness/tests/texturing/test_generate.py b/harness/tests/texturing/test_generate.pydeleted file mode 100644index d2501e85..00000000--- a/harness/tests/texturing/test_generate.py+++ /dev/null@@ -1,47 +0,0 @@-"""generate.py: dedupe, cache, parallel fan-out, per-texture failures, usage."""--from __future__ import annotations--from pathlib import Path--from PIL import Image--from codeverse3d.texturing.generate import SEAM_MAX, generate_textures, prompt_key-from tests.texturing.conftest import FakeImageModel---def test_generate_dedupes_caches_and_accounts(tmp_path: Path):- model = FakeImageModel(usd_per_image=0.01)- prompts = {"oak": "oak wood grain", "oak_copy": "oak wood grain", "steel": "brushed steel"}- ts = generate_textures(prompts, tmp_path / "out", model, size=128, cache_dir=tmp_path / "cache", max_workers=3)- assert set(ts.textures) == set(prompts)- assert len(model.calls) == 2 # identical prompt generated once- assert ts.usage.cost_usd == 0.02 and ts.usage.output_tokens == 2 * 1290- for a in ts.textures.values():- assert a.ok and Image.open(a.path).size == (128, 128)- assert a.seam_score <= SEAM_MAX and a.seam_score < a.seam_score_raw- assert ts.textures["oak_copy"].cached and ts.textures["oak_copy"].prompt_hash == ts.textures["oak"].prompt_hash- assert (tmp_path / "cache" / "textures" / f"{prompt_key('oak wood grain', model.id, 128)}.png").is_file()- # second run: everything from cache, no model calls, zero cost- ts2 = generate_textures(prompts, tmp_path / "out2", model, size=128, cache_dir=tmp_path / "cache")- assert len(model.calls) == 2 and ts2.usage.cost_usd == 0.0 and all(a.cached for a in ts2.textures.values())---def test_generate_accepts_texture_plan_and_empty(tmp_path: Path, chair_plan):- from codeverse3d.texturing.plan import default_plan-- tp = default_plan(chair_plan)- ts = generate_textures(tp, tmp_path, FakeImageModel(), size=64, cache_dir=tmp_path / "c")- assert set(ts.textures) == set(tp.texture_ids())- assert generate_textures({}, tmp_path, FakeImageModel(), size=64, cache_dir=tmp_path / "c").textures == {}---def test_seed_is_part_of_the_cache_key(tmp_path: Path):- """V9b: seed=2 must not be served seed=1's cached pixels."""- model = FakeImageModel(usd_per_image=0.01)- generate_textures({"oak": "oak wood grain"}, tmp_path / "o1", model, size=64, cache_dir=tmp_path / "c", seed=1)- ts2 = generate_textures({"oak": "oak wood grain"}, tmp_path / "o2", model, size=64, cache_dir=tmp_path / "c", seed=2)- assert len(model.calls) == 2 and not ts2.textures["oak"].cached, "a new seed must regenerate"- ts3 = generate_textures({"oak": "oak wood grain"}, tmp_path / "o3", model, size=64, cache_dir=tmp_path / "c", seed=2)- assert len(model.calls) == 2 and ts3.textures["oak"].cached, "the same seed still hits the cache"- assert prompt_key("p", "m", 64, seed=1) != prompt_key("p", "m", 64, seed=2)diff --git a/harness/tests/texturing/test_live.py b/harness/tests/texturing/test_live.pydeleted file mode 100644index bdf93a81..00000000--- a/harness/tests/texturing/test_live.py+++ /dev/null@@ -1,44 +0,0 @@-"""Live texturing tests (real Gemini calls; need keys). Run: pytest tests/texturing -m live -s"""--from __future__ import annotations--from pathlib import Path--import pytest--from codeverse3d.config import get_settings-from codeverse3d.contracts.plan import StaticPlan-from codeverse3d.contracts.spec import Spec-from codeverse3d.models.gemini import GeminiImageModel-from codeverse3d.texturing.generate import seam_score-from codeverse3d.texturing.plan import compose_image_prompt, material_plan--pytestmark = pytest.mark.live-RUN = Path(__file__).resolve().parents[2] / "runs" / "e2e_chair_blender"--[email protected](autouse=True)-def _keys():- if not get_settings().gemini_api_keys:- pytest.skip("no Gemini keys")---def test_gemini_image_model_generates_a_tile(tmp_path: Path):- model = GeminiImageModel()- images, usage = model.generate_with_usage(compose_image_prompt("oiled walnut wood grain, warm brown", "wood"), size=1024, seed=1)- assert len(images) == 1 and images[0].size == (1024, 1024)- assert usage.cost_usd > 0.01 and usage.output_tokens > 0 and usage.backend == "gemini-image"- assert 0.0 <= seam_score(images[0]) <= 1.0- images[0].save(tmp_path / "walnut.png")---def test_material_plan_live_on_chair(tmp_path: Path):- if not (RUN / "plan.json").is_file():- pytest.skip("reference run missing")- spec = Spec.model_validate_json((RUN / "spec.json").read_text())- plan = StaticPlan.model_validate_json((RUN / "plan.json").read_text())- sheet = RUN / "artifacts" / "renders" / "r01" / "sheet.png"- tp = material_plan(spec, plan, sheet if sheet.is_file() else None, "gemini:gemini-3.7-flash", cache_dir=tmp_path, use_cache=False)- assert tp.source == "vlm" and len(tp.parts) == len(plan.parts)- assert tp.textured() and all("wood" in p.material_family or p.skip for p in tp.parts)- assert 1 <= len(tp.texture_ids()) <= 4 and tp.usage.cost_usd > 0diff --git a/harness/tests/texturing/test_maps.py b/harness/tests/texturing/test_maps.pydeleted file mode 100644index b982b28e..00000000--- a/harness/tests/texturing/test_maps.py+++ /dev/null@@ -1,38 +0,0 @@-"""maps.py: roughness + normal maps derived from a generated albedo tile."""--from __future__ import annotations--import numpy as np-from PIL import Image--from codeverse3d.texturing.apply import (- metallic_roughness_image,- normal_image,-)---def _grain(size: int = 64) -> Image.Image:- """A vertical stripe pattern: light bands (polished high points) and dark ones."""- x = np.arange(size)- band = (0.5 + 0.45 * np.sin(2 * np.pi * 8 * x / size)).astype(np.float32) # seamless: 8 periods- a = np.repeat(band[None, :], size, axis=0)- rgb = np.stack([a * 0.7, a * 0.45, a * 0.25], axis=-1)- return Image.fromarray(np.round(rgb * 255).astype(np.uint8), mode="RGB")---def test_derived_maps_use_the_gltf_encodings():- """metallicRoughness: glTF channel packing; normal: tangent space, as seamless as the albedo."""- img = _grain()- mr = metallic_roughness_image(img, 0.62, 1.0, "cast_iron")- a = np.asarray(mr)- assert mr.mode == "RGB" and a.shape == (64, 64, 3)- assert (a[..., 2] == 255).all(), "metallic lives in B"- assert a[..., 1].std() > 3, "roughness lives in G and must actually vary"- assert 140 < a[..., 1].mean() < 180- n = np.asarray(normal_image(img, "cast_iron"), dtype=np.float32) / 255.0 * 2.0 - 1.0- assert np.allclose(np.linalg.norm(n, axis=-1), 1.0, atol=1e-2)- assert (n[..., 2] > 0).all(), "z always points out of the surface"- # wrap-around gradients: the map must be as seamless as the albedo it came from- assert abs(float(n[:, 0, 0].mean() - n[:, -1, 0].mean())) < 0.35- flat = normal_image(img, "cast_iron", strength=0.0)- assert np.asarray(flat)[..., 0].std() < 1e-6diff --git a/harness/tests/texturing/test_materials.py b/harness/tests/texturing/test_materials.pyindex b6da060a..bb4eb558 100644--- a/harness/tests/texturing/test_materials.py+++ b/harness/tests/texturing/test_materials.py@@ -1,25 +1,13 @@-"""materials.py: the family table, the keyword resolver and the plausibility bands."""+"""materials.py: the family table and the keyword resolver."""from __future__ import annotationsimport pytest-from codeverse3d.texturing.materials import (- BARE_METAL_FAMILIES,- COARSE_TO_FINE,- MATERIALS,- family_for,- is_warm_metal_hue,- looks_painted,- out_of_band,- pbr_for,- saturation,-)-from codeverse3d.texturing.plan import FAMILY_DEFAULTS+from codeverse3d.texturing.materials import COARSE_TO_FINE, MATERIALS, family_for, pbr_for-def test_coarse_families_of_the_texture_planner_all_resolve():- assert set(COARSE_TO_FINE) == set(FAMILY_DEFAULTS)+def test_coarse_families_all_resolve():for coarse, fine in COARSE_TO_FINE.items():assert fine in MATERIALS, coarseassert pbr_for(coarse) is MATERIALS[fine]@@ -47,22 +35,3 @@ def test_family_for_prefers_the_first_text_that_resolves():assert family_for("Unnamed", "SteamWand", "silicone tip").family == "rubber"assert family_for("", "", "") is Noneassert family_for("Widget42") is None---def test_out_of_band_names_the_offending_factor():- chrome = MATERIALS["chrome"]- assert out_of_band(chrome, 0.95, 0.10) == []- assert out_of_band(chrome, 0.2, 0.10) == ["metallic"]- assert out_of_band(chrome, 0.95, 0.8) == ["roughness"]- assert out_of_band(MATERIALS["hardwood"], 0.9, 0.02) == ["metallic", "roughness"]---def test_saturated_colour_means_paint_but_gold_still_means_metal():- assert saturation((0.5, 0.5, 0.5)) == 0.0- assert looks_painted("cast_iron", (0.10, 0.35, 0.18)) # dark green pump = painted iron- assert looks_painted("machined_steel", (0.85, 0.05, 0.05))- assert not looks_painted("cast_iron", (0.12, 0.12, 0.13)) # neutral: really is iron- assert not looks_painted("machined_steel", (0.85, 0.65, 0.28)) # titanium nitride is gold- assert not looks_painted("hardwood", (0.10, 0.35, 0.18)) # rule only applies to bare metals- assert is_warm_metal_hue((0.72, 0.40, 0.25)) and not is_warm_metal_hue((0.8, 0.1, 0.1))- assert set(MATERIALS) >= BARE_METAL_FAMILIESdiff --git a/harness/tests/texturing/test_normalise.py b/harness/tests/texturing/test_normalise.pydeleted file mode 100644index e585ecec..00000000--- a/harness/tests/texturing/test_normalise.py+++ /dev/null@@ -1,132 +0,0 @@-"""normalise.py: which materials the post-build normaliser touches, and what it writes."""--from __future__ import annotations--from pathlib import Path--import trimesh-from PIL import Image--from codeverse3d.spatial.measure import load_scene, measure_glb-from codeverse3d.texturing.apply import classify, normalise_materials---def _pbr(name: str, metallic, roughness, colour=(120, 120, 120, 255), **kw):- return trimesh.visual.material.PBRMaterial(- name=name, baseColorFactor=list(colour), metallicFactor=metallic, roughnessFactor=roughness, **kw)---def _glb(tmp_path: Path, rows) -> Path:- """rows: (node, material name, metallic, roughness, colour)."""- scene = trimesh.Scene()- for i, (node, mat_name, m, r, colour) in enumerate(rows):- box = trimesh.creation.box(extents=(0.1, 0.1, 0.1))- box.apply_translation((i * 0.2, 0, 0))- box.visual = trimesh.visual.TextureVisuals(- uv=[[0.0, 0.0]] * len(box.vertices), material=_pbr(mat_name, m, r, colour))- scene.add_geometry(box, node_name=node, geom_name=node)- out = tmp_path / "in.glb"- scene.export(out)- return out---# --------------------------------------------------------------------------- classify---def test_plan_prose_may_only_fix_a_never_configured_default():- """The plan's prose may spot an untouched default, never overrule typed numbers."""- assert classify("lid__0", "SpaceGray", "glass display panel in an aluminium lid", 0.88, 0.30) is None- v = classify("lid__0", "SpaceGray", "glass display panel", 0.0, 1.0)- assert v is not None and v.reason == "untouched" and v.family == "glass"---def test_a_saturated_colour_turns_bare_iron_into_paint():- v = classify("PumpBody", "DarkGreenCastIron", "", 0.15, 0.65, (0.10, 0.35, 0.18))- assert v is None or v.family in ("painted_metal", "painted_wood")- grey = classify("CastBase", "CastIronDark", "", 0.20, 0.65, (0.12, 0.12, 0.13))- assert grey is not None and grey.family == "cast_iron" and grey.metallic == 0.5---# --------------------------------------------------------------------------- the pass-def test_normalise_materials_rewrites_only_the_factors(tmp_path: Path):- glb = _glb(tmp_path, [- ("Seat", "OakSeat", 0.0, 0.5, (150, 100, 60, 255)), # untouched default -> hardwood- ("Rail", "ChromeRail", 0.20, 0.10, (210, 215, 220, 255)), # impossible metallic -> clamp- ("Bit", "PolishedSteelBit", 0.98, 0.15, (215, 215, 224, 255)), # fine- ("Widget", "Mat.001", 0.30, 0.40, (100, 100, 100, 255)), # unknown- ])- out = tmp_path / "out.glb"- rep = normalise_materials(glb, out, plan=None)- assert out.is_file() and rep.warnings == []- changed = {c.node: c for c in rep.changes}- assert set(changed) == {"Seat", "Rail"}- assert changed["Seat"].family == "hardwood" and changed["Seat"].roughness == (0.5, 0.45)- assert changed["Rail"].family == "chrome" and changed["Rail"].metallic == (0.2, 0.7)- assert rep.n_materials == 4 and rep.n_unchanged == 2- assert "hardwood" in rep.table() and "chrome" in rep.table()- # nothing but the two floats moved- a, b = measure_glb(glb), measure_glb(out)- assert {p.name for p in a.parts} == {p.name for p in b.parts} and a.tri_count == b.tri_count- after = {g: m.baseColorFactor.tolist() for g, mesh in load_scene(out).geometry.items()- for m in [mesh.visual.material]}- before = {g: m.baseColorFactor.tolist() for g, mesh in load_scene(glb).geometry.items()- for m in [mesh.visual.material]}- assert after == before, "base colour is the agent's decision and must survive"---def test_nothing_to_do_writes_nothing_and_a_texture_is_never_second_guessed(tmp_path: Path):- glb = _glb(tmp_path, [("Bit", "PolishedSteelBit", 0.98, 0.15, (215, 215, 224, 255))])- out = tmp_path / "out.glb"- rep = normalise_materials(glb, out)- assert not rep.changed() and rep.glb_out == "" and not out.exists()- assert rep.table() == "no material needed normalising"- glb = _glb(tmp_path, [("Seat", "OakSeat", 0.0, 0.5, (150, 100, 60, 255))])- scene = load_scene(glb)- scene.geometry["Seat"].visual.material.baseColorTexture = Image.new("RGB", (8, 8), (120, 90, 40))- textured = tmp_path / "textured.glb"- scene.export(textured)- rep = normalise_materials(textured, tmp_path / "out.glb")- assert not rep.changed() and rep.n_unchanged == 1---def test_an_instanced_part_reads_its_plan_material(tmp_path: Path):- """N4: the normaliser matched a node to its plan part by exact name or link piece only, so- ``Leg_0`` never read the plan's "solid oak" and kept the untouched default."""- from types import SimpleNamespace as NS-- glb = _glb(tmp_path, [("Leg_0", "Mat0", 0.0, 0.5, (150, 100, 60, 255))])- plan = NS(parts=[NS(name="Leg", material="solid oak", description="leg")])- rep = normalise_materials(glb, tmp_path / "out.glb", plan=plan)- assert [(c.node, c.family) for c in rep.changes] == [("Leg_0", "hardwood")]---def _cq_export_factors() -> tuple[float, float]:- """The (metallic, roughness) run_cq.py writes on every material (a stdlib-only wrapper: read, not imported)."""- import ast-- from codeverse3d import languages-- tree = ast.parse((Path(languages.__file__).parent / "wrappers" / "run_cq.py").read_text())- call = next(n for n in ast.walk(tree) if isinstance(n, ast.Call) and getattr(n.func, "attr", "") == "PBRMaterial")- kw = {k.arg: ast.literal_eval(k.value) for k in call.keywords if k.arg in ("metallicFactor", "roughnessFactor")}- return kw["metallicFactor"], kw["roughnessFactor"]---def test_the_harness_writers_own_defaults_count_as_never_authored():- """N54: CadQuery's (0, 0.6) and the three.js stub's (0.05, 0.6) read as authored, so CadQuery- steel was clamped to half-metallic and CadQuery wood was never normalised. Since D107 the- three.js stub sets neither factor, so it exports three's own default (0, 1); the pre-D107 stub's- pair stays listed for the runs recorded before it."""- import re-- from codeverse3d.languages.threejs import PART_TEMPLATE- from codeverse3d.texturing.materials import is_framework_default-- assert "MeshStandardMaterial" in PART_TEMPLATE and not re.search(r"\b(roughness|metalness)\s*:", PART_TEMPLATE)- assert is_framework_default(0.0, 1.0) and is_framework_default(0.05, 0.6)- cq = _cq_export_factors()- assert is_framework_default(*cq)- steel = classify("SteelFrame", "SteelFrameMat", "", *cq)- assert steel is not None and steel.reason == "untouched" and steel.metallic == 1.0- oak = classify("Leg", "LegMat", "solid oak", *cq)- assert oak is not None and oak.family == "hardwood"diff --git a/harness/tests/texturing/test_plan.py b/harness/tests/texturing/test_plan.pydeleted file mode 100644index 066a945a..00000000--- a/harness/tests/texturing/test_plan.py+++ /dev/null@@ -1,85 +0,0 @@-"""plan.py: default heuristics, planner-output finalisation, one vision call + cache."""--from __future__ import annotations--from pathlib import Path--import pytest-from PIL import Image--from codeverse3d.texturing.materials import pbr_for-from codeverse3d.texturing.plan import (- PlannerOutput,- PlannerPart,- TexturePlan,- compose_image_prompt,- family_from_text,- finalize_plan,- material_plan,-)-from tests.orchestrator_tracks.fakes import FakeChatModel---def test_family_keywords_are_whole_words():- assert family_from_text("satin oiled walnut") == "wood"- assert family_from_text("brushed stainless steel") == "metal"- assert family_from_text("grey-blue linen upholstery") == "fabric"- assert family_from_text("oiled") == "other" # 'led' must not match---def test_finalize_plan_defaults_and_unification(chair_plan):- out = PlannerOutput(parts=[- PlannerPart(part="Seat", texture_id="oak", material_family="wood", subject="light oak, straight grain"),- PlannerPart(part="back", texture_id="oak", material_family="fabric", subject="something else", roughness=0.9),- PlannerPart(part="Ghost", texture_id="x", material_family="wood", subject="unknown part is dropped"),- # Leg omitted → defaulted from the plan material (brushed steel → metal)- ])- tp = finalize_plan(out, chair_plan, model_id="m")- by = tp.by_part()- assert set(by) == {"seat", "back", "leg", "knob"}- assert by["back"].prompt == by["seat"].prompt and by["back"].material_family == "wood" # shared id → first wins- assert by["back"].roughness == 0.9 # per-part factor kept- assert by["leg"].material_family == "metal" and not by["leg"].skip- assert by["knob"].skip- assert by["seat"].tile_size_m == 0.35 # wood default- # an unset factor is THE material table's, the numbers the normaliser writes in the same pass (C5)- assert (by["seat"].roughness, by["leg"].metallic, by["leg"].roughness) == (- pbr_for("wood").roughness, pbr_for("metal").metallic, pbr_for("metal").roughness)---def test_compose_prompt():- p = compose_image_prompt(" red brick wall. ", "stone")- assert p.startswith("red brick wall, stone surface") and p.endswith("1:1 square")---def test_material_plan_one_call_with_sheet_and_cache(tmp_path: Path, chair_plan, chair_spec):- sheet = tmp_path / "sheet.png"- Image.new("RGB", (32, 32), (1, 2, 3)).save(sheet)- payload = {"parts": [- {"part": "Seat", "texture_id": "oak_wood", "material_family": "wood", "subject": "light oak", "projection": "planar_y", "tile_size_m": 0.4},- {"part": "Back", "texture_id": "oak_wood", "material_family": "wood", "subject": "light oak", "projection": "box"},- {"part": "Leg", "texture_id": "steel", "material_family": "metal", "subject": "brushed steel", "projection": "cylinder", "metallic": 1, "roughness": 0.3},- {"part": "Knob", "texture_id": "glass", "material_family": "glass", "skip": True, "reason": "glass"},- ], "notes": "two materials"}- chat = FakeChatModel(default=payload)- tp = material_plan(chair_spec, chair_plan, sheet, "fake:fake", model=chat, cache_dir=tmp_path / "cache")- assert isinstance(tp, TexturePlan) and tp.source == "vlm" and tp.usage.cost_usd == pytest.approx(0.002)- assert len(chat.requests) == 1- req = chat.requests[0]- assert req.response_schema is not None and any(p.type == "image" for p in req.messages[0].parts)- assert "Seat" in req.messages[0].text and chair_spec.prompt in req.messages[0].text- assert tp.by_part()["seat"].projection == "planar_y" and tp.by_part()["seat"].tile_size_m == 0.4- assert tp.texture_ids() == ["oak_wood", "steel"]- # cache hit: no second call- tp2 = material_plan(chair_spec, chair_plan, sheet, "fake:fake", model=chat, cache_dir=tmp_path / "cache")- assert tp2.source == "cache" and len(chat.requests) == 1 and tp2.texture_ids() == tp.texture_ids()- # different sheet → new key → new call- Image.new("RGB", (32, 32), (9, 9, 9)).save(sheet)- material_plan(chair_spec, chair_plan, sheet, "fake:fake", model=chat, cache_dir=tmp_path / "cache")- assert len(chat.requests) == 2---def test_material_plan_invalid_payload_fails_loud(tmp_path, chair_plan, chair_spec):- chat = FakeChatModel(default={"nope": 1})- with pytest.raises(ValueError):- material_plan(chair_spec, chair_plan, None, "fake:fake", model=chat, cache_dir=tmp_path, use_cache=False)diff --git a/harness/tests/texturing/test_run.py b/harness/tests/texturing/test_run.pydeleted file mode 100644index a29c3c7d..00000000--- a/harness/tests/texturing/test_run.py+++ /dev/null@@ -1,86 +0,0 @@-"""run.py: the whole pass offline (fake image model, fake render, fake judge)."""--from __future__ import annotations--import json-import shutil-from pathlib import Path--from typer.testing import CliRunner--from codeverse3d.contracts.run import RunRecord-from codeverse3d.texturing.run import (- TextureReport,- load_report,- texture_pass,-)-from codeverse3d.workspace import Workspace-from tests.texturing.conftest import FakeImageModel, FakeJudge, fake_render---def _ws(tmp_path: Path, chair_glb: Path, chair_spec, chair_plan) -> Workspace:- ws = Workspace(tmp_path / "run").create()- ws.write_json(ws.spec_path, chair_spec)- ws.write_json(ws.plan_path, chair_plan)- shutil.copy(chair_glb, ws.artifacts / "object.glb")- rec = RunRecord(spec=chair_spec, plan=chair_plan, workspace=str(ws.root))- ws.write_json(ws.record_path, rec)- return ws---def test_texture_pass_ships_records_and_shows(tmp_path, chair_glb, chair_spec, chair_plan):- ws = _ws(tmp_path, chair_glb, chair_spec, chair_plan)- other = ws.renders_dir(0) / "sheet.png" # another round's sheet: never the planner's picture of THIS glb- other.parent.mkdir(parents=True)- other.write_bytes(b"not this glb")- judge = FakeJudge([(0.70, {"materials": 0.6, "intent_fidelity": 0.8}), (0.73, {"materials": 0.75, "intent_fidelity": 0.8})])- img = FakeImageModel(usd_per_image=0.05)- rep = texture_pass(ws, chair_spec, chair_plan, model_id="", image_model=img, judge_obj=judge, render=fake_render,- cache_dir=tmp_path / "cache")- assert isinstance(rep, TextureReport) and rep.shipped and rep.delta == 0.03- assert rep.plan.source == "default" and len(rep.textures.paths()) == 2- assert (ws.artifacts / "object_textured.glb").is_file() and (ws.artifacts / "object.glb").read_bytes() == chair_glb.read_bytes()- assert (ws.artifacts / "textures" / "texturing.json").is_file() and (ws.artifacts / "textures" / "texture_plan.json").is_file()- assert rep.usage.cost_usd > 0.1 # 2 images + 2 judge calls- rec = json.loads(ws.record_path.read_text())- tx = rec["extra"]["texturing"]- assert tx["shipped"] is True and tx["glb_textured"] == "artifacts/object_textured.glb" and len(tx["textures"]) == 2- assert tx["texture_plan"]["Seat"] == tx["texture_plan"]["Back"]- # events were emitted- events = [json.loads(line)["event"] for line in ws.events_path.read_text().splitlines()]- assert events[0] == "texture.start" and "texture.gate" in events and events[-1] == "texture.done"- # report reloads- assert load_report(ws).shipped- # planner quick render was written because the round passed no sheet of its own- assert (ws.artifacts / "textures" / "planner_views" / "sheet.png").is_file()- # `3dcode texture show` reads it back- from codeverse3d.cli.main import app-- runner = CliRunner()- res = runner.invoke(app, ["texture", "show", str(ws.root)])- assert res.exit_code == 0, res.output- assert "texture pass" in res.output and "wood_oiled_oak" in res.output- res = runner.invoke(app, ["texture", "--help"])- assert res.exit_code == 0 and "scene-pack" in res.output and "pass" in res.output- res = runner.invoke(app, ["texture", "show", str(tmp_path / "nowhere")])- assert res.exit_code != 0---def test_texture_pass_no_judge_and_all_failed(tmp_path, chair_glb, chair_spec, chair_plan):- ws = _ws(tmp_path, chair_glb, chair_spec, chair_plan)- rep = texture_pass(ws, chair_spec, chair_plan, model_id="", image_model=FakeImageModel(), judge=False, render=fake_render,- cache_dir=tmp_path / "cache")- assert rep.shipped and rep.gate is None and any("skipped" in n for n in rep.notes)- from codeverse3d.cli.main import app-- # `texture show` tells the user the gate was skipped- res = CliRunner().invoke(app, ["texture", "show", str(ws.root)])- assert res.exit_code == 0 and "judge gate skipped" in res.output, res.output- # every image fails → nothing applied, not shipped, no crash — and a stray- # canonical file from an earlier pass is removed even on this early-return path- ws2 = _ws(tmp_path / "b", chair_glb, chair_spec, chair_plan)- (ws2.artifacts / "object_textured.glb").write_bytes(b"stale earlier pass")- rep2 = texture_pass(ws2, chair_spec, chair_plan, model_id="", image_model=FakeImageModel(fail_on=("seamless",)), judge=False,- render=fake_render, cache_dir=tmp_path / "cache2")- assert not rep2.shipped and rep2.apply is None and rep2.glb_out == "" and rep2.textures.failed()- assert not (ws2.artifacts / "object_textured.glb").exists()diff --git a/harness/tests/texturing/test_scene_pack.py b/harness/tests/texturing/test_scene_pack.pydeleted file mode 100644index bf59d20d..00000000--- a/harness/tests/texturing/test_scene_pack.py+++ /dev/null@@ -1,66 +0,0 @@-"""scene_pack.py: heuristic + VLM pack plans, generation, manifest, prompt snippet."""--from __future__ import annotations--import json-from pathlib import Path--import pytest--from codeverse3d.contracts.plan import AssetPlan, BBox, CameraPlan, ScenePlan, ZonePlan-from codeverse3d.texturing.plan import (- scene_pack_plan,- scene_texture_pack,- texture_pack_prompt,-)-from tests.orchestrator_tracks.fakes import FakeChatModel-from tests.texturing.conftest import FakeImageModel---def garden_plan() -> ScenePlan:- bb = BBox(center=(0, 0, 0), extents=(30, 10, 30))- return ScenePlan(- title="Zen Garden", summary="a small Kyoto garden", setting="Kyoto, autumn dusk", mood="calm",- bounds=bb, environment="mossy banks, a koi pond, raked gravel court",- zones=[ZonePlan(name="Pond", description="koi pond with stepping stones", bbox=bb, contents=["Bridge"]),- ZonePlan(name="GravelCourt", description="raked gravel karesansui with granite rocks", bbox=bb)],- assets=[AssetPlan(name="Bridge", kind="blender_glb", description="red lacquered wooden arched bridge", approx_size_m=(4, 2, 1))],- cameras=[CameraPlan(name="main", position=(10, 3, 10), look_at=(0, 0, 0))],- )---def test_scene_pack_plan_with_model_and_cap(garden_plan):- payload = {"textures": [- {"name": "Moss Ground", "material_family": "other", "subject": "green moss carpet", "tile_size_m": 1.2, "role": "ground"},- {"name": "moss_ground", "material_family": "other", "subject": "dup", "tile_size_m": 1.0, "role": "ground"},- {"name": "granite_gravel", "material_family": "stone", "subject": "fine grey gravel", "tile_size_m": 0.8, "role": "ground"},- {"name": "iron_grate", "material_family": "metal", "subject": "cast iron grate", "tile_size_m": 0.5, "role": "prop"},- {"name": "zinc_sheet", "material_family": "metal", "subject": "painted zinc", "metallic": 0, "role": "roof"},- ], "notes": "n"}- chat = FakeChatModel(default=payload)- entries, notes, usage = scene_pack_plan(garden_plan, "fake:fake", model=chat, n_max=4)- assert [e.name for e in entries] == ["moss_ground", "granite_gravel", "iron_grate", "zinc_sheet"] and notes == "n"- assert usage.cost_usd > 0- # a metal the planner left unset is metallic (it shipped 0.0 until 2026-09-23); a stated 0 is kept- assert [e.metallic for e in entries] == [0.0, 0.0, 1.0, 0.0]- assert entries[0].tile_size_m == 1.2 and "green moss carpet, matte natural surface" in entries[0].prompt- assert "Zen Garden" in chat.requests[0].messages[0].text and "GravelCourt" in chat.requests[0].messages[0].text- with pytest.raises(ValueError):- scene_pack_plan(garden_plan, "fake:fake", model=FakeChatModel(default={"textures": []}))---def test_scene_texture_pack_writes_manifest_and_prompt(tmp_path: Path, garden_plan):- model = FakeImageModel()- out = tmp_path / "public" / "textures"- pack = scene_texture_pack(garden_plan, out, model, "", size=64, cache_dir=tmp_path / "c", n_min=4, n_max=6)- man = json.loads(Path(pack.manifest_path).read_text())- assert pack.source == "default" and 4 <= len(man) <= 6 and Path(pack.manifest_path).name == "manifest.json"- for name, e in man.items():- assert (out / e["file"]).is_file() and e["file"] == f"{name}.png" and e["tile_size_m"] > 0 and "family" in e- assert Path(pack.manifest_path).parent == out- snippet = texture_pack_prompt(man)- assert "/public/textures/" in snippet and "RepeatWrapping" in snippet and "SRGBColorSpace" in snippet- assert "loaders.texture.load" in snippet and "tile =" in snippet- assert texture_pack_prompt({}) == ""- assert "/textures/x" in texture_pack_prompt({"a": {"file": "a.png", "tile_size_m": 1}}, url_prefix="/textures/x")diff --git a/harness/tests/texturing/test_tile.py b/harness/tests/texturing/test_tile.pydeleted file mode 100644index 3a6d13a8..00000000--- a/harness/tests/texturing/test_tile.py+++ /dev/null@@ -1,18 +0,0 @@-"""tile.py: sizing and saving (the seam score is gated in test_generate)."""--from __future__ import annotations--from PIL import Image--from codeverse3d.texturing.generate import fit_size, save_texture---def test_fit_size_save_and_helpers(tmp_path):- img = Image.new("RGB", (300, 200), (10, 20, 30))- sq = fit_size(img, 128)- assert sq.size == (128, 128)- assert fit_size(Image.new("RGB", (64, 64)), 128).size == (64, 64) # never upscales- p = save_texture(sq, tmp_path / "t.jpg")- assert p.is_file() and Image.open(p).format == "JPEG"- p2 = save_texture(sq, tmp_path / "t.png")- assert Image.open(p2).format == "PNG"diff --git a/harness/tests/texturing/test_tools_cli.py b/harness/tests/texturing/test_tools_cli.pydeleted file mode 100644index 4a29b5df..00000000--- a/harness/tests/texturing/test_tools_cli.py+++ /dev/null@@ -1,63 +0,0 @@-"""The texture pass with every dependency injected, and `3dcode texture scene-pack`, offline (`show`: test_run)."""--from __future__ import annotations--import shutil-from pathlib import Path--from typer.testing import CliRunner--from codeverse3d.texturing.run import texture_pass-from codeverse3d.workspace import Workspace-from tests.orchestrator_tracks.fakes import FakeChatModel-from tests.texturing.conftest import PLAN_REPLY, FakeImageModel, FakeJudge, fake_render---def _ws(tmp_path: Path, chair_glb, chair_spec, chair_plan) -> Workspace:- ws = Workspace(tmp_path / "run").create()- ws.write_json(ws.spec_path, chair_spec)- ws.write_json(ws.plan_path, chair_plan)- shutil.copy(chair_glb, ws.artifacts / "object.glb")- return ws---def test_texture_pass_runs_with_injected_fakes(tmp_path, chair_glb, chair_spec, chair_plan):- """Every dependency injected, the spec's REAL planner id passed as ``model_id``: the pass must- not build a model from it (tests/install/test_hermetic.py runs this with no keys at all)."""- ws = _ws(tmp_path, chair_glb, chair_spec, chair_plan)- judge = FakeJudge([(0.7, {"materials": 0.5}), (0.72, {"materials": 0.7})])- rep = texture_pass(ws, chair_spec, chair_plan, model_id=chair_spec.backends.planner, image_model=FakeImageModel(),- plan_model=FakeChatModel(default=PLAN_REPLY), judge_obj=judge, render=fake_render, cache_dir=tmp_path / "c")- assert rep.shipped and rep.plan.source != "default"- assert (ws.artifacts / "object_textured.glb").is_file()---def test_cli_scene_pack_spend_joins_the_runs_ledger(tmp_path, chair_spec, monkeypatch):- """`3dcode texture scene-pack` opened no run_ledger (`pass` did), so its plan + image- spend went to the per-process log instead of the run's telemetry/cost.jsonl."""- from codeverse3d.cli.main import app- from codeverse3d.contracts.common import Language, Track, Usage- from codeverse3d.contracts.plan import BBox, CameraPlan, ScenePlan, ZonePlan- from codeverse3d.cost.instrument import run_ledger- from codeverse3d.cost.ledger import load_ledger, record_call- from codeverse3d.texturing.plan import ScenePack-- ws = Workspace(tmp_path / "run").create()- ws.write_json(ws.spec_path, chair_spec.model_copy(update={"track": Track.SCENE, "language": Language.SCENE_THREEJS}))- bb = BBox(center=(0, 0, 0), extents=(30, 10, 30))- ws.write_json(ws.plan_path, ScenePlan(- title="Zen Garden", summary="a small Kyoto garden", setting="Kyoto", bounds=bb, environment="raked gravel",- zones=[ZonePlan(name="Pond", description="koi pond with stepping stones", bbox=bb)],- cameras=[CameraPlan(name="main", position=(10, 3, 10), look_at=(0, 0, 0))]))- with run_ledger(ws.root, run=ws.root.name): # the run kept a ledger while it ran- record_call(Usage(model="gemini-3.7-flash", input_tokens=1000), label="planner")-- def fake_pack(plan, out_dir, image_model, model_id, **_):- record_call(Usage(model="gemini-3.1-flash-image", input_tokens=200, cost_usd=0.04), label="texture_pack")- return ScenePack(out_dir=str(out_dir))-- monkeypatch.setattr("codeverse3d.texturing.plan.scene_texture_pack", fake_pack)- monkeypatch.setattr("codeverse3d.reference.get_image_model", lambda name: FakeImageModel())- res = CliRunner().invoke(app, ["texture", "scene-pack", str(ws.root), "--model", ""])- assert res.exit_code == 0, res.output- assert [r.label for r in load_ledger(ws.root)] == ["planner", "texture_pack"]diff --git a/harness/tests/texturing/test_uv.py b/harness/tests/texturing/test_uv.pydeleted file mode 100644index 8c241307..00000000--- a/harness/tests/texturing/test_uv.py+++ /dev/null@@ -1,56 +0,0 @@-"""uv.py: projections, world-scale texel density, seam splitting."""--from __future__ import annotations--import numpy as np-import pytest-import trimesh--from codeverse3d.texturing.apply import choose_projection, unwrap---def test_choose_projection_rules():- assert choose_projection(np.array([0.04, 0.45, 0.04]), "auto") == ("cylinder", 1)- assert choose_projection(np.array([0.44, 0.03, 0.42]), "auto")[0] == "box" # slab- assert choose_projection(np.array([0.44, 0.03, 0.08]), "auto")[0] == "box" # elongated slab, not round- assert choose_projection(np.array([1, 1, 1]), "planar_y") == ("planar_y", 1)- assert choose_projection(np.array([1, 1, 1]), "planar_z") == ("planar_z", 2)- assert choose_projection(np.array([0.1, 2.0, 0.1]), "cylinder") == ("cylinder", 1)---def test_box_and_cylinder_projections_keep_world_scale_and_split_seams():- m = trimesh.creation.box(extents=(0.6, 0.3, 0.3))- uw = unwrap(m.vertices, m.faces, np.eye(4), projection="box", tile_size_m=0.3)- assert uw.projection == "box"- assert len(uw.faces) == len(m.faces)- # every box vertex touches 3 axis-groups → 8 vertices × 3 keys = 24- assert len(uw.vertices) == 24 and uw.n_split == 16- # the 0.6 m faces span 2 tiles along u, 0.3 m span 1 tile- spans = []- for f in uw.faces:- uv = uw.uv[f]- spans.append(uv.max(0) - uv.min(0))- assert max(s.max() for s in spans) == pytest.approx(2.0, abs=1e-6)- # scaling the world transform ×2 doubles the UV range (texel density is world-space)- T = np.diag([2.0, 2.0, 2.0, 1.0])- uw2 = unwrap(m.vertices, m.faces, T, projection="box", tile_size_m=0.3)- assert (uw2.uv.max(0) - uw2.uv.min(0)) == pytest.approx(2 * (uw.uv.max(0) - uw.uv.min(0)), abs=1e-6)-- m = trimesh.creation.cylinder(radius=0.05, height=0.5, sections=32) # along z- uw = unwrap(m.vertices, m.faces, np.eye(4), projection="auto", tile_size_m=0.1)- assert uw.projection == "cylinder" and uw.axis == 2- assert uw.n_split > 0 # seam + caps split- # side faces: u spread per face must be small (no face stretched across the seam)- for f in uw.faces:- uv = uw.uv[f]- assert (uv[:, 0].max() - uv[:, 0].min()) < 1.0- # v covers height / tile = 5 tiles- assert (uw.uv[:, 1].max() - uw.uv[:, 1].min()) >= 5.0 - 1e-6---def test_unwrap_rejects_bad_input():- with pytest.raises(ValueError):- unwrap(np.zeros((3, 3)), np.zeros((0, 3), dtype=int), np.eye(4))- m = trimesh.creation.box()- with pytest.raises(ValueError):- unwrap(m.vertices, m.faces, np.eye(4), tile_size_m=0.0)