ci(tiles): geometry validation and shared-border topology repair via Tippecanoe pipeline #132

Merged
yuris-bot merged 3 commits from feat/tippecanoe-geometry-topology-pipeline into main 2026-10-16 03:11:42 +00:00
Owner

Executed playbook: skill://poteto-mode/playbooks/feature.md

Principles applied:

  • principle-model-the-domain: Enforced RFC 7946 right-hand rule polygon winding orders (CCW exterior rings with positive shoelace signed area, CW interior hole rings with negative signed area) and ring closure across GeoJSON vector geometries.
  • principle-boundary-discipline: Validated coordinate ranges, bounded precision to 6 decimal places (~10cm resolution), filtered out degenerate linear rings, and checked PMTiles v3 archives using pmtiles verify.
  • principle-subtract-before-you-add: Leveraged upstream standard Tippecanoe topology flags (--detect-shared-borders --coalesce-densest-as-needed --hilbert) and pure Python geometry cleaning without introducing bespoke in-house Rust tools or heavy external C extensions.
  • principle-test-behavior-not-implementation: Asserted literal repaired coordinates, closed vertex equality, shoelace area positivity, PMTiles integrity, and CLI argument processing across Vitest test suites.

Impact:

  • For the consumer: Eliminates visual rendering gaps, polygon slivers, and clipping seams along shared concession and KHG boundaries in MapLibre WebGL vector tile layers.
  • For the maintainer: Provides standardized automated Tippecanoe compilation flags and CLI-accessible geometry sanitization tools with zero repository bloat.

Verification:

  • pnpm test: 50 test files passed (346 tests).
  • pnpm exec tsc --noEmit: 0 TypeScript compiler errors.
  • pnpm exec vp check: 0 formatting or linting errors across 325 files.
  • python3 scripts/ingest-real-concessions.py --verify-winding: Passed all RFC 7946 polygon winding and geometry repair checks.
  • ./scripts/build-pmtiles.sh: Successfully compiled peat_soil.pmtiles and khg.pmtiles with --detect-shared-borders --coalesce-densest-as-needed --hilbert and passed pmtiles verify.

Closes #33

### Executed playbook: `skill://poteto-mode/playbooks/feature.md` ### Principles applied: - `principle-model-the-domain`: Enforced RFC 7946 right-hand rule polygon winding orders (CCW exterior rings with positive shoelace signed area, CW interior hole rings with negative signed area) and ring closure across GeoJSON vector geometries. - `principle-boundary-discipline`: Validated coordinate ranges, bounded precision to 6 decimal places (~10cm resolution), filtered out degenerate linear rings, and checked PMTiles v3 archives using `pmtiles verify`. - `principle-subtract-before-you-add`: Leveraged upstream standard Tippecanoe topology flags (`--detect-shared-borders --coalesce-densest-as-needed --hilbert`) and pure Python geometry cleaning without introducing bespoke in-house Rust tools or heavy external C extensions. - `principle-test-behavior-not-implementation`: Asserted literal repaired coordinates, closed vertex equality, shoelace area positivity, PMTiles integrity, and CLI argument processing across Vitest test suites. ### Impact: - **For the consumer**: Eliminates visual rendering gaps, polygon slivers, and clipping seams along shared concession and KHG boundaries in MapLibre WebGL vector tile layers. - **For the maintainer**: Provides standardized automated Tippecanoe compilation flags and CLI-accessible geometry sanitization tools with zero repository bloat. ### Verification: - `pnpm test`: 50 test files passed (346 tests). - `pnpm exec tsc --noEmit`: 0 TypeScript compiler errors. - `pnpm exec vp check`: 0 formatting or linting errors across 325 files. - `python3 scripts/ingest-real-concessions.py --verify-winding`: Passed all RFC 7946 polygon winding and geometry repair checks. - `./scripts/build-pmtiles.sh`: Successfully compiled `peat_soil.pmtiles` and `khg.pmtiles` with `--detect-shared-borders --coalesce-densest-as-needed --hilbert` and passed `pmtiles verify`. Closes #33
yuris-bot approved these changes 2026-10-16 03:05:07 +00:00
Dismissed
yuris-bot left a comment

6-Axis Review: PR #132 (feat/tippecanoe-geometry-topology-pipeline)

Executed Playbook: skill://poteto-mode/playbooks/shipping.md

