code wiki / (root) / nx_sov_census.nx

nx_sov_census.nx source

↩ module page · 63 lines · 2305 B

1// nx_sov_census.nx -- sovereign 3rd-party-dependency census (the MEASURE step). 2// 3// Operator 2026-06-30: "no 3rd party db or other stuff; get to s-class exceed 4// EVERYWHERE in nishi investments (tools/ecosystem/language/team)." You cannot 5// get there without measuring the gap honestly first. This organ byte-scans an 6// investment's source for 3rd-party markers, grades sovereignty (gaps-first), 7// and the runner NAMES the sovereign Nishi replacement for each gap = the 8// worklist. No shell, no 3rd-party: pure byte-scan, built+run by the WOMB. 9// 10// genealogy_id: nishi_sovereignty_census_2026_06_30 11// lineage_id: sov_census_core 12 13import "nx_uxcx_grade.nx" // reuse uxg_has_lit / uxg_len (consolidation: do not re-roll) 14 15// Each axis returns 1 = SOVEREIGN (no 3rd-party marker found), 0 = 3rd-party gap. 16 17func soc_db_sov(s: *u8, n: i64) -> i64 { 18 if uxg_has_lit(s, n, "sqlite3" as *u8) == 1 { return 0 } 19 if uxg_has_lit(s, n, "import sqlite" as *u8) == 1 { return 0 } 20 return 1 21} 22 23func soc_http_sov(s: *u8, n: i64) -> i64 { 24 if uxg_has_lit(s, n, "httpx" as *u8) == 1 { return 0 } 25 if uxg_has_lit(s, n, "urllib" as *u8) == 1 { return 0 } 26 if uxg_has_lit(s, n, "requests" as *u8) == 1 { return 0 } 27 return 1 28} 29 30func soc_validation_sov(s: *u8, n: i64) -> i64 { 31 if uxg_has_lit(s, n, "pydantic" as *u8) == 1 { return 0 } 32 return 1 33} 34 35func soc_pdf_sov(s: *u8, n: i64) -> i64 { 36 if uxg_has_lit(s, n, "docling" as *u8) == 1 { return 0 } 37 if uxg_has_lit(s, n, "grobid" as *u8) == 1 { return 0 } 38 if uxg_has_lit(s, n, "marker" as *u8) == 1 { return 0 } 39 return 1 40} 41 42func soc_map_sov(s: *u8, n: i64) -> i64 { 43 if uxg_has_lit(s, n, "leaflet" as *u8) == 1 { return 0 } 44 return 1 45} 46 47// runtime axis: a source artifact's LANGUAGE. .py/.js = 3rd-party runtime by 48// construction; .nx = sovereign. Caller passes is_nx (1 sovereign / 0 3rd-party). 49func soc_runtime_sov(is_nx: i64) -> i64 { 50 return is_nx 51} 52 53// Sovereignty permil over the six axes. 54func soc_permil(db: i64, http: i64, val: i64, pdf: i64, map: i64, rt: i64) -> i64 { 55 var p: i64 = 0 56 if db == 1 { p = p + 1 } 57 if http == 1 { p = p + 1 } 58 if val == 1 { p = p + 1 } 59 if pdf == 1 { p = p + 1 } 60 if map == 1 { p = p + 1 } 61 if rt == 1 { p = p + 1 } 62 return (p * 1000) / 6 63}