Skip to content

Keep the physical map foundation continuous at every zoom - #30

Merged
Occumed79 merged 85 commits into
mainfrom
fix/continuous-base-surface
Jul 29, 2026
Merged

Keep the physical map foundation continuous at every zoom#30
Occumed79 merged 85 commits into
mainfrom
fix/continuous-base-surface

Conversation

@Occumed79

@Occumed79 Occumed79 commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Problem

Production changed its physical appearance as the user zoomed. The worldwide landcover foundation was explicitly stamped with maxzoom: 5, so it disappeared exactly when regional routing began at zoom 6. That caused vegetation and other physical layers to switch character even though the browser source URL remained constant.

The runtime also needed stronger protection against slow, missing, malformed, oversized, conflicting, or overloaded PMTiles data.

Continuous-map repair

  • one permanent browser source: /tiles/{z}/{x}/{y}.pbf;
  • one authoritative land, landcover, and depth foundation at every zoom;
  • worldwide landcover now remains native through surface zoom 10 and overscales through zoom 16;
  • overview and regional archives cannot replace those foundation layers;
  • roads, boundaries, labels, buildings, parks, and landuse are additive detail only;
  • the exterior white-blue atmosphere uses a tracked bright limb plus layered outward glow without raising hemisphere fog.

Aggressive hardening

Upstream PMTiles reads

  • strict HTTP(S) URLs and byte-range validation;
  • bounded retries with permanent/transient error classification;
  • per-range deadlines, exponential backoff, jitter, and circuit breaking;
  • upstream byte-size limits and source telemetry.

Gateway

  • strict, size-bounded, duplicate-free manifest validation;
  • last-known-good manifest and tile recovery;
  • bounded shard fan-out, archive-read concurrency, queue depth, and in-flight tiles;
  • deterministic routing and antimeridian coverage;
  • fresh/stale LRU cache with byte and entry budgets;
  • fail closed when a required shard or authoritative physical surface is missing;
  • resolved tile size limits and health diagnostics.

Vector-tile safety

  • malformed PBF rejection before merge or overscaling;
  • revalidation after merged and overscaled encoding;
  • limits for encoded bytes, layers, features, points, properties, extents, and coordinates;
  • reused polygon IDs cannot stitch unrelated rings into wedges or bands;
  • overscaled polygons are clipped to the requested child tile;
  • canonical zero-byte protobuf is accepted only as a valid empty vector tile.

Production HTTP server

  • asynchronous gzip instead of event-loop-blocking compression;
  • tile-request concurrency and deadline limits;
  • ETag/304 and identity/gzip equivalence;
  • bounded cache headers with stale-if-error;
  • /healthz liveness, /readyz readiness, and optional internal gateway diagnostics;
  • strict asset 404s, coordinate rejection, security headers, request IDs, structured errors, and graceful shutdown.

Mandatory forensic and soak gates

  • static lock prevents reintroducing the zoom-5 cutoff or weakening the tracked bloom;
  • exhaustive Amazon and Pacific checks at every integer zoom 0–16 plus 5.9, 6.0, and 6.1;
  • continuous globe-to-street, street-to-globe, border, Europe, antimeridian, and zoom-6 threshold motions;
  • six complete 0–16 sweeps across land, forest, ocean, Europe, and the antimeridian;
  • three-wave sustained soak across zooms 0–16, nine global centers, hundreds of real requests, and a 64-request coalesced hot tile;
  • after soak: zero queued reads, zero in-flight tiles, zero overloads, bounded cache memory, stable ETags, and no open circuits;
  • every gate preserves its report, screenshots, stdout, server log, aggregate status, and final tile-health snapshot even after a failure.

Required gates before merge

  1. Exact lockfile install, production vulnerability audit, and dependency-graph validation.
  2. Full npm run build, deterministic chaos suite, continuity lock, and server checks.
  3. Candidate HTTP contract and sustained worldwide soak.
  4. Complete zoom 0–16 sweeps in both directions with no blank frame, source change, or missing physical layer.
  5. Cross-border, cross-shard, Europe, antimeridian, regional, city, street, and routing-threshold motion tests.
  6. Polygon regression renders with no wedges, bands, circles, or tile seams.
  7. Continuous Amazon land/landcover and Pacific depth at all tested zooms.
  8. Clearly visible tracked exterior atmosphere bloom at globe zoom without hemisphere wash.
  9. No external vector requests, page errors, HTTP failures, open circuits, overloads, or undrained queues.
  10. Candidate screenshots and JSON diagnostics visually inspected.

