From d1b6f262221cdd6d4e693e8dd8465714597c90f7 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Mon, 16 Nov 2026 19:32:48 +0000 Subject: [PATCH] Write step B5.4 for the no-negative rule --- docs/TODO.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/TODO.md b/docs/TODO.md index 1231a8d..560d6a9 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -298,15 +298,11 @@ transfer may not name the bank. `validation` learns the bank id as an optional p **Verify:** six payloads, clean and rejected, each with its Nynorsk message. ### B5.4 `ledger.py` -Nothing changes here unless the owner answers the question below with "refuse everything". The -rule stays as B4.4 wrote it: a `transfer_out` is refused when the kroner do not cover it, with the -shortfall named in kroner, and a buy or a cost may overdraw and is shown as a negative balance. -**Open:** the owner asked that no account may go negative, but an absolute rule makes the golden -example of §6.4 (buys with no kroner income) and a fresh installation (an empty bank) impossible -to enter. Refusing everything would also need an opening balance for the bank, which is a new -concept. -**Verify:** the unit tests, plus a hand check of a transfer that overdraws and one a deposit -covers. +`_move_kroner()` refuses any payment that would take a real account below zero — a buy, a cost +and a transfer alike — with the shortfall named in kroner, and exempts the bank, whose negative +balance is how much has been drawn from it (D35). +**Verify:** the unit tests, plus a hand check of a buy that overdraws, a deposit from the bank +that funds it, and a transfer that overdraws after that. ### B5.5 `app.py` Allow the bank as the `market_id` or the `to_market_id` of a kroner `transfer_out` (and keep it