code wiki / (root) / nx_genealogy.nx

nx_genealogy.nx

buildroot/runtime/nx_genealogy.nx

6152 B167 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic genealogy
docsdependenciesstructsconstsfunctions

about

nx_genealogy.nx -- substrate-primitive genealogy ledger. Cardinal: feedback-systemic-injection-everything-zero-runtime-overhead. Distinct from nx_bit_provenance: that ledger tracks OUTPUT BITS. This one tracks the PRIMITIVES THEMSELVES -- who authored each `func`, what parent primitive(s) it derives from, when (session id), and the one-line intent (WHY). Use cases: - "What's the lineage of nx_matmul_traced?" -> nx_bit_provenance -> nx_blas_i64 -> nx_tensor + nx_syscalls -> Linux RV64 ABI - "Was this primitive built in a session that's since been rolled back?" -> session_id check - "Which agent authored this brick?" -> author tag API: nx_geneal_record(prim_tag, parent_a_tag, parent_b_tag, parent_c_tag, author_tag, session_id, intent_hash) -> i64 nx_geneal_lookup(prim_tag) -> i64 (record-slot index, -1 if missing) nx_geneal_n_records() -> i64 Storage: same mmap-backed append-only ring as the other meta-pattern ledgers. 56-byte records (7 i64 fields).

dependencies 1 imports · 0 importers

syscalls.nx nx_genealogy.nx

imports: syscalls.nx

imported by: nobody (leaf or entry point)

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

main nx_geneal_init nx_geneal_disable nx_geneal_record nx_geneal_init ↻ nx_geneal_n_records nx_geneal_init ↻ nx_geneal_enable nx_geneal_lookup nx_geneal_init ↻ nx_geneal_field nx_geneal_init ↻

structs

none

consts

27const NX_MAGIC_2026: i64 = 2026
28const NX_MAGIC_20260517: i64 = 20260517
29const NX_MAGIC_20260516: i64 = 20260516
36const NX_GENEAL_REC_SIZE: i64 = 56 // 7 i64 fields
37const NX_GENEAL_CHUNK_BYTES: i64 = 32768 // 585 records

functions

39func nx_geneal_init() -> i64
51func nx_geneal_enable() -> i64 { NX_GENEAL_ACTIVE = 1; return 0 }
called by 1: main
52func nx_geneal_disable() -> i64 { NX_GENEAL_ACTIVE = 0; return 0 }
called by 1: main
53func nx_geneal_is_active() -> i64 { return NX_GENEAL_ACTIVE }
58func nx_geneal_record(prim_tag: i64, parent_a: i64, parent_b: i64,
called by 1: main calls 1: nx_geneal_init
80func nx_geneal_lookup(prim_tag: i64) -> i64
called by 1: main calls 1: nx_geneal_init
94func nx_geneal_field(slot: i64, field: i64) -> i64
called by 1: main calls 1: nx_geneal_init
105func nx_geneal_n_records() -> i64
called by 1: main calls 1: nx_geneal_init
113func main() -> i64