Merge rule

Keep this PR draft and unmerged until every gate is green and the candidate artifacts are visually inspected.

Summary by CodeRabbit

  • New Features

    • Improved worldwide map navigation with continuous foundational layers across zoom levels.
    • Added a subtle globe atmosphere bloom that adapts as you zoom.
    • Local development startup can automatically prepare required navigation map assets.
    • Added persistent navigation tile caching for faster repeated access.
  • Bug Fixes

    • Improved tile reliability with safer validation, retries, caching, compression, and conditional requests.
    • Enhanced handling of invalid requests, overloaded services, and temporary upstream failures.
  • Tests

    • Expanded automated checks for zoom continuity, tile health, security, performance, and globe-wide navigation behavior.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2cf182ef-a7a2-491d-9433-5a0cdc182eff

📥 Commits

Reviewing files that changed from the base of the PR and between 1be1ccf and 71aa755.

📒 Files selected for processing (32)
  • .env.example
  • .github/workflows/security-hardening.yml
  • .github/workflows/validate-continuous-zoom.yml
  • package.json
  • scripts/apply-mapbox-rendering-contract.mjs
  • scripts/apply-schema-parity.mjs
  • scripts/build-world-overview.mjs
  • scripts/capture-polygon-regression.mjs
  • scripts/check-cartography-parity.mjs
  • scripts/check-continuous-foundation-lock.mjs
  • scripts/check-globe-parity.mjs
  • scripts/check-neon-navigation-cache.mjs
  • scripts/check-photo-reference.mjs
  • scripts/check-pmtiles-integration.mjs
  • scripts/check-world-hardening.mjs
  • scripts/check-world-http-hardening.mjs
  • scripts/check-world-soak.mjs
  • scripts/check-world-tile-gateway.mjs
  • scripts/prepare-world-bathymetry.mjs
  • scripts/prepare-world-landcover.mjs
  • scripts/start-localized-world.mjs
  • scripts/validate-all-zoom-levels.mjs
  • scripts/validate-continuous-zoom.mjs
  • server.mjs
  • src/occumed-map.js
  • src/server/mvt.js
  • src/server/neon-navigation-tile-cache.js
  • src/server/pmtiles-source.js
  • src/server/tile-safety.js
  • src/server/world-tile-gateway.js
  • src/server/world-tile-routing.js
  • src/styles.css

📝 Walkthrough

Walkthrough

The change introduces continuous worldwide foundation rendering, a Neon-backed navigation tile cache, hardened tile composition and HTTP delivery, localized local startup, and expanded browser, soak, security, and CI validation.

Changes

Worldwide tile continuity and hardening

Layer / File(s) Summary
Continuous foundation rendering
scripts/*, src/occumed-map.js, src/styles.css, package.json
Foundation layers, zoom ranges, opacity rules, tile retention, atmosphere bloom, and style-contract checks are updated for continuous worldwide rendering.
Safe tile composition and routing
src/server/mvt.js, src/server/tile-safety.js, src/server/pmtiles-source.js, src/server/world-tile-gateway.js, src/server/world-tile-routing.js
Vector-tile validation, retry and circuit-breaker behavior, manifest validation, bounded caching, fan-out limits, stale fallback, and continuous surface merging are added.
Persistent navigation tile cache
src/server/neon-navigation-tile-cache.js, .env.example
Navigation tiles can use deterministic Neon database sharding with HTTP SQL transport, bounded retention, lifecycle methods, and secret-free health snapshots.
Hardened server delivery and local startup
server.mjs, scripts/start-localized-world.mjs, package.json
Tile responses add concurrency controls, timeouts, ETags, conditional requests, async gzip, safer ranges, strict routing, graceful shutdown, and localized PMTiles startup.
Expanded validation and CI gates
.github/workflows/*, scripts/check-*, scripts/validate-*, scripts/capture-polygon-regression.mjs
Security, hardening, HTTP, soak, zoom-sweep, polygon, integration, and foundation-lock checks now produce consolidated reports and artifacts.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

  • Occumed79/Map#26 — Extends the same worldwide tile gateway and server tile endpoint flow.
  • Occumed79/Map#23 — Also modifies PMTiles serving and related integration validation.
  • Occumed79/Map#29 — Shares the MVT merge and overscaling pipeline.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/continuous-base-surface

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@Occumed79
Occumed79 marked this pull request as ready for review July 29, 2026 00:08

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@Occumed79
Occumed79 merged commit ba835de into main Jul 29, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant