code wiki / _hdl_build / nx_memroot.nx
nx_memroot.nx
buildroot/runtime/_hdl_build/nx_memroot.nx
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
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
structs
| none |
consts
| 40 | const MR_DIR: *u8 = "/mnt/c/Users/elder/.claude/projects/C--Users-elder/memory" |
| 41 | const MR_ORIG: *u8 = "MEMORY.md" |
| 42 | const MR_OUT: *u8 = "reference-memory-lineage.md" |
| 43 | const MR_FBUF: i64 = 1048576 |
| 44 | const MR_OBUF: i64 = 4194304 |
| 45 | const MR_MSG: i64 = 16384 |
| 46 | const MR_HUBS: i64 = 96 |
| 47 | const MR_TOK: i64 = 8192 |
functions
| 51 | func mr_tokput(set: *i64, h: i64) -> i64 |
| 63 | func mr_tokhas(set: *i64, h: i64) -> i64 called by 1: mr_score |
| 75 | func mr_tokset(buf: *u8, n: i64, set: *i64) -> i64 |
| 102 | func mr_score(buf: *u8, n: i64, hub: *i64) -> i64 |
| 132 | func main(argc: i64, argv: *i64) -> i64 |