code wiki / _hdl_build / nx_ale_format_validate.nx

nx_ale_format_validate.nx

buildroot/runtime/_hdl_build/nx_ale_format_validate.nx

6215 B138 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic ale
docsdependenciesstructsconstsfunctions

about

nx_ale_format_validate.nx -- sovereign ALE-FORMAT triple validator (rungs ALE-R0a/R0b). Parses one task/grader/deployer triple file (contract|field|value lines) and ENFORCES the ale_format.spec contracts with NO mocks: (1) all 15 required fields present (5 task + 5 grader + 5 deployer); (2) grader score_range bound to [0,1] -- the value MUST be exactly "0..1" (lower-bound token 0 AND upper-bound token 1; anything else = out of range); (3) grader deterministic -- the value MUST be "yes" (a "no" = non-deterministic). ALE-R0b HARDENING (3 NEW semantic contracts as VALUES, grounded in the real rdi-berkeley/agents-last-exam@6b7f1b98 repo cross-check): (4) grader staged_reference_after -- value MUST be "yes" (reject LEAKAGE: the hidden reference must be staged AFTER the agent completes; lifecycle.py Phase 3 stage_reference proves the real ordering); (5) grader code_graded -- value MUST be "yes" (reject HUMAN-JUDGE: grading is the task's evaluate() code, never a human; a "no" breaks the measure); (6) the numeric [0,1] range -- ENFORCED by check (2) "0..1" (lower bound 0, upper bound 1); a value like "0..5" is rejected as out-of-range. Silent organ: argv[1] = triple path. exit 0 iff ALL checks pass, else exit 1. The refusal is REAL (a check that bites) -- the gate proves it on 5 tampered triples. Landmines respected: nested ifs (no &&/||), flat exprs, <=6 args/func, no empty string literal, strings authored via Write. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_ale_format_validate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_exit sys_mmap av_read sys_openat_rd sys_read sys_close av_has av_find_line av_len av_is_bol av_match av_val_is av_find_line ↻ av_len ↻ av_match ↻

structs

none

consts

22const K_MAGIC_262144: i64 = 262144

functions

25func av_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
40func av_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
43func av_match(buf: *u8, n: i64, pos: i64, pat: *u8, pl: i64) -> i64
54func av_is_bol(buf: *u8, pos: i64) -> i64
called by 1: av_find_line
61func av_find_line(buf: *u8, n: i64, prefix: *u8) -> i64
74func av_has(buf: *u8, n: i64, prefix: *u8) -> i64
called by 1: main calls 1: av_find_line
81func av_val_is(buf: *u8, n: i64, prefix: *u8, val: *u8) -> i64
called by 1: main calls 3: av_find_lineav_lenav_match
95func main(argc: i64, argv: *i64) -> i64