code wiki / (root) / nx_commons_price.nx

nx_commons_price.nx

buildroot/runtime/nx_commons_price.nx

6113 B107 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic commons
docsdependenciesstructsconstsfunctions

about

nx_commons_price.nx -- COMMENSURATION: how do you compare an hour of shovelling to a borrowed GPU? KNOWN GOOD MATCHED, and it is in this estate already: nx_meal_effort. Its three honesty invariants are the whole spine of this problem and are adopted verbatim in spirit: 1. AN UNASSESSED SKILL IS NOT AN EXPERT SKILL -- return UNKNOWN, never default to a flattering value. 2. NO INVENTED WAGE -- "picking a plausible-looking hourly rate would make the ranking AN OPINION WEARING ARITHMETIC'S CLOTHES". If the commons has not DECLARED a rate, there is no rate. 3. ONLY FULLY-KNOWN OPTIONS MAY BE RANKED -- a partial sum must never be presented as a total. Real-world known good for the base unit: TIME BANKING (Cahn 1980; hOurworld / TimeBanks USA, decades of field deployment). Its defining move is that it REFUSES to price skill: one hour is one hour. WHY TIME AND NOT MARKET PRICE -- this is the whole design and it is testable. Any commensuration that prices contributions at market rate RE-IMPORTS THE EXACT INEQUALITY THE COMMONS EXISTS TO ESCAPE. Price a lawyer's hour at 10 janitor-hours and the commons faithfully reproduces the strip mine, in its own currency, with a clean conscience. The market rate is not a neutral measuring stick; it is the thing under dispute. So the base unit is the one unit every person has in equal supply: an hour. THE IMPROVEMENT OVER NAIVE TIME BANKING (its known failure, addressed rather than ignored): flat 1:1 gives no signal for scarce, hazardous or unsocial work -- if one neighbour can fix the boiler at 2am in the rain, 1:1 says that hour is worth a pleasant hour of weeding, and the boiler does not get fixed. So multipliers exist -- but they are DECLARED BY THE COMMONS, recorded as data, and BOUNDED: * CP_MULT_FLOOR_PERMIL = 1000 -- NOBODY'S HOUR IS EVER WORTH LESS THAN AN HOUR. There is no downward adjustment at all, because that is the lever every hierarchy reaches for first. * CP_MULT_CAP_PERMIL = 3000 -- and no hour may be worth more than three. ★ THE SPREAD BETWEEN THE MOST AND LEAST VALUED HOUR IS THEREFORE BOUNDED AT 3:1 BY CONSTRUCTION. For scale: a hedge-fund hour against a cleaner's hour is on the order of 1000:1. A commons cannot vote itself into that shape here, because the arithmetic will not represent it. THE THIRD STATE IS MANDATORY. cp_* returns CP_UNPRICED for anything the commons has not declared a rate for, and any total containing an unpriced part is itself UNPRICED. A pricer that can only ever return a number WILL fabricate one -- the same lesson nx_gonogo paid for when a two-state verdict had to grow a third. Integer permille throughout, no floats. Rates are DATA (law 11), never literals in this file. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_commons_price.nx nx_commons_price_gate.nx

imports: nx_syscalls.nx

imported by: nx_commons_price_gate.nx

structs

none

consts

40const CP_UNPRICED: i64 = 0 - 1 // the third state -- absent evidence, not zero value
41const CP_SEC_PER_HOUR: i64 = 3600
42const CP_PERMIL: i64 = 1000
43const CP_MULT_FLOOR_PERMIL: i64 = 1000 // no hour is worth LESS than an hour. No exceptions.
44const CP_MULT_CAP_PERMIL: i64 = 3000 // and none is worth more than three.

functions

49func cp_clamp_mult(declared_permil: i64) -> i64
called by 2: cp_price_timemain
57func cp_price_time(seconds: i64, mult_permil: i64) -> i64
called by 1: main calls 1: cp_clamp_mult
67func cp_price_kind(qty: i64, rate_permil: i64) -> i64
called by 1: main
76func cp_total(parts: *i64, n: i64) -> i64
called by 1: main
88func cp_is_priced(v: i64) -> i64
called by 1: main
94func cp_spread_permil() -> i64
called by 1: main
103func cp_market_price(seconds: i64, hourly_cents: i64) -> i64
called by 1: main