nx_explore.nx
buildroot/runtime/nx_explore.nx
about
nx_explore.nx -- THE NISHI EXPLORE TEAM, RUNG R4 "MAP": query -> conclusion map. The SOVEREIGN
replacement for the third-party Explore *agent* (operator 2026-06-23: "dont launch an explore agent
build a nishi explore team capability from the hardware rung up each rung to be s class exceed").
What the Explore agent does: sweep many files, return the RELEVANT ones + a one-line role each --
a CONCLUSION, not a dump. This organ does exactly that, sovereignly: recursive getdents64 walk
(R0) + per-file content scan (R2), SYNTHESIZED to ONE ROW PER FILE: "path (Nx) <first-match line>".
That synthesis is the exceed over raw nx_codegrep (which dumps file:line per hit) AND over the
Explore agent (zero egress, no spend wall, deterministic) AND over ripgrep (completes where rg
timed out 4x @20s on this tree this session).
USE (dogfood): ./_offc/nx_explore.elf "<query>" -> live map over runtime/
SELF-GATE: run with NO args (the nx_sov_build_run path) -> self-test: a real symbol must map to
>=1 file AND a byte-built absent token must map to 0 (neg-control) -> EXPLORE-MAP-GATE GREEN/run-exit=0.
Composes nx_codegrep's proven walk; reuses sys_getdents64 + dirent_* from nx_syscalls. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 18 | const EX_MAGIC_65536: i64 = 65536 |
| 19 | const EX_MAGIC_1024: i64 = 1024 |
| 21 | const EX_FBUF: i64 = 4194304 // 4 MB per-file read buffer (reused across files, like nx_codegrep) |
| 22 | const EX_MAXDEPTH: i64 = 64 // JPL rule-2 bounded recursion ceiling |
functions
| 24 | func ex_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 25 | func ex_puts(s: *u8) -> i64 { sys_write(1, s, ex_strlen(s)); return 0 } |
| 30 | func ex_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 32 | func ex_find(buf: *u8, lo: i64, hi: i64, pat: *u8, pl: i64) -> i64 called by 1: ex_scan_file |
| 44 | func ex_ends_nx(name: *u8) -> i64 |
| 53 | func ex_is_dot(name: *u8) -> i64 called by 1: ex_map_dir |
| 58 | func ex_join(dirpath: *u8, name: *u8, out: *u8) -> i64 called by 1: ex_map_dir |
| 69 | func ex_scan_file(path: *u8, query: *u8, ql: i64, fbuf: *u8, outln: *u8, outcap: i64, out_len: *i64) -> i64 |
| 110 | func ex_map_dir(dirpath: *u8, query: *u8, ql: i64, fbuf: *u8, depth: i64) -> i64 called by 2: ex_map_direx_map calls 14: sys_openat_rdsys_mmapsys_getdents64dirent_reclendirent_typedirent_name+8 |
| 156 | func ex_map(root: *u8, query: *u8, ql: i64, fbuf: *u8) -> i64 |
| 160 | func main(argc: i64, argv: *i64) -> i64 |