Note: section 32.1 is done, with the two PNG icons in place

This commit is contained in:
ai-bot committed 2026-10-15 19:45:33 +00:00
1 parent 4bb11dbd27
commit 2a2010503a
1 file changed
+16 -14
+16 -14
View File
@@ -8,16 +8,16 @@ 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.2, the UI pass with the retro theme, and the SVG half of section 32.1, the icon, are also done**, together with **section 32.4, the bug report** (round 32-A and round 32-B) and **section 32.3, the alert and page texts**. The follow-up round of 32.1 and 32.2 — the favicon, the top-bar brand mark, the footer at the bottom, the single way back, the history button and the three line/table changes in the history view — is done too. Schema version 12. **494 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.1, the icon, is done** — the SVG drawing, the favicon on every page, the top-bar brand mark and the two 192 and 512 px PNGs — together with **section 32.2, the UI pass with the retro theme**, **section 32.3, the alert and page texts**, and **section 32.4, the bug report** (round 32-A and round 32-B). The follow-up round of 32.1 and 32.2 — the favicon, the top-bar brand mark, the footer at the bottom, the single way back, the history button and the three line/table changes in the history view — is done too. Schema version 12. **498 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:** the two PNG icons at 192 and 512 px (they need a rasterizer), 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. The user's own manual pass is also outstanding: the retro theme on a narrow phone, the footer on a short page, the favicon in the tab, the brand mark in the top bar, the history view after the three changes, and the whole box test again. - **What is left of section 32:** 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. The user's own manual pass is also outstanding: the retro theme on a narrow phone, the footer on a short page, the favicon in the tab, the brand mark in the top bar, installing the PWA with the two PNG icons, the history view after the three changes, and the whole box test again.
- **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.
- **Known gap, still open, folded into 32.6:** `docs/application.md` and `README.md` still describe the API as it was before section 31 — no login/session endpoints, no gating or CSRF rule, the old maintenance command name, the undated export name, and now also the two new summary fields, the moved field reminder, the added `model` field in the check detail and the icon link on the pages. The documentation conflict in the bug report (BR-004) covers the same ground. - **Known gap, still open, folded into 32.6:** `docs/application.md` and `README.md` still describe the API as it was before section 31 — no login/session endpoints, no gating or CSRF rule, the old maintenance command name, the undated export name, and now also the two new summary fields, the moved field reminder, the added `model` field in the check detail, the icon link on the pages and the two PNG icons. The documentation conflict in the bug report (BR-004) covers the same ground.
## Section 32 — what is left ## Section 32 — what is left
- **32.1 The icon — done for the SVG and the favicon, open for the PNGs.** `icon.svg` at the root and `static/icon.svg` are the same retro drawing: a raised grey window with the three keys, centred in the face. **The navy title bar is gone** (the follow-up round removed it), and the keys were recomputed so they are centred: one key group is 21 high, the face inside the bevel runs from 6 to 122, so the centre is 64 and the keys sit at `translate(23, 25.5)`, `(23, 51.5)` and `(23, 77.5)`. The root file is 1.2 KiB, well under the 40 KiB cap, and it is plain SVG with no font, image or network reference, so the `default-src 'self'` CSP holds. Every one of the six pages links `/icon.svg` as its favicon, and the top-bar brand mark is the icon image under the same `brand-mark` class. `/icon.svg` was already in `STATIC_FILES`, in the manifest's `icons` entry and in the service worker's allow-list, so no path is new. **What is left:** the 192 and 512 px PNGs, which need a rasterizer the agent does not have. The user rasterizes `static/icon.svg`, adds both to the manifest's `icons` entry with `sizes` and `type: "image/png"` (**the SVG entry must stay first**, or `test_the_manifest_lists_the_served_icon` breaks), adds the paths to `STATIC_FILES` in `app.py` and to the allow-list in `static/sw.js`, and updates `tests/test_pwa.py`. The placeholder with `sizes: "any"` is a fine place to stop. - **32.1 The icon — done.** `icon.svg` at the root and `static/icon.svg` are the same retro drawing: a raised grey window with the three keys, centred in the face. **The navy title bar is gone**, and the keys were recomputed so they are centred: one key group is 21 high, the face inside the bevel runs from 6 to 122, so the centre is 64 and the keys sit at `translate(23, 25.5)`, `(23, 51.5)` and `(23, 77.5)`. The root file is 1.2 KiB, well under the 40 KiB cap, and it is plain SVG with no font, image or network reference, so the `default-src 'self'` CSP holds. Every one of the six pages links `/icon.svg` as its favicon, the top-bar brand mark is the icon image under the same `brand-mark` class, and the two PNGs the user rasterized — `static/icon-192.png` and `static/icon-512.png` — are listed in the manifest after the SVG, served through `STATIC_FILES` and cached by the service worker. `/icon.svg` was already in `STATIC_FILES`, in the manifest's `icons` entry and in the service worker's allow-list, so no path is new; the two PNG paths are.
- **32.2 UI polish — done**, including the follow-up round. See the round 32.2 section below. The only thing left for the user is the manual browser pass on a narrow phone and over the new points. - **32.2 UI polish — done**, including the follow-up round. See the round 32.2 section below. The only thing left for the user is the manual browser pass on a narrow phone and over the new points.
- **32.3 Alert and page texts — done.** See the round 32.3 section below. - **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.
@@ -43,16 +43,18 @@ Short working handover for the next model. Keep it short.
## The follow-up round of 32.1 and 32.2 — the icon, the favicon, the footer and the history ## The follow-up round of 32.1 and 32.2 — the icon, the favicon, the footer and the history
Six small changes, no new feature and no schema change. The whole round is one commit series; the reasoning is in `TODO.md` §32.1 and §32.2 points 16–21. Seven small changes, no new feature and no schema change. The reasoning is in `TODO.md` §32.1 and §32.2 points 16–21.
- **The icon lost its navy title bar and the keys are centred.** `icon.svg` and `static/icon.svg` are the same drawing. The keys are 21 high per group and the face is 6–122, so the centre is 64 and the translate values are `25.5`, `51.5` and `77.5`. The style, the `viewBox` and the `role`/`aria-label` are unchanged. The `aria-label` is still `VardKey icon`, so `tests/test_pwa.py`'s manifest test (which only checks that `/icon.svg` is served) still passes. - **The icon lost its navy title bar and the keys are centred.** `icon.svg` and `static/icon.svg` are the same drawing. The keys are 21 high per group and the face is 6–122, so the centre is 64 and the translate values are `25.5`, `51.5` and `77.5`. The style, the `viewBox` and the `role`/`aria-label` are unchanged.
- **The two SVG files must keep the same drawing.** The package icon at the repository root is the source of truth, and `static/icon.svg` is the copy the PWA serves. Only the leading comment differs, and `test_the_served_icon_carries_the_same_drawing_as_the_package_icon` compares them from the `<svg>` element onwards. A change to one drawing has to be made in both.
- **The two PNGs are rasterized from `static/icon.svg` and are real files in the repository.** `static/icon-192.png` and `static/icon-512.png` were made by the user, because the agent has no rasterizer. `IconTests` reads each file's IHDR and asserts 192×192 and 512×512, so a PNG made at the wrong size fails the suite instead of silently breaking the install prompt.
- **The favicon is on all six pages.** `<link rel="icon" type="image/svg+xml" href="/icon.svg">` sits in `<head>` next to the manifest link on the five pages that have one; `/login` has no manifest, so it stands next to the stylesheet there. - **The favicon is on all six pages.** `<link rel="icon" type="image/svg+xml" href="/icon.svg">` sits in `<head>` next to the manifest link on the five pages that have one; `/login` has no manifest, so it stands next to the stylesheet there.
- **The brand mark is the icon image.** `<span class="brand-mark" aria-hidden="true">V</span>` became `<img class="brand-mark" src="/icon.svg" alt="" aria-hidden="true">`. **The class name is kept**, because the stylesheet and the tests refer to it. `.brand-mark` is now `width: 18px; height: 18px; border: 2px solid; border-color: #ffffff #000000 #000000 #ffffff; background: var(--face); image-rendering: pixelated;` — `display: grid`, `place-items: center`, `color`, `font-size` and `font-weight` are gone, and `IconTests` asserts that `place-items: center` appears nowhere in the sheet. - **The brand mark is the icon image.** `<span class="brand-mark" aria-hidden="true">V</span>` became `<img class="brand-mark" src="/icon.svg" alt="" aria-hidden="true">`. **The class name is kept**, because the stylesheet and the tests refer to it. `.brand-mark` is now `width: 18px; height: 18px; border: 2px solid; border-color: #ffffff #000000 #000000 #ffffff; background: var(--face); image-rendering: pixelated;` — `display: grid`, `place-items: center`, `color`, `font-size` and `font-weight` are gone, and `IconTests` asserts that `place-items: center` appears nowhere in the sheet.
- **The footer sits at the bottom on a short page.** `body` is a column with `min-height: 100vh` and `min-height: 100dvh`, and `main { flex: 1 1 auto; }` takes the rest, so `.footer` lands at the bottom. No other layout rule was touched. `IconTests` pins those four declarations. - **The footer sits at the bottom on a short page.** `body` is a column with `min-height: 100vh` and `min-height: 100dvh`, and `main { flex: 1 1 auto; }` takes the rest, so `.footer` lands at the bottom. No other layout rule was touched. `IconTests` pins those four declarations.
- **There is one way back to the dashboard.** The top-bar `Back to dashboard` link is gone from `history.html`, `settings.html`, `setup.html` and `health-check.html`; the `VardKey` brand mark is the way back. **The link in the blocked-keys note stays** — it points at the dashboard for a different reason, and `tests/test_health_check_form.py` still asserts its wording. `history.html` also lost the `Start annual health check` button: a check is started from the dashboard. - **There is one way back to the dashboard.** The top-bar `Back to dashboard` link is gone from `history.html`, `settings.html`, `setup.html` and `health-check.html`; the `VardKey` brand mark is the way back. **The link in the blocked-keys note stays** — it points at the dashboard for a different reason, and `tests/test_health_check_form.py` still asserts its wording. `history.html` also lost the `Start annual health check` button: a check is started from the dashboard.
- **The history view changed in three places.** In `static/history.js`, `mergedLine(...)` joins `wallet_software` and `software_version` into one line (`Sparrow Wallet 2.5.1`) and `model` and `firmware_version` into one line (`Blockstream Jade 1.4.1`); a missing part is left out and a pair with neither shows `—`. The `Follow-up closed` table is now `["Alert", "Action", "Closed"]` — **the `Source` column is gone**. - **The history view changed in three places.** In `static/history.js`, `mergedLine(...)` joins `wallet_software` and `software_version` into one line (`Sparrow Wallet 2.5.1`) and `model` and `firmware_version` into one line (`Blockstream Jade 1.4.1`); a missing part is left out and a pair with neither shows `—`. The `Follow-up closed` table is now `["Alert", "Action", "Closed"]` — **the `Source` column is gone**.
- **The model had to be added to the detail response.** `get_health_check()` did not select `k.model`, so `GET /api/health-checks/<id>` carried no model at all. It is now selected in the key-check query and comes in **in addition** to the fields that were already there; no existing field was renamed. `tests/test_pwa.py`'s `IconTests` and three new tests in `tests/test_health_check_form.py` pin the page and history changes, and `tests/test_alerts.py` pins the alert source below. - **The model had to be added to the detail response.** `get_health_check()` did not select `k.model`, so `GET /api/health-checks/<id>` carried no model at all. It is now selected in the key-check query and comes in **in addition** to the fields that were already there; no existing field was renamed.
- **Tests:** three in `tests/test_alerts.py`, four in `tests/test_pwa.py` and three in `tests/test_health_check_form.py`, so the suite went from 484 to **494**. Nothing in `tests/test_app.py` or `tests/test_database.py` had to change: the added field is additive and no test there asserts a whole record. - **Tests:** three in `tests/test_alerts.py`, four in `tests/test_pwa.py` and three in `tests/test_health_check_form.py` in the first half, plus four more in `tests/test_pwa.py` when the PNGs arrived — so the suite went from 484 to **498**. Nothing in `tests/test_app.py` or `tests/test_database.py` had to change: the added field is additive and no test there asserts a whole record.
## Section 32.4 — the bug report, as it turned out ## Section 32.4 — the bug report, as it turned out
@@ -67,7 +69,7 @@ Six small changes, no new feature and no schema change. The whole round is one c
- **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. Round 32.3 added two more — one in `tests/test_alerts.py` and one in `tests/test_health_check_form.py` — and round 32.2 added seven net, for 484. The seven are six new tests in `tests/test_health_check_form.py` and two in `tests/test_app.py`, minus the one `WarningTests` test that the rewritten class no longer has. The follow-up round of 32.1 and 32.2 added ten more, for 494. - **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` — and round 32.2 added seven net, for 484. The seven are six new tests in `tests/test_health_check_form.py` and two in `tests/test_app.py`, minus the one `WarningTests` test that the rewritten class no longer has. The follow-up round of 32.1 and 32.2 added fourteen more in total, for 498.
## Round 32.3 — the alert texts and the page texts ## Round 32.3 — the alert texts and the page texts
@@ -106,7 +108,7 @@ Seven points, done in the order 7, 5, 4, 3, 2, 1, 6 — the data model first, be
- **Schema 12.** `app_settings` (`multisig_threshold`, `multisig_key_count`, `admin_username`, `admin_password_hash`, `session_secret`) and a nullable `keys.model`. The `key_number` CHECK was loosened through a table rebuild with `PRAGMA foreign_keys = OFF` and `PRAGMA foreign_key_check` before commit. - **Schema 12.** `app_settings` (`multisig_threshold`, `multisig_key_count`, `admin_username`, `admin_password_hash`, `session_secret`) and a nullable `keys.model`. The `key_number` CHECK was loosened through a table rebuild with `PRAGMA foreign_keys = OFF` and `PRAGMA foreign_key_check` before commit.
- **The admin login.** `auth.py` is the only place that knows the credential: `hashlib.scrypt` with a random salt per password, a signed session cookie (HMAC-SHA256 over an expiry, keyed by `session_secret`, no session table), and a double-submit CSRF token. Every route except `GET /health` needs a session: `401` on the API, a redirect to `/login` on the pages, and a CSRF requirement on every state-changing POST. - **The admin login.** `auth.py` is the only place that knows the credential: `hashlib.scrypt` with a random salt per password, a signed session cookie (HMAC-SHA256 over an expiry, keyed by `session_secret`, no session table), and a double-submit CSRF token. Every route except `GET /health` needs a session: `401` on the API, a redirect to `/login` on the pages, and a CSRF requirement on every state-changing POST.
- **`maintenance.py`**, with `delete-all-data` and `set-admin-password`. - **`maintenance.py`**, with `delete-all-data` and `set-admin-password`.
- **The installable PWA**, without offline data: `static/sw.js` (an allow-list of shell paths only), `static/manifest.webmanifest`, `static/icon.svg`, the registration and offline state in `static/app.js`, and the manifest link on the five pages. - **The installable PWA**, without offline data: `static/sw.js` (an allow-list of shell paths only), `static/manifest.webmanifest`, `static/icon.svg` and the two PNGs beside it, the registration and offline state in `static/app.js`, and the manifest link on the five pages.
- **The flexible threshold** (`2 ≤ key_count ≤ 15`, `1 ≤ threshold ≤ key_count`), still for **one** setup only. - **The flexible threshold** (`2 ≤ key_count ≤ 15`, `1 ≤ threshold ≤ key_count`), still for **one** setup only.
- **The dated export name**, `YYYY-MM-DD-vardkey-export.csv`. The `download` attribute in `static/index.html` was removed, because one with a value overrides the server's `Content-Disposition` filename. - **The dated export name**, `YYYY-MM-DD-vardkey-export.csv`. The `download` attribute in `static/index.html` was removed, because one with a value overrides the server's `Content-Disposition` filename.
@@ -193,7 +195,7 @@ The rotate payload is `replaced` + `keep_name` + `name` + `type` + `address_path
Five things that are easy to break: Five things that are easy to break:
- New static files must be added to `STATIC_FILES` in `app.py`, or they return `404`. That includes `/settings`, `/settings.js`, `/login`, `/login.js`, `/session.js`, `/sw.js`, `/manifest.webmanifest` and `/icon.svg`. - New static files must be added to `STATIC_FILES` in `app.py`, or they return `404`. That includes `/settings`, `/settings.js`, `/login`, `/login.js`, `/session.js`, `/sw.js`, `/manifest.webmanifest`, `/icon.svg` and the two raster icons `/icon-192.png` and `/icon-512.png`.
- `/api/setup`, `/api/settings`, `/api/alerts`, `/api/key-status`, `/api/previous-values` and `/api/session` are extra endpoints that are not in the minimum list in section 11. - `/api/setup`, `/api/settings`, `/api/alerts`, `/api/key-status`, `/api/previous-values` and `/api/session` are extra endpoints that are not in the minimum list in section 11.
- `STORAGE_ERRORS` in `app.py` includes `RuntimeError`, because `list_keys()` raises it for a partial setup. Keep it there, or a broken database answers with a traceback instead of a `500`. It also includes `ValueError`, so `validate_admin_credentials()` has to be called in its own `try` and mapped to a `400` before the storage handler — and it is why a refused secret has to be a `ValidationError` rather than a bare `ValueError`. - `STORAGE_ERRORS` in `app.py` includes `RuntimeError`, because `list_keys()` raises it for a partial setup. Keep it there, or a broken database answers with a traceback instead of a `500`. It also includes `ValueError`, so `validate_admin_credentials()` has to be called in its own `try` and mapped to a `400` before the storage handler — and it is why a refused secret has to be a `ValidationError` rather than a bare `ValueError`.
- The settings, rotation and acknowledgement endpoints keep the same error handling as the existing ones: a bad payload is a `400`, an unknown key or alert is a `404`, a locked or duplicate address path is a `409`, and a broken database is a `500`. `DuplicateAddressPath` and `WalletSoftwareNameInUse` must be caught before the general `ValidationError` — in `_save_key_settings` and `_rotate_key` respectively — or the `409` turns into a `400`. A missing or invalid session is a `401`, and a missing CSRF token is a `403`. - The settings, rotation and acknowledgement endpoints keep the same error handling as the existing ones: a bad payload is a `400`, an unknown key or alert is a `404`, a locked or duplicate address path is a `409`, and a broken database is a `500`. `DuplicateAddressPath` and `WalletSoftwareNameInUse` must be caught before the general `ValidationError` — in `_save_key_settings` and `_rotate_key` respectively — or the `409` turns into a `400`. A missing or invalid session is a `401`, and a missing CSRF token is a `403`.
@@ -203,7 +205,7 @@ Five things that are easy to break:
- **`with sqlite3.connect(...)` does not close the connection.** It only commits or rolls back the transaction. On Windows the database file stays locked and `TemporaryDirectory.cleanup()` fails with `WinError 32`. Always close explicitly with `try`/`finally`; see `write_schema()` in `tests/test_database.py`. - **`with sqlite3.connect(...)` does not close the connection.** It only commits or rolls back the transaction. On Windows the database file stays locked and `TemporaryDirectory.cleanup()` fails with `WinError 32`. Always close explicitly with `try`/`finally`; see `write_schema()` in `tests/test_database.py`.
- **A module the image is missing is a runtime error, not a build error.** `auth.py` was left out of the `Dockerfile` because the module list was written before it existed, and both `app.py` and `maintenance.py` then died with `ModuleNotFoundError` inside the container while every test stayed green. The `COPY *.py ./` line is what stops that recurring. After any change to the image, check the modules, not just the tests. `secret_guard.py` is covered by the same line. - **A module the image is missing is a runtime error, not a build error.** `auth.py` was left out of the `Dockerfile` because the module list was written before it existed, and both `app.py` and `maintenance.py` then died with `ModuleNotFoundError` inside the container while every test stayed green. The `COPY *.py ./` line is what stops that recurring. After any change to the image, check the modules, not just the tests. `secret_guard.py` is covered by the same line.
- **Every server test module needs a session, and a redirect makes a missing one look like a pass.** A page fetched without a session answers `302 → /login`, and `urllib` follows it, so an assertion on page markup reads the login page's HTML instead of failing with `401`. Use `tests/server_session.py`'s `SessionMixin`, and note that the manifest and the icon are open while the pages are not. - **Every server test module needs a session, and a redirect makes a missing one look like a pass.** A page fetched without a session answers `302 → /login`, and `urllib` follows it, so an assertion on page markup reads the login page's HTML instead of failing with `401`. Use `tests/server_session.py`'s `SessionMixin`, and note that the manifest and the icons are open while the pages are not.
- **`urlopen` raises `HTTPError` on a 4xx.** A test that expects a `400` has to catch it and read the body from the exception; `tests/test_secret_guard.py`'s `post_status()` helper is the pattern. - **`urlopen` raises `HTTPError` on a 4xx.** A test that expects a `400` has to catch it and read the body from the exception; `tests/test_secret_guard.py`'s `post_status()` helper is the pattern.
- **A field has a length limit, and the guard runs before it.** A test that pastes an 80-character seed phrase into a 60-character label field gets a secret refusal, not a length refusal. Use a WIF key (52 characters) or a BIP38 key (58) when a test needs a secret that *fits* a short field, and use the seed phrase where the field has room. Both sides are pinned in `tests/test_secret_guard.py`. - **A field has a length limit, and the guard runs before it.** A test that pastes an 80-character seed phrase into a 60-character label field gets a secret refusal, not a length refusal. Use a WIF key (52 characters) or a BIP38 key (58) when a test needs a secret that *fits* a short field, and use the seed phrase where the field has room. Both sides are pinned in `tests/test_secret_guard.py`.
- **A `required` control inside a `display:none` container still blocks submission.** The browser refuses to submit and logs "An invalid form field is not focusable". Hiding a section is not enough: the required flags must be cleared, or the section must render something other than required fields. That is why `renderSecurityChecks()` shows an empty note instead of cards when a key could not be checked, why `syncUncheckableState()` clears the flags on the wallet software and the compatibility select — also for a cloud key, whose grid is hidden — and why `syncRequiredFields()` clears the flag on `hardware_works` and `seed_backup_verified`. The rotation fields follow the same rule: the type is `disabled` until the key is marked for rotation, the path is `disabled` when the key has a saved check and is not marked, and the script refuses to send an empty path. The login page sidesteps it with two separate forms, so only the visible one is ever validated. - **A `required` control inside a `display:none` container still blocks submission.** The browser refuses to submit and logs "An invalid form field is not focusable". Hiding a section is not enough: the required flags must be cleared, or the section must render something other than required fields. That is why `renderSecurityChecks()` shows an empty note instead of cards when a key could not be checked, why `syncUncheckableState()` clears the flags on the wallet software and the compatibility select — also for a cloud key, whose grid is hidden — and why `syncRequiredFields()` clears the flag on `hardware_works` and `seed_backup_verified`. The rotation fields follow the same rule: the type is `disabled` until the key is marked for rotation, the path is `disabled` when the key has a saved check and is not marked, and the script refuses to send an empty path. The login page sidesteps it with two separate forms, so only the visible one is ever validated.
@@ -214,6 +216,7 @@ Five things that are easy to break:
- **The dashboard heading is dynamic and the static description is gone.** `tests/test_app.py` asserts `id="setup-shape"` and the fallback text on the dashboard and `assertNotIn("Bitcoin Multisig Health Monitor")` there, while `tests/test_pwa.py` still asserts that exact description in the manifest. Do not move the one into the other. - **The dashboard heading is dynamic and the static description is gone.** `tests/test_app.py` asserts `id="setup-shape"` and the fallback text on the dashboard and `assertNotIn("Bitcoin Multisig Health Monitor")` there, while `tests/test_pwa.py` still asserts that exact description in the manifest. Do not move the one into the other.
- **The stylesheet test asserts on the shape of the theme, not on its wording.** `test_stylesheet_is_the_retro_theme` checks the two bevel colour pairs, the dotted focus outline, the font stack, the absence of `box-shadow` and `gradient`, and that every `border-radius` in the sheet is `0`. It reads the values, so a restyled rule that keeps the palette passes, and a rounded corner does not. - **The stylesheet test asserts on the shape of the theme, not on its wording.** `test_stylesheet_is_the_retro_theme` checks the two bevel colour pairs, the dotted focus outline, the font stack, the absence of `box-shadow` and `gradient`, and that every `border-radius` in the sheet is `0`. It reads the values, so a restyled rule that keeps the palette passes, and a rounded corner does not.
- **The brand mark is an image, and the class name is pinned.** `IconTests` in `tests/test_pwa.py` asserts that all six pages carry `<img class="brand-mark" src="/icon.svg" alt="" aria-hidden="true">`, that the old `<span class="brand-mark" aria-hidden="true">V</span>` is gone, that the sheet holds `image-rendering: pixelated`, and that `place-items: center` appears nowhere. It also pins `min-height: 100vh`, `min-height: 100dvh`, `flex-direction: column` and the exact string `main { flex: 1 1 auto; }`, which is what keeps the footer at the bottom. Do not style the brand mark as a letter again, and do not drop the `main` rule. - **The brand mark is an image, and the class name is pinned.** `IconTests` in `tests/test_pwa.py` asserts that all six pages carry `<img class="brand-mark" src="/icon.svg" alt="" aria-hidden="true">`, that the old `<span class="brand-mark" aria-hidden="true">V</span>` is gone, that the sheet holds `image-rendering: pixelated`, and that `place-items: center` appears nowhere. It also pins `min-height: 100vh`, `min-height: 100dvh`, `flex-direction: column` and the exact string `main { flex: 1 1 auto; }`, which is what keeps the footer at the bottom. Do not style the brand mark as a letter again, and do not drop the `main` rule.
- **The manifest lists the SVG first, and the two PNGs after it.** `test_the_manifest_lists_the_served_icon` reads `icons[0]`, so a PNG added in front of the SVG turns the suite red. The PNG entries must carry the real size (`192x192` and `512x512`) and `type: "image/png"`, and `test_the_png_icons_are_the_size_the_manifest_declares` reads each file's IHDR, so a PNG rasterized at the wrong size fails rather than quietly breaking the install prompt. The two SVG files must also keep the same drawing — `test_the_served_icon_carries_the_same_drawing_as_the_package_icon` compares them from `<svg>` onwards, and only the leading comment may differ.
- **`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 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 used `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 used `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. - **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.
@@ -227,8 +230,7 @@ Five things that are easy to break:
- **The other server test modules share `tests/server_session.py`.** `test_export_filename.py`, `test_key_model.py`, `test_key_status.py`, `test_multisig_setup.py`, `test_pwa.py` and `test_secret_guard.py` mix in `SessionMixin`, which signs in through the API and carries the cookies; each class calls `authenticate()` at the end of its own `setUp`. **A test that switches `DATABASE_PATH` to another file has to call `authenticate()` again**, because the session secret lives in the database, so the old cookie is signed with the wrong secret and every request answers `401`. The mixin resolves the path with `app.get_database_path()`, so the admin lands in the file the server actually reads. - **The other server test modules share `tests/server_session.py`.** `test_export_filename.py`, `test_key_model.py`, `test_key_status.py`, `test_multisig_setup.py`, `test_pwa.py` and `test_secret_guard.py` mix in `SessionMixin`, which signs in through the API and carries the cookies; each class calls `authenticate()` at the end of its own `setUp`. **A test that switches `DATABASE_PATH` to another file has to call `authenticate()` again**, because the session secret lives in the database, so the old cookie is signed with the wrong secret and every request answers `401`. The mixin resolves the path with `app.get_database_path()`, so the admin lands in the file the server actually reads.
- **Section 19 records one key per submission**, so a `Check id` in the export can cover up to three keys only for rows saved before section 19. A legacy record with several `key_checks` is read through its first one when an alert needs the key it belongs to. - **Section 19 records one key per submission**, so a `Check id` in the export can cover up to three keys only for rows saved before section 19. A legacy record with several `key_checks` is read through its first one when an alert needs the key it belongs to.
- **The database path default is repeated in sixteen places.** `database.py` carries `database_path="data/vardkey.sqlite3"` as the default of every storage function (fifteen of them), and `app.py` carries it in `get_database_path()`. A missed one makes a single code path read or create the other file, silently. Grep for the old name before and after a rename round. - **The database path default is repeated in sixteen places.** `database.py` carries `database_path="data/vardkey.sqlite3"` as the default of every storage function (fifteen of them), and `app.py` carries it in `get_database_path()`. A missed one makes a single code path read or create the other file, silently. Grep for the old name before and after a rename round.
- **The favicon link sits next to the manifest link, and `/login` has no manifest.** `IconTests` asserts the exact string `<link rel="icon" type="image/svg+xml" href="/icon.svg">` on all six pages, so a reworded or reordered link breaks it. `/icon.svg` is open (it is not in `PROTECTED_PAGES` and does not start with `/api/`), which is what lets the login page and the browser tab read it. - **The favicon link sits next to the manifest link, and `/login` has no manifest.** `IconTests` asserts the exact string `<link rel="icon" type="image/svg+xml" href="/icon.svg">` on all six pages, so a reworded or reordered link breaks it. `/icon.svg` and the two PNGs are open (they are not in `PROTECTED_PAGES` and do not start with `/api/`), which is what lets the login page and the browser tab read them.
- **`TODO.md` §32.1 lists the PNG steps, and the SVG entry must stay first in `icons`.** `test_the_manifest_lists_the_served_icon` reads `icons[0]`, so a PNG added in front of the SVG turns the suite red.
## Product clarification ## Product clarification