code wiki / _hdl_build / nx_ecomat_trend_lib.nx
nx_ecomat_trend_lib.nx
buildroot/runtime/_hdl_build/nx_ecomat_trend_lib.nx
about
nx_ecomat_trend_lib.nx -- ADVANCEMENT vs EXPANSION: the honest growth decomposition over the
durable maturity ledger (knowledge/status/ecosystem_maturity.log).
THE DEFECT THIS EXISTS TO KILL (measured 2026-07-31): the rollup headline is sum_cur/sum_bar, so
DECLARING a new domain raises the denominator and the grade FALLS while capability is unchanged.
Read naively the ledger says 460 -> 434 permil = "we regressed". Read honestly it says the bar
grew by 20 levels because 4 domains were declared. Conflating ADVANCEMENT (an existing domain
climbing a rung) with EXPANSION (a new domain declared at the bottom) is the design flaw: a grade
that punishes expansion trains the ecosystem to stop declaring frontiers.
WHAT IS EXACT AND WHAT IS NOT -- this lib never invents precision (L011 self-ceiling honesty):
* a transition where the domain COUNT DID NOT CHANGE has a stable cohort, so the entire delta
in sum_cur IS advancement. EXACT, no assumption.
* a transition that ADDED domains cannot be attributed from aggregates alone -- the ledger did
not keep who contributed what. That span is counted AMBIGUOUS and is never silently folded
into either bucket.
The permanent fix is a per-domain ledger line (then every span is exact). Until that ships this
lib reports its decomposable coverage explicitly instead of guessing.
Pairs with nx_ecomat_lib (the rollup core that writes the ledger this reads).
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 5 importers
imports: nx_ecomat_lib.nx
imported by: nx_ecomat_domtrend_lib.nxnx_ecomat_trend.nxnx_ecomat_trend_gate.nxnx_ecomat_trend_live_gate.nxnx_sota_page.nx
structs
| none |
consts
| 24 | const TR_LEDGER: *u8 = "knowledge/status/ecosystem_maturity.log" |
| 28 | const TR_MAX_ROWS: i64 = 4096 |
| 29 | const TR_I64: i64 = 8 |
| 30 | const TR_OUT_SLOTS: i64 = 24 |
| 32 | const TR_NL: i64 = 10 |
| 33 | const TR_ASC0: i64 = 48 |
| 34 | const TR_ASC9: i64 = 57 |
| 37 | const TRO_ROWS: i64 = 0 |
| 38 | const TRO_SCANNED: i64 = 1 |
| 39 | const TRO_CAPPED: i64 = 2 |
| 40 | const TRO_FIRST_CUR: i64 = 3 |
| 41 | const TRO_FIRST_BAR: i64 = 4 |
| 42 | const TRO_FIRST_DOM: i64 = 5 |
| 43 | const TRO_LAST_CUR: i64 = 6 |
| 44 | const TRO_LAST_BAR: i64 = 7 |
| 45 | const TRO_LAST_DOM: i64 = 8 |
| 46 | const TRO_ADVANCE: i64 = 9 |
| 47 | const TRO_STABLE_SPANS: i64 = 10 |
| 48 | const TRO_EXPAND_BAR: i64 = 11 |
| 49 | const TRO_AMBIG_CUR: i64 = 12 |
| 50 | const TRO_FIRST_EPOCH: i64 = 13 |
| 51 | const TRO_LAST_EPOCH: i64 = 14 |
| 52 | const TRO_FIRST_PERMIL: i64 = 15 |
| 53 | const TRO_LAST_PERMIL: i64 = 16 |
| 54 | const TRO_ADDED_DOM: i64 = 17 |
| 55 | const TRO_DECOMP_PERMIL: i64 = 18 |
| 58 | const TR_UNDECIDABLE: i64 = 0 |
| 59 | const TR_RISING: i64 = 1 |
| 60 | const TR_FLAT: i64 = 2 |
| 61 | const TR_FALLING: i64 = 3 |
| 63 | const TR_PERMIL: i64 = 1000 |
| 66 | const TR_ERR_NOLOG: i64 = 0 - 1 |
| 67 | const TR_ERR_THIN: i64 = 0 - 2 |
functions
| 71 | func tr_field(buf: *u8, ls: i64, le: i64, pat: *u8) -> i64 |
| 103 | func em_trend_buf(buf: *u8, n: i64, out: *i64) -> i64 |
| 203 | func em_trend(logpath: *u8, out: *i64) -> i64 |
| 218 | func tr_finding(out: *i64) -> i64 |
| 225 | func tr_finding_label(f: i64) -> *u8 |