code wiki / (root) / nx_atlas_traits.nx

nx_atlas_traits.nx

buildroot/runtime/nx_atlas_traits.nx

11889 B168 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic atlas
docsdependenciesstructsconstsfunctions

about

nx_atlas_traits.nx -- the EXTENSIBLE trait engine for the Living Capability Atlas. Operator 2026-07-17: "full atlas scope immediately" + "make sure its extensible too on these traits and other things so we dont get locked in and can grow them." DESIGN = ANTI-LOCK-IN BY CONSTRUCTION. Nothing about the trait set, the node kinds, or the computation methods is hardcoded into the card struct. They are DATA-DRIVEN REGISTRIES: * TRAIT REGISTRY -- each trait = (key, axis, computed_by, applies_to_kinds, glyph). Grow it by adding ONE row (tr_def below) + optionally ONE dispatch arm. The GRADER LOOP IS GENERIC over the registry -- it never names a specific trait. * KIND REGISTRY -- node kinds span digital-organ + physical + STEM + bio + product + workflow + agent (open enum; add a row). Full-scope from day one. * CARD -- an OPEN trait-set (key->value bag), NOT fixed columns. Any registered trait attaches to any applicable node. New traits appear on old cards for free. * COMPUTED_BY -- a small dispatch (cb_eval): DISK / ALLOWLIST / POLICY today; MATERIAL / PROOF / BIO / WMS / CREW / SWARM declared-but-pending (honest: a trait can exist in the registry before its data source does -- that IS the growth path, not a blocker). So the atlas grows by editing DATA (registry rows), never by re-cutting the card. That is the extensibility. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_gate.nx nx_atlas_traits.nx

imports: nx_gate.nx

imported by: nobody (leaf or entry point)

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

main gw sys_write tr_def gn sys_write ↻ sys_mmap at_grade gw ↻ gn ↻ tr_def ↻ cb_eval at_have at_file_has sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close at_is_internal ax_name

structs

none

consts

23const AX_EXPOSURE: i64 = 0
24const AX_PARTICIPATE: i64 = 1
25const AX_LINEAGE: i64 = 2
26const AX_PHYSICAL: i64 = 3
27const AX_STEM: i64 = 4
28const AX_BIO: i64 = 5
39const K_DIGITAL: i64 = 1
40const K_PHYSICAL: i64 = 2
41const K_STEM: i64 = 4
42const K_BIO: i64 = 8
43const K_PRODUCT: i64 = 16
44const K_WORKFLOW: i64 = 32
45const K_AGENT: i64 = 64
46const K_ALL: i64 = 127
48const CB_DISK: i64 = 0 // organ opens on disk
49const CB_ALLOWLIST: i64 = 1 // node name present in tool_allowlist.conf = on-mcp / is-tool
50const CB_POLICY: i64 = 2 // exposure-policy name-classifier: primitive/gate -> internal-by-policy
51const CB_DEBT: i64 = 3 // DERIVED: built AND not on-mcp AND not internal-by-policy
52const CB_PENDING: i64 = 9 // declared trait, data source not wired yet (honest growth slot)

functions

29func ax_name(a: i64) -> *u8
called by 1: at_grade
56func tr_def(i: i64, ax: *i64, cb: *i64, applies: *i64, key: *i64, src: *i64) -> i64
called by 2: at_grademain
78func at_have(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: cb_eval
80func at_file_has(path: *u8, needle: *u8) -> i64
called by 1: cb_eval calls 1: sys_read_file
96func at_is_internal(name: *u8) -> i64
called by 1: cb_eval
105func cb_eval(cb: i64, node_name: *u8, node_path: *u8) -> *u8
120func at_grade(node_name: *u8, node_path: *u8, node_kind: i64) -> i64
called by 1: main calls 5: gwgntr_defcb_evalax_name
141func main() -> i64