nx_oracleband_lib.nx
buildroot/runtime/nx_oracleband_lib.nx
about
nx_oracleband_lib.nx -- LIB: READ A CITED ORACLE TABLE AND JUDGE A VALUE AGAINST IT (2026-08-25).
WHY THIS EXISTS. The whole "load a banked reference table, find a key, check a value is inside its cited
band" capability lived as gf_load/gf_eq/gf_find/gf_band INSIDE nx_gamefeel_oracle_gate and nowhere else --
one consumer, private statics, and a conf path hardcoded into the loader. That is a general capability at
the narrowest possible adoption level: every organ in this estate that derives a constant from cited data
needs exactly this and could not reach it. Extracted, not retyped: the parser, the key compare and the
cross-multiplied band test are the gate's own code, and the gate now composes this instead of owning it,
so there is ONE oracle-table reader rather than one per lane.
THREE THINGS THIS ADDS OVER THE PRIVATE VERSION, each because the private one could not do it:
1. THE PATH IS AN ARGUMENT. gf_load hardcoded knowledge/gamefeel_oracle.conf, so a second oracle table
was unreachable without copying the file. ob_load takes the path.
2. THE ROW CAP ANNOUNCES. GF_ROWCAP was 32 and SILENT: a table that outgrew it would be read as a
PREFIX and every absent-row verdict below it would read as an honest RED. A cap reached in silence
becomes a measurement nobody knows is partial, so ob_truncated() reports it and ob_load refuses.
3. ob_pin -- ASSERT A COMPILED CONSTANT EQUALS ITS CITED ROW. A banded check proves a VALUE is in range;
it cannot notice that the constant compiled into an organ has drifted from the row it cites. Without
this the citation is decorative: edit either side and nothing complains. This is the tooth that makes
a citation load-bearing, and it belongs beside the band check rather than in one gate's main().
FORMAT, unchanged from the table it was written for: comment lines start '#', rows are
key<TAB>min<TAB>max<TAB>... and only the first three fields are read. Integers only, no division anywhere;
the band compare is CROSS-MULTIPLIED so an integer truncation cannot silently pass a value.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_gate_verdict.nx
imported by: nx_gamefeel_oracle_gate.nxnx_tissuebudget.nxnx_tissuematerial_gate.nxnx_vpick_gate.nx
structs
| none |
consts
| 29 | const OB_ROWCAP: i64 = 256 |
| 30 | const OB_TAB: i64 = 9 |
| 31 | const OB_NL: i64 = 10 |
| 32 | const OB_HASH: i64 = 35 |
functions
| 42 | func ob_rows() -> i64 { return ob_n } |
| 43 | func ob_truncated() -> i64 { return ob_trunc } |
| 48 | func ob_load(path: *u8) -> i64 |
| 111 | func ob_eq(a: *u8, b: *u8) -> i64 |
| 119 | func ob_find(key: *u8) -> i64 |
| 129 | func ob_lo(r: i64) -> i64 { let p: *i64 = ob_min as *i64; return p[r] } |
| 130 | func ob_hi(r: i64) -> i64 { let p: *i64 = ob_max as *i64; return p[r] } |
| 133 | func ob_band(name: *u8, key: *u8, val: i64, ctr: *i64) -> i64 |
| 161 | func ob_pin(name: *u8, key: *u8, lo: i64, hi: i64, ctr: *i64) -> i64 |