code wiki / (root) / nx_pageref_lib.nx

nx_pageref_lib.nx

buildroot/runtime/nx_pageref_lib.nx

10054 B219 linesdepth 0pulls 0 transitivereach 5 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_pageref_lib.nx -- THE ASSET-REFERENCE VOCABULARY: which attributes on a page name an artifact the browser will fetch, and which file extensions must never answer HTML. ONE owner, imported by BOTH the verifier (nx_page_verify) and its in-process gate (nx_pageref_gate) -- the nx_sitesweep_lib shape, for the same reason: the piece of judgement must be biteable without a fork or a network. WHY THIS EXISTS (measured 2026-08-26, debt 1787786411). nx_page_verify reported checked=2 on the live /exceed/vrm/seed-san, a page carrying FOUR data-glb= mesh references. Its extractor knew src= (both quote styles, plus bare) and <link href=, and had never known data-glb= -- an attribute nx_absent shows is emitted from exactly ONE site estate-wide (nx_asset_page.nx:432, matches=1 coverage_complete=1 corpus_complete=1). By that organ's own banked law: A REF THE EXTRACTOR CANNOT SEE IS A REF THE VERDICT SILENTLY ACQUITS. Four mesh refs per asset page were being acquitted without ever being fetched. EVERY LENGTH HERE IS DERIVED FROM ITS LITERAL, NEVER HAND-COUNTED. A hand-counted length beside a string literal is a second copy of that literal's shape and the two drift silently -- change the string, forget the number, and the parser reads the wrong window while still compiling. THE EXTENSION MATCH IS EXACT TO END-OF-URL, NOT A PREFIX AT THE DOT. The incumbent tested sw_starts(aurl, dot, ".png"), which also accepts .pngx; exactness costs one comparison and is bite-proven here by a neg-control. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 0 imports · 3 importers

nx_pageref_lib.nx nx_page_verify.nx nx_pageref_gate.nx nx_sitesweep_lib.nx

imports: none

imported by: nx_page_verify.nxnx_pageref_gate.nxnx_sitesweep_lib.nx

structs

none

consts

23const PR_DQ: i64 = 34 // "
24const PR_SQ: i64 = 39 // '
25const PR_DOT: i64 = 46 // .
26const PR_LT: i64 = 60 // <
27const PR_BANG: i64 = 33 // the ! that opens a doctype declaration
85const PR_ATTR_DECLARED: i64 = 2
86const PR_TAG_LOOKBACK: i64 = 512

functions

29func pr_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
32func pr_starts(buf: *u8, n: i64, i: i64, lit: *u8) -> i64
45func pr_nattr() -> i64 { return 2 }
46func pr_attr(k: i64) -> *u8
58func pr_attr_hit(buf: *u8, n: i64, i: i64, out: *i64) -> i64
called by 1: main calls 4: pr_nattrpr_attrpr_startspr_len
88func pr_declared_type(buf: *u8, n: i64, at: i64, end: i64) -> i64
109func pr_declared_hit(buf: *u8, n: i64, i: i64, out: *i64) -> i64
156func pr_nbinext() -> i64 { return 9 }
157func pr_binext(k: i64) -> *u8
171func pr_lastdot(url: *u8) -> i64
called by 1: pr_ext_class
182func pr_ext_class(url: *u8) -> i64
202func pr_body_is_html(body: *u8, n: i64) -> i64
called by 2: mainpr_is_fallback calls 1: pr_starts
215func pr_is_fallback(url: *u8, body: *u8, n: i64) -> i64