Skip to content

Official Codebase of 3DCodeVerse

Python

cost: profiles stop carrying four fields they never varied; `cost estimate --in N --images K` counts the images

gaoypeng2f95bde5656f
diff --git a/harness/codeverse3d/cli/cost_cmd.py b/harness/codeverse3d/cli/cost_cmd.py
index cdd09af3..fc464bd8 100644
--- a/harness/codeverse3d/cli/cost_cmd.py
+++ b/harness/codeverse3d/cli/cost_cmd.py
@@ -247,11 +247,11 @@ def profiles() -> None:
from codeverse3d.config import get_settings
from codeverse3d.cost.profiles import profile_table
- header = ("profile", "generator", "judge", "shape", "payload", "$/run", "measured quality")
+ 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(6)]
+ 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[:6], widths, strict=True)) + " " + r[6],
+ 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]")
diff --git a/harness/codeverse3d/config.py b/harness/codeverse3d/config.py
index f19f754e..91b6ef71 100644
--- a/harness/codeverse3d/config.py
+++ b/harness/codeverse3d/config.py
@@ -304,8 +304,8 @@ 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,
- # turn cap, montage size and the texture pass together (codeverse3d/cost/profiles.py).
+ # 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 "
@@ -381,9 +381,7 @@ class Settings(BaseSettings):
put("default_judge", p.judge)
put("default_captioner", p.captioner)
put("default_candidates", p.candidates)
- put_section("judge", {"max_px": p.judge_max_px, "montages": p.judge_montages,
- "detail_crops": p.judge_detail_crops, "samples": p.judge_samples})
- put_section("limits", {"agent_max_turns": p.max_turns})
+ put_section("judge", {"samples": p.judge_samples})
return p
def resolve_blender(self) -> str:
diff --git a/harness/codeverse3d/cost/guard.py b/harness/codeverse3d/cost/guard.py
index 2b844063..ed9fc2bd 100644
--- a/harness/codeverse3d/cost/guard.py
+++ b/harness/codeverse3d/cost/guard.py
@@ -68,24 +68,22 @@ def estimate_call(
cached_tokens: int = 0,
prompt: str | Sequence[str] = "",
n_images: int = 0,
- image_px: int = 1024,
n_images_out: int = 0,
- image_out_px: int = 1024,
) -> 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
- ``prompt`` text (plus ``n_images`` vision parts)."""
+ ``prompt`` text, plus ``n_images`` vision parts (1024 px) either way."""
kind, provider, model = normalise_ids("", model_id)
if not provider:
kind, provider, model = normalise_ids(model_id, model_id)
- tokens_in = input_tokens or (text_tokens(prompt) + image_tokens(n_images, px=image_px) if prompt or n_images else 0)
+ tokens_in = (input_tokens or text_tokens(prompt)) + image_tokens(n_images)
cached = max(0, min(cached_tokens, tokens_in))
p_in, p_cached, p_out = unit_prices(provider, model, prompt_tokens=tokens_in)
usd = ((tokens_in - cached) * p_in + cached * p_cached + output_tokens * p_out) / 1e6
if n_images_out:
- usd += n_images_out * per_image_usd(provider, model, size=image_out_px)
+ 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,
diff --git a/harness/codeverse3d/cost/ledger.py b/harness/codeverse3d/cost/ledger.py
index 1805c774..29e9fc72 100644
--- a/harness/codeverse3d/cost/ledger.py
+++ b/harness/codeverse3d/cost/ledger.py
@@ -51,7 +51,7 @@ TELEMETRY_DIR = "telemetry"
TELEMETRY_LEDGER = f"{TELEMETRY_DIR}/cost.jsonl"
#: alias name at the run root: a relative symlink :func:`open_run_ledger` leaves
-#: pointing at the telemetry copy, so ``flywheel.telemetry.live_ledger_path`` and
+#: pointing at the telemetry copy, so ``record.telemetry.live_ledger_path`` and
#: anything that learned this path before the telemetry bucket existed still reads
#: the one physical file.
LEDGER_NAME = "cost_ledger.jsonl"
diff --git a/harness/codeverse3d/cost/profiles.py b/harness/codeverse3d/cost/profiles.py
index 048a4a0b..e96560d5 100644
--- a/harness/codeverse3d/cost/profiles.py
+++ b/harness/codeverse3d/cost/profiles.py
@@ -2,8 +2,8 @@
``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 judge payload, the texture pass and the budget
-ceilings in one consistent move. Mixing knobs by hand is how a run ends up
+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.
@@ -22,7 +22,7 @@ Every number is taken from the measurements in ``docs/COST.md``:
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 field comments below).
+ neither paid (see the note on :class:`Profile`).
* **balanced** — exactly today's defaults (gemini-cli generator, pro judge at
n=1, 4 rounds, no best-of-N, no texture): the arm every number in the audit
was measured on.
@@ -45,7 +45,17 @@ DEFAULT_PROFILE = "balanced"
@dataclass(frozen=True)
class Profile:
- """One coherent setting of the cost/quality dial."""
+ """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)
@@ -57,14 +67,7 @@ class Profile:
rounds: int = 4 # refine rounds after the baseline
candidates: int = 1 # best-of-N baselines
judge_samples: int = 1 # VLM judge samples per verdict
- max_turns: int = 0 # agent turn cap (0 = the backend's own default)
texture: bool = False # run the derived texture pass
- #: judge payload
- judge_max_px: int = 1024 # measured: 768 bills the same and is noisier — see PROFILES
- judge_montages: int = 5 # 14-view rig needs 5 (D47); 3 silently drops the low ring + poles
- judge_detail_crops: int = 2 # one crop ≈ 1,198 input tokens ($0.0024 on the pro judge);
- # NOT reduced by any profile — the score effect is inside the
- # judge's own noise in both directions (docs/COST.md §14)
#: 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``
@@ -86,23 +89,6 @@ PROFILES: dict[str, Profile] = {
judge="gemini:gemini-3.7-flash",
captioner="gemini:gemini-3.7-flash",
rounds=2, candidates=1, judge_samples=2, texture=False,
- # max_turns=0 (2026-08-23): economy's generator is ``single-shot:``, which opens no
- # agent session, so the 20-turn cap this profile used to carry could never fire. And
- # the cap it was modelled on did not survive its own A/B — 3 runs per arm, a 28-turn
- # cap cost $0.02 MORE and 0.205 of a score point (docs/COST.md §17) — so there is no
- # default cap anywhere now. A caller who wants one still has
- # ``Settings.limits.agent_max_turns`` / ``$C3D_AGENT_MAX_TURNS``.
- max_turns=0,
- # 1024 px, not 768: measured on 8 recorded rounds, Gemini bills a montage the same at
- # both sizes (156,834 vs 156,874 input tokens over 16 verdicts) while 768 raised the
- # sampling σ 0.033 → 0.042.
- # detail_crops=2, i.e. the same payload as every other profile. Dropping to 1 crop saves
- # 1,198 input tokens ($0.0024/verdict on pro) and was adopted on a single draw that read
- # 0.595 → 0.600; an independent re-draw of the same round read 0.600 → 0.552, a 0.048
- # swing = 1.6x the pro judge's measured σ (0.030). Two draws that disagree by more than
- # the instrument's noise do not license a payload cut worth a fifth of a cent, so the
- # experiment is recorded as INCONCLUSIVE in docs/COST.md §14 and the budget is unchanged.
- judge_max_px=1024, judge_montages=5, judge_detail_crops=2,
max_minutes=30.0,
expected_usd=0.30,
expected_score="graphics 0.81 median (5/6 passed); objects clear the gates less often "
@@ -116,8 +102,7 @@ PROFILES: dict[str, Profile] = {
planner="gemini:gemini-3.7-flash",
judge="gemini:gemini-3.1-pro-preview",
captioner="gemini:gemini-3.7-flash",
- rounds=4, candidates=1, judge_samples=1, max_turns=0, texture=False,
- judge_max_px=1024, judge_montages=5, judge_detail_crops=2,
+ 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) "
@@ -133,8 +118,7 @@ PROFILES: dict[str, Profile] = {
planner="gemini:gemini-3.7-flash",
judge="gemini:gemini-3.1-pro-preview",
captioner="gemini:gemini-3.7-flash",
- rounds=4, candidates=2, judge_samples=3, max_turns=0, texture=True,
- judge_max_px=1024, judge_montages=5, judge_detail_crops=2,
+ rounds=4, candidates=2, judge_samples=3, texture=True,
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 "
@@ -157,16 +141,13 @@ def get_profile(name: str | None) -> Profile:
return PROFILES[key]
-def profile_table() -> list[tuple[str, str, str, str, str, str, str]]:
- """Rows for ``3dcode cost profiles``: name, generator, judge, shape, montage, $, note."""
+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}" + (
- f", ≤{p.max_turns} turns" if p.max_turns else "")
- rows.append((p.name, p.generator, p.judge, shape,
- f"{p.judge_max_px}px/{p.judge_detail_crops}crop" + (" +texture" if p.texture else ""),
- f"${p.expected_usd:.2f}", p.expected_score))
+ 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
diff --git a/harness/codeverse3d/cost/reconstruct.py b/harness/codeverse3d/cost/reconstruct.py
index 5c052a9a..4cc3a6d6 100644
--- a/harness/codeverse3d/cost/reconstruct.py
+++ b/harness/codeverse3d/cost/reconstruct.py
@@ -390,7 +390,7 @@ def reconstruct_run(run_dir: str | Path, *, recheck: bool = False) -> RunLedger:
# --------------------------------------------------------------------------- compare cells
def reconstruct_cell(cell_dir: str | Path, *, recheck: bool = False) -> RunLedger:
- """A ``bench/compare_backends.py`` one-shot cell (``gen/attempt*`` + ``eval/eval.json``)."""
+ """A ``eval/bench/compare_backends.py`` one-shot cell (``gen/attempt*`` + ``eval/eval.json``)."""
root = Path(cell_dir)
cell = _read_json(root / "cell.json")
run = RunId(battery="", rel=f"{root.parent.name}/{root.name}").slug # <prompt>__<arm>
diff --git a/harness/codeverse3d/cost/routing.py b/harness/codeverse3d/cost/routing.py
index 2e1528e6..f1196387 100644
--- a/harness/codeverse3d/cost/routing.py
+++ b/harness/codeverse3d/cost/routing.py
@@ -3,7 +3,7 @@
Every number in :data:`ROUTES` was measured on this box (see ``docs/COST.md``):
prices from ``models/pricing.py`` (checked 2026-08-23), $/call from the 61
recorded runs, judge noise from ``judges/calibration.py`` (n=3 on the e2e
-rounds), generator quality from ``bench/out/compare_v1_live2``.
+rounds), generator quality from ``eval/bench/out/compare_v1_live2``.
The one non-obvious result: **a noisy cheap judge is not cheap.** Averaging
flash to pro's precision needs ``(σ_flash/σ_pro)²`` samples — and even then it
diff --git a/harness/codeverse3d/orchestrator.py b/harness/codeverse3d/orchestrator.py
index 08b1e7c2..5f694c98 100644
--- a/harness/codeverse3d/orchestrator.py
+++ b/harness/codeverse3d/orchestrator.py
@@ -501,7 +501,7 @@ class RoundPolicy:
# A/B on one prompt (n=3 per arm, same generator/judge/budget) cost $1.381 mean at
# 0.479 mean score capped, against $1.360 at 0.684 uncapped — no saving and −0.205
# score (docs/COST.md §17). 0 = no policy cap: the session runs under the backend's
- # own AgentJob.max_turns. Callers who want one set it explicitly (cost profiles do).
+ # own AgentJob.max_turns. Callers who want one set it explicitly (no cost profile does).
agent_max_turns: int = 0 # 0 = the backend's own AgentJob.max_turns (claude-code 60; the other vendors have no turn cap)
agent_wrapup_turns: int = 6 # turns granted to land a final build + summary when a cap IS set
# ---- depth. Measured (wave "generation-depth"): across 88 consecutive refine-round pairs the
diff --git a/harness/codeverse3d/tracks/generation.py b/harness/codeverse3d/tracks/generation.py
index 6ca4f631..302e37aa 100644
--- a/harness/codeverse3d/tracks/generation.py
+++ b/harness/codeverse3d/tracks/generation.py
@@ -21,8 +21,8 @@ A session cut off mid-task leaves work the next round pays for again.
So there is **no default cap** (``DEFAULT_AGENT_MAX_TURNS`` and
``RoundPolicy.agent_max_turns`` are 0 → the backend's own ``AgentJob.max_turns``).
A caller may still set one (``GenerationTask.max_turns`` > ``generate(max_turns=…)``
-> ``C3D_AGENT_MAX_TURNS`` > ``Settings.limits.agent_max_turns``, which a cost
-profile sets), and a cap that IS set stays **graceful**: the session is not killed
+> ``C3D_AGENT_MAX_TURNS`` > ``Settings.limits.agent_max_turns``; no cost profile
+sets one), and a cap that IS set stays **graceful**: the session is not killed
but asked, in a short wrap-up (``agent_wrapup_turns``), for one last build + summary.
**Every dollar is charged.** Both strategies spend through ``BudgetGuard.charge`` in
@@ -249,8 +249,8 @@ WRAPUP_PROMPT = (
def agent_max_turns(default: int = DEFAULT_AGENT_MAX_TURNS) -> int:
- """The turn cap a machine/profile asks for: ``C3D_AGENT_MAX_TURNS`` >
- ``Settings.limits.agent_max_turns`` (what a cost profile sets) > ``default``.
+ """The turn cap a machine asks for: ``C3D_AGENT_MAX_TURNS`` >
+ ``Settings.limits.agent_max_turns`` > ``default``.
``0`` means *no cap*: the caller leaves ``AgentJob.max_turns`` at the backend's
own default. That is the measured default (docs/COST.md §17)."""
diff --git a/harness/docs/COST.md b/harness/docs/COST.md
index 2bd6ea5a..b97a67b5 100644
--- a/harness/docs/COST.md
+++ b/harness/docs/COST.md
@@ -596,7 +596,7 @@ payload C (14 views + clay, 5 montages + 2 crops) bills **$0.155/verdict at pro
(40.9k input tokens)** against the old 8-view payload's $0.146–0.150/30.0–34.0k — a
+3–6 % price for the only payload change that has survived multiplicity (+0.038
same-cap). The rejected 14-singles arm B cost $0.198 & 67.5k tok/verdict for a
-*negative* delta. Every profile's `judge_montages` is 5 (economy included: the
+*negative* delta. `Settings.judge.montages` is 5 under every profile (economy included: the
flash replica prices a C verdict at ~$0.032, and 3 montages would silently drop the
low ring + poles).
@@ -627,7 +627,7 @@ arm **0.048 lower** — **1.6× the pro judge's measured σ of 0.030** §8, and
than the effect being claimed. Two draws that disagree by more than the
instrument's noise measure nothing.
-**Not adopted.** `judge_detail_crops = 2` in **every** profile, and
+**Not adopted.** No profile carries a crop count, and
`Settings.judge.detail_crops` keeps its default of 2 — the previous image budget,
restored. Buying a fifth of a cent per verdict is not worth a payload change we
cannot show is harmless, and at n=1 per arm the experiment cannot show it: it
@@ -682,8 +682,8 @@ levers measured to raise a score, so they belong to quality.
opens no agent session — the cap could never fire, and no recorded economy run
shows it firing. The cap it was modelled on also lost its own A/B in this wave
(§17: a 28-turn cap cost $0.02 more and 0.205 of a score point over 3 runs per
- arm), so there is no default cap anywhere now: `Profile.max_turns` is 0 in all
- three profiles and `tracks.generation.DEFAULT_AGENT_MAX_TURNS` is 0.
+ arm), so there is no default cap anywhere now: no profile carries a turn cap
+ and `tracks.generation.DEFAULT_AGENT_MAX_TURNS` is 0.
`Settings.limits.agent_max_turns` / `C3D_AGENT_MAX_TURNS` remain the knob for a
run or a machine that wants one by name.
* **economy's 1 detail crop.** §14: two independent draws of the crop experiment
@@ -791,7 +791,7 @@ backend's own default. The plumbing stays for callers who choose one —
`Settings.limits.agent_max_turns` — and a cap that IS set still lands gracefully
(wrap-up session, `generate.turn_cap` event). **Nothing sets one by default any
more**: the profiles independently dropped their own caps in the same wave
-(`cost/profiles.py`, all three at `max_turns=0`), so a cap now only exists when a
+(`cost/profiles.py` carries none), so a cap now only exists when a
run, a bench arm or `$C3D_AGENT_MAX_TURNS` asks for it by name.
### `skip_judge_reason` — two of four branches removed
diff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.md
index df21ac8a..5b612f38 100644
--- a/harness/docs/INTERFACES.md
+++ b/harness/docs/INTERFACES.md
@@ -136,8 +136,8 @@ from codeverse3d.addons.costreport.caching import session_cache, session_key
session_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, Settings.judge
- # (max_px/montages/detail_crops/samples) and limits.agent_max_turns; a value the user stated in
+ # 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,
diff --git a/harness/tests/cost/test_cli.py b/harness/tests/cost/test_cli.py
index b23df20f..d23634d0 100644
--- a/harness/tests/cost/test_cli.py
+++ b/harness/tests/cost/test_cli.py
@@ -35,6 +35,8 @@ def test_cost_prices_and_estimate():
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 "$0.0788" in r.stdout
+ r = runner.invoke(app, ["cost", "estimate", "gemini:gemini-3.7-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
# --------------------------------------------------------------------- the live ledger
diff --git a/harness/tests/cost/test_guard_caching_routing.py b/harness/tests/cost/test_guard_caching_routing.py
index dc1cf2c9..f4a2caa9 100644
--- a/harness/tests/cost/test_guard_caching_routing.py
+++ b/harness/tests/cost/test_guard_caching_routing.py
@@ -23,6 +23,9 @@ def test_estimate_from_text_and_images():
assert est.input_tokens == 1000 + image_tokens(4)
assert est.usd == pytest.approx((est.input_tokens * 2.0 + 2000 * 12.0) / 1e6)
assert text_tokens(["ab" * 2, "cd" * 2]) == 2
+ # a token count and images add up: `cost estimate --in 12000 --images 8` dropped the images
+ est = 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():
diff --git a/harness/tests/cost/test_profiles.py b/harness/tests/cost/test_profiles.py
index fb48a23d..3b946d3a 100644
--- a/harness/tests/cost/test_profiles.py
+++ b/harness/tests/cost/test_profiles.py
@@ -30,11 +30,6 @@ def test_the_three_profiles_are_a_monotone_dial():
assert usd == sorted(usd) and usd[0] < usd[-1]
rounds = [PROFILES[n].rounds for n in PROFILE_NAMES]
assert rounds == sorted(rounds)
- # the judge payload is NOT part of the dial: two independent draws of the
- # 2-crop vs 1-crop experiment disagreed by 0.048 = 1.6x the pro judge's σ,
- # so no profile trades a fifth of a cent for that (docs/COST.md §14)
- assert {PROFILES[n].judge_detail_crops for n in PROFILE_NAMES} == {2}
- assert {PROFILES[n].judge_max_px for n in PROFILE_NAMES} == {1024}
assert PROFILES["quality"].candidates == 2 and PROFILES["quality"].texture is True
assert PROFILES["economy"].texture is False and PROFILES["economy"].candidates == 1
# every profile explains itself and cites what it was measured at
@@ -47,7 +42,7 @@ def test_balanced_is_todays_defaults():
s = Settings()
assert (p.generator, p.planner, p.judge) == (s.default_generator, s.default_planner, s.default_judge)
assert p.rounds == 4 and p.candidates == s.default_candidates and p.judge_samples == 1
- assert p.max_minutes == 60.0 and p.judge_max_px == 1024
+ assert p.max_minutes == 60.0
def test_a_value_the_user_configured_survives_the_profile_unless_forced():
@@ -77,6 +72,16 @@ def test_one_stated_judge_field_does_not_disable_the_whole_judge_block(monkeypat
get_settings.cache_clear()
+def test_no_profile_touches_the_judge_payload_or_the_turn_cap(monkeypatch):
+ """Neither cut paid when measured (docs/COST.md §14, §17), so they are not dials: even
+ `--profile X`, which forces the dial, leaves a stated payload and turn cap 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_applying_a_profile_twice_is_idempotent():
"""Profile defaults do not masquerade as user-stated fields."""
s = Settings()