All packsScheduling & Availability CoreSolve
postgres tstzrange half open adjacent vs overlapping bookings
09:00-10:00 and 10:00-11:00 are adjacent. A naive overlap check calls them a conflict.
The classic overlap predicate a.start <= b.end AND a.end >= b.start treats back-to-back appointments as conflicting, silently halving real availability -- half-open ranges fix it at the type level.
This is one of the things Scheduling & Availability Core already handles. Bookings and availability that survive timezones, repeating events and daylight saving — without double-booking.
Is this you?
Writing an overlap check as a.start <= b.end AND a.end >= b.start treats two bookings that end and begin at exactly the same instant -- 09:00-10:00 followed by 10:00-11:00 -- as overlapping, when they're actually adjacent and perfectly bookable back to back. Every slot boundary in a busy calendar silently becomes unavailable, cutting real capacity without any error ever appearing.
Why this one is easy to get wrong
The <= / >= overlap predicate is the version most people write first, because it reads naturally as 'do these two ranges touch at all' -- and it's subtly wrong only at the exact boundary instant, which single-appointment manual testing rarely constructs deliberately. The bug is a quiet reduction in available slots, not a crash, so it's the kind of thing that's noticed as 'the calendar seems fuller than it should be' rather than as a bug report with a stack trace.
What you get instead
Every range in the schema is a Postgres tstzrange enforced half-open ([)) by a CHECK constraint (lower_inc AND NOT upper_inc), so adjacency versus overlap is decided at the type level rather than by an application-level comparison someone could get subtly wrong. This is also exactly what the booking exclusion constraint indexes, which is what guarantees the availability check in application code and the constraint the database actually enforces can never quietly disagree about what counts as a conflict.
Source: ARCHITECTURE.md 'Half-open [) everywhere' — checkable in the pack you receive
How you actually use this
You don’t install a library or wire up an SDK. Your own coding agent builds the code in your project, and you keep it — no runtime dependency on us.
Step 1
Download and unzip
You get a folder: the docs that tell an agent what to build, a starting skeleton, and the test suite that decides when it's done.
Step 2
Open it in Claude Code or Cursor
Point your coding agent at the folder. Nothing to install, no account with us, no API key.
Step 3
Paste one prompt
The pack contains the exact prompt. Paste it as your first message and leave it alone — it works through the build itself, choosing a cheaper or stronger model per task.
Step 4
Run ./verify.sh
One command. It prints a pass or fail for every check. Green means the build is done — the same script we ran to produce the receipt on this page.
Typical build: about 22 minutes of your agent working, mostly unattended. Then you integrate the working module into your app the way you would any code you’d written yourself.
Why you can believe this
3 of 3 runs passedWe ran this pack from an empty folder 3 times and published exactly what happened — every check, the model, the token cost, the wall time. Not a testimonial, and not our opinion: the same verify.sh you run yourself. Read the full receipt →
Related problems
Scheduling & Availability Core
Two buffers both apply -- they don't collapse into the bigger one
Scheduling & Availability Core
The fix everyone reaches for doesn't error. It just doesn't book anything.
Scheduling & Availability Core
Two READ COMMITTED transactions can both see the same free slot and both win