code wiki / _hdl_build / nx_ale_real_readfile.nx

nx_ale_real_readfile.nx

buildroot/runtime/_hdl_build/nx_ale_real_readfile.nx

6554 B137 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic ale
docsdependenciesstructsconstsfunctions

about

nx_ale_real_readfile.nx -- ALE-R6 FIRST HONEST SLICE: attempt ONE real self-contained ALE task (demo/readfile_secret from .alelane/ale-repo, taskId verified) end-to-end with the REAL sovereign agent-core, scored by the REAL task's grader semantics. NO exceed claim, NO leaderboard claim -- this converts the prior "0.0 plan-only-no-artifact" into a real artifact + an honest measured score on one real task. The real task: read input/secret.txt (a token), write the EXACT token to output/answer.txt; grader = (token in answer.txt) -> 1.0 else 0.0 (substring, content-forwarding). INGEST: stage a token into materials/secret.txt + emit the sovereign task spec mapping the task to the copy_verbatim transform (identity: artifact == staged bytes = the token). ATTEMPT: fork the REAL _offc/nx_ale_agent.elf (PLAN nx_ale_plan -> EXECUTE nx_ale_exec -> VERIFY) -- the team's organs produce the artifact, not this harness. GRADE: the REAL grader semantics (token substring in the agent's answer.txt). Controls: real_pass (agent produced the token) + discriminates (a DECOY token is NOT present -> grader is non-vacuous). Honest scope: ONE demo task (simplest real one); leaderboard subset + exceed = later rungs. Sovereign (nx_cc->nxasm_x86, no gcc). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_ale_real_readfile.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_mkdir ar_write_file ar_unlink sys_openat_wr sys_write sys_close ar_len ar_unlink ↻ ar_run_agent sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 sys_mmap ↻ ar_read sys_openat_rd sys_read sys_close ↻ ar_contains ar_puts sys_write ↻ ar_fn sys_mmap ↻ sys_write ↻

structs

none

consts

16const AR_MAGIC_65536: i64 = 65536
18const AR_MAT: *u8 = "/tmp/_alereal_materials"
19const AR_SB: *u8 = "/tmp/_alereal_sb"
20const AR_OUT: *u8 = "/tmp/_alereal_out"
21const AR_TASK: *u8 = "/tmp/_alereal_task.txt"
22const AR_SECRET: *u8 = "/tmp/_alereal_materials/secret.txt"
23const AR_ANSWER: *u8 = "/tmp/_alereal_sb/answer.txt"
24const AR_SPEC: *u8 = "task|materials_dir|/tmp/_alereal_materials\ntask|input_stage|secret.txt\ntask|instruction|copy_verbatim\ntask|artifact_path|answer.txt\n"
25const AR_SECVAL: *u8 = "ALE-SECRET-a1b2c3d4-END\n"

functions

27func ar_puts(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
28func ar_fn(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(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
29func ar_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
32func ar_write_file(path: *u8, buf: *u8, n: i64) -> i64
41func ar_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
55func ar_contains(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main
69func ar_run_agent(task: *u8, sandbox: *u8, outdir: *u8) -> i64
90func main() -> i64