Skip to content

Official Codebase of 3DCodeVerse

Python

prompts: the track templates state no harness limits — the DETAIL BUDGET block becomes numberless advice

gaoypenga979099cbb13
diff --git a/harness/codeverse3d/prompts/tracks/assemble_static.j2 b/harness/codeverse3d/prompts/tracks/assemble_static.j2
index 749c5578..dd84a228 100644
--- a/harness/codeverse3d/prompts/tracks/assemble_static.j2
+++ b/harness/codeverse3d/prompts/tracks/assemble_static.j2
@@ -40,8 +40,8 @@ Overall bbox: {{ overall_bbox }}
## Acceptance checklist (the judge verifies each item)
{{ acceptance }}
-## Detail budget
-{{ detail_budget }}
+## Detail
+{{ detail_advice }}
{% if tool_cards and not single_shot %}
## Tools
diff --git a/harness/codeverse3d/prompts/tracks/generate_graphics.j2 b/harness/codeverse3d/prompts/tracks/generate_graphics.j2
index 839dd804..1f1d4d3e 100644
--- a/harness/codeverse3d/prompts/tracks/generate_graphics.j2
+++ b/harness/codeverse3d/prompts/tracks/generate_graphics.j2
@@ -60,7 +60,7 @@ Motion: {{ motion }}
- Detail at several scales (fbm octaves, hash-placed elements, highlights) — the judge scores richness.
- Guard the maths: `x / max(d, 1e-4)`, `sqrt(max(x, 0.0))`, `normalize` only non-zero vectors,
`clamp` acos/asin inputs — one NaN pixel caps the score at 0.
-- Constant loop bounds; keep per-pixel cost sane (≤ ~100 raymarch steps, ≤ 8 fbm octaves).
+- Constant loop bounds; keep per-pixel cost sane.
## DON'T
- No `#version` line, no `uniform`/`out` declarations of the harness names (shader); no window,
diff --git a/harness/codeverse3d/prompts/tracks/generate_static.j2 b/harness/codeverse3d/prompts/tracks/generate_static.j2
index df57835c..6205d77f 100644
--- a/harness/codeverse3d/prompts/tracks/generate_static.j2
+++ b/harness/codeverse3d/prompts/tracks/generate_static.j2
@@ -45,12 +45,12 @@ Construction notes per part:
- Put real detail where the plan says: chamfers/bevels 2-6 mm, tapers, grooves, slats, bolts —
with the stated radii and counts. Primitives alone are not enough; combine and shape them.
- Materials per part with the stated colour (sRGB hex or 0-1 floats); roughness/metalness sensible.
-- Segments 24-48 for round things; see the detail budget below for the triangle target.
+- Segments 24-48 for round things.
- Name parts EXACTLY as in the table (PascalCase). One named node/object per part (instances may
be `Name`, `Name_2`, … or a single parent named `Name`).
-## Detail budget (what "finished" means for THIS object — sized from its plan, not a global cap)
-{{ detail_budget }}
+## Detail
+{{ detail_advice }}
## DON'T
- No environment sniffing, no `typeof window`, no headless branches — one code path.
diff --git a/harness/codeverse3d/prompts/tracks/generate_static_part.j2 b/harness/codeverse3d/prompts/tracks/generate_static_part.j2
index 73d81319..1df92f7c 100644
--- a/harness/codeverse3d/prompts/tracks/generate_static_part.j2
+++ b/harness/codeverse3d/prompts/tracks/generate_static_part.j2
@@ -34,8 +34,8 @@ one, overlap it by 2–5 mm (never leave a gap, never float); where a neighbour
leave a real surface for it at the stated box — no recess it cannot reach, no shape that would
make it interpenetrate.
-## Detail budget (this is what "finished" means here)
-{{ detail_budget }}
+## Detail
+{{ detail_advice }}
## DO
- Place each part so its bounding box CENTRE and EXTENTS equal the plan row (±0.01 m).
diff --git a/harness/codeverse3d/prompts/tracks/plan_scene.j2 b/harness/codeverse3d/prompts/tracks/plan_scene.j2
index 05970f54..b0a839c9 100644
--- a/harness/codeverse3d/prompts/tracks/plan_scene.j2
+++ b/harness/codeverse3d/prompts/tracks/plan_scene.j2
@@ -73,8 +73,8 @@ WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
brief is about) and its centre point S. Put the camera at distance
D = 1.5 x (subject radius) / tan(fov/2) from S, at height
y = (tallest thing between camera and subject) + 0.30 x D, looking AT S (not at the bounds
- centre, not at the horizon). It must see 2+ zones and >= 20 % of the frame must be content
- rather than empty sky/ground.
+ centre, not at the horizon). It must see 2+ zones and be mostly content rather than empty
+ sky/ground.
- one eye-level camera INSIDE the scene at y = ground + 1.6-1.8 m, aimed along a path or
across the subject so that something within 5 m frames one edge of the shot;
- one detail camera 2-4 m from the hero asset, slightly above its mid height.
@@ -85,7 +85,7 @@ WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
9. `acceptance` — 6 to 12 items covering: each must-have from the brief, the hero assets visible
from the establishing camera, time-of-day lighting reads correctly, the hero motion is visible
between t=0 and t=1.5 s, no floating or sunken assets (`how: probe`), no hard world edge from
- any authored camera, fps >= 30 at 1024x576.
+ any authored camera.
**`priority` matters more than anything else in this list.** ANY unmet `must` item caps the
whole run's score at 0.60, however good the pictures are — one over-specified detail throws
away a passing scene. So:
@@ -106,7 +106,7 @@ WHAT TO PRODUCE (JSON, fields: {{ schema_fields }}):
six interior runs: with no owner for walls and roof, every one was judged "not
enclosed, a diorama on a flat plane" (0.0–0.3) until a refine round built them;
- mark everything else `priority: should` — craft goals, counts, specific patterns, exact
- heights, fps and anything needing evidence the judge may not have;
+ heights and anything needing evidence the judge may not have;
- never write a `must` whose wording contains a number, a named style, or the word "and"
joining two independent claims — split it or demote it.
diff --git a/harness/codeverse3d/prompts/tracks/refine_graphics.j2 b/harness/codeverse3d/prompts/tracks/refine_graphics.j2
index 9b77ad5b..d272d261 100644
--- a/harness/codeverse3d/prompts/tracks/refine_graphics.j2
+++ b/harness/codeverse3d/prompts/tracks/refine_graphics.j2
@@ -37,7 +37,7 @@ Key visuals:
context or clock in a program.
- Motion is judged by comparing frames at t = {{ judge_times }}: a "static" gate warning caps the score at 0.5.
- NaN/Inf pixels cap the score at 0: guard divisions, sqrt/pow/log, normalize, acos/asin.
-- Keep brightness readable (mean luminance ~0.2-0.6), aspect-correct coordinates, tonemap + gamma last.
+- Keep brightness readable (neither near-black nor blown out), aspect-correct coordinates, tonemap + gamma last.
- A "colour/light" change = palette constants / exposure / grade only; a "motion" change = the time terms only;
do not rewrite unrelated layers.
{% if seeded_recipes %}- The harness-owned, read-only `src/recipes.glsl` (pasted above your code at build time) carries VERIFIED
diff --git a/harness/codeverse3d/prompts/tracks/refine_object.j2 b/harness/codeverse3d/prompts/tracks/refine_object.j2
index 9f54c2f8..dbdf36b6 100644
--- a/harness/codeverse3d/prompts/tracks/refine_object.j2
+++ b/harness/codeverse3d/prompts/tracks/refine_object.j2
@@ -36,8 +36,8 @@ Files in scope: {% for f in files %}`{{ f }}`{% if not loop.last %}, {% endif %}
## Acceptance checklist (unchanged)
{{ acceptance }}
-## Detail budget
-{{ detail_budget }}
+## Detail
+{{ detail_advice }}
## Contract reminders
{{ frame_doc }}
diff --git a/harness/codeverse3d/prompts/tracks/repair.j2 b/harness/codeverse3d/prompts/tracks/repair.j2
index 5b4b49b5..e151dda2 100644
--- a/harness/codeverse3d/prompts/tracks/repair.j2
+++ b/harness/codeverse3d/prompts/tracks/repair.j2
@@ -20,7 +20,7 @@ cookbook's copyable snippet instead of patching arguments).
- Lint error (forbidden API, missing entry point, wrong frame/units): replace the construct with the
one the fix hint names; do not argue with the linter.
- Syntax error: fix the syntax at the line; check brackets/indentation in that function only.
-- Geometry bombs (out of memory / timeout): reduce segment counts or loop counts; never exceed 300k tris.
+- Geometry bombs (out of memory / timeout): reduce segment counts or loop counts.
- Keep one code path: no environment sniffing (`typeof window`, `isHeadless`, user agent checks).
Failing file(s): {% for f in failing_files %}`{{ f }}`{% if not loop.last %}, {% endif %}{% endfor %}
diff --git a/harness/codeverse3d/prompts/tracks/scene_asset.j2 b/harness/codeverse3d/prompts/tracks/scene_asset.j2
index 2e115051..6135fd34 100644
--- a/harness/codeverse3d/prompts/tracks/scene_asset.j2
+++ b/harness/codeverse3d/prompts/tracks/scene_asset.j2
@@ -22,7 +22,7 @@ Scene: {{ spec_prompt }}
total size as stated (±5%). One Blender object per plan part, named exactly as the plan says.
- Materials with colours (Principled BSDF base colour), roughness 0.4-0.8 for wood/stone; one
material per material class (wood / iron / cloth …), never one vertex-painted mesh.
-{{ detail_budget }}
+{{ detail_advice }}
- No camera/light/render/export calls.
- MOTION (only when the description names a moving part — a swinging lamp, a turning wheel, a lid
that rocks): keyframe that object's OWN rotation/location over frames 1-48 (24 fps = a 2 s loop,
@@ -57,7 +57,7 @@ Scene: {{ spec_prompt }}
`userData.tick` is never called by anything). Amplitudes must be visible after 1.5 s:
>= 0.10 rad of rotation or >= 0.05 m of travel — not sub-centimetre jitter.
- No DOM, no texture/image loading, no fetch, no imports except `import * as THREE from 'three'`.
-- ≤ 15k triangles per instance; segments 12-24.
+- Segments 12-24.
{% endif %}
## DO / DON'T
diff --git a/harness/codeverse3d/prompts/tracks/scene_env.j2 b/harness/codeverse3d/prompts/tracks/scene_env.j2
index 327bb389..33fd4418 100644
--- a/harness/codeverse3d/prompts/tracks/scene_env.j2
+++ b/harness/codeverse3d/prompts/tracks/scene_env.j2
@@ -84,7 +84,7 @@ The chapters behind these rules are printed in full at the end of this brief
5. **Shadows must not be jagged.** Shadow texel = `2 x shadowSpan / mapSize` <= 0.05 m: fit the
shadow camera to the BOUNDS (not the whole ground), then pick mapSize 2048 (span <= 30 m) /
3072 (<= 60 m) / 4096 (larger). `bias = -0.0004`, `normalBias = 0.02`.
-6. Keep the whole module <= 300 lines; no textures, no 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.
@@ -98,7 +98,7 @@ The chapters behind these rules are printed in full at the end of this brief
{{ tool_cards }}
After editing run `build`, then `scene_views` and LOOK: is the horizon hazy, is the ground
multi-coloured, is the shade coloured rather than black? Read the frame table it prints:
-every authored camera needs mean luminance >= 0.15 with dark <= 35 %.
+every authored camera must pass the exposure checks.
{% endif %}
{% if effects_catalog is defined and effects_catalog %}
diff --git a/harness/codeverse3d/prompts/tracks/scene_refine.j2 b/harness/codeverse3d/prompts/tracks/scene_refine.j2
index 745c5fb0..c8d46172 100644
--- a/harness/codeverse3d/prompts/tracks/scene_refine.j2
+++ b/harness/codeverse3d/prompts/tracks/scene_refine.j2
@@ -44,7 +44,7 @@ Animation: {{ animation }}
- A zone change lives in its `src/zones/<zone>.js` (`export function build(ctx)`, animation on
`group.userData.update`); an asset change in `src/assets/<asset>.js`.
- Console/shader errors: fix the named module; never wrap in try/catch to hide them.
-- Everything rests on `heightAt(x, z)`; nothing floats or sinks > 2 cm; keep fps ≥ 30 (InstancedMesh for repeats).
+- Everything rests on `heightAt(x, z)`; nothing floats or sinks > 2 cm; InstancedMesh for repeats.
- No DOM, no textures, no fetch, no Math.random, no CDN imports.
## The recurring defects on this track and the cookbook chapter that fixes each
diff --git a/harness/codeverse3d/prompts/tracks/scene_zone.j2 b/harness/codeverse3d/prompts/tracks/scene_zone.j2
index 7036e461..23a9a165 100644
--- a/harness/codeverse3d/prompts/tracks/scene_zone.j2
+++ b/harness/codeverse3d/prompts/tracks/scene_zone.j2
@@ -80,14 +80,13 @@ The recipes for all five points below are printed in full at the end of this bri
side, as its foreground frame.
5. **Motion that shows.** Amplitudes from the Recipes table (foliage +/-0.10-0.20 rad, particles
>= 0.6 m per 1.5 s). The harness DIFFERENCES the t=0 and t=1.5 frames pixel by pixel and
- reports the number: anything under **0.4 % of the frame changed** counts as `nothing_moves`
- (-0.05 and the animation criterion). Sub-centimetre sway is invisible at 1024x576. Give this
+ reports the number: too small a change counts as `nothing_moves` (-0.05 and the animation
+ criterion). Sub-centimetre sway is invisible at 1024x576. Give this
zone at least one motion big enough to see across the frame, and everything a pure function of `t`.
-6. Use `InstancedMesh` for anything repeated > 5x; <= 400k triangles and <= 40 draw calls per zone;
- the file stays <= 320 lines.
+6. Use `InstancedMesh` for anything repeated > 5x.
## DON'T
-- No lights except small point lights for lanterns (≤ 4 per zone); no cameras; no sky/ground here.
+- No lights except small point lights for lanterns; no cameras; no sky/ground here.
- No DOM, no textures, no fetch, no Math.random (hash `rand(i)` with an explicit seed).
- Do not import assets marked NOT AVAILABLE; do not edit other files.
{% if tool_cards and not single_shot %}
@@ -98,8 +97,8 @@ After editing run `build` → `check_placement` (it names every asset that float
touches nothing or interpenetrates another, with the exact "lower X by 0.23 m onto Terrain"
fix; a deliberately airborne thing gets `obj.userData.placement = 'free'`) → fix → `build`
again, then `scene_views` and LOOK at the frames: count the silhouettes, look
-for a flat colour under your props, and read the MEASURED MOTION line it prints — if your zone's
-motion is under 0.4 % of the frame, double the amplitude and render again.
+for a flat colour under your props, and read the MEASURED MOTION line it prints — if it reports your
+zone's cameras as STATIC, double the amplitude and render again.
{% endif %}
{% if effects_catalog is defined and effects_catalog %}
diff --git a/harness/codeverse3d/tracks/depth.py b/harness/codeverse3d/tracks/depth.py
index 684fe591..98ebddb4 100644
--- a/harness/codeverse3d/tracks/depth.py
+++ b/harness/codeverse3d/tracks/depth.py
@@ -14,18 +14,18 @@ Measured on the recorded corpus (183 judged rounds / 81 runs, see the wave's
*inside* a part cost nothing. Within one difficulty tier (static_v2 r00) the
sign flips: ``n_built`` vs ``geometry_detail`` = +0.34 — more parts DO buy
detail once difficulty is held constant, they just also buy gate errors.
-3. **The limits handed to the builder are flat and irrelevant.** ``MAX_TRIS_OBJECT``
- is 600 000 against a corpus p50 of ~6 000 and an all-time max of 54 210; build
- timeout 300 s against p50 0.25 s / p99 8.3 s. A 4-part stool and a 25-part
- machine were given the same numbers, so the number said nothing.
+3. **A flat limit says nothing.** ``MAX_TRIS_OBJECT`` is 600 000 against a corpus p50
+ of ~6 000 and an all-time max of 54 210; build timeout 300 s against p50 0.25 s /
+ p99 8.3 s. A 4-part stool and a 25-part machine hit the same numbers.
The *measurement* side of the same question — how much artifact actually got built,
on eight objective axes — is ``codeverse3d/spatial/complexity.py`` + ``eval/docs/COMPLEXITY.md``.
This module is the *target* side: what THIS plan should be allowed and asked to spend.
Hence: :func:`depth_budget` (how many triangles / how much build time this *plan*
-deserves — how many PARTS a prompt deserves is ``tracks.planner.plan_budget``,
-which also owns the thin-plan re-ask), and :func:`scope_groups` (how to split one plan into sessions small
+deserves, checked by :func:`budget_gate` and never printed into a prompt — the prompt
+gets the numberless :data:`DETAIL_ADVICE`; how many PARTS a prompt deserves is
+``tracks.planner.plan_budget``, which also owns the thin-plan re-ask), and :func:`scope_groups` (how to split one plan into sessions small
enough that each part gets real attention) with :func:`interfaces_text` handing
each session the exact numbers of the parts it must touch but may not edit.
"""
@@ -60,43 +60,33 @@ MIN_BUILD_S = 20
class DepthBudget:
"""What THIS object is allowed to spend, sized from its own plan."""
- n_parts: int
n_units: int # parts × instances — the things that actually get built
min_tris: int
target_tris: int
max_tris: int
max_build_s: int
- def as_prompt(self) -> str:
- """The complexity-aware limits block that replaces the contract's flat numbers."""
- return (
- f"DETAIL BUDGET for this object ({self.n_parts} plan parts / {self.n_units} built objects — "
- f"these numbers are sized for THIS plan, not a global cap):\n"
- f"- Triangles: aim for **{self.target_tris:,}** in total ({self.target_tris // max(1, self.n_units):,} "
- f"per built object). Below {self.min_tris:,} the object reads as primitive boxes and the judge scores "
- f"geometry_detail down; above {self.max_tris:,} the build is rejected.\n"
- f"- Spend those triangles INSIDE the parts the plan already names — bevels, chamfers, profile sweeps, "
- f"fasteners, panel seams, arrays — not on new parts the plan does not list. Measured on this harness: "
- f"triangles per part are neutral-to-positive for the score, extra un-planned parts are strongly negative.\n"
- f"- Build time: your code must finish in **under {self.max_build_s} s** headless. Typical objects here "
- f"build in well under a second, so this is generous; if you are near it, lower segment counts before "
- f"you drop detail."
- )
+
+#: What the generate / refine prompts say about detail. No numbers: the triangle and build-time
+#: budget below is enforced by :func:`budget_gate`, never stated to the builder (owner, 2026-09-22).
+DETAIL_ADVICE = (
+ "- Spend detail INSIDE the parts the plan already names — bevels, chamfers, profile sweeps, "
+ "fasteners, panel seams, arrays — not on new parts the plan does not list. Measured on this harness: "
+ "detail inside a part is neutral-to-positive for the score, extra un-planned parts are strongly negative."
+)
def depth_budget(plan: Any, *, build_timeout_s: int = 300) -> DepthBudget:
"""Triangle + build-time budget sized from the plan's part/instance count."""
parts = list(getattr(plan, "parts", None) or [])
- n_parts = len(parts)
n_units = sum(max(1, int(getattr(p, "leaf_count", None) or getattr(p, "instances", 1) or 1)) for p in parts) or 1
target = _clamp(TRIS_PER_UNIT_TARGET * n_units, 6_000, 200_000)
return DepthBudget(
- n_parts=n_parts,
n_units=n_units,
min_tris=_clamp(TRIS_PER_UNIT_FLOOR * n_units, 1_500, 40_000),
target_tris=target,
max_tris=_clamp(TRIS_PER_UNIT_MAX * n_units, 60_000, MAX_TRIS_OBJECT),
- # honest: the subprocess is killed at build_timeout_s, so never promise more than
+ # the subprocess is killed at build_timeout_s, so never allow more than
# that minus the exporter's share, and never less than MIN_BUILD_S
max_build_s=int(_clamp(int(BUILD_S_PER_UNIT * n_units), MIN_BUILD_S, max(MIN_BUILD_S, build_timeout_s - 30))),
)
diff --git a/harness/codeverse3d/tracks/prompting.py b/harness/codeverse3d/tracks/prompting.py
index 425e5e51..2a892dce 100644
--- a/harness/codeverse3d/tracks/prompting.py
+++ b/harness/codeverse3d/tracks/prompting.py
@@ -21,7 +21,14 @@ from codeverse3d.conventions import LANGUAGE_FRAME, frame_doc, to_authoring_fram
from codeverse3d.prompts import render
from codeverse3d.prompts.catalog import language_prompt, language_text
from codeverse3d.tracks.common import RunContext
-from codeverse3d.tracks.depth import DepthBudget, PartScope, depth_budget, fmt3, interfaces_text
+from codeverse3d.tracks.depth import (
+ DETAIL_ADVICE,
+ DepthBudget,
+ PartScope,
+ depth_budget,
+ fmt3,
+ interfaces_text,
+)
from codeverse3d.tracks.generation import SINGLE_SHOT_FORMAT
if TYPE_CHECKING:
@@ -291,7 +298,7 @@ def base_prompt_context(ctx: RunContext, **extra: Any) -> dict[str, Any]:
"acceptance": acceptance_lines(plan),
"entry_files": ", ".join(ctx.runtime.entry_globs),
"n_parts": len(getattr(plan, "parts", []) or []) if plan else 0,
- "detail_budget": detail_budget_text(ctx),
+ "detail_advice": DETAIL_ADVICE if plan and getattr(plan, "parts", None) else "",
"root_link": getattr(plan, "root_link", "") if plan else "",
"reference_note": reference_note(ctx),
# The want -> call table for the effect library that ships in every
@@ -315,13 +322,6 @@ def budget_for(ctx: RunContext) -> DepthBudget:
return b
-def detail_budget_text(ctx: RunContext) -> str:
- """The limits block every generate/refine prompt shows, sized from the plan."""
- if ctx.plan is None or not (getattr(ctx.plan, "parts", None) or ()):
- return ""
- return budget_for(ctx).as_prompt()
-
-
def scope_context(ctx: RunContext, scope: PartScope, **extra: Any) -> dict[str, Any]:
"""Template context for ONE scoped part session: only its parts, plus the exact
numbers of the neighbours it must weld to but may not write."""
diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.md
index d3178cd1..7aee3430 100644
--- a/harness/docs/ARCHITECTURE.md
+++ b/harness/docs/ARCHITECTURE.md
@@ -503,7 +503,7 @@ Best-of-N, refine planning and the asset ladder are sized at run time; they stay
round 0 "baseline": generate → build_with_repair → measure → gates → render → post-render gates → judge
(object tracks, ≥ 8 plan parts, a language with one file per part, an agent backend: the baseline FANS OUT
per part — phase 0 = one scoped session per attachment subtree (its parts + the planned boxes of the
- neighbours it must weld to + the shared detail budget, its own files only), phase 1 = ONE "assemble"
+ neighbours it must weld to + the shared detail advice, its own files only), phase 1 = ONE "assemble"
session that owns the entry file, placement and the connectivity/contract gates. $C3D_SCOPED_PARTS=off
restores the single whole-object session; single-shot always uses it.)
(--candidates N: N parallel baselines in <ws>/_cand/c<k>, quick 4-view judge, crashed candidate retried once,
diff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.md
index bf5c0631..9eda003d 100644
--- a/harness/docs/INTERFACES.md
+++ b/harness/docs/INTERFACES.md
@@ -500,17 +500,17 @@ from codeverse3d.tracks.candidates import run_best_of_n, quick_render # N para
# candidates[])
from codeverse3d.tracks.articulated_object import default_motion_checks, expected_direction # gate "motion_direction"
from codeverse3d.tracks.static_object import silhouette_gate, reference_refine_tasks # gate "reference_silhouette" (IoU<0.6 → WARN + refine task)
-from codeverse3d.tracks.depth import depth_budget, DepthBudget, scope_groups, PartScope, interfaces_text, \
- scoped_generation_enabled # complexity-aware budgets + per-part scoped generation
+from codeverse3d.tracks.depth import depth_budget, DepthBudget, DETAIL_ADVICE, scope_groups, PartScope, \
+ interfaces_text, scoped_generation_enabled # complexity-aware budgets + per-part scoped generation
depth_budget(plan, *, build_timeout_s=300) -> DepthBudget # min/target/max triangles + max_build_s sized from
- # the plan's LEAF count (parts × instances × children); .as_prompt() is the DETAIL BUDGET block every
- # generate/refine template shows in place of a flat "≤ 300k tris"
+ # the plan's LEAF count (parts × instances × children); only budget_gate reads it — no prompt states it.
+ # DETAIL_ADVICE: the numberless "spend detail inside the planned parts" bullet the generate/refine
+ # templates show as {{ detail_advice }}
scope_groups(plan, *, files_for, max_groups=6, parts_per_scope=3, min_parts=8) -> [PartScope]
# [] = one session owns the object (small plan, no per-part file ownership, or $C3D_SCOPED_PARTS=off);
# otherwise attachment-subtree groups whose files are disjoint, so the sessions run in parallel
interfaces_text(plan, scope) -> str # the planned boxes of the neighbours this scope must weld to
-from codeverse3d.tracks.prompting import base_prompt_context, reference_images, scope_context, budget_for, \
- detail_budget_text # Δ split out of
+from codeverse3d.tracks.prompting import base_prompt_context, reference_images, scope_context, budget_for # Δ split out of
from codeverse3d.tracks.prompting import select_cookbook_chapters, is_always_chapter
# select_cookbook_chapters(ctx, brief, *, budget=9000, always=COOKBOOK_ALWAYS) -> list[Section]: the header +
# always-on chapters + the brief's chapters (whole, cookbook order, inside budget)
diff --git a/harness/tests/orchestrator_tracks/test_generation_depth.py b/harness/tests/orchestrator_tracks/test_generation_depth.py
index a467b22a..d48a164b 100644
--- a/harness/tests/orchestrator_tracks/test_generation_depth.py
+++ b/harness/tests/orchestrator_tracks/test_generation_depth.py
@@ -2,10 +2,13 @@
from __future__ import annotations
+import re
+
from codeverse3d.contracts.common import Language
from codeverse3d.contracts.plan import BBox, PartPlan, StaticPlan
from codeverse3d.conventions import MAX_TRIS_OBJECT, to_snake
from codeverse3d.tracks.depth import (
+ DETAIL_ADVICE,
PartScope,
depth_budget,
interfaces_text,
@@ -37,10 +40,8 @@ def test_depth_budget_scales_with_the_plan_and_is_bounded(chair_plan):
parts=[one], acceptance=[])
assert depth_budget(plan).n_units == 4
- text = depth_budget(chair_plan).as_prompt()
- assert "DETAIL BUDGET" in text and "plan parts" in text
- assert f"{depth_budget(chair_plan).target_tris:,}" in text
- assert "not on new parts" in text
+ # the budget is enforced by budget_gate; the prompt's detail advice states no number
+ assert "not on new parts" in DETAIL_ADVICE and not re.search(r"\d", DETAIL_ADVICE)
# ----------------------------------------------------------------------------- scoping
@@ -120,9 +121,9 @@ def test_scoped_baseline_fans_out_and_the_assembly_session_owns_the_entry(tmp_pa
owned = [f for t in parts for f in t.files_hint]
assert len(owned) == len(set(owned)) and "src/object.js" not in owned # file-disjoint, no entry
assert all(t.kind == "baseline" and t.round == 0 for t in tasks)
- # every scoped prompt carries ITS parts, the interface table and the detail budget — not the plan
+ # every scoped prompt carries ITS parts, the interface table and the detail advice — not the plan
one = parts[0]
- assert "Interfaces" in one.prompt and "DETAIL BUDGET" in one.prompt
+ assert "Interfaces" in one.prompt and DETAIL_ADVICE in one.prompt
assert "FILES YOU MAY WRITE" in one.prompt
diff --git a/harness/tests/orchestrator_tracks/test_scene_hero_ladder.py b/harness/tests/orchestrator_tracks/test_scene_hero_ladder.py
index a19bc8be..3426235d 100644
--- a/harness/tests/orchestrator_tracks/test_scene_hero_ladder.py
+++ b/harness/tests/orchestrator_tracks/test_scene_hero_ladder.py
@@ -16,6 +16,7 @@ from codeverse3d.contracts.common import Language, Track
from codeverse3d.contracts.plan import ScenePlan
from codeverse3d.contracts.spec import Constraints
from codeverse3d.tracks import scene_assets as SA
+from codeverse3d.tracks.depth import DETAIL_ADVICE
from codeverse3d.tracks.planner import plan_example
from tests.orchestrator_tracks.conftest import make_spec
from tests.orchestrator_tracks.fakes import (
@@ -83,8 +84,8 @@ def test_hero_prompt_carries_the_scene_and_blenders_own_tools(tmp_ws, settings):
assert f"Scene: {hero.description}" not in job.prompt and "(none)" not in job.prompt.split("## The asset")[0]
# the hero's tools are Blender's (check_contract, cross_section …), not the scene's
assert "CARDS(static_object/blender)" in job.prompt and "CARDS(scene/" not in job.prompt
- # the plan's detail budget, not a flat number; the layout it must fill
- assert "40k" not in job.prompt and "DETAIL BUDGET" in job.prompt
+ # the plan's detail advice and no triangle number; the layout it must fill
+ assert "40k" not in job.prompt and DETAIL_ADVICE in job.prompt and "DETAIL BUDGET" not in job.prompt
# the blender layout: the entry + one file per planned part (the one-part sheet here)
assert job.files_hint == ["src/model.py", f"src/parts/{SA.to_snake(hero.name)}.py"]
assert job.timeout_s <= SA.asset_timeout_s(ctx, 180)