openpencil/tools
Kayshen-X d20e1acf0f build(step-1b): tools/check-wasm-bundle.sh — local A3 bundle gate
Implements the Phase A A4 NIT-1 fix from codex Phase A gate review
(verdict GO, 2 NITs flagged): the local equivalent of the Step 1b §6
+ §7.1 CI gate, runnable by developers before submitting Phase A-E
PRs. The full CI workflow remains DEFERRED in
`.github/workflows/rust-release.yml` until brew emscripten install +
EMSDK + .wasm.a → .a symlink + wasm-bindgen + wasm-opt are
automated; until then this script is the authoritative gate.

What it enforces (matches spec §6 + §7.1):
  - EMSDK env var present (build-time-only emsdk libcxx headers +
    wasm-aware clang)
  - cargo build → wasm-bindgen → wasm-opt -Oz pipeline succeeds
  - 0 env.* imports in the post-bindgen bundle (any leak = LinkError
    at load time = regression)
  - gzip size ≤ STEP1B_SHELL_WASM_GZIP_LIMIT_BYTES (default 1 MiB)

Verified on the C-hard.2 bundle: 613 006 bytes gzip (58% of 1 MiB
ceiling), 0 env.* imports, exit 0.

Step 1b Phase A — completes A3 (local) + A4 (codex verdict GO).
2026-05-09 21:44:00 +08:00
..
check-jian-boundaries.sh feat(shell-native): Step 1a Task 4 — basic_window demo + acceptance + Phase C Gate 2026-05-05 22:39:00 +08:00
check-wasm-bundle.sh build(step-1b): tools/check-wasm-bundle.sh — local A3 bundle gate 2026-05-09 21:44:00 +08:00
fetch-skia-artifact.sh build(step-1b): add tools/fetch-skia-artifact.sh (Variant A release path) 2026-05-09 21:04:00 +08:00