code wiki / (root) / nx_reveal_lib.nx

nx_reveal_lib.nx

buildroot/runtime/nx_reveal_lib.nx

21668 B393 linesdepth 2pulls 2 transitivereach 5 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_reveal_lib.nx nx_asset_page.nx nx_compare_results_lib.nx

imports: nx_syscalls.nx

imported by: nx_asset_page.nxnx_compare_results_lib.nx

structs

none

consts

26const RVL_MODE_OPEN: i64 = 0
27const RVL_MODE_CLICK: i64 = 1
28const RVL_MODE_GATED: i64 = 2
29const RVL_RATING_GENERAL: i64 = 0
30const RVL_RATING_ADULT: i64 = 1
31const RVL_OVERFLOW: i64 = 0 - 1
32const RVL_NL: i64 = 10
33const RVL_CR: i64 = 13
34const RVL_PIPE: i64 = 124
35const RVL_LT: i64 = 60
36const RVL_GT: i64 = 62
37const RVL_AMP: i64 = 38
38const RVL_QUOT: i64 = 34
39const RVL_APOS: i64 = 39
40const RVL_SLASH: i64 = 47
41const RVL_I64: i64 = 8
42const RVL_BYTE: i64 = 255
44const RVL_F_ID: i64 = 1
45const RVL_F_MODE: i64 = 2
46const RVL_F_RATING: i64 = 3
47const RVL_F_SOURCE: i64 = 4
48const RVL_F_LABEL: i64 = 5
49const RVL_FIELDS: i64 = 6
51const RVL_L_FOUND: i64 = 0
52const RVL_L_MODE: i64 = 1
53const RVL_L_RATING: i64 = 2
54const RVL_L_SRC_S: i64 = 3
55const RVL_L_SRC_E: i64 = 4
56const RVL_L_LAB_S: i64 = 5
57const RVL_L_LAB_E: i64 = 6
58const RVL_L_N: i64 = 7
60const RVL_T_OPEN: i64 = 0
61const RVL_T_CLICK: i64 = 1
62const RVL_T_GATED: i64 = 2
63const RVL_T_UNKNOWN: i64 = 3
64const RVL_T_ADULT: i64 = 4
65const RVL_T_N: i64 = 5
67const RVL_A_COVERED: i64 = 0
68const RVL_A_OPEN: i64 = 1
69const RVL_A_BARE: i64 = 2
70const RVL_A_BLOCKS: i64 = 3
71const RVL_A_N: i64 = 4
72const RVL_POLICY_FILE: *u8 = "knowledge/reveal_policy.conf"
73const RVL_POLICY_FILE_BUILDROOT: *u8 = "buildroot/knowledge/reveal_policy.conf"
74const RVL_POLICY_FILE_UP: *u8 = "../knowledge/reveal_policy.conf"
75const RVL_WHICH_NONE: i64 = 0
76const RVL_WHICH_HERE: i64 = 1
77const RVL_WHICH_BUILDROOT: i64 = 2
78const RVL_WHICH_UP: i64 = 3
79const 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"
80const RVL_CLASS_TAG: *u8 = "class"
81const RVL_W_OPEN: *u8 = "open"
82const RVL_W_CLICK: *u8 = "click"
83const RVL_W_GATED: *u8 = "gated"
84const RVL_W_ADULT: *u8 = "adult"
85const RVL_UNKNOWN_LABEL: *u8 = "Undeclared content class, withheld from public pages until a policy row names it"
86const RVL_BLOCK_OPEN: *u8 = "<details class=\"nx-reveal\""
87const RVL_BLOCK_CLOSE: *u8 = "</details>"
88const RVL_FIG_OPEN: *u8 = "<figure class=\"nx-open\""
89const RVL_FIG_CLOSE: *u8 = "</figure>"

functions

91func rvl_slen(s: *u8) -> i64 { var n: i64 = 0; while ((s[n] as i64) & RVL_BYTE) != 0 { n = n + 1 } return n }
94func rvl_cat(out: *u8, o: i64, cap: i64, s: *u8) -> i64
103func rvl_esc_byte(out: *u8, o: i64, cap: i64, c: i64) -> i64
called by 2: cres_renderrvl_cat_span_esc calls 1: rvl_cat
116func rvl_cat_span_esc(out: *u8, o: i64, cap: i64, buf: *u8, s: i64, e: i64) -> i64
125func 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)) }
128func rvl_span_is(buf: *u8, s: i64, e: i64, lit: *u8) -> i64
135func rvl_mode_of_span(buf: *u8, s: i64, e: i64) -> i64
called by 1: rvl_find calls 1: rvl_span_is
141func rvl_find(pol: *u8, pn: i64, cls: *u8, rec: *i64) -> i64
184func rvl_policy_load(len: *i64, which: *i64) -> *u8
199func rvl_decide(file: *u8, fn: i64, cls: *u8, rec: *i64, srcbuf: *i64) -> i64
238func rvl_mode(file: *u8, fn: i64, cls: *u8) -> i64
called by 1: main calls 2: sys_mmaprvl_decide
244func rvl_rating(file: *u8, fn: i64, cls: *u8) -> i64
called by 1: cres_any_adult calls 2: sys_mmaprvl_decide
251func rvl_mode_name(m: i64) -> *u8
256func rvl_tally_clear(t: *i64) -> i64 { var i: i64 = 0; while i < RVL_T_N { t[i] = 0; i = i + 1 } return 0 }
called by 2: ap_panelcres_render
260func rvl_head_meta(out: *u8, o: i64, cap: i64, any_adult: i64) -> i64
called by 1: cres_render calls 1: rvl_cat
266func rvl_css(out: *u8, o: i64, cap: i64) -> i64
called by 2: maincres_render calls 1: rvl_cat
281func rvl_emit_gated(out: *u8, o: i64, cap: i64, file: *u8, fn: i64, cls: *u8, caption: *u8, tally: *i64) -> i64
300func rvl_block_open(out: *u8, o: i64, cap: i64, file: *u8, fn: i64, cls: *u8, caption: *u8, tally: *i64, mode_out: *i64) -> i64
331func rvl_block_close(out: *u8, o: i64, cap: i64, mode: i64, caption: *u8) -> i64
340func rvl_emit_img(out: *u8, o: i64, cap: i64, file: *u8, fn: i64, cls: *u8, href: *u8, alt: *u8, caption: *u8, tally: *i64) -> i64
353func rvl_at(html: *u8, n: i64, i: i64, lit: *u8) -> i64
360func rvl_media_tag_at(html: *u8, n: i64, i: i64) -> i64
called by 1: rvl_audit calls 1: rvl_at
372func rvl_audit(html: *u8, n: i64, rep: *i64) -> i64