An entrance is a small value
Everything this track does hangs off one struct in PathfinderKit, Entrance. Its fields are the whole vocabulary of a door:
lat,lon: the door itself.level: floors above the street the walk arrives on. 2 means "up two levels", -1 means "one level down", nil means nobody knows. Not the building's floor numbering: the climb from where Dad will actually be standing.altitude: metres above sea level, as the phone's barometer measured it standing at this door. Only Dad's own confirmation records one, and it is the level check Pathfinder trusts first (still a barometer reading, stored and used only when accurate to 6 m).note: a short Korean line shown and spoken on the way in, such as "2층 출발 홀, 이 계단으로 올라가".source: who said this is the way in.label: the door's own name or reference when it has one ("Salidas", "P2").venue: the building's centre, set only when Pathfinder chose this door for a destination. It never travels on Pippa's wire.
The route preview turns all of that into one Korean line, summaryKorean: "2층 출발 홀 · 길에서 2층 위 · 피파가 알려준 입구". Dad sees which door, how far up, and whose word it is before he starts walking.
Three witnesses, one order
Entrance.Source has three cases, and its doc comment is the policy: Dad's own correction outranks Pippa's pin, which outranks OpenStreetMap's tags. The order follows who has the best evidence. OpenStreetMap's tags are volunteers' mapping, of uneven age and detail, written for every reader and none in particular. Pippa's door is chosen for this trip, by name, with a note written for Dad. Dad's door is the one he stood at, with the barometer's reading taken there. Nobody outranks the person who was physically at the door.
The type writes the order down as Comparable. Read the code that picks doors, though, and you will find it does not sort by that rank. ArrivalPlan.make builds its list by hand in the same order: the memory's confirmed door, then the door on Pippa's pin, then OpenStreetMap's ranked candidates. The rule lives in two places, and the kit test dadsDoorBeatsPippasWhichBeatsTheMap is what keeps them saying the same thing.
Pippa's half: a door she must actually know
Pippa hands Pathfinder destinations two ways, a recommended pin (pin) and a handoff that starts guidance (navigate), and both take the door as four flat tool arguments: entrance_lat, entrance_lon, entrance_level and entrance_note. Her location tool's description sets the bar in one sentence: "Give a door only when you know it; Pathfinder looks one up itself otherwise." A guessed door is worse than no door, because no door falls through to OpenStreetMap while a confident wrong door leads the plan.
cwkPippa's dad_location.normalize_entrance is the gate both paths share. It accepts a nested entrance object or the flat entrance_* arguments, and then refuses anything a door cannot be:
- latitude and longitude must be finite and on the globe;
- the door must lie within
ENTRANCE_MAX_M = 1500.0metres of the place (a haversine distance on a 6,371,008.8 m mean Earth radius), because farther than that is a different place, not its entrance; levelmust be a whole number of floors from -5 to 10;- the note is cut to 200 characters.
The failure mode is the point. A malformed or far door raises, so the tool call fails and Pippa hears that the save failed, instead of the pin being saved quietly without its door. A note with no coordinates fails the same way. place_pins.save also keeps an earlier entrance when the same pin is saved again without one, so a later, lazier save does not erase a door.
The phone's Entrance is that wire's twin. The project notes say so explicitly: the pin's entrance has a twin in cwkPippa's place_pins and handoff. Neither repo imports the other, so a field changes in both or not at all. On the phone side, a door that arrives without a source is Pippa's by default, and a door off the globe is dropped while the pin itself survives.
Routing to the door without losing the building
Once a door is chosen, Place.routed(to:) makes a new destination: the door's coordinate, the same name and address, and the building's centre riding along in entrance.venue. The id changes too, to entrance: plus the old id. That prefix is not decoration. A provider handed a place id it recognises can route to its own idea of that place (Google's place id would), which is the station's centre all over again. A fresh id forces it to route to the coordinate. venueID strips the prefix back off, so a mode switch plans again from the building rather than from the door, and every screen still knows it is the same destination.