nx_ppp_probe.nx
buildroot/runtime/nx_ppp_probe.nx
about
nx_ppp_probe.nx -- PERSON / PRODUCT / PLACE probe: ONE ruler, run on OUR live surface AND on each rival's
live surface, so a /compare page can say how to build a better site than the competitor from a measurement
instead of an opinion (operator 2026-08-24: "we need to know the person, product, and place ... competing on
person via privacy and superior cx, product as a superior product ... place ... ease of navigation and
ability to accomplish the desired task").
WHAT IT MEASURES, from the bytes a first visitor receives (HTML body over the sovereign TLS stack + the
HTTP response headers) -- the same envelope for every subject, which is what makes the head-to-head fair:
PERSON (privacy + CX) third-party asset hosts, third-party SCRIPT hosts, known tracker markers (tag
manager, analytics, pixel, session-replay, ad networks, fingerprinting), consent-banner markers,
cookie-less analytics markers, Set-Cookie count, Permissions-Policy, the 5 security headers
(composes nx_uiq_wire_lib uw_audit -- one ruler for headers, never a second copy).
PRODUCT (design quality + longevity) the design-hygiene score of nx_ui_audit (forked, /12), computed
WCAG contrast over the page's real color tokens (composes nx_uiq_color uiq_audit_buf in-process),
the static Core-Web-Vitals predictor of nx_uiq_perf (forked: render-blocking css/js, unsized
media), script tags, inline-JS share of the page, noscript, dark-mode + reduced-motion media
queries, canonical link, doctype, page weight.
PLACE (findability + task) nav / main / footer landmarks, skip link, on-site search, breadcrumb,
exactly-one h1, aria-current, link count and internal-link count, lang, viewport, title.
SCORE: each axis is a permil computed by the DECLARED rules in pp_score_* below -- every rule is a count
against a published bar (WCAG 2.2 landmarks and skip links, NN/g search + breadcrumb, web.dev CWV
predictors, OWASP secure headers, the Markup Blacklight tracker classes) so it can be argued with, and the
raw counts are printed beside the score so nobody has to trust the arithmetic.
THIRD STATE: a sub-measure the probe could not observe (a fork that returned nothing, headers not captured)
is printed as -1 and named in "unobserved" -- it scores ZERO for that rule and the page says so, never a
silent acquittal (abstain-never-acquit).
HONEST ENVELOPE: static HTML + headers, no render, no script execution. A client-rendered app is graded on
what it ships to a no-JS first visitor -- which is the progressive-enhancement bar itself, stated on the
page. Registrable domain = last two labels (wrong for co.uk-class suffixes; declared).
nx_ppp_probe url <url> [connect-host:port] -> one JSON object on stdout
nx_ppp_probe domain <dom> -> reads knowledge/compare/<dom>.ppp rows
surface|<col>|<label>|<url>|<connect or ->
probes each, writes knowledge/compare/<dom>.pppstate
nx_ppp_probe --kat -> fixture self-test (bite-proven both directions)
exit: 0 ok | 1 kat failed | 2 usage | 4 fetch failed (url verb)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_tool_run.nxnx_https_fetch_follow.nxnx_trust_store_load_from_certdata.nxnx_https_url_connect.nxnx_uiq_color.nxnx_uiq_wire_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 45 | const PP_BODY_CAP: i64 = 4194304 // one page body reserve (largest rival measured: 792 KB); brim announces |
| 46 | const PP_CERT_CAP: i64 = 4194304 // Mozilla certdata reserve, as nx_ui_audit sizes it |
| 47 | const PP_FORK_CAP: i64 = 262144 // a forked ruler's stdout, unknowable in advance |
| 48 | const PP_HDR_CAP: i64 = 2097152 // nx_https_get prints headers AND body; headers are read from the head |
| 49 | const PP_HOSTS_MAX: i64 = 128 // distinct hosts tracked per page; brim announces |
| 50 | const PP_HOST_W: i64 = 128 // one host slot |
| 51 | const PP_OUT_CAP: i64 = 32768 // one surface's JSON |
| 52 | const PP_MIN_BYTES: i64 = 1024 // under this a body is a redirect stub or a co-squat 404, not a page |
| 53 | const PP_FORK_MS: i64 = 60000 // a forked ruler that has not answered in a minute is UNOBSERVED |
| 54 | const PP_MAX_SURFACES: i64 = 16 |
| 55 | const PP_ROW_CAP: i64 = 2048 |
| 56 | const PP_STATE_CAP: i64 = 524288 |
| 57 | const PP_NAME_CAP: i64 = 512 |
| 58 | const PP_TMP_BODY: *u8 = "/tmp/nx_ppp_body.html" |
| 59 | const PP_LINE_CAP: i64 = 4096 |
| 61 | const PP_ATTRPAT_CAP: i64 = 256 |
| 63 | const PP_NUMBUF_CAP: i64 = 32 |
functions
| 65 | func pp_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 66 | func pp_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 67 | func pp_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } d[p] = 0 as u8; return p } |
| 68 | func pp_catn(d: *u8, o: i64, v: i64) -> i64 |
| 81 | func pp_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 } |
| 82 | func pp_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: pp_lower |
| 84 | func pp_count(buf: *u8, n: i64, pat: *u8) -> i64 |
| 97 | func pp_has(buf: *u8, n: i64, pat: *u8) -> i64 { if pp_count(buf, n, pat) > 0 { return 1 } return 0 } |
| 107 | func pp_has_attr(buf: *u8, n: i64, attr: *u8, val: *u8) -> i64 |
| 121 | func pp_find(buf: *u8, n: i64, from: i64, pat: *u8) -> i64 |
| 135 | func pp_json_int(buf: *u8, n: i64, key: *u8) -> i64 |
| 152 | func pp_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 154 | func pp_elf(name: *u8, out: *u8) -> i64 |
| 172 | func pp_write_atomic(path: *u8, buf: *u8, n: i64) -> i64 called by 2: pp_probe_urlpp_domain calls 6: sys_mmappp_catsys_openat_wrsys_writesys_closesys_renameat |
| 184 | func pp_lower(src: *u8, n: i64, dst: *u8) -> i64 |
| 191 | func pp_host_of(url: *u8, host: *u8, reg: *u8) -> i64 |
| 221 | func pp_same_site(host: *u8, reg: *u8) -> i64 |
| 233 | func pp_in_script_tag(lb: *u8, p: i64) -> i64 |
| 247 | func pp_hosts(lb: *u8, n: i64, reg: *u8, out: *i64, names: *u8) -> i64 |
| 311 | func pp_trackers(lb: *u8, n: i64, names: *u8) -> i64 |
| 350 | func pp_consent(lb: *u8, n: i64) -> i64 |
| 360 | func pp_cookieless(lb: *u8, n: i64) -> i64 |
| 368 | func pp_inline_js(lb: *u8, n: i64) -> i64 |
| 385 | func pp_score_person(tp_hosts: i64, tp_script: i64, trackers: i64, consent: i64, setcookie: i64, sec: i64, permpol: i64) -> i64 |
| 397 | func pp_score_product(design: i64, cfails: i64, ctokens: i64, bcss: i64, bjs: i64, unsized: i64, scripts: i64, jsperm: i64, noscript: i64, dark: i64, motion: i64, canonical: i64, doctype: i64) -> i64 |
| 413 | func pp_score_place(nav: i64, main: i64, footer: i64, skip: i64, search: i64, crumb: i64, h1: i64, links: i64, internal: i64, lang: i64, viewport: i64, title: i64, current: i64) -> i64 |
| 430 | func pp_pat_skip(out: *u8) -> i64 |
| 436 | func pp_pat_skip2(out: *u8) -> i64 |
| 447 | func pp_measure(body: *u8, n: i64, hdr: *u8, hn: i64, url: *u8, design: i64, bcss: i64, bjs: i64, unsized: i64, m: *i64, tnames: *u8, hnames: *u8) -> i64 |
| 527 | func pp_kv(d: *u8, o: i64, k: *u8, v: i64) -> i64 |
| 530 | func pp_ks(d: *u8, o: i64, k: *u8, v: *u8) -> i64 |
| 538 | func pp_emit_json(out: *u8, col: *u8, label: *u8, url: *u8, m: *i64, tnames: *u8, hnames: *u8, unobs: *u8) -> i64 |
| 598 | func pp_fork(name: *u8, a1: *u8, a2: *u8, out: *u8, cap: i64) -> i64 |
| 612 | func pp_probe_url(url: *u8, connect: *u8, col: *u8, label: *u8, store: *TrustStore, out: *u8) -> i64 |
| 690 | func pp_store() -> *TrustStore |
| 698 | func pp_kat() -> i64 |
| 769 | func pp_split(line: *u8, fld: *i64, maxf: i64) -> i64 |
| 780 | func pp_domain(dom: *u8) -> i64 |
| 863 | func main(argc: i64, argv: *i64) -> i64 |