Skip to content

booking.com: return the house rules in get_property - #142

Merged
yummybomb merged 7 commits into
mainfrom
hypeship/booking-house-rules
Oct 29, 2026
Merged

yummybomb merged 7 commits into
mainfrom
hypeship/booking-house-rules

Conversation

@yummybomb

@yummybomb yummybomb commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

get_property already read Booking.com's house-rules section, but returned only the check-in and check-out times from it. It now also returns property.house_rules: every section in page order, each with its title as the page shows it and its text lines. That covers pets, accepted payment methods and cash, children and extra beds, age restriction, smoking, parties, quiet hours and groups, so an agent can answer "does this hotel allow pets / take cash" without leaving the tool.

  • Card brands are logos on the page, so they are read from each image's alt text ("Visa", "Mastercard"), next to the text items ("Debit card", "Cash" or "Cash is not accepted").
  • A crib or extra-bed row stays one line: "4 - 12 years: Extra bed upon request, € 12.50 per child, per night". When one age range has several offers, each keeps its own charge: "0 - 2 years: Extra bed upon request, $35 per stay; Crib upon request, Free". A single age ("2 years old") is grouped the same way.
  • Lines are the page's own wording. Nothing is interpreted; a section the property did not fill in is absent.
  • The field is also present with no_availability and no_rate_for_party, which already return property. A page without a house-rules section gives []; a section the tool cannot split into rows gives null, so a markup change is not mistaken for "no rules". Rows that include neither Check-in nor Check-out (every property lists both) also give null.
  • Rows are found as the siblings of the section's shallowest <hr> separator, so the parser doesn't depend on how deep the list sits and a separator inside a row's content is not taken for one.
  • Lines are capped at 600 characters, marked with "…" when cut. The list is bounded at 20 sections, 30 lines per section and about 20 KB, which also bounds the no_availability and no_rate_for_party outputs; property.house_rules_truncated says when anything was left out.

check_in_time and check_out_time are unchanged.

Status

get_property is verified on this source (325e0ae). Independent QA on 2026-10-29, signed out in plain Kernel browsers started on the Booking.com home page:

  • search_stays then get_property at Palacio Ramalhete returned all nine house-rules sections, including "Pets are not allowed.", the card logos as American Express, Visa and Mastercard next to "Cash is not accepted", and the crib row as one line, untruncated.
  • Bench booking-house-rules, 5 pairs per model, low thinking: Haiku 5.5 treatment vs control correct 5/5 vs 5/5 (1.2x faster), GPT-6 Luna 4/5 vs 2/5. Every treatment trial that got get_property output answered correctly (9 of 9); Luna's one treatment miss never got output from the tool.
  • The null and truncated paths are covered by fixtures only, and signed-in sessions were not tested.

Tests

  • New tests use a fabricated house-rules section that mirrors the live markup: icon cells, &amp; in a title, an inline link, child policies, crib and extra-bed rows, card logos, and "Cash is not accepted". A second test covers no_availability and a page with no section. The existing property test now expects house_rules too.
  • A third test covers a separator nested inside a row, an en-dash crib age range, a line over 600 characters and a section with no separators (null).
  • A fourth test covers the bounds: more than 20 sections, more than 30 lines, and oversized rules on a no_availability page (output stays under 30 KB, house_rules_truncated true). The separator test also covers rows split on a separator inside a row (null), a single-age crib row and a two-offer age row.
  • Mutation check: dropping the crib-row grouping fails 1 test; dropping the logo alt text fails 1 test; taking the first <hr> instead of the shallowest, returning [] instead of null, dropping the en dash and restoring the 300-character cut each fail at least 1 test. So do dropping the Check-in/Check-out check, the multi-offer grouping, "years old", the byte bound, the section cap and the line-truncation flag.
  • node --test "tests/*.test.mjs": 4489 pass. node scripts/validate-registry.mjs: 295 tools valid.

Live check (author, not independent QA)

Run on the first revision; the follow-up commits were not invoked live as a tool. The final parser was run against house-rules sections captured from 38 live property pages (23 Lisbon, 15 Orlando): every page has Check-in and Check-out rows at one separator depth, none was truncated, house_rules was 0.8–1.9 KB, and the single-age and two-offer crib rows (5 pages) came out as one line each.

Registered on a Kernel browser and invoked from the Booking.com home page for six Lisbon properties, 2 adults, Dec 7–9. Every call returned ok, and each section matched the page:

  • pets allowed with charges, and pets not allowed;
  • cash accepted, and "Cash is not accepted";
  • cards-only lists, and mixed card, debit and cash lists;
  • crib and extra-bed rows with charges;
  • "No age restriction" and minimum age 18;
  • parties, quiet hours and groups.

house_rules added about 1.2–1.4 KB to each output.

Follow-up

The bench intent booking-house-rules moves from gap to inspect in this PR, since get_property now answers it. booking.com needs a new gap intent that no tool covers.

@yummybomb
yummybomb marked this pull request as ready for review October 28, 2026 16:49
@yummybomb
yummybomb merged commit d4c49ff into main Oct 29, 2026
2 checks passed
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.

1 participant