code wiki / (root) / nx_grove.nx

nx_grove.nx

buildroot/runtime/nx_grove.nx

6589 B176 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_grove.nx -- patient multi-generational capital substrate. Per META-CARDINAL feedback-regenerative-stewardship-doctrine-captain-moroni: the substrate model that lets a 50-year forest or a 100-year ecosystem- restoration project be financed and sustained, when conventional discount-rate finance would call it worthless. REFUSES the conventional 5-10% discount rate that makes 100-year forests' NPV approach zero. V1 ships sealed enum of capital classes + per-class discount-rate override + multi-generation contribution tracking + steward succession.

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_tier.nx nx_grove.nx nx_grove_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_grove_test.nx

structs

39struct NxGroveContribution
50struct NxGrove

consts

17const NX_GR_KIND_ENDOWMENT_PRINCIPAL: nx_int = 0 // never spent; only yield
18const NX_GR_KIND_LAND_TRUST: nx_int = 1
19const NX_GR_KIND_CONSERVATION_EASEMENT: nx_int = 2
20const NX_GR_KIND_GENERATION_SKIPPING: nx_int = 3 // trust crossing generations
21const NX_GR_KIND_INDIGENOUS_STEWARDSHIP: nx_int = 4
22const NX_GR_KIND_COMMUNITY_LAND_TRUST: nx_int = 5
23const NX_GR_KIND_LABOR_INKIND: nx_int = 6 // volunteer hours
24const NX_GR_KIND_TEK_CONTRIBUTION: nx_int = 7 // traditional knowledge
25const NX_GR_KIND_N: nx_int = 8
29const NX_GR_V_OK: nx_int = 0
30const NX_GR_V_ERR_INVALID_KIND: nx_int = 1
31const NX_GR_V_REFUSED_SHORT_HORIZON: nx_int = 2 // <5 year horizon refused
32const NX_GR_V_REFUSED_EXTRACTION: nx_int = 3 // discount rate too high
33const NX_GR_V_NULL: nx_int = 4
34const NX_GR_V_INVALID: nx_int = 5
35const NX_GR_V_N: nx_int = 6
48const NX_GR_CON_BYTES: nx_int = 40
60const NX_GR_BYTES: nx_int = 48

functions

62func nx_gr_kind_is_valid(k: nx_int) -> nx_int
68func nx_gr_v_is_valid(v: nx_int) -> nx_int
called by 1: main
74func nx_gr_kind_is_in_perpetuity(k: nx_int) -> nx_int
called by 1: main
83func nx_gr_kind_is_in_kind(k: nx_int) -> nx_int
called by 1: main
89func nx_gr_new(grove_id: nx_int,
called by 1: main calls 1: sys_mmap
111func _gr_contrib_at(g: *NxGrove, idx: nx_int) -> *NxGroveContribution
118func nx_gr_add_contribution(g: *NxGrove,
called by 1: main calls 1: nx_gr_kind_is_valid
142func nx_gr_total_units_by_kind(g: *NxGrove, kind: nx_int) -> nx_size
called by 1: main calls 1: _gr_contrib_at
154func nx_gr_longest_horizon_years(g: *NxGrove) -> nx_int
called by 1: main calls 1: _gr_contrib_at
166func nx_gr_count_by_kind(g: *NxGrove, kind: nx_int) -> nx_int
called by 1: main calls 1: _gr_contrib_at