code wiki / _hdl_build / nx_build_registry_lib.nx
nx_build_registry_lib.nx
buildroot/runtime/_hdl_build/nx_build_registry_lib.nx
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
imports: nx_framed_append.nxnx_syscalls.nx
imported by: nx_build_bypass_gate.nxnx_build_nobypass_gate.nxnx_build_registry.nx
structs
| none |
consts
| 12 | const BR_CAP: i64 = 256 // per-record byte cap for fa_appendz |
| 13 | const BR_FBUF: i64 = 262144 // store read buffer |
| 14 | const BR_SLOT: i64 = 128 // per-field byte slot |
| 15 | const BR_MAX: i64 = 1024 // max distinct organs |
functions
| 17 | func br_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 18 | func br_streq(a: *u8, b: *u8) -> i64 |
| 24 | func br_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 36 | func br_find(buf: *u8, from: i64, to: i64, pat: *u8) -> i64 |
| 49 | func br_extract(buf: *u8, ls: i64, le: i64, key: *u8, out: *u8) -> i64 |
| 61 | func br_submit_lin(store: *u8, organ: *u8, owner: *u8, parent: *u8, state: *u8) -> i64 |
| 78 | func br_submit(store: *u8, organ: *u8, owner: *u8, state: *u8) -> i64 |
| 82 | func br_get_parent(store: *u8, organ: *u8, out: *u8) -> i64 |
| 103 | func br_distinct(store: *u8) -> i64 |
| 127 | func br_get_state(store: *u8, organ: *u8, out: *u8) -> i64 |
| 147 | func br_registered(store: *u8, organ: *u8) -> i64 |