code wiki / _hdl_build / _ale_verify_gate.nx
_ale_verify_gate.nx
buildroot/runtime/_hdl_build/_ale_verify_gate.nx
about
_ale_verify_gate.nx -- the ALE-R2c gate: sovereign agent-core SELF-VERIFY phase organ.
Diff-lane / no-mocks: runs the REAL sovereign planner nx_ale_plan.elf + executor nx_ale_exec.elf
(both nx_cc_sovereign->nxasm_x86_main, NO gcc) to PRODUCE a real hello-kv-extract artifact, then
runs the REAL self-verify organ nx_ale_verify.elf and the REAL independent grader nx_ale_grade.elf
over the SAME (reference, artifact) pair, and asserts:
(1) HONEST-SELF-SCORE -- nx_ale_verify's self-score BYTE-EQUALS an independent nx_ale_grade
run on the same (reference, artifact); on the GOOD artifact == 1000
(2) WRONG-ARTIFACT-<1000 -- a corrupted artifact (one unit| line dropped) self-scores < 1000
AND that self-score BYTE-EQUALS the independent grade of the bad art
(3) NO-LEAKAGE -- self-score is BYTE-IDENTICAL whether or not a decoy reference.txt is
planted in the sandbox (verify resolves the ref ONLY from the spec)
(4) DETERMINISTIC -- two nx_ale_verify runs on the same (task, artifact) -> byte-identical
milli-score scoreout files
(5) TAMPER REJECTED -- a degenerate/empty artifact self-scores 0 (negative control: the
self-verify is not vacuously green)
Evidence -> knowledge/status/ale_verify.log (ALEVERIFYGATE row; the queue row's ||MARK= reads it).
Sovereign orchestration (fork/dup3/execve/wait4 + mkdirat). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| none |
functions
| 20 | func g_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 21 | func g_fp(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 22 | func g_fn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m }; let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48; k = 1 }; while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }; var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 }; sys_write(fd, bb, k); return 0 } |
| 25 | func g_run_plan(task: *u8, planout: *u8) -> i64 |
| 46 | func g_run_exec(plan: *u8, task: *u8, sandbox: *u8) -> i64 |
| 68 | func g_run_verify(task: *u8, art: *u8, scoreout: *u8) -> i64 |
| 90 | func g_run_grade(ref: *u8, art: *u8, scoreout: *u8) -> i64 |
| 112 | func g_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 126 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 129 | func g_files_eq(pa: *u8, pb: *u8) -> i64 |
| 142 | func g_score_of(path: *u8) -> i64 |
| 155 | func g_write_file(path: *u8, buf: *u8, n: i64) -> i64 |
| 166 | func g_drop_line(buf: *u8, n: i64, skippref: *u8, out: *u8) -> i64 |
| 203 | func main() -> i64 |