code wiki / _hdl_build / _ale_plan_gate.nx

_ale_plan_gate.nx

buildroot/runtime/_hdl_build/_ale_plan_gate.nx

15201 B369 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic ale
docsdependenciesstructsconstsfunctions

about

_ale_plan_gate.nx -- the ALE-R2a gate: sovereign agent-core PLAN-phase organ. Diff-lane / no-mocks: runs the REAL sovereign planner nx_ale_plan.elf (built by nx_cc_sovereign->nxasm_x86_main, NO gcc) over REAL ALE-format task fixtures and asserts: (1) INGEST -- over task_good the organ emits a PLAN file of ordered "step|<n>|<verb>|<arg>" lines (>=3 step lines, all step|-prefixed) (2) ORDERED -- the emitted step numbers are exactly 1,2,3 contiguous (no gaps) (3) GROUNDED -- every step's <arg> equals a task field VALUE present in the spec (each plan arg appears in the task spec as a "task|<field>|<arg>" value-tail line -> no step references a field the spec didn't declare) (4) ARTIFACT-TERMINAL -- the FINAL step is write_artifact and its <arg> is the task's declared artifact_path value (the plan aims at the scored deliverable) (5) DETERMINISTIC -- two consecutive runs on the SAME spec emit BYTE-IDENTICAL plans (6) TAMPER REJECTED -- over task_missing_artifact (no artifact_path) the organ REFUSES: child exits NON-ZERO and writes NO plan (the grounding check bites, negative control mirroring the nondet-stub tamper in _ale_grade_gate) Evidence -> knowledge/status/ale_plan.log (ALEPLANGATE row; the queue row's ||MARK= reads it). Sovereign orchestration (fork/dup3/execve/wait4). The planner's purity (no clock/rand) IS the oracle: a pure grounded decomposer needs no external oracle, exactly as ALE-R1a established. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _ale_plan_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 g_run_plan sys_fork sys_openat_wr sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 sys_mmap ↻ g_read sys_openat_rd sys_read sys_close g_count_prefix g_len g_is_bol g_match g_step_num_present sys_mmap ↻ g_is_bol ↻ g_match ↻ g_step_arg sys_mmap ↻ g_is_bol ↻ g_match ↻ g_arg_in_task g_len ↻ g_is_bol ↻ g_match ↻ g_is_bol ↻ g_match ↻ g_files_eq sys_mmap ↻ g_read ↻ g_fn sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

22func 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
23func 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
24func 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
27func g_run_plan(task: *u8, planout: *u8) -> i64
48func g_read(path: *u8, buf: *u8, cap: i64) -> i64
62func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
65func g_match(buf: *u8, n: i64, pos: i64, pat: *u8, pl: i64) -> i64
73func g_is_bol(buf: *u8, pos: i64) -> i64
80func g_count_prefix(buf: *u8, n: i64, prefix: *u8) -> i64
called by 1: main calls 3: g_leng_is_bolg_match
94func g_files_eq(pa: *u8, pb: *u8) -> i64
called by 1: main calls 2: sys_mmapg_read
109func g_step_num_present(buf: *u8, n: i64, num: i64) -> i64
called by 1: main calls 3: sys_mmapg_is_bolg_match
142func g_step_arg(buf: *u8, n: i64, num: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_mmapg_is_bolg_match
193func g_arg_in_task(tbuf: *u8, tn: i64, arg: *u8) -> i64
called by 1: main calls 3: g_leng_is_bolg_match
222func main() -> i64