code wiki / _hdl_build / nx_role_store_migrate.nx

nx_role_store_migrate.nx

buildroot/runtime/_hdl_build/nx_role_store_migrate.nx

5824 B122 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic role
docsdependenciesstructsconstsfunctions

about

nx_role_store_migrate.nx -- MIGRATE the knowledge/roles/*.tsv files into the SOVEREIGN seg-store (knowledge/store/roles-*, via nx_role_store). Operator 2026-06-22: "migrate and get rid of these tsvs just nishi ecosystem." Reads each legacy .tsv, seeds its rows into the matching channel in ONE batched commit (1 segment), then reads EVERY row back and byte-compares to the source line -> GREEN only if every source row is present byte-exact. IDEMPOTENT (rule#10): a channel is seeded only when EMPTY (count==0); once seeded (and possibly evolved by live appends) a re-run writes nothing and still verifies. ADDITIVE (rule#13): the .tsv files are not touched here -- retirement to knowledge/_retired_tsv/ is a separate, post-verify step. pm_coord.tsv -> pmcoord engineer_queue.tsv -> engineerq doctor_queue.tsv -> doctorq engineer_ledger.tsv -> engineerl expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_role_store.nx nx_seg_store.nx nx_syscalls.nx nx_role_store_migrate.nx

imports: nx_role_store.nxnx_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 mw sys_write sys_mmap mig_one sys_mmap ↻ ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close mw ↻ rs_count sys_mmap ↻ rs_nkey ss_cat ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_r32 rs_atoi mn sys_mmap ↻ rs_itoa sys_mmap ↻ sys_write ↻ rs_get_seq sys_mmap ↻ rs_key ss_cat ↻ ss_catn

structs

none

consts

13const K_MAGIC_4096: i64 = 4096

functions

15func mw(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 2: mig_onemain calls 1: sys_write
16func mn(v: i64) -> i64 { let b: *u8=sys_mmap(28); let e: i64=rs_itoa(b,v); sys_write(1,b,e); return 0 }
20func mig_one(ch: *u8, tsvpath: *u8, tot: *i64, ver: *i64, wro: *i64) -> i64
101func main() -> i64