code wiki / _hdl_build / nx_ledger_data_register.nx

nx_ledger_data_register.nx source

↩ module page · 47 lines · 4493 B

1// nx_ledger_data_register.nx -- GOVERNED registration of LEDGER-AS-DATA (AN1) + the v2 case 2// answer (AN8 fetch-re-earn). Engineer gate = both elfs built THIS invocation exit 0; Council 3// admits; Librarian allocs via cl_next_idx + dual-writes. license_tier: ORIGINAL 4import "nx_cap_register.nx" 5import "nx_capreg_librarian.nx" 6import "nx_syscalls.nx" 7 8func ldr_run(path: *u8) -> i64 { 9 let pid: i64 = sys_fork() 10 if pid == 0 { 11 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 12 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 13 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0 14 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0 15 sys_execve(path, argv, envp); sys_exit(127) 16 } 17 let st: *i64 = sys_mmap(16) as *i64 18 sys_wait4(pid, st, 0) 19 return st[0] 20} 21 22func main() -> i64 { 23 var allok: i64 = 1 24 if ldr_run("/tmp/nx_ledger_data_gate.sov.elf" as *u8) != 0 { allok = 0 } 25 if ldr_run("/tmp/nx_analyst_case_led.sov.elf" as *u8) != 0 { allok = 0 } 26 cr_w(1, "ENGINEER: ledger-as-data gate + v2 case runner all-pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8) 27 let eng: i64 = ig_engineer(1, 1, 1, allok) 28 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1) 29 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) } 30 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 31 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 32 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 33 34 let idx1: i64 = cl_next_idx(lp, jp) 35 let ok1: i64 = cl_register_dual(lp, jp, idx1, 5, 36 2, "GEN LEDGER-AS-DATA (arc=ANALYST rung AN1) -- an Analyst case is now a .led FILE, not code (the vizsla model-is-data lesson landed on the Analyst): grammar T/C/S/N/B (thresholds, opposed-class pairs, SOURCE COLUMNS rel/cred/party/method/class, nodes, backing edges) -> nx_ledger_data.nx parser refuses LOUDLY on ANY malformation (unknown record, bad Admiralty grade, dangling ref, dup/missing thresholds, bad kind = parse 0, never a partial answer) -> strict evaluation runs the INDEPENDENCE RULE FROM DATA (a MEASURED leaf keeps status only with >=2 distinct incentive classes; per-row weaker-of-two-best-legs feeds ICD-203 confidence) composing nx_analyst verdict math + nx_source_grade grades. Gate nx_ledger_data_gate 38/38 sovereign GREEN first compile incl. the NO-RECOMPILE proof (same binary, different .led -> different verdict) + 7 loud-refusal tampers + the real case file hand-computed end-to-end; Examiner row ANALYST-LED; durable anchor analyst_led_gate.log. New question = new file -- the per-case marginal cost of rigorous analysis drops to AUTHORING DATA" as *u8) 37 if ok1 != 1 { cr_w(1, "DUAL-WRITE-1 FAILED\n" as *u8); sys_exit(1) } 38 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx1); cr_w(1, " REGISTERED -- ledger-as-data organ\n" as *u8) 39 40 let idx2: i64 = cl_next_idx(lp, jp) 41 let ok2: i64 = cl_register_dual(lp, jp, idx2, 5, 42 2, "GEN ANALYST-CASE-001-V2 FETCH-RE-EARN (arc=ANALYST rung AN8, via the AN1 data path: knowledge/analyst/ac_vs_pc_v2.led, 17 graded sources, 10 incentive classes). The v0 $1050 labor PLUG is DEAD: labor = BLS 49-9021 median $28.75/hr [gov class, primary measured] x 12 crew-hours [manufacturer install-time + cost guides] x 1.5 burden [industry guides 30-60%] = $517.50 MEASURED; root price re-earned via manufacturer's own published range (trane.com) + vendor breakdown (3 classes); equipment re-earned via trade-distributor posted prices (Ferguson) joining the vendor class; pc-margin issuer echo broken by IDC + academic (PC margins 4%->~1%); leftover $532.50 = NAMED gap row (permits/inspection/noise), never smoothed. STRICT VERDICT FLIPS HONESTLY: UNDERTRACED -> EXPLAINED (coverage 855 permil, residual 144 < 150 bar) -- the price IS its traced costs; the shenanigan is IN THE OPEN: ~40% install gross margin + gatekept channel vs the PC chain's 1-6%. CONFIDENCE stays LOW (weakest leg 122 = margin's vendor expert-claim; F6 measured-markup lifts it) -- verdict and confidence move INDEPENDENTLY, exactly the ICD-203 design. Materials still demoted (F3 owed, kept loud). Runner nx_analyst_case_led 9/9; report knowledge/status/analyst_ac_v2.log" as *u8) 43 if ok2 != 1 { cr_w(1, "DUAL-WRITE-2 FAILED\n" as *u8); sys_exit(1) } 44 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx2); cr_w(1, " REGISTERED -- v2 case fetch-re-earn\n" as *u8) 45 sys_exit(0) 46 return 0 47}