nx_pageref_lib.nx
buildroot/runtime/nx_pageref_lib.nx
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
imports: none
imported by: nx_page_verify.nxnx_pageref_gate.nxnx_sitesweep_lib.nx
structs
| none |
consts
| 23 | const PR_DQ: i64 = 34 // " |
| 24 | const PR_SQ: i64 = 39 // ' |
| 25 | const PR_DOT: i64 = 46 // . |
| 26 | const PR_LT: i64 = 60 // < |
| 27 | const PR_BANG: i64 = 33 // the ! that opens a doctype declaration |
| 85 | const PR_ATTR_DECLARED: i64 = 2 |
| 86 | const PR_TAG_LOOKBACK: i64 = 512 |
functions
| 29 | func pr_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 32 | func pr_starts(buf: *u8, n: i64, i: i64, lit: *u8) -> i64 |
| 45 | func pr_nattr() -> i64 { return 2 } |
| 46 | func pr_attr(k: i64) -> *u8 |
| 58 | func pr_attr_hit(buf: *u8, n: i64, i: i64, out: *i64) -> i64 |
| 88 | func pr_declared_type(buf: *u8, n: i64, at: i64, end: i64) -> i64 |
| 109 | func pr_declared_hit(buf: *u8, n: i64, i: i64, out: *i64) -> i64 |
| 156 | func pr_nbinext() -> i64 { return 9 } |
| 157 | func pr_binext(k: i64) -> *u8 |
| 171 | func pr_lastdot(url: *u8) -> i64 called by 1: pr_ext_class |
| 182 | func pr_ext_class(url: *u8) -> i64 |
| 202 | func pr_body_is_html(body: *u8, n: i64) -> i64 |
| 215 | func pr_is_fallback(url: *u8, body: *u8, n: i64) -> i64 |