code wiki / _hdl_build / nx_js_hydrate_index_gate.nx
nx_js_hydrate_index_gate.nx
buildroot/runtime/_hdl_build/nx_js_hydrate_index_gate.nx
about
nx_js_hydrate_index_gate.nx -- CLOSES THE LOOP: a page whose INLINE JS builds content -> hydrate
(js_render_page, async-drained) -> extract text -> INDEX into a seg_store shard -> the JS-built token
is SEARCHABLE (ss_term finds it), whereas indexing the RAW static HTML does NOT. Proves hydration makes
JS content indexable/searchable -- the payoff of the whole JS-execution arc, end-to-end, HERMETIC.
D001 MIGRATION 2026-08-22 -- WHY THIS FILE CHANGED. It hand-rolled its own pass/total counters and
printed "=== GREEN (4/4) ===" with NO canonical verdict= anchor, so /api/promote REFUSED it by name and
nx_gate_green could not judge it: its outcome has been unreadable FROM OUTSIDE for its whole life.
It now inherits nx_gate_verdict, so declared == executed BY CONSTRUCTION (a hand-rolled counter can
print 5/4 when a tooth silently stops running) and the EXIT CODE CARRIES the verdict.
AND THE EMPTY-SET HOLE IS CLOSED: T2 and T4 are ABSENCE assertions -- "the JS token is NOT in the
static shard", "'loading' is GONE from the hydrated one" -- and BOTH PASS TRIVIALLY IF NOTHING WAS
INDEXED AT ALL. gv_subjects binds them to their denominators, so a hydration that silently produced
zero bytes now SKIPs (evidence=none) instead of reporting a clean 4/4.
license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_js_eval.nxnx_html_to_text.nxnx_seg_store.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
| none |
functions
| 22 | func r_clen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 24 | func next_segid(prefix: *u8) -> i64 |
| 44 | func index_doc(prefix: *u8, key: *u8, text: *u8, tlen: i64) -> i64 |
| 52 | func term_count(prefix: *u8, term: *u8) -> i64 |
| 60 | func main() -> i64 |