code wiki / (root) / nx_license_check.nx

nx_license_check.nx

buildroot/runtime/nx_license_check.nx

9037 B223 linesdepth 3pulls 4 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_runtime.nx nx_types.nx nx_tier.nx nx_license_check.nx nx_license_check_test.nx nx_license_wall_audit.nx

imports: nx_syscalls.nxnx_runtime.nxnx_types.nxnx_tier.nx

imported by: nx_license_check_test.nxnx_license_wall_audit.nx

structs

none

consts

67const NX_LIC_UNKNOWN: nx_int = 0
69const NX_LIC_TIER_0_UNENCUMBERED: nx_int = 1
70const NX_LIC_INDEPENDENT_REDERIVE: nx_int = 2
71const NX_LIC_ORIGINAL: nx_int = 3
73const NX_LIC_FORBIDDEN: nx_int = 4
75const NX_LIC_N: nx_int = 5
90const NX_LIC_VERDICT_WIN: nx_int = 1
91const NX_LIC_VERDICT_LOSE: nx_int = 2
92const NX_LIC_VERDICT_TIE: nx_int = 3
93const NX_LIC_VERDICT_UNMEASURED: nx_int = 0

functions

77func nx_license_tier_is_valid(t: nx_int) -> nx_int
called by 1: main
95func nx_license_verdict_for_tier(t: nx_int) -> nx_int
called by 2: main_audit_one
106func _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
120func _skip_spaces(src: *u8, src_len: nx_int, off: nx_int) -> nx_int
139func _match_tier_at(src: *u8, src_len: nx_int, off: nx_int) -> nx_int
calls 1: _starts_with
160func nx_license_extract(src: *u8, src_len: nx_int) -> nx_int
190func nx_license_named_improvement(t: nx_int) -> *u8
202func nx_license_tier_name(t: nx_int) -> *u8
216func nx_license_scan_file(path: *u8) -> nx_int