code wiki / _hdl_build / nx_ale_real_readfile.nx
nx_ale_real_readfile.nx
buildroot/runtime/_hdl_build/nx_ale_real_readfile.nx
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
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
| 16 | const AR_MAGIC_65536: i64 = 65536 |
| 18 | const AR_MAT: *u8 = "/tmp/_alereal_materials" |
| 19 | const AR_SB: *u8 = "/tmp/_alereal_sb" |
| 20 | const AR_OUT: *u8 = "/tmp/_alereal_out" |
| 21 | const AR_TASK: *u8 = "/tmp/_alereal_task.txt" |
| 22 | const AR_SECRET: *u8 = "/tmp/_alereal_materials/secret.txt" |
| 23 | const AR_ANSWER: *u8 = "/tmp/_alereal_sb/answer.txt" |
| 24 | const AR_SPEC: *u8 = "task|materials_dir|/tmp/_alereal_materials\ntask|input_stage|secret.txt\ntask|instruction|copy_verbatim\ntask|artifact_path|answer.txt\n" |
| 25 | const AR_SECVAL: *u8 = "ALE-SECRET-a1b2c3d4-END\n" |
functions
| 27 | func 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 } |
| 28 | func 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 } |
| 29 | func ar_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 30 | func ar_unlink(path: *u8) -> i64 { return __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) } |
| 32 | func ar_write_file(path: *u8, buf: *u8, n: i64) -> i64 |
| 41 | func ar_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 55 | func ar_contains(buf: *u8, n: i64, needle: *u8) -> i64 called by 1: main |
| 69 | func ar_run_agent(task: *u8, sandbox: *u8, outdir: *u8) -> i64 |
| 90 | func main() -> i64 |