explorer: document loadRes-chase invariant on tryEnterPointModeIfNeeded (closes #194)#195
Conversation
…ed (closes isamplesorg#194) Adds a load-bearing invariant block to the helper's doc comment plus a short pointer above the `!loading` short-circuit. Codifies the contract that every `loadRes` call site in the zoomWatcher cell must be followed by `await tryEnterPointModeIfNeeded()` (or be inside the helper itself, or in a path where the user can't be at point altitude). Without the chase, the helper's `!loading` bail-out can strand the user in cluster mode at point altitude — the exact bug round-3 of isamplesorg#191 fixed by adding the source-filter handler's chase call. Future contributors adding new `loadRes` sites need this invariant called out in the code, not buried in the PR thread. Doc-only change: no behavior change. Closes isamplesorg#194. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Switch verification grep from `loadRes\(` to `await[[:space:]]+loadRes\(` so it matches actual call sites (4 lines) instead of also matching the explanatory comments above the helper that mention `loadRes(...)` in prose. - Add "outside this helper" qualifier so the helper's own internal loadRes call is not visually flagged as an exception to the invariant. Doc-only refinement of isamplesorg#194 fix; no behavior change.
Codex review round 1Codex flagged one blocking issue + offered a precision tweak. Blocking
Fix in b87cb49: changed the documented command to Verified locally: Precision tweak (also addressed)
Added the "outside this helper" qualifier in the same commit. Codex's other answers (no action needed)
Asking for re-review. |
Codex review round 2 — LGTM
Merging. |
Summary
Closes #194. Doc-only change to
explorer.qmd— adds a load-bearing INVARIANT block to the doc comment oftryEnterPointModeIfNeeded()plus a short pointer above the!loadingshort-circuit inside the function.The invariant: every
loadRescall site in thezoomWatchercell that could be in flight when the user crosses belowENTER_POINT_ALTMUST be followed byawait tryEnterPointModeIfNeeded(). Without the chase, the helper's!loadingbail-out can strand the user in cluster mode at point altitude — the exact bug round 3 of #191 fixed by adding the source-filter handler's chase call.Why this matters
Future contributors adding a new
loadRessite without the chase would silently break supersession recovery. The bug would surface only as a rare liveness regression (user at point altitude, mode stays cluster, no further events fire) that's hard to attribute back to the missing chase. The PR thread for #191 documented this; this PR moves it to the code itself.Test plan
quarto render explorer.qmdproduces identical output to main.grep -nE 'loadRes\(' explorer.qmdreturns the same set of call sites as main, each either insidetryEnterPointModeIfNeededitself or followed byawait tryEnterPointModeIfNeeded().🤖 Generated with Claude Code