Official Codebase of 3DCodeVerse
Python
addons: the gallery and the dataset tools move out of the core, one-way boundary pinned
gaoypengc02141fd9e2f
diff --git a/harness/bench/report.py b/harness/bench/report.pyindex 4cdeba5b..e4a5e4cd 100644--- a/harness/bench/report.py+++ b/harness/bench/report.py@@ -3,7 +3,7 @@``build_report(out_dir)`` reads ``results.jsonl`` (or results.json), aggregatesmean/median/pass-rate/cost per tier and category, writes ``report.md`` and``report.html`` — the same self-contained page as ``3dcv gallery build --embed``-(``codeverse.gallery``), one section per tier, with the stats tables under the+(``codeverse.addons.gallery``), one section per tier, with the stats tables under thesummary strip."""@@ -20,9 +20,9 @@ from bench._compare_report import _f as _fmtfrom bench._compare_report import _meanfrom bench._jsonl import read_jsonlfrom bench.run_bench import BenchItemResult+from codeverse.addons.gallery import GalleryIndex, RootSection, RunEntry, render_static+from codeverse.addons.gallery.index import entry_from_recordfrom codeverse.flywheel.record import RecordError, load_record-from codeverse.gallery import GalleryIndex, RootSection, RunEntry, render_static-from codeverse.gallery.index import entry_from_recordfrom codeverse.workspace import WorkspaceTIER_ORDER = {"easy": 0, "medium": 1, "hard": 2}diff --git a/harness/codeverse/addons/__init__.py b/harness/codeverse/addons/__init__.pynew file mode 100644index 00000000..99c4a198--- /dev/null+++ b/harness/codeverse/addons/__init__.py@@ -0,0 +1,11 @@+"""Optional tools that READ finished runs — nothing a run needs in order to happen.++* ``gallery`` the run browser (``3dcv gallery serve|build``)+* ``dataset`` run records → samples, packs, preference pairs, captions, an index+ (``3dcv flywheel export|pairs|caption|index``)++The boundary is one-way and pinned by ``tests/core/test_addons_boundary.py``: an addon may+import anything in ``codeverse``; outside ``codeverse.cli`` nothing in ``codeverse`` imports an+addon. What a run itself writes (``record.json``, ``deliverable/``, telemetry) is NOT an+addon — that is ``codeverse.flywheel``.+"""diff --git a/harness/codeverse/addons/dataset/__init__.py b/harness/codeverse/addons/dataset/__init__.pynew file mode 100644index 00000000..8adadbac--- /dev/null+++ b/harness/codeverse/addons/dataset/__init__.py@@ -0,0 +1,9 @@+"""Run records → a dataset: what ``3dcv flywheel …`` does AFTER the runs exist.++* ``export`` ``export_samples(runs_dir, out_dir, min_score=..)`` → ``ExportReport``+* ``pack`` ``pack_samples(out_dir)`` (plain tars + byte-range locators, optional)+* ``pairs`` ``build_pairs(runs_dir, out_jsonl, min_delta=..)`` → n+* ``refine`` the refine-transition rows (``RefineTransition``)+* ``captions`` ``caption_sample(ws, record, model_id)`` → ``Captions``+* ``index`` ``build_index(runs_dir, out_sqlite)`` + query helpers+"""diff --git a/harness/codeverse/flywheel/captions.py b/harness/codeverse/addons/dataset/captions.pysimilarity index 100%rename from harness/codeverse/flywheel/captions.pyrename to harness/codeverse/addons/dataset/captions.pydiff --git a/harness/codeverse/flywheel/export.py b/harness/codeverse/addons/dataset/export.pysimilarity index 100%rename from harness/codeverse/flywheel/export.pyrename to harness/codeverse/addons/dataset/export.pydiff --git a/harness/codeverse/flywheel/index.py b/harness/codeverse/addons/dataset/index.pysimilarity index 100%rename from harness/codeverse/flywheel/index.pyrename to harness/codeverse/addons/dataset/index.pydiff --git a/harness/codeverse/flywheel/pack.py b/harness/codeverse/addons/dataset/pack.pysimilarity index 99%rename from harness/codeverse/flywheel/pack.pyrename to harness/codeverse/addons/dataset/pack.pyindex 6b037727..faa4a728 100644--- a/harness/codeverse/flywheel/pack.py+++ b/harness/codeverse/addons/dataset/pack.py@@ -25,7 +25,7 @@ from typing import Anyfrom pydantic import BaseModel, Field-from codeverse.flywheel.export import (+from codeverse.addons.dataset.export import (JSONL_NAME,PARQUET_NAME,ManifestEntry,diff --git a/harness/codeverse/flywheel/pairs.py b/harness/codeverse/addons/dataset/pairs.pysimilarity index 99%rename from harness/codeverse/flywheel/pairs.pyrename to harness/codeverse/addons/dataset/pairs.pyindex 4ffdfbbf..ec7f2e0c 100644--- a/harness/codeverse/flywheel/pairs.py+++ b/harness/codeverse/addons/dataset/pairs.py@@ -80,7 +80,7 @@ def _base(ws: Workspace, rec: RunRecord, kind: str, *, slug: str | None = None)#: the judge Δ at which two rounds are a preference pair — and, in-#: :mod:`codeverse.flywheel.refine`, the Δ at which a transition counts as improved. One+#: :mod:`codeverse.addons.dataset.refine`, the Δ at which a transition counts as improved. One#: constant, so a Δ that is a preference pair here is never "unchanged" there.MIN_PREFERENCE_DELTA = 0.05diff --git a/harness/codeverse/flywheel/refine.py b/harness/codeverse/addons/dataset/refine.pysimilarity index 98%rename from harness/codeverse/flywheel/refine.pyrename to harness/codeverse/addons/dataset/refine.pyindex 6e5f7eaa..8feea538 100644--- a/harness/codeverse/flywheel/refine.py+++ b/harness/codeverse/addons/dataset/refine.py@@ -1,6 +1,6 @@"""Refine rounds as transitions: what the round was told, what it changed, what it scored.-:mod:`codeverse.flywheel.pairs` exports whole code trees per round and never looks at what+:mod:`codeverse.addons.dataset.pairs` exports whole code trees per round and never looks at whatasked for the change, so a refine round arrives as two 30 kB files with no cause. Thisexports the transition instead — one row per refine round::@@ -27,10 +27,10 @@ from typing import Anyfrom pydantic import BaseModel, Field+from codeverse.addons.dataset.pairs import MIN_PREFERENCE_DELTAfrom codeverse.contracts.artifacts import Severityfrom codeverse.contracts.run import RoundRecord, RunRecordfrom codeverse.flywheel._git import GitReadError, changed_files_between, diff_between, read_tree_at-from codeverse.flywheel.pairs import MIN_PREFERENCE_DELTAfrom codeverse.flywheel.record import (BATTERY_MARKERS,effective_judgment,diff --git a/harness/codeverse/gallery/__init__.py b/harness/codeverse/addons/gallery/__init__.pysimilarity index 83%rename from harness/codeverse/gallery/__init__.pyrename to harness/codeverse/addons/gallery/__init__.pyindex 77fee54d..5c32f569 100644--- a/harness/codeverse/gallery/__init__.py+++ b/harness/codeverse/addons/gallery/__init__.py@@ -13,9 +13,9 @@* ``server`` ``GalleryApp.route`` + ``serve(...)`` — loopback-only unless --host is typed"""-from codeverse.gallery.compare import export_csv, render_compare-from codeverse.gallery.index import build_index, default_roots-from codeverse.gallery.model import (+from codeverse.addons.gallery.compare import export_csv, render_compare+from codeverse.addons.gallery.index import build_index, default_roots+from codeverse.addons.gallery.model import (VERDICTS,GalleryIndex,RootSection,@@ -25,8 +25,8 @@ from codeverse.gallery.model import (summarize,verdict_breakdown,)-from codeverse.gallery.page import build_static, render_static-from codeverse.gallery.server import (+from codeverse.addons.gallery.page import build_static, render_static+from codeverse.addons.gallery.server import (DEFAULT_HOST,DEFAULT_PORT,GalleryApp,diff --git a/harness/codeverse/gallery/cards.py b/harness/codeverse/addons/gallery/cards.pysimilarity index 98%rename from harness/codeverse/gallery/cards.pyrename to harness/codeverse/addons/gallery/cards.pyindex 31b2f982..c47649f5 100644--- a/harness/codeverse/gallery/cards.py+++ b/harness/codeverse/addons/gallery/cards.py@@ -14,9 +14,9 @@ Design rules this module exists to hold in one place:from __future__ import annotations-from codeverse.gallery.model import VERDICT_META, RunEntry, RunLink, humanize_view-from codeverse.gallery.theme import esc-from codeverse.gallery.urls import UrlMaker+from codeverse.addons.gallery.model import VERDICT_META, RunEntry, RunLink, humanize_view+from codeverse.addons.gallery.theme import esc+from codeverse.addons.gallery.urls import UrlMaker#: links promoted next to ``detail`` on the card, best-first — the one artifact#: you actually open for that trackdiff --git a/harness/codeverse/gallery/code.py b/harness/codeverse/addons/gallery/code.pysimilarity index 97%rename from harness/codeverse/gallery/code.pyrename to harness/codeverse/addons/gallery/code.pyindex bcd6a06f..6d0bc20d 100644--- a/harness/codeverse/gallery/code.py+++ b/harness/codeverse/addons/gallery/code.py@@ -12,9 +12,9 @@ from __future__ import annotationsimport refrom pathlib import Path-from codeverse.gallery.model import RunEntry-from codeverse.gallery.theme import esc, footer, page_shell, top_bar-from codeverse.gallery.urls import UrlMaker, safe_join+from codeverse.addons.gallery.model import RunEntry+from codeverse.addons.gallery.theme import esc, footer, page_shell, top_bar+from codeverse.addons.gallery.urls import UrlMaker, safe_joinMAX_VIEW_BYTES = 512 * 1024HIGHLIGHT_SUFFIXES = {".py", ".js", ".mjs", ".cjs", ".frag", ".vert", ".glsl", ".json"}diff --git a/harness/codeverse/gallery/compare.py b/harness/codeverse/addons/gallery/compare.pysimilarity index 97%rename from harness/codeverse/gallery/compare.pyrename to harness/codeverse/addons/gallery/compare.pyindex e2895f59..c6227fbb 100644--- a/harness/codeverse/gallery/compare.py+++ b/harness/codeverse/addons/gallery/compare.py@@ -15,10 +15,10 @@ import csvimport iofrom urllib.parse import quote-from codeverse.gallery.cards import fmt, tier_tag, verdict_tag-from codeverse.gallery.model import VERDICT_META, RunEntry-from codeverse.gallery.theme import esc, footer, page_shell, top_bar-from codeverse.gallery.urls import UrlMaker+from codeverse.addons.gallery.cards import fmt, tier_tag, verdict_tag+from codeverse.addons.gallery.model import VERDICT_META, RunEntry+from codeverse.addons.gallery.theme import esc, footer, page_shell, top_bar+from codeverse.addons.gallery.urls import UrlMaker#: how many runs a compare page will lay out before it says "too many"MAX_COMPARE = 8diff --git a/harness/codeverse/gallery/detail.py b/harness/codeverse/addons/gallery/detail.pysimilarity index 98%rename from harness/codeverse/gallery/detail.pyrename to harness/codeverse/addons/gallery/detail.pyindex c4e3c777..ad2fb298 100644--- a/harness/codeverse/gallery/detail.py+++ b/harness/codeverse/addons/gallery/detail.py@@ -12,15 +12,15 @@ from __future__ import annotationsfrom pathlib import Pathfrom urllib.parse import quote+from codeverse.addons.gallery.cards import fmt, gallery_figure, tier_tag, verdict_tag+from codeverse.addons.gallery.code import CODE_CSS, numbered, read_text, src_files+from codeverse.addons.gallery.index import _rel+from codeverse.addons.gallery.model import RunEntry+from codeverse.addons.gallery.theme import esc, footer, page_shell, top_bar+from codeverse.addons.gallery.urls import UrlMakerfrom codeverse.contracts.common import ENTRY_FILEfrom codeverse.contracts.run import RunRecordfrom codeverse.flywheel.record import best_round_record, effective_judgment-from codeverse.gallery.cards import fmt, gallery_figure, tier_tag, verdict_tag-from codeverse.gallery.code import CODE_CSS, numbered, read_text, src_files-from codeverse.gallery.index import _rel-from codeverse.gallery.model import RunEntry-from codeverse.gallery.theme import esc, footer, page_shell, top_bar-from codeverse.gallery.urls import UrlMakerfrom codeverse.workspace import WorkspaceDETAIL_CSS = CODE_CSS + """diff --git a/harness/codeverse/gallery/index.py b/harness/codeverse/addons/gallery/index.pysimilarity index 99%rename from harness/codeverse/gallery/index.pyrename to harness/codeverse/addons/gallery/index.pyindex 5dbf7097..a1d17729 100644--- a/harness/codeverse/gallery/index.py+++ b/harness/codeverse/addons/gallery/index.py@@ -1,7 +1,7 @@"""Build the gallery index from run roots.``build_index(roots)`` walks every run directory once, reads ``record.json`` and-turns it into a :class:`~codeverse.gallery.model.RunEntry` whose every path is+turns it into a :class:`~codeverse.addons.gallery.model.RunEntry` whose every path is**run-relative**. It is deliberately cheap (no image work, no git): ~80 runsindex in well under a second, which is what makes ``--reload`` free.@@ -15,6 +15,14 @@ from __future__ import annotationsimport timefrom pathlib import Path+from codeverse.addons.gallery.model import (+ GalleryIndex,+ RootSection,+ RoundRow,+ RunEntry,+ RunLink,+ humanize_view,+)from codeverse.contracts.run import RunId, RunRecordfrom codeverse.flywheel.quality import quality_tierfrom codeverse.flywheel.record import (@@ -28,14 +36,6 @@ from codeverse.flywheel.record import (load_record,)from codeverse.flywheel.sample import gate_error_summary, telemetry_digest-from codeverse.gallery.model import (- GalleryIndex,- RootSection,- RoundRow,- RunEntry,- RunLink,- humanize_view,-)from codeverse.proc import read_json_or_nonefrom codeverse.workspace import Workspacediff --git a/harness/codeverse/gallery/model.py b/harness/codeverse/addons/gallery/model.pysimilarity index 99%rename from harness/codeverse/gallery/model.pyrename to harness/codeverse/addons/gallery/model.pyindex c9008d23..3c318a1e 100644--- a/harness/codeverse/gallery/model.py+++ b/harness/codeverse/addons/gallery/model.py@@ -179,7 +179,7 @@ class RunEntry(BaseModel):@propertydef verdict(self) -> str:- """The triage bucket — exactly one of :data:`~codeverse.gallery.model.VERDICTS`.+ """The triage bucket — exactly one of :data:`~codeverse.addons.gallery.model.VERDICTS`.The four are disjoint *and* exhaustive on purpose: a status breakdown builtfrom them always sums to the number of runs on screen. A run whose recorddiff --git a/harness/codeverse/gallery/page.py b/harness/codeverse/addons/gallery/page.pysimilarity index 96%rename from harness/codeverse/gallery/page.pyrename to harness/codeverse/addons/gallery/page.pyindex 49c366cd..6a74d95a 100644--- a/harness/codeverse/gallery/page.py+++ b/harness/codeverse/addons/gallery/page.py@@ -1,7 +1,7 @@"""The index page: status rail, filters, per-battery sections, cards + table.Rendered identically for the local server and the static build — the only-difference is the :class:`~codeverse.gallery.urls.UrlMaker` it is handed. The+difference is the :class:`~codeverse.addons.gallery.urls.UrlMaker` it is handed. Theinitial filter is applied **server-side** (so ``curl '/?track=graphics'`` and ano-JS browser both see the right runs and the right summary) and then re-appliedclient-side on every keystroke without a reload.@@ -17,9 +17,9 @@ from __future__ import annotationsimport jsonfrom pathlib import Path-from codeverse.gallery.cards import TABLE_HEAD, fmt, render_card, render_row-from codeverse.gallery.index import build_index-from codeverse.gallery.model import (+from codeverse.addons.gallery.cards import TABLE_HEAD, fmt, render_card, render_row+from codeverse.addons.gallery.index import build_index+from codeverse.addons.gallery.model import (FILTER_KEYS,VERDICT_META,VERDICTS,@@ -29,8 +29,8 @@ from codeverse.gallery.model import (sort_entries,summarize,)-from codeverse.gallery.theme import INDEX_CSS, INDEX_JS, esc, footer, page_shell, top_bar-from codeverse.gallery.urls import THUMB_PX, StaticUrls, UrlMaker+from codeverse.addons.gallery.theme import INDEX_CSS, INDEX_JS, esc, footer, page_shell, top_bar+from codeverse.addons.gallery.urls import THUMB_PX, StaticUrls, UrlMakerfrom codeverse.proc import write_text_atomicdiff --git a/harness/codeverse/gallery/server.py b/harness/codeverse/addons/gallery/server.pysimilarity index 95%rename from harness/codeverse/gallery/server.pyrename to harness/codeverse/addons/gallery/server.pyindex d0fcfc2c..3e8e8e8c 100644--- a/harness/codeverse/gallery/server.py+++ b/harness/codeverse/addons/gallery/server.py@@ -27,15 +27,15 @@ from pathlib import Pathfrom typing import Anyfrom urllib.parse import parse_qs, unquote, urlsplit-from codeverse.gallery import code as code_page-from codeverse.gallery import viewer as viewer_page-from codeverse.gallery.compare import MAX_COMPARE, export_csv, parse_keys, render_compare-from codeverse.gallery.detail import render_broken_detail, render_detail-from codeverse.gallery.index import build_index-from codeverse.gallery.model import FILTER_KEYS, RunEntry, match, sort_entries-from codeverse.gallery.page import render_index-from codeverse.gallery.theme import esc, footer, page_shell, top_bar-from codeverse.gallery.urls import PathError, UrlMaker, content_type, safe_join+from codeverse.addons.gallery import code as code_page+from codeverse.addons.gallery import viewer as viewer_page+from codeverse.addons.gallery.compare import MAX_COMPARE, export_csv, parse_keys, render_compare+from codeverse.addons.gallery.detail import render_broken_detail, render_detail+from codeverse.addons.gallery.index import build_index+from codeverse.addons.gallery.model import FILTER_KEYS, RunEntry, match, sort_entries+from codeverse.addons.gallery.page import render_index+from codeverse.addons.gallery.theme import esc, footer, page_shell, top_bar+from codeverse.addons.gallery.urls import PathError, UrlMaker, content_type, safe_joinDEFAULT_HOST = "127.0.0.1"DEFAULT_PORT = 8765@@ -242,7 +242,7 @@ class GalleryApp:state = entry.state if entry.state != "ok" else "broken"broken = entry.model_copy(update={"state": state, "error": str(e)[:400]})return Response.html(render_broken_detail(broken, self.urls))- from codeverse.gallery.index import entry_from_record+ from codeverse.addons.gallery.index import entry_from_recordfresh = entry_from_record(entry.battery, ws, rec, slug=entry.slug) # newest rounds, even mid-benchprev, nxt = self.neighbours(entry)@@ -270,7 +270,7 @@ class GalleryApp:return Response.json({"n": len(rows), "total": len(self.index.entries()),"runs": [e.model_dump(mode="json") for e in rows]})if what == "summary":- from codeverse.gallery.model import summarize+ from codeverse.addons.gallery.model import summarizereturn Response.json(summarize(self.selected(query)).model_dump(mode="json"))if what == "index":diff --git a/harness/codeverse/gallery/theme.py b/harness/codeverse/addons/gallery/theme.pysimilarity index 100%rename from harness/codeverse/gallery/theme.pyrename to harness/codeverse/addons/gallery/theme.pydiff --git a/harness/codeverse/gallery/urls.py b/harness/codeverse/addons/gallery/urls.pysimilarity index 99%rename from harness/codeverse/gallery/urls.pyrename to harness/codeverse/addons/gallery/urls.pyindex 7b99d38c..6e8906d1 100644--- a/harness/codeverse/gallery/urls.py+++ b/harness/codeverse/addons/gallery/urls.py@@ -14,7 +14,7 @@ import mimetypesfrom pathlib import Path, PurePosixPathfrom urllib.parse import quote-from codeverse.gallery.model import RunEntry, RunLink+from codeverse.addons.gallery.model import RunEntry, RunLinkTHUMB_PX = 720JPEG_QUALITY = 78diff --git a/harness/codeverse/gallery/viewer.py b/harness/codeverse/addons/gallery/viewer.pysimilarity index 96%rename from harness/codeverse/gallery/viewer.pyrename to harness/codeverse/addons/gallery/viewer.pyindex 99799f71..61eac175 100644--- a/harness/codeverse/gallery/viewer.py+++ b/harness/codeverse/addons/gallery/viewer.py@@ -11,9 +11,9 @@ from __future__ import annotationsimport jsonfrom pathlib import Path-from codeverse.gallery.model import RunEntry-from codeverse.gallery.theme import esc, footer, page_shell, top_bar-from codeverse.gallery.urls import UrlMaker+from codeverse.addons.gallery.model import RunEntry+from codeverse.addons.gallery.theme import esc, footer, page_shell, top_bar+from codeverse.addons.gallery.urls import UrlMaker#: URL prefix → path under node_modules/threeVENDOR_MAP = {"three/build/": "build/", "three/examples/jsm/": "examples/jsm/"}@@ -104,7 +104,7 @@ def vendor_path(rel: str, runtime_js: Path | str | None = None) -> Path | None:Only the two whitelisted subtrees are reachable, and :func:`safe_join` stillchecks the result — a vendor URL can never leave ``node_modules/three``."""- from codeverse.gallery.urls import PathError, safe_join+ from codeverse.addons.gallery.urls import PathError, safe_joinroot = three_root(runtime_js)if root is None:diff --git a/harness/codeverse/cli/flywheel_cmd.py b/harness/codeverse/cli/flywheel_cmd.pyindex 9a625d61..0aa48f90 100644--- a/harness/codeverse/cli/flywheel_cmd.py+++ b/harness/codeverse/cli/flywheel_cmd.py@@ -9,9 +9,9 @@ from typing import Annotatedimport typerfrom rich.markup import escape+from codeverse.addons.dataset.pairs import MIN_PREFERENCE_DELTAfrom codeverse.cli import _common as Cfrom codeverse.cli._common import console, kv_table, ok, warn-from codeverse.flywheel.pairs import MIN_PREFERENCE_DELTAflywheel_app = typer.Typer(no_args_is_help=True)@@ -30,7 +30,7 @@ def export_cmd() -> None:"""Export runs → sample folders + dataset_manifest.json + metadata.jsonl/.parquet(+ optional plain tars, packed FROM the manifest)."""- from codeverse.flywheel.export import export_samples+ from codeverse.addons.dataset.export import export_samplesif pack:# pack_samples rewrites the index and reads it back with pyarrow, so --pack@@ -58,7 +58,7 @@ def export_cmd(for g in rep.duplicates[:20]:warn(f"duplicate of {g.canonical}: {', '.join(g.duplicates)}")if pack:- from codeverse.flywheel.pack import pack_samples, verify_locators+ from codeverse.addons.dataset.pack import pack_samples, verify_locatorsprep = pack_samples(out_dir, tar_prefix=tar_prefix)n = verify_locators(out_dir)@@ -72,7 +72,7 @@ def pairs_cmd(min_delta: Annotated[float, typer.Option("--min-delta")] = MIN_PREFERENCE_DELTA,) -> None:"""Preference / repair (round + in-session) / cross-backend pairs → JSONL."""- from codeverse.flywheel.pairs import build_pairs+ from codeverse.addons.dataset.pairs import build_pairsn = build_pairs(runs_dir, out_jsonl, min_delta=min_delta)ok(f"{n} pairs → {out_jsonl}")@@ -86,7 +86,7 @@ def refine_cmd("format converter needs no access to the runs")] = False,) -> None:"""Refine rounds as transitions (brief → diff → score delta) → JSONL."""- from codeverse.flywheel.refine import build_refine+ from codeverse.addons.dataset.refine import build_refinen, drops = build_refine(runs_dir, out_jsonl, with_code=with_code)ok(f"{n} transitions → {out_jsonl}" + (f"; not exported: {dict(drops)}" if drops else ""))@@ -102,9 +102,9 @@ def caption_cmd(out: Annotated[Path | None, typer.Option("--out", help="write side-car <out>/<slug>.json instead of touching the run (read-only runs)")] = None,) -> None:"""Caption run(s): {detailed, instruction, factory} via a chat model."""+ from codeverse.addons.dataset.captions import CaptionError, caption_sample+ from codeverse.addons.dataset.export import load_captionsfrom codeverse.cost.instrument import run_ledger- from codeverse.flywheel.captions import CaptionError, caption_sample- from codeverse.flywheel.export import load_captionsfrom codeverse.flywheel.record import iter_runs, load_recordfrom codeverse.proc import RunLocked, exclusive@@ -145,7 +145,7 @@ def index_cmd(show: Annotated[bool, typer.Option("--summary/--no-summary")] = True,) -> None:"""Build the SQLite index (runs / rounds / usage) and print a summary."""- from codeverse.flywheel.index import build_index, summary+ from codeverse.addons.dataset.index import build_index, summaryn = build_index(runs_dir, out_sqlite)ok(f"indexed {n} runs → {out_sqlite}")@@ -208,7 +208,7 @@ def gallery_cmd(embed: Annotated[bool, typer.Option("--embed/--no-embed", help="inline the contact sheets as data: URIs")] = True,) -> None:"""Alias of `3dcv gallery build` (kept for scripts): one self-contained HTML page."""- from codeverse.gallery.page import build_static+ from codeverse.addons.gallery.page import build_staticpath, n, _ = build_static([runs_dir], out_html, title=title, embed=embed, thumb_px=thumb_px)ok(f"gallery of {n} runs → {path} ({path.stat().st_size // 1024} KB)")diff --git a/harness/codeverse/cli/main.py b/harness/codeverse/cli/main.pyindex 33fd5f55..c566d498 100644--- a/harness/codeverse/cli/main.py+++ b/harness/codeverse/cli/main.py@@ -155,7 +155,7 @@ RootsArg = Annotated[list[Path] | None, typer.Argument(def resolve_roots(roots: list[Path] | None) -> list[Path]:"""Explicit roots (validated) or the defaults; a clear error when there are none."""- from codeverse.gallery.index import default_roots+ from codeverse.addons.gallery.index import default_rootsif roots:missing = [r for r in roots if not Path(r).is_dir()]@@ -186,7 +186,7 @@ def serve_cmd(title: Annotated[str, typer.Option("--title")] = "3dcv gallery",) -> None:"""Serve the gallery (and the run directories) on localhost."""- from codeverse.gallery.server import GalleryError, serve+ from codeverse.addons.gallery.server import GalleryError, serveroot_paths = resolve_roots(roots)@@ -216,7 +216,7 @@ def build_cmd(thumb_px: Annotated[int, typer.Option("--thumb-px", min=128, help="embedded thumbnail long edge")] = 720,) -> None:"""Write the gallery as one self-contained HTML file."""- from codeverse.gallery.page import build_static+ from codeverse.addons.gallery.page import build_staticpath, n, index = build_static(resolve_roots(roots), out, title=title, embed=embed, thumb_px=thumb_px)broken = sum(1 for e in index.entries() if e.state != "ok")diff --git a/harness/codeverse/flywheel/__init__.py b/harness/codeverse/flywheel/__init__.pyindex bb26cfd9..d7f8dc84 100644--- a/harness/codeverse/flywheel/__init__.py+++ b/harness/codeverse/flywheel/__init__.py@@ -1,13 +1,14 @@-"""Flywheel: run records → dataset samples, preference pairs, captions, dedupe, index.+"""Flywheel: what every run WRITES so it can be learned from later.Public API (see docs/INTERFACES.md):-* ``record`` ``finalize_record(ws, record)`` · ``load_record(ws)`` · ``iter_runs(runs_dir)``-* ``export`` ``export_samples(runs_dir, out_dir, min_score=..)`` → ``ExportReport``-* ``pack`` ``pack_samples(out_dir)`` (plain tars + byte-range locators, optional)-* ``pairs`` ``build_pairs(runs_dir, out_jsonl, min_delta=..)`` → n-* ``captions`` ``caption_sample(ws, record, model_id)`` → ``Captions``-* ``dedupe`` ``code_fingerprint`` · ``mesh_fingerprint`` · ``near_duplicates``-* ``quality`` ``quality_tier`` (A/B/C/D) · ``prompt_hash`` · exact (code, prompt) duplicate groups-* ``index`` ``build_index(runs_dir, out_sqlite)`` + query helpers+* ``record`` ``finalize_record(ws, record)`` · ``load_record(ws)`` · ``iter_runs(runs_dir)``+* ``deliverable`` the run's ``deliverable/`` directory+* ``telemetry`` the settings / environment a record carries+* ``sample`` one run → one dataset sample (code files of the best round)+* ``quality`` ``quality_tier`` (A/B/C/D) · ``prompt_hash`` · code / mesh fingerprints, duplicate groups+* ``code_quality`` the per-record code metrics++Turning a tree of finished runs into a dataset (export, pack, pairs, captions, index) is+``codeverse.addons.dataset``."""diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.mdindex 62851202..02dbe738 100644--- a/harness/docs/ARCHITECTURE.md+++ b/harness/docs/ARCHITECTURE.md@@ -197,12 +197,15 @@ codeverse/planner as a re-ask before any code is written),skills_hook.py (the round's view of codeverse/skills: attach before generating,probe reads after — a no-op unless CV3D_SKILLS is on)- flywheel/ record.py (+ best_round_record), export.py, pack.py, sample.py, pairs.py,- deliverable.py, telemetry.py, captions.py, quality.py (tiers + dedupe + code/mesh fingerprints), index.py,+ flywheel/ what every run WRITES: record.py (+ best_round_record), sample.py,+ deliverable.py, telemetry.py, quality.py (tiers + dedupe + code/mesh fingerprints),code_quality.py (the delivered CODE's own vector — magic numbers per 100 LOC,function length, dead functions, duplication, docstrings → record.extra["code_quality"].index, a flywheel filter beside score and complexity)- gallery/ THE local run gallery (`3dcv gallery serve|build`): cards.py,+ addons/ optional tools that READ finished runs; outside cli/ nothing imports them+ (tests/core/test_addons_boundary.py). dataset/ = export.py, pack.py, pairs.py,+ refine.py, captions.py, index.py (`3dcv flywheel …`); gallery/ = below+ addons/gallery/ THE local run gallery (`3dcv gallery serve|build`): cards.py,compare.py (side-by-side arms), index.py (run roots →typed RunEntry, tolerant of half-written records), model.py, page.py (cards +table + filters + per-filter summary), detail.py (/run/<battery>/<slug>),@@ -226,7 +229,7 @@ codeverse/flywheel_cmd.py, texture_cmd.py, cost_cmd.py (`3dcv cost`), layout_cmd.py, doctor.py(`--skills` checks the library + its discovery wiring),skills_cmd.py (`3dcv skills list|show|validate|report` — the read-rate report)-bench/ run_bench.py, report.py (renders through codeverse/gallery), compare_backends.py+bench/ run_bench.py, report.py (renders through codeverse/addons/gallery), compare_backends.py(preflights every model it needs; --wait-for-provider / --no-preflight),_infra.py (outage vs model failure: infra_failed / budget_exhausted, docs/EVAL.md §7),pin_plan.py (seed one plan into both arms so the paired delta stops carrying@@ -553,7 +556,7 @@ repair pairs (in-session trajectory mining died with the api-agent, 2026-08-28vendor CLIs log raw stdout, not structured tool turns); `flywheel refine` emits the loop's OWN transitions — one row per (round i → roundi+1) where the harness asked for a change, carrying what condemned the round, theinstructions written in response, both code snapshots and whether the score moved-(the row is `flywheel/refine.RefineTransition`; INTERFACES has the fields and the+(the row is `addons/dataset/refine.RefineTransition`; INTERFACES has the fields and thedrop reasons). That is the supervision the harness produces that aone-shot corpus cannot: what a failing artefact looked like, what was wrong with itin the harness's own words, and what the fix changed. `toolkits/llamafactory/`@@ -563,7 +566,7 @@ trainer's format. `flywheel caption` addsside-car mode); `flywheel gallery` is an alias of `3dcv gallery build --embed`(the flywheel package has no renderer of its own).-`codeverse/gallery/` is the **local** answer to the same question: `3dcv gallery+`codeverse/addons/gallery/` is the **local** answer to the same question: `3dcv galleryserve` indexes `runs/` + every `bench/out/*/runs`, serves the page **and the rundirectories** on 127.0.0.1 (so every link opens: sheet, renders, `src/`, `object.glb`in an orbit viewer built on the vendored three.js, `record.json`), and re-reads adiff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.mdindex dc029150..7a468bff 100644--- a/harness/docs/INTERFACES.md+++ b/harness/docs/INTERFACES.md@@ -530,16 +530,16 @@ from codeverse.texturing.plan import scene_texture_pack, texture_pack_prompt ### flywheel/ + cli/```pythonfrom codeverse.flywheel.record import finalize_record, load_record, iter_runs, best_round_index, best_round_record-from codeverse.gallery.index import hero_view # (ws, rec) -> (rel, label, n_views): the card image, rebased via ws+from codeverse.addons.gallery.index import hero_view # (ws, rec) -> (rel, label, n_views): the card image, rebased via wsfrom codeverse.flywheel.record import complexity_block, round_complexity # objective complexity of what shipped# finalize_record fills record.extra["complexity"] = the BEST round's vector + plan_parts /# parts_per_plan_part / by_round; every rounds_summary row gains "complexity" (the index or None)-from codeverse.flywheel.export import export_samples # (runs_dir, out_dir, *, min_score=None, only_passed=False,+from codeverse.addons.dataset.export import export_samples # (runs_dir, out_dir, *, min_score=None, only_passed=False,# include_unbuilt=False, captions_dir=None, drop_duplicates=False) -> ExportReport{…, n_duplicates, duplicates, tiers}from codeverse.flywheel.quality import quality_tier, prompt_hash, find_duplicates # tiers: A passed & 0 gate errors, B passed,# C best ≥ 0.6, D else; dedupe = (code fingerprint, prompt)-from codeverse.flywheel.pairs import build_pairs # (runs_dir, out_jsonl, *, min_delta=0.05) -> n-from codeverse.flywheel.refine import build_refine, transitions, RefineTransition, REFINE_KINDS, outcome_of+from codeverse.addons.dataset.pairs import build_pairs # (runs_dir, out_jsonl, *, min_delta=0.05) -> n+from codeverse.addons.dataset.refine import build_refine, transitions, RefineTransition, REFINE_KINDS, outcome_of# build_refine(runs_dir, out_jsonl, **kw) -> (rows written, Counter of drop reasons); writes via a .part file# transitions(runs_dir, *, threshold=MIN_PREFERENCE_DELTA, max_diff_bytes=200_000, with_code=False,# drops=None) -> Iterator[RefineTransition]; outcome_of(delta, threshold) -> the label@@ -564,17 +564,17 @@ from codeverse.workspace import GIT_SAFE_FLAGS, GIT_SAFE_DIFF_FLAGS, git_safe_en# is still live and why read_tree_at avoids every content-rendering command. git_safe_env drops# the SYSTEM and GLOBAL config (GIT_CONFIG_NOSYSTEM, GIT_CONFIG_GLOBAL=/dev/null) and the# inherited environment (HOME, PATH, GIT_TERMINAL_PROMPT)-from codeverse.flywheel.captions import caption_sample # Δ (ws, record, model_id, *, model=None, out_dir=None) -> Captions;+from codeverse.addons.dataset.captions import caption_sample # Δ (ws, record, model_id, *, model=None, out_dir=None) -> Captions;# out_dir → side-car <out_dir>/<slug>.json, run untouched-from codeverse.gallery import build_index, default_roots, build_static, serve, GalleryApp # THE local gallery+from codeverse.addons.gallery import build_index, default_roots, build_static, serve, GalleryApp # THE local gallery# build_index(roots) -> GalleryIndex (sections of RunEntry; never raises per run)# build_static(roots, out_html, *, embed=False) -> (path, n, index)# render_static(index, *, embed=…, extra_html="") — bench/report.py's page# GalleryApp(roots, reload=False).route(path, query) -> Response (pure, testable)# serve(roots, *, host=None, host_explicit=False, port=8765, reload=False)-from codeverse.gallery.urls import safe_join # (root, rel) -> Path inside root, else PathError-from codeverse.gallery.urls import content_type # .glb→model/gltf-binary, .py/.js/.frag→text/plain; charset=utf-8-from codeverse.flywheel.index import build_index, query, summary # sqlite + parquet: adds quality_tier, gate_errors, cost_usd,+from codeverse.addons.gallery.urls import safe_join # (root, rel) -> Path inside root, else PathError+from codeverse.addons.gallery.urls import content_type # .glb→model/gltf-binary, .py/.js/.frag→text/plain; charset=utf-8+from codeverse.addons.dataset.index import build_index, query, summary # sqlite + parquet: adds quality_tier, gate_errors, cost_usd,# rounds, status, code_fingerprint, prompt_hash, duplicate_of, has_captions3dcodeverse make [--profile economy|balanced|quality]|resume|status|show|render|judge|tools|mcp|texture {pass,scene-pack,show}|cost {<slug>,show,cache,prices,profiles,estimate}diff --git a/harness/docs/RUNBOOK.md b/harness/docs/RUNBOOK.mdindex 249af358..1c9cd23e 100644--- a/harness/docs/RUNBOOK.md+++ b/harness/docs/RUNBOOK.md@@ -160,7 +160,7 @@ unless you type `--host` yourself; it never serves a path outside the declared r3dcv flywheel pairs runs/ pairs.jsonl [--min-delta 0.05]3dcv flywheel refine runs/ refine.jsonl [--with-code]# one row per round the harness asked to change; the row- # schema is codeverse/flywheel/refine.RefineTransition and+ # schema is codeverse/addons/dataset/refine.RefineTransition and# INTERFACES has the call signatures. Training formats live# in toolkits/llamafactory/, not here.3dcv flywheel caption <slug> [--model …] [--out caps/] # --out = side-car mode, run untoucheddiff --git a/harness/tests/core/test_addons_boundary.py b/harness/tests/core/test_addons_boundary.pynew file mode 100644index 00000000..c7879e85--- /dev/null+++ b/harness/tests/core/test_addons_boundary.py@@ -0,0 +1,29 @@+"""``codeverse.addons`` reads finished runs; a run never needs it. One-way, pinned here."""++from __future__ import annotations++import re+from pathlib import Path++import codeverse+import codeverse.addons++PKG = Path(codeverse.__file__).parent+# an import statement, or a module named in a string (the lazy `_import("codeverse.…")` call sites);+# prose that points a reader at the addons is fine+IMPORTS_ADDON = re.compile(r"""(?:\bimport|\bfrom)\s+codeverse\.addons|["']codeverse\.addons""")+++def test_nothing_outside_the_cli_imports_an_addon() -> None:+ offenders = [+ p.relative_to(PKG).as_posix()+ for p in sorted(PKG.rglob("*.py"))+ if p.relative_to(PKG).parts[0] not in {"addons", "cli"} and IMPORTS_ADDON.search(p.read_text())+ ]+ assert offenders == [], f"the core imports an addon: {offenders}"+++def test_the_addons_are_the_ones_the_docstring_lists() -> None:+ names = sorted(p.name for p in (PKG / "addons").iterdir() if p.is_dir() and p.name != "__pycache__")+ assert names == ["dataset", "gallery"]+ assert all(f"``{n}``" in (codeverse.addons.__doc__ or "") for n in names)diff --git a/harness/tests/flywheel_cli/test_captions.py b/harness/tests/flywheel_cli/test_captions.pyindex 6352280f..6d5db7ca 100644--- a/harness/tests/flywheel_cli/test_captions.py+++ b/harness/tests/flywheel_cli/test_captions.py@@ -6,9 +6,14 @@ import jsonimport pytest+from codeverse.addons.dataset.captions import (+ CaptionError,+ Captions,+ caption_sample,+ validate_captions,+)from codeverse.contracts.chat import ChatRequest, ChatResponse, ImagePartfrom codeverse.contracts.common import Usage-from codeverse.flywheel.captions import CaptionError, Captions, caption_sample, validate_captionsfrom codeverse.flywheel.record import load_recordGOOD = {@@ -120,8 +125,8 @@ GOOD_JS = {def test_threejs_instruction_naming_threejs_is_valid():"""The required 'Three.js' phrase must NOT trip the forbidden-API check (both js languages)."""+ from codeverse.addons.dataset.captions import Captions, validate_captionsfrom codeverse.contracts.common import Language- from codeverse.flywheel.captions import Captions, validate_captionsc = Captions(**GOOD_JS)assert validate_captions(c, Language.THREEJS) == []@@ -148,8 +153,8 @@ def test_caption_sample_threejs_run(tmp_path):def test_caption_graphics_and_scene_phrases():"""Graphics languages have phrases + phrase words (no KeyError, sane rules)."""+ from codeverse.addons.dataset.captions import Captions, validate_captionsfrom codeverse.contracts.common import Language- from codeverse.flywheel.captions import Captions, validate_captionsshader = Captions(detailed="Neon rain streaks down a dark window while blurred city lights pulse behind the glass.",diff --git a/harness/tests/flywheel_cli/test_flywheel.py b/harness/tests/flywheel_cli/test_flywheel.pyindex 02da46c2..4f13ce4d 100644--- a/harness/tests/flywheel_cli/test_flywheel.py+++ b/harness/tests/flywheel_cli/test_flywheel.py@@ -10,12 +10,12 @@ from pathlib import Pathimport pytest+from codeverse.addons.dataset.export import export_samples+from codeverse.addons.dataset.index import build_index, summary+from codeverse.addons.dataset.pack import pack_samples, verify_locators+from codeverse.addons.dataset.pairs import build_pairsfrom codeverse.contracts.run import RunRecordfrom codeverse.flywheel import _git-from codeverse.flywheel.export import export_samples-from codeverse.flywheel.index import build_index, summary-from codeverse.flywheel.pack import pack_samples, verify_locators-from codeverse.flywheel.pairs import build_pairsfrom codeverse.flywheel.quality import (DedupeItem,MeshFingerprint,@@ -315,7 +315,7 @@ def test_build_index_and_queries(runs_dir: Path, tmp_path: Path):# --------------------------------------------------------------------------- finding: repair pairs (pairs.py:115)def test_repair_pairs_match_structurally_not_by_kind(tmp_path: Path):"""Lifecycle labels the fixing round 'refine' — repair pairs must not need kind='repair'."""- from codeverse.flywheel.pairs import repair_pairs+ from codeverse.addons.dataset.pairs import repair_pairsfrom tests.flywheel_cli.conftest import make_fake_runws, rec = make_fake_run(tmp_path / "runs", with_repair=True)@@ -335,7 +335,7 @@ def test_in_round_repair_pairs_from_generated_commit(tmp_path: Path):"""build_with_repair fixes inside one round: generated commit → final commit."""import json as _json- from codeverse.flywheel.pairs import in_round_repair_pairs+ from codeverse.addons.dataset.pairs import in_round_repair_pairsfrom tests.flywheel_cli.conftest import make_fake_runws, rec = make_fake_run(tmp_path / "runs")@@ -370,7 +370,7 @@ def _degrade(judgment):def test_degraded_round_is_not_a_zero_score(tmp_path: Path):- from codeverse.flywheel.pairs import preference_pairs+ from codeverse.addons.dataset.pairs import preference_pairsfrom codeverse.flywheel.record import effective_judgment, effective_score, round_summaryfrom tests.flywheel_cli.conftest import make_fake_run@@ -455,8 +455,8 @@ def test_export_includes_textured_assets_when_shipped(fake_run, tmp_path: Path):def test_battery_layouts_are_discovered_by_flywheel_and_gallery(tmp_path):"""All three battery layouts resolve runs; eval siblings never become gallery runs."""+ from codeverse.addons.gallery.index import scan_rootfrom codeverse.flywheel.record import find_run_dirs, iter_runs- from codeverse.gallery.index import scan_rootbattery = tmp_path / "static_v2_flash" # run_bench: runs/<id>(battery / "runs" / "some_run").mkdir(parents=True)@@ -507,7 +507,7 @@ def test_parquet_keeps_the_complexity_columns_the_exporter_writes(tmp_path):"""The fixed Arrow schema preserves exported complexity columns."""import pyarrow.parquet as pq- from codeverse.flywheel.export import parquet_schema, write_parquet+ from codeverse.addons.dataset.export import parquet_schema, write_parquetrow = dict.fromkeys(parquet_schema().names)row.update(id="x", key="k", complexity=7.5, complexity_band="high")diff --git a/harness/tests/flywheel_cli/test_manifest_pack.py b/harness/tests/flywheel_cli/test_manifest_pack.pyindex 4212d983..03a4d73a 100644--- a/harness/tests/flywheel_cli/test_manifest_pack.py+++ b/harness/tests/flywheel_cli/test_manifest_pack.py@@ -20,14 +20,14 @@ from pathlib import Pathimport pytest-from codeverse.flywheel.export import (+from codeverse.addons.dataset.export import (MANIFEST_NAME,ManifestError,export_samples,load_manifest,write_manifest,)-from codeverse.flywheel.pack import PackError, pack_samples, verify_locators+from codeverse.addons.dataset.pack import PackError, pack_samples, verify_locatorsCHAIR_ID = "3dcodeverse/static_object/blender/wooden_chair_ab12cd34"@@ -141,7 +141,7 @@ def test_a_failure_after_the_pack_loop_publishes_nothing(packed_ds: Path, monkeywrite fails. Publishing the tars alone left the OLD index resolving to the newtars' byte offsets — six rows pointing at the wrong bytes, and verify_locatorshappily passing a corrupt dataset."""- import codeverse.flywheel.pack as P+ import codeverse.addons.dataset.pack as Pbefore = _packed_state(packed_ds)monkeypatch.setattr(P, "write_parquet", lambda *a, **k: (_ for _ in ()).throw(OSError("No space left on device")))diff --git a/harness/tests/flywheel_cli/test_quality_gallery.py b/harness/tests/flywheel_cli/test_quality_gallery.pyindex 223fcf01..aec856f0 100644--- a/harness/tests/flywheel_cli/test_quality_gallery.py+++ b/harness/tests/flywheel_cli/test_quality_gallery.py@@ -5,9 +5,9 @@ from __future__ import annotationsimport jsonfrom pathlib import Path+from codeverse.addons.dataset.captions import caption_sample+from codeverse.addons.dataset.export import export_samples, load_captionsfrom codeverse.contracts.common import Language-from codeverse.flywheel.captions import caption_sample-from codeverse.flywheel.export import export_samples, load_captionsfrom codeverse.flywheel.quality import find_duplicates, mark_duplicates, prompt_hash, quality_tierfrom codeverse.flywheel.record import load_recordfrom tests.flywheel_cli.conftest import make_fake_rundiff --git a/harness/tests/flywheel_cli/test_refine.py b/harness/tests/flywheel_cli/test_refine.pyindex ba6e18e5..6fc99f2d 100644--- a/harness/tests/flywheel_cli/test_refine.py+++ b/harness/tests/flywheel_cli/test_refine.py@@ -1,4 +1,4 @@-"""Refine transitions (codeverse/flywheel/refine.py)."""+"""Refine transitions (codeverse/addons/dataset/refine.py)."""from __future__ import annotations@@ -7,10 +7,10 @@ from pathlib import Pathimport pytest+from codeverse.addons.dataset.pairs import MIN_PREFERENCE_DELTA+from codeverse.addons.dataset.refine import build_refine, outcome_of, transitionsfrom codeverse.contracts.artifacts import GateFinding, GateReport, Severity-from codeverse.flywheel.pairs import MIN_PREFERENCE_DELTAfrom codeverse.flywheel.record import load_record-from codeverse.flywheel.refine import build_refine, outcome_of, transitionsfrom tests.flywheel_cli.conftest import make_fake_rundiff --git a/harness/tests/flywheel_cli/test_run_identity.py b/harness/tests/flywheel_cli/test_run_identity.pyindex 0a08b8f8..514a37b4 100644--- a/harness/tests/flywheel_cli/test_run_identity.py+++ b/harness/tests/flywheel_cli/test_run_identity.py@@ -15,10 +15,10 @@ from pathlib import Pathimport pytest+from codeverse.addons.dataset.export import export_samples, load_captions+from codeverse.addons.dataset.index import build_index as build_sqlite_index+from codeverse.addons.dataset.pairs import build_pairsfrom codeverse.contracts.run import RunId-from codeverse.flywheel.export import export_samples, load_captions-from codeverse.flywheel.index import build_index as build_sqlite_index-from codeverse.flywheel.pairs import build_pairsfrom codeverse.flywheel.record import FoundRun, battery_label, iter_runs, run_id_for, unique_filesfrom codeverse.flywheel.sample import SampleErrorfrom tests.flywheel_cli.conftest import make_fake_run@@ -130,7 +130,7 @@ def test_nested_run_identity_survives_every_flywheel_consumer(tmp_path: Path):assert runs == {"cmp_a_stool__armx", "cmp_b_lamp__armx"}# Caption sidecars are equally isolated.- from codeverse.flywheel.captions import caption_sample+ from codeverse.addons.dataset.captions import caption_samplefrom tests.flywheel_cli.test_captions import GOOD, FakeModelside = tmp_path / "caps"diff --git a/harness/tests/flywheel_cli/test_run_layout_cli.py b/harness/tests/flywheel_cli/test_run_layout_cli.pyindex 796a5c7e..86880430 100644--- a/harness/tests/flywheel_cli/test_run_layout_cli.py+++ b/harness/tests/flywheel_cli/test_run_layout_cli.py@@ -9,10 +9,12 @@ from pathlib import Pathfrom typer.testing import CliRunner+from codeverse.addons.dataset.export import export_samples+from codeverse.addons.gallery import build_static+from codeverse.addons.gallery.index import entry_from_recordfrom codeverse.cli.main import appfrom codeverse.contracts.run import RunRecordfrom codeverse.flywheel.deliverable import build_deliverable, deliverable_path, load_deliverable-from codeverse.flywheel.export import export_samplesfrom codeverse.flywheel.record import load_record, package_runfrom codeverse.flywheel.telemetry import (build_telemetry,@@ -21,8 +23,6 @@ from codeverse.flywheel.telemetry import (load_telemetry,stage_order,)-from codeverse.gallery import build_static-from codeverse.gallery.index import entry_from_recordfrom codeverse.workspace import LAYOUT_ALIASES, Workspacefrom .conftest import make_fake_rundiff --git a/harness/tests/gallery/test_hardening.py b/harness/tests/gallery/test_hardening.pyindex 9a63875d..0445f4df 100644--- a/harness/tests/gallery/test_hardening.py+++ b/harness/tests/gallery/test_hardening.py@@ -7,10 +7,10 @@ import csvimport iofrom pathlib import Path-from codeverse.gallery.compare import CSV_COLUMNS, csv_safe, export_csv-from codeverse.gallery.index import build_index-from codeverse.gallery.server import SANDBOXED_TYPES, GalleryApp-from codeverse.gallery.urls import content_type+from codeverse.addons.gallery.compare import CSV_COLUMNS, csv_safe, export_csv+from codeverse.addons.gallery.index import build_index+from codeverse.addons.gallery.server import SANDBOXED_TYPES, GalleryApp+from codeverse.addons.gallery.urls import content_typefrom tests.flywheel_cli.conftest import make_fake_rundiff --git a/harness/tests/gallery/test_index.py b/harness/tests/gallery/test_index.pyindex 8175b10c..f314ca2f 100644--- a/harness/tests/gallery/test_index.py+++ b/harness/tests/gallery/test_index.py@@ -5,9 +5,9 @@ from __future__ import annotationsimport jsonfrom pathlib import Path+from codeverse.addons.gallery.index import build_index, default_roots, entry_for_dir+from codeverse.addons.gallery.model import match, sort_entries, summarizefrom codeverse.flywheel.record import battery_label-from codeverse.gallery.index import build_index, default_roots, entry_for_dir-from codeverse.gallery.model import match, sort_entries, summarizedef test_build_index_sections_and_states(gallery_tree: dict[str, Path]):diff --git a/harness/tests/gallery/test_page.py b/harness/tests/gallery/test_page.pyindex dd12341d..64832a2f 100644--- a/harness/tests/gallery/test_page.py+++ b/harness/tests/gallery/test_page.py@@ -7,9 +7,9 @@ import refrom html.parser import HTMLParserfrom pathlib import Path-from codeverse.gallery.index import build_index-from codeverse.gallery.page import build_static, render_index, render_static-from codeverse.gallery.urls import StaticUrls, UrlMaker+from codeverse.addons.gallery.index import build_index+from codeverse.addons.gallery.page import build_static, render_index, render_static+from codeverse.addons.gallery.urls import StaticUrls, UrlMakerVOID = {"area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param","source", "track", "wbr"}diff --git a/harness/tests/gallery/test_server.py b/harness/tests/gallery/test_server.pyindex 658c0e41..7c1077ec 100644--- a/harness/tests/gallery/test_server.py+++ b/harness/tests/gallery/test_server.py@@ -13,14 +13,14 @@ from pathlib import Pathimport pytest-from codeverse.gallery.server import (+from codeverse.addons.gallery.server import (DEFAULT_HOST,GalleryApp,GalleryError,make_server,resolve_host,)-from codeverse.gallery.urls import PathError, content_type, safe_join+from codeverse.addons.gallery.urls import PathError, content_type, safe_join@pytest.fixture@@ -124,7 +124,7 @@ def test_unknown_run_and_unknown_route(app: GalleryApp):def test_vendor_and_viewer(app: GalleryApp):- from codeverse.gallery.viewer import viewer_available+ from codeverse.addons.gallery.viewer import viewer_availablev = app.route("/viewer/runs/wooden_chair_ab12cd34/artifacts/object.glb")if viewer_available():diff --git a/harness/tests/gallery/test_triage.py b/harness/tests/gallery/test_triage.pyindex 49bcf08b..9e557a67 100644--- a/harness/tests/gallery/test_triage.py+++ b/harness/tests/gallery/test_triage.py@@ -14,18 +14,24 @@ from urllib.parse import parse_qsimport pytest-from codeverse.gallery.compare import (+from codeverse.addons.gallery.compare import (CSV_COLUMNS,MAX_COMPARE,export_csv,parse_keys,render_compare,)-from codeverse.gallery.index import build_index, hero_view-from codeverse.gallery.model import VERDICTS, humanize_view, match, summarize, verdict_breakdown-from codeverse.gallery.page import render_index-from codeverse.gallery.server import GalleryApp-from codeverse.gallery.urls import UrlMaker+from codeverse.addons.gallery.index import build_index, hero_view+from codeverse.addons.gallery.model import (+ VERDICTS,+ humanize_view,+ match,+ summarize,+ verdict_breakdown,+)+from codeverse.addons.gallery.page import render_index+from codeverse.addons.gallery.server import GalleryApp+from codeverse.addons.gallery.urls import UrlMaker# --------------------------------------------------------------------------- breakdown@@ -187,7 +193,7 @@ def test_compare_survives_a_run_with_no_record(gallery_tree: dict[str, Path]):def test_bulk_bar_is_offered_on_the_server_but_not_in_the_static_build(gallery_tree: dict[str, Path]):- from codeverse.gallery.page import render_static+ from codeverse.addons.gallery.page import render_staticindex = build_index([gallery_tree["runs"]])served = render_index(index, UrlMaker())