code wiki / (root) / nx_forge_model_fetch.nx

nx_forge_model_fetch.nx

buildroot/runtime/nx_forge_model_fetch.nx

6465 B206 linesdepth 21pulls 147 transitivereach 0 importersview sourcekind tooltopic forge
docsdependenciesstructsconstsfunctions

about

nx_forge_model_fetch.nx -- L3: sovereign BIG-FILE downloader (Range loop) for model weights. usage: nx_forge_model_fetch <urlfile> <outpath> <expected-bytes> urlfile = file whose content is the (signed CDN) URL -- URLs are shell-hostile, never argv outpath = absolute output path (additive staging: NEVER point at the proven live model) expected = exact byte size (from the origin's X-Linked-Size header) Streams 16MB RFC-9110 Range chunks over sovereign TLS-1.3 (nx_https_fetch_range), appends to outpath, sha256's the stream incrementally, RESUMES from existing size (re-hashing the prefix), retries each chunk 3x. Exits 0 only when size == expected; prints the sha256 hex for comparison against the origin ETag. license_tier: ORIGINAL expect_exit: 0

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_lib_std.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_forge_model_fetch.nx

imports: nx_syscalls.nxnx_lib_std.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nx

imported by: nobody (leaf or entry point)

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

main std_putln std_puts std_slen sys_write sys_exit std_atoi sys_mmap sys_openat_rd sys_read sys_close nx_trust_store_load_from_c sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read ↻ sys_close ↻ nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻

structs

none

consts

15const FMF_MAGIC_4096: i64 = 4096
16const FMF_MAGIC_4095: i64 = 4095
17const FMF_MAGIC_4194304: i64 = 4194304
18const FMF_MAGIC_1024: i64 = 1024
19const FMF_MAGIC_1500: i64 = 1500
21const FMF_CHUNK: i64 = 16777216

functions

23func fmf_wb(fd: i64, p: *u8, n: i64) -> i64
called by 1: main calls 1: sys_write
38func fmf_hexput(b: *u8, n: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
57func main(argc: i64, argv: *i64) -> i64