code wiki / (root) / nx_corpus_to_meta.nx

nx_corpus_to_meta.nx

buildroot/runtime/nx_corpus_to_meta.nx

6956 B203 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic corpus
docsdependenciesstructsconstsfunctions

about

nx_corpus_to_meta.nx -- compact-corpus -> meta.json minter. Reads specs/algo_corpus.txt (one primitive per line, pipe-separated KV pairs) and emits specs/algo_registry/<name>/meta.json for each. Removes the last manual authoring layer beyond shape-design. Line format (TAB-separated): <name><TAB><nx_module><TAB><shape><TAB><summary><TAB><KEY>=<VALUE><TAB><KEY>=<VALUE><TAB>... First 4 fields are positional: name, nx_module, shape, summary_plain. Remaining fields are KEY=VALUE pairs that become template_params. TAB is the separator (not `|`) because `|` collides with the bitwise-OR operator used inside body code. genealogy_id: substrate_corpus_minter_2026_05_14 lineage_id: compact_format_codegen license: public_domain

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_fcntl.nx nx_corpus_to_meta.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_fcntl.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_write strlen emit_meta_from_line sys_mmap ↻ find_char copy_slice corp_mkdir nx_open_wr nx_openat write_str_corp sys_write ↻ strlen ↻ sys_close ↻ print_i64 sys_mmap ↻ itoa sys_mmap ↻ sys_write ↻

structs

none

consts

30const STDOUT: i64 = 1
31const NX_CORPUS_PATH_BUF: nx_size = 512
32const NX_CORPUS_FIELD_CAP: nx_size = 1024

functions

34func write_str_corp(fd: i64, s: *u8) -> nx_int
called by 1: emit_meta_from_line calls 2: sys_writestrlen
41func corp_mkdir(path: *u8) -> nx_int
called by 1: emit_meta_from_line
47func find_char(buf: *u8, start: nx_idx, end: nx_idx, c: nx_int) -> nx_idx
called by 1: emit_meta_from_line
57func copy_slice(buf: *u8, lo: nx_idx, hi: nx_idx, out: *u8) -> nx_size
called by 1: emit_meta_from_line
69func emit_meta_from_line(buf: *u8, line_lo: nx_idx, line_hi: nx_idx) -> nx_int
169func main() -> i64