code wiki / _hdl_build / nx_advertising_page.nx

nx_advertising_page.nx source

↩ module page · 73 lines · 5684 B

1// nx_advertising_page.nx -- emits the ADVERTISING dashboard for nishifamily.com, served BEHIND the 2// Nishi Family OPAQUE wall (written to wiki_pages/advertising.html, which the gated :18791 daemon 3// serves ONLY to a valid operator session -- never a public byte). The grades are ORGAN-COMPUTED 4// live by ax_census_levels (nx_ad_exceed), NOT hand-written -- the dashboard cannot overclaim. The 5// cited frame text is display-only. Sovereign: nx_ad_exceed + nx_wiki_skin_lib + nx_syscalls. 6// Re-run + push to refresh. license_tier: ORIGINAL 7import "nx_ad_exceed.nx" // ax_census_levels (live grades) + the whole ad organ graph 8import "nx_wiki_skin_lib.nx" // skin_open / sk_cat / sk_catn / skin_close (matches the hub skin) 9import "nx_syscalls.nx" 10const AP_MAGIC_262144: i64 = 262144 11 12const AP_OUT: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/knowledge/wiki_pages/advertising.html" 13 14// append the ladder level NAME for a grade into the skin buffer. 15func ap_grade(buf: *u8, off: i64, lv: i64) -> i64 { 16 if lv == 0 { return sk_cat(buf, off, "ABSENT" as *u8) } 17 if lv == 1 { return sk_cat(buf, off, "STUB" as *u8) } 18 if lv == 2 { return sk_cat(buf, off, "BUILT" as *u8) } 19 if lv == 3 { return sk_cat(buf, off, "GATED" as *u8) } 20 if lv == 4 { return sk_cat(buf, off, "MEASURED" as *u8) } 21 if lv == 5 { return sk_cat(buf, off, "EXCEEDS" as *u8) } 22 return sk_cat(buf, off, "PHYSICS-OPTIMUM" as *u8) 23} 24 25// one census row: face label | organ-computed grade | cited measured bar. 26func ap_row(buf: *u8, off: i64, label: *u8, lv: i64, bar: *u8) -> i64 { 27 var o: i64 = off 28 o = sk_cat(buf, o, "<tr><td><b>" as *u8); o = sk_cat(buf, o, label) 29 o = sk_cat(buf, o, "</b></td><td><b>" as *u8); o = ap_grade(buf, o, lv) 30 o = sk_cat(buf, o, "</b></td><td>" as *u8); o = sk_cat(buf, o, bar); o = sk_cat(buf, o, "</td></tr>\n" as *u8) 31 return o 32} 33 34func main() -> i64 { 35 let lv: *i64 = sys_mmap(8 * 8) as *i64 36 ax_census_levels(lv) 37 var exc: i64 = 0 38 var sum: i64 = 0 39 var i: i64 = 0 40 while i < 6 { 41 if lv[i] == 5 { exc = exc + 1 } 42 sum = sum + lv[i] 43 i = i + 1 44 } 45 46 let h: *u8 = sys_mmap(AP_MAGIC_262144) 47 var w: i64 = 0 48 w = skin_open(h, w, "Advertising" as *u8, "ads" as *u8) 49 w = sk_cat(h, w, "<h1>Advertising &mdash; measured S-class census</h1>\n" as *u8) 50 w = sk_cat(h, w, "<p class=\"sub\">One ad per page, &ldquo;Brought to you by&rdquo;. Organ-graded, cited, liar-killed &mdash; never tracking users, just systems.</p>\n" as *u8) 51 w = sk_cat(h, w, "<p><b>Privacy law:</b> site visitors are NEVER identified server-side &mdash; aggregate-only, no id / cookie / IP / fingerprint, k-anon floor; any visitor login is device-local (their business, their own computer). Advertisers are a separate B2B account.</p>\n" as *u8) 52 w = sk_cat(h, w, "<h2>The six faces</h2>\n<table>\n<tr><th>Face</th><th>Grade</th><th>Measured bar (cited, sovereignly fetched)</th></tr>\n" as *u8) 53 w = ap_row(h, w, "Delivery &mdash; one ad/page byline" as *u8, lv[0], "0 third-party JS vs incumbent Google Publisher Tag loader" as *u8) 54 w = ap_row(h, w, "Viewability &mdash; honest impressions" as *u8, lv[1], "MRC &ge;50% pixels for &ge;1s; counts only genuinely-seen, refuses served-but-unseen" as *u8) 55 w = ap_row(h, w, "Privacy &mdash; analytics, no tracking" as *u8, lv[2], "k-anon floor k=5; cookieless peer (Plausible) has no count floor" as *u8) 56 w = ap_row(h, w, "Bot filter &mdash; invalid traffic" as *u8, lv[3], "8 aggregate GIVT signals; SIVT refused (needs per-user fingerprint we will not do)" as *u8) 57 w = ap_row(h, w, "Signup &mdash; businesses advertise" as *u8, lv[4], "$0-on-miss pay-on-results vs CPM (pay per impression regardless of outcome)" as *u8) 58 w = ap_row(h, w, "Transparency &mdash; supply chain" as *u8, lv[5], "0 reseller hops (DIRECT single sponsor) vs the programmatic reseller chain" as *u8) 59 w = sk_cat(h, w, "</table>\n" as *u8) 60 w = sk_cat(h, w, "<p><b>Summary:</b> EXCEEDS " as *u8); w = sk_catn(h, w, exc); w = sk_cat(h, w, " / 6 faces &middot; ladder sum " as *u8); w = sk_catn(h, w, sum) 61 w = sk_cat(h, w, " / 30. Viewability + bot filter are held at MEASURED <i>on purpose</i> &mdash; incumbents match there (Active View / SIVT via the fingerprinting we refuse), so claiming a beat would be overclaim. Honesty over flattery.</p>\n" as *u8) 62 w = sk_cat(h, w, "<h2>Honest billing</h2>\n<p>Billable reach = <b>seen AND human</b> only (served &rarr; viewable &rarr; billable). No fake impressions like the incumbents; bot and useless traffic is filtered out for our clients. Pay on results &mdash; miss the goal, pay $0; beat it, a flat capped bonus.</p>\n" as *u8) 63 w = sk_cat(h, w, "<p class=\"sub\">Ladder: ABSENT &lt; STUB &lt; BUILT &lt; GATED &lt; MEASURED &lt; EXCEEDS. Grades are computed live by the census organ (nx_ad_exceed) from real gate evidence; the grader is monotone so it cannot be made to claim a rung it has not earned. Sources fetched by the sovereign researcher (own TLS-1.3 vs the Mozilla CA store).</p>\n" as *u8) 64 w = skin_close(h, w, sys_now_realtime_sec()) 65 66 let fd: i64 = sys_openat_wr(AP_OUT, 420) 67 if fd < 0 { sys_write(2, "AD-PAGE-FAIL (wiki_pages dir?)\n" as *u8, 30); sys_exit(1); return 1 } 68 sys_write(fd, h, w); sys_close(fd) 69 let r: *u8 = sys_mmap(96); var ro: i64 = 0 70 ro = sk_cat(r, ro, "AD-PAGE-OK bytes=" as *u8); ro = sk_catn(r, ro, w); ro = sk_cat(r, ro, " exceeds=" as *u8); ro = sk_catn(r, ro, exc); ro = sk_cat(r, ro, " sum=" as *u8); ro = sk_catn(r, ro, sum); ro = sk_cat(r, ro, " -> wiki_pages/advertising.html\n" as *u8) 71 sys_write(1, r, ro) 72 sys_exit(0); return 0 73}