nx_provenance.nx
buildroot/runtime/nx_provenance.nx
about
nx_provenance.nx -- license-class enforcement gate.
Per user directive 2026-05-14: "i dont want any wolfram or other
polluters that will try to sue i want academic sources that are
open etc but i dont want to have to deal with agl or apl or mit
or whatever licenses".
This primitive reads nxc2/specs/nx_source_allowlist.txt (TSV:
source_id <TAB> license_class <TAB> year <TAB> description) and
exposes a yes/no gate for any caller that wants to attach a
source_id to a record before emit.
Allowed classes (emit proceeds):
pd_classical, pd_explicit, pd_govdoc, academic_open, expired_patent
Refused classes (emit blocked):
forbidden, unknown (default for missing source_id)
Compositionally fits between source-bridges (lean / coq / etc.) and
the ingest_runner: the bridge attaches a source_id; the runner asks
the provenance gate; if allowed, the row goes to the shard.
genealogy_id: substrate_provenance_gate_2026_05_14
lineage_id: license_class_filter
dependencies 4 imports · 3 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_str.nx
imported by: nx_provenance_test.nxnx_self_audit.nxnx_sovereign_qed_audit.nx
structs
| 53 | struct NxSourceRecord |
| 63 | struct NxProvenanceRegistry |
consts
| 38 | const NX_LC_UNKNOWN: nx_int = 0 |
| 39 | const NX_LC_FORBIDDEN: nx_int = 1 |
| 40 | const NX_LC_PD_CLASSICAL: nx_int = 2 |
| 41 | const NX_LC_PD_EXPLICIT: nx_int = 3 |
| 42 | const NX_LC_PD_GOVDOC: nx_int = 4 |
| 43 | const NX_LC_ACADEMIC_OPEN: nx_int = 5 |
| 44 | const NX_LC_EXPIRED_PATENT: nx_int = 6 |
| 49 | const NX_LC_ALLOW_MIN: nx_int = 2 |
| 59 | const NX_PROV_REC_BYTES: nx_size = 24 |
| 60 | const NX_PROV_MAX_SRCS: nx_int = 256 |
| 61 | const NX_PROV_SRC_ID_CAP: nx_size = 96 |
functions
| 71 | func nx_lc_from_str(s: *u8) -> nx_int |
| 85 | func nx_prov_parse_line(buf: *u8, lo: nx_int, hi: nx_int, |
| 176 | func nx_provenance_load(path: *u8) -> *NxProvenanceRegistry |
| 219 | func nx_provenance_check(reg: *NxProvenanceRegistry, source_id: *u8) -> nx_int |
| 233 | func nx_provenance_is_allowed(reg: *NxProvenanceRegistry, source_id: *u8) -> nx_int |
| 240 | func nx_provenance_n_records(reg: *NxProvenanceRegistry) -> nx_int called by 1: main |
| 245 | func nx_provenance_n_by_class(reg: *NxProvenanceRegistry, lc: nx_int) -> nx_int called by 1: main |