code wiki / _hdl_build / nx_capability_genealogy.nx
nx_capability_genealogy.nx source
↩ module page · 31 lines · 2426 B
1// nx_capability_genealogy.nx -- the FRONTIER-OBJECT layer that brings everything together (operator: "combined
2// in with our genealogist work ... from god each generation up till the frontier or io point ... bringing
3// everything together"). The genealogist (nx_lineage_evolution_grade) grades the GOD->axis layer (sovereignty:
4// fragmentation->unification). This grades the ORGAN/capability layer below it: each capability has GENERATIONS
5// (same-named impls across dirs = shadow collisions) that must be CONSOLIDATED into ONE FRONTIER object, and that
6// frontier must be a PERFECT OBJECT (right-sized) + ideally a reusable core (at the IO point = used by the world).
7// So a capability is "CLIMBED to its frontier" iff: PERFECT shape AND CONSOLIDATED (no remaining collision =
8// generations merged) AND sovereign (.nx). Composes nx_capability_shape (shape/reuse) + nx_janitor_dupname
9// (generations). This is the bridge: god-axis (lineage) -> capability-frontier (here) -> perfect objects.
10// READ-ONLY (never-brick). license_tier: ORIGINAL
11import "nx_capability_shape.nx" // cs_funcs, cs_grade, cs_grade_name, cs_reuse, CS_PERFECT
12import "nx_janitor_dupname.nx" // jdn_scan, jdn_is_collision
13import "nx_syscalls.nx"
14
15const CG_FRONTIER: i64 = 1 // perfectly climbed: PERFECT shape + consolidated + sovereign
16const CG_NEEDS_WORK: i64 = 0
17
18// how many un-merged GENERATIONS does this capability still have? (1 = consolidated; 2 = a live shadow collision)
19func cg_generations(organ_name: *u8, fnames: *u8, fnoff: *i64, hc: i64, NF: i64) -> i64 {
20 if jdn_is_collision(fnames, fnoff, hc, NF, organ_name) == 1 { return 2 } // present in both dirs = 2 generations
21 return 1 // single = consolidated frontier
22}
23
24// the UNIFIED FRONTIER grade: a capability is at its PERFECT FRONTIER OBJECT iff PERFECT shape AND consolidated
25// (generations merged to one) AND sovereign (.nx, which all our organs are). Brings shape + consolidation together.
26func cg_frontier(path: *u8, organ_name: *u8, fnames: *u8, fnoff: *i64, hc: i64, NF: i64) -> i64 {
27 let shape: i64 = cs_grade(cs_funcs(path))
28 if shape != CS_PERFECT { return CG_NEEDS_WORK } // too big/small -> not perfect yet
29 if cg_generations(organ_name, fnames, fnoff, hc, NF) > 1 { return CG_NEEDS_WORK } // un-merged generations
30 return CG_FRONTIER
31}