code wiki / _hdl_build / nx_meta_schema.nx

nx_meta_schema.nx

buildroot/runtime/_hdl_build/nx_meta_schema.nx

7580 B150 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind tooltopic meta
docsdependenciesstructsconstsfunctions

about

nx_meta_schema.nx -- X-CAP-001 (CALLOUT-012 unblocker; universal-capture.md). The MODALITY-AGNOSTIC LOSSLESS META RECORD = the crown-jewel intermediate every app reads/writes (companion / apparel store / writer-ingest / media-library, X-CAP-006). A record is structured DATA: key=value lines (modality, cid, origin, gen_modality, source_model, consent, license, attr.* content). "Lossless" here = EXACT byte round-trip of the structured record (self-model lay118: that is a DIFFERENT objective than perceptual fidelity of regenerated media -- this layer is exactly-lossless). Proven by emit->parse->emit byte-identical. CONSENT HARD LINE (X-CAP-005, anti-deepfake): a record with consent=NONE or missing modality/cid is INVALID -> ms_valid=0. Self-validating gate (METAGATE) for nx_reconcile. MLIB-003 media records + COMP-004 person records are PROFILES of this one schema (no parallel substrate). Built sovereignly (nx_cc->nxasm_x86, no gcc). license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_meta_schema.nx nx_extract.nx nx_media_record.nx nx_meta_consumers.nx

imports: nx_syscalls.nx

imported by: nx_extract.nxnx_media_record.nxnx_meta_consumers.nx

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

main sys_mmap ms_set ms_roundtrip sys_mmap ↻ ms_emit ms_app ms_parse ms_scan ms_bufeq ms_valid ms_get ms_streq ms_streq ↻ ms_puts sys_write ms_putn sys_mmap ↻ sys_write ↻

structs

none

consts

13const MS_MAGIC_16384: i64 = 16384
15const MS_MAXF: i64 = 64

functions

17func ms_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
18func ms_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
20func ms_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
21func ms_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; var s: i64 = 1; while s == 1 { if a[i] != b[i] { s = 0 } else { if a[i] == (0 as u8) { return 1 } else { i = i + 1 } } } return 0 }
22func ms_bufeq(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: ms_roundtrip
23func ms_app(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i }
24func ms_scan(buf: *u8, n: i64, start: i64, delim: i64) -> i64 { var i: i64 = start; var s: i64 = 1; while s == 1 { if i >= n { s = 0 } else { if buf[i] == (delim as u8) { s = 0 } else { i = i + 1 } } } return i }
called by 1: ms_parse
27func ms_emit(keys: *i64, vals: *i64, n: i64, out: *u8) -> i64
called by 2: mainms_roundtrip calls 1: ms_app
41func ms_parse(buf: *u8, blen: i64, keys: *i64, vals: *i64) -> i64
59func ms_get(keys: *i64, vals: *i64, n: i64, key: *u8) -> i64
66func ms_valid(keys: *i64, vals: *i64, n: i64) -> i64
76func ms_roundtrip(keys: *i64, vals: *i64, n: i64) -> i64
93func ms_set(keys: *i64, vals: *i64, i: i64, k: *u8, v: *u8) -> i64 { keys[i] = (k as *u8) as i64; vals[i] = (v as *u8) as i64; return 0 }
called by 4: mainmainmainmain
95func main() -> i64