code wiki / _hdl_build / nx_adnet_census.nx

nx_adnet_census.nx source

↩ module page · 100 lines · 7751 B

1// nx_adnet_census.nx -- HONEST MEASURED census of our SOVEREIGN AD NETWORK vs the June-2026 bar (operator: our own 2// ad setup like 4chan's banners; mainstream networks refuse our content so we self-serve; offsets hosting cost like 3// the swarm offsets bandwidth; site-level banners = safe-harbor-compatible platform ads, not content-monetization). 4// Drives the general census engine over knowledge/fetched/adnet_*.raw. Truth today: we have the SOVEREIGN FIRST-PARTY 5// serving FOUNDATION (own HTTP server -> ad-block-resilient + serves refused-content categories AdSense won't), but 6// the AD-SYSTEM ITSELF (banner unit, rotation/inventory, impression+click tracking, CPM/CPC billing, self-serve 7// advertiser flow, contextual targeting) is the GAP set to build on that foundation. Sovereign nx_cc->nxasm. 8// expect_exit: 0 license_tier: ORIGINAL 9import "nx_capability_census.nx" 10import "nx_syscalls.nx" 11const K_MAGIC_2097152: i64 = 2097152 12 13func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 14func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } 15func row(label: *u8, term: *u8, organ: *u8, exceed: *u8, subj: *i64, ns: i64, buf: *u8, cap: i64, st: *i64) -> i64 { 16 let comp: i64 = cc_comp_attest(subj, ns, term, buf, cap) 17 let our: i64 = cc_our_grade(organ, exceed) 18 let v: i64 = cc_verdict(comp, our) 19 w(" "); w(cc_verdict_str(v)); w(" us="); w(cc_grade_str(our)); w(" them(src="); wn(comp); w(") "); w(label); w("\n") 20 st[0]=st[0]+1 21 if our>=3 { st[1]=st[1]+1 } 22 if our==4 { st[2]=st[2]+1 } 23 if v==3 { st[3]=st[3]+1 } 24 if v==2 { st[4]=st[4]+1 } 25 if v==1 { st[5]=st[5]+1 } 26 if v==0 { st[6]=st[6]+1 } 27 st[7]=st[7]+comp 28 return 0 29} 30 31func main() -> i64 { 32 w("=== NISHI SOVEREIGN AD NETWORK (4chan-style banners) vs June-2026 -- CENSUS ===\n" as *u8) 33 w("them(src)=banked knowledge/fetched/adnet_*.raw. us=EXCEEDS>PRESENT>ABSENT (disk-fact, never self-scored).\n\n" as *u8) 34 let cap: i64 = K_MAGIC_2097152 35 let buf: *u8 = sys_mmap(cap) 36 let st: *i64 = sys_mmap(128) as *i64 37 var z: i64=0; while z<8 { st[z]=0; z=z+1 } 38 39 let subj: *i64 = sys_mmap(8 * 24) as *i64 40 subj[0]="knowledge/fetched/adnet_a_online_advertising.raw" as *u8 as i64 41 subj[1]="knowledge/fetched/adnet_a_web_banner.raw" as *u8 as i64 42 subj[2]="knowledge/fetched/adnet_a_native.raw" as *u8 as i64 43 subj[3]="knowledge/fetched/adnet_b_ad_network.raw" as *u8 as i64 44 subj[4]="knowledge/fetched/adnet_b_ad_serving.raw" as *u8 as i64 45 subj[5]="knowledge/fetched/adnet_b_contextual.raw" as *u8 as i64 46 subj[6]="knowledge/fetched/adnet_c_impression.raw" as *u8 as i64 47 subj[7]="knowledge/fetched/adnet_c_ctr.raw" as *u8 as i64 48 subj[8]="knowledge/fetched/adnet_c_ppc.raw" as *u8 as i64 49 subj[9]="knowledge/fetched/adnet_c_cpm.raw" as *u8 as i64 50 subj[10]="knowledge/fetched/adnet_d_rtb.raw" as *u8 as i64 51 subj[11]="knowledge/fetched/adnet_e_4chan.raw" as *u8 as i64 52 subj[12]="knowledge/fetched/adnet_e_affiliate.raw" as *u8 as i64 53 subj[13]="knowledge/fetched/adnet_f_adblock.raw" as *u8 as i64 54 subj[14]="knowledge/fetched/adnet_g_gam.raw" as *u8 as i64 55 subj[15]="knowledge/fetched/adnet_g_freqcap.raw" as *u8 as i64 56 subj[16]="knowledge/fetched/adnet_g_adstxt.raw" as *u8 as i64 57 subj[17]="knowledge/fetched/adnet_g_adtrack.raw" as *u8 as i64 58 let ns: i64 = 18 59 let none: *u8 = "runtime/nx_DOES_NOT_EXIST_zzqq.nx" as *u8 60 61 w(" -- FOUNDATION we HAVE (sovereign first-party serving = the architectural advantage) --\n" as *u8) 62 row("SOVEREIGN ad SERVER infra (own HTTP; no AdSense gatekeeper)" as *u8, "advertising" as *u8, "runtime/nx_http_server.nx" as *u8, none, subj, ns, buf, cap, st) 63 row("FIRST-PARTY serving (same-origin -> AD-BLOCK-RESILIENT + refused-content-OK)" as *u8, "blocking" as *u8, "runtime/nx_dist_serve.nx" as *u8, none, subj, ns, buf, cap, st) 64 65 w("\n -- AD-NETWORK SYSTEM (the build ladder on that foundation) --\n" as *u8) 66 row("BANNER ad unit (image placement, 4chan-style)" as *u8, "banner" as *u8, "runtime/_hdl_build/nx_adnet.nx" as *u8, none, subj, ns, buf, cap, st) 67 row("AD ROTATION / inventory (serve 1 of N per view)" as *u8, "serving" as *u8, "runtime/_hdl_build/nx_adnet.nx" as *u8, none, subj, ns, buf, cap, st) 68 row("IMPRESSION tracking (count views)" as *u8, "impression" as *u8, "runtime/_hdl_build/nx_adnet.nx" as *u8, none, subj, ns, buf, cap, st) 69 row("CLICK tracking + redirect" as *u8, "click" as *u8, "runtime/_hdl_build/nx_adnet.nx" as *u8, none, subj, ns, buf, cap, st) 70 row("CPM/CPC billing (price per impression/click)" as *u8, "cost" as *u8, "runtime/_hdl_build/nx_adnet_bill.nx" as *u8, none, subj, ns, buf, cap, st) 71 row("SELF-SERVE advertiser (submit banner + buy placement)" as *u8, "advertiser" as *u8, "runtime/_hdl_build/nx_adnet_selfserve.nx" as *u8, none, subj, ns, buf, cap, st) 72 row("CONTEXTUAL targeting (by section; privacy-respecting)" as *u8, "contextual" as *u8, "runtime/_hdl_build/nx_adnet.nx" as *u8, none, subj, ns, buf, cap, st) 73 row("Advertiser DASHBOARD (campaign mgmt)" as *u8, "campaign" as *u8, "runtime/_hdl_build/nx_adnet_dash.nx" as *u8, none, subj, ns, buf, cap, st) 74 row("PRIVACY-respecting (no cross-site behavioral tracking)" as *u8, "advertising" as *u8, "runtime/_hdl_build/nx_adnet.nx" as *u8, none, subj, ns, buf, cap, st) 75 76 w("\n -- UNIVERSAL PLACEMENT (slots on ALL assets; July-2026 completion arc) --\n" as *u8) 77 row("SITE-WIDE SLOT on every vhost page (edge injection, fail-closed per-host)" as *u8, "placement" as *u8, "runtime/_hdl_build/nx_adnet_slot.nx" as *u8, none, subj, ns, buf, cap, st) 78 row("TIME-ROTATION serving (per-user frequency capping REFUSED: no visitor id)" as *u8, "frequency" as *u8, "runtime/_hdl_build/nx_adnet_slot.nx" as *u8, none, subj, ns, buf, cap, st) 79 row("ADS.TXT transparency (DIRECT single-seller, zero reseller hops)" as *u8, "ads.txt" as *u8, "runtime/_hdl_build/nx_adnet_dash.nx" as *u8, none, subj, ns, buf, cap, st) 80 81 let total: i64=st[0]; let have: i64=st[1]; let permil: i64=(have*1000)/total 82 w("\n TALLY: axes=" as *u8); wn(total); w(" HAVE=" as *u8); wn(have); w(" (" as *u8); wn(permil); w("permil)" as *u8) 83 w(" EXCEEDS=" as *u8); wn(st[2]); w(" AHEAD=" as *u8); wn(st[3]); w(" PARITY=" as *u8); wn(st[4]); w(" GAP=" as *u8); wn(st[5]) 84 w("\n corpus attestations=" as *u8); wn(st[7]); w("\n" as *u8) 85 86 let g_real: i64 = cc_our_grade("runtime/nx_http_server.nx" as *u8, none) 87 let g_fake: i64 = cc_our_grade(none, none) 88 var liar_ok: i64=1; if g_real!=3 { liar_ok=0 } if g_fake!=0 { liar_ok=0 } 89 var corpus_ok: i64=0; if st[7]>0 { corpus_ok=1 } 90 w(" honesty: liar-kill=" as *u8); if liar_ok==1 { w("ARMED" as *u8) } else { w("DISARMED" as *u8) } 91 w(" corpus-grounded=" as *u8); if corpus_ok==1 { w("YES" as *u8) } else { w("NO" as *u8) } w("\n" as *u8) 92 93 w("\n=== ADNET-CENSUS verdict=" as *u8) 94 if liar_ok==1 { if corpus_ok==1 { 95 w("GREEN. Read: sovereign FIRST-PARTY serving = the moat (ad-block-resilient + serves what AdSense refuses); " as *u8); wn(st[5]) 96 w(" GAPs = the ad-system (banner/rotation/impression/click/billing/self-serve/targeting) = the build ladder.\n" as *u8) 97 sys_exit(0); return 0 98 } } 99 w("RED (unbanked corpus -> run nx_adnet_research_fetch)\n" as *u8); sys_exit(1); return 1 100}