Skip to main content

Module value_flow

Module value_flow 

Source
Expand description

Value-flow & compensation (§23, legal_logic.md) — the Permissive Commons.

Shifts economic obligation from infinite linear consumption to threshold-based discharge to prevent extraction: a work’s cost is its audited production cost plus a legally capped ROI; usage by an agent triggers a royalty scaled by the agent’s category; payments accumulate into a pool; once the pool meets the cost, the obligation is discharged and the use is freed globally. Integer arithmetic throughout (deterministic, zero-heap) — units are abstract minor units (e.g. cents).

Structs§

UsuryError
ERROR_USURY_LIMIT_EXCEEDED — a projected spend breached the agreed budget’s ceiling. Carries the budget, the computed ceiling, and the offending projected spend so the caller can write a faithful conduct-violation record.

Constants§

USURY_OVERAGE_PERCENT_DEFAULT
Default permitted overage above an agreed budget, in percent — the spec’s 110% token ceiling is budget × (1 + 10/100).

Functions§

ancestor_royalty
The royalty owed to an ancestor generation levels up a derivation chain: a geometric split where each level takes share_percent of what reaches it — total × (share_percent/100)^(generation+1). Generation 0 = the immediate parent. Saturating integer arithmetic; zero-heap. (Recursive commons attribution for derivative works.)
apply_tax
The tax owed on amount at tax_basis_points (1 bp = 0.01%) — the automated cross- jurisdictional tax-schema shunt. Saturating (u128 intermediate).
check_usury
Gate a projected spend against the usury ceiling — Ok(()) while at/under the ceiling, Err(UsuryError) once it is breached. The fiduciary circuit-breaker an agent’s resource declaration is checked through before the spend is admitted.
commons_cost
Total economic obligation for a work: production_cost × (1 + roi_cap), with the ROI margin capped (the sh:maxInclusive cap — extraction guard). roi_cap_percent is clamped to max_roi_percent before applying. Saturating.
convert_currency
Convert amount at rate_micros (target units per source unit, in millionths — e.g. 1_500_000 = ×1.5). Saturating (u128 intermediate).
eroi
Energy Return On Investment = energy_returned / energy_invested. 0.0 if nothing was invested. The physics-bound viability ratio of a value flow.
eroi_viable
Is a value flow thermodynamically viable — E-ROI at or above min_ratio? Below this floor the flow is net-extractive (spends more energy than it recovers) and is refused — the physics-bound cost cap.
is_commons_discharged
The obligation is discharged once accumulated compensation meets the cost — the use is then obligation-free (freed globally). Active(Outstanding) → Discharged(ObligationFree).
is_usurious
Has projected_spend breached the usury ceiling for budget? Spending up to and including the ceiling is permitted; only a strictly greater spend is usurious.
liquidity_after
Evolve liquidity over steps of the ODE (constant inflow, proportional drain_percent) — converges toward the steady state inflow / (drain_percent/100).
liquidity_step
One discrete Euler step of the liquidity ODE dL/dt = inflow − drain·L: constant inflow replenishment minus drainage proportional to the current pool (drain_percent% per step). Saturating; zero-heap. The steady state is L* = inflow / drain.
outstanding
Outstanding balance still owed before discharge (0 once met). Saturating.
pool_after
Accumulate a payment into the compensation pool (saturating).
royalty
The royalty a use incurs: base × multiplier%, where the multiplier scales by agent category (e.g. a corporate user pays a higher multiple than a non-profit). Saturating.
royalty_tree_total
Total royalty distributed up a chain of generations ancestors (the sum of each generation’s geometric share) — what leaves the deriving work as upstream attribution.
usury_ceiling
Maximum spend permitted before the usury breaker trips: budget × (1 + overage/100) (saturating). With the default 10% overage this is the 110% ceiling.