code wiki / _hdl_build / nx_ecomat_trend_lib.nx

nx_ecomat_trend_lib.nx

buildroot/runtime/_hdl_build/nx_ecomat_trend_lib.nx

8971 B230 linesdepth 4pulls 5 transitivereach 7 importersview sourcekind librarytopic ecomat
docsdependenciesstructsconstsfunctions

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

nx_ecomat_lib.nx nx_ecomat_trend_lib.nx nx_ecomat_domtrend_lib.nx nx_ecomat_trend.nx nx_ecomat_trend_gate.nx nx_ecomat_trend_live_gate.nx nx_sota_page.nx

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

24const TR_LEDGER: *u8 = "knowledge/status/ecosystem_maturity.log"
28const TR_MAX_ROWS: i64 = 4096
29const TR_I64: i64 = 8
30const TR_OUT_SLOTS: i64 = 24
32const TR_NL: i64 = 10
33const TR_ASC0: i64 = 48
34const TR_ASC9: i64 = 57
37const TRO_ROWS: i64 = 0
38const TRO_SCANNED: i64 = 1
39const TRO_CAPPED: i64 = 2
40const TRO_FIRST_CUR: i64 = 3
41const TRO_FIRST_BAR: i64 = 4
42const TRO_FIRST_DOM: i64 = 5
43const TRO_LAST_CUR: i64 = 6
44const TRO_LAST_BAR: i64 = 7
45const TRO_LAST_DOM: i64 = 8
46const TRO_ADVANCE: i64 = 9
47const TRO_STABLE_SPANS: i64 = 10
48const TRO_EXPAND_BAR: i64 = 11
49const TRO_AMBIG_CUR: i64 = 12
50const TRO_FIRST_EPOCH: i64 = 13
51const TRO_LAST_EPOCH: i64 = 14
52const TRO_FIRST_PERMIL: i64 = 15
53const TRO_LAST_PERMIL: i64 = 16
54const TRO_ADDED_DOM: i64 = 17
55const TRO_DECOMP_PERMIL: i64 = 18
58const TR_UNDECIDABLE: i64 = 0
59const TR_RISING: i64 = 1
60const TR_FLAT: i64 = 2
61const TR_FALLING: i64 = 3
63const TR_PERMIL: i64 = 1000
66const TR_ERR_NOLOG: i64 = 0 - 1
67const TR_ERR_THIN: i64 = 0 - 2

functions

71func tr_field(buf: *u8, ls: i64, le: i64, pat: *u8) -> i64
103func em_trend_buf(buf: *u8, n: i64, out: *i64) -> i64
called by 2: mainem_trend calls 1: tr_field
203func em_trend(logpath: *u8, out: *i64) -> i64
called by 3: mainmainmain calls 2: ss_readallem_trend_buf
218func tr_finding(out: *i64) -> i64
called by 3: mainmainmain
225func tr_finding_label(f: i64) -> *u8
called by 2: mainmain