Project · in progress · live on the web · Started Nov 2026

Hotel finder

Not four hundred hotels: the right five, and why. You describe the trip in a sentence, in English or Spanish, and Penny asks only for what's missing. Say “2 nights in Austin, Texas at a hotel close to Patrizi's” and it finds the restaurant and searches around it. A deterministic ranker checks up to 200 hotels it can book and shows the best five on a map, each with the reason it was picked. Models only turn words into typed actions, and every price comes from the supplier.

A real search on the live app on 18 Nov, typed as one sentence. Penny asks which two nights, then searches around Patrizi's on Manor Road: 73 hotels fit, and the five closest come back on the map, each with its reason. One wait is sped up 2×.
430+Playwright tests, run in a real browser against the live supplier sandbox on every PR
2,100+unit and Postgres tests, the database in-process, plus a typecheck and a migrations check on every PR
200hotels checked per search, in the city or around the place you named; the best five come back with their reasons

How it works

The model reads the request. Code does everything else.

  1. 1

    A message becomes typed actions

    Every message goes first to a typed-decision classifier that only picks among labels; code extracts the values. What it doesn't settle goes to a Haiku agent, capped at four model calls a turn. Both emit actions from one closed Zod union, and every change takes one path: validate against current state, persist, run the finder. The agent names a hotel by its position on screen and a place by a reference from that turn's lookup. It never sees an id. A message that is mostly misspelled, or in a language other than English or Spanish, gets a fixed line with no model call.

  2. 2

    Google finds the place, the supplier finds the hotels

    The supplier's own place search has no record of Patrizi's, a restaurant in Austin. So code asks Google's text search for place IDs only, leaning toward the destination, and the supplier's details for that ID give the point the hotels are searched around. A namesake inside the town counts only if it's the same kind of place: restricted to Munich, “Porsche Museum” answers car dealers, so Penny says the museum is in Stuttgart and offers to search there instead. Only Google's IDs are stored, and a guard fails if the search ever asks Google for more.

  3. 3

    The ranker is a pure function

    No I/O, no clock, no model. Hard constraints first. One priority is a lexicographic order; two or three are an equal-weight sum of rank percentiles; none is a fixed balance of price, rating and distance. Each of the five rows carries a machine-readable reason, and when fewer than five fit, near misses fill the list with what each one lacks. A refinement that keeps where, when and who re-ranks the held offers with no supplier call.

  4. 4

    Ranking is tested three ways

    27 personas are checked against an oracle written from the raw supplier data. A dominance property runs 400 random searches for each of the 8 priority combinations: a hotel no worse on anything and better on something never ranks lower. A purity check shuffles the candidates and the priorities and expects the same order. The dominance test failed on its first run because ranking used exact distance while users see 100 m steps.

  5. 5

    Answers are read from rows

    “Can I cancel the second one?” is answered by a template over the offer and property rows, with no model call. A value the row doesn't hold is said as “the listing does not say”, and a hotel with no facility list is unknown, never “no”. When the agent does write, its words are shown only after a guard rejects any number of two or more digits it wasn't shown, any claim that something was booked or changed, anything over 600 characters, and any reply that didn't finish.

  6. 6

    One claim, one booking

    The supplier re-checks the rate before any payment form. Its book call isn't idempotent: in the sandbox the same prebook confirmed twice. So only the caller that wins a paid → booking claim may book, and the call is never retried. Of four concurrent claims one wins, and a timeout stays “unknown”. Postgres enforces the rest: a partial unique index allows one running turn per session, a unique idempotency key makes a retried send the same turn, and a check constraint requires every finder row to have a reason and a priced offer.

How it's tested

A browser test for every control, and CI writes the ones a change is missing

  1. 1

    Every control and route is claimed

    A guard walks each page through its states, lists every button, link, tab and input on screen, and fails CI on any control no test claims. Each claim names the test that presses it, and a claim that points at a missing test fails too. A second guard reads every API route file and fails if a route or a method has no spec. Both guards were made to fail on purpose before they were trusted.

  2. 2

    Tests assert intent, not today's output

    Assertions come from the docs and the app's own error catalogue, never from what the page happens to print. A test that fails because the app is wrong stays failing until the app is fixed: no skip, no fixme, no snapshot of wrong output. An automatic fixture fails any test that saw a console error, a failed request or an unexpected 4xx or 5xx, and every 4xx and 5xx a route answers is logged with its status code, read back at the end of each run and fails it on any 5xx of ours. Live supplier data is checked for invariants, such as the per-night price being the total over the nights rounded up, never for fixed prices.

  3. 3

    Two minutes on a phone beat the suite

    On 13 Nov I used the app on a phone for two minutes and found more than the whole suite had, and in two places the suite was asserting the bug. Each finding became a test that fails without its fix, and the method became a ten-step hunt run on every feature: use it at phone size with real words, measure overflow instead of eyeballing it, and check one fact on every screen down to the raw supplier payload. A feature isn't done until a browser test drives it at desktop size and at 390 px.

  4. 4

    CI writes the tests a change is missing

    On every PR push, a GitHub Actions job has Claude read the change one commit at a time. For each thing a user or an API caller can now see or do, it finds the test that covers it, writes the ones that are missing and runs them against the sandbox. The workflow, not the model, keeps only what's in e2e/ and posts one plain comment: each new test and what it checks, what was already covered, and the tests as a patch to add in your own commit. It used to push them, until a bot's push made GitHub hold the PR's CI for approval. Its first run read only the last three commits of a large PR, so it now goes commit by commit and shows its evidence.

  5. 5

    Every PR runs it against the live sandbox

    Three shards of two workers each run the suite in Chromium against the real LiteAPI sandbox: real searches, and real bookings that are each cancelled before the test ends. The sandbox allows about five requests a second, so most tests share one stay it answers from cache, and setup retries a refusal while a test of the search itself never does. A push to main merges into every open PR and reruns its CI, and a smoke test runs against every deployment.

Where it is

  1. NOW

    Live at feraltravels.com/hotels: Penny, hotels near a place you name, the ranked five on a map, filters, saved hotels, museum tours, “book it now” from the chat, and Spanish

  2. NEXT

    Real payments. Checkout runs end to end on test Apple Pay and Google Pay sheets today, and no money moves

  3. THEN

    An idea, not yet planned: a whole trip itinerary, with a hotel for each leg close to the places on it

Stack

Next.jsTypeScriptNeon PostgresDrizzleZodClaude HaikuLiteAPIGoogle PlacesMapLibreOpenFreeMapResendVitestPlaywrightGitHub ActionsVercel