code wiki / _hdl_build / nx_docstage_gate.nx

nx_docstage_gate.nx

buildroot/runtime/_hdl_build/nx_docstage_gate.nx

14645 B236 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_docstage_gate.nx -- THE REFEREE for nx_docstage (DM8, devmgmt rung). END-TO-END: forks the DEPLOYED nx_docstage elf, so it grades the artifact callers run. The accept rule, verbatim from devmgmt.plan: "the stage reports DOCUMENTED or UNDOCUMENTED per ship with ZERO false DOCUMENTED, measured against the symbols a session actually shipped." ZERO FALSE DOCUMENTED IS THE ONLY BAR THAT MATTERS HERE, so the fixture is built around the one way this check goes wrong: a SUBSTRING match. `nx_dora_page` contains `nx_dora`, and a scanner that does not test token boundaries reports the shipped symbol as written-down because a DIFFERENT symbol is mentioned somewhere. That failure is invisible -- it produces a green, plausible, wrong answer -- so the fixture carries all four boundary traps at once (`nx_dora_page`, `xnx_dora`, `_nx_dora`, `nx_dorax`) with NO real token, and demands UNDOCUMENTED. The positive control sits in the same gate: the same symbol, as a real token, must come back DOCUMENTED. A detector that answers "documented" for everything fails the first; one that answers "undocumented" for everything fails the second. Neither alone proves discrimination. The third state is tested too, because "I could not look" and "it is not written down" demand opposite actions and only one of them is ever safe to act on. Fixtures under /tmp/nx_docstage_gate/, rewritten O_TRUNC each run (idempotent). license_tier: ORIGINAL Read-only outside /tmp. No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_sovjson_lib.nx nx_gate_verdict.nx nx_tool_run.nx nx_docstage_gate.nx

imports: nx_syscalls.nxnx_sovjson_lib.nxnx_gate_verdict.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ sj_cat sj_allow_path sys_mmap ↻ sys_openat_rd sys_read sys_close sj_le sj_col sj_lit_eq sys_mkdir dg_wr sys_openat_wr sys_write ↻ sys_close ↻ sys_unlinkat gv_check gv_puts ↻ dg_run sys_mmap ↻

structs

none

consts

26const DG_MODE_644: i64 = 420
27const DG_MODE_755: i64 = 493
28const DG_PATH: i64 = 512
29const DG_FIX: i64 = 65536
30const DG_OUT: i64 = 1048576
31const DG_EXIT_SKIP: i64 = 3
32const DG_RC_DOC: i64 = 0
33const DG_RC_UNDOC: i64 = 1
34const DG_RC_UNMEASURED: i64 = 3
35const DG_RC_USAGE: i64 = 2
36const DG_MANY: i64 = 30 // token occurrences planted to exceed the printed-list bound

functions

38func dg_wr(path: *u8, buf: *u8, n: i64) -> i64
45func dg_run(subj: *u8, a1: *u8, a2: *u8, out: *u8, cl: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
54func main(argc: i64, argv: *i64) -> i64