code wiki / (root) / nx_refintake_lib.nx

nx_refintake_lib.nx

buildroot/runtime/nx_refintake_lib.nx

29835 B739 linesdepth 5pulls 5 transitivereach 26 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_refintake_lib.nx -- REFERENCE INTAKE AS AN ESTATE CAPABILITY (aesthetictwin AT22 rp_reference_intake, 2026-09-16). Operator: "build the collection into the nishi estate and let it do this via its capabilities" and, the same day, "build all of these fetch capabilities in the nishi estate". A declared subject (knowledge/refintake.conf, DATA) yields mirrored pages, discovered media links (patterns in knowledge/refintake.hosts, DATA: babepedia, Bing image search, Wikimedia Commons), mirrored media with a licence state beside every byte, an image-magic verdict on every mirror (a bot-challenge stub can never be journaled as a picture), and a per-subject journal. This lib is the decision core; nx_refintake is the CLI (pages, discover, mirror, verify, and the all workflow) and nx_refintake_gate proves it on fixtures, never on the production conf and never on the network. STANDING RULE (operator, repeated): references are usable through BETA -- fitting, testing, proposals -- and only the production publish is gated on the licence row. licence: REVIEW beta-usable | SHIP_OK licensed | REFUSED never. The intake measures on DECLARED MORPHOLOGY AXES only. A tag whose axis is not declared is refused BY NAME; the intake carries no ethnic, racial or religious label of any person, because those are not measurable axes. Composes: nx_research_fetch (mirror + PROVENANCE line), nx_tool_run (fork and capture). No hw writes (Rule 26). license_tier: ORIGINAL

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_tool_run.nx nx_refintake_lib.nx nx_refintake.nx nx_refintake_gate.nx nx_twincard_lib.nx

imports: nx_syscalls.nxnx_tool_run.nx

imported by: nx_refintake.nxnx_refintake_gate.nxnx_twincard_lib.nx

structs

none

consts

17const RI_CONF: *u8 = "knowledge/refintake.conf"
18const RI_HOSTS: *u8 = "knowledge/refintake.hosts"
19const RI_DIR: *u8 = "knowledge/refintake"
20const RI_FETCHED: *u8 = "knowledge/fetched/"
21const RI_FETCHER_OFFC: *u8 = "_offc/nx_research_fetch.elf"
22const RI_FETCHER_HERE: *u8 = "./nx_research_fetch.elf"
23const RI_FETCHER_UP: *u8 = "../nx_research_fetch.elf"
24const RI_AXES: *u8 = " malar_projection bizyg_bigon midface_height canthal_tilt palpebral_fissure vthird_upper vthird_mid vthird_lower facial_index intercanthal nasal_index lip_ratio mandibular_angle whr bust_waist frame hair_length hair_curl hair_colour skin_undertone skin_tan age_at_photo "
25const RI_HTTPS_PREFIX: *u8 = "https:"
26const RI_NL: i64 = 10
27const RI_SP: i64 = 32
28const RI_QUOTE: i64 = 34
29const RI_AMP: i64 = 38
30const RI_PIPE: i64 = 124
31const RI_PCT: i64 = 37
32const RI_DASH: i64 = 45
33const RI_DOT: i64 = 46
34const RI_SLASH: i64 = 47
35const RI_LT: i64 = 60
36const RI_DIGIT0: i64 = 48
37const RI_DIGIT9: i64 = 57
38const RI_UNDERSCORE: i64 = 95
39const RI_LC_G: i64 = 103
40const RI_LC_N: i64 = 110
41const RI_LC_P: i64 = 112
42const RI_MODE644: i64 = 420
43const RI_MODE755: i64 = 493
44const RI_PATHB: i64 = 1024
45const RI_ROWB: i64 = 4096
46const RI_NUMB: i64 = 24
47const RI_CAPB: i64 = 262144
48const RI_I64: i64 = 8
49const RI_ARGV_N: i64 = 4
50const RI_SHA_HEX: i64 = 64
51const RI_PROV_PREFIX_LEN: i64 = 11
52const RI_HREF_LEN: i64 = 6
53const RI_MAGIC_N: i64 = 16
54const RI_OK: i64 = 0
55const RI_E_CONF: i64 = 0 - 3
56const RI_E_NOSUBJECT: i64 = 0 - 4
57const RI_E_REFUSED: i64 = 0 - 5
58const RI_E_AXIS: i64 = 0 - 6
59const RI_E_FETCH: i64 = 0 - 7
60const RI_E_NOPROV: i64 = 0 - 8
61const RI_STDOUT: i64 = 1
62const RI_F_SLUG: i64 = 1
63const RI_SUBJ_LIC: i64 = 3
64const RI_SRC_KIND: i64 = 2
65const RI_SRC_URL: i64 = 3
66const RI_SRC_MIRROR: i64 = 4
67const RI_SRC_DATE: i64 = 5
68const RI_TAG_AXIS: i64 = 2
69const RI_PROV_SHA: i64 = 4
70const RI_PROV_BYTES: i64 = 5
72const RI_F_HOST_PREFIX: i64 = 2
73const RI_F_HOST_NEEDLE: i64 = 3
74const RI_F_HOST_SKIP: i64 = 4
75const RI_F_HOST_TERM: i64 = 5
76const RI_F_HOST_BASE: i64 = 6
78const RI_IMG_UNREADABLE: i64 = 0
79const RI_IMG_JPEG: i64 = 1
80const RI_IMG_PNG: i64 = 2
81const RI_IMG_GIF: i64 = 3
82const RI_IMG_WEBP: i64 = 4
83const RI_IMG_HTML: i64 = 5
84const RI_IMG_OTHER: i64 = 6
85const RI_IMG_MP4: i64 = 7
86const RI_IMG_N: i64 = 8
88const RI_J_URL: i64 = 3
89const RI_J_PATH: i64 = 4
90const RI_J_STATUS: i64 = 8
590const RI_KVS_PREFIX: *u8 = "function/0/"
591const RI_KVS_URL_KEY: *u8 = "video_url: '"
592const RI_KVS_CODE_KEY: *u8 = "license_code: '"
593const RI_KVS_HASH_LEN: i64 = 32
594const RI_KVS_OFFSETS: i64 = 4
595const RI_KVS_MOD: i64 = 10
596const RI_KVS_QUAD: i64 = 4
597const RI_KVS_APOS: i64 = 39
598const RI_KVS_COLON: i64 = 58
599const RI_KVS_MAXDIGITS: i64 = 18
600const RI_KVS_HASH_SLASHES: i64 = 3
601const RI_KVS_TOKEN_CAP: i64 = 96
602const RI_KVS_E_CODE: i64 = 0 - 1
603const RI_KVS_E_URL: i64 = 0 - 2

