"""App version + changelog.

Per /srv/projects/standards/coding.md: every code change bumps the version and
adds a newest-first changelog line; the running app surfaces its version (the
UI shows it in Library > About, and /api/version serves it).
"""

APP_VERSION = "2.0.0-dev.17"

# Newest first. One line per change set.
CHANGELOG = [
    ("2.0.0-dev.17", "2026-07-07", "Presence ping moved to a BackgroundTask — "
     "the ~0.5s report_presence round-trip now runs AFTER the /api/me response, "
     "so the polled auth check stays instant."),
    ("2.0.0-dev.16", "2026-07-07", "Identified presence: /api/me reports the "
     "signed-in user + client IP to the BW hub via bw_auth.report_presence "
     "(gate-free — the Pattern B way to show who's online; the SPA polls "
     "/api/me so presence stays fresh). Best-effort; only surfaces once "
     "presence tracking is enabled on the host."),
    ("2.0.0-dev.15", "2026-07-07", "FIX: BW Auth login was hijacked by the PWA "
     "service worker — its navigation fallback served the cached shell for "
     "/login and /auth/callback, so no request reached the server and no one "
     "could sign in. Denylisted /login, /logout, /auth/* from the SW; moved "
     "the silent SSO probe to a client-triggered /auth/probe route (/api/me "
     "now returns should_probe). Auto-signin + interactive login now work."),
    ("2.0.0-dev.14", "2026-07-07", "BW Auth (Pattern B, PUBLIC mode) replaces "
     "the shim gate: 'Sign in with BW' via id-auth OAuth+PKCE, own signed "
     "session cookie, server-side silent auto-signin (SSO'd visitors skip the "
     "welcome page; anonymous ones see it, never the BW login page). New "
     "welcome page + AppShell auth gate + profile section (access level + "
     "app-only City field). users.access_level/city columns; access levels "
     "(rian=Garden Owner, bev=Garden Admirer) reported to the hub. Shim fully "
     "removed (gate/, mint_grant, forward_auth); agent Bearer path preserved."),
    ("2.0.0-dev.13", "2026-07-03", "Adversarial-review fixes: feedback "
     "exclusion extended to the AI surfaces (chat starter context + "
     "get_recent_notes/search_notes tools — bodied feedback could leak into "
     "chat grounding); gate login rejects protocol-relative next= (open "
     "redirect); captures empty-state honors the feedback filter; capture "
     "chips re-seed after Clear/Add-another (visual/server inference "
     "mismatch); outbox save failure now surfaces instead of silently "
     "dropping the note."),
    ("2.0.0-dev.12", "2026-07-03", "App-feedback capture: new 'App feedback' "
     "tab in the capture sheet (voice/text/photo) records kind='feedback' + "
     "the page it was made from (new field_notes.page_context, Alembic "
     "a7c2f19e4b02). Feedback stays out of the diary/threads/notes-mirror at "
     "the query level and lives under Library > Captures > 'app feedback'. "
     "Quick notes + comments now record page_context too."),
    ("2.0.0-dev.11", "2026-07-03", "FIX: ending a chat session 500'd (router "
     "called the keyword-only end_session service positionally). Added the "
     "missing chat test suite — HTTP lifecycle (create/list/replay/end-"
     "discard/404) + titled-end service test with fake provider."),
    ("2.0.0-dev.10", "2026-07-03", "Capture FAB hides on chat screens — it "
     "overlapped the composer's Send/Stop buttons."),
    ("2.0.0-dev.9", "2026-07-03", "Chat cosmetics: session cards no longer "
     "repeat the title inside migrated v1 summaries (only the message/tool "
     "meta shows), ended-conversation notice de-duplicated."),
    ("2.0.0-dev.8", "2026-07-03", "PWA fix: SPA shell paths (/sw.js, "
     "/registerSW.js, /workbox-*, /manifest.webmanifest, /assets, /icons) "
     "made public at BOTH auth layers (app middleware + Caddy gate) so an "
     "installed PWA with an expired session can still update its service "
     "worker. Data routes and /notes/* media remain gated."),
    ("2.0.0-dev.7", "2026-07-03", "Pre-cutover polish: chat fully styled "
     "(bubbles user-leaf/assistant-marigold, collapsible tool chips, thinking "
     "dots, streaming cursor, pinned composer, session cards), area breadcrumbs "
     "use full names, real PWA icons (192/512 maskable)."),
    ("2.0.0-dev.6", "2026-07-03", "P2 COMPLETE: write flows everywhere (click-to-edit, creation sheets, archive, featured-image upload), capture system (FAB + sheet w/ audio/live-transcript/camera + offline outbox), layout editor (full v1 gesture port: snap ghost, tray pools, queues, attach/detach), chat (Gemini streaming, 9 tools, SSE, session titling)."),
    ("2.0.0-dev.5", "2026-07-02", "P1 frontend: all 22 screens live across the 5-tab shell (Diary/Today, Garden w/ read-only sketch — geometry port verified to exact float parity, Plan, Library). Artifacts + meta routes typed. Species sprite extracted (26 icons)."),
    ("2.0.0-dev.4", "2026-07-02", "P1 backend COMPLETE: all 15 routers registered "
     "(areas, layout, catalog, inventory, years, notes, timeline, media, edit, "
     "archive, export + earlier meta/plantings/plants). Narrowed inferred-targets, "
     "dual-write notes mirror, agent Bearer-token path, snapshot_overview "
     "single-sourced. Auth shim gate live at /auth/*."),
    ("2.0.0-dev.3", "2026-07-02", "P1: plantings + plants domain ported "
     "(/api/plantings, /api/plants): year-grouped list w/ counts, inline plant "
     "rows w/ seen-ids delete-missing, pools, mark-planted, qty->0 removal rule, "
     "attach/detach with v1 split+merge semantics, split-aware move."),
    ("2.0.0-dev.2", "2026-07-02", "P0 COMPLETE: 37-table schema live (Alembic initial "
     "revision, pgvector+pg_trgm), migrate_v1 + 9-invariant diff harness ALL GREEN "
     "(2767 rows + media verified), frontend rails (Vite/tokens/generated TS client), "
     "3-stage Docker, SPA served via StaticFiles, SSE-through-Caddy verified."),
    ("2.0.0-dev.1", "2026-07-02", "P0 foundations: project scaffold, v1 export snapshot "
     "(2770 rows/17 tables + 114 media files), backend skeleton with Pattern B auth."),
]
