Open-source personal finance manager. Self-hosted, privacy-first.
chore: pre-release cleanup for 0.16.5 (#1222)
Tássio Noronha0554fec45fe4
diff --git a/.env.example b/.env.exampleindex 77609584..fd62d234 100644--- a/.env.example+++ b/.env.example@@ -1,14 +1,14 @@# RequiredSECRET_KEY=change-me-in-production-# Bank sync — Pluggy (https://pluggy.ai)+# Bank sync: Pluggy (https://pluggy.ai)## 1. Create an account at https://dashboard.pluggy.ai## 2. Copy your Client ID and Client Secret## 3. Add http://localhost:${FRONTEND_PORT}/oauth/callback as an allowed redirect URIPLUGGY_CLIENT_ID=PLUGGY_CLIENT_SECRET=-# Bank sync — Enable Banking (https://enablebanking.com) for European banks+# Bank sync: Enable Banking (https://enablebanking.com) for European banks## 1. Sign up at https://enablebanking.com and create a Production application## 2. Add http://localhost:${FRONTEND_PORT}/oauth/callback as an allowed redirect URL## 3. Save the downloaded PEM file to ./secrets/enable_banking_private.pem@@ -20,7 +20,7 @@ ENABLE_BANKING_APP_ID=# registered in your EB application differs from where the app is served.# ENABLE_BANKING_OAUTH_REDIRECT_URI=https://securo.example.com/oauth/callback-# OIDC login (optional) — Authentik, Pocket ID, or any standard OIDC provider+# OIDC login (optional): Authentik, Pocket ID, or any standard OIDC provider## Redirect/callback URL to register in the provider:## http://localhost:${FRONTEND_PORT:-3000}/api/auth/oidc/callback# OIDC_ENABLED=true@@ -48,7 +48,7 @@ ENABLE_BANKING_APP_ID=# disable (e.g. to avoid the dependency on the Brazilian government CSV endpoint).# TESOURO_DIRETO_ENABLED=false-# Passkeys (optional) — nothing to set for the common cases.+# Passkeys (optional). Nothing to set for the common cases.## Passkeys follow the address you open the app on, so they work out of the box on## http://localhost:3000 and on any HTTPS domain behind a reverse proxy.##@@ -57,7 +57,7 @@ ENABLE_BANKING_APP_ID=## - plain HTTP can never be used, except on localhost## Reach the app on a domain over HTTPS, or on http://localhost, to use passkeys.##-## Set FRONTEND_URL when the app is served from a domain — it is also used for+## Set FRONTEND_URL when the app is served from a domain; it is also used for## CORS and OAuth callbacks.# FRONTEND_URL=https://securo.example.com##@@ -71,32 +71,32 @@ ENABLE_BANKING_APP_ID=## Settings; without one, this variable, then the host timezone, then UTC.# TZ=America/Sao_Paulo-# Host ports (optional) — change these to avoid conflicts with other services+# Host ports (optional). Change these to avoid conflicts with other services## Default values are set in docker-compose.yml and docker-compose.prod.yml.## Example:# FRONTEND_PORT=3132# BACKEND_PORT=8182-# Reverse proxy labels (optional, docker-compose.prod.yml only) — static+# Reverse proxy labels (optional, docker-compose.prod.yml only): static# Traefik routing labels on the frontend service, for setups (e.g. some# Coolify versions) where the proxy's own domain UI doesn't turn into# working Traefik labels on this compose file. Off by default.# TRAEFIK_ENABLE=true# FRONTEND_DOMAIN=securo.example.com## Set to a network name shared by this stack and your Traefik/proxy-## container — find it with `docker network ls` or `docker inspect+## container. Find it with `docker network ls` or `docker inspect## <traefik-container> --format '{{json .NetworkSettings.Networks}}'`.-## Leave unset to let Traefik auto-detect the shared network — works as+## Leave unset to let Traefik auto-detect the shared network; it works as## long as `frontend` is on exactly one network (the default). REQUIRED if## you've attached `frontend` to more than one network yourself.# TRAEFIK_NETWORK=## Only if your ACME resolver isn't named "letsencrypt".# TRAEFIK_CERTRESOLVER=letsencrypt## Must be unique per deployment if multiple Securo instances share the-## same Traefik/Coolify proxy — otherwise their router/service names collide.+## same Traefik/Coolify proxy; otherwise their router/service names collide.# TRAEFIK_RESOURCE_NAME=securo-frontend-# AI Agents (optional) — to enable, set BOTH:+# AI Agents (optional). To enable, set BOTH:# 1) the feature flag# 2) COMPOSE_PROFILES so `docker compose up` starts the mcp-server container# (Docker Compose only. On a bare-metal/LXC install set just the flag,diff --git a/backend/alembic/versions/097_account_stable_external_id.py b/backend/alembic/versions/097_account_stable_external_id.pyindex a830e1bd..488d24a5 100644--- a/backend/alembic/versions/097_account_stable_external_id.py+++ b/backend/alembic/versions/097_account_stable_external_id.py@@ -7,8 +7,8 @@ Create Date: 2026-10-02Enable Banking identifies an account by a `uid` that is scoped to a singlesession, so reauthorising (which mints a new session) hands back a new uid forthe same real account. The sync matched accounts only on `external_id`, so it-inserted a second row and left the original — with its transactions, rules and-name overrides — behind.+inserted a second row and left the original (with its transactions, rules and+name overrides) behind.EB publishes an `identification_hash` precisely to match the same account acrosssessions. Persist it here so the sync can rebind the existing row to the new uiddiff --git a/backend/app/providers/base.py b/backend/app/providers/base.pyindex 10810f38..a3ea24ff 100644--- a/backend/app/providers/base.py+++ b/backend/app/providers/base.py@@ -57,8 +57,8 @@ def mask_last4(value: Optional[str]) -> Optional[str]:class AccountData:# The provider's identifier for this account. It is expected to be stable# across re-syncs, and the sync matches an incoming account on it first. A- # provider that re-keys it — Enable Banking mints a `uid` scoped to a single- # session — must also set `stable_external_id`, or re-syncing inserts a+ # provider that re-keys it (Enable Banking mints a `uid` scoped to a single+ # session) must also set `stable_external_id`, or re-syncing inserts a# duplicate instead of recognising the account it already imported.external_id: strname: strdiff --git a/backend/app/providers/enable_banking.py b/backend/app/providers/enable_banking.pyindex 46a642b1..d2570962 100644--- a/backend/app/providers/enable_banking.py+++ b/backend/app/providers/enable_banking.py@@ -571,7 +571,7 @@ class EnableBankingProvider(BankProvider):uids = self._account_uids(data)# EB keys each account by a uid scoped to this session; the# identification_hash is the id that survives a reauthorisation. It comes- # in the same payload we just fetched, so carry it through — otherwise a+ # in the same payload we just fetched, so carry it through; otherwise a# reconnect re-keys every account and the sync duplicates them all.stable_external_ids = {entry.get("uid"): entry.get("identification_hash")diff --git a/backend/app/providers/market_price.py b/backend/app/providers/market_price.pyindex 1d398404..50c30d33 100644--- a/backend/app/providers/market_price.py+++ b/backend/app/providers/market_price.py@@ -209,7 +209,7 @@ class YFinanceProvider(MarketPriceProvider):currencies = await asyncio.to_thread(self._get_currencies_sync, candidates)- except Exception as e: # pragma: no cover — upstream flakiness, not logic+ except Exception as e: # pragma: no cover (upstream flakiness, not logic)logger.warning("minor-unit currency check failed for %s: %s", candidates, e)@@ -217,7 +217,7 @@ class YFinanceProvider(MarketPriceProvider):for sym in candidates:currency = currencies.get(sym)if not currency:- # Unit unknown — a raw pence/cents close could be+ # Unit unknown: a raw pence/cents close could be# 100× off, so drop it and let the caller fall back# to ``get_quote``, which normalizes on its own.chunk_prices[sym] = None@@ -280,7 +280,7 @@ class YFinanceProvider(MarketPriceProvider):return list(response.get("quotes") or [])except _rate_limit_exception_types():raise MarketPriceRateLimitedError("Yahoo Finance rate-limited the search")- except Exception as e: # pragma: no cover — upstream flakiness, not logic+ except Exception as e: # pragma: no cover (upstream flakiness, not logic)logger.warning("yfinance search failed for %r: %s", query, e)return []@@ -334,7 +334,7 @@ class YFinanceProvider(MarketPriceProvider):# Swallowing upstream failures silently would leave callers# unable to distinguish "no data" from "request blew up".)- except Exception as e: # pragma: no cover — upstream flakiness+ except Exception as e: # pragma: no cover (upstream flakiness)logger.warning("yfinance batch download failed for %d symbols: %s", len(symbols), e)return outdiff --git a/backend/app/services/category_defaults.py b/backend/app/services/category_defaults.pyindex 24f346f6..7cd8fab4 100644--- a/backend/app/services/category_defaults.py+++ b/backend/app/services/category_defaults.py@@ -17,7 +17,7 @@ import jsonfrom importlib.resources import files# importlib.resources (rather than Path(__file__)) so the file is found in-# every install mode — editable, wheel, or zipped — as long as it's declared+# every install mode (editable, wheel, or zipped) as long as it's declared# as package data (see [tool.setuptools.package-data] in pyproject.toml)._taxonomy = json.loads(files("app").joinpath("data", "default_categories.json").read_text(encoding="utf-8")@@ -34,7 +34,7 @@ CATEGORY_TO_GROUP: dict[str, str] = {def localized_name(data: dict, lang: str) -> str:"""Display name for `lang`: requested language, then English, then any- available translation. Never raises on a partially-translated entry —+ available translation. Never raises on a partially-translated entry:a missing language must degrade to a readable name, not break seeding."""names = data["names"]fallback = names.get("en") or next(iter(names.values()))diff --git a/backend/app/services/connection_service.py b/backend/app/services/connection_service.pyindex 1b4d54b2..82805fda 100644--- a/backend/app/services/connection_service.py+++ b/backend/app/services/connection_service.py@@ -1332,8 +1332,8 @@ async def _find_existing_connected_account(# The provider re-keyed this account. Enable Banking issues a `uid` scoped to# one session, so reauthorising changes it while `stable_external_id` (the- # identification_hash) survives. Rebind the existing row — keeping its- # transactions, rules and name overrides — instead of inserting a duplicate.+ # identification_hash) survives. Rebind the existing row, keeping its+ # transactions, rules and name overrides, instead of inserting a duplicate.# EB does not guarantee the hash is unique, so require exactly one unclaimed# candidate: a row another incoming account already took in this run carries# an external_id that is in the batch, and adopting it a second time would@@ -1355,11 +1355,11 @@ async def _find_existing_connected_account(return stable_rows[0]# Last resort for rows that predate `stable_external_id` (added by migration- # 097, and only ever backfilled by a *successful* sync — which a user whose+ # 097, and only ever backfilled by a *successful* sync, which a user whose# bank was failing never had). The masked identifier is the closest thing to# an account number we keep. Two guards, both fail-closed: a single candidate# (a shared last-4 must never merge two accounts), and candidates limited to- # rows with no stable id — a row that is already identified is a different+ # rows with no stable id: a row that is already identified is a different# account, so adopting it would overwrite its identity and mix histories.if connection.provider == "enable_banking" and acc_data.masked_number:masked_rows = (await session.execute(diff --git a/backend/tests/api_contract/harness.py b/backend/tests/api_contract/harness.pyindex ad510d7e..db1c885b 100644--- a/backend/tests/api_contract/harness.py+++ b/backend/tests/api_contract/harness.py@@ -66,7 +66,7 @@ async def _send(client: AsyncClient, op: Operation, path: str, headers: dict, kw"""Send the request; an exception escaping the app counts as a 500."""try:resp = await client.request(op.method, path, headers=headers, **kwargs)- except Exception as exc: # noqa: BLE001 — any escape is the finding+ except Exception as exc: # noqa: BLE001 (any escape is the finding)return UNHANDLED, f"{type(exc).__name__}: {exc}", Nonereturn resp.status_code, resp.text[:500], respdiff --git a/backend/tests/test_connection_service.py b/backend/tests/test_connection_service.pyindex 7ef811d6..1b2e0ec3 100644--- a/backend/tests/test_connection_service.py+++ b/backend/tests/test_connection_service.py@@ -1181,7 +1181,7 @@ async def test_find_existing_connected_account_masked_fallback_skips_rows_with_aWhen a persisted account's details request is skipped (partial providerfailure) and a *different* account surfaces with the same masked number andcurrency, the fallback would rebind the skipped row and overwrite its stable- id — mixing two account histories. Rows that already carry a stable id are+ id, mixing two account histories. Rows that already carry a stable id areidentified, so they must be out of scope for the fallback."""conn = await _make_connection(session, test_user.id, "MaskedBank")diff --git a/backend/tests/test_connection_service_coverage.py b/backend/tests/test_connection_service_coverage.pyindex e73f37e4..f325ee04 100644--- a/backend/tests/test_connection_service_coverage.py+++ b/backend/tests/test_connection_service_coverage.py@@ -630,7 +630,7 @@ async def test_sync_rematches_legacy_account_by_masked_number():"""Rows predating `stable_external_id` must survive a reauth too.- A user whose bank was failing never had a stable_external_id backfilled — the sync+ A user whose bank was failing never had a stable_external_id backfilled; the syncthat would have done it is the one that was failing. When the bank recoversafter a reconnect the uid is new and the hash is unknown to us, so themasked identifier is the last thing that still identifies the account.diff --git a/backend/tests/test_market_price_assets.py b/backend/tests/test_market_price_assets.pyindex c3784597..1474132c 100644--- a/backend/tests/test_market_price_assets.py+++ b/backend/tests/test_market_price_assets.py@@ -512,7 +512,7 @@ async def test_yfinance_batch_keeps_decimal_precision_when_scaling():@pytest.mark.asyncioasync def test_yfinance_batch_leaves_major_unit_lse_ticker_unchanged():- # Not every *.L listing trades in pence — some are quoted in GBP/USD.+ # Not every *.L listing trades in pence; some are quoted in GBP/USD.provider = YFinanceProvider()with (patch.object(@@ -534,7 +534,7 @@ async def test_yfinance_batch_leaves_major_unit_lse_ticker_unchanged():@pytest.mark.asyncioasync def test_yfinance_batch_drops_price_when_currency_unknown():# A failed currency lookup must not let a raw pence close through as- # pounds — the symbol comes back None so the refresh falls back to+ # pounds, so the symbol comes back None and the refresh falls back to# get_quote. Other symbols in the same chunk are unaffected.provider = YFinanceProvider()with (diff --git a/backend/tests/test_providers_enable_banking.py b/backend/tests/test_providers_enable_banking.pyindex 38d8d79e..34e3a9fe 100644--- a/backend/tests/test_providers_enable_banking.py+++ b/backend/tests/test_providers_enable_banking.py@@ -561,7 +561,7 @@ async def test_get_accounts_raises_session_expired_when_details_unauthorized(eb_``_request`` maps 401/410 to SessionExpiredError precisely because EB'saccess token is session-scoped: the consent is dead for every account. The- per-account ``except httpx.HTTPError`` must not swallow it — doing so stored+ per-account ``except httpx.HTTPError`` must not swallow it; doing so storedan empty account list and left the connection "active" (issue #1013)."""provider = EnableBankingProvider()@@ -589,7 +589,7 @@ async def test_get_accounts_exposes_stable_external_id(eb_keys):Reauthorising mints a new session, so the same real account comes back witha new uid. The hash is what survives that, and it already rides in the- /sessions payload this method fetches — carry it out on AccountData so the+ /sessions payload this method fetches. Carry it out on AccountData so thesync can re-match the existing row instead of creating a duplicate."""provider = EnableBankingProvider()diff --git a/docker-compose.prod.yml b/docker-compose.prod.ymlindex ea41d951..1a702a6a 100644--- a/docker-compose.prod.yml+++ b/docker-compose.prod.yml@@ -46,7 +46,7 @@ x-backend-env: &backend-envREDIS_URL: redis://redis:6379/0STORAGE_LOCAL_PATH: /app/data/attachmentsAGENTS_KNOWLEDGE_STORAGE_PATH: /app/data/agent_knowledge- # Agents/LLM feature — opt-in. Off by default so existing users pay+ # Agents/LLM feature, opt-in. Off by default so existing users pay# zero cost. Run `docker compose -f docker-compose.prod.yml --profile# agents up` after enabling.AGENTS_ENABLED: ${AGENTS_ENABLED:-false}@@ -56,7 +56,7 @@ x-backend-env: &backend-env# TTL for tokens minted from /agents/connections → "External MCP access".# Used by Claude Desktop, n8n, custom clients plugging into Securo.AGENTS_MCP_EXTERNAL_TTL_DAYS: ${AGENTS_MCP_EXTERNAL_TTL_DAYS:-90}- # LLM provider config — only the provider you actually use needs setting.+ # LLM provider config: only the provider you actually use needs setting.AGENTS_DEFAULT_PROVIDER: ${AGENTS_DEFAULT_PROVIDER:-ollama}AGENTS_DEFAULT_MODEL: ${AGENTS_DEFAULT_MODEL:-}AGENTS_OLLAMA_BASE_URL: ${AGENTS_OLLAMA_BASE_URL:-http://ollama:11434}@@ -65,7 +65,7 @@ x-backend-env: &backend-envAGENTS_OPENAI_COMPAT_BASE_URL: ${AGENTS_OPENAI_COMPAT_BASE_URL:-}AGENTS_OPENAI_COMPAT_API_KEY: ${AGENTS_OPENAI_COMPAT_API_KEY:-}# Knowledge-base embeddings. `native` (default) uses fastembed with a- # bundled multilingual model — zero external setup. Override with+ # bundled multilingual model, so zero external setup. Override with# ollama/openai/openai_compatible for better quality.AGENTS_EMBEDDING_PROVIDER: ${AGENTS_EMBEDDING_PROVIDER:-native}AGENTS_EMBEDDING_MODEL: ${AGENTS_EMBEDDING_MODEL:-sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2}@@ -142,11 +142,11 @@ services:# their router/service names collide.# TRAEFIK_NETWORK has no default: the Docker network Traefik and this# stack share isn't guaranteed to be named `securo_default` (it isn't,- # under some Coolify setups) — find it with `docker network ls` or+ # under some Coolify setups). Find it with `docker network ls` or# `docker inspect <traefik-container> --format '{{json .NetworkSettings.Networks}}'`# and set it explicitly. Left unset (the empty value below is# equivalent to omitting the label), Traefik auto-detects the network- # when this container is on exactly one — the default here, since+ # when this container is on exactly one, the default here, since# `frontend` isn't attached to any other network out of the box. If# you've added `frontend` to additional networks yourself, you MUST# set TRAEFIK_NETWORK, or Traefik's choice among them is undefined.@@ -176,10 +176,10 @@ services:# Optional: Securo built-in MCP server. Only starts under the `agents`# profile (`docker compose -f docker-compose.prod.yml --profile agents up`).# Reuses the backend image, just runs a different uvicorn entry point.- # Modular by design — users not using the agents feature pay zero cost.+ # Modular by design: users not using the agents feature pay zero cost.## The port is published on the host (127.0.0.1 by default) so external- # agents — Claude Desktop, n8n, custom clients — can reach it after+ # agents (Claude Desktop, n8n, custom clients) can reach it after# minting a token from the UI. JWT auth is always required. Override# AGENTS_MCP_EXTERNAL_HOST_PORT to e.g. "0.0.0.0:8765" to expose to LAN.mcp-server:diff --git a/docker-compose.yml b/docker-compose.ymlindex d0388f67..5f49981a 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -49,7 +49,7 @@ x-backend-env: &backend-envTESOURO_DIRETO_ENABLED: ${TESOURO_DIRETO_ENABLED:-true}STORAGE_LOCAL_PATH: /app/data/attachmentsAGENTS_KNOWLEDGE_STORAGE_PATH: /app/data/agent_knowledge- # Agents/LLM feature — opt-in. Off by default so existing users pay+ # Agents/LLM feature, opt-in. Off by default so existing users pay# zero cost. Run `docker compose --profile agents up` after enabling.AGENTS_ENABLED: ${AGENTS_ENABLED:-false}AGENTS_BUILTIN_MCP_URL: ${AGENTS_BUILTIN_MCP_URL:-http://mcp-server:8765/mcp}@@ -62,7 +62,7 @@ x-backend-env: &backend-env# TTL for tokens minted from /agents/connections → "External MCP access".# Used by Claude Desktop, n8n, custom clients plugging into Securo.AGENTS_MCP_EXTERNAL_TTL_DAYS: ${AGENTS_MCP_EXTERNAL_TTL_DAYS:-90}- # LLM provider config — only the provider you actually use needs setting.+ # LLM provider config: only the provider you actually use needs setting.AGENTS_DEFAULT_PROVIDER: ${AGENTS_DEFAULT_PROVIDER:-ollama}AGENTS_DEFAULT_MODEL: ${AGENTS_DEFAULT_MODEL:-}AGENTS_OLLAMA_BASE_URL: ${AGENTS_OLLAMA_BASE_URL:-http://ollama:11434}@@ -71,7 +71,7 @@ x-backend-env: &backend-envAGENTS_OPENAI_COMPAT_BASE_URL: ${AGENTS_OPENAI_COMPAT_BASE_URL:-}AGENTS_OPENAI_COMPAT_API_KEY: ${AGENTS_OPENAI_COMPAT_API_KEY:-}# Knowledge-base embeddings. `native` (default) uses fastembed with a- # bundled multilingual model — zero external setup. Override with+ # bundled multilingual model, so zero external setup. Override with# ollama/openai/openai_compatible for better quality.AGENTS_EMBEDDING_PROVIDER: ${AGENTS_EMBEDDING_PROVIDER:-native}AGENTS_EMBEDDING_MODEL: ${AGENTS_EMBEDDING_MODEL:-sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2}@@ -161,11 +161,11 @@ services:# Optional: Securo built-in MCP server. Only starts under the `agents`# profile (`docker compose --profile agents up`). Reuses the backend- # image, just runs a different uvicorn entry point. Modular by design —+ # image, just runs a different uvicorn entry point. Modular by design:# users not using the agents feature pay zero cost.## The port is published on the host (127.0.0.1 by default) so external- # agents — Claude Desktop, n8n, custom clients — can reach it after+ # agents (Claude Desktop, n8n, custom clients) can reach it after# minting a token from the UI. JWT auth is always required. Override# AGENTS_MCP_EXTERNAL_HOST_PORT to e.g. "0.0.0.0:8765" to expose to LAN.mcp-server:diff --git a/frontend/public/manifest.json b/frontend/public/manifest.jsonindex 4dd52d97..7fe3826a 100644--- a/frontend/public/manifest.json+++ b/frontend/public/manifest.json@@ -4,7 +4,7 @@"start_url": "/","scope": "/","display": "standalone",- "background_color": "#F8F9FB",+ "background_color": "#0C0D12","theme_color": "#6366F1","icons": [{diff --git a/frontend/src/lib/remembered-range.ts b/frontend/src/lib/remembered-range.tsindex 0b13b71c..8115a7ca 100644--- a/frontend/src/lib/remembered-range.ts+++ b/frontend/src/lib/remembered-range.ts@@ -32,7 +32,7 @@ function write(page: RememberedPage, value: unknown): void {}}-/** '' (open end) or a real calendar date as YYYY-MM-DD — not "2026-02-30". */+/** '' (open end) or a real calendar date as YYYY-MM-DD, not "2026-02-30". */function isDate(v: unknown): v is string {if (v === '') return trueif (typeof v !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(v)) return falsediff --git a/frontend/src/pages/account-detail.tsx b/frontend/src/pages/account-detail.tsxindex 28dbc6fe..30f6deb9 100644--- a/frontend/src/pages/account-detail.tsx+++ b/frontend/src/pages/account-detail.tsx@@ -525,7 +525,7 @@ export default function AccountDetailPage() {const params = {account_id: id,// When the active cycle is a real bill, prefer bill_id (Pluggy's- // truth — picks up charges the bank rolled outside the nominal date+ // truth: picks up charges the bank rolled outside the nominal date// range) AND keep from/to so manual / non-bill-linked txs (recurring// fills, CSV imports) bucketed into this cycle still show up.bill_id: activeBill?.id,