code wiki / (root) / nx_publish_verify.nx

nx_publish_verify.nx

buildroot/runtime/nx_publish_verify.nx

11583 B186 linesdepth 21pulls 150 transitivereach 0 importersview sourcekind orphan librarytopic publish
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_https_fetch_lib.nx nx_publish_verify.nx

imports: nx_syscalls.nxnx_https_fetch_lib.nx

imported by: nobody (leaf or entry point)

structs

none

consts

26const PV_BASE_DEFAULT: *u8 = "https://nishifamily.com/world/"
27const PV_FILE_PFX: *u8 = "sites/nishifamily/world/"
28const PV_FILE_EXT: *u8 = ".html"
29const PV_MARK: *u8 = "REVIEW STAGE b"
30const PV_REVIEW_QUERY: *u8 = "?review=1&cast=1&hud=1"
31const PV_CONNECT_IP: i64 = 2130706433 // 127.0.0.1 packed big-endian (0x7F000001): connect to the sovereign edge on this host
32const PV_CONNECT_PORT: i64 = 8443 // sites.elf's LAN listener; SNI, Host and cert name stay the URL's host
33const PV_DECODE: i64 = 1 // hf_fetch_mode: decode the transport coding so the body is the document
34const PV_CAP: i64 = 4194304 // a world page is ~620 KB; 4 MiB of capture headroom, announced when hit
35const PV_TMO_MS: i64 = 30000
36const PV_PATH: i64 = 1024
37const PV_OUT: i64 = 4096
38const PV_STAMP_MAX: i64 = 24
39const PV_EXIT_OK: i64 = 0
40const PV_EXIT_STALE: i64 = 1
41const PV_EXIT_USAGE: i64 = 2
42const PV_EXIT_UNREACH: i64 = 3
43const PV_EXIT_NOMARK: i64 = 4
44const PV_CH_0: i64 = 48
45const PV_CH_9: i64 = 57
46const PV_CH_NL: i64 = 10
49const PV_LADDER_MARK: *u8 = "window.__nx_ladder=["

functions

51func pv_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
52func 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 }
53func pv_num(d: *u8, o: i64, v: i64) -> i64
67func pv_stamp(b: *u8, n: i64) -> i64
87func pv_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
89func pv_find(b: *u8, n: i64, needle: *u8) -> i64
103func main(argc: i64, argv: *i64) -> i64