code wiki / (root) / nx_refintake.nx

nx_refintake.nx

buildroot/runtime/nx_refintake.nx

22713 B450 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_refintake.nx -- CLI over nx_refintake_lib (aesthetictwin AT22, 2026-09-16): reference intake as a workflow of verbs, each one a step that can run alone or inside `all`, so the same organ is a primitive, a workflow and an agent's tool. nx_refintake pages <slug> mirror every page source whose mirror is absent (journaled PAGE-OK / PAGE-FAILED) nx_refintake discover <slug> apply every knowledge/refintake.hosts pattern whose prefix matches a page source; rewrite knowledge/refintake/<slug>.sources (one url per line, deduped) nx_refintake mirror <slug> mirror every declared image source and every discovered url not yet journaled; every mirrored body is classified by its magic bytes (JPEG/PNG/GIF/WEBP are OK, an HTML stub or anything else is journaled NOT-IMAGE-<class>, never counted as a picture) nx_refintake verify <slug> re-classify every journaled OK mirror; names each row whose bytes are no longer a picture nx_refintake videos <slug> KVS player pages (kind video): page, player video_url + license_code, the function/0/ hash permutation undone, the clip mirrored and classified by its ftyp magic (AT24) nx_refintake all <slug> pages, discover, mirror, verify, videos in that order (the one-call workflow) nx_refintake check the conf: subjects, sources per kind, tags on declared axes (a group label is refused by name) exit: 0 ok | 2 usage | 3 conf unreadable | 4 subject undeclared or refused | 5 tag refused | 6 a leg reported failures license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_refintake_lib.nx nx_refintake.nx

imports: nx_syscalls.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 rc_usage ri_puts sys_write ri_slen 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 ↻ ri_load sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ri_puts ↻ ri_streq rc_check sys_mmap ↻ ri_tags_check sys_mmap ↻ ri_line_end ri_starts ri_field ri_axis_declared sys_mmap ↻ ri_cat

structs

none

consts

19const RC_EXIT_USAGE: i64 = 2
20const RC_EXIT_CONF: i64 = 3
21const RC_EXIT_SUBJECT: i64 = 4
22const RC_EXIT_TAG: i64 = 5
23const RC_EXIT_LEG: i64 = 6
24const RC_ARGC_SLUG: i64 = 3
25const RC_C_N: i64 = 8
26const RC_C_TRIED: i64 = 0
27const RC_C_OK: i64 = 1
28const RC_C_FAILED: i64 = 2
29const RC_C_PRESENT: i64 = 3
30const RC_C_NOTIMAGE: i64 = 4
31const RC_C_ALREADY: i64 = 5
32const RC_C_PATTERNS: i64 = 6
33const RC_C_UNKNOWNHOST: i64 = 7
34const RC_V_ROWS: i64 = 0
35const RC_V_IMAGES: i64 = 1
36const RC_V_HTML: i64 = 2
37const RC_V_OTHER: i64 = 3
38const RC_V_UNREADABLE: i64 = 4

functions

40func rc_usage() -> i64
called by 1: main calls 1: ri_puts
44func rc_zero(c: *i64, n: i64) -> i64 { var i: i64 = 0; while i < n { c[i] = 0; i = i + 1 } return 0 }
called by 1: main
45func rc_fetched_path(mirror: *u8, out: *u8) -> i64
51func rc_present(mirror: *u8) -> i64
58func rc_journaled(jrnl: *u8, jn: i64, url: *u8) -> i64
68func rc_load_journal(slug: *u8, lenp: *i64) -> *u8
75func rc_pages(conf: *u8, n: i64, slug: *u8, lic: *u8, c: *i64) -> i64
110func rc_discover(conf: *u8, n: i64, slug: *u8, hosts: *u8, hn: i64, c: *i64, urlsp: *i64) -> i64
181func rc_mirror_url(slug: *u8, url: *u8, mirror: *u8, lic: *u8, c: *i64) -> i64
210func rc_mirror(conf: *u8, n: i64, slug: *u8, lic: *u8, c: *i64) -> i64
259func rc_verify(slug: *u8, v: *i64) -> i64
294func rc_videos(conf: *u8, n: i64, slug: *u8, lic: *u8, c: *i64) -> i64
380func rc_check(conf: *u8, n: i64) -> i64
404func main(argc: i64, argv: *i64) -> i64