code wiki / _hdl_build / nx_build_registry_lib.nx

nx_build_registry_lib.nx

buildroot/runtime/_hdl_build/nx_build_registry_lib.nx

6331 B150 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind librarytopic build
docsdependenciesstructsconstsfunctions

about

nx_build_registry_lib.nx -- the BUILD-REGISTRAR library (Librarian SSOT of backend ORGANS); the build-time twin of the publisher's pub_submit -> ledger. SEPARATE from the WMS stream-registry (does NOT clobber it, per coordinate-don't-clobber). Storage = the WMS-R0b framed-append floor (fa_appendz: O_APPEND + flock(LOCK_EX) + write-until-complete = atomic, torn-safe, NO TSV). Records: "BR organ=<name> owner=<role> state=<state> END\n" IDEMPOTENT by LATEST-WINS-on-read: re-submit appends, but distinct-organ count is stable and the newest record's state is the live one (ledger-style dedup without rewrites). Pure lib, no main. Consumers: nx_build_registry (R1 gate), nx_build_bypass_gate (R2 audit). license_tier: ORIGINAL

dependencies 2 imports · 3 importers

nx_framed_append.nx nx_syscalls.nx nx_build_registry_lib.nx nx_build_bypass_gate.nx nx_build_nobypass_gate.nx nx_build_registry.nx

imports: nx_framed_append.nxnx_syscalls.nx

imported by: nx_build_bypass_gate.nxnx_build_nobypass_gate.nxnx_build_registry.nx

structs

none

consts

12const BR_CAP: i64 = 256 // per-record byte cap for fa_appendz
13const BR_FBUF: i64 = 262144 // store read buffer
14const BR_SLOT: i64 = 128 // per-field byte slot
15const BR_MAX: i64 = 1024 // max distinct organs

functions

17func br_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
18func br_streq(a: *u8, b: *u8) -> i64
24func br_read(path: *u8, buf: *u8, cap: i64) -> i64
36func br_find(buf: *u8, from: i64, to: i64, pat: *u8) -> i64
called by 1: br_extract calls 1: br_len
49func br_extract(buf: *u8, ls: i64, le: i64, key: *u8, out: *u8) -> i64
61func br_submit_lin(store: *u8, organ: *u8, owner: *u8, parent: *u8, state: *u8) -> i64
called by 1: br_submit calls 3: sys_mmapfa_catfa_appendz
78func br_submit(store: *u8, organ: *u8, owner: *u8, state: *u8) -> i64
called by 3: mainmainmain calls 1: br_submit_lin
82func br_get_parent(store: *u8, organ: *u8, out: *u8) -> i64
103func br_distinct(store: *u8) -> i64
127func br_get_state(store: *u8, organ: *u8, out: *u8) -> i64
147func br_registered(store: *u8, organ: *u8) -> i64