florecon
Reconciliation as partitioning. Given a bag of entries (each a stable id plus an opaque payload), parse it into a list of groups. That is the whole problem.
use *;
let strategy = seq;
The model
Entry<E> { id, data }— a stableIdand an opaque payload. Derefs to the payload, so|e| e.amountreaches a field whilee.idnames identity.Group { members: Vec<Id>, origin, reason }— a set of whole entries.Strategy<E>: bag -> (groups, residual)— a pure function. The output is a partition: every input id lands in exactly one group or in residual.
There is no privileged numeraire. Every number a leaf needs — an amount to net, a value to search, a flow supply — is a closure over the payload. So:
- multi-currency is just different closures (
agg_net(key, |g| g.net(|e| e.usd) == 0)); - there is no
pivot, nooriginal, no fractional allocation; - a match is judged by an acceptance closure over a
GroupView(|g| g.net(|e| e.amount).abs() <= 5 * g.min_leg(|e| e.amount) / 10_000) — no tolerance type, the author writes the inequality and picks the lane.
Conservation is identity, not arithmetic: nothing lost, nothing invented.
The surface
combinators seq partition_by when windowed fixed_point restart accept_if explain identity soak
leaves exact_1to1 agg_net signal_group cumulative subset_sum flow(FlowSpec)
flow keeps using min-cost flow internally (the netsimplex
crate — a standalone network-simplex transportation solver) to discover the
optimal matching, but reads it back as whole-row connected-component
clusters — a row is never split. The break, if any, is just the cluster's net,
which a downstream accept_if can gate.
Workspace
florecon— the strategy algebra (this crate).netsimplex— the domain-agnostic min-cost transportation solver behindflow.