code wiki / (root) / nx_assetprobe.nx

nx_assetprobe.nx

buildroot/runtime/nx_assetprobe.nx

14440 B295 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_assetprobe.nx -- CONTENT-TYPED ASSET IDENTIFICATION FOR INGESTION. WHY (measured 2026-08-07 from vrstormlab.com/dancexr/preparecontent, their own docs): DanceXR types assets by WHERE THEY SIT and WHAT THEY ARE NAMED -- typed subfolders (actors/ motion/ texture/), same-basename pairing (dance.vmd + dance.ogg), alternative-texture discovery by matching filename. Every one of those decisions trusts the filename. *AN EXTENSION IS A CLAIM. THE MAGIC BYTES ARE THE MEASUREMENT. The same law cost us once today: a grep for bvh matched nx_bvh (a Bounding Volume Hierarchy) and reported a motion format as supported. A mislabelled asset in a name-driven pipeline fails at PLAY time, deep in a loader, as a crash or an invisible model. Probed at INGEST time it is one honest row. THE RULER LIVES IN nx_assetprobe_lib (extracted 2026-09-06): identify / name / cat / claim are ONE function each, shared with the bundle walker (/compare/modding MD1), so the CLI and the walker cannot drift. This file is the CLI, the zip central-directory walk and the KAT. usage: nx_assetprobe probe <file> | zip <file> | --kat exit 0 ok | 2 unreadable | 3 usage | 4 REFUSED malformed | 5 DISAGREE | 1 KAT RED license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_assetprobe_lib.nx nx_assetprobe.nx

imports: nx_syscalls.nxnx_assetprobe_lib.nx

imported by: nobody (leaf or entry point)

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

main ap_puts sys_write ap_slen ap_slen ↻ ap_kat 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 ↻ ap_put ap_slen ↻ ap_identify ap_at ap_slen ↻ ap_scan ap_slen ↻ ap_scan_bol ap_slen ↻ ap_puts ↻ ap_probe ap_identify ↻ ap_claim ap_ends ap_slen ↻ ap_lc ap_puts ↻ ap_num sys_mmap ↻

structs

none

consts

23const AP_KATBUF: i64 = 8192
24const AP_MAXMEM: i64 = 512
26const AP_EOCD_MIN: i64 = 22
27const AP_CD_MIN: i64 = 46

functions

29func ap_puts(s: *u8) -> i64 { sys_write(1, s, ap_slen(s)); return 0 }
30func ap_num(v: i64) -> i64
45func ap_probe(path: *u8, b: *u8, len: i64) -> i64
68func ap_eocd(b: *u8, len: i64) -> i64
called by 2: ap_zipap_kat
89func ap_zip(b: *u8, len: i64) -> i64
143func ap_put(b: *u8, o: i64, s: *u8) -> i64
called by 2: ap_kat_zipap_kat calls 1: ap_slen
149func ap_p16(b: *u8, o: i64, v: i64) -> i64
called by 1: ap_kat_zip
152func ap_p32(b: *u8, o: i64, v: i64) -> i64
called by 1: ap_kat_zip
158func ap_kat_zip(b: *u8) -> i64
called by 1: ap_kat calls 3: ap_p32ap_p16ap_put
192func ap_kat() -> i64
282func main(argc: i64, argv: *i64) -> i64