CAMPAIGN.md (110929B)
1 <!-- 2 This file is part of GNU Taler 3 (C) 2026 Taler Systems S.A. 4 5 GNU Taler is free software; you can redistribute it and/or modify it under the 6 terms of the GNU General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 --> 16 17 # Simulator campaign log 18 19 Every finding here has three things: what happens, how to reproduce it by hand 20 on a device, and a `repro_*.py` beside it that reproduces it against the 21 simulator. To run one: 22 23 ```bash 24 ssh root@tripwire.taler.net 25 cd /opt/taler-sim/driver 26 python3 ../findings/repro_zero_deposit.py # worker 0 by default 27 python3 ../findings/repro_zero_deposit.py emulator-5562 28 ``` 29 30 Each exits 0 when the defect is present and prints the evidence it checked, so 31 they double as regression tests once a fix lands. 32 33 ## Findings so far 34 35 | Finding | Severity | How it was found | 36 | --- | --- | --- | 37 | [`addglobalcurrencyexchange-null-masterpub.md`](addglobalcurrencyexchange-null-masterpub.md) — "Treat as global" sends a request with no `exchangeMasterPub`, so wallet-core answers `WALLET_UNEXPECTED_EXCEPTION` and nothing happens | low-moderate (developer mode only) | random exploration, seed 11 | 38 | [`action-buttons-have-no-accessible-name.md`](action-buttons-have-no-accessible-name.md) — none of the main screen's seven action buttons has an accessible name; TalkBack cannot announce them | moderate (release builds) | the driver could not tap them | 39 | [`mailbox-private-keys-written-to-log.md`](mailbox-private-keys-written-to-log.md) — both mailbox private keys are logged every 30 s, where the app's own log export picks them up | moderate | an oracle false positive led to the line | 40 | [`word-currency-symbol-glued-to-amount.md`](word-currency-symbol-glued-to-amount.md) — amounts render as `UNKNOWN0.00` and `Total: EUR1.00` when the currency symbol is a word | low (cosmetic) | QR scan of an order that does not exist | 41 | [`delete-transaction-requeries-deleted-id.md`](delete-transaction-requeries-deleted-id.md) — deleting a transaction makes the app ask wallet-core for it again | low | the `history_delete` scenario, twice | 42 | [`error-code-registry-behind-wallet-core.md`](error-code-registry-behind-wallet-core.md) — the app's registry is 26 wallet codes behind the wallet-core it ships; two were hit in normal runs | low | tallying error replies across all logs | 43 | [`dev-experiment-uri-exits-the-app.md`](dev-experiment-uri-exits-the-app.md) — an unknown `dev-experiment` URI logs an internal error and drops the user on the home screen | low (developer mode only) | the `uri_dev_experiment` scenario | 44 | [`add-payment-service-fails-silently.md`](add-payment-service-fails-silently.md) — every payment-service failure is silent: `ExchangeManager` publishes four error channels and nothing reads any of them | moderate | the `exchange_url_fuzz` scenario | 45 | [`deposit-does-not-guard-zero-amounts.md`](deposit-does-not-guard-zero-amounts.md) — clearing the deposit amount raises `WALLET_UNEXPECTED_EXCEPTION`, and depositing at or below the fee stores a zero-value deposit | low-moderate | the `deposit_flow` scenario | 46 | [`unreachable-host-leaves-blank-retrying-purchase.md`](unreachable-host-leaves-blank-retrying-purchase.md) — a prompt the app cannot prepare is an empty screen: eleven different exchange faults produce the same blank "Withdraw UNKNOWN", and it does not recover when the fault stops | moderate | random exploration, then fault injection | 47 | [`refresh-fails-on-mixed-age-denominations.md`](refresh-fails-on-mixed-age-denominations.md) — on an exchange offering age-restricted and ordinary denominations, the exchange rejects the melt and the change is never recovered; fixed upstream after the shipped wallet-core was built | high where it applies | the `refund` scenario, once age restriction was enabled | 48 | [`bitcoin-transfer-relabels-the-amount-as-btc.md`](bitcoin-transfer-relabels-the-amount-as-btc.md) — the Bitcoin wire instructions say "5.00 BTC" for a withdrawal of EUR 5.00, in the screen and on the clipboard | low | the `withdraw_account_tabs` scenario, once a Bitcoin account was signed | 49 | [`mailbox-payment-only-actionable-for-one-scheme.md`](mailbox-payment-only-actionable-for-one-scheme.md) — a payment received by mailbox shows an "Accept payment" button only for a literal `taler://` prefix; the developer-mode and extension schemes become a bare string | low-moderate | the `mailbox_roundtrip` scenario | 50 | [`taldir-protocol-version-mismatch.md`](taldir-protocol-version-mismatch.md) — the directory advertises protocol `0:0:0`, wallet-core's client requires `1:0:0` and refuses, and the precise reason is replaced by "could not read the configuration" | low-moderate | deploying a real taldir | 51 | [`alias-registration-hardcodes-the-directory.md`](alias-registration-hardcodes-the-directory.md) — the Taler directory URL is a literal in two files, so alias registration and contact lookup can only ever talk to `taldir.gnunet.org` | low | trying to cover the `contacts` package | 52 | [`amounts-without-currency-specification.md`](amounts-without-currency-specification.md) — the wire transfer instructions read "transfer 5.00 EUR … to receive €4.88", and the incoming peer-payment prompt shows "Total: 1.00 EUR" | low | the `withdraw_account_tabs` and `peer_push_receive` scenarios | 53 | [`release-error-screen-explains-nothing.md`](release-error-screen-explains-nothing.md) — with developer mode off, an error whose explanation is in `detail` rather than `hint` shows only the word "Error" | moderate (release builds) | the `error_screen_without_dev_mode` scenario | 54 | [`a-failed-query-is-shown-as-an-empty-wallet.md`](a-failed-query-is-shown-as-an-empty-wallet.md) — a failed `getDepositWireTypes` is shown as "No bank accounts saved", a failed `getMaxPeerPushDebitAmount` as "€0.00" to send; four of ten screens report nothing | moderate | the `api_error_sweep` scenario | 55 | [`wallet-lock-opens-when-the-credential-is-gone.md`](wallet-lock-opens-when-the-credential-is-gone.md) — once the device credential is removed, "Protect access to wallet" still shows its lock screen but opens on one tap with no authentication | moderate (security, release builds) | the `wallet_lock_without_credential` scenario | 56 | [`unknown-wire-method-hangs-the-deposit-form.md`](unknown-wire-method-hangs-the-deposit-form.md) — an exchange advertising a wire method the app does not know makes the whole reply undecodable and the add-account form spin for ever; three enums carry an `Unknown` member that can never be used | moderate | the `deposit_methods` scenario, once a Cyclos address was signed | 57 | [`purge-destroys-coins-and-history-without-saying-so.md`](purge-destroys-coins-and-history-without-saying-so.md) — "Force deletion (purge)" removes the balance and every transaction with the payment service, from a dialog that is a title, a checkbox and two buttons | moderate | the `history_after_forgetting_exchange` scenario | 58 | [`suspended-looks-like-completed-in-the-list.md`](suspended-looks-like-completed-in-the-list.md) — the transaction list has no branch for `Suspended`, so a suspended withdrawal's row says "Waiting for confirmation" instead | low-moderate | the `transaction_states_rendered` and `withdraw_suspend_resume` scenarios | 59 | [`aborted-credit-shows-the-whole-amount-as-fee.md`](aborted-credit-shows-the-whole-amount-as-fee.md) — an aborted withdrawal reads "Chosen amount €5.00 / Fee −€5.00 / Total amount €0.00"; the same arithmetic is on three further credit screens | low-moderate | a note of the `abort_then_retry` scenario | 60 | [`pos-confirmation-shows-five-codes.md`](pos-confirmation-shows-five-codes.md) — "Confirmation code" prints every T-OTP code in the valid time range, with nothing to say which one to read out | low | the `payment_pos_confirmation` scenario | 61 62 Each one has a manual reproduction and, where there is something to run, a 63 `repro_*.py` script beside it. Three are established by reading rather than 64 running — the hard-coded directory URL, the error-code registry and the 65 fault-injection half of the blank-prompt finding — and each says which command 66 shows it. 67 68 One entry per iteration: what was run, what the coverage was afterwards, what 69 it found, and what the next iteration aims at. Coverage is JaCoCo line coverage 70 of the `wallet` module (the Kotlin shell only — wallet-core is TypeScript inside 71 QuickJS and is not instrumentable through qtart). 72 73 ## Iteration 1 — baseline (random exploration only) 74 75 Ran `smoke_withdraw`, `smoke_pay` and two `explore.py` runs (80 and 100 steps). 76 77 * **Coverage: 33.9 %** line (5855/17247), 22.3 % branch, 35.8 % class. 78 * Findings: one confirmed defect, `addglobalcurrencyexchange-null-masterpub.md` 79 (`WALLET_UNEXPECTED_EXCEPTION` from "Treat as global"). Everything else the 80 oracles flagged was a correct refusal. 81 * Gaps, by missed lines: `peer` 0.9 % covered, `deposit` 0.8 %, `accounts` 82 1.3 %, `transfer` 0.0 %, `tokens` 1.1 %, `donau` 3.4 %, `mailbox` 20.2 %, 83 `payment` 27.4 %, `exchanges` 27.8 %, `transactions` 45.4 %. 84 85 Random exploration reaches the screens that are one tap from the main screen and 86 stops there: everything behind an amount field or a multi-step form stayed 87 untouched. Hence the scenario suite. 88 89 ## Iteration 2 — feature scenarios 90 91 `suite.py` with 33 scenarios covering the flows named in the campaign brief: 92 transaction history and detail views, deleting transactions, aborting, 93 suspending and resuming, suspending and aborting, abandoning, adding and 94 removing exchanges, terms-of-service accept/reject, every settings row and 95 switch, the scan screen's manual entry, deposits, peer send/request in both 96 directions, manual withdrawal with wire-transfer details, tokens, donau and 97 contacts. 98 99 Ran 33 scenarios across 4 emulators on tripwire (one bank customer and one 100 CLI peer wallet per worker, all against one Taler stack). 101 102 * **Coverage: 40.8 %** line (7043/17247), up from 33.9 %; class 44.7 %, 103 branch 27.5 %. 104 * 23 of 33 scenarios passed. The 10 failures were all harness faults, not 105 wallet faults, and each one taught the driver something: 106 * a helper lost in an edit (`open_exchange_list`) — restored; 107 * `taler-wallet-cli` needs a `.sqlite3` database ("memory backend not 108 supported") and cannot fund itself with `withdraw --exchange`, which 109 creates a *manual* withdrawal nobody completes — the peer wallet now goes 110 through the bank like the app, with a bank customer of its own; 111 * bank accounts ran out of money mid-run ("Insufficient funds to withdraw 112 with Taler") — provisioning now tops every account up past EUR:100; 113 * **tapping a label did nothing** for the main screen's Send / Request / 114 Withdraw / Deposit buttons, because the clickable element is an unnamed 115 `Button` *above* the text. `Screen.tap_target()` now resolves a label to 116 the clickable node that contains it or sits next to it. 117 * Findings: the tap problem turned out to be a defect in the app, not just in 118 the driver — see `action-buttons-have-no-accessible-name.md`. The oracles 119 flagged nothing else: no crash, no internal error, no stuck operation, and 120 the new database oracles (`operation_retries`, unfinished operations) were 121 quiet throughout. 122 * New oracles this iteration: background failures and stuck operations read 123 out of the wallet's own SQLite database (`dbprobe.py`), which sees errors the 124 UI never shows. 125 126 ## Iteration 3 — the same scenarios with a working driver, plus 17 new ones 127 128 50 scenarios: everything from iteration 2 (10 of which never really ran), plus 129 selection-mode bulk delete, transaction filters, mailbox, contacts, the 130 `add-contact` and `dev-experiment` URIs, order templates, expired and deleted 131 orders, change (refresh) transactions, and a batch of adversarial sequences — 132 suspend/kill/relaunch/resume, abort-then-reuse-the-URI, hostile amounts in the 133 deposit and peer fields, airplane mode mid-withdrawal, two pay URIs at once, 134 force-purging an exchange that still holds coins, and rejecting the terms of 135 service mid-withdrawal. 136 137 Ran 60 scenarios across 4 emulators; 55 passed, and the 5 that did not were 138 harness faults (all since fixed: the CLI peer could not fund itself, the 139 Mailbox row needed scrolling in both directions, and `withdraw_manual` needs a 140 wallet that already knows the exchange). 141 142 * **Coverage: 56.5 %** line (9743/17247), up from 40.8 %; class 60.9 %, branch 143 44.8 %. 144 * **wallet-core operations exercised: 44/71 (62 %)**, up from 26/71. What is 145 left is mostly features that need services this stack does not run (Taldir 146 alias registration, the GNUnet mailbox) plus the database export/import 147 pickers. 148 * Newly reached, from 0 %: token issuance and the Discounts screen (a v1 149 contract with a token output), contract choices, the deposit account forms, 150 the donau setup screen, performance stats, and the bank-account manager. 151 * Findings: the two written up above, plus repeats of the known ones. Two 152 `silent-failure` reports were false positives from background log chatter, 153 which is why that oracle now only counts wallet-core error replies. 154 155 ## Verified good behaviour 156 157 Negative results worth recording, because each was a plausible place for a 158 crash and is not one: 159 160 * **A corrupted wallet database is handled.** Overwriting the SQLite header and 161 restarting shows "An error occurred while starting the wallet … Please retry, 162 and if the problem persists, export the …" — no crash, and the wallet works 163 again after a wipe (`db_corruption`). 164 * **Suspend survives process death.** Suspending a withdrawal, killing the app 165 and reopening it leaves the transaction suspended and still offering *Resume* 166 (`lifecycle_kill`). 167 * **A withdrawal survives losing the network.** Turning on airplane mode 168 mid-withdrawal and turning it off again lets the transaction finish without 169 intervention (`offline_withdraw`). 170 * **Invalid QR codes are refused cleanly.** All ten payloads in the QR suite — 171 malformed base32, unknown actions, a plain https URL, free text — produce an 172 explained refusal rather than silence or a crash. 173 * **Paying the same order twice** shows the completed transaction rather than 174 charging again (`payment_twice`). 175 * **A transaction the app cannot parse is handled.** `TransactionSerializer` 176 falls back to a `DummyTransaction` when deserialization throws, and nothing 177 had ever given it one. Fed a type that does not exist 178 (`interpretive-dance`) and a withdrawal with no amounts, the list renders 179 both as "Unknown transaction" with a zero amount and stays usable -- no 180 crash, no blank row (`transaction_states_rendered`). 181 * **A database export can be restored.** The export/import round trip brings a 182 wiped wallet back to its balance and its transactions 183 (`settings_import`). This one took three attempts to establish, all of 184 them harness error; see the near-miss above. 185 * **Tap-to-pay works, and refuses what it should.** An order delivered as an 186 NDEF record is paid like any other, and a tag carrying a plain website, a 187 bare `taler+http://pay/` or a non-existent order each produce their own 188 explained error (`nfc_tap_to_pay`). 189 * **KYC works end to end.** On the KYC stack a withdrawal above the threshold 190 shows "KYC required, preparing challenge", then "This transaction would 191 exceed a limit set by the payment service. To increase the limit, follow the 192 instructions linked below."; the call to action hands off to the exchange's 193 KYC page in Chrome, and coming back to the wallet shows the explanation 194 again. No internal errors anywhere in that path. 195 * **The app has not crashed once.** Across every round, scenario and 196 exploration step, no `FATAL EXCEPTION` belongs to `net.taler.wallet`. The 197 ones in the logs are `uiautomator dump` colliding with itself, which is the 198 driver's problem — the oracle now says so rather than reporting a wallet 199 crash. 200 201 ## Iteration 4 and onward — unattended rounds 202 203 `driver/forever.sh` runs continuously: provision (topping up the bank), all 65 204 scenarios across 4 emulators, then a random-exploration pass with a fresh seed 205 each round, dumping coverage after each phase and appending one line per round 206 to `run/rounds.log`. Round 4 started at 23:24. 207 208 ### Where the numbers stand 209 210 | After | Line coverage | wallet-core operations | 211 | --- | --- | --- | 212 | random exploration only | 33.9 % | 26/71 (37 %) | 213 | iteration 2 (first scenario pass) | 40.8 % | — | 214 | iteration 3 (working driver) | 56.5 % | 44/71 (62 %) | 215 | round 4 | 61.2 % | 48/71 (68 %) | 216 217 The 23 operations still unexercised are mostly features with no service behind 218 them here: Taldir alias registration (`registerAlias`, `lookupAlias`, 219 `completeRegisterAlias`, `addContact`, `deleteContact`) and GNUnet mailbox 220 messaging (`addMailboxMessage`, `sendTalerUriMailboxMessage`, 221 `deleteMailboxMessage`). The rest — the database import/reset pickers, 222 `failTransaction`, `cancelProgressToken`, the donau statements and the 223 incoming-peer-payment pair — are covered by scenarios added for round 5. 224 225 ### What the stack gained 226 227 Round 4 ended with a config swap that unlocked two feature areas the wallet 228 could not reach before: 229 230 * a **second exchange account in IBAN form**, so the manual withdrawal offers 231 an account picker and the IBAN transfer screens; 232 * **age-restricted denominations**, so the withdrawal screen offers "Restrict 233 usage to age" (8, 10, 12, 14, 16, 18) — exercised end to end. 234 235 Neither happens by itself: `taler-unified-setup.sh` enables only the account 236 given with `-u`, and age restriction needs `AGE_RESTRICTION_ENABLED` in the 237 `[exchange]` section on top of the age-restricted denominations. 238 239 ### Round 5 240 241 75 scenarios; 49 ran, and 26 failed on one shared cause: the bank accounts ran 242 dry. A fresh account holds exactly the EUR:100 registration bonus, the 243 provisioning top-up only triggered *below* EUR:100, and a round of 75 244 scenarios spends far more. Accounts are now kept at EUR:2000 and a refused 245 withdrawal tops up and retries, so the whole class is gone. 246 247 No new defects. What the round did show is that the oracles now catch by 248 themselves what used to take noticing by hand: the screen-sanity oracle 249 flagged `UNKNOWN0.00` on the main screen without anyone looking for it, and the 250 `expects` declarations kept the deliberate failures (a corrupted database, a 251 dead exchange) out of the serious column. 252 253 ### Rounds 6 to 10, the KYC pass, and two fault-injection phases 254 255 Rounds kept running unattended; `phase.sh` can now pause them, swap the stack 256 for a variant, run a named set of scenarios and put everything back. 257 258 * **KYC pass** (`sim-kyc.conf`, a FORM check with a EUR:5 withdraw threshold): 259 the hand-off works — the withdrawal reports "KYC required, preparing 260 challenge", the action opens the KYC page in Chrome, and coming back shows 261 "This transaction would exceed a limit set by the payment service". The one 262 serious finding of that phase was a withdrawal "retried 4 times", which is 263 the ordinary scenarios doing a plain EUR:10 withdrawal on a stack that 264 demands identification above EUR:5 — correct behaviour, not a defect. 265 * **Fault injection**, twice, and both runs measured nothing: 266 1. the first because the bank still suggested the direct exchange URL while 267 the wallet was configured for the proxy, so every withdrawal was refused 268 with `WALLET_EXCHANGE_BASE_URL_MISMATCH` before a fault could matter 269 (`SUGGESTED_WITHDRAWAL_EXCHANGE` now points at the proxy); 270 2. the second because **a twister fault is one-shot**. Arming it and then 271 starting a withdrawal spends it on whichever poll happens to come first, 272 which is why all seven fault types produced an untouched withdrawal 273 prompt and a withdrawal that then completed normally. `Twister.armed()` 274 re-arms in the background for as long as the step runs, and the field 275 faults now name real paths (`denominations.0.denoms.0.master_sig`, not 276 `denoms`, which matched nothing and said so in twister's log). 277 278 ### Iteration 5 — what one exchange and one wire method were hiding 279 280 Two configuration facts, not scenarios, were holding coverage down: 281 282 * `taler-unified-setup.sh` uploads a wire fee only for the method it was told 283 about, and **wallet-core hides every exchange account whose method has no 284 fee**. The IBAN account had been enabled since round 4 and was still 285 invisible: `/keys` listed it under `accounts` but `wire_fees` had only 286 `x-taler-bank`. One `taler-exchange-offline wire-fee now iban …` made the 287 account picker, the IBAN transfer screen (0 % → 61 %), the IBAN deposit form 288 (0 % → 95 %) and the EPC QR card appear. 289 * With **one** payment service every "which one?" step picks the only 290 candidate, so the exchange picker, "treat as global" and the balance scopes a 291 second service creates were unreachable. `backend/exchange2.sh` now starts a 292 second, independent exchange (own port, database, offline key, secmod 293 sockets, bank account at the shared libeufin) beside the stack in 11 s. 294 295 Also fixed: the peer wallet could not be funded at all — 296 `taler-wallet-cli wait-tx --state pending` returns immediately, because the 297 transaction is already pending, so no task ever ran. Waiting for 298 `pending/idle` is the pump; all four peer scenarios pass now where they used 299 to be driver errors. 300 301 * **Coverage: 66.0 %** line (11390/17247), up from 61.2 %; branch 53.8 %, 302 class 70.2 %. 303 * New scenarios: `withdraw_account_tabs` (one transfer screen per wire 304 method), `payment_pos_confirmation` (an order tied to a merchant OTP 305 device — the only way to reach the TOTP screen), `exchange_two_services`, 306 `withdraw_pick_exchange`, `balances_two_exchanges`. 307 * New findings: the hard-coded directory URL, the two amount notations in one 308 sentence, and the five confirmation codes. 309 310 ## Iteration 6 — fault injection that lands, and three more defects 311 312 ### Fault injection, third attempt 313 314 With `Twister.armed()` re-arming in the background, every fault finally hit 315 the request it was aimed at (the notes record 64 to 116 re-arms per step): 316 317 * **Payments survive transport faults.** A truncated reply, 500, 404, 403, 318 502 or the wrong content type leaves the purchase pending and the merchant 319 saying "claimed"; when the fault stops, the wallet retries and the merchant 320 says "paid". Two of three faulted payments recovered on their own within the 321 measurement window, and the third had run the wallet out of coins — the 322 scenario now withdraws EUR:20 first and waits 90 s for the recovery, so the 323 distinction is recorded rather than guessed. 324 * **Withdrawals do not.** Eleven ways of breaking `/keys` — truncation, five 325 status codes, the wrong content type, a deleted denomination list, a flipped 326 master public key, a forged denomination signature, missing wire fees, an 327 impossible protocol version — all produce the *same* screen, 328 `['Go back', 'Withdraw UNKNOWN', 'Internal event log']`, and it stays that 329 way after the fault is removed. That went into 330 `unreachable-host-leaves-blank-retrying-purchase.md`, which is no longer 331 about unreachable hosts: it is about a prompt with no error state. 332 333 ### Three defects, from three different directions 334 335 * **An aborted withdrawal says the whole amount went to fees** — found by 336 reading a scenario's notes, now caught by an oracle 337 (`fee-on-dead-transaction`), and shared by all four credit screens. 338 * **The wallet lock opens with no credential** — found by asking what happens 339 when the thing a security feature depends on goes away. The overlay still 340 appears and a single tap opens the wallet. 341 * **The point-of-sale confirmation shows five codes** — found by reaching 342 `PayTotpComposable` for the first time, which needed a merchant OTP device. 343 344 ### What the operation counter kept pointing at 345 346 Measuring which wallet-core operations the campaign had *never* reached found 347 three driver bugs that each hid a feature: 348 349 * `addBankAccount`, `forgetBankAccount` and `getBankAccountById` had never 350 run, because the form's submit button carries the same string as the app bar 351 title ("Add account"), the label search found the title, and the neighbour 352 search then switched tabs instead. `Ctx.tap_button` takes the lowest 353 matching node that is clickable and contains the label. 354 * `setDonau` had never run, because the tax payer ID was being typed into the 355 authority URL field and Save stays disabled until both are filled. 356 * `addContact` and `deleteContact` had no scenario at all. 357 358 Still out of reach: the directory operations (`registerAlias`, 359 `completeRegisterAlias`, `lookupAlias`) behind the hard-coded URL, the mailbox 360 operations with no mailbox service in this stack, and `importDb` / `clearDb`. 361 362 ### New: failing a wallet-core call from the outside 363 364 wallet-core takes `taler://dev-experiment/api-error?operation=…&detail=…`, 365 where the detail is base64url JSON with an error code, and fails that 366 operation that many times. `api_error_sweep` uses it to make each screen's own 367 call fail — balances, transactions, exchanges, contacts, bank accounts, 368 deposit wire types, withdrawal details, peer limits, discounts, donau — and 369 reports which screens then say nothing. It needs no proxy and no stack 370 variant, which makes it the cheapest way to hunt for the silent-failure class 371 that `add-payment-service-fails-silently.md` is one instance of. 372 373 ## Iteration 7 — failing wallet-core from the outside 374 375 The sharpest tool so far turned out not to be a proxy at all. wallet-core 376 accepts two developer-mode URIs: 377 378 ``` 379 dev-experiment/api-error?operation=<op>&detail=<base64url JSON>&count=<n> 380 dev-experiment/api-response?operation=<op>&response=<base64url JSON>&count=<n> 381 ``` 382 383 the first failing a named operation `n` times with a given error, the second 384 answering it with a canned reply. No stack variant, no proxy, no restart. 385 386 `api_error_sweep` makes one operation fail per screen and reads what the screen 387 then says. Thirteen operations in, the split is clean: **six screens report the 388 failure** (balances, transactions, bank accounts, discounts, passes, terms of 389 service — an `ErrorComposable` with the code and an export affordance) and 390 **seven say nothing**. Three of the seven state the failure as a fact about the 391 user: "No bank accounts saved in the wallet", "No contacts yet.", and a Send 392 screen offering "€0.00" on a wallet holding €9.87. That is 393 `a-failed-query-is-shown-as-an-empty-wallet.md`, and it also reproduced the 394 blank withdrawal prompt from a single injected error — no twister needed. 395 396 `error_screen_without_dev_mode` then asked what a *release* build shows, by 397 turning developer mode off after queueing the error. Everything in this 398 campaign runs in developer mode, where the error screen prints the whole error 399 as JSON; without it the explanation is `userFacingMsg`, the hint and the 400 message concatenated, and an error carrying neither renders as the word 401 "Error" and two export buttons. wallet-core puts a bad request's reason in 402 `detail`, which the app keeps but never shows: 403 `release-error-screen-explains-nothing.md`. 404 405 Both defects are now oracles — `absence-after-error` (an empty state claimed 406 while the query behind it was failing) and `mixed-amount-notation` — so the 407 next round catches the class rather than the instance. 408 409 ### Two more screens reached by signing an address 410 411 The wallet picks a transfer screen purely from the payto method, so signing an 412 address at the exchange is enough to render it. A `payto://bitcoin/…` address 413 brought up the segwit instructions — and with them a defect: the amount is 414 relabelled, not converted, so a EUR 5.00 withdrawal reads "5.00 BTC" on the 415 screen and on the clipboard (`bitcoin-transfer-relabels-the-amount-as-btc.md`). 416 A `payto://cyclos/…` address covers the fourth and last transfer screen. 417 418 ### Scenarios added this iteration 419 420 `api_error_sweep`, `api_response_hostile` (a balance of €999,999,999,999.99 421 renders correctly, with grouping separators), `error_screen_without_dev_mode`, 422 `denom_loss_transaction` (the loss-of-funds transaction, which no stack can 423 produce), `exchange_turns_hostile` (the exchange's protocol version and master 424 key change under the wallet), `peer_push_abandon` (the only reachable path to 425 `failTransaction`: "Abandon" is offered on deposits and outgoing peer 426 payments, never on withdrawals), `contacts_add_and_forget`, 427 `wallet_lock_without_credential`, `revoke_denomination`. Ninety-one in total. 428 429 Three scenarios had been passing every round without recording a single 430 observation, which is indistinguishable from doing nothing; they now say what 431 they saw. And the random exploration had **never run in any round** — the 432 STOP file a queued phase sets breaks the loop before it, so it now runs first. 433 434 ## Iteration 8 — 69.7 %, and what a config change found 435 436 * **Coverage: 69.7 %** line (12018/17247), up from 66.0 %; branch 57.6 %, 437 class 73.9 %. The start of the campaign was 33.9 %. 438 * What is left is mostly out of reach rather than untried: about 190 lines have 439 **no caller at all** (`PromptAddContactScreen`, `GridMenu`, 440 `DemandAttention`, `SelectExchangeDialogFragment`, and 441 `SelectionModeTopAppBar` — the transaction list implements selection mode 442 inline instead), and another ~350 need a 443 service this stack has not got (the GNUnet mailbox, donau statements, the 444 Taler directory). 445 * The app's *sending* side of the mailbox (`sendTalerUriMailboxMessage`) looked 446 dead and is not — see iteration 10. It hangs off a developer-mode-only button 447 labelled "Contacts" on a peer-push QR screen, which is why no scenario had 448 found it. 449 * The measurement itself was losing data: coverage accumulates in the app 450 process, so every scenario that wiped the app mid-run threw away what it had 451 exercised — `WalletInitErrorScreen` read 0 % although `db_corruption` 452 renders it, word for word. `fresh_start` now dumps first. 453 454 ### A signed address found a real defect 455 456 Signing a `payto://cyclos/…` account — done to reach the last transfer screen 457 — broke the **deposit** form in the next round: 458 459 ``` 460 E taler-wallet: Error getDepositWireTypes TalerErrorInfo(code=NONE, hint=, 461 message=kotlinx.serialization.SerializationException: 462 net.taler.wallet.deposit.WireType does not contain element with name 'cyclos') 463 ``` 464 465 One unrecognised wire method makes the whole reply undecodable, so the 466 add-account form sits on its spinner for ever with no message. `WireType` has 467 an `Unknown` member for exactly this case and it can never fire, because the 468 property that decodes into it has no default value and `coerceInputValues` 469 only coerces to a declared default. Two more enums have the same shape 470 (`WithdrawalOperationStatusFlag`, `ExchangeTosStatus`). 471 472 The Cyclos address is therefore opt-in: leaving it signed blocks every deposit 473 scenario. `findings/unknown-wire-method-hangs-the-deposit-form.md` has the 474 one-line reproduction. 475 476 ### Random exploration, now that it runs in a round 477 478 48 finding lines on its first in-round run, and **19 of them were about 479 Chrome**: a tap had opened a browser (a KYC link, "Open in banking app") and a 480 random walk has no reason to come back, so the oracles spent the run reading 481 Chrome's search suggestions ("undefined behavior", "undefined label") and 482 tapping its settings. The screen oracles now only apply to the app's own 483 screens, `silent_failure` likewise, and the explorer notices it has left and 484 relaunches. 485 486 ### Three more defects 487 488 * **`purge-destroys-coins-and-history-without-saying-so.md`** — "Force 489 deletion (purge)" destroyed €9.87, the payment service and every transaction 490 made with it, leaving the first-run welcome screen. The dialog is a title, a 491 checkbox and two buttons, with no body text at all. 492 * **`suspended-looks-like-completed-in-the-list.md`** — the transaction list 493 has no branch for `Suspended`, so a suspended withdrawal's row reads 494 "Waiting for confirmation" — the opposite of what is happening. 495 * **`unknown-wire-method-hangs-the-deposit-form.md`**, above. 496 497 And `failTransaction` is now pinned down rather than guessed at: wallet-core 498 offers "Abandon" only for deposits that are aborting, suspended-aborting or 499 waiting on aggregate KYC (`deposits.ts:955-1000`), none of which this stack 500 produces, because the aggregator finalises a deposit at once. A withdrawal 501 never offers it; an outgoing peer payment offers Retry/Abort/Suspend while 502 live and Resume/Abort once suspended. 503 504 ## Iteration 9 — the two services the stack was missing 505 506 `taler-unified-setup.sh` brings up the exchange, merchant, bank, donau and 507 auditor. The wallet has screens for two more services, and both are now 508 deployed beside the stack (`backend/services/README.md`): the **Taler 509 mailbox** (`git://git.taler.net/taler-mailbox`, port 11000) and the **Taler 510 directory** (`git://git.taler.net/taldir`, port 11001), each Go, each with its 511 own Postgres database, both outliving a stack restart. 512 513 `sync` was deliberately *not* deployed: the Android wallet has no backup or 514 sync feature — no screens, and no backup operation in 515 `coverage/app-operations.txt` — so there would be nothing to drive. 516 517 ### The mailbox pays off directly 518 519 Its URL is the one service address the app lets the user type in, so no DNS or 520 TLS work was needed. The wallet registers itself on first use and shows its own 521 address: 522 523 ``` 524 http://localhost:11000/V8K0FT9X8DP44T4SW7VK40XVNJPGTMNFQB24GC34DFP7VNNBG70… 525 ``` 526 527 `mailbox_roundtrip` does the whole thing: configure the URL, let the wallet 528 register, have the **CLI wallet** encrypt a `taler://pay-push` URI for that 529 address and post it, refresh, read and delete. The sender has to be another 530 wallet: the app's own `sendTalerUriMailboxMessage` has no caller in the UI, and 531 a hand-made POST cannot stand in for it, because the app fetches a message it 532 cannot decrypt, deletes it from the server and says nothing — the right 533 instinct for a public drop box, and the reason the first two attempts showed 534 "No messages yet.". 535 536 Three facts that cost an hour each are in `backend/services/README.md`: 537 wallet-core resolves `localhost` to `::1` while both services bind 538 `127.0.0.1`; every `GetDuration`/`GetAmount` in the mailbox server errors out 539 when its key is absent, default or not; and `taldir-dbinit` reads 540 `[taldir-pq]` while `taldir-server` reads `[directory-pq]`. 541 542 ### The directory proves a point instead 543 544 Deployed, with a validator script that records each challenge where the driver 545 can read it — the simulator's stand-in for a validation email — the three 546 operations the app can never reach round-trip through wallet-core on the first 547 attempt: 548 549 ``` 550 registerAlias -> {} (202, challenge recorded) 551 completeRegisterAlias -> {} 552 lookupAlias -> {"targetUri": "http://127.0.0.1:11000/SIMADDRESS"} 553 ``` 554 555 So the feature is finished and the protocol is fine; the app is the only thing 556 that cannot be pointed at a directory. That is now in 557 `alias-registration-hardcodes-the-directory.md` as evidence rather than 558 conjecture. 559 560 Getting there needed one character changed in the service: 561 `taldir-protocol-version-mismatch.md` — its `/config` hard-codes protocol 562 `0:0:0`, wallet-core's client declares `1:0:0` and refuses anything 563 incompatible, and `taldir.ts` replaces the precise reason with "could not read 564 the configuration of the directory service". 565 566 ### Answering for a hard-coded name, without touching the app 567 568 `simulator/tls/` is a TLS front end that routes by `Host` and serves a 569 certificate for `taldir.gnunet.org` and `mailbox.gnunet.org` from the 570 simulator's own CA; `emu/tls-names.sh` roots one emulator, bind-mounts a hosts 571 entry over `/system/etc/hosts` and forwards the device's port 443 to the front 572 end. The CA is trusted because the `sim` build type — the simulator's own, 573 never published — bundles it as an extra trust anchor. No URL the app uses 574 changes, so `alias_registration_real` drives the shipped code path: register, 575 read the challenge from the validator's log, complete, look up. 576 577 Installing the CA into the *device's* store was tried first and abandoned after 578 two measurements, both written up in `tls/README.md`: a mount made from `adbd` 579 is invisible to app processes (APEX paths have their own mount namespace, so it 580 has to be made under `nsenter --mount=/proc/1/ns/mnt`), there are two system 581 stores and the app reads the one that is not the APEX — and the framework 582 restart needed to make zygote see either leaves the network at 583 `PARTIAL_CONNECTIVITY`, where the wallet refuses everything with "This action 584 requires internet connection". A trust anchor in a test-only build type costs 585 none of that. 586 587 ### Two more harness defects, both of which hid behaviour 588 589 * **Clearing a pre-filled field needs the caret at the end.** Tapping a 590 Compose field puts it in the middle and `KEYCODE_MOVE_END` does not move it, 591 so deleting backwards left the tail: `https://mailbox.gnunet.org` became 592 `http://localhost:11000unet.org`. That mistake is how the mailbox screen was 593 caught printing a QuickJS stack trace to the user 594 (`release-error-screen-explains-nothing.md`). 595 * The **silent-failure oracle** was reporting taps on plain text — "Pending:", 596 a timestamp, a section header — as findings: 24 lines in round 13. It now 597 requires the tapped label to resolve to something clickable. 598 599 The exploration fixes from iteration 8 held: round 13's random walks produced 600 **no findings about Chrome at all**, where round 12 produced 19, and 601 `return_to_app` fired six to ten times per worker. 602 603 ## Iteration 10 — the app reaches the directory, and a crash nobody had to look for 604 605 ### The shipped code path, against a real directory 606 607 Iteration 9 proved the directory's three operations work by calling wallet-core 608 directly. This time the **app** did it, with no URL changed: the emulator 609 resolves `taldir.gnunet.org` to a TLS front end, and the `sim` build type — the 610 simulator's own, never published — carries that front end's CA as an extra 611 trust anchor. The proxy log is the witness: 612 613 ``` 614 POST taldir.gnunet.org/register/email <- the "Register Alias" button 615 POST taldir.gnunet.org/FAVWP84VPPY4… <- the challenge, typed in 616 GET taldir.gnunet.org/FAVWP84VPPY4… <- "Lookup with Taldir" 617 ``` 618 619 and the screens followed: `Challenge Solution` → `Registration successful!` → 620 an `Add Contact` form filled in with the alias and the mailbox address behind 621 it. **No findings.** The feature works; the hard-coded URL is the entire 622 defect, which is now written into 623 `alias-registration-hardcodes-the-directory.md` with the evidence. 624 625 Two blind alleys were worth the time it took to rule them out, both now in 626 `tls/README.md`: a trust store mounted from `adbd` is invisible to app 627 processes (APEX paths have their own mount namespace), and there are *two* 628 system stores of which the app reads the one that is not the APEX. The 629 framework restart needed to make either visible leaves the network at 630 `PARTIAL_CONNECTIVITY`, where the wallet refuses everything with "This action 631 requires internet connection" — which looks exactly like a wallet bug and was 632 briefly mistaken for one. 633 634 ### Changing the language locks the wallet out of its own database 635 636 Found by accident, setting up a translation test: 637 `config-change-locks-the-wallet-out-of-its-database.md`. Changing the app's 638 language, the system font size or the display size while the wallet is open 639 lands it on the **Initialization error** screen, under 640 641 ``` 642 code 7001 "could not acquire exclusive ownership of the wallet database; 643 another wallet process may still be using it" 644 ``` 645 646 The screen replaces the whole app and says "Please retry" while offering only 647 *Export logs* and *Export database*; the only way back is to kill the app. Two 648 of the three triggers are accessibility settings. 649 650 The cause is two lines of lifecycle that disagree. `onDestroy` deliberately 651 keeps wallet-core alive across a configuration change — 652 653 ```kotlin 654 // wallet-core belongs to the retained MainViewModel, not to this activity 655 if (!isChangingConfigurations) model.stopWallet() 656 ``` 657 658 — while `onCreate` calls `model.startWallet()` unconditionally, which sends a 659 second `init`. The pid is unchanged across the whole thing (measured), so the 660 error's "another wallet process" is this very process. Dark mode and rotation 661 are safe only because `uiMode` and `orientation` are already in the activity's 662 `configChanges`. 663 664 This is the first defect in the campaign that a user can hit by changing a 665 system setting, and the first one found while building a test for something 666 else entirely. 667 668 ### Two whole features cannot be translated 669 670 `contacts-and-mailbox-cannot-be-translated.md`: 34 user-visible strings in 671 `contacts/`, `mailbox/`, the two settings entries that open them, the 672 transaction list's selection counter and a couple of error messages are string 673 literals in the Compose sources, not entries in `strings.xml`. The wallet ships 674 19 translations; none of them can reach these. Neither defence in the repo can 675 see it — `./check-translations.py` reads only `values*/strings.xml`, and 676 lint's `HardcodedText` check only looks at layout XML, of which Compose has 677 none. `AliasRegistrationScreen.kt`, in the same package, uses `stringResource` 678 for all of its labels, so this is drift rather than convention. 679 680 The reproducer's own navigation is the demonstration: it needs 681 `Settings|Einstellungen` to get around a German wallet, and plain English for 682 `Contacts`, `Mailbox` and everything behind them. 683 684 ### Three operations that no scenario could reach 685 686 `registerAlias` and `lookupAlias` now run (above). Two more needed the right 687 state rather than a service: 688 689 * **`failTransaction`** is the "Abandon" button, and wallet-core offers it only 690 while an abort is *in progress* — never for a withdrawal waiting on the bank, 691 which is what `withdraw_abandon` kept recording. An abort against a healthy 692 exchange finishes too fast to catch, so `abandon_aborting_deposit` takes the 693 wallet offline first. 694 * **`getBankAccountById`** is only called when the add-account screen is opened 695 with an existing id, and nothing is labelled "Edit": the account *row* is the 696 button. `bank_accounts` now taps it, checks the form came back filled, and 697 saves a change. 698 699 `sendTalerUriMailboxMessage` is reachable too, by a path worth writing down 700 because it is easy to conclude it is not: a peer-push transaction's QR screen 701 shows a *forward* button **in developer mode only**, and only for a 702 `pay-push`/`pay-pull` URI 703 (`compose/QrCodeUriComposable.kt:183`); it navigates to the contacts screen 704 with the URI, and confirming a contact there calls 705 `mailboxManager.sendMessage` (`contacts/ContactScreen.kt:203`). The button is 706 labelled "Contacts", which is why it does not read like a send button. 707 `forward_payment_to_contact` now drives it. 708 709 ### Five scenarios were passing without doing anything 710 711 The worst defect of this iteration was in the harness, and it had been hiding 712 behaviour for thirteen rounds. Five scenarios drove their flow, *noted* what 713 they saw, and reported "ok" whether or not anything happened: 714 715 | Scenario | What it never did | Why | 716 | --- | --- | --- | 717 | `deposit` | deposited | the payto link it used is one the wallet refuses (`payto-link-only-accepts-iban.md`) | 718 | `deposit_bad_payto` | deposited | the submit button on that screen is **Send**, not Deposit, so the tap went nowhere | 719 | `peer_push_receive` | received | "Receive payment" is both the heading and the button, and the heading came first | 720 | `bank_accounts` | added an account | the unmarked required "Note" field left the submit disabled (`add-account-note-is-required-but-unmarked.md`) | 721 | `deposit_methods` | added any of its three | the same, plus the Bitcoin tab's fields filled in the wrong order | 722 723 Three of the five were hiding a genuine app defect behind the green row. Two 724 were purely my own mistakes. Either way the lesson is the same one iteration 7 725 already wrote down and did not apply widely enough: **a scenario that only 726 notes what it sees cannot fail.** 727 728 `peer_push_receive` is the sharpest case, because it *had* a check: 729 730 ```python 731 if home.find(r"(?i)0\.00|Welcome") is not None and home.find(r"€") is None: 732 c.note("WARNING: the received payment did not reach the balance") 733 ``` 734 735 It asks for a screen with no `€` anywhere — which a zero balance, rendered 736 "€0.00", never is. The condition could not fire, and the note it guarded was a 737 warning rather than a failure in any case. It now polls the balance and raises. 738 739 Each of the five now asserts: a bank balance that must increase, a wallet 740 balance that must become non-zero, an account that must appear in the list. 741 742 ### The measurement was quietly broken, twice 743 744 * **One truncated `.ec` file lost a whole campaign's coverage.** A dump whose 745 app was killed mid-write leaves a partial file, and jacoco's `merge` aborts 746 on the first one it cannot read — taking the other 1099 files' data with it. 747 `coverage/validate_ec.py` now walks each file's block structure and keeps 748 only the complete ones (it found exactly the one bad file), and 749 `driver/coverage.py` refuses to write a dump that is not execution data. 750 * **`merge` appends to an existing `--destfile`.** A first attempt to merge in 751 batches reused two scratch files and so doubled the data every other batch: 752 4 MB of execution data became 11 GB before it was noticed. Each destination 753 is now removed first. 754 * **Rebuilding the APK starts a new coverage baseline.** Jacoco matches data to 755 classes by a checksum of the class file, and adding the two `src/sim/res` 756 files shifted the inlined `R` constants, so data from the old APK is dropped 757 with "Execution data for class … does not match". Reporting rounds 1–13 758 against the new build reads 49.7 % where the same data read 69.7 % against 759 the build that produced it. The figure to compare from here on is the one 760 measured over rounds 14 and later; the caveat is recorded in `report.sh` so 761 the next person does not chase it. 762 763 ## Iteration 11 — what the remaining 30 % actually is 764 765 **Coverage: 69.8 % line** (12041/17247) on the new APK, measured twice over two 766 independent rounds with the same figure, so the measurement is now stable 767 enough that a real gain is distinguishable from noise. 768 769 The more useful number is what is left. Of the 5206 missed lines, **1404 are 770 inside `@Preview` bodies** — functions that exist for Android Studio's preview 771 pane, which nothing calls and which no instrumented run can ever execute: 772 773 ``` 774 overall lines: 12041/17247 (69.8%) 775 of the 5206 missed lines, 1404 are inside @Preview bodies and cannot run at all 776 reachable lines covered: 12041/15843 (76.0%); the highest this report can ever read is 91.9% 777 ``` 778 779 So the campaign has covered **76 % of the code that can run**, and 91.9 % is the 780 ceiling of the figure everyone quotes. `coverage/gaps.py` now says this on every 781 run, because a ranking that counts preview bodies points at work nobody can do: 782 `ScreenTransfer.kt` leads the "missed" table with 135 lines, and 106 of them are 783 its five previews. 784 785 A further ~300 lines are unreachable for a second reason — they have no caller. 786 That list keeps growing as scenarios reach further: 787 `PromptAddContactScreen`, `GridMenu`, `DemandAttention`, 788 `SelectionModeTopAppBar`, `SelectExchangeDialogFragment` (the last 789 DialogFragment in the app, and the premise `withdraw_pick_exchange` was built 790 on), and `DonauStatementScreen` + `DonauStatementComposable`, which are dead 791 because the button that should open them is wired to a no-op 792 (`donation-statements-button-is-wired-to-nothing.md`). 793 794 ### What the de-vacuumed scenarios bought 795 796 Round 16 ran with most of iteration 10's fixes and moved the headline by six 797 lines, which looks like nothing until the per-class diff is read: 798 799 | | before | after | 800 | --- | --- | --- | 801 | `TransactionPeerPushCreditKt` | 0 % | 44.7 % | 802 | `PeerManager$confirmPeerPushCredit$1` | — | 100 % | 803 | `TransactionPeerPullDebit` | — | 78.3 % | 804 | `WithdrawalShowInfoKt` | — | 63.3 % | 805 | `peer` package, missed lines | 482 | 448 | 806 | `transactions` package, missed lines | 751 | 719 | 807 808 `confirmPeerPushCredit` at 100 % is the proof that the peer payment is now 809 accepted rather than merely prompted, and `bank_accounts` reached the edit form 810 and saved a change — which is `getBankAccountById`, one of the operations no 811 scenario could reach before. 812 813 139 lines moved the other way across 28 classes. Most is run-to-run variance, 814 but one was a real defect in the fix: `deposit_methods` reported "no Bitcoin 815 tab", because a successful submit closes the form and returns to the account 816 list, so the first case that worked left the later tabs with nothing to tap. 817 Each wire method now reopens the form. 818 819 ### Two features that had never been driven at all 820 821 * **Tap-to-pay.** `MainActivity` has three external entry points -- a VIEW 822 intent, shared text, and `NfcAdapter.ACTION_NDEF_DISCOVERED` -- and the third 823 had never been used, although the sim build has shipped a `SEND_NDEF` hook 824 for exactly it since the harness was written (the URI travels in a Parcelable 825 `NdefMessage`, which `am start` cannot build). `nfc_tap_to_pay` now delivers 826 a real order over NDEF and requires it to be *paid*, then taps three hostile 827 tags. All four behave: the order is paid, and a plain website, a bare 828 `taler+http://pay/` and a non-existent order each produce their own error 829 (`Unsupported URI`, 7008, 21). 830 831 * **Database import.** `settings_import` had been reaching the document picker 832 and tapping a label matching the file name -- which DocumentsUI also uses for 833 the thumbnail ("Preview the file <name>") -- so nothing was selected, 834 `importDb` never ran, and the scenario noted "after importing" while still 835 sitting in the picker. Fixed, the export/import round trip **works**: a wiped 836 wallet comes back with its €9.87 and its transaction. 837 838 ### Nearly a serious finding, and why it was not 839 840 The import work is worth recording as a discipline lesson, because for about 841 twenty minutes the evidence looked like the worst defect of the campaign: a 842 funded wallet exported 526 KB, was wiped, imported that file, and stayed 843 empty -- across a relaunch -- while `importDb` returned `result: {}`. 844 845 It was not a defect. Three separate mistakes in the driving produced it: 846 847 | assumed | actually | 848 | --- | --- | 849 | `adb shell rm` clears old exports from the picker | the shell sees its own scoped view; the picker lists MediaStore, which keeps everything the app wrote | 850 | the picker lists oldest first, so `rows[-1]` is the newest | it lists **newest** first -- `rows[-1]` was the oldest export, taken from an empty wallet | 851 | `Screen.tap_target` selects the row | it resolves to a neighbour that dismisses the picker to the launcher, so no import happened at all | 852 853 The second one is the trap: the app faithfully imported an export of an empty 854 wallet, which is indistinguishable from an import that lost everything. The 855 check that caught it was reading the `importDb` *request* -- `"tables": 856 {"bank_accounts": [], …}` -- rather than trusting the screen. Every step of 857 that probe is now asserted separately (which file, which activity, which call, 858 which reply), and `pick_file_in_picker` carries all three findings in its 859 docstring. 860 861 ### The operation census was lying, in both directions 862 863 `coverage/operations.py` counts wallet-core operations from the logcats the 864 episodes save, and it read **66 of 71** exercised with five never reached. Two 865 of those five were wrong: 866 867 * `updateExchangeEntry` fires **forty times** when the exchange menu's "Reload 868 information" is tapped -- which `exchange_reload_global` has been tapping 869 every round. It read as unexercised because `episode.py` kept only the last 870 2 MB of logcat, and in a chatty scenario that cuts the start. The wallet's 871 own lines (`taler-wallet`, `BackendManager`, `SimHooks`) are now kept in 872 full to 4 MB, with the rest of the system log keeping its tail. 873 * `clearDb` was genuinely unreached, because `settings_reset_cancel` only ever 874 cancelled. `settings_reset_confirmed` now carries the dialog through -- and 875 found that both of the app's `MaterialAlertDialogBuilder` dialogs put the 876 destructive action in the *negative* slot, which Material draws on the left 877 where Cancel belongs 878 (`reset-dialog-puts-the-wipe-where-cancel-belongs.md`). 879 880 Of the three that remain, two are blocked by defects already written up 881 (`getDonauStatements` by the no-op button, `sendTalerUriMailboxMessage` by the 882 `taler://`-only prefix test), and one is out of reach of this environment 883 altogether: `cancelProgressToken` has a single caller, 884 `cancelDatabaseMigration`, and a migration is only offered to a wallet whose 885 database is still the IndexedDB emulation. `MainViewModel` hard-codes 886 `useNativeDb = true` so a new install never has one, and `taler-wallet-cli` 887 writes the native schema as well -- nothing here can manufacture the legacy 888 format. That also keeps the migration UI in `MainViewModel` and 889 `MainActivity` unreachable, which is a fair slice of their missed lines. 890 891 ### Measurement notes worth keeping 892 893 * **Two jobs on one emulator look exactly like app defects.** Twice a scenario 894 landed on the welcome screen and a probe timed out inside `flows.withdraw`, 895 and both times the cause was a second run driving the same device. One job 896 per worker. 897 * `Wallet.dev_mode_on()` reads the marker on the *current* screen, so it 898 returns False on the home screen whatever the setting is. It is only 899 meaningful inside Settings. 900 * The transaction list is **on the main screen** under "Recent transactions", 901 which is what `transaction_rows` keys on; the "All" chip navigates to a 902 different screen where that header does not exist and every row goes missing. 903 904 ## Iteration 12 — the last few operations, and three features nothing had driven 905 906 **Coverage: 70.0 % line** (12075/17247) after round 17, **76.2 % of the 907 reachable lines**. Each of the iteration's fixes shows up on its own in the 908 per-class diff, which is the useful way to read a +34-line round: 909 910 | | | 911 | --- | --- | 912 | `TransactionManager$failTransaction$1` | **100 %** — "Abandon" finally reachable | 913 | `SettingsManager$importDb$1` | 60 % — the database import runs | 914 | `SettingsManager$clearDb$1` | the wallet reset, confirmed rather than cancelled | 915 | `SimHooks` | 81.6 % — the NDEF hook, used for the first time | 916 | `QrCodeUriComposableKt` | 98.4 % | 917 | `HandleUriScreenKt$getTalerAction$2` | the hostile-tag URIs | 918 | `MainActivity` | 76.0 % | 919 920 **Wallet-core operations: 69 of 71.** The three that were outstanding are 921 settled: `clearDb` and `failTransaction` are exercised, and 922 `updateExchangeEntry` turned out to have been exercised all along (see below). 923 What remains is `getDonauStatements` and `sendTalerUriMailboxMessage`, both 924 blocked by defects already written up, and `cancelProgressToken`, which no 925 wallet in this environment can reach. 926 927 ### Where the Abandon button actually lives 928 929 `failTransaction` took three attempts because the state it belongs to is 930 narrow. A deposit against a reachable exchange finishes in under four seconds, 931 so the network has to go away *between entering the amount and submitting*; 932 and `abortTransaction`'s success handler navigates back, so the transaction has 933 to be reopened afterwards to see what it now offers: 934 935 ``` 936 pending -> Retry, Suspend, Abort 937 aborting -> Retry, Abandon, Suspend <- the only state that offers it 938 abandoned -> "This transaction has failed or been abandoned" 939 ``` 940 941 The money is really gone afterwards (€9.87 -> €8.87), which is what the 942 dialog promises. That raised a question rather than a finding, recorded under 943 `aborted-credit-shows-the-whole-amount-as-fee.md`: the amount is honest, but 944 the exchange never completed the deposit, so the €0.02 "Fee" row is doubtful. 945 946 ### Three features the stack could not present 947 948 Twice more the "uncovered" code turned out to be unreachable by configuration 949 rather than untested, which is the same lesson as the wire fees and the terms 950 in earlier iterations: 951 952 * **The terms language selector** only renders when the exchange offers more 953 than one language, and the shipped `exchange-tos-v0` has an English source 954 only. `exchange-tos-tops-v0` ships de and en, so `stack.sh` now renders both 955 (`SIM_TERMS_ID`, `SIM_TERMS_LANGS`) and `exchange_tos` picks the other 956 language and checks the body text changes. 957 * **`ExchangeShoppingScreen`** needs a *scope* carrying two shopping URLs; one 958 URL opens a browser instead. Both exchanges now advertise one, which is why 959 the card appears at all, and what is still missing is written in the 960 scenario. 961 * **`DummyTransaction`** is what `TransactionSerializer` falls back to when a 962 transaction will not deserialize, so it needed a transaction the app cannot 963 parse: `transaction_states_rendered` now injects an unknown type and a 964 withdrawal missing its amounts. 965 966 ### A warning that was not a defect 967 968 `denom_loss_transaction` had been reporting "WARNING: the loss event appears in 969 no transaction list" every round. It is not a defect: the dev experiment 970 inserts the event for **TESTKUDOS** -- the database row's own `currency` column 971 says so -- and a wallet holding EUR has no scope to show it under. The scenario 972 now says that, with the currency it found. Rendering `TransactionDenomLoss` 973 needs a loss in a currency the wallet holds, which means a denomination 974 expiring under it. 975 976 ### Still to do, in order 977 978 1. Keep rounds running and triage what they surface. 979 2. `alias_registration_real` against the TLS front end, and the coverage the 980 contacts package then reaches. 981 3. The revocation phase, with the wallet asked to reload the exchange: a 982 revoked denomination left no trace in the first minute. 983 3. A destructive phase for `revoke_denomination`: an exchange that withdraws a 984 denomination under a wallet holding its coins, which is the only way to 985 reach the recoup path. 986 4. The remaining untouched screens are mostly things no service in this stack 987 can produce: Cyclos transfers, the GNUnet mailbox, and the database 988 migration prompt (which needs a wallet database in the old IndexedDB 989 format). 990 991 ## The camera path, taken apart without a camera 992 993 A report arrived that scanning works on Android 15 but not on Android 14. The 994 campaign cannot answer that directly: the emulator's virtual scene camera 995 cannot be aimed at a code, so the live-camera route behind `qrsuite.py 996 --camera` has never run unattended, and the QR suite's default route decodes a 997 *bitmap* through the gallery — a different decoder that never touches the 998 camera arithmetic. Pointing the gallery route at API 34 and API 36 gave 10 of 999 10 on both with identical screens, which says nothing about the report and 1000 everything about why it had to be approached another way. 1001 1002 So the pipeline was rebuilt instead. A camera frame is a luminance plane plus 1003 `rowStride` and `pixelStride`, and nothing in `QrCameraAnalyzer` after that 1004 point is Android-specific — the conversion, the rotation and zxing are all 1005 plain JVM code. `findings/repro_qr_plane_strides.java` builds a frame with a 1006 real QR code in it, lays it out the way hardware is free to, and runs the 1007 app's own arithmetic over it. That turned a code-reading suspicion into 1008 measurements, and it surfaced more than the suspicion: 1009 1010 * **Padding kills it outright.** Row padding of 16, 32, 64 or 128 bytes: 1011 not one frame decodes. The same frame decodes the moment the stride is 1012 honoured. Interleaved samples likewise. 1013 * **A padded frame held upside down throws.** `rotateNV21`'s 180° branch walks 1014 the chroma tail out to the padded `data.size` and runs off the end of an 1015 array it sized from `width * height`. Because `proxy.close()` sits in the 1016 *decode* `try`'s `finally`, that throw leaks the frame, and with 1017 `STRATEGY_KEEP_ONLY_LATEST` CameraX then never delivers another one — the 1018 scanner is dead for the life of the screen while the preview keeps running. 1019 Nothing in the wallet's manifest locks the orientation, so it is reachable. 1020 * **The rotation was never needed.** zxing finds a QR code by its finder 1021 patterns and takes the orientation from them: all four orientations decode 1022 untouched. The rotation that caused the crash bought nothing, which makes 1023 deleting it the fix rather than repairing it. 1024 * **And the obvious repair would have been worse.** The tempting replacement, 1025 `PlanarYUVLuminanceSource.rotateCounterClockwise()`, throws 1026 `UnsupportedOperationException` — zxing does not implement rotation for that 1027 source, in 3.5.3 or 3.5.4. 1028 1029 That last one was worth checking because the **merchant terminal already does 1030 it.** `ConfigFragment` keeps its own copy of the pipeline, with the same 1031 stride-blind conversion plus a `rotateCounterClockwise()` call sitting outside 1032 the `try`. On a device whose back camera sensor is oriented 0° — common on 1033 tablets, which is what a terminal usually is — the first frame throws, the 1034 proxy leaks, and scanning the configuration QR code, the normal way to 1035 provision a terminal, has never worked. Two findings, two patches, both 1036 verified to compile and lint: `qr-camera-ignores-the-plane-strides` (now with 1037 nine unit tests, five of which encode a real code into a synthetic frame) and 1038 `pos-config-scanner-asks-for-a-rotation-zxing-refuses`. 1039 1040 What this still does not establish is that either is *the* reported bug. The 1041 two numbers that would settle it — `rowStride` and `width`, on the two 1042 platforms — can only be read on the devices in the report, so both findings end 1043 with the attended tests a developer should run, ordered to separate causes 1044 rather than to confirm the guess. 1045 1046 ### The version matrix, and what API 24 showed 1047 1048 `driver/matrix.py` runs the platform-sensitive scenarios on one emulator per 1049 API level, the levels being the ones where the app's own code forks (24, 26, 1050 28, 29, 30, 31, 33, 34, 36, each justified in `API_LEVELS` by the branch that 1051 needs it). Its first run never got past the first level: the API 24 emulator 1052 spent 1200 seconds booting and never finished, with its log full of 1053 1054 ``` 1055 ERROR | Unsupported camera format for virtual scene views 825382478 1056 ``` 1057 1058 825382478 is the NV21 fourcc, so the virtual scene camera — configured so that 1059 a QR code *can* be shown to the device — is asking the image's camera service 1060 for a format it will not produce. That is **not** established as the cause of 1061 the timeout: the API 26 emulator logs the same error eight times and boots 1062 fine. So the error is at most a suspect. `emu.sh` now picks the camera backend 1063 from the image's API level anyway, virtualscene from 26 up and the old emulated 1064 camera below, because no scenario in the matrix needs to decode from it and it 1065 removes one difference between a level that boots and one that does not. The 1066 API 24 level is queued for a retry on that configuration, which is what will 1067 actually say whether the camera was involved. 1068 1069 ## Iteration 19 — a number that was counting the wrong thing 1070 1071 101 scenarios, 0 driver errors, and the round reported **7 serious findings**, 1072 up from 5. Every one turned out to be a kind already written up: 1073 `fee-on-dead-transaction` (`aborted-credit-shows-the-whole-amount-as-fee`), 1074 `mixed-amount-notation` (`amounts-without-currency-specification`), 1075 `glued-currency` (`word-currency-symbol-glued-to-amount`), and a refresh 1076 failing with 7029 `WALLET_REFRESH_GROUP_INCOMPLETE` plus its retry 1077 (`refresh-fails-on-mixed-age-denominations`, which is wallet-core's). 1078 1079 The two remaining ones were the harness's fault, and not in an interesting way: 1080 1081 ``` 1082 *** [unfinished-transaction] withdrawal_groups WQWFW8YK… unfinished after 255s (status 16777219) 1083 *** [unfinished-transaction] withdrawal_groups WQWFW8YK… unfinished after 260s (status 16777219) 1084 ``` 1085 1086 16777219 is `0x0100_0003`, `WithdrawalGroupStatus.PendingQueryingStatus` — 1087 "querying reserve status with the exchange". The scenarios that produced it, 1088 `withdraw_account_details` and `withdraw_account_tabs`, create a **manual** 1089 withdrawal and deliberately never wire the money: their subject is the transfer 1090 instructions screen. A withdrawal waiting for a transfer that is never made 1091 stays pending by design, which is exactly why `unfinished-transaction` is 1092 listed in `oracles.INFORMATIONAL`. 1093 1094 The round tally did not use that list. `oracles.Session.serious` filters on 1095 `INFORMATIONAL`, while the suite's own summary line filtered on 1096 `kind != "error-screen"` — two rules for one word, and the narrower one made 1097 every deliberately-pending withdrawal a serious finding, twice a round, to be 1098 re-triaged each time. The suite now uses `oracles.INFORMATIONAL` as well. 1099 1100 Worth stating plainly: this inflated every "serious findings" count this 1101 campaign has reported for scenarios that leave a manual withdrawal pending. 1102 Nothing was *missed* — `stuck-operation` and `background-error`, the kinds that 1103 catch a genuine stall, are untouched — but the number was larger than the 1104 defects behind it. 1105 1106 ### A patched build, on a device 1107 1108 `PATCHES.md` had to admit that none of the seventeen patches had run anywhere 1109 but a compiler. So the whole set was built into a `sim` APK 1110 (`:wallet:assembleFdroidSim` on a tree with every `.diff` applied) and run on 1111 worker 4 against the same stack, with `SIM_COVERAGE_DIR` pointing somewhere 1112 else — JaCoCo keys classes by a hash of their bytecode, so dumps from two 1113 builds cannot be merged into one report. 1114 1115 That pass has a second purpose. Two wallet-core operations had no caller the 1116 simulator could reach *because of* defects that are now patched: 1117 `getDonauStatements` sits behind the donation-statements button that was wired 1118 to nothing, and `sendTalerUriMailboxMessage` behind a forward button that only 1119 recognised one URI scheme. On the patched build both are reachable, which is 1120 also the only end-to-end check those two patches can get. 1121 1122 ### The last operation, and the database that unlocks it 1123 1124 `cancelProgressToken` had been written off as unreachable: it is only called 1125 when a database migration is cancelled, a migration only exists for a wallet 1126 database in the legacy IndexedDB-emulation format, and the note in iteration 12 1127 said `taler-wallet-cli` writes the native schema. That note was wrong — or 1128 rather, incomplete. wallet-core picks its backend from what the file already 1129 contains, and for *empty* storage the node host reads an environment variable: 1130 1131 ```bash 1132 TALER_WALLET_DB_BACKEND=indexeddb taler-wallet-cli \ 1133 --wallet-db legacy.db api getVersion '{}' 1134 ``` 1135 1136 produces a 53 KB SQLite file holding `object_data`, `object_stores`, `indexes` 1137 and 29 records — the legacy format, confirmed by its tables. 1138 1139 Planting that file made the wallet **refuse to start**, with the init error 1140 screen. The reason is not a defect, and it is the useful part of this: 1141 1142 ``` 1143 "hint": "unexpected exception (message: requested version 34, existing version is 36)" 1144 VersionError: requested version 34, existing version is 36 1145 ``` 1146 1147 The checkout beside this one is wallet-core 1.6.48, whose IndexedDB schema is 1148 version 36; the qtart the app embeds is 1.6.42 and asks for 34. IndexedDB does 1149 not open a database newer than the version requested, and refusing is right. 1150 A fixture therefore has to come from *the app's own core*, which is easy enough 1151 to arrange: build the app with `useNativeDb = false` in `MainViewModel`, launch 1152 it once, and copy `files/talerwalletdb.sqlite3` back out. That file carries 1153 `taler-wallet-main-v10` at version 34 — and the fixture has to be remade 1154 whenever the bundled qtart moves its schema version, which the scenario's 1155 docstring now says. 1156 1157 With that fixture, `db_migration_prompt` works end to end: 1158 1159 ``` 1160 - database now: -rw------- 1 u0_a216 u0_a216 57344 files/talerwalletdb.sqlite3 1161 - after relaunch: ['Upgrade wallet database?', 'The wallet can use a faster 1162 database. …', 'Migrate now', 'Later'] 1163 - after Later: [settings] 1164 - caught the migration in progress: False 1165 - the migration row is still offered: False 1166 ``` 1167 1168 So the prompt, the "Later" deferral, `migrateDatabase` and the switch to the 1169 native backend are all covered now, and the migration dialog in `MainActivity` 1170 — the last of the "screens nothing had driven" — is reached. 1171 1172 `cancelProgressToken` is still not. The `Cancel` that calls it lives on the 1173 progress dialog, and the migration finishes faster than the harness can tap: 1174 driving the `useNativeDb = false` build through a scenario first gave a 1.7 MB 1175 fixture with 512 records, the migration emitted 102 progress notifications, and 1176 even tapping blind at the button's coordinates — no screen dump, since a dump 1177 alone costs about a second — never landed while the dialog was up. That leaves 1178 **70 of 71 wallet-core operations exercised**, with the last one behind a race 1179 rather than behind a defect. A fixture of some thousands of records would 1180 probably win it; the big one is passed in with `SIM_LEGACY_DB` rather than 1181 carried in the repository. 1182 1183 One harness defect fell out of this. Both database oracles query the native 1184 schema, so against a wallet still on the legacy backend they reported 1185 `oracle-error: no such table: operation_retries` — a serious finding for a 1186 state the wallet can legitimately be in. `dbprobe.has_native_schema` now 1187 answers that question and both oracles return nothing instead. 1188 1189 ### Coverage after rounds 18 and 19 1190 1191 The report had not been regenerated since the morning, and the stale one was 1192 misleading in a way worth recording: run on the emulator host it printed 49.7 %, 1193 because `report.sh` resolves the checkout two directories above itself, which is 1194 the repository on a workstation and `/opt` on the emulator host — so it merged 1195 2400 dumps and then failed to find any class files. It also hard-coded the 1196 workstation's JDK path, which is why it died with "no such file or directory" 1197 after half an hour of validation. Both are fixed: Java comes from `JAVA_HOME` 1198 when that points at a real JVM and from `PATH` otherwise, and the merge can be 1199 done on the host while the report step runs where the build output is. 1200 1201 Merged over every dump from rounds 1–19: 1202 1203 ``` 1204 instruction 109639/150580 72.8% 1205 branch 3095/4923 62.9% 1206 line 12585/17247 73.0% 1207 method 2988/4530 66.0% 1208 class 743/942 78.9% 1209 ``` 1210 1211 73.0 % of lines, up from 70.0 %, and **79.4 % of the lines that can run at all** 1212 (1403 of the 4662 missed lines are `@Preview` bodies; the ceiling is 91.9 %). 1213 1214 Ranked by what is left: 1215 1216 ``` 1217 636 missed 69.0% ~.transactions 1218 526 missed 64.8% ~.payment 1219 432 missed 70.9% ~.peer 1220 369 missed 73.7% ~.compose 1221 289 missed 54.3% ~.transfer 1222 256 missed 38.2% ~.donau 1223 ``` 1224 1225 `~.donau` at 38.2 % is the lowest of any package, and most of what is missing 1226 there is behind the statements button that is wired to nothing. `~.transfer` at 1227 54.3 % is largely the Cyclos path, which no service in this stack can present. 1228 And checking the "untouched classes" list before writing scenarios for it turned 1229 up `ui-with-no-callers.md`: 189 lines of UI that nothing in the app refers to, 1230 including a second, unreachable implementation of the add-contact screen. 1231 1232 ### Still to do, as of round 20 1233 1234 Replacing the list at the end of iteration 12, two items of which are done: 1235 1236 * **`alias_registration_real` — done.** It has been passing since the TLS front 1237 end went in, end to end: register, challenge, complete, look up. 1238 1239 ``` 1240 - the form: ['email', 'Alias Type', 'Alias', '12', 'Duration (months)', 'Register Alias'] 1241 - after registering (challenge: WJY4TVQQ2D6TCJVBBXBN9R5974): ['Challenge Solution', 'OK'] 1242 - after completing: ['Registration successful!', 'OK'] 1243 - after the lookup: ['Add Contact', 'Looked up', 'Petname', 'sim-w1-…@example.com', 'Alias', …] 1244 ``` 1245 1246 * **The database migration prompt — done**, see above, with the fixture caveat. 1247 1248 * **The revocation phase and fault injection — queued as one job.** 1249 `run/phases.sh` waits for the round the loop is in to finish, waits for the 1250 version matrix to clear worker 6, then restarts the stack and runs 1251 `revoke_denomination` alone (it is stack-wide and lasts until the next 1252 restart), restarts it again from `sim-twister.conf` and runs the three 1253 twister scenarios, and finally restores the ordinary stack and puts the loop 1254 back at round 21. 1255 1256 The twister scenarios are worth saying something about: they have been in the 1257 suite for several rounds and **have been skipping every time**, because 1258 `twister_or_skip` looks for a `twister` entry in the stack's `env.json` and 1259 an ordinary stack has none. They were costing 30–60 seconds a round to 1260 report "the stack is not running twister; nothing to inject". That is the 1261 right behaviour — faults were to be the last avenue, after everything else — 1262 but it does mean no fault has been injected yet, and the phase above is the 1263 first time one will be. 1264 1265 * **What is left uncovered is now mostly explained rather than pending.** Three 1266 findings written this round account for a good part of it: 1267 `ui-with-no-callers` (189 lines nothing refers to), 1268 `refresh-transactions-are-never-listed` (a whole detail screen for a 1269 transaction type the app never asks wallet-core for), and 1270 `multi-qr-transfer-screen-cannot-be-reached` (a button gated on two QR codes 1271 where there can only ever be one). Cyclos transfers and the GNUnet mailbox 1272 remain genuinely absent from this stack, and `ExchangeShoppingScreen` still 1273 needs an exchange advertising two shopping URLs in one scope. 1274 1275 ### Round 20 — three scenarios written from the gap list 1276 1277 Reading the fresh report class by class rather than package by package paid off 1278 better than designing scenarios from the feature list did. 1279 1280 * **The overflow menu on a transaction detail screen.** It only exists when the 1281 transaction has a payto target, and its single item is the only caller of 1282 `copyToClipBoard` there. `transaction_details_by_type` now opens it on every 1283 detail screen it visits. 1284 1285 * **`manual_withdraw_transfer` stopped swallowing its own failures.** It tried 1286 four buttons -- "Wire transfer QR codes", "EPC QR", "Swiss QR bill", "Open in 1287 banking app" -- inside a `try: … except TimeoutError: continue`, so a button 1288 that had stopped working was indistinguishable from one that is not offered. 1289 It now says which, and the answer turned out to be the finding 1290 `multi-qr-transfer-screen-cannot-be-reached`. 1291 1292 * **`subscription_issued_and_viewed`, a new scenario.** The uncovered half of 1293 `TokenListScreen` is the pass (subscription) list, and nothing was buying a 1294 subscription: `payment_needs_token` creates a subscription family and 1295 *demands* the token, so the wallet never holds one. An order with a 1296 subscription token as its **output** does: 1297 1298 ``` 1299 - the merchant says the order was paid: True 1300 - passes: ['Simulator discount', 'subscription tokens issued by the simulator', 1301 'Provided by Simulator Shop', 'Active', 1302 'Valid until October 18, 2027 at 2:43 PM', …] 1303 ``` 1304 1305 One trap worth recording: the first version asserted the pass was called 1306 "Simulator pass", and it is called "Simulator discount". `create_token_family` 1307 answers 409 when the slug already exists and leaves the existing name alone, 1308 so the family that `payment_needs_token` created first keeps its name 1309 whatever a later scenario asks for. The assertion is now on a row having a 1310 validity, which is what actually says a pass is listed. 1311 1312 * **`balances_two_exchanges` now goes on to the shopping screen.** Same shape 1313 as the QR button: `MainScreen.kt:188` opens a browser when the scope has 1314 exactly one shopping URL and only navigates to `ExchangeShoppingScreen` when 1315 it has more, which needs both exchanges treated as global currency in one 1316 scope. The scenario does the treating already; now it taps the card and says 1317 which of the two happened. 1318 1319 #### The shopping screen, and what it says about the global-currency defect 1320 1321 `ExchangeShoppingScreen` (62 lines, untouched since the campaign began) is now 1322 covered, and getting there answered a question the findings had left open. 1323 1324 The card on the main screen only navigates to that screen when the scope 1325 carries more than one shopping URL, which needs both services in one currency 1326 scope — that is what "treat as global" is for. `balances_two_exchanges` was 1327 already treating both as global and getting nowhere, and the reason is the 1328 defect in `addglobalcurrencyexchange-null-masterpub.md`: the call sends 1329 `masterPub`, which is null until the exchange's `/keys` has been fetched, and 1330 `JSONObject.put` drops a null key, so wallet-core rejects the request. The 1331 second service had just been added by URL and never contacted, so its key was 1332 null every time. 1333 1334 With the scenario accepting the second service's terms and tapping "Reload 1335 information" first, it works: 1336 1337 ``` 1338 - 8081: reloaded 1339 - 8091: reloaded 1340 - the shopping screen: ['Your payment service offers the following website(s) …', 1341 'http://localhost:8080/config?shop=one', 1342 'http://localhost:8080/config?shop=two'] 1343 - 2 shopping URLs listed 1344 ``` 1345 1346 Which sharpens the finding: "treat as global" is not broken, it is broken for 1347 an exchange that has been added and not yet talked to — the state an exchange 1348 is in immediately after being added by URL, and therefore the state a user is 1349 most likely to try it in. 1350 1351 Two detection mistakes worth recording, both mine, both of the same kind. The 1352 first check for the screen looked for a node reading exactly "Where to pay", 1353 but the title is "Where to pay with EUR" — which is also what the card on the 1354 main screen says, so the title cannot distinguish the two screens at all. The 1355 screen is now recognised by its own message ("offers the following 1356 website(s)"). Before that, the note said the tap "left the app", which was 1357 wrong: the activity was still the wallet's, and the screen text in the very 1358 same note was the shopping screen's. A note that prints what it saw is worth 1359 more than a note that reports a conclusion. 1360 1361 #### The round tally counted work that was not the round's 1362 1363 Round 20 reported "147 ok, 1 driver errors, 8 serious findings", and three of 1364 those eight were things this session had done by hand on the spare emulator: 1365 the error screen of a *patched* APK, the oracle error from the deliberately 1366 too-new migration fixture, and the `history` run that built the big legacy 1367 database. `campaign.py`'s `collect()` merged **every** `suite-w*-summary.json` 1368 newer than the round's start, and a scenario run by hand writes one of those 1369 into the same directory. 1370 1371 It now filters by worker as well as by time — the round knows which emulators 1372 it launched. Recomputed over workers 0–3 only, round 20 is: 1373 1374 ``` 1375 205 scenarios, 205 ok, 9 findings, 5 serious 1376 *** background-error refresh 7029 WALLET_REFRESH_GROUP_INCOMPLETE 1377 *** stuck-operation the same refresh, retried 5 times 1378 *** fee-on-dead-transaction 1379 *** mixed-amount-notation 1380 *** glued-currency 1381 ``` 1382 1383 Five, all of kinds already written up, three of them already patched. That is 1384 the third measurement bug this campaign has found in itself — after the 1385 truncated logcat and the double-counting merge — and all three had the same 1386 shape: a number that was easy to read and quietly measuring something else. 1387 1388 ### The version matrix: three levels clean, four never booted 1389 1390 `matrix.py`'s first full pass over the nine API levels where the app's own code 1391 branches gave: 1392 1393 ``` 1394 API 24: ERROR boot timed out after 1200s 1395 API 26: 12 scenarios, 12 ok 1396 API 28: ERROR could not boot 1397 API 29: 12 scenarios, 12 ok 1398 API 30: ERROR could not boot 1399 API 31: 12 scenarios, 12 ok 1400 API 33: ERROR could not boot 1401 ``` 1402 1403 The pattern is the finding: **every second level** failed. That is not how 1404 platform incompatibility behaves; it is how a teardown that does not wait 1405 behaves. `emu.sh kill` ran `adb emu kill`, which returns as soon as the 1406 emulator's console accepts the request, and the matrix then immediately 1407 created the next AVD **under the same name** — with the previous process still 1408 holding its lock files. The level after a failure then found nothing running 1409 and booted fine, which is what produced the alternation. 1410 1411 `kill` now waits for the device to leave `adb devices`, then for the process on 1412 that console port to exit, and clears any `*.lock` left in the AVD directory. 1413 The four failed levels are queued for a retry behind the phase job 1414 (`run/matrix-retry.sh`), which is also where it will become clear whether the 1415 API 24 timeout was ever about the camera format at all. 1416 1417 One data point in the fix's favour arrived immediately: API 34 passed 12/12, 1418 and under the old alternation the level after a success was the one that 1419 failed — but API 36, the first level whose predecessor was torn down with the 1420 waiting `kill`, booted. One observation is not proof; the retry of the four 1421 failed levels is the test. 1422 1423 What the three levels that did run say: the twelve platform-sensitive 1424 scenarios — the balances and history screens, manual QR entry, NFC tap to pay, 1425 the settings walk, export and import, the config changes, the lock screen 1426 without a credential, the accessibility audit, the lifecycle kill and the 1427 database corruption — behave on API 26, 29 and 31 exactly as they do on 36. 1428 **No version-specific defect has been found yet**, which is worth saying 1429 plainly given that the whole matrix exists because of a report that scanning 1430 works on one Android version and not another: the matrix cannot speak to that 1431 report, because the camera path is the one thing it cannot drive. 1432 1433 #### What the last big gap in the detail screen actually is 1434 1435 `TransactionDetailScreenKt` is the single largest partially-covered class (164 1436 missed lines, 59 %), and reading it line by line leaves three things, none of 1437 them a scenario anyone can write today: 1438 1439 * **Its preview** (lines 638–657) — counted correctly as unreachable; checked, 1440 because `gaps.py`'s preview accounting is what the "79.4 % of reachable 1441 lines" figure rests on. `preview_lines()` does find them: 1831 preview lines 1442 across 43 files, of which 1403 are lines the report also calls missed. The 1443 same check cleared the `~.peer` package, whose 432 missed lines are mostly 1444 the four previews in `OutgoingPushComposable.kt` (105 lines) — so no 1445 scenario was worth writing there either. 1446 * **The refresh branch** (320–329) — unreachable by design, see 1447 `refresh-transactions-are-never-listed.md`. 1448 * **The denomination-loss branch** (354–364, 497–531) — needs a loss event in a 1449 currency the wallet holds, and it cannot have one here. 1450 `dev-experiments.ts:243` hard-codes the injected event: 1451 1452 ```ts 1453 const newRg: WalletDenomLossEvent = { 1454 amount: "TESTKUDOS:42", 1455 currency: "TESTKUDOS", 1456 exchangeBaseUrl: "https://exchange.test.taler.net/", 1457 ``` 1458 1459 No parameters, so the injected loss is always TESTKUDOS, and a EUR wallet has 1460 no scope to show it under — which is what `denom_loss_transaction` has been 1461 reporting all along. 1462 1463 **Corrected the same evening:** the revocation phase makes a *EUR* loss 1464 event, because revoking a denomination the wallet holds is a real loss in the 1465 wallet's own currency. The clean revocation run left `denom_loss_events: 1` 1466 and one coin marked `denom-loss`, so the loss transaction and its detail 1467 screen are reachable after all — through the destructive phase rather than 1468 through the dev experiment. `revoke_denomination` now looks for the "Loss of 1469 funds" row, opens it, and checks that the screen names a reason (one of 1470 `loss_reason_expired`, `_unoffered`, `_vanished`). That is 1471 `TransactionDenomLoss`, the loss branch of the detail screen and 1472 `TransitionLossComposable` — around ninety lines that had never rendered — 1473 and it makes the detail screen's remaining gap the refresh branch alone. 1474 1475 ### The phase job's first attempt, and a third teardown that did not wait 1476 1477 The revocation-and-twister job waited correctly for the campaign loop and the 1478 version matrix, then died: 1479 1480 ``` 1481 === 17:49:15 restarting the stack with sim.conf 1482 === 17:49:35 stack did not come up; stopping 1483 ``` 1484 1485 `phases-stack.log` shows `taler-unified-setup.sh` terminating at the merchant. 1486 The cause is the same shape as the emulator one, two sections above: 1487 `stack.sh stop` kills the supervisor and waits for *it*, then returns — while 1488 its children are still holding the ports. The job started the stack again five 1489 seconds later, and the merchant could not bind. 1490 1491 Both halves are fixed. `stack.sh stop` now waits, after the supervisor is 1492 gone, for the six ports this stack owns to be released (not 11000 and 11001: 1493 the mailbox and taldir are run separately and outlive it), and says so if they 1494 are still held after a minute. `run/phases2.sh` additionally retries the start 1495 once, because losing a phase to a transient failure costs an hour of waiting 1496 for the next round boundary. 1497 1498 Worth noticing how similar the three are: 1499 1500 | what | what it waited for | what it should have waited for | 1501 | --- | --- | --- | 1502 | `emu.sh kill` | the console accepting `emu kill` | the process to exit and release the AVD | 1503 | `stack.sh stop` | the supervisor to exit | the children to release the ports | 1504 | the first phase job | a line in `rounds.log` | the loop's process to be gone | 1505 1506 In all three, something answered "done" before the thing that mattered was 1507 done, and the failure landed on whatever ran next rather than on the component 1508 at fault. In the meantime the stack is back up (18 s, clean), the loop is 1509 running again at round 21, and the phases are queued behind the matrix retry. 1510 1511 ### The revocation phase ran, in the worst possible conditions 1512 1513 A `pkill` of the first phase script had not actually killed it — the pattern 1514 matched the `bash -c` wrapper of the very command doing the killing, which 1515 ended that ssh session before `pkill` ran. So two phase jobs were alive, and at 1516 17:49 they both stopped and started the stack. One of them won, ran the 1517 revocation phase from 17:50 to 17:59, restarted the stack and started a 1518 *second* campaign loop; the other saw its own start fail at the merchant and 1519 gave up. For about fifteen minutes there were two loops exploring with the same 1520 seeds on the same four emulators, a scenario of mine running on a fifth, and 1521 the stack being restarted underneath all of it. 1522 1523 Everything is back to one loop and one phase job. The point of recording it is 1524 what it does to the result: `revoke_denomination` completed and reported 1525 1526 ``` 1527 - the wallet holds 4 denominations: [1, 4, 7, 8] 1528 - revoked 1E1SBDFT7V6KX9… (1 coin(s) held) 1529 - asked the wallet to reload the exchange 1530 - home after revocation: [] 1531 - denom_loss_events: 0 rows 1532 - recoup_groups: 0 rows 1533 - coins: 0 rows 1534 ``` 1535 1536 A wallet that held twenty coins has none, with no recoup group and no loss 1537 event to account for them — which would be a serious finding if anything about 1538 that run could be trusted. It cannot: the same episode carries a 1539 `[harness-crash] FATAL EXCEPTION: main` from a process that is not the app and 1540 an `[empty-hierarchy] no view hierarchy returned`, the two scenarios after it 1541 died with `could not enable developer mode; settings showed: []`, and the 1542 exchange it was talking to was restarted twice while it ran. Any of those could 1543 produce an empty wallet. 1544 1545 So it is **not** filed as a finding. `run/phases2.sh` re-runs the same phase 1546 with the stack to itself, and the question to put to that run is precisely: 1547 after revoking one denomination of four, does the wallet still hold the coins 1548 of the other three, and does the revoked one leave a recoup group or a loss 1549 event behind? Whatever that says is worth a finding; this run is not. 1550 1551 ### Ranking the gaps by what can be reached 1552 1553 `gaps.py` ranked packages by raw missed lines, and that ranking was misleading 1554 in a way that cost scenario-design time: `~.peer` looked like the third-biggest 1555 gap in the module and is mostly four `@Preview` functions in one file. The 1556 ranking now subtracts preview lines per package — the same data the headline 1557 "reachable" figure already used, applied one level down: 1558 1559 ``` 1560 packages by missed lines that can actually be reached: 1561 493 missed 69.0% ~.transactions (636 counting previews) 1562 376 missed 64.8% ~.payment (526 counting previews) 1563 271 missed 73.7% ~.compose (369 counting previews) 1564 222 missed 67.8% ~.exchanges (242 counting previews) 1565 204 missed 38.2% ~.donau (256 counting previews) 1566 … 1567 122 missed 70.9% ~.peer (432 counting previews) 1568 97 missed 74.6% ~.balances (233 counting previews) 1569 ``` 1570 1571 `~.peer` moves from third to tenth and `~.balances` from tenth to fourteenth. 1572 `~.donau` keeps the lowest percentage of any package at 38.2 %, and most of 1573 what is missing there is behind the statements button that is wired to nothing 1574 — which the patched build reaches, so that number should move on its own once 1575 the patch lands. 1576 1577 ### Why API 24 never booted: not the camera, not the teardown, the AVD's size 1578 1579 The retry settled two of the three hypotheses at once. **API 28 booted** this 1580 time, where it had failed in the first pass — so the teardown fix is real. 1581 **API 24 failed again**, from a clean start and with the emulated camera, so 1582 neither the lingering-process theory nor the NV21 virtual-scene error was its 1583 cause. The camera error is therefore cleared: it is noise that API 26 logs 1584 eight times while booting fine. 1585 1586 What is left is the AVD itself. `emu.sh create` builds every AVD the same way: 1587 `-d pixel_6`, 4 GB of RAM, a 6 GB data partition, 1080×2400 at 420 dpi. Three 1588 probes on a spare emulator, each a fresh AVD from the same API 24 image: 1589 1590 | profile | RAM | data partition | result | 1591 | --- | --- | --- | --- | 1592 | `pixel_2` | 2 GB | 2 GB | **booted in 35 s** | 1593 | `pixel_6` | 2 GB | 2 GB | **booted in 35 s** | 1594 | `pixel_6` | 4 GB | 6 GB | never booted (the campaign's own configuration) | 1595 1596 So the device profile is not the problem — a Pixel 6 profile on Android 7 boots 1597 fine. The size is. Which of the two sizes is still open; a fourth probe 1598 (`pixel_6`, 4 GB RAM, 2 GB partition) is running to say whether it is the RAM 1599 or the partition, and `emu.sh` will then pick that one value by API level 1600 rather than giving a 2016 system image the same budget as a 2025 one. 1601 1602 A note on how the probes were run, since two of them had to be thrown away: the 1603 first attempt printed a hard-coded "booted with -d pixel_2 and 2 GB" while 1604 actually running with `pixel_6`, which nearly produced the wrong conclusion — 1605 the message now interpolates the parameters it was given. And two copies ended 1606 up racing on the same AVD name and console port, because the ssh session 1607 carrying one timed out while the remote script kept going. Probes get 1608 `setsid nohup` and their own log now, like everything else here. 1609 1610 #### The retried levels booted and had no money 1611 1612 API 28, 30 and 33 all booted on the second pass — the teardown fix works — and 1613 then every one of their twelve scenarios failed: 1614 1615 ``` 1616 API 28: 0/12 ok 1617 all twelve: driver-error 1618 stack.HttpError: HTTP 401 for http://localhost:8082/accounts/wallet7/withdrawals: 1619 {"code":40,"hint":"Unknown account"} 1620 ``` 1621 1622 Worker 6 — the one the matrix drives — banks as `wallet7`, and 1623 `stack.py`'s `provision()` defaulted to `SIM_WORKERS=5`, so a plain 1624 `python3 stack.py` created `wallet1`…`wallet5` and stopped. The campaign's own 1625 four workers were fine, which is why nobody noticed; the matrix's worker had an 1626 account until the bank database was rebuilt, and after that it did not. 1627 1628 The failure mode is the thing to watch for: a level that boots and then reports 1629 twelve driver errors looks exactly like a platform that cannot run the app. 1630 Only the exception text says otherwise. The default is now seven, which covers 1631 every AVD the harness has, and the three levels are queued to run again behind 1632 the phase job. 1633 1634 ## Fault injection, at last 1635 1636 The twister phase ran: three scenarios, all of them actually doing something 1637 for the first time (`twister_withdraw_faults` took 638 s against the 30 s it 1638 used to take while reporting "nothing to inject"). Seven faults, armed one at a 1639 time in front of the exchange: a truncated response, a truncated upload, 500, 1640 404, 403, 502, and a wrong `Content-Type`. 1641 1642 **One finding.** Five of the seven faults leave a withdrawal on a screen with a 1643 title, a back arrow and nothing else — and it stays that way after the fault is 1644 removed and the exchange is healthy again: 1645 1646 ``` 1647 - http-500: ['Go back', 'Withdraw UNKNOWN', 'Internal event log'] 1648 - http-500 after retry: ['Go back', 'Withdraw UNKNOWN', 'Internal event log'] 1649 - http-500: armed 115 times 1650 - http-500 once the fault stops: ['Go back', 'Withdraw UNKNOWN', 'Internal event log'] 1651 ``` 1652 1653 Written up as `withdrawal-screen-never-recovers-from-an-exchange-outage.md`: 1654 `PromptWithdrawScreen` has a loading state and a success state and nothing in 1655 between, so a preparation that failed looks like one still in flight, and 1656 nothing re-runs it. A user meets this without any proxy whenever an exchange 1657 answers 5xx or truncates a body at the moment a withdrawal starts. 1658 1659 The two faults that are *survived* are the useful contrast: a damaged **upload** 1660 (`truncated-request`) and a wrong `Content-Type` both carry on to the terms of 1661 service and then to "Waiting for authorization in the bank". So the wallet is 1662 not simply fragile under damage; it is specifically missing an error state on 1663 one screen. 1664 1665 **One observation held back.** Under every fault, a payment ends with the 1666 wallet showing "This transaction is pending" and "Paid -€1.00" while the 1667 merchant still says `claimed` ninety seconds after the fault stopped. That 1668 could be a purchase that never resolves, or a retry that had not come round 1669 yet — ninety seconds cannot tell them apart, and wallet-core's retry backoff is 1670 measured in minutes. The scenario now waits five minutes and records how long 1671 recovery took, so the next phase will answer it instead of hinting at it. 1672 1673 **And one thing the faults did not find:** no crash, no internal error screen, 1674 no stuck database, in 21 fault-armed flows. The oracles that have caught real 1675 defects all round — `fee-on-dead-transaction`, `mixed-amount-notation`, 1676 `glued-currency` — reported nothing here either. Fault injection was the last 1677 avenue by design, and on this evidence the wallet's transport-level error 1678 handling is in better shape than its screens are. 1679 1680 ### Two more scenarios from the reachable ranking, and a finding from one of them 1681 1682 With the ranking subtracting previews, `~.payment` is second (376 reachable 1683 missed) and `PaymentResponses.kt` the worst file in it at 42 %. What is missing 1684 there is the *typed* half: `PaymentInsufficientBalanceDetails`, its 1685 `PerExchange` breakdown, and the mapping from each of seven refusal reasons to 1686 its own string. `payment_insufficient` only ever reaches the plain 1687 "not enough money" case, and the wallet cannot manufacture the others — but 1688 wallet-core can, with the `merchant-deposit-insufficient` dev experiment. 1689 1690 The new `payment_insufficient_reason` scenario arms it and pays for something 1691 the wallet can easily afford. The answer is 1692 `payment-prompt-says-insufficient-without-the-reason.md`: with €9.87 in the 1693 wallet and a €1.00 order, the prompt says **"Insufficient balance"** and nothing 1694 else. The reason is in the reply, the string for it exists, the mapping from 1695 hint to string exists, and exactly one screen in the app uses that mapping — 1696 the peer-push one. The payment prompt reads `choice.details` and ignores 1697 `choice.details.balanceDetails.causeHint` sitting beside it. Patched with the 1698 same expression the peer screen already uses. 1699 1700 Two mistakes of mine in writing that scenario, both worth the same warning: 1701 the first version named the order "Order the merchant cannot take", so every 1702 pattern looking for the word "cannot" matched the order summary and the 1703 scenario cheerfully reported a reason-specific hint that was not there. The 1704 summary is neutral now and the patterns match wording only the wallet's own 1705 strings contain. **An assertion that can be satisfied by the test's own input 1706 is not an assertion.** 1707 1708 The other new scenario comes from the revocation: `revoke_denomination` now 1709 follows the recoup group to completion, reports what the balance did, and then 1710 looks for the "Loss of funds" row and opens it — `TransactionDenomLoss`, the 1711 loss branch of the detail screen and `TransitionLossComposable`, about ninety 1712 lines that had never rendered because the only loss event anyone could make was 1713 TESTKUDOS. A revocation makes one in euros. That phase is queued. 1714 1715 ### A seventh vacuous scenario, and the long press that could not work 1716 1717 `TransactionsScreen.kt` sat at 49 % with its whole selection mode uncovered — 1718 select all, leaving selection mode, and the delete-selected dialog. There was 1719 already a scenario for that, `transactions_bulk_delete`, and it had been 1720 reporting the same line every round while counting as a pass: 1721 1722 ``` 1723 - after long press: ['http://localhost:8081', '€7.87', 'Pending:', …] 1724 - long press did not open selection mode 1725 ``` 1726 1727 Checked across the last forty summaries: **every** run of it, in every round, 1728 ended on that note. It never could do otherwise. The main screen's list is 1729 built with selection switched off: 1730 1731 ```kotlin 1732 // wallet/src/main/java/net/taler/wallet/balances/BalancesPagerComposable.kt 1733 TransactionRow( 1734 tx = tx, 1735 isSelected = false, 1736 selectionMode = false, 1737 onTransactionClick = { onTransactionClicked(tx) }, 1738 onTransactionSelect = {}, // a no-op, by construction 1739 ) 1740 ``` 1741 1742 Selection exists only on the dedicated screen behind the "All" chip. So the 1743 scenario was waiting for a feature that is deliberately absent, and saying so 1744 in a way that read like a flaky gesture. 1745 1746 Finding the real cause took three wrong turns worth recording, because each was 1747 a plausible theory that the evidence refuted: 1748 1749 1. **"The gesture is wrong."** `long_press` sends `input swipe x y x y 800`, a 1750 zero-distance swipe, which looks like something Compose might reject. It was 1751 replaced with two `input motionevent` calls — which silently do nothing, 1752 because each `input` invocation is its own input session and the DOWN is 1753 cancelled when it exits. Probing four techniques against a live row settled 1754 it: the original zero-distance swipe is the only one that works, and moving 1755 even two pixels turns it into a drag that cancels the long press. The change 1756 was reverted and the reason written into the function. 1757 2. **"The balance card is being counted as a row."** It is, on the dedicated 1758 screen — the card sits between the app bar and the list — but adding 1759 "balance" to the stop-list did not help, because the card's parts land in 1760 different bands and the offending one holds the exchange URL, not the word 1761 "Balance". 1762 3. **The actual fix.** A transaction's amount carries a sign and a balance's 1763 does not, so `transaction_rows` grew a `signed_only` mode for callers on 1764 that screen, plus a rule that a URL is never a row's title. 1765 1766 With that, the dedicated screen's selection mode runs end to end: 1767 1768 ``` 1769 - selection mode: [… '1 selected', 'Select All', …] 1770 - after select all: [… '2 selected', …] 1771 - 1 unnamed clickable(s) in the app bar: [(12, 150, 138, 276)] 1772 - after closing selection mode: [… 'Go back', …] 1773 - the delete dialog: ['Delete transactions', 'Are you sure you want to remove 1774 the selected transactions from your wallet?', 'Delete', 'Cancel'] 1775 - rows after deleting the selection: 0 1776 ``` 1777 1778 `transactions_bulk_delete` now pins what the main screen actually does — a long 1779 press there must do *nothing*, not open a detail screen and not crash — and 1780 says so, and `transactions_screen_selection` owns the deletion flow. Note the 1781 close button in that app bar is an unnamed clickable, which is why the scenario 1782 has to find it by position: `TransactionsScreen.kt:112` passes 1783 `contentDescription = null`, the same omission as 1784 `action-buttons-have-no-accessible-name.md`. 1785 1786 ### The matrix, third pass: five levels clean, and two kinds of infrastructure noise 1787 1788 With `wallet7` funded, the retried levels do what they should: 1789 1790 ``` 1791 API 30: 12/12 ok 1792 API 28: 0/0 ok -- aborted: adb logcat timed out after 120s 1793 ``` 1794 1795 API 30 joins 26, 29, 31, 34 and 36 at 12 of 12. API 28 did not fail a 1796 scenario; it never finished one, because `adb logcat` stopped answering: 1797 1798 ``` 1799 subprocess.TimeoutExpired: Command '[… 'logcat', '-d', '-t', '600']' 1800 timed out after 120 seconds 1801 ``` 1802 1803 That is the machine, not the app — at the time it was carrying six emulators, 1804 the campaign's four workers, a matrix level, two Gradle builds and a scenario 1805 of mine on a spare worker. The lesson is about discipline rather than code: ad 1806 hoc runs on a spare emulator are cheap individually and not free in aggregate, 1807 and the version matrix is the thing that suffers first because it boots a fresh 1808 emulator for every level. 1809 1810 Tally so far, across three passes: 1811 1812 | level | result | 1813 | --- | --- | 1814 | 24 | never booted; the AVD-sizing fix is queued for validation | 1815 | 26, 29, 30, 31, 34, 36 | 12/12 ok | 1816 | 28 | booted twice, aborted twice — provisioning once, an adb timeout once | 1817 | 33 | pending in the current pass | 1818 1819 So **no version-specific defect has turned up in any level that completed**, 1820 and every failure so far has been the harness or the host. 1821 1822 ## Dead code, enumerated, and coverage without it 1823 1824 The "untouched classes" list in a coverage report shows the dead code that 1825 happens to be big; `ui-with-no-callers.md` was assembled by reading it and 1826 chasing suspects by hand. `simulator/coverage/deadcode.py` now does it 1827 systematically: every top-level declaration and every direct member of a type, 1828 asked whether its name appears anywhere else in the app. 1829 1830 **19 declarations, 383 lines in the wallet module; 10 and 56 in the library.** 1831 The full list, with what each one is, is in 1832 `dead-declarations-complete-list.md`. Beyond the five pieces of UI already 1833 written up, it turned up the older generation of a menu component sitting in 1834 the same file as its replacement (`NewMenuItem`, `NewMenuSectionHeader`, 1835 `NewMenuContent`, beside the `Material3MenuGroup` four screens use), two lists 1836 of wallet-core notification type strings superseded by `@SerialName` matching 1837 in `backend/Notifications.kt`, a constructor property nothing passes or reads, 1838 and `fun MerchantInfoSheet() {}` — an empty composable. 1839 1840 ### What it does to the numbers 1841 1842 ``` 1843 lines covered 12585/17247 (73.0%) 1844 missed inside @Preview 1403 1845 missed in dead code 277 1846 reachable lines covered 12585/15567 (80.8%) 1847 the ceiling this report can read: 90.3% 1848 ``` 1849 1850 Three figures that have to be kept apart: **73.0 %** of all lines, **79.4 %** 1851 of lines outside `@Preview` bodies, **80.8 %** of lines that are both outside a 1852 preview and reachable at all. Only the last says anything about how well the 1853 app is tested. `gaps.py --dead` prints it; the pass is opt-in because it takes 1854 a few minutes. 1855 1856 Only *missed* dead lines are subtracted. Some dead lines count as covered — a 1857 file-level `private val` is initialised when its class loads whether anything 1858 reads it or not — and subtracting those would flatter the numerator. 1859 1860 ### Getting the detector to tell the truth took three tries 1861 1862 Worth recording, because the first two versions produced confident nonsense: 1863 1864 1. **Indentation is not nesting.** The first version accepted declarations at 1865 indent 0 or 4, which admitted every `val` local to a composable — 43 1866 "dead declarations" of which most were locals, including `pagerPosition` 1867 and `biometricManager`. It now tracks brace depth and the kind of the 1868 enclosing construct, so a member of a class counts and a local inside a 1869 function does not. 1870 2. **Spans ran away.** Brace-matching from a `val` declaration consumed the 1871 rest of the enclosing block, so a one-line property was reported as 121 1872 lines — and worse, spans overlapped, which would have double-counted lines 1873 subtracted from the coverage denominator. Each body shape is now handled 1874 separately, and the spans were checked against the source line by line. 1875 3. **Deadness is transitive.** `connectToWifi29` and 1876 `connectToWifiDeprecated` are referenced only from `connectToWifi`, which 1877 is referenced from nowhere. The search now repeats, ignoring references 1878 that come from inside already-dead spans, until a round adds nothing. 1879 1880 The remaining limits are in the finding: a common name can collide with an 1881 unrelated use and look alive (which under-reports, the safe direction — the 1882 library's `showError` hides the wallet's two), mutually-referencing overloads 1883 keep each other alive (`GridMenu.kt` is dead as a unit but only `GridMenu` is 1884 listed), and anything reached by reflection would be reported wrongly. Which 1885 is why the finding is a list to read, not a deletion to apply. 1886 1887 ### cancelProgressToken: four attempts, and why it stays at 70 of 71 1888 1889 The last unexercised wallet-core operation sits behind one button: the Cancel 1890 on the database-migration progress dialog. `MainActivity.kt`'s largest 1891 remaining gap is that dialog (lines 445–482) and the `onCancel` that calls 1892 `cancelDatabaseMigration` (223–227), so this is worth something beyond the 1893 operation count — but it is also the hardest thing in the campaign to reach, 1894 and four attempts did not. 1895 1896 1. **The committed 57 KB fixture.** Migrates in well under a second. The 1897 fifteen-attempt tap loop never saw the dialog. 1898 2. **A 1.7 MB fixture, 512 records.** Built by driving the 1899 `useNativeDb = false` build through a scenario first. The migration emitted 1900 112 progress notifications and still finished before a screen dump came 1901 back; a dump costs about a second, which is most of the window. 1902 3. **Blind taps.** Read the prompt's button coordinates first, then tap 1903 "Migrate now" and the same slot again with no dump in between — the 1904 progress dialog's single button sits where the prompt's confirm button was. 1905 No call. 1906 4. **Freezing the process.** `kill -STOP` on the app so the taps queue in the 1907 system input dispatcher, then `kill -CONT`: once after starting the 1908 migration, once with the start *and* the cancel queued together before it. 1909 The freeze itself worked both times (`froze the app: True`); the migration 1910 still finished first. 1911 1912 What would reach it: a legacy database of some thousands of records, which 1913 means driving the `useNativeDb = false` build through enough withdrawals to 1914 make one, or a debug hook that pauses the migration between steps. Neither is 1915 a scenario, so the operation count stands at **70 of 71**, and the reason is 1916 recorded in the scenario itself rather than left as a mystery for the next 1917 person. 1918 1919 Worth noting what the attempts *did* buy: the prompt, the "Later" deferral, 1920 `migrateDatabase`, the progress notifications and the switch to the native 1921 backend are all covered, and the migration dialog in `MainActivity` is no 1922 longer a screen nothing had ever driven. 1923 1924 ## Iteration 22 — 106 scenarios, three serious findings, all of them patched kinds 1925 1926 ``` 1927 2026-10-18T20:52:13 round 22: suite: 106 ok, 0 driver errors, 3 serious findings 1928 *** [fee-on-dead-transaction] a fee is shown on a transaction that did not happen 1929 *** [mixed-amount-notation] '5.00 EUR' beside '€4.88' 1930 *** [glued-currency] 'UNKNOWN0.00' 1931 ``` 1932 1933 Three, down from five, and the drop is not luck: two of the five were the 1934 `unfinished-transaction` false positives that the tally fix reclassified. All 1935 three that remain have patches sitting beside them. 1936 1937 ### The mailbox screen's two dialogs, and the same tap trap for the third time 1938 1939 `MailboxScreen.kt` sat at 61 %, and half of what was missing was its two 1940 dialogs. The scenario had been tapping for `^Add$|^New$|^\+$` and 1941 `refresh|reload`, of which only the last matches anything on that screen — the 1942 app bar offers "Show Mailbox Address", "Configure Mailbox" and "Refresh". 1943 1944 Both dialogs now run: the address one shows the wallet's real mailbox URI and 1945 copies it, and the URL one accepts a typed URL and is cancelled, which must 1946 leave the screen as it was. 1947 1948 Getting the copy confirmation to appear took the same mistake twice more: 1949 1950 * **Too slow.** `c.see(r"copied to clipboard", timeout=10)` reported "no 1951 confirmation" for a snackbar that a probe found **0.4 s** after the tap. The 1952 scenario now polls tightly, as the Toast lesson in the import scenario 1953 already said it should. 1954 * **The wrong control.** Even then it saw nothing, because `c.tap` hunts for a 1955 clickable ancestor and on these dialog buttons lands somewhere that dismisses 1956 the dialog instead of pressing the button — exactly the trap documented in 1957 `pick_file_in_picker`'s docstring for the document picker's rows, and in the 1958 transactions screen's row long-press. Tapping the node's own centre works: 1959 1960 ``` 1961 - after copying: ['Mailbox address URI copied to clipboard'] 1962 ``` 1963 1964 Three different screens have now needed that same correction. It is written in 1965 three docstrings; it would be better as one helper, and that is worth doing 1966 before a fourth screen finds it. 1967 1968 ### API 24 boots, and the matrix is eight levels of nine 1969 1970 The AVD-sizing fix is confirmed end to end. The level that spent 1200 seconds 1971 twice without finishing a boot now boots and runs everything: 1972 1973 ``` 1974 scenario 24 1975 balances_screens ok 1976 history ok 1977 scan_manual_entry ok 1978 nfc_tap_to_pay ok 1979 settings_walk ok 1980 settings_export ok 1981 settings_import ok 1982 config_changes ok 1983 wallet_lock_without_credential ok 1984 a11y_audit ok 1985 lifecycle_kill ok 1986 db_corruption ok 1987 1988 API 24: 12/12 ok 1989 ``` 1990 1991 So the cause was never the app, the camera format or the teardown: a 2016 1992 system image cannot boot on 4 GB of RAM with a 6 GB data partition, and boots 1993 in 35 seconds on 2 GB of each. `emu.sh` picks the smaller budget below API 29. 1994 1995 The matrix now reads: 1996 1997 | level | result | 1998 | --- | --- | 1999 | 24, 26, 29, 30, 31, 33, 34, 36 | **12/12 ok** | 2000 | 28 | aborted twice, both times on the harness — provisioning once, an `adb logcat` timeout under load once | 2001 2002 **Eight of the nine levels the app's own code branches on now pass every 2003 platform-sensitive scenario, identically.** The report that started this — 2004 scanning works on Android 15 but not 14 — is still unanswered, and the matrix 2005 cannot answer it: the camera is the one path no emulator here can drive. What 2006 the matrix *can* say is that nothing else about the app differs across eight 2007 platform generations, which narrows where to look.