Rebuild the object in a reference image as a code-only, procedural, quality-gated, animation-ready Three.js model. Token-efficient image-to-3D.
Python 3dai-agentsclaude-codecomputer-graphicsgenerativeimage-to-3dprocedural-generationthreejstypescriptwebgl
fix: commit the registry-port test adaptations; review follow-ups
kokorolx1b79af58dbb4
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0789cc5..78fafd9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -37,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0broke meshes because no step in the workflow forbade it and no gate could tell a rigged mesh from adamaged one. This closes the loop between the gates and the pipeline that is supposed to enforce them.-### Added+### Added (rigging and animation workflow, merged from main)- **`animated-character` workflow profile** (now `forge/_shared/domains/animated_character.py` --ported from the hardcoded `RIG_STEPS` into the domain registry when this branch merged v1.5.2;diff --git a/README.md b/README.mdindex 248d921..f7ab339 100644--- a/README.md+++ b/README.md@@ -91,7 +91,7 @@ It runs under Claude Code, Codex, or OpenCode. It is agent-agnostic: wherever th- **Maximum likeness for a specific person or character.** An opt-in projection-first path fits a parametric template to image landmarks, de-lights the photo, camera-matches the render, and projects the reference onto the mesh. A single image cannot guarantee 100 percent likeness, so the pipeline reports per-region confidence and asks for more views when it matters. Details: `grimoire/character/likeness_maximization.md`.- **Multi-view silhouette carving.** An opt-in `geometryDescriptor.visualHull` intersects at least two deterministic orthographic binary silhouettes into a bounded, welded voxel mesh. It records unseen areas as low-confidence rather than inventing hidden detail. Schema and runtime check: `grimoire/scripts.md`.- **CS2 weapon review gates.** Knife and Glock-18 routes use family-specific component contracts. The review records exactness tier, family identity, painted-region and projection coverage, per-region confidence, approximation notes, and versioned review-scene metadata; component-coverage and map-stripped blockout gates prevent a convincing texture from standing in for real structure. Ships with the CS2 domain plugin; see its `docs/cs2/review-gates.md`.-- **Resumable local workflow.** `forge/state.py` records an ordered, evidence-backed intake/pass checklist for generic, character, and CS2 profiles. `forge/next.py --state` resumes from that checklist while the existing spec, render, and review gates remain authoritative.+- **Resumable local workflow.** `forge/state.py` records an ordered, evidence-backed intake/pass checklist for the generic profile and every registered domain (in-repo `character`/`animated-character`, plus installed domain plugins such as CS2). `forge/next.py --state` resumes from that checklist while the existing spec, render, and review gates remain authoritative.- **Material reference pipeline.** Every visible material region can be cropped, analyzed, resolved against the versioned Three.js material registry, fitted into `ObjectSculptSpec`, rendered from controlled camera views, and accepted only after a per-region comparison gate. See [`docs/materials/README.md`](docs/materials/README.md).- **Python-assisted browser rendering.** Python may orchestrate camera batches, hashes, manifests, and deterministic diagnostics, but the target browser Three.js route remains the rendering authority. See [`grimoire/build/python_threejs_render_bridge.md`](grimoire/build/python_threejs_render_bridge.md).@@ -243,7 +243,6 @@ The net effect: you still get a faithful 3D model from an image, but the expensi| `stage4_review/material_gate.py` | Block material-pass until registry, crop, render, compatibility, and comparison evidence passes. || `stage4_review/make_comparison_sheet.py` | Package one reference-vs-render sheet for review. || `stage4_review/append_review.py` | Record a per-pass review: scores, decision, evidence. |-| `stage4_review/cs2_review.py` | Evaluate the blocking CS2 knife review contract and versioned scene thresholds. || `_shared/feature_acceptance_policy.py` | Internal helper enforcing per-feature score thresholds. || `stage1_intake/build_detail_inventory.py` | Slice the reference into zones and scaffold a detail inventory. || `stage1_intake/extract_landmarks.py` | Overlay a landmark grid and scaffold an anatomy block for characters. |diff --git a/forge/tests/test_domain_registry.py b/forge/tests/test_domain_registry.pyindex 5e31bfd..09ef0de 100644--- a/forge/tests/test_domain_registry.py+++ b/forge/tests/test_domain_registry.py@@ -41,9 +41,9 @@ class Registry(unittest.TestCase):# happens to have under ~/.img2 -- the old form of this test asserted the INSTALLED cs2# plugin and was green or red depending on the machine, which is what turned CI red.with self._temp_img2_home({}):- self.assertEqual(sorted(registered_domains()), ["character"])+ self.assertEqual(sorted(registered_domains()), ["animated-character", "character"])with self._temp_img2_home({"fixture-plugin": {"id": "fixture-dom"}}):- self.assertEqual(sorted(registered_domains()), ["character", "fixture-dom"])+ self.assertEqual(sorted(registered_domains()), ["animated-character", "character", "fixture-dom"])def test_an_unregistered_profile_fails_loud_and_names_what_is_available(self) -> None:with self.assertRaises(DomainRegistryError) as ctx:diff --git a/forge/tests/test_rig_workflow_steps.py b/forge/tests/test_rig_workflow_steps.pyindex 91a99f2..a4258ac 100644--- a/forge/tests/test_rig_workflow_steps.py+++ b/forge/tests/test_rig_workflow_steps.py@@ -17,15 +17,39 @@ Pure Python 3.10+ stdlib.from __future__ import annotations+import osimport sys+import tempfileimport unittestfrom pathlib import PathROOT = Path(__file__).resolve().parents[1]sys.path.insert(0, str(ROOT / "_shared"))+# Profiles resolve through the domain registry, which reads installed plugins from IMG2_HOME.+# Pinned to an empty temp home so a developer's real ~/.img2 (malformed or colliding domain.json)+# can never fail these tests -- the test_search_specs.py pattern.+_TMP_HOME: tempfile.TemporaryDirectory | None = None+_OLD_HOME: str | None = None+++def setUpModule() -> None:+ global _TMP_HOME, _OLD_HOME+ _TMP_HOME = tempfile.TemporaryDirectory()+ _OLD_HOME = os.environ.get("IMG2_HOME")+ os.environ["IMG2_HOME"] = _TMP_HOME.name+++def tearDownModule() -> None:+ if _OLD_HOME is None:+ os.environ.pop("IMG2_HOME", None)+ else:+ os.environ["IMG2_HOME"] = _OLD_HOME+ if _TMP_HOME is not None:+ _TMP_HOME.cleanup()++from domains.animated_character import DOMAIN as ANIMATED_CHARACTER # noqa: E402from workflow_state import ( # noqa: E402- RIG_STEPS,WorkflowStateError,new_state,next_entry,@@ -46,7 +70,7 @@ class AnimatedCharacterProfile(unittest.TestCase):self.assertEqual(self.state["profile"], "animated-character")def test_every_rig_step_reaches_the_checklist(self) -> None:- self.assertEqual(rig_ids(self.state), [step_id for step_id, _command in RIG_STEPS])+ self.assertEqual(rig_ids(self.state), [step_id for step_id, _command in ANIMATED_CHARACTER["rigSteps"]])def test_it_keeps_the_character_steps_too(self) -> None:"""An animated character is still a character; the anatomy contract must not be lost."""@@ -137,7 +161,7 @@ class TheDispatcherActuallyReachesThem(unittest.TestCase):def test_every_rig_step_is_actually_dispatched(self) -> None:dispatched, _state = self.drain("animated-character")- self.assertEqual(dispatched, [step_id for step_id, _command in RIG_STEPS])+ self.assertEqual(dispatched, [step_id for step_id, _command in ANIMATED_CHARACTER["rigSteps"]])def test_the_build_is_not_complete_while_a_rig_step_is_pending(self) -> None:"""The exact bug: `complete` was reached with all nine rig steps still pending."""@@ -170,13 +194,13 @@ class TheDispatcherActuallyReachesThem(unittest.TestCase):"""Invisible in status output is unreachable in practice: nobody knows to run them."""state = new_state("subject.glb", profile="animated-character", spec="spec.json")pending = status_payload(state)["pending"]- for step_id, _command in RIG_STEPS:+ for step_id, _command in ANIMATED_CHARACTER["rigSteps"]:self.assertIn(step_id, pending)class StepsNameTheirTooling(unittest.TestCase):def setUp(self) -> None:- self.commands = dict(RIG_STEPS)+ self.commands = dict(ANIMATED_CHARACTER["rigSteps"])def test_each_gate_step_names_the_script_that_runs_it(self) -> None:for step_id, script in (