code wiki / _hdl_build / nx_dr_archive.nx
nx_dr_archive.nx
buildroot/runtime/_hdl_build/nx_dr_archive.nx
about
nx_dr_archive.nx -- CAP-DR-ARCHIVE: sovereign disaster-recovery archiving. Copies critical NAS state to a SEPARATE
device (a local drive that is NOT the NAS) + verifies BYTE-IDENTITY + records a sha256 receipt -- killing the DATA
SPOF without a failover host. Data-driven: a manifest (source-path <TAB> archive-name) is the SSOT of what to
protect. Composes rep_in_sync (byte-identity proof), nx_sha256 (integrity fingerprint), slk_* (manifest parse).
Idempotent (each run = a fresh, verified snapshot). Additive-safe: READS the NAS, WRITES only the archive dir.
argv: [1]=manifest-path [2]=archive-dir (on a separate drive, e.g. /mnt/d/nishi-archive)
license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_site_lock_lib.nxnx_sha256.nxnx_seg_store.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const AR_MAGIC_262144: i64 = 262144 |
| 14 | const AR_MAGIC_1024: i64 = 1024 |
| 15 | const AR_MAGIC_1536: i64 = 1536 |
| 17 | const AR_CAP: i64 = 67108864 // 64 MiB/file cap (crown jewels are small; large media is a later tier) |
functions
| 19 | func ar_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 24 | func ar_wn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 25 | func ar_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 28 | func ar_read(path: *u8, out: *u8, cap: i64) -> i64 |
| 35 | func ar_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 40 | func ar_join(out: *u8, dir: *u8, name: *u8) -> i64 called by 1: main |
| 47 | func ar_field(reg: *u8, ls: i64, le: i64, f: i64, out: *u8, cap: i64) -> i64 |
| 53 | func ar_eq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 } called by 1: main |
| 55 | func main(argc: i64, argv: *i64) -> i64 |