Weigh a whole-party move when no row can seat them all, and name the seating for what it does

Adds the missing middle to the placing pass, as designed in the issue summary.

replace() sets an unbeatable bar — one unbroken run for the whole party — and so needs no comparison. Below it there was nothing, which is where every party longer than the longest row in the house lives. This asks the weaker question, which does need a comparison: seat the party as though it had walked in this moment, and weigh that against what staying gives it.

  • Weighed against staying, not against the past. Both answers seat the same people. Comparing the move against where the party sits now would refuse every move a growing party could want, since the arrivals have to go somewhere.
  • Fewer parts of the house decides it, and then only if the move is no worse on the ladder's own measures in the ladder's own order — fewest pieces before closest. The second half matters because an area with room for everybody may hold it as single places.
  • "Fewer parts" rather than "better", and that correction cost a test. The first shape moved whenever the house could do marginally better, which for a party growing one press at a time meant being carried around the building repeatedly and told each time that their places had changed, to land somewhere no better. FragmentConsolidationTest caught it because it asserts an arrangement rather than a count.
  • hasChosenAnchor() gates it exactly as it gates replace().

Coverage: the issue's own case, seen to fail against 1.x with the split it describes, plus two controls — a party with nowhere better is left alone, and a party holding a chosen place stays split.

Verified locally: 11 seating suites green, including SeatTogether, OrphanedPlaces, OrphanContract, OrphanSweep, FragmentConsolidation, PooledSection, CartPlacesApart, SlotSeats, AreaChoice and AssignedArea. phpcs and phpstan clean per-file.

Not in scope: the same all-or-nothing condition still stands in replace() itself and in consolidate(). This is the placing pass only.

Merge request reports

Loading
Loading