code wiki / (root) / nx_forge_loop_run.nx

nx_forge_loop_run.nx source

↩ module page · 42 lines · 1535 B

1// nx_forge_loop_run.nx -- CLI for the A1 closed maker-checker loop (nx_forge_loop core). 2// argv: <organ> <taskfile> <expectfile> <packfile> <port> <maxcycles> <maxnew> <chat> 3// The task FILE carries the task instruction + the output-contract line (the measured L4 arm 4// shape); the serve at 127.0.0.1:<port> is the maker (0.5B :8033 contract; 1.5B = its own seat). 5// Exit 0 iff GREEN. license_tier: ORIGINAL 6import "nx_forge_loop.nx" 7 8func main(argc: i64, argv: *i64) -> i64 { 9 if argc < 9 { 10 std_putln("usage: nx_forge_loop_run <organ> <taskfile> <expectfile> <packfile> <port> <maxcycles> <maxnew> <chat>" as *u8) 11 sys_exit(2) 12 return 2 13 } 14 let a1: i64 = argv[1] 15 let organ: *u8 = a1 as *u8 16 let a2: i64 = argv[2] 17 let taskf: *u8 = a2 as *u8 18 let a3: i64 = argv[3] 19 let expf: *u8 = a3 as *u8 20 let a4: i64 = argv[4] 21 let packf: *u8 = a4 as *u8 22 let a5: i64 = argv[5] 23 let p5: *u8 = a5 as *u8 24 let port: i64 = std_atoi(p5) 25 let a6: i64 = argv[6] 26 let p6: *u8 = a6 as *u8 27 let maxc: i64 = std_atoi(p6) 28 let a7: i64 = argv[7] 29 let p7: *u8 = a7 as *u8 30 let maxnew: i64 = std_atoi(p7) 31 let a8: i64 = argv[8] 32 let p8: *u8 = a8 as *u8 33 let chat: i64 = std_atoi(p8) 34 let rc: i64 = flp_run(organ, taskf, expf, packf, port, maxc, maxnew, chat) 35 std_puts("FORGE-LOOP rc=" as *u8) 36 std_pdec(rc) 37 if rc > 0 { std_putln(" GREEN" as *u8) } 38 if rc <= 0 { std_putln(" RED" as *u8) } 39 if rc > 0 { sys_exit(0) } 40 sys_exit(1) 41 return 1 42}