code wiki / (root) / nx_refintake_gate.nx

nx_refintake_gate.nx

buildroot/runtime/nx_refintake_gate.nx

20343 B276 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_refintake_gate.nx -- the referee for nx_refintake_lib (aesthetictwin AT22, 2026-09-16). In-process, on fixtures built at runtime under /tmp/refintake_gate/ (never the production conf, never a network fetch): conf parsing, the licence decision, the declared-axis refusal (the group-label neg-control), gallery discovery with dedupe and percent-encoding, and the provenance parse the mirror leg relies on. Values are printed with gv_kv so a second method can recompute them; the verdict line stays LAST. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_refintake_lib.nx nx_refintake_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_refintake_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write 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 ↻ sys_mkdir rg_write sys_openat_wr sys_write ↻ ri_slen sys_close gv_need gv_puts ↻ sys_mmap ↻ ri_load sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ gv_check gv_puts ↻ ri_subject_licence

structs

none

consts

11const RG_DIR: *u8 = "/tmp/refintake_gate"
12const RG_CONF: *u8 = "/tmp/refintake_gate/refintake.conf"
13const RG_BADCONF: *u8 = "/tmp/refintake_gate/bad.conf"
14const RG_OUTCAP: i64 = 65536
15const RG_TILDE: i64 = 126
16const RG_CONF_TEXT: *u8 = "subject|alpha|Alpha Fixture|REVIEW|operator-declared\nsource|alpha|page|https://example.test/babe/Alpha|fx_alpha_page.html|-\nsource|alpha|image|https://example.test/pics/Alpha.jpg|fx_alpha_1.jpg|2019-05\nsource|alpha|image|https://example.test/pics/Alpha2.jpg|fx_alpha_2.jpg|-\ntag|alpha|malar_projection|high\nsubject|beta|Beta Fixture|REFUSED|no-consent\nsource|beta|image|https://example.test/pics/Beta.jpg|fx_beta_1.jpg|-\n"
17const RG_BADCONF_TEXT: *u8 = "subject|alpha|Alpha Fixture|REVIEW|operator-declared\ntag|alpha|ancestry|anything\ntag|alpha|canthal_tilt|positive\n"
19const RG_PAGE_TILDE: *u8 = "<div><a href=~/pics/Alpha Fixture.jpg~ class=img><img src=~/pics/Alpha Fixture_thumb3.jpg~></a><a href=~/pics/Alpha Fixture.jpg~>dup</a><a href=~/user-uploads/Alpha Fixture 2.jpg~>two</a><a href=~/pics/Alpha_thumb.jpg~>thumb</a></div>"
20const RG_RECEIPT: *u8 = "CA roots=167\nFETCH https://example.test/pics/Alpha.jpg\nstatus=200 body_bytes=4242\nPROVENANCE prov|1789584000|https://example.test/pics/Alpha.jpg|knowledge/fetched/fx_alpha_1.jpg|0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|4242|0\nSAVED knowledge/fetched/fx_alpha_1.jpg (4242 bytes)\n"
21const RG_RECEIPT_NOPROV: *u8 = "CA roots=167\nFETCH https://example.test/pics/Alpha.jpg\nstatus=0 body_bytes=0\n"
23const RG_HOSTS_TILDE: *u8 = "# fixture hosts\nhost|babepedia-pics|https://www.babepedia.com/babe/|href=~/pics/|6|~|https://www.babepedia.com|pics\nhost|babepedia-uploads|https://www.babepedia.com/babe/|href=~/user-uploads/|6|~|https://www.babepedia.com|uploads\nhost|bing-images|https://www.bing.com/images/search|murl&quot;:&quot;|17|&quot;|-|origin images\nhost|commons-category|https://commons.wikimedia.org/wiki/Category:|href=~/wiki/File:|6|~|https://commons.wikimedia.org|file pages\n"
25const RG_BING_PAGE: *u8 = "{&quot;murl&quot;:&quot;https://x.test/a b.jpg&quot;,&quot;turl&quot;:&quot;https://th.test/t.jpg&quot;,&quot;purl&quot;:&quot;https://page.test/p&quot;}{&quot;murl&quot;:&quot;https://x.test/c.jpg?w=1&amp;h=2&quot;}{&quot;murl&quot;:&quot;//cdn.test/d.jpg&quot;}{&quot;murl&quot;:&quot;https://x.test/a b.jpg&quot;}"
26const RG_BING_SKIP: i64 = 17
27const RG_BING_EXPECT: i64 = 3
28const RG_IMAGE_CLASSES: i64 = 4
31const RG_KVS_CODE: *u8 = "$440571814535234"
32const RG_KVS_URL: *u8 = "function/0/https://thothub.to/get_file/47/f88b17bbb9e870b22ca4eaef11836e29c1eebc25d6/1527000/1527540/1527540.mp4/"
33const RG_KVS_REAL: *u8 = "https://thothub.to/get_file/47/e9249ba11b70ebb87e8cb2a6f23e881fc1eebc25d6/1527000/1527540/1527540.mp4/"
34const RG_KVS_HEAD8: *u8 = "55165168"
35const RG_KVS_HEAD_N: i64 = 8
36const RG_KVS_TOKEN_N: i64 = 32
37const RG_KVS_PREFIX_LEN: i64 = 11
38const RG_KVS_HASH_OFF: i64 = 31
39const RG_KVS_PAGE: *u8 = "var flashvars = { video_url: 'function/0/https://h.test/get_file/1/0123456789abcdef0123456789abcdefXX/2/3/4.mp4/', postfix: '.mp4', license_code: '$440571814535234', rnd: '1' };"
40const RG_HIST_N: i64 = 256
41const RG_F_MP4: *u8 = "/tmp/refintake_gate/m.mp4"
42const RG_MP4_BOXLEN: i64 = 24
43const RG_MP4_HEAD: i64 = 12
44const RG_LC_F: i64 = 102
45const RG_LC_T: i64 = 116
46const RG_LC_Y: i64 = 121
47const RG_LC_P: i64 = 112
48const RG_LC_I: i64 = 105
49const RG_LC_S: i64 = 115
50const RG_LC_O: i64 = 111
51const RG_LC_M: i64 = 109
52const RG_F_JPEG: *u8 = "/tmp/refintake_gate/m.jpg"
53const RG_F_PNG: *u8 = "/tmp/refintake_gate/m.png"
54const RG_F_GIF: *u8 = "/tmp/refintake_gate/m.gif"
55const RG_F_WEBP: *u8 = "/tmp/refintake_gate/m.webp"
56const RG_F_HTML: *u8 = "/tmp/refintake_gate/m.html"
57const RG_F_OTHER: *u8 = "/tmp/refintake_gate/m.pdf"
58const RG_F_SHORT: *u8 = "/tmp/refintake_gate/m.short"
59const RG_FF: i64 = 255
60const RG_D8: i64 = 216
61const RG_E0: i64 = 224
62const RG_PNG0: i64 = 137
63const RG_P: i64 = 80
64const RG_N: i64 = 78
65const RG_G: i64 = 71

functions

67func rg_write_bytes(path: *u8, b: *u8, n: i64) -> i64
75func rg_write(path: *u8, text: *u8) -> i64
82func rg_quotes(s: *u8) -> *u8
91func main(argc: i64, argv: *i64) -> i64