Skip to content

Official Codebase of 3DCodeVerse

Python

skills: default ON; the read probe reads the CLIs' own tool calls first

gaoypengb3c9c407e1ae
diff --git a/eval/bench/ab_plan.py b/eval/bench/ab_plan.py
index 61774508..ada1d7a6 100644
--- a/eval/bench/ab_plan.py
+++ b/eval/bench/ab_plan.py
@@ -10,6 +10,14 @@ the VARIANT arm alone. Everything else is held fixed on both sides: the generat
planner, the in-loop judge, the rounds, and the fixed judge that produces
the reported score (``bench/_fixed_eval.py``, ``n_samples`` 2).
+An A/B of SKILLS (harness docs/SKILLS.md §6): since 2026-09-22 skills are ON by default,
+so the no-skills arm has to say ``C3D_SKILLS=0`` explicitly. The control is the driver's
+env with every variant key REMOVED (:func:`child_env`), which means ``--variant-env
+C3D_SKILLS=1`` now runs two identical arms, and a ``C3D_SKILLS=0`` exported in the launching
+shell never reaches the control either. With these mechanics the OFF arm is the variant:
+``--variant-env C3D_SKILLS=0`` (control = the shipped default, skills on; a positive delta
+means turning skills OFF helped).
+
Why each arm is a child PROCESS rather than a thread: the switches under test are read
from the environment (``codeverse3d.tracks.planner.brief_enabled`` reads ``os.environ`` at
call time; anything under ``Settings`` is read once through an ``lru_cache``), so two
diff --git a/eval/tests/test_ab_plan.py b/eval/tests/test_ab_plan.py
index ada35167..07541dc7 100644
--- a/eval/tests/test_ab_plan.py
+++ b/eval/tests/test_ab_plan.py
@@ -364,13 +364,13 @@ def test_cli_report_only_rebuilds_from_results(tmp_path: Path, capsys):
[_row("cmp_easy_stool", CONTROL, 0.5),
_row("cmp_easy_stool", VARIANT, None, "infra_failed"),
_row("cmp_easy_stool", VARIANT, 0.4)]))
- opts = AbOptions(variant_env={"C3D_SKILLS": "on"}, rounds=1)
+ opts = AbOptions(variant_env={"C3D_SKILLS": "0"}, rounds=1) # skills are on by default: the variant turns them off
(tmp_path / "ab.json").write_text(json.dumps({"options": json.loads(opts.model_dump_json())}))
assert main(["--prompts", str(BATTERY), "--out", str(tmp_path), "--report-only"]) == 0
assert "verdict: revert" in capsys.readouterr().out
assert (tmp_path / "pairs.json").is_file()
summary = (tmp_path / "summary.md").read_text()
- assert "variant env: `C3D_SKILLS=on`" in summary and "n_infra_failed: 0" in summary
+ assert "variant env: `C3D_SKILLS=0`" in summary and "n_infra_failed: 0" in summary
def test_report_only_survives_a_run_dir_with_no_or_broken_ab_json(tmp_path):
@@ -402,7 +402,7 @@ def test_a_pinned_plan_that_dies_in_a_storm_records_the_pair_and_continues(tmp_p
return "h1"
monkeypatch.setattr(ab, "pin_pair", stormy_pin)
- opts = AbOptions(variant_env={"C3D_SKILLS": "1"}, pin_plan=True, ids=ids)
+ opts = AbOptions(variant_env={"C3D_SKILLS": "0"}, pin_plan=True, ids=ids)
run_ab(BATTERY, tmp_path, opts, run_cell_fn=fake)
rows = load_jsonl(tmp_path / "results.jsonl", CellResult)
diff --git a/eval/tests/test_ab_plan_switches.py b/eval/tests/test_ab_plan_switches.py
index a480439e..10d7091d 100644
--- a/eval/tests/test_ab_plan_switches.py
+++ b/eval/tests/test_ab_plan_switches.py
@@ -40,7 +40,8 @@ def test_ab_plan_still_accepts_a_live_switch(monkeypatch, capsys):
def test_a_dead_switch_does_not_block_pin_plan(monkeypatch, capsys):
"""C3D_PLAN_FEATURES is read by nothing, so it cannot change a plan: next to a
generation-side switch it must not make --pin-plan refuse the A/B (until 2026-09-22
- its never-implemented feature names did)."""
+ its never-implemented feature names did). The generation-side switch is the skills
+ OFF arm: skills are on by default since 2026-09-22, so `C3D_SKILLS=1` would be no switch."""
import bench.ab_plan as A
seen: list[dict[str, str]] = []
@@ -50,5 +51,28 @@ def test_a_dead_switch_does_not_block_pin_plan(monkeypatch, capsys):
monkeypatch.setattr(A, "run_ab", lambda battery, out, opts, **kw: (seen.append(opts.variant_env), _V())[1])
A.main(["--prompts", "p.yaml", "--out", "o", "--no-preflight", "--allow-siblings", "--pin-plan",
- "--variant-env", "C3D_PLAN_FEATURES=all", "--variant-env", "C3D_SKILLS=1"])
- assert seen == [{"C3D_PLAN_FEATURES": "all", "C3D_SKILLS": "1"}], capsys.readouterr()
+ "--variant-env", "C3D_PLAN_FEATURES=all", "--variant-env", "C3D_SKILLS=0"])
+ assert seen == [{"C3D_PLAN_FEATURES": "all", "C3D_SKILLS": "0"}], capsys.readouterr()
+
+
+def test_a_skills_ab_spells_its_off_arm_explicitly(monkeypatch):
+ """Skills are ON by default since 2026-09-22 (harness docs/SKILLS.md §6). The control
+ arm is the driver's env minus every variant key, so the only way to get an arm WITHOUT
+ skills is to name `C3D_SKILLS=0` in the variant — and `C3D_SKILLS=1` is now two
+ identical arms, the byte-identical-arms trap tracks/plan_features.py exists for."""
+ from bench._ab_report import CONTROL, VARIANT
+ from bench.ab_plan import AbOptions, child_env
+ from codeverse3d.skills.config import SKILLS_ENV, skills_enabled
+
+ def enabled(env: dict[str, str]) -> bool:
+ monkeypatch.delenv(SKILLS_ENV, raising=False)
+ if SKILLS_ENV in env:
+ monkeypatch.setenv(SKILLS_ENV, env[SKILLS_ENV])
+ return skills_enabled()
+
+ shell = {"PATH": "/usr/bin", SKILLS_ENV: "0"} # exported in the launching shell: never reaches the control
+ off = AbOptions(variant_env={SKILLS_ENV: "0"})
+ assert enabled(child_env(CONTROL, off, shell)) is True
+ assert enabled(child_env(VARIANT, off, shell)) is False
+ on = AbOptions(variant_env={SKILLS_ENV: "1"})
+ assert enabled(child_env(CONTROL, on, shell)) is enabled(child_env(VARIANT, on, shell)) is True
diff --git a/eval/tests/test_pin_plan.py b/eval/tests/test_pin_plan.py
index 93e91548..b3c57fc7 100644
--- a/eval/tests/test_pin_plan.py
+++ b/eval/tests/test_pin_plan.py
@@ -92,7 +92,7 @@ def test_pin_pair_seeds_every_arm_from_one_plan(tmp_path, monkeypatch):
battery = Battery.load(Path(ab_plan.__file__).resolve().parent / "prompts" / "compare_v1.yaml")
item = battery.prompts[0]
- opts = ab_plan.AbOptions(variant_env={"C3D_SKILLS": "1"}, pin_plan=True)
+ opts = ab_plan.AbOptions(variant_env={"C3D_SKILLS": "0"}, pin_plan=True) # the skills-OFF arm
calls: list[Path] = []
def fake_plan_once(spec, ws_root):
@@ -129,7 +129,7 @@ def test_pin_pair_reuses_the_plan_when_the_pair_is_retried(tmp_path, monkeypatch
battery = Battery.load(Path(ab_plan.__file__).resolve().parent / "prompts" / "compare_v1.yaml")
item = battery.prompts[0]
- opts = ab_plan.AbOptions(variant_env={"C3D_SKILLS": "1"}, pin_plan=True)
+ opts = ab_plan.AbOptions(variant_env={"C3D_SKILLS": "0"}, pin_plan=True) # the skills-OFF arm
n = 0
def fake_plan_once(spec, ws_root):
diff --git a/harness/codeverse3d/cli/skills_cmd.py b/harness/codeverse3d/cli/skills_cmd.py
index 82e757b8..575e237c 100644
--- a/harness/codeverse3d/cli/skills_cmd.py
+++ b/harness/codeverse3d/cli/skills_cmd.py
@@ -122,9 +122,12 @@ def report(
Target from the design: >= 60% deep-read rate for a CLI backend. A skill
under 20% over 20 sessions is merged or deleted.
- Sessions whose CONTROL bundle was also "read" are counted separately and excluded from
- the rate: git's own diff and every CLI's skill activation both bump atime, so in those
- sessions the probe saw nothing it can attribute to the agent (docs/SKILLS.md section 4).
+ Sessions measured by atime whose CONTROL bundle was also "read" are counted separately
+ and excluded from the rate: git's own diff and every CLI's skill activation both bump
+ atime, so in those sessions the probe saw nothing it can attribute to the agent
+ (docs/SKILLS.md section 4). Sessions measured from the CLI's own tool calls
+ (``evidence: transcript``, 2026-09-22) are exact and always counted; one whose agent
+ opened the control is reported, not dropped.
"""
from rich.table import Table
@@ -132,14 +135,20 @@ def report(
for p in sorted(Path(runs_dir).rglob("telemetry/skills.jsonl")):
rows.extend(read_jsonl_lenient(p))
if not rows:
- err_console.print(f"[yellow]no telemetry/skills.jsonl under {runs_dir}[/] (was C3D_SKILLS on?)")
+ err_console.print(f"[yellow]no telemetry/skills.jsonl under {runs_dir}[/] (was C3D_SKILLS=0?)")
raise typer.Exit(code=1)
per: dict[tuple[str, str], list[int]] = {}
- blind = sum(1 for r in rows if r.get("control_read"))
+
+ def _blind(r: dict) -> bool: # an atime row whose control fired saw nothing
+ return bool(r.get("control_read")) and r.get("evidence", "atime") != "transcript"
+
+ blind = sum(1 for r in rows if _blind(r))
+ exact = sum(1 for r in rows if r.get("evidence") == "transcript")
+ indiscriminate = sum(1 for r in rows if r.get("evidence") == "transcript" and r.get("control_read"))
no_control = sum(1 for r in rows if not r.get("control_present"))
for r in rows:
- if r.get("control_read"):
+ if _blind(r):
continue # the probe was blind here; counting it would lie
backend = str(r.get("agent", "?")).split(":", 1)[0]
reads = {x["name"]: x for x in r.get("reads", [])}
@@ -152,14 +161,15 @@ def report(
if as_json:
console.print_json(json.dumps({
"sessions": len(rows), "control_read_sessions": blind, "no_control_sessions": no_control,
+ "transcript_sessions": exact, "control_opened_by_agent_sessions": indiscriminate,
"skills": [
{"skill": k[0], "backend": k[1], "listed": v[0], "surfaced": v[1], "deep": v[2],
"deep_read_rate": round(v[2] / v[0], 3) if v[0] else None}
for k, v in sorted(per.items())]}))
return
scored = len(rows) - blind
- t = Table(title=f"skill read rate ({scored} of {len(rows)} sessions; "
- f"{blind} blind — the control was read too)")
+ t = Table(title=f"skill read rate ({scored} of {len(rows)} sessions, {exact} from the CLI's own "
+ f"tool calls; {blind} blind — the atime control was read too)")
for col in ("skill", "backend", "listed", "surfaced", "deep", "deep rate", "verdict"):
t.add_column(col)
for (name, backend), (listed, surfaced, deep) in sorted(per.items()):
@@ -172,6 +182,10 @@ def report(
err_console.print(
f"[yellow]{blind} of {len(rows)} sessions excluded[/]: the never-routed control bundle "
f"was opened too, so nothing in them can be attributed to the agent.")
+ if indiscriminate:
+ err_console.print(
+ f"[yellow]{indiscriminate} session(s) opened the control bundle themselves[/] (tool trace): "
+ f"their agent reads skills whether or not the description matches.")
if no_control:
err_console.print(
f"[yellow]{no_control} session(s) predate the control bundle[/]: their rates are an upper bound.")
diff --git a/harness/codeverse3d/contracts/run.py b/harness/codeverse3d/contracts/run.py
index e89b0030..5de378a0 100644
--- a/harness/codeverse3d/contracts/run.py
+++ b/harness/codeverse3d/contracts/run.py
@@ -33,8 +33,10 @@ class SkillRead(BaseModel):
"""The read probe's verdict for one materialised bundle (design §6.4)."""
name: str
- surfaced: bool = Field(default=False, description="SKILL.md atime > mtime: opened by someone (a discovery scan counts)")
- deep: bool = Field(default=False, description="a references/*.md atime > mtime: the body was read and followed")
+ surfaced: bool = Field(default=False, description="transcript: the agent activated the skill or opened its "
+ "SKILL.md; atime fallback: SKILL.md atime > mtime (a discovery scan counts)")
+ deep: bool = Field(default=False, description="transcript: the agent opened a file under its references/; "
+ "atime fallback: a references/*.md atime > mtime")
deep_measurable: bool = Field(default=True, description="False when the bundle ships no references/ file to probe")
body_tokens: int = 0
reason: str = Field(default="", description="which route attached it, and which finding")
@@ -53,19 +55,29 @@ class SkillsUsage(BaseModel):
inlined: str = Field(default="", description="single-shot: the body inlined into the prompt, '' otherwise")
control_read: bool = Field(
default=False,
- description="the never-routed control bundle was 'read' too, so this session's atime "
- "evidence proves nothing and every rate below is an upper bound")
+ description="the never-routed control bundle was 'read' too. Under atime evidence that "
+ "means the probe was blind (every rate below is an upper bound); under "
+ "transcript evidence it means the AGENT itself opened a bundle that matches "
+ "nothing — a real read, and a sign it reads skills indiscriminately")
control_present: bool = Field(default=False, description="a control bundle was materialised at all")
+ evidence: Literal["atime", "transcript"] = Field(
+ default="atime",
+ description="where the reads came from: 'transcript' = the CLI's own tool calls, recorded by "
+ "its backend in trajectories/*/transcript.jsonl (exact); 'atime' = the file-access "
+ "probe, the fallback when a session left no tool trace")
@property
def probe_trustworthy(self) -> bool:
- """False when the control fired — the only honest reading of the numbers below.
+ """False when the atime probe's control fired — the only honest reading of the numbers below.
A run computes ``files_changed`` through ``git add -A -N`` + ``git diff``, and git
reads every untracked file to do it, which bumps atime on the whole bundle tree.
CLI activation opens ``references/`` too. Either way the probe says "read" when
nobody chose to read, and only the control can tell you which session you are in.
+ Transcript evidence is the CLI's own record of what it called, so it is trusted as is.
"""
+ if self.evidence == "transcript":
+ return True
return self.control_present and not self.control_read
@property
@@ -78,8 +90,8 @@ class SkillsUsage(BaseModel):
@property
def deep_read_rate(self) -> float | None:
- """None when there is nothing listed, or when the control says the probe is blind."""
- if not self.listed or (self.control_present and self.control_read):
+ """None when there is nothing listed, or when the atime control says the probe is blind."""
+ if not self.listed or (self.evidence == "atime" and self.control_present and self.control_read):
return None
return len(self.deep) / len(self.listed)
diff --git a/harness/codeverse3d/doctor.py b/harness/codeverse3d/doctor.py
index b4a5bbac..21fe33ce 100644
--- a/harness/codeverse3d/doctor.py
+++ b/harness/codeverse3d/doctor.py
@@ -257,14 +257,15 @@ def check_skills() -> list[Row]:
A CLI upgrade that moves its skills root ships an empty index and the run still
passes — the failure is invisible except as a read rate of zero a battery later. So
the wiring gets a check you can run before spending money."""
- from codeverse3d.agents.backends import ALLOWED_TOOLS
+ from codeverse3d.agents.backends import ALLOWED_TOOLS, SYSTEM_SETTINGS
from codeverse3d.skills import bundle_dirs, skills_dir, validate_bundle
from codeverse3d.skills.config import skills_enabled
from codeverse3d.skills.materialize import SKILL_ROOTS
from codeverse3d.skills.registry import ROUTED_SKILLS
rows: list[Row] = [("skills switch", "OK" if skills_enabled() else "WARN",
- "C3D_SKILLS=on" if skills_enabled() else "C3D_SKILLS is off (default): no skill is attached")]
+ "C3D_SKILLS on (the default since 2026-09-22)" if skills_enabled()
+ else "C3D_SKILLS=0: no skill is attached to any session")]
dirs = bundle_dirs()
if not dirs:
rows.append(("skills library", "WARN", f"no bundles under {skills_dir()}"))
@@ -279,6 +280,10 @@ def check_skills() -> list[Row]:
rows.append(("skills discovery", "OK", "materialised into " + " + ".join(SKILL_ROOTS)))
rows.append(("claude-code Skill tool", "OK" if "Skill" in ALLOWED_TOOLS else "FAIL",
"in --allowedTools" if "Skill" in ALLOWED_TOOLS else "missing: claude-code would deny skill activation"))
+ pinned = (SYSTEM_SETTINGS.get("skills") or {}).get("enabled") is True
+ rows.append(("gemini-cli skills setting", "OK" if pinned else "FAIL",
+ "skills.enabled pinned in the per-session system settings" if pinned
+ else "not pinned: a user's skills.enabled=false would hide every bundle from gemini-cli"))
return rows
diff --git a/harness/codeverse3d/skills/__init__.py b/harness/codeverse3d/skills/__init__.py
index 7b0dd168..fbe933c1 100644
--- a/harness/codeverse3d/skills/__init__.py
+++ b/harness/codeverse3d/skills/__init__.py
@@ -21,7 +21,8 @@ Public surface for the rest of the harness::
``skills_for`` is pure and testable; ``attach_skills`` writes the routed bundles into a
workspace and returns what it wrote; ``probe_reads`` says afterwards which of them were
-actually opened. Everything is behind ``C3D_SKILLS`` (default off).
+actually opened — from the CLI's own tool calls where its backend recorded them. Everything
+is behind ``C3D_SKILLS``: ON by default since 2026-09-22, ``C3D_SKILLS=0`` turns it off.
"""
from __future__ import annotations
diff --git a/harness/codeverse3d/skills/c3d-cadquery-forms/SKILL.md b/harness/codeverse3d/skills/c3d-cadquery-forms/SKILL.md
index 557365bd..3ae6a049 100644
--- a/harness/codeverse3d/skills/c3d-cadquery-forms/SKILL.md
+++ b/harness/codeverse3d/skills/c3d-cadquery-forms/SKILL.md
@@ -5,7 +5,7 @@ license: Apache-2.0
compatibility: CadQuery 2.8 on OCP; one module src/model.py exporting a module-level `result`.
metadata:
evidence: inherited-unverified
- evidence_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.'
+ evidence_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 by default since 2026-09-22 (C3D_SKILLS_UNVERIFIED defaults on); still unranked until cadquery has 20 graded runs.'
verified: "2026-08-25"
target_metric: "build_failure_rate"
target_direction: "down"
diff --git a/harness/codeverse3d/skills/c3d-threejs-forms/SKILL.md b/harness/codeverse3d/skills/c3d-threejs-forms/SKILL.md
index b03a5caa..cdb88465 100644
--- a/harness/codeverse3d/skills/c3d-threejs-forms/SKILL.md
+++ b/harness/codeverse3d/skills/c3d-threejs-forms/SKILL.md
@@ -5,7 +5,7 @@ license: Apache-2.0
compatibility: "static_object track, language threejs. three r182 ESM in node, exported to GLB by the harness. Imports that resolve: three, three/addons/*, relative files under src/."
metadata:
evidence: inherited-unverified
- 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 codeverse3d/prompts/threejs/contract.md, codeverse3d/prompts/threejs/cookbook.md, codeverse3d/languages/threejs/__init__.py and runtime_js/package.json, but the ADVICE has not been A/B'd on our corpus. Routed off unless C3D_SKILLS_UNVERIFIED=on; upgrade to measured when threejs reaches 20 graded runs."
+ 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 codeverse3d/prompts/threejs/contract.md, codeverse3d/prompts/threejs/cookbook.md, codeverse3d/languages/threejs/__init__.py and runtime_js/package.json, but the ADVICE has not been A/B'd on our corpus. Routed by default since 2026-09-22 (C3D_SKILLS_UNVERIFIED=0 drops it); upgrade to measured when threejs reaches 20 graded runs."
verified: "2026-08-25"
pairs_with: "c3d-part-contact, c3d-bbox-contract"
target_metric: "missing_parts"
diff --git a/harness/codeverse3d/skills/config.py b/harness/codeverse3d/skills/config.py
index 2eac16aa..22ad2b44 100644
--- a/harness/codeverse3d/skills/config.py
+++ b/harness/codeverse3d/skills/config.py
@@ -8,12 +8,24 @@ arms because the switch it flipped was read by nothing at all
(``codeverse3d/tracks/plan_features.py``). So: one module, read at call time, registered
in ``plan_features.LIVE_SWITCHES``, and a test that greps the tree to prove it is read.
-* ``C3D_SKILLS`` — off by default. On = route, materialise, measure.
+* ``C3D_SKILLS`` — ON by default (2026-09-22). On = route, materialise, measure;
+ ``C3D_SKILLS=0`` turns the whole system off (an A/B's no-skills arm must say so explicitly:
+ ``ab_plan.py --variant-env C3D_SKILLS=0``).
* ``C3D_SKILLS_MAX`` — attached bundles per session (default 5, design §5.2 law 1).
-* ``C3D_SKILLS_UNVERIFIED`` — also route bundles labelled ``inherited-unverified``
- (cadquery / threejs today: zero graded runs, so their claims are carried, not measured).
+* ``C3D_SKILLS_UNVERIFIED`` — also route bundles labelled ``inherited-unverified`` (the
+ cadquery / threejs forms and the four scene-graphics ports). ON by default with the
+ switch above, so all 17 bundles route; ``C3D_SKILLS_UNVERIFIED=0`` drops those six.
* ``C3D_SKILLS_ONLY`` — comma list; the router may consider ONLY these bundles.
+WHY both defaults flipped ON (owner, 2026-09-22). They shipped OFF on 2026-08-25/26
+because the in-process ``api-agent`` read 0 of 5 routed bundles and the A/B could not
+resolve an effect (docs/SKILLS.md §6). That backend was deleted 2026-08-28; every
+backend left is a vendor CLI with its own native skill loader, and the 2026-09-22 live
+probes (docs/SKILLS_LEDGER.md §0b) watched gemini-cli, claude-code, codex and agy each
+activate all four routed bundles of a chair baseline unprompted and leave the control
+alone — read from the CLI's own tool calls, not from atime. Skills are part of the
+product now; measuring an effect is the A/B's job.
+
WHY ``C3D_SKILLS_ONLY`` exists. An effect A/B has to attribute its delta to ONE bundle,
and ``C3D_SKILLS=1`` routes up to five. Restricting the LIBRARY (rather than filtering
the selection afterwards) is the semantics that keeps the arms honest: the named bundle
@@ -39,13 +51,16 @@ SKILLS_ONLY_ENV = "C3D_SKILLS_ONLY"
DEFAULT_SKILLS_MAX = 5
def skills_enabled() -> bool:
- """Is the skill system on for this process? Default OFF until the A/B says otherwise."""
- return env_flag(SKILLS_ENV, False)
+ """Is the skill system on for this process? Default ON since 2026-09-22; ``C3D_SKILLS=0``
+ (or ``off``) is the one way to turn it off — and a garbage value reads as off, never as
+ the variant (``config.env_flag``)."""
+ return env_flag(SKILLS_ENV, True)
def skills_unverified() -> bool:
- """Route bundles whose evidence label is ``inherited-unverified``? Default no."""
- return env_flag(SKILLS_UNVERIFIED_ENV, False)
+ """Route bundles whose evidence label is ``inherited-unverified``? Default yes since
+ 2026-09-22, so the whole library routes; the per-session cap (5) still holds."""
+ return env_flag(SKILLS_UNVERIFIED_ENV, True)
def skills_only() -> frozenset[str]:
diff --git a/harness/codeverse3d/skills/materialize.py b/harness/codeverse3d/skills/materialize.py
index 58abc005..6bfd8d73 100644
--- a/harness/codeverse3d/skills/materialize.py
+++ b/harness/codeverse3d/skills/materialize.py
@@ -207,7 +207,7 @@ def attach_skills(
allow_unverified=skills_unverified() if allow_unverified is None else allow_unverified,
)
out = SkillsMaterialized(listed=[s.name for s in sel], selections=list(sel),
- reasons={s.name: s.reason for s in sel})
+ reasons={s.name: s.reason for s in sel}, attached_at=time.time())
if not sel or single_shot:
# an empty selection is a legal desired set: the sweep must still run, or last
# round's bundles stay live where the native CLIs discover skills by directory
diff --git a/harness/codeverse3d/skills/model.py b/harness/codeverse3d/skills/model.py
index c35eee10..0f1ba77d 100644
--- a/harness/codeverse3d/skills/model.py
+++ b/harness/codeverse3d/skills/model.py
@@ -19,7 +19,8 @@ from codeverse3d.cost.guard import text_tokens
#: `metadata.evidence` values. A bundle whose claims are carried over from a reference
#: library but which our own corpus cannot back yet is `inherited-unverified`, and the
-#: router refuses it unless C3D_SKILLS_UNVERIFIED is on (design §5.2 law 3).
+#: router refuses it when C3D_SKILLS_UNVERIFIED is off (design §5.2 law 3; the switch defaults
+#: ON since 2026-09-22, so the whole library routes unless it is set to 0).
EVIDENCE_MEASURED = "measured"
EVIDENCE_INHERITED = "inherited-unverified"
EVIDENCE_MIXED = "mixed"
@@ -109,6 +110,8 @@ class SkillsMaterialized(BaseModel):
reasons: dict[str, str] = Field(default_factory=dict, description="name → why it was attached")
index_tokens: int = Field(default=0, description="estimated tokens the index/mandate adds to message 0")
inlined: str = Field(default="", description="single-shot: the one body inlined, '' otherwise")
+ attached_at: float = Field(default=0.0, description="epoch seconds of the attach: the read probe credits "
+ "only tool calls a CLI session logged after it (telemetry.probe_reads)")
warnings: list[str] = Field(default_factory=list)
diff --git a/harness/codeverse3d/skills/registry.py b/harness/codeverse3d/skills/registry.py
index 356f0c65..c5c3ea7e 100644
--- a/harness/codeverse3d/skills/registry.py
+++ b/harness/codeverse3d/skills/registry.py
@@ -194,9 +194,11 @@ ROUTES: tuple[Route, ...] = (
findings=(LINT_PART_NOT_IMPORTED,),
why="a part file was written but never imported, so its geometry does not exist"),
Route("R10", "c3d-cadquery-forms", 75, languages=("cadquery",), kinds=BUILD_KINDS,
- why="cadquery authoring (evidence: inherited-unverified — 0 graded runs, routed off by default)"),
+ why="cadquery authoring (evidence: inherited-unverified — unranked by our corpus; routed by default "
+ "since 2026-09-22, C3D_SKILLS_UNVERIFIED=0 drops it)"),
Route("R11", "c3d-threejs-forms", 75, tracks=("static_object",), languages=("threejs",), kinds=BUILD_KINDS,
- why="three.js object authoring (evidence: inherited-unverified — 0 graded runs, routed off by default)"),
+ why="three.js object authoring (evidence: inherited-unverified — unranked by our corpus; routed by "
+ "default since 2026-09-22, C3D_SKILLS_UNVERIFIED=0 drops it)"),
Route("R12", "c3d-urdf-joints", 80, tracks=("articulated_object",), languages=("urdf_blender",),
kinds=("baseline", "refine", "rebuild", "repair"),
why="joints, limits and axes: joint_sweep fires on 38% and motion_direction on 35% of urdf runs"),
diff --git a/harness/codeverse3d/skills/telemetry.py b/harness/codeverse3d/skills/telemetry.py
index 93885c35..1b35f1c7 100644
--- a/harness/codeverse3d/skills/telemetry.py
+++ b/harness/codeverse3d/skills/telemetry.py
@@ -1,11 +1,19 @@
-"""Did anyone actually READ it? The measurement no CLI can do for us.
+"""Did anyone actually READ it? Measured from the CLI's own record where there is one.
The fact this whole system has to answer: ``read_cookbook`` was called by **0 of 16**
zone sessions and 1 of 4 env sessions on ``scenes_v1_flash``, although the prompt named
five chapters by title. A tool that exists is not a tool that gets used, and shipping a
nicer file format without measuring reads would repeat that at a new price.
-Three signals, cheapest first:
+**Ground truth first (2026-09-22).** Every CLI backend now folds its session's tool
+calls into ``trajectories/<label>/transcript.jsonl`` (``agents/cli_common.record_tool_calls``:
+claude-code's ``Skill``/``Read`` from stream-json, gemini-cli's ``activate_skill``/
+``read_file`` from its chat record, codex's shell commands from ``exec --json``). A
+bundle is *surfaced* when a call activated it or named its ``SKILL.md``, *deep* when a
+call named a file under its ``references/``, and the control is read when a call touched
+it — ``SkillsUsage.evidence == "transcript"``. Only when a session after the attach left
+no trace does the probe fall back to the atime signals below, which the control proved
+blind in 27 of 33 sessions (docs/SKILLS.md §9):
1. **atime probe** — the root filesystem is ext4 with ``relatime``, where the first read
after a write bumps ``atime``. ``materialize_skills`` stamps ``atime == mtime`` on
@@ -34,10 +42,13 @@ from __future__ import annotations
import json
import logging
+import re
+from collections.abc import Sequence
from pathlib import Path
from typing import Any
from codeverse3d.contracts.run import SkillRead, SkillsUsage
+from codeverse3d.proc import read_jsonl_lenient
from codeverse3d.skills.model import SkillsMaterialized
from codeverse3d.skills.prompting import AGENTS_SKILL_ROOT, CLAUDE_SKILL_ROOT
@@ -58,16 +69,26 @@ def _opened(path: Path) -> bool:
def probe_reads(ws_root: Path, materialized: SkillsMaterialized) -> SkillsUsage:
- """What the session did with the bundles we attached, per skill."""
+ """What the sessions since the attach did with the bundles we attached, per skill.
+
+ From their tool traces when every one of them left one; from atime otherwise."""
+ from codeverse3d.skills.materialize import CONTROL_NAME
+
root = Path(ws_root)
control_present, control_read = _control_state(root)
+ trace = trace_reads(root, [*materialized.listed, CONTROL_NAME], since=materialized.attached_at)
+ if trace is not None:
+ control_read = control_present and any(trace[CONTROL_NAME])
reads: list[SkillRead] = []
for sel in materialized.selections:
name = sel.name
bundles = [root / r / name for r in (AGENTS_SKILL_ROOT, CLAUDE_SKILL_ROOT)]
refs = [f for b in bundles for f in sorted((b / "references").glob("*.md"))]
- surfaced = any(_opened(b / "SKILL.md") for b in bundles)
- deep = any(_opened(f) for f in refs)
+ if trace is not None:
+ surfaced, deep = trace[name]
+ else:
+ surfaced = any(_opened(b / "SKILL.md") for b in bundles)
+ deep = any(_opened(f) for f in refs)
# reading a reference means the bundle was reached, whatever SKILL.md's atime says
# (relatime can miss the second access within 24 h, and some CLIs stream the body
# out of their own index rather than re-opening the file)
@@ -81,9 +102,65 @@ def probe_reads(ws_root: Path, materialized: SkillsMaterialized) -> SkillsUsage:
body_tokens_read=sum(r.body_tokens for r in reads if r.deep),
inlined=materialized.inlined,
control_present=control_present, control_read=control_read,
+ evidence="transcript" if trace is not None else "atime",
)
+def trace_reads(ws_root: Path, names: Sequence[str], *, since: float = 0.0) -> dict[str, tuple[bool, bool]] | None:
+ """``{name: (surfaced, deep)}`` from the tool calls the CLI sessions logged after ``since``.
+
+ ``None`` — "no ground truth, use the fallback" — when no session ran after the attach,
+ or when one of them left no ``tool_trace`` marker (a CLI that died before its backend
+ could read its record, or a backend that cannot): that session's reads would be
+ MISSING, not absent, and a partial trace would under-count exactly like a blind probe
+ over-counts. A session is a transcript with an ``invoke`` row at or after ``since``."""
+ from codeverse3d.agents.cli_common import TOOL_CALL_ROW, TOOL_TRACE_ROW
+ from codeverse3d.workspace import Workspace
+
+ sessions = traced = 0
+ calls: list[dict[str, Any]] = []
+ for path in sorted(Workspace(ws_root).trajectories.glob("*/transcript.jsonl")):
+ try:
+ if path.stat().st_mtime < since:
+ continue
+ except OSError:
+ continue
+ rows = [r for r in read_jsonl_lenient(path, dicts_only=True) if _t(r) >= since]
+ if not any(r.get("kind") == "invoke" for r in rows):
+ continue
+ sessions += 1
+ if any(r.get("kind") == TOOL_TRACE_ROW for r in rows):
+ traced += 1
+ calls += [r for r in rows if r.get("kind") == TOOL_CALL_ROW]
+ if not sessions or traced < sessions:
+ return None
+ return {n: _called(n, calls) for n in names}
+
+
+def _t(row: dict[str, Any]) -> float:
+ try:
+ return float(row.get("t") or 0.0)
+ except (TypeError, ValueError):
+ return 0.0
+
+
+def _called(name: str, calls: Sequence[dict[str, Any]]) -> tuple[bool, bool]:
+ """(surfaced, deep) for one bundle. Matched on ``<name>/SKILL.md`` and
+ ``<name>/references/<file>`` anywhere in a call's arguments, so a relative path, an
+ absolute one, codex's ``r1/<name>/SKILL.md`` root alias expanded or not, and a
+ ``cat``/``sed`` shell line all count; a listing of ``references`` does not."""
+ body = re.compile(rf"(?<![\w-]){re.escape(name)}/SKILL\.md")
+ ref = re.compile(rf"(?<![\w-]){re.escape(name)}/references/[^\s\"'`]+")
+ surfaced = deep = False
+ for c in calls:
+ if c.get("failed"): # the CLI's own verdict: that read returned nothing
+ continue
+ text = json.dumps(c.get("args") or {}, ensure_ascii=False)
+ deep = deep or bool(ref.search(text))
+ surfaced = surfaced or c.get("skill") == name or bool(body.search(text))
+ return surfaced or deep, deep
+
+
def _control_state(root: Path) -> tuple[bool, bool]:
"""(a control was materialised, something opened it) — the probe's own falsification."""
from codeverse3d.skills.materialize import CONTROL_NAME
@@ -114,4 +191,4 @@ def append_usage(ws_root: Path, usage: SkillsUsage, **context: Any) -> Path | No
return None
-__all__ = ["ATIME_EPSILON_S", "SKILLS_FILE", "TELEMETRY_DIR", "append_usage", "probe_reads"]
+__all__ = ["ATIME_EPSILON_S", "SKILLS_FILE", "TELEMETRY_DIR", "append_usage", "probe_reads", "trace_reads"]
diff --git a/harness/codeverse3d/tracks/skills_hook.py b/harness/codeverse3d/tracks/skills_hook.py
index da0a8750..86648231 100644
--- a/harness/codeverse3d/tracks/skills_hook.py
+++ b/harness/codeverse3d/tracks/skills_hook.py
@@ -4,9 +4,11 @@ Kept out of ``codeverse3d/skills`` so that package stays pure (no ``RunContext``
workspace conventions, no environment) and testable without a run. Kept out of
``steps.py`` so a round's control flow does not grow a second subject.
-Everything here is a no-op unless ``C3D_SKILLS`` is on, and every function swallows its
-own failures: a skill that cannot be routed, written or probed must cost that skill, not
-the round. The switch is read at CALL time (see ``skills/config.py`` for why).
+Everything here is a no-op when ``C3D_SKILLS=0`` (the system is ON by default since
+2026-09-22), and every function swallows its own failures: a skill that cannot be routed,
+written or probed must cost that skill, not the round. The switch is read at CALL time
+(see ``skills/config.py`` for why). ``record_usage`` reads what the round's sessions did
+from their CLIs' own tool calls (``skills/telemetry.probe_reads``), atime only as fallback.
"""
from __future__ import annotations
diff --git a/harness/tests/skills/test_config.py b/harness/tests/skills/test_config.py
index 06ff644b..015132f5 100644
--- a/harness/tests/skills/test_config.py
+++ b/harness/tests/skills/test_config.py
@@ -13,21 +13,38 @@ from codeverse3d.skills import config as C
from codeverse3d.tracks import plan_features as F
-def test_off_by_default(monkeypatch):
+def test_on_by_default(monkeypatch):
+ """Flipped 2026-09-22 (owner): every backend is a vendor CLI with a native skill loader,
+ and the whole library routes — the cap of 5 per session is the cost knob, not the switch."""
for env in (C.SKILLS_ENV, C.SKILLS_MAX_ENV, C.SKILLS_UNVERIFIED_ENV):
monkeypatch.delenv(env, raising=False)
- assert C.skills_enabled() is False
- assert C.skills_unverified() is False
+ assert C.skills_enabled() is True
+ assert C.skills_unverified() is True
assert C.skills_max() == C.DEFAULT_SKILLS_MAX == 5
@pytest.mark.parametrize("raw, want", [("on", True), ("1", True), ("true", True), ("YES", True),
- ("off", False), ("0", False), ("", False), ("maybe", False)])
+ ("off", False), ("0", False), ("", True), ("maybe", False)])
def test_flag_spellings(monkeypatch, raw, want):
+ """Unset or empty is the default (ON); garbage is OFF, never the variant — a typo in a
+ bench command must produce a control run (``config.env_flag``)."""
monkeypatch.setenv(C.SKILLS_ENV, raw)
assert C.skills_enabled() is want
[email protected]("raw", ["0", "off", "false", "no"])
+def test_c3d_skills_0_turns_both_off(monkeypatch, raw):
+ """The ONE off switch an A/B control arm sets: nothing is enabled, whatever UNVERIFIED says."""
+ monkeypatch.setenv(C.SKILLS_ENV, raw)
+ monkeypatch.delenv(C.SKILLS_UNVERIFIED_ENV, raising=False)
+ assert C.skills_enabled() is False
+
+
+def test_unverified_can_still_be_turned_off(monkeypatch):
+ monkeypatch.setenv(C.SKILLS_UNVERIFIED_ENV, "0")
+ assert C.skills_unverified() is False
+
+
def test_read_at_call_time_not_cached(monkeypatch):
monkeypatch.setenv(C.SKILLS_ENV, "on")
assert C.skills_enabled()
@@ -47,3 +64,16 @@ def test_the_switches_are_registered_as_live_not_dead():
assert env not in F.DEAD_SWITCHES
assert F.LIVE_SWITCHES[env] == "codeverse3d/skills/config.py"
assert F.dead_env_keys({C.SKILLS_ENV: "on"}) == []
+
+
+def test_doctor_reports_the_default_and_the_gemini_pin(monkeypatch):
+ """`3dcode doctor --skills`: ON is the healthy state now, and gemini-cli's skills.enabled
+ must be pinned in the per-session system settings (a user file could turn it off)."""
+ from codeverse3d.doctor import check_skills
+
+ monkeypatch.delenv(C.SKILLS_ENV, raising=False)
+ rows = {name: status for name, status, _ in check_skills()}
+ assert rows["skills switch"] == "OK" and rows["gemini-cli skills setting"] == "OK"
+ assert rows["claude-code Skill tool"] == "OK"
+ monkeypatch.setenv(C.SKILLS_ENV, "0")
+ assert {name: status for name, status, _ in check_skills()}["skills switch"] == "WARN"
diff --git a/harness/tests/skills/test_end_to_end.py b/harness/tests/skills/test_end_to_end.py
index ae4604ae..eac6b9b2 100644
--- a/harness/tests/skills/test_end_to_end.py
+++ b/harness/tests/skills/test_end_to_end.py
@@ -142,7 +142,7 @@ def test_enabled_run_delivers_routes_repairs_and_records_skills(run):
def test_the_switch_off_leaves_no_trace(tmp_path, chair_plan, settings, monkeypatch):
- monkeypatch.delenv("C3D_SKILLS", raising=False)
+ monkeypatch.setenv("C3D_SKILLS", "0") # ON is the default since 2026-09-22; off must be said
ws = Workspace(tmp_path / "runs" / "chair_off")
track = StaticObjectTrack(services=FakeServices(contract_errors=1), judge=FakeJudge(scores=(0.55, 0.7, 0.85)),
agent=FakeAgent(_agent_writer),
diff --git a/harness/tests/skills/test_hook.py b/harness/tests/skills/test_hook.py
index 837a7d6e..338b82b5 100644
--- a/harness/tests/skills/test_hook.py
+++ b/harness/tests/skills/test_hook.py
@@ -38,7 +38,7 @@ def ctx(tmp_path: Path, library_dir: Path, monkeypatch):
def test_the_switch_off_means_no_files_no_events_no_record(ctx, monkeypatch):
- monkeypatch.delenv(C.SKILLS_ENV, raising=False)
+ monkeypatch.setenv(C.SKILLS_ENV, "0") # ON is the default since 2026-09-22; off must be said
assert H.attach_for_round(ctx, index=0, kind="baseline") is None
assert not (ctx.ws.root / ".agents").exists()
assert ctx.events == [] and ctx.extra == {}
diff --git a/harness/tests/skills/test_telemetry.py b/harness/tests/skills/test_telemetry.py
index dc63ebb5..a93bb3de 100644
--- a/harness/tests/skills/test_telemetry.py
+++ b/harness/tests/skills/test_telemetry.py
@@ -174,3 +174,130 @@ def _touch(path):
st = os.stat(path)
os.utime(path, (st.st_mtime + 60, st.st_mtime))
time.sleep(0)
+
+
+# ===================================================================== transcript evidence
+# Since 2026-09-22 every CLI backend folds its session's tool calls into
+# trajectories/<label>/transcript.jsonl (agents/cli_common.record_tool_calls), and the probe
+# reads THOSE first. The rows below are shaped like the four live 2026-09-22 sessions
+# (tests/agents/test_tool_trace.py holds the vendor-side excerpts).
+
+def _session(ws: Path, label: str, calls: list[dict], *, t: float, traced: bool = True) -> None:
+ d = ws / "trajectories" / f"{label}_r00"
+ d.mkdir(parents=True, exist_ok=True)
+ rows = [{"t": t, "kind": "invoke", "argv": ["cli"], "attempt": 1},
+ *({"t": t + 1, "kind": "tool_call", **c} for c in calls)]
+ if traced:
+ rows.append({"t": t + 2, "kind": "tool_trace", "calls": len(calls), "source": "test"})
+ with (d / "transcript.jsonl").open("a") as fh:
+ fh.writelines(json.dumps(r) + "\n" for r in rows)
+
+
+def _git_read_everything(ws: Path) -> None:
+ """What `git add -A -N` + `git diff` does to the atime of every bundle file."""
+ for f in ws.rglob("*.md"):
+ if "/skills/" in str(f):
+ _touch_read(f)
+
+
+def test_the_cli_transcript_is_the_evidence_when_every_session_left_one(ws, library):
+ import time
+
+ got = _attach(ws, library)
+ a, b = got.listed[:2]
+ _session(ws, "baseline", [
+ {"tool": "Skill", "args": {"skill": a}, "skill": a}, # claude / gemini
+ {"tool": "command_execution", "args": {"command": f"sed -n '1,280p' .agents/skills/{b}/SKILL.md"}},
+ {"tool": "view_file", "args": {"AbsolutePath": f"{ws}/.agents/skills/{b}/references/worked_example.md"}},
+ ], t=time.time() + 1)
+ _git_read_everything(ws) # the atime probe would now call every bundle, and the control, read
+ usage = probe_reads(ws, got)
+ assert usage.evidence == "transcript"
+ assert usage.surfaced == [a, b] and usage.deep == [b]
+ assert not usage.control_read and usage.probe_trustworthy
+ assert usage.deep_read_rate == 1 / len(got.listed)
+
+
+def test_a_session_without_a_trace_sends_the_probe_back_to_atime(ws, library):
+ """A partial trace would under-count exactly as a blind probe over-counts."""
+ import time
+
+ got = _attach(ws, library)
+ _session(ws, "baseline", [{"tool": "Skill", "args": {}, "skill": got.listed[0]}], t=time.time() + 1)
+ _session(ws, "repair", [], t=time.time() + 2, traced=False) # e.g. a CLI killed before its record
+ usage = probe_reads(ws, got)
+ assert usage.evidence == "atime" and usage.surfaced == []
+
+
+def test_only_sessions_after_the_attach_are_credited(ws, library):
+ import time
+
+ got = _attach(ws, library)
+ name = got.listed[0]
+ _session(ws, "old", [{"tool": "Skill", "args": {}, "skill": name}], t=got.attached_at - 100)
+ _session(ws, "baseline", [{"tool": "Read", "args": {"file_path": "src/model.py"}}], t=time.time() + 1)
+ usage = probe_reads(ws, got)
+ assert usage.evidence == "transcript" and usage.surfaced == [] # last round's activation is last round's
+
+
+def test_a_call_the_cli_marked_failed_read_nothing(ws, library):
+ """codex 0.155.1, 2026-09-22: its first `sed` expanded the skill-root alias wrongly and exited 2."""
+ import time
+
+ got = _attach(ws, library)
+ name = got.listed[0]
+ _session(ws, "baseline", [{"tool": "command_execution", "failed": True,
+ "args": {"command": f"sed -n 1,240p /home/u/.codex/skills/.system/{name}/SKILL.md"}}],
+ t=time.time() + 1)
+ assert probe_reads(ws, got).surfaced == []
+
+
+def test_an_agent_that_opens_the_control_is_reported_not_called_blind(ws, library):
+ import time
+
+ from codeverse3d.skills.materialize import CONTROL_NAME
+
+ got = _attach(ws, library)
+ _session(ws, "baseline", [{"tool": "read_file", "args": {"file_path": f".agents/skills/{CONTROL_NAME}/SKILL.md"}}],
+ t=time.time() + 1)
+ usage = probe_reads(ws, got)
+ assert usage.evidence == "transcript" and usage.control_read
+ assert usage.probe_trustworthy and usage.deep_read_rate == 0.0 # exact: it read the control, and nothing else
+
+
+def test_the_path_match_is_exact_about_names_and_about_reading():
+ from codeverse3d.skills.telemetry import _called
+
+ def called(*args: dict) -> tuple[bool, bool]:
+ return _called("c3d-scene", [{"args": a} for a in args])
+
+ assert called({"file_path": "/ws/.claude/skills/c3d-scene/SKILL.md"}) == (True, False)
+ assert called({"command": "cat r1/c3d-scene/SKILL.md"}) == (True, False) # codex's root alias
+ assert called({"AbsolutePath": "/ws/.agents/skills/c3d-scene/references/a.md"}) == (True, True)
+ assert called({"DirectoryPath": "/ws/.agents/skills/c3d-scene/references"}) == (False, False) # a listing
+ assert called({"file_path": ".agents/skills/c3d-scene-water/SKILL.md"}) == (False, False) # a longer name
+ assert called({"file_path": ".agents/skills/xc3d-scene/SKILL.md"}) == (False, False)
+ assert called({"pattern": "src/**"}) == (False, False)
+
+
+def test_the_report_counts_exact_sessions_and_drops_only_blind_ones(tmp_path):
+ from typer.testing import CliRunner
+
+ from codeverse3d.cli.main import app
+
+ tele = tmp_path / "run" / TELEMETRY_DIR
+ tele.mkdir(parents=True)
+ rows = [ # exact, the agent opened the control too: counted, and said so
+ {"agent": "gemini-cli:gemini-3.7-flash", "listed": ["c3d-a"], "evidence": "transcript",
+ "control_present": True, "control_read": True, "reads": [{"name": "c3d-a", "surfaced": True, "deep": True}]},
+ # atime, control fired: blind, dropped
+ {"agent": "codex:gpt-5.6-luna", "listed": ["c3d-a"], "control_present": True, "control_read": True,
+ "reads": [{"name": "c3d-a", "surfaced": True, "deep": True}]},
+ ]
+ (tele / SKILLS_FILE).write_text("".join(json.dumps(r) + "\n" for r in rows))
+ r = CliRunner().invoke(app, ["skills", "report", str(tmp_path), "--json"])
+ assert r.exit_code == 0, r.output
+ out = json.loads(r.output)
+ assert out["transcript_sessions"] == 1 and out["control_opened_by_agent_sessions"] == 1
+ assert out["control_read_sessions"] == 1
+ assert [(s["backend"], s["deep"]) for s in out["skills"]] == [("gemini-cli", 1)]