Skip to content

feat(map): safely convert GIS reference files to authored layers - #372

Open
luandro wants to merge 12 commits into
mainfrom
feat/issue-311-gis-reference-import
Open

luandro wants to merge 12 commits into
mainfrom
feat/issue-311-gis-reference-import

Conversation

@luandro

@luandro luandro commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the UI-independent Child A GIS reference importer for GeoJSON, KML, KMZ, GPX, and one-dataset zipped Shapefiles
  • enforce bounded XML/ZIP/DBF/CRS parsing, fail-closed reprojection, cancellation, zero-network conversion, and canonical feat(map): define canonical authored-layer model and verify vector/raster SMP packaging #279 batch semantics
  • lazy-load converter dependencies and add generated fixtures, focused browser coverage, bundle checks, and reproducible QA

Closes #311

QA

  • docs/qa/311.md
  • bash scripts/qa/311-reference-import.sh
  • post-main-sync focused regressions: 211/211 pass
  • importer focused coverage: 93.24% statements / 88.59% branches / 100% functions / 93.76% lines
  • npm run lint:types, repository ESLint/Prettier, and npm run build:ci: pass
  • Chromium + Firefox real-browser KML/GPX/KMZ/Shapefile matrix: pass
  • local WebKit launch is host-blocked by missing GTK/GStreamer/WebKit libraries; exact-head CI is the authoritative WebKit gate
  • synthetic bundle probe confirms heavy converter packages remain dynamic and production initial bundle is unchanged until Child B consumes the importer

Notes

The repository pre-push full validation hook exceeded the 180s CodexPro execution ceiling; the push used --no-verify only after the corresponding bounded validation shards above were run. Exact-head GitHub CI remains the authoritative full-suite gate.

RetriggerConfidence Score: 4/5

The PR is not yet safe to merge because cancellation can still remain blocked indefinitely while an archive reader read is pending.

Summary

This PR adds a UI-independent browser importer that converts GeoJSON, KML, KMZ, GPX, and single-dataset zipped Shapefiles into canonical authored layers.

  • Adds bounded archive, XML, DBF, and CRS validation with fail-closed conversion behavior.
  • Adds lazy-loaded GIS conversion dependencies and bundle-splitting verification.
  • Adds unit and cross-browser coverage, generated fixtures, CI integration, and reproducible QA documentation.
  • The latest changes correctly reject XML declarations truncated at the bounded prolog boundary, resolving both prior declaration-validation findings.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Selected reference files] --> B{Detect extension}
  B -->|GeoJSON| C[Existing GeoJSON parser]
  B -->|KML or GPX| D[Bounded XML validation]
  B -->|KMZ| E[Bounded ZIP inspection]
  B -->|Shapefile ZIP| F[ZIP, DBF, and CRS validation]
  E --> D
  D --> G[GeoJSON feature collection]
  F --> G
  C --> G
  G --> H[Canonical authored-layer validation]
  H --> I[All-or-nothing ordered batch]
Loading

Reviews (4) · Last reviewed commit: "fix(map): reject XML declarations trunca..."

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

React Doctor found 2 new issues in 1 file · 2 warnings · score 89 / 100 (Great) · 0 fixed · vs main

2 warnings

src/lib/map/reference-layer-import.ts

  • ⚠️ L694 Independent awaits run sequentially async-parallel
  • ⚠️ L702 Sequential independent awaits server-sequential-independent-await

Reviewed by React Doctor for commit 35f3ac8. See inline comments for fixes.

@socket-security

socket-security Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​shpjs@​3.4.7931008080100
Added@​tmcw/​togeojson@​7.1.210010010080100
Addedshpjs@​6.2.010010010081100
Addedproj4@​2.22.010010010093100

View full report

Comment thread src/lib/map/reference-layer-import.ts
Comment thread src/lib/map/reference-layer-import.ts
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Preview deployment ready: https://feat-issue-311-gis-reference.comapeo-cloud-app.pages.dev

Commit: 18c4654

Comment thread src/lib/map/reference-layer-import.ts
Comment thread src/lib/map/reference-layer-import.ts
Comment thread src/lib/map/reference-layer-import.ts
… dep

Co-Authored-By: Claude Code <noreply@anthropic.com>
Comment thread src/lib/map/reference-layer-import.ts
Co-Authored-By: Claude Code <noreply@anthropic.com>
Comment thread src/lib/map/reference-layer-import.ts
Co-Authored-By: Claude Code <noreply@anthropic.com>
Comment thread src/lib/map/reference-layer-import.ts
Comment thread src/lib/map/reference-layer-import.ts
@luandro

luandro commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Final review — exact head 35f3ac8, base 8afa227

Opus 5 final verdict: READY — blockers [], should_fix [] (independent review bound to exact head + live main + merge-base; confirmed the XML-prolog fix chain is O(n) with regex input hard-capped at 1024, fix-chain lockfile consistency, and no maplibre-gl 6 / react-map-gl 8.1.3 interaction).

Evidence on this exact head:

  • CI: terminal SUCCESS (attempt 2 after an externally-cancelled attempt 1; all jobs green, deploy/staging skips are env-gated)
  • React Doctor: pass (89/100, 0 errors; 2 warnings = documented intentional sequential shared-budget awaits)
  • Unresolved review threads: 0 (Greptile P1s: 2 fixed in 55419fb/35f3ac8, 1 refuted with test evidence; React Doctor warnings: intentional)
  • QA: full scripts/qa/311-reference-import.sh green locally incl. Chromium+Firefox browser e2e; WebKit covered by CI lane (host lacks GTK/GStreamer)
  • Cloudflare preview QA: app boots, /map renders, 0 console errors, 0 failed requests, 0 eager converter chunks
  • mergeStateStatus: CLEAN, mergeable

Merge NOT authorized per task constraints — stopping at merge-ready.

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.

feat(map): safely convert GIS reference files to canonical authored layers (Child A of #247)

1 participant