code wiki / (root) / nx_research_ledger.nx

nx_research_ledger.nx

buildroot/runtime/nx_research_ledger.nx

29801 B262 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic research
docsdependenciesstructsconstsfunctions

about

nx_research_ledger.nx -- rung 1 of "build up the NISHI RESEARCHER to LEARN each rung" (operator standing order 2026-06-16). module: nishi-core.research.ledger capability: RESEARCH_MEMORY (the researcher compounds knowledge) The researcher (nx_onsite_research_fetch) does the FETCH leg; this is the LEARNING leg: a durable, append-only ledger of what each cliff taught us {topic :: cliff :: root-cause :: fix :: source :: outcome}. Future research calls rl_query(topic) FIRST -> if a finding exists, start from it instead of re-researching from scratch. That is how the researcher gets better "from the hardware rung up each rung". Sovereign: pure nx_syscalls file I/O (openat_append/openat_rd/read), no C. Idempotent (upsert by topic -> safe to run twice = deterministic GREEN x2). Append-only history (CLAUDE.md #13). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_seg_store.nx nx_research_ledger.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_seg_store.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write rl_strlen ss_next_segid sys_mmap ss_cat ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ss_segid_ok ss_begin ss_begin_cap sys_mmap ↻ rl_upsert sys_mmap ↻ ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ↻ ss_readall ↻ sys_munmap ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_r32 rl_cat ss_add ss_add2 ss_w32 ss_len ↻

structs

none

consts

15const K_MAGIC_1024: i64 = 1024
16const K_MAGIC_8192: i64 = 8192
17const K_MAGIC_65536: i64 = 65536
21const LP: *u8 = "knowledge/registry/research_ledger" as *u8

functions

25func rl_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i];o=o+1;i=i+1} return o }
27func rl_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 3: g_putsrl_wrl_count
30func g_puts(s: *u8) -> i64 { sys_write(1, s, rl_strlen(s)); return 0 }
called by 1: main calls 2: sys_writerl_strlen
35func g_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
37func rl_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, rl_strlen(s)); return 0 }
40func rl_count(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: rl_strlen
54func rl_read_all(buf: *u8, maxlen: i64) -> i64
70func rl_upsert(topic: *u8, cliff: *u8, root: *u8, fix: *u8, source: *u8, outcome: *u8) -> i64
called by 1: main calls 4: sys_mmapss_getrl_catss_add
81func main() -> i64