nx_toolreg_reconcile_lib.nx
buildroot/runtime/nx_toolreg_reconcile_lib.nx
about
nx_toolreg_reconcile_lib.nx -- DISCOVERY RECONCILER, library half. Closes the WIRE class forever:
every tool that is GREEN in tool_allowlist.conf (vetted + callable) but ABSENT from the discovery
registry (toolreg -> tools/list) gets registered using ITS AUTHOR'S OWN schema row from
knowledge/tool_schemas.conf -- no invented contracts. A tool with NO schema row is SKIPPED and
reported (fail-closed: never register a contract-less tool). Idempotent by construction (tool_get
first). Re-running after any future allowlist growth wires the newcomers -- the allowlist stays the
SSOT and discovery reconciles to it, so the built-not-discoverable bucket cannot silently regrow.
license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_tool_registry.nxnx_vsz_watchdog_core.nx
imported by: nx_toolreg_reconcile.nxnx_toolreg_reconcile_gate.nx
structs
| none |
consts
| 12 | const RR_FILE_CAP: i64 = 262144 // allowlist/schemas read cap |
| 13 | const RR_LINE_CAP: i64 = 4096 // one row (name/title/fields/desc) |
| 14 | const RR_INV_CAP: i64 = 512 // generated invoke line |
| 15 | const RR_TAB: i64 = 9 // '\t' |
| 16 | const RR_NL: i64 = 10 // '\n' |
| 17 | const RR_HASH: i64 = 35 // '#' (comment rows) |
| 18 | const RR_C_REG: i64 = 0 // counts slot: newly registered |
| 19 | const RR_C_ALREADY: i64 = 1 // counts slot: already discoverable |
| 20 | const RR_C_NOSCHEMA: i64 = 2 // counts slot: skipped, no schema row (fail-closed) |
| 21 | const RR_C_FAIL: i64 = 3 // counts slot: register call failed |
| 22 | const RR_C_UPDATED: i64 = 4 // counts slot: stored description REWRITTEN from the author's schema |
| 23 | const RR_COUNTS: i64 = 64 // counts buffer bytes |
| 24 | const RR_COMMA: i64 = 44 // ',' join separator (name list) |
| 25 | const RR_SPC: i64 = 32 // ' ' |
| 26 | const RR_SEP_LEN: i64 = 2 // ", " separator width |
| 31 | const RR_DENY_PATH: *u8 = "knowledge/mcp/exposure_deny.txt" |
functions
| 33 | func rr_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 34 | func rr_seq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } |
| 36 | func rr_f0(line: *u8, ll: i64, out: *u8) -> i64 |
| 45 | func rr_flast(line: *u8, ll: i64, out: *u8) -> i64 called by 1: rr_schema_desc |
| 57 | func rr_rec_desc(rec: *u8, ln: i64, out: *u8) -> i64 called by 1: rr_run |
| 77 | func rr_schema_desc(buf: *u8, n: i64, name: *u8, desc: *u8) -> i64 |
| 99 | func rr_invoke(name: *u8, inv: *u8) -> i64 called by 1: rr_run |
| 114 | func rr_is_deny(name: *u8, db: *u8, dn: i64) -> i64 |
| 137 | func rr_run(prefix: *u8, allow_path: *u8, schemas_path: *u8, counts: *i64, dry: i64) -> i64 called by 2: rr_reconcilerr_drift calls 9: vw_readrr_f0rr_is_denytool_get_pfxrr_schema_descrr_rec_desc+3 |
| 212 | func rr_reconcile(prefix: *u8, allow_path: *u8, schemas_path: *u8, counts: *i64) -> i64 |
| 217 | func rr_drift(prefix: *u8, allow_path: *u8, schemas_path: *u8, counts: *i64) -> i64 |
| 227 | func rr_no_schema_names(prefix: *u8, allow_path: *u8, schemas_path: *u8, out: *u8, outcap: i64) -> i64 |