code wiki / _hdl_build / nx_adnet_compare_page.nx
nx_adnet_compare_page.nx source
↩ module page · 115 lines · 10243 B
1// nx_adnet_compare_page.nx -- GENERATOR: the /compare/ads page (Nishi Compare plane). Renders the
2// Advertising and Ad Serving comparison from MEASURED artifacts only: the nx_adnet_census tally
3// (14/14 presence, 163 corpus attestations, liar-kill armed -- 2026-07-09 run), the June nx_ad_exceed
4// ladder (4/6 MEASURED EXCEEDS, 2 axes HELD at MEASURED on purpose), and the live serving mechanics
5// (gated hr_serve3_slot + nx_adnet_slot). NO waved claims: every number here traces to a gate log or
6// census run banked in knowledge/status/. Self-verified emission (read-back + required facts present).
7// Output: knowledge/staging/adnet/compare_ads.html expect_exit: 0 license_tier: ORIGINAL
8import "nx_syscalls.nx"
9import "_hdl_build/nx_adnet_slot.nx"
10const K_MAGIC_1024: i64 = 1024
11const K_MAGIC_262144: i64 = 262144
12
13func cp_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
14
15func cp_has(hay: *u8, n: i64, needle: *u8) -> i64 {
16 var nl: i64 = 0
17 while needle[nl] != (0 as u8) { nl = nl + 1 }
18 if nl == 0 { return 0 }
19 var i: i64 = 0
20 while i + nl <= n {
21 var j: i64 = 0
22 var eq: i64 = 1
23 while j < nl { if hay[i + j] != needle[j] { eq = 0; break } j = j + 1 }
24 if eq == 1 { return 1 }
25 i = i + 1
26 }
27 return 0
28}
29
30func cp_row(out: *u8, o0: i64, axis: *u8, st: *u8, note: *u8, cap: i64) -> i64 {
31 var o: i64 = o0
32 if o + K_MAGIC_1024 >= cap { return o }
33 o = ad_cat(out, o, "<tr><td>" as *u8)
34 o = ad_cat(out, o, axis)
35 o = ad_cat(out, o, "</td><td><span class=\"s s-" as *u8)
36 o = ad_cat(out, o, st)
37 o = ad_cat(out, o, "\">" as *u8)
38 o = ad_cat(out, o, st)
39 o = ad_cat(out, o, "</span></td><td>" as *u8)
40 o = ad_cat(out, o, note)
41 o = ad_cat(out, o, "</td></tr>" as *u8)
42 return o
43}
44
45func cp_wfile(path: *u8, buf: *u8, n: i64) -> i64 {
46 let fd: i64 = sys_openat_wr(path, 0x1A4)
47 if fd < 0 { return 0 }
48 let wr: i64 = sys_write(fd, buf, n)
49 sys_close(fd)
50 if wr != n { return 0 }
51 return 1
52}
53
54func main() -> i64 {
55 let cap: i64 = K_MAGIC_262144
56 let out: *u8 = sys_mmap(cap)
57 var o: i64 = 0
58 o = ad_cat(out, o, "<html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Advertising and Ad Serving - Nishi Compare</title>" as *u8)
59 o = ad_cat(out, o, "<style>body{font-family:system-ui,sans-serif;max-width:980px;margin:4vh auto;padding:0 20px;line-height:1.55;color:var(--fg,black)}table{border-collapse:collapse;width:100%;margin:10px 0 24px}td,th{border:1px solid gray;padding:6px 10px;text-align:left;font-size:.92rem;vertical-align:top}th{background:silver}h2{margin-top:2rem}code{background:gainsboro;padding:1px 5px;border-radius:3px;font-size:.85em}.s{padding:2px 8px;border-radius:10px;font-size:.78rem;font-weight:600;color:white}.s-PARITY{background:seagreen}.s-EXCEEDS{background:darkgreen}.s-MEASURED{background:steelblue}.s-HELD{background:slategray}.s-REFUSED{background:darkgoldenrod}.k{background:honeydew;border-left:4px solid seagreen;padding:10px 14px;margin:14px 0}</style></head><body>" as *u8)
60 o = ad_cat(out, o, "<h1>Advertising and Ad Serving</h1>" as *u8)
61 o = ad_cat(out, o, "<p><strong>Nishi adnet</strong> vs Google Ad Manager · Kevel · Revive Adserver · the 4chan self-serve model. Presence census <strong>14/14 axes (1000 permil)</strong>, 163 corpus attestations, liar-kill ARMED (grades are disk-fact functions, never self-scored; census re-run 2026-07-09). June exceed ladder: <strong>4/6 MEASURED EXCEEDS</strong> with cited incumbent baselines.</p>" as *u8)
62 o = ad_cat(out, o, "<div class=\"k\"><strong>The moat:</strong> sovereign FIRST-PARTY serving on our own HTTP+TLS stack — ad-block-resilient by same-origin construction, no AdSense gatekeeper, and privacy BY CONSTRUCTION: no cookie, no visitor id, no fingerprint, per-AD counters only, k-anonymity floor in the analytics lane.</div>" as *u8)
63
64 o = ad_cat(out, o, "<h2>Presence census (nx_adnet_census, corpus-grounded)</h2><table><tr><th>axis</th><th>status</th><th>grounding</th></tr>" as *u8)
65 o = cp_row(out, o, "Sovereign ad server infra" as *u8, "PARITY" as *u8, "own HTTP server (nx_http_server) - no third-party gatekeeper" as *u8, cap)
66 o = cp_row(out, o, "First-party serving" as *u8, "PARITY" as *u8, "same-origin, ad-block-resilient (nx_dist_serve)" as *u8, cap)
67 o = cp_row(out, o, "Banner ad unit" as *u8, "PARITY" as *u8, "nx_adnet inventory rows + 728x90 units" as *u8, cap)
68 o = cp_row(out, o, "Rotation / inventory" as *u8, "PARITY" as *u8, "1-of-N per section per view (nx_adnet ad_pick)" as *u8, cap)
69 o = cp_row(out, o, "Impression tracking" as *u8, "PARITY" as *u8, "per-AD append-only served counters (no visitor key)" as *u8, cap)
70 o = cp_row(out, o, "Click tracking + redirect" as *u8, "PARITY" as *u8, "first-party /ad/click/id 302 (gated fail-closed)" as *u8, cap)
71 o = cp_row(out, o, "CPM/CPC billing" as *u8, "PARITY" as *u8, "nx_adnet_bill gate 6/6 - integer milli-units, REFUSES unpriced/unmeasured" as *u8, cap)
72 o = cp_row(out, o, "Self-serve advertiser" as *u8, "PARITY" as *u8, "nx_adnet_selfserve gate 5/5 - staged-never-live intake, operator approve" as *u8, cap)
73 o = cp_row(out, o, "Contextual targeting" as *u8, "PARITY" as *u8, "by page section only - privacy-respecting" as *u8, cap)
74 o = cp_row(out, o, "Advertiser dashboard" as *u8, "PARITY" as *u8, "nx_adnet_dash gate 7/7 - aggregate-only, zero JS" as *u8, cap)
75 o = cp_row(out, o, "Privacy-respecting" as *u8, "PARITY" as *u8, "no cross-site behavioral tracking anywhere" as *u8, cap)
76 o = cp_row(out, o, "SITE-WIDE slot on every page" as *u8, "PARITY" as *u8, "hr_serve3_slot gate 8/8 - edge injection, byte-identical when off" as *u8, cap)
77 o = cp_row(out, o, "Time-rotation serving" as *u8, "PARITY" as *u8, "no per-user frequency state (capping-via-id REFUSED)" as *u8, cap)
78 o = cp_row(out, o, "ads.txt transparency" as *u8, "PARITY" as *u8, "DIRECT single-seller emission - zero reseller hops" as *u8, cap)
79
80 o = ad_cat(out, o, "</table><h2>Measured exceed ladder (nx_ad_exceed, June arc - cited head-to-heads)</h2><table><tr><th>axis</th><th>status</th><th>vs incumbent</th></tr>" as *u8)
81 o = cp_row(out, o, "Delivery (one ad per page)" as *u8, "EXCEEDS" as *u8, "0 third-party JS vs the GPT loader script tag" as *u8, cap)
82 o = cp_row(out, o, "Privacy analytics" as *u8, "EXCEEDS" as *u8, "aggregate + k-anon floor k=5 vs Plausible (cookieless but no k-floor)" as *u8, cap)
83 o = cp_row(out, o, "Signup (pay-on-results)" as *u8, "EXCEEDS" as *u8, "0-dollar on miss vs CPM pay-regardless" as *u8, cap)
84 o = cp_row(out, o, "Transparency" as *u8, "EXCEEDS" as *u8, "DIRECT single-sponsor, zero reseller hops vs reseller chains" as *u8, cap)
85 o = cp_row(out, o, "Viewability" as *u8, "HELD" as *u8, "MEASURED (MRC dwell rules in nx_ad_view); incumbents match - a beat claim would be overclaim" as *u8, cap)
86 o = cp_row(out, o, "Bot filtering" as *u8, "HELD" as *u8, "MEASURED (aggregate GIVT); SIVT needs per-user fingerprinting we REFUSE" as *u8, cap)
87
88 o = ad_cat(out, o, "</table><h2>Universal placement (the July-2026 completion)</h2>" as *u8)
89 o = ad_cat(out, o, "<p>ONE labeled first-party slot on EVERY served HTML page of every ad-enabled host, injected at the edge file server (<code>hr_serve3_slot</code>): fail-closed per-host (<code>@host</code> directive), page opt-out marker honored, byte-identical serving when disabled (gated do-no-harm law), correct Content-Length by construction. Click redirects and served-impression counters are first-party and per-AD only. Rotation is time-based - deliberately NO per-user frequency state.</p>" as *u8)
90 o = ad_cat(out, o, "<p>Navigate the estate: <a href=\"/synth/adnet_catalog.html\">the LIVING CATALOGUE of digital / app / physical ad real estate</a> · <a href=\"/synth/adnet_sitemap.xml\">sitemap</a> · <a href=\"/synth/adnet_inventory.txt\">live inventory</a>.</p>" as *u8)
91 o = ad_cat(out, o, "<h2>Honest gaps and refusals</h2><table><tr><th>item</th><th>status</th><th>why</th></tr>" as *u8)
92 o = cp_row(out, o, "Per-user frequency capping" as *u8, "REFUSED" as *u8, "requires a visitor identifier - against the privacy law; time-rotation instead" as *u8, cap)
93 o = cp_row(out, o, "SIVT-grade bot filtering" as *u8, "REFUSED" as *u8, "requires fingerprinting - GIVT aggregate lane only" as *u8, cap)
94 o = cp_row(out, o, "RTB / programmatic exchange" as *u8, "HELD" as *u8, "single-seller DIRECT model by design - no auction middlemen" as *u8, cap)
95 o = cp_row(out, o, "OPAQUE advertiser portal" as *u8, "MEASURED" as *u8, "dashboard organ gated; portal auth wiring = named follow-on" as *u8, cap)
96 o = cp_row(out, o, "Root /ads.txt placement" as *u8, "MEASURED" as *u8, "emitter gated; root-file publish lane = named follow-on" as *u8, cap)
97 o = ad_cat(out, o, "</table><p>Every green above traces to a gate log in <code>knowledge/status/</code> (adnet_slot 19/19 · hr_serve3_slot 8/8 · adnet_bill 6/6 · adnet_selfserve 5/5 · adnet_dash 7/7 · census GREEN liar-kill armed). Generated by <code>nx_adnet_compare_page</code> - regenerate, never hand-edit.</p>" as *u8)
98 o = ad_cat(out, o, "<p><a href=\"/compare\">Back to the compare hub</a></p></body></html>" as *u8)
99
100 let ok: i64 = cp_wfile("knowledge/staging/adnet/compare_ads.html" as *u8, out, o)
101 var good: i64 = ok
102 let vbox: *i64 = (sys_mmap(8)) as *i64
103 vbox[0] = 0
104 let vc: *u8 = sys_read_file("knowledge/staging/adnet/compare_ads.html" as *u8, vbox)
105 if (vc as i64) == 0 { good = 0 } else {
106 if cp_has(vc, vbox[0], "14/14 axes" as *u8) == 0 { good = 0 }
107 if cp_has(vc, vbox[0], "4/6 MEASURED EXCEEDS" as *u8) == 0 { good = 0 }
108 if cp_has(vc, vbox[0], "adnet_catalog.html" as *u8) == 0 { good = 0 }
109 if cp_has(vc, vbox[0], "<script" as *u8) == 1 { good = 0 }
110 }
111 if good == 1 { cp_puts("ADNET-COMPARE-PAGE verdict=GREEN\n" as *u8); sys_exit(0); return 0 }
112 cp_puts("ADNET-COMPARE-PAGE verdict=RED\n" as *u8)
113 sys_exit(1)
114 return 1
115}