nx_reveal_lib.nx
buildroot/runtime/nx_reveal_lib.nx
about
nx_reveal_lib.nx -- THE ONE CLICK-TO-OPEN PRIMITIVE FOR PUBLIC BOARDS (ecosystem EC64, 2026-09-17).
Operator 2026-09-17: "i dont want nudity or other things shown without a clickthrough to open or expand on public boards"
and, of result pages, "i dont want them strewn about". Every emitter that puts result media on a public page composes
THIS lib, so the rule lives in the path and not in a seat's memory:
* a content CLASS is data on every media item; the class decides the MODE through the policy rows:
open = may render inline (charts, diagrams)
click = collapsed behind a native disclosure; nothing is drawn until the reader opens it, and with scripting
enabled a lazy image inside a closed disclosure is not fetched either
gated = never emitted on a public page: a named placeholder, and the href is NOT written (a URL is a leak)
* policy rows are DATA: class|<id>|<mode>|<rating>|<source>|<label>, the built-in rows below plus an optional file
(knowledge/reveal_policy.conf). THE FILE MAY ONLY TIGHTEN: the effective mode is the stricter of the two, a class the
file declares with rating adult can never be open, and a class NOBODY declares is gated. Wrong in the direction of
showing less, by construction.
* rating adult on any emitted item makes the page carry the rating meta the search engines' safe filters read.
* source is the IPTC digital source type term for the item (algorithmicMedia = "created purely by an algorithm not
based on any sampled training data", which is what the estate's SDF renders are), written as a data attribute so a
synthetic render says so in a machine-readable place as well as in words.
* rvl_audit is the VERIFIER: it counts media tags in an emitted page that sit outside a reveal block or an open
figure. Every consumer's gate holds that count at zero over its own output.
The disclosure is the platform's own (details/summary): keyboard operable, announced by assistive technology, and it
works with scripting off. A click-to-open is a CONTENT WARNING, NOT AGE ASSURANCE: that is why explicit media and nude
reference media of real people are gated off the public surface here rather than hidden behind a click.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_asset_page.nxnx_compare_results_lib.nx
structs
| none |
consts
| 26 | const RVL_MODE_OPEN: i64 = 0 |
| 27 | const RVL_MODE_CLICK: i64 = 1 |
| 28 | const RVL_MODE_GATED: i64 = 2 |
| 29 | const RVL_RATING_GENERAL: i64 = 0 |
| 30 | const RVL_RATING_ADULT: i64 = 1 |
| 31 | const RVL_OVERFLOW: i64 = 0 - 1 |
| 32 | const RVL_NL: i64 = 10 |
| 33 | const RVL_CR: i64 = 13 |
| 34 | const RVL_PIPE: i64 = 124 |
| 35 | const RVL_LT: i64 = 60 |
| 36 | const RVL_GT: i64 = 62 |
| 37 | const RVL_AMP: i64 = 38 |
| 38 | const RVL_QUOT: i64 = 34 |
| 39 | const RVL_APOS: i64 = 39 |
| 40 | const RVL_SLASH: i64 = 47 |
| 41 | const RVL_I64: i64 = 8 |
| 42 | const RVL_BYTE: i64 = 255 |
| 44 | const RVL_F_ID: i64 = 1 |
| 45 | const RVL_F_MODE: i64 = 2 |
| 46 | const RVL_F_RATING: i64 = 3 |
| 47 | const RVL_F_SOURCE: i64 = 4 |
| 48 | const RVL_F_LABEL: i64 = 5 |
| 49 | const RVL_FIELDS: i64 = 6 |
| 51 | const RVL_L_FOUND: i64 = 0 |
| 52 | const RVL_L_MODE: i64 = 1 |
| 53 | const RVL_L_RATING: i64 = 2 |
| 54 | const RVL_L_SRC_S: i64 = 3 |
| 55 | const RVL_L_SRC_E: i64 = 4 |
| 56 | const RVL_L_LAB_S: i64 = 5 |
| 57 | const RVL_L_LAB_E: i64 = 6 |
| 58 | const RVL_L_N: i64 = 7 |
| 60 | const RVL_T_OPEN: i64 = 0 |
| 61 | const RVL_T_CLICK: i64 = 1 |
| 62 | const RVL_T_GATED: i64 = 2 |
| 63 | const RVL_T_UNKNOWN: i64 = 3 |
| 64 | const RVL_T_ADULT: i64 = 4 |
| 65 | const RVL_T_N: i64 = 5 |
| 67 | const RVL_A_COVERED: i64 = 0 |
| 68 | const RVL_A_OPEN: i64 = 1 |
| 69 | const RVL_A_BARE: i64 = 2 |
| 70 | const RVL_A_BLOCKS: i64 = 3 |
| 71 | const RVL_A_N: i64 = 4 |
| 72 | const RVL_POLICY_FILE: *u8 = "knowledge/reveal_policy.conf" |
| 73 | const RVL_POLICY_FILE_BUILDROOT: *u8 = "buildroot/knowledge/reveal_policy.conf" |
| 74 | const RVL_POLICY_FILE_UP: *u8 = "../knowledge/reveal_policy.conf" |
| 75 | const RVL_WHICH_NONE: i64 = 0 |
| 76 | const RVL_WHICH_HERE: i64 = 1 |
| 77 | const RVL_WHICH_BUILDROOT: i64 = 2 |
| 78 | const RVL_WHICH_UP: i64 = 3 |
| 79 | const RVL_BUILTIN: *u8 = "class|chart|open|general|algorithmicMedia|Chart or diagram drawn by the estate\nclass|face-synthetic|click|general|algorithmicMedia|Synthetic face render, generated by the estate\nclass|body-synthetic-clothed|click|general|algorithmicMedia|Synthetic body render, clothed, generated by the estate\nclass|reference-photo|click|general|digitalCapture|Reference photo of a real person, beta review only\nclass|measured-overlay|click|general|compositeCapture|Reference photo with the rulers' overlay, beta review only\nclass|model-3d|click|general|algorithmicMedia|3D model viewer, opens on request\nclass|unclassified-image|click|general||Image whose publisher declared no content class\nclass|anatomy-synthetic|click|adult|algorithmicMedia|Synthetic anatomical render, may show an unclothed body\nclass|nudity-synthetic|click|adult|algorithmicMedia|Synthetic render containing nudity\nclass|nudity-reference|gated|adult|digitalCapture|Reference media containing nudity, withheld from public pages\nclass|explicit|gated|adult|algorithmicMedia|Explicit media, withheld from public pages\n" |
| 80 | const RVL_CLASS_TAG: *u8 = "class" |
| 81 | const RVL_W_OPEN: *u8 = "open" |
| 82 | const RVL_W_CLICK: *u8 = "click" |
| 83 | const RVL_W_GATED: *u8 = "gated" |
| 84 | const RVL_W_ADULT: *u8 = "adult" |
| 85 | const RVL_UNKNOWN_LABEL: *u8 = "Undeclared content class, withheld from public pages until a policy row names it" |
| 86 | const RVL_BLOCK_OPEN: *u8 = "<details class=\"nx-reveal\"" |
| 87 | const RVL_BLOCK_CLOSE: *u8 = "</details>" |
| 88 | const RVL_FIG_OPEN: *u8 = "<figure class=\"nx-open\"" |
| 89 | const RVL_FIG_CLOSE: *u8 = "</figure>" |
functions
| 91 | func rvl_slen(s: *u8) -> i64 { var n: i64 = 0; while ((s[n] as i64) & RVL_BYTE) != 0 { n = n + 1 } return n } |
| 94 | func rvl_cat(out: *u8, o: i64, cap: i64, s: *u8) -> i64 |
| 103 | func rvl_esc_byte(out: *u8, o: i64, cap: i64, c: i64) -> i64 |
| 116 | func rvl_cat_span_esc(out: *u8, o: i64, cap: i64, buf: *u8, s: i64, e: i64) -> i64 |
| 125 | func rvl_cat_esc(out: *u8, o: i64, cap: i64, s: *u8) -> i64 { return rvl_cat_span_esc(out, o, cap, s, 0, rvl_slen(s)) } called by 5: cres_renderrvl_emit_gatedrvl_block_openrvl_block_closervl_emit_img calls 2: rvl_cat_span_escrvl_slen |
| 128 | func rvl_span_is(buf: *u8, s: i64, e: i64, lit: *u8) -> i64 |
| 135 | func rvl_mode_of_span(buf: *u8, s: i64, e: i64) -> i64 |
| 141 | func rvl_find(pol: *u8, pn: i64, cls: *u8, rec: *i64) -> i64 |
| 184 | func rvl_policy_load(len: *i64, which: *i64) -> *u8 |
| 199 | func rvl_decide(file: *u8, fn: i64, cls: *u8, rec: *i64, srcbuf: *i64) -> i64 |
| 238 | func rvl_mode(file: *u8, fn: i64, cls: *u8) -> i64 |
| 244 | func rvl_rating(file: *u8, fn: i64, cls: *u8) -> i64 |
| 251 | func rvl_mode_name(m: i64) -> *u8 |
| 256 | func rvl_tally_clear(t: *i64) -> i64 { var i: i64 = 0; while i < RVL_T_N { t[i] = 0; i = i + 1 } return 0 } |
| 260 | func rvl_head_meta(out: *u8, o: i64, cap: i64, any_adult: i64) -> i64 |
| 266 | func rvl_css(out: *u8, o: i64, cap: i64) -> i64 |
| 281 | func rvl_emit_gated(out: *u8, o: i64, cap: i64, file: *u8, fn: i64, cls: *u8, caption: *u8, tally: *i64) -> i64 |
| 300 | func rvl_block_open(out: *u8, o: i64, cap: i64, file: *u8, fn: i64, cls: *u8, caption: *u8, tally: *i64, mode_out: *i64) -> i64 called by 2: ap_panelrvl_emit_img calls 6: sys_mmaprvl_decidervl_emit_gatedrvl_catrvl_cat_escrvl_cat_span_esc |
| 331 | func rvl_block_close(out: *u8, o: i64, cap: i64, mode: i64, caption: *u8) -> i64 |
| 340 | func rvl_emit_img(out: *u8, o: i64, cap: i64, file: *u8, fn: i64, cls: *u8, href: *u8, alt: *u8, caption: *u8, tally: *i64) -> i64 |
| 353 | func rvl_at(html: *u8, n: i64, i: i64, lit: *u8) -> i64 |
| 360 | func rvl_media_tag_at(html: *u8, n: i64, i: i64) -> i64 |
| 372 | func rvl_audit(html: *u8, n: i64, rep: *i64) -> i64 |