Official Codebase of 3DCodeVerse
Python
chore: drop dead deps/helpers, fix python-version and decisions drift
gaoypeng843f313e05b3
diff --git a/harness/codeverse/__init__.py b/harness/codeverse/__init__.pyindex f93458a6..f7c7b547 100644--- a/harness/codeverse/__init__.py+++ b/harness/codeverse/__init__.py@@ -2,7 +2,7 @@A backend harness in which LLMs (API models or agentic CLIs) write RAW,executable 3D code — Blender ``bpy``, CadQuery, Three.js, URDF, GLSL — for-three tracks (static objects, articulated objects, scenes). Every run is+four tracks (static objects, articulated objects, scenes, graphics). Every run isplanned, generated, linted, executed, measured, rendered, judged, refined andfinally emitted as a data-flywheel record.@@ -20,7 +20,7 @@ Package map (each sub-package has its own docstring):slice, isolate, silhouette, joints, probes — also served asan MCP server to agentic harnesses.- ``judges`` VLM judges + rubrics + deterministic metrics.-- ``tracks`` static_object / articulated_object / scene pipelines.+- ``tracks`` static_object / articulated_object / scene / graphics pipelines.- ``orchestrator`` stage runner, round loop, fan-out, budget, events.- ``flywheel`` run records → dataset samples / preference pairs.- ``cli`` ``3dcv`` command line.diff --git a/harness/codeverse/agents/transcript.py b/harness/codeverse/agents/transcript.pyindex 24331804..d1b92277 100644--- a/harness/codeverse/agents/transcript.py+++ b/harness/codeverse/agents/transcript.py@@ -39,14 +39,6 @@ class Trajectory:def result_path(self) -> Path:return self.dir / "result.json"- @property- def stdout_path(self) -> Path:- return self.dir / "stdout.log"-- @property- def stderr_path(self) -> Path:- return self.dir / "stderr.log"-# ------------------------------------------------------------------ writesdef write_prompt(self, prompt: str, system: str = "") -> Path:body = prompt if not system else f"<!-- system -->\n{system}\n\n<!-- prompt -->\n{prompt}"diff --git a/harness/codeverse/cli/doctor.py b/harness/codeverse/cli/doctor.pyindex b9ac60cb..77ecc1d9 100644--- a/harness/codeverse/cli/doctor.py+++ b/harness/codeverse/cli/doctor.py@@ -18,7 +18,7 @@ doctor_app = typer.Typer(invoke_without_command=True)Row = tuple[str, str, str]_PY_DEPS = ("pydantic", "pydantic_settings", "typer", "rich", "jinja2", "yaml", "numpy", "trimesh", "fcl", "PIL", "pyarrow",- "scipy", "shapely", "networkx", "manifold3d", "playwright", "google.genai", "anthropic", "openai",+ "scipy", "shapely", "networkx", "manifold3d", "google.genai", "anthropic", "openai","yourdfpy", "mcp", "moderngl", "cadquery")#: modules that come from an OPTIONAL extra: missing means one track is unavailable, not a#: broken install, so they are a WARN naming the extra to install. `moderngl` and `cadquery`@@ -30,7 +30,7 @@ _PY_DEPS = ("pydantic", "pydantic_settings", "typer", "rich", "jinja2", "yaml",#: map was missing scipy/networkx/pyarrow, so a fresh clone installed exactly as#: docs/INSTALL.md §1 documents (no extras) got `python deps FAIL 14/23` — "your install#: is broken" for an install that is correct — and a remedy that named four of the five-#: extras and could not clear the row. Verified on a 3.10 clean clone, 2026-08-24.+#: extras and could not clear the row. Verified on a 3.13 clean clone, 2026-08-24._OPTIONAL_DEPS = {"manifold3d": "mesh", "shapely": "mesh", "networkx": "mesh","yourdfpy": "urdf", "scipy": "urdf", "mcp": "mcp","moderngl": "graphics", "cadquery": "cad", "pyarrow": "flywheel"}diff --git a/harness/codeverse/spatial/tool_common.py b/harness/codeverse/spatial/tool_common.pyindex 14e78d75..62e4afdd 100644--- a/harness/codeverse/spatial/tool_common.py+++ b/harness/codeverse/spatial/tool_common.py@@ -23,7 +23,7 @@ from codeverse.spatial.registry import ToolContext, ToolUnavailable, ToolUsageErfrom codeverse.workspace import Workspace__all__ = [- "ToolUnavailable", "lazy", "spec_dict", "language_of", "track_of",+ "ToolUnavailable", "lazy", "spec_dict", "language_of","glb_path", "reference_path", "load_plan", "resolve_views", "check_mode", "tool_out_dir", "render_cache_dir","cached_render_glb", "gl_metrics_summary", "VIEW_BY_NAME", "RENDER_MODES",]@@ -69,9 +69,6 @@ def language_of(ctx: ToolContext) -> str:return lang-def track_of(ctx: ToolContext) -> str:- return ctx.track or str(spec_dict(ctx).get("track", ""))-def reference_path(ctx: ToolContext, index: int, *, tool: str) -> tuple[Path, dict]:"""``spec.references[index]`` as ``(absolute path, reference dict)``.diff --git a/harness/codeverse/texturing/plan.py b/harness/codeverse/texturing/plan.pyindex 04612a83..56b1c699 100644--- a/harness/codeverse/texturing/plan.py+++ b/harness/codeverse/texturing/plan.py@@ -9,7 +9,6 @@ skip) validated in code with deterministic defaults, cached by content hash.from __future__ import annotationsimport hashlib-import jsonimport loggingfrom collections.abc import Sequencefrom pathlib import Path@@ -343,6 +342,3 @@ def plan_table(tp: TexturePlan) -> str:f"{p.roughness:<5.2f} {p.metallic:<4.1f} {'yes' if p.skip else 'no'}{(' — ' + p.reason) if p.skip and p.reason else ''}")return "\n".join(rows)--def plan_to_json(tp: TexturePlan) -> dict[str, Any]:- return json.loads(tp.model_dump_json())diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.mdindex 3949100a..7d4f967d 100644--- a/harness/docs/ARCHITECTURE.md+++ b/harness/docs/ARCHITECTURE.md@@ -1,7 +1,7 @@# 3dcodeverse harness — architecturePackage `codeverse`, CLI `3dcodeverse` (short alias `3dcv`), repo location-`/home/yipeng/3dcodeverse/harness`. Backend only. Python 3.11+, a small Node+`/home/yipeng/3dcodeverse/harness`. Backend only. Python 3.13 (one fixed version), a small Noderuntime (`runtime_js/`) for everything Three.js / headless Chrome, and modernglfor the graphics track. Reconciled against the code and the live runs on2026-08-23 (waves 2–3 + fix batch 1); design history and deviations are in@@ -67,8 +67,6 @@ the flywheel unit.```codeverse/- _compat.py the ONLY stdlib shims for the python floor (StrEnum, UTC, tomllib — all 3.11+;- floor is 3.10, see docs/INSTALL.md §2.1). Its docstring says when each diesconventions.py frames (LANGUAGE_FRAME, GLB_FRAME), units, OBJECT_VIEWS/_QUICK, SCENE_VIEWS,to_snake/to_pascal/slugify, MAX_TRIS_*, BBOX_TOLERANCE_M, CONTACT_GAP_M (THE source)config.py Settings (CV3D_* env, ~/.config/codeverse/config.yaml; role defaults come fromdiff --git a/harness/docs/DECISIONS.md b/harness/docs/DECISIONS.mdindex 717cfe1d..6208a6ed 100644--- a/harness/docs/DECISIONS.md+++ b/harness/docs/DECISIONS.md@@ -39,8 +39,9 @@ written) that were accepted because the code works that way and the tests pin itoverrides `RoundPolicy.target` when no explicit policy is injected.* **D4 Parallel refine only when it is safe.** Fan out only when ≥ 3 file-disjointgroups exist and every task maps to a file (threejs parts, scene zones/assets/env);- single-file languages get one whole-object task. Consequence: `generation.workspace_lock`- + retried `git diff` protect the shared git index (Workspace itself has no lock).+ single-file languages get one whole-object task. Consequence: `Workspace` itself+ holds a per-root lock + index.lock retry (workspace.py); the older+ `generation.workspace_lock` layer is redundant and queued for removal.* **D5 A refine round that changes no file is a plateau, not a crash.** Emits`round.no_change` and stops with the best round so far.* **D6 Finalise restores the best commit and rebuilds.** Artifacts always match the@@ -58,9 +59,9 @@ written) that were accepted because the code works that way and the tests pin it`dynamicModelConfiguration` (else silent model substitution) + `folderTrust.enabled=false`(else workspace MCP servers are silently disabled even with `--skip-trust`). Servedmodel is checked; mismatch → `exit_reason=model_substituted`.-* **D11 AgentJob.extra is the side-channel (Δ).** Keys `round`, `kind`, `language`, `track`- (+ `mcp_command`, `max_usd`, `temperature`, `thinking`, `allow_shell` for api-agent)- rather than new AgentJob fields, to keep `contracts/agent.py` frozen.+* **D11 AgentJob carries typed fields; `extra` is back-compat only (Δ, revised 2026-08-27).**+ `round`, `kind`, `files_hint`, `language`, `track` are typed `AgentJob` fields;+ `contracts/agent.py::_lift_legacy_extra` lifts old `extra` payloads into them.* **D12 api-agent exposes `build` under its real name; `run_build` is an alias (Δ).*** **D13 Node ESM resolution via an import hook (Δ).** `NODE_PATH` cannot resolve bare ESMspecifiers; `run_node(three_hook=True)` adds `--import runtime_js/lib/resolve_three.mjs`;@@ -237,5 +238,5 @@ written) that were accepted because the code works that way and the tests pin it* Storing URDF meshes Y-up and converting on load (rejected: breaks foreign loaders).* Per-asset judging for threejs scene assets (deferred: needs a `render_asset` hook).* Proposed and not yet done (owner-level files): `ToolCallPart.extra` for provider- state; `Workspace._git` lock + index.lock retry; package-data globs for- `languages/**/starter/**` and `languages/**/*.md`; `n_samples` in Settings.+ state; `n_samples` in Settings. (Done since first written: `Workspace._git`+ lock + index.lock retry; the `languages/**` package-data globs.)diff --git a/harness/docs/INSTALL.md b/harness/docs/INSTALL.mdindex 4e62f083..d5d4679f 100644--- a/harness/docs/INSTALL.md+++ b/harness/docs/INSTALL.md@@ -127,7 +127,7 @@ console scripts (`3dcodeverse`, `3dcv`) point back at the checkout.Core dependencies (always installed): pydantic + pydantic-settings (contracts,settings), typer + rich (CLI), jinja2 (prompt templates), pyyaml, numpy, trimesh(mesh measurement), python-fcl (collision), pillow, google-genai, anthropic,-openai, playwright.+openai.| extra | pulls | unlocks ||---|---|---|diff --git a/harness/pyproject.toml b/harness/pyproject.tomlindex 3329ff6c..29639481 100644--- a/harness/pyproject.toml+++ b/harness/pyproject.toml@@ -7,10 +7,10 @@ name = "3dcodeverse"version = "0.1.0"description = "3dcodeverse: a data-flywheel harness for LLM-written 3D code (Blender / CadQuery / Three.js / URDF / GLSL) across static objects, articulated objects and scenes."readme = "README.md"-# Floor = 3.10 (the oldest interpreter the whole dependency set still resolves on and the+# One fixed version: 3.13 (owner's decision 2026-08-26 — no floor, no matrix; the# one fixed version, 3.13 (owner, 2026-08-26): developed and measured on it; no CI (tests run locally before a push).# Nothing in the package uses a 3.11+ stdlib name directly — the three that were used-# (StrEnum, datetime.UTC, tomllib) live behind codeverse/_compat.py.+# old codeverse/_compat.py shims are gone: StrEnum, datetime.UTC, tomllib are stdlib here).requires-python = ">=3.13"license = { text = "Apache-2.0" }classifiers = [@@ -34,8 +34,6 @@ dependencies = ["google-genai>=1.0","anthropic>=0.40","openai>=1.40",- "playwright>=1.45",- 'tomli>=2.0; python_version < "3.11"', # stdlib `tomllib` backport — see codeverse/_compat.py][project.optional-dependencies]diff --git a/harness/tests/core/test_portability.py b/harness/tests/core/test_portability.pyindex fe7d9eef..33ec6e85 100644--- a/harness/tests/core/test_portability.py+++ b/harness/tests/core/test_portability.py@@ -1,15 +1,12 @@"""Guards for the supported-version floor (docs/INSTALL.md §2.1 "Supported versions").-The harness is developed on python 3.13 / node 24 but must install and run on-python 3.10 / node 20.6. Nothing here needs either of those installed: the-python guards read the tree, and the node guards drive the version logic with-fakes. Three things are pinned:+The harness runs on exactly python 3.13 and node 20.6+ (developed on node 24).+Nothing here needs either of those installed: the python guards read the tree,+and the node guards drive the version logic with fakes. Two things are pinned:-* the floors agree across ``pyproject.toml``, ``ruff``, ``scripts/setup.sh``,+* the versions agree across ``pyproject.toml``, ``ruff``, ``scripts/setup.sh``,``codeverse/spatial/node.py`` and ``runtime_js/package.json``;-* no module reaches past the floor — no 3.14 syntax, and the three 3.11 stdlib- names the harness needs come from ``codeverse/_compat`` and nowhere else;-* the ``StrEnum`` shim behaves exactly like ``enum.StrEnum``.+* no module reaches past the version — no 3.14-only syntax."""from __future__ import annotations