diff --git a/ai-note.md b/ai-note.md index 54cd8b9..4c1a97e 100644 --- a/ai-note.md +++ b/ai-note.md @@ -8,9 +8,9 @@ Short working handover for the next model. Keep it short. ## Status -- **Done and verified:** sections 1–30, and section 18 steps 1–11. Schema version 12. 397 green tests. +- **Done and verified:** sections 1–30, and section 18 steps 1–11. Schema version 12. 416 green tests. - **Section 30 is done and verified.** The StartOS package lives in this repository beside the application: `startos/`, `Dockerfile`, `.dockerignore`, `Makefile`, `package.json`, `tsconfig.json`, `.prettierrc`, `LICENSE`, `icon.svg`, `instructions.md`, `UPDATING.md`, `AGENTS.md`, `README.md`, and `CLAUDE.md`. It built clean with `make x86` into `vardkey_x86_64.s9pk`, was sideloaded onto a StartOS 0.4.0 box, and runs there: the service shows **Running**, the health check reports **The web interface is ready**, and **Open UI** opens the VardKey web app. Sections 14, 16 and 17 were exercised on that box and are ticked in `TODO.md`. -- **Next work: section 31 — the eight points before version 1.** **In progress.** The plan, the order and the file lists live in `TODO.md` section 31; the state of the round is at the top of that section. Read it there before touching anything. +- **Next work: section 31 — the eight points before version 1.** **In progress: points 7, 5, 4, 3, 2 and 1 are done.** Point 6 (the installable PWA) has its service worker, its registration and its offline state in place; the manifest, its `` and the two PWA icons wait for the artwork, because the manifest needs a 192 and a 512 px icon. Point 8 (the icon) waits for the same artwork. The plan, the order and the file lists live in `TODO.md` section 31; the state of the round is at the top of that section. Read it there before touching anything. - **Two things are still deliberately left in section 30, and both need the user's go-ahead.** Do **not** raise the package version from `0.1.0:0` to `1.0.0:0`, and do **not** draw the real `icon.svg`. Section 31 comes first, and it carries the icon as its eighth point. - **A round stops when it is done.** Section 31 is the round. Do not roll into the version bump, into section 18 step 12, or into anything after it. - **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 manual tests in section 16 are all run. @@ -61,16 +61,10 @@ Decided 10.10.2026. **In progress.** The plan, the per-point file lists and the ### Where the round stands -- **Done: points 7, 5, 4, 3 and 2.** The schema is 12. `maintenance.py` (with `delete-history`), `startos/actions/deleteHistory.ts`, and the test modules `test_multisig_setup.py`, `test_key_model.py`, `test_key_status.py`, `test_export_filename.py` and `test_maintenance.py` are all in the repository. -- **In progress: point 1, the admin password.** `auth.py` and `tests/test_auth.py` are written and green, and **nothing imports `auth.py` yet**. What `auth.py` gives the rest of the round: - - `hash_password(password)`, `verify_password(password, stored)` — `hashlib.scrypt`, random salt per password, self-describing stored format, a malformed row is a failed match and never a traceback. - - `get_admin(database_path)`, `admin_configured(database_path)`, `set_admin(username, password, database_path)`, `authenticate(username, password, database_path)`. - - `session_secret(database_path)`, `create_session_token(database_path, now=None)`, `verify_session_token(token, database_path, now=None)` — a signed cookie, HMAC-SHA256 over an expiry, keyed by a secret generated once into `app_settings`. No session table. - - `new_csrf_token()`, `csrf_tokens_match(cookie_value, header_value)` — a double-submit token. - - Constants: `SESSION_COOKIE` (`vardkey_session`), `CSRF_COOKIE` (`vardkey_csrf`), `CSRF_HEADER` (`X-CSRF-Token`), `SESSION_TTL_SECONDS`, and the three `app_settings` names. - - **Build on this. Do not invent a second session mechanism.** -- **Still to do in point 1, in this order:** (1) `app.py` — login/logout, create-admin when none is stored, gating every route except `GET /health` (`401` on the API, a redirect on pages), and a CSRF requirement on every state-changing POST; (2) `static/login.html` and `static/login.js` (new), and `static/session.js` (new) — a small script that puts the CSRF header on every `fetch`, so the existing JS files do not have to be touched, with `