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.

fix: let a generic weapon pass strict validation

kokorolx9545dddb7de9
diff --git a/forge/stage2_spec/new_sculpt_spec.py b/forge/stage2_spec/new_sculpt_spec.py
index 257f728..d42ecfb 100755
--- a/forge/stage2_spec/new_sculpt_spec.py
+++ b/forge/stage2_spec/new_sculpt_spec.py
@@ -1173,6 +1173,7 @@ def apply_character_template(
# anodized-multicolored, e.g. Doppler) need a low roughness + high metalness +
# strong environment reflection or they render muddy; see
# grimoire/build/cs2_finishes.md and grimoire/intake/cs2_texture_acquisition.md.
+CS2_DOMAIN_ID = "cs2"
CS2_FINISH_STYLES = [
"solid", "hydrographic", "anodized", "spray-paint",
"anodized-multicolored", "custom-paint-job", "patina", "gunsmith",
@@ -1519,7 +1520,7 @@ def apply_cs2_template(
oc["structureKind"] = ["blade", "grip", "guard"]
oc["motionPotential"] = ["static", "inspect-orbit"]
oc["materialFamilies"] = ["metal", "anodized-coat" if profile["viewDependent"] else "painted-coat"]
- oc["cs2"] = True
+ oc["domain"] = CS2_DOMAIN_ID
complexity = pre.setdefault("complexity", {})
complexity["tier"] = "ultra-complex"
decision = pre.setdefault("specDepthDecision", {})
@@ -2327,7 +2328,7 @@ def main(argv: list[str]) -> int:
pre = assessment.get("preSpecAssessment", {})
oc = pre.get("objectClass", {}) if isinstance(pre, dict) else {}
domain = oc.get("primaryDomain") if isinstance(oc, dict) else None
- cs2_marker = bool(oc.get("cs2")) if isinstance(oc, dict) else False
+ cs2_marker = oc.get("domain") == CS2_DOMAIN_ID if isinstance(oc, dict) else False
incoming_routing = assessment.get("pipelineRouting") if isinstance(assessment, dict) else None
incoming_classification = incoming_routing.get("classification") if isinstance(incoming_routing, dict) else None
explicit_track = "character-v1.5" if args.character or domain in {"character", "hybrid"} else None
diff --git a/forge/stage2_spec/validate_sculpt_spec.py b/forge/stage2_spec/validate_sculpt_spec.py
index 61376aa..79eb5e7 100644
--- a/forge/stage2_spec/validate_sculpt_spec.py
+++ b/forge/stage2_spec/validate_sculpt_spec.py
@@ -895,8 +895,14 @@ def validate_pipeline_routing_contract(spec: dict[str, Any], errors: list[str])
errors.append("character-v1.5 routing cannot carry cs2Intake")
if routing_track == "character-v1.5" and object_class.get("primaryDomain") not in {"character", "hybrid"}:
errors.append("character-v1.5 routing requires the character template")
- if routing_track == "weapon-v1.4" and not legacy_cs2 and object_class.get("cs2") is not True:
- errors.append("weapon-v1.4 routing requires the CS2 weapon template")
+ # There is deliberately no domain requirement on weapon-v1.4. This used to read
+ # if routing_track == "weapon-v1.4" and not legacy_cs2 and object_class.get("cs2") is not True
+ # which was wrong twice over: weapon-v1.4 is the weapon *shape* template, keyed by classified
+ # kind, and CS2 is a finish/material domain that rides the generic hard-surface path
+ # (apply_cs2_template sets primaryDomain="object"). Because weapon-v1.4 was also the fallback for
+ # every unrecognised kind, the check meant a plain sword could pass strict validation only by
+ # being labelled a CS2 skin. A domain's own coherence is already enforced by
+ # validate_cs2_contract, which runs whenever the spec carries that domain's intake.
def validate_materials(spec: dict[str, Any], errors: list[str], warnings: list[str]) -> set[str]: