code wiki / (root) / nx_native_contract_gate.nx

nx_native_contract_gate.nx

buildroot/runtime/nx_native_contract_gate.nx

8985 B239 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic native
docsdependenciesstructsconstsfunctions

about

nx_native_contract_gate.nx -- F103a R-N0: THE NATIVE CONTRACT v1 GATE (on nx_gate_verdict, D001 migrate-on-touch). Reads the contract card knowledge/registry/native_contract_v1.txt (pipe rows: clause_id|axis|law|rejects|status|witness_path|needle) and GROUNDS it in live organ bytes: PROVEN/PARTIAL -> witness file must EXIST and carry the needle (no clause without a live organ) NEGCTL -> fabricated needle must be ABSENT from the witness (scanner non-vacuity tooth) NEGCTL_ABSENT -> phantom witness file must be ABSENT (existence-check tooth) DESIGN -> counted only (honest declared gap; a DESIGN row never fakes a witness) Structural teeth: >=12 rows, >=6 PROVEN, >=1 DESIGN, >=2 negctl, all 6 doctrine axes, 0 malformed. argv[1] optionally overrides the card path (pinned at tool registration). Exit 0 GREEN / 1 RED. license_tier: ORIGINAL No hw writes (Rule 26): reads card + sources, writes stdout only.

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_native_contract_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap gv_head gv_puts sys_write sys_mmap ↻ ncg_read sys_openat_rd sys_read sys_close gv_check gv_puts ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close ↻ sys_munmap ↻ sys_exit ncg_cp ncg_axis ncg_eq ncg_eq ↻ ncg_find ncg_slen ncg_name

structs

none

consts

14const NCG_CARD_PATH: *u8 = "knowledge/registry/native_contract_v1.txt" as *u8
15const NCG_CARD_CAP: i64 = 65536
16const NCG_WIT_CAP: i64 = 1048576
17const NCG_SCR: i64 = 512
18const NCG_PIPE: i64 = 124
19const NCG_NL: i64 = 10
20const NCG_HASH: i64 = 35

functions

22func ncg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: ncg_find
24func ncg_eq(a: *u8, b: *u8) -> i64
called by 2: ncg_axismain
37func ncg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
56func ncg_find(hay: *u8, hn: i64, nd: *u8) -> i64
called by 1: main calls 1: ncg_slen
76func ncg_cp(src: *u8, o: i64, n: i64, dst: *u8) -> i64
called by 1: main
86func ncg_name(dst: *u8, id: *u8, suf: *u8) -> i64
called by 1: main
98func ncg_axis(ax: *i64, s: *u8) -> i64
called by 1: main calls 1: ncg_eq
114func main(argc: i64, argv: *i64) -> i64