Official Codebase of 3DCodeVerse
Python
docs: D48 — the slice-channel evidence chain, interfaces, and the cost line
gaoypeng5c1d9aacf8a2
diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.mdindex 55096ad1..fea688e9 100644--- a/harness/docs/ARCHITECTURE.md+++ b/harness/docs/ARCHITECTURE.md@@ -352,7 +352,20 @@ OPEN with the gap, the lowest point above the floor) and a CONNECTIVITY PASSED pthat also forbids the interpenetration checklist claim. It is rendered from the stored`GateReport`, so `3dcv judge <slug>` and calibration see exactly what the in-run judgesaw, and a round recorded before the ledger existed renders byte-identical to before-(`ObjectPipeline.judge_context` stays empty on purpose — one source). Floors,+(`ObjectPipeline.judge_context` stays empty on purpose — one source). On an+object-track round whose connectivity gate carries an ERROR, the payload+conditionally grows **cross-section slices** (D48, `Settings.judge.slices =+"on-error"`): `spatial.sections.judge_slices` cuts the round's GLB+(`JudgeInput.glb_path`) on the two vertical centre planes — per-part fills with a+legend, red hatch ONLY on the gate's ERROR penetration pairs, plain darkened blends+for every other in-plane overlap, degenerate slices dropped — and the ≤ 2 PNGs are+appended AFTER the montages and crops with a factual rig-text block (an in-plane gap+is not evidence of disconnection) plus one provenance-elicitation sentence in the+defect-checklist bullet ("say where it is visible … or state that it rests on the+measured text alone"). A clean round's payload is **byte-identical** to the+unconditional one (test-pinned; `judge_prompt_hash` unchanged), the render is local+CPU, and the typed `SliceManifest` beside the PNGs keeps every "visible in slice n"+citation auditable. Floors,deterministic caps from gate findings (`data["kind"]`), console errors, missingmust-acceptance and`missing_views` rules apply on top; degraded verdicts are glitches, not scores.diff --git a/harness/docs/COST.md b/harness/docs/COST.mdindex 11173e11..57d9681c 100644--- a/harness/docs/COST.md+++ b/harness/docs/COST.md@@ -605,6 +605,15 @@ same-cap). The rejected 14-singles arm B cost $0.198 & 67.5k tok/verdict for aflash replica prices a C verdict at ~$0.032, and 3 montages would silently drop thelow ring + poles).+### Conditional slices (D48, 2026-08-31): the dirty verdict got CHEAPER++The gate-ERROR-only slice channel (docs/DECISIONS.md D48) measured **$0.154/dirty+verdict vs $0.172 baseline** (n=3, 3.1-pro, 14 conn-dirty rows) — the two extra+small PNGs are outweighed by shorter narration — and a clean round's payload is+byte-identical, so at production dirty ratios the channel amortises to **≤ $0**.+The slice render itself is local CPU (shapely + matplotlib, a few seconds). No+profile carries a dial for it; `CV3D_JUDGE__SLICES=off` is the kill switch.+### The crop-count experiment — INCONCLUSIVE, not adoptedThe other payload lever is the **image count**. The same rounddiff --git a/harness/docs/DECISIONS.md b/harness/docs/DECISIONS.mdindex e3f29aa0..f4ef5eda 100644--- a/harness/docs/DECISIONS.md+++ b/harness/docs/DECISIONS.md@@ -477,6 +477,39 @@ written) that were accepted because the code works that way and the tests pin itdrops −0.195 → −0.126: re-keying every σ threshold to buy half the noise is a badtrade; **t = 0.2 stays**.+* **D48 Conditional cross-section slices + provenance elicitation on gate-ERROR rounds+ (2026-08-31).** Context: the judge's interpenetration verdicts were reading+ comprehension of the gate text, not seeing (D47's provenance pass: pure-view TP 0/14+ in every arm). Three measured iterations on the same 42-item battery (n=3 pro),+ under a pre-registered stopping rule — adopt only if the guarded image-cited+ interp majority on the 14 conn-dirty rows reaches 8/14, with a per-vote provenance+ guard that verifies every "visible in slice n" citation against the slice manifest+ and PNGs: **v1** (slices always on + a primed rig text) hit 8/14 but primed the+ defect and damaged clean rounds; **v2** (de-primed: F1 hatch only gate-ERROR pairs,+ F2 neutral legend "measured overlap (gate ERROR)", F3 anti-over-read sentence, F4+ degenerate-slice drop) killed the clean-row damage but fell to 5/14 — the judges+ still *saw* (the catches stayed) but stopped narrating; **v3** (conditional: slices+ + one neutral elicitation sentence ONLY on rounds whose connectivity gate carries an+ ERROR; every clean row byte-identical to production by construction) restored+ **8/14 guard-verified** (2/23 citations fabricated, both guard-caught, 0 rows+ flipped) with honest negatives: on the 4 rows whose error pairs miss both centre+ planes the judges wrote text-only evidence in 10/12 present-votes instead of+ inventing citations. Both real catches retained (gate_valve wrong_orientation+ 3/3, clock_theirs hatch-verified interp); dirty-row mean at CPROD parity excluding+ the one collapse; clean−dirty gap 0.155 → 0.198. Cost: dirty verdict **$0.154 vs+ $0.172** baseline — cheaper — so amortised ≤ $0 and no profile dial moves.+ Shipped: `spatial.sections.judge_slices` (+ typed `SliceManifest` beside the PNGs —+ citations stay auditable), `JudgeInput.glb_path`, `Settings.judge.slices`+ ("on-error" default | "off", `CV3D_JUDGE__SLICES`), slices appended AFTER the+ montages/crops with the F2/F3 rig text and the elicitation sentence in the DEFECT+ CHECKLIST bullet; clean rounds byte-identical (test-pinned), `judge_prompt_hash`+ untouched. **Watch item before D48 is called done** (b36_v0_02): the elicitation+ sentence changes defect-marking *behaviour*, not just narration — its per-defect+ sweep made three samples consistent on render-true defects and the multiplicative+ cap stack took the row 0.54 → 0.008 (every added defect was already a minority vote+ in the other arms; direction correct, magnitude brutal). The first production+ battery must re-check dirty-round defect rates and cap stacking.+## Rejected / deferred* A versioned `Spec`/`RunRecord`/`RunState` load-normaliser (rejected 2026-08-30: of the sevendiff --git a/harness/docs/EVAL.md b/harness/docs/EVAL.mdindex c7c7494b..39195beb 100644--- a/harness/docs/EVAL.md+++ b/harness/docs/EVAL.md@@ -706,3 +706,38 @@ render_artifacts vs 0.965 blind) but posts the worst clean/dirty gap (0.112), throw-σ (0.040) and a windmill relapse to 0.62 — rejected; the replace-the-bottom-cropvariant stays queued. Temperature A2 @ t=0 ($6.0): σ 0.037 → 0.022 (8/42 rows exactlydeterministic) but mean −0.037 and pearson(gate errors) −0.195 → −0.126 — t = 0.2 stays.++**2026-08-31 — conditional cross-section slices ADOPTED (D48): three iterations under a+pre-registered stopping rule.** Question: can the judge be made to SEE interpenetration+(D47's provenance pass: pure-view TP 0/14 in every arm — the 14/14 naive figure measured+reading comprehension of the shared gate text)? Instrument: the same 42-item battery,+n=3 pro, 14 rows conn-dirty; the metric is the **guarded image-cited interp majority**+on those 14, bar fixed at 8/14 BEFORE the last iteration ran.++*Provenance-guard methodology.* Every interp PRESENT vote that cites a slice is checked+against the slice's own manifest and, where decisive, the PNG. Citation classes:+**A** = the slice is named AND the named part pair is verbatim in that slice's hatched+list; **B** = the slice is named with no pair, but the slice genuinely carries hatch+("slice 1 shows massive red hatched areas" over a slice that does). A cited slice with+no hatch, or a cited pair the manifest contradicts, is a FAIL and the vote is discarded.+v3: 13 A votes + 8 B votes counted, 2 FAILs (a pair-swap parroted from the gate text; a+citation into an empty slice) — 2/23 fabrication, 0 rows flipped by the guard. Two rows+reach majority through B votes only; both were PNG-read and the hatch is real, so 8/14+stands (a pair-named-only reading gives 6/14 and discards PNG-true citations).++*The three iterations.* **v1** (slices always on, primed rig text): 8/14 but the wording+primed the defect and clean rounds took damage — rejected. **v2** (de-primed: hatch only+gate-ERROR pairs, neutral legend, anti-over-read sentence, degenerate-slice drop): clean+damage gone, but 5/14 — the seeing survived (catches retained), the narration did not.+**v3** (conditional on a connectivity gate ERROR + one neutral elicitation sentence in+the defect-checklist bullet; 28 clean rows byte-identical CPROD by construction): **8/14+guard-verified**, honest negatives on the 4 rows whose error pairs miss both centre+planes (10/12 present-votes there say text-only rather than inventing a citation), both+real catches retained (gate_valve wrong_orientation 0.700→0.500 at 3/3; clock_theirs+hatch-verified 3×A), dirty mean at CPROD parity excluding one row, clean−dirty gap+0.155→0.198, dirty verdict $0.154 vs $0.172 (cheaper; docs/COST.md §14). Caveat carried+into D48 as a watch item: b36_v0_02 collapsed 0.54→0.008 — every added defect was a+minority vote in the other arms and render-true, but the elicitation's per-defect sweep+made three samples consistent and the multiplicative cap stack did the rest; the first+production battery re-checks dirty-round defect rates and cap stacking before D48 is+called done.diff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.mdindex 80501190..5af9e371 100644--- a/harness/docs/INTERFACES.md+++ b/harness/docs/INTERFACES.md@@ -293,6 +293,11 @@ check_placement(ws, *, indoor=None, force_probe=False) -> GateReport # gate "splacement_gate_safe(census, *, plan=None) -> GateReport | None # round gate: None without a table, WARN on failure, never raisesfrom codeverse.spatial.scene_placement import setting_text # (plan: dict | model) -> the indoor/outdoor setting linefrom codeverse.spatial.silhouette import compare_silhouette+from codeverse.spatial.sections import judge_slices, SliceManifest, JUDGE_SLICE_PLANES # (D48)+judge_slices(glb, error_pairs, out_dir, planes=("front_back","left_right")) -> SliceManifest # two vertical centre slices,+ # red hatch ONLY on error_pairs (the connectivity gate's ERROR penetration pairs), plain darkened blend otherwise,+ # degenerate slices dropped (F4) → 0–2 PNGs (slice_<name>.png, manifest.json beside them; JudgeSlice.png is a bare+ # file name); needs the mesh extra (shapely + matplotlib), ImportError propagates; a bad GLB → manifest.errors, no raisefrom codeverse.spatial.joints import load_urdf, fk, sweep_collisions, urdf_to_glb, render_poses # RESERVED_LINK_NAMES={'world'}from codeverse.spatial.joints_collide import components # (names, edges) -> list[set[str]]: THE union-find (connectivity + sweep)# the joint_sweep TOOL body lives in spatial/tools.py (no joint_sweep_observation helper; render_poses takes no renderer=)@@ -319,10 +324,21 @@ VlmJudge(rubric="static_object_v1", model_id=None (settings.default_judge = gemitemperature=0.2, *, thinking="low", max_attempts=3, max_montages=3, detail_crops=2, max_px=1024, sample_budget_s=240,chat_model=None, cache_dir=None, label="judge") # Δ max_images is GONE → montage budgetVlmJudge.judge(inp) -> Judgment # clay/normals views travel ONLY as JudgeInput.geometry_views (no kwarg)+VlmJudge.slice_payload(inp) -> (list[(label, png_path)], provenance_elicitation: bool) # (D48) ([], False) unless+ # Settings.judge.slices=="on-error" AND spec.track in judges.base.SLICE_TRACKS AND inp.glb_path exists AND the+ # connectivity gate has ≥1 ERROR; renders judge_slices into the judge cache (keyed by glb identity + error pairs)from codeverse.judges.base import JudgeInput # (spec, renders, measurement=None, gates=[], acceptance=[], plan_summary="",- # round_index=0, previous=None, extra_context="", geometry_views=None)+ # round_index=0, previous=None, extra_context="", geometry_views=None,+ # glb_path=None (D48: the round's canonical GLB; object tracks + 3dcv judge fill it))from codeverse.judges.prompt_builder import plan_montages, render_montage, Montage # ≤3 2×2 montages (shaded/geometry/poses) + ≤2 detail# crops @≤1024px replace sheet+9 views; clay/normals views (RenderView.mode) auto-route to the GEOMETRY montage+from codeverse.judges.prompt_builder import build_judge_messages, connectivity_error_pairs, PROVENANCE_ELICITATION+build_judge_messages(inp, rubric, *, …, extra_images=None (PREpended: references), extra_text="",+ slice_images=None, provenance_elicitation=False) -> (system, [ChatMessage]) # (D48) slice_images+ # (label, path) are APPENDED after the montages/crops + described by slice_rig_section in the view-rig text;+ # provenance_elicitation appends one sentence to the DEFECT CHECKLIST bullet. Defaults build the byte-identical+ # pre-D48 payload; judge_prompt_hash(rubric) is unchanged either way (per-round content stays outside the hash)+connectivity_error_pairs(gates) -> list[(a, b)] # the gate's ERROR penetration pairs via finding.target/data.otherfrom codeverse.judges.rubrics import is_degraded, aggregate_samples, SCORING_VERSION # ScoreBreakdown adds defects,# defect_votes (majority; a defect tie → absent, an acceptance tie → representative sample, D36 as amended# 2026-08-30), tie_broken, defect_penalty, overall_after_defects, overridden (defects the measured-absent