| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
On description.php the gradient-plot hover drops a dot on the companion map. It was positioned by linearly interpolating lat/lon between gradient SAMPLE anchors (put-in, each bin centre that has a lat/lon, take-out). Across a flat reservoir the analysis collapses the whole pool into a single coarse, insignificant bin, so there are no intermediate anchors there and the dot cut a straight chord across the curved channel — on Canyon Creek (id=419) it left the trace around mile 2.7 and ran straight to the take-out instead of following the reservoir. The map already draws the full reach.geom as data-track="[[lat,lon],...]" (200 dense points on 419). Position the dot along THAT polyline by cumulative arc-length: d_mi is distance-from-put-in along the trace, the same parameterization as the geom's cumulative length, so the plot axis fraction maps 1:1 onto a point on the drawn line. The sample-anchor interpolation stays as a fallback for a chart with no companion map track. Verified against 419's data: the old method sat 78-198 m off-trace across the reservoir (the straight chord); the new method returns points that lie on the drawn polyline by construction. JS-only; no DB/PHP change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Review — #98 fix(gradient-profile): ride the geom trace for the hover map dotVerdict: ✅ Approve. Correct root-cause fix, and the chosen approach (parameterize by arc-length fraction along the already-drawn geom) is more robust than the bug it replaces. CI is green. I traced every load-bearing assumption against the code rather than trusting the description. Root cause is accurately diagnosedThe old interpolateLatLon() interpolates between sparse sample anchors (put-in, bin centres with a lat/lon, take-out). A flat reservoir collapses into one coarse insignificant bin, so there are no anchors across the pool and the dot draws a straight chord — exactly the 2.5 → 3.4 → take-out cut described. Confirmed in gradient-profile.js:109‑131. The fix is sound — verified end to end
Nice property worth calling outEven if a reach's geom were ever edited independently of its gradient_profile, riding the drawn polyline is still the visually correct behavior — the dot belongs on the trace the user sees. So this is strictly better than the chord-cutting anchor interpolation in every case, not just the reservoir one. Notes (non-blocking)
🤖 Reviewed with Claude Code |
Sorry, something went wrong.
* docs: round-6 deep project review (graded B+, ▲ from B−) Sixth deep project review of the entire tracked repo — 6 cold facet auditors (Python, PHP/security, schema/data, tests/CI, ops, docs) + synthesizer hand-re-verification, judging two bands: (A) did round-5's fixes durably stick, and (B) what did #93–#98 + migrations 0069–0071 + the two direct-to-main commits introduce. The recursive integrity check passes cleanly for the first time in the series: every round-5 fix (R1.1/R1.2/R1.3/R1.5/R2.1/R3.x/R4.x) landed as a committed PR and is still present at HEAD, and every mechanized guard is proven non-vacuous by break-it experiment. New code is clean — no CRIT/HIGH: #93 USACE kcfs→cfs (correct, per-series), migrations 0069/0070/0071 (idempotent, FK-clean, Bridgeport DROP cascade residue-free), #96/#97 multi-state pickers, #95/#98 gradient JS. Two MED findings, both recurrences of round-5 classes closed by documentation not mechanization: (1) two direct-to-main commits, one of which broke CI on main (the {}-is-a-dict bug); (2) a nightly snapshot overrode migration 0067's sort_name for gauge 217 with no migration. Root cause is shared — main accepts un-CI-gated direct pushes from both humans and the snapshot bot. Lever: route everything through a CI gate (branch protection + a self-gating/auto-merging snapshot), a snapshot-column drift guard, and teach seed_gauge_display to preserve migration-pinned sort_names. Two facet over-claims dissolved on hand-re-verification (the USACE temperature-docstring drop is a correct fix; check_reaches DOES range-check vertices via validate_lat_lon). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: fold external-review corrections into the round-6 review (#99) The PR #99 external verification pass re-confirmed every finding, severity, and the B+ grade against db34ae0 (recommendation: merge), and flagged one inaccurate evidence line plus three off-by-one citations. Corrected: - MED #1: drop the `git branch --contains` "reachable only from main" claim — feature branches later cut from main now contain 9b428bb / 6007c21, so containment no longer distinguishes them. The direct-to- main conclusion stands on the durable evidence (linear f3ed673..HEAD, no merge commit, missing (#NN) suffix). - citations: ci.yml:114→115, SourceUrlTest.php:83-84→84-85, check_reaches.py:212→213. Added an External-review note recording the pass + the one below-LOW item it surfaced (the 0069/0070 header comments' now-stale PENDING_RECONCILIATION wording). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Problem
On description.php?id=419 (Canyon Creek), hovering the gradient/elevation plot moves a dot on the companion map. It follows the trace until ~river-mile 2.7, then shoots in a straight line across the reservoir to the take-out instead of following the channel.
Cause
gradient-profile.js positioned the map dot by linear lat/lon interpolation between gradient-sample anchors (put-in, each bin centre that carries a lat/lon, take-out). Reach 419's samples are dense (every ~0.2 mi) only to d_mi 2.5; the entire reservoir collapses into one coarse, insignificant bin (d_mi 3.4, w_mi 1.6, 0.1 ft/mi). With no intermediate anchors across the pool, the dot draws straight chords 2.5 → 3.4 → take-out — cutting across the curve.
Meanwhile the map already draws the full reach.geom (200 dense points, 33 of them tracing the reservoir) as data-track="[[lat,lon],...]".
Fix
Position the dot along the drawn geom polyline by cumulative arc-length. d_mi is distance-from-put-in along the trace — the same parameterization as the geom's cumulative length — so the plot's axis fraction maps 1:1 onto a point on the drawn line. The dot now rides every bend to the take-out. The old sample-anchor interpolation stays as a fallback for a chart with no companion map track.
JS-only — reuses the geom the map already has; no DB/PHP/payload change.
Verification (reach 419, real data)
Distance of the computed dot from the drawn trace:
*new points are interpolated between adjacent geom vertices, so they lie on the drawn line by construction. A d_mi=2.5 consistency check (new position vs the sample's own lat/lon = 23 m) confirms d_mi ≈ geom arc-length.
biome clean. Generalizes to every reach with a reservoir/flat section, not just 419.
Deploy
Ships via the normal levels build (copies static/ → docroot; the ?v= cache-bust updates on the new mtime). No migration.
🤖 Generated with Claude Code