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_C_SCAFFOLD: i64 = 5 // counts slot: row points at a STAGED .elf.new -- not a shipped tool |
| 24 | const RR_C_NOAUTH: i64 = 6 // counts slot: REGISTERED but its tool_schemas.conf row is GONE |
| 25 | const RR_C_DUPSCHEMA: i64 = 7 // counts slot: a NAME with more than one schema row |
| 26 | const RR_COUNTS: i64 = 64 // counts buffer bytes |
| 27 | const RR_COMMA: i64 = 44 // ',' join separator (name list) |
| 28 | const RR_SPC: i64 = 32 // ' ' |
| 29 | const RR_SEP_LEN: i64 = 2 // ", " separator width |
| 34 | const RR_DENY_PATH: *u8 = "knowledge/mcp/exposure_deny.txt" |
functions
| 36 | func rr_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 44 | func rr_drift_name(kind: *u8, name: *u8) -> i64 |
| 51 | 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 } |
| 66 | func rr_is_stagepath(line: *u8, ll: i64) -> i64 |
| 79 | func rr_f0(line: *u8, ll: i64, out: *u8) -> i64 |
| 88 | func rr_flast(line: *u8, ll: i64, out: *u8) -> i64 called by 1: rr_schema_desc |
| 100 | func rr_rec_desc(rec: *u8, ln: i64, out: *u8) -> i64 called by 1: rr_run |
| 120 | func rr_schema_desc(buf: *u8, n: i64, name: *u8, desc: *u8) -> i64 |
| 142 | func rr_invoke(name: *u8, inv: *u8) -> i64 called by 1: rr_run |
| 157 | func rr_is_deny(name: *u8, db: *u8, dn: i64) -> i64 |
| 189 | func rr_dup_census(sb: *u8, sn: i64, dry: i64) -> i64 |
| 238 | func rr_allow_has(ab: *u8, an: i64, name: *u8, scratch: *u8) -> i64 |
| 275 | func rr_missing_rows(allow_path: *u8, schemas_path: *u8, report: i64) -> i64 |
| 331 | func rr_run(prefix: *u8, allow_path: *u8, schemas_path: *u8, counts: *i64, dry: i64) -> i64 called by 2: rr_reconcilerr_drift calls 11: rr_dup_censusrr_f0rr_is_denytool_get_pfxrr_schema_descrr_is_stagepath+5 |
| 456 | func rr_reconcile(prefix: *u8, allow_path: *u8, schemas_path: *u8, counts: *i64) -> i64 |
| 471 | func rr_drift(prefix: *u8, allow_path: *u8, schemas_path: *u8, counts: *i64) -> i64 |
| 481 | func rr_no_schema_names(prefix: *u8, allow_path: *u8, schemas_path: *u8, out: *u8, outcap: i64) -> i64 |