nx_genealogy.nx
buildroot/runtime/nx_genealogy.nx
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
imports: syscalls.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
| 27 | const NX_MAGIC_2026: i64 = 2026 |
| 28 | const NX_MAGIC_20260517: i64 = 20260517 |
| 29 | const NX_MAGIC_20260516: i64 = 20260516 |
| 36 | const NX_GENEAL_REC_SIZE: i64 = 56 // 7 i64 fields |
| 37 | const NX_GENEAL_CHUNK_BYTES: i64 = 32768 // 585 records |
functions
| 39 | func nx_geneal_init() -> i64 |
| 51 | func nx_geneal_enable() -> i64 { NX_GENEAL_ACTIVE = 1; return 0 } called by 1: main |
| 52 | func nx_geneal_disable() -> i64 { NX_GENEAL_ACTIVE = 0; return 0 } called by 1: main |
| 53 | func nx_geneal_is_active() -> i64 { return NX_GENEAL_ACTIVE } |
| 58 | func nx_geneal_record(prim_tag: i64, parent_a: i64, parent_b: i64, |
| 80 | func nx_geneal_lookup(prim_tag: i64) -> i64 |
| 94 | func nx_geneal_field(slot: i64, field: i64) -> i64 |
| 105 | func nx_geneal_n_records() -> i64 |
| 113 | func main() -> i64 |