Skip to content

feat(planner): /planner journey planner (walk + transit) - #486

Open
valeboth wants to merge 2 commits into
n3ary:mainfrom
valeboth:feat/planner-prototype
Open

valeboth wants to merge 2 commits into
n3ary:mainfrom
valeboth:feat/planner-prototype

Conversation

@valeboth

@valeboth valeboth commented Aug 14, 2026 •

Copy link
Copy Markdown

Fills the reserved /planner route with a walk + transit (bus / trolleybus / tram) journey planner. Routing runs client-side (RAPTOR) over the feed's SQLite in the GTFS worker — no backend, works offline, feed-agnostic.

What's in it

  • src/lib/domain/raptor.ts — pure, framework-free RAPTOR engine (pattern preprocessing + rounds + reconstruction) with unit tests (raptor.test.ts, 10 cases).
  • src/lib/workers/gtfs/plannerNetwork.ts — lazy, feed-scoped RAPTOR graph built from SQLite (patterns, footpaths, shapes); cleared on feed switch next to shapeCache.
  • src/lib/workers/gtfs/queries/planner.ts + planJourney on GtfsRepo — access/egress via getStopsNear, active services via activeServicesOn, hydrates legs with names/coords/route/mode; transit legs carry real shapes.txt geometry.
  • src/routes/planner/ — Leaflet map (same OSM tiles as the route map), offline stop search + tap-to-set + GPS origin, day/time controls, itinerary cards, shareable deep links (?from&to&t&d).
  • Nav entry wired in src/routes/+layout.svelte.

Scope / safety

  • Additive: station boards, live pipeline, and reconcile are untouched — "next bus at a stop" behaves exactly as before.
  • Deferred: live-time overlay (needs the station-board per-stop recompute) and street-level walking + address/POI geocoding (Faza C — hosting decision).

Verification

  • Isolated strict tsc on the pure/glue .ts files passes; RAPTOR unit tests pass (10/10).
  • Full npm run check && npm test && npm run build was not run in the authoring environment (private @n3ary/gtfs-spec needs NPM_TOKEN) — CI validates the rest; the .svelte page wasn't run through svelte-check locally.

docs/plan/planner.md is included as a review aid — per the issue/plan lifecycle it should be distilled into a spec and deleted before merge.

@valeboth
valeboth force-pushed the feat/planner-prototype branch 2 times, most recently from 6d457b9 to 93b5c35 Compare August 15, 2026 09:35
Fills the reserved /planner route with a walk + transit (bus/trolley/tram)
journey planner. Client-side RAPTOR over the feed's SQLite - no backend,
works offline; feed-agnostic.

- domain/raptor.ts: pure RAPTOR engine (patterns + footpaths + rounds +
  reconstruction) with unit tests.
- workers/gtfs/plannerNetwork.ts: lazy, feed-scoped RAPTOR graph built from
  SQLite (patterns, footpaths, shapes); cleared on feed switch.
- workers/gtfs/queries/planner.ts + planJourney on GtfsRepo: access/egress
  via getStopsNear, active services via activeServicesOn, hydrate legs with
  names/coords/route/mode; transit legs carry real shapes.txt geometry.
- routes/planner: Leaflet map, stop search + tap-to-set + GPS origin,
  day/time controls, itinerary cards, shareable deep links.

Additive only: station boards / live pipeline / reconcile untouched.

Deferred: live times (needs station-board per-stop recompute) and
street-level walking + address/POI geocoding (Faza C, hosting decision).

Note: full `npm run check && npm test && npm run build` not run in the
authoring env (private @n3ary/gtfs-spec needs NPM_TOKEN). Isolated strict
tsc + RAPTOR unit tests pass; CI / local run validates the rest.
@valeboth
valeboth force-pushed the feat/planner-prototype branch from 93b5c35 to c5c01a5 Compare August 15, 2026 09:37
ciotlosm added a commit that referenced this pull request Sep 28, 2026
The `validate` job failed for fork PRs because its checkout used
`ref: github.head_ref`, which is the branch name on the head repo.
For forks the base repo's GITHUB_TOKEN can't fetch refs/heads/<name>
on the fork; the run died at the first step with:

  A branch or tag with the name '<branch>' could not be found

Switch the ref to `github.event.pull_request.head.sha`, which resolves
via `refs/pull/<N>/head` on the base repo. This works for fork and
same-repo PRs alike. `workflow_dispatch` still honors its `inputs.branch`
and falls back to `github.ref_name`.

Also add `persist-credentials: false` so the token isn't written to
`.git/config` after checkout (no later step reuses it).

Fixes #486 (validate job only; pr-check ASCII + standards
drift jobs already worked because they use the fork-aware default
checkout from n3ary/actions).
@ciotlosm ciotlosm closed this in a17a5a7 Sep 28, 2026
@ciotlosm ciotlosm reopened this Sep 28, 2026
@ciotlosm

Copy link
Copy Markdown
Member

Rebase required

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