Official Codebase of 3DCodeVerse
Python
gitignore build/ and dist/; refresh the stale test counts in INSTALL and CI
gaoypeng117c232e774c
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 971683fa..6ecb81ca 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -45,8 +45,12 @@ jobs:run: pip install -e ./harness[dev]# The suite is marked: `live` needs API keys, `blender` needs a Blender# binary, `node` needs runtime_js/node_modules — none exist on a runner,- # so CI runs the pure-python subset (1809 on 3.10 / 1810 on 3.13 locally;- # the whole offline suite is 2413 / 2414).+ # so CI runs the pure-python subset: 1290 selected of 1306, 1284 passed+ # on 3.13 locally, out of the 2110 the whole offline suite passes. The+ # few skips are data-dependent (recorded runs/batteries a fresh clone+ # does not have). Measured with NO credentials in the environment,+ # which is what a runner has: every non-`live` test must pass without+ # keys (PORT-2).- name: pytest (pure python subset)run: python -m pytest tests/core tests/models tests/judges tests/orchestrator_tracks tests/flywheel_cli tests/bench_prompts tests/cost -q -m "not live and not blender and not node"working-directory: harnessdiff --git a/.gitignore b/.gitignoreindex 4fcec12c..e6772442 100644--- a/.gitignore+++ b/.gitignore@@ -11,3 +11,5 @@ harness/logs/*.pycharness/logs/*.log+build/+dist/diff --git a/harness/docs/INSTALL.md b/harness/docs/INSTALL.mdindex 32bc74dc..74ac076a 100644--- a/harness/docs/INSTALL.md+++ b/harness/docs/INSTALL.md@@ -60,7 +60,7 @@ a tested claim, not an aspiration.| component | floor | developed on | how the floor is enforced | what you lose at the floor ||---|---|---|---|---|-| **python** | **3.10** | 3.13 | `requires-python = ">=3.10"` (pip refuses 3.9); ruff `target-version = "py310"`; CI matrix 3.10 + 3.13; `tests/core/test_portability.py` parses every module with `ast.parse(feature_version=(3, 10))` and bans direct imports of 3.11-only stdlib names | nothing — the offline suite is green on both (2413 passed / 1 skipped on 3.10 vs 2414 passed on 3.13; the one skip is the `enum.StrEnum` parity check, which needs 3.11 to have something to compare against). Resolved deps are a little older (numpy 2.2 vs 2.4, scipy 1.15 vs 1.18, networkx 3.4 vs 3.6, cadquery 2.7 vs 2.8) and pip additionally installs `tomli` |+| **python** | **3.10** | 3.13 | `requires-python = ">=3.10"` (pip refuses 3.9); ruff `target-version = "py310"`; CI matrix 3.10 + 3.13; `tests/core/test_portability.py` parses every module with `ast.parse(feature_version=(3, 10))` and bans direct imports of 3.11-only stdlib names | nothing — the offline suite is green on both (2110 passed of the 2116 selected, measured on 3.13; the few skips are data-dependent — recorded runs and bench batteries a fresh clone does not have — and on 3.10 the `enum.StrEnum` parity check skips as well, since it needs 3.11 to have something to compare against). Resolved deps are a little older (numpy 2.2 vs 2.4, scipy 1.15 vs 1.18, networkx 3.4 vs 3.6, cadquery 2.7 vs 2.8) and pip additionally installs `tomli` || **node** | **20.6.0** | 24 (LTS) | `runtime_js/package.json` `engines.node`; `codeverse.spatial.node.NODE_MIN` fails every node workload with an actionable message; `3dcv doctor`'s `node` row; `scripts/setup.sh` | nothing. 20.6.0 is where `node --import` lands, which the `three` resolver hook needs; below 22.15 it registers the older async loader hooks (`lib/resolve_three_async.mjs`) instead of the in-thread ones — same resolutions, a few ms slower at startup. Verified: all 93 `node`-marked tests (GLB export, headless-Chrome renders, scene probes, shader preflight) pass on node 20.19.5 || **Blender** | 4.2 | 5.0.1 | runtime probe only (`Settings.resolve_blender()`) | untested below 4.2; the `blender` / `urdf_blender` languages are the only users || **OS** | Linux x86_64 | WSL2 Ubuntu | — | macOS should work (pure-python + node + Blender; no code is Linux-specific except `resource.setrlimit` guards) but is **not** tested. Windows is not supported: use WSL2 |diff --git a/harness/tests/install/test_hermetic.py b/harness/tests/install/test_hermetic.pyindex 5766cea1..421d5f56 100644--- a/harness/tests/install/test_hermetic.py+++ b/harness/tests/install/test_hermetic.py@@ -1,4 +1,6 @@-"""PORT-2: every non-``live`` test must pass with NO credentials in the environment.+"""Guards for claims the install docs make about the suite.++PORT-2: every non-``live`` test must pass with NO credentials in the environment.A test that only goes green because this box has 22 Gemini keys is not offline —it is red on a fresh clone and red on the CI runner, which has none. Guarded by@@ -10,6 +12,7 @@ the key file lives at ``~/.config/astra3d/gemini_keys.env``).from __future__ import annotationsimport os+import reimport subprocessimport sysfrom pathlib import Path@@ -36,3 +39,47 @@ def test_passes_with_no_api_keys_in_the_environment(nodeid: str, tmp_path: Path)cwd=HARNESS, env=env, capture_output=True, text=True, timeout=300)assert r.returncode == 0, f"{nodeid} needs credentials:\n{r.stdout[-3000:]}\n{r.stderr[-2000:]}"+++# --------------------------------------------------------------------------- PORT-8+CI_YML = HARNESS.parent / ".github" / "workflows" / "ci.yml"+INSTALL = HARNESS / "docs" / "INSTALL.md"+#: numbers the docs quote as test counts: "N passed", "N selected", "out of the N"+_COUNT = re.compile(r"(\d{3,6})\s+(?:passed|selected)|out of the (\d{3,6})")+++def _collected() -> int:+ """How many tests the suite actually has (the ceiling for any quoted count)."""+ r = subprocess.run([sys.executable, "-m", "pytest", "tests", "--collect-only", "-q",+ "-p", "no:cacheprovider"], cwd=HARNESS, capture_output=True, text=True, timeout=300)+ m = re.search(r"(\d+)\s*/\s*(\d+) tests collected", r.stdout) or re.search(r"(\d+) tests collected", r.stdout)+ assert m, r.stdout[-2000:]+ return int(m.group(m.lastindex))++[email protected]("doc", [CI_YML, INSTALL], ids=["ci.yml", "INSTALL.md"])+def test_quoted_test_counts_are_possible(doc: Path) -> None:+ """docs/INSTALL.md §2.1 advertises the floor as 'a tested claim, not an aspiration',+ so a count no invocation can produce is worse than no count: it read as a broken+ install to anyone comparing their own run. §2.1 claimed 2413 passed and ci.yml+ 1809 for a subset, against a tree that could collect neither (PORT-8).++ Deliberately a ceiling, not an equality — pinning exact counts would fail on every+ added test, which is how they went stale in the first place."""+ ceiling = _collected()+ quoted = [int(a or b) for a, b in _COUNT.findall(doc.read_text())]++ assert quoted, f"no test counts found in {doc} — did the wording change?"+ too_big = [n for n in quoted if n > ceiling]+ assert not too_big, f"{doc.name} quotes {too_big}, but only {ceiling} tests exist"++[email protected]("path", ["harness/build/lib/codeverse/__init__.py", "harness/dist/x.whl",+ "build/lib/x.py", "dist/x.tar.gz"])+def test_a_build_does_not_dirty_the_tree(path: str) -> None:+ """`pip wheel ./harness` leaves a full build/lib/codeverse copy, which showed up as+ `?? harness/build/` in a fresh clone's `git status` (PORT-8). A stale build/lib is+ also a setuptools footgun for the next wheel."""+ r = subprocess.run(["git", "check-ignore", "-q", path], cwd=HARNESS.parent)++ assert r.returncode == 0, f"{path} is not gitignored"