nx_agent_ops_census.nx source
↩ module page · 58 lines · 6055 B
1// nx_agent_ops_census.nx -- HONEST measure of whether the AGENT can do its work via SOVEREIGN Nishi APIs instead of
2// 3rd-party shell (pkill / Invoke-WebRequest / Remove-Item / curl). For each operational capability: HAVE iff a clean
3// sovereign organ actually opens on disk (no-false-green, auditor discipline); GAP = a capability the TEAM must build.
4// permille = have*1000/total. Goal = 1000 (everything via API, zero shell). This is the gap-list the autonomous
5// builder + genesis_lineage/raci own. license_tier: ORIGINAL
6import "nx_gate.nx"
7
8func ax_have(path: *u8) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0 { return 0 } sys_close(fd); return 1 }
9func ax(label: *u8, path: *u8, note: *u8) -> i64 {
10 let h: i64=ax_have(path)
11 if h==1 { gw(" [HAVE] " as *u8) } else { gw(" [GAP ] " as *u8) }
12 gw(label); gw(" -> " as *u8); gw(note); gw("\n" as *u8)
13 return h
14}
15
16func main() -> i64 {
17 gw("=== nx_agent_ops_census: can the agent operate via SOVEREIGN API (no 3rd-party shell)? ===\n\n" as *u8)
18 var have: i64=0; var tot: i64=0
19
20 have=have+ax("http GET / probe " as *u8, "runtime/nx_http_probe.nx" as *u8, "retires Invoke-WebRequest (GET+status+assert)" as *u8); tot=tot+1
21 have=have+ax("http client (GET/POST) " as *u8, "runtime/nx_http_client.nx" as *u8, "request builder + TCP connect + read-to-EOF" as *u8); tot=tot+1
22 have=have+ax("TLS fetch (external) " as *u8, "runtime/nx_https_fetch.nx" as *u8, "retires curl for https" as *u8); tot=tot+1
23 have=have+ax("sovereign data store " as *u8, "runtime/nx_seg_store.nx" as *u8, "retires sqlite / loose TSV files" as *u8); tot=tot+1
24 have=have+ax("process fork/exec/wait " as *u8, "runtime/nx_proc.nx" as *u8, "spawn + reap children" as *u8); tot=tot+1
25 have=have+ax("service mgmt (NAS) " as *u8, "runtime/_hdl_build/nx_hostctl.nx" as *u8, "supervise/restart KNOWN services" as *u8); tot=tot+1
26 have=have+ax("build toolchain " as *u8, "_offc/nx_sov_build_run.elf" as *u8, "nx_cc->nxasm sovereign compile" as *u8); tot=tot+1
27 have=have+ax("canonical gate I/O " as *u8, "runtime/nx_gate.nx" as *u8, "one gw/gn/gwb (retired 23 copies)" as *u8); tot=tot+1
28 have=have+ax("tab-record parse/build " as *u8, "runtime/nx_tabrec.nx" as *u8, "one field parser (retired 4 copies)" as *u8); tot=tot+1
29
30 have=have+ax("proc-kill (full-cmdline)" as *u8, "runtime/nx_proc_ctl.nx" as *u8, "retires pkill (canonical lib, gate 5/5, fixed comm-truncation)" as *u8); tot=tot+1
31 have=have+ax("daemon-run (detach) " as *u8, "runtime/nx_daemon.nx" as *u8, "retires harness run_in_background (fork+setsid+execve, gate 3/3)" as *u8); tot=tot+1
32 have=have+ax("file op (rm/mv/exists) " as *u8, "runtime/nx_fileop.nx" as *u8, "retires Remove-Item (nx_fio lib + CLI, gate 3/3)" as *u8); tot=tot+1
33 have=have+ax("http POST probe " as *u8, "runtime/nx_http_post.nx" as *u8, "retires Invoke-WebRequest POST (nx_http_post + gate 2/2 proven live)" as *u8); tot=tot+1
34 have=have+ax("supervise / restart " as *u8, "runtime/nx_runsv.nx" as *u8, "s6-style runsv, DECLARATIVE (supervise BY NAME from nx_svcreg registry)+health+backoff; LIVE-supervising archive-server:8080" as *u8); tot=tot+1
35
36 // ---- SOTA-bar axes (knowledge/research/2026-06-30-agentops-sota-bar.md): MCP primitives + governance + sovereignty ----
37 gw("\n -- vs 2026 SOTA bar (MCP / AARM control plane / agent tool surface) --\n" as *u8)
38 have=have+ax("tool registry/discovery" as *u8, "runtime/nx_tool_registry.nx" as *u8, "MCP Tools parity: register+discover on seg_store (nx_registry, gate 3/3)" as *u8); tot=tot+1
39 have=have+ax("resource protocol " as *u8, "runtime/nx_resource.nx" as *u8, "MCP Resources parity: register+discover+read on seg_store (gate 3/3)" as *u8); tot=tot+1
40 have=have+ax("async tasks (dispatch+poll)" as *u8, "runtime/nx_task.nx" as *u8, "MCP Tasks parity: dispatch+poll+result on seg_store (gate 5/5)" as *u8); tot=tot+1
41 have=have+ax("runtime action policy " as *u8, "runtime/_hdl_build/nx_mgmt_api.nx" as *u8, "fail-closed allowlists + confirm-gates (AARM-style)" as *u8); tot=tot+1
42 have=have+ax("audit trail (contest.) " as *u8, "runtime/nx_blocklist_audit.nx" as *u8, "every action justified + contestable (seg_store history)" as *u8); tot=tot+1
43 have=have+ax("observability / SLO " as *u8, "runtime/nx_slo.nx" as *u8, "SLO computer: availability/budget/latency-pctl/verdict (gate 5/5)" as *u8); tot=tot+1
44 have=have+ax("multi-agent orchestrate" as *u8, "runtime/_hdl_build/nx_conductor_registry.nx" as *u8, "sovereign GOVERNED orchestration: registered+RACI-owned+admission-gated pulse fire (nx_conductor+registry+pulse suite, LIVE) -- was a FALSE-GAP (census had the wrong path)" as *u8); tot=tot+1
45 have=have+ax("sovereign isolation " as *u8, "runtime/nx_seg_store.nx" as *u8, "EXCEED: zero external dependency by construction" as *u8); tot=tot+1
46 have=have+ax("no-false-green auditor " as *u8, "runtime/nx_agent_ops_census.nx" as *u8, "EXCEED: grades QUALITY not presence (caught the proc-kill comm-bug)" as *u8); tot=tot+1
47
48 let permille: i64=have*1000/tot
49 gw("\n=== agent-ops sovereignty vs SOTA bar: " as *u8); gn(have); gw("/" as *u8); gn(tot); gw(" HAVE = " as *u8); gn(permille); gw(" permille ===\n" as *u8)
50 gw("0 GAPS: a sovereign organ exists for every axis. (multi-agent was a FALSE-GAP -- census pointed at nx_agent_conductor.nx; the real nx_conductor+registry+pulse suite is LIVE.)\n" as *u8)
51 if permille >= 1000 {
52 gw("AGENT-OPS GREEN -- a sovereign organ for EVERY axis; zero 3rd-party shell needed.\n" as *u8)
53 gw(" HONEST: this grades COVERAGE (organ exists). Per-organ QUALITY is the ongoing ratchet -- the auditor caught a false-GREEN (proc-kill comm-bug) AND a false-GAP (multi-agent wrong path) this arc; existence != full-correctness.\n" as *u8)
54 sys_exit(0); return 0
55 }
56 gw("AGENT-OPS HONEST -- rich ecosystem, real gaps; NOT yet zero-shell (do not claim s-class until 1000)\n" as *u8)
57 sys_exit(0); return 0
58}