Record round 32.3 in the handover (section 32.3)
This commit is contained in:
1 parent
2a32368ab2
commit
84c1809b14
1 file changed
+28
-10
+28
-10
@@ -8,8 +8,8 @@ Short working handover for the next model. Keep it short.
|
|||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
- **Done and verified:** sections 1–31 and section 18 steps 1–11. **Section 32.4, the bug report, is also done** — in round 32-A (BR-001, BR-004, BR-005, BR-006, BR-007, BR-008) and round 32-B (BR-002). Schema version 12. **475 green tests.** The StartOS package is built, sideloaded and running on a StartOS 0.4.0 box; the package version is still `0.1.0:0`.
|
- **Done and verified:** sections 1–31 and section 18 steps 1–11. **Section 32.4, the bug report, is also done** — in round 32-A (BR-001, BR-004, BR-005, BR-006, BR-007, BR-008) and round 32-B (BR-002) — and **section 32.3, the alert and page texts, is done**. Schema version 12. **477 green tests.** The StartOS package is built, sideloaded and running on a StartOS 0.4.0 box; the package version is still `0.1.0:0`.
|
||||||
- **What is left of section 32:** 32.1 the real icon, 32.2 the UI polish pass, 32.3 the alert message texts, 32.6 the documentation drift, and 32.5 the raise to `1.0.0:0` together with section 18 step 12. 32.6 has to come after 32.1–32.3 and before 32.5. One item inside 32.4 is left to the user: **BR-003** — read the 32.4 section below before acting on it, because the report's own wording for it is out of date.
|
- **What is left of section 32:** 32.1 the real icon, 32.2 the UI polish pass, 32.6 the documentation drift, and 32.5 the raise to `1.0.0:0` together with section 18 step 12. 32.6 has to come after 32.1–32.2 and before 32.5. One item inside 32.4 is left to the user: **BR-003** — read the 32.4 section below before acting on it, because the report's own wording for it is out of date.
|
||||||
- **A round stops when it is done.** Do not start the next item unless the user asks.
|
- **A round stops when it is done.** Do not start the next item unless the user asks.
|
||||||
- **Verified how:** the automated suite, the user's manual browser testing, and the install and test round on a StartOS 0.4.0 box. The user runs the suite; the agent has no shell.
|
- **Verified how:** the automated suite, the user's manual browser testing, and the install and test round on a StartOS 0.4.0 box. The user runs the suite; the agent has no shell.
|
||||||
- **Tests:** `python3 -m unittest discover -s tests`. They run on a Windows copy at `C:\Users\<brukarnamn>\Downloads\helsesjekk`, so they must pass there as well as on Linux.
|
- **Tests:** `python3 -m unittest discover -s tests`. They run on a Windows copy at `C:\Users\<brukarnamn>\Downloads\helsesjekk`, so they must pass there as well as on Linux.
|
||||||
@@ -18,10 +18,10 @@ Short working handover for the next model. Keep it short.
|
|||||||
## Section 32 — what is left
|
## Section 32 — what is left
|
||||||
|
|
||||||
- **32.1 The icon.** The user supplies the artwork. `icon.svg` at the root is capped at 40 KiB; the PWA needs 192 and 512 px PNGs in `static/`; both go into the manifest's `icons` entry and into `STATIC_FILES` in `app.py`. The placeholder the manifest points at today carries `sizes: "any"`, which is what the manifest test asserts.
|
- **32.1 The icon.** The user supplies the artwork. `icon.svg` at the root is capped at 40 KiB; the PWA needs 192 and 512 px PNGs in `static/`; both go into the manifest's `icons` entry and into `STATIC_FILES` in `app.py`. The placeholder the manifest points at today carries `sizes: "any"`, which is what the manifest test asserts.
|
||||||
- **32.2 UI polish.** The five pages for consistency: the same wording for the same action, a clear empty state on every list, nothing clipped or overflowing on a narrow phone, and the offline state still clear after signing in and out. The short reminder that round 32-B put next to every free-text field belongs to this pass too — the user has confirmed it reads well on a phone, so what is left there is only that it looks the same on every page.
|
- **32.2 UI polish.** The five pages for consistency: the same wording for the same action, a clear empty state on every list, nothing clipped or overflowing on a narrow phone, and the offline state still clear after signing in and out. The short reminder that round 32-B put next to every free-text field belongs to this pass too — the user has confirmed it reads well on a phone, so what is left there is only that it looks the same on every page. **The duplicated headings, the redundant help lines and the two wordings for the settings link were taken in 32.3**, because they belong to the text pass; the rest of this item is still open.
|
||||||
- **32.3 Alert message texts.** All eleven alert rows in `TODO.md` §7 have a `message` in `alerts.py`. Make them alike in shape: what is wrong, which key or software it is about, and what closes it. Update the tests that hold the texts; keep the codes and the actions unchanged.
|
- **32.3 Alert and page texts — done.** See the round 32.3 section below.
|
||||||
- **32.4 The bug report — done.** See the section below for what each finding turned out to be.
|
- **32.4 The bug report — done.** See the section below for what each finding turned out to be.
|
||||||
- **32.6 The documentation drift.** `README.md`, `docs/application.md`, `instructions.md`, `UPDATING.md`, `AGENTS.md` and the package's own i18n strings are all behind the code. `TODO.md` §32.6 lists what is wrong in each. It answers the rest of BR-004, and it must be done after 32.1–32.3 and before 32.5, so the documents describe the released state.
|
- **32.6 The documentation drift.** `README.md`, `docs/application.md`, `instructions.md`, `UPDATING.md`, `AGENTS.md` and the package's own i18n strings are all behind the code. `TODO.md` §32.6 lists what is wrong in each. It answers the rest of BR-004, and it must be done after 32.1–32.2 and before 32.5, so the documents describe the released state.
|
||||||
- **32.5 The version raise.** `0.1.0:0` → `1.0.0:0`, once the items above are done and the user says so. No schema change, no new endpoint, no new feature. `startos/versions/` stays empty, because the app migrates its own schema.
|
- **32.5 The version raise.** `0.1.0:0` → `1.0.0:0`, once the items above are done and the user says so. No schema change, no new endpoint, no new feature. `startos/versions/` stays empty, because the app migrates its own schema.
|
||||||
|
|
||||||
## Section 32.4 — the bug report, as it turned out
|
## Section 32.4 — the bug report, as it turned out
|
||||||
@@ -37,7 +37,22 @@ Short working handover for the next model. Keep it short.
|
|||||||
- **BR-007 — confirmed and fixed.** The service worker only stores a successful, same-origin, non-redirected response.
|
- **BR-007 — confirmed and fixed.** The service worker only stores a successful, same-origin, non-redirected response.
|
||||||
- **BR-008 — confirmed and fixed.** The address-path comparison is canonical.
|
- **BR-008 — confirmed and fixed.** The address-path comparison is canonical.
|
||||||
- **The report was written against a different file set.** It asks for `SECURITY.md`, `PRIVACY.md`, `THREATMODEL.md`, `PLATFORM-ACCESS.md`, `ENCRYPTION.md`, `OFFLINE.md`, `AI-STATUS.md` and `DATA-MODEL.md`; none of them exist here. Do not create them.
|
- **The report was written against a different file set.** It asks for `SECURITY.md`, `PRIVACY.md`, `THREATMODEL.md`, `PLATFORM-ACCESS.md`, `ENCRYPTION.md`, `OFFLINE.md`, `AI-STATUS.md` and `DATA-MODEL.md`; none of them exist here. Do not create them.
|
||||||
- **The counts in the report were partly wrong and are corrected there.** Round 32-A added ten tests, not eight, and `tests/test_secret_guard.py` holds 43, not 44: 5 wordlist tests, 10 detection tests, 17 field-level tests, 6 warning tests and 5 API tests. The suite went from 422 to 475, which is the number the user confirmed.
|
- **The counts in the report were partly wrong and are corrected there.** Round 32-A added ten tests, not eight, and `tests/test_secret_guard.py` holds 43, not 44: 5 wordlist tests, 10 detection tests, 17 field-level tests, 6 warning tests and 5 API tests. The suite went from 422 to 475, which is the number the user confirmed. Round 32.3 added two more — one in `tests/test_alerts.py` and one in `tests/test_health_check_form.py` — for 477.
|
||||||
|
|
||||||
|
## Round 32.3 — the alert texts and the page texts
|
||||||
|
|
||||||
|
The eleven rows in `TODO.md` §7 (eight codes, two of which have a key form and a software form) now read alike in shape: what is wrong, which key or software it is about, and what closes the alert. `code`, severity, `source`, the actions and the `software` field are unchanged. The shape is written down in §7, so a new alert follows it.
|
||||||
|
|
||||||
|
- **The source names the key or the software, so the message does not repeat it.** `source` is either `Key N: <name>` or the software name, and it is shown right above the message in the alert list, in brackets on the key card and in front of the message in the form's blocking note. That is why the messages say "this key". The one exception is the cloud-key form of `software_incompatible`: its source is the key, so its message names the software.
|
||||||
|
- **The two forms of a security code carry their own message.** `_VULNERABLE_MESSAGE` and `_COMPROMISED_MESSAGE` were split into `_VULNERABLE_KEY_MESSAGE` / `_VULNERABLE_SOFTWARE_MESSAGE` and `_COMPROMISED_KEY_MESSAGE` / `_COMPROMISED_SOFTWARE_MESSAGE`, because the key form is closed by a rotation and the software form by removing the software.
|
||||||
|
- **Two more constants were pulled out of `_key_alerts`:** `_HARDWARE_FAILURE_MESSAGE` and `_SEED_BACKUP_MESSAGE`. `_SOFTWARE_INCOMPATIBLE_KEY_MESSAGE` is a template with `{software}`.
|
||||||
|
- **"Replace the key" is gone** where the only action offered is `rotate`. **"PROTOCOL 3: key loss" and "follow the key loss procedure" are gone too** — neither term is defined anywhere in the app or the documents, so they pointed at a concept the user does not have.
|
||||||
|
- **The contact alert no longer names the key in its message.** It says "this key"; the source carries the name.
|
||||||
|
- **The remaining duplication is deliberate:** the action appears in the message, on the button in the alert list and in the form's `Close it with: …` line. The button and the note say what the user can press; the message has to stand alone when it is read without them.
|
||||||
|
- **The blocking `409` message no longer prints the internal code.** It reads "This key has an open alert. Close the alert before recording a new check."
|
||||||
|
- **The page texts that went with it:** the duplicated `Multisig setup` eyebrow in `index.html`, the duplicated `Settings` eyebrow in `settings.html`, the duplicated `Sign in` heading in `login.html`, the blocked-key help line in `health-check.html` that repeated the note above it, the static `#software-help` text that the script overwrote before it was ever read, the two `Removing an entry…` helps in `settings.html` that became one paragraph, the `Open settings` wording in `setup.js` that is now `Open the settings` like the dashboard's, and the repeated privacy sentence in `app.js`'s `setupDescription`. `validation.py`'s "a configured cloud key already provides this wallet software name" is now "this name already comes from a configured cloud key".
|
||||||
|
- **Not merged on purpose:** `ACTION_LABELS` / `ACTION_CONFIRMATIONS` stay in three copies (`static/app.js`, `static/health-check.js`, `static/history.js`). They are identical today; a shared file would have to be added to `STATIC_FILES` in `app.py` and to the allow-list in `static/sw.js`.
|
||||||
|
- **`UNAVAILABLE_MESSAGE` in `health-check.js` stays**, even though the section it is rendered into is hidden for a key that could not be checked. It is the defensive render, and a test pins it.
|
||||||
|
|
||||||
## Round 32-B — the wallet-secret guard
|
## Round 32-B — the wallet-secret guard
|
||||||
|
|
||||||
@@ -83,8 +98,8 @@ The package is one service: one daemon, one container, one SQLite database on th
|
|||||||
The rules are in `TODO.md` §7; these are the traps that have already cost time.
|
The rules are in `TODO.md` §7; these are the traps that have already cost time.
|
||||||
|
|
||||||
- **The acknowledgement stores the key.** `alert_acknowledgements.key_id` is nullable and holds the key the alert belonged to, or `NULL` for a software alert raised by the settings list. An alert with a key is acknowledged and hidden by `(code, key_id)`; an alert without one stays on `(code, source)`. This closed a real bug: a rename — or a `rotate` with `keep_name=false` — used to reopen a closed alert, because `source` carries the name the key has *now*.
|
- **The acknowledgement stores the key.** `alert_acknowledgements.key_id` is nullable and holds the key the alert belonged to, or `NULL` for a software alert raised by the settings list. An alert with a key is acknowledged and hidden by `(code, key_id)`; an alert without one stays on `(code, source)`. This closed a real bug: a rename — or a `rotate` with `keep_name=false` — used to reopen a closed alert, because `source` carries the name the key has *now*.
|
||||||
- **The contact alert belongs to the checked key.** It gets `key_id` and `source` = `Key N: <name>`, and its message names the key. The severity stays `info` and the action stays `contact_updated`. It blocks its key like every other key alert, because `blocking_alert()` and the `blockingAlerts` filter in the form only look at `key_id`. A record without a key check raises no contact alert at all.
|
- **The contact alert belongs to the checked key.** It gets `key_id` and `source` = `Key N: <name>`, and its message says "this key" and no longer repeats the name (round 32.3). The severity stays `info` and the action stays `contact_updated`. It blocks its key like every other key alert, because `blocking_alert()` and the `blockingAlerts` filter in the form only look at `key_id`. A record without a key check raises no contact alert at all.
|
||||||
- **`software_incompatible` has two forms.** A software from the settings list keeps `source` = the software name, `key_id` = `None`, actions `[remove_software]`, and carries `software`. A wallet software that is the name of a configured cloud key can never be removed from the settings, so that form belongs to the checked key instead: `key_id` = the checked key, `source` = `Key N: <name>`, actions `[replace_hardware]`, and **no** `software` value, so a settings removal can never close it.
|
- **`software_incompatible` has two forms.** A software from the settings list keeps `source` = the software name, `key_id` = `None`, actions `[remove_software]`, and carries `software`. A wallet software that is the name of a configured cloud key can never be removed from the settings, so that form belongs to the checked key instead: `key_id` = the checked key, `source` = `Key N: <name>`, actions `[replace_hardware]`, and **no** `software` value, so a settings removal can never close it. Only that form names the software in its message, because its source is the key.
|
||||||
- **`alerts.py` needs the cloud key names.** `build_alerts()` and `collect_alerts()` take `cloud_names=()`, threaded through `rotation_alert_targets()`, `software_alert_targets()`, and the four call sites in `app.py` (`_send_alerts`, `_blocking_alert`, `_rotate_key`, `_close_removed_software`), plus `newest_alert_check_id()`. `app.cloud_key_names(keys)` builds the tuple. If `newest_alert_check_id()` does not get exactly the same names as `collect_alerts()`, the alert's `source` differs, the acknowledgement stores `check_id = None`, `_is_acknowledged()` refuses to hide an alert without a check id, and the alert can never be closed. Keep the default `()` on `build_alerts()`.
|
- **`alerts.py` needs the cloud key names.** `build_alerts()` and `collect_alerts()` take `cloud_names=()`, threaded through `rotation_alert_targets()`, `software_alert_targets()`, and the four call sites in `app.py` (`_send_alerts`, `_blocking_alert`, `_rotate_key`, `_close_removed_software`), plus `newest_alert_check_id()`. `app.cloud_key_names(keys)` builds the tuple. If `newest_alert_check_id()` does not get exactly the same names as `collect_alerts()`, the alert's `source` differs, the acknowledgement stores `check_id = None`, `_is_acknowledged()` refuses to hide an alert without a check id, and the alert can never be closed. Keep the default `()` on `build_alerts()`.
|
||||||
- **The closures that belong to a key are shown.** `app.closed_alerts()` and `database._grouped_closures()` both filter on `key_id IS NOT NULL`, so a rotation, a replaced hardware, an updated contact, and an ignored key alert are listed, while `remove_software` and a software-sourced `ignore` are not. `GET /api/health-checks/<id>` returns them as `closed_alerts`, and the CSV has one last column, `Follow-up closed`, with `code: action (YYYY-MM-DD)`, hanging on the check it closed through `check_id`.
|
- **The closures that belong to a key are shown.** `app.closed_alerts()` and `database._grouped_closures()` both filter on `key_id IS NOT NULL`, so a rotation, a replaced hardware, an updated contact, and an ignored key alert are listed, while `remove_software` and a software-sourced `ignore` are not. `GET /api/health-checks/<id>` returns them as `closed_alerts`, and the CSV has one last column, `Follow-up closed`, with `code: action (YYYY-MM-DD)`, hanging on the check it closed through `check_id`.
|
||||||
- **The key card shows the dates and the note together.** `createKeyCard()` in `static/app.js` always renders `Last checked` / `Next check due`, and adds the alert note on top. It used to replace the dates with the note, which cost the dates for a key whose only alert was the informational contact one.
|
- **The key card shows the dates and the note together.** `createKeyCard()` in `static/app.js` always renders `Last checked` / `Next check due`, and adds the alert note on top. It used to replace the dates with the note, which cost the dates for a key whose only alert was the informational contact one.
|
||||||
@@ -112,6 +127,7 @@ The rules are in `TODO.md` §7; these are the traps that have already cost time.
|
|||||||
- **The export is plain CSV only.** XLSX is not built and the app does not promise Excel compatibility. The column names and the column order are an agreement; do not change them. A text cell that a spreadsheet would read as a formula is neutralized with a leading apostrophe, and that is the only change a cell may receive.
|
- **The export is plain CSV only.** XLSX is not built and the app does not promise Excel compatibility. The column names and the column order are an agreement; do not change them. A text cell that a spreadsheet would read as a formula is neutralized with a leading apostrophe, and that is the only change a cell may receive.
|
||||||
- **The PWA cache stores only a valid shell answer.** `isCacheable()` in `static/sw.js` requires `response.ok`, `response.type === "basic"` and `!response.redirected`, so a login page (or an error page) can never replace the cached shell. The allow-list is the other half: the worker never names `/api/*`, `/health` or `/login`.
|
- **The PWA cache stores only a valid shell answer.** `isCacheable()` in `static/sw.js` requires `response.ok`, `response.type === "basic"` and `!response.redirected`, so a login page (or an error page) can never replace the cached shell. The allow-list is the other half: the worker never names `/api/*`, `/health` or `/login`.
|
||||||
- **A free-text field refuses a wallet secret, and the guard runs before the length limit.** See the 32-B section above. The refusal is a `ValidationError`, the message never repeats the value, and the password is not checked.
|
- **A free-text field refuses a wallet secret, and the guard runs before the length limit.** See the 32-B section above. The refusal is a `ValidationError`, the message never repeats the value, and the password is not checked.
|
||||||
|
- **Every alert message says what is wrong, which key or software, and what closes it**, and it does not repeat the name in `source` — except the cloud-key form of `software_incompatible`. See the round 32.3 section above and `TODO.md` §7.
|
||||||
- **The prohibition lists** in sections 1 and 13 of `TODO.md` stay unticked. They are standing prohibitions, to be re-confirmed before release — with the one amendment for the installable PWA.
|
- **The prohibition lists** in sections 1 and 13 of `TODO.md` stay unticked. They are standing prohibitions, to be re-confirmed before release — with the one amendment for the installable PWA.
|
||||||
- **Whether a date is overdue is decided in the browser**, so `/api/key-status` stays independent of the current date.
|
- **Whether a date is overdue is decided in the browser**, so `/api/key-status` stays independent of the current date.
|
||||||
- **`/api/previous-values` still returns a `security` map** that nothing consumes any more, and its `address_path` per key is no longer used by the form, which pre-fills the path from `keys.address_path`. Both are deliberate: removing them would shrink the endpoint, but nothing breaks while they stay.
|
- **`/api/previous-values` still returns a `security` map** that nothing consumes any more, and its `address_path` per key is no longer used by the form, which pre-fills the path from `keys.address_path`. Both are deliberate: removing them would shrink the endpoint, but nothing breaks while they stay.
|
||||||
@@ -159,9 +175,11 @@ Five things that are easy to break:
|
|||||||
- **The mismatch confirmation follows its warning.** `#address-path-confirmed` is `required` only while `#address-path-warning` is visible, so the browser itself stops the submission and a required control is never hidden.
|
- **The mismatch confirmation follows its warning.** `#address-path-confirmed` is `required` only while `#address-path-warning` is visible, so the browser itself stops the submission and a required control is never hidden.
|
||||||
- **The per-field secret warning is a `<span>`, not a `<p>`, in the JavaScript.** `settings.js` puts it inside a `.field` label, and a `<p>` is not allowed there. `.secret-warning` sets `display: block` and `font-weight: 400` so it looks right in both places. `static/health-check.js` must not use `placeholder` anywhere: a test asserts that string is absent, because a previous value is a real input value.
|
- **The per-field secret warning is a `<span>`, not a `<p>`, in the JavaScript.** `settings.js` puts it inside a `.field` label, and a `<p>` is not allowed there. `.secret-warning` sets `display: block` and `font-weight: 400` so it looks right in both places. `static/health-check.js` must not use `placeholder` anywhere: a test asserts that string is absent, because a previous value is a real input value.
|
||||||
- **`make x86` runs `prettier --check startos`, and the config is the SDK's own.** `.prettierrc` is the single line `"@start9labs/start-sdk/prettier.config.json"`, which is `{ trailingComma: "all", tabWidth: 2, semi: false, singleQuote: true }` — everything else is prettier's default, so `printWidth` is 80 and `quoteProps` is `"as-needed"`. That last one silently unquotes a single-word i18n key (`Username: 21`, not `'Username': 21`), and 80 columns decides when an array element or an argument collapses onto one line. Write it the way prettier would, or run `npx prettier --config node_modules/@start9labs/start-sdk/prettier.config.json --write startos`.
|
- **`make x86` runs `prettier --check startos`, and the config is the SDK's own.** `.prettierrc` is the single line `"@start9labs/start-sdk/prettier.config.json"`, which is `{ trailingComma: "all", tabWidth: 2, semi: false, singleQuote: true }` — everything else is prettier's default, so `printWidth` is 80 and `quoteProps` is `"as-needed"`. That last one silently unquotes a single-word i18n key (`Username: 21`, not `'Username': 21`), and 80 columns decides when an array element or an argument collapses onto one line. Write it the way prettier would, or run `npx prettier --config node_modules/@start9labs/start-sdk/prettier.config.json --write startos`.
|
||||||
- **The page heading uses `class="eyebrow"` too.** A regex over `health-check.html` finds `Annual security check` before the numbered sections. `settings.html` starts with `Settings`, then `01 / Wallet software` and `02 / Key rotation`. A test on the section order must expect that first. `tests/test_health_check_form.py` asserts those two lists **exactly**, so a new eyebrow on either page breaks it. The 32-B warnings deliberately use `class="secret-warning"`, not an eyebrow.
|
- **The page heading uses `class="eyebrow"` too.** A regex over `health-check.html` finds `Annual security check` before the numbered sections. `settings.html` starts with the `h1` `Settings`, then `01 / Wallet software` and `02 / Key rotation` — the eyebrow that repeated the `h1` was removed in round 32.3. `tests/test_health_check_form.py` asserts those two lists **exactly**, so a new eyebrow on either page breaks it, and so does a removed one: update the list in the same change. The 32-B warnings deliberately use `class="secret-warning"`, not an eyebrow.
|
||||||
|
- **A static help line that the script overwrites is dead text.** `#software-help` in `health-check.html` was emptied in round 32.3, because `lockSoftwareFields()` fills it before the user can read it. `static/health-check.js` must keep setting it — the wording depends on the selected key. A test pins both halves: the empty element in the markup and `softwareHelp.textContent` in the script.
|
||||||
|
- **`aria-labelledby` may point at the eyebrow.** `login.html`'s first form has no `h2` any more; its `aria-labelledby="login-form-title"` points at the eyebrow `<p>` that carries the same `id`. Do not add a heading back just to have one, and do not drop the `id`.
|
||||||
- **Do not assert on the quoting style of the JavaScript.** `static/health-check.js` uses single quotes for constant selectors and template literals where a `${...}` substitution is needed, and `static/settings.js` uses double quotes. Assert on the selector text, e.g. `[name="address_path"]`, and on quote-free substrings such as `/api/settings` and `/settings?rotate=`.
|
- **Do not assert on the quoting style of the JavaScript.** `static/health-check.js` uses single quotes for constant selectors and template literals where a `${...}` substitution is needed, and `static/settings.js` uses double quotes. Assert on the selector text, e.g. `[name="address_path"]`, and on quote-free substrings such as `/api/settings` and `/settings?rotate=`.
|
||||||
- **`clean_record()` in `tests/test_alerts.py` has a fixed provider list and carries `key_id` and `wallet_software`.** A test that needs another provider must replace the entry itself, and the recorded software is `Sparrow Wallet`, which is what a software alert names. A test that exercises the cloud-key form of `software_incompatible` has to pass `cloud_names` to `build_alerts()`.
|
- **`clean_record()` in `tests/test_alerts.py` has a fixed provider list and carries `key_id` and `wallet_software`.** A test that needs another provider must replace the entry itself, and the recorded software is `Sparrow Wallet`, which is what a software alert names. A test that exercises the cloud-key form of `software_incompatible` has to pass `cloud_names` to `build_alerts()`. The alert texts are asserted there, and **not** in `tests/test_app.py`, which checks the code, the severity, the source, the actions and the `key_id` only — so a message change touches `tests/test_alerts.py` alone.
|
||||||
- **`sample_payload()` / `unavailable_payload()` are duplicated in `tests/test_validation.py`, `tests/test_database.py`, `tests/test_app.py`, `tests/test_maintenance.py` and `tests/test_secret_guard.py`.** They build the labels from the key's name and the selected software, they always send `contact_info_verified`, and for a hardware key `hardware_works`. They must send the key's **own** `address_path`, because the server compares it with the stored one.
|
- **`sample_payload()` / `unavailable_payload()` are duplicated in `tests/test_validation.py`, `tests/test_database.py`, `tests/test_app.py`, `tests/test_maintenance.py` and `tests/test_secret_guard.py`.** They build the labels from the key's name and the selected software, they always send `contact_info_verified`, and for a hardware key `hardware_works`. They must send the key's **own** `address_path`, because the server compares it with the stored one.
|
||||||
- **Every test fixture uses one address path per key** (`ADDRESS_PATH`, `SECOND_ADDRESS_PATH`, `THIRD_ADDRESS_PATH`), because the setup refuses duplicates. `tests/test_app.py` also has `ROTATION_PATHS` and the `rotate()` helper, which picks an unused path per key so a test can rotate several keys in one run.
|
- **Every test fixture uses one address path per key** (`ADDRESS_PATH`, `SECOND_ADDRESS_PATH`, `THIRD_ADDRESS_PATH`), because the setup refuses duplicates. `tests/test_app.py` also has `ROTATION_PATHS` and the `rotate()` helper, which picks an unused path per key so a test can rotate several keys in one run.
|
||||||
- **`validate_health_check()` takes a third argument** (the wallet software list), and `validate_rotation()` takes a fourth for the same reason. `tests/test_validation.py` and `tests/test_database.py` wrap the first one in a small `validate()` helper.
|
- **`validate_health_check()` takes a third argument** (the wallet software list), and `validate_rotation()` takes a fourth for the same reason. `tests/test_validation.py` and `tests/test_database.py` wrap the first one in a small `validate()` helper.
|
||||||
|
|||||||
Reference in new issue
Block a user