nx_jsbalance.nx -- DOES THE EMITTED JAVASCRIPT EVEN LEX? A structural balance check over a page
this estate GENERATES, so a bad emit cannot reach a browser as a black screen.
WHY THIS EXISTS, AND IT IS MY OWN OUTAGE. 2026-08-25 I edited nx_game_page_emit's emitted guard,
shipped it through build -> promote -> ship lane -> live docroot, and /world/beach and /world/craft
both went BLACK. Every gate in the chain was GREEN: the organ compiled, the wasm-vm gate passed,
the ship lane read the page back and verified its marker. NOT ONE OF THEM PARSES THE JAVASCRIPT.
The estate emits ~410 KB of JS per page and had no check that it lexes at all, so a single stray
brace or unterminated string takes the whole script down -- and with the script down, even the
software-renderer fallback never runs. That is the difference between "ugly" and "black".
★A PIPELINE THAT VERIFIES EVERY STAGE EXCEPT THE ARTIFACT'S OWN LANGUAGE IS GREEN ALL THE WAY TO
THE OUTAGE.
WHAT IT CHECKS, AND ONLY THIS: the three faults that take a whole script out at once --
1. an unterminated string or template literal at EOF
2. an unterminated block comment at EOF
3. bracket depth that ends non-zero, or ever goes NEGATIVE (a close before its open)
It is a LEXER, not a parser. It cannot see a misspelled identifier or a wrong argument, and it does
not pretend to: those fail one call, not the whole file, and the browser reports them.
⚠ DECLARED IMPRECISION, because a checker whose blind spots are unstated gets trusted as exact.
JavaScript cannot be lexed without parsing: `/` is division or the start of a regex literal
depending on the grammatical position before it, and no scanner settles that without a parser.
This one treats every `/` as division, so a REGEX LITERAL containing a quote or a brace would be
miscounted. That is the one construct it can be wrong about, and it errs by REPORTING IMBALANCE on
a valid file -- loud, never silent. Before wiring, it is calibrated on the known-good live page:
if it cannot pass a page a browser runs, it is too naive to gate with, and the calibration says so
rather than the ratchet being loosened to fit.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 23 importers
diagram shows first 10 each side; +0 more imports, +13 more importers in the complete lists below.