Skip to content

calternal-money

Pure Money Markdown codec and exact envelope-budget maths for calternal (#404, #462)

calternal Money core: the Money Markdown codec and exact envelope maths.

This crate is pure: no I/O, no clock, no locale. The Money plugin (crates/plugins/money) reads files through calternal-fs and calls in. It ports the reviewed Python oracle in spikes/money-markdown/ and spikes/money-format/ (#404 rounds 1-3 and two independent breakage reviews); tests/vectors.rs replays the oracle’s recorded test vectors from contracts/vectors/money/money.v1.json and requires the same result.

Layers, lowest first:

  • [units]: ISO 4217 scales, exact units::Minor amounts.
  • [codec]: lossless Markdown lines, links, transaction rows, edits.
  • [ledger]: the three file kinds -> one validated ledger::Ledger.
  • [budget]: Ready to Assign, Available, rollover, funding states.
  • [schedule]: upcoming bills and card statement cycles.
  • [edit]: the writes the API offers (assign, add or edit a simple transaction, cleared flag, new budget files).

Money never uses floating point. Deliberate differences from the oracle are listed in each module’s documentation.

Source: crates/calternal-money/src/lib.rs

Module Summary
budget Exact zero-based envelope maths: Ready to Assign, Assigned, Activity, Available, rollover, funding states and card payment reserves.
codec Lossless Money Markdown codec (#404 format, DESIGN §48 F1-F3).
edit The file edits the Money API offers (#462): new budget files, accounts, categories, assignments and simple transactions.
error One error type for the Money codec and maths.
import Deterministic source-to-Money writer for Actual and YNAB adapters (#462).
ledger Projection: three kinds of Money file -> one validated Ledger.
schedule Derived schedules: upcoming bills and card statement cycles.
units Exact money units: the ISO 4217 scale table and decimal text <-> minor units.