Skip to content

Leg routes keep to the leg's corridor - #279

Open
ellmkay wants to merge 3 commits into
claude/project-thread-avzbksfrom
claude/project-thread-rkgqif
Open

ellmkay wants to merge 3 commits into
claude/project-thread-avzbksfrom
claude/project-thread-rkgqif

Conversation

@ellmkay

@ellmkay ellmkay commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Requested by Marcus · project thread

Into #254's branch (course elevation), not main.

What

Marcus: "in a corridor, the suggested route should follow the centre of the corridor, or at least stay inside it". Before this, the route finder ignored corridors entirely.

  • Search (packages/shared/src/route): LegRouteRequest.corridor (centre line + half width, paper mm). confineToCorridor makes every cell outside the corridor uncrossable (the cells the line passes through are kept, so a narrow corridor stays connected). The window shrinks to the corridor's box plus 1 mm. A crossing point's opening stays inside the corridor.
  • Automatic route (leg-routes-auto.ts): a corridor pair's route is its centre line where that line is legal, else the shortest way inside the corridor. A bent corridor whose centre isn't legal never stores an empty row, because an empty row would read as the bent line. The basis digests the corridor only for corridor pairs, so the other pairs keep their basis.
  • Shared pairs: Marcus chose "each course on its own". A pair is confined only when every leg that runs it has the same corridor. A corridor leg's climb reads a chosen route only while that route stays inside its own corridor (routeInsideCorridor), and otherwise reads its drawn line.
  • Editor: the alternatives request carries the corridor, and so does its cache key. There is no new UI.
  • Spec: docs/course-elevation.md §0.46, §7.3, §7.5, §7.6 step 5, §7.8, the Tests table and Pending. Also one line each in course-editor.md §6.7 and guide/course-editor.md.

Verification (cloud)

  • pnpm build passes.
  • pnpm test: shared 2736, api 1533, web 2780, all passing.
  • pnpm lint: 0 errors.
  • Integration: leg-routes-auto, leg-routes, course-climb all pass on PG16 :5433.
  • E2E: e2e/course-editor-routes.spec.ts passes all 4 tests. The new bent-corridor test passed 5 of 5 under --repeat-each 5.
  • Docker images were not built: the container has no Docker daemon. Bringing the stack up is left to the main checkout.
  • A Fable planner and a Fable reviewer were run as separate subagents. The review found a bent corridor around a lake being stored as "the line", a crossing point's opening leaking outside the corridor, and the editor reading the corridor at two scales. All three are fixed in the second commit, with tests.

Generated by Claude Code

A corridor leg's automatic route follows the corridor's centre line where
it is legal, else the shortest way inside; the editor's alternatives are
searched inside the corridor. A pair whose courses differ is searched
without one, and a corridor leg reads a chosen route only while it stays
inside its corridor (course-elevation.md §0.46, §7.3, §7.5, §7.6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZwiGLhqVqaUG86tu32
A bent corridor whose centre is not legal never stores a route without
vertices (it would read as the bent line); a crossing point's opening
stays inside the corridor; the editor reads the corridor's width at one
scale for search and climb. Tests for the map scale, a bent corridor
round a lake, a crossing point, two widths on one pair; the browser test
allows the corner a corridor lets a route cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZwiGLhqVqaUG86tu32
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.

2 participants