Issue #3616584: Judge the orphan rule against the seats a booker could actually take

The rule against leaving a place available on its own was enforced twice, against two different pictures of the same row, so one take could be accepted by the hold and refused by the seating. PlaceOrphans reads absence from the row it is handed as the end of a run, and the two callers built that row from different lists.

Neither list was the right one.

  • A place an allotment holds is occupied. Nobody outside that allotment may have it, so it ends a run exactly as a booking does. The policy counted it as available and accepted takes that really did strand a place, which is why a click on the plan succeeded where a quantity stepper failed.
  • A place priced for another grade is not occupied. Another booker may take it at another tariff, so it belongs to the run. The seating counted it as the end of one, and in a hall with an allotment it invented runs everywhere: it refused takes for holes that did not exist, and it also passed over legal seats and seated parties further apart than the hall required.

PlacesInPlay is the one picture now, and both enforcements read it: the hall, minus what the session has booked, minus what an allotment holds away from this party, at every grade. The rows it answers with travel on the seating request, so every rung weighs the rule in the same row. The candidate list keeps its own question, which places may be given to this party, and the provider's two private readings of the party's allotment are gone with it.

Nothing is memoized on purpose: the two reads underneath are already shared for the request, so the second reading costs no query, and a cached picture would have to be invalidated on every write. PlaceHoldCostTest::testTheOrphanRuleCostsNothingToEnforce is the guard.

New kernel tests, each seen to fail against the unfixed code first:

  • a place priced for another grade keeps its company, which errored with Only 0 of the 1 requested units can be placed before the fix, the exact refusal a booker met on a live hall;
  • a place held for an allotment ends a run, which threw nothing before the fix;
  • the two enforcements answer one take the same way, which reported false is not identical to true before the fix.

Follow-up to file: the rule must never cost a booking. Where no arrangement avoids stranding a place, the party should be seated anyway rather than refused, under a third setting on the policy.

Merge request reports

Loading