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

6030 B100 linesdepth 7pulls 25 transitivereach 0 importersview sourcekind gate/prooftopic js
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_js_eval.nx nx_html_to_text.nx nx_seg_store.nx nx_js_hydrate_index_gate.nx

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ r_clen sys_mmap ↻ nx_html_to_text nx_html_to_text_x h2t_state_new sys_mmap ↻ sys_mmap ↻ h2t_scan_tag h2t_skip_to_gt h2t_scan_name h2t_is_name h2t_is_block_tag h2t_name_eq_lit h2t_lc h2t_lc ↻ h2t_is_suppress_tag h2t_name_eq_lit ↻ h2t_emit_newline h2t_name_eq_lit ↻ h2t_emit_raw

structs

none

consts

none

functions

22func r_clen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
24func next_segid(prefix: *u8) -> i64
called by 1: index_doc calls 2: sys_mmapss_manifest_cap
44func index_doc(prefix: *u8, key: *u8, text: *u8, tlen: i64) -> i64
52func term_count(prefix: *u8, term: *u8) -> i64
called by 1: main calls 3: ss_opensys_mmapss_term
60func main() -> i64