nx_publish_verify.nx
buildroot/runtime/nx_publish_verify.nx
about
nx_publish_verify.nx -- THE LAST STEP OF THE PUBLISHING LOOP: is the page the PUBLIC URL serves the page the emitter just
wrote? (operator 2026-09-02: "beach wasnt receiving the updates for review and still isnt ... the pipeline needs to be
fully mature").
WHY THE LOOP WAS OPEN: nx_craft_emit's [5/5] SHIPPED step reads the FILE back and verifies its marker -- it proves the write
landed on disk and nothing about what a visitor receives through the edge (cache, a stale docroot, a route pointing at an older
tree, an injected banner). nx_page_verify proves the served page's assets fetch and decode and says nothing about WHICH build
it is. Neither answers the reviewer's question "am I looking at the build you just shipped?", so the reviewer answered it by
eye and was wrong for a day.
WHAT THIS DOES, composing the estate's own instruments and never a third-party client: reads the emitted file's build stamp
(`REVIEW STAGE b<epoch>` in the <title>, written by nx_game_page_emit), fetches the PUBLIC URL through the sovereign TLS client
(forks nx_https_get with the our-domain connect override so the request crosses the real edge), reads the served stamp, and
prints ONE verdict line a human or a seat can act on:
SERVED-CURRENT the edge serves the stamp the file carries (exit 0)
SERVED-STALE the edge serves an OLDER (or different) stamp (exit 1) -- both stamps and the byte delta printed
NO-MARKER the file or the served page carries no stamp (exit 4)
UNREACHABLE the fetch failed; nothing is claimed about the page (exit 3)
plus the REVIEW URL with every see-it lever on (?review=1&cast=1&hud=1) so the reviewer is never left to guess a query string.
The served body may legitimately exceed the file (the edge injects its notice bytes); the delta is PRINTED, never hidden.
nx_publish_verify <world> [base-url] (default base https://nishifamily.com/world/ ; file sites/nishifamily/world/<world>.html)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_https_fetch_lib.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 26 | const PV_BASE_DEFAULT: *u8 = "https://nishifamily.com/world/" |
| 27 | const PV_FILE_PFX: *u8 = "sites/nishifamily/world/" |
| 28 | const PV_FILE_EXT: *u8 = ".html" |
| 29 | const PV_MARK: *u8 = "REVIEW STAGE b" |
| 30 | const PV_REVIEW_QUERY: *u8 = "?review=1&cast=1&hud=1" |
| 31 | const PV_CONNECT_IP: i64 = 2130706433 // 127.0.0.1 packed big-endian (0x7F000001): connect to the sovereign edge on this host |
| 32 | const PV_CONNECT_PORT: i64 = 8443 // sites.elf's LAN listener; SNI, Host and cert name stay the URL's host |
| 33 | const PV_DECODE: i64 = 1 // hf_fetch_mode: decode the transport coding so the body is the document |
| 34 | const PV_CAP: i64 = 4194304 // a world page is ~620 KB; 4 MiB of capture headroom, announced when hit |
| 35 | const PV_TMO_MS: i64 = 30000 |
| 36 | const PV_PATH: i64 = 1024 |
| 37 | const PV_OUT: i64 = 4096 |
| 38 | const PV_STAMP_MAX: i64 = 24 |
| 39 | const PV_EXIT_OK: i64 = 0 |
| 40 | const PV_EXIT_STALE: i64 = 1 |
| 41 | const PV_EXIT_USAGE: i64 = 2 |
| 42 | const PV_EXIT_UNREACH: i64 = 3 |
| 43 | const PV_EXIT_NOMARK: i64 = 4 |
| 44 | const PV_CH_0: i64 = 48 |
| 45 | const PV_CH_9: i64 = 57 |
| 46 | const PV_CH_NL: i64 = 10 |
| 49 | const PV_LADDER_MARK: *u8 = "window.__nx_ladder=[" |
functions
| 51 | func pv_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 52 | func pv_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 } return p } |
| 53 | func pv_num(d: *u8, o: i64, v: i64) -> i64 |
| 67 | func pv_stamp(b: *u8, n: i64) -> i64 |
| 87 | func pv_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 89 | func pv_find(b: *u8, n: i64, needle: *u8) -> i64 |
| 103 | func main(argc: i64, argv: *i64) -> i64 |