code wiki / (root) / nx_provenance.nx

nx_provenance.nx

buildroot/runtime/nx_provenance.nx

8700 B255 linesdepth 4pulls 5 transitivereach 3 importersview sourcekind librarytopic provenance
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_str.nx nx_provenance.nx nx_provenance_test.nx nx_self_audit.nx nx_sovereign_qed_audit.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_str.nx

imported by: nx_provenance_test.nxnx_self_audit.nxnx_sovereign_qed_audit.nx

structs

53struct NxSourceRecord
63struct NxProvenanceRegistry

consts

38const NX_LC_UNKNOWN: nx_int = 0
39const NX_LC_FORBIDDEN: nx_int = 1
40const NX_LC_PD_CLASSICAL: nx_int = 2
41const NX_LC_PD_EXPLICIT: nx_int = 3
42const NX_LC_PD_GOVDOC: nx_int = 4
43const NX_LC_ACADEMIC_OPEN: nx_int = 5
44const NX_LC_EXPIRED_PATENT: nx_int = 6
49const NX_LC_ALLOW_MIN: nx_int = 2
59const NX_PROV_REC_BYTES: nx_size = 24
60const NX_PROV_MAX_SRCS: nx_int = 256
61const NX_PROV_SRC_ID_CAP: nx_size = 96

functions

71func nx_lc_from_str(s: *u8) -> nx_int
called by 1: nx_prov_parse_line calls 1: nx_str_eq
85func nx_prov_parse_line(buf: *u8, lo: nx_int, hi: nx_int,
176func nx_provenance_load(path: *u8) -> *NxProvenanceRegistry
219func nx_provenance_check(reg: *NxProvenanceRegistry, source_id: *u8) -> nx_int
233func nx_provenance_is_allowed(reg: *NxProvenanceRegistry, source_id: *u8) -> nx_int
called by 1: main calls 1: nx_provenance_check
240func nx_provenance_n_records(reg: *NxProvenanceRegistry) -> nx_int
called by 1: main
245func nx_provenance_n_by_class(reg: *NxProvenanceRegistry, lc: nx_int) -> nx_int
called by 1: main