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.

Linked issues Hover a release to read the product owner's comment.
  1. 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 /health for readiness checks.
  2. 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}/vaccinations and DELETE /dogs/{dog_id}/vaccinations/{vaccination_id}.
    • vaccinated on every dog.
    • GET /dogs filters: vaccinated, present.
    • Pagination (limit, cursor) on GET /dogs and GET /dogs/{dog_id}/visits.
    • Error responses may carry a details object.
    Changed
    • Check-in now requires the dog to be fully vaccinated (rabies, DHPP, bordetella, none expired). Otherwise: 409 vaccination_missing.
    • GET /dogs and GET /dogs/{dog_id}/visits now return { "items": [...], "next_cursor": ... } instead of a bare array.
    ⚡ load test from here: lookup
  3. 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. Added weight_kg (optional, kilograms).
  4. 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, medium or large: 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_id and cage_id.
    • Visits record room_id and cage_id.
    Changed
    • Check-in always places the dog in a cage, automatically if none is requested. It fails with 409 when no suitable cage is free. Dogs without a known weight only fit large cages.
    ⚡ load test from here: rooms
  5. 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.Added
    • weight on dogs, a string such as "12.5kg" or "27 lb". It is another view of the same value as weight_kg; send either or both.
    Changed
    • Responses always include both weight and weight_kg. weight is always given in kg.
    • Sending both fields with different values is rejected with 422 weight_mismatch.
  6. 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_heat on dogs (null for males).
    • PUT /dogs/{dog_id}/heat to flip it quickly from the front desk.
    • GET /dogs?in_heat=true.
    Changed
    • 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.
  7. 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}, and GET /owners/{owner_id}/dogs. GET /owners?phone=... finds an owner by phone number.
    • owner_id on dogs, and GET /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.
    Changed
    • A dog takes owner_id or, as before, an inline owner. An inline owner is matched to the existing owner with the same phone number, digits only (+358 40 123 and 35840123 are 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.
    Upgrading
    • 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, visits and location. An owner's cats are at GET /owners/{owner_id}/cats. A cat has no in_heat, and there is no /cats/{cat_id}/heat.
      • Cats need rabies and fvrcp vaccinations. A vaccination's type must be one the animal's species uses, otherwise 400 validation_failed.
      • cat_id. Everything that has a dog_id (visits, vaccinations, cages, locations) now has a cat_id too. Exactly one of the two is set; the other is null.
      • A cat's id is never also a dog's id. /dogs/{dog_id} with a cat's id is 404 not_found, and the other way round.
      • Cages have a species restriction (dog, cat or any, default any). Placing an animal in a cage for another species is 409 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 is 404 there, and a cage holding a cat shows dog_id: null but is not free. Every 2.0.0 rule still holds for changes made through /v1, answered with the closest 1.x error code.
      Changed
      • Errors are now application/problem+json, also for /owners. The old error field is now code; message is now detail. Validation errors list the offending fields in invalid_params. details.missing is now missing, details.owner_id is now owner_id, and an import's per-line error is now code.
      • dog_checked_in is now animal_checked_in, and owner_has_dogs is now owner_has_animals. An owner with a dog or a cat can't be removed.
      • GET /dogs/{dog_id}/location for a dog that is not checked in is now 409 not_checked_in (it was 404). The same goes for cats.
      • An inline owner on 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.
    • 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_friendly on cats (defaults to false) and cat_friendly on dogs (null, unknown, by default).
      • GET /cats?dog_friendly=... and GET /dogs?cat_friendly=....
      • weight_g on cats: the weight in whole grams, from 1 to 120000, or null when unknown.
      Changed
      • A cat has weight_g instead of weight_kg and weight, in requests and responses, imports included. A cat in a response has no weight_kg and no weight field, and weight_kg or weight in a request for a cat is 400 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 fits medium, anything and unknown weight fits large.
      • 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 /v1 too. There it is 409 heat_conflict, the only 1.x code for a room-sharing rule.
      • PUT /dogs/{dog_id} keeps cat_friendly when the field is omitted: the front desk kept wiping it by accident. PUT /cats/{cat_id} without dog_friendly still resets it to false. PUT /v1/dogs/{dog_id} never touches it, since the 1.x API doesn't know the field.
      Upgrading
        ⚡ load test from here: placement
      • 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, staff or owner.
        • 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 by entity, entity_id, actor, since and until; paginated. A dog's entries have entity dog, a cat's cat.
        • credentials.json. Write one admin and one staff login to credentials.json at the root of the workspace. How these logins come to exist is up to you, but they must work whenever the service runs.
        Changed
        • Every request except GET /health and POST /login needs Authorization: Bearer <token>, /v1 included: 401 unauthorized without a valid token, 403 forbidden when 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 inline owner whose phone numbers belong to more than one existing owner.
        Changed
        • An owner has phones instead of phone: 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, the owner shown on dogs and cats, and the inline owner when registering, replacing or importing a dog or a cat. phone in a request is 400 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's owner_id is 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 owner is 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 is 409 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.
        • /v1 still knows one phone number per owner:
        • an owner's phone in /v1 is their primary number;
        • GET /v1/owners?phone=... and an inline owner in /v1 match by any of an owner's numbers, and a number any owner has is 409 phone_taken in /v1 too;
        • POST /v1/owners and a new inline owner in /v1 make 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, with phone.
        Upgrading
        • 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 /v1 was last month, so /v1 goes too. I'll handle that conversation.Added
          • Reservations: GET/POST /reservations, GET/DELETE /reservations/{reservation_id}. A reservation books one animal (dog_id or cat_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}.
          • date query parameter on GET /rooms, GET /rooms/{room_id} and GET /dogs/{dog_id}/location and GET /cats/{cat_id}/location.
          • GET /reservations filters by dog_id, cat_id, room_id and date.
          • Owners can read their own animals' reservations with their login.
          Changed
          • in_heat on 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.
          Removed
          • /v1.
          • Check-in, check-out, move and visit history.
          • PUT /dogs/{dog_id}/heat.
          • checked_in on animals and the present filter.
          Upgrading
            ⚡ load test from here: 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, and PUT /prices for admins. Amounts are in minor units (cents) with a currency.
            • price on 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 /invoices for one owner and some of their reservations, GET /invoices and GET /invoices/{invoice_id}. Numbers look like 2027-000042: sequential per year, never reused, no gaps. Owners can read their own.
            • invoice_id on reservations.
            Changed
            • 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.
            Upgrading
            • 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 by code), create, read, replace. Each location has a unique code (2 to 8 capital letters or digits). Admins create and change them.
              • location_id on rooms (required when creating one) and on reservations (from the room). GET /rooms, GET /reservations and GET /invoices filter by it, and POST /reservations can limit automatic placement to a location.
              • Rates per location: GET/PUT /locations/{location_id}/prices. A new location starts with MAIN's rates.
              Changed
              • GET/PUT /prices are now the rates of location MAIN. A reservation is priced at its own location's rates.
              • An invoice is for one location (409 mixed_locations) and has its location_id. Its number starts with the location's code: TOWN-2027-000001, sequential per location and year.
              • GET /invoices is ordered by when invoices were issued.
              Upgrading
              • 3.3.03.3.0 minorThe product ownerNot every family stays in one household, and the dog goes back and forth.Added
                • paying_owner_id on reservations: the owner who pays. POST /reservations takes it, every reservation shows it, and GET /reservations?paying_owner_id=... filters on it.
                • 422 not_an_owner: the paying_owner_id of 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.
                Changed
                • An animal has owner_ids instead of owner_id: one to four owners, in the order given, none twice. In requests give either owner_ids or an inline owner (one owner, matched or created as before), not both and not neither; owner_id in a request is 400 validation_failed. More than four ids, an empty list or the same id twice is 400 validation_failed; an id that is no owner's is 422 unknown_owner. This holds for dogs and cats, imports included.
                • An animal shows owners instead of owner: each owner's current name and phones, in the order of owner_ids.
                • An owner's animals are the animals that have them among their owners. That is what GET /owners/{owner_id}/dogs and /cats, the owner_id filter of GET /dogs and GET /cats, 409 owner_has_animals and an owner's login go by.
                • POST /reservations: paying_owner_id may be left out (or null) 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 is 422 unknown_owner; an owner who is not one of the animal's owners is 422 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_reservation now 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 is 409 owner_has_animals, as before; otherwise an owner who is the paying owner of any reservation is 409 owner_has_reservations.
                • With an owner login, 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_ids and owners, and reservations with paying_owner_id. Entries from before 3.3.0 stay as they were.
                Upgrading
                • 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: vaccinations and location. An owner's birds are at GET /owners/{owner_id}/birds. A bird has a required flightless (boolean) and no neutered. Like a cat it has weight_g (grams), owner_ids and owners, 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, and rabies is not one for birds (400 validation_failed).
                  • bird_id. Everything that has dog_id and cat_id (vaccinations, cages, locations, reservations) now has bird_id too, and GET /reservations filters 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 have closed (boolean, default false, set when the room is created).
                  • A bird that is not flightless must be in a closed cage, on every night (409 cage_not_closed). This is checked after cage_too_small and before the rules about who shares a room.
                  • A cat and a bird may never share a room (409 compatibility_conflict), whatever the cat's dog_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.
                  • segments on 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}/move with {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. Without cage_id the cage is chosen as in automatic placement.
                  Changed
                  • room_id and cage_id on reservations are replaced by segments. 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.
                  • nightly moves from a reservation's price to its segments. A stay's subtotal is 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 update of the reservation in the audit log.
                  Upgrading
                  • 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_id and are for admins only.
                    Performance
                      ⚡ load test from here: reports
                    • 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, location and heat-periods. An owner's animals are at GET /owners/{owner_id}/animals.
                      • species on every animal (dog, cat or bird): required when registering or replacing one, and on every line of an import. Each species keeps its own fields and rules. A missing or unknown species is 400 validation_failed; a PUT with another species than the animal has is 409 species_immutable.
                      • GET /animals?species=.... Without it, every species is listed together, ordered by created_at. The filters in_heat, cat_friendly, dog_friendly and flightless only 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.
                      Changed
                      • dog_id, cat_id and bird_id are now animal_id, everywhere: vaccinations, cages, locations, heat periods, reservations, and the GET /reservations filter. A reservation is booked with animal_id.
                      • New audit entries for animals have entity animal.
                      Removed
                      • /dogs, /cats and /birds, and everything under them, including /owners/{owner_id}/dogs, /cats and /birds.
                      Upgrading
                      • major, breaking
                      • minor
                      • patch
                      • ⚡new load test joins the benchmark, then runs every release after
                      Workflow Every release, graded the same way
                      1. SpecOpenAPI + changelog
                      2. Agentown container · 4 CPU
                      3. Buildfresh container
                      4. Start2 CPU · 1g · Postgres
                      5. Hidden testskill -9 halfway
                      6. Load50 req/s · 100 ms

                      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.

                      HarnessModelEstimate
                      claiFable 5.2$380
                      claiOpus 5.5$210
                      claiSonnet 5.5$110
                      claigpt-6-astra$610
                      claigpt-6.1-sol$100
                      claideepseek-v4-pro$50
                      claude-codeFable 5.2$380
                      claude-codeOpus 5.5$210
                      codexgpt-6-astra$610
                      codexgpt-6.1-sol$100
                      deepseekdeepseek-v4-pro$50
                      geminigemini-3.1-pro-preview$130
                      geminigemini-3.5-flash$100
                      kimikimi-k3.1-pro$120
                      opencodeFable 5.2$380
                      opencodeOpus 5.5$210
                      opencodeSonnet 5.5$110
                      opencodegpt-6-astra$610
                      opencodegpt-6.1-sol$100
                      piFable 5.2$380
                      piOpus 5.5$210
                      piSonnet 5.5$110
                      pigpt-6-astra$610
                      pigpt-6.1-sol$100
                      pideepseek-v4-pro$50
                      qwen-codeqwen4-max$80