nx_license_check.nx
buildroot/runtime/nx_license_check.nx
about
nx_license_check.nx -- Layer-3 lexical grader perspective.
Enforces the LICENSING WALL per refined cardinal
feedback-licensing-absorb-vs-copy-discipline (2026-05-15):
"i dont want direct copies in the code that can be suable or allow
loss of sovereignty i want the papers in the library but we need
a wall that we arent copying from them something that needs
attribution or licensing"
Scans a substrate source file for the
// license_tier: <TIER>
header line. Only THREE tier values are permitted in substrate
code:
TIER_0_UNENCUMBERED -- public-domain / CC0 / U.S. Govt work;
verbatim safe
INDEPENDENT_REDERIVE -- built from published spec, no source copy
ORIGINAL -- substrate-original, no external ancestor
Anything else (or no header at all) is a LOSE. The grader emits a
named_improvement string telling the maintainer exactly how to
remedy the file.
Substrate-original code, written from scratch in this file.
license_tier: ORIGINAL
nx_safety_envelope: (schema: nishi-library/seeds/safety-critical-standards.toml)
intended_use: "Layer-3 license-tier grader -- enforces the
TIER_0_UNENCUMBERED / INDEPENDENT_REDERIVE /
ORIGINAL wall across substrate. Refuses
sneaking in AGPL / GPL / MIT / Apache / OSI
annotations. Cardinal feedback-no-standard-
OSI-license-custom-tbd enforcement point."
sil_target: SIL2 (licensing wall breach = sovereignty
loss + suability risk; cardinal-
critical)
dependencies 4 imports · 2 importers
imports: nx_syscalls.nxnx_runtime.nxnx_types.nxnx_tier.nx
imported by: nx_license_check_test.nxnx_license_wall_audit.nx
structs
| none |
consts
| 67 | const NX_LIC_UNKNOWN: nx_int = 0 |
| 69 | const NX_LIC_TIER_0_UNENCUMBERED: nx_int = 1 |
| 70 | const NX_LIC_INDEPENDENT_REDERIVE: nx_int = 2 |
| 71 | const NX_LIC_ORIGINAL: nx_int = 3 |
| 73 | const NX_LIC_FORBIDDEN: nx_int = 4 |
| 75 | const NX_LIC_N: nx_int = 5 |
| 90 | const NX_LIC_VERDICT_WIN: nx_int = 1 |
| 91 | const NX_LIC_VERDICT_LOSE: nx_int = 2 |
| 92 | const NX_LIC_VERDICT_TIE: nx_int = 3 |
| 93 | const NX_LIC_VERDICT_UNMEASURED: nx_int = 0 |
functions
| 77 | func nx_license_tier_is_valid(t: nx_int) -> nx_int called by 1: main |
| 95 | func nx_license_verdict_for_tier(t: nx_int) -> nx_int |
| 106 | func _starts_with(src: *u8, src_len: nx_int, off: nx_int, needle: *u8, needle_len: nx_int) -> nx_int called by 1: _match_tier_at |
| 120 | func _skip_spaces(src: *u8, src_len: nx_int, off: nx_int) -> nx_int |
| 139 | func _match_tier_at(src: *u8, src_len: nx_int, off: nx_int) -> nx_int calls 1: _starts_with |
| 160 | func nx_license_extract(src: *u8, src_len: nx_int) -> nx_int |
| 190 | func nx_license_named_improvement(t: nx_int) -> *u8 |
| 202 | func nx_license_tier_name(t: nx_int) -> *u8 |
| 216 | func nx_license_scan_file(path: *u8) -> nx_int |