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