code wiki / (root) / nx_aerobic.nx

nx_aerobic.nx

buildroot/runtime/nx_aerobic.nx

6050 B175 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_aerobic.nx -- clean decomposition pile (regenerative metaphor). Per [[feedback-regenerative-stewardship-doctrine-captain-moroni]]: "aerobic composting decomposes cleanly with oxygen + transparency; anaerobic produces methane + smells." Substrate equivalent: when stale data / expired cells / unused capabilities need to be retired, do it AEROBICALLY -- with proper journal entries, content- addressed receipts, operator visibility. Never silent removal. CRITICAL DISCIPLINE: this is the OPPOSITE of nx_lysosome. Lysosome is for FOREIGN material that should be recycled at speed (cleanup queue). Aerobic is for SUBSTRATE-SELF material that has aged out and needs to be released with stewardship. Composes: nx_evict_journal -- every decomposition logged nx_provenance_chain -- each decomposition is a transform nx_chromatin -- germline preserved before aerobic release (so future cells can re-derive) nx_microbiome -- stagnant microbiome (low diversity) + aerobic compost = renewal signal V1 ships: - struct NxAerobicPile of decomposable items - add (mark for release with reason) - check_stagnant (no add/drain in window = anaerobic risk) - drain (caller frees + receives report) - emit_compost_report (summary of what decomposed + when)

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_aerobic.nx nx_aerobic_test.nx nx_tier3_ecology_compose_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_aerobic_test.nxnx_tier3_ecology_compose_test.nx

structs

49struct NxAerobicItem
58struct NxAerobicPile

consts

35const NX_AR_EXPIRED: nx_int = 0 // cell/data aged out
36const NX_AR_SUPERSEDED: nx_int = 1 // newer version exists
37const NX_AR_USER_REQUESTED: nx_int = 2 // operator marked for release
38const NX_AR_UNUSED_FOR_WINDOW: nx_int = 3 // no touches in N seconds
39const NX_AR_VERSION_RETIRED: nx_int = 4 // substrate ABI retired
40const NX_AR_N_REASONS: nx_int = 5
42const NX_AE_OK: nx_int = 0
43const NX_AE_ERR_FULL: nx_int = 1
44const NX_AE_ERR_EMPTY: nx_int = 2
45const NX_AE_ERR_BAD_REASON: nx_int = 3
67const NX_AE_ITEM_BYTES: nx_size = 48
68const NX_AE_STAGNANT_WINDOW_US: nx_size = 86400000000 // 24h default

functions

70func nx_ar_is_valid(r: nx_int) -> nx_int
called by 2: nx_aerobic_addmain
76func nx_aerobic_pile_new(capacity: nx_size, now_us: nx_size) -> *NxAerobicPile
called by 2: mainmain calls 1: sys_mmap
88func _ae_at(p: *NxAerobicPile, idx: nx_size) -> *NxAerobicItem
92func nx_aerobic_add(p: *NxAerobicPile,
called by 2: mainmain calls 2: nx_ar_is_valid_ae_at
119func nx_aerobic_drain_one(p: *NxAerobicPile,
called by 2: mainmain calls 1: _ae_at
149func nx_aerobic_is_stagnant(p: *NxAerobicPile, now_us: nx_size) -> nx_int
called by 2: mainmain
156func nx_aerobic_count(p: *NxAerobicPile) -> nx_size
called by 1: main
160func nx_aerobic_total_decomposed(p: *NxAerobicPile) -> nx_int
called by 2: mainmain
164func nx_aerobic_count_by_reason(p: *NxAerobicPile, reason: nx_int) -> nx_int
called by 2: mainmain calls 1: _ae_at