nx_aerobic.nx
buildroot/runtime/nx_aerobic.nx
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
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_aerobic_test.nxnx_tier3_ecology_compose_test.nx
structs
| 49 | struct NxAerobicItem |
| 58 | struct NxAerobicPile |
consts
| 35 | const NX_AR_EXPIRED: nx_int = 0 // cell/data aged out |
| 36 | const NX_AR_SUPERSEDED: nx_int = 1 // newer version exists |
| 37 | const NX_AR_USER_REQUESTED: nx_int = 2 // operator marked for release |
| 38 | const NX_AR_UNUSED_FOR_WINDOW: nx_int = 3 // no touches in N seconds |
| 39 | const NX_AR_VERSION_RETIRED: nx_int = 4 // substrate ABI retired |
| 40 | const NX_AR_N_REASONS: nx_int = 5 |
| 42 | const NX_AE_OK: nx_int = 0 |
| 43 | const NX_AE_ERR_FULL: nx_int = 1 |
| 44 | const NX_AE_ERR_EMPTY: nx_int = 2 |
| 45 | const NX_AE_ERR_BAD_REASON: nx_int = 3 |
| 67 | const NX_AE_ITEM_BYTES: nx_size = 48 |
| 68 | const NX_AE_STAGNANT_WINDOW_US: nx_size = 86400000000 // 24h default |
functions
| 70 | func nx_ar_is_valid(r: nx_int) -> nx_int |
| 76 | func nx_aerobic_pile_new(capacity: nx_size, now_us: nx_size) -> *NxAerobicPile |
| 88 | func _ae_at(p: *NxAerobicPile, idx: nx_size) -> *NxAerobicItem |
| 92 | func nx_aerobic_add(p: *NxAerobicPile, |
| 119 | func nx_aerobic_drain_one(p: *NxAerobicPile, |
| 149 | func nx_aerobic_is_stagnant(p: *NxAerobicPile, now_us: nx_size) -> nx_int |
| 156 | func nx_aerobic_count(p: *NxAerobicPile) -> nx_size called by 1: main |
| 160 | func nx_aerobic_total_decomposed(p: *NxAerobicPile) -> nx_int |
| 164 | func nx_aerobic_count_by_reason(p: *NxAerobicPile, reason: nx_int) -> nx_int |