Projects / Kennel API / KNL-15
KNL-15 · Epic
Product Story Testsuite ∞ pts
- Status
- In progress
- Reporter
- Product owner
- Assignee
- Coding agent
- Priority
- Highest
- Fix versions
- 18 releases
- Due
- Yesterday
- Benchmark
- v1.0.0+dirty
- Source
- GitHub
Description
A coding agent builds a dog daycare API from an OpenAPI spec, then lives through 18 releases of a product owner changing their mind. Hidden tests grade every release. See which language, model and harness keep up.
- 1.0.0Just a dog register.1.0.0 first releaseThe product ownerGreat news, we won the kennel account! They need a simple dog register with check-in and check-out. MVP only, nothing fancy. I've told them two weeks.Added
- Dog register: create, read, replace and delete dogs (
/dogs). - Check-in and check-out (
/dogs/{dog_id}/check-in,/dogs/{dog_id}/check-out). - Visit history per dog (
/dogs/{dog_id}/visits). GET /healthfor readiness checks.
- Dog register: create, read, replace and delete dogs (
- 1.1.0⚡1.1.0 minorThe product ownerSmall thing: health and safety visited, and the client is now very passionate about vaccinations. No shots, no check-in. Also the front desk can't scroll a list of every dog ever, so could you paginate it? I said it's a config change.Added
- Vaccination records:
GET/POST /dogs/{dog_id}/vaccinationsandDELETE /dogs/{dog_id}/vaccinations/{vaccination_id}. vaccinatedon every dog.GET /dogsfilters:vaccinated,present.- Pagination (
limit,cursor) onGET /dogsandGET /dogs/{dog_id}/visits. - Error responses may carry a
detailsobject.
- Check-in now requires the dog to be fully vaccinated (rabies, DHPP, bordetella, none expired). Otherwise:
409 vaccination_missing. GET /dogsandGET /dogs/{dog_id}/visitsnow return{ "items": [...], "next_cursor": ... }instead of a bare array.
- Vaccination records:
- 1.1.11.1.1 patchThe product ownerHotfix request. Staff have been typing weights into the notes field and now nobody can search them. Can we just add a weight? In kilograms. Today if possible.Fixed
- Dogs can now have a weight. Staff were writing it into
notes, which nobody could search. Addedweight_kg(optional, kilograms).
- Dogs can now have a weight. Staff were writing it into
- 1.2.0⚡1.2.0 minorThe product ownerExciting update: the client knocked down a wall and now has proper rooms with cages. They need to know where every dog is at all times. I may have demoed this already with a mock-up, so it needs to match.Added
- Rooms with numbered cages of size
small,mediumorlarge:GET/POST /rooms,GET/DELETE /rooms/{room_id}. GET /dogs/{dog_id}/location: which room and cage a dog is in.POST /dogs/{dog_id}/move: move a checked-in dog to another cage.- Check-in accepts optional
room_idandcage_id. - Visits record
room_idandcage_id.
- Check-in always places the dog in a cage, automatically if none is requested. It fails with
409when no suitable cage is free. Dogs without a known weight only fit large cages.
- Rooms with numbered cages of size
- 1.3.01.3.0 minorThe product ownerThe client signed a partner integration, and the partner wants "a clean, human-friendly weight field". So a string, like "12.5kg" or "27 lb". Yes, we already have
weight_kg. Keep both. The partner is very important.Addedweighton dogs, a string such as"12.5kg"or"27 lb". It is another view of the same value asweight_kg; send either or both.
- Responses always include both
weightandweight_kg.weightis always given in kg. - Sending both fields with different values is rejected with
422 weight_mismatch.
- 1.4.0Don't ask about room B.1.4.0 minorThe product ownerThere was an incident in room B. I won't go into it. We need to know which dogs are in heat and keep them away from the intact males. The client asked for this yesterday.Added
in_heaton dogs (nullfor males).PUT /dogs/{dog_id}/heatto flip it quickly from the front desk.GET /dogs?in_heat=true.
- A dog in heat and an intact male can no longer be in the same room. Check-in and move fail with
409 heat_conflict, and automatic placement avoids such rooms.
- 1.5.01.5.0 minorThe product ownerOwners keep calling to change their phone number, and staff update every one of their dogs by hand. Give owners their own records. Also the partner wants to send their whole dog list in one go. Can't be that hard, it's just a file.Added
- Owners:
GET/POST /owners,GET/PUT/DELETE /owners/{owner_id}, andGET /owners/{owner_id}/dogs.GET /owners?phone=...finds an owner by phone number. owner_idon dogs, andGET /dogs?owner_id=....POST /dogs/import: one dog per line (application/x-ndjson), up to 10,000 lines. Each line is imported or rejected on its own; the response counts both and lists rejected lines with their error codes.
- A dog takes
owner_idor, as before, an inlineowner. An inline owner is matched to the existing owner with the same phone number, digits only (+358 40 123and35840123are the same), and a new owner is created when none matches. - Dog responses keep the inline
owner, now read from the owner record, so a changed phone number shows on every dog at once. - Deleting an owner who still has dogs is
409 owner_has_dogs.
- Owners:
- 2.0.0Let's add cats!2.0.0 majorThe product ownerBig one! The client is expanding into cats, so everything that says dog now says animal. The partner hasn't budgeted for an upgrade, so the old API has to keep working exactly as it is. I've called it a "phased migration" in the deck.Added
- Cats, under
/cats.GET/POST /cats,POST /cats/import,GET/PUT/DELETE /cats/{cat_id}, and under a cat:vaccinations,check-in,check-out,move,visitsandlocation. An owner's cats are atGET /owners/{owner_id}/cats. A cat has noin_heat, and there is no/cats/{cat_id}/heat. - Cats need
rabiesandfvrcpvaccinations. A vaccination'stypemust be one the animal's species uses, otherwise400 validation_failed. cat_id. Everything that has adog_id(visits, vaccinations, cages, locations) now has acat_idtoo. Exactly one of the two is set; the other isnull.- A cat's id is never also a dog's id.
/dogs/{dog_id}with a cat's id is404 not_found, and the other way round. - Cages have a
speciesrestriction (dog,catorany, defaultany). Placing an animal in a cage for another species is409 cage_wrong_species. /v1. The Kennel API 1.5.0 is served unchanged under/v1(/v1/dogs,/v1/owners,/v1/rooms, ...) until 3.0.0, on the same data. It only sees dogs: a cat is404there, and a cage holding a cat showsdog_id: nullbut is not free. Every 2.0.0 rule still holds for changes made through/v1, answered with the closest 1.x error code.
- Errors are now
application/problem+json, also for/owners. The olderrorfield is nowcode;messageis nowdetail. Validation errors list the offending fields ininvalid_params.details.missingis nowmissing,details.owner_idis nowowner_id, and an import's per-lineerroris nowcode. dog_checked_inis nowanimal_checked_in, andowner_has_dogsis nowowner_has_animals. An owner with a dog or a cat can't be removed.GET /dogs/{dog_id}/locationfor a dog that is not checked in is now409 not_checked_in(it was404). The same goes for cats.- An inline
owneron a cat is matched by phone number against all owners, as it is for dogs: a dog and a cat can have the same owner.
- Cats, under
- 2.1.0⚡2.1.0 minorThe product ownerFeedback from the floor: not every cat likes dogs, and apparently the dogs have opinions too. A dog and a cat only share a room if both are friendly. Through the old API too, the partner still hasn't moved.Added
dog_friendlyon cats (defaults tofalse) andcat_friendlyon dogs (null, unknown, by default).GET /cats?dog_friendly=...andGET /dogs?cat_friendly=....weight_gon cats: the weight in whole grams, from 1 to 120000, ornullwhen unknown.
- A cat has
weight_ginstead ofweight_kgandweight, in requests and responses, imports included. A cat in a response has noweight_kgand noweightfield, andweight_kgorweightin a request for a cat is400 validation_failed. Dogs are unchanged, in this API and in/v1. - Cage sizes for cats count 1000 g as 1 kg: up to and including 10000 g fits
small, up to and including 25000 g fitsmedium, anything and unknown weight fitslarge. - A dog and a cat can share a room only if the dog is cat friendly and the cat is dog friendly. Unknown counts as "no". Placement that breaks this is
409 compatibility_conflict, and automatic placement skips such rooms. - The rule holds for check-ins and moves through
/v1too. There it is409 heat_conflict, the only 1.x code for a room-sharing rule. PUT /dogs/{dog_id}keepscat_friendlywhen the field is omitted: the front desk kept wiping it by accident.PUT /cats/{cat_id}withoutdog_friendlystill resets it tofalse.PUT /v1/dogs/{dog_id}never touches it, since the 1.x API doesn't know the field.
- 2.2.02.2.0 minorThe product ownerBit awkward. The insurer did an audit and found that anyone on the wifi can delete a dog. We need logins, roles, and a log of who changed what. And please stop sending me the admin password on Slack.Added
POST /login: a username and password for a bearer token. Logins have a role:admin,stafforowner.PUT /owners/{owner_id}/login: staff give an owner a login, so owners can read their own animals. Replacing it ends the old login's tokens.GET /audit(admins only): every change, through either API, with who made it, when, and the record before and after. Filter byentity,entity_id,actor,sinceanduntil; paginated. A dog's entries have entitydog, a cat'scat.credentials.json. Write one admin and one staff login tocredentials.jsonat the root of the workspace. How these logins come to exist is up to you, but they must work whenever the service runs.
- Every request except
GET /healthandPOST /loginneedsAuthorization: Bearer <token>,/v1included:401 unauthorizedwithout a valid token,403 forbiddenwhen the role may not make the request. - Staff may do everything except delete rooms and read the audit log. Owners may only read their own animals (another owner's is
404) and their own record.
- 2.3.02.3.0 minorThe product ownerHalf our owners have a work phone, and the other half share a landline with someone who never picks up.Added
409 owner_ambiguous: an inlineownerwhose phone numbers belong to more than one existing owner.
- An owner has
phonesinstead ofphone: a list of one to five phone numbers, the first being the primary one. This holds everywhere an owner is sent or shown:POST /owners,PUT /owners/{owner_id}(which replaces the whole list), every owner in a response, theownershown on dogs and cats, and the inlineownerwhen registering, replacing or importing a dog or a cat.phonein a request is400 validation_failed. - Each number must contain a digit, as before. Two numbers with the same digits in one list is
400 validation_failed. - No two owners share a number, whichever place it has in their lists (
409 phone_taken). When several of the numbers sent are taken, the problem'sowner_idis the owner of the first of them in the list. GET /owners?phone=...finds the owner who has that number, primary or not.- An inline
owneris matched to the existing owner who has any of its numbers, and that owner is used unchanged: neither the inline name nor the inline numbers change them. If its numbers belong to more than one owner, the request is409 owner_ambiguous(in an import, that line is rejected with that code). If no owner has any of them, a new owner is created with the inline name and numbers. /v1still knows one phone number per owner:- an owner's
phonein/v1is their primary number; GET /v1/owners?phone=...and an inlineownerin/v1match by any of an owner's numbers, and a number any owner has is409 phone_takenin/v1too;POST /v1/ownersand a new inlineownerin/v1make an owner with that one number;PUT /v1/owners/{owner_id}replaces the owner's primary number with the given one. The rest of their list stays after it, in its order, except a number with the same digits as the given one, which is left out.- Audit entries made from now on show owners with
phones. Entries from before 2.3.0 stay as they were, withphone.
- 3.0.0Let's be a hotel!⚡3.0.0 majorThe product ownerThe client wants customers to book ahead, like a hotel. Check-in is going away, it's all reservations now. The partner's deadline for leaving
/v1was last month, so/v1goes too. I'll handle that conversation.Added- Reservations:
GET/POST /reservations,GET/DELETE /reservations/{reservation_id}. A reservation books one animal (dog_idorcat_id, exactly one of them) into one cage for a range of nights, and every placement rule must hold on every night of it. - Heat periods:
GET/POST /dogs/{dog_id}/heat-periods,DELETE /dogs/{dog_id}/heat-periods/{heat_period_id}. datequery parameter onGET /rooms,GET /rooms/{room_id}andGET /dogs/{dog_id}/locationandGET /cats/{cat_id}/location.GET /reservationsfilters bydog_id,cat_id,room_idanddate.- Owners can read their own animals' reservations with their login.
in_heaton dogs is now read-only and derived from heat periods.- Vaccinations must be valid for the whole stay, not just today.
- Animals and rooms with reservations can't be deleted (
409 has_reservations,409 room_has_reservations). - Location without a reservation on that date is
409 not_booked. - The audit log records reservations and heat periods instead of visits.
/v1.- Check-in, check-out, move and visit history.
PUT /dogs/{dog_id}/heat.checked_inon animals and thepresentfilter.
- Reservations:
- 3.1.03.1.0 minorThe product ownerFinance just found out they're still invoicing from a spreadsheet. We need nightly rates per cage size, a discount for families, and proper invoices. A price never changes after booking, legal was very clear about that.Added
- Nightly rates per cage size:
GET /prices, andPUT /pricesfor admins. Amounts are in minor units (cents) with acurrency. priceon every reservation, fixed when it's booked: the nightly rate, the subtotal, the discount and the total.- Discounts: 10% when the same owner has another animal booked on any of the same nights, 15% for stays of 14 nights or more. Only the larger applies. The discount rounds half up to a whole cent, once per reservation.
- Invoices:
POST /invoicesfor one owner and some of their reservations,GET /invoicesandGET /invoices/{invoice_id}. Numbers look like2027-000042: sequential per year, never reused, no gaps. Owners can read their own. invoice_idon reservations.
- A reservation on an invoice can't be cancelled (
409 invoiced). Invoices can't be changed or deleted. - Changing the rates never changes the price of an existing reservation.
- Staff can't change the rates.
- Nightly rates per cage size:
- 3.2.03.2.0 minorThe product ownerFantastic news, the client bought the kennel across town! Everything needs a location now, and the new site has its own prices. Same system, obviously. They open Monday.Added
/locations: list (filter bycode), create, read, replace. Each location has a uniquecode(2 to 8 capital letters or digits). Admins create and change them.location_idon rooms (required when creating one) and on reservations (from the room).GET /rooms,GET /reservationsandGET /invoicesfilter by it, andPOST /reservationscan limit automatic placement to a location.- Rates per location:
GET/PUT /locations/{location_id}/prices. A new location starts withMAIN's rates.
GET/PUT /pricesare now the rates of locationMAIN. A reservation is priced at its own location's rates.- An invoice is for one location (
409 mixed_locations) and has itslocation_id. Its number starts with the location's code:TOWN-2027-000001, sequential per location and year. GET /invoicesis ordered by when invoices were issued.
- 3.3.03.3.0 minorThe product ownerNot every family stays in one household, and the dog goes back and forth.Added
paying_owner_idon reservations: the owner who pays.POST /reservationstakes it, every reservation shows it, andGET /reservations?paying_owner_id=...filters on it.422 not_an_owner: thepaying_owner_idof a new reservation is not among the animal's owners.409 owner_has_reservations: deleting an owner who is the paying owner of a reservation.
- An animal has
owner_idsinstead ofowner_id: one to four owners, in the order given, none twice. In requests give eitherowner_idsor an inlineowner(one owner, matched or created as before), not both and not neither;owner_idin a request is400 validation_failed. More than four ids, an empty list or the same id twice is400 validation_failed; an id that is no owner's is422 unknown_owner. This holds for dogs and cats, imports included. - An animal shows
ownersinstead ofowner: each owner's current name and phones, in the order ofowner_ids. - An owner's animals are the animals that have them among their owners. That is what
GET /owners/{owner_id}/dogsand/cats, theowner_idfilter ofGET /dogsandGET /cats,409 owner_has_animalsand an owner's login go by. POST /reservations:paying_owner_idmay be left out (ornull) when the animal has one owner, who then pays. When the animal has several owners it is required (400 validation_failed). An id that is no owner's is422 unknown_owner; an owner who is not one of the animal's owners is422 not_an_owner. These are checked after the animal is found and before the booking rules.- The 10% discount now goes by who pays: it applies when the same owner pays another animal's reservation covering any of the same nights. Two animals that share an owner get no discount when different owners pay.
- An invoice bills an owner for reservations that owner pays.
422 not_owners_reservationnow means a listed reservation has another paying owner. - Changing an animal's owners changes no existing reservation: not its paying owner and not its price. An owner taken off an animal stays in place.
DELETE /owners/{owner_id}: an owner who has animals is409 owner_has_animals, as before; otherwise an owner who is the paying owner of any reservation is409 owner_has_reservations.- With an
ownerlogin, an owner reads every animal they are one of the owners of, and every reservation of those animals, whoever pays. Their invoices are those issued to them. - Audit entries made from now on show animals with
owner_idsandowners, and reservations withpaying_owner_id. Entries from before 3.3.0 stay as they were.
- 4.0.0Last big change, promise.4.0.0 majorThe product ownerTurns out guests get moved mid-stay: renovations, fights, upgrades. A stay isn't one cage any more. I know we said reservations were done done. This is the last big change, I promise.Added
- Birds, under
/birds.GET/POST /birds,POST /birds/import,GET/PUT/DELETE /birds/{bird_id}, and under a bird:vaccinationsandlocation. An owner's birds are atGET /owners/{owner_id}/birds. A bird has a requiredflightless(boolean) and noneutered. Like a cat it hasweight_g(grams),owner_idsandowners, with the same cage sizes.GET /birds?flightless=...filters on it. - Birds need one vaccination,
polyomavirus. It is not a type for dogs or cats, andrabiesis not one for birds (400 validation_failed). bird_id. Everything that hasdog_idandcat_id(vaccinations, cages, locations, reservations) now hasbird_idtoo, andGET /reservationsfilters by it. Exactly one of the three is set. A reservation is booked with exactly one of them.- A bird's id is never also a dog's or a cat's id.
- Cages can be restricted to
bird, and haveclosed(boolean, defaultfalse, set when the room is created). - A bird that is not
flightlessmust be in a closed cage, on every night (409 cage_not_closed). This is checked aftercage_too_smalland before the rules about who shares a room. - A cat and a bird may never share a room (
409 compatibility_conflict), whatever the cat'sdog_friendly. Dogs and birds may. - Birds count as animals wherever the rules say animal: the discount when the same owner pays for another animal,
409 owner_has_animals,409 has_reservations, and what an owner may read with their login. - A bird's audit entries have entity
bird. segmentson reservations: which cage the animal is in for each part of the stay, as{room_id, cage_id, from, to, nightly}. A new reservation has one segment.POST /reservations/{reservation_id}/movewith{from, cage_id}or{from, room_id}: from that night until the end of the stay, the animal is in another cage at the same location. Withoutcage_idthe cage is chosen as in automatic placement.
room_idandcage_idon reservations are replaced bysegments.GET /reservations?room_id=finds reservations with any segment in the room.- Every placement rule holds per night, in whichever cage the animal is in that night. A move checks the moved nights, ignoring the reservation itself.
nightlymoves from a reservation'spriceto its segments. A stay'ssubtotalis the sum of its segments, each at its own cage size's rate; moved nights are priced at the rates when they are moved. The discount is decided at booking and a move doesn't change it.- A move of an invoiced reservation is
409 invoiced. - A move is an
updateof the reservation in the audit log.
- Birds, under
- 4.1.0⚡4.1.0 minorThe product ownerThe board wants to know whether buying the second kennel was a good idea. Occupancy and revenue reports, per night and per location. It needs to be fast, they'll open it live in the meeting.Added
GET /reports/occupancy?from=&to=: per night and location, how many cages of each size are taken and how many there are. At most 366 nights per request.GET /reports/revenue?from=&to=&group=day|month: per day or month and location, the amounts booked (reservations by the day they were booked) and invoiced (invoices by the day they were issued), per currency.- Both filter by
location_idand are for admins only.
- 5.0.05.0.0 majorThe product ownerThree registers, three ids on everything, and the rabbit people are calling. An animal is an animal. This is a breaking release.Added
/animals. One register for every animal:GET/POST /animals,POST /animals/import,GET/PUT/DELETE /animals/{animal_id}, and under an animal:vaccinations,locationandheat-periods. An owner's animals are atGET /owners/{owner_id}/animals.specieson every animal (dog,catorbird): required when registering or replacing one, and on every line of an import. Each species keeps its own fields and rules. A missing or unknownspeciesis400 validation_failed; aPUTwith another species than the animal has is409 species_immutable.GET /animals?species=.... Without it, every species is listed together, ordered bycreated_at. The filtersin_heat,cat_friendly,dog_friendlyandflightlessonly ever match the species that has the field.- A heat period for a cat or a bird is
409 not_applicable, as it is for a male dog.
dog_id,cat_idandbird_idare nowanimal_id, everywhere: vaccinations, cages, locations, heat periods, reservations, and theGET /reservationsfilter. A reservation is booked withanimal_id.- New audit entries for animals have entity
animal.
/dogs,/catsand/birds, and everything under them, including/owners/{owner_id}/dogs,/catsand/birds.
- major, breaking
- minor
- patch
- ⚡new load test joins the benchmark, then runs every release after
- SpecOpenAPI + changelog
- Agentown container · 4 CPU
- Buildfresh container
- Start2 CPU · 1g · Postgres
- Hidden testskill -9 halfway
- Load50 req/s · 100 ms
- Next releasesame code, same data
Fails → failure report → fix round, up to 3
KNL-201Leaderboard
Releases passed, mean of complete runs. Ties go to the cheaper.
KNL-202Cost against distance
One dot per run. Up and left is better.
KNL-203Through the story
KNL-204Every run, release by release
- ✓first try
- 2after fix rounds
- ⏱too slow
- ✕still failing
- not reached
KNL-205The work and the code
Means over complete runs; hover a number for its range. Code numbers are from the workspace at the last release.
KNL-206How alike the solutions are
Runs of the same language, model and harness, compared pair by pair at the last release: the share of five-token sequences two solutions have in common, with comments, layout and string contents left out. 100% is the same code.
Table view
There is support for 8 more harnesses (clai, codex, deepseek, gemini, kimi, opencode, pi, qwen-code), but the cost of running 3 runs per language per harness would be about $130 for each of them, so about $1040 for all of them. Running every frontier model on every harness that can reach it is 26 combinations and about $6110. I'm not rich enough for that. Please email l.kinde94@outlook.com with test runs, or to sponsor tokens.
The 26 combinations and what each would cost
Three runs in each language, priced as the tokens the runs above used at each model's list price. Another model or harness will use more or fewer tokens, so read these as a rough size.
| Harness | Model | Estimate |
|---|---|---|
| clai | Fable 5.2 | $380 |
| clai | Opus 5.5 | $210 |
| clai | Sonnet 5.5 | $110 |
| clai | gpt-6-astra | $610 |
| clai | gpt-6.1-sol | $100 |
| clai | deepseek-v4-pro | $50 |
| claude-code | Fable 5.2 | $380 |
| claude-code | Opus 5.5 | $210 |
| codex | gpt-6-astra | $610 |
| codex | gpt-6.1-sol | $100 |
| deepseek | deepseek-v4-pro | $50 |
| gemini | gemini-3.1-pro-preview | $130 |
| gemini | gemini-3.5-flash | $100 |
| kimi | kimi-k3.1-pro | $120 |
| opencode | Fable 5.2 | $380 |
| opencode | Opus 5.5 | $210 |
| opencode | Sonnet 5.5 | $110 |
| opencode | gpt-6-astra | $610 |
| opencode | gpt-6.1-sol | $100 |
| pi | Fable 5.2 | $380 |
| pi | Opus 5.5 | $210 |
| pi | Sonnet 5.5 | $110 |
| pi | gpt-6-astra | $610 |
| pi | gpt-6.1-sol | $100 |
| pi | deepseek-v4-pro | $50 |
| qwen-code | qwen4-max | $80 |