104 lines
4.8 KiB
Markdown
104 lines
4.8 KiB
Markdown
# Coder prompt — phase B3
|
||
|
||
Paste everything below the line into the coding agent.
|
||
|
||
---
|
||
|
||
You are the coding agent for **Skuld**, the repository `skuld`. Phases A, B and B2 of
|
||
`docs/TODO.md` are done and committed. The owner has reviewed the running app once more and asked
|
||
for a second round of corrections. Your job in this session is **phase B3 only**: steps 45 to 55
|
||
of `docs/TODO.md`.
|
||
|
||
## Scope, and the hard stop
|
||
|
||
- Do steps 45, 46, ... 55, in that order, one step per turn.
|
||
- **Do not start Phase C.** No `Dockerfile`, no `Makefile`, no `package.json`, no `startos/`
|
||
directory, no `icon.svg`, no `README.md`, no `instructions.md`, no `AGENTS.md`. The owner will
|
||
say when Phase C starts, and there may be more corrections before that.
|
||
- Do not add anything the steps do not name, and do not tidy up neighbouring code on the way.
|
||
- If a step is impossible as written, stop and ask instead of inventing a variant.
|
||
|
||
## Read this first
|
||
|
||
1. `docs/spec.md` — the contract, updated for these corrections. Read it fresh rather than from
|
||
memory. The sections that changed: §3.2 fees, §3.3 internal transfers, §3.10
|
||
`Forvaltningskostnad`, §4 the `fee_ore` comment, §5.1 and §5.2 the lot rules, §6.2 the
|
||
`admin_cost` figure, §7.3 the form and the price, §7.4 the generated transfer, §7.6 the
|
||
transaction list, §8 the API, §13 Q3.
|
||
2. `docs/TODO.md` — phase B3, steps 45 to 55, each with its own verification.
|
||
|
||
## What the owner asked for, in his words
|
||
|
||
- The column in `/transaksjonar` is named **Bitcoin pris**, not `Pris`. It sits between
|
||
`Til konto` and `Inn`.
|
||
- A transfer **inherits the bitcoin price of the lot that was chosen**: the `transfer_out` and
|
||
its generated `transfer_in` show the same price.
|
||
- **Avgift can only be entered in sats.** A kroner cost is not a fee: the owner folds it into the
|
||
inngangsverdi or the utgangsverdi himself, by typing the amount that already includes it.
|
||
- A `transfer_out` generates a `transfer_in` whose **`INN` equals `Sendt`** — today it is
|
||
`Sendt − Avgift`, which is wrong. And the `transfer_in` shows **no Avgift**, because the fee
|
||
belongs to the `transfer_out`.
|
||
- The form still shows fields that do not belong to the type. The field list below is the
|
||
corrected one and it is exact. A field whose currency is not a choice shows the unit as plain
|
||
text, `sats` or `kr`, not a selector. On Handel, `sats` is preselected on `Kjøp` and `kr` on
|
||
`Salg/kostnad`.
|
||
|
||
```
|
||
Handel Kjøp: {antall}, Valuta: {sats/kr}
|
||
Salg/kostnad: {antall}, Valuta: {sats/kr}
|
||
Inntekt Inntekt/gevinst: {antall}, Valuta: {sats}
|
||
Pris: {antall}, Valuta: {kr}
|
||
Forbruk Forbruk: {antall}, Valuta: {sats}
|
||
Utgangsverdi: {antall}, Valuta: {kr}
|
||
Tap Tap: {antall}, Valuta: {sats}
|
||
Pris: {antall}, Valuta: {kr}
|
||
Overføring ut Sendt: {antall}, Valuta: {sats}
|
||
Til: {namn på børs/lommebok}
|
||
Gåve (motteke) Motteke gåve: {antall}, Valuta: {sats}
|
||
Pris: {antall}, Valuta: {kr}
|
||
Gåve (gjeven) Gjeven gåve: {antall}, Valuta: {sats}
|
||
Forvaltningskostnad Kostnad: {antall}, Valuta: {kr}
|
||
```
|
||
|
||
`Forvaltningskostnad` is a kroner cost that is not stored on any account: it stands on its own.
|
||
`Avgift` is shown only for Handel, Inntekt, Forbruk, Tap, Overføring ut and Gåve (gjeven), and it
|
||
is always in sats.
|
||
|
||
## Language
|
||
|
||
- Code, identifiers, comments, commit messages, `docs/*.md`: **English**.
|
||
- Everything the end user sees: **Norwegian Nynorsk**.
|
||
- `1 500 000 sats`, `1 000 000 kr`, `31.12.2025`. Never a BTC amount with decimals, never a
|
||
kroner figure with decimals.
|
||
|
||
## How to work
|
||
|
||
- One step per turn, files exactly as the step names them, the step's verification run before you
|
||
commit, one-line English commit message.
|
||
- The repository must be consistent after every step: it imports, the tests pass, no page is left
|
||
without its script.
|
||
- Money stays integer øre, BTC stays integer sats, and `fee_ore` stays 0 forever.
|
||
- Keep `python3 -m unittest discover -s tests -v` green from step 50 onwards. Steps 45 to 49 may
|
||
leave the tests red where the step says so, and steps 50 and 51 must end green.
|
||
- Read only the files the step touches.
|
||
|
||
## Stop and ask the owner when
|
||
|
||
- a verification fails twice and the cause is not obvious;
|
||
- the spec and a step contradict each other;
|
||
- you think a third-party dependency is needed (it is not: the standard library only).
|
||
|
||
## Report format for every step
|
||
|
||
```
|
||
Step <number>: <title>
|
||
Files: <paths>
|
||
Changed: <one or two lines on what the code does>
|
||
Verification: <the command> -> <the observed result>
|
||
Commit: <message>
|
||
Next: <the next step number and title>
|
||
```
|
||
|
||
After step 55, reply with a short summary: the steps done, the commit range, the test result, and
|
||
the sentence "Phase B3 done — waiting for the owner before Phase C."
|