code wiki / _attic / _offc_loop_smoke.nx

_offc_loop_smoke.nx source

↩ module page · 32 lines · 1320 B

1// Closed-loop smoke test: simulate a run that emits architect + 2// author + editor audits, persists to the learnings ledger, then 3// loads the priors so the next run sees them. Two passes through 4// this binary populate two rows; bench/nx_loop_diff.sh shows the 5// trend. 6 7import "syscalls.nx" 8import "nx_narr.nx" 9 10func main() -> i64 { 11 // 0. Load priors first (architect remembers). 12 narr_loop_load_priors("bench/editor_learnings.jsonl" as *u8) 13 14 // 1. Pretend a tiny build happened. Phase + ledger work. 15 narr_perf_phase_begin("loop_lex" as *u8) 16 narr_ledger_birth("loop_smoke" as *u8, LK_TOKEN, 1, "loop.nx:14" as *u8) 17 narr_ledger_birth("loop_smoke" as *u8, LK_TOKEN, 2, "loop.nx:15" as *u8) 18 narr_ledger_death("loop_smoke" as *u8, LK_TOKEN, 2, "loop.nx:16" as *u8) 19 narr_ledger_death("loop_smoke" as *u8, LK_TOKEN, 1, "loop.nx:17" as *u8) 20 narr_perf_phase_end("loop_lex" as *u8, 2) 21 22 // 2. Architect summary: pretend we walked the module. 23 narr_architect_audit(50, 5, 12, 1500, 90, 1, 0, 8) 24 25 // 3. Author summary: same. 26 narr_author_audit(120, 60, 200, 7, 3, 1, 4, 50) 27 28 // 4. Editor closes: audit + advise + persist for tomorrow. 29 narr_emit_epilogue() 30 narr_loop_persist("bench/editor_learnings.jsonl" as *u8) 31 return 0 32}