feat(gis): add dual-mode tile URL resolver helper for CDN and local routes #110
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/dual-mode-tile-url-resolver"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement dual-mode tile URL resolver helper in
src/lib/gis/tile-url.tsto seamlessly route PMTiles requests to the Cloudflare R2 Anycast CDN edge in production or to the local/tiles/[file]proxy in offline development. Executed playbook:skill://poteto-mode/playbooks/feature.md.Closes #46
Principles applied
principle-model-the-domain: Defined clean options shape and dual resolution paths matching physical environment tiers.principle-boundary-discipline: Isolated environment inspection and URL prefixing logic inside the GIS boundary helper.principle-migrate-callers-then-delete-legacy-apis: Migratedkhg-layer.tsx,peat-soil-layer.tsx, andmap.tsto useresolveTileUrl.principle-prove-it-works: Verified local and CDN edge URL resolutions with isolated unit tests.principle-test-behavior-not-implementation: Tested observable URL output strings directly with literal value assertions.Impact
Anti-Overengineering Audit (ponytail-review)
Verification proof
pnpm exec vp check: Passed (0 errors, 0 warnings across 251 files).pnpm test: All 18 test files and 129 unit tests passed.pnpm build: Passed cleanly, standalone Next.js production build compiled in 18s.e7484f75bb3157171f91Code Review & Ponytail Audit Summary: Dual-Mode Tile URL Resolver Helper
1. Mechanical Verification Gate (
scripts/verify-pr.mjs)2. Ponytail Audit (Zero Bespoke Bloat)
src/lib/gis/tile-url.tsmanaging CDN vs. local proxy routing.khg-layer.tsx,peat-soil-layer.tsx, andmap.tsto use the single source of truthresolveTileUrl.Lean already. Ship.3. Subsystem Boundary & Discipline
src/lib/gis/tile-url.ts, layers, and tests). Zero backend pipeline or script leakage.4. Verification & Test Proofs
vp check: Passed 100% (260 files formatted, 0 warnings/lint errors in 100 files).pnpm test: All 149 tests passed across 21 test suites, including full coverage of CDN edge resolution, fallback local paths, trailing slashes, and protocol prefixing.next build: Next.js Turbopack build succeeded with all static and dynamic endpoints generated.5. Acceptance Criteria
Decision: APPROVED for squash merge into
main.