code wiki / (root) / nx_fruiting.nx

nx_fruiting.nx

buildroot/runtime/nx_fruiting.nx

13121 B334 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_fruiting.nx -- content-addressed many-to-many broadcast (mushroom fruiting body releasing spores). Per user 2026-05-19: *"not just peer but we should also have torrent aka the fruiting or whatever"* -- the underground mycelium (nx_hypha) is point-to-point peer share; the ABOVE-GROUND fruiting body is the many-to-many broadcast layer. Mushrooms release spores that disperse via wind / water / animal / ballistospory; spores find new substrate and germinate. Substrate equivalent: content-addressed fragment dispersal where any peer holding fragment-N can serve it to any receiver requesting fragment-N (BitTorrent-class but biology-named). Per [[feedback-naming-discipline-no-industry-competitor-overlap]]: "torrent" is a tech-product name we avoid. "Fruiting" is biology- precise + unowned in tech-product space. V1 ships sealed enum of dispersal modes + content-addressed fragment- hash chain + per-fragment provenance + per-fruiting-body dispersal budget (refuses amplification attacks). Distinct from nx_hypha: hypha is RECIPROCITY-REQUIRED point-to-point peer exchange; fruiting is one-to-many broadcast where receivers do NOT need to share back (they may, but it's not required for reception). Together they're the complete fungal-network distribution architecture. Composes: nx_methyl -- each fragment carries Ed25519-signed methyl marker; receiver verifies before germinating nx_chromatin -- content-addressed block storage; fragments are chromatin block hashes nx_provenance_chain -- dispersal event chain-logged nx_hypha -- peers can re-share fruiting fragments via hypha point-to-point if desired (composes) V1 ships state-machine + classification primitives. Actual byte- transport for fragment delivery is caller-supplied (V2 wires content-addressed BLAKE3 fragment chain + chromatin block fetch). Gap list (V1 honest perf verdict):

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_tier.nx nx_fruiting.nx nx_fruiting_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_fruiting_test.nx

structs

110struct NxFruitingBody

consts

75const NX_FR_ANEMOPHILY: nx_int = 0 // wind: broadcast many-to-many
76const NX_FR_HYDROPHILY: nx_int = 1 // water: sequential flow
77const NX_FR_ZOOCHORY: nx_int = 2 // animal: carry-and-deliver
78const NX_FR_BALLISTOSPORY: nx_int = 3 // active push
79const NX_FR_AUTOCHORY: nx_int = 4 // local store + pull-available
80const NX_FR_N_MODES: nx_int = 5
84const NX_FB_DEVELOPING: nx_int = 0 // gathering fragments
85const NX_FB_READY_TO_DISPERSE: nx_int = 1 // complete + verified
86const NX_FB_DISPERSING: nx_int = 2 // actively serving fragments
87const NX_FB_QUIESCENT: nx_int = 3 // dispersal-budget exhausted
88const NX_FB_FAILED: nx_int = 4 // refused/invalid
89const NX_FB_N_STATES: nx_int = 5
93const NX_FR_OK: nx_int = 0
94const NX_FR_ERR_INVALID_MODE: nx_int = 1
95const NX_FR_ERR_INVALID_STATE: nx_int = 2
96const NX_FR_ERR_BUDGET_EXHAUSTED: nx_int = 3
97const NX_FR_ERR_FRAGMENT_OUT_OF_RANGE: nx_int = 4
98const NX_FR_ERR_NULL_INPUT: nx_int = 5
99const NX_FR_ERR_INVALID_TRANSITION: nx_int = 6
100const NX_FR_N_VERDICTS: nx_int = 7
123const NX_FB_BYTES: nx_int = 80
124const NX_FB_DEFAULT_BUDGET_MULTIPLIER: nx_int = 100

functions

128func nx_fr_mode_is_valid(m: nx_int) -> nx_int
called by 1: main
136func nx_fb_state_is_valid(s: nx_int) -> nx_int
144func nx_fr_verdict_is_valid(v: nx_int) -> nx_int
called by 1: main
157func nx_fr_mode_is_broadcast(m: nx_int) -> nx_int
called by 1: main
168func nx_fr_mode_requires_active_sender(m: nx_int) -> nx_int
called by 1: main
175func nx_fb_state_is_serving(s: nx_int) -> nx_int
called by 1: main
182func nx_fb_state_is_terminal(s: nx_int) -> nx_int
193func _fb_transition_allowed(from: nx_int, to: nx_int) -> nx_int
216func nx_fb_new(body_id: nx_int,
called by 1: main calls 1: sys_mmap
244func nx_fb_record_fragment_complete(b: *NxFruitingBody) -> nx_int
called by 1: main
256func nx_fb_is_complete(b: *NxFruitingBody) -> nx_int
called by 1: main
264func nx_fb_transition(b: *NxFruitingBody, to: nx_int) -> nx_int
289func nx_fb_serve_fragment(b: *NxFruitingBody,
called by 1: main
313func nx_fb_remaining_budget(b: *NxFruitingBody) -> nx_int
called by 1: main
326func nx_fb_set_dispersal_budget(b: *NxFruitingBody,
called by 1: main