nx_refusal_shape_gate.nx
buildroot/runtime/nx_refusal_shape_gate.nx
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
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
structs
| none |
consts
| 32 | const RSG_DIR: *u8 = "/tmp/nx_refusal_shape_gate/" |
| 33 | const RSG_BUF: i64 = 262144 |
| 34 | const RSG_PATH: i64 = 4096 |
| 35 | const RSG_OUTC: i64 = 262144 |
| 36 | const RSG_MODE_0755: i64 = 493 |
| 40 | const RSG_GOOD: i64 = 0 // composed across two literals with a literal-free line between |
| 41 | const RSG_NOREM: i64 = 1 // names a particular, names no remedy |
| 42 | const RSG_BARE: i64 = 2 // names neither |
| 43 | const RSG_NOTREF: i64 = 3 // carries no marker at all: NOT in the population |
| 44 | const RSG_COMMENT: i64 = 4 // the marker exists ONLY inside a comment: NOT in the population |
| 45 | const RSG_BRACE: i64 = 5 // a remedy sits past a closing brace and must NOT be borrowed |
| 46 | const RSG_SHORT: i64 = 6 // too short to judge: UNKNOWN, and never an offender |
| 47 | const RSG_TRAIL: i64 = 7 // a QUOTED refusal inside a TRAILING comment on a code line |
| 48 | const RSG_TESTA: i64 = 8 // states BOTH outcomes at once: a gate tooth, not a refusal |
| 49 | const RSG_USAGEB: i64 = 9 // a call-grammar banner: its own remedy |
functions
| 51 | func rsg_join(dst: *u8, name: *u8) -> i64 |
| 58 | func rsg_cat_voc(dst: *u8, o: i64, conf: *u8, voc: *i64, base: i64, idx: i64) -> i64 called by 1: rsg_fixture |
| 70 | func rsg_fixture(path: *u8, conf: *u8, voc: *i64, kind: i64) -> i64 |
| 148 | func rsg_scan1(path: *u8, conf: *u8, voc: *i64, want: *u8) -> *i64 |
| 158 | func rsg_show(label: *u8, res: *i64) -> i64 |
| 176 | func main(argc: i64, argv: *i64) -> i64 |