implicit-cad: track the snapshot runtime, because nothing was publishing it

The skill's generated browser runtime was gitignored on develop and, per the
comment on the ignore, "published only from build-test/main". Nothing did that.
The publish job stages with `git add -A` (release.yml:396), which honours
.gitignore, so skills/implicit-cad/scripts/snapshot/runtime/ never reached main
at all.

This is new in 0.4.0. main still ships the old self-contained
scripts/snapshot.mjs alongside a tracked runtime under
scripts/packages/implicitjs/. This branch replaced both with the shared
cadgen.snapshot_cli, which loads RUNTIME_DIR/render.html -- so the next release
would have shipped a snapshot CLI with nothing to load.

The failure is not a clean error. Rendering a real model with the runtime moved
aside resolves the input, starts the browser, and then sits in
Page.wait_for_function for the full 300s Playwright timeout.

Nothing catches it either: check-builds.sh runs before the commit, against the
working tree where bundle.sh has just written the files.

So the runtime is tracked now, exactly as cad, dxf, sdf, srdf and urdf track
theirs, and bundle-implicit-cad.sh checks it in BOTH layouts rather than only in
production. Production-only was the right call when the file was absent on
develop; it is not absent any more. The assertion in
setup-implicit-cad-skill-symlink.sh that it stay untracked goes with it, and so
does the neighbouring ignore for scripts/export/runtime/ -- nothing generates
that path, and it shared the comment being deleted.

Verified by simulating the publish commit: `git add -A` after a --clean bundle
now stages render.html and snapshot-render.js. The new development-layout check
was confirmed to fire by tampering with the committed runtime.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
earthtojake
2026-08-11 12:48:59 -04:00
parent 96677dc3a1
commit 349def093f
5 changed files with 5075 additions and 39 deletions
-6
View File
@@ -27,12 +27,6 @@ node_modules
dist
coverage
# The implicit CAD skill's generated browser runtimes are build outputs on develop and
# are published only from build-test/main -- unlike `cad` and `dxf`, which track theirs.
# scripts/dev/skills/setup-implicit-cad-skill-symlink.sh enforces that they stay untracked.
skills/implicit-cad/scripts/snapshot/runtime/
skills/implicit-cad/scripts/export/runtime/
# Production CAD Viewer runtime dist is committed on main. On dev,
# skills/cad-viewer/scripts/viewer must stay a symlink to viewer/.
!skills/cad-viewer/scripts/viewer/dist/
+12 -11
View File
@@ -165,11 +165,9 @@ if [ "$CLEAN" -eq 1 ]; then
rm -rf "$CHECK_DIR"
fi
# The builder bundles are esbuild output, never a symlink, so they are checked in BOTH
# layouts -- unlike the vendored package copies below, which the development layout
# deliberately replaces with links to their sources.
# The node BUILDERS are tracked on develop, so they are checked in both layouts -- they are
# esbuild output, never a symlink, and a stale one would ship.
# The node BUILDERS are tracked on develop, so they are checked in BOTH layouts -- they are
# esbuild output, never a symlink, and a stale one would ship. The vendored package copies
# below are not: the development layout deliberately replaces those with links to sources.
check_builders() {
check_node_builders \
"$BUILDERS_RUNTIME_DIR" "$CHECK_DIR/packages/cadjs/bin" \
@@ -178,11 +176,11 @@ check_builders() {
"${BUILDER_ENTRIES[@]}"
}
# The snapshot RUNTIME is not. Unlike `cad` and `dxf`, this skill gitignores its generated
# runtimes on develop and publishes them from build-test/main
# (setup-implicit-cad-skill-symlink.sh asserts they stay untracked). So it can only be
# checked where it is expected to EXIST -- the production layout. Checking it alongside the
# builders meant a fresh clone, which is what CI is, reported it missing and failed.
# The snapshot runtime is tracked and checked the same way, exactly as `cad` and `dxf` track
# theirs. It was briefly gitignored here and "published from build-test/main" instead --
# which nothing did: the publish job stages with `git add -A`, so an ignored path never
# reached main at all, and the shipped skill sat in Playwright for the full 300s timeout
# with no render.html to load.
check_snapshot() {
build_snapshot_runtime "$CHECK_DIR/snapshot-runtime" "$SNAPSHOT_BUILD_DEPS_DIR"
check_snapshot_runtime "$SNAPSHOT_RUNTIME_DIR" "$CHECK_DIR/snapshot-runtime" \
@@ -192,7 +190,10 @@ check_snapshot() {
if [ "$MODE" = "check" ] && [ -L "$IMPLICITJS_RUNTIME_DIR" ]; then
rm -rf "$CHECK_DIR"
check_builders || exit 1
stale=0
check_builders || stale=1
check_snapshot || stale=1
[ "$stale" -eq 0 ] || exit 1
check_development_layout
exit 0
fi
@@ -41,30 +41,8 @@ done
# shellcheck source=scripts/dev/symlink-utils.sh
source "$UTILS_SCRIPT"
check_no_generated_runtimes() {
local tracked_runtime
tracked_runtime="$(
git ls-files \
"skills/implicit-cad/scripts/export/runtime" \
"skills/implicit-cad/scripts/export/runtime/**" \
"skills/implicit-cad/scripts/snapshot/runtime" \
"skills/implicit-cad/scripts/snapshot/runtime/**" \
2>/dev/null || true
)"
if [ -n "$tracked_runtime" ]; then
echo "Implicit CAD generated runtimes must not be tracked on develop." >&2
echo "Run scripts/dev/setup-symlinks.sh to restore the implicit-cad development layout." >&2
echo "$tracked_runtime" | sed 's/^/- /' >&2
return 1
fi
}
cd "$REPO_ROOT"
setup_link "$MODE" "skills/implicit-cad/scripts/packages/implicitjs" "../../../../packages/implicitjs"
# scripts/gen runs cadgen.implicit_artifact, so the skill vendors cadgen exactly as `cad` and
# `dxf` do; in the development layout that vendored copy is a link to the package source.
setup_link "$MODE" "skills/implicit-cad/scripts/packages/cadgen" "../../../../packages/cadgen"
if [ "$MODE" = "check" ]; then
check_no_generated_runtimes
fi
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>CAD snapshot render</title>
<style>
html,
body {
margin: 0;
min-width: 100%;
min-height: 100%;
overflow: hidden;
background: transparent;
}
</style>
</head>
<body>
<script type="module" src="/snapshot-render.js"></script>
</body>
</html>
File diff suppressed because one or more lines are too long