code wiki / (root) / nx_bundle_ingest.nx

nx_bundle_ingest.nx

buildroot/runtime/nx_bundle_ingest.nx

24012 B495 linesdepth 8pulls 24 transitivereach 5 importersview sourcekind tooltopic bundle
docsdependenciesstructsconstsfunctions

about

nx_bundle_ingest.nx -- COMMUNITY BUNDLE TO A TYPED MANIFEST (/compare/modding MD1 bundle_ingest, 2026-09-06). Walks a ZIP or a 7z by content type through nx_bundle_ingest_lib (the zip reader, the inflater and the ONE identify ruler are all incumbents) or nx_sevenz_lib (the 7z container reader over nx_lzma_lib, MD29, same day -- filling the SAME record table, so the texture binder and the partition run unchanged over both containers) and prints one MEMBER row per entry plus one BUNDLE row whose partition sums to the entry count. Unknown members are rows, not omissions; a method or coder the walker cannot open is a row that says so. PROVENANCE (MD9, same day): the archive's own sha256 is the asset identity. With source=<url> the walk appends a row to the provenance journal (licence=<id> names a rights-table row; absent, the licence is recorded as unknown, which is NOT a table row and therefore REFUSES every export and publish door by construction); with or without it the verdict for that sha is printed from nx_asset_prov_lib -- private use always allowed, the walk's own exit code unchanged. usage: nx_bundle_ingest <bundle.zip|bundle.7z> [manifest.out] [source=<url>] [licence=<id>] [jrnl=<path>] exits: 0 walked | 2 usage | 3 REFUSED (unreadable, not a zip or 7z, truncated, a record or the header refused, partition does not sum) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 7 imports · 4 importers

nx_syscalls.nx nx_bundle_ingest_lib.nx nx_asset_prov_lib.nx nx_sevenz_lib.nx nx_fsops_lib.nx nx_atomic_rewrite.nx json_emit.nx nx_bundle_ingest.nx nx_gltf2mesh.nx nx_gltf2mesh_normal_candidate_t337 nx_gltf2mesh_preserve_t145.nx nx_gltf_inventory_candidate_t180.n

imports: nx_syscalls.nxnx_bundle_ingest_lib.nxnx_asset_prov_lib.nxnx_sevenz_lib.nxnx_fsops_lib.nxnx_atomic_rewrite.nxjson_emit.nx

imported by: nx_gltf2mesh.nxnx_gltf2mesh_normal_candidate_t337.nxnx_gltf2mesh_preserve_t145.nxnx_gltf_inventory_candidate_t180.nx

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

main fsx_seq bix_run bix_main fsx_seq ↻ bix_uint bic_len fsx_denied 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 nxa_dump_sizes fsx_lower fsx_ends_with fsx_basename_is fsx_ends_with ↻ fsx_deny_hit fsx_content_secret sys_openat_rd sys_mmap ↻ sys_read sys_close fsx_conf_deny sys_mmap ↻ fsx_deny_hit ↻ fsx_write_denied fsx_denied ↻ osf_write_forbidden osf_under sys_mmap ↻ fsx_lower ↻

structs

none

consts

23const BIC_NAMES_HEADROOM: i64 = 4096
24const BIC_MODE_0644: i64 = 420
25const BIC_EXIT_USAGE: i64 = 2
26const BIC_EXIT_REFUSE: i64 = 3
27const BIC_OUTFD: i64 = 1
28const BIC_SRC_KEY: *u8 = "source="
29const BIC_SRC_KEY_LEN: i64 = 7
30const BIC_LIC_KEY: *u8 = "licence="
31const BIC_LIC_KEY_LEN: i64 = 8
32const BIC_JRNL_KEY: *u8 = "jrnl="
33const BIC_JRNL_KEY_LEN: i64 = 5
34const BIC_LIC_DEFAULT: *u8 = "unknown" // deliberately NOT a rights-table row: the absence is the refusal
35const BIC_ORIGIN: *u8 = "nx_bundle_ingest"
36const BIC_ST_N: i64 = 8
37const BIC_CONTAINER_ZIP: i64 = 0
38const BIC_CONTAINER_7Z: i64 = 1
156const BIX_LOCK_SUFFIX: *u8 = ".nx-ingest-lock"
157const BIX_JSON_ROW_ROOM: i64 = 512
158const BIX_JSON_BASE_ROOM: i64 = 2048
292const BIX_STAT_BYTES: i64 = 256
293const BIX_STAT_DEVICE_WORD: i64 = 0
294const BIX_STAT_INODE_WORD: i64 = 1

functions

40func bic_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
41func bic_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, bic_len(s)); return 0 }
42func bic_wn(fd: i64, v: i64) -> i64
56func bic_prefix(s: *u8, p: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { if s[i] != p[i] { return 0 } i = i + 1 } return 1 }
called by 2: bic_is_kvbic_arg
57func bic_is_kv(s: *u8) -> i64
called by 1: main calls 1: bic_prefix
64func bic_arg(argc: i64, argv: *i64, key: *u8, klen: i64) -> *u8
called by 1: bic_provenance calls 1: bic_prefix
73func bic_container_name(c: i64) -> *u8 { if c == BIC_CONTAINER_7Z { return "7z" as *u8 } return "zip" as *u8 }
called by 1: bic_summary
75func bic_method(fd: i64, container: i64, code: i64) -> i64
called by 1: bic_row calls 3: bic_wsz_coder_namebic_wn
81func bic_row(fd: i64, tbl: *i64, names: *u8, i: i64, container: i64) -> i64
99func bic_summary(fd: i64, m: i64, p: *i64, sum: i64, verdict: *u8, container: i64, st: *i64) -> i64
called by 1: main calls 3: bic_wbic_wnbic_container_name
128func bic_provenance(argc: i64, argv: *i64, b: *u8, n: i64) -> i64
159func bix_uint(s: *u8) -> i64
169func bix_lock(path: *u8) -> i64
185func bix_same(path: *u8, data: *u8, n: i64) -> i64
194func bix_store(path: *u8, data: *u8, n: i64) -> i64
224func bix_key(w: *JsonWriter, key: *u8, value: *u8) -> i64
228func bix_num(w: *JsonWriter, key: *u8, value: i64) -> i64
235func bix_row(w: *JsonWriter, r: *i64, names: *u8, idx: i64) -> i64
258func bix_receipt(path: *u8, w: *JsonWriter) -> i64
272func bix_intent(receipt: *u8, archive: *u8, sha: *u8, output: *u8, member_sha: *u8) -> i64
295func bix_alias(a: *u8, b: *u8) -> i64
312func bix_store_state(rc: i64) -> *u8
321func bix_main(argc: i64, argv: *i64) -> i64
420func bix_run(argc: i64, argv: *i64) -> i64
437func main(argc: i64, argv: *i64) -> i64