trails/openspec/specs
Ullrich Schäfer 9c4c3d6444
Store Terms version alongside acceptance timestamp
Reviewer's follow-up: it's not enough to record when a user accepted
the Terms; we also need to record which version of the text they saw.

Changes:
- journal.users gains a nullable `terms_version` text column (nullable
  so the three pre-existing users without a version are kept as-is).
- New apps/journal/app/lib/legal.ts exports TERMS_VERSION as a single
  source of truth, reused by the legal pages' "Last updated" header
  and by the registration flow as the value to send/store.
- Registration form posts `termsVersion` alongside `termsAccepted` on
  all three relevant steps (start, finish, register-magic-link).
- API route validates that `termsVersion` is a non-empty string on
  any step that requires terms, and forwards it to the auth server.
- auth.server finishRegistration and registerWithMagicLink now take
  `termsVersion` and persist it on the users row.
- journal-auth spec gets a new scenario for version storage and a
  rejection scenario for missing version.

PRIVACY_LAST_UPDATED is also exported from the same module and used
by the Privacy page header, keeping both pages on a single legal.ts
source of truth for "last updated" labels. Privacy is not per-user
stored — it's informational, not contract.

Existing users have NULL terms_version; if we ever prompt them to
re-accept updated Terms, we can backfill with the version they
re-accept at that point.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 07:46:34 +02:00
..
account-settings Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
activity-feed Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
brouter-integration Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
crash-recovery Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
elevation-map-interaction Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
gpx-import Update specs: session-notes, route-coloring, gpx-import 2026-04-11 03:24:54 +02:00
infrastructure Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
journal-auth Store Terms version alongside acceptance timestamp 2026-04-19 07:46:34 +02:00
legal-disclaimers Realign legal-disclaimers spec with post-review implementation 2026-04-19 07:33:27 +02:00
local-dev-environment Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
map-core Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
map-display Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
multi-day-routes Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
no-go-areas Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
observability Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
osm-poi-overlays Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
osm-tile-overlays Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
planner-journal-handoff Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
planner-session Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
rate-limiting Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
road-type-coloring Add road type color mode to route visualization 2026-04-11 11:13:43 +02:00
route-coloring Update route-coloring spec with all 10 modes, create follow-up changes 2026-04-11 11:20:17 +02:00
route-drag-reshape Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
route-management Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
route-preview Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
route-splitting Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
secret-management Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
security-hardening Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
session-notes Sync notes through GPX, Journal, and Planner roundtrip 2026-04-11 03:35:40 +02:00
shared-packages Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
transactional-emails Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
wahoo-import Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00