FAILURE MAP
← Case archive

FA-57995 / Double-entry ledger accounting / Member archive

Foreign currency period-end revaluation: rate orientation · case 05

Revalued balances move inversely to the exchange rate.

Member previewVariant 5 · 3 implementations · 7 checks per implementation

Case contract

x = {'bid': [num, den], 'ask': [num, den], 'accounts': [[name, 'asset'|'liability', monetary, foreign units, carried home cents]]}. Monetary assets are revalued at the bid rate and monetary liabilities at the ask rate: home = foreign * num / den rounded half-up per account. Non-monetary accounts keep their carried amount. Unrealized gain sums (new - carried) for assets and (carried - new) for liabilities. Return {'balances': [[name, home]], 'unrealized_gain'}.

Why this case matters

Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: rate orientation{"balances": [["a0", 1], ["a1", 1002], ["a2", 1], ["a3", 1003]], "unrealized_gain": 1}{"balances": [["a0", 2], ["a1", 1002], ["a2", 2], ["a3", 1003]], "unrealized_gain": -1}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