code wiki / _hdl_build / nx_algo_registry_migrate.nx

nx_algo_registry_migrate.nx

buildroot/runtime/_hdl_build/nx_algo_registry_migrate.nx

5380 B117 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_algo_registry_migrate.nx -- migrate specs/algo_registry/<algo>/meta.json (the 3,282 JSON algorithm cards) into ONE sovereign seg_store (knowledge/store/algo-registry-), key = algo name, value = meta.json bytes (byte-faithful, content-addressed). The cards total ~1.4MB, so the writer is sized to hold them all in a SINGLE segment -> one commit (no multi-commit segid collision). Self-verifies: re-opens the store, round-trips a known card byte-for-byte + checks the count key. This is the "get the JSON onto the nishi ecosystem" win; repointing the consumer (nx_bundle_gen) + retiring the derived JSON is the NEXT (gated) step. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_seg_store.nx nx_syscalls.nx nx_algo_registry_migrate.nx

imports: nx_seg_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main am_puts sys_write sys_openat_rd sys_mmap sys_getdents64 dirent_reclen dirent_name am_metapath ss_cat ss_readall sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_close ss_add ss_add2 ss_w32 ss_len sys_close ↻ am_itoa sys_mmap ↻ ss_commit ss_segid_ok sys_mmap ↻ ss_cat ↻ ss_catn sys_mmap ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻ sys_write ↻ ss_segname ss_cat ↻ ss_catn ↻ ss_writefile

structs

none

consts

10const AM_MAGIC_131072: i64 = 131072
11const AM_MAGIC_6291456: i64 = 6291456
12const AM_MAGIC_1024: i64 = 1024
48const AM_PREFIX: *u8 = "knowledge/store/algo-registry-" as *u8

functions

14func am_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
15func am_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
26func am_itoa(v: i64, out: *u8) -> i64
called by 1: main calls 1: sys_mmap
34func am_eq(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
40func am_metapath(nm: *u8, out: *u8) -> i64
called by 1: main calls 1: ss_cat
50func main() -> i64