code wiki / _hdl_build / nx_memroot.nx

nx_memroot.nx

buildroot/runtime/_hdl_build/nx_memroot.nx

17940 B447 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_memroot.nx -- FROM-GOD ROOTING FOR THE MEMORY PLANE. node -> parent -> ... -> ORIGIN. CONVERTED TO nx_memplane_lib 2026-08-07. It now owns only the rooting: the BFS, the declared-edge authority, the lineage emitter and the parent proposals. Walk, name table, link scanner, read, join and the derived-artefact test come from the lib. THE MISS THIS ORGAN CORRECTS (operator) --------------------------------------- "it should be a logical from god does this already exist ... to give feedback on parents and descendents to give the ability to triangulate and get context and understand what is happening vs a flat directory where naming and guessing are key" A whole session of lexical instruments -- slug similarity, rarity weighting, BM25 -- all COMPENSATE FOR A FLAT DIRECTORY by getting better at guessing names. The estate had already written the correction 22 days earlier, in a memory whose filename is the problem: feedback-sprawl-orphans-use-fromgod-rooting-systems -- "USE the operator's established FROM-GOD + DEPENDENCY-GRAPH + NO-ORPHANS systems FIRST ... do NOT propose a NEW ladder when the system exists." ★★★★★★ THE ANTI-PATTERN HAS A MEMORY FILE, AND I REPRODUCED IT ANYWAY -- WHICH IS THE ADOPTION GAP THE FILE DESCRIBES: A DOCTRINE THAT IS WRITTEN BUT UNROOTED IS NOT REACHABLE WHEN IT WOULD MATTER. MEASURED GAP: 1,514 files declare `node_type: memory` -- graph nodes BY DECLARATION -- and the parent edge was absent from all of them. Declared and unwired, so the corpus behaves as a flat directory of 2,181 files. That is the root cause under every symptom measured this session. MATCHED KNOWN GOOD: nx_build_rooted_gate, the NO-ORPHANS enforcer for organs -- root every node to ORIGIN, census the FLOATING ones as the OPERATOR-PACED worklist; floating is not dead, it is unrooted. Same shape, applied to the memory plane, rather than a new ladder. DECLARED EDGES ARE THE AUTHORITY; citation edges are the fallback. A node's derived parent is the file that first cites it on a breadth-first walk from ORIGIN, so DEPTH is the true distance from the front door. ⚠The declared pass runs AFTER the walk: applied before it, a declared parent has no depth yet, so every declared node still received an accidental citation parent. ★ AN AUTHORITY APPLIED BEFORE THE DATA IT DEPENDS ON EXISTS IS NOT AN AUTHORITY. usage: nx_memroot [--dir D] [--apply] [--floating] [--suggest] exit: 0 = every node rooted (GREEN); 1 = floating nodes exist (the worklist) Sovereign: imports nx_memplane_lib. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_memplane_lib.nx nx_memroot.nx

imports: nx_memplane_lib.nx

imported by: nobody (leaf or entry point)

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

main mp_streq mp_scan sys_openat_rd sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ mp_is_md mp_len mp_nameptr sys_close mp_put mp_nameptr ↻ mp_hashr mp_len ↻ mp_cat mp_say mp_write_all sys_write ↻ mp_join mp_nameptr ↻ mp_readf sys_openat_rd ↻ sys_read sys_close ↻ mp_declparent mp_len ↻ mp_get

structs

none

consts

40const MR_DIR: *u8 = "/mnt/c/Users/elder/.claude/projects/C--Users-elder/memory"
41const MR_ORIG: *u8 = "MEMORY.md"
42const MR_OUT: *u8 = "reference-memory-lineage.md"
43const MR_FBUF: i64 = 1048576
44const MR_OBUF: i64 = 4194304
45const MR_MSG: i64 = 16384
46const MR_HUBS: i64 = 96
47const MR_TOK: i64 = 8192

functions

51func mr_tokput(set: *i64, h: i64) -> i64
called by 2: mr_toksetmr_score
63func mr_tokhas(set: *i64, h: i64) -> i64
called by 1: mr_score
75func mr_tokset(buf: *u8, n: i64, set: *i64) -> i64
called by 1: main calls 1: mr_tokput
102func mr_score(buf: *u8, n: i64, hub: *i64) -> i64
called by 1: main calls 2: mr_tokputmr_tokhas
132func main(argc: i64, argv: *i64) -> i64