nx_jslogic_census.nx
buildroot/runtime/nx_jslogic_census.nx
about
nx_jslogic_census.nx -- THE RULER for the JS/HTML-INTEROP-ONLY law (operator standing order
2026-08-12: "we shouldnt be building into the js strings -- nishi os from the first bit up, js
and html only as an interop layer for 3rd-party systems"). It measures the AUTHORED JavaScript
living inside the page emitter's string literals so the migration into the wasm engine has a
number that can only go DOWN (the nx_sov_guard2 / nx_magicratchet ratchet shape).
MECHANISM (comments are SKIPPED -- a scanner that reads comments measures the documentation):
tokenize the NishiLang source into CODE / //-COMMENT / STRING states (backslash escapes inside
strings; REAL newlines inside literals are legal and stay in-string). Literal bytes count only
between the literal containing <script> and the literal containing </script> (inclusive), so
HTML/CSS chrome outside the script region is never charged. The base64 wasm payload and
gpe_num-emitted values are BUFFER emissions, not literals -- data crossing the boundary is
lawful and is not counted. DECLARED IMPRECISION: the two boundary literals carry a few bytes
of enclosing HTML, so totals are a small UPPER bound on authored JS.
CLASSES from knowledge/jslogic_class.conf rows `<fnv64-decimal> <CLASS>` where CLASS is
INTEROP (shim: decode/instantiate/blit/input/context plumbing) | LOGIC (game/engine behavior
that belongs in the wasm) | SHADER (GLSL display path -- judged separately). A literal whose
hash is not in the conf lands in UNKNOWN -- ITS OWN BUCKET, never silently merged; editing a
classified literal changes its hash and forces re-classification by construction.
usage: nx_jslogic_census check [srcpath] -> census + ratchet vs knowledge/status/jslogic.baseline
nx_jslogic_census snapshot [srcpath] -> census + deliberately re-record the baseline
nx_jslogic_census rows [srcpath] -> per-literal rows (hash, bytes, class, head) for conf work
exit: 0 GREEN (logic+unknown <= baseline) | 1 RED rose vs baseline | 2 usage | 3 unreadable-src
Journals every run: knowledge/status/jslogic.jrnl (epoch TAB totals). license_tier: ORIGINAL
No hw writes (Rule 26).
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 29 | const JC_MAGIC_1024: i64 = 1024 |
| 31 | const JC_SRC_DEF: *u8 = "buildroot/runtime/nx_game_page_emit.nx" |
| 32 | const JC_CONF: *u8 = "knowledge/jslogic_class.conf" |
| 33 | const JC_BASE: *u8 = "knowledge/status/jslogic.baseline" |
| 34 | const JC_JRNL: *u8 = "knowledge/status/jslogic.jrnl" |
| 35 | const JC_MAXLIT: i64 = 4096 |
functions
| 37 | func jc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 38 | func jc_puts(s: *u8) -> i64 { sys_write(1, s, jc_slen(s)); return 0 } |
| 39 | func jc_pn(v: i64) -> i64 |
| 52 | func jc_find(hay: *u8, off: i64, n: i64, needle: *u8) -> i64 |
| 66 | func jc_fnv(b: *u8, off: i64, len: i64) -> i64 called by 1: main |
| 78 | func jc_rdint(s: *u8, pos: *i64, n: i64) -> i64 called by 1: main |
| 96 | func main(argc: i64, argv: *i64) -> i64 |