docs: cut the README down to what a reader needs first

The README had grown to 2,940 words (`wc -w README.md`): a table of the
app's screens with a list of notes on how the app behaves under it, the
checkout's method with its rules, errors and examples, and a subsection
on polkit rules with one written out. It is 1,170 words now.

What stays is what a reader needs to choose, install and use Nostro,
and what they must know for their money's sake: how nostrod keeps the
bank connections, the app's pictures with four notes under them,
installing, the CLI's commands, a paragraph on the checkout that points
at the interface's XML, and "Security" as a list whose last line points
at the polkit policy.

The README's warning against a rule that keeps an authorization moves
into the comment of that policy file, which already describes the rule
the README wrote out.

The guide's commit guidelines now say that the README is kept short,
and where what does not go into it goes. Two of the guide's sentences
spoke of what the README says of each screen: the one is gone, the
other no longer names the README. A third cited the README for what an
app with access to the checkout can learn of an order, which the
README no longer says: it stands without the citation.
This commit is contained in:
Jorijn van der Graaf 2026-11-22 13:31:18 +01:00
commit 25d991658f
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
3 changed files with 25 additions and 108 deletions

View file

@ -124,7 +124,7 @@ The app end to end:
- Accounts go to nostrod by IBAN, by name where the bank gave none; a connection by name, or by its number from a fresh `Accounts` listing when two share a name.
- Which bank an account is with makes no difference outside the settings. No screen there names a bank, or a way to connect to one, in the app's own words: it says "your bank". `ShouldDriveTheApp` fails on a frame that does, excepting what nostrod and the bank say themselves: a note about a connector, a refusal with the call it refused, a link the bank made. What does differ by bank is asked of `:Banks`: a connection that pays between the user's own accounts only, as bunq's through OAuth, is `Connection::ownAccountsOnly`. It is marked Limited, a payment from it to anyone else is saved as a draft, and it cannot pay a request or a shop.
- Adding a connection is three pages, from the settings and from the welcome alike: the banks (`add`), the bank's ways (`add:bunq`) and the way's form (`add:bunq:key`). The first two are built from `:Banks`. The form is the bank's own to draw and to check, in a file of the bank's (`Nostro.App-Bunq.cpp`), and its button ends in `App::Connect`, which is every bank's.
- **The screens** (`implementations/Nostro.App-Screens.cpp`, and a bank's own forms in that bank's file) are functions from that state to a frame. A window under 600 dp wide shows one page at a time, with the app's places along its bottom; a wider one has them down its left side, and from 900 dp the accounts too. A screen that shows the bank's own state (the accounts, an account, the cards) reads it again four ways, all one action (`Refresher`): Refresh in the bar, F5, Ctrl+R, and the page pulled down at its top. The README's "The app" says what each screen is for.
- **The screens** (`implementations/Nostro.App-Screens.cpp`, and a bank's own forms in that bank's file) are functions from that state to a frame. A window under 600 dp wide shows one page at a time, with the app's places along its bottom; a wider one has them down its left side, and from 900 dp the accounts too. A screen that shows the bank's own state (the accounts, an account, the cards) reads it again four ways, all one action (`Refresher`): Refresh in the bar, F5, Ctrl+R, and the page pulled down at its top.
- **The window** (`Nostro.Ui.Shell`) is one sd-event loop that carries the compositor's connection, nostrod's bus, the desktop portal's bus and the timers. `Window` turns Crafter.Graphics' events into the `Context`'s, bringing time up to each and building a stale frame again first, and does what the `Context` wants afterwards (`Settle`, which the loop calls from a post source after every source that ran). A frame is drawn only when the compositor asks for one after something changed, or when it waits for one itself, having asked for another size (`onFrameOwed`): an idle window draws nothing. `Canvas` turns a `DrawList` into Crafter.Graphics' items, one dispatch per batch, from a pool of buffers per frame in flight. `Portal` reads the desktop's colour scheme and accent, and asks the desktop to open an address.
- **`nostro-app`** puts them together, and has what looking at the window without a hand on it takes: `--size`, `--scale` (a phone's density on a desktop's display), `--theme`, `--route`, `--screenshot`, `--poke` and `--gallery`. It makes itself undumpable once the portal has seen it. Closing the window while a change is under way takes the window down and keeps the process until the answer has come.
@ -231,7 +231,7 @@ The bunq sandbox is still the check for what a fake cannot show. Since nostrod (
4. A new sandbox account holds €0 and no payments. Fund it with `nostro request <iban> sugardaddy@bunq.com "Sugar Daddy" 50000`: it is paid within seconds. A hundred rows at once: `POST …/payment-batch` with `{"payments": […]}` (more than 200 exercises the paging). `curl` can call as the same user with the `sessionToken` from the scratch file, and sign with `openssl dgst -sha256 -sign` over the body using its `privateKey` PEM, base64, in `X-Bunq-Client-Signature`. A sandbox card (`POST /v1/user/{id}/card-debit` with `type: MASTERCARD`, `product_type: MASTERCARD_DEBIT`, a `name_on_card` out of `GET /v1/user/{id}/card-name` and a `pin_code_assignment`) stays a virtual one, `DEACTIVATED` at `VIRTUAL_DELIVERY`, whatever it is set to: `nostro cards` lists it as `VIRTUAL`, `cards freeze` and `unfreeze` are refused for it, and `cards lost` and `stolen` can be tried on it. OAuth stops at the token exchange: approving needs a person and the bunq app.
5. bunq allows 3 GETs, 5 POSTs and 2 PUTs per three seconds per endpoint and one session per 30 seconds; nostro waits a 429 out, so a burst of runs is slow rather than failing. Concurrent nostro processes queue on `connectors.lock`, so two never hold the same account's table.
The app against the sandbox takes both Flatpaks installed and a hand on the window: every row of the README's "The app" from the window, with real polkit dialogs. That had not been done on 2026-11-19; nor had anything on a phone.
The app against the sandbox takes both Flatpaks installed and a hand on the window, with real polkit dialogs. That had not been done on 2026-11-19; nor had anything on a phone.
A bug fix comes with a test that fails without it, and states in its commit how it was reproduced; a new bank comes with tests against a fake of it and with the same check against its sandbox or live API.
@ -296,7 +296,7 @@ The checklist, from the bunq connector:
- Patches go by mail to jorijnvdgraaf@catcrafts.net, as the README says. Branch off `master`.
- Take the commit voice from the sibling Crafter repositories: `type(scope): imperative summary` with `feat`, `fix`, `refactor`, `docs` or `build`, and the partition or the CLI as the scope (`bunq`, `account`, `currency`, `connector`, `file`, `bus`, `client`, `daemon`, `checkout`, `cli`, `ui`, `app`, `shell`, `debug`, `build`, `packaging`). The body says what was wrong, why, and how it was verified against the sandbox.
- The README is the manual: keep its CLI section true to `main.cpp` and "The app" true to the screens: what the one can do, the other can. Update `AGENTS.consumer.md` in the same change when a signature, a path, a default, a file format or an error behaviour consumers lean on changes; consumers pick it up on their next build.
- The README is the manual, and is kept short: keep its CLI section true to `main.cpp` and what it says of the app true to the screens, and give a new feature a line there, or none. What a standard says is linked, not retold. How a screen works goes into this guide, what a caller needs into `AGENTS.consumer.md`, and what an administrator needs into the comment of `packaging/system/net.catcrafts.Nostro1.policy`. Update `AGENTS.consumer.md` in the same change when a signature, a path, a default, a file format or an error behaviour consumers lean on changes; consumers pick it up on their next build.
- A change to how the app looks or is laid out says in its commit how it was looked at: which screens, at which sizes, on what. When it changes a screen the README shows, the pictures are taken again (`docs/screenshots/take.sh`) in the same commit.
- The app's version is `NOSTRO_VERSION` in `project.cpp`, and the newest release in `packaging/flatpak/net.catcrafts.Nostro.metainfo.xml` is the same: `packaging/flatpak/release-version.sh` fails on a tree where they differ, and CI runs it first.
- A change to `Transaction` is a schema change (design rule 5), and the commit message says so.
@ -310,11 +310,11 @@ The checklist, from the bunq connector:
- `connectors.json` is the crown jewels: the bunq API key or OAuth token, the installation and session tokens and the unencrypted RSA private key, as plain text. Its protection is `0600` in a `0700` directory, and installed, the directory of a system user of its own (`/var/lib/nostro`) under a service that keeps the rest of the system read-only to it; it is replaced by a synced rename, never rewritten in place. There is no encryption at rest: root, and a disk taken out of the machine, read it. Never print it, never log a token or a signature, never copy a real one into a scratch directory or a commit. The transaction tables are the user's financial history, kept private the same way by Crafter.DB.
- What nostrod does not stop: a program running as the user can still draw a dialog that looks like polkit's and ask for the password; only the system's own agent is the real one. On a session without a polkit agent (SSH, a TTY without one) nothing can confirm, so every call that needs a password is `Cancelled`. polkit logs the calling process's command line, which is why no secret is ever an argument.
- What the shipped policy leaves open is looking: `View` needs no password in an active session, so any program of the user's there can read the accounts, payments, requests and cards. Everything else asks, `Change` included since 2026-11-19 (design rule 9). The README's "How Nostro runs" and "Security" say both plainly, and how a rule loosens it. polkit cannot tell the app from another program of the user's, so a rule that loosens an action loosens it for all of them; neither can nostrod, since whatever marks a process as the app (its executable, its Flatpak id, a unit's name) another program of the same user can wear, by starting the real app with its own code in it or on a display of its own.
- What the shipped policy leaves open is looking: `View` needs no password in an active session, so any program of the user's there can read the accounts, payments, requests and cards. Everything else asks, `Change` included since 2026-11-19 (design rule 9). The README's "How Nostro runs" and "Security" say both plainly, and the policy file's comment how a rule loosens it. polkit cannot tell the app from another program of the user's, so a rule that loosens an action loosens it for all of them; neither can nostrod, since whatever marks a process as the app (its executable, its Flatpak id, a unit's name) another program of the same user can wear, by starting the real app with its own code in it or on a display of its own.
- A worker makes itself undumpable, and the service sets `LimitCORE=0`: a core dump would hold the keys. A text that reaches a dialog goes through `Shown()`, so neither a payee's name nor a description can fake another amount or payee in it, start a line of its own, or leave an agent that reads its message as markup with nothing to show. What it cannot stop is a name that reads like part of the sentence ("Bob) from NL00… (Savings"): the summary puts the amount first and the paying account last for that reason.
- The app is one of the programs nostrod keeps the user's bank from: it sees accounts and payments, which `View` allows any program of the user's in an active session, and nothing that could pay or change anything at the bank without the dialog. Its Flatpak has the compositor, the graphics device and `net.catcrafts.Nostro1` on the system bus, and no network, no files and no session bus beyond the portals. It makes itself undumpable, so another program of the user's cannot read a key out of it while it is typed. It writes no amount, IBAN or name to its log, which lands in the user's journal.
- A build with `--debug-api` is none of that: every program of the user's can drive it and read what it shows, it logs what it is told, and a debugger can attach to it. It is for the made-up system and bunq's sandbox. `Ui_Type` refuses to type into a field that hides what it holds unless the text is a sandbox key (`sandbox_…`); nothing stops a hand from typing a real one into such a build, so do not. No Flatpak is made of it.
- The checkout answers a repeated order with its payment id without a dialog, so any app with access to the checkout can learn whether the user paid an order whose IBAN, reference and amount it knows (README, "Checkout for apps").
- The checkout answers a repeated order with its payment id without a dialog, so any app with access to the checkout can learn whether the user paid an order whose IBAN, reference and amount it knows.
- A connector's `environment` decides between `api.bunq.com`, where `send` moves real money, and the sandbox. An API key says itself which it is of: a sandbox key starts with `sandbox_`, and anything else is production. Nobody chooses it: nostrod takes the key's own, and refuses an environment named otherwise before the key goes anywhere, so a real key is not sent to the sandbox by a slip (`OnAddBunq`); the CLI has no flag for it and the app's form no choice. An OAuth client has no such mark, so there the environment is named (`--sandbox`, the form's Production or Sandbox). Since 2026-11-19 production has been used to connect and to read accounts, payments and cards; these notes record no payment made on it, so try that with small amounts first.
- Request bodies are `nlohmann::json` values serialised once (`dump` with invalid UTF-8 replaced), and the signature covers those exact bytes; nothing is spliced into JSON text by hand. Responses are used only after their server signature verifies.
- A write is never replayed by the transport (fresh connection) and only resent by nostro after a 429, which bunq refuses before acting. An IBAN's check digits are verified before anything is sent.