Skip to content

Add CI, fix lint purity error, add hook and App tests, real README (#12) - #14

Merged
GeoBradDev merged 7 commits into
mainfrom
issue-12-ci-lint-tests-readme
Nov 7, 2026
Merged

GeoBradDev merged 7 commits into
mainfrom
issue-12-ci-lint-tests-readme

Conversation

@GeoBradDev

Copy link
Copy Markdown
Owner

Adds CI, makes lint pass on main by fixing the real render impurity in useStressPoints, adds the missing hook and App tests, replaces the Vite template README, and adds a repo-root CLAUDE.md.

Summary

  • .github/workflows/ci.yml: single job ci on push to main and on pull_request, Node lts/* with npm cache, running npm ci, npm run lint, npm test, npm run build, npm audit --omit=dev --audit-level=high. Actions pinned to actions/checkout@v7 and actions/setup-node@v7; permissions: contents: read.
  • src/hooks/useStressPoints.js: points are no longer generated during render. A pure-by-argument generateStressPoints(count, random) runs inside a debounced (150 ms) effect timer and the result is held in state. Rapid slider changes generate once, for the last value; 0 clears. Return shape is unchanged, so buildLayers and MapView are untouched. No eslint-disable or rule change was added.
  • New tests: usePorts (success, non-OK response, network rejection), useGPUCapabilities (no navigator.gpu, null adapter, rejecting adapter, success), App render smoke with MapView and useGPUHeatmap mocked and fetch stubbed, and the rewritten useStressPoints tests (debounce, single generation, clear on 0, ranges).
  • README.md: purpose, browser and WebGPU requirements, setup from a clean clone, scripts, data sources and licenses, known limitations.
  • CLAUDE.md: gate commands, style rules (JavaScript only, no emojis, no em dashes), and a ## Git exception scoped to issue-<N>-* branches. This PR changes CLAUDE.md; the repo has no eval suite, so that change is ungated beyond human review.
  • The workgroup overflow mentioned in the issue is already fixed on main (src/hooks/useGPUCompute.js lines 3 to 5 dispatch exactly 65,535 workgroups); no change there.

Behavior note: the PTS readout and the drawn stress points now update about 150 ms after the slider settles (plus generation time), instead of on every slider step.

Plan

docs/plans/2026-11-07-issue-12-ci-lint-tests-readme.md, committed in 55d4cf3. Revised in 85a5f33: public/data/ports.geojson is Natural Earth ne_10m_ports (1,081 features, name property), not the NGA World Port Index as src/config/sources.js says; the README documents the actual source.

Test evidence

Gate on 45be195, in order, all exit 0:

  • npm ci: added 329 packages, 0 vulnerabilities
  • npm run lint: eslint . with no problems (was 2 react-hooks/purity errors on main)
  • npm test: 14 files, 87 tests passed (was 11 files, 77 tests)
  • npm run build: built; maplibre-gl-worker emitted
  • npm audit --omit=dev --audit-level=high: 0 vulnerabilities

TDD: red test committed alone in 9153a6a (2 of 6 failed: Math.random called 200 and 120 times during render), fixed in 54d413e. The new characterization tests were mutation-checked locally (8 of 9 failed with assertions broken).

Live drive (npm run build && npx vite preview, Chrome): basemap, airports and ports render; GPU panel PTS 73,769 at baseline. Slider to 1M: PTS unchanged at 30 ms, 1,073,769 at about 178 ms, stress points drawn. Rapid changes 2M, 3M, 500K, 4M, 200K about 40 ms apart: PTS polled every 5 ms showed only the start value and the final 273,769. Back to 0: cleared to 73,769 at about 159 ms. Airport and port toggles and the feature popup still work. No app console errors. The browser had no WebGPU adapter, so the heatmap path was not driven.

Review findings

  • Fixed (Claude finder): README said the heatmap toggle is hidden only without WebGPU; it is hidden until a heatmap compute succeeds. Reworded.
  • Fixed (Claude finder): CLAUDE.md said not to add eslint-disable comments while two pre-existing ones exist; now says no new ones and names the existing ones.
  • Fixed (Claude and Fable finders, note): useGPUCapabilities "starts unknown" test now awaits the settled tier so no update lands outside act.
  • Dismissed (Fable finder): "CI not yet green on this PR"; premature before push, proven by this PR's checks.
  • Nits left: generateStressPoints does not guard a negative count (unreachable from the slider, min 0); actions pinned to major tags rather than SHAs, per the requested policy.
  • Delta finder and a fresh verifier reported no further findings.

Docs reconciled

  • README.md: rewritten (template replaced).
  • CLAUDE.md: new.
  • docs/plans/...issue-12...md: new, with the deviation note.
  • ADR: none.

Closes #12

🤖 Generated with Claude Code

https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf

GeoBradDev and others added 7 commits November 7, 2026 16:18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…ities test (#12)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
@GeoBradDev
GeoBradDev merged commit 10731f7 into main Nov 7, 2026
1 check passed
@GeoBradDev
GeoBradDev deleted the issue-12-ci-lint-tests-readme branch November 7, 2026 22:33
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.

No CI; lint fails on main; core hooks and components untested; README is the Vite template

1 participant