feat: harden CAD showcase skill and delivery pipeline

This commit is contained in:
2026-07-10 09:21:13 +08:00
parent a6856f903d
commit 8b1b1d5e89
53 changed files with 5405 additions and 1327 deletions

View File

@@ -18,6 +18,8 @@ import subprocess
from pathlib import Path
from typing import Any
import showcase_schema
VARIANTS = [
{
@@ -160,10 +162,12 @@ def write_manifest(entries: list[dict[str, Any]], out_dir: Path, name: str) -> P
}
)
manifest = {
"manifest_version": showcase_schema.MANIFEST_VERSION,
"name": name,
"default_key": "standard",
"variants": variants,
}
showcase_schema.validate_manifest(manifest)
manifest_path = out_dir / "variants_manifest.json"
manifest_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2), encoding="utf-8")
return manifest_path
@@ -174,7 +178,12 @@ def main() -> int:
spec_path = Path(args.spec)
out_dir = Path(args.out_dir)
out_dir.mkdir(parents=True, exist_ok=True)
spec = json.loads(spec_path.read_text(encoding="utf-8"))
spec = showcase_schema.normalize_spec(json.loads(spec_path.read_text(encoding="utf-8")))
try:
showcase_schema.validate_spec(spec)
except showcase_schema.ValidationFailure as exc:
print(str(exc), file=sys.stderr)
return 3
entries = write_variant_specs(spec, out_dir)
if args.build:
run_blender(entries, out_dir, args.blender, Path(args.build_script))