code wiki / _hdl_build / nx_docstage_gate.nx
nx_docstage_gate.nx
buildroot/runtime/_hdl_build/nx_docstage_gate.nx
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
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
structs
| none |
consts
| 26 | const DG_MODE_644: i64 = 420 |
| 27 | const DG_MODE_755: i64 = 493 |
| 28 | const DG_PATH: i64 = 512 |
| 29 | const DG_FIX: i64 = 65536 |
| 30 | const DG_OUT: i64 = 1048576 |
| 31 | const DG_EXIT_SKIP: i64 = 3 |
| 32 | const DG_RC_DOC: i64 = 0 |
| 33 | const DG_RC_UNDOC: i64 = 1 |
| 34 | const DG_RC_UNMEASURED: i64 = 3 |
| 35 | const DG_RC_USAGE: i64 = 2 |
| 36 | const DG_MANY: i64 = 30 // token occurrences planted to exceed the printed-list bound |
functions
| 38 | func dg_wr(path: *u8, buf: *u8, n: i64) -> i64 |
| 45 | func dg_run(subj: *u8, a1: *u8, a2: *u8, out: *u8, cl: *i64) -> i64 |
| 54 | func main(argc: i64, argv: *i64) -> i64 |