Skip to content

Rebuild the object in a reference image as a code-only, procedural, quality-gated, animation-ready Three.js model. Token-efficient image-to-3D.

feat!: stop inferring a domain from the target's name

kokorolx4f97d14d3cd4
diff --git a/forge/stage1_intake/search_specs.py b/forge/stage1_intake/search_specs.py
index a663ffb..747d63a 100644
--- a/forge/stage1_intake/search_specs.py
+++ b/forge/stage1_intake/search_specs.py
@@ -85,7 +85,7 @@ class CliNamespace(argparse.Namespace):
def __init__(self) -> None:
super().__init__()
self.query: list[str] = []
- self.collection: str = "cs2"
+ self.collection: str = "core_3d"
self.limit: int = 3
self.snippet_chars: int = 250
self.reindex: bool = False
@@ -97,7 +97,7 @@ def _parse_options(argv: Sequence[str]) -> CliOptions:
description="Search registered specification collections with local BM25."
)
_ = parser.add_argument("query", nargs="*", help="Search terms")
- _ = parser.add_argument("--collection", default="cs2")
+ _ = parser.add_argument("--collection", default="core_3d")
_ = parser.add_argument("--limit", type=int, default=3)
_ = parser.add_argument(
"--snippet-chars",
@@ -179,7 +179,7 @@ def main(argv: Sequence[str]) -> int:
options = _parse_options(argv)
except CliArgumentError as error:
return _emit_error(
- ErrorContext("", "cs2", json_requested),
+ ErrorContext("", "core_3d", json_requested),
CliFailure("invalid_arguments", str(error), 2),
)
diff --git a/forge/stage2_spec/new_pre_spec_assessment.py b/forge/stage2_spec/new_pre_spec_assessment.py
index 3a305cb..6649b4b 100755
--- a/forge/stage2_spec/new_pre_spec_assessment.py
+++ b/forge/stage2_spec/new_pre_spec_assessment.py
@@ -86,18 +86,10 @@ DETAIL_MINIMUMS = {
# wear layer, hardware, stitching/fasteners) than a generic object at the same structural
# complexity tier -- so --cs2 defaults to the ultra-complex tier (targetMinDetails 16), and the
# detail-count floor never drops below this even if --complexity is explicitly set lower.
+CS2_DOMAIN_ID = "cs2"
CS2_DETAIL_MINIMUM = 9
# Lightweight keyword heuristic, not exhaustive: catches the common phrasing ("CS2 skin",
-# "AK-47 | Redline", "Karambit Doppler") so --cs2 doesn't have to be typed by hand for the
-# obvious case. A miss here just means the agent (or the user) sets --cs2 explicitly --
-# vision/prompt-based detection beyond this heuristic is inherently the agent's judgment call.
-CS2_INTENT_KEYWORDS = (
- "cs2", "csgo", "counter-strike", "counter strike", "weapon skin", "knife skin", "glove skin",
- "doppler", "gamma doppler", "marble fade", "case hardened", "fade",
- "karambit", "butterfly knife", "bayonet", "gut knife", "falchion", "bowie knife",
- "classic knife",
-)
DEFAULT_SPEC_SEARCH_LIMIT: Final = 3
DEFAULT_SPEC_SEARCH_SNIPPET_CHARS: Final = 250
@@ -126,16 +118,12 @@ class PreSpecPayload(PreSpecPayloadRequired, total=False):
localSpecSearch: LocalSpecSearchPayload
-def detect_cs2_intent(target_name: str) -> bool:
- lowered = target_name.lower()
- return " | " in target_name or any(keyword in lowered for keyword in CS2_INTENT_KEYWORDS)
-
def select_spec_collection(target_name: str, requested_collection: str | None) -> str:
"""Choose the local specification collection for a pipeline target."""
if requested_collection:
return requested_collection
- return "cs2" if detect_cs2_intent(target_name) else "core_3d"
+ return "core_3d"
def search_local_specs(
target_name: str,
collection: str,
@@ -174,9 +162,8 @@ def make_payload(
) -> PreSpecPayload:
assessment = make_pre_spec_assessment(target_name)
contract = make_quality_contract()
- is_cs2 = is_cs2 or detect_cs2_intent(target_name)
if is_cs2:
- assessment["objectClass"]["cs2"] = True
+ assessment["objectClass"]["domain"] = CS2_DOMAIN_ID
assessment["sourceImage"] = image or ""
assessment["complexity"]["tier"] = complexity
assessment["specDepthDecision"]["requiredDepth"] = complexity
@@ -288,7 +275,7 @@ def main(argv: list[str]) -> int:
)
args = parser.parse_args(argv)
- is_cs2 = args.cs2 or detect_cs2_intent(args.target_name)
+ is_cs2 = args.cs2
complexity = args.complexity or ("ultra-complex" if is_cs2 else "moderate")
manifest = None
if args.manifest:
diff --git a/forge/tests/test_pipeline.py b/forge/tests/test_pipeline.py
index 7bfcfa0..6464df1 100644
--- a/forge/tests/test_pipeline.py
+++ b/forge/tests/test_pipeline.py
@@ -86,6 +86,8 @@ class PipelineTest(unittest.TestCase):
r = run(
"stage2_spec/new_pre_spec_assessment.py",
"Karambit Fade",
+ "--collection",
+ "cs2",
"--out",
self.assessment,
)
@@ -890,16 +892,28 @@ class PipelineTest(unittest.TestCase):
spec = json.loads(self.spec.read_text())
self.assertNotIn("skin-finish", {m["id"] for m in spec["materials"]})
- def test_cs2_intent_autodetected_from_target_name(self):
+ def test_a_domain_looking_target_name_is_not_auto_detected(self):
+ # Declared breaking change. The base used to infer the CS2 domain from the target's name
+ # (a " | " separator, or any of 17 keywords including bare "fade" and "karambit"). That is
+ # name-similarity resolution, which PLUGIN_CONTRACT.md section 13 forbids, so it is gone: a
+ # domain now has to be declared, not guessed from what the thing is called.
r = run("stage2_spec/new_pre_spec_assessment.py", "Karambit | Doppler", "--out", self.assessment)
self.assertEqual(r.returncode, 0, r.stderr)
payload = json.loads(self.assessment.read_text())
- self.assertTrue(payload["preSpecAssessment"]["objectClass"]["cs2"])
+ self.assertNotIn("domain", payload["preSpecAssessment"]["objectClass"])
+ self.assertEqual(payload["localSpecSearch"]["collection"], "core_3d")
+
+ def test_a_declared_domain_is_still_honoured(self):
+ r = run("stage2_spec/new_pre_spec_assessment.py", "Karambit Doppler", "--cs2", "--out", self.assessment)
+ self.assertEqual(r.returncode, 0, r.stderr)
+ payload = json.loads(self.assessment.read_text())
+ self.assertEqual(payload["preSpecAssessment"]["objectClass"]["domain"], "cs2")
def test_cs2_defaults_to_ultra_complex(self):
- # CS2 is held to the top fidelity bar: --cs2 (or autodetected intent) defaults the tier to
- # ultra-complex (targetMinDetails 16) in both the assessment and the authored spec.
- r = run("stage2_spec/new_pre_spec_assessment.py", "Karambit | Doppler", "--out", self.assessment)
+ # CS2 is held to the top fidelity bar: --cs2 defaults the tier to ultra-complex
+ # (targetMinDetails 16) in both the assessment and the authored spec. The domain must be
+ # declared -- it is no longer inferred from the target name.
+ r = run("stage2_spec/new_pre_spec_assessment.py", "Karambit | Doppler", "--cs2", "--out", self.assessment)
self.assertEqual(r.returncode, 0, r.stderr)
pre = json.loads(self.assessment.read_text())["preSpecAssessment"]
self.assertEqual(pre["complexity"]["tier"], "ultra-complex")
diff --git a/forge/tests/test_search_specs.py b/forge/tests/test_search_specs.py
index f3b995a..90539a5 100644
--- a/forge/tests/test_search_specs.py
+++ b/forge/tests/test_search_specs.py
@@ -235,6 +235,11 @@ def run_cli_fixture(
)
environment = os.environ.copy()
environment["PYTHONDONTWRITEBYTECODE"] = "1"
+ # This fixture's profile defines only the "cs2" collection, and these tests are about snippets,
+ # caching and error shapes -- not about which collection the CLI defaults to. Name it explicitly
+ # so they stop depending on that default, which is now "core_3d".
+ if "--collection" not in arguments:
+ arguments = ("--collection", "cs2", *arguments)
return subprocess.run(
[sys.executable, str(cli), *arguments],
cwd=root,
@@ -922,7 +927,9 @@ class CliOutputTest(unittest.TestCase):
(root / ".cache" / "spec-search").symlink_to(outside, target_is_directory=True)
result = subprocess.run(
- [sys.executable, str(cli), "needle", "--json"],
+ # Names the collection for the same reason run_cli_fixture does: this fixture defines
+ # only "cs2", and the test is about the cache failure, not the CLI's default.
+ [sys.executable, str(cli), "--collection", "cs2", "needle", "--json"],
cwd=root,
env={**os.environ, "PYTHONDONTWRITEBYTECODE": "1"},
capture_output=True,