code wiki / (root) / nx_refusal_shape_gate.nx

nx_refusal_shape_gate.nx

buildroot/runtime/nx_refusal_shape_gate.nx

29599 B476 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_refusal_shape_gate.nx -- THE REFEREE FOR FM11 (/compare/failmodes rung: fc_refusal_shape). THE ACCEPT RULE THIS GATE ENFORCES, QUOTED FROM failmodes.plan BEFORE THE WORK BEGAN: "run it over the estate's EXISTING refusal messages and publish the pass rate; it is accepted only if it PASSES the three known-correct guards (the nx_fs read truncation envelope, the build-admission refusal, the capability-denied mint recipe) AND FAILS a crafted refusal that names no remedy." * A SHAPE CHECKER THAT FLAGS A KNOWN-GOOD GUARD IS WORSE THAN NONE, BECAUSE SOMEONE WILL ACT ON IT. * The three known-good teeth below read the REAL production sources, not a fixture: a control drawn from the population under test is not a control, and a control drawn from a fixture proves only that the fixture was written to pass. FIXTURES ARE ASSEMBLED AT RUNTIME UNDER /tmp AND THEIR REFUSAL TEXT COMES FROM THE CONF. A source-scanning detector finds its own fixture and accuses its author first, so not one refusal marker is written as a literal in this file: the fixtures splice marker[0] and remedy[0] out of the loaded vocabulary. That also makes the fixtures track the conf -- a fixture whose vocabulary has drifted from the detector's is a test of nothing. Scratch lives in /tmp/nx_refusal_shape_gate/ because a gate that shares a fixture with a production path reports on the fixture, and every fixture is rewritten on every run because a gate that is not idempotent reports on its first run and lies about every run after. THE BASELINE IS DELETED AT SETUP so the self-baseline direction is genuinely exercised; the ratchet is bite-proven in THREE directions, because a ratchet that rewrites its baseline on a rise launders itself green and can never fire twice. license_tier: ORIGINAL module: nishi-core.quality.refusal_shape capability: REFUSAL_EMITTER_SHAPE_GATE

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_refusal_shape_lib.nx nx_refusal_shape_gate.nx

imports: nx_gate_verdict.nxnx_refusal_shape_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write 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 ↻ gk_mkdir sys_mkdir gk_cat gk_exists sys_openat_rd sys_close rs_conf_load sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ rs_err sys_write ↻ gk_eol rs_find_byte rs_range_eq gk_len

structs

none

consts

32const RSG_DIR: *u8 = "/tmp/nx_refusal_shape_gate/"
33const RSG_BUF: i64 = 262144
34const RSG_PATH: i64 = 4096
35const RSG_OUTC: i64 = 262144
36const RSG_MODE_0755: i64 = 493
40const RSG_GOOD: i64 = 0 // composed across two literals with a literal-free line between
41const RSG_NOREM: i64 = 1 // names a particular, names no remedy
42const RSG_BARE: i64 = 2 // names neither
43const RSG_NOTREF: i64 = 3 // carries no marker at all: NOT in the population
44const RSG_COMMENT: i64 = 4 // the marker exists ONLY inside a comment: NOT in the population
45const RSG_BRACE: i64 = 5 // a remedy sits past a closing brace and must NOT be borrowed
46const RSG_SHORT: i64 = 6 // too short to judge: UNKNOWN, and never an offender
47const RSG_TRAIL: i64 = 7 // a QUOTED refusal inside a TRAILING comment on a code line
48const RSG_TESTA: i64 = 8 // states BOTH outcomes at once: a gate tooth, not a refusal
49const RSG_USAGEB: i64 = 9 // a call-grammar banner: its own remedy

functions

51func rsg_join(dst: *u8, name: *u8) -> i64
called by 1: main calls 1: gk_cat
58func rsg_cat_voc(dst: *u8, o: i64, conf: *u8, voc: *i64, base: i64, idx: i64) -> i64
called by 1: rsg_fixture
70func rsg_fixture(path: *u8, conf: *u8, voc: *i64, kind: i64) -> i64
called by 1: main calls 3: gk_catrsg_cat_vocgk_write
148func rsg_scan1(path: *u8, conf: *u8, voc: *i64, want: *u8) -> *i64
158func rsg_show(label: *u8, res: *i64) -> i64
176func main(argc: i64, argv: *i64) -> i64