code wiki / (root) / nx_commons_lib.nx

nx_commons_lib.nx

buildroot/runtime/nx_commons_lib.nx

11446 B197 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind librarytopic commons
docsdependenciesstructsconstsfunctions

about

nx_commons_lib.nx -- NETWORK standing for a neighbour commons. The replacement for the pairwise tolerance-ratio rule in nx_mycorrhiza (nx_my_audit_kind) / nx_hypha (nx_hy_reciprocity_verdict). WHY THE INCUMBENT HAD TO BE REPLACED (measured by nx_commonsbench_gate, not asserted): the pairwise rule scores 1/5 teeth and 190 permil ordering agreement -- WORSE THAN CHANCE. It ranks a 3-identity sybil ring FIRST, ranks the skimmer above every person who works, and FLAGS AS AN EXTRACTOR the most generous member in the population. The reason is structural: AN EXTRACTOR IS BALANCED WITH EVERY COUNTERPARTY AND NET-NEGATIVE ON THE NETWORK. A PAIRWISE AUDIT IS THEREFORE STRUCTURALLY BLIND TO THE CLASS. The rent-extractor always renders each counterparty a fee-justifying service, so every pairwise audit returns BALANCED. And the same ratio test fires on the nurse, because generosity is indistinguishable from imbalance to a ratio. THE KNOWN GOOD WE MATCH INSTEAD (biology, not invention): mycorrhizal networks sanction cheaters by BIDIRECTIONAL PREFERENTIAL ALLOCATION (Kiers et al., Science 2011) -- the fungus routes phosphorus preferentially to roots that delivered more carbon, and the plant routes carbon to fungi that delivered more phosphorus. Cheating is never forbidden; it is made UNPROFITABLE by the allocation gradient. That is the only anti-capture mechanism that survives a powerful adversary: you cannot ban a predator class that can buy the rule-makers, but you can make predation return less than reciprocity BY CONSTRUCTION. FOUR TERMS, each earning its place against a named attack: 1. WITNESS -- only giving attested by a THIRD PARTY (not the counterparty you billed) counts. Kills the sybil ring, which can manufacture volume but not witnesses. 2. FLOW-THROUGH -- what you took and did NOT pass onward is a debt to the commons. Catches the extractor, whose pairwise books are immaculate. A flow is not hoardable. 3. TRUST-FLOW CAP -- standing is bounded by INDEPENDENT counterparties, so an attacker's total claim is capped by the honest edges they must actually earn, NOT by how many identities or how much capital they hold. Money buys identities, hardware and stake; it cannot buy witnessed reciprocal history. 4. DECAY -- standing that stops renewing fades, so year-1 founders never outrank an active member forever. This is the anti-ossification tooth; every co-op that calcified into an oligarchy lacked it. RED-TEAM OF THIS RULE, BY ITS AUTHOR, BEFORE SHIPPING -- one attack changed the design: A. "buy witnesses" -> witness rises but flow-through still convicts. Survives. B. "pass value on to my OWN sybils" -> DEFEATED THE FIRST DRAFT. Flow-through can be faked by circulating inside your own ring. FIX: the term is passed_OUTSIDE, never passed. A transfer to an identity you control is not circulation, it is laundering. C. "ring buys one honest witness" -> the cap converts one bought edge into ONE edge of standing

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_commons_lib.nx nx_commons_capunit_gate.nx nx_commons_ledger_gate.nx nx_commonsbench_gate.nx

imports: nx_syscalls.nx

imported by: nx_commons_capunit_gate.nxnx_commons_ledger_gate.nxnx_commonsbench_gate.nx

structs

none

consts

51const NXC_SCALE: i64 = 1000 // permil scale for witness + recency
52const NXC_CAP_PER_PARTNER: i64 = 100 // trust-flow: standing admitted per INDEPENDENT counterparty
53const NXC_GRACE: i64 = 300 // starter quota: the un-started are NEUTRAL, never zero
56const NXC_V_PILLAR: i64 = 4 // large witnessed net contributor
57const NXC_V_MEMBER: i64 = 3 // net contributor
58const NXC_V_GRACE: i64 = 2 // newcomer, not yet started -- protected
59const NXC_V_THROTTLE: i64 = 1 // net taker within learning bounds
60const NXC_V_EXTRACTOR: i64 = 0 // takes and does not pass on -- starved by the gradient
62const NXC_PILLAR_FLOOR: i64 = 1000
63const NXC_MEMBER_FLOOR: i64 = 1
128const NXC_RATE_UNDECLARED: i64 = 0 - 1

functions

68func nxc_effective_given(gave: i64, witnessed_permil: i64, recent_permil: i64) -> i64
83func nxc_retained(took: i64, passed_outside: i64) -> i64
93func nxc_raw_standing(gave: i64, took: i64, passed_outside: i64,
104func nxc_standing(gave: i64, took: i64, passed_outside: i64,
130func nxc_standing_rated(gave: i64, took: i64, passed_outside: i64,
called by 1: main calls 1: nxc_raw_standing
145func nxc_cap_bound(gave: i64, took: i64, passed_outside: i64,
called by 1: main calls 1: nxc_raw_standing
158func nxc_is_extractor(gave: i64, took: i64, passed_outside: i64,
168func nxc_verdict(gave: i64, took: i64, passed_outside: i64,
186func nxc_incumbent_pairwise_standing(worst_pair_ratio_q10: i64) -> i64
called by 1: main
194func nxc_incumbent_pairwise_flags(worst_pair_ratio_q10: i64) -> i64
called by 1: main