code wiki / (root) / nx_tictactoe_html_contract_test.nx

nx_tictactoe_html_contract_test.nx

buildroot/runtime/nx_tictactoe_html_contract_test.nx

7240 B159 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic tictactoe
docsdependenciesstructsconstsfunctions

about

nx_tictactoe_html_contract_test.nx -- bits-up HTML-contract checker. Reads stdin (piped index.html), asserts the UI contract: - exactly 9 cell elements are present (marker: `data-cell-idx="N"`) - the 9 instances appear in ORDER N=0,1,2,3,4,5,6,7,8 This catches the click-handler-maps-to-wrong-cell bug class (the tic-tac-toe equivalent of the W/S inversion). Composes ยง22.1 bug-class prevention without needing a third-party browser driver. Per [[feedback-no-third-party-in-build-path-source-of-truth-is-bits-up]]: pure NishiLang. No grep, no awk, no Playwright, no Selenium. Just bytes. Bench harness pipes the HTML via stdin so this test is portable across machines without hardcoded paths: cat dist/tictactoe/index.html | qemu-riscv64-static <binary> genealogy_id: nx_tictactoe_html_contract_v1_2026_05_19 lineage_id: bits_up_html_attribute_contract_checker

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_tictactoe_html_contract_tes

imports: nx_syscalls.nxnx_tier.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sys_read nx_scan_cell_idx

structs

none

consts

30const NX_HTML_BUF_BYTES: i64 = 65536 // 64 KB enough for tic-tac-toe page

functions

35func nx_scan_cell_idx(buf: *u8, n: i64, idx_out: *u8) -> i64
called by 1: main
106func main() -> i64