code wiki / _hdl_build / nx_assign_gen_register.nx
nx_assign_gen_register.nx source
↩ module page · 46 lines · 2750 B
1// nx_assign_gen_register.nx -- GOVERNED registration of the research->spec->assignments pipeline.
2// Engineer gate = REAL re-run of /tmp/nx_assign_gen_test.sov.elf (6/6). license_tier: ORIGINAL
3import "nx_cap_register.nx"
4import "nx_syscalls.nx"
5
6const AR_IDX: i64 = 221
7const AR_LAYER: i64 = 5 // SELF -- the team writing its own backlog (self-build planning)
8const AR_NLAYERS: i64 = 6
9
10func ar_run_status(path: *u8) -> i64 {
11 let pid: i64 = sys_fork()
12 if pid == 0 {
13 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4)
14 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) }
15 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0
16 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0
17 sys_execve(path, argv, envp); sys_exit(127)
18 }
19 let st: *i64 = sys_mmap(16) as *i64
20 sys_wait4(pid, st, 0)
21 return st[0]
22}
23
24func main() -> i64 {
25 let elf: *u8 = "/tmp/nx_assign_gen_test.sov.elf" as *u8
26 let probe: i64 = sys_openat_rd(elf)
27 var present: i64 = 0
28 if probe >= 0 { present = 1; sys_close(probe) }
29 let raw: i64 = ar_run_status(elf)
30 var ran_no_signal: i64 = 0
31 if (raw % 128) == 0 { ran_no_signal = 1 }
32 var exit_ok: i64 = 0
33 if raw == 0 { exit_ok = 1 }
34 let eng: i64 = ig_engineer(present, present, ran_no_signal, exit_ok)
35 cr_w(1, "ENGINEER: assign-gen gate raw=" as *u8); cr_wn(1, raw); cr_w(1, " (0=6/6)\n" as *u8)
36 let council: i64 = ig_council(eng, 1, 1, 2)
37 let decision: i64 = ig_decision(eng, council, 1)
38 if decision != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) }
39 if cr_can_register(AR_LAYER, 2, AR_NLAYERS, decision) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) }
40 let fd: i64 = sys_openat_append("/tmp/nishi_cap_registry.log" as *u8, 0x1a4)
41 cr_write_entry(fd, AR_IDX, AR_LAYER, "SELF ASSIGN-GEN -- the research->spec->ASSIGNMENTS pipeline (the team writes its own backlog, the part Claude wrote by hand). Takes researcher ADMITTED facts -> emits assignments {layer,action,gate,depends-on,grounded-by}, ordered by ss_build_rank (charter ladder hardware-up), GAP-flagged (0-evidence -> PURSUE raised-hand, never fabricated into a build), build-order MONOTONIC (forward-dep rejected). S-class exceed vs hand-written backlog: every BUILD assignment GROUNDED in >=1 corroborated fact (traceability the hand plan lacks) + REPRODUCIBLE + gaps surfaced; ag_spec_gate REJECTS a thin-air plan. PROVEN by generating the Arc D chip-fab backlog from the chipfab facts: 4 builds rank-ordered + 2 raised hands, 666 permil grounded. 6/6 KATs. Composes nx_spec_layers" as *u8, 2)
42 sys_close(fd)
43 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, AR_IDX); cr_w(1, " REGISTERED\n" as *u8)
44 sys_exit(0)
45 return 0
46}