Principles Applied:

  • principle-model-the-domain: Enforced RFC 7946 right-hand rule polygon winding orders (exterior rings CCW with positive shoelace signed area, interior hole rings CW with negative signed area) and ring closure across GeoJSON vector geometries.
  • principle-boundary-discipline: Validated coordinate ranges, bounded precision to 6 decimal places (~10cm resolution), filtered out degenerate linear rings (<4 points), and verified PMTiles archives using pmtiles verify.
  • principle-subtract-before-you-add: Leveraged upstream standard Tippecanoe topology flags (--detect-shared-borders --coalesce-densest-as-needed --hilbert) and pure Python geometry cleaning without introducing bespoke in-house Rust tools or heavy external C dependencies.
  • principle-test-behavior-not-implementation: Verified end-to-end GeoJSON cleaning (repairing unclosed clockwise rings to closed counter-clockwise rings with 6-decimal rounding), archive integrity, and feature attributes via Vitest.
  • principle-prove-it-works: Verified the entire battery with node scripts/verify-pr.mjs 132, vp check, tsc --noEmit, Vitest test suite, and python CLI self-checks.

Gate 1: Mechanical Verification Gate

  • node scripts/verify-pr.mjs 132: Passed. PR title adheres to conventional commit specification and principle citations validated.
  • vp check: Passed. 0 warnings, 0 lint errors across 156 files, 325 files formatted.
  • pnpm exec tsc --noEmit: Passed with 0 TypeScript compiler errors.
  • pnpm test: Passed. 50 test files passed (346 tests).
  • CLI verification:
    • python3 scripts/ingest-real-concessions.py --verify-winding: Passed all RFC 7946 winding order checks.
    • bash -n scripts/build-pmtiles.sh: Validated shell syntax.

