code wiki / _hdl_build / nx_source_grade_register.nx

nx_source_grade_register.nx source

↩ module page · 47 lines · 4808 B

1// nx_source_grade_register.nx -- GOVERNED registration of the SOURCE-CRITICISM organ + the 2// Case 001 source re-grade. 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 sgr_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 sgr_run("/tmp/nx_source_grade_gate.sov.elf" as *u8) != 0 { allok = 0 } 25 if sgr_run("/tmp/nx_analyst_case_sources.sov.elf" as *u8) != 0 { allok = 0 } 26 cr_w(1, "ENGINEER: source-grade gate + case-001 re-grade 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 SOURCE-GRADE organ (arc=ANALYST; operator: 'clarity on what we see in real terms -- measure qualitatively AND quantitatively the accuracy from first-party sources, their biases, their actual research method'). RESEARCH-DERIVED, not invented: Researcher synthesis knowledge/library/analyst-tradecraft-best-practices-2026-06-10.txt (delegated fetch, team-owned >=2-corroboration rule; ICD 203 primary PDF + Admiralty/NATO 6x6 + Heuer ACH + WEP bands; 2 claims REFUTED incl. fold-the-scales-early). nx_source_grade.nx: Admiralty rel A..F x cred 1..6 rated INDEPENDENTLY then composed (F/6 cannot-judge = NEVER actionable, owes fetch-task); first-party distance primary>secondary>tertiary; method rung measured>systematic>survey>expert>marketing; quantitative permil score MONOTONE in all 4 axes, loud -1 on invalid grades; INDEPENDENCE RULE = corroboration only across DISTINCT incentive classes (same-class pair = ECHO of one interest; OPPOSED classes agreeing = strongest signal); ICD-203 confidence (LOW/MOD/HIGH from weakest admitted leg) SEPARATE from likelihood (7 estimative bands w/ permil edges) + sg_separation_ok law (never one sentence). Gate nx_source_grade_gate 45/45 sovereign GREEN first compile; durable anchor analyst_sources_gate.log; Examiner row ANALYST-SOURCES. Composes nx_analyst (CAPREG300) + nx_researcher protocol" 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 -- source-grade 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 SOURCE RE-GRADE -- the instrument's first target was OUR OWN ledger, and it DEMOTED us (the honesty proof). All 8 case sources graded (Admiralty pair + party + method + incentive class + permil score: SEC filings 800, P&L aggregation 462, vendor posted prices 640-but-uncorroborated-outside-class, lead-gen guides 163, vendor expert-claim 122); independence rule applied per row: root price/materials = lead-gen ECHO pair, equipment = vendor-class echo (S3 primary+measured yet uncorroborated outside its class), pc-margin = issuer-class echo; ONLY the contractor-margin row survives (vendor class vs consultant class AGREE = opposed-incentive corroboration, the strongest). STRICT RE-VERDICT: coverage 400 permil -> v0 SHENANIGAN demoted to UNDERTRACED; CONFIDENCE=LOW (weakest admitted leg 122, the vendor expert-claim blog); LIKELIHOOD withheld (the ICD-203 separation law: confidence and likelihood never share a sentence, and UNDERTRACED = the honest don't-know-yet). 6 fetch tasks each name the NEW bias class that re-earns a demoted row (BLS/insurer/distributor-pricelist/IDC-class). 20/20 hand-computed self-checks sovereign; report knowledge/status/analyst_sources_ac.log. The exceed over an LLM answer: the demotion is MECHANICAL and re-runnable, not a mood" 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 -- Case 001 source re-grade\n" as *u8) 45 sys_exit(0) 46 return 0 47}