code wiki / _hdl_build / nx_anticheat.nx

nx_anticheat.nx source

↩ module page · 25 lines · 1776 B

1// nx_anticheat.nx -- in PARTNERSHIP WITH THE REFEREE, refuse cheating: a grade is valid ONLY if every input 2// is a REAL MEASUREMENT of the actual sovereign artifact (not a number Claude typed), AND the artifact is 3// NishiLang bits-up (non-sovereign deps like gcc/bash are flagged as gaps to retire) (operator: "make sure 4// that no cheating happens where the input is non nishi lang... using nishi ecosystem from the bits up and 5// flagging the gaps to improve themselves... iterating and iterating"). license_tier: ORIGINAL The Referee 6// REJECTS a fabricated grade -- this is what makes the andelinwest race honest. 7 8import "nx_syscalls.nx" 9 10const AC_VALID: i64 = 1 11const AC_FABRICATED: i64 = 0 12 13// a grade INPUT is legitimate only if it was MEASURED from the real artifact (measured=1), not typed. 14func ac_measurement_backed(measured: i64) -> i64 { if measured == 1 { return 1 } return 0 } 15 16// the Referee's anti-cheat verdict: a grade is VALID only if ALL inputs are measured (zero fabricated). 17func ac_grade_valid(n_inputs: i64, n_measured: i64) -> i64 { if n_measured == n_inputs { return 1 } return 0 } 18func ac_fabricated_count(n_inputs: i64, n_measured: i64) -> i64 { return n_inputs - n_measured } 19 20// SOVEREIGNTY (bits-up): count the non-NishiLang deps still in the build path -- the cheating to flag + retire. 21func ac_sovereignty_gaps(gcc_used: i64, bash_used: i64) -> i64 { return gcc_used + bash_used } 22// fully bits-up sovereign iff the emitter is NishiLang AND no non-sovereign deps remain. 23func ac_bits_up_sovereign(emitter_nishi: i64, gaps: i64) -> i64 { if emitter_nishi == 1 { if gaps == 0 { return 1 } } return 0 } 24 25func ac_verdict_label(v: i64) -> *u8 { if v == AC_VALID { return "VALID(measured)" as *u8 } return "REJECTED(fabricated)" as *u8 }