code wiki / (root) / nx_tropism.nx

nx_tropism.nx

buildroot/runtime/nx_tropism.nx

7733 B188 linesdepth 4pulls 7 transitivereach 10 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_tropism.nx -- location-policy resolver. Biological analogue: tropism is a directional growth response to a stimulus gradient (phototropism toward light, geotropism toward gravity, chemotropism toward nutrient). Nishi tropism resolves a homeostasis migration signal into a concrete destination by consulting the cell's declared preference list against current conditions. Same .nx pathway runs local/NAS/peer/cloud transparently per [[feedback-pathway-tropism-block-composition-location-agnostic]]. The structural EXCEED-axis vs K8s scheduler / Nomad / Argo: those resolve placement at submission time and re-schedule on failure; nx_tropism resolves PER MIGRATION SIGNAL, mid-pathway, with cell memory intact via the existing nx_chromatin replication. Composes: nx_homeostasis -- supplies the migration signal nx_attention_class -- foreground prefers LOCAL_*; idle accepts CLOUD nx_budget -- destination must have headroom for the cell nx_pathway -- pathway declares per-cell tropism preference V1 ships a sealed enum of 10 location targets + a resolver that picks based on signal + attention class. Cost / bandwidth / latency estimation per peer is queued (requires peer-mesh discovery layer). Gap list (V1 honest perf verdict): - no actual peer discovery (returns symbolic target, not address) - no cost estimation (CHEAPEST returns same as LOCAL_DISK) - no FOLLOW_INPUT/FOLLOW_DEST cross-cell resolution (returns LOCAL_CPU placeholder) - no failed-migration retry policy (caller's responsibility) genealogy_id: nishi_cardinal_2026-05-17_pathway_tropism + biology_directional_growth lineage_id: substrate_tropism_v1 nx_safety_envelope: intended_use: "Resolve homeostasis migration signal into a concrete location target per cell preference" sil_target: SIL1 evidence: [enum_sealed, deterministic_resolution,

dependencies 4 imports · 7 importers

nx_syscalls.nx nx_tier.nx nx_attention_class.nx nx_homeostasis.nx nx_tropism.nx nx_ecosystem_compose_test.nx nx_organism_test.nx nx_pathway.nx nx_pathway_test.nx nx_sovereign_compose_test.nx nx_substrate_compose_test.nx nx_tropism_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_attention_class.nxnx_homeostasis.nx

imported by: nx_ecosystem_compose_test.nxnx_organism_test.nxnx_pathway.nxnx_pathway_test.nxnx_sovereign_compose_test.nxnx_substrate_compose_test.nxnx_tropism_test.nx

structs

none

consts

48const NX_MAGIC_1024: i64 = 1024
55const NX_TROP_LOCAL_CPU: nx_int = 0
56const NX_TROP_LOCAL_GPU: nx_int = 1
57const NX_TROP_LOCAL_GPU_MAX_VRAM: nx_int = 2
58const NX_TROP_LOCAL_DISK: nx_int = 3
59const NX_TROP_NAS: nx_int = 4
60const NX_TROP_PEER: nx_int = 5
61const NX_TROP_CLOUD: nx_int = 6
62const NX_TROP_FOLLOW_INPUT: nx_int = 7 // co-locate with upstream cell
63const NX_TROP_CHEAPEST: nx_int = 8 // pick by cost (V2)
64const NX_TROP_USER_ATTENTION: nx_int = 9 // pick by where user is looking
65const NX_TROP_N_TARGETS: nx_int = 10
69const NX_TROP_OK: nx_int = 0
70const NX_TROP_ERR_BAD_TARGET: nx_int = 1
71const NX_TROP_ERR_NO_HEADROOM: nx_int = 2 // resolved target full

functions

75func nx_tropism_is_valid(t: nx_int) -> nx_int
87func nx_tropism_is_local(t: nx_int) -> nx_int
called by 2: mainmain
97func nx_tropism_is_remote(t: nx_int) -> nx_int
117func nx_tropism_resolve(signal: nx_int,
179func nx_tropism_cost_q10(t: nx_int) -> nx_int
called by 1: main