From 3bb49eaaf4a8024936d901c8a148c676d2aea0da Mon Sep 17 00:00:00 2001 From: ai-bot Date: Wed, 14 Oct 2026 15:59:50 +0000 Subject: [PATCH] ai-note.md: rett BR-003-dommen, 32-E -> 32.6, og pakkenamnet i prettier-fella --- ai-note.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ai-note.md b/ai-note.md index a8aa741..c4bbdab 100644 --- a/ai-note.md +++ b/ai-note.md @@ -9,11 +9,11 @@ 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). 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`. -- **What is left of section 32:** 32.1 the real icon, 32.2 the UI polish pass, 32.3 the alert message texts, 32-E the documentation drift, and 32.5 the raise to `1.0.0:0` together with section 18 step 12. Plus one item inside 32.4 that only the user can close: **BR-003**, the manual end-to-end pass over §16 and §31. +- **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. - **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\\Downloads\helsesjekk`, so they must pass there as well as on Linux. -- **Known gap, still open, folded into 32-E:** `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, and the undated export name. The documentation conflict in the bug report (BR-004) covers the same ground. ## Section 32 — what is left @@ -21,6 +21,7 @@ Short working handover for the next model. Keep it short. - **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.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.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.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 @@ -29,13 +30,14 @@ Short working handover for the next model. Keep it 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 — confirmed, user-only.** The manual end-to-end pass in §16 and §31 is still outstanding and needs a browser and a StartOS box. It is the only item inside 32.4 that is still open. -- **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-E. +- **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-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-B — the wallet-secret guard @@ -73,7 +75,7 @@ The package is one service: one daemon, one container, one SQLite database on th - **Two actions**, registered through `Actions.of()` in `startos/actions/index.ts`, with their strings in `startos/i18n/dictionaries/`: `deleteAllData.ts` (`delete-all-data`) and `setAdminPassword.ts` (`set-admin-password`). Both run `maintenance.py` in a `withTemp` subcontainer, behind a confirmation the handler enforces. The generated password never travels into the container: `maintenance.py` generates it there and prints it, which is the packaging guide's own password-reset pattern. - **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/start9-sdk` is pinned to `3.0.4`. +- **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`. - **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 @@ -156,7 +158,7 @@ Five things that are easy to break: - **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 ``, not a `

`, in the JavaScript.** `settings.js` puts it inside a `.field` label, and a `

` 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/start9-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/start9-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. - **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()`.