Handover: round 32.2 and the SVG icon, with the new traps
This commit is contained in:
1 parent
7b01b04a15
commit
f4eaf5e012
1 file changed
+35
-13
+35
-13
@@ -8,36 +8,51 @@ Short working handover for the next model. Keep it short.
|
||||
|
||||
## 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) — 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.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.
|
||||
- **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**. Schema version 12. **485 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.
|
||||
- **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.
|
||||
- **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, and the undated export name. 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 and the moved field reminder. The documentation conflict in the bug report (BR-004) covers the same ground.
|
||||
|
||||
## 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.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.1 The icon — done for the SVG, open for the PNGs.** `icon.svg` at the root and `static/icon.svg` are the same retro drawing: a raised grey window with the navy title bar and three keys. The root file is 1.3 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. `/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"`, 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.2 UI polish — done.** See the round 32.2 section below. The only thing left for the user is the manual browser pass on a narrow phone.
|
||||
- **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.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.
|
||||
|
||||
## Round 32.2 — the UI pass and the retro theme
|
||||
|
||||
`static/styles.css` was rewritten as a Windows application of the mid-1990s: background `#c0c0c0`, fields `#ffffff`, dark edge `#808080`, darkest `#000000`, a navy `#000080` title bar with white text, and no radius, shadow or gradient anywhere. Depth comes from two-tone bevels only. Headings are title bars, buttons are raised and go sunken on `:active`, fields are sunken wells, focus is the classic `outline: 1px dotted #000000`, and the tables are a 1 px grid. The responsive rules and every selector the scripts and the tests rely on are unchanged, including the exact string `.rotation-list { margin-top: 22px; }`.
|
||||
|
||||
- **`theme-color` and the manifest move together.** The five pages, `/login` and `theme_color`/`background_color` in `static/manifest.webmanifest` are all `#c0c0c0` now, and `tests/test_pwa.py` asserts that.
|
||||
- **The key card changed shape.** The number and the type share the top line (`01 · Hardware` via `keyTypeLabel()`), the type has no line of its own, the path stands alone in italics (`.key-path`) with no `Address path:` prefix, the model is a line of its own under the name with no `Model:`/`Service:` prefix and is **left out entirely when it only repeats the key's name** (`sameLabel()` normalizes case and whitespace), and only `Next check due` is shown — `Last checked` is gone. `tests/test_key_status.py` and `tests/test_health_check_form.py` pin the new order, so a fourth line or a reordered card breaks them.
|
||||
- **The dashboard heading is dynamic.** `p#setup-shape` in `index.html` carries the fallback `Bitcoin Health Monitor for a Multisig Setup.`, and `renderSetupHeading()` in `app.js` replaces it with `Bitcoin Health Monitor for a ${threshold}-of-${key_count} Multisig Setup.` from `/api/setup`. The static description and the whole `section.setup-card` are gone, and `setupTitle`, `setupDescription` and `renderSetupShape()` were removed with them, so no `null` reference is left. **The manifest description stays `Bitcoin Multisig Health Monitor`** (section 29) — only the dashboard line is dynamic. `tests/test_app.py` asserts that the dashboard no longer contains the static description.
|
||||
- **The field reminder moved.** `Never paste a seed phrase or a private key here.` now stands **once**, as a `p.secret-warning` above the whole key list in `setup.html`. It is gone from `health-check.html` (3 static fields), `health-check.js` (3), `settings.js` (2) and `setup.js` (one per card). `secretWarning()` no longer exists in `setup.js` at all. The server is untouched: `secret_guard.py`, `validation.py` and `auth.py` still refuse a secret in every free-text field. `WarningTests` in `tests/test_secret_guard.py` was rewritten to pin the new rule, and `TODO.md` §2, §12 and §15 were reworded.
|
||||
- **Two review lists went.** `Needs assessment` is gone from the Review summary in `health-check.js` (the form itself shows what is missing), and so is the `Key N: … · Check date: … · Next check due: …` line. `Results requiring follow-up` stays, and `tests/test_health_check_form.py` now asserts `assertNotIn("Needs assessment", script)`.
|
||||
- **The history list card changed.** It shows the date, `Key N: <name>` for each key (from the new `key_names`), and one short status, `All OK` or `Needs follow-up` (from the new `needs_follow_up`). `Next check due` and the `Software` text are gone from the card; the read-only detail view keeps every field it had.
|
||||
- **The two new summary fields are additive.** `GET /api/health-checks` still returns everything `list_health_checks()` returns and adds `key_names` (the name each key has now, in the same order as `key_numbers`) and `needs_follow_up` (whether that check raised anything to follow up, from `build_alerts()` — the same rules the dashboard uses). `needs_follow_up` is a property of the saved check itself, so closing an alert or renaming the key later does **not** change it; that is deliberate and pinned by `test_the_history_list_marks_a_check_that_needs_follow_up`. The enrichment lives in `app.py`'s `_send_health_check_list`, so `database.py` is untouched.
|
||||
- **The tables stay inside the page.** `table-layout: fixed` and `overflow-wrap: break-word` on `.detail-table`, plus a smaller font and tighter padding in the `max-width: 700px` query, keep `Security status` and `Follow-up closed` from running off a narrow screen. CSS only, no new JavaScript.
|
||||
- **`Local service` and `Your data stays local.` are gone** from the top bar and the footer on all six pages, including `/login`.
|
||||
- **Tests:** `tests/test_health_check_form.py` (+6), `tests/test_app.py` (+2, one renamed), `tests/test_secret_guard.py` (WarningTests rewritten, same count), `tests/test_key_status.py` (one test renamed and extended) and `tests/test_pwa.py` (colours). The suite went from 477 to 485.
|
||||
|
||||
## Section 32.4 — the bug report, as it turned out
|
||||
|
||||
`BUG-RAPPORT-AI-AGENT.md` carries the full verdicts at the end. In short:
|
||||
|
||||
- **BR-001 — false positive.** The source files are in `main` and tracked by Git. The report was written from the repository's web view, not from a checkout.
|
||||
- **BR-002 — confirmed and fixed** (round 32-B). See the guard section below. The user has since confirmed by hand that a seed phrase is stopped in the name field and in the address path field.
|
||||
- **BR-003 — the report's wording is out of date; what is left of it belongs to §32.** The report says the manual end-to-end pass is still open, but it quotes a §31 text that no longer exists, and §16 and §17 record that the manual browser pass and the box tests were run and verified through §31. What is actually outstanding is the **new** manual work §32 adds — the icon (32.1), the UI pass (32.2), the alert texts (32.3), the same look for the field reminder on every page (32.2), and the whole box test again after the changes (32.5) — plus the user's confirmation that they have been run. Do not re-verify what §16 and §17 already record as done.
|
||||
- **BR-003 — the report's wording is out of date; what is left of it belongs to §32.** The report says the manual end-to-end pass is still open, but it quotes a §31 text that no longer exists, and §16 and §17 record that the manual browser pass and the box tests were run and verified through §31. What is actually outstanding is the **new** manual work §32 adds — the icon (32.1), the UI pass and the retro theme (32.2), the alert texts (32.3), and the whole box test again after the changes (32.5) — plus the user's confirmation that they have been run. Do not re-verify what §16 and §17 already record as done.
|
||||
- **BR-004 — falls away.** `AI-STATUS.md` and `DATA-MODEL.md` do not exist in this repository, so there is no conflicting pair to reconcile. The real documentation drift is 32.6.
|
||||
- **BR-005 — verified in code, no behaviour change.** Only `GET /health`, `GET /api/session` and `/login` are open; every other `/api/*` answers `401` and the pages answer `302` to `/login`; every state-changing POST needs a session and the CSRF token (`403`). The `Secure` cookie attribute is deliberately left off, because StartOS terminates TLS and proxies plain HTTP into the container. The report itself says not to change `app.py` behaviour for this one.
|
||||
- **BR-006 — confirmed and fixed.** The CSV export neutralizes a text cell a spreadsheet would read as a formula.
|
||||
- **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.
|
||||
- **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` — for 477.
|
||||
- **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 eight, for 485.
|
||||
|
||||
## Round 32.3 — the alert texts and the page texts
|
||||
|
||||
@@ -66,7 +81,7 @@ The eleven rows in `TODO.md` §7 (eight codes, two of which have a key form and
|
||||
- **`app.py` needed no change at all.** Do not add a handler for this.
|
||||
- **The password is deliberately not checked.** A long passphrase is a legitimate password, and refusing one would lock the user out of their own account.
|
||||
- **The guard runs before the field's length limit.** A seed phrase pasted into a 60-character label field is answered with "looks like a seed phrase", not with "too long" — the other order would invite the user to shorten a seed phrase instead of removing it. The limit is still the outer bound and still applies to everything the guard lets through. **This order is deliberate and pinned by tests; do not swap it back.**
|
||||
- **The warning in the UI** is one short line, `Never paste a seed phrase or a private key here.`, in the same amber as the page notice, with the class `.secret-warning` in `static/styles.css`. It sits in `static/health-check.html` (three static fields), `static/health-check.js` (the firmware version, the key note and each security comment), `static/setup.html` and `static/setup.js` (one per key card, which covers the name, the model and the path), and `static/settings.js` (the software row and the rotation card). `settings.html` has no static free-text field, so it carries none — the fields are all built in `settings.js`. The user has confirmed it reads well on a phone.
|
||||
- **The reminder in the UI changed in 32.2.** Round 32-B put `Never paste a seed phrase or a private key here.` next to every free-text field, with the class `.secret-warning` in `static/styles.css`. It now stands **once**, above the whole key list in `static/setup.html`, and nowhere else; the per-card and per-field copies are gone. The server side is unchanged. **The page notice is not the same thing and stays** on `health-check.html`, `setup.html` and `settings.html`. `tests/test_secret_guard.py`'s `WarningTests` pins the new rule: one `class="secret-warning"` in `setup.html`, none in the check form or the settings, and no `secretWarning` in `setup.js`.
|
||||
- **The limitations are documented in the module docstring and are not to be played down:** a bare 64-character hex string is not refused (it is indistinguishable from a transaction id, which is legitimate note content); only the English wordlist is used; a secret split across several fields, or in a shape outside the patterns, is not caught; and a false positive is possible for a note that happens to be twelve or more BIP39 words in a row.
|
||||
|
||||
## Section 31 — the points before version 1 (done)
|
||||
@@ -91,6 +106,7 @@ The package is one service: one daemon, one container, one SQLite database on th
|
||||
- **Backups.** `startos/backups.ts` is `sdk.Backups.ofVolumes('main')`. StartOS stops the service for the duration of a backup, so the database file is quiescent while it is copied — the open question section 30 raised needed no snapshot hook, and it is not a known limitation.
|
||||
- **No CI.** The guide assumes GitHub Actions; this repository is on Gitea, so there are no `.github/workflows/` and there must not be any. The `.s9pk` is built locally with `make`.
|
||||
- **The skeleton** (`package.json`, `tsconfig.json`, `Makefile`, `.prettierrc`, `startos/sdk.ts`, `startos/index.ts`, `startos/i18n/`, `startos/fileModels/.gitkeep`, `assets/.gitkeep`) was written to match the Start9 template rather than generated by `s9pk init-workspace`, because that command was not available where it was written. The successful build and install confirm they are equivalent; `@start9labs/start-sdk` is pinned to `3.0.4`.
|
||||
- **The root `icon.svg` is the package artwork.** Nothing in `startos/` names it; the build reads it from the repository root. It is the same retro drawing as `static/icon.svg`, and it must stay under 40 KiB.
|
||||
- **Documentation layout.** `README.md` is the StartOS package README, with the guide's fixed heading set. The application's own reference moved to `docs/application.md`, which `instructions.md` links to under `## Documentation`. `AGENTS.md` is the repo-specific agent context, and `CLAUDE.md` is the one-line `@AGENTS.md` import. Both `README.md` and `docs/application.md` are behind the code — see the gap under Status.
|
||||
|
||||
## Alerts, closures and key identity — the parts that are easy to get wrong
|
||||
@@ -100,9 +116,9 @@ 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 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. 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()`. `_send_health_check_list()` passes the same tuple for its `needs_follow_up` field, for the same reason.
|
||||
- **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 next due date with the alert note.** `createKeyCard()` in `static/app.js` always renders `Next check due` and adds the alert note on top. `Last checked` was dropped in 32.2, but the note still comes in addition to the date, never instead of it — that is what cost the dates once before, for a key whose only alert was the informational contact one.
|
||||
- **The type is part of a key's identity.** The setup locks it, the settings never change it, and only a rotation may pick the other one: `POST /api/keys/<id>/rotate` takes an optional `type`, and leaving it out keeps the current type. `save_key_settings(..., key_type=None)` uses `COALESCE(?, type)`, so the settings and a rotation share one statement.
|
||||
- **A key that becomes a cloud key must not take a taken name.** A cloud key offers its own name as a wallet software choice, and the settings list holds the other choices, so a name the list already holds is refused with `409` through `WalletSoftwareNameInUse` — a `ValidationError` subclass, so it has to be caught before the general `ValidationError` in `_rotate_key`, or the `409` turns into a `400`. `validate_rotation()` therefore takes the wallet software list as a fourth argument.
|
||||
- **A rename needs no rotation and no confirmation.** In the rotation section the name can be changed on its own through `POST /api/settings/keys`, for any key, and the address path of a key with **no** saved check can be changed there the same way. Marking a key with `Rotate this key` and ticking the confirmation box sends it through the rotate endpoint instead, together with the type and the new path. The single button is `Save keys`.
|
||||
@@ -126,8 +142,9 @@ The rules are in `TODO.md` §7; these are the traps that have already cost time.
|
||||
- **An acknowledgement stores the action name, not a free reason**, and only the actions the endpoint performs are accepted. `rotate` has its own endpoint, because it requires a new address path.
|
||||
- **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`.
|
||||
- **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. The reminder that says so is one line in the key setup, not one per field (32.2).
|
||||
- **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 two new summary fields are additive and mean what they say.** `key_names` follows `key_numbers`; `needs_follow_up` is a property of the saved check, so it does not change when an alert is closed or a key is renamed. Do not "fix" it to follow `collect_alerts()`, which hides acknowledged alerts and would rewrite history.
|
||||
- **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.
|
||||
- **`/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.
|
||||
@@ -152,6 +169,8 @@ The rules are in `TODO.md` §7; these are the traps that have already cost time.
|
||||
|
||||
Pages: `/`, `/setup`, `/settings`, `/health-check`, `/history`, `/login`. Endpoints: `GET /health`, `GET /api/session`, `POST /api/admin`, `POST /api/login`, `POST /api/logout`, `GET /api/setup`, `POST /api/setup`, `GET /api/keys`, `GET /api/key-status`, `GET /api/previous-values`, `GET /api/settings`, `POST /api/settings/keys`, `POST /api/settings/wallet-software`, `POST /api/keys/<id>/rotate`, `GET /api/health-checks`, `GET /api/health-checks/<id>`, `GET /api/alerts`, `POST /api/alerts/acknowledge`, `GET /api/export`, `POST /api/health-checks`. Field details are in `docs/application.md` — which is behind the code, see the gap under Status.
|
||||
|
||||
`GET /api/health-checks` returns each summary with `id`, `checked_at`, `next_check_due`, `software_compatibility_status`, `wallet_software`, `contact_info_verified`, `comments`, `key_numbers`, and the two added in 32.2: `key_names` and `needs_follow_up`.
|
||||
|
||||
Maintenance commands, run inside the container by the StartOS actions and usable by hand: `maintenance.py delete-all-data` and `maintenance.py set-admin-password`. Neither is an HTTP endpoint.
|
||||
|
||||
The rotate payload is `replaced` + `keep_name` + `name` + `type` + `address_path`, and `type` is optional. `GET /api/health-checks/<id>` also returns `closed_alerts`. The settings page has two sections, and `POST /api/settings/keys` is what a rename alone goes through.
|
||||
@@ -173,9 +192,12 @@ Five things that are easy to break:
|
||||
- **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.
|
||||
- **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 reminder is gone; only the setup keeps one.** It used to be a `<span>` built in JavaScript (`settings.js` put it inside a `.field` label, where a `<p>` is not allowed) with `display: block` and `font-weight: 400` so it looked right in both places. Since 32.2 it is a single `p.secret-warning` in `setup.html`, and `setup.js`, `health-check.js` and `settings.js` no longer build one at all. A test asserts `setup.html` holds exactly one `class="secret-warning"` and that the check form and the settings hold none, so re-adding a per-field copy breaks it.
|
||||
- **`static/health-check.js` must not use `placeholder` anywhere.** A test asserts the string is absent, because a previous value is a real input value.
|
||||
- **The key card's line order is pinned by two test modules.** `tests/test_key_status.py` asserts `card.append(top, name)` → `card.append(model)` → `card.append(path)`, and `tests/test_health_check_form.py` asserts that the top line is `${String(entry.key_number).padStart(2, "0")} · ${keyTypeLabel(entry.type)}`, that `card.append(type)` is gone, and that the model line is skipped by `sameLabel(entry.model, entry.name)`. Adding a line, reordering them, or dropping `sameLabel()` breaks them.
|
||||
- **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.
|
||||
- **`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 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 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.
|
||||
- **`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=`.
|
||||
|
||||
Reference in new issue
Block a user