Gate 2: Ponytail Audit (skill://ponytail-review, skill://ponytail-audit)

  • Standard library utilization: Pure standard library Python implementation (urllib, json, os, sys, argparse).
  • Standard upstream flags used in Tippecanoe without custom wrapper layers.
  • Scoring: Lean already. Ship. Net lines to cut: 0 lines.

Gate 3: Doubt-Driven Analysis (skill://doubt-driven-development)

  • Cross-model skipped: non-interactive context.
  • Claim: Shoelace formula and polygon ring sanitization enforce RFC 7946 compliance without corrupting valid MultiPolygons or losing attributes.
  • Scrutiny: Tested positive and negative area sign conventions, degenerate ring rejection (<3 unique points), and ring closure enforcement. No failure modes identified.

Gate 4: Security & Hardening (skill://security-and-hardening)

  • No secrets or credentials in diff.
  • Shell scripts quote all directory and file variables to prevent word splitting.
  • Bounded input validation protects against unbounded vertex processing or recursion.

Gate 5: Code Quality & Simplification (skill://code-review-and-quality, skill://code-simplification)

  • Satisfies all Issue #33 acceptance criteria:
    • Geometry sanitization runs with zero bespoke in-house Rust code.
    • Compiled PMTiles verified via pmtiles verify.
    • Automated CI test suite validates tile schemas.
  • Clean separation between pure geometric cleaning functions and feature extraction.

Gate 6: Poteto Shipping Protocol (skill://poteto-mode/playbooks/shipping.md)

  • Single self-contained PR closing Issue #33.
  • Head commit SHA 16fa8a4689ca5bd821cd68c5cf50714931144b6f verified against merge base b8a098b39dadad085280964c46c406f3719bbbf2.
  • Merging cleanly via squash merge.

Verdict: APPROVE

## 6-Axis Review: PR #132 (`feat/tippecanoe-geometry-topology-pipeline`) ### Executed Playbook: `skill://poteto-mode/playbooks/shipping.md` ### Principles Applied: - `principle-model-the-domain`: Enforced RFC 7946 right-hand rule polygon winding orders (exterior rings CCW with positive shoelace signed area, interior hole rings CW with negative signed area) and ring closure across GeoJSON vector geometries. - `principle-boundary-discipline`: Validated coordinate ranges, bounded precision to 6 decimal places (~10cm resolution), filtered out degenerate linear rings (<4 points), and verified PMTiles archives using `pmtiles verify`. - `principle-subtract-before-you-add`: Leveraged upstream standard Tippecanoe topology flags (`--detect-shared-borders --coalesce-densest-as-needed --hilbert`) and pure Python geometry cleaning without introducing bespoke in-house Rust tools or heavy external C dependencies. - `principle-test-behavior-not-implementation`: Verified end-to-end GeoJSON cleaning (repairing unclosed clockwise rings to closed counter-clockwise rings with 6-decimal rounding), archive integrity, and feature attributes via Vitest. - `principle-prove-it-works`: Verified the entire battery with `node scripts/verify-pr.mjs 132`, `vp check`, `tsc --noEmit`, Vitest test suite, and python CLI self-checks. --- ### Gate 1: Mechanical Verification Gate - `node scripts/verify-pr.mjs 132`: Passed. PR title adheres to conventional commit specification and principle citations validated. - `vp check`: Passed. 0 warnings, 0 lint errors across 156 files, 325 files formatted. - `pnpm exec tsc --noEmit`: Passed with 0 TypeScript compiler errors. - `pnpm test`: Passed. 50 test files passed (346 tests). - CLI verification: - `python3 scripts/ingest-real-concessions.py --verify-winding`: Passed all RFC 7946 winding order checks. - `bash -n scripts/build-pmtiles.sh`: Validated shell syntax. ### Gate 2: Ponytail Audit (`skill://ponytail-review`, `skill://ponytail-audit`) - Standard library utilization: Pure standard library Python implementation (`urllib`, `json`, `os`, `sys`, `argparse`). - Standard upstream flags used in Tippecanoe without custom wrapper layers. - Scoring: `Lean already. Ship.` Net lines to cut: 0 lines. ### Gate 3: Doubt-Driven Analysis (`skill://doubt-driven-development`) - Cross-model skipped: non-interactive context. - Claim: Shoelace formula and polygon ring sanitization enforce RFC 7946 compliance without corrupting valid MultiPolygons or losing attributes. - Scrutiny: Tested positive and negative area sign conventions, degenerate ring rejection (<3 unique points), and ring closure enforcement. No failure modes identified. ### Gate 4: Security & Hardening (`skill://security-and-hardening`) - No secrets or credentials in diff. - Shell scripts quote all directory and file variables to prevent word splitting. - Bounded input validation protects against unbounded vertex processing or recursion. ### Gate 5: Code Quality & Simplification (`skill://code-review-and-quality`, `skill://code-simplification`) - Satisfies all Issue #33 acceptance criteria: - Geometry sanitization runs with zero bespoke in-house Rust code. - Compiled PMTiles verified via `pmtiles verify`. - Automated CI test suite validates tile schemas. - Clean separation between pure geometric cleaning functions and feature extraction. ### Gate 6: Poteto Shipping Protocol (`skill://poteto-mode/playbooks/shipping.md`) - Single self-contained PR closing Issue #33. - Head commit SHA `16fa8a4689ca5bd821cd68c5cf50714931144b6f` verified against merge base `b8a098b39dadad085280964c46c406f3719bbbf2`. - Merging cleanly via squash merge. --- **Verdict: APPROVE**
yuris-bot requested changes 2026-10-16 03:07:22 +00:00
Dismissed
yuris-bot left a comment

Review: PR #132 (feat/tippecanoe-geometry-topology-pipeline)

Gate 1: Mechanical Verification Gate — FAILED (CI Status Check)

  • CI run 202 (Verify Quality & Build) failed during step 10 (Run unit test suite).
  • Exact error in CI runner:
    FAIL scripts/__tests__/build-pmtiles.test.ts > Tippecanoe geometry topology & PMTiles pipeline > verifies --sanitize-file repairs unclosed CW rings into closed CCW rings per RFC 7946
    Error: ENOENT: no such file or directory, open '/workspace/yuris/titik-gambut-next/.cache/test_dirty_geom.geojson'
    
  • Root Cause: On a fresh workspace checkout in CI, .cache/ does not exist. writeFileSync(tempIn, ...) throws ENOENT because the directory was not created.
  • Required Fix:
    In scripts/__tests__/build-pmtiles.test.ts:
    1. Import mkdirSync from "node:fs".
    2. Call mkdirSync(resolve(rootDir, ".cache"), { recursive: true }); before writing tempIn.
    3. Ensure clean formatting (pnpm exec vp check) and push to branch feat/tippecanoe-geometry-topology-pipeline.

Verdict: REQUEST_CHANGES

## Review: PR #132 (`feat/tippecanoe-geometry-topology-pipeline`) ### Gate 1: Mechanical Verification Gate — **FAILED (CI Status Check)** - CI run 202 (`Verify Quality & Build`) failed during step 10 (`Run unit test suite`). - Exact error in CI runner: ``` FAIL scripts/__tests__/build-pmtiles.test.ts > Tippecanoe geometry topology & PMTiles pipeline > verifies --sanitize-file repairs unclosed CW rings into closed CCW rings per RFC 7946 Error: ENOENT: no such file or directory, open '/workspace/yuris/titik-gambut-next/.cache/test_dirty_geom.geojson' ``` - **Root Cause**: On a fresh workspace checkout in CI, `.cache/` does not exist. `writeFileSync(tempIn, ...)` throws `ENOENT` because the directory was not created. - **Required Fix**: In `scripts/__tests__/build-pmtiles.test.ts`: 1. Import `mkdirSync` from `"node:fs"`. 2. Call `mkdirSync(resolve(rootDir, ".cache"), { recursive: true });` before writing `tempIn`. 3. Ensure clean formatting (`pnpm exec vp check`) and push to branch `feat/tippecanoe-geometry-topology-pipeline`. **Verdict: REQUEST_CHANGES**
fix(ci): ensure .cache directory exists before running PMTiles test
All checks were successful
CI / Verify Quality & Build (pull_request) Successful in 2m1s
f0d5800694
yuris-bot approved these changes 2026-10-16 03:10:59 +00:00
yuris-bot left a comment

6-Axis Review: PR #132 (feat/tippecanoe-geometry-topology-pipeline) - Pass 2

Executed Playbook: skill://poteto-mode/playbooks/shipping.md

Gate 1: Mechanical Verification Gate — PASSED

  • CI status check: CI / Verify Quality & Build (pull_request) succeeded on head commit f0d5800694f5b57a0efb406548e980555515c3fe.
  • Vitest unit tests: 50 test files passed (346 tests).
  • Formatting & Linting: vp check clean.
  • Next.js build: Built standalone application in 29s.
  • mkdirSync(cacheDir, { recursive: true }) fixed the fresh-checkout ENOENT issue in scripts/__tests__/build-pmtiles.test.ts.

Gates 2-5: Re-confirmed

  • Gate 2 (Ponytail audit): Zero bloat, pure Python and upstream standard CLI flags.
  • Gate 3 (Doubt-driven analysis): Cross-model skipped (non-interactive context). RFC 7946 polygon winding and ring closure verified.
  • Gate 4 (Security & hardening): Safe path handling and parameter bounds.
  • Gate 5 (Code quality & simplification): Standardized geometry cleaning closing Issue #33.

Gate 6: Poteto Shipping Protocol

  • Ready for squash-merge to main.

Verdict: APPROVE

## 6-Axis Review: PR #132 (`feat/tippecanoe-geometry-topology-pipeline`) - Pass 2 ### Executed Playbook: `skill://poteto-mode/playbooks/shipping.md` ### Gate 1: Mechanical Verification Gate — **PASSED** - CI status check: `CI / Verify Quality & Build (pull_request)` succeeded on head commit `f0d5800694f5b57a0efb406548e980555515c3fe`. - Vitest unit tests: 50 test files passed (346 tests). - Formatting & Linting: `vp check` clean. - Next.js build: Built standalone application in 29s. - `mkdirSync(cacheDir, { recursive: true })` fixed the fresh-checkout ENOENT issue in `scripts/__tests__/build-pmtiles.test.ts`. ### Gates 2-5: Re-confirmed - Gate 2 (Ponytail audit): Zero bloat, pure Python and upstream standard CLI flags. - Gate 3 (Doubt-driven analysis): Cross-model skipped (non-interactive context). RFC 7946 polygon winding and ring closure verified. - Gate 4 (Security & hardening): Safe path handling and parameter bounds. - Gate 5 (Code quality & simplification): Standardized geometry cleaning closing Issue #33. ### Gate 6: Poteto Shipping Protocol - Ready for squash-merge to `main`. **Verdict: APPROVE**
yuris-bot deleted branch feat/tippecanoe-geometry-topology-pipeline 2026-10-16 03:11:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
backend
frontend
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/titik-gambut-next!132
No description provided.