Official Codebase of 3DCodeVerse
Python
skills: one falsifiable claim per bundle, and the command that reads it out
gaoypengeb625543d750
diff --git a/harness/bench/skill_targets.py b/harness/bench/skill_targets.pynew file mode 100644index 00000000..d4d7e987--- /dev/null+++ b/harness/bench/skill_targets.py@@ -0,0 +1,419 @@+"""Per-skill deterministic readout: what each bundle claims to move, measured.++``bench/ab_gate_rates.py`` prints the gate numbers of an A/B run; it does not know which+*skill* owns which number. This does. ``codeverse/skills/targets.py`` holds one+falsifiable claim per bundle; this file computes it over a recorded battery or an A/B+directory, so the same command answers both "what is the baseline" and "did the variant+move it".++Usage::++ python bench/skill_targets.py bench/out/static_v2_flash # one battery+ python bench/skill_targets.py bench/out/ab_skills # control vs variant+ python bench/skill_targets.py bench/out --per-run --skill cv3d-part-contact+ python bench/skill_targets.py bench/out --json++Nothing here reads the judge. Every number comes from a gate report, a BuildResult, the+exported GLB or the sampled frames — the readouts that do not carry the planner's variance+(``docs/EVAL.md`` §8.1).+"""++from __future__ import annotations++import argparse+import contextlib+import json+import re+import statistics+import sys+from dataclasses import dataclass+from pathlib import Path+from typing import Any++sys.path.insert(0, str(Path(__file__).resolve().parents[1]))++from codeverse.skills.registry import finding_kind # noqa: E402+from codeverse.skills.targets import ( # noqa: E402+ SRC_ARTIFACT,+ SRC_BUILD,+ SRC_FRAMES,+ SRC_GATE,+ SRC_GLB,+ TARGETS,+ Target,+)++CACHE_NAME = ".skill_targets_cache.json"+_FRAME_T = re.compile(r"_t(\d+(?:\.\d+)?)\.png$")+++# --------------------------------------------------------------------------- runs+@dataclass(frozen=True)+class Run:+ """One recorded run: the record, and the directory its artefacts sit in."""++ key: str+ label: str+ path: Path+ record: dict[str, Any]++ @property+ def dir(self) -> Path:+ return self.path.parent++ @property+ def language(self) -> str:+ return str((self.record.get("spec") or {}).get("language") or "")++ @property+ def rounds(self) -> list[dict]:+ return list(self.record.get("rounds") or [])++ def gated_round(self, which: str = "last") -> dict | None:+ gated = [r for r in self.rounds if r.get("gates")]+ if not gated:+ return None+ return gated[0] if which == "first" else gated[-1]++ def render_dir(self, rd: dict) -> Path | None:+ """The round's render directory, resolved inside THIS tree.++ ``record.json`` stores absolute paths from the machine that produced it, so a+ moved or copied corpus would read nothing; the canonical layout is authoritative+ and the stored path is only the fallback for a layout we have not seen.+ """+ cand = self.dir / "artifacts" / "renders" / f"r{int(rd.get('index', 0)):02d}"+ if cand.is_dir():+ return cand+ for v in (rd.get("renders") or {}).get("views") or []:+ p = Path(str(v.get("path") or ""))+ if p.is_file():+ return p.parent+ return None+++def load_runs(root: Path) -> list[Run]:+ out: list[Run] = []+ for rec in sorted(root.rglob("record.json")):+ try:+ data = json.loads(rec.read_text())+ except (OSError, json.JSONDecodeError):+ continue+ out.append(Run(key=_key_of(rec, root), label=str(rec.parent.relative_to(root)),+ path=rec, record=data))+ return out+++def _key_of(rec: Path, root: Path) -> str:+ """A stable prompt id: the cell/run directory name, not the whole path."""+ parts = rec.relative_to(root).parts+ for anchor in ("cells", "runs"):+ if anchor in parts:+ return parts[parts.index(anchor) + 1]+ return parts[0] if parts else rec.parent.name+++def ab_arms(root: Path) -> dict[str, Path] | None:+ """``{arm: dir}`` when *root* is an A/B directory, else None."""+ arms = root / "arms"+ if (arms / "control").is_dir() and (arms / "variant").is_dir():+ return {"control": arms / "control", "variant": arms / "variant"}+ return None+++# --------------------------------------------------------------------------- metrics+def count_kinds(rd: dict, kinds: tuple[str, ...], severities: tuple[str, ...]) -> int:+ n = 0+ for g in rd.get("gates") or []:+ for f in g.get("findings") or []:+ sev = str(f.get("severity", "warn")).lower()+ if severities and sev not in severities:+ continue+ if finding_kind(str(g.get("gate", "")), str(f.get("message", "")), sev) in kinds:+ n += 1+ return n+++def _frames_of(d: Path) -> list[tuple[float, Path]]:+ out = []+ for p in sorted(d.glob("frame_t*.png")):+ m = _FRAME_T.search(p.name)+ if m:+ out.append((float(m.group(1)), p))+ return sorted(out)+++def _feature_density(glb: Path) -> float | None:+ from codeverse.spatial.complexity import complexity_of_glb++ try:+ return float(complexity_of_glb(glb).feature_density)+ except Exception:+ return None+++def _mean_edge_density(d: Path) -> float | None:+ from codeverse.spatial.frame_stats import sequence_stats++ frames = _frames_of(d)+ if not frames:+ return None+ try:+ return float(sequence_stats([(t, p) for t, p in frames]).mean_edge_density)+ except Exception:+ return None+++def _min_authored_changed_frac(d: Path) -> float | None:+ from codeverse.spatial.frame_motion import motion_from_dir++ try:+ rows = [r for r in motion_from_dir(d) if r.authored]+ except Exception:+ return None+ return min((float(r.changed_frac) for r in rows), default=None)+++def _shader_preflight_findings(run: Run) -> float | None:+ """``artifacts/shader_preflight.json`` — written beside the run, not into the record."""+ p = run.dir / "artifacts" / "shader_preflight.json"+ if not p.is_file():+ return None+ try:+ rep = json.loads(p.read_text())+ except (OSError, json.JSONDecodeError):+ return None+ return float(sum(1 for f in rep.get("findings") or []+ if str(f.get("severity", "")).lower() in ("warn", "error")))+++def measure(target: Target, run: Run, *, which: str = "last",+ cache: dict[str, Any] | None = None) -> float | None:+ """The target's value for one run, or None when it does not apply / has no artefact."""+ if target.languages and run.language not in target.languages:+ return None+ if target.source == SRC_GATE:+ rd = run.gated_round(which)+ return None if rd is None else float(count_kinds(rd, target.kinds, target.severities))+ if target.source == SRC_BUILD:+ builds = [r.get("build") for r in run.rounds if isinstance(r.get("build"), dict)]+ if not builds:+ return None+ return sum(0.0 if b.get("ok") else 1.0 for b in builds) / len(builds)+ if target.source == SRC_ARTIFACT:+ return None if run.gated_round(which) is None else _shader_preflight_findings(run)++ key = f"{target.metric}:{run.path}:{which}"+ if cache is not None and key in cache:+ v = cache[key]+ return None if v is None else float(v)+ val = _measure_heavy(target, run, which)+ if cache is not None:+ cache[key] = val+ return val+++def _measure_heavy(target: Target, run: Run, which: str) -> float | None:+ # every source shares one population: a run the gates actually reported on. Without+ # this a GLB-derived metric would also count concurrency probes and e2e smoke runs+ # that no gate graded, and its n would not compare with the gate-derived rows.+ rd = run.gated_round(which)+ if rd is None:+ return None+ if target.source == SRC_GLB:+ glb = run.dir / "artifacts" / "object.glb"+ return _feature_density(glb) if glb.is_file() else None+ if target.source == SRC_FRAMES:+ d = run.render_dir(rd)+ if d is None:+ return None+ if target.metric == "mean_edge_density":+ return _mean_edge_density(d)+ if target.metric == "min_authored_changed_frac":+ return _min_authored_changed_frac(d)+ return None+++# --------------------------------------------------------------------------- reporting+def _stats(vals: list[float]) -> dict[str, float | int]:+ return {"n": len(vals), "mean": statistics.fmean(vals), "median": statistics.median(vals),+ "min": min(vals), "max": max(vals), "zero": sum(1 for v in vals if v == 0)}+++def battery_rows(runs: list[Run], targets: list[Target], *, which: str,+ cache: dict | None, languages: tuple[str, ...] = ()) -> list[dict[str, Any]]:+ rows = []+ if languages:+ runs = [r for r in runs if r.language in languages]+ for t in targets:+ vals, per_run = [], {}+ for r in runs:+ v = measure(t, r, which=which, cache=cache)+ if v is not None:+ vals.append(v)+ per_run[r.label] = v+ row: dict[str, Any] = {"skill": t.skill, "metric": t.metric, "direction": t.direction,+ "unit": t.unit, "measurable": t.measurable, "per_run": per_run}+ row.update(_stats(vals) if vals else {"n": 0})+ rows.append(row)+ return rows+++def _best(runs: list[Run]) -> Run:+ """One cell can hold several attempts (``...flash.attempt1``) after a provider outage.++ The graded one is the one to pair: an attempt that never reached a gate is the+ provider failing, not the arm, and ``_infra`` already excludes those cells.+ """+ return max(runs, key=lambda r: (len(r.rounds), str(r.path)))+++def _by_key(root: Path, languages: tuple[str, ...]) -> dict[str, Run]:+ out: dict[str, list[Run]] = {}+ for r in load_runs(root):+ if not languages or r.language in languages:+ out.setdefault(r.key, []).append(r)+ return {k: _best(v) for k, v in out.items()}+++def ab_rows(arms: dict[str, Path], targets: list[Target], *, which: str,+ cache: dict | None, languages: tuple[str, ...] = ()) -> list[dict[str, Any]]:+ by_arm = {arm: _by_key(d, languages) for arm, d in arms.items()}+ rows = []+ for t in targets:+ pairs, dropped = [], []+ for key in sorted(set(by_arm["control"]) | set(by_arm["variant"])):+ c = v = None+ if key in by_arm["control"]:+ c = measure(t, by_arm["control"][key], which=which, cache=cache)+ if key in by_arm["variant"]:+ v = measure(t, by_arm["variant"][key], which=which, cache=cache)+ if c is not None and v is not None:+ pairs.append((key, c, v))+ elif c is not None or v is not None:+ dropped.append(key)+ row: dict[str, Any] = {"skill": t.skill, "metric": t.metric, "direction": t.direction,+ "unit": t.unit, "measurable": t.measurable,+ "n": len(pairs), "half_paired": dropped,+ "pairs": [{"prompt": k, "control": c, "variant": v}+ for k, c, v in pairs]}+ if pairs:+ deltas = [v - c for _, c, v in pairs]+ better = sum(1 for d in deltas if (d < 0) == (t.direction == "down") and d != 0)+ worse = sum(1 for d in deltas if d != 0) - better+ control_mean = statistics.fmean(c for _, c, _ in pairs)+ row.update({"control_mean": control_mean,+ "variant_mean": statistics.fmean(v for _, _, v in pairs),+ "mean_delta": statistics.fmean(deltas),+ "better": better, "worse": worse, "tied": len(deltas) - better - worse})+ row.update(confidence(deltas, control_mean))+ rows.append(row)+ return rows+++def confidence(deltas: list[float], control_mean: float, effect: float = 0.25) -> dict[str, Any]:+ """Paired sd, the 2 SE band, and how many pairs a given effect would need.++ Same shape as the Confidence block ``bench/ab_plan.py`` prints for the judged score+ (docs/EVAL.md §8), because the question is the same one and the answer is not: a+ deterministic count has its own sd and it is NOT zero. ``effect`` is the fraction of+ the control mean that counts as a real move.+ """+ if len(deltas) < 2:+ return {"sd": None, "se": None, "ci95": None, "n_to_resolve": None}+ sd = statistics.stdev(deltas)+ se = sd / len(deltas) ** 0.5+ want = abs(control_mean) * effect+ n = None if not want or not sd else max(2, int(round((2 * sd / want) ** 2)))+ return {"sd": sd, "se": se, "ci95": 2 * se, "n_to_resolve": n,+ "resolvable_effect": want}+++def _fmt(v: Any, width: int = 8) -> str:+ if v is None:+ return "-".rjust(width)+ return (f"{v:.3f}" if isinstance(v, float) else str(v)).rjust(width)+++def print_battery(rows: list[dict], per_run: bool) -> None:+ print(f"{'skill':<28} {'metric':<28} {'dir':<5} {'n':>4} {'mean':>8} {'median':>8} "+ f"{'min':>8} {'max':>8} {'=0':>4}")+ for r in rows:+ flag = "" if r["measurable"] else " (measurable=false: guard only)"+ print(f"{r['skill']:<28} {r['metric']:<28} {r['direction']:<5} {r['n']:>4} "+ f"{_fmt(r.get('mean'))} {_fmt(r.get('median'))} {_fmt(r.get('min'))} "+ f"{_fmt(r.get('max'))} {_fmt(r.get('zero'), 4)}{flag}")+ if per_run:+ for k, v in sorted(r.get("per_run", {}).items()):+ print(f" {k:<40} {v:.3f}")+++def print_ab(rows: list[dict], per_run: bool) -> None:+ print(f"{'skill':<28} {'metric':<28} {'dir':<5} {'n':>4} {'control':>9} {'variant':>9} "+ f"{'delta':>9} b/w/t {'sd':>8} {'+/-2SE':>8} n to resolve 25%")+ for r in rows:+ if not r["n"]:+ print(f"{r['skill']:<28} {r['metric']:<28} {r['direction']:<5} 0 (no paired run)")+ continue+ flag = "" if r["measurable"] else " (guard only)"+ print(f"{r['skill']:<28} {r['metric']:<28} {r['direction']:<5} {r['n']:>4} "+ f"{_fmt(r['control_mean'], 9)} {_fmt(r['variant_mean'], 9)} {_fmt(r['mean_delta'], 9)}"+ f" {r['better']}/{r['worse']}/{r['tied']} {_fmt(r.get('sd'))} {_fmt(r.get('ci95'))}"+ f" {r.get('n_to_resolve') if r.get('n_to_resolve') is not None else '-':>6}{flag}")+ if r["half_paired"]:+ print(f"{'':<28} one arm only, dropped: {', '.join(r['half_paired'])}")+ if per_run:+ for p in r["pairs"]:+ print(f" {p['prompt']:<40} {p['control']:>8.3f} -> {p['variant']:>8.3f}")+++def main(argv: list[str] | None = None) -> int:+ ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])+ ap.add_argument("out", type=Path, help="a battery dir, an A/B dir (arms/control+variant), or bench/out")+ ap.add_argument("--skill", action="append", default=[], help="limit to this bundle (repeatable)")+ ap.add_argument("--round", choices=("first", "last"), default="last",+ help="which gated round to read (default last, as ab_gate_rates does)")+ ap.add_argument("--language", action="append", default=[],+ help="limit to runs in this language (repeatable)")+ ap.add_argument("--per-run", action="store_true", help="also print every run / pair")+ ap.add_argument("--json", action="store_true", help="machine-readable")+ ap.add_argument("--no-cache", action="store_true", help="do not read/write the GLB+frame cache")+ a = ap.parse_args(argv)++ if not a.out.is_dir():+ ap.error(f"{a.out} is not a directory")+ targets = [t for t in TARGETS if not a.skill or t.skill in a.skill]+ if not targets:+ ap.error(f"no such skill: {a.skill}")++ cache_path = a.out / CACHE_NAME+ cache: dict[str, Any] | None = None+ if not a.no_cache:+ try:+ cache = json.loads(cache_path.read_text()) if cache_path.is_file() else {}+ except (OSError, json.JSONDecodeError):+ cache = {}++ langs = tuple(a.language)+ arms = ab_arms(a.out)+ if arms:+ rows = ab_rows(arms, targets, which=a.round, cache=cache, languages=langs)+ else:+ rows = battery_rows(load_runs(a.out), targets, which=a.round, cache=cache, languages=langs)++ if cache is not None:+ with contextlib.suppress(OSError):+ cache_path.write_text(json.dumps(cache))++ if a.json:+ print(json.dumps({"out": str(a.out), "mode": "ab" if arms else "battery",+ "round": a.round, "rows": rows}, indent=1))+ elif arms:+ print_ab(rows, a.per_run)+ else:+ print_battery(rows, a.per_run)+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/harness/codeverse/cli/skills_cmd.py b/harness/codeverse/cli/skills_cmd.pyindex cf23925d..2e4bdff9 100644--- a/harness/codeverse/cli/skills_cmd.py+++ b/harness/codeverse/cli/skills_cmd.py@@ -30,18 +30,29 @@ def _root(ctx: typer.Context) -> None:def list_skills(routes: Annotated[bool, typer.Option("--routes", help="show the rules that can attach each skill")] = False,) -> None:- """Every bundle in the library, with its evidence label and body size."""+ """Every bundle in the library, with its evidence label, body size and its ONE claim.++ ``target`` is the deterministic quantity the bundle says it moves (docs/SKILLS_LEDGER.md);+ ``dir`` is the direction that counts as an improvement, and a ``?`` marks a bundle whose+ claim no deterministic instrument can see. Read them out with+ ``python bench/skill_targets.py bench/out``.+ """from rich.table import Tablefrom codeverse.skills import iter_skillsfrom codeverse.skills.registry import ROUTED_SKILLS, ROUTES+ from codeverse.skills.targets import target_forfound = list(iter_skills())t = Table(title="3dcv skills")- for col in ("name", "evidence", "verified", "lines", "~tokens", "refs", *(["routes"] if routes else [])):+ for col in ("name", "evidence", "verified", "lines", "~tokens", "refs", "target", "dir",+ *(["routes"] if routes else [])):t.add_column(col)for s in found:- row = [s.name, s.evidence, s.verified, str(s.body_lines), str(s.body_tokens), str(len(s.references))]+ tg = target_for(s.name)+ row = [s.name, s.evidence, s.verified, str(s.body_lines), str(s.body_tokens), str(len(s.references)),+ tg.metric if tg else "[red]none[/]",+ ("" if not tg else tg.direction if tg.measurable else f"{tg.direction} ?")]if routes:row.append(",".join(r.rule for r in ROUTES if r.skill == s.name))t.add_row(*row)diff --git a/harness/codeverse/skills/cv3d-bbox-contract/SKILL.md b/harness/codeverse/skills/cv3d-bbox-contract/SKILL.mdindex 3ebd5a98..cb7c42fe 100644--- a/harness/codeverse/skills/cv3d-bbox-contract/SKILL.md+++ b/harness/codeverse/skills/cv3d-bbox-contract/SKILL.md@@ -6,6 +6,11 @@ metadata:evidence: measuredverified: "2026-08-25"corpus: bench/out, 142 graded records with gate artefacts, recomputed 2026-08-25+ target_metric: "contract_findings"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "1.51 mean / 1.0 median findings per run; n=167 (bench/out, last gated round, 2026-08-25); 1.23 on the first gated round"---# The plan's numbers are the contractdiff --git a/harness/codeverse/skills/cv3d-blender-forms/SKILL.md b/harness/codeverse/skills/cv3d-blender-forms/SKILL.mdindex b910fde2..9b911a9b 100644--- a/harness/codeverse/skills/cv3d-blender-forms/SKILL.md+++ b/harness/codeverse/skills/cv3d-blender-forms/SKILL.md@@ -7,6 +7,11 @@ metadata:evidence: measuredverified: "2026-08-25"corpus: "102 graded blender runs + 23 urdf_blender runs with gate artefacts, mined 2026-08-25"+ target_metric: "blender_lint_findings"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "0.87 mean / 0.0 median findings per run; n=164 (bench/out, last gated round, 2026-08-25); blender 1.01, urdf_blender 0.00"---# Shapes to bpy, and the traps the lint countsdiff --git a/harness/codeverse/skills/cv3d-cadquery-forms/SKILL.md b/harness/codeverse/skills/cv3d-cadquery-forms/SKILL.mdindex 3da9924f..ab33f295 100644--- a/harness/codeverse/skills/cv3d-cadquery-forms/SKILL.md+++ b/harness/codeverse/skills/cv3d-cadquery-forms/SKILL.md@@ -7,6 +7,11 @@ metadata:evidence: inherited-unverifiedevidence_note: 'Every kernel rule below was probed against the CadQuery 2.8.0 installed in this repo on 2026-08-25 and cross-checked with the cadquery lint, the run_cq wrapper and the language contract. What is NOT available is score evidence. This harness has ZERO graded cadquery bench runs, so nothing here is ranked by measured defect frequency the way the blender and urdf bundles are. Routed off by default until cadquery has 20 graded runs.'verified: "2026-08-25"+ target_metric: "build_failure_rate"+ target_direction: "down"+ target_unit: "fraction of rounds whose build failed"+ target_measurable: "true"+ target_baseline: "none: n=0, bench/out holds no graded cadquery run (2026-08-25)"---# CadQuery: forms, and the kernel rules that gate themdiff --git a/harness/codeverse/skills/cv3d-form-manifest/SKILL.md b/harness/codeverse/skills/cv3d-form-manifest/SKILL.mdindex f7432c7f..01e260c8 100644--- a/harness/codeverse/skills/cv3d-form-manifest/SKILL.md+++ b/harness/codeverse/skills/cv3d-form-manifest/SKILL.md@@ -8,6 +8,11 @@ metadata:verified: "2026-08-25"corpus: "bench/out/*/runs/* graded records, recomputed 2026-08-25"pairs_with: "cv3d-blender-forms, cv3d-cadquery-forms, cv3d-threejs-forms, cv3d-part-contact"+ target_metric: "feature_density"+ target_direction: "up"+ target_unit: "small sharp edges per unit surface (spatial/complexity)"+ target_measurable: "true"+ target_baseline: "2551 median / 7946 mean; n=164 (bench/out, last gated round, 2026-08-25); right-skewed, read the median"---# Form manifest — name the shapes before you name an APIdiff --git a/harness/codeverse/skills/cv3d-glsl-craft/SKILL.md b/harness/codeverse/skills/cv3d-glsl-craft/SKILL.mdindex 913e29ef..34e3c678 100644--- a/harness/codeverse/skills/cv3d-glsl-craft/SKILL.md+++ b/harness/codeverse/skills/cv3d-glsl-craft/SKILL.md@@ -8,6 +8,11 @@ metadata:evidence_note: "Gate thresholds and rubric weights are read from live code (spatial/frame_stats.py, judges/rubrics/shader_v1.yaml). The corpus is thin: 9 graded glsl_shader runs, so every count below names its n and no rate is generalised."verified: "2026-08-25"corpus: "9 graded glsl_shader runs (18 judged rounds) + 5 opengl_python runs, mined 2026-08-25"+ target_metric: "mean_edge_density"+ target_direction: "up"+ target_unit: "mean edge density over the 5 sampled frames (frame_stats)"+ target_measurable: "true"+ target_baseline: "0.167 median / 0.203 mean edge density; n=9 (bench/out, last gated round, 2026-08-25); range 0.031-0.464"---# What separates a graded shader from a demodiff --git a/harness/codeverse/skills/cv3d-opengl-pipeline/SKILL.md b/harness/codeverse/skills/cv3d-opengl-pipeline/SKILL.mdindex 07b3b708..a353f071 100644--- a/harness/codeverse/skills/cv3d-opengl-pipeline/SKILL.md+++ b/harness/codeverse/skills/cv3d-opengl-pipeline/SKILL.md@@ -7,6 +7,11 @@ metadata:evidence: mixedevidence_note: 'Thin but real, and labelled so in the body. 5 graded opengl_python runs across graphics_v1_flash and graphics_v2_flash, 10 judged rounds, recomputed 2026-08-25. The API facts come from the runtime wrapper and the lint, not from the corpus.'verified: "2026-08-25"+ target_metric: "gl_frame_findings"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "0.20 mean / 0.0 median findings per run; n=5 (bench/out, last gated round, 2026-08-25); 4 of 5 at zero"---# The moderngl pipeline, and the two things that actually sink these runsdiff --git a/harness/codeverse/skills/cv3d-part-contact/SKILL.md b/harness/codeverse/skills/cv3d-part-contact/SKILL.mdindex c497d557..64697b59 100644--- a/harness/codeverse/skills/cv3d-part-contact/SKILL.md+++ b/harness/codeverse/skills/cv3d-part-contact/SKILL.md@@ -7,6 +7,11 @@ metadata:evidence: measuredverified: "2026-08-25"corpus: "142 graded runs with gate artefacts (102 blender, 23 urdf_blender), mined 2026-08-25"+ target_metric: "interpenetrating_pairs"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "3.35 mean / 2.0 median findings per run; n=164 (bench/out, last gated round, 2026-08-25); 5.07 on the first gated round"---# Parts that touchdiff --git a/harness/codeverse/skills/cv3d-repeats-and-mirrors/SKILL.md b/harness/codeverse/skills/cv3d-repeats-and-mirrors/SKILL.mdindex 9022fb58..777af4c7 100644--- a/harness/codeverse/skills/cv3d-repeats-and-mirrors/SKILL.md+++ b/harness/codeverse/skills/cv3d-repeats-and-mirrors/SKILL.md@@ -8,6 +8,11 @@ metadata:verified: "2026-08-25"corpus: "217 run records / 2,121 gate reports under bench/out, mined 2026-08-25"owns: "contract/instance_bbox, contract/instance_count"+ target_metric: "contract_instance_findings"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "0.32 mean / 0.0 median findings per run; n=164 (bench/out, last gated round, 2026-08-25); 132 of 164 runs already at zero"---# Repeats, mirrors and arraysdiff --git a/harness/codeverse/skills/cv3d-scene-composition/SKILL.md b/harness/codeverse/skills/cv3d-scene-composition/SKILL.mdindex 30627561..04c707b2 100644--- a/harness/codeverse/skills/cv3d-scene-composition/SKILL.md+++ b/harness/codeverse/skills/cv3d-scene-composition/SKILL.md@@ -8,6 +8,11 @@ metadata:evidence_note: "Gate thresholds, score caps and the backdrop classifier are read from live code (spatial/frame_metrics.py, judges/rubrics/scene_v1.yaml, runtime_js/lib/backdrop.mjs, runtime_js/lib/scene_host.mjs). The corpus behind them is thin: only 3 graded scene runs exist, so every count below names its n."verified: "2026-08-25"corpus: "3 graded scene_threejs runs with gate artefacts, mined 2026-08-25"+ target_metric: "camera_placement_findings"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "0.00 findings per run; n=3 (bench/out, last gated round, 2026-08-25); 0.33 on the first gated round, so the repair loop already clears it"---# Composing a scene the instruments can readdiff --git a/harness/codeverse/skills/cv3d-scene-lighting/SKILL.md b/harness/codeverse/skills/cv3d-scene-lighting/SKILL.mdindex 031abf10..5efafb4a 100644--- a/harness/codeverse/skills/cv3d-scene-lighting/SKILL.md+++ b/harness/codeverse/skills/cv3d-scene-lighting/SKILL.md@@ -7,6 +7,11 @@ metadata:evidence: mixedevidence_note: 'Thresholds and renderer settings are read from live code, namely spatial/frame_metrics.py and runtime_js/lib/browser/renderer.js, and the luminance figures are computed from those settings. The corpus half is thin and labelled as such, being 4 scene_threejs runs in scenes_v1_flash mined 2026-08-25, so it is quoted as examples and never as a rate.'verified: "2026-08-25"+ target_metric: "dark_or_flat_frames"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "1.00 mean / 1.0 median findings per run; n=3 (bench/out, last gated round, 2026-08-25); 2.67 on the first gated round"---# Lighting a scene the frame gate will acceptdiff --git a/harness/codeverse/skills/cv3d-scene-motion/SKILL.md b/harness/codeverse/skills/cv3d-scene-motion/SKILL.mdindex 64c27027..57159a29 100644--- a/harness/codeverse/skills/cv3d-scene-motion/SKILL.md+++ b/harness/codeverse/skills/cv3d-scene-motion/SKILL.md@@ -8,6 +8,11 @@ metadata:evidence_note: "The mechanism, thresholds and hook are read from live code (spatial/frame_motion.py, spatial/frame_metrics.py, runtime_js/lib/scene_host.mjs) and are exact. The corpus behind them is thin: 3 graded scene runs / 8 judged rounds on scenes_v1_flash, 2026-08-23. Where a number is from that battery it says so."verified: "2026-08-25"pairs_with: "cv3d-scene-composition, cv3d-scene-lighting, cv3d-threejs-shader-traps"+ target_metric: "min_authored_changed_frac"+ target_direction: "up"+ target_unit: "fraction of pixels changed on the WEAKEST authored camera, t=0 → t=1.5 s"+ target_measurable: "false"+ target_baseline: "0.006 median / 0.017 mean on the weakest authored camera; n=3 (bench/out, 2026-08-25). The gate needs only ONE authored camera over the 0.4 pct bar, so a run whose establishing shot is frozen at 0.13 pct still passes - which is why this is a guard, not a target"---# Motion the harness can measurediff --git a/harness/codeverse/skills/cv3d-threejs-forms/SKILL.md b/harness/codeverse/skills/cv3d-threejs-forms/SKILL.mdindex 50f2aeb4..535b5f77 100644--- a/harness/codeverse/skills/cv3d-threejs-forms/SKILL.md+++ b/harness/codeverse/skills/cv3d-threejs-forms/SKILL.md@@ -8,6 +8,11 @@ metadata:evidence_note: "Zero graded threejs bench runs exist (bench/out/*/runs/*, checked 2026-08-25); the only recorded threejs run is runs/e2e_bench_threejs. Every API claim here is verified against codeverse/prompts/threejs/contract.md, codeverse/prompts/threejs/cookbook.md, codeverse/languages/threejs/lint.py and runtime_js/package.json, but the ADVICE has not been A/B'd on our corpus. Routed off unless CV3D_SKILLS_UNVERIFIED=on; upgrade to measured when threejs reaches 20 graded runs."verified: "2026-08-25"pairs_with: "cv3d-form-manifest, cv3d-part-contact, cv3d-bbox-contract"+ target_metric: "missing_parts"+ target_direction: "down"+ target_unit: "findings per run"+ target_measurable: "true"+ target_baseline: "none: n=0, bench/out holds no graded threejs run (2026-08-25)"---# FORM to three.jsdiff --git a/harness/codeverse/skills/cv3d-threejs-shader-traps/SKILL.md b/harness/codeverse/skills/cv3d-threejs-shader-traps/SKILL.mdindex 84e84eb0..658eebe3 100644--- a/harness/codeverse/skills/cv3d-threejs-shader-traps/SKILL.md+++ b/harness/codeverse/skills/cv3d-threejs-shader-traps/SKILL.md@@ -8,6 +8,11 @@ metadata:evidence_note: "Every rule is read from the live runtime_js source and cross-checked against the shader_report merge path. Incidence is NOT measured: bench/out holds 4 scene_threejs runs, and all 4 shader_preflight reports are clean INFO (10, 9, 14 and 11 programs compiled; 1-12 custom materials). The corpus therefore supports the detection map, not a defect rate."verified: "2026-08-25"owns: "shader/compile_or_binding"+ target_metric: "shader_preflight_findings"+ target_direction: "down"+ target_unit: "WARN+ERROR findings per run"+ target_measurable: "true"+ target_baseline: "0.00 findings per run; n=3 (bench/out, 2026-08-25) - every recorded scene run is clean, so there is no headroom to improve, only a regression to catch"---# three.js shader traps that this harness actually detectsdiff --git a/harness/codeverse/skills/cv3d-urdf-joints/SKILL.md b/harness/codeverse/skills/cv3d-urdf-joints/SKILL.mdindex 0255fa3b..84db9f95 100644--- a/harness/codeverse/skills/cv3d-urdf-joints/SKILL.md+++ b/harness/codeverse/skills/cv3d-urdf-joints/SKILL.md@@ -9,6 +9,11 @@ metadata:corpus: "26 urdf_blender runs / 50 judged rounds under bench/out, mined 2026-08-25"owns: "joint_sweep, motion_direction"scope: "URDF physical structure only; SRDF semantics are out of scope and must not be invented"+ target_metric: "joint_sweep_errors"+ target_direction: "down"+ target_unit: "ERROR findings per run"+ target_measurable: "true"+ target_baseline: "6.91 mean / 0.0 median ERRORs per run; n=23 (bench/out, last gated round, 2026-08-25); 20 of 23 at zero, worst run 101"---# URDF joints: axes, limits and clearance across the sweepdiff --git a/harness/codeverse/skills/registry.py b/harness/codeverse/skills/registry.pyindex 77ec7b5d..455e6a4c 100644--- a/harness/codeverse/skills/registry.py+++ b/harness/codeverse/skills/registry.py@@ -72,7 +72,8 @@ _RULES: tuple[tuple[str, str, str], ...] = (("motion_direction", r"WRONG", MOTION_WRONG_AXIS),("scene_frames", r"too dark|flat frame", SCENE_DARK_OR_FLAT),("scene_frames", r"BELOW the ground|inside / touching geometry", SCENE_CAMERA_PLACEMENT),- ("gl_frames", r"frame-to-frame|visual detail", GL_MOTION_OR_DETAIL),+ ("gl_frames", r"frame-to-frame|visual detail|do not change over time"+ r"|essentially black|blown out|NaN/Inf|no frames were rendered", GL_MOTION_OR_DETAIL),("detail_drift", r"moved|resized|removed|added", DETAIL_DRIFT),("render_console", r"frame rate|error", RUNTIME_SLOW),("shader_preflight", r".", SHADER_COMPILE_OR_BINDING),diff --git a/harness/codeverse/skills/targets.py b/harness/codeverse/skills/targets.pynew file mode 100644index 00000000..176ec942--- /dev/null+++ b/harness/codeverse/skills/targets.py@@ -0,0 +1,266 @@+"""What each bundle CLAIMS to move — one deterministic quantity per skill.++WHY this file exists. A library you cannot measure per-skill is one you can only+maintain by taste. ``metadata.evidence`` says where a bundle's *prose* came from;+nothing said what the bundle is supposed to *do* to a run, in a number a machine can+recompute. This is that: one row per bundle, naming the quantity, the direction, and+the gate kinds (``skills.registry``) or artefact it is read out of.++Three rules the rows obey:++* **Deterministic only.** Every row is read from a gate report, a build result or a+ measured artefact — never from the judge. An 8-prompt A/A of the judged score gave+ paired sd 0.202 and needs ~408 paired prompts to resolve +0.02 (``docs/EVAL.md`` §8);+ a skills A/B read out on ``score`` at n=8 is a coin toss. These do not carry that+ variance.+* **One owner per quantity.** ``contract/instance_bbox`` belongs to+ ``cv3d-repeats-and-mirrors``, so ``cv3d-bbox-contract``'s row excludes it. Two+ bundles sharing a metric means an A/B cannot say which one moved it.+* **``measurable=False`` is a finding, not a gap.** A bundle whose claim no+ deterministic instrument can see says so here rather than borrowing a judged+ criterion and calling it evidence.++``bench/skill_targets.py`` is the readout; ``tests/skills/test_targets.py`` pins the+rows against the live gate vocabulary and against each bundle's own frontmatter.+"""++from __future__ import annotations++from dataclasses import dataclass, field++#: the direction that counts as an improvement+DOWN = "down"+UP = "up"+DIRECTIONS = (DOWN, UP)++#: where the readout gets the number+SRC_GATE = "gate_kinds" #: count findings of `kinds` in the last gated round+SRC_BUILD = "build" #: the round's BuildResult+SRC_GLB = "glb" #: recomputed from the exported object.glb+SRC_FRAMES = "frames" #: recomputed from the round's sampled frames+SRC_ARTIFACT = "artifact" #: a gate report written beside the run, not into the record+SOURCES = (SRC_GATE, SRC_BUILD, SRC_GLB, SRC_FRAMES, SRC_ARTIFACT)+++@dataclass(frozen=True)+class Target:+ """One bundle's falsifiable claim."""++ skill: str+ metric: str+ direction: str+ unit: str+ source: str+ why: str+ #: gate kinds (skills.registry slugs) counted when ``source == SRC_GATE``+ kinds: tuple[str, ...] = ()+ #: severities that count; empty == every actionable (non-INFO) finding+ severities: tuple[str, ...] = ()+ #: languages the metric is defined over; empty == every language+ languages: tuple[str, ...] = field(default_factory=tuple)+ #: False when no deterministic instrument can see the bundle's claim+ measurable: bool = True+ caveat: str = ""++ @property+ def frontmatter(self) -> dict[str, str]:+ """The rows a bundle must carry under ``metadata`` (spec-legal string values)."""+ return {"target_metric": self.metric,+ "target_direction": self.direction,+ "target_unit": self.unit,+ "target_measurable": "true" if self.measurable else "false"}+++OBJECT_LANGS = ("blender", "urdf_blender", "cadquery", "threejs")++TARGETS: tuple[Target, ...] = (+ Target(+ skill="cv3d-part-contact",+ metric="interpenetrating_pairs",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("connectivity/interpenetration",),+ languages=OBJECT_LANGS,+ why="the plain count of penetrating pairs is the strongest single predictor of "+ "assembly_fit (r = -0.258, docs/COMPLEXITY.md §6) and the bundle exists to lower it",+ ),+ Target(+ skill="cv3d-bbox-contract",+ metric="contract_findings",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("contract/part_bbox", "contract/overall_bbox", "contract/footprint_offset",+ "contract/ground_gap", "contract/scene_bounds"),+ languages=(*OBJECT_LANGS, "scene_threejs"),+ why="the bundle is the contract gate's own tolerance arithmetic: a part that IS there "+ "and is the wrong size or in the wrong place",+ caveat="two contract kinds are deliberately somebody else's. contract/instance_* is "+ "cv3d-repeats-and-mirrors; contract/missing_part is a part that never reached the "+ "GLB at all, which is a language-API failure (cv3d-threejs-forms owns it for "+ "threejs; for blender its upstream signal is lint/part_not_imported, counted by "+ "cv3d-blender-forms) rather than a tolerance failure.",+ ),+ Target(+ skill="cv3d-repeats-and-mirrors",+ metric="contract_instance_findings",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("contract/instance_bbox", "contract/instance_count"),+ languages=OBJECT_LANGS,+ why="metadata.owns already names these two kinds; they are the whole claim",+ ),+ Target(+ skill="cv3d-form-manifest",+ metric="feature_density",+ direction=UP,+ unit="small sharp edges per unit surface (spatial/complexity)",+ source=SRC_GLB,+ languages=OBJECT_LANGS,+ why="of the four complexity axes only feature_density correlates with geometry_detail "+ "(+0.19); part count (-0.25) and triangles (-0.05) do not, which is the bundle's thesis",+ caveat="a leading indicator, not the outcome: r = +0.19 against the judged criterion "+ "(docs/COMPLEXITY.md §2.2, n=44). Recomputed from object.glb, not stored in the record.",+ ),+ Target(+ skill="cv3d-blender-forms",+ metric="blender_lint_findings",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("lint/api_trap", "lint/part_not_imported"),+ languages=("blender", "urdf_blender"),+ why="the bundle is written around the five bpy traps the static lint already counts",+ ),+ Target(+ skill="cv3d-urdf-joints",+ metric="joint_sweep_errors",+ direction=DOWN,+ unit="ERROR findings per run",+ source=SRC_GATE,+ kinds=("joint_sweep/link_overlap", "joint_sweep/disconnected"),+ severities=("error",),+ languages=("urdf_blender",),+ why="metadata.owns names joint_sweep; 653 of 691 sweep findings in the corpus are "+ "moved-pose ERRORs, which is exactly what the clearance rule targets",+ ),+ Target(+ skill="cv3d-cadquery-forms",+ metric="build_failure_rate",+ direction=DOWN,+ unit="fraction of rounds whose build failed",+ source=SRC_BUILD,+ languages=("cadquery",),+ why="the bundle's own framing is 'the kernel rules that decide whether the script "+ "builds at all'; an OCC kernel refusal is a build failure, not a gate finding",+ caveat="no baseline exists: bench/out holds zero graded cadquery runs.",+ ),+ Target(+ skill="cv3d-threejs-forms",+ metric="missing_parts",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("contract/missing_part",),+ languages=("threejs",),+ why="the bundle's distinct claim is the traps that make a threejs part silently ship "+ "nothing (bevel_depth 0, no computeVertexNormals); the contract gate calls that a missing part",+ caveat="no baseline exists: bench/out holds zero graded threejs runs.",+ ),+ Target(+ skill="cv3d-scene-composition",+ metric="camera_placement_findings",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("scene_frames/camera_placement",),+ languages=("scene_threejs",),+ why="cameras below ground or inside geometry are arithmetic failures, and the bundle's "+ "whole method is deriving them from measured bounds",+ caveat="frame coverage (content_frac) is the bundle's other half and registry.py "+ "classifies no kind for it, so it is not in this count.",+ ),+ Target(+ skill="cv3d-scene-lighting",+ metric="dark_or_flat_frames",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("scene_frames/dark_or_flat",),+ languages=("scene_threejs",),+ why="the bundle is the exposure thresholds of frame_metrics.py restated with a recipe; "+ "the gate counts exactly the frames it failed to light",+ ),+ Target(+ skill="cv3d-scene-motion",+ metric="min_authored_changed_frac",+ direction=UP,+ unit="fraction of pixels changed on the WEAKEST authored camera, t=0 → t=1.5 s",+ source=SRC_FRAMES,+ languages=("scene_threejs",),+ measurable=False,+ why="reported as a regression guard only",+ caveat="NOT a target. The bundle says so itself: re-measuring all 8 recorded rounds, every "+ "authored camera cleared the 0.4 % bar by 5-12x while animation_life averaged 0.431. "+ "The claim is per-plan-item ('the water and the leaves are static'), and no "+ "deterministic instrument attributes motion to a named plan item. Raising this "+ "number is not evidence the bundle worked; a drop below MOVING_FRAC still is a "+ "regression worth catching.",+ ),+ Target(+ skill="cv3d-threejs-shader-traps",+ metric="shader_preflight_findings",+ direction=DOWN,+ unit="WARN+ERROR findings per run",+ source=SRC_ARTIFACT,+ kinds=("shader/compile_or_binding",),+ languages=("scene_threejs", "threejs"),+ why="metadata.owns names shader/compile_or_binding; every trap the bundle teaches lands "+ "in the one shader_preflight report",+ caveat="zero headroom in today's corpus: all 4 recorded scene runs are clean, so this can "+ "only detect a regression until a battery makes it fire. shader_preflight is written "+ "beside the run (artifacts/shader_preflight.json) and is NOT merged per-round into "+ "the record, so only the run's final state is readable.",+ ),+ Target(+ skill="cv3d-glsl-craft",+ metric="mean_edge_density",+ direction=UP,+ unit="mean edge density over the 5 sampled frames (frame_stats)",+ source=SRC_FRAMES,+ languages=("glsl_shader",),+ why="the gl_frames gate fired zero findings on all 9 graded glsl runs, so its finding "+ "count has no headroom; edge density is the continuous quantity that gate thresholds "+ "and the quantity its own fix hint asks the agent to raise",+ ),+ Target(+ skill="cv3d-opengl-pipeline",+ metric="gl_frame_findings",+ direction=DOWN,+ unit="findings per run",+ source=SRC_GATE,+ kinds=("gl_frames/motion_or_detail",),+ languages=("opengl_python",),+ why="every gl_frames finding in the whole graphics corpus (3 flicker, 1 low detail) came "+ "from opengl_python, and flicker is trap 1 (a sampled solver) showing up in pixels",+ ),+)++BY_SKILL: dict[str, Target] = {t.skill: t for t in TARGETS}+METRICS: frozenset[str] = frozenset(t.metric for t in TARGETS)+++def target_for(skill: str) -> Target | None:+ return BY_SKILL.get(skill)+++def gate_kinds_claimed() -> frozenset[str]:+ """Every registry kind some row counts — what test_targets checks is still live."""+ return frozenset(k for t in TARGETS for k in t.kinds)+++__all__ = ["BY_SKILL", "DIRECTIONS", "DOWN", "METRICS", "SOURCES", "SRC_ARTIFACT", "SRC_BUILD",+ "SRC_FRAMES", "SRC_GATE", "SRC_GLB", "TARGETS", "UP", "Target", "gate_kinds_claimed",+ "target_for"]diff --git a/harness/docs/SKILLS.md b/harness/docs/SKILLS.mdindex 9026c0ca..fec79768 100644--- a/harness/docs/SKILLS.md+++ b/harness/docs/SKILLS.md@@ -125,6 +125,14 @@ Fourteen bundles. `lines`/`tokens` are the body, against caps of 350 and 2,500.| `cv3d-cadquery-forms` | any | cadquery | **inherited-unverified** | 82 | 1,470 | R10 || `cv3d-threejs-forms` | static_object | threejs | **inherited-unverified** | 120 | 1,934 | R11 |+Every bundle also declares **one deterministic quantity it claims to move**, in its own+frontmatter (`target_metric`, `target_direction`, `target_baseline`) and in+`codeverse/skills/targets.py`. `python bench/skill_targets.py bench/out` prints them all —+per battery or paired across an A/B's two arms — and **`docs/SKILLS_LEDGER.md` is the row-by-row+maintenance surface**: baseline, graded-run count, and what each bundle owes before it can be+called earned. `evidence` says where the prose came from; the target says what the bundle is+for.+`evidence` is a claim about **n**, and `tests/skills/test_corpus.py` recomputes it from`bench/out`:@@ -504,7 +512,13 @@ chose to go deeper" (§1).format = "{:.0f} mm"```4. Add its rows to `ROUTES` in `codeverse/skills/registry.py`, in the same commit.-5. `3dcv skills validate --strict` and `pytest tests/skills`.+5. Add a `Target` row to `codeverse/skills/targets.py` and the matching `target_*` keys to+ the frontmatter — the ONE deterministic quantity the bundle claims to move, its+ direction, and its baseline from `python bench/skill_targets.py bench/out`. If no+ deterministic instrument can see the claim, say so with `measurable=False` and a+ `caveat`: that is a finding about the bundle, not a gap to paper over with a judged+ criterion. Then add its row to `docs/SKILLS_LEDGER.md`.+6. `3dcv skills validate --strict` and `pytest tests/skills`.Body rules: ≤ 350 lines and ≤ 2,500 tokens; no code fence over 20 lines; never restate aframe, unit or naming rule (`conventions.py` owns those); every corpus percentage carriesdiff --git a/harness/docs/SKILLS_LEDGER.md b/harness/docs/SKILLS_LEDGER.mdnew file mode 100644index 00000000..8b7f2bd5--- /dev/null+++ b/harness/docs/SKILLS_LEDGER.md@@ -0,0 +1,161 @@+# Skills ledger — what each bundle claims, and whether it is earning its place++A skill library you cannot measure per-skill is one you can only maintain by taste. This is+the maintenance surface: **one row per bundle**, naming the single deterministic quantity it+claims to move, the direction, the number it has to beat, and what it owes before it can be+called earned.++Three files hold it up:++| file | what it is |+|---|---|+| `codeverse/skills/targets.py` | the table — one `Target` row per bundle |+| `bench/skill_targets.py` | the readout — one command, battery **or** A/B |+| `tests/skills/test_targets.py` | the pins — the rows exist, the gate kinds are still live, the frontmatter agrees, the readout counts what the row says |++Each bundle carries its own row in `metadata` (`target_metric`, `target_direction`,+`target_unit`, `target_measurable`, `target_baseline`), so the claim travels with the skill+to any CLI that reads the bundle, and `tests/skills/test_freshness.py` fails the day the+metric stops existing.++```+python bench/skill_targets.py bench/out # every baseline, whole corpus+python bench/skill_targets.py bench/out/static_v2_flash # one battery+python bench/skill_targets.py bench/out/ab_skills # control vs variant, paired+python bench/skill_targets.py bench/out --language blender --round first+python bench/skill_targets.py bench/out --skill cv3d-part-contact --per-run --json+```++---++## 1. Why these are gate numbers and not scores++An 8-prompt A/A of `bench/ab_plan.py` put the paired sd of the judged score at **0.202**,+the 2 SE band at ±0.165, and printed *~408 paired prompts to resolve +0.02*+(`docs/EVAL.md` §8). A skills A/B read out on `score` at n=8 is a coin toss. Every row below+is read from a gate report, a `BuildResult`, the exported GLB or the sampled frames — never+from the judge.++That does **not** make them noiseless. The same A/A directory (`bench/out/plan_loop/C0`,+3 pairs usable after the provider weather) reads out like this:++```+skill metric n control variant delta b/w/t sd ±2SE n to resolve 25%+cv3d-part-contact interpenetrating_pairs 3 5.667 11.333 +5.667 0/2/1 8.963 10.349 160+cv3d-bbox-contract contract_findings 3 1.000 1.000 0.000 2/1/0 1.732 2.000 192+cv3d-form-manifest feature_density 3 2095.733 6000.467 +3904.733 3/0/0 3057.62 3530.63 136+```++Two arms that were **identical by construction** moved interpenetrating pairs by +5.7. So:++* the deterministic readout is much cheaper than the judged score but still needs three+ figures of paired prompts *unless the plan is pinned* — and `C0` predates+ `bench/pin_plan.py`, which is exactly the term that swing is;+* `CV3D_SKILLS*` sits in `GENERATION_SIDE_ENV`, so `pin_plan_blockers({"CV3D_SKILLS": "1"})`+ is empty and **a skills A/B is pinnable**. Pin it. Every number in §3 assumes it;+* n=3 makes those sd's indicative, not trustworthy. **The first job of the Measure phase is+ to re-read this block on an A/A with ≥8 usable pairs and a pinned plan**, per metric.++---++## 2. The ledger++Baselines are the **last gated round** of every run under `bench/out` that a gate reported+on, recomputed 2026-08-25 (`python bench/skill_targets.py bench/out`). "graded n" is that+language's graded-run count as `tests/skills/test_corpus.py` counts it: blender 141,+urdf_blender 23, glsl_shader 9, opengl_python 5, scene_threejs 3, cadquery 0, threejs 0.++| bundle | evidence | target metric | dir | baseline (last round) | graded n | status | to graduate |+|---|---|---|---|---|---|---|---|+| **cv3d-part-contact** | measured | `interpenetrating_pairs` | down | **3.35** mean / 2.0 median, n=164 (5.07 first round; 65 runs already at 0) | 164 | **earning — measure it** | a pinned-plan A/B moving the mean down with more prompts better than worse |+| **cv3d-bbox-contract** | measured | `contract_findings` | down | **1.51** mean / 1.0 median, n=167 (1.23 first round) | 167 | **earning — measure it** | same, on the non-instance contract kinds |+| **cv3d-repeats-and-mirrors** | measured | `contract_instance_findings` | down | **0.32** mean / 0.0 median, n=164; **132 of 164 already at 0** | 164 | **probation — thin defect** | a battery slice where the metric is non-zero often enough to have headroom (prompts with `instances > 1`), then an A/B on that slice |+| **cv3d-form-manifest** | measured | `feature_density` | up | **2551** median / 7946 mean, n=164 | 164 | **probation — weak link** | it is a *leading* indicator: r = +0.19 against the judged `geometry_detail` (`docs/COMPLEXITY.md` §2.2, n=44). Show the metric moves AND that the criterion follows, or the row is measuring the wrong thing |+| **cv3d-blender-forms** | measured | `blender_lint_findings` | down | **0.87** mean / 0.0 median, n=164 (blender 1.01, urdf_blender 0.00); **133 of 164 at 0** | 164 | **probation — thin defect** | the lint already catches these, so most runs never had the defect. Either show the A/B lowers the remaining 31, or accept that the bundle's real value is the form table, which this metric does not see |+| **cv3d-urdf-joints** | measured | `joint_sweep_errors` | down | **6.91** mean / 0.0 median ERRORs, n=23; 20 of 23 at 0, worst run 101 | 23 | **earning — measure it** | extremely heavy-tailed: three runs carry every error. Pair on prompts with >1 movable joint or the mean is noise |+| **cv3d-cadquery-forms** | inherited-unverified | `build_failure_rate` | down | **none — n=0** | **0** | **routed OFF; unmeasurable today** | 20 graded cadquery runs. Until then no A/B can be run and the bundle stays out of routing (design §5.2 law 3) |+| **cv3d-threejs-forms** | inherited-unverified | `missing_parts` | down | **none — n=0** | **0** | **routed OFF; unmeasurable today** | 20 graded threejs runs |+| **cv3d-scene-composition** | mixed | `camera_placement_findings` | down | **0.00**, n=3 (0.33 on the first gated round) | 3 | **probation — no headroom** | the repair loop already clears every camera fault by the last round. Read it out on the **first** gated round (`--round first`), where the bundle is supposed to act, and get scene runs past n=3 |+| **cv3d-scene-lighting** | mixed | `dark_or_flat_frames` | down | **1.00** mean / 1.0 median, n=3 (2.67 first round) | 3 | **probation — thin corpus** | real headroom (2 of 3 runs still fail on the last round) but n=3. Needs a scene battery of ≥8 prompts |+| **cv3d-scene-motion** | mixed | `min_authored_changed_frac` | up | 0.006 median / 0.017 mean, n=3 (one run's establishing shot is frozen at 0.0013 and the gate still passes) | 3 | **UNMEASURABLE (`measurable=false`)** | see §4 — nothing deterministic sees this bundle's claim. Do not A/B it on this number |+| **cv3d-threejs-shader-traps** | mixed | `shader_preflight_findings` | down | **0.00**, n=3 — every recorded scene run is clean | 3 | **probation — no headroom** | the gate has never fired here, so today this can only catch a regression. Needs a battery whose plans actually author custom GLSL. Also owes an instrumentation fix: `shader_preflight` is written to `artifacts/shader_preflight.json` and never merged per-round into `record.json`, so only a run's final state is readable |+| **cv3d-glsl-craft** | mixed | `mean_edge_density` | up | **0.167** median / 0.203 mean, n=9 (range 0.031–0.464) | 9 | **earning — measure it** | the widest continuous spread of any row, so it is the cheapest graphics A/B we have. Confirm the judged `visual_richness` follows |+| **cv3d-opengl-pipeline** | mixed | `gl_frame_findings` | down | **0.20** mean / 0.0 median, n=5; 4 of 5 at 0 | 5 | **probation — thin corpus** | n=5 and one finding. The bundle's headline defect (trap 1: a solver that gets five steps) shows up in the judge's words, not yet in a gate |++**Read at a glance:** 4 bundles are ready to A/B on their own number today+(`part-contact`, `bbox-contract`, `urdf-joints`, `glsl-craft`). 7 are on probation for a+thin corpus or a floor-effect. 2 are routed off with zero graded runs. 1 has no honest+deterministic proxy at all.++---++## 3. What "graduate" means++A bundle is **earning** when all four hold:++1. **Routable** — its language has ≥20 graded runs, so `metadata.evidence` may say+ `measured` (the rule `tests/skills/test_corpus.py` already enforces).+2. **Read** — the backend actually opens it. `read_skill` (`agents/api_skills.py`) records+ exactly which bundles were opened; measured 2026-08-25 api-agent opened 2 of 3 routed+ bundles, against 0 of 5 before the tool existed, and the three CLI backends read 5 of 5.+ **A bundle nobody opens cannot have an effect — check the read rate before spending on an+ effect A/B.**+3. **Headroom** — its target metric is non-zero on enough of the battery to move. A row+ where most runs already read 0 fails here, and the fix is a prompt slice, not a bigger n.+4. **Moved** — a pinned-plan A/B (`bench/pin_plan.py`) on ≥ the row's `n to resolve` pairs+ moves the metric in the stated direction, with more prompts better than worse.++A bundle that fails (3) or (4) after a fair A/B **gets cut**. Cutting a skill that does not+earn its tokens is a win for the wave, not a failure — the plan-loop's C1 was reverted and+the whole skills A/B shipped OFF on the same reasoning.++---++## 4. The one bundle with no honest proxy++`cv3d-scene-motion` is marked `measurable=false`, and its own body is the evidence.++* The deterministic instrument is `spatial/frame_motion.py`: a camera counts as moving when+ ≥0.4 % of its pixels change between t=0 s and t=1.5 s, and `scene_frames` emits a+ `no_motion` ERROR when no authored camera does.+* `scene_moves` is an **any**, not an **all**: one authored camera over the bar clears the+ gate for the whole scene. Re-measured 2026-08-25, `scn_easy_desert_canyon` ships an+ establishing shot frozen at **0.13 %** — well under the bar — in both of its rounds, and+ the gate passes anyway because two other cameras move. The bundle's own body reports the+ matching fact from the other side: the *best* authored camera cleared the bar by 5–12× in+ all 8 recorded rounds while `animation_life` averaged **0.431 — the lowest criterion of+ any language in the corpus.**+* The judge's reasons are per item: *"the planned animations for water and falling leaves+ are completely static"*. `tracks/scene.py::judge_context` hands the judge the plan's+ `animation` list verbatim and it is scored **item by item**.++No deterministic instrument attributes motion to a *named plan item*, so any number we could+put here would be a proxy we invented to have one. Raising `min_authored_changed_frac` is not+evidence the bundle worked. It is still printed, and still worth watching: a drop below the+0.4 % bar is a regression the gate would fire on.++Building the honest instrument — per-item motion, by masking the plan's animated objects and+diffing only those pixels — is the way this bundle becomes measurable, and it is a harness+change, not a skill change.++---++## 5. Instrumentation gaps this wave found++* **`gl_frames` classified only 2 of its 7 actionable messages.** `R19`/`R24` say *"the frame+ gate saw no motion or no detail"*, but `registry.py` matched only `frame-to-frame` and+ `visual detail` — a shader that came out **static**, **black**, **blown out**, **NaN** or+ that rendered **no frames** classified as `None` and routed nothing. Widened, with a+ parametrised pin in `tests/skills/test_targets.py`. No baseline moves: the four recorded+ `gl_frames` findings were all flicker/low-detail already.+* **`shader_preflight` never reaches the record.** It is written to+ `artifacts/shader_preflight.json` beside the run, so the readout can only see a run's final+ state, not per-round. It should be merged into `rounds[].gates` like every other gate.+* **`scene_frames/content_*` has no classified kind.** Frame coverage (`content_frac`) is+ half of what `cv3d-scene-composition` teaches and `registry.finding_kind` returns `None`+ for it, so it neither routes nor counts. Deliberately left alone here — adding a kind+ widens routing, which is an effect claim and needs its own evidence.+* **`connectivity` and `contract` carry no `data["kind"]`**, unlike every gate written since.+ `registry.finding_kind()` is the classifier that fills the gap, which is why the readout+ goes through it rather than reading `data` — but the two oldest and busiest gates are the+ ones relying on message regexes.diff --git a/harness/tests/skills/test_freshness.py b/harness/tests/skills/test_freshness.pyindex ea0926db..b6cce52f 100644--- a/harness/tests/skills/test_freshness.py+++ b/harness/tests/skills/test_freshness.py@@ -246,3 +246,23 @@ def test_a_constant_a_body_names_is_also_pinned_by_a_claim(s):assert unpinned == [], (f"{s.name} names {unpinned} in prose but pins no claim to it — add a "f"[[claim]] row to skills/_claims/{s.name}.toml")++[email protected]("s", SKILLS, ids=[s.name for s in SKILLS])+def test_the_target_metric_a_bundle_declares_is_still_one_we_read_out(s):+ """The fifth vocabulary: a bundle's own falsifiable claim.++ ``metadata.target_metric`` is the quantity ``bench/skill_targets.py`` prints for this+ bundle. If the row is renamed or dropped, the frontmatter keeps promising a number+ nothing computes, and the next A/B reads a silent zero as "no effect".+ """+ from codeverse.skills.targets import METRICS, target_for++ metric = s.metadata.get("target_metric", "")+ assert metric, (+ f"{s.name}: metadata.target_metric is missing — every bundle owes one deterministic "+ f"claim (docs/SKILLS_LEDGER.md)")+ assert metric in METRICS, (+ f"{s.name} declares target_metric {metric!r}, which skills/targets.py no longer defines")+ row = target_for(s.name)+ assert row is not None and row.metric == metricdiff --git a/harness/tests/skills/test_targets.py b/harness/tests/skills/test_targets.pynew file mode 100644index 00000000..4ac1f585--- /dev/null+++ b/harness/tests/skills/test_targets.py@@ -0,0 +1,302 @@+"""Every bundle's ONE deterministic claim: that it exists, that it is still readable,+and that the readout counts what the row says it counts.++WHY this file. ``metadata.evidence`` says where a bundle's prose came from. Nothing+said what the bundle is supposed to DO to a run in a number a machine can recompute, so+a bundle that stopped earning its tokens looked exactly like one that never had.+``codeverse/skills/targets.py`` names the quantity and ``bench/skill_targets.py`` reads+it out; this pins the two together and to the live gate vocabulary.++The rows are deliberately checked against ``skills.registry`` rather than a copy: a gate+reword that changes a slug must fail HERE, where the readout would otherwise start+silently counting zero and a later A/B would read "no effect".+"""++from __future__ import annotations++import json+import re+import sys+from pathlib import Path++import pytest+import yaml++from codeverse.skills import bundle_dirs, iter_skills, skills_dir+from codeverse.skills.registry import ROUTED_SKILLS, finding_kind+from codeverse.skills.targets import (+ BY_SKILL,+ DIRECTIONS,+ METRICS,+ SOURCES,+ SRC_GATE,+ TARGETS,+ gate_kinds_claimed,+ target_for,+)++HARNESS = Path(__file__).resolve().parents[2]+sys.path.insert(0, str(HARNESS))++BUNDLES = bundle_dirs()+SKILLS = list(iter_skills()) if BUNDLES else []+pytestmark = pytest.mark.skipif(not BUNDLES, reason=f"no bundles in {skills_dir()} yet")+++def _live_kinds() -> set[str]:+ from codeverse.skills import registry++ return {v for k, v in vars(registry).items()+ if k.isupper() and isinstance(v, str) and "/" in v}+++def _frontmatter(d: Path) -> dict:+ text = (d / "SKILL.md").read_text(encoding="utf-8")+ m = re.match(r"\A---[ \t]*\r?\n(.*?)\r?\n---[ \t]*\r?\n", text, re.S)+ assert m, f"{d.name}: no frontmatter"+ return (yaml.safe_load(m.group(1)) or {}).get("metadata") or {}+++# --------------------------------------------------------------------------- the table[email protected]("s", SKILLS, ids=[s.name for s in SKILLS])+def test_every_shipped_bundle_has_exactly_one_target(s):+ """A bundle with no falsifiable claim is a bundle maintained by taste."""+ assert target_for(s.name) is not None, (+ f"{s.name} ships with no row in skills/targets.py — decide the ONE deterministic "+ f"quantity it moves, or add it with measurable=False and say why")+++def test_every_target_row_names_a_bundle_that_exists():+ have = {d.name for d in BUNDLES}+ assert set(BY_SKILL) <= have, f"targets.py names missing bundle(s): {sorted(set(BY_SKILL) - have)}"+++def test_every_routed_skill_has_a_target():+ missing = [s for s in ROUTED_SKILLS if s not in BY_SKILL]+ assert missing == [], f"the router can attach {missing}, and nothing measures them"+++def test_every_gate_kind_a_target_counts_is_a_live_kind():+ unknown = sorted(gate_kinds_claimed() - _live_kinds())+ assert unknown == [], (+ f"targets.py counts gate kind(s) registry.py no longer defines: {unknown} — the "+ f"readout would report a silent zero")++[email protected]("t", TARGETS, ids=[t.skill for t in TARGETS])+def test_a_row_is_well_formed(t):+ assert t.direction in DIRECTIONS+ assert t.source in SOURCES+ assert t.unit and t.why, f"{t.skill}: a row must say what the number is and why it is the claim"+ if t.source == SRC_GATE:+ assert t.kinds, f"{t.skill}: a gate-sourced row must name the kinds it counts"+ if not t.measurable:+ assert t.caveat, f"{t.skill}: measurable=False is a finding — it owes the reason"+++def test_no_two_bundles_claim_the_same_quantity():+ """Two bundles sharing a metric means an A/B cannot say which one moved it."""+ assert len(METRICS) == len(TARGETS)+ seen: dict[str, str] = {}+ for t in TARGETS:+ for k in t.kinds:+ assert k not in seen, f"{t.skill} and {seen[k]} both count {k}"+ seen[k] = t.skill+++# --------------------------------------------------------------------------- frontmatter[email protected]("d", BUNDLES, ids=[d.name for d in BUNDLES])+def test_the_claim_travels_with_the_skill(d: Path):+ """The row must be readable from the bundle alone — it ships to other CLIs."""+ meta, t = _frontmatter(d), target_for(d.name)+ assert t is not None+ assert meta.get("target_metric") == t.metric+ assert meta.get("target_direction") == t.direction+ assert meta.get("target_unit") == t.unit+ assert meta.get("target_measurable") == ("true" if t.measurable else "false")+ assert str(meta.get("target_baseline") or "").strip(), (+ f"{d.name}: target_baseline is the number a later A/B has to beat; recompute it with "+ f"`python bench/skill_targets.py bench/out`")++[email protected]("d", BUNDLES, ids=[d.name for d in BUNDLES])+def test_a_baseline_names_its_n(d: Path):+ """"3.35 per run" without an n is a mood. Every baseline states the population."""+ base = str(_frontmatter(d).get("target_baseline") or "")+ assert re.search(r"\bn\s*=\s*\d+", base), f"{d.name}: target_baseline must state n=<runs>"++[email protected]("d", BUNDLES, ids=[d.name for d in BUNDLES])+def test_metadata_values_are_strings(d: Path):+ meta = _frontmatter(d)+ for k, v in meta.items():+ assert isinstance(v, str), f"{d.name}: metadata.{k} must be a string (the spec allows string→string)"+++# --------------------------------------------------------------------------- classification+ "message",+ ["very large frame-to-frame change (max |Δ| 0.412); flicker or hard cuts",+ "very low visual detail (edge density 0.0014); the image is a near-flat gradient",+ "frames do not change over time (mean |Δ| 0.0001); the shader looks static",+ "frames are essentially black (mean luminance 0.004)",+ "frames are blown out white (mean luminance 0.991)",+ "NaN/Inf pixels in 3 frame(s) (first at t=1s: nan=1200 inf=0)",+ "no frames were rendered"])+def test_every_actionable_gl_frames_message_classifies(message):+ """R19/R24 say "the frame gate saw no motion or no detail"; the regex used to catch+ only two of the seven messages ``frame_gate`` can emit, so a shader that came out+ static or black routed NOTHING. This is the pin on the widened rule."""+ assert finding_kind("gl_frames", message, "warn") == "gl_frames/motion_or_detail"+++# --------------------------------------------------------------------------- the readout+def _record(language: str, gates: list[dict], *, build_ok: bool = True) -> dict:+ return {"spec": {"language": language}, "final_score": 0.5, "status": "plateau",+ "rounds": [{"index": 0, "gates": gates, "build": {"ok": build_ok}}]}+++def _battery(tmp_path: Path, cells: dict[str, dict]) -> Path:+ root = tmp_path / "battery"+ for name, rec in cells.items():+ d = root / "runs" / name+ d.mkdir(parents=True)+ (d / "record.json").write_text(json.dumps(rec))+ return root+++def _finding(gate: str, message: str, severity: str = "warn") -> dict:+ return {"gate": gate, "severity": severity, "message": message}+++CONNECTIVITY = [_finding("connectivity", "'Lid' and 'Body' interpenetrate by ≈7.4 mm (12% of surface samples inside)"),+ _finding("connectivity", "'Leg_0' and 'Seat' interpenetrate by ≈2.1 mm (3% of surface samples inside)"),+ _finding("connectivity", "all 7 parts are connected (9 contacts, gap ≤ 1 mm)", "info")]+CONTRACT = [_finding("contract", "part 'Seat' bbox deviates from the plan (worst 2.1× tolerance)"),+ _finding("contract", "'Leg' (each instance) bbox deviates from the plan (worst 1.4× tolerance)")]+++def test_the_readout_counts_the_kinds_the_row_names(tmp_path):+ from bench.skill_targets import battery_rows, load_runs++ root = _battery(tmp_path, {+ "chair": _record("blender", [{"gate": "connectivity", "findings": CONNECTIVITY},+ {"gate": "contract", "findings": CONTRACT}]),+ "lamp": _record("blender", [{"gate": "connectivity", "findings": CONNECTIVITY[2:]},+ {"gate": "contract", "findings": []}]),+ })+ rows = {r["skill"]: r for r in battery_rows(load_runs(root), list(TARGETS), which="last", cache=None)}+ assert rows["cv3d-part-contact"]["n"] == 2+ assert rows["cv3d-part-contact"]["mean"] == 1.0 # 2 pairs + 0, INFO ignored+ assert rows["cv3d-bbox-contract"]["mean"] == 0.5 # part_bbox only+ assert rows["cv3d-repeats-and-mirrors"]["mean"] == 0.5 # instance_bbox only+++def test_a_row_only_counts_the_languages_it_is_defined_over(tmp_path):+ from bench.skill_targets import battery_rows, load_runs++ root = _battery(tmp_path, {+ "robot": _record("urdf_blender", [{"gate": "joint_sweep", "findings": [+ _finding("joint_sweep", "links 'a' and 'b' overlap by 6.0 mm at pose j=1.0", "error"),+ _finding("joint_sweep", "links 'a' and 'c' overlap by 3.0 mm at rest", "warn")]}]),+ "chair": _record("blender", [{"gate": "connectivity", "findings": CONNECTIVITY}]),+ })+ rows = {r["skill"]: r for r in battery_rows(load_runs(root), list(TARGETS), which="last", cache=None)}+ assert rows["cv3d-urdf-joints"]["n"] == 1 # the blender run is not eligible+ assert rows["cv3d-urdf-joints"]["mean"] == 1.0 # ERRORs only; the rest-pose WARN is not one+ assert rows["cv3d-part-contact"]["n"] == 2 # both languages carry a part graph+++def test_an_ungraded_run_is_not_in_the_population(tmp_path):+ """A concurrency probe or an e2e smoke run has no gate report; counting it would give+ a GLB-derived row a different n from the gate-derived rows beside it."""+ from bench.skill_targets import battery_rows, load_runs++ root = _battery(tmp_path, {+ "chair": _record("blender", [{"gate": "connectivity", "findings": CONNECTIVITY}]),+ "probe": {"spec": {"language": "blender"}, "rounds": [{"index": 0, "gates": []}]},+ })+ rows = {r["skill"]: r for r in battery_rows(load_runs(root), list(TARGETS), which="last", cache=None)}+ assert rows["cv3d-part-contact"]["n"] == 1+++def test_the_ab_mode_pairs_by_prompt(tmp_path):+ from bench.skill_targets import ab_arms, ab_rows++ root = tmp_path / "ab"+ for arm, findings in (("control", CONNECTIVITY), ("variant", CONNECTIVITY[1:])):+ d = root / "arms" / arm / "cells" / "chair" / "run"+ d.mkdir(parents=True)+ (d / "record.json").write_text(json.dumps(+ _record("blender", [{"gate": "connectivity", "findings": findings}])))+ arms = ab_arms(root)+ assert arms is not None+ rows = {r["skill"]: r for r in ab_rows(arms, list(TARGETS), which="last", cache=None)}+ r = rows["cv3d-part-contact"]+ assert (r["n"], r["control_mean"], r["variant_mean"], r["mean_delta"]) == (1, 2.0, 1.0, -1.0)+ assert (r["better"], r["worse"], r["tied"]) == (1, 0, 0)+++def test_a_battery_dir_is_not_mistaken_for_an_ab_dir(tmp_path):+ from bench.skill_targets import ab_arms++ root = _battery(tmp_path, {"chair": _record("blender", [])})+ assert ab_arms(root) is None+++def test_the_cli_runs_over_a_synthetic_battery(tmp_path, capsys):+ from bench.skill_targets import main++ root = _battery(tmp_path, {"chair": _record("blender", [{"gate": "connectivity", "findings": CONNECTIVITY}])})+ assert main([str(root), "--json", "--no-cache"]) == 0+ payload = json.loads(capsys.readouterr().out)+ assert payload["mode"] == "battery"+ row = next(r for r in payload["rows"] if r["skill"] == "cv3d-part-contact")+ assert row["n"] == 1 and row["mean"] == 2.0+++def test_the_confidence_block_says_how_many_pairs_an_effect_needs():+ """The deterministic readout is lower-variance than the judged score, not zero-variance;+ a row that cannot say how many pairs it needs cannot be planned around."""+ from bench.skill_targets import confidence++ c = confidence([-1.0, 1.0, -1.0, 1.0], control_mean=4.0)+ assert c["sd"] == pytest.approx(1.1547, rel=1e-3)+ assert c["ci95"] == pytest.approx(2 * c["se"])+ assert c["resolvable_effect"] == 1.0 # 25% of a control mean of 4+ assert c["n_to_resolve"] == 5 # (2*1.1547/1.0)^2+++def test_confidence_is_silent_on_a_single_pair():+ from bench.skill_targets import confidence++ assert confidence([1.0], control_mean=4.0)["sd"] is None+++def test_a_retried_cell_pairs_on_the_attempt_that_reached_a_gate(tmp_path):+ """A provider outage leaves `...flash` and `...flash.attempt1` side by side in one cell;+ pairing the ungraded one would drop a prompt that actually ran."""+ from bench.skill_targets import ab_arms, ab_rows++ root = tmp_path / "ab"+ for arm in ("control", "variant"):+ cell = root / "arms" / arm / "cells" / "chair"+ for leaf, rec in (("run_a", {"spec": {"language": "blender"}, "rounds": []}),+ ("run_a.attempt1",+ _record("blender", [{"gate": "connectivity", "findings": CONNECTIVITY}]))):+ (cell / leaf).mkdir(parents=True)+ (cell / leaf / "record.json").write_text(json.dumps(rec))+ rows = {r["skill"]: r for r in ab_rows(ab_arms(root), list(TARGETS), which="last", cache=None)}+ assert rows["cv3d-part-contact"]["n"] == 1+++def test_3dcv_skills_list_shows_every_bundles_claim():+ """The ledger has to be visible from the CLI, or it is a document nobody opens."""+ from typer.testing import CliRunner++ from codeverse.cli.main import app++ r = CliRunner().invoke(app, ["skills", "list"])+ assert r.exit_code == 0+ assert "target" in r.output+ assert "none" not in r.output, "a bundle with no target row would print `none` here"