CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m14s
Calibration showed Haiku fixing the right constant but keeping only four decimal places, which passes the visible test and still loses the JPY rate's precision. An explicit plan should say so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
22 lines
1.1 KiB
YAML
22 lines
1.1 KiB
YAML
title: Trace a wrong total to its cause in a shared helper
|
|
check: python -m pytest -q .bench_check
|
|
plan: |
|
|
Milestone 1: fix the wrong totals on multi-currency invoices.
|
|
|
|
1. Run `python -m pytest -q`. `test_multi_currency_total` in
|
|
`tests/test_invoice.py` fails: totals are slightly off when an invoice has
|
|
lines in another currency. The test is correct. Do not change any file
|
|
under `tests/`.
|
|
2. Find the cause. Start at `Invoice.total` in `invoicing/invoice.py` and
|
|
follow the functions it calls, reading each one, until you find where
|
|
precision is lost. The cause is in a function that more than one module
|
|
uses.
|
|
3. Fix it at its source, in that shared function or the value it uses. Do
|
|
not special-case currencies in `invoicing/invoice.py` or
|
|
`invoicing/currency.py`: every caller of the shared function has the
|
|
same problem, and all of them must be fixed by your change. The rates in
|
|
`invoicing/currency.py` have up to six decimal places (JPY is 0.006712),
|
|
and no step may round a rate or fraction to fewer places than that.
|
|
4. Run `python -m pytest -q` until every test passes.
|
|
5. Call finish.
|