Commit graph

7 commits

Author SHA1 Message Date
Philip Peterson
d0fb299f13 Price rides with rate cards, surge and driver share, by market
Dispatch now prices rides with a basic model inspired by public
information on Uber and Lyft (docs/pricing.md): base + per mile + per
minute, times a per-zone surge multiplier from recent requests against
available drivers, plus a booking fee, with a minimum. Riders get an
upfront quote per ride type and book against it; drivers see and earn
a configurable share (75%) of the fare.

Rate cards are per market, chosen by pickup location: San Francisco
(third-party 2026 rates) and Fairbanks, AK (its own UberX and UberXL
rates, Comfort from Anchorage, no Black). Everything is configurable
via PRICING_FILE or POST /test/reset.

Tests use a simple test card by default so auction scenarios keep
their numbers; new scenarios cover SF rates, Fairbanks rates and surge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 08:47:10 -08:00
Philip Peterson
da9172e594 Add driver app with driving mode, and mock location in the simulator
Build a separate driver app from the same codebase: APP_VARIANT=driver
(app.config.ts) sets its name, bundle ID and scheme, eas.json gets
driver build profiles, and Stack.Protected keeps each app to its own
screens. metro.config.js keys Metro's cache by variant so switching
apps never serves the other's baked-in config.

Drivers get ride requests only in driving mode. While driving they see
a waiting animation or, on a ride, turn-by-turn directions; requests
slide up over either without disturbing it. Accepting mid-ride queues
the ride (one in progress plus one queued). Going offline or online
mid-round leaves or joins it.

Simulated phones no longer touch the location API: each sits at a
mocked position from its URL (default downtown San Francisco). Phone
specs in sim.html move to named key=value options.

Scenarios cover driving mode, interruptions, the ride queue and
mocked location, each with a slow version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 08:14:23 -08:00
Philip Peterson
a01cb76f9e Switch to a rising-price auction with configurable pricing
Drivers no longer enter bids. Each round offers every available driver
the same suggested fare to accept or pass; the first accept to reach
dispatch wins. A round with no taker is followed by one at a higher
price, until the policy's cap. Start, step, cap and round length are a
configurable policy (env vars, POST /test/reset), with policyFor() as
the hook for pricing by locality later.

Phones can be paused in tests (cy.pausePhone / cy.resumePhone), which
queues what they send and buffers what they receive, to stage races
such as two drivers accepting at once. Late accepts are rejected and
recorded on the round.

Scenarios are rewritten for rounds and a race scenario is added, each
with a slow version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 07:32:39 -08:00
Philip Peterson
8d8b6727c7 Add slow versions of every auction scenario
Each scenario gets a spec in cypress/e2e/slow/ that replays the same
steps for watching: every phone step pauses and outlines the acting
phone, typing is visible, time windows stretch 4x, and the final
screen holds for 5 s. npm run e2e:slow runs them in a visible Chrome
window; npm run e2e still runs only the normal-speed specs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:49:58 -08:00
Philip Peterson
3a9944489f Split auction scenarios into one Cypress spec each
Scenario steps move to cypress/scenarios/ and each gets a thin spec in
cypress/e2e/, so the same steps can back more than one spec. Shared
phones move to cypress/support/phones.ts, and "Run all specs" is
enabled in the Cypress UI for playing every scenario back to back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:39:14 -08:00
Philip Peterson
64ab853eeb Add ride app, auction dispatch, and multi-phone Cypress simulator
Build the rider app on Expo Router (map, place search, ride options,
trip history). Replace the simulated driver match with a dispatch
server that runs a sealed-bid price auction: online idle drivers bid
up to the rider's quoted fare, and the lowest bid wins.

Add a driver screen, web support (map falls back to a backdrop), a
same-origin simulator page (public/sim.html) that runs each phone in
an iframe, and Cypress scenarios that drive the phones and assert on
both the UI and dispatch state. See docs/multi-phone-simulator.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 01:56:54 -08:00
Philip Peterson
18ee1ee6b5 Initial commit
Generated by create-expo 5.0.2.
2026-09-28 00:56:27 -08:00