nx_tropism.nx
buildroot/runtime/nx_tropism.nx
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
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
| 48 | const NX_MAGIC_1024: i64 = 1024 |
| 55 | const NX_TROP_LOCAL_CPU: nx_int = 0 |
| 56 | const NX_TROP_LOCAL_GPU: nx_int = 1 |
| 57 | const NX_TROP_LOCAL_GPU_MAX_VRAM: nx_int = 2 |
| 58 | const NX_TROP_LOCAL_DISK: nx_int = 3 |
| 59 | const NX_TROP_NAS: nx_int = 4 |
| 60 | const NX_TROP_PEER: nx_int = 5 |
| 61 | const NX_TROP_CLOUD: nx_int = 6 |
| 62 | const NX_TROP_FOLLOW_INPUT: nx_int = 7 // co-locate with upstream cell |
| 63 | const NX_TROP_CHEAPEST: nx_int = 8 // pick by cost (V2) |
| 64 | const NX_TROP_USER_ATTENTION: nx_int = 9 // pick by where user is looking |
| 65 | const NX_TROP_N_TARGETS: nx_int = 10 |
| 69 | const NX_TROP_OK: nx_int = 0 |
| 70 | const NX_TROP_ERR_BAD_TARGET: nx_int = 1 |
| 71 | const NX_TROP_ERR_NO_HEADROOM: nx_int = 2 // resolved target full |
functions
| 75 | func nx_tropism_is_valid(t: nx_int) -> nx_int |
| 87 | func nx_tropism_is_local(t: nx_int) -> nx_int |
| 97 | func nx_tropism_is_remote(t: nx_int) -> nx_int |
| 117 | func nx_tropism_resolve(signal: nx_int, |
| 179 | func nx_tropism_cost_q10(t: nx_int) -> nx_int called by 1: main |