code wiki / (root) / nx_patent_check.nx

nx_patent_check.nx

buildroot/runtime/nx_patent_check.nx

7470 B227 linesdepth 4pulls 5 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_patent_check.nx -- offline patent-encumbrance gate. Per user directive 2026-05-14: "add the patent information/table to nishi library for offline referencing". This primitive reads nxc2/specs/nx_patent_table.txt (TSV: algorithm_id, patent_status, patent_ref, filed_year, expiry_year, notes) and answers per-algo safety queries. Status enum: NX_PAT_UNKNOWN = 0 default deny (no row in table) NX_PAT_ACTIVE = 1 patent in force -- UNSAFE; refuse NX_PAT_EXPIRED = 2 was patented; now safe NX_PAT_PD = 3 never patented; always safe Safe predicate: status >= NX_PAT_EXPIRED (i.e., PD or EXPIRED). Composes with nx_provenance: license filter (#2) blocks tainted source text; patent filter (#3) blocks encumbered algorithm IDEAS. Together they close the IP-exposure surface. genealogy_id: substrate_patent_gate_2026_05_14 lineage_id: ip_compliance_filter

dependencies 4 imports · 3 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_str.nx nx_patent_check.nx nx_patent_check_test.nx nx_self_audit.nx nx_sovereign_qed_audit.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_str.nx

imported by: nx_patent_check_test.nxnx_self_audit.nxnx_sovereign_qed_audit.nx

structs

50struct NxPatentRecord
58struct NxPatentTable

consts

35const NX_PAT_UNKNOWN: nx_int = 0
36const NX_PAT_ACTIVE: nx_int = 1
37const NX_PAT_EXPIRED: nx_int = 2
38const NX_PAT_PD: nx_int = 3
42const NX_PAT_SAFE_MIN: nx_int = 2
44const NX_PAT_MAX_RECORDS: nx_int = 1024
45const NX_PAT_ALGO_ID_CAP: nx_size = 96
46const NX_PAT_STATUS_CAP: nx_size = 16
56const NX_PAT_REC_BYTES: nx_size = 24

functions

66func nx_pat_status_from_str(s: *u8) -> nx_int
called by 1: nx_pat_parse_line calls 1: nx_str_eq
77func nx_pat_parse_line(buf: *u8, lo: nx_int, hi: nx_int,
156func nx_patent_load(path: *u8) -> *NxPatentTable
194func nx_patent_check(t: *NxPatentTable, algo_id: *u8) -> nx_int
called by 2: nx_patent_is_safemain calls 1: nx_str_eq
208func nx_patent_is_safe(t: *NxPatentTable, algo_id: *u8) -> nx_int
called by 1: main calls 1: nx_patent_check
215func nx_patent_n_records(t: *NxPatentTable) -> nx_int { return t.n }
called by 2: mainmain
217func nx_patent_n_by_status(t: *NxPatentTable, status: nx_int) -> nx_int
called by 2: mainmain