nx_forge_engine_run.nx source
↩ module page · 47 lines · 1681 B
1// nx_forge_engine_run.nx -- CLI for the assembled autonomous-coding engine (nx_forge_engine).
2// argv: <organ> <taskfile> <expectfile> <packfile> <port> <maxcycles> <maxnew> <chat> <nsamples> <temp_pm>
3// Exit 0 iff GREEN (either stage). The ONE command that turns a task into judged NishiLang code.
4// license_tier: ORIGINAL
5import "nx_forge_engine.nx"
6
7func main(argc: i64, argv: *i64) -> i64 {
8 if argc < 11 {
9 std_putln("usage: nx_forge_engine_run <organ> <taskfile> <expectfile> <packfile> <port> <maxcycles> <maxnew> <chat> <nsamples> <temp_pm>" as *u8)
10 sys_exit(2)
11 return 2
12 }
13 let a1: i64 = argv[1]
14 let organ: *u8 = a1 as *u8
15 let a2: i64 = argv[2]
16 let taskf: *u8 = a2 as *u8
17 let a3: i64 = argv[3]
18 let expf: *u8 = a3 as *u8
19 let a4: i64 = argv[4]
20 let packf: *u8 = a4 as *u8
21 let a5: i64 = argv[5]
22 let p5: *u8 = a5 as *u8
23 let port: i64 = std_atoi(p5)
24 let a6: i64 = argv[6]
25 let p6: *u8 = a6 as *u8
26 let maxc: i64 = std_atoi(p6)
27 let a7: i64 = argv[7]
28 let p7: *u8 = a7 as *u8
29 let maxnew: i64 = std_atoi(p7)
30 let a8: i64 = argv[8]
31 let p8: *u8 = a8 as *u8
32 let chat: i64 = std_atoi(p8)
33 let a9: i64 = argv[9]
34 let p9: *u8 = a9 as *u8
35 let nsamples: i64 = std_atoi(p9)
36 let a10: i64 = argv[10]
37 let p10: *u8 = a10 as *u8
38 let temp_pm: i64 = std_atoi(p10)
39 let rc: i64 = fe_run(organ, taskf, expf, packf, port, maxc, maxnew, chat, nsamples, temp_pm)
40 std_puts("FORGE-ENGINE rc=" as *u8)
41 std_pdec(rc)
42 if rc > 0 { std_putln(" GREEN" as *u8) }
43 if rc <= 0 { std_putln(" RED" as *u8) }
44 if rc > 0 { sys_exit(0) }
45 sys_exit(1)
46 return 1
47}