trails/openspec/changes
Ullrich Schäfer 279734c607
route-surface-breakdown (Phase 2): async Overpass backfill + SSE
Covers routes/activities that enter the journal without BRouter waytags
(imports, uploads, pre-existing rows):

- overpass-ways.server.ts: server-side Overpass client (way[highway] + geom in
  a bbox, configurable OVERPASS_URLS, timeout + oversized-bbox guard).
- surface-match.server.ts: pure nearest-way map-matcher → per-segment
  surface/highway (unmatched → unknown). Unit-tested.
- surface-backfill pg-boss job: load geom → skip if breakdown exists → Overpass
  → match → computeSurfaceBreakdown → store → emit `surface_breakdown` SSE to
  the owner. Idempotent, retry-safe, best-effort; registered in server.ts.
- Enqueued from createActivity (imports/uploads) + owner-on-open in the route &
  activity detail loaders (non-Planner routes, old rows), deduped via singletonKey.
- useSurfaceBackfillUpdates: detail pages subscribe to /api/events and
  revalidate() when their row's backfill lands (live bars, no reload).
- Privacy manifest updated (DE + EN) for the Overpass bbox lookup.

Tests: matchSurfaces unit; surface-backfill job (mocked Overpass/db/events:
store + emit, skip-if-present, skip-if-no-ways). Verified the real
Overpass→match→breakdown pipeline against a live Berlin bbox (509 ways →
plausible asphalt/paving_stones/footway mix). typecheck + lint + unit
(journal 333) green.

Note: the worker runs via server.ts (prod/staging), not `react-router dev`, so
the live job + SSE exercise on a deployed instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 19:18:03 +02:00
..
activity-photos Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
archive openspec: archive profile-stats + profile-weekly-distance, sync specs 2026-06-14 16:34:06 +02:00
changelog Add 8 proposed changes and old trails analysis 2026-03-25 03:57:20 +01:00
garmin-import feat(journal): Garmin activity import — provider, webhook pipeline, backfill (§1–5) 2026-06-07 17:47:22 +02:00
mobile-app Implement mobile route editor with MapLibre and BRouter routing 2026-04-15 01:06:10 +02:00
route-discovery Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
route-features Add 8 proposed changes and old trails analysis 2026-03-25 03:57:20 +01:00
route-federation docs: split-domain handles idea + interop constraint for the trails check 2026-06-07 11:18:13 +02:00
route-sharing docs: fix stale route-sharing → social-federation dependency 2026-06-06 13:16:06 +02:00
route-surface-breakdown route-surface-breakdown (Phase 2): async Overpass backfill + SSE 2026-06-14 19:18:03 +02:00
visual-redesign Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
wahoo-production-cutover Add openspec changes for Wahoo production cutover and route updates 2026-05-01 11:37:42 +02:00