code wiki / _hdl_build / _ale_agent_gate.nx

_ale_agent_gate.nx

buildroot/runtime/_hdl_build/_ale_agent_gate.nx

16428 B376 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic ale
docsdependenciesstructsconstsfunctions

about

_ale_agent_gate.nx -- the ALE-R2d gate: sovereign agent-core SUBMIT/compose entrypoint. Diff-lane / no-mocks: drives the REAL composed entrypoint nx_ale_agent.elf (which itself fork/execves the REAL sovereign phase organs nx_ale_plan.elf -> nx_ale_exec.elf -> nx_ale_verify.elf, all nx_cc_sovereign->nxasm_x86_main, NO gcc) on the existing fixture knowledge/specs/ale_exec_examples/task_exec.txt, and asserts ALL GREEN: (1) ONE-ENTRYPOINT -- nx_ale_agent.elf <task> <sandbox> <outdir> runs the full PLAN->EXECUTE->SELF-VERIFY pipeline in ONE invocation and exits 0. (2) REAL-ARTIFACT -- a real result.units lands under the sandbox, BYTE-IDENTICAL to the artifact produced by the STANDALONE plan->exec path (no mocks). (3) HONEST-SELF-SCORE -- outdir/self_score BYTE-EQUALS an INDEPENDENT nx_ale_grade run on the same (reference, artifact) AND == 1000 (the agent does not lie). (4) NO-LEAKAGE-ORDER -- planting a decoy reference.txt in the sandbox does NOT change the artifact or the self_score (agent never reads the reference during plan/exec; only SELF-VERIFY resolves it, from the spec, post-run). (5) DETERMINISTIC -- two runs on the same (task, fresh sandbox, fresh outdir) yield byte-identical {plan, artifact, self_score} triples. (6) TAMPER/NEG-CONTROL -- a task spec MISSING a required field makes nx_ale_agent REFUSE (non-zero exit, NO artifact, NO self_score) -> not vacuously green. Evidence -> knowledge/status/ale_agent.log (ALEAGENTGATE row; the queue row's ||MARK= reads it). Sovereign orchestration (fork/dup3/execve/wait4 + mkdirat). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _ale_agent_gate.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 g_p sys_write sys_mkdir g_run_agent sys_fork sys_openat_wr sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 g_run_plan sys_fork ↻ sys_openat_wr ↻ sys_dup3 ↻ sys_mmap ↻ sys_execve ↻ sys_exit ↻ sys_wait4 ↻ g_run_exec sys_fork ↻ sys_openat_wr ↻ sys_dup3 ↻ sys_mmap ↻ sys_execve ↻ sys_exit ↻ sys_wait4 ↻ g_exists sys_openat_rd sys_close g_files_eq sys_mmap ↻ g_read sys_openat_rd ↻ sys_read sys_close ↻ g_run_grade sys_fork ↻ sys_openat_wr ↻

structs

none

consts

none

functions

23func 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 }
called by 1: main calls 1: sys_write
24func 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 }
called by 1: main calls 1: sys_write
25func 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 }
called by 1: main calls 2: sys_mmapsys_write
28func g_run_agent(task: *u8, sandbox: *u8, outdir: *u8) -> i64
50func g_run_plan(task: *u8, planout: *u8) -> i64
71func g_run_exec(plan: *u8, task: *u8, sandbox: *u8) -> i64
93func g_run_grade(ref: *u8, art: *u8, scoreout: *u8) -> i64
115func g_read(path: *u8, buf: *u8, cap: i64) -> i64
129func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: g_drop_linemain
132func g_exists(path: *u8) -> i64
called by 1: main calls 2: sys_openat_rdsys_close
140func g_files_eq(pa: *u8, pb: *u8) -> i64
called by 1: main calls 2: sys_mmapg_read
153func g_score_of(path: *u8) -> i64
called by 1: main calls 2: sys_mmapg_read
166func g_write_file(path: *u8, buf: *u8, n: i64) -> i64
176func g_drop_line(buf: *u8, n: i64, skippref: *u8, out: *u8) -> i64
called by 1: main calls 1: g_len
212func main() -> i64