Files
nisse/nisse-dev/src/nisse_dev/bench/tasks/trace-bug/task.yaml
T
dongarandClaude Opus 5.5 277bff6fcd
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m14s
trace-bug: say how much precision the rates need
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>
2026-09-27 22:43:39 +00:00

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.