functions

92func ri_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
93func ri_streq(a: *u8, b: *u8) -> i64
99func ri_cat(d: *u8, o: i64, s: *u8) -> i64
106func ri_catn(d: *u8, o: i64, v: i64) -> i64
119func ri_puts(s: *u8) -> i64 { return sys_write(RI_STDOUT, s, ri_slen(s)) }
120func ri_putn(v: i64) -> i64 { let b: *u8 = sys_mmap(RI_NUMB); ri_catn(b, 0, v); return ri_puts(b) }
121func ri_atoi(s: *u8) -> i64
134func ri_line_end(buf: *u8, n: i64, i: i64) -> i64
139func ri_starts(buf: *u8, n: i64, i: i64, lit: *u8) -> i64
149func ri_prefix(s: *u8, lit: *u8) -> i64
158func ri_field(buf: *u8, i: i64, e: i64, idx: i64, out: *u8, cap: i64) -> i64
180func ri_load(path: *u8, lenp: *i64) -> *u8
186func ri_subject_licence(buf: *u8, n: i64, slug: *u8, lic: *u8) -> i64
204func ri_count_rows(buf: *u8, n: i64, kindword: *u8, slug: *u8, srckind: *u8) -> i64
225func ri_source_at(buf: *u8, n: i64, slug: *u8, idx: i64, kind: *u8, url: *u8, mirror: *u8, date: *u8) -> i64
249func ri_axis_declared(axis: *u8) -> i64
called by 1: ri_tags_check calls 3: sys_mmapri_catri_slen
269func ri_tags_check(buf: *u8, n: i64, bad: *u8) -> i64
288func ri_has_line(buf: *u8, n: i64, s: *u8) -> i64
304func ri_contains(buf: *u8, n: i64, s: *u8) -> i64
318func ri_pattern(out: *u8, tail: *u8) -> i64
called by 1: ri_discover calls 1: ri_cat
328func ri_discover_pat(page: *u8, n: i64, needle: *u8, skip: i64, term: *u8, base: *u8, out: *u8, cap: i64, outlen: *i64) -> i64
390func ri_discover(page: *u8, n: i64, host: *u8, out: *u8, cap: i64, outlen: *i64) -> i64
403func ri_host_at(hosts: *u8, hn: i64, url: *u8, idx: i64, needle: *u8, skipp: *i64, term: *u8, base: *u8) -> i64
429func ri_image_class(path: *u8) -> i64
449func ri_class_word(c: i64) -> *u8
459func ri_is_video(c: i64) -> i64
called by 1: rc_videos
463func ri_is_image(c: i64) -> i64
472func ri_prov_parse(rcpt: *u8, n: i64, sha: *u8) -> i64
490func ri_fetcher(out: *u8) -> i64
501func ri_mirror_one(url: *u8, mirror: *u8, sha: *u8, bytesp: *i64) -> i64
518func ri_journal_path(slug: *u8, out: *u8) -> i64
called by 2: rc_load_journalri_journal calls 1: ri_cat
525func ri_sources_path(slug: *u8, out: *u8) -> i64
called by 2: rc_discoverrc_mirror calls 1: ri_cat
533func ri_journal(slug: *u8, url: *u8, mirror: *u8, sha: *u8, bytes: i64, lic: *u8, status: *u8) -> i64
563func ri_mirror_name(slug: *u8, k: i64, url: *u8, out: *u8) -> i64
called by 2: rc_mirrormain calls 3: ri_catri_catnri_slen
577func ri_mirror_allowed(buf: *u8, n: i64, slug: *u8) -> i64
606func ri_kvs_license_token(code: *u8, out: *i64, cap: i64) -> i64
650func ri_kvs_real_url(vurl: *u8, code: *u8, out: *u8) -> i64
708func ri_kvs_value(page: *u8, n: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 1: ri_kvs_extract calls 2: ri_slenri_starts
734func ri_kvs_extract(page: *u8, n: i64, vurl: *u8, code: *u8) -> i64
called by 2: rc_videosmain calls 1: ri_kvs_value