Files
token-circles/dev-changelog.md
Komediruzecki 619f180373 merge: main 5c2798da into the first week
Brings in 580168e8 and the six PRs merged on it: #628 and #623 (tests), #622, #621, #624 and
#625. The branch already carried #621's first commit (3b265179), #622's first commit (50841aaf)
and #624's and #625's commits. Main's reviewed versions win, and the branch's later work stays on
top of them.

- #621's review commit: the Accounts page takes the badge's colour and the card's icon from
  core/accountTypes.ts, the constellation and the edit dialog read the type through
  knownAccountType, and an unknown type opens as a disabled "Other account" option. The branch's
  credit work moves into those maps: accountTypeTone gives credit 'expense', accountTypeIcon gives
  it the card and cash the banknotes, the constellation keeps its "Credit card" entry and drops the
  dead "investment" one, and the edit dialog offers Credit Card. accountForm.ts imports main's
  storedAccountType and the branch's takesCreditLine.
- #622's review commit is dev-changelog only, and main's entry replaces the branch's copy. The
  achievements code is the branch's, which sums through baseAmount wherever #622 does.
- #624 and #625: the onboarding CSS and spec are main's plus the branch's later commits.

The clash: the branch makes credit a type, and #621's tests on main use credit as the type a build
does not know. After the merge a credit account shows as a credit card on every display #621
reads through knownAccountType (badge word, colour, icon, constellation, Transactions select, edit
dialog), and the import and MCP create_account take credit, as the account form does. #621's
tests that need an unknown type use sock_drawer, which no build will have; the branch's own switch
from credit to loan stays in the tests that are not #621's. New checks: a credit card on each
display (accountTypes, accountsPageTypes, accountConstellation, transactionsAccountTypeWord, the
edit dialog in accountForm), an import contract scenario in both runtimes and MCP create_account.

Changelogs: main's entries stay where main has them, and the branch's stay under [Unreleased].
The branch's credit entries now say that the import and the MCP server take a credit card.
2026-10-18 16:25:35 +02:00

414 KiB
Raw Permalink Blame History

Developer changelog (detailed)

Full technical detail of every change, for developers and self-hosters. The concise, user-facing summary — and what the app shows in-product — lives in CHANGELOG.md.

All notable changes to Token Circles are documented here. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Deploy notes

  • Two migrations, both a column on an existing table: 0031_email_change.sql adds purpose ('confirm' or 'change', default 'confirm') to email_verifications (#608), and 0032_login_code_handle.sql adds handle_hash with a unique index to login_codes (#615). A sign-in code requested before the deploy has no handle and stops working; the person asks for a new one, and every code expires within ten minutes anyway.
  • From #616 on, a password account whose address is not confirmed gets Confirm your email instead of the app, and its sessions and API tokens get 403 EMAIL_UNCONFIRMED. That includes accounts created before this release that never opened their link.
  • The app sends X-Time-Zone on every cloud request from #603 on, so GETs that sent no custom header now get a CORS preflight; cors() sets maxAge: 7200 so the browser asks once per two hours.
  • 0033_welcome_once.sql is data only: it adds a reminder_dedup row (user_id, 'welcome') for every account, so no account that exists before it gets the new Welcome. The migration runs before the deploy, so a password account that signs up in between gets the old welcome, with its confirm link, and the new Welcome when it confirms.
  • 0034_user_state.sql adds one table, user_state (user_id, key, value, updated_at) with primary key (user_id, key). Only /api/account/state reads or writes it, so it is safe to apply before the code that uses it.
  • 0035_onboarding_existing_accounts.sql is data only: it writes a finished onboarding record (outcome: 'existing', step and started_at null) for every account with an account, a transaction or a bill in any of its profiles, or an onboarding row in any profile's settings. An account with none of those keeps meeting the wizard, as it did before. Until the Worker serves /api/account/state, the new app's read of it fails and the app opens no wizard; an account that signs up between the migration and the app's deploy and decides the wizard there has the decision in its settings, which the app sends to the record.
  • 0036_category_kinds.sql adds two nullable columns to categories, kind TEXT and essential INTEGER, with no default and no rewrite: every existing category reads NULL for both, which the app reads as "go by the name". Safe to apply before the code: the Worker before it names its columns on every insert, and the client before it drops keys its schema lacks.
  • 0037_account_credit.sql adds two nullable columns to accounts, credit_limit REAL and credit_rate REAL, with no default and no rewrite. Safe to apply before the code, for the same reasons. The code also writes a new accounts.type, credit: a client from before the tolerant account reader (fix(accounts), the reader keeps a type it lacks) fails to load a list holding one, so that fix ships in an earlier release, and no rollback goes past it once a credit account exists.
  • 0038_import_bank_formats.sql adds one nullable column to import_logs, bank_formats TEXT, with no default and no rewrite: every existing log reads NULL. Safe to apply before the code: the Worker before it names its columns on every insert.

Loans

  • One amortisation engine for both runtimes (#594). shared/loanSchedule.ts replaces the two copies in frontend/src/core/loanCalculator.ts (deleted with its test) and worker/src/routes/loans.ts. The decisions it encodes, with 100,000 at 5 % over 120 months (installment 1,060.66) as the example: extra payments shorten the loan at the same installment; a rate change recomputes the installment so the loan still ends on its current end date (5 % to 8 % from month 13 pays 1,198.93 and owes nothing after month 120); dates are year/month arithmetic with the day clamped to the month's last day and no Date object (addCalendarMonths), so a 31 January start is due 28 February, then 31 March, in every timezone; same-month extra payments add up; an extra payment larger than the balance records only what was needed and principal is never negative; the last month pays what is owed, so totalPaid is principal plus interest; monthsSaved is a count of months removed; the base interest_rate is part of the engine's input and covers every month no rate period covers. A balance within half a cent of zero (HALF_CENT = 0.005) counts as repaid, so paying the balance shown to the cent ends the loan. The annuity goes through expm1/log1p. Tests check closed forms, one case per old defect, and invariants over 400 seeded random loans.
  • POST /api/loans/:id/calculate calls calculateLoan() in both runtimes, with the same response shape; shared/fixtures/loanParity.ts is stored through each runtime's API and must answer exactly calculateLoan() of it (worker/test/loans-calculate.test.ts, localHandlers.loans.test.ts). The Worker's rate period and extra payment queries order by id. A local-first loan without a start date calculates with empty dates and a null payoff date instead of a 500. /api/calculators/loans, /mortgages and /loans/amortization use annuityPayment(); the amortization calculator dates payment i with addCalendarMonths, so asked on 31 January it lists 28 February, 31 March, 30 April.
  • GET /api/loans adds remaining_balance, monthly_payment, next_payment_date and payoff_date to each loan from loanStatus(), in both runtimes (#594). Additions only, after the existing keys. The Worker reads all listed loans' rate periods and extra payments in one query each. The Loans page reads them (its own calculateRemaining subtracted one installment per 30 days with no interest), runs the engine itself for a server without the fields, derives paid or active from remaining_balance, and formats dates in UTC. The debt-free badge (core/achievements/evaluate.ts) runs amortize() with the loan's interest_rate, so months no rate period covers are charged the loan's rate. LoanAmortizationTable took its dates from the schedule rather than setMonth.
  • Loans page rebuilt around what-ifs (#600). frontend/src/features/loans/: LoansOverview (summary strip and one card per loan, What if on each unpaid one), LoanDetail with three tabs routed as #loans/<id>/compare|schedule|extras (loanRoute.ts), LoanCompare, LoanSchedule (the amortisation table out of its modal, with CSV export) and LoanExtras (saved extra payments changed in their row or removed). shared/loanScenarios.ts adds the "lower" mode (end date kept, installment drops), repeating extra-payment rules, a keep-the-installment option for rate changes with "never repaid", compareScenarios, a done-by-a-date solver and the template presets. Scenarios live in the URL and are computed in the browser. A loan without the new fields gets the #594 figures unchanged. LoanAmortizationTable.tsx and LoansPage.module.css are deleted; the loan form's Status select is gone (it was never stored). The loans tour gains a What if step.
  • PUT /api/loans/:id/prepayments/:prepayId in both runtimes; an extra payment keeps one stored id in local-first as on the Worker, a cloud backup's ids survive a restore, and a missing one answers "Extra payment not found" in both (#600). The Worker stores a 0 % rate as 0 %: a create without a rate gets 5 %, an edit without one keeps the stored rate. Round the installment up takes no mode. The route is on the CRUD contract. Each Worker contract scenario gets a one-minute timeout.
  • Form-error slice 4a (#609) moved loans, rate periods and extra payments onto shared/loanSchema.ts (replacing shared/loanExtraPayment.ts). Removing an extra payment or rate period the loan does not have answers 404 in both runtimes, and the page treats a 404 on a remove or a loan delete as done. total_prepaid is 0 to the cent for a loan without extra payments. Local-first's unused POST /loans/:id/prepayment is gone. shared/fixtures/loanFormParity.ts schedules loans typed into the dialog to the same cent in both runtimes (worker/test/loan-form-parity.test.ts).

Forms say what is wrong at the field

  • Slice 1, the kit and categories (#602). A refused save answers 400 { error, fields } from both runtimes (shared/refusal.ts, worker/src/http.ts), and both client surfaces throw ApiError (frontend/src/core/apiError.ts) so a form can put each message under its field. frontend/src/components/form/ is the form kit, with a busy state. shared/categorySchema.ts holds the category rules and words for the four category dialogs (Categories, Budgets, Bills, Goals; features/categoryForm.ts). An edit checks only the fields it changes, so rows stored under older rules still save. An ended session asks to sign in again, and a save that lands after Cancel leaves the reopened dialog alone.
  • Slice 2, transactions and accounts (#605). shared/transactionSchema.ts and shared/accountSchema.ts hold the rules both runtimes and forms use; worker/src/validation.ts is gone. The runtimes agree on the 10 rules they differed on. Editing a transaction updates the goals of both categories it moves between; a foreign-currency edit moves the account by the converted amount, and a local amount that copies the amount follows it (shared editedLocalAmount). The edit form shows the row's own exchange rate, and notes, beneficiary or payor cleared in an edit stay cleared. Seven warning toasts and "Failed to create account" are gone. The kit gains form.mark and a Field tip.
  • Slice 3, budgets, goals and bills (#607). shared/budgetSchema.ts, goalSchema.ts and billSchema.ts, read through shared/fieldReaders.ts; money is kept to the cent with shared/money.ts. shared/billSchedule.ts is the one rule for when a bill falls due next, used by the Bills list and calendar, the Dashboard, /api/bills/upcoming, mark-paid, the reminder email and the MCP tools: weekly and biweekly bills fall due on their own schedule, a bill on the 31st falls on a shorter month's last day, and local-first's Dashboard lists upcoming bills. The Bills dialog saves its category; Set Budget changes the month's budget instead of adding one; Allocate sets the month on screen; budget alerts measure a month against that month's budgets; the sankey counts uncategorised spending; setting a month from last month's spending fills only categories without a budget. A budget stored with a float error opens and saves unchanged, Backfill from Spending stores sums to the cent, and MCP upsert_budget checks a budget as the app does. Seven contract pins settled.
  • Slice 4a, loans and retirement (#609). See Loans for the loan half. shared/retirementGoalSchema.ts and shared/retirementPlanSchema.ts cover retirement goals and the retirement plan (features/retirementGoalForm.ts, RetirementPlanner.tsx). The FIRE calculator takes inflationRate in both runtimes. The kit gains fields in list rows, a form's own copy of its values, and SubmitButton unchanged.
  • Slice 4b, profiles, Settings and import (#611). shared/profileSchema.ts, settingsSchema.ts, importSourceSchema.ts, categoryMappingSchema.ts, importUpload.ts and exportColumns.ts. A profile name that is blank, over 100 characters, or another profile's in other capitals is refused at name; any profile but the last can be deleted, and the Danger Zone lists the page's profiles under their current names. PUT /api/settings refuses a key another route owns; the base currency select is labelled and refuses at the select. Both runtimes read an upload with shared/importUpload.ts (complete file checked first, every cell text, no header row refused at file); local-first reads it off the main thread in workers/uploadReader.ts with a time limit, and imports an uploaded file again. The email importer, /api/v1/import and MCP's upload use the same reader. A backup carries each profile's connected sources and only its own settings; a restore files each retirement plan and badge record under its profile from either runtime's file, and restores profile names that differ only in case with the later one numbered. Clearing a profile deletes its connected sources on the Worker, and account deletion runs the same deletes. Applying category mappings updates linked goals. The Worker's full backup is indented when Settings asks, and its reseed-demo answers 410. 12 contract pins settled (43 to 31).
  • Slice 5, housing, portfolio, tags, recurring and onboarding (#614). shared/tagSchema.ts, housingSchema.ts, holdingSchema.ts, recurringSchema.ts, recurringUpcoming.ts and palette.ts; forms in features/{tag,housing,holding,recurring}Form.ts and components/onboarding/onboardingForms.ts, plus the subscription catalog and scan. An edit checks and writes only what it changes. Tags: name up to 50 characters and unique in any case, colour #RRGGBB, a create without one takes the palette's next colour. Housing: six types, an amount to the cent, a real due month and a day that month has; no due month falls due this month. Holdings: ticker up to 20 characters stored in capitals, shares and price above zero and below one trillion; a buy merges only into the open profile's holding. Recurring: a period is added once and a second add is 409 in both runtimes; deleting a rule the profile does not have is 404; local-first's upcoming list is the Worker's. Another profile's tag, category or account is a 400 at the field it names. New tags and recurring rules answer 201 in both runtimes. A delete of a row another tab already deleted says so and reloads. MCP upsert_tag_rule finds and creates tags by the tag rules. 12 contract pins settled (31 to 19).
  • Slice 6, sign-in and support (#615). The sign-in screen and dialog, the sign-in code steps, the two-factor challenge and its enroll and disable steps, the new-password screen and the support form use the kit, with shared/signInSchema.ts for the address format, a new password's 8 characters and a support message's length. A refused field answers 400 { error, fields }, and a code that does not sign in answers 401 at code. A wrong address or password stays one message for the whole form. Every field has a label, and the sign-in fields keep the ids password managers use. components/captchaGate.ts is the one captcha gate: a send waits for its token and each token is used for one request. The reset page says a link is invalid only when the Worker says so, and a failed check offers Try again. A mail call gives up after 10 seconds (worker/src/email.ts).

Dates and calendars

  • "Today" is the person's day (#603). In cloud mode apiFetch sends X-Time-Zone with the browser's IANA zone, to the app's own API only and never over a caller's own header. The readTimeZone middleware in worker/src/index.ts accepts a name that matches the IANA pattern, is at most 64 characters and that Intl knows; offsets and anything else fall back to UTC, so API tokens, MCP and older builds answer as before. shared/calendarDate.ts keeps one formatter per zone, keyed in lower case and capped at 256. Routes call localToday(c), localMonth(c) and localNow(c) from worker/src/local-date.ts; 46 call sites were swapped, and worker/test/local-today.test.ts (48 tests) runs each at an instant where the zone's date and UTC's differ. Mark-paid treats a payment dated on or after the start of the caller's period as settling it, in the list's paid flag, the pre-flight and the batch guard, so two clients on different calendars pay once (bills-paid-across-zones.test.ts). The net-worth timeline groups by the caller's day. Local-first and the app's forms use localToday()/localMonth() in utils/period.ts; endOfNextMonth keeps its day across an offset change, and the week labels and forecast months no longer depend on the zone. A guard test fails on a toISOString() cut to a date outside its list. Scheduled jobs, MCP, API tokens and timestamps stay on UTC. todayUtc is gone from shared/loanSchedule.ts.
  • Month steps past February (#604), in both runtimes through shared/calendarMonths.ts. Twelve months of totals start on the 1st, so the first month counts whole and none is skipped from the 29th to the 31st. The budget forecast counts this month's budgets. A monthly recurring rule on the 31st falls on 28 February and returns to the 31st; the upcoming list takes populate's own steps and lists an overdue rule today, then on its dates. /api/bills/upcoming keeps a bill due today and its month step no longer overflows. MCP create_transactions refuses an account that is not there before writing anything. The bill and recurring payment guards each have a test that fails without them.

Account email and sign-in

  • A changed email takes effect once the new address confirms it (#608). A change is a 'change' row in email_verifications (migration 0031); users.email and email_verified stay as they are until its link is opened, once, within 24 hours (worker/src/email-change.ts). Opening it moves the account, marks the address confirmed, and spends the account's other confirm and change links, unused reset links and sign-in codes, and the unsubscribe link in reminders sent to the old address. A waiting address is not held: anyone may sign up with it, and the link then says the address is taken and changes nothing. The current address gets a notice (emailTemplates.ts). Settings shows the waiting address with Send again and Cancel change. New routes POST /api/auth/email-change/resend and DELETE /api/auth/email-change. Limits: three links an hour per inbox, five an hour and ten a day per account, twenty an hour per network address. Account deletion deletes its email links.
  • Confirming an address clears what was set up before it, and email links finish after sign-in (#610). Google sign-in, an emailed sign-in code and a reset link confirm the address; on an account whose address was never confirmed, each first runs clearUnconfirmedAccess (worker/src/auth.ts) in the same D1 batch: sessions, password, passkeys, two-factor, API tokens and unused links. The route reports what went (cleared), and frontend/src/core/accessCleared.ts shows it once after the reload. Session and credential writes carry SAME_TOKEN_VERSION (boundTo), so they land only while the account's token_version is the one its check read. Confirm and change links are spent only with their own account's session (worker/src/email-link.ts): opened elsewhere, the browser gets a signed, HttpOnly fm_email_link marker on /api/auth for 30 minutes, and the link finishes on a password sign-in to that account or through POST /api/auth/email-link/finish after any other sign-in. A browser that starts local-first opens the sign-in for these links, and the reset page works there. Google sign-in stores and matches addresses in lower case. Account deletion deletes its sessions.
  • The notice after confirming an address names only what went. clearedWorthSaying (worker/src/auth.ts) returns the kinds that went, under the names in shared/accessCleared.ts (password, passkeys, two-factor, api-tokens). Google sign-in puts them on its redirect as ?cleared=password,passkeys; the emailed-code sign-in and the reset answer carry them as cleared: ['password'], and leave cleared out when nothing went. Sessions are never named, and a reset never names the password it set. accessClearedNotice (frontend/src/core/accessCleared.ts) writes one sentence that names the step (Google sign-in, an emailed code or a reset) and only those kinds, then one next step: sign out and choose Forgot password when the password went, set them up again in Settings otherwise, and after a reset, sign in first. Nothing named, no notice. A ?cleared= value that names no known kind is stripped without one, and a kept notice the app does not recognise is removed. What is cleared, and the batch that clears it, are unchanged.
  • Sign-in history is kept 90 days, and goes with the account (#613). Account deletion deletes its auth_logs rows in the same D1 batch: rows with its user id, and attempts at its address that carry none. The scheduled run deletes rows older than AUTH_LOG_RETENTION_DAYS (90, worker/src/authlog.ts), at most 1,000 rows per statement and 50 statements per run. Nothing in the app reads auth_logs.
  • A password account confirms its email before it uses the app (#616). Create account ends on Check your inbox (components/CheckInbox.tsx), which names the address, sends the link again and says where to open it; the screen is the same for any address. A password sign-in works once the address is confirmed, or in the browser that opened the account's own confirm link; until then it answers as a wrong password does and the form offers Send the link again. A signed-in, unconfirmed account sees Confirm your email (components/ConfirmEmailScreen.tsx). authenticateRequest and the API token check answer 403 EMAIL_UNCONFIRMED everywhere but me, logout, the signed-in resend, the link's finish route, and the billing portal for a paying account (requireAuthEvenUnconfirmed). POST /api/auth/verify-email/resend sends the link while signed out, with limits and the captcha before any look-up; one budget of three confirm links an hour (CONFIRM_LINKS_PER_HOUR) covers every way of asking. Sign-up answers first, then writes the account, its profile and its first link in one batch, tried twice; signing up again for an address waiting for its link mails a fresh link. A sign-in code, a reset link and Google sign-in confirm the address; a passkey or two-factor does not. /api/v1 capabilities, reminders and sheet syncs leave out an account waiting for its link. The welcome and confirm mails say the link starts the account and where to sign in after opening it. No migration.
  • #forgot-password opens the sign-in screen on the reset form (frontend/src/components/LoginScreen.tsx), at load or when the fragment changes to it with the screen open. Leaving the form takes the fragment off with replaceState, so neither a reload nor the app after signing in opens it again. It is a route outside the page router, like #reset-password (isNonPageRoute in frontend/src/core/hashRoute.ts): a signed-in app stays on its page instead of showing the 404, and periodStore keeps the period off it. The Reset password button of renderAccountExists links there. Only account mode has a sign-in screen, so consumeForgotPasswordLink (frontend/src/core/forgotPasswordLink.ts, called in index.tsx before render) moves a browser in local-first mode to account mode first, always, as a confirm link that needs a sign-in does (toAccountMode); a fresh production browser starts in local-first mode (VITE_DEFAULT_STORAGE=dexie). Data kept on the device is not touched. frontend/tests/forgot-password-link.spec.ts opens the link under both boots.

Mails

  • A second mail layout, with engraved art (renderMail in worker/src/emailTemplates.ts). The wordmark sits above the card and the art flush at its top; then an eyebrow where it adds something (only the Welcome has one), one headline, one or two short paragraphs, a button (or a button and a quieter outlined one, which a phone stacks under it, each full width), at most one list of numbered steps, and the footer outside the card. Dark by default; paper in light mode through prefers-color-scheme, with the page, card and button colours also set as bgcolor attributes for classic Outlook, which also ignores max-width: an <!--[if mso]> table holds the column (wordmark, card and footer) at 600 px there. The system font stack, no Georgia. The art is two cuts of one image, frontend/public/email/hero-engraved-night-v1.jpg (1200 x 560, for the welcome) and banner-engraved-night-v1.jpg (1199 x 360, for every other mail on the layout), loaded from the sending app. /email/* is now served Cache-Control: public, max-age=31536000, immutable, which is safe only because a file there is never overwritten: new art gets a new name. The master and its prompt are in docs/design/mail-art/. In the HTML a headline keeps its last two words on one line and a number keeps its unit ("10 minutes"), through no-break spaces; the plain-text twin carries every fact of the footer (its line, the links, Terms, Privacy and the contact address).
  • Confirm and the Welcome are two mails, and the Welcome goes once (worker/src/welcome.ts, migration 0033_welcome_once.sql). A password sign-up gets Confirm (renderConfirmEmail): the link that opens the account and nothing else. Send the link again, and a sign-up again for an address waiting for its link, get a fresh link (renderEmailVerification), which says it replaces the links sent before and never that the reader asked for it. Until the same-browser sign-in ships, both say the link asks for a sign-in, in any browser, and neither promises a one-click confirm (maff's call of 2026-10-11): "One link, one sign-in, and you're in." The Welcome (renderWelcome) goes to an account once: when its address is first confirmed, by its link (opened with its own session, a password sign-in in the browser that opened it, or POST /api/auth/email-link/finish), a change link (a Google account stored with no confirmed address that adds one in Settings: applyEmailChange claims it in the move's batch with claimWelcomeOnMove, only while email_verified = 0 and only when the move happens, and spendLink mails it to the new address), Google sign-in, an emailed sign-in code or a reset link; and at once for a Google sign-up with a confirmed address. The record is a reminder_dedup row (user_id, 'welcome'). Each confirming D1 batch claims it before the write that confirms the address, and only while email_verified = 0 (claimWelcomeOnConfirm), so of two confirmations that race only one sends it. The mail goes in waitUntil, best effort: a failed send is logged ([email] Resend <status> by sendMail when Resend refuses it, Welcome email failed: when the send throws) and is not retried; the claim stays. resolveGoogleUser returns welcome; spendLink and confirmWithOwnLink take the route's welcomer. Step 3 of the Welcome is the version for before finance prints ship: Progress, and the A year badge.
  • The account mails moved to the new layout; the mails that show money did not (worker/src/emailTemplates.ts). On the layout now, with their facts kept and their em dashes gone: the link to a new address (renderEmailChange); the notice to the old address (renderEmailChangeNotice), one sentence of what was asked and the one thing to do, in Settings; "already has an account" (renderAccountExists), with Sign in, and Reset password to #forgot-password, the reset form; the password reset; the sign-in code, large and monospaced and still first in the subject; the test mail ("Test mail from Token Circles"), which no longer says the reminders look like it; and the support reply ("We got your message (TC-...)"); and the two billing mails that show no amount, the bank asking to confirm a payment (renderPaymentActionRequired) and a plan that ended (renderSubscriptionEnded), which lost the old shell's card helper, their last user. Left exactly as they were, by maff's call of 2026-10-11: the budget alert, the spending report, upcoming bills and the failed payment, which show an amount. worker/scripts/mail-samples.ts renders every mail from plainly fake data, and worker/test/mail-catalogue.test.ts holds every one to the rules (a sample of every renderer, a snapshot of every subject, under 102 KB, a text twin with the card's links, no em dash on the new layout) and pins the four unchanged mails to digests taken before the change: their samples, and a grid of 584 inputs over every branch (worker/test/helpers/amount-mail-grid.ts, one digest per renderer, equal to what the renderers at 9bd2661a give for the same grid). The worker's typecheck also checks worker/scripts/, which has its own tsconfig.
  • worker/scripts/send-sample-mails.ts mails a sample of every mail to one inbox, through Resend's REST API, from mail-samples.ts. It needs --to, reads RESEND_API_KEY and EMAIL_FROM from the environment under the Worker's names, and prints one line per sample: its name and Resend's message id, or the error. Before sending anything it trims the key and refuses one that is not ^re_[A-Za-z0-9_-]+$ (exit 2, nothing sent, nothing of the value printed), and an error it prints has [key] wherever it quoted the key. --dry-run <folder> writes each mail as .html and .txt instead of sending, and needs no key; --only, --app-url and --asset-origin pick the samples and the origins. It runs on a Node that strips types by default, with no build step.

Errors

  • The Worker answers an unexpected error with a fixed sentence (#601). worker/src/error-response.ts (publicError, reportError, errorResponse, rejectMalformedJson) is the one rule: HttpError and Hono's HTTPException keep their status and message (an HTTPException with its own response answers with it), and anything else answers 500 with "Something went wrong on our side. Try again in a moment." The full error goes to the logs with method, path, cf-ray and user id, never the request body, and 5xx are still stored in error_logs. A body that is not JSON answers 400 "The request body isn't valid JSON."; the check wraps only c.req.json, so raw-body routes such as the Stripe webhook and receipt uploads are untouched. MCP tools/call and the Google Sheets import's 501 follow the same rule (worker/src/mcp/rpc.ts, routes/imports.ts). Renaming a tag or profile onto a name already taken answers 400 with the create route's words, and validateBackup (worker/src/backup.ts) refuses a backup that repeats a unique key with a 422 naming it, before anything is staged.
  • Local-first answers an unexpected failure with the same sentence (shared/genericError.ts), never an exception's text (#612).

Profiles and quick entry

  • Fixes from the 5.16 dev check (#599). Local-first stores a new category as the Worker does (default colour, icon and type, tax_deductible false; handlers/categories.ts), and normalize.ts repairs rows already stored, so a category made on Budgets, Goals or Bills no longer fails every typed category read of its profile; core/validation.ts accepts a blank icon. core/quickEntryLists.ts is one list per entity for both quick entries (GuidedOrbit.tsx, CommandBar.tsx): the active profile's rows only (rowsOfProfile), a loading, ready or error state, read when a quick entry opens and when the seam's counters move, newest answer wins, and a save guard so another profile's category id never reaches POST /api/transactions. The Transactions form offers the rows of the profile it writes to (the active one for a new entry, the row's own for an edit), and so do bulk actions, Auto Categorize (failed picks stay staged with a "Couldn't categorize N of M" toast), the recurring section and the tag lists. A form left open across a profile switch closes and names the profile to switch back to. The account field says "Loading accounts…" and offers Try again on failure. Local-first lists recurring rules for the active profile only. The Worker's GET /api/tags lists each tag's profile_id. In cloud, a blank icon stores the default tag on create and edit, and an edit keeps every stored category field it does not send (parent, tax_deductible).

Onboarding

  • The setup wizard's panel stays on a phone's screen. Two causes. The orbit field behind the panel (.backdrop in frontend/src/components/onboarding/Onboarding.module.css) is 160vmax square, 1350 px at 390x844, and as the overlay's absolutely positioned content it gave the overlay an 870 by 1097 px scroll area. overflow: hidden stops a finger, not scrollIntoView or focus: a browser bringing Continue into view centred moved the overlay 115 px sideways and 253 px down, and the panel with it, in both themes, and the panel's own focus at open scrolled it 9 px down. The field is position: fixed now, so the viewport clips it. And the panel, a grid item of the overlay, took its content's width as its minimum: on the import step it was 382 px wide on a 375 px screen before a file was chosen, 583 px with the mapping table and 1141 px with the preview, its footer buttons past the screen's edge. .panel has min-width: 0 now, and each table scrolls sideways inside its own wrapper. tests/onboarding.spec.ts ("onboarding wizard at phone width") walks every step and import sub-step at 390x844 and 375x667, light and dark: the overlay never scrolls, the panel and its footer buttons stay on screen and still when Continue is scrolled into view, and no box but a table's wrapper is wider inside than out.
  • Each wizard step opens at its top, with focus on its heading. The body (.body, data-test-id="onboarding-body") kept its scroll position across a step change, so on a short screen a step opened as far down as the last one was left: at 390x600, 45 px into "Name your space" and 202 px into the import. Focus stayed on the Continue button, or fell to <body> when that step's content went. An effect on onboardingStep (deferred, so not on open, where the panel takes focus) sets the body's scrollTop to 0 at once and focuses the new step's heading (data-step-heading, tabindex="-1", preventScroll, no focus ring). Enter in the name, Escape and the import step's showTheWork are unchanged. The report of "Name your space" opening scrolled down at 1280x800 was the overlay scrolling (entry above, 450 px in one measured run), not the body, whose scrollTop was 0 every time. tests/onboarding.spec.ts ("a new step opens at its top") checks by mouse, by Enter, through a confirm and going back.
  • Onboarding is decided per account. The completed-or-skipped flag in localStorage is kept under the account it belongs to, finance_onboarding:account-<id>, or finance_onboarding:local in local-first (frontend/src/core/onboardingStore.ts: setOnboardingOwner, onboardingOwnerFor; the key format is core/onboardingFlag.ts). The app sets the owner at start, after an in-app sign-in and at sign-out, from the id GET /api/auth/me answers (SignedInAccount.id); with no owner, nothing is offered. The browser-wide finance_onboarding flag moves to the local account only, unless it has a flag of its own, and is then removed; a server account never takes it, and its profile's settings (onboarding) and the pristine-profile check decide, so an account with data is still never offered the wizard. Specs and the marketing shots mark the wizard decided per owner with onboardingDecided (tests/onboarding-decided.ts). No migration.

State that follows the account

  • user_state and /api/account/state. GET /api/account/state answers every key (onboarding, tours, getting_started), null where nothing is stored, with Cache-Control: no-store; PUT /api/account/state/:key writes one key. Both take a session only (requireAuth, so an account waiting for its confirm link gets 403 EMAIL_UNCONFIRMED) and serve the session's own account. The keys are an allowlist (shared/accountStateKeys.ts; any other key answers 404 and stores nothing). The stored value is rebuilt from the checked fields (checkUserStateWrite in shared/accountState.ts; a refusal is 400 { error, fields }) and is capped at 1 KB of JSON. The onboarding record only moves forward: the furthest step is kept, the first write stamps started_at with server time, completed or skipped stamps finished_at, and a finished record never changes again. A client cannot send existing. A write stores its result only while the row still holds the value it read (compare-and-swap, three attempts, then 503), so a step from a stale tab cannot undo a finish from another. Deleting the account deletes its rows, and worker/test/account-deletion.test.ts now checks that every table with a user_id column has a delete in routes/account.ts. Worker-only in the contract guard: local-first keeps the same state in localStorage.
  • The setup wizard's record is on the account (frontend/src/core/onboardingStore.ts, the account's state in core/accountState.ts). Signed in, the app reads GET /api/account/state once per account and opens the wizard when onboarding is not finished, at its step, with no pristine-profile check: a wizard left after the import step reopens there. Each step further than the record's, and Finish or Skip with the step it was decided on, is a PUT /api/account/state/onboarding; a relaunch over a finished record sends nothing. A decision kept from before the record (this browser's finance_onboarding:account-<id> flag, or the profile's onboarding setting) is sent once as { outcome } and the wizard stays closed. The flag is removed once the record is finished, and a decision whose PUT fails is kept in it, so the next start sends it again. A failed read opens nothing and sends nothing. The settings mirror and the pristine-profile check are local-first only now. /api/account/state bumps no data-version counter and dispatches no tc:data-changed (isUserStatePath in shared/accountStateKeys.ts, used by dataVersions.ts and dataChangedEvent.ts), so a wizard step reloads no page and runs no badge check. E2E: global.setup.ts finishes the fixture account's record through the route, so the specs that wrote the fixture's flag no longer do; onboarding-server.spec.ts covers a new account, resume after a reload, a skip seen from a second browser, a flag sent once and a second account in one browser; the cloud form-errors spec opens the wizard from the tour menu. onboardingDecided flags for other accounts still work, through the same one-time send. A spec that signs a new account in through the page now meets the wizard there, whatever the profile holds: mark the account first (bootApp(context, boot, email) once it exists), as sign-in-form-errors.spec.ts does before it opens Manage Account.
  • The tours finished are on the account (frontend/src/core/spotlightStore.ts). Signed in, endSpotlight adds the tour, or every tour after the full tour, to tours.seen with PUT /api/account/state/tours. The writes go in order, so a tour ended while another's write is out is kept, and each is made on a list that was read: a list that cannot be read is never replaced. Reset All Tours sends { seen: [], reset: true }. The tour menu reads the list as it opens (loadAccountTours), and its badges and count follow the list as it arrives. An account with no list yet takes this browser's finance_spotlight_tours map once; the map stays, and local-first keeps using it. scripts/walk-tours.mjs clears the fixture account's list before each load, as its init script clears the browser's. No notice keeps a dismissal in localStorage (advice dismissals were already in the profile's settings), so tours are the only state that moved.
  • Tours are added on the Worker; only a reset replaces them. PUT /api/account/state/tours adds the ids sent to the stored list (stored ones first, each once), so a tour finished on one device is kept when another device, holding a copy read before it, finishes a different one. reset: true replaces the list with the ids sent (400 reset when it is not a boolean). Reset All Tours sends { seen: [], reset: true }, which stores an empty list rather than deleting the row: an account with no row takes this browser's map again at the next load, which would undo the reset. endSpotlight sends only the tours its copy does not have yet, and scripts/walk-tours.mjs clears the fixture account's list with a reset.
  • A value another build wrote is read for what it holds, and never replaced unread (shared/accountState.ts). An onboarding step this build does not know (one a newer build adds, read after a rollback or by an installed older app) reads as step: null, and the record keeps started_at, finished_at and outcome, so a finished record stays finished and no wizard opens. A tours list keeps its well-formed ids and drops only the others (a write still refuses an ill-formed id). The PUT goes through applyUserStateWrite, which merges over that lenient read, leaves the row byte for byte when the merge changes nothing, and refuses with 409 a row it cannot read at all (not JSON, a bad time, a list that is not a list), leaving it as it is. The app treats the 409 as any failed write: a decision stays in this browser's flag, a tour is not marked. GET answers such a row as 'unreadable' (next entry). The frontend stand-ins of the Worker read and write through the same functions.
  • A row this build cannot read is unknown, not empty. GET /api/account/state answers 'unreadable' (UNREADABLE in shared/accountState.ts) for a key whose row another build wrote in a shape this one cannot read, and null only where there is no row; answerUserState builds the answer, for the route and for the frontend stand-ins. The app's readUserState reads a key as UNREADABLE when the answer holds that, or any value it cannot read, and as null only when the key is absent or null. The app treats such a key as unknown and sends nothing over it: an onboarding row opens no wizard, records no step and takes no decision (a relaunched wizard closes without a write, and this browser's flag stays unsent); a getting_started row shows no card, is not begun by the wizard and is not hidden; a tours row is not replaced, and the tour menu shows this browser's finance_spotlight_tours map instead, where a tour finished now is kept and Reset All Tours starts over. Before, GET answered such a row as null, so the wizard opened once on that device and its writes were refused with 409.
  • An onboarding outcome this build does not know reads as finished. readOnboardingRecord reads an outcome it does not know (one a newer build adds) as null when the record has a valid finished_at, and keeps step, started_at and finished_at, as an unknown step reads as no step. onboardingFinished asks for a finish time, not an outcome, so that record is finished: no wizard opens, this browser's flag goes as it does for any finished record, a write over it answers 200 and leaves the row byte for byte. The GET answer that carries it (outcome: null with a finished_at) reads back as finished in the app. An outcome, known or not, with no finished_at still cannot be read.

Orientation

  • The advice kind unbudgeted-subscription is unbudgeted-category (frontend/src/core/achievements/advice.ts): it flags the biggest category spent on this month with no budget and no bill behind it, which is not always a subscription. Card ids follow (unbudgeted-category:<category id>:<month>). parseDismissed (achievements/records.ts) reads a dismissal stored under the old name as the new one, so the card stays hidden, and the next save stores the new id. The card's words do not change.
  • The advice counts are computed in one place (frontend/src/core/achievements/monthFacts.ts): uncategorisedIn (entries with no category, transfers aside), monthInTheRed (what a month of three or more entries earned and spent, when it spent more) and biggestUnbudgeted (the category spent on most with no budget and no bill). advice.ts calls them, and so do the Getting started steps, so the two read the same numbers. What advice says does not change.
  • One definition of a tracked month, and of a year on file (shared/trackedMonths.ts). A month is tracked with TRACKED_MONTH_MIN_TRANSACTIONS (3) entries of any type dated inside it (isTrackedMonth, trackedMonthsOf). A year on file is YEAR_ON_FILE_MONTHS (12) tracked months among the YEAR_WINDOW_MONTHS (13) calendar months that end with this one (trackedMonthsInYearWindow), so a year imported up to last month counts. The badges (evaluate.ts calls trackedMonthsOf), the year in review, the streak card and Getting started all read it, and achievements/definitions.ts no longer exports the constant. The "A year" badge still needs twelve tracked months in a row; a year on file allows one month missing.
  • Each count of months names what it counts. Dashboard had three numbers for the same months: the badge rail's streak (tracked months in a row, up to this month or last), the "A year" badge (twelve in a row, at any time) and Getting started's import-year step (tracked months among the last 13, gaps allowed). The rule for a tracked month stays one (3 or more entries). The step's reason now names its window, "8 of the last 13 months are tracked." or "None of the last 13 months is tracked yet.", where it said "You have 8 tracked months from the past year." The rail (streakLabel in components/BadgeRail.tsx) and the Progress record say "4 months in a row" (one: "1 month in a row") where they said "4 months tracked"; the badge's rule already reads "Twelve tracked months in a row." hasYearOnFile had no caller and is gone. core/__tests__/monthCountsOnDashboard.test.ts holds what each surface says for the same entries in three cases (eight months with a gap, a whole year in 2024 and nothing since, twelve of the last thirteen with a gap).
  • Progress says what the rail says at a zero streak. The record on Progress takes its words from streakLabel (components/BadgeRail.tsx), so with no streak running it reads "Start a streak", as the rail does, where it read "0 months in a row" (on main, "0 months tracked"). features/__tests__/progressPage.test.tsx checks the zero case.
  • Getting started rules (shared/orientation.ts). orientationSteps(facts) returns the steps whose rule applies, in rule order (import-year, review-subscriptions, sort-uncategorised, budget-top-category, heavy-month, loan-payoff), and nextSteps the first NEXT_STEPS_SHOWN (3). Each step has a title, a reason in counts and months (never amounts) and a hash link. A rule added later goes in its place in RULES without moving the others. frontend/src/core/orientation.ts (orientationFacts) builds the facts from the achievements snapshot, which now holds whole transaction and bill rows (Transaction[], Bill[]).
  • The subscription scan's window and tick rule are exported (features/subscriptionDetection.ts: SCAN_WINDOW_DAYS, recentForScan, worthTracking), so SubscriptionScan.tsx and the Getting started count read the same rows and tick the same proposals. The scan behaves as before.
  • The Getting started card and the wizard's last step (components/GettingStarted.tsx). NextSteps lists nextSteps(orientationFacts(snapshot)), each step a link to its page. GettingStartedCard sits on Dashboard between the period bar and the badge rail, and shows while the account's getting_started record exists, is not hidden, and a step applies. The wizard's done step runs refreshAchievements() and lists the steps; following one completes setup.
  • The Getting started record (core/gettingStarted.ts): getting_started in user_state signed in, finance_getting_started:local in local-first. onboardingStore's decide makes it { hidden: false } on the first finish or skip only: adopting an older decision, a wizard relaunched over a finished record, and (signed in) an account whose state could not be read make none. Hide writes { hidden: true }, and hidden is for good: the Worker stores { hidden: false } over a stored true as true (checkUserStateWrite), so a tab that read the account before another device hid the card cannot bring it back when its wizard ends. Local-first writes { hidden: false } only when this browser holds no record, read in the same call.
  • Links that open something on a page. takeHashFlag(page, flag) (core/hashRoute.ts) answers ?flag=1 once and takes it off the address with history.replaceState. #bills?scan=1 opens the subscription scan on the Subscriptions tab. #transactions?uncategorised=1 lists the active profile's entries with no category, transfers aside, from all time (the rows Auto Categorize offers), under a note with "Show every entry". The heavy-month step links to #transactions?period=YYYY-MM, because Analytics shows a year at a time.
  • The uncategorised link clears the list's other filters. Following #transactions?uncategorised=1 sets type All, clears the search and the category, account and tag filters, shows reconciled entries, and sets period All and page 1, so the list holds the entries the step counted. A filter left from earlier used to narrow it, and a category filter emptied it.
  • Hide is a full touch target, and the unsorted share is one number. The card's Hide is styled as the app's secondary card actions (Progress's advice links: a pill with the border colour and body text) and is at least 44 px tall; orientation.spec.ts measures it. sort-uncategorised rounds the share once (unsortedPercent) and applies above 10 of that number, so 10.3% (shown as 10%) no longer counts as more than one in ten. The comments that still described the wizard's pristine-profile check for signed-in accounts (App.tsx, OnboardingWizard.tsx) say what decides it now.
  • E2E: tests/orientation.spec.ts (three @smoke cases in both modes) pastes a generated statement on Import and checks the steps and reasons on the card and the done step. The own-account helpers of onboarding-server.spec.ts moved to tests/own-account.ts.
  • Getting started costs nothing unless it can be seen. GettingStartedCard works the steps out only while its record is shown (hidden === false) and Dashboard is the page on screen (getPage()): pages stay mounted, and the badges are evaluated again after every write, so the card used to scan the whole history for an account with no record, a hidden card, or a Dashboard nobody was looking at. It works them out once per snapshot, a frame and a task after the change (not inside the render), and once on coming back to Dashboard when the snapshot changed meanwhile. The wizard's done step still works them out on the spot (currentNextSteps). The scan itself is quicker for everyone, the Bills scan included, with the same results: MERCHANT_KEYS holds every catalogue name, alias and brand keyword normalised once when the module loads (it used to be done for each transaction), and withinEditDistance answers "at most n edits" with a length check, an early stop and two reused rows instead of a full table per token pair. Node, ms per Getting started computation on statement-like rows, before and after: 1,000 rows 582 / 35, 3,000 1,797 / 83, 5,000 2,925 / 143, 10,000 5,981 / 279. Chromium at 3,000 entries: Dashboard's load held the main thread 1,465 ms with no record and 1,463 ms with the card shown; now nothing over 50 ms with no record, and one 89 ms task with the card shown. A category saved on another page cost 1,452 to 1,456 ms; now nothing.

Guidance

  • Category kinds (shared/guidance/kinds.ts, migration 0036). KINDS are the fifteen ids of the guidance research (housing, utilities, groceries, eating_out, transport, health, insurance, childcare, debt, subscriptions, shopping, leisure, gifts, taxes, other), ESSENTIAL_KINDS the eight a month costs whatever happens. kindForName guesses from English names: the defaults, the old Food (groceries), the bank import's rule names (Restaurant and Dining eating_out, Fuel and Car (Gas) transport, Travel leisure, Apartment (Bills) utilities, Bank Fees taxes, Transfers none), then whole words in the name, accents stripped. effectiveKind is a category's own kind, else its parent's stored kind, else its name's guess, else its parent's name's guess, and none for a category that is not an expense. essentialOf says whether a category is needed every month and why (chosen, kind, or no-kind: a category with no effective kind counts as essential, per category).
  • Categories store kind and essential in both runtimes. shared/categorySchema.ts reads a kind in any case (one of KINDS, blank is none) and essential as 1, 0 or null (true and false too); both are refused on a category that is not an expense, and an edit that makes a category another type clears both. GET /api/categories lists them on the Worker, and local-first's normalizeCategory reads a row from before as null for both. The client's CategorySchema takes kind as any string, so a kind a later build adds cannot fail the list (effectiveKind ignores it), and essential as a boolean or 1/0.
  • The defaults split Food (worker/src/profileData.ts, frontend/src/core/storage/idb.ts): Groceries (shopping-cart) and Eating out (utensils) in both runtimes, and every expense default carries its kind. The local-first demo files "Grocery shopping" under Groceries and "Dining out" under Eating out (it was Entertainment), and budgets both. DELETE /api/categories matches a category called Food to Groceries (resetName, shared/defaultCategories.ts), so a reset renames it with its entries and budgets instead of deleting it, and folds a Groceries the person made into it (F9 below); the Danger Zone's confirmation says both.
  • Imports give a new expense category the kind its name suggests, on the Worker (imports.ts) and in local-first (importFlow.ts). In the cloud, where a new account has no categories, that is how most categories get one.
  • The Categories dialog shows Kind and "Needed every month" for an expense category (categoryForm.ts, kinds: true). Kind shows the stored kind; its empty choice is no kind stored, labelled with the guess the app then goes by (effectiveKind over the page's categories, so a child goes by its parent): "From the name: Eating out", "From the parent: Groceries", or "None yet: counts as needed every month" (now "None yet": "The no-kind state says it once" below). The box follows the kind shown, or that guess, until it is changed. A new category sends the kind shown (null for the empty choice) and the box once changed; an edit sends either only when the person changed it (review F4 and F5 below). The Budgets, Bills and Goals dialogs send neither. tests/quick-entry-phone.spec.ts makes Groceries, not Food.
  • Tests: frontend/src/core/__tests__/guidanceKinds.test.ts (the guess, the order of effectiveKind, essentialOf, the local defaults), worker/test/category-kinds.test.ts (the migration's columns, the Worker defaults), four contract scenarios in both runtimes (kinds stored, edited and refused; the reset's rename; an import's kinds; a backup and restore keeping both columns, which the Worker's restore copies by PRAGMA table_info and local-first's as whole rows), api.getCategories.kinds.test.ts, categoryKindField.test.tsx, demoFoodSplit.test.ts and dangerZoneCategoriesReset.test.tsx.
  • Credit cards and overdrafts (shared/accountSchema.ts, migration 0037). credit joins ACCOUNT_TYPES (MCP create_account describes it as "a credit card"), and every place that offers a type offers it: the Accounts dialog, the transaction form's new-account row, the import's mapping step and the wizard. credit_limit (0 or more) and credit_rate (a yearly percentage from 0 to 100) are read by takesCreditLine types only, a credit card and a Giro account: a create of another type that sends either is refused at that field, and an edit that gives the account another type clears both. The balance stays signed, so money owed is below zero and balance, import and transfer code is unchanged. Both runtimes store both columns; normalizeAccount reads a local row from before them as null for both, and the client's AccountSchema takes both as optional numbers. The Accounts dialog shows Credit Limit or Overdraft Limit and Interest Rate for those two types, and cash accounts get a banknote icon so the card icon is a credit card's. With #621 merged, every display that reads the type through knownAccountType shows a credit card as one: accountTypeTone gives it expense and accountTypeIcon the card, with cash on the banknotes (both maps live in core/accountTypes.ts now), the constellation names it "Credit card", the Transactions select says "credit", and the edit dialog opens it on Credit Card, not "Other account". The import and MCP create_account take credit as they take every type on the list.
  • Tests: worker/test/account-credit.test.ts (the migration's columns), a contract scenario in both runtimes (stored, read, refused on another type and out of range, cleared on a type change or a blank), a backup scenario (both columns survive a restore), the rules in accountSchema.test.ts, the dialog, the badge and the icons in accountForm.test.tsx, both readers (api.getAccounts.test.ts, accountTypeRead.test.ts), and src/__tests__/accountTypeChoices.test.ts, which fails when a place that offers account types and ACCOUNT_TYPES disagree. The tests that used credit as the type a build does not have use loan now, and #621's own tests use sock_drawer, a type no build will have. A credit card on each display: accountTypes.test.ts, accountsPageTypes.test.tsx, accountConstellation.test.tsx, transactionsAccountTypeWord.test.tsx and the edit dialog in accountForm.test.tsx; the import takes one in a contract scenario (imports.ts, both runtimes), and mcp-tools-write.test.ts checks create_account does.
  • Import logs keep the bank formats a session read (shared/bankFormats.ts, migration 0038): the adapter ids, comma-separated, in a column of their own, because both runtimes cut details at 8000 characters. Every writer goes through storedBankFormats, which keeps the ids in BANK_FORMAT_IDS (the registry's, which a test holds equal) each once and drops the rest: POST /api/import-logs in both runtimes (the Import page sends the recognised statements' formats from the Bank Imports tab, importedBankFormats, and none from the other tabs), and /api/v1/import (the adapter that read the file). The email import and the Google Sheet sync read plain tables and write null. Local-first lists a log from before it with bank_formats: null, as the Worker answers. Nothing reads the column yet; the region choice will.
  • Tests: worker/test/import-bank-formats.test.ts (the migration's column), v1-import-bank.test.ts (the API import names its adapter, the generic path none), bankFormats.test.ts (the reader, the registry, what the import page sends), importLogFormatsRead.test.ts (a local log from before reads null), two scenarios in both runtimes (stored and dropped; kept by a backup and restore), and tests/import.spec.ts, where a Revolut statement imported through the Bank Imports tab is logged as revolut.
  • A deduction lowers income; it is never spending (shared/guidance/flows.ts). A deduction is pay that never reaches an account (tax, a pension contribution at source): flowsOf answers income (income less deductions), deductions and spending (expenses only) for a set of entries at the amounts the caller gives, flowsByMonth the same per month, and savedOf income less spending. Achievements read through it: saving months (the same months as before, since income beat expenses plus deductions exactly when income less deductions beat expenses), the average monthly spend behind rainy-day (deductions out), the year in review (income net of deductions, expenses without them, the same saved) and monthInTheRed (the same months, its figures net). Balances and the emergency fund calculator already read a deduction this way. Earned badges stay earned. No form creates a deduction; the API, the MCP and older data hold them.
  • Tests: guidanceFlows.test.ts (a table of entry sets) and achievements/__tests__/deductions.test.ts, a guard on each place achievements count spending (rainy-day, saving months, the year in review, a month in the red) and on the code: a sum listing expense and deduction together, anywhere in frontend/src or shared/, fails it.
  • The guidance answers (shared/guidance/answers.ts): one record per profile, the JSON text of an object in the settings under guidance (local-first: guidance:<profile id>), with no route or column of its own. guidance joins PROFILE_SETTING_KEYS, whose local-first pattern is now built from the list, so the record goes with a deleted profile, survives "Clear profile data" as the retirement plan does ("Clear all data" takes it), and follows its profile through a backup within and between the runtimes. PUT /api/settings checks it in both (readSetting, checkAnswers): the JSON text of one object, at most 4,096 bytes, region a short id, adults a whole number from 1 to 99 and children one from 0 to 99; a field this build does not know is stored as sent. readAnswers reads region (DE, HR, EU27, UK, US, elsewhere, skipped), adults and children, and takes a value it cannot read, like a region a later build adds, as unanswered. mergeAnswers changes only the fields given (null clears one) and keeps every other, known or not. In the app, core/guidanceAnswers.ts saves through one function that re-reads the record just before it writes, with this tab's saves queued, and in cloud mode refuses a save for a profile that is no longer active rather than file it under another.
  • Tests: guidanceAnswers.test.ts (the reader, the merge, the write rules, the cap counted in bytes), guidanceAnswersStore.test.ts (in both modes: a save keeps an answer another tab saved meanwhile, two saves started together keep both, a newer build's fields survive, a failed save does not block the next, the profile check), two contract scenarios in both runtimes (stored as sent, per profile, with a field this build does not know; refused when not well formed, the stored record kept), a backup scenario, guidance answers as a stored kind (so the delete, clear and restore scenarios count it in both runtimes), and the restores between runtimes in exportPerProfileSettings.test.ts and worker/test/backup-profile-settings.test.ts.
  • Setup asks where you live and who the space covers (guidance.md 5.5, as written), on "Name your space", in both modes: components/guidance/SpaceQuestions.tsx, radio groups drawn as chips, with Germany, Croatia, Another EU country (EU27), United Kingdom, United States and Somewhere else, adults 1, 2 or 3 or more and children 0, 1, 2 or 3 or more. Both are optional. The step saves the answers chosen on it, for the profile the app writes to, after the rename or the new profile; a region left unanswered is saved as skipped unless the record already holds one, read from the record just before the write (spaceAnswerChanges; saveAnswers now also takes a function of that record). Reopening the step shows the stored answers.
  • Settings, General, About this space (components/guidance/AboutThisSpace.tsx) shows the active profile's answers and how the region was set; choosing another answer saves it at once, and Ask again (now "Remove answer") clears one. It reloads with the profile, the settings and the import logs.
  • The region choice (shared/guidance/region.ts, design section 3, moved here from commit 8 so Settings can say how the region was set): the answer (Somewhere else compares with the EU average), else the bank formats of the profile's import logs (DKB and Sparkasse Germany, Erste and PBZ Croatia, ING the EU average; Revolut, Wise, YNAB and N26 no hint; most sessions win, a tie goes to the latest), else the base currency (EUR, GBP, USD), else the EU average. Its words are components/guidance/regionWords.ts, like "Compared with Germany, going by your DKB statements.".
  • Tests: guidanceRegion.test.ts (a chooseRegion table), regionWords.test.ts, the wizard's questions in onboardingForms.test.tsx (as written; saved with the space; skipped; the stored answers shown and kept; a newer build's region never replaced), AboutThisSpace.test.tsx (the notes for an answer, the bank formats of this profile only, the base currency and nothing; a change saved on the freshest record; Ask again; a failed save; another profile), and E2E in both modes: onboarding.spec.ts (answer, see and change in Settings, survive a reload; a region left unanswered) and onboarding-server.spec.ts (the record on the Worker, Settings, Ask again).
  • The recurring-payment finder (frontend/src/features/recurringPayments.ts): detectSubscriptions hands it the expenses no catalogue or brand name matched, so a payment is proposed once at most. It skips an entry filed under a transfer or account category, or under Transfers (where the bank import files a transfer it could not match), and a cash withdrawal (F2 below), and groups the rest by payee: the beneficiary, else the description, else the payor, normalised and without digits. A payee is proposed when three or more of its charges keep to one amount (pickAmountCluster), the median gap has a cadence, at least three gaps in four have that cadence, and the last charge is at most one and a half periods old. The gaps rule keeps everyday shopping out: a cafe paid one price on random days has a median gap of about a week. Four charges or more at a monthly or yearly cadence are medium; three, or a weekly or fortnightly cadence, low, which the scan leaves unticked and Getting started does not count. A result has matchedVia: 'recurring', the payee's name without the words that are numbers, the key recurring:<payee key>, alreadyTracked when a bill's name has that key or the key of the name proposed, and billType: subscription when the category most of its charges are filed under goes by subscriptions or leisure (effectiveKind), else bill, with that categoryId. Named finds are subscription, as before. The scan shows a finder row as "Regular payment to {payee}" with no brand's look, and adds it as its bill type in its category; the scan and Getting started pass the categories to detectSubscriptions. What both scans share moved to features/chargePatterns.ts. In the 750-day window a yearly payment has three charges at most, so the finder only ever guesses one.
  • Tests: recurringPayments.test.ts (a gym at four, three and two charges, weekly, through a paused month, stopped, already tracked; amounts that drift, that wander, and a cafe at one price on random days; transfers; no payment found twice; bill or subscription by kind, by a parent's kind and by the most common category; the payee's key and name) and SubscriptionScan.test.tsx (the rows and the bills they add, a payment under Transfers left out, the count Getting started shows).
  • A regular payment added as a bill is not proposed again (review F1). The finder named a payee without every word holding a digit and cut the name at 60 characters, but checked a bill by the payee's whole key, so "FIT24 STUDIO" was proposed as "STUDIO", proposed again once added, and Getting started's review step never cleared; the same for "O2 Germany", "STAN 4B NAJAM" and any payee over 60 characters. payeeName now drops only a word with no letters, or one with at least four digits and more digits than letters (a reference or an account number), and alreadyTracked also holds when a bill's key is the key of the name proposed.
  • Tests: recurringPayments.test.ts (names that keep "FIT24", "O2" and "4B" and drop numbers; a proposal added as a bill and scanned again, for a payee holding digits, one over 60 characters and one with an account number) and orientationFacts.test.ts (Getting started's step goes once the proposal is a bill).
  • The finder proposes regular bills, not habits (review F2). On the review's invented years it ticked cash taken out every week or so (41 years in 50), the Saturday bakery (47 in 50), and a monthly payment to a person and a pharmacy co-pay as subscriptions (50 in 50). Now:
    • a find is medium only at a monthly or yearly cadence; weekly and fortnightly finds are low, listed and unticked;
    • an entry whose beneficiary, description or payor says it is a cash withdrawal is skipped (isCashWithdrawal: ATM, cash withdrawal, Revolut's "Cash at", Geldautomat, Bargeld..., the "GA NR" of a Sparkasse or DKB withdrawal, Dutch geldautomaat, Bankomat..., isplata gotovine). No adapter fixture holds a withdrawal, so the words come from the banks' own statement texts. The import's categorisation does not change;
    • a find is a bill unless its category's effective kind is subscriptions or leisure, so a payment to a person, a co-pay and a find with no category are bills (SUBSCRIPTION_KINDS replaces BILL_KINDS);
    • Getting started's facts gain billsSpotted, the counted finds that are bills, and the step says "Review the 3 regular payments we spotted" while there is one, "subscriptions" otherwise.
  • Tests: recurringPaymentsHistories.test.ts (the review's histories as tests, seeds 1 to 50: shopping, the bakery and the salary never ticked, cash never proposed, the payment to a person, the co-pay, a gym and the rent likely and bills every year), recurringPayments.test.ts (weekly and fortnightly guesses, each bank's cash wording, bill or subscription by kind), orientation.test.ts and orientationFacts.test.ts (the step's words, billsSpotted).
  • Quick entry guesses by kind (review F3, frontend/src/core/entry/parseEntry.ts). Its hints pointed coffee, lunch, groceries and the like at a category whose name holds "food", which the new defaults no longer have, so 11 of 12 such words got no guess and the Command Bar's Save waited for a category. Each hint now names a kind (eating_out: coffee, latte, cafe, lunch, dinner, breakfast, restaurant, snack, meal; groceries: grocery, groceries, food; transport, housing, subscriptions, health, shopping, utilities and leisure for the rest) and a name fragment: a category is matched by its effective kind first (effectiveKind, so a child goes by its parent), then by name as before, so a profile that still has Food finds it. The Command Bar passes each category's kind and parent, and its placeholder reads "Type an entry, like "coffee 4.50", "groceries 32 yesterday" or "salary 3000"".
  • Tests: parseEntry.test.ts (the local-first defaults, a kind under another name and from a parent, a profile with Food, Food beside Eating out), worker/test/quick-entry-defaults.test.ts (the Worker's defaults) and components/__tests__/quickEntryGuessByKind.test.tsx (the Command Bar files by kind, and every example in its placeholder gets a category on the defaults).
  • The category dialog stores what it shows (review F4). Its "No kind" choice ticked "Needed every month" (no kind counts as essential) but saved kind and choice as null, which the app reads as the name's guess: "Coffee beans" saved that way counted as eating out, not needed. The empty choice now says which guess it stands for, the box follows that guess, a box the person changed is sent as chosen even with no kind, and reopening shows what was saved. categoryForm gains guessed(), which the page's label reads.
  • An edit never clears what this build cannot read (review F5). An edit sent kind: null for a kind only a later build knows (this build shows it as the guess), clearing it on a change of colour. An edit now sends kind only when the field changed, and essential only when the person changed the box and it differs from what the dialog opened with or from what the stored choice or the kind makes of it after the save.
  • Tests: categoryKindField.test.tsx (the labels; a guess saved as no kind and reopened as shown; a ticked box with no kind; an edit whose box is back to how it opened but differs from the new kind; a later build's kind kept on a change of colour, in the real local-first router) and categoryFormBody.test.ts (the bodies: a colour edit sends neither key).
  • A failed answers save never stops the wizard (review F8). "Name your space" saved the answers after the rename or the new profile in the same save, so a failure there showed "Couldn't save your space. Try again." about a space that was saved. The answers' save is now caught on its own: the step moves on and a warning toast says "Your space is saved, but your answers didn't save. You can give them in Settings, under About this space." The answers stay chosen, so going back to the step shows them and its save tries them again.
  • Tests: onboardingSpaceAnswersFail.test.tsx (the failure path, on the real local-first router: the profile renamed, the next step shown, the toast, no notice on the form).
  • Reset merges budgets too (review F9). When a reset kept Food (renamed Groceries) and folded a Groceries the person made into it, the kept category ended with both budgets for the same month (300 and 200), in both runtimes. A moved budget for the same period and start date as one the kept category has is now added to that one and removed (budgetMergeStatements in worker/src/profileData.ts, the budgets branch of resetProfileCategories in idb.ts); of two kept budgets that match, the one with the lower id takes it. A budget with no match moves as before. budgets_zero_based, which no route reads, is repointed as before. The Danger Zone says "Food becomes Groceries and keeps its entries and budgets. A Groceries you already have becomes part of it, and budgets for the same period are added together."
  • Tests: a contract scenario in both runtimes (Food and an own Groceries, budgeted for March, the own one for April too: one Groceries, its entry moved, March's budgets one of 500, April's moved as it is) and dangerZoneCategoriesReset.test.tsx (the confirmation's words).
  • About this space reads the same for both questions (visual pass 3a, finding 3). An answered household had no status line, and its Ask again sat at the far right of the note row (.note was justify-content: space-between around an empty span): x 292 at 390 wide and x 1142 at 1280. The region's sat under its line at 390 (x 39) but at the far right at 1280 (x 1142, its line ending at x 671). The household's line is now householdText (components/guidance/regionWords.ts), in the chips' words: "1 adult, no children.", "2 adults, 1 child.", "3 or more adults, 3 or more children."; half answered, "2 adults. Children not answered yet." or "Adults not answered yet. 1 child."; neither, "Not answered yet.". A count above three reads as "3 or more". The note row starts at the left, so Ask again follows its line, 12 px after the last word when it fits (household at 390: line 39-155, button at 167) and under the line's start when not (region at 390). At 390 with Settings scrolled to its end, nothing in the card or elsewhere on the page is under the floating + button (button y 776-828, card ends at y 606), before and after.
  • Tests: regionWords.test.ts (every combination, and counts above three), AboutThisSpace.test.tsx (the line for a full, a half and a cleared answer; Ask again clears it) and onboarding.spec.ts ("Remove answer" follows each status line at 390 and 1280 wide: beside the last word or under the line's start; nothing in the card under the + button at the end).
  • The category dialog says where its guesses come from (visual pass 3a, findings 4 and 5). While "Needed every month" follows the kind (no choice stored, and the box not changed in this dialog), the words under it say why: "Ticked to match its kind, Housing. Untick it if this one isn't needed every month.", "Unticked to match its kind, Eating out. Tick it if this one is needed every month." or, with no kind, "Ticked because it has no kind yet. Untick it if this one isn't needed every month." (now "Ticked while it has no kind. ...", below). The kind named is the one the app goes by, so the line follows the Kind field. The line goes once the box is changed, never shows for a stored choice, and the box's aria-describedby reads it out. (It was a line of its own; it is now the last sentences of the box's one hint: "Needed every month keeps the form's spacing" below.) categoryForm gains essentialFollows(), from two signals (changed in this dialog, choice stored), where it kept a plain flag. The Kind help said "Until you pick one, it's guessed from the name." even with no guess; it now follows the field: the name's guess keeps that sentence, the parent's says "it follows the parent category", none says "The name doesn't suggest one, so pick the closest.", and a picked kind reads "What this category holds."
  • Tests: categoryKindField.test.tsx (the three lines, the line following the Kind field, leaving on a change, absent for a stored choice and shown for a stored kind with no choice; the help for the name's guess, the parent's, none and a picked kind).
  • 44 px touch targets on a phone (visual pass 3a, finding 6). At the app's phone width (max-width: 768px) the region and count chips (setup and Settings share SpaceQuestions.module.css) and Ask again have min-height: 44px, and so does the "Needed every month" row in the category dialog (.check-row, a label, so the whole row toggles the box). At 390 wide: chips 36.3 to 44 px (13 in setup, 13 in Settings), Ask again 18.1 to 44 px, the row 21 to 44 px (the box itself stays 16 px). At 1280 every one keeps its size. Ask again still sits on its status line's baseline. With Settings scrolled to its end at 390, the card ends at y 606 and the + button starts at y 776: nothing is under it.
  • Tests: onboarding.spec.ts (every chip and Ask again in setup and Settings: 44 px or more at 390, under 40 at 1280) and categories.spec.ts (the row: 44 px or more at 390, under 30 at 1280, and a tap at its far end toggles the box).
  • Groceries and Eating out draw their own icons (visual pass 3a, finding 7). Local-first's defaults carried no icon, so Groceries fell to the food pattern in CategoryIcon.tsx (a coffee mug, as "grocer" sits in it) and Eating out to the fallback tick ("eat" must stand alone). The local-first defaults now give these two the Worker's icons, shopping-cart and utensils (DEFAULT_CATEGORIES in idb.ts takes an optional icon; the rest still come from the name), and the name matching checks /grocer/ (cart) and /eating\s*out|dining\s*out/ (utensils; since widened to every meal, below) before the food family, so an existing Groceries or Eating out with no icon of its own ('', tag, folder or none) shows them in both runtimes. A reset renaming Food to Groceries keeps an icon the person chose (resetKeepsIcon, shared/defaultCategories.ts); Food's old default icon (utensils on the Worker) or none becomes the cart. Before, the Worker set every kept default's icon back to the default's, a chosen one on Food included, and local-first kept Food's icon whatever it was; a default matched by its own name is still set back to the default's icon.
  • Tests: CategoryIconResolve.test.ts (Groceries and Eating out with no icon, any case; a chosen icon wins; Food unchanged), guidanceKinds.test.ts (the local defaults' two icons; resetKeepsIcon), worker/test/category-kinds.test.ts (the Worker's), and the reset contract scenarios in both runtimes (Food with utensils and with no icon becomes the cart; Food with coffee keeps it; Eating out set back to utensils). CategoryIcon.test.ts's copy of the pattern table has the two new rows.
  • Children can't be missed on a phone (visual pass 3a, finding 8). On "Name your space" at 390x844, with the 44 px chips, the footer starts at y 770 and the Children legend sat at y 793-811, its chips at 817-861, with 105 px left to scroll and nothing saying so. The step's lead is one line, without the dash ("Yours, a partner's or the household's. Add more later.", was two; now "A profile is one space. You can add more later.", below), and the two questions keep the form's 14 px rhythm (--space-questions-gap, which .stepForm sets; Settings keeps 18). Children's legend now starts at y 768 and its chips at 792, still under the footer, with 80 px to scroll, so the step showed a cue while it goes on below (data-more-below), read on the middle's scroll and by a ResizeObserver on the middle and the step in it; at the end it goes. The cue was a shadow along the footer's top; it is now a fade, and Children's legend shows as the step opens (the entry "Children shows as Name your space opens" below).
  • Tests: onboarding.spec.ts (the new lead, the 14 px gap, the cue at 390x844, none at the end, back on scrolling up, none at 390x1000 or 1280x800; now "the step's bottom fades while it goes on below").
  • About this space says what its answers belong to (visual pass 3a, finding 9). The card's subtitle ("Your answers choose the official figures your numbers are compared with.") said what the region's own line says ("We compare your numbers with official statistics for that place."). The answers belong to the space in both runtimes: local-first keeps them under guidance:<profile id>, and the Worker's settings rows are keyed by profile (PUT /api/settings writes (key, value, profile_id) for the active profile). The subtitle is now "Each space keeps its own answers." onboarding.spec.ts checks it at 390 and 1280.
  • The account dialog's hints keep the dialogs' leading (visual pass 3a, finding 10). Its hints (.form-hint, AccountsPage.module.css, used only by the account dialog) are Field's inline <span>s, so their lines took the field's 24 px line box, whatever their own 16.8 px line-height said: 24 px between the overdraft hint's two lines, against 18 px in the Categories dialog, whose .field-hint is a block. .form-hint is a block with a 1.5 line-height, as there: 18 px a line at 390 and 1280. The rule is local to the Accounts page, so nothing else moves. accounts-crud.spec.ts measures the two lines at 390.
  • Children shows as "Name your space" opens (visual pass 3a-2, N1 and finding 8). At 390x844 the Children legend sat at y 768-786 under a footer starting at y 770, and the footer's shadow was all but invisible in dark (1.09:1). The questions' lead is one line ("Both are optional. Change them later in Settings.", was "Both questions are optional. You can change the answers in Settings.", two lines), and so is the currency help ("Totals and charts use it. Accounts can still hold others.", was "Totals and charts are shown in this currency. Individual accounts can still hold others.", two). At 390x844, both themes, the legend now sits at y 733-751 and its chips at 757-801, with 45 px to scroll (was 80). The cue is a mask, not a shadow: data-more-below moved from the footer to the scrolling middle, whose last 20 px fade into the panel while the step goes on below (mask-image, with the -webkit- form for older WebKit), so it needs no colour per theme; the footer no longer draws a shadow or needs positioning. It shows at 390x844 and 375x667 in both themes, and not at the step's end, at 390x1000 or at 1280x800.
  • Tests: onboarding.spec.ts ("the step's bottom fades while it goes on below, and Children shows as it opens", light and dark: both hints one line, the Children legend wholly above the footer with its chips under it, the mask on and no footer shadow, none at the end, at 390x1000 or at 1280x800, on again at 375x667) and onboardingForms.test.tsx (the lead's words).
  • The number chips are 44 by 44 px on a phone (visual pass 3a-2, N2 and finding 6). At 390 wide the one-digit chips were 44 px tall but 35 to 39 px wide ("1" 35, "2" 38, "0" 39). In the same max-width: 768px rule as their height, every chip has min-width: 44px and centres its label (justify-content: center): at 390 the "1", "2" and "0" chips are 44x44 in setup and in Settings, label centred to 0.0 px; region and "3 or more" chips keep their widths (76 to 155 px); at 1280 every chip keeps its size (35 to 155 by 36.3).
  • Tests: onboarding.spec.ts ("the space questions' chips and Remove answer are at least 44 px on a phone": every chip at least 44 wide as well as tall, its label within 0.5 px of its centre, in setup and Settings).
  • Needed every month and Ask again keep the form's spacing on a phone (visual pass 3a-2, N3 and N5). The 44 px hit areas had pushed what a person sees apart. Measured on the text itself at 390: the Kind help ended 31.5 px above "Needed every month" (20 before the 44 px rule) and the hint started 20.5 px under it (9 before); in Settings the region's wrapped Ask again started 18.1 px under its status line (5.1 before) and 33.1 px above the household question (20.1). The row (.check-row, CategoriesPage.module.css) and Ask again (.askAgain, SpaceQuestions.module.css) keep min-height: 44px and take back what they grew by with negative block margins (-11.5 px from the row's 21 px line, -13 px from Ask again's 18 px), so the gaps are 20 and 9 px again, the same as at 1280, and Ask again's words start 7.1 px under a wrapped line (the note's row gap is 4 px, was 2) and 20.1 px above the next question. The row is positioned, so it paints over the hint its lower edge reaches into and takes the tap there; Ask again comes after its line and does already. No chip loses a tap at its edges. The general hint and the guess line are one hint (#category-essential-hint): the guess is its last sentences, in a span that keeps data-test-id="category-essential-guess", and the box is described by that one hint; at 390 that is three lines where it was four.
  • Tests: categories.spec.ts ("its whole row toggles the box ..., with the form's spacing": 20 and 9 px within 2, at 390 and 1280; at 390 taps at the row's top and bottom edges toggle it), onboarding.spec.ts ('on a phone "Remove answer" sits 6 to 8 px under a wrapped line and takes a tap at either edge'; the placement test reads Ask again's words, not its box) and categoryKindField.test.tsx (the box's one hint ends with the guess; the whole description).
  • "Name your space" says what a space is (visual pass 3a-2, N4). The step's heading says "space" and its field "Profile name", and the lead ("Yours, a partner's or the household's. Add more later.") bridged neither. It is now "A profile is one space. You can add more later.", one line at 390 and at 375 (298 px of 352 and 337; the old lead was two lines at 375). Of the two briefed candidates both fit ("Each profile is one space. Add more later." 266 px); this one is two whole sentences and says what "more" means. Nothing is renamed: whether the field should say "Space name" is maff's call.
  • Tests: onboarding.spec.ts (the fade test checks the lead's words and that it is one line at 390).
  • A meal draws utensils (visual pass 3a-2, N6). A category named "Restaurant" showed the coffee mug while its Kind said "From the name: Eating out": the food row in CategoryIcon.tsx mapped restaurant, dining, eat, meal, lunch, dinner and breakfast to the mug. Read whole, the row held food, dining, grocer, restaurant, eat, meal, lunch, dinner, breakfast, cafe and coffee; the meals moved to the utensils row (which held Eating out and Dining out): /eating\s*out|dining|restaurant|\beat\b|\beating\b|meal|lunch|dinner|breakfast/i. "eat" and "eating" match only as words, so "Heating" and "Seat covers" do not become meals. Food, cafe and coffee keep the mug (grocer stays in the row, behind the cart row before it). A chosen icon still wins. CHANGELOG's Groceries and Eating out line now names the meals.
  • Tests: CategoryIconResolve.test.ts (the real getCategorySvg: ten meal names draw utensils; Coffee, Cafe and Food the mug; Heating and Seat covers not utensils; a chosen icon on Restaurant wins) and CategoryIcon.test.ts's copy of the table (Restaurant and Dining).
  • An import gives a new category the same icons (worker/src/routes/imports.ts getCategoryIcon). When /api/import/execute created a category, its food row stored coffee for groceries and every meal, and a stored icon counts as chosen: a Restaurants made by an import while signed in kept the mug, while local-first's import stores tag and the name matching draws utensils. The row is split as CategoryIcon.tsx splits it: /grocer/ the cart, the meals (with "eat" and "eating" only as words) utensils, food, cafe and coffee the mug. Categories an earlier import made keep the icon it stored. CHANGELOG's line says so.
  • Tests: import-dedup-categories.test.ts ("gives a new category the icon the app draws for its name"): Groceries, Restaurants, Work lunches, Coffee and Heating through a real import.
  • The no-kind state says it once (visual pass 3a-2, N7). With a name that suggests no kind, the dialog said "needed every month" three ways: the Kind field's empty choice ("None yet: counts as needed every month"), and the words under the box ("Ticked because it has no kind yet. ..."), which also read oddly. The empty choice now reads "None yet" when nothing gives a guess ("From the name: X" and "From the parent: X" stay), and the words under the box "Ticked while it has no kind. Untick it if this one isn't needed every month." The Kind help for that state ("What this category holds. The name doesn't suggest one, so pick the closest.") is unchanged.
  • Tests: categoryKindField.test.tsx ("None yet" in both places it was asserted; with no kind, of the empty choice, the Kind help and the words under the box only the last says "needed every month"; the new guess words).
  • Ask again's 44 px stay clear of the chips (found while measuring W7). With its negative margins, Ask again's hit area reaches 13 px above its line; beside a short household line at 390 ("1 adult, no children.") its top edge (y 560.3) reached 3 px into the Children chips above (bottom y 563.3), where the chips, positioned, took the taps: 20 px of its width answered a chip. At the phone width the status line now starts 14 px under the chips (.note, was 10): the chips end at y 559.3, the button's top edge is its own across its whole width, and its hit area at its centre is 44 px (y 560 to 604). The region's wrapped line keeps its 7.1 px.
  • Tests: onboarding.spec.ts (the edge-tap test answers both questions in full, so the household's button sits beside its line under the chips, and checks no Ask again overlaps a chip).
  • "Ask again" is "Remove answer" (visual pass 3a-2, N9). In Settings the button clears the answer and asks nothing at that moment; the question comes back only as an unanswered one. Its visible label is now "Remove answer" ("Clear answer" could read as "a clear answer"). Test ids (settings-space-*-ask-again), the AskAgain component, onAskAgain and .askAgain keep their names; comments and test names that named the label say "Remove answer". After a removal the status line still says what happens now: the region's reason line ("Not answered yet. Compared with the EU average, going by your base currency, EUR.") and "Not answered yet." for the household. The wider label still sits beside the household's short line at 390 (its words from x 167 to x 262) and under the region's wrapped line, 7.1 px down; at 1280 both sit beside their lines.
  • Tests: AboutThisSpace.test.tsx (both buttons read "Remove answer"; the region's reason line after a removal), and the renamed tests in onboarding.spec.ts, AboutThisSpace.test.tsx and guidanceAnswersStore.test.ts.
  • The questions' lead names them and sits with them (visual pass 3a-3, A). "Both are optional." sat halfway between the fields and "Where do you live?" (14 px each way, 17.3 and 18.3 px between the text), so "Both" could mean Profile name and Base currency. It reads "Both questions are optional. Change them later in Settings.", one line at 390, 375 and 1280 (320 px of text in a 352 px box at 390, 337 at 375). .questionsLead (margin: 6px 0 -6px) gives it 20 px from the fields and 8 px to the first question (23.3 and 12.3 px between the text); the margins cancel out, so Children's legend stays at y 733-751 at 390x844.
  • Tests: onboarding.spec.ts ("the questions' lead names them, on one line, nearer the questions than the fields": its words, one line and less room below than above at 390x844, 375x667 and 1280x800), and the lead's words in onboardingForms.test.tsx.
  • The fade says "more below" only while there is (visual pass 3a-3, B). readMoreBelow (OnboardingWizard.tsx) compared the visible bottom with the middle's whole scroll height, so a step stopped inside the middle's bottom padding (14 px on a phone, 18 px wider) still faded its last 20 px: tapping through the questions at 390x844 left the middle 14 px short of its end, the picked Children chip at y 726-770 against a bottom at 770, its lower half faded. It compares with where the step ends now, the scroll height less the bottom padding window.getComputedStyle reads (half a pixel's slack, so one pixel of the step below still fades). .body has scroll-padding-bottom: 20px, so a control brought into view stops above the fade: the same taps now leave the middle at its end, the chip at y 712-756 and nothing faded. At 375x667 the taps already reached the end.
  • Tests: onboarding.spec.ts ("the fade is on only while the step goes on below, and a row brought into view stops above it", 375x667): no fade with the visible bottom at the step's end or one pixel short of the scroll end, a fade with one pixel of the step below, and the last region chip brought into view from the top ending 20 px or more above the middle's bottom.
  • Each "Remove answer" says which answer it removes (visual pass 3a-3, F). About this space's two buttons had the same name and nothing else, so a screen reader's list of buttons gave "Remove answer" twice. Each question's legend has an id (<prefix>-region-question, <prefix>-household-question, in SpaceQuestions.tsx) and its button points at it with aria-describedby: "Remove answer", described as "Where do you live?" or "Who does this space cover?". The visible label and the test ids are unchanged.
  • Tests: onboarding.spec.ts ("each "Remove answer" is described by the question it clears": both buttons' accessible name and description as Chromium computes them) and AboutThisSpace.test.tsx (what each button's aria-describedby points at).
  • CHANGELOG: the meal line has its verb (visual pass 3a-3, E). "and one named for a meal a knife and fork" reads "and one named for a meal shows a knife and fork"; the rest of the line is unchanged.
  • The benchmarks (shared/guidance/benchmarks.ts and benchmarks.json): the official figures a person's numbers are set beside, for eleven metrics and five regions. The JSON is the guidance research's file, shipped whole: 164 bands, each with its edges, source URL, year and strength; the references the copy quotes; the gaps (a metric a region has no figure for, and why); a derivation per metric and region; and the sources. Three changes from the research copy: it cited the app's own plan as a source at a file:// path on the machine it was written on, so that source and its citations (15 bands, 5 derivations) are left out; the five cushion derivations, which credited that plan with their edges, name the sources they keep instead; and it is formatted as the repo's JSON is, the data otherwise the same. bandFor takes the metric, the region, the value and { tenure, hasHousingLoan }, and answers the band the value falls in, or null for a gap, a value that is not a number and one below what the metric can be; a tenure without rows of its own reads as not given (the UK's mortgage row), and no answer as no housing loan. Beside it: bandsFor, referencesFor, gapFor (the file's stated gap, or a borrowing the app does not use), derivationFor and sourceFor. Two decisions are written down here: BAND_RULE (D5: typical runs from 0.75 times the lowest group average to 1.25 times the highest, and the savings rate is the official rate plus or minus 5 points), which records the rule the research's generator drew the file's bands with and redraws nothing, and BORROWED_BANDS_USED (D4 and D9: the UK's subscription count for the euro regions and Croatia's debt-payment lines for Germany and the EU are used and named as borrowed; the euro regions have no subscription-spend band, the UK no debt-payment band). benchmarks.ts is the only module that imports the JSON, and nothing imports benchmarks.ts yet, so no chunk of the app carries it.
  • Tests: guidanceBenchmarks.test.ts: the file (every section, an https source and a year on every figure, citations that resolve, no path on anyone's machine); bands or a stated gap for every metric and region; no overlap or hole for any household a metric's rows tell apart, probed at and either side of every edge; a table of what each region chooseRegion can pick gets; the UK's tenure rows and the 45% line with a housing loan; D4 and D9 (every borrowing listed, the lender named, a "no" leaving a gap that says why); D5 (every band the rule drew, subscriptions included, held to it); the values of the three people in the research's examples landing in the bands it gave them; and who reads the file (only benchmarks.ts imports the JSON, and nothing in shared/guidance/ imports from outside shared/).
  • A person's numbers (shared/guidance/facts.ts, guidanceFacts), worked out on the device from what the app holds, with the same code in both runtimes. The window is the last twelve tracked months before this one (fewer when there are fewer; this month is left out while it is under way), and an average needs three of them (MIN_MONTHS_FOR_AVERAGES). Income is income less deductions and spending is expenses (flows.ts), in the base currency, less the expenses filed under a category that holds transfers (holdsTransfers), which are money moved, not spent; own income leaves out the categories the person marks as support they expect to stop. Essential spending goes by essentialOf, and spending with no category counts as needed too (unsure says how much was counted that way). Every account is read at its balance today: the stored balance less what the entries dated after today moved (accountsToday). Liquid money is savings and cash at that balance and the lowest total the current accounts ended a day on in the last 30 days (today and the 29 before it), read back together as one pool through the entries (balanceMoves books an entry as local-first's computeBalanceDeltas does), each account from zero up on each day, and null without a savings, cash or current account. Invested is the investment accounts or the portfolio, whichever holds more, plus savings held elsewhere. Debts are the loans with a balance left, at the rate their schedule charges for the next payment, and credit cards and current accounts below zero whose balance is carried, unless the person says they carry no balance on either; a debt is expensive from EXPENSIVE_DEBT_RATE (10%), and a card or overdraft with no rate given is too. A card's payment is what went into it, a month on average over the last three full months, and a card it covers is cleared each month and carries none. The savings rate is worked out with and without the loan principal the window's installments and extra payments repaid.
  • The seven circles (shared/guidance/circles.ts, placeCircle). A circle is reached when the one inside it is and its own required checks are met, so the current circle is the first one not reached, and a hard month moves a person inward. A check is met, not met, or not known yet, and says why it is not known (unknown): the accounts could not be read, or nothing on file says yet (too few months, no account money could be in, a question not answered). Until a year is on file the placement is provisional and has no next step of its own (Getting started's lead); after that the next step is the current circle's first check not met, and says when that check is not known. A required check not known leaves the placement provisional too. Solid ground checks free money first, in Germany, Croatia, the UK and the US (FREE_MONEY_REGIONS), then debt at 10% or more, then three months of essentials; six months is on its checklist, not required. Room to choose counts liquid money beyond six months towards two years of spending; Work optional is invested money that pays a year of spending at the person's withdrawal rate (targetFromSpend); More than enough waits for the person's own number. The yearly-bills set-aside guidance.md lists for Solid ground is not checked: nothing links a yearly bill to a set-aside yet (guidance.md's own gap table says so). Decisions, each in one place: D1 CIRCLES, D2 CIRCLE_NAMES, D10 CLEAR_PICTURE_MONTHS (12, read by the first circle's check and by the facts' firm), D11 MORE_THAN_ENOUGH_DEFAULT (null), and D6 LOAN_PRINCIPAL_IS_SAVING in facts.ts (true: principal repaid counts as kept). The cushion lines (FIRST_CUSHION_MONTHS 1, FULL_CUSHION_MONTHS 6) and EXPENSIVE_DEBT_RATE are held by tests to the benchmarks' band edges in every region, so the app still imports nothing from benchmarks.ts. Nothing shows the circles yet.
  • Getting started can suggest a cushion (shared/orientation.ts, rule cushion, in the slot its comment kept between heavy-month and loan-payoff). "Build a one-month cushion" shows while the money a person can reach covers less than a month of essential spending (cushionOf, the facts' own window, essentials and liquid money), and links to Goals. The reason counts whole days, never an amount: "The money you can reach covers 28 days of what you need.", "1 day", and "doesn't cover a day" below one. OrientationFacts.cushionMonths is null with fewer than three tracked months or no account money could be in, and the step does not show then.
  • The achievements snapshot holds the accounts (achievementsStore.ts), read beside the other lists, kept to the active profile, and null when the read fails, so the badges are worked out all the same. That is one more request per evaluation. Getting started reads them from the snapshot (core/orientation.ts), so it still computes only while it is visible on Dashboard, after paint; at 3,000 entries one computation takes about as long as before.
  • Tests: guidanceFacts.test.ts (the window and a year on file, income and support, the sorted share, essentials with choices, kinds and no kind, a space whose categories have no kind, the low point and its 30 days, future entries, transfers, old type names, balanceMoves against computeBalanceDeltas, loans at the rate now, cards and overdrafts with and without a rate, a card's payment, invested money, D6, and the lines shared with the benchmarks), guidanceCircles.test.ts (the order and names, reaching, provisional, Solid ground's checklist, D11, and a family moved from circle 4 to 3 by a car repair paid from savings), guidanceExamples.test.ts (the three people of the research's examples: Mia in circle 1 with 7 months and the cushion as her third step, the Leipzig family in circle 4, Jordan in circle 2; where the examples' savings rates differ from the app's, the test says why), orientation.test.ts and orientationFacts.test.ts (the step's threshold, days, words, link and place), GettingStarted.test.tsx, achievementsStore.test.ts, localRows-apiContract.test.ts, and tests/orientation.spec.ts, where the step shows under a month of savings and leaves past one, local-first and signed in.
  • Current accounts are read back as one pool (review 3b-1, finding 1). A move between two of a person's own current accounts took the money out of reach for 30 days: each account was read back on its own, so the one the money left was low after the move and the one it reached was low before it. In the app, in both modes, a move of 400 from one bank to another brought "covers 18 days" for money that never left the person's hands. The current accounts are now read back together, as guidance.md 3.1 words it ("the lowest current-account balance"): each one's end-of-day balance from zero up, added up per day, and the lowest of those totals. Savings and cash still count at their balance, so money moved in from savings counts from the day the low point passes it, an under-count; reading savings and cash back as well is not built. The read-back covers exactly the last 30 days, today and the 29 before it: an entry on the first of them is no longer undone (finding 13). balanceMoves says it follows local-first's booking, and that the Worker books a transfer with no account to go to the other way: older data only, as both runtimes refuse a new one (finding 7).
  • Tests: guidanceFacts.test.ts (a move between two current accounts, a switch of banks, a salary passed on to a spending account, an overdraft beside another account, money moved in from savings and still held or spent, money put by, and the first of the 30 days) and tests/orientation.spec.ts (two current accounts and a move between them leave the step as it was, local-first and signed in).
  • One balance today for every account the facts read (review 3b-1, finding 6). Both runtimes store a balance with every entry in it, those dated after today too, and only the current accounts' read-back took those back out. Savings at 600 after a rent of 900 booked for later in the month read as 600, the current account beside it as 1,500. accountsToday now takes the entries dated after today back out of every balance the facts read: savings, cash and current accounts, cards and current accounts below zero, and investment accounts. A rent booked ahead no longer reads as an overdraft either. The comments that called the stored balance "now" say what it holds.
  • Tests: guidanceFacts.test.ts (a rent booked ahead on a current account, savings and cash; a card's payment booked ahead and an overdraft that a booked rent made; an investment account with money booked into it).
  • Money moved is not spending (review 3b-1, finding 2). An expense filed under Transfers, where the bank import's worldwide rules file a transfer whose other account they cannot tell, counted as spending and, as Transfers has no kind, as needed every month. 1,000 a month put by at a bank the app does not hold, beside 400 of real needs, read as 1,400 needed and a cushion of 21 days instead of 2.5 months. holdsTransfers (shared/guidance/kinds.ts) is now the one rule for what holds transfers: a transfer or account category, a category named as the import's rule sets file transfers (TRANSFER_CATEGORY_NAMES: Transfers; the Croatian set has none), and a category filed inside one. The facts leave the expenses filed under one out of spending, the needed spending and the sorted share, and so out of the cushion, circle 2 and the savings rate, whatever the person ticked for the category. The recurring-payment finder had its own copy of the rule and now uses this one, so it also skips a category filed inside Transfers. Other is unchanged: its name gives it the kind other, so it counts as spending and not as needed, and the Croatian rule set files an unpaired transfer there. Income filed under Transfers still counts as income.
  • Tests: guidanceFacts.test.ts (1,000 a month under Transfers beside 400 of groceries: the spending, the needed spending, the sorted share, the cushion, the savings rate and circle 2; a transfer and an account category, Transfers in capitals and padded, one ticked as needed, and a category inside Transfers; Other still spending and not needed), guidanceKinds.test.ts (holdsTransfers, a category inside one, and the list held to the bank import's rule sets: every name on it is one they file under, and every rule that files by the word transfer files under one) and recurringPayments.test.ts (a category inside Transfers).
  • The cushion step says "what you spend" while nothing says what is needed (review 3b-1, finding 2). In a space whose categories have no kind, such as ones named in a language the guess does not read, every expense counts as needed, and the step said "covers 28 days of what you need" about what was all of the spending. guidance.md 3.1 asks for that figure to be labelled as such. When everything counted as needed was counted only because nothing said otherwise, the facts say so (unsure.all), cushionOf answers against: 'spending', Getting started carries it as cushionAgainst, and the step says "of what you spend". One category needed by its kind or by the person's tick, and it says "of what you need" again. With too few months there is no figure, and against is 'needs'.
  • Tests: guidanceFacts.test.ts (a space with no kinds, and against what: no kinds, a category the profile no longer has, one with a needed kind, one ticked, too few months, nothing needed), orientation.test.ts (the three wordings of what you spend), orientationFacts.test.ts (the same spending under Croatian names: "covers 22 days of what you spend") and guidanceExamples.test.ts (Mia's step, from cushionOf).
  • A check not known is never a step to take (review 3b-1, finding 3). With a year on file and the accounts read, the review's person (32,000 within reach, 1,500 needed) is in circle 5 with two years as the next step. When the accounts could not be read, or only an investment account was on file, the same person was placed in circle 3 with "first cushion" as the next step, as if the cushion were known to be short. placeCircle now tells a check it could not read from one not met: a check not known says why (unknown), 'unread' when the accounts could not be read and 'not-on-file' when nothing on file says yet, so a failed read is no longer "no accounts". next carries it, so the circles panel (commit 10) can read the accounts again or ask, instead of advising. A required check not known leaves the placement provisional at the circles it could read. A figure read without the accounts (two years, work optional, more than enough) can only grow once they are read: one that reaches its target is met, one below it is not known. The number for More than enough not given is a check not known, so a person at circle 7 without one is placed provisionally and asked for it.
  • Tests: guidanceCircles.test.ts (the review's three cases from the person's own entries: the full picture, the accounts not read, only an investment account; a figure read without the accounts below and above its target; why each check is not known; free money unanswered asked about without making the placement provisional; the next step's unknown on every case it had) and guidanceExamples.test.ts (the examples' next steps).
  • A card paid off each month is not expensive debt (review 3b-1, finding 4). Every card below zero counted as a carried balance, expensive without a rate, so a card spent on mid-month and cleared at its end held a person at Solid ground with "no expensive debt" as the next step until they answered the card question. guidance.md 3.1 counts a carried balance. Unanswered, a card's entries now decide (cardCarried): when what went into it, a month on average over the last CARD_PAYMENT_MONTHS full months, covers what it owes today, it is cleared each month and left out of the debts; when its entries go back to the first of those months and do not cover it, its balance is carried; when they do not go back that far, nobody knows yet. Such a card is carried: null and expensive: null (a rate below the line keeps it cheap either way), and the debt check is not known ('not-on-file'), so the next step is the card question, never "pay off expensive debt". The answer, when given, beats the entries: no leaves every card and overdraft out, yes counts every card below zero as carried. An overdraft is carried, as before. Every debt says carried now.
  • Tests: guidanceFacts.test.ts (a card cleared each month, one carrying 2,000, one opened in September, one with no entries, the first of the three months as the edge of enough history, each of the three with either answer, a cheap card, an overdraft, and the debt check for each) and guidanceCircles.test.ts (a card too new to say: the card question as the next step, and either answer deciding).
  • Living off investments is paying your way (review 3b-1, finding 5). A retiree with no income on file, 3,000 a month spent from a current account that transfers from 2,000,000 invested fill, was held at circle 2 with own income as the next step. Work optional's check (invested money pays for the spending at the withdrawal rate) now meets the own-income check as well, and the check says so (via: 'work-optional'); its value and target stay own income and spending. Own income short of spending while the investments could not be read is not known ('unread') instead of a step to take.
  • Tests: guidanceCircles.test.ts (the review's retiree, from a year of entries, placed at circle 7; the same person with 100,000 invested, held at circle 2; own income with the accounts not read).
  • Infinity reads above every edge (review 3b-1, finding 9). With nothing needed every month the cushion is Infinity months (cushionMonthsOf), and bandFor answered no band for it, as for a value that is no number. It now lies above every edge, in the band open above, so that cushion reads high; only NaN has no band. Every metric's bands in every region have one open above.
  • Tests: guidanceBenchmarks.test.ts (Infinity in the band open above for every metric and region with bands, high for the cushion in all five; NaN and minus Infinity below a share still none) and guidanceFacts.test.ts (a cushion with nothing needed set beside the bands).
  • Each decision's place controls it (review 3b-1, finding 10). The facts' firm read the badges' year (YEAR_ON_FILE_MONTHS), so D10's CLEAR_PICTURE_MONTHS did not decide when the circles firm up, though guidance.md section 7 makes that handoff part of D10. It reads CLEAR_PICTURE_MONTHS now. D5's BAND_RULE draws nothing: the research's generator drew the file's bands with it, outside this repo. Its comment and the module's say so, and a test now holds every band the rule drew to it, subscriptions included, from the published averages they were drawn from, so a different width fails until the file is drawn again. The two phase 3b commit messages that said each decision lives in one place, that D5 lives in BAND_RULE, and that the facts are worked out the same way signed in or not were reworded before anything was pushed.
  • Tests: guidanceClearPicture.test.ts (D10 at six months firms the facts at six, with the badges' year still twelve) and guidanceBenchmarks.test.ts (every band drawn from group averages or the savings points, against BAND_RULE).
  • The benchmarks' words name what they mean (review 3b-1, findings 11 and 12). gapFor's answer for a borrowing the app does not use named the lender by its id ("the app does not borrow HR's"); it names it as the copy does, from the file's inCopy: "Croatia's", "the UK's". The five cushion derivations still said "Edges come from the method", a source the file no longer holds. Each now says where the edges come from, the r/personalfinance wiki (one month while paying debts above 10%, three to six months in full), and names the region's figures that give context: Eurostat's for the EU and Croatia, Destatis for Germany, the ONS for the UK and the Federal Reserve for the US.
  • Tests: guidanceBenchmarks.test.ts (both lenders by name; every cushion derivation names each source it keeps, and no method).

Achievements

  • Achievements count money in the base currency. sumTypes in frontend/src/core/achievements/evaluate.ts added Math.abs(t.amount), the figure in the transaction's own currency, so a month with an entry in another currency was summed in two currencies. Every sum of money in achievements now goes through baseAmount, which is Math.abs(normalizedTransactionAmount(t)) (amount_local, else amount), as the Worker's COALESCE(amount_local, amount) and the local-first handlers count it: sumTypes (saving months, budgets held, the average monthly spend behind rainy-day, the year in review's totals, and the in-the-red and budget-drift advice), the year in review's biggest category and the biggest unbudgeted category in advice. EvaluateInput.transactions takes an optional amount_local; the store already passes whole rows. txBaseValue (core/currency.ts) was not used: it also estimates a foreign row without amount_local from the browser's base currency, which would make the evaluator read localStorage. The Transactions totals and local-first's PDF reports (clientPdfReports.ts) do use that estimate; Budgets and Analytics do not, in either runtime (the Worker's COALESCE, the local-first handlers' getAmount, which is normalizedTransactionAmount). baseAmount counts as they do, so badges and advice see a month as Budgets and Analytics show it. Earned badges stay earned (diffUnlocks only adds). For a profile with converted entries, saver-x3, saver-x6, perfect-year, held-the-line, under-budget-six, clean-sweep and rainy-day can now be earned where they were not, or not be earned where they would have been; no other badge sums transactions. Tests: achievements/__tests__/baseCurrency.test.ts.

CRUD contract suite

  • One CRUD suite for cloud and local-first (#606). shared/contract/scenarios/ holds 120 scenarios in 24 entity files, run by worker/test/contract.test.ts through SELF.fetch on D1 and by frontend/src/core/storage/__tests__/contract.test.ts through routeApiRequest on fake IndexedDB: create from the body the form sends, read back to the cent, edit, delete, and check another profile can neither read nor change it. shared/contract/routes.ts lists 171 routes served by both runtimes, 69 by the Worker only and 25 by local-first only, each one-runtime route with its reason. Guards fail on a served route on no list, a listed route not served, a shared route without a passing scenario, and (from #612) a route registered twice. Where the runtimes differ, the check says // DIFFERENCE <id> and shared/contract/differences.ts describes it (52 when the suite merged); a shared wrong answer is marked KNOWN BUG.
  • 35 bugs fixed, each in its own commit with a failing test. Copy last month (features/copyLastMonth.ts, both runtimes) fills only categories with no budget yet, copies amount, period and the rollover switch but not a hand-set rollover amount, and answers { ok, count, already_budgeted } for a toast that says both. Worker: an account's reconciliation summary counts only that account; reconciling a date range works; a partial budget edit keeps rollover; adherence and the forecast history count each budget once; a month summary counts that month only; counterparties with and without a trailing space stay apart; a deleted loan's rate periods and extra payments are deleted with it; a loan saved without rate periods no longer gets a copy of its rate as one; the emergency fund answer carries monthsWithData; the monthly PDF answers 400 for an unreadable month; the import preview lists the accounts it would create. Local-first: the transaction list honours the app's filter names and orders a day's rows last entered first; a bill keeps its account, so paying it moves the balance; bills and recurring rules carry their category's name and colour; extra payments and rate periods have ids; holdings are profile-scoped; an imported account keeps its case; a deleted profile's retirement plan goes with it and a restore keeps it; a restore removes the replaced profiles' import sources; PDF reports answer the PDF's bytes. Both: the sankey uses the month's own budget; loans list newest first. Local-first's PUT /loans/:id/rate and api.updateLoanRate are gone.

Found along the way

  • The wizard's hints at full strength (#625). .fieldHint in frontend/src/components/onboarding/Onboarding.module.css drew --text-secondary at opacity: 0.85: 3.94:1 against the panel in light and 5.92:1 in dark, under the 4.5:1 that text needs. Without the opacity they are 5.48:1 and 7.69:1. Only the wizard uses the class; the other fieldHint classes belong to other modules. tests/onboarding.spec.ts ("the wizard's hints read at 4.5:1 or better against the panel"), light and dark: every hint on the space and account steps, from computed colours, the hint at its opacity over the glass panel and the panel over each stop of the overlay's gradient.

  • Analytics weeks, heatmap days, whole PDF reports, net worth by day (#612). shared/calendarWeeks.ts puts every day of a month in one of its weeks, a week's trends cover the seven days its label names, and a week or month the calendar does not have answers no days, in both runtimes. Local-first's heatmap drill-down lists the day's transactions. A cloud PDF report reads every transaction of its range, not the newest 1,000. shared/netWorthTimeline.ts takes each account's latest balance on or before the day, in both runtimes. Quick entry, Goals, Bills, Budgets and Categories say why an action failed; deleting a goal or category another tab already deleted says so, and the Worker names a missing goal or bill. Twelve months back from 29 February reach 28 February. 13 Worker routes and 12 local-first routes that nothing called are removed, with a second registration of POST /api/calculator/compound-interest. Achievements leave out a loan deleted while they count. The formButtonType guard reads the whole tag.

  • Account types: one list, checked by every writer, and a reader that keeps the rest. ACCOUNT_TYPES in shared/accountSchema.ts is the list. MCP create_account stored any string (z.string().max(50), described as "e.g. giro, savings, credit, cash"); its type is now z.enum(ACCOUNT_TYPES), and the tool and field descriptions are built from the list and ACCOUNT_TYPE_WORDS. POST /api/import/execute in both runtimes reads each accountTypes value with readAccountType (the Accounts form's reading: blank is giro, checking, investment and retirement are their v4 replacements, case and spaces ignored) and answers 422 before any write for a type the app does not have: validation_errors holds accountTypes.<name> with ACCOUNT_MESSAGES.type, and error is importedAccountTypeError(name), the same words in both. A dry run refuses it too. The Worker stored the value raw and local-first cast it. Where no client chose a type (the sheet sync, email-in, /api/v1/import, MCP create_transactions), an account is still giro, and local-first's IB detection still gives ib. The accounts routes and handlers already ran checkAccountCreate and checkAccountEdit; restore copies rows as stored. On the client, AccountSchema.type was z.enum, so one account of another type failed api.getAccounts() (Transactions, quick entry, Tags) for every account; it is now z.string().transform(storedAccountType), which keeps an unknown type and reads a v4 name as its replacement, as local-first's normalizeAccount now does through the same function. Account.type is AccountType | (string & {}). Every display reads the type through knownAccountType (core/accountTypes.ts): the badge's word (accountTypeBadge), its colour (accountTypeTone), the card's icon (accountTypeIcon), the Transactions account select and the constellation's label and colour. A v4 name shows as its replacement everywhere, which matters in cloud mode, where the Accounts page gets the stored type raw: a retirement account had the "ib" word but the plain colour and icon, and "Account" in the constellation. A type the app does not have is a plain account everywhere: "account" on the badge and in the select, "Account" in the constellation, the plain colour and icon. The edit dialog opens a v4 name as its replacement (storedAccountType in accountForm.open, which checkAccountEdit reads as the same type) and shows an unknown type as a disabled, selected "Other account" option instead of a blank select. An untouched save sends the type back unchanged and writes nothing, so this is what keeps a rollback safe once a build writes a new type. Tests: two contract scenarios (imports.ts, both runtimes), mcp-tools-write.test.ts, api.getAccounts.test.ts, the Accounts page in accountForm.test.tsx (local-first) and accountsPageTypes.test.tsx (cloud), accountTypes.test.ts, accountConstellation.test.tsx and transactionsAccountTypeWord.test.tsx.

Tests and tooling

  • The confirm-email tests get the time their waits allow. Each test in frontend/src/__tests__/confirmEmailGate.test.tsx waits on the real App, up to 10 s a wait, but ran under vitest's default limit of 5 s, so on a loaded runner a test could end while its wait still had time left: "reads the signed-in account's from start, and nobody's after signing out" timed out that way in CI and in local full runs, and passed alone. The file's tests now have 30 s, enough for three of its waits.
  • The release suite (#593). frontend/tests/release/ runs the 5.16 dev test scope in both storage modes as its own Playwright project, present only with E2E_RELEASE=1 (pnpm run test:e2e:release): cloud cases in profiles of their own, local-first cases through Continue with no account. Sections 1 to 6, 8 and 10 to 15, including the two-tab upgrade rehearsal (s15-two-tab-upgrade.spec.ts), which routes each tab to its own build. Known app bugs are pinned at their check with test.fail, listed in the suite's README. #600 adds s16-loans.spec.ts.
  • Stopping the Worker webServer stops wrangler too (#588). frontend/playwright.config.ts sets gracefulShutdown: { signal: 'SIGTERM', timeout: 5000 } on the Worker entry, so serve-worker.mjs's supervisor kills wrangler's detached group before it exits, instead of leaving wrangler, workerd and esbuild on :8787 for the next local run's reuseExistingServer to adopt. e2eWorkerTeardown.test.ts runs the real supervisor against a stand-in wrangler and fails without the line.
  • The first-three-markers test forges three distinct markers. In worker/test/email-link-finish.test.ts, "looks at the first three markers a request carries, and no further" made its forged markers by setting the signature's first character to A or B. When the genuine signature already started with that letter, a "forged" marker was the genuine one, the request confirmed, and the test failed about 1 run in 32. Each forged marker now takes a first character from ABCD other than the signature's own, so all three differ from the genuine marker and from each other, as in the test above it.

Dependencies

  • The worker-deps group (#591): @simplewebauthn/server 14.0.3, hono 4.13.12 and @cloudflare/workers-types 5.20261002.1, with the worker lockfile regenerated under pnpm 10, and undici overridden to exactly 7.29.1 in worker/ for six advisories (both miniflare releases pin 7.29.0).
  • The dev-tooling group at #597's versions (#598), including ESLint 10.12.0, Prettier 3.9.9, Vitest 5.0.3 and Vite 8.3.2; dompurify 3.4.16 and postcss-selector-parser 7.1.6; a fast-uri 3.1.8 override in the root workspace; solid-js 1.9.16 (seroval 1.6.8); brace-expansion and source-map-js lockfile refreshes; the worker's sharp override raised to 0.35.5.

[5.16.1] — 2026-09-27

  • Money is formatted in the base currency everywhere it was hard-coded. D3HeatmapChart's tooltip and RentBuyCalculator used euros, RecurringSection dollars, and SubscriptionCatalogModal euros plus a literal euro prefix on its price field. They use the shared formatCurrency, or getLocalCurrency() where they format themselves; a recurring rule and a catalog price have no currency of their own, so theirs is the base one. AutoCategorizeModal fell back to euros for a row without a currency. The calculator still honours a currency prop. New currencySymbol(code, locale?) in core/currencies.ts gives the catalog its prefix: the symbol where the locale has one, the code (CHF) where it does not. The audit found no other literal-currency Intl.NumberFormat; the budget allocation alerts' Over budget by $… strings (Worker and local) are API text no page renders, left as they are.
  • Local-first mark-paid records the payment (handlers/bills.ts), as the Worker's batch does: an expense transaction for the bill's amount in the base currency (EUR when none was ever set, as on the Worker; amount_local = amount), on its account and category, dated today; the account debited; the bill stamped paid; 409 when it is already paid for its period; { ok, transactionId } back. It used to stamp the bill only. New IndexedDBAdapter.payBill runs the check and every write in one IndexedDB transaction, so a second tap or tab runs after the first and gets the 409 with nothing written. Local billsCreate still takes no account_id (no form sends one); a bill restored from a cloud backup can carry one.
  • Profile-selection edge paths. loadProfiles keeps the list and the selection when the read fails; it used to empty the list, which read "Not Logged In", and the repair then dropped every selected id. After a sidebar create whose list read failed, App adds the created row (ProfileModal.onSuccess now passes the profile, not its id). Sign-out clears the list itself. The setup wizard's first-profile create goes through applyProfileSelection (new selectProfiles prop) instead of writing the storage keys. App's sidebar selection follows the stored one on a profileVersion bump while the dropdown is closed, so a household edited in Settings is no longer written back over by the next dropdown close.
  • Tags are per profile in local-first lists too. Local GET /api/tags returned every household profile's tags while the Worker returns the active profile's; tags are per profile in every other route. The filter bar and the bulk-tag modal (which 404ed on another profile's tag) now get the active profile's list in both modes, and use the form's ownTags for the window after a profile switch. The filter bar keeps no household tags: cloud mode never offered them (the Worker's list is the active profile's), tags are per profile and the filter matches rows by tag id, so a household list would offer one entry per profile for a shared name, and the Tags page links only the active profile's. The bulk-tag create picks an existing tag of the same name in any case, and local tagsCreate refuses an exact duplicate in a profile with the Worker's 400, mirroring UNIQUE(name, profile_id).
  • Household rows are enriched from their own profile (local transactionsList). It read rows from every selected profile but looked categories, receipts and tags up in the active profile's alone, so the other profiles' rows showed a dash for the category and no receipt or tags. It reads them from every selected profile now and, like the Worker's joins (c.profile_id = t.profile_id), takes a category or a receipt only from the row's own profile; tags come from every selected profile's rows, as the Worker attaches them.
  • IndexedDB connection handlers in getDB (core/storage/idb.ts, notices in core/storage/connectionNotices.ts). blocking: close the connection so another tab's upgrade or a delete can run, ask for a reload through reloadToLatest on the deploy notice's channel (UPDATE_TOAST_CHANNEL, now exported from core/toastStore.ts), and leave later calls waiting rather than failing into empty lists. blocked: a warning to close the other tabs until the upgrade runs; builds up to 5.16.0 have no blocking handler, so this is what a tab upgrading past an old one shows. terminated: drop the dead connection so the next call reopens. The v12 schema the upgrade tests build is a shared helper now, __tests__/v12Schema.ts.
  • The waiting notice is drawn while the app loads. blocked raised its toast as intended, but <ToastContainer /> lived inside App's <Show when={!_isLoading()}>, and the blocked upgrade is what keeps App loading: the tab showed the boot screen and nothing else. The container now renders beside App in the new Root.tsx, which index.tsx mounts; App has none of its own. toastsOutsideBootGate.test.tsx pins both halves, and the release suite's two-tab case (frontend/tests/release/s15-two-tab-upgrade.spec.ts) passes on a production build.
  • An import preview no longer counts as a write for badges. announceDataChanged skipped GET, HEAD, OPTIONS and settings writes but not the lookups sent as POST, so each preview's dry run set off a full badge evaluation (eight reads) after a request that wrote nothing. The list of those lookups moved from dataVersions.ts into the leaf module core/readsSentAsPost.ts, which both listeners now consult.
  • A test that failed under load. goalsUndated.test.tsx loads the local-first router in its beforeAll. Its first two tests paid for apiFetch's import of the router inside a one-second waitFor, and failed every full run on a loaded machine, on the 5.16.0 base as well.

[5.16.0] — 2026-09-27

Data refresh: one invalidation seam

  • Pages follow writes made anywhere (#570, #572, #578). Since keep-alive page mounting (#317) every visited page stays mounted with the copy of the data it fetched first, so a category created on Categories never reached the add-transaction form until a browser reload. The app had been patching this one consumer at a time. frontend/src/core/dataVersions.ts now holds one counter per entity, and core/apiFetch.ts bumps the counters a successful non-GET names, in both storage modes. A page follows an entity by adding entityVersion('<tag>') to what it already tracks (refetchOnActive(...), or a gatedSource(...) resource), and its manual reload after its own write is deleted. #570 converted Transactions; #572 Goals, Bills, Budgets and Tags (and Goals.loadGoals no longer refetches every category per load just to build a name map that froze renames); #578 every remaining page.
  • ALSO_INVALIDATES is followed transitively (#578): an entry that writes transactions says transactions and inherits the rest. Three holes closed on the way: the import entry was keyed imports while the routes are /api/import/*, so a finished import refreshed nothing; a paid bill or a populated recurring row never reached budgets, reports or accounts; and lookups sent as POST (portfolio prices, loan amortization, tag-rule preview, import previews) counted as writes. They are listed in READS_SENT_AS_POST now.
  • asOneWrite(work) (#579): a multi-request action is one write. Applying fifty auto-categorize picks, tagging a selection with two tags, or a save followed by a receipt upload held the counters while it ran and delivers them once, so a list refetches once per click instead of once per request. The Transactions list follows the seam; its form's tags are the transaction's own, not the list filter's (a tag created in the form used to set the list filter and was never attached), and it offers and matches only the active profile's tags.
  • Resume revalidation (#573, audit F-03). core/dataRevalidation.ts: after 60 s or more in the background, or on any reconnect, every tracked counter is bumped, so the visible page refetches and hidden pages refetch when next shown. There was no data revalidation of any kind before; the one visibilitychange listener checked for a new build. This is the prerequisite for the native shell, where resume is constant.
  • Selects keep their choice through a refetch (#576). <select value={model()}> is applied only when the model changes; a refetch rebuilt every <option> and removing the selected one reset the select to its first entry while the model kept the old id. 19 selects across 13 files now set selected={...} per option, and a source guard fails on a new select in the old shape.
  • App.tsx's async onMount registered five onCleanups after an await (#571), which Solid drops silently: the keydown handlers for the command bar, the shortcuts guide and period stepping, and the disposers of initPeriodSync() and initVersionWatch(). They are collected in a lateTeardowns array registered before the first await; a source-scan test guards the shape.

Profiles

  • The active profile is always in the household (#575). currentProfileId (X-Profile-Id) decides where a write lands and selectedProfileIds (X-Profile-Ids) what a household read returns; Settings let you untick the active profile, after which every new row was filed where no read looked. householdProfileIds() in core/apiProfileScope.ts enforces the invariant at read time for both storage modes, and the Settings toggle keeps the stored value honest.
  • The household list disables the active profile's box with the reason as a tooltip, and marks it with an "Active" badge (#577). Picking a profile, closing the sidebar dropdown and clicking outside it share one function, applyProfileSelection; the click-outside path had moved where writes land without moving the profile the sidebar showed. A source guard fails if App.tsx writes currentProfileId without setCurrentProfile.
  • A profile created from the sidebar becomes the selection (#584). In local-first mode the adapter pointed currentProfileId at it but the selection and profileVersion stayed put; in cloud mode nothing moved at all. ProfileModal hands App the created id, and App reloads the list and routes it through applyProfileSelection.
  • The Import page's bank-rules editor follows a profile switch (#582). The flow copied a profile's rules into drafts once, in the page's onMount or the wizard's first import step, so after a switch it showed the previous profile's rules and Save wrote them under the new profile's key. reloadBankRulesIfProfileChanged() reloads them when the profile moved, and keeps unsaved edits when it did not.

Achievements

  • Badges are earned and kept per profile (#580). The evaluator read with the household scope and saved what it found to the active profile, so ticking another profile into the household handed its badges over, permanently. It now keeps only the active profile's rows (after the fetch, since local-first handlers read the household from storage whatever scope a request asks for), and a profile switch during an evaluation cannot file one profile's badges under another.
  • Badges fire on the write that earns them (#574). The tc:data-changed event achievements listens to was dispatched from the typed client's request(), which the raw helpers (apiGet/apiPost/apiPut/apiDelete) never pass through. Goals, Bills and Budgets write only through those, so first-budget, goal-in-sight, goal-reached and under-budget-six unlocked on some unrelated later write. The dispatch moved to apiFetch.

Local-first storage

  • Complete rows (#581). IndexedDB has no columns, so a key no writer set is absent, and zod rejects an absent key even where it accepts null: a plain load of the demo logged "Validation failed" for /budgets, /bills, /loans and /savings-goals. The achievements run reads all four in one Promise.all and swallowed the rejection, so badges never ran in local-first mode. The seed and the local writers now write every key the Worker's rows carry, and rows stored by earlier builds get them at the response boundary (handlers/normalize.ts).
  • IndexedDB v13: retirement goals in their own retirement_goals store (#581). They were filed among the savings goals, and a restored server backup parked its retirement goals in a settings row no page read. The upgrade copies both kinds into the new store before removing them from the old places. It is one-way: a build from before 5.16.0 cannot open a v13 database, so the frontend must not be rolled back past this release.
  • Undated goals stay undated (#583). The Goals page filled a missing target date with today's, so an undated goal read "Due today", and saving any edit gave it that date. The date is optional in the form and can be cleared.

Tooling and dependencies

  • The pre-commit hook runs ESLint from inside frontend/ on the staged frontend paths only (#561). One worker/, shared/, packages/ or scripts/ path in a batch made ESLint 10 abort the whole run for want of a config, and || true printed ok. The dead root .eslintrc.json, which nothing loads, is gone (#562).
  • sharp 0.35.2 to 0.35.4 (a scoped override: two miniflare builds pin it exactly) and postcss to a patched release in worker/pnpm-lock.yaml, clearing Dependabot alerts #3 (high, libheif) and #1 (medium); both dev-only and transitive (#560). zod 4.6.5 (#566); the worker-deps group, including @simplewebauthn/server 14.0.2 and hono 4.13.8 (#567); the dev-tooling group, including ESLint 10.10, Prettier 3.9.8, Vitest 5.0.1 and Playwright 1.63 (#568).

Documentation

  • End-to-end encryption is no longer described as planned anywhere (#585). It will not be built for now: the security model is the platform's encryption at rest (Cloudflare D1 and R2, AES-256) plus TLS in transit, and in local-first mode the data stays in the browser. SECURITY.md said zero-knowledge encryption of synced data was "on the roadmap"; it now states only what exists, checked against Cloudflare's D1 and R2 data-security pages. frontend/public/llms.txt and the 5.15.1 llms.txt bullet in CHANGELOG.md no longer list it as decided but not built. The tier note is gone from the worker/src/plans.ts comment and from docs/plans/billing-tiers.md, whose "Encryption (when it lands)" line now describes the encryption that already applies.
  • docs/e2ee-research.md stays as research, under a status line saying it is not planned; the encryption part of docs/plans/bank-connectivity-and-encryption.md carries the same line and its open E2EE decision is closed. docs/readiness-audit-agent-prompt.md marks Phase 5 as not to be run, and docs/plans/import-automation.md no longer speaks of "the E2EE envelope" as a thing that exists. Token-at-rest encryption for server-held sync tokens is server-side and unaffected.

[5.15.1] — 2026-09-09

  • The legacy Express backend's paperwork is gone too. The server itself went in e5931959; what stayed was a layer of documentation for it that nobody could follow, because the files it told you to build no longer exist. Deleted: docs/self-hosting.md and docs/docker.md (19 KB of docker compose instructions against a Dockerfile and docker-compose.yml that were removed with the server), and the root .env.example, whose every variable — APP_PORT=3847, PORT, SESSION_SECRET, DATABASE_PATH=db/finance.db, SMTP_*, DEFAULT_USERNAME — belonged to that server and is read by nothing in the tree (the Worker takes wrangler.toml vars plus .dev.vars; the frontend takes VITE_* from frontend/.env*). Both guides are still readable at tag v5.9.3 for anyone running an image built from that server.

  • Also corrected the references that pointed at them: README.md, docs/README.md, AGENTS.md, SECURITY.md (which still described the Worker's security features as a contrast against a "deprecated" Express server), and ROADMAP.md, which carried an open checkbox for bringing backend/routes/importRoutes.js to import parity — unreachable work on a deleted file. The frontend/vite.config.ts proxy comment still told you to set API_PROXY_TARGET to "the legacy Node/SQLite backend (http://127.0.0.1:3847)" and claimed the Playwright suite pinned it there; both Playwright configs have pinned it at the Worker since the retirement.

  • docs/specs/backend/ and test/e2e/specs/ stay. They are the API contract, written against the Express routes but describing behaviour the Worker carried over, and AGENTS.md says so. The // Port of backend/routes/*.js headers in worker/src/routes/ stay for the same reason: they are provenance for why a handler is shaped the way it is, not a pointer at a live runtime.

  • frontend/public/llms.txt (#556). The app host answered 404 for it while every sibling property in the group had one. Served as a static asset alongside robots.txt and sitemap.xml; content mirrors README.md and about.tokencircles.com, so it introduces no claim that is not already published. Half of it is a "what this does not do" section — the four things most often assumed about a finance app — because the host previously gave a fetcher nothing to check an assumption against.

[5.15.0] — 2026-09-09

Added

  • ?plan=<tier> as an entry point from the marketing site (new core/planIntent.ts, index.tsx, App.tsx, BillingPlans.tsx, styles/index.css). about.tokencircles.com prices four tiers; until now every one of its buttons could only land on the app's root, because nothing deeper worked:

    • Production ships VITE_DEFAULT_STORAGE=dexie, so a first-time visitor opens in serverless (local) mode — and isTabVisible('billing', 'serverless') is false. A link straight to Settings would have shown them a page with no Billing tab at all.
    • Sign-in reloads the page — every path through LoginScreen ends in window.location.reload() — and a query parameter cannot survive that, so the intent is parked in localStorage and consumed on the far side.

    applyPlanIntentFromUrl() runs before render, next to applyDemoModeFromUrl() and for the same reason — <App/> reads the storage mode once, on the way in. It is the mirror image of ?demo=: that one switches to client-only mode, this one switches away from it. The switch is unconditional, exactly as the app's own "Sign in" button already is (App.tsx handleLogin): asking for a paid tier is asking for an account.

    It deliberately does not reload, and handleLogin is why that needed checking rather than copying: it reloads for this same switch, but only because it runs after the app is already up. Every reader of the mode reads it lazily — apiFetch per call, the storage adapter on first use, nothing captured at import — so setting it before render is the whole job, and a reload would have cost a second page load on every click arriving from the marketing site.

    After checkLogin() returns true the intent fires — Settings, Billing tab, hash updated — and BillingPlans scrolls the requested card into view and rings it for a couple of seconds (data-plan-wanted). The parameter is stripped from the address bar with replaceState so a refresh cannot re-fire it, and free is rejected on purpose: it needs no billing page, it is what an account already is. Eleven tests, including that a bad tier never switches anyone out of local mode.

  • A light-theme set of plan card art (public/plans/card-light-*.webp, styles/index.css). The generated art shipped dark-only and said so in a comment: 8-16% mean luminance, so under a light card it would have put dark text on a dark field. A light user saw four flat cards.

    The light set is the dark set's own ring geometry re-painted, not a second generation run — which is the point: a tier's card is recognisably itself in both themes, and adding a tier means one image, not two art directions. Derived and measured, never eyeballed:

    magick card-<tier>.webp -colorspace gray -level 6%,55% -evaluate multiply 0.50 mask.png
    magick -size 560x831 xc:'#eef3ff' \( -size 560x831 xc:'#3b6fe0' \) mask.png -composite \
      -quality 88 card-light-<tier>.webp
    

    The black point is what stops the source's navy ground arriving as a grey wash; the multiply is what keeps the rings a tint rather than a block of azure. Both were picked by sweeping and measuring, not by looking: -auto-level was the obvious first choice and is wrong — it normalises each image independently, so the faint Free card came out with more ink than Basic, inverting the tier gradient. Result is 90-94% mean luminance across the four, the clean mirror of the dark set's 8-16%, with ink coverage still ascending by tier.

    The shared rule moved from :root[data-theme='dark'] [data-plan-card] to a bare [data-plan-card] with var(--plan-card-art, none); each theme block now sets only the four urls. Verified in a real browser against the built CSS — the same check that caught the background shorthand bug when this art first shipped — that dark resolves to card-*.webp and light to card-light-*.webp for all four tiers.

[5.14.0] — 2026-09-08

Fixed

  • Four colours were built by pasting a # in front of a value that already had one. Category and tag colours carry the hash at every write — the columns default to '#6b7280' (worker/migrations/0001_init.sql), the seeded categories are '#22C55E'/'#F97316' and the rest (worker/src/profileData.ts), the offline handler writes '#6e9bff', and the pickers are either <input type="color"> (Bills, Goals) or swatch buttons over CATEGORY_PALETTE (Categories, Tags) — neither can emit anything else. Nothing strips it, and the places that render these correctly (Tags.tsx, BulkActionBar.tsx) pass the stored value straight through. So style={{ background: `#${tag.color}` }} built ##6e9bff; the CSS parser rejects the declaration and drops it silently, with no console warning and a diff that reads like every correct line beside it. The worst of the four was the tag chip on a transaction row (TransactionTable.tsx): .tag sets color: #fff and no background of its own, so a tagged transaction rendered white text on the table's own background. The other three — FilterBar.tsx's category and tag swatches and BudgetAlertsCard.tsx's alert dot — are 10x10 circles with no colour of their own, so they were simply not there whenever the row had a colour to show; the budget dot painted only in the one case the value was null, where the bare fallback ('ef4444') happened to make the template's # correct. Both fallbacks now carry their own hash, and the two tag sites, which had none, gained one — so a tag saved without a colour gets a visible chip rather than the same invisible one. The dot in FilterBar uses var(--primary), matching the dot BulkActionBar already falls back on; the chip in TransactionTable uses the column's own default #6b7280 instead, because .tag prints its label in white and white on the dark theme's --primary (#6e9bff) is 2.7:1, against 4.8:1 for the grey in every theme. Guarded twice: src/components/__tests__/storedColours.test.tsx reads the colour back off the rendered chip, because the markup and the value are both right and only the browser's rejection of ## shows the bug; src/__tests__/storedColourHash.test.ts scans every source line for the shape, skipping hash routes (href={#${page}}) and SVG paint servers (fill="url(#${id})"), which are the two places the same syntax is correct.

  • Every badge Share failed, for two independent reasons. shareBadge hands the card's SVG to an <img> and draws that on a canvas, and both steps were broken since the feature shipped; nothing caught it because neither is visible until the button is pressed.

    1. baseMarkup emitted <circle data-ring ...>. A valueless attribute is fine in HTML and invalid in XML, and an SVG loaded as an image is parsed strictly — so the document failed to parse, img.onerror fired, and the catch showed "Could not build the share card". data-ring now carries its index.
    2. With that fixed the image loaded and toBlob threw SecurityError: Tainted canvases may not be exported: Chrome taints the canvas when the drawn SVG contains a <foreignObject>, which the card used to wrap the share line. Replaced with wrapShare, a greedy word wrap into <tspan>s — crude on purpose, since the strings are ours and one sentence each. Verified by rasterising all 34 cards in a real browser on a real origin: 34 of 34 produce a PNG, against 0 of 34 before. Three tests now pin it — every card parses as XML, no card carries a foreignObject, and every share line fits two wrapped lines.
  • The badge timeline's scrollbar was the OS grey. .brand-scroll in styles/index.css paints the thumb in the theme's own --primary graduating into --accent-warm, the same azure-into-gold the medals use, inset by a transparent border so it reads as a pill in the gutter. Firefox has only scrollbar-width/scrollbar-color; Blink and WebKit need the pseudo-elements, so both are set. Applied to the Progress timeline and the dashboard badge rail, and deliberately not globally: the page's own vertical bar stays the platform's.

  • The badge art was off centre, twice over. Reported from the app: the Beginnings and Building faces sat high in their black cutout while Mastery and Legacy looked right, and several glyphs did not sit dead centre in the medallion.

    • The faces. aurora-blank-*.webp were cropped by hand out of the generated row, so each medallion landed somewhere slightly different: Beginnings and Building were 19px high in a 440px frame and also smaller than Mastery (379 and 385 wide against 402). All four are now cropped from the masters by measurement — the medallion's content box is found by threshold, the crop is centred on it, and the side is diameter / 0.945 so every band fills the frame identically. Re-measured: all four content boxes centre on (220, 220) within a pixel.
    • The glyphs. They are drawn by hand and their ink lands where the paths fall, not where the 48-unit box says: a-quarter sat 8.95 units high, half-a-year 7.35, and 23 of the 34 were off by at least 0.4. BadgeMedallion cannot measure anything — it builds the share card as a string, with no DOM — so the corrections live in GLYPH_OFFSET in badgeGlyphs.ts and are applied in the glyph transform. scripts/measure-badge-glyphs.mjs generates the table: it rasterises each glyph at the app's stroke and scans the alpha channel, so caps and joins count. Every glyph now centres within 0.12 units of the medallion's middle.
    • The comeback's arrowhead was a corner bracket at (9,8)-(17,16) next to an arc that started at (14,22) — nothing lined it up. The arc and the head are now generated from one circle: both endpoints sit on r=13 about (24,24) and the head's vertex is the arc's end point, so the chevron cannot drift off the ring.

Added

  • A wheel over a sideways strip moves the strip (utils/horizontalWheel.ts, used by BadgeTimeline and BadgeRail). scrollHorizontallyOnWheel(el) maps deltaY onto scrollLeft and returns its own detach function; both call sites register it from the element's ref callback through onCleanup, which covers the <Show> case where the strip appears only once a badge exists. Three details are the whole design. It is registered { passive: false } because Chrome makes wheel listeners passive by default and a passive listener cannot preventDefault at all. It calls preventDefault only while the strip can still move that way, so the last badge is not a wall the page scroll cannot get past — the pointer never has to leave the strip to carry on down the page. And a gesture whose deltaX already exceeds its deltaY is left alone, so a trackpad's own sideways scroll is not fought over. deltaMode is honoured (Firefox reports lines, not pixels: a 3-line notch would otherwise move the strip three pixels).

  • The badges rail is a dashboard widget (core/dashboardWidgets.ts, features/Dashboard.tsx, components/DashboardSettings.tsx). It renders at a fixed spot under the period bar, so like metrics and the deck-* ids it is excluded from the ordered loop and gated on isWidgetVisible('badges') where it sits. The registry is new and is the point of the change: the page and the Views dialog each held their own copy of the widget lists, and the dialog had no equivalent of the page's splice-in-new-ids migration. Adding an id to both copies would still have left every existing user — everyone, since the rail already shipped — with a saved widgetOrder that predates badges, so the dialog would have rendered no row for it and the next Save would have written a visibleWidgets without it, switching the rail off for a user who never asked. ALL_WIDGET_IDS, DEFAULT_WIDGET_ORDER, DEFAULT_VISIBLE, WIDGET_STORAGE_KEY and loadWidgetPrefs() now live in one module both read.

  • Tiered plans that actually differ (worker/src/plans.ts, plan.ts, apitoken.ts, routes/api-tokens.ts, routes/import-sources.ts, routes/receipts.ts, components/BillingPlans.tsx; decisions in docs/plans/billing-tiers.md). Basic, Advanced and Ultimate carried identical feature flags — only profiles, receipts and reminders differed — so the page asked 3x the money for more of the same. PlanFeatures gains apiAccess, automatedImports and prioritySupport; PlanLimits gains apiTokens and receiptMaxMb. Reminders drop from 2 000/20 000 to 500/2 000/unlimited: a household on top of every bill sends about thirty a month, so the old numbers advertised a cost we would have eaten if anyone had believed them.

  • API access is enforced, not just advertised. POST /api/account/api-tokens and the MCP server had no plan check at all, so a Free account could drive the whole product from a script. Minting now requires apiAccess and counts live tokens against the plan's cap — live only, so revoking one frees its slot and rotating never needs an upgrade. The check also sits in verifyApiToken, on a column joined into the query it already ran, so a downgrade or a lapsed subscription closes the API instead of leaving whatever was minted while paying working for ever.

  • Scheduled imports are an Advanced feature. Gated at the write, and only when the request actually sets a non-manual schedule — renaming a source that is already daily must not 402 on a field the body never mentioned. Manual import stays free: it is the user's own file.

  • Receipt upload size is per plan (5/25/50 MB), because upload size is bandwidth and R2. RECEIPT_MAX_BYTES stays as the floor a plan with no cap falls back to.

  • The plan cards are cumulative. addedRows diffs a tier against the one below and renders only what changed, under an "Everything in X, plus" line. At nine rows a flat list was a wall the reader had to diff by eye. Four generated backgrounds (public/plans/card-<tier>.webp, 3-15 KB each) sit behind the cards in the badges' own language — navy, hairline rings, azure warming into gold as the tier climbs. Two things had to be right and were not at first: the card set the background shorthand inline, which resets background-image to none at a specificity no stylesheet rule can reach, so the art rendered as literally nothing (measured: getComputedStyle().backgroundImage === 'none', and an on/off screenshot diff of exactly 0); and the sources were landscape while a plan card is a 200px column, so cover would have shown a slice of empty navy. The card now sets background-color, and the art is cropped to the ring cluster. On/off diff is now 7.2% RMSE. Scoped to the dark theme: the art is 8-16% mean luminance, so under a light card it would put dark text on a dark field. A light set is a follow-up, not a silent compromise.

  • Worker fixtures that exercise API tokens, MCP and import sources now seed a paid plan. They were creating users with no plan, which defaults to Free — the new gates were right to refuse them.

  • A timeline of what has been earned, above the gallery (components/BadgeTimeline.tsx and its module CSS, wired into features/Progress.tsx). At thirty-four badges one flat grid buries the lit ones among the dim, and it answers "what is there to get" while never answering "what have I done". The strip groups unlocks by earnedOn — the month the rule was met, not unlockedAt, the moment the app noticed — so a profile that imports five years of statements reads as five years of history instead of one very busy afternoon. Oldest first, because a timeline reads forwards. The connecting rule is drawn on the stop's dot with a ::before, not behind the row, so it never crosses the medal art.

  • The gallery sorts earned first within each band (inBand in Progress.tsx), so a band shows what was done at the top and what is left underneath. The headings say so: "What you have earned" over the timeline, "Every badge" over the gallery.

  • The progress-page test scopes its badge count to the gallery section, since the timeline now draws a medallion of its own for each earned badge.

  • Ten badges people will chase, and loans in the evaluator (core/achievements/definitions.ts, evaluate.ts, achievementsStore.ts). The set was complete but characterless: everything in it was earned by simply continuing. These are the ones with a story. The comeback is the important one — a tracked month after a gap of two or more, once there had been a run of three — because it is the only badge that makes returning read as progress rather than as failure; it is dated to the month tracking resumed. Alongside it: Clean sweep (a month both fully categorised and fully under budget, the intersection of the two month lists that already existed), Reconciled, Ahead of plan (a reached goal whose deadline has not passed — we cannot know when it was reached, so a live deadline is the honest proxy, and the record only ever adds), The full picture, A perfect year, Six months under, Rainy day (a reached goal worth three times the profile's own average monthly spend), Every month of a year (a calendar year, not a rolling streak) and Debt free.

  • Debt free needs the amortisation, not a balance. Loan has no current-balance column, so the rule runs calculateSchedule + payoffDate from core/loanCalculator.ts and asks whether the schedule ran out before today — which means a prepayment that finishes a mortgage early earns it early, as it should. GET /loans omits rate_periods and prepayments (worker routes/loans.ts adds them only on the single-loan route) and LoanSchema was a plain z.object, which strips unknown keys, so both are now optional fields on the schema and the model. achievementsStore.loadLoans fetches the list and then one detail per loan, and makes no request at all when a profile has none.

  • Nine more badges and a fourth band (core/achievements/definitions.ts, evaluate.ts, components/badgeGlyphs.ts, BadgeMedallion.tsx). The ladder no longer stops at Two years: Three years joins Mastery and a new Legacy band holds Five, Ten and Twenty years plus Twenty thousand entries. BANDS gains legacy at four rings, and the Progress page needed no change because it already iterates Object.keys(BANDS). Volume is the second axis, from VOLUME_STEPS (100 / 1 000 / 5 000 / 10 000 / 20 000): monthOfNth sorts the dates and reads the nth, so importing ten years of statements dates the hundredth entry to the month it actually happened rather than to today — the same rule the rest of the set follows. Volume counts every transaction, tracked month or not, so a two-entries-a-month profile still earns them. public/badges/face-legacy.webp is a fourth generated aurora face, gold-dominant (mean RGB 54/36/24 against mastery's 41/49/74) and blank in the middle like the others, so the glyph is still vector.

  • Progress page (frontend/src/features/Progress.tsx, core/achievements/advice.ts, review.ts, components/BadgeRail.tsx). Sidebar entry after Bills. Nothing fetches: the achievements store keeps its loaded arrays in a snapshot signal and the page computes advice and the year in review from it. buildAdvice is pure and ranked (budget drift, goal pace, in the red, uncategorised, unbudgeted category, streak at risk); each card has a stable id so a dismissal sticks, and dismissals live in the same achievements settings key as the unlocks, so there is no migration. BadgesPanel and StreakChip are deleted: the panel's markup is now the page's badges section, and the dashboard shows BadgeRail, a sideways scroller of earned badges with a link to the page. Settings and the unlock toast both call setPage('progress'). BadgeMedallion gains the generated aurora face (public/badges/face-<band>.webp, one per band, about 20 KB each); face="plain" keeps the drawn one for tests and as a fallback. Plan: docs/plans/progress-page-plan.md.

  • Achievements (frontend/src/core/achievements/*, core/achievementsStore.ts, components/BadgeMedallion.tsx, BadgesPanel.tsx, StreakChip.tsx, AchievementsHost.tsx). One pure evaluator (evaluate.ts) over the profile's transactions, budgets, goals and import logs; a tracked month is three or more transactions dated inside it; the streak is the run of tracked months ending this month or last. Unlocks are { id, earnedOn, unlockedAt } records kept as JSON under the profile settings key achievements, not a table: fifteen rows did not justify a migration, a route and four backup sites, and settings are already per profile, in both storage modes and in every backup. api.ts dispatches tc:data-changed after any non-GET, non-settings request; AchievementsHost debounces that into a refresh, and the first evaluation on a history toasts once as a summary. Art is the SVG ring recipe from the gallery page (disjoint-colliders gallery-viewer/token-circles-badges.html); the share card is rendered client-side from the same SVG. Plan: docs/plans/achievements-and-badges-plan.md.

  • Marketing stills: no verify-email banner, year-to-date transactions (frontend/scripts/gen-marketing-shots.mjs). The fixture account never verifies its email, so VerifyEmailBanner sat above every frame; the init script now sets its per-tab dismiss key (tc:verifyEmailDismissed in sessionStorage) and the shot loop fails loudly if the banner is on screen anyway. The transactions frame navigates to #transactions?period=ytd — the current month has only a handful of rows early in the month, and the frame's minimum is five.

Fixed

  • A tour step navigating to a lazily-loaded page flashed the "target missing" banner (Spotlight.tsx, new __tests__/spotlightLateTarget.test.tsx). Two effects race for the same state: the step-change effect resolves the anchor with a MutationObserver and a 6s budget, calling showTargetMissing() only when that budget expires — while updatePositions, which runs from a 100ms timer and from every resize and scroll, was calling setTargetMissing(true) the instant querySelector came back empty. On a page whose chunk had not mounted, the second won first and the banner appeared over a step that resolved milliseconds later. updatePositions now only hides the highlight; raising the banner belongs to the one effect that knows how long it has waited. Found by the pre-release tour walk, which reported MISS step 1: Settings 97x50 [target-missing banner] — a spotlight with a real measured rect and the banner, which is the shape of this race. The step passes in isolation; it needs the full 15-tour walk to be slow enough to lose.

Changed

  • The bottom of the transactions table (TransactionTable.module.css, TransactionSummaryBar.module.css). Three faults stacked into one ragged corner: every tbody tr drew a border-bottom, the last one included, so a straight 1px rule ran across the card's var(--radius) (14px) bottom and stopped dead where the corner curved away; the card had box-shadow but no border, which on the dark themes is no visible edge at all; and the page-summary bar sitting flush beneath it used border-radius: 6px against the table's 14px. Now: tbody tr:last-child td { border-bottom: none }, a 1px solid var(--border) on the table, var(--radius) on both summary-bar variants, and 12px between the blocks.

  • The Progress page's band headings carry their own rule (Progress.tsx, ProgressPage.module.css). .band had a flat border-top: 1px solid var(--border) — the plain grey line the OrbitalDividers above had just replaced. The line is gone; the heading row gains a .band-rule strip running out of the label in --primary through --accent-warm, fading before the hint on the right — the medals' own azure-into-gold. Deliberately quieter than an OrbitalDivider: these sit one level below the page's sections, so no arc and no planets.

  • The sidebar's Progress glyph (App.tsx). It drew a pie wedge and a three-bar chart overlapping in the same 24 units and read as neither. Replaced with a line climbing inside its axes, arrow corner at the end — distinct from Savings Goals (the bare trending-up line, no axes) and from Budgets (bars).

  • Save & Close is in the Views modal header (Dashboard.tsx, DashboardSettings.tsx, DashboardPage.module.css). DashboardSettings grew a registerSave prop mirroring the registerReset it already had, so the host modal renders the button without knowing how saving works. The footer button stays — the widget list scrolls, and whichever end you finish at should have a way out.

  • The Progress page's section headings are OrbitalDividers (features/Progress.tsx), the same orbit-arc separator every other section-bearing page uses; they were plain <h2> rows. The hint text moves to the divider's meta slot and "Restore dismissed" becomes an OrbitalAction. Each <section> swaps aria-labelledby for aria-label — the divider owns its own heading and the old ids no longer exist. progressPage.test.tsx needed a matchMedia stub, since the divider asks about prefers-reduced-motion on mount (tagsPage.test.tsx has the same stub for the same reason).

  • The badge rail no longer touches the cards below it (BadgeRail.module.css). It carried no bottom margin at all, so the rail and the first chart card read as one block; it now has 20px, against the period bar's 16px above it.

Fixed

  • The dashboard's period bar stopped pinning. #534 put <PeriodBar> and the streak chip in a shared .periodRow flex wrapper; position: sticky only travels inside its own parent's box, so a wrapper sized to the bar pins it for zero pixels — the exact failure PeriodBar.module.css warns about at the top of the file. Nothing went red because the dashboard fixture was a little shorter than the 720px viewport, so sticky-period-bar.spec.ts hit its pageIsScrollable guard and skipped the dashboard case. #536's badge rail made the page taller, the case ran for the first time in two merges, and the bar was measured 402px above the viewport. Dashboard.tsx now renders the bar and the rail as siblings of the page container, .periodRow is gone, and BadgeRail.module.css carries the 12px the row used to supply. Two things stop it recurring: the three pinning cases are tagged @smoke, so a pull request runs them instead of only main, and the describe pins a 560px-tall viewport so every page under test is scrollable and the guard stays a guard.

  • Thirty-four styles.* references pointed at classes their CSS module never declared. A module exports only what its stylesheet declares, and a miss is silent — styles.whatever is undefined, the attribute renders class="... undefined" or nothing, and neither tsc, eslint nor the build says a word. Auditing every reference in frontend/src against the export map vite actually produces turned up thirty-four across twelve files, in three kinds. Wrong name: ChartWrapper asked for chartTall/chartMedium/chartShort while ChartContainer.module.css writes .chart-container.tall/.medium/.short, which export as tall/medium/short — so the variant prop had never applied a class (invisible today, since both Dashboard call sites also pass an inline height that outranks it). Rule missing: AnalyticsPage.module.css had no .empty-state at all, so six empty and loading states rendered as bare text in a panel's top-left corner; Goals' category modal, a copy of Bills', never got .btn-link or .color-input copied with it, leaving "+ Add Category" a native grey button and the colour field at the browser's ~50x25px default; Import's paste tab put .form-control on a select and a textarea against a module with no such rule. All three added, matching the existing house rules verbatim. Vestigial: the seven transaction-table headers asking for a base .col (.transaction-table th already styles them), Loans' three icon buttons asking for a base .btn under standalone .btnSm/.btnGhost, the budget-alert ok state, BillCalendar's paid row (already showing "Paid" and a green check), Spotlight's three placement classes (placement is computed into an inline style), and single dead references in App, OverviewDeck, Accounts and Tags — removed, several of which had been emitting a literal undefined class into the DOM. TwofaSettings' layoutStyles.btnDanger ?? layoutStyles.btnSecondary is left as is: it already degrades on purpose, and whether the shared button system should grow a danger variant is a design call.

  • The app never linked Privacy or Terms. about.tokencircles.com/privacy and /terms exist and are real (operator, sub-processors, updated 2026-07-14), but a grep of frontend/src found no link to either — not on the sign-in screen, not in Settings. components/LegalLinks.tsx (new) renders both as absolute links (target="_blank" rel="noopener noreferrer") and exports the URLs; it sits in the sign-in footer next to Support and in Settings → About under Support. A case in loginScreen.captcha.test.tsx pins the sign-in screen having them, since that is the screen that was missing them.

  • The dev deployment and both API hosts were indexable. Search Console reported api.dev.tokencircles.com/ as a 404 — it had crawled an API host (found through certificate transparency, most likely) because nothing told it not to. Auditing every host: dev.tokencircles.com served prod's robots.txt (Allow: / plus prod's sitemap), so a full second copy of the app was open to ranking; the API hosts served Cloudflare's managed "content signals" file with no Disallow; and no host sent X-Robots-Tag. The 404 itself was correct — there is no root route — it was the crawl that should never have happened.

    • frontend/src/crawlerPolicy.ts (new) is a Vite plugin gated on mode === 'production'. For every other build — --mode dev, which both the dev deploy and PR previews use — it injects <meta name="robots" content="noindex, nofollow">, overwrites robots.txt with Disallow: /, and appends an X-Robots-Tag block to _headers. Three signals because they have three consumers: the meta for renderers, robots.txt for the crawl gate, the header for every non-HTML asset. It runs in closeBundle, not writeBundle: Vite copies public/ — which holds prod's Allow: / — into dist/ after writeBundle, so an earlier hook would write the Disallow and then watch the Allow land on top of it. Verified by building both modes. Prod emits nothing, so public/robots.txt stays the single source of truth there.
    • worker/src/index.ts: a middleware sets X-Robots-Tag: noindex, nofollow on every response in a finally, so 404s from notFound and handler-written 4xx carry it; onError sets it again explicitly, because the response it builds replaces the one the middleware stamped. GET /robots.txt returns Disallow: / as the courtesy copy — Cloudflare's managed robots.txt prepends its block to whatever the origin serves there, and the Disallow survives.
    • Tests: worker/test/crawler-policy.test.ts (200, 404, unauthenticated 4xx, robots.txt) and frontend/src/__tests__/crawlerPolicy.test.ts (both modes, the _headers merge, apply: 'build').

[5.13.1] — 2026-09-01

Changed

  • Sign-in screen relaid out (LoginScreen.tsx, new LoginScreen.module.css). Inline styles moved to a CSS module, matching the rest of the components, and the structure changed in four ways:

    • Labels above every field. A placeholder is not a label — it disappears the moment you type, so a half-filled form stops saying what its fields are, and assistive tech has nothing to announce. Forgot password? now sits on the password label's own row rather than floating under the input.
    • The captcha is invisible unless it wants a click. Turnstile gained an appearance prop and the screen passes interaction-only. Cloudflare then renders nothing while the challenge passes silently, which is nearly always.
    • The submit button is no longer gated on a captcha token. It could not stay that way: with no widget on screen, a disabled button has nothing to explain it. Submit awaits the token instead, via a captchaToken() helper wrapping the existing waitForTurnstileToken — normally already resolved, since the challenge finishes long before a password is typed. The "checking your browser" hint now shows only while a submit is genuinely parked on it.
    • One account line, below the alternatives. "Don't have an account? Create one" was above the Google/passkey buttons it competes with, and "Try the demo" was a separate underlined link at the bottom. They are now one line under the alternatives, and the demo is described as what it is — "Continue with no account" — since "demo" is jargon for using the app without signing up.

    The footer's two stacked rows (support link, then version) are a single two-column row. Both rules — the or separator and the footer's — are brand gradients rather than flat hairlines: the or fades up to the logo blue from each side toward the word, and the footer's is the same blue strongest at the centre and gone by both edges, drawn as a pseudo-element since a border cannot hold a gradient.

    The register transition no longer says "Account created". /api/auth/register returns the same neutral response whether or not the email existed — that is the anti-enumeration guarantee — so the screen cannot know which happened, and claiming creation tells an existing owner something untrue. It says "Signing you in…", which is what both branches actually do.

    Two Turnstile details worth keeping: Cloudflare only decides an interaction-only widget's visibility on its first execution, so a later reset() can never make a hidden one appear — retry() removes and re-renders, which is why it still works. And the widget's container drops its fixed margin in that mode, or an empty box would reserve a permanent gap for something that usually never renders. The component's own "blocked" panel is our markup, not Cloudflare's, so it still appears when the script is blocked.

    Covered by components/__tests__/loginScreen.captcha.test.tsx: the button stays usable with no token, the request still carries one (waiting if needed), the hint appears only once a submit is blocked, both labels are bound to their inputs, and the account line follows the alternatives.

  • Subscriptions view redesigned around filter pills and compact cards (Bills.tsx, SubscriptionCard.tsx). The per-category collapsible sections are gone; a pill row (All · one per category · Paused) filters one flat gallery, with the pure filtering/grouping logic in features/subscriptionFilters.ts (unit-tested). One label rule everywhere: category_name || category || matchBrand(...).defaultCategory — the old view grouped by the brand default while cards showed the user's category, so a card could sit under a heading that didn't match its own pill. Cards are single-row (36px brand icon · name + category/date · amount + due countdown) with exactly two controls: a mark-paid icon button and a "…" menu (new reusable components/OverflowMenu.tsx, portalled to <body> because cards clip with overflow: hidden and glass panels carry backdrop-filter; closes on select/Escape/outside press/scroll). Delete moved behind the menu and confirms via showConfirm({ danger: true }) instead of ConfirmButton.

Security

  • The support contact form was not captcha-gated (routes/support.ts, SupportContact.tsx). The route's own comment admitted it — "Turnstile will gate this too once wired (backlog #4)" — leaving an unauthenticated endpoint that sends two emails per accepted request: the relay to the private inbox, and an acknowledgement to a caller-supplied, unverified address.

    The only control was enforce(support:<ip>, 5, 3600). A per-IP cap does not bound this: rotating IPs walk straight past it, and the cost lands on the sending domain's reputation — which is precisely what puts recipients on Resend's suppression list, the failure this same release is cleaning up after. Content injection was already handled (the ack deliberately never echoes the submitted message back, so it carries no attacker-chosen payload).

    Now gated by verifyTurnstileDetailed + captchaRejection, the same pair the auth routes use, checked before any work so a forged token never reaches the mail provider. The client renders the widget as interaction-only and awaits the token on submit rather than disabling the button, so in practice nothing is visible unless Cloudflare wants a click. The per-IP and per-recipient limits stay as defence in depth.

    worker/test/support-captcha.test.ts covers it — and was checked against a build with the gate removed, where three of its four cases fail. The fourth (no mail on a forged token) was vacuous at first: without RESEND_API_KEY in the test env, sendMail short-circuits before calling out, so it passed with or without the gate. The env override sets one.

Fixed

  • A delivered-looking support request that was never delivered (email.ts, routes/support.ts). sendMail returned { sent: true } for any 2xx from Resend, and support.ts reads that as "the relay went through" — it is the condition gating the acknowledgement mail to the sender. But a 2xx only means Resend accepted the message. A recipient on the account suppression list (anything that has previously hard-bounced or drawn a complaint) is accepted and then dropped at delivery, so the sender got "we received your message" while the support inbox got nothing.

    Nothing in the send response reveals that, and there is no synchronous way to find out — so this logs what it can instead: sendMail now returns Resend's message id and logs it, and support.ts logs it beside the ticket id. That pairing is the only handle tying a request to its row in the Resend dashboard, where the real status and the suppression reason live. It does not make delivery reliable; it makes a lost message findable.

    The suppression itself is account state, not code — it is cleared from the Resend dashboard (open the email, "Remove from suppression list"). Ruled out while diagnosing: resend._domainkey is present on the root domain, send.tokencircles.com carries the SES return path, and DMARC is p=none, so this was never an SPF/DKIM/DMARC failure. The domain's MX is Cloudflare Email Routing, which forwards rather than hosting a mailbox, so a missing or unverified route for the support address is the likeliest origin of the original bounce.

    Durable delivery wants the support request persisted to D1 before the email is attempted, which the route's own comment already flags as the intended direction; that needs a migration and is left to its own change.

  • A bill marked paid read back as unpaid (core/storage/handlers/bills.ts). The serverless handlers disagreed with themselves about which calendar a stored date is in. billsPayOrMarkPaid wrote new Date().toISOString().substring(0, 10) — a UTC date — while isBillPaidForCurrentPeriod compared it back with .getMonth(), which is local. A bare YYYY-MM-DD parses as UTC midnight, so west of UTC its local month is the previous one.

    Two independent defects, and the write is only half of it. West of UTC the read alone breaks: on the 1st of any month a bill marked paid was reported unpaid the instant it was saved, so the mark-paid button stayed clickable and the bill never left the list. East of UTC the write breaks too, between local midnight and the UTC rollover — which is how it was caught, at 01:50 CEST on 1 September.

    Both sides now use the local calendar: isoDate() to write, and a new parseLocalDate() — its inverse, added beside it in utils/period.ts — to read. isoDate already carried the comment "avoids the UTC off-by-one from toISOString()"; the bills handler simply never used it.

    Two more instances of the same mismatch in the same file went with it: the month calendar took a bill's day-of-month from new Date(due_date).getDate() (drawing a bill due on the 15th on the 14th west of UTC, and dropping one due on the 1st out of the month entirely), and daysUntil measured from a UTC-parsed midnight against a local instant.

    The worker is not affected and is deliberately left alone. worker/src/routes/bills.ts has the same-shaped code, but the Cloudflare runtime is UTC, so its write and its read are on one calendar. Verified rather than assumed: a probe in the workers pool reports getTimezoneOffset() === 0 and parses 2026-09-01 as month 8 even with the host at America/New_York. It remains timezone-blind — it decides "this month" in UTC rather than in the user's zone — but that is a separate question needing the user's timezone, not this bug.

    Regression coverage in localHandlers.billsPaidDate.test.ts pins both the zone (process.env.TZ, self-verified via getTimezoneOffset()) and the instant (vi.setSystemTime, faking Date only so fake-indexeddb keeps real timers). It has to pin both: the bug needs the UTC date and the local date to fall in different months, which is why an ordinary mid-month run never caught it — and why CI never did either, its runners being UTC.

  • localHandlers.recurring.test.ts only passed on UTC runners (test-only). It seeded next_date from new Date().toISOString().slice(0, 10) while recurringPopulate compares against isoDate(new Date()) — the very anti-pattern that handler's own comment warns about. West of UTC the test therefore seeded tomorrow, the idempotency guard fired, and all five balance tests failed with 409. The handler was correct throughout; only the fixture was on the wrong calendar. The full suite now passes under TZ=America/New_York and TZ=Pacific/Auckland as well as UTC.

  • Every page load replayed the whole stored error log to the console (core/logger.ts). flushLogs() ended with trimmedLogs.forEach(writeLogToConsole) — and trimmedLogs is the buffer merged with everything already in localStorage, not just the new entries. initLogging() flushes on boot, so each reload re-emitted up to MAX_LOGS (500) past errors. Errors also flush immediately (addLogEntry), so a new one printed twice: once live from log(), once from the flush.

    The replay is convincing because it looks live: timestamps hours apart arrive in one burst, each carrying the stack of the flush that reprinted it rather than of the call that failed, and reloading "reproduces" it every time because the source is storage. This cost a real investigation — login-screen /profiles and /categories failures with Cannot read properties of undefined (reading 'routeApiRequest') were read as a live storage-mode desync, when they had happened once, hours earlier, in a mode the app had since left. An incognito window (empty app_logs) showed the truth: the signed-out login screen makes exactly one request, /api/auth/me, which correctly 401s.

    flushLogs() now only persists. The console is written solely by log(), once per entry, as it happens.

  • Production builds wrote to the user's console (core/logger.ts). The level gating was inverted: debug/info/warn were hidden behind the debugMode flag, but error had no gate at all and called console.error in every environment. A console is the user's, not ours, and a shipped app spilling internals into it is noise at best.

    Console output is now decided in one place, shouldWriteToConsole(): production writes nothing; development keeps warn and error; debugMode turns everything back on in any build, so a production report is chased with "enable debug mode, reproduce, send the log" rather than a special build. Follows the import.meta.env.DEV || localStorage flag pattern already used by CalcTracer.tsx.

    None of this changes what is recorded — every level is still stored for the LogViewer behind Settings → View Logs, which is the supported way to inspect a problem. core/__tests__/logger.test.ts covers both halves of that split: the console stays silent in production while getLogs() still returns the entries, and boot no longer replays history.

  • A passkey that cannot be used here failed silently (core/webauthn.ts). The platform reports "you cancelled", "no credential matches this site" and "the prompt timed out" as one indistinguishable NotAllowedError — deliberately, so a site cannot probe which passkeys you hold. isAbort() lumped it in with AbortError, and the callers hide aborted results (else if (!result.aborted) setError(...)), so pressing "Sign in with a passkey" while only another domain's passkey was saved did visibly nothing.

    isAbort() now means only AbortError — a request this code called off itself (the explicit button aborts the pending conditional one), where no human ever saw a prompt. NotAllowedError is handled separately: an explicit press always returns a message naming the cause the user can act on, while the background autofill request stays aborted so it can never paint the form on page load. Registration keeps treating it as a cancel — creating a NEW credential has no "belongs to another site" case. Covered by core/__tests__/webauthnNoMatchingPasskey.test.ts.

  • An unreachable API crashed the app at the login screen (core/webauthn.ts, components/LoginScreen.tsx). postJson awaited apiFetch bare, so a network-layer failure (offline, DNS, a CORS preflight the browser blocks) rejected with TypeError: Failed to fetch instead of returning a Response. LoginScreen's onMount fires the conditional-mediation passkey autofill as void signInWithPasskey({ conditional: true }).then(...) — a .then with no .catch — so that rejection went unhandled, reached the global handler and painted "App Crashed" over a login screen that was otherwise fine. Regression from the passkeys work in 5.13.0: before it, nothing called the API from onMount at the login screen.

    Fixed at the source (every passkey call now reports a network failure as ok: false with "Could not reach the server") and hardened at the call site (the floating chain has a .catch). Covered by core/__tests__/webauthnNetworkFailure.test.ts.

    This is why PR preview deployments showed "App Crashed": preview frontends are built with build:dev (VITE_API_URL=https://api.dev.tokencircles.com) and served from a unique <version>-finance-manager-preview.<account>.workers.dev origin, which the dev Worker's fixed CORS_ORIGIN (https://dev.tokencircles.com) does not allow — so every preview's first API call fails the preflight. Previews are still API-less by design (use serverless/local mode there); they now land on a working login screen instead of a crash page.

  • Auto sync surfaces execute-step failures (ConnectedSources.tsx). importFlow.handleImport catches every error into flow.error() and never calls onImported, but autoSync only read flow.error() after the fetch step — a rejected /api/import/execute (422 validation, 500) ended with the spinner stopping and no message at all. Auto sync now checks flow.error() after handleImport and toasts it. Regression test: frontend/src/features/import/__tests__/connectedSources.autoSyncError.test.tsx mounts the real component over a mocked apiFetch and asserts a failed execute produces exactly one error toast (and a successful one none).

  • Mark-paid transactions were stamped USD (worker/src/routes/bills.ts). The INSERT omitted currency/amount_local, so the schema default (currency TEXT DEFAULT 'USD', 0001_init.sql) applied — an EUR profile saw a converted-from-USD estimate on every bill payment while the Bills page showed the same amount in EUR. Now mirrors the recurring cron: currency = the profile's configured base (configuredBaseCurrency, newly exported from base-currency.ts; EUR fallback) and amount_local = amount. Covered by worker/test/bills-mark-paid-currency.test.ts.

  • A paid subscription kept its clickable "Mark Paid" button. GET /api/bills computes paid per period, and the route 409s a second mark-paid — so after paying, the button could only produce "Failed to mark bill as paid". The card now swaps the action for a Paid badge (subscriptionCard.test.tsx pins this).

  • Pause/Resume failed in serverless mode. togglePause (formerly pauseSubscription) echoed the whole GET row back into PUT /api/bills/:id; seeded rows carry recurring: 1 (number) which fails the router's z.boolean() validation. Both backends treat PUT as partial, so it now sends only { is_active }.

[5.13.0] — 2026-08-31

Added

  • Remote MCP server at POST /mcp, plus a bearer-authed account API. Stateless streamable HTTP JSON-RPC (initialize / tools/list / tools/call / ping), 15 tools across read, write and import scopes. Tokens are tc_pat_-prefixed, stored as a SHA-256 hash (migration 0027_api_tokens), and minted from cookie-authed routes under /api/account/api-tokens.

    • Auth is an allow-list, not a widening of authenticateRequest. A bearer token reaches /mcp and /api/v1/* and nothing else; a regression test asserts it still gets 401 on /api/transactions, /api/accounts and /api/billing/status.
    • File bytes never travel through a tool argument. A model emitting a base64 spreadsheet token by token is slow, costly and truncates, so prepare_import returns a 15-minute HMAC-signed capability URL bound to one purpose, and the bytes go over plain HTTP. The same applies in reverse for export_snapshot.
    • Cross-user isolation is asserted table-driven over the live tool registry, so a new tool is covered the moment it is registered.
  • POST /api/v1/import runs the bank adapters before falling back to generic CSV. The generic path guesses a mapping from row 1, which assumes an already app-shaped file: header on the first line, one signed amount column, UTF-8, comma-separated. An Erste export is none of those — Windows-1250, semicolon-delimited, a bank preamble above the header, and debit/credit split across Isplate/Uplate — so it was refused 422 while the Bank Imports tab accepted it. ?bank= forces an adapter, ?account= names the target account, and the response and import log both record which parser ran.

  • Passkeys (WebAuthn), and they replace the 2FA prompt rather than adding to it. Migration 0030, @simplewebauthn/server, worker/src/routes/passkeys.ts. A passkey proves possession and user verification in one gesture, so a successful assertion mints a full session with no TOTP step — the point of the feature for anyone who never enabled 2FA. Registration is sudo-gated the way GitHub does it: a session younger than 10 minutes passes, otherwise the password or a 2FA code is re-presented (registrationAllowed), or a stolen cookie could silently add a permanent second credential. userVerification: 'required' on both ceremonies, a UNIQUE credential id (409 on replay), counter regression logged distinctly from a failed assertion, and 10 passkeys per account. The RP id comes from CORS_ORIGIN and fails closed — never from the request URL, which an attacker controls. Conditional mediation puts passkeys in the email field's autofill; the explicit button aborts that pending request first.

  • TOTP two-factor with recovery codes. Migration 0028, worker/src/totp.ts (RFC 6238, HMAC-SHA1, ±1 step drift) plus a per-user high-water mark so a code cannot be replayed inside its own window. The QR is rendered in-page with uqr: the secret must never reach a third party, which rules out every hosted chart API. Ten single-use recovery codes, stored hashed. Enabling deletes every OTHER session, and disabling is rate-limited — it is a credential check, and without a budget it is an offline-grade oracle reachable online.

  • Email-code sign-in, bound to the browser that asked for it. Migration 0029 plus a signed httpOnly ceremony cookie (fm_logincode) carrying the code id and address. That binding is what makes the rest safe: brute force cannot be spread across addresses, the per-address verify bucket (a trivial lockout DoS) is gone entirely, and codes burn after 5 attempts with at most 3 live per account. The send goes through waitUntil, so response time does not reveal whether the address exists, and an unknown address does the same hashing work.

  • Settings → API access: create, inspect and revoke personal access tokens. The MCP server above landed with no way to mint a token except a hand-written fetch from the browser console. frontend/src/features/ApiAccess.tsx drives the three cookie-authed endpoints.

    • The reveal is a modal that only an acknowledgement closes. The worker returns the secret exactly once and keeps only a SHA-256 hash, so a value shown in a table row would be lost to a stray refresh. A backdrop click deliberately does not dismiss it; a test pins that.
    • The tab is hidden in serverless mode. apiFetch answers from IndexedDB there and never reaches a Worker, so a token would authenticate nothing. The rule moved into settingsStore.isTabVisible, which also now covers the pre-existing billing gate.
    • The default-profile picker is a safety control, not a convenience. The MCP tools resolve "token default, then the FIRST profile", so an unpinned token silently acts on whichever profile sorts first once you have more than one.
    • GET /api/account/api-tokens now returns scopes as an array. They are stored stringified, and passing that through made every client JSON.parse a field of an already-parsed response; a row that does not hold an array degrades to no scopes rather than failing the whole listing. parseScopes in apitoken.ts is that one tolerance rule, shared with the bearer-auth path so the two can never disagree about what a token may do.
    • A failed refresh is never reported as a failed mutation. Both handlers used to await the list reload inside the mutation's try, so a 500 on the reload toasted "Could not create the token" over a modal displaying a live, unrecoverable secret — and made a successful revoke look like a failure, sending the user to retry against a token that was already dead. Revoke is now idempotent server-side (COALESCE(revoked_at, …)) for the same reason.
    • The reveal is portalled to <body>. It sits in a Settings card whose backdrop-filter makes the card a containing block for position: fixed, which trapped the overlay inside the card and left the rest of the page uncovered and clickable. Focus now moves to the acknowledge button, which is the dialog's only exit.
    • The profile pin re-seeds on a profile switch. Pages stay mounted, so an open panel kept the previous profile's id and minted tokens against it — the exact accident the control exists to prevent. A /api/profiles failure now surfaces instead of silently unpinning.
    • A failed listing says so. It used to render "No tokens yet.", which to someone who came to revoke a leaked token is a lie with consequences.
    • Minting is rate-limited (20/hour) like every other credential-issuing route — an API token deliberately survives sign-out-everywhere, so a burst mint from a stolen cookie cannot be undone by revoking the session. expiresAt must now parse and be in the future: it was passed through on typeof === 'string', and verifyApiToken's getTime() <= now is false for NaN, so "30d" minted a token that showed an expiry and never expired.
    • Account deletion deletes api_tokens explicitly. D1's cascade does fire, but account.ts states it does not rely on cascade, and every other user-scoped table is listed there.

Changed

  • The bank-import core moved to shared/bankImport/. Detection, parsing, the nine adapters and the canonical table were under frontend/src/, so only the browser could reach them; they are pure TypeScript, so both runtimes now import the same code rather than forking it. Browser persistence (memory.ts, rulesStore.ts) stays in the frontend. The barrel re-exports the same 42 names, unchanged.
    • shared/ sits at the repo root and xlsx is installed under frontend/ and worker/, so a bare import from shared/ does not resolve. Rather than hoist a package to the workspace root, BankAdapter.parse takes an optional third argument carrying an xlsx loader and each runtime supplies its own () => import('xlsx'); the eight adapters that parse text are untouched.

Fixed

  • API-imported rows were left with account_id NULL. executeImport creates an account only for a name the caller marks as one — the app marks them from the import preview's tick-boxes — and the endpoint marked nothing. A real 94-row Erste statement reported "94 imported, 0 skipped" while every transaction belonged to no account and appeared in no balance or report. The account ?account= names is now created and linked; on the generic path, minting accounts from arbitrary means-of-payment values stays opt-in behind autoCreateAccounts=true.
  • parseDateString accepted any year the JS Date parser invented. new Date('REF-88213') is not an error, it is 1 January year 88213 — the parser scavenges a number and calls it a year — so an unmapped bank reference column imported as transactions dated eighty-six millennia out. The free-form fallback is now bounded to 1900–2200; ISO and dd/mm/yyyy inputs are handled by earlier branches and are unaffected.
  • list_transactions never terminated a full pagination walk. truncated compared the page size against the total row count, which cannot distinguish a full last page from a full middle one: 18 rows at limit 6 left page 3 reporting more to come with a cursor that returned nothing. It now fetches one row past the page.
  • Tool results were measured once but transmitted twice — as structuredContent and as the JSON text block clients without structured support read — so the 200 KB cap delivered ~400 KB.
  • whoami read the settings table with no user filter, relying on profile-id keying to stay correct.
  • The API import no longer shares a rate-limit bucket with the app's own import routes, and a commit that imports nothing still writes an import_logs row — "ran and found nothing new" and "never ran" were indistinguishable.

[5.12.2] — 2026-08-29

Fixed

  • iOS home-screen installs drew the app under the status bar, with white glyphs over it. index.html declared apple-mobile-web-app-status-bar-style: black-translucent alongside viewport-fit=cover. That combination does two separate things in standalone mode, and both hurt:

    • The web view fills the screen, status bar included. body padded env(safe-area-inset-bottom) and nothing at the top, so page content ran underneath the clock. .sidebar is position: fixed; top: 0 with padding: 20px 0 ..., which put the logo and the first nav item squarely behind it.
    • It forces the status-bar glyphs WHITE whatever the theme. dawn-light is --bg: #f7f9ff, so on the light theme the clock and battery were white on near-white. theme-color was the hardcoded #0a0e1c — orbit-dark's background — and nothing updated it on a theme switch, so it described the wrong theme half the time. iOS 26 then glasses that strip, which is the blur in the report; the blur was the symptom, the unreadable overlap was the cause.

    Apple also lists black-translucent as deprecated, so this needed replacing regardless.

    • apple-mobile-web-app-status-bar-style is now default: iOS keeps the status bar out of the page and tints it from theme-color. Every existing calc(56px + env(safe-area-inset-top, 0px)) rule degrades to its pre-notch value, because the inset is then 0.
    • theme-color follows the active theme. public/theme-init.js stamps it before first paint — it has to be there, since by the time core/theme.ts runs the bar is already painted — and syncStatusBarColor() re-reads the live --bg on every switch. setTheme now delegates to applyTheme instead of restating the same four lines, so there is one path that touches the document and it cannot forget the sync.
    • body::before paints an opaque strip of exactly env(safe-area-inset-top). Insurance, not the fix: under default the inset is 0 and it has no height at all. It covers the cases where the inset is not 0 — Safari in landscape on a notched phone, and any future iOS that returns to a full-bleed web view — so the glyphs always have a solid, theme-coloured ground. It is pointer-events: none, because a full-width fixed strip that swallowed taps along the top edge would cause the exact failure it exists to prevent.
    • .mobile-toggle used max(12px, env(safe-area-inset-top, 0px)), which resolves to the inset itself once that exceeds 12px — parking the button flush against the status bar with no gap, and against the notch in landscape. It adds to the inset now. .sidebar pads the top inset for the same reason.

    src/__tests__/statusBarColor.test.ts pins the two colour literals in theme-init.js against the --bg of the theme files they duplicate (the script runs before any stylesheet exists, so it cannot read them), and asserts black-translucent never comes back. Verified to fail on injected drift rather than assumed to work.

[5.12.1] — 2026-08-27

Fixed

  • Transaction filters were sent under names the Worker does not read, so they did nothing. GET /api/transactions reads startDate, endDate and category_ids (worker/src/routes/transactions.ts:183-186). Both typed client helpers — api.getTransactions() and storageFactory.listTransactions() — forwarded the app's own vocabulary (date_from, date_to, category_id) verbatim. An unrecognised query parameter is not an error: the WHERE clause is simply never built, so a "filtered" request returned every row in the profile and reported success.

    It survived because nothing failed loudly and the two parameters that are exercised most, search and type, happen to have the same name on both sides. The date filter also looked right, because the only caller narrows client-side afterwards. Every hand-built call site in the app (clientPdfReports.ts:97, Analytics.tsx:359, Accounts.tsx:79) already used the Worker's names — the typed helpers were the odd ones out.

    • Both helpers now translate to the Worker's names, and getTransactions additionally forwards limit, offset, account_id and reconciled, none of which were reachable through it before. TransactionListParams gained offset/account_id and a note that page, perPage, category_name, profile_id and profile_ids are historical and forwarded nowhere.
    • The unfiltered default is unchanged on purpose. Transactions.tsx:456-461 documents that its cross-page bulk selection intersects against the whole list, so a default limit would make a row outside the window read as deleted and silently unselect it. limit stays opt-in until that is reworked; a test pins the no-argument call as sending no window at all.
  • ?offset= without a limit returned HTTP 500. Found by the tests above, and older than them. SQLite accepts OFFSET only as a suffix of LIMIT, so ... ORDER BY t.date DESC OFFSET 2 is a syntax error rather than a no-op, and the whole request failed. The handler now emits SQLite's own LIMIT -1 ("no upper bound") when an offset arrives alone. Inert values (?offset=0, ?offset=abc) emit no clause at all.

Changed

  • The transaction list no longer runs a redundant COUNT(*) on unwindowed reads. total is the size of the whole filtered set, which differs from what was just returned only when a window was actually applied — unwindowed, the returned rows are the whole set, so the count recomputed a number already in hand. It is skipped when no window reached the SQL. Tests cover both shapes, including that an unwindowed filtered read still reports the filtered count and not the table size.

    Measured, so nobody inherits an overclaim: on a 5000-row profile the unwindowed read went from a 44 ms median to 38–42 ms — inside the run-to-run spread. This removes genuinely redundant work and is worth keeping, but it is not the fix for the "deleting is slow" class of report. The dominant cost is serialising and transferring every row, and that stays until the list is windowed or stops re-reading the world after each mutation (11 call sites in Transactions.tsx). Both are blocked on the cross-page-selection invariant documented at Transactions.tsx:456-461, which is the actual next piece of work.

  • The guided-tour gate reported a dead API as a tour regression. pnpm run test:tours walks every spotlight tour in a real browser and asserts each step highlights a visible element. It assumed the Worker underneath it would outlive the walk. It does not: wrangler dev exits partway through a long run —

    [ERROR] Error in ProxyController: Error inside ProxyWorker
      cause: { message: 'Network connection lost.' }
      at castErrorCause -> emitErrorEvent -> onProxyWorkerMessage
    

    — the ProxyWorker websocket to workerd drops, ProxyController treats it as fatal, and the process goes, measured at durationMs: 104348, roughly 100s after startup. A 15-tour walk always outlives that, so it could never finish inside one wrangler lifetime.

    From the browser's side a dead API is indistinguishable from a broken app: pages render their empty states, spotlights have nothing to point at, and every remaining tour MISSes. The gate duly reported a UI regression that had not happened — five consecutive times, each one really the same crash. That is a defect in the gate, not just bad luck: a check that cannot tell its own infrastructure dying from the thing it is checking cannot be trusted either way.

    • frontend/scripts/lib/worker-supervisor.mjs (new) owns the Worker for the length of a run. It spawns wrangler dev in its own process group — wrangler forks workerd, and killing only the parent leaves that child holding the port — waits on /api/health, and watches it two ways, because neither alone is enough: the child's exit event catches a crash, and a 3s health poll (two consecutive misses, so one dropped probe under load is not a death) catches a worker that wedges without exiting. A wrangler already listening is adopted rather than killed — another terminal's process is not this script's to close — and replaced with a managed one the first time it dies. SIGINT/SIGTERM/exit all kill the group, so a Ctrl-C mid-walk no longer strands a wrangler on :8787.
    • walk-tours.mjs re-walks instead of blaming. A death mid-tour rolls that attempt back wholesale — its steps, its MISSes and its failure lines all disappear — and the tour restarts from step 1 against a fresh Worker, up to three attempts. Before recording any MISS the walk probes /api/health twice; if the API is gone that is a [worker] line and a re-walk, never a failure line. Only a walk that ran end to end on a live API is allowed to say anything about a tour.
    • It recycles the Worker between tours once it is older than WORKER_MAX_UPTIME_MS (default 60000; 0 keeps only crash recovery). A restart costs a couple of seconds, a mid-tour death costs the restart plus a re-walk, so replacing a worker that is about to die is the cheaper trade.
    • Three verdicts, three exit codes. GATE: PASSED / 0, GATE: FAILED / 1 (a real tour regression, listed under "Failures"), GATE: UNPROVEN / 2 (the Worker would not stay up, so those tours were never walked — not a pass, and not a tour failure). Two non-zero exits meaning opposite things is the point; reading the second as the first is the confusion this replaces, so the run says which in words as well as in its exit code.
    • Worker events print on [worker] lines and are counted apart from MISSes: Worker: 1 adopted, 1 start, 1 crash recovered, 1 tour re-walk. None of that is a tour failure.

    There is no version to pin your way out of the crash, which is why the gate has to survive it rather than avoid it. It reproduces identically on wrangler 4.116.0 with stable miniflare 4.20260730.0 (death at 154s) and on the 4.126.0 / miniflare 5 alpha this repo pins (~104s) — same stack, same cause. It is an upstream wrangler dev bug.

    It is also hard to see, which is its own reason for the [worker] lines. The signature above never reaches stdout: all wrangler prints there is an empty [ERROR] marker, and the ProxyController stack goes only to the debug log under ~/.config/.wrangler/logs/ — which .github/workflows/e2e.yml already uploads as an artifact for exactly this reason. Grepping job stdout for "ProxyController" therefore comes back empty on runs that did crash, and has already sent one investigation to a wrong root cause.

    Verified end to end: 15/15 tours desktop and 15/15 MOBILE=1, both exit 0, each run recovering real crashes mid-walk (one at 78s, two more on the mobile pass) without a single false MISS; plus fault injection for the paths that are hard to wait for — a killed worker mid-tour, a wedged worker that never exits, an adopted worker taken over on death, a worker that cannot start at all, and a tour abandoned after three deaths (GATE: UNPROVEN, exit 2, zero steps counted). The tour-check skill is updated to match — the walk no longer wants a hand-started wrangler dev, which drops the setup from three terminals to two, and the skill now says plainly that no CI workflow runs this walk; it is a local gate. The E2E suite is a different job that merely shares the same wrangler dev, which is why one upstream bug surfaces in both and reads as two unrelated problems.

  • CI's E2E suite was a coin-flip for the same wrangler crash. The suite's other job, the one that does run in CI: Playwright started wrangler dev once through its webServer config and never restarted it, so the crash above — a minute or two into a run — turned the API into a 502 for every remaining spec in the shard. A clean run reported 529 passed; an unlucky one reported a hundred failures with no code change between them, and maxFailures: 10 existed only to stop a dead-worker shard grinding for 22 minutes before the job bound killed it.

    • frontend/scripts/serve-worker.mjs (new) is now the Worker's webServer command. It hands wrangler dev to the same WorkerSupervisor the tour gate uses (crash recovery only, no proactive recycling — there is no test boundary this process can see, so a scheduled restart would land under a running spec), stays alive as the server Playwright waits on, and brings wrangler back within a couple of seconds of each death. Its own SIGINT/SIGTERM cleanup kills wrangler's process group, so Playwright's teardown leaves nothing on the port.
    • playwright.config.ts points the Worker webServer at it (migrations still run first, now via pnpm -C ../worker), and CI retries go 1 -> 2: a spec caught in the few-second recovery gap fails, and its immediate retry can land in the same gap before the restart finishes, so the second retry is what clears that residual. maxFailures: 10 stays as an ordinary backstop, no longer the defence against the crash.
    • Verified locally on the real CI path (CI=true, the @smoke subset): the run took two real wrangler exited (code 1) crashes, at 5s and 49s, each recovered in ~1.3s, and finished 42 passed with the single spec caught mid-recovery passing on retry — where before the first death would have failed every spec after it.

    Not fixed here: the crash itself is upstream in wrangler dev and there is no version to pin around it (a full writeup is under the tour-gate entry above). Surviving it is the only lever, and now both jobs that share the Worker do.

  • Delete-with-balance-reversal is now covered for income and for two-account transfers. DELETE /api/transactions/:id reverses the row's effect on every account it touched and removes it in one DB.batch with the DELETE last, guarded by unchangedSince so a delete racing an edit either reverses the amount the row actually has or 409s. The suite proved that for an expense and for a legacy destination-only transfer; a normal two-account transfer was asserted on create only. That is the case with two balances to put back, and the one where a half-applied reversal is hardest to spot — each account still looks individually plausible on its own. Income was unpinned in the same way, and the reversal takes its sign from tx.type, so a flipped comparison would pass one direction and fail the other. worker/test/transactions-balance.test.ts now covers both, the transfer case asserting both balances and that the pair sums back to its pre-transaction total. Both passed against existing code — nothing was broken, it simply was not pinned.

[5.12.0] — 2026-08-26

Added

  • Monthly subscribers can move to annual billing from the plan grid. The worker has been able to do this since the duplicate-subscription fix — POST /api/billing/checkout with a new { plan, interval } moves the existing subscription onto the new price rather than opening a second one. The grid could not ASK for it: mine() in BillingPlans.tsx keyed on tier alone, and the tier either side of an interval switch is the same one, so a monthly subscriber who flipped the toggle to Annual still got "Manage subscription" and no way to act on what they were reading. The expectedInterval plumbing added alongside the interval status field existed for this case and could never fire from the UI.
    • BillingPlans takes currentInterval, fed from billing()?.interval. The Monthly/Annual toggle seeds from it once, in an effect rather than as an initial value — the status arrives after mount, and re-running the seed on every read would drag the toggle back exactly when someone is mid-click on the other option.
    • Monthly -> annual only, deliberately. It is a price increase, so Stripe prorates the difference onto the next invoice and nothing is given back; the card says so under the button. The reverse is a price decrease mid-period, which leaves a Stripe credit balance rather than a refund — a conversation, not a click. An annual subscriber looking at monthly gets a note pointing at support instead of a dead end. BillingPlans.interval.test.tsx pins the asymmetry, because the obvious "improvement" is to make it symmetric.
    • Nothing is offered when the interval is unknown (null): Free, a comped plan, or a row that predates migration 0025. Guessing monthly there would offer an annual switch to someone who might already be annual.
    • Manage stays reachable on the same card throughout — cancelling must never be crowded out by an upsell.

Fixed

  • A first subscription now lands with its renewal date (#486). A Checkout Session carries the tier but no period end, and for a first-time subscriber the event that does carry one is routinely lost: customer.subscription.created/updated matches on stripe_customer_id, which checkout.session.completed has only just written, so an event arriving first matches nothing — and one arriving second is often refused, because its created is frequently a second earlier than the session's and the ordering guard rejects anything older than the watermark the session just advanced. Prod's timeline was the second case exactly (subscription.updated 15:39:21, session 15:39:22). plan_renews_at stayed NULL and self-corrected a month later at the first renewal. The session branch now reads the subscription from Stripe once the link exists and writes with COALESCE(column, ?) — column first, so it can only fill a hole and never stamp on a value another event already got right, which is what makes it safe without an ordering guard. Best effort throughout: an unacked webhook is retried and the retry is swallowed by the idempotency ledger, so this must never throw.
  • The billing card offered a manage link that could only fail for granted plans. Settings.tsx gated it on plan !== 'free' alone, so a comped account got "Manage or cancel your subscription" — while the plan card two inches below it correctly read "Granted — nothing to manage". A comped plan has no stripe_customer_id, so POST /api/billing/portal can only answer 400 "No billing account yet"; the only way to find that out was to click it. The predicate now lives in core/billingActivation.ts as hasManageableSubscription, pure and covered, and the status line's bottom margin follows the same condition so hiding the link does not leave a gap.
  • A monthly <-> annual switch announced itself before Stripe had moved anything. billingActivated matched on tier alone, and an interval switch keeps the tier — which is already entitled — so the first poll matched and toasted "Switched to the X plan" immediately. billingActivated and confirmBillingActivation now take an optional expectedInterval, and choosePlan passes the interval it asked for. An absent interval on the row (a subscription predating migration 0025) means "cannot tell" rather than "wrong", so those never hang waiting for a field that will not arrive.

Added

  • /api/billing/status returns interval. users.subscription_interval has been written by the webhook since 0025 and read back by nothing, so the app could not say whether an account was on monthly or annual — and could not tell an interval switch from a no-op. The billing status line now says "billed monthly" / "billed annually", and success_url carries interval alongside plan so the checkout return is equally precise. Null for comped plans and for rows that predate the column.
  • TokenOrbitLink (components/TokenOrbitLink.tsx + .module.css) — the manage action as an engraved pill with three of the product's tokens tracing slow circles around it. The tokens ride the button's own border-box via offset-path, so the orbit is the shape of the button and stays right at any label length or font size; nothing is measured in JS and there is no path to re-cut when the copy changes. Three sizes at three periods (9s / 11s / 13s) rather than evenly matched dots at even spacing, which would read as a loading spinner. Hover tightens and brightens them; the busy state pulls all three to a 1.6s sweep so the same tokens report the redirect. Behind @supports (offset-path: border-box) — without it the tokens are hidden entirely, since a dot that cannot follow the path would pile up at the pill's top-left corner. prefers-reduced-motion parks them at three points around the rim and stops the orbit. Covered by TokenOrbitLink.test.tsx, which pins the case worth pinning: .t1 is declared ONLY inside the nested @media (prefers-reduced-motion) > @supports block, so if the CSS modules transform did not export a local for it, styles.t1 would be undefined and that token would render class="token undefined" — no crash, no failing build, one token silently unstyled. It does export it (_t1_ff23fe), and the test now says so.

Changed

  • One Stripe API version, pinned everywhere and matched to the webhook endpoint (#487). STRIPE_API_VERSION had sat on 2024-06-20 while the prod endpoint sent 2026-06-24.dahlia — four breaking releases apart, with nothing enforcing or noticing the gap. Moved to worker/src/stripe.ts so "every call we make is pinned" is checkable by grepping the import rather than by reading each call site, and DELETE /v1/customers/{id} in routes/account.ts is pinned too — it was the one call sending no version header at all, silently riding the account default. Of everything acacia/basil/clover/dahlia broke, exactly two reach this worker: basil moved current_period_end onto the subscription item (both readers already took the item first), and clover made flexible billing mode the default for newly created subscriptions, which changes how prorations are calculated — the one live behavioural difference, since every tier change sends proration_behavior=create_prorations. The subscription branch now logs the sending version when an entitled event carries no period end in either shape, as a tripwire for the next drift.

  • READMEs brought back in line with what ships (#485). worker/README.md still opened with "Not live yet" and claimed there was no billing flow; README.md told contributors to clone finance-manager, which only worked via GitHub's rename redirect; docs/README.md had three links that 404 and a spec table that had drifted in both directions. Verified by resolving every relative link against the filesystem and diffing both spec tables against docs/specs/*/.

  • The prod-update skill gained a real migration-rehearsal recipe (#477).

  • Worker dependencies bumped to their current releases, and Dependabot taught not to hand us the same broken PRs again. hono 4.6.0 -> 4.13.4, postal-mime 2.7.5 -> 3.0.0, @cloudflare/workers-types 4 -> 5, @cloudflare/vitest-pool-workers 0.17.0 -> 0.22.0, vitest 4.1.9 -> 4.1.11. wrangler deliberately stays at 4.126.0.

    • Landed as one commit rather than the five PRs Dependabot opened (#467, #468, #470, #471), because every one of them failed CI the same way: Dependabot rewrote worker/package.json and left worker/pnpm-lock.yaml untouched, so pnpm install --frozen-lockfile --ignore-workspace refused each with ERR_PNPM_OUTDATED_LOCKFILE. Not a stale snapshot — an explicit @dependabot recreate produced the same manifest-only diff. worker/ is not listed in pnpm-workspace.yaml, so its standalone lockfile is not one Dependabot's pnpm updater manages. .github/dependabot.yml now documents the drill and groups all worker updates into a single PR, since each one costs that manual lockfile step.
    • postal-mime 3 is a major on a path with no test coverage: the suite covers parseAttachment but never PostalMime.parse, so 488 green tests proved nothing about it. Checked by hand instead — email.attachments is still Attachment[], and the three fields import-email.ts reads (filename, mimeType, content) are unchanged. v3 types content as ArrayBuffer | Uint8Array | string; toBytes already handles all three arms explicitly.
    • @cloudflare/workers-types 4 -> 5 is clean under tsc --noEmit.
  • GitHub Actions bumped past several majors (#462-#466): actions/checkout, actions/setup-node, actions/upload-artifact 4 -> 7, actions/github-script 7 -> 9, cloudflare/wrangler-action 3 -> 4. The artifact/checkout/setup-node majors are Node-runtime bumps with no behavioural change, which matters because upload-artifact carries the pre-migration D1 backup and deploy-worker.yml never runs on a PR — green PR CI does not cover it. github-script v9 breaks require('@actions/github'); we use the injected globals and Node builtins only. wrangler-action v4's one breaking change is defaulting to wrangler v4, which our explicit wranglerVersion overrides.

  • TypeScript 7 held back (#469, #474 closed). typescript-eslint 8.x crashes on it (Cannot read properties of undefined (reading 'FunctionType')) and tsc rejects our own config: baseUrl is removed in 7 and every paths entry is non-relative. That is a migration, not a bump. Pinned via ignore in dependabot.yml with the reason recorded.

  • Root and frontend dev tooling bumped to current (#472, #475, #476 landed together): @playwright/test/playwright 1.59.1 -> 1.62.1, typescript-eslint and both @typescript-eslint/* 8.58.2 -> 8.67.0, vite 8.0.9 -> 8.2.2, vitest -> 4.1.11, prettier 3.8.3 -> 3.9.6, eslint-plugin-solid 0.14.5 -> 0.16.0, eslint-plugin-sonarjs 4.1.0 -> 4.2.0, eslint-plugin-simple-import-sort 12.1.1 -> 14.0.0, @squoosh/lib 0.3.1 -> 0.5.3, @fontsource/fraunces 5.2.9 -> 5.3.0, plus assorted patches.

    • Three Dependabot PRs rather than one because they were raised separately, and each of the last two conflicted with whichever merged first on pnpm-lock.yaml. Landed as one branch with the lockfile resolved once.
    • Two of the new linter versions found real things, and both are fixed here rather than suppressed:
      • simple-import-sort 14 changed its ordering, which frontend/src/features/Dashboard.tsx violated. Autofixed.
      • sonarjs 4.2.0 added no-fixed-wait-in-tests, which caught the page.waitForTimeout(1200) in frontend/tests-shots/pwa-shots.spec.ts — a guess at how long Chart.js needs for its first draw. Replaced with the condition that guess was standing in for: the init script wraps requestAnimationFrame to record when a frame callback last ran, and the shot waits for 400ms of no frames. Faster when charts settle early, correct when they take longer than 1200ms, and .catch(() => {}) so a view that animates forever degrades to an early screenshot instead of failing the run.
    • frontend/vitest.config.ts uses import.meta.dirname instead of __dirname: Vite 8.2 warns that configLoader: 'native', planned as a future default, does not support it.
    • Prettier 3.9.6 reformats seven existing files. Folded in here, since this is the commit that introduces that prettier — otherwise the next person to touch period.ts gets the churn in their diff. CI does not check formatting, so this was drift either way.

[5.11.0] — 2026-08-25

Added

  • Update notices carry an action; the toast stack moved top-right (frontend/src/core/toastStore.ts, frontend/src/components/ToastContainer.tsx, Toast.module.css, frontend/src/core/appVersion.ts, frontend/src/core/api.ts). ToastItem gains title, action and channel; ToastOptions gains durationMs, with per-type defaults (info/success 5s, warning 8s, error 10s) and a non-finite value falling back to the default rather than scheduling setTimeout(NaN). MAX_TOASTS = 4 drops the oldest. Stored items pick their fields explicitly instead of spreading options, so durationMs does not leak onto the item. New removeToast, removeToastsByChannel and hasToastOnChannel share a timer map, so evicting a toast cancels its pending dismissal instead of leaving a timer to fire against an id that is gone. ToastContainer renders a per-type icon, role="alert" for errors and role="status" otherwise, the title as a coloured inline prefix, and the action button. appVersion.ts adds announceUpdate() — channel app-update, 60s, Reload wired to reloadToLatest — which re-announces on a later poll only once the previous notice has expired, and clears the channel on rollback.
  • userIsMidEntry(doc) gates the hashchange auto-reload (frontend/src/core/appVersion.ts). The safe-moment reload now waits out a focused text control and any open dialog. "Open" is decided by computed pointer-events !== 'none', because CommandBar and GuidedOrbit keep role="dialog" nodes mounted permanently — a naive presence check was true on every page and disabled auto-reload outright. NON_ENTRY_INPUT_TYPES excludes checkboxes, radios and the rest, whose focus is a resting state rather than mid-entry.
  • Android install hint (packages/pwa-kit/src/install.ts, frontend/src/components/InstallAppButton.tsx). needsAndroidInstallHint() plus a shared hintEligible() gate and a promptSeen signal that outlives the event's consumption, so the hint stays suppressed on any session where beforeinstallprompt fired. Android WebViews (; wv) in the UA) are excluded — they cannot install. InstallAppButton flattens the nested Show fallbacks into one <Switch> with prompt → iOS hint → Android hint priority.

Fixed

  • Every tier switch created a second subscription (worker/src/routes/billing.ts, worker/migrations/0026_stripe_subscription_id.sql, frontend/src/features/Settings.tsx, frontend/src/components/BillingPlans.tsx). POST /api/billing/checkout built a Checkout Session on every click, and mode: subscription creates a new subscription each time — Stripe permits one customer to hold several, so nothing ever refused. Basic → Advanced → Basic on dev left three live subscriptions on one customer, all billing the same card, while users showed whichever webhook landed last. Worse, customer.subscription.deleted matched on stripe_customer_id alone and dropped the account to free unconditionally, so cancelling any one of several meant losing access while the others kept charging. Checkout now asks Stripe what the customer holds (liveSubscriptions, status=all filtered through ENTITLED_STATUSES, so trialing and past_due count); if something entitles them the request is a change — POST subscriptions/{id} replacing the existing item's price via items[0][id], not appending a second item, with proration_behavior=create_prorations so the difference lands on the next invoice rather than raising one that could demand SCA with nowhere to send anyone. It answers { url: null, changed: true } and the page never leaves. It asks Stripe rather than our own column because the accounts most likely to carry strays are the ones predating the column, and a failed lookup fails the request: not knowing what exists is never a reason to create another one. Migration 0026 adds nullable users.stripe_subscription_id; entitlement-removing events are ignored when they concern a subscription the row is not tracking, and when they concern the tracked one the handler moves the account onto a surviving live subscription rather than to Free. NULL tracks nothing and behaves exactly as before, so rows predating the migration keep working and fill the column in on their next event. The metadata is rewritten alongside the price — customer.subscription.updated reads the tier back off it, and a stale value would re-apply the tier just left. Covered by worker/test/billing-single-subscription.test.ts and worker/test/billing-webhook-strays.test.ts.

    • Does not clean up duplicates already out there — that is a refund decision belonging in the Stripe dashboard, where the invoices are visible. Affected customers keep paying twice until someone acts.
  • Choosing a plan after cancelling kept the cancellation (worker/src/routes/billing.ts, frontend/src/features/Settings.tsx). Cancel, think better of it, pick a different tier, and the subscription carried cancel_at_period_end through the price change: charged for one more period on the tier just chosen, then dropped to Free, with "Your Advanced plan is canceled" sitting under the upgrade the person had just made. Choosing a paid plan is asking to be billed for it, so the switch now sends cancel_at_period_end=false alongside the new price — and only when there is a cancellation to lift, so an ordinary change makes no write nobody asked for. Stripe's own portal keeps the cancellation through a price change too, but it has a Renew button to undo it and this grid does not, so a cancelled subscriber had no way back except through Stripe. The same-tier case stops answering "you already have that plan": asking for the plan that is about to end is asking to keep it. The response carries resumed so Settings can say so rather than leaving somebody to reload and check.

  • The plan grid froze at first paint (frontend/src/components/BillingPlans.tsx). const mine = isCurrent(p.id) inside <For> — the callback runs once per item, so the const froze at whatever the plan was on first render, which before /api/billing/status answers is free. Hence the "YOUR PLAN" border staying on Free, an Upgrade button on the tier already being paid for, and the status line one paragraph above correctly saying otherwise. Switching settings tabs "fixed" it by remounting. Now an accessor, like price and per beside it already were. Covered by frontend/src/components/__tests__/BillingPlans.reactivity.test.tsx.

  • The new plan needed a manual reload to appear (frontend/src/core/billingActivation.ts, frontend/src/features/Settings.tsx, worker/src/routes/billing.ts). Stripe redirects to /?billing=success the instant payment succeeds, but the plan is written by checkout.session.completed, which arrives out of band — measured at ~3s on dev. Settings read /api/billing/status once in onMount and so raced that webhook and normally lost, leaving the billing card on Free; the same branch toasted "Subscription activated." before reading anything back. success_url now carries the tier and the page re-reads on a backoff (600ms..6s, ~17s total) until that tier reaches an entitled status — active, trialing or past_due, matching isEntitled in the worker, since past_due is a dunning grace window and the page must not show Free to someone who still has access. The tier travels in the URL rather than being inferred from a baseline because a checkout return is a fresh page load: comparing against the first value read is wrong exactly where it matters, since Advanced → Ultimate reads advanced on the first poll, which is the tier being left. A timeout says payment was received and the plan will appear shortly — Stripe took the money either way, so it is "not seen yet", never "failed". Generalised by the tier-switch work above, which waits on our own webhook instead of Stripe and wants different wording.

  • Checkout 400'd for every account with a Stripe customer (worker/src/routes/billing.ts). The Session already set automatic_tax and tax_id_collection; Stripe refuses a Session combining those two with an attached existing customer unless it also sends customer_update[name]=auto and customer_update[address]=auto. Only accounts with a stripe_customer_id take the params.customer branch, so first-time checkout — which takes the customer_email branch — was unaffected and the failure was invisible in testing. Both params are now set on the customer branch. Covered by worker/test/billing-checkout-params.test.ts.

  • Stripe error text no longer reaches the client verbatim (worker/src/routes/billing.ts). stripePost's handler logs a structured line (type, code, param, message, Stripe's request-id) and returns Stripe's own wording only for card_error as a 402. Anything else is a 502 whose text depends on the upstream status: a Stripe 4xx is permanent and says it has been logged our side, a 5xx keeps "try again shortly".

  • Subscription interval is recorded (worker/migrations/0025_subscription_interval.sql, worker/src/routes/billing.ts). Nullable users.subscription_interval. Checkout stamps metadata[interval] and subscription_data[metadata][interval]; intervalForPrice() resolves monthly-vs-annual from the Price id as a webhook fallback, so subscriptions predating this backfill on their next customer.subscription.* event. checkout.session.completed COALESCEs the column (null = unknown, keep what is there) while applySubscription writes through (null = clear it); cancellation clears it alongside the plan. Covered by worker/test/billing-webhook-interval.test.ts.

  • A comped plan offered billing controls that could not work (frontend/src/features/Settings.tsx, frontend/src/components/BillingPlans.tsx). The portal route 400s when there is no Stripe customer to manage. Settings adds a status === 'comped' billing-summary branch and passes a comped prop that swaps Manage-billing for a "Granted — nothing to manage" label. Covered by frontend/src/components/__tests__/BillingPlans.gate.test.tsx.

  • The delete confirm dialog closed before the delete landed (frontend/src/core/confirmStore.ts, frontend/src/components/ConfirmDialog.tsx, frontend/src/features/Transactions.tsx, frontend/src/core/storage/handlers/transactions.ts). ConfirmRequest gains busy, stalled, progress and error, and an optional onConfirm: ConfirmWork — a (report) => Promise<void>. acceptConfirm() runs the work, patches progress as it reports, resolves on success, and holds the dialog with an error banner on rejection. finish() is split out from the guarded resolveConfirm precisely because it must bypass the busy guard, which otherwise refuses to close the dialog it is meant to close. STALL_GRACE_MS = 10_000 flips stalled so Cancel becomes Close: review found the first version guarded every exit at once — both buttons disabled, overlay guarded, no Escape handler, and no timeout or AbortController anywhere in the request path — so a never-settling socket or a blocked IndexedDB open left an undismissable z-index: 5000 overlay with page reload as the only recovery. An empty Error.message falls back to a generic sentence. ConfirmDialog renders <Index> rather than <For>, since a progress patch replaces the request object and <For> (keyed by reference) would rebuild the whole dialog on every tick; it drops its own label because OrbitSpinner already renders label visibly.

  • Deleting refetched the entire profile (frontend/src/features/Transactions.tsx). refreshTransactions() calls api.getTransactions() with no arguments and the worker appends no LIMIT, so every delete refetched every transaction plus a tags join and a COUNT(*) — which is why it was fast for small datasets and slow for the customer who reported it. Both handlers now drop rows from local state with setTransactions(prev => prev.filter(...)); the refetch is kept on the error path only, where the local state is no longer trustworthy. Single delete treats a 404 as success, otherwise "Try again" is unwinnable after a lost response.

  • The bulk selection kept ids for rows that no longer existed (frontend/src/features/Transactions.tsx). handleDeleteTransaction dropped the row from transactions() but never from selectedTransactions(), so ticking a row and deleting it with its own row-level button left the bar reading "1 selected" over a table that no longer held it, and the next bulk action posted an id the server had already deleted — the worker skips it and the serverless path fails its ownership check, so nothing corrupts, but the action silently under-applies. Pre-existing, not from #449: the refreshTransactions() that replaced did not clear the selection either. Fixed with one createEffect intersecting the selection against the ids present in transactions(), rather than a line at the delete call site, because the refetch paths cannot unselect anything themselves — refetchOnActive('transactions', …, refreshTransactions) swaps the whole list on a profile switch while the keep-alive host leaves the page mounted, so selecting rows and switching profile left ids from the previous profile in the bar. Deliberately intersected against transactions() and not filteredTransactions(): filtering here is a derived memo, so a row hidden by a filter or sitting on another page stays selected, which is what makes selecting across pages and acting on the lot work. The functional setter form does not track selectedTransactions, and returning prev unchanged keeps the array reference, so there is no feedback loop and no notify in the common case. Covered by frontend/src/features/__tests__/transactionsSelection.test.tsx.

  • Serverless bulk delete opened one IndexedDB transaction per row (frontend/src/core/storage/handlers/transactions.ts). Now deduplicates ids and calls the adapter's bulkDeleteTransactions once. The old per-id loop skipped repeats while the up-front ownership check counted them, so deleted could exceed what was removed.

  • The import preview rejected every transfer into an account it was about to create (worker/src/routes/imports.ts, frontend/src/core/storage/handlers/importFlow.ts). Accounts are inserted only when the run is not a dry run, and accountIdMap learns new ids only from the loadAccounts() that follows that insert — so during a preview the map held existing accounts only, and every transfer naming a pending account produced no account named "X" (Means of Payment, the source). Reported from production as 300+ rejected rows on a 5183-row first import. Both paths now seed the to-be-created accounts into accountIdMap when dryRun is set, with placeholder ids counting down from Number.MAX_SAFE_INTEGER: distinct, so the "both sides resolve to the same account" check still fires, and positive, because the shared invariant rejects non-positive account ids. A dry run inserts nothing, so no placeholder is ever persisted. A preview with nothing approved still rejects, and still names the side and the value. Covered by worker/test/import-transfer-accounts.test.ts.

  • The crash modal reloaded straight back into the dead build (frontend/src/components/ErrorBoundary.tsx, frontend/src/core/bootRecovery.ts). window.location.reload() is re-served the crashed build from the service worker's precache; it is now reloadToLatest(). bootRecovery adds a recoveryInFlight signal with a 10s deadline (isChunkRecoveryInFlight()), and both global handlers route through a shared escalate() that suppresses chunk errors while recovery is in flight, with the render fallback wrapped in <Show when={!isChunkRecoveryInFlight()}> — so the modal stops flashing over a page that is already quietly recovering. vite:preloadError is preventDefaulted only when a reload will actually follow: a prevented event makes Vite resolve the import as undefined, which surfaces later as an unclassifiable TypeError.

  • The spotlight tour claimed ArrowRight/ArrowLeft/Enter unconditionally (frontend/src/core/spotlightStore.ts, frontend/src/components/Spotlight.tsx, frontend/src/App.tsx). The overlay is pointer-events: none, so the page underneath stays fully live while a tour runs, but the window keydown handler had no focus check, no modifier check and no preventDefault. Three consequences, all reachable during any tour: ← pressed to fix a typo in a focused field moved the caret and stepped the tour back; Enter on the tour's own Next button activated the button and advanced, so one press skipped two steps; and every ArrowRight also reached App's period stepper, which had no spotlightActive() guard, so the focus period drifted a month per step and the user left the tour on a different period than they entered it. The decision now lives in tourKeyAction, pure and unit-tested, and the component asks isEditableTarget from core/domFocus — the predicate extracted just above, whose module header already claimed every global key handler needed it; this was the one still carrying no check at all. includeResting, because ←/→ are exactly the keys a range input and a radio group drive themselves. Escape stays exempt deliberately: someone who wants out of a tour has to be able to leave from wherever they are, including mid-typing.

    • The guard then took Enter away from every other button, since isEditableTarget answers false for a <button>: tab to "End Tour", press Enter, and the tour stepped forward instead of closing — as did "Back". Both worked before the guard, because nothing was prevented and the button's own activation still ran. isActivatableTarget (core/domFocus.ts) now covers what activates itself on Enter — button, a[href], [role=button|link]; input[type=button|submit|reset] is already covered by includeResting, the only mode a caller guarding Enter would use. Arrows stay the tour's, since a button does not use them. Caught reviewing the release range, not from a report — Space still activates the buttons, which is likely why it went unnoticed.

Changed

  • The worker's toolchain is pinned and reproducible (worker/package.json, worker/pnpm-lock.yaml, worker/.gitignore, .github/workflows/e2e.yml, .github/workflows/deploy-worker.yml, .github/dependabot.yml). worker/ is not a workspace member, and its lockfile was gitignored from the scaffold days ("deps installed fresh"), with wrangler at ^4.0.0. So both CI jobs installed --no-frozen-lockfile and resolved the toolchain afresh every run: CI never ran the wrangler anyone had tested locally, a wrangler dev crash could not be told from a code change because the version moved underneath the suite, and — the part that matters most — every prod deploy bundled whatever npm served that morning, which is neither reproducible nor rollback-able. Note where that bites: the deploy CLI itself was never the exposure, because wrangler-action@v3 pins wranglerVersion: '4.106.0' on the backup, migrate and deploy steps. What floated into production was the pnpm install that wrangler deploy bundles FROM — hono (43 imports; the entire HTTP and auth layer), zod, pdf-lib, postal-mime and xlsx. Those are not dev tooling. They run on every request and handle user data, and they were resolved unreviewed and integrity-unchecked on each deploy. The lockfile is now committed (209 resolutions, integrity-hashed, so a republished or tampered tarball is refused rather than installed), wrangler is pinned exactly at 4.126.0 to match vitest and @cloudflare/vitest-pool-workers which were already exact, and both workflows use --frozen-lockfile. deploy-worker.yml's header comment had claimed it installed "against worker/pnpm-lock.yaml" all along; it is true now.

    • The counter-argument was security — leave it floating so an urgent fix arrives on its own. It does not survive contact: floating IS the supply-chain exposure (unreviewed, integrity-unchecked downloads straight into a deploy pipeline is the path a hijacked or republished package takes), and nothing was watching for advisories in the first place — there was no dependabot.yml in the repo at all, so new versions arrived silently and untested. The dev-tool-versus-runtime split matters here: a CVE in wrangler threatens CI runners rather than user data, but hono and friends are not wrangler. .github/dependabot.yml closes the gap for the workspace root, worker/, and the GitHub Actions themselves (a compromised action runs with the workflow's token). Security updates are raised as soon as an advisory lands regardless of the weekly cadence, so pinning surfaces fixes faster and more visibly than floating did, because a human is actually told.
    • Left alone deliberately: wrangler-action's wranglerVersion: '4.106.0' now differs from the 4.126.0 in package.json, so the CLI that applies migrations to prod is not the one the tests ran against. Aligning them changes the production deploy path and cannot be rehearsed without deploying, which is not a thing to do in the same patch as a lockfile — worth its own PR against a quiet main.
    • wrangler minors and majors are on the ignore list: it ships a new minor most weeks, each carrying a different miniflare, and an unattended bump is exactly how a dev server that crashes mid-run reaches main. Patches and advisories still come through.
    • This does not fix the intermittent wrangler dev crash on the E2E job (Error inside ProxyWorker → cause: Network connection lost., from miniflare's loopback fetch service, killing the server mid-run). That crash was observed on 4.125.0 at 17:44 and on 4.126.0 — which was published at 19:13 the same day — so it spans versions and is not a regression in either. Pinning makes it diagnosable: the toolchain is finally a fixed variable, so the next occurrence can be bisected instead of guessed at. Every recent wrangler 4.x depends on a -alpha miniflare; that is Cloudflare's normal channel for the miniflare 5 line, not a prerelease pulled in by accident.
  • One shared focus predicate behind the global key guards (frontend/src/core/domFocus.ts, frontend/src/App.tsx, frontend/src/components/GuidedOrbit.tsx, frontend/src/core/appVersion.ts). New isEditableTarget consolidates four drifted copies of the "is focus in an editable control" check. GuidedOrbit's copy had omitted SELECT; only appVersion's knew that a checkbox keeps focus long after the click. userIsMidEntry keeps its own open-dialog scan, which is specific to the deploy watcher. The period stepper passes includeResting because ←/→ are owned by a focused RangeField slider (RetirementPlanner), where the narrower mid-entry semantics would let one keypress both drag the slider and step the period. Extraction surfaced a bug it also introduced: isContentEditable is typed boolean but reads back undefined in jsdom, so the function returned undefined despite its : boolean signature. The attribute fallback is gated on typeof el.isContentEditable === 'boolean', since in a real browser it was overriding an authoritative false, and it matches lowercased keywords — contenteditable is a case-insensitive enumerated attribute whose invalid values mean NOT editable, so a focused <div contenteditable="FALSE"> read as editable and would veto both shortcuts and the auto-reload while it held focus. frontend/src/core/__tests__/domFocus.test.ts asserts through document.activeElement rather than held element references, which is what let the original suite pass vacuously.

  • Removed the dead SettingsDialog and Modal components (frontend/src/components/SettingsDialog.tsx, SettingsDialog.module.css, Modal.tsx, Modal.module.css; 826 lines). SettingsDialog had no importers anywhere in frontend/src, and the generic Modal's only importer was that dead SettingsDialog; both were flagged by the 2026-07-23 code-and-data-integrity audit. Modal was unsafe to adopt as it stood — if (!props.isOpen) return null sat in the component body, so Solid read the prop non-reactively and evaluated isOpen exactly once at mount — and was deleted rather than repaired with a <Show>. ConfirmButton, SettingsDialog's other local import, stays: fifteen other importers. Also drops a stale comment in worker/src/routes/settings.ts naming SettingsDialog as a caller of the storage-mode endpoints.

  • The worker suite got a timeout that fits what it does (worker/vitest.config.ts). session-lockout > lets the real owner back in once they get it right hit vitest's 5s default on main, on a commit whose two earlier runs of the same job passed. That default assumes a pure unit test; nothing in worker/test is one — every file boots its own workerd and applies the migrations, and the auth tests run PBKDF2 at 100,000 iterations per login (worker/src/auth.ts), twenty of them in that test. It takes ~274ms locally, so an 18x stall is contention rather than a slow runner: the failing run reported 112s of setup against 90s of wall clock, and locally the same suite reports 739s against 45s — 16x oversubscribed — so files boot workerd in parallel and a CPU-bound test scheduled into a burst of those startups is starved of the runner's 4 shared vCPUs. testTimeout: 20_000 is ~70x the slowest test's real cost, so a genuine hang still fails, on being hung rather than on being unlucky.

[5.10.1] — 2026-08-25

Fixed

  • A first import rejected every transfer row (worker/src/routes/imports.ts, frontend/src/core/storage/handlers/importFlow.ts, frontend/src/features/import/importFlow.ts). A transfer's account_id resolves from the Means-of-Payment column and its transfer_account_id from Category — but account creation was driven entirely by categoryTypes, a map built from the CATEGORY column's distinct values, and the preview's new_accounts scan read only that column too. Means-of-Payment values were enumerated nowhere, classified nowhere, offered nowhere. On a profile with no accounts yet — which is what onboarding is — every transfer row failed the shared invariant and was rejected; the reported sheet had 341 of them.
    • Both new_accounts scans (worker and serverless) now read both columns. A Means-of-Payment value qualifies unconditionally: it is the account the money moved from, by definition of the column. A Category value qualifies when marked 'account' as before, or when the row's own type says transfer — there is no reading of "transfer to Groceries" that makes Groceries a category, and a first-time import has no way to have marked anything yet.
    • The mapping step (detectAccountValues) enumerates the same set and seeds categoryTypes with them as 'account', after the keyword classifier so they win over any guess; an explicit user choice still wins over both (?? 'account' fills gaps only). applySavedMapping gets the same treatment on BOTH branches — a mapping saved before this fix has no entry for any Means-of-Payment value, and restoring it verbatim would keep every transfer unresolvable for exactly the people who had already set the source up.
    • The mapping table renders mappingValues() — the category values plus the account-by-construction ones — rather than detectCategories() alone. Without the union the Means-of-Payment accounts were created invisibly: real accounts, never listed in the table, so no starting balance, no date, and no way to opt out. Categories keep their order; the extras append after.
    • The rejection now names the side and quotes the value: no account named "Erste Current" (Means of Payment, the source); no account named "Revolut" (Category, the destination). The invariant lives in shared/ and only sees ids, so the naming happens where the names are, in both import paths, self-transfer case included.
    • Tests: 3 worker (worker/test/import-transfer-accounts.test.ts) + 3 serverless (importFlow.transferResolution.test.ts), the same three scenarios each — the preview offers both sides, the rejection names the failing value, and the row imports once both are approved, with both legs linked and distinct. Confirmed red against the pre-fix code: the preview offered [], then ['erste current'] without the transfer-destination rule.

Changed

  • Rules-editor confirmation moved beside its button; success banners auto-dismiss and clear on navigation (frontend/src/features/import/BankRulesEditor.tsx, importFlow.ts, Import.module.css). saveBankRules/resetBankRules set the global resultMessage, which renders at the top of the page/panel — the editor sits far down a scrolling step, so on a phone the confirmation appeared a full screen above the click and was never seen. The editor now owns an inline confirmation (role="status", check icon, 4s, timer cleaned up on unmount) rendered in the same flex row as the buttons, and the flow no longer routes those two actions to the banner at all.
    • The banner itself never cleared: "Preview recalculated from your rules." was still sitting there on the NEXT step, which reads as a stuck page, not a confirmation. Success messages now go through announceResult (6s auto-dismiss) and goToMapping/goToPreview clear any banner on entry. Errors are untouched — they stay until acted on.
    • Tests: 3 in BankRulesEditor.confirmation.test.tsx — beside-the-button placement, self-dismissal under fake timers, and a save-after-reset keeping the newer message on the newer clock.
  • The "Expected columns" table matched neither the importer nor itself (frontend/src/features/import/ImportDataEntry.tsx). It listed Date and Description as required. Neither is: only Amount hard-fails a row (checkImportRowNumbers), a missing date imports as today and is flagged (MISSING_DATE_WARNING), and a blank description imports outright — a contract the worker pins in import-blank-description.test.ts because a stricter local rule once silently dropped 291 rows. The header is now "Sample (default when missing)" and every optional column with non-obvious absence behaviour says it in parentheses: Currency → base currency from Settings, Type → from the amount's sign, Amount Local → same as Amount, Category → uncategorized / a transfer's destination account, Means of Payment → the account the money left.
    • Tests: 3 in expectedColumnsTable.test.ts — only Amount may claim Required, the table's column set equals the downloadable template's TEMPLATE_HEADER, and the columns with defaults must state them.
  • Auto Categorize rebuilt around the rows that actually reach it (frontend/src/components/AutoCategorizeModal.tsx, features/Transactions.tsx). Every uncategorized row comes from an import — the app will not create one — so the person looking at the list did not type these rows in, and a bare description was unidentifiable. The reported experience: "bunch of transactions I don't know what they are (no amount, date metadata etc, from/to accounts)".
    • The modal's transaction type carried only { id, description } even though the host was already passing full Transaction objects; the row now renders date, signed amount (− for expense, coloured both ways, tabular-nums) and the account line, Erste Current → Revolut for a transfer, via a host-supplied accountName resolver.
    • A row with no mapping match gets a category <select> (filtered to the row's own type where known — an expense is not offered Salary), so "no suggestion" is no longer a dead end. Select all matches stages every suggested row at once.
    • Staging and applying were entangled: the row's + called onApply immediately AND applyAll called it again for every staged row — a double write per row, and a footer label ("Apply N") that described neither. Staging is now local state; Apply N is the only writer, sequential on purpose, with a new onApplied fired once so the host refetches once instead of after every row (the old handler reloaded the entire transaction list per application — "Apply 50" was 50 full refetches).
    • uncategorizedTransactions in Transactions.tsx now excludes transfers: a transfer has no category by design, so they filled the modal with rows that could not and should not be categorized.
    • Tests: 5 in components/__tests__/AutoCategorizeModal.test.tsx — the metadata line, the manual pick (and its type filter), a manual pick counting toward Apply, stage-then-apply writing each row once with one onApplied, and select-all-matches.
  • Onboarding: the footer button carries its own progress, and the panel scrolls to the work (frontend/src/components/onboarding/OnboardingWizard.tsx, Onboarding.module.css). The processing spinner and the import summary render at the top of the wizard body; with a 5000-row preview the user is a whole table below, so "Import selected" looked like it did nothing. FooterAction gained busy — the primary button disables, shows an inline spinner and switches label ("Importing…", "Building the preview…", "Processing…", "Adding…") — and every long-running footer action first scrolls the body back to the top (showTheWork). Spinner respects prefers-reduced-motion.
  • Onboarding: one primary action on the subscriptions step (frontend/src/components/SubscriptionScan.tsx, OnboardingWizard.tsx). The scan panel's own "Add N" sat mid-panel while the footer's "Continue" silently did not add. SubscriptionScanPanel gained expose (hands the host chosenCount / submitting / addSelected, which now resolves with how many were created) and hideAddButton; the wizard folds both into the footer: "Add 2 subscriptions & continue" when something is selected, "Continue" otherwise. The standalone Bills modal keeps its own button — hideAddButton is opt-in.
    • tests/onboarding.spec.ts asserts the in-panel button is GONE in the wizard and the unified label adds and advances in one click.

Tooling

  • The tour walk fails fast when the page never renders. walk-tours.mjs polled the sidebar button with an unbounded boundingBox() — on a page that never mounted (an intermittent dev-stack flake), each poll waited the 30s default and a bounded-looking retry loop became twenty minutes of silent hang until timeout killed it, reporting "browser has been closed" from the kill rather than anything about the page. The poll is bounded at 1s now, and the drawer failure names the URL, whether the button was attached at all, and saves a screenshot.

[5.10.0] — 2026-08-24

Added

  • A sticky period bar, and the overflow-x that had been quietly disabling position: sticky app-wide (frontend/src/core/uiPrefs.ts, components/PeriodBar.tsx, PeriodBar.module.css, components/Layout.module.css). The month control is how you change period, and on a long page — Budgets above all — it scrolls away exactly when the numbers being read make you want to change month. Settings > Appearance > "Keep the period bar in view" pins it to the top. Off by default: it changes how every page with a period bar behaves and costs a line of screen on each, which is not a change to make on someone's behalf.
    • Layout.module.css set overflow-x: hidden on html, body, which makes the body a scroll container and stops position: sticky working anywhere in the app. Nothing sticky had ever pinned; the first attempt here measured the bar at y = -792 after a scroll, with position: sticky; top: 8px correctly computed on it. Changed to overflow-x: clip in three places — html, body, and .main inside both the 768px and 480px media queries, which were overriding it back to hidden on mobile. clip still prevents sideways scrolling but does not create a scroll container. The sidebar's own overflow-x: hidden is left as it is: that one is a real scroll container and is meant to be.
    • PeriodBar gained a host wrapper so the sticky positioning, the pinned styling and the tour/test anchors live in the one component the pages already share, rather than in a per-page wrapper div repeated four times. Budgets, Dashboard and Transactions pass tourAnchor / hostTestId and drop their wrappers; page CSS keeps only the spacing that is genuinely per-page.
    • The "stuck" look (a shadow and a solid background, so content passing underneath does not show through) needs to apply only once the bar is actually pinned, and CSS has no selector for that. An IntersectionObserver with threshold: [1] and rootMargin: '-<top+1>px 0 0 0' fires the moment the element stops being fully visible against its own offset, which is the same instant it pins — no sentinel element, no scroll listener. The offset is read from the element's own computed top, so the media queries stay the single source of truth for it.
    • top is 8px on desktop and, on mobile, clears the fixed menu button rather than sliding under it. data-sticky and data-stuck are exposed for the e2e suite.
    • The bar is two rows on a phone rather than three. Six pills at flex: 1 1 auto wrapped to two lines and stranded the sixth alone, where justify-content: space-between stretched it across the full width — a whole row spent on "All". PERIOD_PILLS is now rendered as two groups (ROW_PILLS and TRAILING_PILL, both derived from the one list so they cannot disagree), which lets the mobile rules order the trailing pill up onto the stepper row, where there was already spare width. The five below divide one row at flex: 1 1 0. On a desktop the groups sit adjacent and .bar's column gap was set to match the gap inside .pills, so the split is invisible. This applies whether or not the bar is pinned — and it is why a pinned bar on a phone is a control rather than an obstruction.
    • readBool accepts only the two strings this module writes; anything else falls back to the default rather than being read as a deliberate choice.
    • uiPrefs.ts keeps the preference in localStorage, not on the account: it describes how this screen should behave, and a phone wanting the bar pinned says nothing about a desktop. Every read and write is in a try/catch — a private window or a browser set to block site data throws on the accessor rather than returning null, and a display preference must never be the thing that stops the app rendering.
    • Tests: 7 unit (core/__tests__/uiPrefs.test.ts — default off, both directions remembered, a value it did not write, and both throwing-storage paths) plus 12 e2e (tests/sticky-period-bar.spec.ts). The e2e ones scroll a real page and read where the bar ended up, on all three pages, at desktop and at 390px, including that the month steppers still work while pinned, that the app as it ships lets the bar scroll away, and that turning the switch on in Settings pins it. Two more measure the mobile layout: every control in the bar resolves to exactly two distinct row centres, "All" shares the steppers' centre and sits to their right, and no pill runs past the bar. They are scoped to the page container: pages are kept alive, so several PeriodBars are mounted at once and a bare locator matches all of them.
    • spotlightStore.test.ts now recognises tourAnchor="key" as well as a literal data-tour="key". The anchors moved from per-page wrapper divs into the shared component's prop; both declare the key at the call site, which is what that test is checking for.
  • A category icon gallery (frontend/src/components/IconPicker.tsx, IconPicker.module.css). The icon field resolves a typed keyword through iconFromUserValue / findIcon, which is a good input and a terrible discovery mechanism: the only way to learn that shield-check or more-horizontal exist was to type them. A button beside the field opens a scrollable grid of every icon, with a filter for when 62 becomes more than that. Picking writes the key into the same text field rather than into parallel state, so the field stays the single source of truth and a chosen icon can still be edited or cleared by hand. One modal serves both create and edit on the Categories page, so this lands in both.
    • PICKABLE_ICON_NAMES is derived from iconNameMap rather than written out beside it — a second hand-maintained list goes stale the first time someone adds an icon. It excludes tag and folder: both are real glyphs, but both are also in defaultIconValues, so getCategorySvg reads them as "nobody chose an icon" and pattern-matches the category name instead. Offering them would have offered a choice the renderer silently ignores. A test asserts the property directly rather than the exclusion — for every key on offer, storing it must change what is drawn.
    • iconSvgByKey() draws one icon by exact key. The gallery cannot use getCategorySvg, which is built to resolve a value and would happily show a glyph for a key other than the one being offered.
    • Escape is handled on the capture phase with stopPropagation, so dismissing the gallery does not also close the category modal and discard a half-filled form. The filter input is deliberately uncontrolled — binding value back to the signal is the write-to-a-focused-field bug the solid-forms skill exists to prevent.
    • Tests: 12 unit (IconPicker.test.tsx) plus 6 e2e (tests/category-icon-picker.spec.ts). The e2e ones cover the wiring the unit tests cannot: that the button is reachable from inside the modal, that the panel lands above it (a click that Playwright refuses is the stacking assertion), and that a pick reaches the field the form submits.
  • A maskable icon and manifest screenshots (frontend/src/pwaManifest.ts, frontend/public/icon-maskable-512.svg, frontend/public/screenshots/, docs/pwa-install-assets.md). The manifest declared four any icons and no screenshots at all, so Chrome's install dialog fell back to name-icon-URL, and Android — given nothing maskable — did not mask ours: it shrank the whole square into a white circle, which is the small dark tile in a white ring on the home screen.
    • icon-maskable-512.svg is the same artwork with two required differences: a full-bleed background (no rx — the platform supplies the shape, and our own corners would be masked a second time into a rounded square inside a circle), and scale(0.8) on the artwork so all of it sits inside the safe circle. It is not decorative: the unscaled artwork reaches 207px from the centre of a 512 canvas, past the 204.8px safe radius, so a circular mask clipped the orange marker.
    • Six screenshots — dashboard, transactions, analytics, each wide (1280x720) and narrow (720x1280). Chrome shows the rich dialog only with a wide entry and falls back to the plain one on phones without a narrow entry.
    • icon-192.svg was declared 192x192 and is a byte-identical copy of icon-512.svg, which draws a 512 canvas. Collapsed to one entry at sizes: 'any', the spec's value for a scalable icon. The test found this, not a reading of the file.
    • purpose is now explicit on every entry. Left implicit on some and explicit on others is how a maskable icon ends up serving both roles.
    • The manifest moved out of vite.config.ts into src/pwaManifest.ts so it can be tested. Everything in it fails silently in a browser — an unresolvable src is a swallowed 404, a wrong sizes is a screenshot dropped without a word — and none of it reaches a build log.
    • Screenshots are deliberately not precached: injectManifest.globPatterns is an explicit allowlist, and they are read by the install UI, never by the page.
  • npm run pwa:shots (frontend/playwright.shots.config.ts, frontend/tests-shots/pwa-shots.spec.ts) — re-shoots the six screenshots against the same two servers the e2e suite uses (wrangler on a local D1, vite proxying /api at it) and the same setup project, so the stills and the suite cannot disagree about what the data looks like. A second config rather than a spec in the main suite: these write into public/ and are not assertions.
    • The theme is pinned to dark through finance-theme — the key public/theme-init.js actually reads. With nothing pinned the app follows prefers-color-scheme and headless Chromium reports light, so an unpinned run returns a whole light set to sit beside a #0a0e1c splash. (The e2e fixture state's darkMode key is dead; nothing has read it since the theme moved to core/theme.ts.)
    • Animation and scrollbar suppression is an init script, not addStyleTag: a style tag belongs to the document that was live when it ran, so it evaporates on the first navigation and only the first shot comes out clean.
  • npm run pwa:icons (frontend/scripts/gen-pwa-icons.mjs) — rasterizes every manifest PNG from its SVG master with rsvg-convert. Not run in CI: the PNGs are committed, because a build that rasterizes its own icons fails on any machine without librsvg.
  • Tests: src/__tests__/pwaManifest.test.ts (24) reads the PNG IHDR chunks back off disk and compares them to the declared sizes, plus the maskable pair, explicit purpose, both form factors, one aspect ratio per form factor, Chrome's 320-3840 and 2.3:1 bounds, a label on every screenshot, and the scale() and absent rx in the maskable master. tests-shots/tsconfig.json puts the new directory under npm run typecheck.
  • Per-session revocation: auth_sessions + sid in the JWT (worker/migrations/0024_sessions.sql, worker/src/auth.ts, worker/src/routes/auth.ts, frontend/src/components/SignedInDevices.tsx). Sessions were purely stateless — a JWT plus a single users.token_version counter — so the only revocation primitive the system had was "invalidate every token this account has ever been issued". POST /api/auth/logout used it, which is why signing out on one device signed out all of them.
    • issueSessionCookie now inserts a row (crypto.randomUUID(), user agent, IP, provider) and embeds its id in the JWT as sid. authenticateRequest looks the row up and fails with session_ended when it is gone; last_seen_at is touched at most once per SESSION_TOUCH_SECONDS (300) and fire-and-forget, so a read path stays a read path.
    • Named auth_sessions, not sessions: 0001_init.sql already creates a sessions(sid, sess, expire) table for the retired Express server's session store. CREATE TABLE IF NOT EXISTS sessions against it is a silent no-op, and the next CREATE INDEX ... (user_id) fails with no such column.
    • Routes: POST /api/auth/logout deletes one row; GET /api/auth/sessions lists them with a server-derived device label; DELETE /api/auth/sessions/:id is scoped AND user_id = ? (an id alone is not authority — 404 otherwise) and clears the cookie when you end your own; POST /api/auth/logout-all batches the row delete with the token_version bump, which stays the only handle on a token issued before this table existed.
    • deviceLabel(ua) (worker/src/deviceLabel.ts) derives "Chrome on Linux" at render time rather than at write time, so improving the parser never needs a backfill. Order matters: Edge/Opera/Samsung are matched before Chrome, CriOS/FxiOS before Safari.
    • frontend/src/components/SignedInDevices.tsx renders the list. parseServerTime normalises D1's datetime('now') (YYYY-MM-DD HH:MM:SS, UTC, no zone marker) to a real instant — new Date() reads that string as local time, which puts "last active" hours off for anyone not on UTC.
  • Server-side auth audit trail (worker/migrations/0023_auth_logs.sql, worker/src/authlog.ts). Every login, logout and denied request is logged to the console; auth_logs persists the ones worth keeping — all login/logout outcomes, plus session denials that arrived with a cookie (a denial with no cookie at all is just an unauthenticated request and would bury the signal). Records event, outcome, reason, user, email, IP, user agent, request id and how many session cookies the request carried.
  • The Express/SQLite backend is gone (backend/, Dockerfile, docker-compose.yml, db/, test/backend/, test/e2e/backend-api/, test/benchmark/). It had not shipped for some time — ci.yml stopped testing it, nothing deploys it, browser-only mode is IndexedDB and cloud mode is the Worker — but it was a complete server with routes, models, repositories and its own test suite, and it kept attracting fixes. 144 files.
    • Policy, now written down in the repo docs rather than implied by what happened to be in the tree: self-hosting means running your own copy of the Worker on Cloudflare's free tier. That had been true for a while; the tree said otherwise.
    • An existing Docker image keeps working — nothing is revoked — but it receives no further fixes.
    • The one thing still holding it in the tree was e2e.yml: 35 Playwright specs drive the real built frontend, and something had to answer /api. That is now wrangler dev against a local D1 — the runtime that actually serves the app.
    • frontend/playwright.config.ts starts both servers (wrangler dev on :8787 after d1:migrate:local, then vite on :3800 with API_PROXY_TARGET pinned at it) and runs a setup project before the suite.
    • frontend/tests/global.setup.ts registers the fixture account through /api/auth/register, marks it verified and puts it on ultimate (Free caps profiles at 2, and specs that need isolation create their own — a plan error surfacing inside a subscription-scan spec is a true fact about the Free tier and a useless place to learn it), creates the fixture profile, seeds it, signs in once and saves the storageState every spec starts from. It also clears rate_limits first: the local database survives between runs and so did the login counters, so the seventh run of an afternoon failed at sign-in with a 429.
    • Signing in once rather than per browser context also fixes a real limit: workers: os.cpus().length meant a context per CPU, each spending the per-IP login budget.
    • frontend/tests/e2e-seed.ts is the dataset — two accounts, four months of transactions, six categories, a paid and an unpaid bill. It replaces reseed-demo on the Express server, so what a spec asserting on "recent activity" is looking at is now readable in the repo. A new profile gets no categories from any code path, which is why they are seeded explicitly: a categories page with none renders its empty state, not its grid.
    • test-helpers.login() no longer makes a request; firstProfileId() replaces the hardcoded X-Profile-Id: '1', which only ever held because the Express seed always produced it.
    • Root scripts start, lint:backend, test:backend are gone; test:worker and test:e2e added. better-sqlite3, bcrypt and sqlite3 leave onlyBuiltDependencies with the server that needed them.
  • BillingPlans marks the current plan. mine now outranks RECOMMENDED for both the border and the badge. Before, the two competed and RECOMMENDED always won: a subscriber on advanced (which is RECOMMENDED) saw a card highlighted as a recommendation, never as theirs, and a subscriber on any other plan saw the highlight on somebody else's card. The only signal that a card was yours was the CTA text, which reads as one more button in a row of Upgrade buttons.
    • Current card: 2px var(--success) border (padding drops to 15px so its contents do not shift a pixel against its neighbours) plus a "Your plan" badge in the slot "Recommended" used to occupy. Free gets it too — a Free row has no price and no Manage button to infer it from.
    • data-testid="plan-card-current", so the marking is assertable rather than eyeballed.
  • "Manage billing" → "Manage subscription", with "Change plan, update your card, or cancel" under it. The Stripe portal is where cancelling lives and nothing said so.
  • A Manage or cancel your subscription link under the billing status line (Settings.tsx, shown only on a paid plan, data-testid="billing-manage-link"). Someone looking for how to cancel reads the status line first; making the only route to the portal a button inside the grid put it where it competes with the Upgrade buttons beside it.
  • Tests: BillingPlans.gate grows to 11 — which card is marked, the badge taken back from Recommended when they are the same card, the legacy premium status mapping onto the advanced tier, and the border itself (asserted on the inline style, because a badge alone is not what makes a card read as selected). Three mutations run — badge text, badge condition, border condition — each killed.
  • The service worker is now injectManifest over a hand-written frontend/src/sw.ts, on top of @komediruzecki/pwa-kit's sw-runtime — ported from mercurypitch, not invented. Closes the second half of #417.
    • Model: a precached shell, one build at a time. install() fetches the shell and refuses it unless every <script src> it names is in this build's manifest, then stores it with its first-paint assets; navigations answer from that shell; assets answer cache-first and only for URLs this build shipped; activate() drops the other builds' caches. The previous build's cache is copied forward first, so an unchanged chunk costs no request.
    • skipWaiting and clientsClaim are gone. A worker that took over mid-session paired its own chunk map with the page's already-loaded HTML, which is what the multi-reload deploy loop was made of. The waiting worker is adopted only when the page decides to move.
    • generateSW + runtimeCaching is gone with them, along with the network-first navigation rule (SW_CLEANUP_EPOCH = 'nav-network-first-1'). That rule was the right fix for the failure it was written for and could never be tested; this replaces it with rules that can.
    • The three update signals converge. version.json polling (core/appVersion.ts) still detects a deploy, and so now do a waiting worker and the worker's own stale-build broadcast — all three set the same pending state and wait for the same safe moment (the next hashchange), under the same rolling reload cap.
    • Every reload goes through reloadToLatest(), never location.reload(). With a precached shell the controlling worker answers a plain reload from its own cache, so a page whose chunks are gone re-serves the same dead shell forever. The ladder is: adopt the waiting worker → else unregister and reload → else (offline) reload plainly. bootRecovery.activateUpdatedServiceWorker is deleted; its premise — that skipWaiting makes the new worker claim the page on its own — no longer holds.
    • SW_CLEANUP_EPOCH = 'precache-shell-1', and the inline reset script now deletes the old caches as well as unregistering (the new worker only ever deletes its own tokencircles-assets- prefix, so finance-manager-* and workbox-precache-* would have sat in the quota forever). It publishes window.__SW_CLEANUP__ and registration awaits it — an unregister resolving after a register would silently remove the worker it had just installed, a race the previous version of that script contained.
    • The worker ships with every build, not only production (command === 'build', exposed as __SW_ENABLED__). Chrome does not fire beforeinstallprompt without a fetch-handling worker, so gating on production meant dev.tokencircles.com/sw.js was a 404 and the install button added in #420 could never appear there. vite dev still ships none and still removes a stale one.
    • theme-init.js is in the precache list and has to be: index.html loads it with a <script src>, and the shell check refuses any document naming a script this build did not ship. Leaving it out would have failed every install.
    • HTML references are resolved, not matched on a leading slash. This repo builds with base: './', so index.html says ./assets/index-*.js and ./theme-init.js; mercurypitch's /assets/ pattern would have matched nothing, precached nothing and validated nothing — silently. Verified against a real vite build --mode dev: 115 precache entries, both shell scripts present.
    • Tests: 93 new in packages/pwa-kit (58 caching rules against a fake CacheStorage, 35 registration/update against a fake ServiceWorkerContainer), 104 in the kit overall. bootRecovery.test.ts loses the activateUpdatedServiceWorker cases with the function.
  • Dunning mail on the Stripe webhook. The handler covered checkout.session.completed and the three customer.subscription.* events and no invoice.* event at all, so a decline produced no outbound mail anywhere in the system. It now handles invoice.payment_failed and invoice.payment_action_required, and mails on customer.subscription.deleted.
    • worker/src/billingMail.ts — mailForBillingEvent(type, obj, account, appUrl), pure. The interesting part of this feature is not the sending but the decisions, several of which are "send nothing"; kept out of the route they can be asserted directly. (fetchMock is not exported by cloudflare:test in @cloudflare/vitest-pool-workers@0.17.0, so the alternative was no unit coverage of the wording at all.)
    • invoice.payment_failed with billing_reason: 'subscription_create' sends nothing. That is the first invoice of a checkout, and the user is looking at Stripe's own error on screen; the mail would arrive after they had already tried again.
    • payment_action_required is deliberately not the decline mail. Nothing has failed, and the only thing that resolves it is the user opening a page — which a "your payment failed" subject makes them less likely to do.
    • subscription.deleted reads the account before applySubscription, because afterwards the plan is free and the mail would say "your Free plan has ended"; and it only sends when applied.meta.changes is set, so an event that lost to the ordering guard cannot announce a cancellation that did not happen.
    • Amounts arrive from Stripe in minor units and are divided before rendering; next_payment_attempt, amount_due, currency and hosted_invoice_url are all treated as optional, with the app's own billing screen as the fallback link.
    • Sending is best-effort inside a try/catch: an unacked webhook is retried, and the stripe_events insert makes the handler idempotent, so a mail that could not be sent must not cost us the ack and earn a second delivery.
    • renderPaymentFailed, renderPaymentActionRequired, renderSubscriptionEnded in worker/src/emailTemplates.ts.
    • Tests: worker/test/billing-dunning.test.ts (20) — the decision table, plus end-to-end assertions on the outbound Resend call for the two guards that are invisible from either side alone (the plan column cannot show a mail, and the pure function cannot see a stale event). Four mutations run: dropping the first-invoice guard, the no-address guard, the ordering guard on the mail, and reading the account after the plan drops — each killed.
  • POST /api/billing/checkout refuses an unconfirmed password account (403, "Confirm your email address before subscribing"). The check is a fact about the account, so it runs before the Stripe config and price lookups — and in the route rather than only the UI, since the route is reachable with a session and a fetch whatever the page drew. GET /api/billing/status reports email_verification_required so the panel never offers a button that would be refused.
    • POST /api/billing/portal is deliberately NOT gated. Someone already paying has to be able to reach the portal and cancel whatever else is blocked; a gate that strands a subscriber away from the cancel button is worse than no gate.
    • Google accounts are never gated. auth_provider = 'google' with email_verified = 0 is a real state — Google reports an unverified address by leaving it off the account — and there is no password to reset, so gating on the flag alone would lock those users out of paying with no way to fix it.
    • mustVerifyEmail() is shared by the two routes so the policy cannot drift between what the UI is told and what the server enforces.
  • <ResendVerification/> — the resend control extracted from the banner, now that the same ask appears in the billing panel: one request at a time, a terminal "sent", and a failure that returns to idle instead of stranding the user on a disabled button. inline and button variants.
  • BillingPlans gains upgradeBlockedReason — separate from configured, which is about the server; this is about the account.
  • Tests: worker/test/billing-verified-gate.test.ts (7) plus BillingPlans.gate and ResendVerification on the front end (8).
  • packages/pwa-kit — the install half of the PWA, ported from mercurypitch. A workspace package with no imports from the app that uses it, so extracting it to its own repository later is a git filter-repo and a publish rather than a rewrite. solid-js is a peer dependency. Consumed through a @pwa-kit alias in vite.config.ts, vitest.config.ts and tsconfig.json; its tests run under the frontend's vitest so CI covers them with no extra job.
    • installPwaInstallListeners() runs in index.tsx before render: Chrome fires beforeinstallprompt once, early, never replays it, and that event is the only handle on the native install sheet. Cancelling it also suppresses Chrome's own mini-infobar and is what keeps the event usable later.
    • canInstall() / needsIosInstallHint() / isStandalone() are the three questions worth asking, and <InstallAppButton/> renders nothing when all three say no. A dead Install button would appear on every desktop Firefox and inside every already-installed window.
    • iPadOS 13+ reports itself as a Mac, so the iOS check falls back to touch points; Chrome/Firefox/Edge on iOS are excluded because they are WebKit underneath but cannot add to the home screen at all, and a hint there points at a menu item that does not exist.
  • Manifest: id (without it the identity is derived from start_url, so changing that later reads as a different app and offers a second install beside the first), plus explicit scope, launch_handler: navigate-existing, orientation and categories. Dropped version: Date.now() — not a manifest member, and it churned the file on every build.
  • Tests: 11 for the kit, 6 for the button.

Fixed

  • The month pills overflowed their own buttons on a phone (frontend/src/utils/period.ts, components/PeriodBar.tsx, PeriodOrbit.tsx, PeriodBar.module.css). PERIOD_PILLS gave the first two pills the short forms "This mo." and "Last mo.", which at flex: 1 1 0 on a 320-390px viewport were wider than the pill they sat in — and with only white-space: nowrap and no overflow, the glyphs ran straight out through the border.
    • PERIOD_PILLS is replaced by periodPills(now = new Date()), which names the first two for the months they actually select: label "August"/"July", short "Aug"/"Jul". A function and not a constant, because a constant captures the month at import and a tab left open across midnight on the 1st would keep naming the month it was opened in.
    • A new title field carries the wording the label gave up ("This month (August)"), so the tooltip still explains a pill whose label is only a month. PeriodOrbit gained the same tooltip; it previously had none.
    • .pill gets overflow: hidden; text-overflow: ellipsis. The labels are short now, but a pill that cannot contain its own text is a bug waiting for the next longer word. Mobile padding drops 10px → 8px, which buys the text a few pixels before the ellipsis does.
    • Tests: 6 unit in utils/__tests__/period.test.ts (both months, the January→December year boundary, the titles, that the ids are untouched, that every short form is ≤ 4 characters and no longer than its label, and that the result is computed per call) plus 3 e2e at a 320px viewport.
    • The e2e test that already covered this passed the whole time. It compared each pill's bounding box against the bar's, and the box was inside it — only the glyphs were not. The new one reads scrollWidth - clientWidth on the pill and on its visible label, which is the difference between "the button fits" and "the text fits". Against the old labels it fails with "This mo." overflows its pill.
    • The label assertion reads the visible <span>, not the button: both the full and the short label are in the DOM at all times with CSS choosing between them, so toHaveText on the button returns them concatenated ("AugustAug").
  • The onboarding import step's footer promoted the wrong action (frontend/src/components/onboarding/OnboardingWizard.tsx). The wizard already moved the import flow's forward action into the footer for the mapping and preview sub-steps; the upload sub-step was left out, so with a statement staged the primary button still read "Continue without importing". ImportDataEntry renders its own forward button — bank-process-btn, import-continue-mapping — inside the step body, below that tab's inputs, which on a phone put it under the account pickers and off-screen. The action that abandons the step was the one under the thumb.
    • readyEntryAction() returns the active tab's forward action once that tab has something to act on, and null before then: with no file chosen there is nothing to promote and the footer should still offer to move past the step. Bank imports promote processBankFiles(); Google Sheets and the two CSV tabs promote goToMapping() once sheetResult() / uploadResult() is set.
    • Skipping is demoted to the existing secondary ghost slot — the same shape mapping and preview already use — so it stays one tap away.
    • The import PAGE is untouched. It renders the same ImportDataEntry without this footer, and its inline buttons stay exactly where they are.
    • .footer / .footerRight wrap under 620px. The step can carry four buttons (Back, Skip setup, Don't import, primary), which does not fit a 360px phone on one line; wrapping keeps the primary at full width instead of squashing all four until none reads as the main one.
    • Tests: 1 e2e in tests/onboarding.spec.ts — asserts the primary is the skip before a file lands, becomes "Process & continue" after, that "Don't import" is still reachable beside it, and that the footer button does what the inline one does.
  • Every paid plan card said "Upgrade" (frontend/src/components/BillingPlans.tsx). From Advanced, the Basic card said Upgrade — the opposite of what clicking it does — and the grid gave a subscriber nothing to tell which tiers were above them and which below. The CTA now reads the plan's position in the catalogue and says Downgrade or Upgrade accordingly.
    • Direction comes from the catalogue's own order, not a second list in the component. GET /api/plans returns Object.values(PLANS), which preserves plans.ts's declaration order (free, basic, advanced, ultimate) and is the order the grid already renders in — so a tier slotted into plans.ts later is labelled correctly with no change to the frontend.
    • A current plan that is not in the catalogue falls back to Upgrade. A legacy value, or one granted out of band, says nothing about direction, and guessing Downgrade from an unknown starting point would be worse than the old honest default. premium still maps to advanced through currentId() first.
    • Free is untouched: it has no CTA in either direction. Ending a subscription belongs in the portal, and a Downgrade button opening a Stripe checkout for a 0 EUR plan would be a trap.
    • Tests: 8 in BillingPlans.direction.test.tsx, against a four-tier catalogue — the interesting cases only exist when something sits both above and below you.
  • Picking a colour saved the category and closed the form (frontend/src/features/Categories.tsx, Budgets.tsx). The colour swatches are <button>s inside the category <form> and carried no type, so they took the HTML default — type="submit". Clicking one submitted the form: the category was written and the modal closed, mid-edit, before the name or the icon had been touched. It read as the modal auto-closing rather than as a swatch that was quietly the Save button.
    • Both instances fixed with type="button": the Categories page's category form, and the category form on the Budgets page, which is a second copy of the same picker.
    • Nothing catches this on its own. The diff looks right — the handler does the one thing it should, and nothing anywhere says "and also submit". Solid does not warn, TypeScript cannot see a missing attribute, and eslint's JSX rules do not cover it. frontend/src/__tests__/formButtonType.test.ts scans every .tsx for a <button> opened inside a <form> whose attributes omit type, and fails on any. It matches <button with a negative lookahead rather than requiring a following space or >, because attributes usually start on the next line and <button alone is the shape the bug actually ships in — the first draft required the space and found nothing.
    • Tests: 4 unit (including a fixture of the bug as it shipped, so the scanner cannot silently stop working) plus 4 e2e in frontend/tests/category-color-swatch.spec.ts, covering both forms. Verified against the pre-fix source: the scanner flags exactly Categories.tsx:543 and Budgets.tsx:1385, and 2 of the 3 Categories e2e tests fail without the fix.
    • The e2e test for the add form watches for the POST /api/categories request rather than the modal. Submitting closes the modal only once the POST returns, so an immediate toBeVisible() passes in the gap — the first version of that test did exactly that against the buggy build and would have shipped saying nothing.
  • A category card with a budget drew its divider twice, and cost three extra rows (frontend/src/features/Categories.tsx, CategoriesPage.module.css). The budget block was four stacked rows — "Spent / amount", a 6px .progress-bar, then .spending-footer carrying "X limit" and "Y remaining". .spending-footer set its own border-top: 1px solid var(--border) directly beneath that track, and at 6px against 1px the two read as one horizontal rule painted twice. .spending-footer was also the only one of the card's label/value rows without display: flex, so its two spans stacked left-aligned instead of sitting at either end of one line — which is where the third row came from.
    • Rebuilt as two rows. The limit rides with the amount it bounds ("EUR 254.70 of EUR 220.00", .spending-of), and what is left rides beside the bar that shows it (.meter-row: a 10px capsule .meter plus a .meter-note reading "EUR 34.70 left" or "EUR 34.70 over"). No second border anywhere in the block; the card's one divider stays on .category-spending.
    • The note sits beside the bar, not inside it. Inside is tighter until the fill reaches it, at which point the text is on the fill in one theme and on the track in the other, with no single colour that reads well against both.
    • .meter carries role="img" and an aria-label naming both numbers — a bar whose meaning is carried entirely by a width is nothing to a screen reader. .meter-note uses font-variant-numeric: tabular-nums so figures line up across a grid of cards. The width transition is behind prefers-reduced-motion: no-preference.
    • Under 380px .meter-row wraps and the bar takes the full width, rather than squeezing to nothing to keep the number on the same line.
    • Removed a dead twin of this whole design: .categories-page .budget-limits / .budget-limit{,-label,-amount} / .remaining-{amount,label,amount-value} / .budget-progress{,-bar} and its four state variants, plus .remaining-amount and the .progress-fill warning/danger/success/normal set. None had been referenced from any component — .budget-limits carried the same border-top as the footer that caused the report, and .budget-progress was a second copy of the same 6px bar.
    • Tests: 5 in frontend/tests/category-card-budget.spec.ts. They measure boxes rather than read text, because both defects are layout facts a text assertion cannot see: exactly one drawn border-top in the card's whole subtree; the bar and the note sharing a vertical centre with the note to the right of the bar; the block no taller than header + meter + 40px; the fill between 0 and 1 of the track and the track no more than 14px tall; and no sideways overflow at 360px.
  • styles.formInput on the Budgets page resolved to a rule that matched nothing (frontend/src/features/BudgetsPage.module.css). vite.config.ts sets css.modules.localsConvention: 'camelCase', which exports a camelCase alias for every original class name — so .form-input (line 168) and a later .iconField .formInput block both arrived in the JS as styles.formInput, and the later one won. All six form controls in Budgets.tsx therefore rendered with no background, no border and no padding, because the only rule they could match was scoped under .icon-field.
    • Visible as the reported bug in the Allocate Budget modal: a transparent <select> is what Chrome paints its option list white behind, while the page's light --text still cascades in — white on white. The amount input looked unstyled for the same reason. Confirmed by reading computed styles off the running app: background: rgba(0,0,0,0), border-top-width: 0px, padding: 0px. After the fix: rgb(10,14,28), 1px, 10px 14px.
    • Fixed by writing that block in kebab-case like the rest of the file, which removes the duplicate local name entirely. No rule changed; one simply stopped being shadowed.
    • Seven more collisions of the same shape exist and are listed in the new test rather than fixed here — each one has a dead rule set, and merging them changes how a page renders, which wants looking at rather than doing blind: Layout.module.css (sidebarNav), BillsPage (billsSection), BudgetsPage (categoriesSection, categoryChartSection), LoansPage (loansPage), TransactionsPage (modalFooter, modalTitle).
    • Tests: 4 in frontend/src/__tests__/cssModuleNaming.test.ts. It reads every *.module.css off disk and fails on any NEW collision; a fourth test fails if an entry on the known list is fixed but left there, so the allowlist cannot rot into decoration. Nothing about this class of bug fails a build, a type check or a lint — this test is the only thing that catches it.
  • Signed-in devices listed sessions that had expired weeks ago. A session token is good for seven days and is never refreshed — issueSessionCookie is only ever called at sign-in — but nothing deleted the auth_sessions row when the token died. GET /api/auth/sessions selected the table unfiltered, so the list grew by an entry per sign-in forever: a browser signed into once a month showed up a dozen times, every entry looking exactly as live as the real one, and "sign out this device" on any of them revoked nothing because there was nothing left to revoke.
    • The list is now bounded by the token lifetime (created_at > datetime('now', '-7 days')). last_seen_at cannot answer this — it says when a session was last used, not when it expires, and a token issued seven days ago and used a minute ago is dead either way.
    • sweepExpiredSessions() joins the existing cron alongside sweepRateLimits, so the table stops growing rather than merely being filtered on read. It leaves a day of slack past the TTL: being swept early would end a session a moment before its token was due to expire, for no reason beyond two clocks disagreeing.
    • Tests: 4 in worker/test/session-lockout.test.ts.
  • The E2E job on main was killed by its own timeout, and reported it as cancelled. .github/workflows/e2e.yml runs the 44-test smoke subset on a pull request but all 515 tests on a push to main. The 30-minute bound added alongside workers: 1 was sized against the smoke run: the last green full run already spent 22m25s of it, and the next push went over and was killed. GitHub reports a timeout-minutes kill as cancelled, not failed, so main showed a non-green E2E while CI and both deploys were green and no test had actually broken.
    • Fixed by sharding the push path across four jobs (--shard=i/4), not by raising the bound. workers: 1 stays — four headless Chromiums against one wrangler got workerd killed twenty seconds in, after which every remaining spec failed on a 502 from the vite proxy. Four jobs buys the wall-clock back without putting a second browser on any one workerd: each shard is its own runner with its own wrangler and its own local D1. Playwright splits it 130/130/129/129 and runs the setup project in every shard; a shard is 5.0m of tests locally at workers: 1. The bound is now 25 minutes per shard, a hang detector rather than a budget.
    • fail-fast: false, so one bad shard shows the other three instead of cancelling them.
  • Failure traces from E2E were never actually uploaded. Both artifact steps pointed at playwright-report/ and test-results/ in the repo root; Playwright writes them next to its config, under frontend/. Every run since produced zero artifacts. Now one step uploads frontend/test-results/ on failure, named per shard — upload-artifact@v4 rejects a second upload under a name another job has claimed.
  • The captcha had exactly one visible state for two very different failures (frontend/src/components/Turnstile.tsx, LoginScreen.tsx, LoginModal.tsx). <Turnstile/> reported a token or an empty string and nothing else, so "the challenge has not been solved yet" and "the widget script never arrived" were indistinguishable to the form. The blocked case rendered an empty <div>, the hint "Complete the verification above to continue" under it, and a permanently disabled submit button — and the server, failing closed, could only answer a submit with a generic 403. There was no route out of it short of a page reload.
    • TurnstileStatus names the seven states, and onStatus reports them. captchaIsStuck() separates the two the user cannot clear by waiting or clicking (unreachable, failed) from the rest; expired is deliberately not one of them, because the widget re-arms itself.
    • The stuck states render their own panel from inside Turnstile, so both auth forms get the same wording with no duplication: what failed, the domain to allow (challenges.cloudflare.com — the only actionable fact in the whole situation), and a Retry.
    • loadScript gained a 12s timeout. onerror fires in milliseconds for a refused connection and never at all for a null-routed or silently-dropped host, which is the shape most DNS filters and corporate proxies take. Without it the widget sat in loading forever and the button stayed disabled with no explanation.
    • A failed load no longer caches its rejection. scriptPromise was memoised unconditionally, so every later attempt — Retry, or the fresh widget LoginScreen mounts for the register to sign-in handoff — replayed the original failure without asking for the script. Allowing the domain and retrying could not work.
    • error-callback now logs Cloudflare's numeric code. It is the only way to tell a blocked subrequest from a bad site key after the fact, and it was being discarded.
    • clearCaptcha() replaces the four resetTurnstile() + setTurnstileToken('') pairs per form: a spent token has to take the status with it, or the form explains nothing under a button it has just disabled. A stuck widget stays stuck — resetting a script that never loaded does not load it.
    • LoginModal had no hint at all, only the disabled button; it now shares the same one.
    • Tests: Turnstile.blocked.test.tsx (12) — the message names the domain, captchaIsStuck over all seven states, the blocked panel and its Retry, the never-answering host, Retry as a real second request, a remount after a blocked load, the happy path, error-callback, and expired staying unblocked. Six mutations run — cached rejection, no timeout, expired as stuck, blocked-reports-ready, the domain dropped from the message, and error-callback reporting ready — each killed.
  • The marketing capturer and its guide still drove the deleted Express server (frontend/scripts/gen-marketing-shots.mjs, docs/marketing-screenshots.md, frontend/tests/e2e-seed.ts). Retiring backend/ took nuke-demo.js and the three-profile demo with it, so the documented setup — node backend/scripts/nuke-demo.js, node backend/index.js, shoot profile 3 — named three things that no longer exist, and the script's login posted {username, password} at a Worker that wants {email, password}.
    • The capturer now runs against the e2e suite's app: wrangler dev on a local D1, vite proxying /api at it, and the seeded fixture account. One fixture shot by both the suite and the stills, on purpose — a screenshot pipeline with its own idea of the data drifts from the app the moment either side moves, and it drifts silently, because the frames still render.
    • The profile is looked up by name, not pinned. PROFILE=3 was a fact about a database that no longer exists; the fixture's id is whatever D1 handed out and differs per worktree. The script reads GET /api/profiles and takes E2E Fixture, warning if it falls back. A wrong id is not an error anywhere — it is six shots of an empty profile.
    • EMAIL / PASSWORD are overridable, defaulting to the fixture account.
    • The doc's three-step setup is deliberate: the capturer needs the servers still up when it runs, and Playwright stops the ones it starts. Step three is --project=setup so seeding does not also re-shoot the PWA install screenshots.
    • The stale POST /api/profiles/reseed-demo warning is replaced with the one that is now true: on the Worker it resets the current profile to default categories, so it empties the profile you are about to shoot. Same for the portfolio quote path, which is worker/src/routes/portfolio.ts now and fails the same silent way.
  • The e2e fixture seeds budgets (frontend/tests/e2e-seed.ts) — four monthly ones on the spending categories that carry transactions. The budgets page and the dashboard's budget alerts had nothing but an empty state to render, which is also what made 03-budgets the one marketing frame that could not be re-shot. start_date is the first of the current month: a budget's period is derived from it, so one dated mid-month reads as a partial period and every figure on the page becomes a fraction.
  • exportBackup aborted the entire backup on one unreadable R2 object (worker/src/backup.ts, worker/src/routes/exports.ts). A receipt row whose storage_path no longer resolved threw 503 Receipt file "…" is unavailable; full backup aborted, so an account with one orphaned receipt out of hundreds could not take a backup at all — and no retry fixes a blob that is gone.
    • Missing objects are now skipped and reported in skippedReceipts ({receipt_id, original_name, reason}) plus an X-Backup-Skipped-Receipts response header, because the browser downloads the file without parsing it and the UI needs somewhere to read the warning that is not a hundred megabytes of JSON.
    • The receipt's metadata row is dropped with its bytes. validateBackup requires every receipts[] entry to carry a matching receiptFiles[] entry, so a backup that listed a receipt it had no file for would export cleanly and then be rejected with a 422 on the way back in. Transactions pointing at a skipped receipt keep their row with receipt_id cleared — losing a purchase because its photo is missing would be a far worse trade than losing the pointer.
  • GET /api/export scoped the full backup to X-Profile-Ids, while restoreBackup deletes every profile the user owns (worker/src/routes/exports.ts, frontend/src/features/Settings.tsx). The account-wide guarantee lived entirely in the caller: Settings.tsx passed allProfiles(), and nothing on the server required it. A stale header, a household mid-switch, or any script hitting the endpoint produced a backup that silently destroyed the profiles it omitted. The route now reads the user's profiles itself and ignores the header; handleExport no longer sends one. A user with no profiles gets a 404 rather than an empty file that restores as a wipe.
  • The profile cap made your own backup unrestorable (worker/src/routes/exports.ts). POST /api/import rejected any backup with more profiles than the plan limit. Combined with the account-wide export above, an account holding more profiles than its current plan allows — a downgrade, a plan change, profiles created before the cap — could not restore its own data. The ceiling is now max(planLimit, profiles currently owned): putting back what you had is always allowed, exceeding it is still capped.
  • Six read-then-write races between concurrent requests (worker/src/routes/{bills,recurring,transactions,receipts,auth}.ts). Each was atomic in its write and non-atomic in its decision: a SELECT, a check in JS, then a DB.batch encoding a conclusion drawn from a row that could already have moved. D1 has no interactive transactions, so the fix throughout is to make the write itself the claim — a conditional statement inside the batch — and to report a lost race instead of applying a stale conclusion.
    • POST /api/bills/:id/mark-paid — read last_paid_date, checked isBillPaidForCurrentPeriod, then batched INSERT + balance + UPDATE. Two taps inserted two transactions and debited the account twice. Every statement now carries (SELECT COUNT(*) FROM bills WHERE id = ? AND profile_id = ? AND (last_paid_date IS NULL OR last_paid_date <> ?)) = 1, with the UPDATE last so the writes before it still see the pre-state; zero changes on the claim → 409.
    • POST /api/recurring/:id/populate — same shape against next_date. The guard is next_date IS ? bound to the value read, so the losing batch matches nothing. The invariant is one transaction per period advanced, not one per request: an overdue rule populated twice legitimately takes two periods.
    • PUT and DELETE /api/transactions/:id — the worst of the six, because it left permanent drift rather than a duplicate. Both paths reverse the transaction's OLD effect using values read before the batch, so two concurrent edits each reversed the same original: a 100 expense edited to 50 and to 30 credited 200 and debited 80, leaving the balance 50 out with no row to explain it. unchangedSince(row, id, pid) builds a predicate over exactly the fields the reversal arithmetic reads (type, amount, amount_local, account_id, transfer_account_id); every balance statement carries it and the row write moved to the END of the batch. A lost race is a 409, not a silent partial. Edits that touch only non-balance fields do not collide.
    • POST /api/receipts — COUNT(*) then insert. The insert is now INSERT ... SELECT ... WHERE (SELECT COUNT(*) ...) < ?, with the R2 object cleaned up on refusal by the existing catch. The pre-flight count stays so an over-quota upload is refused before the file is streamed.
    • POST /api/auth/reset-password — SELECT ... WHERE used_at IS NULL then an unconditional UPDATE, plus three unbatched writes. The SELECT no longer filters on used_at: spending the token is the only gate (UPDATE ... WHERE id = ? AND used_at IS NULL, 0 changes → 400), and the password change and the retiring of the account's other pending links are one batch. Two gates for one fact meant the read could refuse before the write was ever exercised, so nothing proved the write was conditional.
    • GET /api/auth/verify-email — same single-gate restructuring.
  • apiPut / apiGet / apiDelete / apiPost threw before parsing the error body (frontend/src/core/api.ts), so every failure through them read Request failed with status 409 and the sentence the server wrote for the user was discarded. parseJsonResponse already raises with the server's own wording; the pre-throw is gone.
  • A thrown API error now carries status (frontend/src/core/api.ts, errorStatus()), and Transactions.tsx uses it: a 409 toasts the server's message and refreshes the list, instead of the previous console.error that left Save looking inert.
  • readCookie returned the first fm_session header value; a browser can hold several. Cookie identity is (name, Domain, Path), not name alone, so a browser that had visited both tokencircles.com and dev.tokencircles.com held two fm_session cookies — one scoped .tokencircles.com, one .dev.tokencircles.com — and the prod-scoped one domain-matches the dev API. RFC 6265 §5.4 sorts equal-path cookies oldest-first, so a first-match-wins reader deterministically picked the stalest one: sign-in succeeded, the redirect authenticated with the wrong token, and the user landed back on the login screen. Only on a browser that had used both origins, which is why it reproduced on one machine and nowhere else.
    • readCookies returns every value; authenticateRequest tries each and the first that verifies wins. AuthResult carries cookieCount and the most informative failure reason, so the log distinguishes "no cookie" from "three cookies, none valid".
  • The login rate limit counted successes. A successful login proves the credentials are right; spending the anti-guessing budget on it means signing in and out across a few devices produces "Too many requests" for a legitimate user. Limits are now per-IP (30/15min) and per-email (10/15min), counted on failure only, and both buckets are cleared on success (clearRateLimit). humanWait renders the retry as "in about 4 minutes" rather than a bare "please wait a bit".
  • The bank-import account error is now on the field, not only at the top of the page. runBankTransform refused with setError('Choose a target account for every recognized file') and nothing else; on a phone that line is off-screen by the time the button is reachable, so the refusal was indistinguishable from the button doing nothing.
    • rowsMissingAccount(rows) is extracted and exported from importFlow.ts, and both the transform's guard and the UI's red-marking now call it — so what is coloured red is by construction exactly what the transform refuses on. Unrecognized rows are excluded: the transform skips them, so demanding an account there would be an error the user cannot clear.
    • bankFilesMissingAccount() gates that list behind showBankFieldErrors, set on the first failed attempt. Derived rather than stored, so filling one in clears its own error with no second submit and removing a row cannot leave a stale index behind.
    • AccountSelect gains invalid / invalidMessage: a --expense border plus a 1px ring (a 1px border on a 13px control is easy to miss on a phone, which is the screen this is for), aria-invalid="true", and the message under the control.
    • The row itself takes a red border and data-invalid="true", and the first offending row is scrolled into view — marking a field only helps if it is on screen.
  • vitest.config.ts now mirrors vite.config.ts's css.modules.localsConvention: 'camelCase'. Without it a kebab-case class reached through its camelCase name — styles.createCard for .create-card, which is how this codebase writes them — resolved to undefined under test, so every rendered component carried class="… undefined" and no test could assert on a class at all. Found by writing the first test that tried.
  • Tests: rowsMissingAccount (5) and AccountSelect.invalid (5). Five mutations run — flagging unrecognized rows, indexing among recognized rows only, dropping the invalid class, dropping aria-invalid, never rendering the message — each killed.

Removed

  • frontend/public/manifest.json — dead since VitePWA started generating manifest.webmanifest. Nothing linked it, and its short_name ("Circles") disagreed with the one actually being served.
  • Email verification for password accounts (Worker). users.email_verified has existed since 0001_init.sql and was written but never asked for: POST /api/auth/register inserted it as 0, and the only things that set it to 1 were Google's own email_verified claim and completing a password reset. Nothing read it — login did not check it and /api/auth/me did not return it, so a password signup was indistinguishable from a confirmed one.
    • 0022_email_verifications.sql — same shape and the same reasoning as password_resets (0005): only the token's SHA-256 is stored, single-use, superseded on resend, expiry checked at use time. 24h TTL, longer than the 2h reset TTL because a reset link is a live credential and a confirm link is not. The row keeps the email it was minted for as well as the user id.
    • GET /api/auth/verify-email?token=&returnTo= — a top-level navigation with nothing to fill in, so it does the work and bounces back to the app as #everified=1 / #everified_error=…, the way the Google callback already does. returnTo goes through isAllowedReturnTo, an unknown token and a spent one get the identical answer, the token is spent whatever the outcome, and the account's address must still be the one the link was sent to — otherwise changing it after asking for a link would confirm the NEW address on the strength of mail delivered to the old one.
    • POST /api/auth/resend-verification (session required) — 3/hour per address on top of the per-IP cap, and answers { ok: true, alreadyVerified: true } rather than an error when there is nothing to confirm. The 429 can be shown here, unlike forgot-password: the caller already proved the account is theirs, so there is no address-existence oracle to protect.
    • renderWelcome takes an optional verifyUrl, which turns the primary button into "Confirm your email" and demotes "Open Token Circles" to a text link. One mail rather than two — a welcome and a confirm arriving together read as a duplicate. renderEmailVerification is the stand-alone resend, where welcome copy would be wrong.
    • /api/auth/me returns email_verified; the banner is the only thing that reads it, and this is the call it already makes.
  • <VerifyEmailBanner/> — mounted at the top of <main>, above the page host, since the pages there stay mounted and hidden and a per-page home would render it once per page. Self-checking (asks /api/auth/me itself, re-asks on every session change, so it appears straight after an in-session signup), dismissible for the tab via sessionStorage. It shows nothing when /me omits email_verified — which is how the legacy self-hosted backend answers — rather than reading the absence as "unverified" and nagging every user of it with a Resend button that server has no endpoint for.
  • core/emailVerification.ts reads the #everified… fragment in index.tsx before render and strips it: it is not a page, so the hash router would resolve it to a 404, and a fragment left in the address bar re-announces the outcome on every reload.
  • Tests: worker/test/email-verification.test.ts (17) and frontend/src/{core,components}/__tests__/ (26). Each guard is covered by a test that fails without it — verified by mutation for the address-still-matches check, single-use consumption, the returnTo allow-list, the absent-field case and the Google-account case.

Notes

  • Worker only. The legacy Express backend has no /api/auth/register at all, and browser-only mode has no accounts, so there is nothing to verify in either.
  • Soft gate on purpose, copying the shape used in mercurypitch: the account works unverified and the banner is the only consequence. Making it a hard gate is a one-line change in login, but it strands anyone whose confirm mail is lost.

[5.9.3] — 2026-08-23

Fixed

  • POST /api/profiles/reseed-demo was additive. It deleted a hand-written list of seven tables (transactions, budgets, loans, categories, accounts, savings_goals, bills) and then called seedThreeTierProfiles(), which re-seeds a profile as soon as that profile has no transactions and then inserts into portfolio_holdings and recurring_transactions unconditionally. Neither table was ever deleted, so every call appended another full copy — a database reseeded four times held SPY x4 and VTI x4 — while the response still returned { ok: true, message: 'Demo data has been restored' }.
  • The same endpoint cleared one profile and re-seeded three. The clear ran against the active profile only, so the other two demo profiles kept their rows; since the seeder skips a profile that still has transactions, "restore the three example profiles" restored whichever one was active. A demo profile that had been emptied another way hit the opposite case — the seeder re-seeded it on top of the accounts, holdings and goals the clear never reached. It now clears every demo profile the caller owns before seeding, and answers 403 to a caller who owns none of them instead of wiping that caller's active profile.
  • DELETE /api/profile/data carried the identical seven-table list, so "clear this profile's data" left portfolio_holdings, recurring_transactions, tags, receipts, housings, category_mappings, budgets_zero_based, retirement_goals and emergency_fund_config in place. It now clears the same full set. Per-profile settings are still kept — they are configuration, not data.
  • ProfilesRepository.deleteAllDataForProfile deleted categories before budgets_zero_based and category_mappings, both of which hold real foreign keys into it while the connection runs with foreign_keys = ON. Deleting a profile that had either populated could fail on a constraint. The shared list is ordered children-before-parents.

Changed

  • backend/lib/profileTables.js is now the single source of truth for what belongs to a profile: 16 tables with a profile_id column plus 4 child tables reached through a parent (transaction_tags, loan_rate_periods, loan_prepayments, account_balance_history — the middle two have no foreign key at all, so nothing cascades them). routes/profiles.js, ProfilesRepository, scripts/nuke-demo.js and scripts/nuke-all.js all read it; the four copies they used to keep had already drifted apart.
  • ProfilesRepository gains clearDataForProfile(pid, { includeSettings }); deleteAllDataForProfile is that plus the profile row.

Added

  • backend/test/unit/routes/profile-data-clearing.test.js — in-process supertest against the real router, real repositories and the real seeder.
    • Reseed. Reseeds twice and asserts every table holds identical per-profile counts (Math.random is pinned, because the seeder randomizes how many dining/lunch/health rows it writes), asserts one holding per ticker, asserts a demo profile emptied by other means is rebuilt rather than doubled, asserts a stale row planted in profile 3 is gone after a reseed run from profile 1, and asserts a caller who owns none of the demo profiles gets a 403 with their own data untouched.
    • Clear. Plants a row in every per-profile table and then names the tables that still hold rows after DELETE /api/profile/data, so a failure says which table the delete list forgot rather than that a count was wrong. Rows are planted from PRAGMA table_info rather than a hand-written list, so a per-profile table added to schema.sql later is probed by the next run instead of being quietly skipped; child rows hang off a parent of the same profile, because loan_rate_periods and loan_prepayments declare no foreign key and PROFILE_CHILD_TABLES is the only place that link is written down. Also covers what the clear deliberately keeps — per-profile settings survive it, and deleting the profile outright takes them with it.
    • Schema drift. PROFILE_DATA_TABLES + settings must equal every table in schema.sql carrying a profile_id, so a new per-profile table cannot be added without landing in the shared list.
    • Eight of the twelve fail on the pre-fix tree. One fails with a 500 rather than an assertion: the old order deleted categories while budgets_zero_based and category_mappings still pointed at them. That path had no test at all — BE-PRF-019 only asserted the response says ok: true, which it also said while leaving holdings, tags, receipts and housing behind.

Notes

  • Legacy backend only. #375 ("make destructive operations complete") swept the same class of bug out of the IndexedDB adapter and the Worker but never touched backend/, which is what a self-hosted Docker install runs. The Worker's reseed-demo calls clearProfileData and has no three-tier seed; browser-only mode does clearAllData({ includeProfiles: true }) before seedDemoProfiles(). Both were already symmetric.

[5.9.2] — 2026-08-23

Added

  • shared/retirement.ts — a month-by-month projection model with no I/O, run by the Worker and by the browser-only storage layer, replacing three hand-written copies that disagreed with each other and with the chart the page drew from their output. Covers what the old code could not express: inflation as a real/nominal pair rather than a discarded parameter, an opening balance, planned income steps and annual raises, dated expense periods, several lifestyle targets at once, and a return band.
  • Simple and Advanced modes on the planner (frontend/src/features/RetirementPlanner.tsx, settings().mode: 'simple' | 'advanced'). Simple takes a contribution, a return and a target spend. Advanced projects income and spending separately — planned raises, a job change, a career break, dated periods of higher spending — and adds an allocation section ("Work the return out from an allocation") that derives the expected return from how the money is split rather than taking a typed rate. Both drive the same shared/retirement.ts projection; Simple is a reduced surface over it, not a second calculation.
  • Inflation is a control, not just a model parameter (RetirementPlanner.tsx). On, the chart reads in today's money and the target line is flat — which is the point of reading it that way, since a target that drifts with inflation cannot be aimed at. Off, everything is nominal. The rate is kept either way, so toggling is non-destructive.
  • shared/retirementSettings.ts — the saved shape of the assumptions, its normaliser, and derivation of unset fields from a user's accounts and transactions. The settings row is JSON last written by whatever version of the app saved it, so every field falls back rather than throwing; rates are clamped to a range a projection survives, expense windows that end before they start lose the end rather than silently contributing nothing, and duplicate lifestyle ids are made unique. Normalisation runs before storage as well as after, so the row can only ever hold something the model accepts.
  • GET/PUT /api/retirement/settings on both runtimes. GET returns the saved assumptions with anything unset derived, plus what was filled and where from, and what could not be answered from the data at all.
  • frontend/src/features/RetirementPlanner.tsx — the editable panel. The projection runs in the browser from the shared module, so the chart redraws on every keystroke instead of after a round trip, and still agrees with the server by construction. Only saving is a request.

Fixed

  • Every copy of the projection accumulated interest in a bucket that was never added back to the balance before the next month's return, so gains earned nothing. Over 30 years at 7% that is 303k where the answer is 761k. The model is checked against closed-form arithmetic — a lump sum has to land on pv * (1+r)^n, level contributions on the annuity future value — which the replaced code fails outright.
  • Annual rates were converted to monthly by dividing by twelve, which overstates the return by roughly 3% of itself at 8% and compounds from there. Now (1 + r)^(1/12) - 1 everywhere, including /api/calculators/retirement.
  • Real returns are netted with Fisher rather than by subtraction: 8.1% against 3.5% is 4.44% real, not 4.6%, which is ~11% of the final balance over 40 years.
  • /api/calculator/retire reported the balance after twice the projection horizon as "savings at retirement". It now reports the balance at the retirement age.
  • The browser-mode FIRE calculator accepted an inflationRate and discarded it. It is passed through.
  • /api/retirement/projection had always accepted overrides on the query string; the page called it with none, and had no controls that could have supplied any. The page now owns the inputs.

Changed

  • An income step now sets the salary outright instead of only raising it. It previously applied only when it beat what raises had already produced, so a sabbatical or a career change typed into the field was silently discarded and the chart did not move. Raises compound from whatever the step set, and a step already in force at the start month is the opening income. The spreadsheet fixtures are unaffected -- their steps all increase.
  • projectRetirement clamps the horizon at 150 years. No plan reaches it, but /api/calculator/retire builds a horizon from a retirement age taken straight from the request body, which could otherwise allocate a row per month without bound.
  • A month still being typed (2026) no longer counts as a start date. Comparing it yielded NaN, which fails every comparison, so an expense period quietly applied from the beginning of time while the user was mid-keystroke.
  • "Plan until age" is disabled, with a reason, until a date of birth is set: stopping at an age means nothing without a date to count it from, and the projection ignored the field.
  • The withdrawal-rate hint no longer prints "Infinityx your annual spending" when the field is cleared.
  • The retirement page's chart came from a fourth formula applied to the endpoint's output (cumulative += annual_contribution * (1 + return/100)^y), which is neither the endpoint's arithmetic nor correct. The page renders the shared model's own series.
  • Two e2e assertions on the retirement page stop swallowing a slow first paint into a fixed timeout, and retry properly instead.

Changed

  • Removed 84 verbatim-duplicated rules from five CSS modules — 519 lines, all pure deletions: CategoriesPage (-43 rules, lines 301-579 duplicated 580-858), BudgetsPage (-21), GoalsPage (-13), HousingPage (-5), RetirementPage (-2). Only rules whose selector and whole source span (comments included) were byte-identical were touched, and the last occurrence is the one kept — the copy that already won the cascade, so nothing that sat between the copies changes. A selector repeated with different declarations is a deliberate override and was left alone: .btn-primary appears twice in each of these files on purpose, the second time to apply the azure-glass recipe. This supersedes the note in 5.9.1 that the duplication was left for a separate change.

  • Verified by rebuilding before and after and comparing the emitted stylesheets: after normalising the CSS-module name hashes (they embed file content and line numbers, so every generated class name shifts), all five affected chunks expand to an identical ordered list of selector/declaration pairs. The only textual difference is in Retirement.css, where esbuild now merges .goal-balance and .goal-progress — adjacent once the duplicates were gone — into one selector list.

  • Ten selectors that overrode themselves are now single rules. .modal-overlay (Accounts), .analytics-chart / .rate-label / .rate-value (Analytics), .budget-summary / .stat-item / .btn-outline (Budgets), .goal-progress / .goal-actions (Goals) and .ruleEditor (Tags) were each declared twice in one file, the later copy quietly winning on some properties. They are merged into the first declaration, keeping the resolved value of every property.

  • Each merge is proven order-independent before it is applied: no rule between the copies has equal specificity, sets an involved property, and can land on the same element (checked against the class combinations the JSX actually puts on one element, so two single-class rules only count as a conflict when some element carries both). Declaration order was checked for shorthand/longhand hazards — border next to border-radius is not one, since border-radius is not part of the border shorthand.

  • Verified by rebuilding: every selector in every built chunk resolves to an identical set of declarations.

  • The primary-button skin is defined once, in styles/index.css. The azure-glass recipe was pasted into thirteen stylesheets, and in twelve of them appended a second time so it could override the solid fill the same file still declared — that appended block is what made deleting a duplicated rule look risky in the first place. Six tokens (--btn-primary-bg, -fg, -border, -shadow, -bg-hover, -border-hover) now name what the theme primitives are used for, and each page's single .btn-primary rule consumes them while keeping its own geometry. 240 lines removed, 116 added. Component modules that never got the retrofit (Layout, Spotlight, SettingsDialog, RecurringSection, DashboardSettings, BulkActionBar) are deliberately untouched: pulling them in would change how they look, not how they are written.

  • Each page's :hover and :hover:not(:disabled) rules are collapsed into one :hover:not(:disabled). That is the single deliberate behaviour change: hovering a disabled primary button no longer applies the hover style. It used to turn solid blue on nine pages (Dashboard, Transactions, Accounts, Budgets, Goals, Housing, Bills, Categories, Import), drop to 90% opacity on Retirement and brighten on Portfolio, because the plain :hover rule outranked the appended skin and nothing excluded disabled buttons.

  • Verified in a browser rather than on paper: a probe carrying each page's own hashed button class, measured base and hover across all 13 pages. 4,544 computed values compared for enabled buttons — zero differences. For disabled buttons the only differences are the eleven described above. Hover is a real mouse move and every measurement asserts el.matches(':hover'); an earlier attempt forced hover over CDP, which failed silently on some probes and hid most of these differences.

Removed

  • Nine CSS modules nothing imported, 629 lines that never reached a bundle: Button, Card, Filter, Table, ModalContent, ModalActions, TaskList, CategoryMultiSelect under components/, and Page under pages/. These are the shared-component stylesheets from the SolidJS migration whose contents were copied into each page module — the origin of the duplication above. They looked referenced under a substring grep: Button.module.css also matches ExportChartButton.module.css, and Page.module.css matches every *Page.module.css in features/.

Added

  • cssModuleHygiene.test.ts guards both defects for every *.module.css: no rule repeated verbatim inside one file, and no module left unimported. Both fail on the pre-change tree.
  • vitest.config.ts now sets css: true. Under the default (css: false) vitest short-circuits every CSS import to empty content, so a ?raw import of a stylesheet resolves to an empty string and any test asserting on stylesheet source passes vacuously (vitest#10788). Cost measured at roughly +1s on the full suite, with all 1001 tests unaffected.

Added — planner interaction

  • NumberField — a numeric input that renders once untracked and syncs from the model only while document.activeElement is not the input. A controlled value={n} compiles to an effect that writes on every model change, and a partly-typed number (3., -) makes <input type="number"> report value === '' while still showing the text, so any write at that instant discards the keystroke.
  • MonthPicker — a month <select> plus a year <select>, emitting and accepting YYYY-MM, replacing <input type="month">. The native control steps to a birth year one year at a time.
  • InfoTip rewritten. The first version used the native title attribute, which is hover-only: on a phone every explanation in the app was unreachable. It opens on hover, on focus and on tap, pins on click, closes on Escape / outside press / blur, and is position: fixed from the trigger's measured box so it escapes any overflow ancestor and occupies no layout. Writing its tests turned up that Escape closed the panel and the focus it handed back reopened it in the same tick, so Escape appeared to do nothing.
  • RangeField — a themed slider. Used for the withdrawal rate, paired with the existing number box, which doubles as its readout.
  • Toggle gains a compact size and an optional label rendered inside the button. Putting the text in the control is what makes clicking the words flip it and what names the control for a screen reader; a <label> wrapped round a <button> does neither. The pill moved into its own span, so a label-less toggle is the same 44x26 box it always was.
  • frontend/src/features/lifestyleMarkers.ts — a Chart.js plugin drawing a dashed line at each lifestyle's crossing with a pill label in that lifestyle's target-line colour. A plugin rather than an HTML overlay: it redraws with the chart on every data change, resize and theme swap, and clips to the plot area. Stateless — the markers arrive through options.plugins.lifestyleMarkers, because one plugin instance is shared across updates. Pills stack when they would overlap and labels are truncated with measureText.
  • frontend/src/features/chartZoom.ts — scroll, pinch and drag over the x scale's min/max, which a category scale reads as point indices, so the axis relabels itself from whatever range it is given. No new dependency: chartjs-plugin-zoom would have been one for behaviour that is a hundred lines of arithmetic, and the window maths is separated from the DOM so anchoring, clamping and gesture fall-through are testable without a canvas. A wheel that would zoom out from the full extent does not preventDefault, so the chart is not a trap you can never scroll past.
  • Chart takes an inline plugins array.
  • shared/retirement.ts gains yearsOfWithdrawals(swrPct, realReturnPct) — ln(s/(s-r)) / ln(1+r), with the pot cancelling out. Infinite when s <= r, 1/s at r = 0 (the formula's limit, where it is otherwise 0/0), zero at r <= -1.

Fixed — the planner

  • Editable lists used <For>, which keys by reference, over .map(x => ({...x})) — a new object per keystroke, so every row's DOM was disposed and rebuilt and focus went to <body>. Now <Index>, which keys by position. A .claude/skills/solid-forms skill records this and the controlled-input rule, with review greps, since it had been fixed and reintroduced before.
  • Derived numbers are rounded. A contribution derived as a difference of two averages could be 7.292500000001382, which is not a whole multiple of the field's step and so is :invalid — and one invalid field blocks the whole <form> from submitting, so the plan could not be saved at all.
  • deriveSettings decided "the user has not set this" by comparing the stored value to the default. Every default is also an ordinary answer, so saving one was indistinguishable from never having saved: a contribution of 500, a net worth of 0, an income or spending of 0, a retirement spend of 2000. It now takes the stored row rather than a normalised object and asks which keys are present — normalising invents a default for every absent key and destroys exactly the distinction the function turns on. A key counts as set when present and not null, since null is how the client says "no value" for an optional field such as birthMonth. All three loaders return raw rows to match. Mutation-checked: restoring the old sentinel for any of the five numeric fields fails a test each.
  • Both PUT /api/retirement/settings handlers re-derive and return filled/missing. Saving is what stops a field being derived, so a client that only took settings back went on crediting "filled in from your data" for figures the user had just typed.
  • In browser mode the settings store is keyed by key alone — no profile column — and the assumptions were saved under a bare retirement_settings, so every profile in the browser shared one plan. The profile is now part of the key; a row saved under the old key is adopted by whichever profile opens the page first and the old row removed. Both server runtimes were always correct, separating profiles through the settings table's (key, profile_id) primary key. The legacy backend keys per profile rather than sharing the Worker's plain key because its settings repository looks rows up by key alone with no profile filter.
  • The retirement page reloaded through onMount, which under the keep-alive page host (#317) fires once per session, so a profile switch left the panel showing the previous profile's plan. Now refetchOnActive, which refetches while visible and defers while hidden. Reverting it fails two of three tests.
  • GET/PUT /api/retirement/settings added to the legacy backend, which had no route for them — a guaranteed 404 on every visit, surfacing as an intermittent E2E failure whenever page-loading.spec.ts sampled the console at the wrong moment. The Import page was requesting endpoints that server never had for the same reason, with the same result; it no longer calls them when the backend is the legacy one.
  • verifyTurnstileDetailed reads Cloudflare's error-codes and separates a deployment fault (invalid-input-secret, missing-input-secret — logged, answered 503 with captcha_not_configured) from a client one (403). /api/health reports captcha: configured | disabled | missing, and secret:{dev,prod} now sets TURNSTILE_SECRET, which is how an environment came to be a secret short with nothing to notice it: 5caef64 switched the dev widget on, the dev worker had no secret, and verifyTurnstile took its fail-closed branch for every password sign-in from that day.

Changed — planner layout

  • Field hints move from block text under the controls into info tips on the labels. A field that carried one was taller than the field beside it, so its control sat out of line — the date-of-birth picker floating above the net worth box. An e2e test measures it: no field may carry text below its control, checked across every field in the form, so the next hint someone adds inline is caught wherever it lands.
  • The left rail is 440px rather than 360px, .form-row aligns on the end edge, and .list-row wraps rather than shrinking its month selects to 80px.
  • Skeleton placeholders are tinted from --primary via color-mix(in oklab, …) in both themes, at percentages chosen to keep their perceived weight (dark luminance 44.2 -> 42.8, light 215.9 -> 216.5).

[5.9.1] — 2026-08-22

Fixed

  • Orphaned categories route. App.tsx navigates to each spotlight step's requiredPage, and the Categories tour's page is categories — a route present in router.tsx but absent from navItems, so it was reachable only via the tour or a hand-typed #categories. Added to the sidebar between Transactions and Accounts. Bills' "Categories" is a count of subscription groups and Budgets' is an embedded editor, so neither replaces the standalone manager.
  • .category-header was display: flex with no gap; the 40px icon chip and the name rendered 0px apart. Set to gap: 12px, matching .catCardHeader on the Budgets page. The rule is triplicated in CategoriesPage.module.css (lines 570-839 duplicate 300-569 verbatim); all three copies were updated. The duplication itself is left for a separate change, since removing it can alter cascade order.
  • .color-btn / .color-picker-btn were 24px circles with no flex centring and default button padding, so the 12-14px check SVG sat on the text baseline instead of the centre. Now display: flex + padding: 0; measured offset from centre is 0x0 in both the card swatches and the modal.
  • Category icon fields were capped at maxlength="2" while advertising e.g., food, home, car. Raised to 32, and getCategorySvg now resolves a typed value through iconFromUserValue: exact iconNameMap key first, then the same keyword matching used on category names, so "food" and "groceries" land on real glyphs. Object.hasOwn guards the lookup so constructor / toString cannot resolve to a non-icon object now that longer strings are typeable. Applied to both Categories.tsx and the add-category modal in Budgets.tsx.
  • The icon preview is a createMemo, not a bare <CategoryIcon>: a Solid component body runs once, so passing the signal as a prop rendered the icon held at mount and never updated as the user typed.

Added

  • frontend/scripts/walk-tours.mjs (pnpm run test:tours) — walks every spotlight tour step in a real browser against the seeded demo account and fails a step on either the app's own targetMissing banner or a degenerate highlight rect. 51 steps across 15 tours, desktop and mobile. Not wired into CI by choice; it is a pre-tag gate, documented in the prod-update skill.
  • spotlightStore.test.ts gains two guardrails: every route in router.tsx must be reachable from the sidebar, and no tour may navigate to a page the sidebar omits. Both fail on the pre-fix tree.
  • .claude/skills/ is now tracked (.claude/* ignored, !.claude/skills/), carrying the tour-check and prod-update skills.

[5.9.0] — 2026-08-21

Added

  • Tag rules — saved filters that attach a tag to matching transactions, implemented identically in both runtimes. Matching semantics live in shared/tagRules.ts (imported by the Worker and by the IndexedDB handlers) so a rule can never match differently in cloud and local-first mode: normalization coerces any stored/POSTed blob into a complete criteria object, unknown fields narrow rather than widen a rule, inverted amount/date bounds are swapped, and empty criteria match nothing so a half-filled rule can never sweep the ledger during a bulk apply.
  • Storage: Worker migration 0021_tag_rules.sql (tag_rules with profile/tag/(profile_id, auto_apply) indexes and ON DELETE CASCADE from tags); IndexedDB DB_VERSION 11 → 12 adds a tagRules store with by_profile / by_tag indexes. Criteria are stored as an opaque JSON blob — rules are always evaluated in memory, never compiled into SQL, so new condition types need no migration.
  • API (both runtimes): GET /api/tags/summary, GET|POST /api/tags/rules, POST /api/tags/rules/preview, PUT|DELETE /api/tags/rules/:ruleId, POST /api/tags/:id/apply, GET /api/tags/:id/summary. Literal rules / summary segments are registered before /api/tags/:id (same ordering constraint as categories.ts /mappings), covered by a routing regression test. Apply is idempotent via INSERT OR IGNORE on transaction_tags; a single-rule apply pushes date/type/category/account conditions into SQL as a pre-filter only, with the shared matcher still making the final per-row decision, and reports scanned/truncated against a 20,000-row scan cap.
  • Transaction create in both runtimes applies auto_apply rules to the new row after the balance batch commits, fail-soft: a tagging error can never fail or roll back a transaction the user successfully saved.
  • New Tags page (features/Tags.tsx, registered in router.tsx, PageName, and the sidebar's Analytics group) with tag CRUD, per-tag totals for the global focus period, a monthly income/expense/transfer chart, a category breakdown, and a rule editor with dry-run preview and apply-to-existing. #transactions?tag=<id> deep-links into a filtered transactions list, adopted on hashchange as well as mount since pages stay mounted once visited. The link's source affordance is a "View" action on the tag chips rendered on the Transactions page itself, so a tag is a way into its own filtered list rather than only a label.
  • Destructive and backup manifests updated for the new table: tag_rules is listed before tags in the Worker's profile-cleanup and backup PROFILE_TABLES (FK on tag_id), included in Worker export/restore with tag_id remapped through the restore's tag map and validated against the backup's tag ids, and added to IndexedDB clearProfileData, clearAllData, export/import, and the backup validator's optional/profile-scoped array lists.
  • Bulk tag/untag endpoint POST /api/tags/:id/transactions ({ transactionIds, mode: 'add' | 'remove' }) in both runtimes, powering the Transactions selection-bar Tag action (Add/Remove toggle, multi-select chips, inline tag creation). Additive — adding leaves a row's other tags intact (unlike the whole-set PUT /api/transactions/:id/tags), and add is idempotent via INSERT OR IGNORE. Transaction ownership is validated against the active profile before linking, since linkTransactionsToTag is not itself profile-scoped (its rule-apply caller passes an already-scoped id list). TAG_RULE_SCAN_LIMIT moved into shared/tagRules.ts so the Worker's SQL LIMIT and the IndexedDB runtime's in-memory scan cap agree; the local scan now orders newest-first and reports real scanned/truncated.
  • Saved import sources ("Connected Sources") — a reusable Google-Sheet link with its column mapping, category types and schedule. Worker migration 0020_import_sources.sql plus routes/import-sources.ts; IndexedDB gets the mirror store and handlers/importSources.ts. The column mapping is persisted BY HEADER NAME rather than column index, resolved back to indices at fetch time (shared/importMapping.ts), so a source survives the sheet owner reordering columns.
  • Daily cron sheet sync (worker/src/import-sync.ts), wired into the Worker's scheduled handler on the 0 8 * * * trigger. Each schedule='daily' source is fetched server-side and run through the SHARED executeImport with a fresh importId, so the execute-side dedup lands only genuinely new rows and previously imported transactions are never disturbed. Best-effort per source: one unreachable sheet cannot stop the rest. Public sheets only — no credentials are stored.
  • shared/importNumber.ts — one number parser for both runtimes, replacing the divergent hand-rolled copies. A single . or , is always the decimal separator (never thousands grouping); with both present the last one wins; grouping is validated strictly, so 1,2,3 and 12 34 stay rejected. Values are rounded to two decimals, and the result carries flags (ambiguous-separator, rounded) that the caller turns into a per-row warning. The rounded flag fires only when the value actually moved half a cent, so float residue does not flag hundreds of clean rows.
  • shared/importCsv.ts — a single RFC 4180 scanner that tracks quote state across newlines, replacing two hand-rolled parsers that split into lines first. Both dropped any row containing a quoted line break and replaced it with shifted junk rows, silently. Also handles the "" escape and strips a leading BOM, which would otherwise ride along inside the first header and break a saved header→column mapping.
  • shared/importRowChecks.ts and shared/importRowLabel.ts — row-level validation and the human label used in rejections and warnings, shared so the two runtimes cannot diverge on which rows import.
  • Theme resolution split into applyTheme() (paints, does not persist) and setTheme() (persists), with hasExplicitChoice() deciding whether the OS preference is followed. Previously the first prefers-color-scheme change wrote a preference and the app stopped following the OS from then on.
  • core/hashRoute.ts centralizes hash→page resolution with explicit aliases and non-page routes, so an unknown hash renders a 404 page instead of leaving the previous page mounted.
  • Loading skeletons for the Transactions, Dashboard and Budgets pages, replacing the bare word "Loading". The app-wide .sr-only class the status roles depend on was missing and is now defined.
  • Tests for the daily sheet sync (worker/test/import-sync.test.ts) and for saved-source CRUD in both runtimes. The cron test pins the schedule string against wrangler.jsonc per environment — the coupling that would otherwise let a schedule edit switch the sync off with nothing failing — plus dedup across runs, header-name remapping, skip-without-syncing on a lost column, and per-profile isolation.

Changed

  • Account and Settings currency selectors now share one complete currency list. Currency inputs are normalized to uppercase three-letter codes instead of being limited by the old six-code frontend validation list.

Fixed

  • Local transaction lists now resolve tags from tag_ids against the tags store rather than trusting each row's denormalized copy, so renaming or recoloring a tag is reflected everywhere without a data migration; tagsUpdate/tagsDelete also write through to the stored copies, and deleting a tag drops its rules so it cannot keep auto-tagging.
  • Tag-rule apply/preview no longer exceed D1's ~100 bound-variable limit: the "already tagged" COUNT chunked its id IN-list at 100, so together with tag_id it bound 101 variables and returned 500 whenever a rule matched ≥100 rows (the "apply to all previous" case). The link helper and the preview loop now chunk at 90; a 105-row apply regression-tests it.
  • The single-rule date pushdown and the summary date window now compare substr(date, 1, 10) instead of the raw date column, matching the shared matcher's day-slice — so a transaction whose stored date carries a time component is no longer dropped from a same-day dateTo in the Worker while the IndexedDB runtime keeps it.
  • Tags page layout and affordances (no change to matching, storage or the API). Selection is stated rather than implied — a left rail, tinted surface and focus ring on the selected card, a context bar naming the tag in its own colour, and "Rules for " on the rules card; a lone tag selects itself, since leaving it unselected hid the rules behind a click nobody knew to make. The rule count moved out of the card's main button into its own button that selects the tag and scrolls to its rules ("Add rule" when there are none) — nested inside, it could not be clicked on its own. The rule editor's repeat(auto-fit, minmax(230px, 1fr)) packed ten unrelated fields into four columns on a wide screen; it is now a capped single column in four labelled sections. Multi-rule OR is stated on screen, and #transactions?tag=<id> appends &period=all when the tag has nothing in the focus period, so the link cannot land on an empty table that reads as a broken filter.
  • Tags page: the detail chart and category breakdown refetch after "apply to existing"; an open rule draft resets when the selected tag changes (it no longer silently retargets the rule to the newly-selected tag); an in-flight preview can no longer overwrite a newer edit; the rule editor's category/account chips are scoped to the active profile; and the local PUT /api/tags/rules/:id returns { ok } to match the Worker and the client type.
  • Destructive operations now use complete, child-first cleanup manifests. Worker/D1 executes profile cleanup atomically with DB.batch, removes receipt objects from R2, and includes account history, transaction-tag links, loan rate/prepayment children, mappings, import logs, and every profile-owned feature table. IndexedDB uses one multi-store transaction and deletes balance history by the target account IDs. Reset All targets every profile owned by the signed-in user while preserving the profile records; client-only demo reseeding is the only action that replaces profiles. Account deletion is enabled with typed confirmation in production and removes user-scoped reports, error logs, reminders, reset tokens, and all profile data.
  • Category reset preserves canonical default category IDs where possible, updates their metadata, detaches nullable references to removed custom categories, deletes dependent budgets that require a category, and reseeds the same default set in both runtimes. Regression tests cover cross-profile survival, all supported stores/tables, R2 deletion, category referential integrity, account deletion, and D1 rollback on an injected failure.
  • Account starting/current-balance fields are locale-safe text inputs: the raw value is preserved while typing so the caret does not jump, and submission accepts either comma or dot decimals while rejecting ambiguous thousands-separated values.
  • Manual account creation and import-created accounts now use the configured local currency in both the IndexedDB/serverless and Cloudflare Worker paths. Missing or malformed currency preferences fall back to EUR; currency-less imported transactions use the same fallback so their account and ledger currency cannot diverge. Worker account/settings defaults were aligned to EUR.
  • Subscription catalogue custom prices now have separate draft and committed state: typing preserves raw comma/dot input and caret position, the row checkmark validates and visibly commits the normalized price/total, and batch Add validates and commits any remaining drafts. Invalid, zero, or ambiguous values stay highlighted and never reach /api/bills; component tests cover checkmark commit, API payload, malformed input, and caret preservation.
  • Bill and Housing modal headers now share the compact OrbitalAccent, replacing their straight header rule with the branded orbit. Their shared ToggleField keeps Autopay as a borderless title/subtitle and switch row with stable narrow-modal layout and aria-labelledby/aria-describedby wiring.
  • Bill mutations now include autopay; IndexedDB create/update responses normalize it to a boolean, and Worker/D1 adds and persists the missing bills.autopay column. Worker partial updates preserve unrelated bill fields. Regression tests cover the form payload plus local and Worker create/list/update/get round trips.
  • Account recent-activity amounts now use accountActivityPresentation() for explicit income, expense, and transfer states. Transfers use var(--transfer) and a neutral ± prefix rather than falling through to the green income presentation.
  • Import no longer rejects a row for having no description, and no longer rejects a row for having no date — a dateless row imports dated today and says so. The blank-description rejection existed only in the IndexedDB runtime, so the same sheet imported cleanly in cloud mode while silently losing hundreds of rows locally.
  • Rejected-row messages identify the row by its date and description instead of a bare index, and a self-transfer names the account both legs resolved to and the column each came from. The preview surfaces the per-row warnings (rounded amount, guessed date) alongside the rejections.
  • The import preview's row numbers now match the spreadsheet's own row numbers (sourceRowNumber), instead of being one off.
  • The daily sheet sync records rows_skipped_invalid and rows_with_warnings in the session it writes to Recent Imports, and no longer stamps last_synced_at when executeImport rejected the batch. Nothing is watching a cron run, so a guessed date or a rounded amount had no way to reach the user at all.
  • E2E: the transaction-create spec pinned a hardcoded future date that the calendar eventually overtook, failing the suite on a date rather than a change.

[5.8.0] — 2026-07-21

Added

  • Delete-a-recent-import (undo a batch). Serverless now stamps import_id on inserted transactions (the worker already did); a new DELETE /api/import-logs/:id on both runtimes deletes the batch's transactions by import_id, recomputes account balances, and drops the log row. Imports predating batch stamping (no import_id) delete 0 transactions and just clear the log entry. Frontend: a confirm-guarded "Delete import" button on each Recent Imports entry (toast feedback). (#369)
  • new_accounts in the import dry-run response — serverless detectNewAccounts, worker newAccts — surfaced as a "New accounts to create" list in the preview (the account-typed counterpart to the existing new-categories list, which excludes account values). (#368)

Changed

  • Import dedup is multiplicity-aware. A row is skipped only when it matches a transaction that already existed before this import, consuming one matching amount per row from a per-key multiset; identical rows within a single import all import instead of collapsing to one. Bank/1money rows carry a date but no time, so genuine same-day repeats (multiple UPLATA NAKNADE fees, repeated same-amount top-ups) were being silently dropped and balances understated. A re-import still dedupes (existing copies consume the incoming ones one-for-one). Preview: within-batch identical rows are "potential duplicates", selected and imported by default (bank-file uploads, which dedupe on a per-second timestamp, stay deselected), each showing the counterpart row it matches (date · description · amount / = row N). Applied to the serverless (IndexedDB) and Cloudflare worker execute paths + detectDuplicates; the Express backend is intentionally out of scope (see ROADMAP). (#368)

Fixed

  • Serverless import now seeds its account map with all existing accounts by name (matching the worker/Express) and falls back to it for the source (means_of_payment) leg of any transaction type — so a transfer whose destination names an existing account resolves both legs instead of one-siding (transfer_account_id null) and draining the source. Also adds a detectNewAccounts preview list. (#368)
  • Account-map keys are trimmed as well as lowercased on both creation/seed and per-row resolution (worker loadAccounts key + created account name, serverless normalizeKeys), so stray whitespace in a category/account value (e.g. Revolut from a sheet cell) no longer stores the account under revolut while the trimmed lookup revolut misses it. On the worker — which resolves the two legs independently — that mismatch dropped only the destination and showed Erste Current → — on a fresh import; gviz strips trailing whitespace, so the sheet looked clean. (#370)
  • fromToLabels now renders an account-to-account transfer's destination from the resolved transfer_account_id account name. The destination of such a transfer lives in transfer_account_id (not a category), so category_name is null and the "to" collapsed to — even though the leg was linked and the balance correct. TransactionTable builds an id→name map from the accounts it is now passed and hands the resolved from/to names to fromToLabels (falling back to the stored means_of_payment / category text). Display-only; no data change. (#372)

[5.7.1] — 2026-07-17

Fixed

  • SubscriptionCatalogModal: the price ✓ was a decorative aria-hidden selected-indicator with no handler — clicking it bubbled to the row toggle and deselected the item, discarding the typed price (re-selecting reset to the catalog default). Now a real apply button: stopPropagation, normalize the raw text (,→., empty → catalog default) and keep the item selected; Enter in the field applies too. .check is inert (pointer-events:none) until .tok.on. The submitted amount always flowed through priceOf() at read time, so this is a display/UX fix, not a data fix.
  • Empty-state create button was left-aligned: .empty-state used text-align:center, which centers text but not the display:flex button. Now a centered flex column across Goals/Housing/Retirement/Budgets/Accounts/Categories (Bills already had it; Dashboard has no CTA). Loans has no empty-state styling at all — separate follow-up.
  • Quick Add categories (⌘K command bar + Guided Orbit) were loaded once at app mount and never refreshed, so after a profile switch the picker showed the previous profile's categories, the natural-language parser matched foreign ones, and an entry could be saved with a category_id not in the active profile (silently failing to add) until a full reload. A shared reloadQuickAddCategories() now runs on profile switch (profileVersion) + sign-in and on each quick-add open (category CRUD refetches locally without bumping profileVersion, so the open-trigger is needed alongside the switch-trigger). Ordering is safe: selectProfile writes currentProfileId before bumping the version, and the profile id is read from localStorage at request time.
  • Guided Orbit (the floating + quick-add) shows on desktop but had no title and forced clicking the on-screen keypad: added an "Add transaction" heading and physical-keyboard entry while open — digits / . / Backspace / Enter (advance, or submit on the confirm step) / Escape (close), with a modifier-key guard so ⌘K/Ctrl+digit shortcuts aren't hijacked. The confirm step's text/date inputs keep their own typing; touch users keep the keypad.

[5.7.0] — 2026-07-17

Added

  • Bank import adapters for N26, Wise (per-currency balance statement), ING NL, Sparkasse (CSV-CAMT), DKB (post-2023 + legacy), and a YNAB-format CSV bridge (Date,Payee,[Category,]Memo,Outflow,Inflow / signed Amount) — the de-facto interchange format, so bank2ynab (MIT, ~145 banks) output imports directly. All client-side (statements never leave the browser). Adapters detect by header content via indexHeader (vintage-drift-proof, resolves columns by name); filename hints are word-bounded / full-shape so lookalikes don't false-positive (jan26.csv ≠ N26, statement_2026_jan_… ≠ Wise). Shared parse.ts gained indexHeader, decodeTextSniffed (UTF-8→cp1252 fallback for Sparkasse/DKB legacy), and normalizeDate support for YYYYMMDD / DD-MM-YYYY / DD.MM.YY (century pivot) — strictly day-first with a plausibility gate so a stray number in a date column stays invalid; the YNAB adapter decides date order once per file (a mixed US export can't import under two conventions) and tolerates currency symbols / accounting negatives. Synthetic-fixture tests per adapter + a registry cross-detection guard. Deferred: Croatian RBA/ZABA/Karlovačka (await real exports), a config-driven long-tail adapter, PDF statements.
  • Reusable Pill component (glass capsule + satellite dot), used for the importer's supported-bank/format chips. Onboarding welcome-step "Use local-only" switch (server mode): honest confirm about any existing local workspace, then suppress the demo seed, clear the onboarding flag + stale server profile-selection keys, flip storage to serverless, and reload into a pristine local wizard.

Changed

  • Register → auto sign-in: LoginScreen/LoginModal obtain a fresh Turnstile token after register resolves and log in with the just-entered credentials, landing in the app (a pristine profile opens onboarding). Branded "signing you in" transition; on failure (existing email / captcha) a colored success-tinted notice drops to manual sign-in, preserving the worker's anti-enumeration (login is not gated on email_verified). LoginModal dismissal can't reload the page out from under the user. Fixed stale api.ts JSDoc claiming register/reset set a session cookie.
  • Onboarding import step: the wizard footer now carries the flow's true action per sub-step — mapping → "Continue to preview", preview → live "Import selected (N)" (disabled at 0) with a "Don't import" ghost escape — and Back walks the import sub-steps in reverse. ImportMappingStep/ImportPreviewStep hide their in-body action rows in the embedded (wizard) context only; the standalone Import page is unchanged. Dropzones gained a files-only drag-over highlight and an inline OrbitSpinner while reading, with a nextPaint() yield (raced against a timeout so a hidden tab can't hang) so the spinner paints before the synchronous XLSX.read. Removed the internal-sounding "works in serverless mode — no CORS" copy from the paste tab (parsing is client-side in both modes).
  • Confirmation UX unified: ConfirmButton now opens the shared centered ConfirmDialog (was an inline Confirm?/Yes/No that overflowed narrow cards) across 11 call sites, and the direct showConfirm delete callers (Transactions, RecurringSection) match; confirmStore.showConfirm gained {confirmText, cancelText, danger} → a red confirm for destructive actions (role="alertdialog"/aria-modal, icon triggers gained aria-label). Autopay control → branded Toggle (was an unstyled native checkbox — Bills' .toggleSwitch class wasn't even defined) in the bill and housing forms; Toggle gained a data-test-id passthrough. BillCalendar day popover uses a solid --surface background (was a 22%-transparent glass that let day numbers bleed through). The import preview's collapsible rules editor is spaced off the action bar and table. New confirmStore unit tests; housing/goals-crud specs updated to the modal flow.

Fixed

  • Deploy-update pipeline hardened end to end after the v5.6.0/v5.6.1 transition storm (multiple reloads, "Update needed" panel, version label reading 5.6.0 while 5.6.1 code ran — full audit in docs/deploy-update-pipeline.md). Root causes and fixes: (1) the SW precached index.html and served it for all navigations, so a version-mismatch reload was re-served the OLD shell by the OLD worker whose chunks were already deleted server-side — index.html is no longer precached, navigateFallback is off, and navigations are NetworkFirst (finance-manager-pages-v1, 4 s offline-fallback timeout), making a plain reload always land on the current build when online; (2) every auto-reload path (appVersion, bootRecovery) now refreshes the service worker first — activateUpdatedServiceWorker() triggers registration.update() and waits (bounded 4 s phases) for the skipWaiting+clientsClaim takeover — so one reload suffices; (3) reloads are hard-bounded: one per server sha plus a rolling cap of 3 per 10 minutes across shas (tc-version-reload-times), and the pre-boot watchdog moved from once-per-SESSION to a 2-minute cooldown so the second release of the day auto-recovers instead of landing on the panel; (4) APP_VERSION now uses git describe --tags without --abbrev=0, so a non-tag prod build (workflow_dispatch from main, Workers Builds) stamps 5.6.0-2-gf6ba930 instead of impersonating the previous release — the source of the lying label; (5) the displayed version (login footer, Settings About, crash modal) comes from a reconciled displayVersion() signal: when version.json reports the same sha under a different version string the network string wins, and while an update is pending Settings shows "vNEW available, loads on your next navigation" (serverVersion()); (6) the per-release SW unregister in index.html (keyed on package.json version — a third, divergent version source) became a one-time SW_CLEANUP_EPOCH migration that re-registers after unregistering, removing the register/unregister race on every release's first load; (7) the js/css runtime cache maxAge went from 5 minutes to 7 days — online loads are NetworkFirst anyway, and 5 minutes made offline boots fail for any tab older than one poll. Decision logic covered by new unit tests (appVersion.test.ts, bootRecovery.test.ts, 25 cases); the SW handoff itself has documented manual verification steps.

[5.6.1] — 2026-07-17

Fixed

  • Subscription scan detected nothing in SERVER (worker/self-hosted) mode — the second instance of the 5.6.0 onboarding-trigger bug: SubscriptionScan fetched /api/transactions expecting a bare array, but the server returns the paginated envelope { rows, total, limit, offset }; the defensive Array.isArray fallback silently scanned an empty list, so every scan (Bills, Import post-import prompt, onboarding wizard step — one shared component) reported "No known subscriptions found". Serverless returns bare arrays, which is why demo-mode testing looked fine. Fixed with a shared listRows normalizer in core/api.ts (bare array OR {rows} envelope → array; unknown → []), now the required idiom for any apiGet of a list endpoint. Covered by unit tests and subscription-scan-server.spec.ts — a server-mode e2e that seeds recurring charges via the API, pins the envelope shape as a precondition, and asserts detections render (verified to fail against the unfixed code). Detection quality itself was validated against a real 6.5-month Revolut statement: 8 subscriptions found (harness kept out of the repo — personal data).

[5.6.0] — 2026-07-16

Added

  • OrbitalDivider — the brand's section separator: a thin orbit arc spanning the row with small planets resting on it (one warm, two muted, placed on the curve), the section title docked left like a station label, and an actions slot on the right. The arc draws itself in and planets drift into place when scrolled into view (rect-check based — no IntersectionObserver/rAF, so it also behaves in throttled tabs; disabled under prefers-reduced-motion). Ships with OrbitalAction, a glass pill button whose leading planet-dot orbits on hover (primary variant uses the warm accent instead of solid blue). First applied across the Budgets page; intended to roll out app-wide.
  • SectionRail — a fixed vertical orbit on the right edge (desktop ≥1280px) listing the page's sections as small planets: the one nearest the viewport focus lights up with a slowly rotating dashed orbit ring, hovering shows a label chip, clicking glides to the section. Anchors are OrbitalDivider ids; sampled on Budgets.

Added

  • OrbitalToggle — the brand's celestial switch: the knob is the sun riding an orbit-arc track by day; flipping it slides it across into a star-flecked night where it becomes a planet with a slowly turning dashed orbit ring. Swapped in for the light/dark theme toggle in Settings (the plain branded Toggle stays for ordinary settings).

Changed

  • Primary buttons across the app (Add Loan, Set Budget, Add Holding, Add Bill, Mark Paid, Add Transaction, Import, …) now use the Settings brand recipe — azure glass tint, azure text, mixed border and glow — instead of the old solid blue fill (12 page stylesheets, appended overrides).
  • Calculators joined the orbital design: Compound Interest's Detailed Projection / Scenario Comparison / Scenario Details and Emergency Fund's coverage sections now use OrbitalDividers above their cards; Emergency Fund's coverage chart gained a proper section title ("Coverage by Fund Level" with an explainer tooltip), and the pointless Show/Hide Details toggle on Coverage Levels was removed — the details always show.
  • Analytics' Savings Rate instrument: the % and its label no longer sit crammed side by side in a 100px circle (the label wrapped) — it is now a proper hero stat: large value, "Savings Rate" subtitle beneath, and a period note ("across 2026").
  • Analytics got the full orbital treatment: every instrument's title moved out of its card header into an OrbitalDivider above the card (dynamic year/period rides in the divider's meta; the Top Categories explainer in its info tooltip), header rows keep their controls right-aligned, the two-column row wraps each card in a plain column so dividers sit on the page background, a 9-stop SectionRail jumps between sections, and the page subtitle became an InfoTip next to the title.
  • Divider placement corrected wherever a divider had landed inside a glass card instead of above it (Goals progress/projections, Housing subscription tracker, Retirement projections, Portfolio holdings/allocation — Portfolio's card visuals moved onto the inner surfaces). Verified by walking every divider's ancestor chain on all ten pages: none sit inside a carded container.
  • OrbitalDividers rolled out across the app: Goals (Progress, Projections), Loans (Overview), Portfolio (Holdings, Allocation), Retirement (Projections, Goals), Bills (Unpaid/Paid with live counts in the divider's meta slot), Housing (Subscription Tracker with the monthly total as meta), Accounts (Net Worth Map), and Counterparties (Balance Meridian, By Counterparty). The divider gained an optional meta note (count / total after the label). Analytics is the deliberate holdout — its section titles live inside card headers together with live controls (year pickers, compare toggles, export buttons), so its migration (titles + controls into divider action slots, plus a SectionRail) is a focused follow-up.
  • Dashboard period stepping polished further: the two dashboard fetches now commit their signals together in one batch() (a single visual wave instead of widgets repainting as each fetch lands), Chart.js in-place updates skip the update tween (update('none') — rapid stepping reads as calm data changes instead of every chart re-animating), and the OverviewDeck's three internal resources (heatmap, budget radar, portfolio) read .latest so profile/year changes can't re-trigger the page-level Suspense.
  • Stepping the focus period no longer flashes/reloads the whole view. Two causes fixed: (1) resource-backed pages (Budgets, Bills, Accounts, Categories, Analytics, Bill calendar) read resource.latest instead of resource(), so a refetch keeps the previous data on screen rather than re-triggering the page-level Suspense fallback; (2) the shared Chart.js wrapper now updates the live chart in place (chart.update()) instead of destroy + async re-create, so Dashboard's charts transition smoothly between periods instead of blanking and re-animating from zero.
  • Budgets: section headers are now OrbitalDividers — the bulk allocation tools and "Add Allocation" dock in the Category Allocations divider, "Add Category" docks in the Categories divider (orbital pill style replaces the solid blue buttons), and the Budget Forecast card lost its duplicate inner title. Sections breathe again (the forecast card no longer sits glued to the chart above), the categories gallery shows ~3–4 rows before scrolling (was ~2), and the "Zero-based budgeting" subtitle moved into an info tooltip next to the page title (it wrapped badly on phones).

Added — Onboarding

  • First-run onboarding wizard (components/onboarding/), a six-step orbital flow shown once to pristine profiles: welcome → name your space (rename the default profile / create one, pick base currency) → first account(s) → bring your data (the real import flow, embedded) → auto-detected subscriptions → orbit-complete celebration. Full-screen night-sky overlay with animated dotted orbit rings + drifting token satellites, a fill-as-you-go progress ring, and a done-state ring that fills to 100% — all continuous motion gated behind prefers-reduced-motion. Every step is skippable (are-you-sure confirms where data would be lost, incl. Escape), and a relaunched wizard recognizes existing accounts instead of pitching "your first account".
  • Onboarding trigger + memory (core/onboardingStore.ts): auto-opens only when the profile has zero accounts AND zero transactions AND zero bills AND no recorded decision. Finishing/skipping stamps finance_onboarding in localStorage AND mirrors the decision into the per-profile settings KV (PUT /api/settings), so in server mode a completion/skip on one device is respected everywhere (the trigger check reads the KV and caches it locally). Relaunch from Settings → About → "Run setup wizard" or What's New → the tour menu.
  • Subscription auto-detection (features/subscriptionDetection.ts, pure + 30 table-driven tests): scans transactions for recurring charges matching the catalogue/brand registry (Netflix, Spotify, Claude, 40+), with token matching + a bounded typo budget, cadence inference from the median charge gap (weekly/biweekly/monthly/yearly), catalogue-plan matching (an 18.00 charge → Claude Pro), a dominant-amount-cluster pass that keeps a real Prime cadence detectable amid Amazon shopping, and a guard that only proposes ambiguous mega-retailer tokens with a stable recurring amount. Reviewed via SubscriptionScan (brand icons, editable price/period, per-row selection) — surfaced in the wizard, Bills → Subscriptions → "Scan transactions", and a post-import prompt on the Import page.
  • AccountSelect — account dropdown with in-place "New account…" creation, used by the bank-statement import's per-file target picker (Import page + wizard) so a multi-bank import can create its target accounts without leaving the flow.
  • Branded transactional email system (worker/src/emailTemplates.ts): every mail (welcome, account-exists, password reset, budget alert, spending report, upcoming-bills reminder, support ack, test) rendered by pure functions returning { subject, html, text } on a shared orbital shell — hosted logo + a small looping orbit GIF ornament (frontend/public/email/orbit.gif), bulletproof 600px table layout, dark-only color-scheme, hidden preheader, and a footer with app/about/GitHub/Terms/Privacy/Contact links + unsubscribe. Plain-text twins now ship with every Resend send. Mail assets load from the SENDING environment's app origin (dev mails never depend on a prod release). Reminder amounts render in the profile's display currency instead of hardcoded dollars.
  • Orbital loading system (components/OrbitSpinner.tsx): a binary planet-pair circling a luminous core (warm satellite on the outer ring), plus OrbitBootScreen — the full-screen branded boot gate (hero-sized spinner + wordmark) that replaces the bare "Loading…". Used for the boot gate, the shell Suspense fallback, import overlays, and the subscription scan.

Changed — Onboarding / Import

  • Import page decomposed into reusable modules (features/import/): a headless createImportFlow controller holds all pipeline state + actions, and ImportDataEntry/ImportMappingStep/ImportPreviewStep/BankRulesEditor render it — shared verbatim by the Import page and the onboarding wizard. Behavior unchanged on the page.
  • Import preview rebuilt as a stacked command panel: stats (total/selected/duplicates) + action buttons on the command row, a compact "Backfill budgets from spending" checkbox (full explanation moved into an InfoTip) on an options row, and duplicate/dry-run/new-category notices stacked below — replacing the single cramped flex row.
  • Re-import honesty: the preview dry-run now reports how many rows the dedup pass will skip ("Everything here was already imported"), the result message names already-imported counts in both storage modes, and the import log records total duplicates avoided — a repeat import no longer reads as a bare "Imported 0".
  • Brand-new Google sign-ins now receive the welcome email (previously only email/password registrations did); resolveGoogleUser returns a created flag so the OAuth callback sends it best-effort.
  • Scheduled reminder emails (budget alerts, spending reports, upcoming bills) now fire in PRODUCTION: the triggers.crons block was added to worker env.prod — previously it existed only in env.dev, so prod never sent them. The upcoming-bills reminder (daily cron) was ported from the legacy Node backend, with its own email_bills_reminders toggle, Settings UI toggle + preview button, and the same plan/quota/dedup gating.
  • Login screen: inline email-format validation (the field turns red with "That doesn't look like a valid email address" once touched, rejecting malformed input before it burns a captcha token) and a "Complete the verification above to continue" hint explaining the disabled submit while Turnstile is pending.

Fixed — Onboarding / charts / CSP

  • CategoryOrbits (spending/allocation rings on Portfolio, Budgets, Analytics, Loans) rendered as a broken donut at both extremes: sparse charts (2–3 rows) piled every arc onto one side from 12 o'clock with a near-full sweep's caps colliding into a notch, and dense charts (7–9 rows on a fixed 13px step) marched the innermost ring to radius 0 and the core to a negative radius. Ring spacing is now adaptive (fits between the outer radius and a 46px inner minimum, strokes slimming to match), the core radius is clamped, launch angles stagger evenly so arcs interleave like orbits, tiny shares get a pixel floor, and near-full sweeps get a cap-collision clamp.
  • Bank-statement drops no longer fail silently: file analysis ran inside a void'ed Promise.all, so one rejected read vanished and only a second drop "worked". Now snapshots the file list synchronously, shows the loading overlay while parsing, uses allSettled so one bad file can't sink the rest, and surfaces per-file read errors.
  • Onboarding never auto-opened in SERVER (self-hosted / worker) mode — the pristine-check read /api/transactions as a bare array, but the server returns a paginated envelope { rows, total, limit, offset }, so Array.isArray(transactions) was always false and the wizard never triggered for a real email/Google signup. shouldOfferOnboarding now uses a shape-tolerant collectionIsEmpty (handles arrays AND { rows }/{ total }), covered by unit tests and a new server-mode e2e (onboarding-server.spec.ts) that logs in and asserts a pristine profile opens the wizard. Serverless mode was unaffected (it returns bare arrays), which is why the earlier serverless-only tests passed.
  • The onboarding account step recognizes accounts already on the profile when the wizard is relaunched (previously a five-account user still saw "Create your first account" and "Continue without an account").
  • Zod's JIT-capability probe (new Function('')) — a securitypolicyviolation under the app's CSP — is disabled via z.config({ jitless: true }), imported first by each schema module (core/zodConfig.ts; the probe fires at schema-definition time and, verified against the production bundle, an entry-level import is too late under Rollup chunking). Parsing behavior is identical; the browser used the interpreter path anyway.
  • The app icon (frontend/public/icon-192.png) was a top-left crop of the logo — regenerated from icon-192.svg as the full mark, fixing both the email masthead and the PWA icon.
  • Boot/Suspense theme flash removed: frontend/public/theme-init.js (external, CSP-safe) stamps the saved theme before first paint.
  • The Node self-hosted backend stubs GET /api/billing/status (a worker-only Stripe feature) so the client's boot-time plan probe stops logging a 404.
  • Flaky e2e: the Goals "progress percentage" reactive test asserted an absolute card count (initialCards + 1) that raced against parallel goal specs on the shared backend (~50% failure on main) — now waits for the uniquely-named goal card, matching its sibling test.

[5.5.0] — 2026-07-15

Added

  • Shareable demo links (?demo=high|mid|low): a link switches the app into client-only demo mode and seeds a sample profile before render (the entry applies it before <App/> reads the storage mode), then strips the ?demo= query from the address bar once applied.

Changed

  • Self-hosted the web fonts (Inter, Fraunces, JetBrains Mono) via @fontsource (latin + latin-ext subsets) and removed the render-blocking cross-origin Google Fonts <link> + preconnects. Removes the third-party dependency and its CSP violations, and lets headings render offline. Fonts are content-hashed into /assets and precached by the service worker.
  • The dashboard "Upcoming Bills" widget now shows each bill's real icon instead of a generic clock: known subscriptions/brands use their brand mark, other bills use their category icon, and the clock remains only as a last-resort fallback.
  • The Analytics spending heatmap now draws noticeably larger cells (and scales its height to match) so the year reads clearly, instead of the previous small/zoomed-out grid.

Fixed

  • Eliminated the "white screen after a deploy" failure class (a stale service worker serving an old index.html + the host returning index.html, 200 text/html, for deleted hashed chunks → Failed to load module script MIME errors). A front Worker (frontend/server/assets-worker.ts, assets not_found_handling: "none") now returns a real 404 for a missing /assets/* and falls back to index.html only for navigations; _headers cache tiers make hashed assets immutable and index.html/sw.js/version.json no-cache; the workbox SW gained cleanupOutdatedCaches, skipWaiting/clientsClaim, a navigate-fallback denylist for /assets, /api, and version.json, 200-only caching, and fresh cache names; a version.json poller reloads onto a new build at the next navigation (toast fallback); and a pre-JS boot watchdog in index.html plus a vite:preloadError/chunk-error handler (core/bootRecovery.ts) recover when the bundle itself can't load. The crash modal can now clear the service worker + Cache Storage without wiping user data.
  • Removed upgrade-insecure-requests from the report-only CSP (browsers ignore it there and log a warning); it remains in the enforcing policy. Dropped the Google Fonts origins from the policy now that fonts are self-hosted. (Known remaining report-only finding, left visible for a future CSP-enforce decision: a vendored library trips unsafe-eval via a benign Function("return this") global-object probe.)
  • CI: dev deploys now show the real build version instead of a placeholder.
  • The Apple subscription icon was a solid black mark on a near-transparent chip, so it vanished in dark mode; it now sits on Apple's light chip and stays visible in both themes.
  • Modals are now responsive on small and short screens: overlays scroll vertically and top-align tall dialogs (with a consistent 16px margin) so nothing is clipped off the top or bottom, and modal containers are capped at calc(100vw - 2rem) / calc(100dvh - 2rem) with box-sizing: border-box so they never force horizontal scrolling. Applied consistently across the feature-page modals (Add Transaction, Add Bill/Subscription, Accounts, Goals, Budgets, Portfolio, Housing, Loans, Retirement, Categories) and the shared modal components. Verified headlessly at 390×844 (phone) and 900×420 (landscape).

[5.3.0] - 2026-07-13

Changed

  • The dashboard "Dashboard Views" button is now a compact "Views" button with a properly sized eye icon (the cog rendered oversized because the icon had no explicit dimensions) and a tooltip explaining it shows/hides widgets; dashboard widget cards (Budget Alerts, Savings Rate) now keep the same vertical spacing as the other cards instead of gluing to whatever follows.
  • The dashboard header is now two rows: the title on the left with the view actions (Dashboard Views, Refresh) anchored right, and all period controls (month navigator + quick-select) together on their own row below — no more cramming everything onto one line.
  • The dashboard period selector is now a compact segmented control (Today / Week / Month / Quarter / Year / 7D / 30D / 90D / All) that fits on one row — about half the header on desktop — and scrolls horizontally on phones instead of wrapping into multiple rows. Full period names show as tooltips.

Fixed

  • Budgets: changing an existing category allocation failed with a 400 ("Budget already exists"). Allocating is now an upsert — re-allocating a category for the same month updates the amount — and the per-category action stays available as a Change button (pre-filled with the current amount) once a budget is set, instead of disappearing.
  • Budgets: the 6-month forecast under-projected any month that fell in the next year — the inflation adjustment was derived from the month-of-year alone, so a forecast crossing a year boundary (e.g. December → February) computed a negative month offset and applied no inflation. It now accounts for the year.
  • Sign-in autofill: the login form inputs regained name/id attributes and use the username/current-password autocomplete tokens, so Android Chrome and password managers recognize and autofill saved credentials again (the redesign had dropped these; iOS still worked because it fills from autocomplete alone).
  • The Auto-Categorize dialog now follows the app theme; it previously rendered with a hardcoded white background in dark mode (its dark styles were behind a class that was never applied).

Added

  • Preview the real notification emails on demand: Settings → Reminders now has "Preview spending report" and "Preview budget alert" buttons that immediately email you the actual report/alert built from your data (without touching the scheduled sends).
  • The Bills calendar now shows small brand icons directly in the day cells for due subscriptions, so you can see what's due at a glance — especially on phones, where the hover tooltips never worked.
  • Settings → About now shows which account (email) you are signed in with, or that you're in local mode.

Fixed

  • The Savings Goals doughnut no longer has its bottom edge shaved flat (the ring rendered at exactly the canvas boundary); it now keeps a small margin and is always a full circle.

  • OneDrive gets its own cloud icon instead of the Microsoft four-squares, and five more common services resolve to proper brand icons: Twitch, Adobe (Creative Cloud/Photoshop/Lightroom), Notion, and ChatGPT/OpenAI.

  • The Bills calendar tab failed with "not found" in local/demo mode — the calendar endpoint existed only on the cloud API and is now served locally too.

  • Netflix, Amazon, and Disney+ subscription icons were malformed (Netflix literally rendered the letter "M"); replaced with proper simple marks and audited the whole icon set.

  • The Savings Goals progress chart could grow past its card; it now stays contained.

  • Mobile: transaction summary totals no longer overflow the screen (compact two-column layout), pagination wraps instead of clipping, and the sidebar toggle becomes a back-chevron at the sidebar's top-right when open instead of covering the logo.

  • Storage-mode options renamed to fit the dropdown: "Server (Backend Database)" and "Local (Browser Storage)".

  • Subscriptions: the "Monthly Total" now normalizes each plan to its monthly cost (a yearly plan counts as amount/12, weekly as x52/12) instead of summing raw amounts, and each card shows its real billing period ("/yr", "/wk") instead of always reading like a monthly price. The bill form also offers a Yearly frequency now.

  • Adding a bill or subscription in the local/demo (serverless) mode failed with a validation error — the form sends the same field names as the cloud API (dueDate), which the local validator did not accept.

Added

  • Richer demo data: each example profile now carries a realistic set of subscriptions that scales with income (a lean pair on the low-income profile up to a dozen — streaming, cloud storage, gaming, developer tools — on the high-income one), all using real brand names so the Bills → Subscriptions view shows proper brand icons.

Fixed

  • Profile switching no longer makes a profile vanish from the selector. Switching the active profile could corrupt the in-memory profile list (the previously selected entry was overwritten with the new profile and then deduplicated away), a long-standing annoyance that hit on nearly every switch; the store now replaces instead of merging and never aliases list entries.

  • Demo mode is now resilient to blocked browser storage (strict private browsing / "block all cookies"): the storage-mode setting falls back to an in-session value instead of silently flipping the deployed app into server mode, which made demo sessions fire unauthenticated API calls.

  • Demo (no-account) mode on the hosted app now truly runs offline in the browser. Deployed builds address the API by absolute URL, and the serverless interceptor only recognized relative /api/* paths — so every call in demo mode bypassed the local IndexedDB, hit the real API without a session (constant 401s), and the local database never initialized. The interceptor now recognizes the deployed URL shape as well; after entering the demo, the app makes zero network calls to the API.

  • Guided onboarding tours now navigate to each feature's page and reliably highlight it. They were rebuilt on stable data-tour anchors (instead of the fragile CSS/label selectors that often missed), steps that couldn't be shown without data or extra clicks were removed or re-pointed at always-visible elements, and the walkthrough overlay was hardened against page-navigation timing.

  • Mobile: pages no longer render at desktop width and get clipped on phones — the app layout now genuinely shrinks to the viewport (the root container previously refused to shrink below its widest content, ~780px). The menu button no longer covers page titles; the Bills tabs, transaction date-range filters, portfolio holdings, and the Rent-vs-Buy form now fit or scroll properly on small screens.

  • Mobile: opening a dropdown or focusing an input no longer makes iOS Safari zoom/jump the page (form controls now stay at the 16px size iOS requires), which read as the app "crashing" from the Settings chart-export dropdown.

  • Debug logs are now readable on phones (entries stack as cards instead of a fixed five-column table wider than the screen), and "Copy" falls back to a legacy clipboard path or a file download when the clipboard is blocked (iOS).

  • Demo mode: fresh demo data failed the app's own response validation on the accounts, transactions, and categories endpoints (stale checking/investment/retirement account types from before the v4 rename, and seeded rows missing now-required fields), flooding the console with errors and breaking parts of the UI. The seeder now writes schema-complete rows and the serverless read path normalizes legacy rows from existing installs.

Changed

  • Public-repo hygiene ahead of open-sourcing: removed operator-specific infrastructure and internal notes from the tree — the apache/ vhost configs, the root deploy.sh, and internal planning/postmortem docs that referenced private hostnames, certificate paths, and server directories — and sanitized the remaining path references. Stopped tracking the generated PWA service-worker artifacts (sw.js/sw.js.map), which are rebuilt into dist/ at build time. Aligned the root package version and the README badge to 5.2.0. Reverse-proxy and deployment guidance lives in docs/self-hosting.md.

[5.2.0] — 2026-07-01

Security

  • Fixed an insecure direct object reference (IDOR) in custom reports. They were held in a shared in-memory map keyed by a guessable id with no ownership check, so one signed-in user could read, edit, or delete another user's report. Custom and saved reports are now persisted in D1 and scoped per user.
  • Completed the SheetJS (xlsx) 0.20.3 security patch on the backend importer (the frontend and worker were patched in 5.1.2), closing the prototype-pollution and ReDoS advisories on server-side Excel parsing.
  • CORS now fails closed when the allowed origin is unconfigured, instead of reflecting * with credentials.
  • Google Sign-In now verifies the token issuer and expiry in addition to the audience.
  • Dropped script-src 'unsafe-inline' from the served production Content-Security-Policy (it is kept only for local Vite HMR in development).

Fixed

  • Account balances are now updated atomically with the transaction that changes them, on both the self-host backend and the worker. A failure mid-update can no longer leave a transaction recorded with its balance change half-applied.
  • Fixed a crash when more than one profile was selected for a transaction operation (a multi-profile query bound its parameters incorrectly).
  • Bulk-deleting a transfer credited only to a destination account now reverses that credit (it was previously skipped, permanently inflating the account).
  • Profile names are now unique per user rather than globally, so two users can each have a default "Personal Profile".
  • The cross-origin session cookie could be dropped when an API caller passed its own credentials option; it is now always sent.
  • Money now renders in the user's selected currency across the client PDF reports and dashboard cards (including zero-decimal currencies such as JPY), instead of a hardcoded symbol.
  • Transactions page crash caused by a createMemo TDZ reference in SolidJS.
  • Missing swagger-ui-express and mime-types backend dependencies.

Performance

  • Import duplicate detection is now O(N+M) instead of O(N·M), and import execution batches all inserts and account-balance updates into a single atomic transaction.
  • Budget forecast/history and monthly statistics are computed in a single pass instead of rescanning the transaction list per row.
  • The transactions list attaches tags with one batched query instead of one query per row.
  • Added indexes on transactions.account_id and transfer_account_id for account-scoped queries.

Changed

  • Fixed the API worker deployment (the CI install used --frozen-lockfile against an intentionally unpinned worker), added a pre-migration D1 backup step, made the self-host Docker image buildable again, and added the OWASP baseline security headers to the Apache vhost.
  • Relicensed the project from MIT to the GNU Affero General Public License v3.0 (AGPL-3.0).
  • Vendored the SheetJS (xlsx) tarball into vendor/ and reference it via a file: dependency, so installs no longer depend on the SheetJS CDN being reachable.
  • The in-app changelog now renders the repository CHANGELOG.md directly (single source of truth) instead of a separate hardcoded copy.
  • Improved public repo readiness: CODE_OF_CONDUCT, CONTRIBUTING, issue/PR templates
  • Cleaned docs/ directory structure with organized specs, postmortems, and archive
  • Replaced internal todo.md with public ROADMAP.md
  • Added .env.example with documented environment variables

[5.1.2] — 2026-06-30

Security

  • Updated SheetJS (xlsx) to the patched 0.20.3 build in both the worker and the frontend, fixing the known prototype-pollution and ReDoS advisories in spreadsheet (Excel) import.

Changed

  • Rewrote the README for the current Cloudflare Worker + D1/R2 architecture (local-first / self-host / managed-cloud), replacing the outdated Express/SQLite description.

[5.1.1] — 2026-06-30

Security

  • Sign-up is now rate-limited per email address (not just per IP), curbing unsolicited account creation and email spam.

Fixed

  • A reminder email that fails to send is now retried on the next cron run instead of being skipped for that period (the dedup slot is rolled back on a failed send).

[5.1.0] — 2026-06-27

Added

  • Account deletion: permanently delete your account and all of its data from Settings → Billing (confirm by typing your account email). Dev = hard delete; production soft-delete to follow; shown on the dev build only for now.
  • Optional Cloudflare Turnstile bot protection on the register / login / forgot-password forms (enable by setting VITE_TURNSTILE_SITE_KEY and the worker secret TURNSTILE_SECRET).

Security

  • Per-account login throttle (on top of the per-IP limit) and constant-time password verification, so login no longer reveals whether an email is registered.
  • Registration no longer reveals whether an email is already registered: it returns the same neutral response and emails either a welcome or an "account already exists" notice, with no session set (you sign in afterward).
  • Profile-limit and rate-limit enforcement made atomic, so concurrent requests cannot slip past a limit.
  • Stripe billing webhook hardened ahead of go-live (still inert until keys are set): idempotent + ordered event processing (a redelivered or stale event can't double-apply or resurrect a canceled plan), a dunning grace window for past_due, and line-item current_period_end handling.

Fixed

  • The periodic spending-report email could be sent multiple times per month (cron day-of-month/day-of-week OR semantics) — now sent once per period, with per-period idempotency.
  • Re-running a failed or interrupted import no longer creates duplicate transactions (idempotent via a stable per-import id; migration 0008).
  • The billing page could label a paid plan as "Free"; it now shows your real tier and, when a plan is canceled, the date access ends.

[5.0.0] — 2026-06-27

Added

  • Cloud sync via a Cloudflare Workers backend (D1 + R2) — sign in to sync across devices.
  • Accounts: Google sign-in, email/password register + login, a no-account demo, and forgot-password reset by email.
  • Pricing & plans (Free / Basic / Advanced / Ultimate) with a 4-tier comparison in Settings → Billing, plus Stripe billing (checkout, portal, status, webhook).
  • Email reminders — budget alerts and a periodic spending report (Resend) — with per-profile toggles and one-click unsubscribe.
  • Contact-support form (sign-in, reset, and Settings) with an auto-acknowledgement and a TC-XXXX reference id.
  • Tabbed Settings: General / Exports / Billing.

Changed

  • Per-plan limits enforced (profiles, receipt storage, monthly reminder quota); advanced reports (tax & P&L) gated to Basic and up.
  • Email now sends from a repliable address (hello@) instead of no-reply.

Security

  • Pre-merge review hardening: receipt-upload IDOR and cross-profile savings-goal recompute fixed; user-supplied IN-lists chunked to stay under D1's bound-variable limit; rate limiter made atomic; the support auto-acknowledgement no longer reflects arbitrary attacker-supplied content to unverified recipients.

Fixed

  • Profile creation failing with a response-validation error (missing created_at).
  • "Access denied" for old/profile-less accounts (a default profile is now created automatically); password-reset no longer leaves a half-logged-in state.
  • Large transaction pages timing out (N+1 tag query) and import of thousands of rows failing (D1 bound-variable limit); several invalid CSS transforms that silently dropped animations.

[4.0.0] — 2026-05-11

Added

  • Portfolio tracker with real-time Yahoo Finance price lookup and allocation pie chart
  • Counterparties page showing who-owes-who from beneficiary/payor transaction data
  • Account balance auto-update when transactions are created/updated/deleted
  • Starting balance and starting date fields for accounts with dynamic balance computation
  • Transfer handling between accounts (FROM/TO with balance adjustments on both sides)
  • Bulk action bar: Change Category and Change Type modals for multi-transaction editing
  • Auto-categorization modal for bulk-mapping uncategorized transactions
  • Nuke scripts: nuke-demo.sh (demo profiles only) and nuke-all.sh (all data)
  • Google Sheets import improvements: auto-populated account inputs, cash account type

Changed

  • Account types aligned with backend: giro/savings/ib/cash (was checking/savings/credit/investment)
  • Import now resolves account_id from Means of Payment (FROM) instead of Category (TO)
  • Transaction FROM/TO column shows MoP → Category with transfer amounts without - prefix
  • Analytics labels changed from "Monthly" to "Period" to reflect actual data range
  • Navigation labels simplified: "Loan Calculator" → "Loans", "Housing Calc" → "Housing"
  • Dropdown UX: category/tag dropdowns auto-close when clicking outside

Fixed

  • Critical import bug: account_id was resolved from Category (TO) instead of Means of Payment (FROM)
  • Post-import balance recalculation handling all transfer directions (FROM only, TO only, both)
  • Bulk DELETE sets account balance to starting_balance instead of 0
  • Import: existing accounts now pre-populated in accountIdMap for MoP resolution
  • Portfolio seed data: tier string passed directly instead of undefined config.tier property
  • Yahoo Finance v3 ESM import: use new YahooFinance() pattern
  • Mobile overflow on all pages: added overflow-x containment, responsive breakpoints for tables/charts
  • SolidJS anti-patterns: replaced createEffect+isMounted with onMount, fixed ChartWrapper reactivity

[3.0.0] — 2026-04-01

Added

  • Serverless mode with full IndexedDB storage adapter
  • Multi-profile support with demo data (low/mid/high income) spanning 2000-2026
  • Zero-based budgeting with allocation and rollover
  • Daily heatmap visualization (D3.js) for spending patterns
  • Sankey flow diagram for income/expense flow visualization
  • PDF report generation: monthly spending, annual summary, P&L, tax summary
  • Reconciliation workflow with bulk toggle and reconciliation summary
  • Transaction tags with filtering and color coding
  • Receipt upload and attachment to transactions
  • Recurring transactions with auto-populate scheduling
  • Quick Add modal (Ctrl+Shift+T) for rapid transaction entry
  • Dark/light theme with CSS variables and persistence
  • PWA support with service worker for offline access
  • Chart export as images

Changed

  • Migrated from vanilla JS to SolidJS + TypeScript + Vite
  • CSS Modules instead of global CSS
  • Hash-based routing with query parameter support

[2.0.0] — 2026-03-15

Added

  • Savings goals with progress tracking and contributions
  • Loan calculator with amortization tables, prepayments, and variable rates
  • Bills tracker with recurring payment scheduling
  • Housing cost calculator
  • Retirement calculator with projections
  • Compound interest calculator
  • Emergency fund calculator
  • Rent vs Buy comparison calculator
  • Budget rollover support
  • Category auto-mapping from transaction descriptions
  • Google Sheets CSV/XLSX import with column mapping and preview

[1.0.0] — 2026-03-01

Added

  • Initial release: vanilla JS SPA with Express/SQLite backend
  • Transaction management (CRUD, filtering, search, pagination)
  • Category management with colors and icons
  • Account tracking with balances
  • Dashboard with income/expense charts and metrics
  • Basic budgeting per category
  • Analytics with category breakdowns
  • User authentication (bcrypt + sessions)
  • Settings management
  • Data export/import (JSON)