#!/usr/bin/env node /** * smoke-studio.mjs — the FIVE-SECOND studio check, runnable on every edit. * * WHY THIS EXISTS (measured, 2026-09-22). A single commit shipped the requested change AND a * regression: a base prefix applied to an already-rooted URL produced * 404 /__plugin-gallery//plugin-designs//index.js * and 404'd ALL 29 studio tabs. Finding it took 32 minutes. The root-cause analysis * (internal-tracker/01-ideation-research/RESEARCH-why-plugin-studio-changes-are-slow.md) attributes the * single largest share of that to there being NO DEV-SURFACE GATE. The census it measured: * package.json scripts ........................ 76 * gate-ish (check:/verify:/smoke:/probe:) ..... 46 * gates that launch a real browser ............ 13 * gates in verify:browser-all ................. 7 * gates that exercise the DEV SERVER .......... 0 <- the hole this closes * * ★ WHY THE BUILD COULD NEVER HAVE CAUGHT IT. The BUILT manifest hands RELATIVE refs * ("./big-picture/big-picture.js"); the DEV manifest hands ROOTED ones * ("/plugin-designs/big-picture/index.js"). A `base + ref` join is therefore correct forever in the * built tree and broken instantly in dev — every build-time gate stays green while every developer's * studio is broken. A product that must work on ten laptops cannot be verified by the build alone. * See REFERENCE-the-four-surface-contract.md. * * ★ WHY IT ACTIVATES ONE TAB, NOT 29. The full sweep costs ~75s (29 tabs x ~2.5s), so it only ever * gets run at the END of a change — which is exactly how a regression rides along undetected. One * mount exercises the whole resolver path: manifest fetch -> scriptUrl resolve -> module load -> * customElements.define -> mount. If the resolver is wrong, tab 1 fails like all 29. Cheap enough to * run on every edit is worth more than thorough enough to run once. * * WHAT IT ASSERTS — each one maps to a defect that actually happened: * 1. `/` serves the STUDIO, not a staging page (three staging surfaces have masqueraded as the product) * 2. the element MOUNTS and its tag is DEFINED (a classic