{"id":"merged","title":"One platform, both use cases: where each table comes from and what it feeds","desc":"Three lanes, the agency account, the open feeds and the region account; five columns, source, Bronze, Silver, Gold and out; every table of both use cases drawn once, each tagged with the path it serves; each step a numbered pill; the account crossings in blue.","lanes":[{"id":"agency","title":"The agency's account  ·  stays home"},{"id":"public","title":"Open feeds  ·  public"},{"id":"region","title":"The region's account  ·  the exchange"}],"layers":[{"id":"source","name":"Source","color":"#3987e5"},{"id":"bronze","name":"Bronze","color":"#b0703a"},{"id":"silver","name":"Silver","color":"#a1a1a6"},{"id":"gold","name":"Gold","color":"#c98500"},{"id":"out","name":"Out","color":"#d55181"}],"status":{"tested":{"label":"tested on the sample","color":"#199e70"},"replayed":{"label":"replayed on the sample","color":"#c98500"},"standard":{"label":"already standard","color":"#3987e5"},"sample":{"label":"the sample files","color":"#a1a1a6"},"planned":{"label":"planned","color":"#86868b"}},"layout":{"NW":220,"NH":68,"GX":420,"GY":92,"X0":60,"PAD":40,"GAP":84,"TW":124,"TH":44},"tables":[{"lane":"agency","layer":"source","row":0,"name":"AVL stop times","role":["the location system's export, one row","per trip per stop; 26 columns"],"status":"sample","shape":"vendor CSV, `;`-delimited, UTF-8 BOM","grain":"one row per trip per stop","keys":"CALENDAR_ID, TRIP_ID, ROUTE_ABBR, GEO_NODE_ABBR, GEO_NAME prefix","part":"one file a month","keep":"the agency's rule","key":"agency","standard":"","columns":[{"name":"CALENDAR_ID","type":"text","key":"PK","desc":"1YYYYMMDD: a leading 1, then the service date"},{"name":"TIME_TABLE_VERSION_NAME","type":"text","key":"","desc":"board period, such as 24AU05; appears inside GTFS service_id"},{"name":"BLOCK_ABBR","type":"text","key":"","desc":"vehicle block, one bus's day of work; not a vehicle id"},{"name":"TRIP_ID","type":"text","key":"PK","desc":"vendor trip id; never equal to GTFS trip_id"},{"name":"ROUTE_ABBR","type":"text","key":"PK","desc":"route number as riders know it; equals GTFS route_short_name"},{"name":"ROUTE_DIRECTION_ABBR","type":"text","key":"","desc":"direction code, such as Noh or Soh"},{"name":"VARIANT","type":"text","key":"","desc":"pattern letter shown on the bus"},{"name":"GEO_NODE_ABBR","type":"text","key":"PK","desc":"stop number; equals GTFS stop_code"},{"name":"GEO_NAME","type":"text","key":"PK","desc":"'<sequence> - <stop name>': the stop sequence hides in the prefix"},{"name":"START_TERMINAL","type":"text","key":"","desc":"display"},{"name":"END_TERMINAL","type":"text","key":"","desc":"display"},{"name":"TRIP_EDGE","type":"text","key":"","desc":"first, middle or last stop of the trip"},{"name":"TIME_POINT_ID","type":"text","key":"","desc":"timepoint reference; NULL between timepoints"},{"name":"TIME_POINT_ABBR","type":"text","key":"","desc":"timepoint short name"},{"name":"TIME_POINT_NAME","type":"text","key":"","desc":"timepoint name"},{"name":"SERVICE_ABBR","type":"text","key":"","desc":"Weekday, Saturday, Sunday or Holiday1"},{"name":"SCHED_TRIP_START","type":"int s","key":"","desc":"scheduled trip start, seconds past midnight"},{"name":"SCHED_TRIP_END","type":"int s","key":"","desc":"scheduled trip end, seconds past midnight"},{"name":"SCHED_TRIP_DURATION","type":"int s","key":"","desc":"scheduled trip length"},{"name":"SCHED_TIME_PER_STOP","type":"int s","key":"","desc":"the plan at this stop, seconds past midnight; past 86,400 after midnight"},{"name":"ACTUAL_TRIP_DURATION","type":"int s","key":"","desc":"observed trip length"},{"name":"ACTUAL_ARRIVAL_TIME","type":"int s","key":"","desc":"observed arrival, seconds past midnight; NULL when not observed"},{"name":"ACTUAL_DEPARTURE_TIME","type":"int s","key":"","desc":"observed departure, seconds past midnight"},{"name":"DWELLING_TIME","type":"int s","key":"","desc":"time stopped at the stop"},{"name":"ADHERENCE_IN_SECS","type":"int s","key":"","desc":"scheduled minus actual in the file: the sign is the reverse of the dictionary's"},{"name":"KPI","type":"text","key":"","desc":"ON-TIME, EARLY or LATE: the vendor's label, agency thresholds"}],"path":"online","id":"avl","status_label":"the sample files"},{"lane":"agency","layer":"source","row":1,"name":"APC counters","role":["the door counters' export, one row","per trip per stop; 18 columns"],"status":"sample","shape":"vendor CSV, `;`-delimited, UTF-8 BOM; first two columns in the opposite order to AVL","grain":"one row per trip per stop; a visit may have several","keys":"CALENDAR_ID, TRIP_ID, ROUTE_ABBR, STOP_NUMBER, PATTERN_STOP_SEQUENCE","part":"one file a month","keep":"the agency's rule","key":"agency","standard":"","columns":[{"name":"TIME_TABLE_VERSION_NAME","type":"text","key":"","desc":"board period"},{"name":"CALENDAR_ID","type":"text","key":"PK","desc":"1YYYYMMDD"},{"name":"BLOCK_ABBR","type":"text","key":"","desc":"vehicle block"},{"name":"TRIP_ID","type":"text","key":"PK","desc":"vendor trip id; joins to AVL"},{"name":"ROUTE_ABBR","type":"text","key":"PK","desc":"route number"},{"name":"ROUTE_DIRECTION_ABBR","type":"text","key":"","desc":"direction code"},{"name":"VARIANT","type":"text","key":"","desc":"pattern letter"},{"name":"PATTERN_STOP_SEQUENCE","type":"int","key":"PK","desc":"stop order along the trip"},{"name":"STOP_NUMBER","type":"text","key":"PK","desc":"stop number; equals GTFS stop_code"},{"name":"STOP_NAME","type":"text","key":"","desc":"display"},{"name":"TOTAL_CAPACITY","type":"int","key":"","desc":"vehicle capacity, seated and standing"},{"name":"SEATING_CAPACITY","type":"int","key":"","desc":"seats"},{"name":"BOARD","type":"int","key":"","desc":"people who got on at this stop"},{"name":"ALIGHT","type":"int","key":"","desc":"people who got off"},{"name":"DEPARTURE_LOAD","type":"int","key":"","desc":"people on board when leaving"},{"name":"SERVICE_ABBR","type":"text","key":"","desc":"service day type"},{"name":"TRIP_BEGIN_TIME","type":"int s","key":"","desc":"seconds past midnight; the only time in this file"},{"name":"TRIP_END_TIME","type":"int s","key":"","desc":"seconds past midnight"}],"path":"online","id":"apc","status_label":"the sample files"},{"lane":"agency","layer":"bronze","row":0,"name":"Raw AVL export","role":["as exported: 1YYYYMMDD dates, times","in seconds, NULL as a string"],"status":"sample","shape":"as received, plus file and landing time","grain":"as received","keys":"none imposed","part":"by file and service day","keep":"the agency's rule; never leaves","key":"agency","standard":"","columns":[{"name":"CALENDAR_ID","type":"text","key":"PK","desc":"1YYYYMMDD: a leading 1, then the service date"},{"name":"TIME_TABLE_VERSION_NAME","type":"text","key":"","desc":"board period, such as 24AU05; appears inside GTFS service_id"},{"name":"BLOCK_ABBR","type":"text","key":"","desc":"vehicle block, one bus's day of work; not a vehicle id"},{"name":"TRIP_ID","type":"text","key":"PK","desc":"vendor trip id; never equal to GTFS trip_id"},{"name":"ROUTE_ABBR","type":"text","key":"PK","desc":"route number as riders know it; equals GTFS route_short_name"},{"name":"ROUTE_DIRECTION_ABBR","type":"text","key":"","desc":"direction code, such as Noh or Soh"},{"name":"VARIANT","type":"text","key":"","desc":"pattern letter shown on the bus"},{"name":"GEO_NODE_ABBR","type":"text","key":"PK","desc":"stop number; equals GTFS stop_code"},{"name":"GEO_NAME","type":"text","key":"PK","desc":"'<sequence> - <stop name>': the stop sequence hides in the prefix"},{"name":"START_TERMINAL","type":"text","key":"","desc":"display"},{"name":"END_TERMINAL","type":"text","key":"","desc":"display"},{"name":"TRIP_EDGE","type":"text","key":"","desc":"first, middle or last stop of the trip"},{"name":"TIME_POINT_ID","type":"text","key":"","desc":"timepoint reference; NULL between timepoints"},{"name":"TIME_POINT_ABBR","type":"text","key":"","desc":"timepoint short name"},{"name":"TIME_POINT_NAME","type":"text","key":"","desc":"timepoint name"},{"name":"SERVICE_ABBR","type":"text","key":"","desc":"Weekday, Saturday, Sunday or Holiday1"},{"name":"SCHED_TRIP_START","type":"int s","key":"","desc":"scheduled trip start, seconds past midnight"},{"name":"SCHED_TRIP_END","type":"int s","key":"","desc":"scheduled trip end, seconds past midnight"},{"name":"SCHED_TRIP_DURATION","type":"int s","key":"","desc":"scheduled trip length"},{"name":"SCHED_TIME_PER_STOP","type":"int s","key":"","desc":"the plan at this stop, seconds past midnight; past 86,400 after midnight"},{"name":"ACTUAL_TRIP_DURATION","type":"int s","key":"","desc":"observed trip length"},{"name":"ACTUAL_ARRIVAL_TIME","type":"int s","key":"","desc":"observed arrival, seconds past midnight; NULL when not observed"},{"name":"ACTUAL_DEPARTURE_TIME","type":"int s","key":"","desc":"observed departure, seconds past midnight"},{"name":"DWELLING_TIME","type":"int s","key":"","desc":"time stopped at the stop"},{"name":"ADHERENCE_IN_SECS","type":"int s","key":"","desc":"scheduled minus actual in the file: the sign is the reverse of the dictionary's"},{"name":"KPI","type":"text","key":"","desc":"ON-TIME, EARLY or LATE: the vendor's label, agency thresholds"},{"name":"_source_file","type":"text","key":"","desc":"the export file this row came from"},{"name":"_landed_at","type":"datetime","key":"","desc":"when the file landed"}],"path":"online","id":"b_avl","status_label":"the sample files"},{"lane":"agency","layer":"bronze","row":1,"name":"Raw APC export","role":["as exported; duplicate records","of one visit kept as they are"],"status":"sample","shape":"as received, plus file and landing time","grain":"as received","keys":"none imposed","part":"by file and service day","keep":"the agency's rule; never leaves","key":"agency","standard":"","columns":[{"name":"TIME_TABLE_VERSION_NAME","type":"text","key":"","desc":"board period"},{"name":"CALENDAR_ID","type":"text","key":"PK","desc":"1YYYYMMDD"},{"name":"BLOCK_ABBR","type":"text","key":"","desc":"vehicle block"},{"name":"TRIP_ID","type":"text","key":"PK","desc":"vendor trip id; joins to AVL"},{"name":"ROUTE_ABBR","type":"text","key":"PK","desc":"route number"},{"name":"ROUTE_DIRECTION_ABBR","type":"text","key":"","desc":"direction code"},{"name":"VARIANT","type":"text","key":"","desc":"pattern letter"},{"name":"PATTERN_STOP_SEQUENCE","type":"int","key":"PK","desc":"stop order along the trip"},{"name":"STOP_NUMBER","type":"text","key":"PK","desc":"stop number; equals GTFS stop_code"},{"name":"STOP_NAME","type":"text","key":"","desc":"display"},{"name":"TOTAL_CAPACITY","type":"int","key":"","desc":"vehicle capacity, seated and standing"},{"name":"SEATING_CAPACITY","type":"int","key":"","desc":"seats"},{"name":"BOARD","type":"int","key":"","desc":"people who got on at this stop"},{"name":"ALIGHT","type":"int","key":"","desc":"people who got off"},{"name":"DEPARTURE_LOAD","type":"int","key":"","desc":"people on board when leaving"},{"name":"SERVICE_ABBR","type":"text","key":"","desc":"service day type"},{"name":"TRIP_BEGIN_TIME","type":"int s","key":"","desc":"seconds past midnight; the only time in this file"},{"name":"TRIP_END_TIME","type":"int s","key":"","desc":"seconds past midnight"},{"name":"_source_file","type":"text","key":"","desc":"the export file this row came from"},{"name":"_landed_at","type":"datetime","key":"","desc":"when the file landed"}],"path":"online","id":"b_apc","status_label":"the sample files"},{"lane":"agency","layer":"silver","row":0,"name":"TIDES stop_visits","role":["5.45 M rows from the month, one per","trip per stop; 100% pass the schema"],"status":"tested","shape":"TIDES `stop_visits` (AVL skeleton, APC counts merged)","grain":"service day × trip × stop sequence","keys":"service_date, trip_id_performed, trip_stop_sequence; stop_id = GTFS stop","part":"by service day","keep":"the agency's rule; the region never reads it","key":"agency","standard":"TIDES stop_visits","columns":[{"name":"service_date","type":"date","key":"PK","desc":"the service day"},{"name":"trip_id_performed","type":"text","key":"PK","desc":"the vendor trip id, unchanged"},{"name":"trip_stop_sequence","type":"int","key":"PK","desc":"1, 2, 3 along the trip"},{"name":"scheduled_stop_sequence","type":"int","key":"","desc":"GTFS stop_sequence; null until the trip map fills it"},{"name":"pattern_id","type":"text","key":"","desc":"route, direction and variant"},{"name":"vehicle_id","type":"text","key":"","desc":"null: the export names a block, not a vehicle"},{"name":"dwell","type":"int s","key":"","desc":"time stopped"},{"name":"stop_id","type":"text","key":"FK","desc":"GTFS stops.stop_id; equals stop_code in this feed"},{"name":"timepoint","type":"bool","key":"","desc":"true at a timepoint"},{"name":"schedule_arrival_time","type":"datetime","key":"","desc":""},{"name":"schedule_departure_time","type":"datetime","key":"","desc":"the file has one scheduled time per stop"},{"name":"actual_arrival_time","type":"datetime","key":"","desc":""},{"name":"actual_departure_time","type":"datetime","key":"","desc":""},{"name":"boarding_1","type":"int","key":"","desc":"people who got on"},{"name":"alighting_1","type":"int","key":"","desc":"people who got off"},{"name":"departure_load","type":"int","key":"","desc":"people on board leaving"},{"name":"schedule_relationship","type":"enum","key":"","desc":"Scheduled, or Missing when nothing was observed"}],"path":"online","id":"a_silver","status_label":"tested on the sample"},{"lane":"agency","layer":"silver","row":1,"name":"TIDES trips_performed","role":["one row per trip per day: route,","direction and the timetable trip"],"status":"planned","shape":"TIDES `trips_performed`","grain":"service day × trip","keys":"service_date, trip_id_performed; trip_id_scheduled = GTFS trip_id through the trip map","part":"by service day","keep":"the agency's rule; never leaves","key":"agency","standard":"TIDES trips_performed","columns":[{"name":"service_date","type":"date","key":"PK","desc":""},{"name":"trip_id_performed","type":"text","key":"PK","desc":"the vendor trip id"},{"name":"vehicle_id","type":"text","key":"","desc":"required by TIDES; the export has none, so null until the vehicle id is exported"},{"name":"trip_id_scheduled","type":"text","key":"FK","desc":"GTFS trips.trip_id through the trip map: 99.78% of trip-days match one trip exactly"},{"name":"route_id","type":"text","key":"FK","desc":"GTFS routes.route_id"},{"name":"route_type","type":"int","key":"","desc":""},{"name":"direction_id","type":"int","key":"","desc":"0 or 1, from the timetable trip"},{"name":"block_id","type":"text","key":"","desc":"the vendor block"},{"name":"shape_id","type":"text","key":"FK","desc":""},{"name":"pattern_id","type":"text","key":"","desc":""},{"name":"trip_start_stop_id","type":"text","key":"FK","desc":""},{"name":"trip_end_stop_id","type":"text","key":"FK","desc":""},{"name":"schedule_trip_start","type":"datetime","key":"","desc":""},{"name":"schedule_trip_end","type":"datetime","key":"","desc":""},{"name":"actual_trip_start","type":"datetime","key":"","desc":""},{"name":"actual_trip_end","type":"datetime","key":"","desc":""},{"name":"schedule_relationship","type":"enum","key":"","desc":"Scheduled, or Canceled when no stop was observed"}],"path":"online","id":"a_trips","status_label":"planned"},{"lane":"agency","layer":"gold","row":0,"name":"5-minute loads","role":["people on board per route, direction,","stop and 5-minute window; no rider"],"status":"replayed","shape":"TIDES `passenger_events`, summed; five extras named in the contract (decision 60)","grain":"route × direction × stop × 5-minute window","keys":"service_date, route_id, direction_id, stop_id, window_start","part":"sent every 5 minutes, within 2","keep":"24 hours on the lane","key":"region, on arrival","standard":"TIDES passenger_events, summed","columns":[{"name":"service_date","type":"date","key":"PK","desc":"TIDES"},{"name":"route_id","type":"text","key":"PK","desc":"GTFS route_id; extra named in the contract: passenger_events has no route"},{"name":"direction_id","type":"int","key":"PK","desc":"extra named in the contract (decision 60): the region's series are per direction"},{"name":"stop_id","type":"text","key":"PK","desc":"TIDES"},{"name":"window_start","type":"datetime","key":"PK","desc":"the 5-minute window; extra named in the contract"},{"name":"boardings","type":"int","key":"","desc":"TIDES event_count summed, event_type boarding"},{"name":"alightings","type":"int","key":"","desc":"TIDES event_count summed, event_type alighting"},{"name":"on_board","type":"int","key":"","desc":"extra named in the contract: the mean departure load over the window's visits (decision 60); the sum is on_board × visits"},{"name":"visits","type":"int","key":"","desc":"extra named in the contract (decision 60): windows under 3 visits show unknown"}],"path":"online","id":"a_loads","status_label":"replayed on the sample"},{"lane":"public","layer":"source","row":0,"name":"GTFS timetables","role":["every party's published schedule;","the yardstick for delay"],"status":"standard","shape":"GTFS zip, as published","grain":"one row per trip per stop (stop_times)","keys":"trip_id, stop_id, stop_sequence; service_id carries the board period","part":"by party and feed version","keep":"every version the archive still covers","key":"none, open","standard":"GTFS","columns":[{"name":"agency.agency_id","type":"text","key":"PK","desc":"the publisher","group":"agency.txt"},{"name":"agency.agency_name","type":"text","key":"","desc":"","group":"agency.txt"},{"name":"agency.agency_timezone","type":"text","key":"","desc":"America/Toronto","group":"agency.txt"},{"name":"stops.stop_id","type":"text","key":"PK","desc":"the stop's id in the feed","group":"stops.txt"},{"name":"stops.stop_code","type":"text","key":"","desc":"the number on the pole; the vendor files' stop number","group":"stops.txt"},{"name":"stops.stop_name","type":"text","key":"","desc":"","group":"stops.txt"},{"name":"stops.stop_lat","type":"number","key":"","desc":"WGS-84","group":"stops.txt"},{"name":"stops.stop_lon","type":"number","key":"","desc":"WGS-84","group":"stops.txt"},{"name":"stops.location_type","type":"int","key":"","desc":"stop, station or entrance","group":"stops.txt"},{"name":"stops.parent_station","type":"text","key":"FK","desc":"stops.stop_id of the station","group":"stops.txt"},{"name":"routes.route_id","type":"text","key":"PK","desc":"","group":"routes.txt"},{"name":"routes.agency_id","type":"text","key":"FK","desc":"","group":"routes.txt"},{"name":"routes.route_short_name","type":"text","key":"","desc":"the route number","group":"routes.txt"},{"name":"routes.route_long_name","type":"text","key":"","desc":"","group":"routes.txt"},{"name":"routes.route_type","type":"int","key":"","desc":"3 is bus","group":"routes.txt"},{"name":"trips.route_id","type":"text","key":"FK","desc":"","group":"trips.txt"},{"name":"trips.service_id","type":"text","key":"FK","desc":"carries the board period","group":"trips.txt"},{"name":"trips.trip_id","type":"text","key":"PK","desc":"the timetable trip","group":"trips.txt"},{"name":"trips.trip_headsign","type":"text","key":"","desc":"","group":"trips.txt"},{"name":"trips.direction_id","type":"int","key":"","desc":"0 or 1","group":"trips.txt"},{"name":"trips.block_id","type":"text","key":"","desc":"","group":"trips.txt"},{"name":"trips.shape_id","type":"text","key":"FK","desc":"","group":"trips.txt"},{"name":"stop_times.trip_id","type":"text","key":"PK","desc":"","group":"stop_times.txt"},{"name":"stop_times.arrival_time","type":"time","key":"","desc":"HH:MM:SS, past 24:00 after midnight","group":"stop_times.txt"},{"name":"stop_times.departure_time","type":"time","key":"","desc":"","group":"stop_times.txt"},{"name":"stop_times.stop_id","type":"text","key":"FK","desc":"","group":"stop_times.txt"},{"name":"stop_times.stop_sequence","type":"int","key":"PK","desc":"increasing along the trip","group":"stop_times.txt"},{"name":"stop_times.timepoint","type":"int","key":"","desc":"1 where the time is exact","group":"stop_times.txt"},{"name":"calendar_dates.service_id","type":"text","key":"PK","desc":"","group":"calendar_dates.txt"},{"name":"calendar_dates.date","type":"date","key":"PK","desc":"YYYYMMDD","group":"calendar_dates.txt"},{"name":"calendar_dates.exception_type","type":"int","key":"","desc":"1 added, 2 removed; this feed has no calendar.txt","group":"calendar_dates.txt"},{"name":"shapes.shape_id","type":"text","key":"PK","desc":"","group":"shapes.txt"},{"name":"shapes.shape_pt_lat","type":"number","key":"","desc":"","group":"shapes.txt"},{"name":"shapes.shape_pt_lon","type":"number","key":"","desc":"","group":"shapes.txt"},{"name":"shapes.shape_pt_sequence","type":"int","key":"PK","desc":"","group":"shapes.txt"},{"name":"feed_info.feed_publisher_name","type":"text","key":"","desc":"","group":"feed_info.txt"},{"name":"feed_info.feed_version","type":"text","key":"","desc":"the version string the publisher sets","group":"feed_info.txt"},{"name":"feed_info.feed_start_date","type":"date","key":"","desc":"","group":"feed_info.txt"},{"name":"feed_info.feed_end_date","type":"date","key":"","desc":"","group":"feed_info.txt"}],"path":"online","id":"gtfs","status_label":"already standard"},{"lane":"public","layer":"source","row":1,"name":"GTFS-Realtime feeds","role":["positions, trip updates, alerts;","24 M positions a day, 4,559 vehicles"],"status":"standard","shape":"GTFS-Realtime protobuf, as each party publishes it","grain":"one position per vehicle every 10 s; one trip update per trip","keys":"party, vehicle id, trip id, timestamp","part":"polled every 10 s","keep":"not stored as such; see the live lane","key":"none, open","standard":"GTFS-Realtime","columns":[{"name":"header.timestamp","type":"epoch s","key":"","desc":"when the feed was built","group":"FeedHeader"},{"name":"header.gtfs_realtime_version","type":"text","key":"","desc":"2.0","group":"FeedHeader"},{"name":"vp.entity_id","type":"text","key":"PK","desc":"entity id, usually the vehicle","group":"VehiclePosition"},{"name":"vp.trip.trip_id","type":"text","key":"FK","desc":"the timetable trip the vehicle runs","group":"VehiclePosition"},{"name":"vp.trip.route_id","type":"text","key":"FK","desc":"","group":"VehiclePosition"},{"name":"vp.trip.direction_id","type":"int","key":"","desc":"","group":"VehiclePosition"},{"name":"vp.trip.start_date","type":"date","key":"","desc":"YYYYMMDD: the service day","group":"VehiclePosition"},{"name":"vp.trip.schedule_relationship","type":"enum","key":"","desc":"SCHEDULED, ADDED, UNSCHEDULED, CANCELED","group":"VehiclePosition"},{"name":"vp.vehicle.id","type":"text","key":"","desc":"the vehicle as the party names it","group":"VehiclePosition"},{"name":"vp.vehicle.label","type":"text","key":"","desc":"the number riders see","group":"VehiclePosition"},{"name":"vp.position.latitude","type":"number","key":"","desc":"WGS-84","group":"VehiclePosition"},{"name":"vp.position.longitude","type":"number","key":"","desc":"WGS-84","group":"VehiclePosition"},{"name":"vp.position.bearing","type":"number","key":"","desc":"degrees from north","group":"VehiclePosition"},{"name":"vp.position.speed","type":"number","key":"","desc":"metres per second","group":"VehiclePosition"},{"name":"vp.position.odometer","type":"number","key":"","desc":"metres","group":"VehiclePosition"},{"name":"vp.current_stop_sequence","type":"int","key":"","desc":"GTFS stop_sequence of the stop in hand","group":"VehiclePosition"},{"name":"vp.stop_id","type":"text","key":"FK","desc":"the stop in hand","group":"VehiclePosition"},{"name":"vp.current_status","type":"enum","key":"","desc":"INCOMING_AT, STOPPED_AT, IN_TRANSIT_TO","group":"VehiclePosition"},{"name":"vp.timestamp","type":"epoch s","key":"PK","desc":"when the position was measured","group":"VehiclePosition"},{"name":"vp.occupancy_status","type":"enum","key":"","desc":"EMPTY to FULL; some parties publish it","group":"VehiclePosition"},{"name":"vp.occupancy_percentage","type":"int","key":"","desc":"","group":"VehiclePosition"},{"name":"tu.trip.trip_id","type":"text","key":"PK","desc":"","group":"TripUpdate"},{"name":"tu.trip.route_id","type":"text","key":"","desc":"","group":"TripUpdate"},{"name":"tu.trip.start_date","type":"date","key":"","desc":"","group":"TripUpdate"},{"name":"tu.vehicle.id","type":"text","key":"","desc":"","group":"TripUpdate"},{"name":"tu.stop_time_update.stop_sequence","type":"int","key":"PK","desc":"","group":"TripUpdate"},{"name":"tu.stop_time_update.stop_id","type":"text","key":"","desc":"","group":"TripUpdate"},{"name":"tu.stop_time_update.arrival.delay","type":"int s","key":"","desc":"late is positive","group":"TripUpdate"},{"name":"tu.stop_time_update.arrival.time","type":"epoch s","key":"","desc":"the predicted or observed arrival","group":"TripUpdate"},{"name":"tu.stop_time_update.departure.time","type":"epoch s","key":"","desc":"","group":"TripUpdate"},{"name":"tu.stop_time_update.schedule_relationship","type":"enum","key":"","desc":"SCHEDULED, SKIPPED, NO_DATA","group":"TripUpdate"},{"name":"tu.timestamp","type":"epoch s","key":"","desc":"","group":"TripUpdate"},{"name":"tu.delay","type":"int s","key":"","desc":"the trip's current delay, where published","group":"TripUpdate"},{"name":"alert.active_period","type":"range","key":"","desc":"","group":"Alert"},{"name":"alert.informed_entity","type":"list","key":"","desc":"routes, stops, trips named","group":"Alert"},{"name":"alert.cause","type":"enum","key":"","desc":"","group":"Alert"},{"name":"alert.effect","type":"enum","key":"","desc":"NO_SERVICE, DETOUR, SIGNIFICANT_DELAYS and more","group":"Alert"},{"name":"alert.header_text","type":"text","key":"","desc":"","group":"Alert"},{"name":"alert.description_text","type":"text","key":"","desc":"","group":"Alert"}],"path":"both","id":"rt","status_label":"already standard"},{"lane":"public","layer":"source","row":2,"name":"Weather and events","role":["forecasts, event calendars;","to label an alert: snow, a game"],"status":"planned","shape":"not chosen","grain":"not chosen","keys":"place and time","part":"not chosen","keep":"not chosen","key":"none, open","standard":"","columns":[{"name":"observed_at","type":"datetime","key":"","desc":"not chosen"},{"name":"place","type":"text","key":"","desc":"not chosen"},{"name":"condition","type":"text","key":"","desc":"snow, rain, heat; not chosen"},{"name":"event_name","type":"text","key":"","desc":"not chosen"},{"name":"venue","type":"text","key":"","desc":"not chosen"},{"name":"starts_at","type":"datetime","key":"","desc":"not chosen"}],"path":"online","id":"weather","status_label":"planned"},{"lane":"region","layer":"source","row":3,"name":"Registry","role":["parties, feeds, both contracts,","shared stops; the party id everywhere"],"status":"planned","shape":"Aurora tables: parties, contracts, shared_stops","grain":"one party; one contract version; one shared stop pair","keys":"party_id; contract_id; party_id, stop_id, neighbour_party","part":"not partitioned","keep":"while the region runs; a leaver's row marked left, kept for audit","key":"region","standard":"","columns":[{"name":"parties.party_id","type":"text","key":"PK","desc":"the id on every regional row","group":"parties"},{"name":"parties.name","type":"text","key":"","desc":"","group":"parties"},{"name":"parties.kind","type":"enum","key":"","desc":"full sharer or feed-only","group":"parties"},{"name":"parties.presto_operator_name","type":"text","key":"","desc":"the name PRESTO writes on a tap from this party; null for a party not on PRESTO (Bike Share)","group":"parties"},{"name":"parties.feed_url_rt","type":"text","key":"","desc":"the GTFS-Realtime address polled","group":"parties"},{"name":"parties.feed_url_gtfs","type":"text","key":"","desc":"the timetable address fetched","group":"parties"},{"name":"parties.status","type":"enum","key":"","desc":"joined, leaving, left","group":"parties"},{"name":"parties.joined_at","type":"datetime","key":"","desc":"","group":"parties"},{"name":"parties.left_at","type":"datetime","key":"","desc":"","group":"parties"},{"name":"parties.key_arn","type":"text","key":"","desc":"the agency's KMS key the region holds a grant on","group":"parties"},{"name":"contracts.contract_id","type":"text","key":"PK","desc":"","group":"contracts"},{"name":"contracts.party_id","type":"text","key":"FK","desc":"","group":"contracts"},{"name":"contracts.name","type":"text","key":"","desc":"live-loads, transfer-totals","group":"contracts"},{"name":"contracts.version","type":"int","key":"","desc":"","group":"contracts"},{"name":"contracts.status","type":"enum","key":"","desc":"drafted, active, retired","group":"contracts"},{"name":"contracts.deadline","type":"text","key":"","desc":"06:00 for the nightly file; within 2 minutes for the loads","group":"contracts"},{"name":"contracts.terms","type":"json","key":"","desc":"the twelve clauses (decision 55)","group":"contracts"},{"name":"shared_stops.party_id","type":"text","key":"PK","desc":"","group":"shared_stops"},{"name":"shared_stops.stop_id","type":"text","key":"PK","desc":"the party's stop id","group":"shared_stops"},{"name":"shared_stops.neighbour_party","type":"text","key":"PK","desc":"","group":"shared_stops"},{"name":"shared_stops.neighbour_stop_id","type":"text","key":"","desc":"the same place in the neighbour's feed","group":"shared_stops"},{"name":"shared_stops.distance_m","type":"number","key":"","desc":"between the two stop points","group":"shared_stops"}],"path":"both","id":"registry","status_label":"planned"},{"lane":"region","layer":"gold","row":2,"name":"Regional transfer table","role":["six files a night become one table;","read by reports and the nightly lookup"],"status":"planned","shape":"Iceberg table; the contract's row, with the party ids resolved","grain":"to-agency × from-party × route × date × 3-hour band","keys":"party_id, from_party, service_date, to_route, time_band","part":"by party (the to-agency) and service date","keep":"3 years; a leaver's rows deleted, snapshots expired, reports rebuilt","key":"each agency's, by revocable grant","standard":"TIDES station_activities plus extras","columns":[{"name":"party_id","type":"text","key":"PK","desc":"the to-agency: who counted"},{"name":"from_party","type":"text","key":"PK","desc":"the from-operator resolved to a party id; 'unknown' for a name not in the registry"},{"name":"service_date","type":"date","key":"PK","desc":""},{"name":"to_route","type":"text","key":"PK","desc":""},{"name":"time_band","type":"text","key":"PK","desc":""},{"name":"transfers","type":"int","key":"","desc":"null for a party whose file was missing at 06:30"},{"name":"median_wait_min","type":"number","key":"","desc":""},{"name":"share_wait_over_15","type":"number","key":"","desc":""},{"name":"status","type":"enum","key":"","desc":"reported, or unknown when the file was late or missing"},{"name":"contract_version","type":"int","key":"","desc":"the contract the file was checked against"},{"name":"loaded_at","type":"datetime","key":"","desc":""}],"path":"both","id":"regional","status_label":"planned"},{"lane":"region","layer":"bronze","row":0,"name":"Live lane","role":["positions and loads as received,","in order; 24 hours; region's key"],"status":"planned","shape":"records as received (Kinesis Data Streams), two record kinds","grain":"one record per position or per load row","keys":"party_id, sequence_number","part":"one shard per party","keep":"24 hours","key":"region","standard":"","columns":[{"name":"party_id","type":"text","key":"PK","desc":"from the registry: whose feed, whose adapter","group":"envelope"},{"name":"record_kind","type":"enum","key":"","desc":"position or load","group":"envelope"},{"name":"sequence_number","type":"text","key":"PK","desc":"the stream's order","group":"envelope"},{"name":"arrived_at","type":"datetime","key":"","desc":"","group":"envelope"},{"name":"pos.vehicle_id","type":"text","key":"","desc":"as the feed names it","group":"position record"},{"name":"pos.trip_id","type":"text","key":"","desc":"the timetable trip","group":"position record"},{"name":"pos.route_id","type":"text","key":"","desc":"","group":"position record"},{"name":"pos.direction_id","type":"int","key":"","desc":"","group":"position record"},{"name":"pos.start_date","type":"date","key":"","desc":"the service day","group":"position record"},{"name":"pos.schedule_relationship","type":"enum","key":"","desc":"","group":"position record"},{"name":"pos.latitude","type":"number","key":"","desc":"","group":"position record"},{"name":"pos.longitude","type":"number","key":"","desc":"","group":"position record"},{"name":"pos.bearing","type":"number","key":"","desc":"degrees","group":"position record"},{"name":"pos.speed","type":"number","key":"","desc":"m/s","group":"position record"},{"name":"pos.odometer","type":"number","key":"","desc":"metres","group":"position record"},{"name":"pos.stop_id","type":"text","key":"","desc":"","group":"position record"},{"name":"pos.current_stop_sequence","type":"int","key":"","desc":"","group":"position record"},{"name":"pos.current_status","type":"enum","key":"","desc":"","group":"position record"},{"name":"pos.occupancy_status","type":"enum","key":"","desc":"where published","group":"position record"},{"name":"pos.timestamp","type":"epoch s","key":"","desc":"when measured","group":"position record"},{"name":"load.service_date","type":"date","key":"","desc":"","group":"load record"},{"name":"load.route_id","type":"text","key":"","desc":"","group":"load record"},{"name":"load.direction_id","type":"int","key":"","desc":"","group":"load record"},{"name":"load.stop_id","type":"text","key":"","desc":"","group":"load record"},{"name":"load.window_start","type":"datetime","key":"","desc":"","group":"load record"},{"name":"load.boardings","type":"int","key":"","desc":"","group":"load record"},{"name":"load.alightings","type":"int","key":"","desc":"","group":"load record"},{"name":"load.on_board","type":"int","key":"","desc":"","group":"load record"},{"name":"load.visits","type":"int","key":"","desc":"","group":"load record"}],"path":"online","id":"lane","status_label":"planned"},{"lane":"region","layer":"silver","row":0,"name":"TIDES vehicle_locations","role":["feed archive, Silver: TIDES","vehicle_locations from the lane; 3 years"],"status":"planned","shape":"TIDES `vehicle_locations` plus extras","grain":"one row per position","keys":"location_ping_id; party_id, service_date, vehicle_id, event_timestamp","part":"by party and service day","keep":"3 years, as costed; a leaver's part deleted at once, snapshots expired","key":"region","standard":"TIDES vehicle_locations","columns":[{"name":"location_ping_id","type":"text","key":"PK","desc":"generated from party, vehicle and time"},{"name":"service_date","type":"date","key":"","desc":"TIDES; the partition"},{"name":"event_timestamp","type":"datetime","key":"","desc":"TIDES"},{"name":"trip_id_performed","type":"text","key":"","desc":"TIDES; the feed's trip id"},{"name":"trip_id_scheduled","type":"text","key":"FK","desc":"TIDES; the same id, as published"},{"name":"scheduled_stop_sequence","type":"int","key":"","desc":"TIDES"},{"name":"vehicle_id","type":"text","key":"","desc":"TIDES"},{"name":"stop_id","type":"text","key":"FK","desc":"TIDES"},{"name":"current_status","type":"enum","key":"","desc":"TIDES"},{"name":"latitude","type":"number","key":"","desc":"TIDES"},{"name":"longitude","type":"number","key":"","desc":"TIDES"},{"name":"heading","type":"number","key":"","desc":"TIDES, degrees"},{"name":"speed","type":"number","key":"","desc":"TIDES, m/s"},{"name":"odometer","type":"number","key":"","desc":"TIDES, metres"},{"name":"schedule_relationship","type":"enum","key":"","desc":"TIDES"},{"name":"party_id","type":"text","key":"PK","desc":"extra: the partition and the leaver's prefix"},{"name":"route_id","type":"text","key":"","desc":"extra: vehicle_locations has no route"},{"name":"direction_id","type":"int","key":"","desc":"extra"},{"name":"occupancy_status","type":"enum","key":"","desc":"extra: as the feed publishes it"}],"path":"online","id":"vl_archive","status_label":"planned"},{"lane":"region","layer":"silver","row":1,"name":"Timetables","role":["GTFS as published, per party","and version; the standard shape"],"status":"standard","shape":"GTFS, unchanged, plus party and version","grain":"as GTFS","keys":"party_id, feed_version, then each file's own key","part":"by party and feed version","keep":"while the archive covers it","key":"region","standard":"GTFS","columns":[{"name":"party_id","type":"text","key":"PK","desc":"who published it; from the registry","group":"key"},{"name":"feed_version","type":"text","key":"PK","desc":"feed_info.feed_version, or the zip's hash when absent","group":"key"},{"name":"fetched_at","type":"datetime","key":"","desc":"","group":"key"},{"name":"agency.agency_id","type":"text","key":"PK","desc":"the publisher","group":"agency.txt"},{"name":"agency.agency_name","type":"text","key":"","desc":"","group":"agency.txt"},{"name":"agency.agency_timezone","type":"text","key":"","desc":"America/Toronto","group":"agency.txt"},{"name":"stops.stop_id","type":"text","key":"PK","desc":"the stop's id in the feed","group":"stops.txt"},{"name":"stops.stop_code","type":"text","key":"","desc":"the number on the pole; the vendor files' stop number","group":"stops.txt"},{"name":"stops.stop_name","type":"text","key":"","desc":"","group":"stops.txt"},{"name":"stops.stop_lat","type":"number","key":"","desc":"WGS-84","group":"stops.txt"},{"name":"stops.stop_lon","type":"number","key":"","desc":"WGS-84","group":"stops.txt"},{"name":"stops.location_type","type":"int","key":"","desc":"stop, station or entrance","group":"stops.txt"},{"name":"stops.parent_station","type":"text","key":"FK","desc":"stops.stop_id of the station","group":"stops.txt"},{"name":"routes.route_id","type":"text","key":"PK","desc":"","group":"routes.txt"},{"name":"routes.agency_id","type":"text","key":"FK","desc":"","group":"routes.txt"},{"name":"routes.route_short_name","type":"text","key":"","desc":"the route number","group":"routes.txt"},{"name":"routes.route_long_name","type":"text","key":"","desc":"","group":"routes.txt"},{"name":"routes.route_type","type":"int","key":"","desc":"3 is bus","group":"routes.txt"},{"name":"trips.route_id","type":"text","key":"FK","desc":"","group":"trips.txt"},{"name":"trips.service_id","type":"text","key":"FK","desc":"carries the board period","group":"trips.txt"},{"name":"trips.trip_id","type":"text","key":"PK","desc":"the timetable trip","group":"trips.txt"},{"name":"trips.trip_headsign","type":"text","key":"","desc":"","group":"trips.txt"},{"name":"trips.direction_id","type":"int","key":"","desc":"0 or 1","group":"trips.txt"},{"name":"trips.block_id","type":"text","key":"","desc":"","group":"trips.txt"},{"name":"trips.shape_id","type":"text","key":"FK","desc":"","group":"trips.txt"},{"name":"stop_times.trip_id","type":"text","key":"PK","desc":"","group":"stop_times.txt"},{"name":"stop_times.arrival_time","type":"time","key":"","desc":"HH:MM:SS, past 24:00 after midnight","group":"stop_times.txt"},{"name":"stop_times.departure_time","type":"time","key":"","desc":"","group":"stop_times.txt"},{"name":"stop_times.stop_id","type":"text","key":"FK","desc":"","group":"stop_times.txt"},{"name":"stop_times.stop_sequence","type":"int","key":"PK","desc":"increasing along the trip","group":"stop_times.txt"},{"name":"stop_times.timepoint","type":"int","key":"","desc":"1 where the time is exact","group":"stop_times.txt"},{"name":"calendar_dates.service_id","type":"text","key":"PK","desc":"","group":"calendar_dates.txt"},{"name":"calendar_dates.date","type":"date","key":"PK","desc":"YYYYMMDD","group":"calendar_dates.txt"},{"name":"calendar_dates.exception_type","type":"int","key":"","desc":"1 added, 2 removed; this feed has no calendar.txt","group":"calendar_dates.txt"},{"name":"shapes.shape_id","type":"text","key":"PK","desc":"","group":"shapes.txt"},{"name":"shapes.shape_pt_lat","type":"number","key":"","desc":"","group":"shapes.txt"},{"name":"shapes.shape_pt_lon","type":"number","key":"","desc":"","group":"shapes.txt"},{"name":"shapes.shape_pt_sequence","type":"int","key":"PK","desc":"","group":"shapes.txt"},{"name":"feed_info.feed_publisher_name","type":"text","key":"","desc":"","group":"feed_info.txt"},{"name":"feed_info.feed_version","type":"text","key":"","desc":"the version string the publisher sets","group":"feed_info.txt"},{"name":"feed_info.feed_start_date","type":"date","key":"","desc":"","group":"feed_info.txt"},{"name":"feed_info.feed_end_date","type":"date","key":"","desc":"","group":"feed_info.txt"}],"path":"online","id":"timetables","status_label":"already standard"},{"lane":"region","layer":"gold","row":0,"name":"Last state per vehicle","role":["place, time and counter reading;","what the rules compare against"],"status":"planned","shape":"DynamoDB items of two kinds: a vehicle, a counter","grain":"one item per vehicle, overwritten; one per route and stop for the counters","keys":"pk = party_id; sk = vehicle_id, or route_id and stop_id","part":"by party","keep":"until overwritten; expires a day after the last sighting","key":"region","standard":"","columns":[{"name":"pk","type":"text","key":"PK","desc":"party_id"},{"name":"sk","type":"text","key":"PK","desc":"V#vehicle_id, or C#route_id#stop_id"},{"name":"kind","type":"enum","key":"","desc":"vehicle or counter"},{"name":"last_seen","type":"datetime","key":"","desc":"the newest position's time","group":"vehicle"},{"name":"latitude","type":"number","key":"","desc":"","group":"vehicle"},{"name":"longitude","type":"number","key":"","desc":"","group":"vehicle"},{"name":"stop_id","type":"text","key":"","desc":"","group":"vehicle"},{"name":"trip_id","type":"text","key":"","desc":"","group":"vehicle"},{"name":"route_id","type":"text","key":"","desc":"","group":"vehicle"},{"name":"direction_id","type":"int","key":"","desc":"","group":"vehicle"},{"name":"moved_at","type":"datetime","key":"","desc":"the last time the position changed by more than a few metres","group":"vehicle"},{"name":"jump","type":"bool","key":"","desc":"the last move was faster than a bus can go","group":"vehicle"},{"name":"last_window","type":"datetime","key":"","desc":"the newest load row's window","group":"counter"},{"name":"last_nonzero_window","type":"datetime","key":"","desc":"the last window with anyone counted","group":"counter"},{"name":"zero_windows","type":"int","key":"","desc":"windows in a row with nobody counted","group":"counter"},{"name":"expires_at","type":"datetime","key":"","desc":"a day after last_seen: the table's own expiry"}],"path":"online","id":"state","status_label":"planned"},{"lane":"region","layer":"gold","row":1,"name":"Delay and load per route","role":["route × direction × 5 minutes;","1,680 series, a band each; 63 days"],"status":"replayed","shape":"CloudWatch metrics; the band is the detector's","grain":"route × direction × 5-minute window, one value per metric","keys":"party_id, route_id, direction_id, metric_name, timestamp","part":"one series per route and direction","keep":"63 days; cannot be deleted sooner","key":"region","standard":"","columns":[{"name":"namespace","type":"text","key":"","desc":"constant"},{"name":"metric_name","type":"enum","key":"PK","desc":"delay_min or on_board"},{"name":"party_id","type":"text","key":"PK","desc":"dimension"},{"name":"route_id","type":"text","key":"PK","desc":"dimension"},{"name":"direction_id","type":"int","key":"PK","desc":"dimension"},{"name":"timestamp","type":"datetime","key":"PK","desc":"the window start"},{"name":"value","type":"number","key":"","desc":"the median delay in minutes, or the mean people on board"},{"name":"sample_count","type":"int","key":"","desc":"vehicles or stops the value is taken over"},{"name":"unit","type":"text","key":"","desc":"Count"},{"name":"expected_low","type":"number","key":"","desc":"the detector's band, learnt from two weeks of history"},{"name":"expected_high","type":"number","key":"","desc":"the detector's band"}],"path":"online","id":"metrics","status_label":"replayed on the sample"},{"lane":"region","layer":"gold","row":3,"name":"Who is affected","role":["shared stops × last night's","transfer totals; rebuilt nightly"],"status":"planned","shape":"DynamoDB item, built with Athena","grain":"party × route × stop → neighbours and their share","keys":"pk = party_id; sk = route_id#stop_id","part":"by party","keep":"replaced nightly","key":"built under each agency's key, by grant","standard":"","columns":[{"name":"pk","type":"text","key":"PK","desc":"the party whose route is late"},{"name":"sk","type":"text","key":"PK","desc":"route_id#stop_id, a shared stop on the route"},{"name":"neighbours","type":"list","key":"","desc":"one entry per neighbour who takes riders from this route here"},{"name":"neighbours[].party","type":"text","key":"FK","desc":"the neighbour","group":"neighbours"},{"name":"neighbours[].stop_id","type":"text","key":"","desc":"the same place in the neighbour's feed","group":"neighbours"},{"name":"neighbours[].to_route","type":"text","key":"","desc":"the neighbour's route they change to","group":"neighbours"},{"name":"neighbours[].time_band","type":"text","key":"","desc":"3-hour band","group":"neighbours"},{"name":"neighbours[].transfers_typical","type":"int","key":"","desc":"median of the last four weeks' totals","group":"neighbours"},{"name":"neighbours[].share","type":"number","key":"","desc":"of all transfers from this route and stop","group":"neighbours"},{"name":"built_at","type":"datetime","key":"","desc":""}],"path":"online","id":"affects","status_label":"planned"},{"lane":"region","layer":"out","row":0,"name":"Alerts","role":["kind, party, where, since, seen,","who is affected; kept 13 months"],"status":"replayed","shape":"no TIDES home; the shape the contract names (DynamoDB alert log)","grain":"one row per alert, open or cleared","keys":"alert_id; party_id and month for the partition","part":"by party and month","keep":"13 months at the region; copies stay with receivers","key":"region; each receiver's own","standard":"","columns":[{"name":"alert_id","type":"text","key":"PK","desc":"generated, time-ordered"},{"name":"party_id","type":"text","key":"FK","desc":"whose feed or vehicle"},{"name":"month","type":"text","key":"","desc":"YYYY-MM of since: the partition"},{"name":"kind","type":"enum","key":"","desc":"feed_gap, frozen_vehicle, position_jump, dead_counter, delay_anomaly, load_anomaly"},{"name":"route_id","type":"text","key":"","desc":""},{"name":"direction_id","type":"int","key":"","desc":""},{"name":"vehicle_id","type":"text","key":"","desc":"for a vehicle rule, as the party's feed names it"},{"name":"stop_id","type":"text","key":"","desc":"for a counter rule"},{"name":"since","type":"datetime","key":"","desc":"the first window outside the band, or when the rule fired"},{"name":"until","type":"datetime","key":"","desc":"null while open"},{"name":"expected_low","type":"number","key":"","desc":"the band, for the detector's alerts"},{"name":"expected_high","type":"number","key":"","desc":""},{"name":"seen","type":"number","key":"","desc":"the value that broke it"},{"name":"unit","type":"text","key":"","desc":"minutes late, or people on board"},{"name":"affects","type":"list","key":"","desc":"neighbours, their stops and routes, typical transfers; empty when unknown"},{"name":"label","type":"text","key":"","desc":"planned: snow, an event nearby; null until weather and events are sourced"},{"name":"status","type":"enum","key":"","desc":"open or cleared"},{"name":"created_at","type":"datetime","key":"","desc":""}],"path":"online","id":"alerts","status_label":"replayed on the sample"},{"lane":"region","layer":"out","row":1,"name":"Live alert feed","role":["open alerts as JSON, to control","rooms and the regional views"],"status":"planned","shape":"JSON over the API","grain":"the open alerts a reader may see","keys":"reader's party; allow-or-deny rules","part":"per request","keep":"not stored","key":"region","standard":"","columns":[{"name":"alert_id","type":"text","key":"PK","desc":""},{"name":"party_id","type":"text","key":"","desc":""},{"name":"kind","type":"enum","key":"","desc":""},{"name":"route_id","type":"text","key":"","desc":""},{"name":"direction_id","type":"int","key":"","desc":""},{"name":"vehicle_id","type":"text","key":"","desc":""},{"name":"stop_id","type":"text","key":"","desc":""},{"name":"since","type":"datetime","key":"","desc":""},{"name":"expected","type":"text","key":"","desc":"low to high, as one string"},{"name":"seen","type":"number","key":"","desc":""},{"name":"unit","type":"text","key":"","desc":""},{"name":"affects","type":"list","key":"","desc":""},{"name":"label","type":"text","key":"","desc":""},{"name":"served_at","type":"datetime","key":"","desc":""}],"path":"online","id":"feed","status_label":"planned"},{"lane":"agency","layer":"source","row":2,"name":"PRESTO fare export","role":["nightly CSV of taps; 18 columns,","with a header; the card serial in it"],"status":"sample","shape":"vendor CSV, `,`-delimited, with a header","grain":"one row per tap","keys":"TransactionID","part":"one file a month in the sample; nightly in a live agency","keep":"the agency's rule","key":"agency","standard":"","columns":[{"name":"GSN","type":"text","key":"","desc":"RESTRICTED · card serial: links taps into a person's trail; hashed at home, never written out"},{"name":"Date","type":"date","key":"","desc":"the calendar date of the tap"},{"name":"Time","type":"time","key":"","desc":"HH:MM:SS"},{"name":"TransactionID","type":"text","key":"PK","desc":"unique per tap"},{"name":"UniversalClass","type":"int","key":"","desc":"RESTRICTED · fare class: can reveal a concession"},{"name":"SpecificClass","type":"int","key":"","desc":"RESTRICTED · fare class detail"},{"name":"TrxTypeID","type":"int","key":"","desc":"14 e-purse ride, 15 period pass, 16 transfer"},{"name":"TransitAuthority_ID","type":"int","key":"","desc":"the authority"},{"name":"CashFare","type":"number","key":"","desc":"the fare charged"},{"name":"oppaymentamount","type":"number","key":"","desc":"the amount paid; differs from CashFare in 5,631 rows"},{"name":"ServiceProvider","type":"int","key":"","desc":"the operator of this tap"},{"name":"TransferServiceProviderID","type":"int","key":"","desc":"the operator transferred from; 0 when none: the one field that links two parties' legs"},{"name":"TransferServiceProviderName","type":"text","key":"","desc":"that operator's name"},{"name":"ProductOwnerID","type":"int","key":"","desc":"who sold the product"},{"name":"TrxStatus","type":"int","key":"","desc":"accepted or declined"},{"name":"ProductID","type":"int","key":"","desc":"RESTRICTED · the product: can reveal a concession"},{"name":"TrxLocationID","type":"text","key":"","desc":"device or stop; the stop number without its leading zeros (398,199 padded)"},{"name":"LineID","type":"text","key":"","desc":"the route"}],"path":"offline","id":"afc","status_label":"the sample files"},{"lane":"agency","layer":"bronze","row":2,"name":"Raw fare export","role":["as received, under the agency's key;","never leaves; the serial still in it"],"status":"sample","shape":"as received, plus file and landing time","grain":"as received","keys":"none imposed","part":"by file and calendar date","keep":"three years (the raw landing); never leaves","key":"agency","standard":"","columns":[{"name":"GSN","type":"text","key":"","desc":"RESTRICTED · card serial: links taps into a person's trail; hashed at home, never written out"},{"name":"Date","type":"date","key":"","desc":"the calendar date of the tap"},{"name":"Time","type":"time","key":"","desc":"HH:MM:SS"},{"name":"TransactionID","type":"text","key":"PK","desc":"unique per tap"},{"name":"UniversalClass","type":"int","key":"","desc":"RESTRICTED · fare class: can reveal a concession"},{"name":"SpecificClass","type":"int","key":"","desc":"RESTRICTED · fare class detail"},{"name":"TrxTypeID","type":"int","key":"","desc":"14 e-purse ride, 15 period pass, 16 transfer"},{"name":"TransitAuthority_ID","type":"int","key":"","desc":"the authority"},{"name":"CashFare","type":"number","key":"","desc":"the fare charged"},{"name":"oppaymentamount","type":"number","key":"","desc":"the amount paid; differs from CashFare in 5,631 rows"},{"name":"ServiceProvider","type":"int","key":"","desc":"the operator of this tap"},{"name":"TransferServiceProviderID","type":"int","key":"","desc":"the operator transferred from; 0 when none: the one field that links two parties' legs"},{"name":"TransferServiceProviderName","type":"text","key":"","desc":"that operator's name"},{"name":"ProductOwnerID","type":"int","key":"","desc":"who sold the product"},{"name":"TrxStatus","type":"int","key":"","desc":"accepted or declined"},{"name":"ProductID","type":"int","key":"","desc":"RESTRICTED · the product: can reveal a concession"},{"name":"TrxLocationID","type":"text","key":"","desc":"device or stop; the stop number without its leading zeros (398,199 padded)"},{"name":"LineID","type":"text","key":"","desc":"the route"},{"name":"_source_file","type":"text","key":"","desc":"the export file this row came from"},{"name":"_landed_at","type":"datetime","key":"","desc":"when the file landed"}],"path":"offline","id":"b_afc","status_label":"the sample files"},{"lane":"agency","layer":"silver","row":2,"name":"TIDES fare_transactions","role":["1.69 M taps from the month, 100%","pass the schema; the card hashed, gone"],"status":"tested","shape":"TIDES `fare_transactions` plus named extras: the transfer operator, the route, the hashed card","grain":"one row per tap","keys":"transaction_id; stop_id = GTFS stop","part":"by service day","keep":"the agency's rule; the region never reads it","key":"agency","standard":"TIDES fare_transactions plus extras","columns":[{"name":"transaction_id","type":"text","key":"PK","desc":"TIDES"},{"name":"service_date","type":"date","key":"","desc":"TIDES; the calendar date (taps before 04:00 stay on it: open)"},{"name":"event_timestamp","type":"datetime","key":"","desc":"TIDES"},{"name":"amount","type":"number","key":"","desc":"TIDES"},{"name":"currency_type","type":"text","key":"","desc":"TIDES; CAD"},{"name":"fare_action","type":"enum","key":"","desc":"TIDES; Enter or Transfer entrance"},{"name":"stop_id","type":"text","key":"FK","desc":"TIDES; GTFS stop (99.1% of taps find theirs)"},{"name":"fare_media_id","type":"text","key":"","desc":"TIDES"},{"name":"fare_product","type":"text","key":"","desc":"TIDES; from the tap type, not the restricted product"},{"name":"fare_capped","type":"bool","key":"","desc":"TIDES; assumed false"},{"name":"token_id","type":"text","key":"","desc":"TIDES; null: never the card"},{"name":"rider_category","type":"text","key":"","desc":"TIDES; null: the fare class is restricted"},{"name":"route_id","type":"text","key":"","desc":"extra: the agency's route the tap was on"},{"name":"from_operator_id","type":"int","key":"","desc":"extra: PRESTO's transfer-from operator; null when none"},{"name":"from_operator_name","type":"text","key":"","desc":"extra: that operator's name"},{"name":"card_hash","type":"text","key":"","desc":"extra: HMAC of the card serial with a secret the agency keeps; counts distinct riders, never leaves (decision 48)"},{"name":"trx_status","type":"enum","key":"","desc":"extra: accepted or declined"}],"path":"offline","id":"a_fares","status_label":"tested on the sample"},{"lane":"agency","layer":"gold","row":2,"name":"Nightly transfer totals","role":["from-operator × route × 3-hour band;","rows under 5 cards dropped; nightly"],"status":"replayed","shape":"TIDES `station_activities` plus extras: the contract's row","grain":"from-operator × route × date × 3-hour band","keys":"party_id, service_date, from_operator, to_route, time_band","part":"one file per service day","keep":"kept at home; the copy at the region 3 years under the agency's key","key":"agency","standard":"TIDES station_activities plus extras","columns":[{"name":"party_id","type":"text","key":"PK","desc":"the agency that counted: transfers into it"},{"name":"service_date","type":"date","key":"PK","desc":"the calendar day of the taps"},{"name":"from_operator","type":"text","key":"PK","desc":"the operator the rider came from, as PRESTO names it"},{"name":"to_route","type":"text","key":"PK","desc":"the counting agency's route, with its prefix"},{"name":"time_band","type":"text","key":"PK","desc":"3-hour band, such as 06:00–09:00"},{"name":"transfers","type":"int","key":"","desc":"distinct cards; rows under 5 already dropped"},{"name":"median_wait_min","type":"number","key":"","desc":"tap time minus the last from-operator arrival at that stop"},{"name":"share_wait_over_15","type":"number","key":"","desc":"share who waited more than 15 minutes"}],"path":"offline","id":"a_totals","status_label":"replayed on the sample"},{"lane":"region","layer":"bronze","row":1,"name":"Feed archive","role":["feed archive, Bronze: positions and","trip updates as polled; 3 years"],"status":"planned","shape":"records as polled, two kinds (Parquet in Iceberg)","grain":"one row per position; one per trip update stop","keys":"party_id, record_kind, polled_at, then the feed's own ids","part":"by party and service day","keep":"3 years, as costed; a leaver's part deleted at once, snapshots expired","key":"region","standard":"","columns":[{"name":"party_id","type":"text","key":"PK","desc":"from the registry: whose feed","group":"envelope"},{"name":"record_kind","type":"enum","key":"","desc":"position or trip_update","group":"envelope"},{"name":"polled_at","type":"datetime","key":"PK","desc":"","group":"envelope"},{"name":"pos.vehicle_id","type":"text","key":"","desc":"","group":"position"},{"name":"pos.trip_id","type":"text","key":"","desc":"","group":"position"},{"name":"pos.route_id","type":"text","key":"","desc":"","group":"position"},{"name":"pos.direction_id","type":"int","key":"","desc":"","group":"position"},{"name":"pos.start_date","type":"date","key":"","desc":"the service day","group":"position"},{"name":"pos.latitude","type":"number","key":"","desc":"","group":"position"},{"name":"pos.longitude","type":"number","key":"","desc":"","group":"position"},{"name":"pos.current_stop_sequence","type":"int","key":"","desc":"","group":"position"},{"name":"pos.stop_id","type":"text","key":"","desc":"","group":"position"},{"name":"pos.current_status","type":"enum","key":"","desc":"","group":"position"},{"name":"pos.timestamp","type":"epoch s","key":"","desc":"when measured","group":"position"},{"name":"tu.trip_id","type":"text","key":"","desc":"","group":"trip update"},{"name":"tu.route_id","type":"text","key":"","desc":"","group":"trip update"},{"name":"tu.start_date","type":"date","key":"","desc":"","group":"trip update"},{"name":"tu.vehicle_id","type":"text","key":"","desc":"","group":"trip update"},{"name":"tu.stop_sequence","type":"int","key":"","desc":"","group":"trip update"},{"name":"tu.stop_id","type":"text","key":"","desc":"","group":"trip update"},{"name":"tu.arrival_time","type":"epoch s","key":"","desc":"","group":"trip update"},{"name":"tu.departure_time","type":"epoch s","key":"","desc":"","group":"trip update"},{"name":"tu.schedule_relationship","type":"enum","key":"","desc":"","group":"trip update"},{"name":"tu.timestamp","type":"epoch s","key":"","desc":"","group":"trip update"}],"path":"offline","id":"archive","status_label":"planned"},{"lane":"region","layer":"bronze","row":3,"name":"Inbox: nightly files","role":["one folder per agency; each file","under that agency's key, as sent"],"status":"planned","shape":"S3 objects, the contract's rows as sent, SSE-KMS with the agency's key","grain":"one file per party per service day; its rows as sent","keys":"party_id, service_date","part":"by party and service day","keep":"3 years, under the agency's key; deleted when it leaves","key":"agency, granted","standard":"TIDES station_activities plus extras","columns":[{"name":"party_id","type":"text","key":"PK","desc":"from the folder and the signing key","group":"file"},{"name":"service_date","type":"date","key":"PK","desc":"from the file name","group":"file"},{"name":"object_key","type":"text","key":"","desc":"","group":"file"},{"name":"received_at","type":"datetime","key":"","desc":"against the 06:00 deadline","group":"file"},{"name":"key_arn","type":"text","key":"","desc":"the KMS key the object is encrypted with","group":"file"},{"name":"rows","type":"int","key":"","desc":"","group":"file"},{"name":"row.party_id","type":"text","key":"","desc":"the agency that counted: transfers into it","group":"row"},{"name":"row.service_date","type":"date","key":"","desc":"the calendar day of the taps","group":"row"},{"name":"row.from_operator","type":"text","key":"","desc":"the operator the rider came from, as PRESTO names it","group":"row"},{"name":"row.to_route","type":"text","key":"","desc":"the counting agency's route, with its prefix","group":"row"},{"name":"row.time_band","type":"text","key":"","desc":"3-hour band, such as 06:00–09:00","group":"row"},{"name":"row.transfers","type":"int","key":"","desc":"distinct cards; rows under 5 already dropped","group":"row"},{"name":"row.median_wait_min","type":"number","key":"","desc":"tap time minus the last from-operator arrival at that stop","group":"row"},{"name":"row.share_wait_over_15","type":"number","key":"","desc":"share who waited more than 15 minutes","group":"row"}],"path":"offline","id":"inbox","status_label":"planned"},{"lane":"region","layer":"silver","row":2,"name":"Public arrivals","role":["one row per bus per stop, from the","feeds; with the stop crosswalk; by grant"],"status":"planned","shape":"TIDES `stop_visits`, times only, plus the crosswalk","grain":"party × service day × trip × stop","keys":"party_id, service_date, trip_id_performed, trip_stop_sequence","part":"by party and service day","keep":"3 years, with the archive","key":"region; read in place by each agency through a grant","standard":"TIDES stop_visits, times only","columns":[{"name":"party_id","type":"text","key":"PK","desc":"whose bus"},{"name":"operator_name","type":"text","key":"","desc":"the party's PRESTO name, so an agency can match a tap's transfer-from field"},{"name":"service_date","type":"date","key":"PK","desc":"TIDES"},{"name":"trip_id_performed","type":"text","key":"PK","desc":"TIDES; the feed's trip id"},{"name":"trip_stop_sequence","type":"int","key":"PK","desc":"TIDES"},{"name":"stop_id","type":"text","key":"FK","desc":"TIDES; the party's stop id"},{"name":"route_id","type":"text","key":"","desc":"extra"},{"name":"vehicle_id","type":"text","key":"","desc":"TIDES"},{"name":"actual_arrival_time","type":"datetime","key":"","desc":"TIDES"},{"name":"actual_departure_time","type":"datetime","key":"","desc":"TIDES"},{"name":"source","type":"enum","key":"","desc":"extra: stopped_at (a position at the stop), trip_update (the feed's own arrival), or interpolated"},{"name":"shared_with","type":"list","key":"","desc":"extra: the crosswalk, one entry per neighbour that shares this stop"},{"name":"shared_with[].party","type":"text","key":"FK","desc":"","group":"shared_with"},{"name":"shared_with[].stop_id","type":"text","key":"","desc":"the same place in that party's feed","group":"shared_with"}],"path":"offline","id":"arrivals","status_label":"planned"},{"lane":"region","layer":"out","row":2,"name":"Report API","role":["matrix, waits, crossing points,","connection times; JSON, behind sign-in"],"status":"planned","shape":"JSON over the API; four reports","grain":"one report per request, filtered per reader","keys":"reader's party; allow-or-deny rules","part":"per request; cached","keep":"cached briefly; purged when a party leaves","key":"region","standard":"","columns":[{"name":"matrix.from_party","type":"text","key":"","desc":"","group":"matrix"},{"name":"matrix.to_party","type":"text","key":"","desc":"","group":"matrix"},{"name":"matrix.time_band","type":"text","key":"","desc":"","group":"matrix"},{"name":"matrix.transfers","type":"int","key":"","desc":"a typical weekday, summed over routes","group":"matrix"},{"name":"matrix.status","type":"enum","key":"","desc":"reported or unknown","group":"matrix"},{"name":"waits.to_party","type":"text","key":"","desc":"","group":"waits"},{"name":"waits.to_route","type":"text","key":"","desc":"","group":"waits"},{"name":"waits.time_band","type":"text","key":"","desc":"","group":"waits"},{"name":"waits.median_wait_min","type":"number","key":"","desc":"","group":"waits"},{"name":"waits.share_wait_over_15","type":"number","key":"","desc":"","group":"waits"},{"name":"crossing.to_party","type":"text","key":"","desc":"","group":"crossing points"},{"name":"crossing.to_route","type":"text","key":"","desc":"by route in v1; by stop would need the contract's grain to change","group":"crossing points"},{"name":"crossing.from_party","type":"text","key":"","desc":"","group":"crossing points"},{"name":"crossing.transfers","type":"int","key":"","desc":"ranked","group":"crossing points"},{"name":"connection.from_party","type":"text","key":"","desc":"","group":"connection times"},{"name":"connection.to_party","type":"text","key":"","desc":"","group":"connection times"},{"name":"connection.to_route","type":"text","key":"","desc":"","group":"connection times"},{"name":"connection.time_band","type":"text","key":"","desc":"","group":"connection times"},{"name":"connection.median_wait_min","type":"number","key":"","desc":"for the journey view","group":"connection times"},{"name":"served_at","type":"datetime","key":"","desc":""}],"path":"offline","id":"api","status_label":"planned"},{"lane":"region","layer":"out","row":3,"name":"Rejected files","role":["a file that failed its contract check,","held with the reason; the agency told"],"status":"planned","shape":"SQS message per file","grain":"one message per rejected file","keys":"party_id, service_date, object_key","part":"not partitioned","keep":"14 days, replayable","key":"region","standard":"","columns":[{"name":"party_id","type":"text","key":"PK","desc":""},{"name":"service_date","type":"date","key":"PK","desc":""},{"name":"object_key","type":"text","key":"PK","desc":""},{"name":"reason","type":"enum","key":"","desc":"shape, deadline, privacy_rule, wrong_key, no_contract"},{"name":"detail","type":"text","key":"","desc":"which column, which row count, which key"},{"name":"checked_at","type":"datetime","key":"","desc":""},{"name":"notified_at","type":"datetime","key":"","desc":"when the agency was told; the path back is still open (audit)"}],"path":"offline","id":"rejects","status_label":"planned"}],"transforms":[{"id":"T1","name":"Land the vendor exports","short":"Land exports","lane":"agency","col":0.5,"row":0.5,"service":"S3 landing","when":"monthly in the sample; nightly in a live agency","inputs":["avl","apc"],"outputs":["b_avl","b_apc"],"detail":{"grain":"unchanged: one row per trip per stop","joins":["none"],"filters":["none: every byte kept"],"dedup":["none: Bronze is never edited, so Silver can be rebuilt from it"],"nulls":["the string NULL stays a string here"],"units":["seconds past midnight stay seconds"],"privacy":["no fare data in these two files"],"key":"the agency's"},"columns":[{"out":"b_avl.CALENDAR_ID","expr":"avl.CALENDAR_ID","from":["avl.CALENDAR_ID"],"rule":"copy"},{"out":"b_avl.TIME_TABLE_VERSION_NAME","expr":"avl.TIME_TABLE_VERSION_NAME","from":["avl.TIME_TABLE_VERSION_NAME"],"rule":"copy"},{"out":"b_avl.BLOCK_ABBR","expr":"avl.BLOCK_ABBR","from":["avl.BLOCK_ABBR"],"rule":"copy"},{"out":"b_avl.TRIP_ID","expr":"avl.TRIP_ID","from":["avl.TRIP_ID"],"rule":"copy"},{"out":"b_avl.ROUTE_ABBR","expr":"avl.ROUTE_ABBR","from":["avl.ROUTE_ABBR"],"rule":"copy"},{"out":"b_avl.ROUTE_DIRECTION_ABBR","expr":"avl.ROUTE_DIRECTION_ABBR","from":["avl.ROUTE_DIRECTION_ABBR"],"rule":"copy"},{"out":"b_avl.VARIANT","expr":"avl.VARIANT","from":["avl.VARIANT"],"rule":"copy"},{"out":"b_avl.GEO_NODE_ABBR","expr":"avl.GEO_NODE_ABBR","from":["avl.GEO_NODE_ABBR"],"rule":"copy"},{"out":"b_avl.GEO_NAME","expr":"avl.GEO_NAME","from":["avl.GEO_NAME"],"rule":"copy"},{"out":"b_avl.START_TERMINAL","expr":"avl.START_TERMINAL","from":["avl.START_TERMINAL"],"rule":"copy"},{"out":"b_avl.END_TERMINAL","expr":"avl.END_TERMINAL","from":["avl.END_TERMINAL"],"rule":"copy"},{"out":"b_avl.TRIP_EDGE","expr":"avl.TRIP_EDGE","from":["avl.TRIP_EDGE"],"rule":"copy"},{"out":"b_avl.TIME_POINT_ID","expr":"avl.TIME_POINT_ID","from":["avl.TIME_POINT_ID"],"rule":"copy"},{"out":"b_avl.TIME_POINT_ABBR","expr":"avl.TIME_POINT_ABBR","from":["avl.TIME_POINT_ABBR"],"rule":"copy"},{"out":"b_avl.TIME_POINT_NAME","expr":"avl.TIME_POINT_NAME","from":["avl.TIME_POINT_NAME"],"rule":"copy"},{"out":"b_avl.SERVICE_ABBR","expr":"avl.SERVICE_ABBR","from":["avl.SERVICE_ABBR"],"rule":"copy"},{"out":"b_avl.SCHED_TRIP_START","expr":"avl.SCHED_TRIP_START","from":["avl.SCHED_TRIP_START"],"rule":"copy"},{"out":"b_avl.SCHED_TRIP_END","expr":"avl.SCHED_TRIP_END","from":["avl.SCHED_TRIP_END"],"rule":"copy"},{"out":"b_avl.SCHED_TRIP_DURATION","expr":"avl.SCHED_TRIP_DURATION","from":["avl.SCHED_TRIP_DURATION"],"rule":"copy"},{"out":"b_avl.SCHED_TIME_PER_STOP","expr":"avl.SCHED_TIME_PER_STOP","from":["avl.SCHED_TIME_PER_STOP"],"rule":"copy"},{"out":"b_avl.ACTUAL_TRIP_DURATION","expr":"avl.ACTUAL_TRIP_DURATION","from":["avl.ACTUAL_TRIP_DURATION"],"rule":"copy"},{"out":"b_avl.ACTUAL_ARRIVAL_TIME","expr":"avl.ACTUAL_ARRIVAL_TIME","from":["avl.ACTUAL_ARRIVAL_TIME"],"rule":"copy"},{"out":"b_avl.ACTUAL_DEPARTURE_TIME","expr":"avl.ACTUAL_DEPARTURE_TIME","from":["avl.ACTUAL_DEPARTURE_TIME"],"rule":"copy"},{"out":"b_avl.DWELLING_TIME","expr":"avl.DWELLING_TIME","from":["avl.DWELLING_TIME"],"rule":"copy"},{"out":"b_avl.ADHERENCE_IN_SECS","expr":"avl.ADHERENCE_IN_SECS","from":["avl.ADHERENCE_IN_SECS"],"rule":"copy"},{"out":"b_avl.KPI","expr":"avl.KPI","from":["avl.KPI"],"rule":"copy"},{"out":"b_avl._source_file","expr":"the export's file name","from":[],"rule":"generate"},{"out":"b_avl._landed_at","expr":"now()","from":[],"rule":"generate"},{"out":"b_apc.TIME_TABLE_VERSION_NAME","expr":"apc.TIME_TABLE_VERSION_NAME","from":["apc.TIME_TABLE_VERSION_NAME"],"rule":"copy"},{"out":"b_apc.CALENDAR_ID","expr":"apc.CALENDAR_ID","from":["apc.CALENDAR_ID"],"rule":"copy"},{"out":"b_apc.BLOCK_ABBR","expr":"apc.BLOCK_ABBR","from":["apc.BLOCK_ABBR"],"rule":"copy"},{"out":"b_apc.TRIP_ID","expr":"apc.TRIP_ID","from":["apc.TRIP_ID"],"rule":"copy"},{"out":"b_apc.ROUTE_ABBR","expr":"apc.ROUTE_ABBR","from":["apc.ROUTE_ABBR"],"rule":"copy"},{"out":"b_apc.ROUTE_DIRECTION_ABBR","expr":"apc.ROUTE_DIRECTION_ABBR","from":["apc.ROUTE_DIRECTION_ABBR"],"rule":"copy"},{"out":"b_apc.VARIANT","expr":"apc.VARIANT","from":["apc.VARIANT"],"rule":"copy"},{"out":"b_apc.PATTERN_STOP_SEQUENCE","expr":"apc.PATTERN_STOP_SEQUENCE","from":["apc.PATTERN_STOP_SEQUENCE"],"rule":"copy"},{"out":"b_apc.STOP_NUMBER","expr":"apc.STOP_NUMBER","from":["apc.STOP_NUMBER"],"rule":"copy"},{"out":"b_apc.STOP_NAME","expr":"apc.STOP_NAME","from":["apc.STOP_NAME"],"rule":"copy"},{"out":"b_apc.TOTAL_CAPACITY","expr":"apc.TOTAL_CAPACITY","from":["apc.TOTAL_CAPACITY"],"rule":"copy"},{"out":"b_apc.SEATING_CAPACITY","expr":"apc.SEATING_CAPACITY","from":["apc.SEATING_CAPACITY"],"rule":"copy"},{"out":"b_apc.BOARD","expr":"apc.BOARD","from":["apc.BOARD"],"rule":"copy"},{"out":"b_apc.ALIGHT","expr":"apc.ALIGHT","from":["apc.ALIGHT"],"rule":"copy"},{"out":"b_apc.DEPARTURE_LOAD","expr":"apc.DEPARTURE_LOAD","from":["apc.DEPARTURE_LOAD"],"rule":"copy"},{"out":"b_apc.SERVICE_ABBR","expr":"apc.SERVICE_ABBR","from":["apc.SERVICE_ABBR"],"rule":"copy"},{"out":"b_apc.TRIP_BEGIN_TIME","expr":"apc.TRIP_BEGIN_TIME","from":["apc.TRIP_BEGIN_TIME"],"rule":"copy"},{"out":"b_apc.TRIP_END_TIME","expr":"apc.TRIP_END_TIME","from":["apc.TRIP_END_TIME"],"rule":"copy"},{"out":"b_apc._source_file","expr":"the export's file name","from":[],"rule":"generate"},{"out":"b_apc._landed_at","expr":"now()","from":[],"rule":"generate"}],"drops":[],"source_id":"online:T1","path":"online"},{"id":"T2","name":"Conform the exports to TIDES stop_visits and trips_performed","short":"Conform to TIDES","lane":"agency","col":1.5,"row":0.5,"service":"the adapter (Glue ETL or Lambda)","when":"per service day","inputs":["b_avl","b_apc","gtfs"],"outputs":["a_silver","a_trips"],"detail":{"grain":"AVL row per trip per stop → one stop visit; the APC records of one visit collapsed into it; one trips_performed row per trip","joins":["AVL ⟕ APC on CALENDAR_ID, TRIP_ID, ROUTE_ABBR, GEO_NODE_ABBR = STOP_NUMBER, int(GEO_NAME prefix) = PATTERN_STOP_SEQUENCE (the four-column key alone collides on loop routes)","stop_id must exist in the party's GTFS stops (100% in the sample)","trip map: (TRIP_ID, service day) → GTFS trips.trip_id by matching the day's scheduled stop times; 99.78% of 136,684 trip-days match one trip exactly, 99.97% within 60 s","routes.route_short_name = ROUTE_ABBR → route_id"],"filters":["an APC record with no AVL skeleton row cannot be placed and is counted, not written (none in the sample)"],"dedup":["several APC records of one visit are summed for counts and take the max load (20,077 visits in the sample)","primary key service_date, trip_id_performed, trip_stop_sequence checked unique; sequence must run 1, 2, 3"],"nulls":["the string NULL → null","vehicle_id null: the export has no vehicle id","scheduled_stop_sequence null until the trip map fills it"],"units":["seconds past midnight → timestamps on the service day; 809,097 values at or past 86,400 roll to the next calendar day"],"privacy":["no rider data in these files"],"key":"the agency's; the region never reads these tables"},"columns":[{"out":"a_silver.service_date","expr":"date(CALENDAR_ID[1:], 'YYYYMMDD')","from":["b_avl.CALENDAR_ID"],"rule":"derive"},{"out":"a_silver.trip_id_performed","expr":"TRIP_ID","from":["b_avl.TRIP_ID"],"rule":"copy"},{"out":"a_silver.trip_stop_sequence","expr":"int(GEO_NAME before ' - ')","from":["b_avl.GEO_NAME"],"rule":"derive"},{"out":"a_silver.scheduled_stop_sequence","expr":"null; planned: stop_times.stop_sequence of trip_id_scheduled at this stop","from":["gtfs.stop_times.stop_sequence"],"rule":"null"},{"out":"a_silver.pattern_id","expr":"ROUTE_ABBR || '-' || ROUTE_DIRECTION_ABBR || '-' || VARIANT","from":["b_avl.ROUTE_ABBR","b_avl.ROUTE_DIRECTION_ABBR","b_avl.VARIANT"],"rule":"derive"},{"out":"a_silver.vehicle_id","expr":"null (BLOCK_ABBR is a block, not a vehicle)","from":["b_avl.BLOCK_ABBR"],"rule":"null"},{"out":"a_silver.dwell","expr":"int(DWELLING_TIME)","from":["b_avl.DWELLING_TIME"],"rule":"copy"},{"out":"a_silver.stop_id","expr":"GEO_NODE_ABBR, checked against stops.stop_id","from":["b_avl.GEO_NODE_ABBR","gtfs.stops.stop_id"],"rule":"join"},{"out":"a_silver.timepoint","expr":"TIME_POINT_ID is not null","from":["b_avl.TIME_POINT_ID"],"rule":"derive"},{"out":"a_silver.schedule_arrival_time","expr":"service_date + SCHED_TIME_PER_STOP seconds","from":["b_avl.CALENDAR_ID","b_avl.SCHED_TIME_PER_STOP"],"rule":"derive"},{"out":"a_silver.schedule_departure_time","expr":"service_date + SCHED_TIME_PER_STOP seconds (one scheduled time per stop)","from":["b_avl.CALENDAR_ID","b_avl.SCHED_TIME_PER_STOP"],"rule":"derive"},{"out":"a_silver.actual_arrival_time","expr":"service_date + ACTUAL_ARRIVAL_TIME seconds","from":["b_avl.CALENDAR_ID","b_avl.ACTUAL_ARRIVAL_TIME"],"rule":"derive"},{"out":"a_silver.actual_departure_time","expr":"service_date + ACTUAL_DEPARTURE_TIME seconds","from":["b_avl.CALENDAR_ID","b_avl.ACTUAL_DEPARTURE_TIME"],"rule":"derive"},{"out":"a_silver.boarding_1","expr":"Σ BOARD over the visit's APC records","from":["b_apc.BOARD"],"rule":"aggregate"},{"out":"a_silver.alighting_1","expr":"Σ ALIGHT over the visit's APC records","from":["b_apc.ALIGHT"],"rule":"aggregate"},{"out":"a_silver.departure_load","expr":"max(DEPARTURE_LOAD) over the visit's APC records","from":["b_apc.DEPARTURE_LOAD"],"rule":"aggregate"},{"out":"a_silver.schedule_relationship","expr":"'Scheduled' if a time or a count was observed, else 'Missing'","from":["b_avl.ACTUAL_ARRIVAL_TIME","b_avl.ACTUAL_DEPARTURE_TIME","b_apc.BOARD"],"rule":"derive"},{"out":"a_trips.service_date","expr":"date(CALENDAR_ID[1:], 'YYYYMMDD')","from":["b_avl.CALENDAR_ID"],"rule":"derive"},{"out":"a_trips.trip_id_performed","expr":"TRIP_ID","from":["b_avl.TRIP_ID"],"rule":"copy"},{"out":"a_trips.vehicle_id","expr":"null: not exported; required by TIDES","from":[],"rule":"null"},{"out":"a_trips.trip_id_scheduled","expr":"trip map: the GTFS trip whose stop_times match the day's SCHED_TIME_PER_STOP at each GEO_NODE_ABBR","from":["b_avl.TRIP_ID","b_avl.SCHED_TIME_PER_STOP","b_avl.GEO_NODE_ABBR","gtfs.stop_times.trip_id","gtfs.stop_times.arrival_time","gtfs.stop_times.stop_id"],"rule":"join"},{"out":"a_trips.route_id","expr":"routes.route_id where routes.route_short_name = ROUTE_ABBR","from":["b_avl.ROUTE_ABBR","gtfs.routes.route_id","gtfs.routes.route_short_name"],"rule":"join"},{"out":"a_trips.route_type","expr":"routes.route_type","from":["gtfs.routes.route_type"],"rule":"join"},{"out":"a_trips.direction_id","expr":"trips.direction_id of trip_id_scheduled","from":["gtfs.trips.trip_id","gtfs.trips.direction_id"],"rule":"join"},{"out":"a_trips.block_id","expr":"BLOCK_ABBR","from":["b_avl.BLOCK_ABBR"],"rule":"copy"},{"out":"a_trips.shape_id","expr":"trips.shape_id of trip_id_scheduled","from":["gtfs.trips.shape_id"],"rule":"join"},{"out":"a_trips.pattern_id","expr":"ROUTE_ABBR || '-' || ROUTE_DIRECTION_ABBR || '-' || VARIANT","from":["b_avl.ROUTE_ABBR","b_avl.ROUTE_DIRECTION_ABBR","b_avl.VARIANT"],"rule":"derive"},{"out":"a_trips.trip_start_stop_id","expr":"GEO_NODE_ABBR where TRIP_EDGE is first","from":["b_avl.GEO_NODE_ABBR","b_avl.TRIP_EDGE"],"rule":"derive"},{"out":"a_trips.trip_end_stop_id","expr":"GEO_NODE_ABBR where TRIP_EDGE is last","from":["b_avl.GEO_NODE_ABBR","b_avl.TRIP_EDGE"],"rule":"derive"},{"out":"a_trips.schedule_trip_start","expr":"service_date + SCHED_TRIP_START seconds","from":["b_avl.CALENDAR_ID","b_avl.SCHED_TRIP_START"],"rule":"derive"},{"out":"a_trips.schedule_trip_end","expr":"service_date + SCHED_TRIP_END seconds","from":["b_avl.CALENDAR_ID","b_avl.SCHED_TRIP_END"],"rule":"derive"},{"out":"a_trips.actual_trip_start","expr":"service_date + ACTUAL_DEPARTURE_TIME at the first stop","from":["b_avl.CALENDAR_ID","b_avl.ACTUAL_DEPARTURE_TIME","b_avl.TRIP_EDGE"],"rule":"derive"},{"out":"a_trips.actual_trip_end","expr":"service_date + ACTUAL_ARRIVAL_TIME at the last stop","from":["b_avl.CALENDAR_ID","b_avl.ACTUAL_ARRIVAL_TIME","b_avl.TRIP_EDGE"],"rule":"derive"},{"out":"a_trips.schedule_relationship","expr":"'Scheduled' if any stop was observed, else 'Canceled'","from":["b_avl.ACTUAL_ARRIVAL_TIME"],"rule":"derive"}],"drops":[{"col":"b_avl.ADHERENCE_IN_SECS","why":"recomputable from scheduled and actual; the file's sign is reversed"},{"col":"b_avl.KPI","why":"the vendor's label with agency thresholds; never shared as-is"},{"col":"b_avl.SCHED_TRIP_DURATION","why":"recomputable"},{"col":"b_avl.ACTUAL_TRIP_DURATION","why":"recomputable"},{"col":"b_avl.TIME_POINT_ABBR","why":"display"},{"col":"b_avl.TIME_POINT_NAME","why":"display"},{"col":"b_avl.START_TERMINAL","why":"display"},{"col":"b_avl.END_TERMINAL","why":"display"},{"col":"b_avl.SERVICE_ABBR","why":"derivable from calendar_dates"},{"col":"b_avl.TIME_TABLE_VERSION_NAME","why":"carried by trip_id_scheduled's service_id"},{"col":"b_apc.TOTAL_CAPACITY","why":"no TIDES home without a vehicle id; the load-over-capacity flag (2,251 visits) is raised before it is dropped"},{"col":"b_apc.SEATING_CAPACITY","why":"no TIDES home without a vehicle id"},{"col":"b_apc.STOP_NAME","why":"display"},{"col":"b_apc.TRIP_BEGIN_TIME","why":"the AVL times are kept instead"},{"col":"b_apc.TRIP_END_TIME","why":"the AVL times are kept instead"}],"source_id":"online:T2","path":"online"},{"id":"T3","name":"Sum the visits into 5-minute loads","short":"Sum per 5 min","lane":"agency","col":2.5,"row":0,"service":"the adapter (Lambda)","when":"every 5 minutes, for the window just closed","inputs":["a_silver","a_trips"],"outputs":["a_loads"],"detail":{"grain":"stop visit → route × direction × stop × 5-minute window","joins":["stop_visits ⋈ trips_performed on service_date, trip_id_performed, for route_id and direction_id"],"filters":["actual_departure_time not null","schedule_relationship = Scheduled"],"dedup":["none needed: Silver's key is unique"],"nulls":["a window with no visit has no row; the region shows unknown, never zero"],"units":["counts of people; the window is the departure time floored to 5 minutes"],"privacy":["counts only, no minimum group size (decision 21); nothing about a rider or a card"],"key":"the agency's, until the push"},"columns":[{"out":"a_loads.service_date","expr":"service_date","from":["a_silver.service_date"],"rule":"copy"},{"out":"a_loads.route_id","expr":"trips_performed.route_id","from":["a_trips.route_id","a_silver.trip_id_performed","a_trips.trip_id_performed"],"rule":"join"},{"out":"a_loads.direction_id","expr":"trips_performed.direction_id","from":["a_trips.direction_id"],"rule":"join"},{"out":"a_loads.stop_id","expr":"stop_id","from":["a_silver.stop_id"],"rule":"copy"},{"out":"a_loads.window_start","expr":"floor(actual_departure_time, 5 min)","from":["a_silver.actual_departure_time"],"rule":"derive"},{"out":"a_loads.boardings","expr":"Σ boarding_1","from":["a_silver.boarding_1"],"rule":"aggregate"},{"out":"a_loads.alightings","expr":"Σ alighting_1","from":["a_silver.alighting_1"],"rule":"aggregate"},{"out":"a_loads.on_board","expr":"mean(departure_load) over the window's visits (decision 60: a mean, as the replay took it)","from":["a_silver.departure_load"],"rule":"aggregate"},{"out":"a_loads.visits","expr":"count(*)","from":["a_silver.trip_id_performed"],"rule":"aggregate"}],"drops":[],"source_id":"online:T3","path":"online"},{"id":"T4","name":"Push the loads to the live lane","short":"Push loads","lane":"agency","col":3.5,"row":0,"service":"the adapter (Lambda), in the agency's account","when":"every 5 minutes, within 2 of the window closing","inputs":["a_loads"],"outputs":["lane"],"detail":{"grain":"unchanged: one lane record per load row","joins":["the adapter's credentials name the party; the registry must hold an active live-loads contract"],"filters":["only closed windows","a row late by more than 2 minutes still goes, flagged by the rules on arrival as late"],"dedup":["the lane keeps every record; the same window sent twice is two records, collapsed by the readers on window_start"],"nulls":["none introduced"],"units":["unchanged"],"privacy":["counts only; the contract's privacy clause"],"key":"TLS in flight; the region's key on arrival (decision 54), 24 hours"},"columns":[{"out":"lane.party_id","expr":"the adapter's party, from its credentials and the registry","from":[],"rule":"generate"},{"out":"lane.record_kind","expr":"'load'","from":[],"rule":"constant"},{"out":"lane.sequence_number","expr":"assigned by the stream","from":[],"rule":"generate"},{"out":"lane.arrived_at","expr":"now()","from":[],"rule":"generate"},{"out":"lane.load.service_date","expr":"service_date","from":["a_loads.service_date"],"rule":"copy"},{"out":"lane.load.route_id","expr":"route_id","from":["a_loads.route_id"],"rule":"copy"},{"out":"lane.load.direction_id","expr":"direction_id","from":["a_loads.direction_id"],"rule":"copy"},{"out":"lane.load.stop_id","expr":"stop_id","from":["a_loads.stop_id"],"rule":"copy"},{"out":"lane.load.window_start","expr":"window_start","from":["a_loads.window_start"],"rule":"copy"},{"out":"lane.load.boardings","expr":"boardings","from":["a_loads.boardings"],"rule":"copy"},{"out":"lane.load.alightings","expr":"alightings","from":["a_loads.alightings"],"rule":"copy"},{"out":"lane.load.on_board","expr":"on_board","from":["a_loads.on_board"],"rule":"copy"},{"out":"lane.load.visits","expr":"visits","from":["a_loads.visits"],"rule":"copy"}],"drops":[],"source_id":"online:T4","path":"online"},{"id":"T5","name":"Land the fare export","short":"Land the export","lane":"agency","col":0.5,"row":2,"service":"S3 raw landing","when":"nightly, when the export arrives","inputs":["afc"],"outputs":["b_afc"],"detail":{"grain":"unchanged: one row per tap","joins":["none"],"filters":["none: every byte kept"],"dedup":["none: Bronze is never edited, so Silver can be rebuilt from it"],"nulls":["blank fields stay blank"],"units":["as exported"],"privacy":["the card serial is in this file and this account only; nothing here leaves (decisions 8, 16)"],"key":"the agency's"},"columns":[{"out":"b_afc.GSN","expr":"afc.GSN","from":["afc.GSN"],"rule":"copy"},{"out":"b_afc.Date","expr":"afc.Date","from":["afc.Date"],"rule":"copy"},{"out":"b_afc.Time","expr":"afc.Time","from":["afc.Time"],"rule":"copy"},{"out":"b_afc.TransactionID","expr":"afc.TransactionID","from":["afc.TransactionID"],"rule":"copy"},{"out":"b_afc.UniversalClass","expr":"afc.UniversalClass","from":["afc.UniversalClass"],"rule":"copy"},{"out":"b_afc.SpecificClass","expr":"afc.SpecificClass","from":["afc.SpecificClass"],"rule":"copy"},{"out":"b_afc.TrxTypeID","expr":"afc.TrxTypeID","from":["afc.TrxTypeID"],"rule":"copy"},{"out":"b_afc.TransitAuthority_ID","expr":"afc.TransitAuthority_ID","from":["afc.TransitAuthority_ID"],"rule":"copy"},{"out":"b_afc.CashFare","expr":"afc.CashFare","from":["afc.CashFare"],"rule":"copy"},{"out":"b_afc.oppaymentamount","expr":"afc.oppaymentamount","from":["afc.oppaymentamount"],"rule":"copy"},{"out":"b_afc.ServiceProvider","expr":"afc.ServiceProvider","from":["afc.ServiceProvider"],"rule":"copy"},{"out":"b_afc.TransferServiceProviderID","expr":"afc.TransferServiceProviderID","from":["afc.TransferServiceProviderID"],"rule":"copy"},{"out":"b_afc.TransferServiceProviderName","expr":"afc.TransferServiceProviderName","from":["afc.TransferServiceProviderName"],"rule":"copy"},{"out":"b_afc.ProductOwnerID","expr":"afc.ProductOwnerID","from":["afc.ProductOwnerID"],"rule":"copy"},{"out":"b_afc.TrxStatus","expr":"afc.TrxStatus","from":["afc.TrxStatus"],"rule":"copy"},{"out":"b_afc.ProductID","expr":"afc.ProductID","from":["afc.ProductID"],"rule":"copy"},{"out":"b_afc.TrxLocationID","expr":"afc.TrxLocationID","from":["afc.TrxLocationID"],"rule":"copy"},{"out":"b_afc.LineID","expr":"afc.LineID","from":["afc.LineID"],"rule":"copy"},{"out":"b_afc._source_file","expr":"the export's file name","from":[],"rule":"generate"},{"out":"b_afc._landed_at","expr":"now()","from":[],"rule":"generate"}],"drops":[],"source_id":"offline:T1","path":"offline"},{"id":"T6","name":"Translate the taps to TIDES fare_transactions; hash the card","short":"Translate, hash","lane":"agency","col":1.5,"row":2,"service":"Glue ETL · translate (or Databricks)","when":"02:00, after the export lands","inputs":["b_afc"],"outputs":["a_fares"],"detail":{"grain":"unchanged: one row per tap","joins":["stop_id checked against the agency's GTFS stops (99.1% of taps find theirs; the rest are devices with no stop)"],"filters":["a malformed row (one in the sample) fails every required field and is counted, not written"],"dedup":["transaction_id checked unique"],"nulls":["TrxLocationID 0 or blank → null stop","token_id null: never the card","rider_category null: the fare class is restricted"],"units":["Date and Time → one timestamp; CashFare stays dollars"],"privacy":["the card serial is read here, hashed with a secret the agency keeps, and dropped: the hash counts distinct riders for the 5-card rule and never leaves (decision 48)","fare class and product withheld: they can reveal a concession","the transfer operator has no TIDES field (818,562 taps name one): kept as a named extra"],"key":"the agency's; the region never reads this table"},"columns":[{"out":"a_fares.transaction_id","expr":"TransactionID","from":["b_afc.TransactionID"],"rule":"copy"},{"out":"a_fares.service_date","expr":"Date (the calendar date; 20,356 taps between 00:00 and 04:00 stay on it: a shared definition is still open)","from":["b_afc.Date"],"rule":"copy"},{"out":"a_fares.event_timestamp","expr":"timestamp(Date || ' ' || Time)","from":["b_afc.Date","b_afc.Time"],"rule":"derive"},{"out":"a_fares.amount","expr":"CashFare","from":["b_afc.CashFare"],"rule":"copy"},{"out":"a_fares.currency_type","expr":"'CAD'","from":[],"rule":"constant"},{"out":"a_fares.fare_action","expr":"TrxTypeID 14, 15 → 'Enter'; 16 → 'Transfer entrance'; else 'Unknown action type'","from":["b_afc.TrxTypeID"],"rule":"derive"},{"out":"a_fares.stop_id","expr":"lpad(TrxLocationID, 4, '0'); 0 or blank → null","from":["b_afc.TrxLocationID"],"rule":"derive"},{"out":"a_fares.fare_media_id","expr":"'Smart card or ticket'","from":[],"rule":"constant"},{"out":"a_fares.fare_product","expr":"TrxTypeID 14 → 'E-purse single ride'; 15 → 'Period pass'; 16 → 'Transfer'","from":["b_afc.TrxTypeID"],"rule":"derive"},{"out":"a_fares.fare_capped","expr":"false (assumed; the export does not say)","from":[],"rule":"constant"},{"out":"a_fares.token_id","expr":"null: never the card","from":[],"rule":"null"},{"out":"a_fares.rider_category","expr":"null: UniversalClass is restricted","from":[],"rule":"null"},{"out":"a_fares.route_id","expr":"LineID, with the agency's prefix","from":["b_afc.LineID"],"rule":"derive"},{"out":"a_fares.from_operator_id","expr":"TransferServiceProviderID; 0 → null","from":["b_afc.TransferServiceProviderID"],"rule":"derive"},{"out":"a_fares.from_operator_name","expr":"TransferServiceProviderName; blank → null","from":["b_afc.TransferServiceProviderName"],"rule":"derive"},{"out":"a_fares.card_hash","expr":"HMAC-SHA256(agency secret, GSN)","from":["b_afc.GSN"],"rule":"derive"},{"out":"a_fares.trx_status","expr":"TrxStatus 0 → 'accepted', else 'declined'","from":["b_afc.TrxStatus"],"rule":"derive"}],"drops":[{"col":"b_afc.GSN","why":"the card serial: hashed into card_hash, then dropped; never written to anything that leaves"},{"col":"b_afc.UniversalClass","why":"restricted: a concession class"},{"col":"b_afc.SpecificClass","why":"restricted"},{"col":"b_afc.ProductID","why":"restricted: the product can reveal a concession"},{"col":"b_afc.oppaymentamount","why":"CashFare kept; the two differ in 5,631 rows"},{"col":"b_afc.ServiceProvider","why":"the file is one agency's"},{"col":"b_afc.TransitAuthority_ID","why":"the file is one agency's"},{"col":"b_afc.ProductOwnerID","why":"revenue split, not this use case"}],"source_id":"offline:T2","path":"offline"},{"id":"T7","name":"Count the transfers and time the waits","short":"Count and time","lane":"agency","col":2.5,"row":2,"service":"Glue ETL · count and time (or Databricks); Athena reads the arrivals in place","when":"02:30, nightly","inputs":["a_fares","arrivals"],"outputs":["a_totals"],"detail":{"grain":"tap → from-operator × route × date × 3-hour band","joins":["the region's public arrivals, read in place by grant: arrivals.operator_name = from_operator_name and the tap's stop_id in arrivals.shared_with[] for this party, within the hour before the tap"],"filters":["from_operator_id not null and not the agency's own (within-agency transfers are counted at home, not sent)","trx_status accepted","rows with fewer than 5 distinct card_hash dropped before the file is written (decision 26)"],"dedup":["one card counted once per cell, by card_hash"],"nulls":["a tap with no stop has no wait; the wait columns are null when fewer than half the cell's taps found an arrival","a from-operator with no public arrivals (not on PRESTO, or feed-only) shows unknown waits, never an estimate (decision 37)"],"units":["waits in minutes, median and share over 15; the band is the tap hour floored to 3"],"privacy":["small-cell suppression at 5 distinct cards; in the sample 28% of 1,352 cells but 1.1% of transfers fall under it","no card, no tap, no stop leaves: the row is a count and two statistics"],"key":"the agency's, then its key on the file"},"columns":[{"out":"a_totals.party_id","expr":"the agency's own party id, from its adapter configuration","from":[],"rule":"constant"},{"out":"a_totals.service_date","expr":"service_date","from":["a_fares.service_date"],"rule":"copy"},{"out":"a_totals.from_operator","expr":"from_operator_name","from":["a_fares.from_operator_name"],"rule":"copy"},{"out":"a_totals.to_route","expr":"route_id","from":["a_fares.route_id"],"rule":"copy"},{"out":"a_totals.time_band","expr":"floor(hour(event_timestamp) / 3) × 3, as 'HH:00–HH:00'","from":["a_fares.event_timestamp"],"rule":"derive"},{"out":"a_totals.transfers","expr":"count(distinct card_hash); the row dropped under 5","from":["a_fares.card_hash"],"rule":"aggregate"},{"out":"a_totals.median_wait_min","expr":"median(event_timestamp − max(arrivals.actual_arrival_time) at the crosswalked stop by the from-operator in the hour before) / 60","from":["a_fares.event_timestamp","a_fares.stop_id","a_fares.from_operator_name","arrivals.actual_arrival_time","arrivals.operator_name","arrivals.shared_with[].party","arrivals.shared_with[].stop_id","arrivals.stop_id"],"rule":"aggregate"},{"out":"a_totals.share_wait_over_15","expr":"mean(wait > 15 min) over the cell's taps with a wait","from":["a_fares.event_timestamp","arrivals.actual_arrival_time"],"rule":"aggregate"}],"drops":[],"source_id":"offline:T3","path":"offline"},{"id":"T8","name":"Push the nightly file to the region's inbox","short":"Push the file","lane":"agency","col":3.5,"row":2,"service":"the adapter, in the agency's account; S3 copy with SSE-KMS","when":"by 06:00","inputs":["a_totals"],"outputs":["inbox"],"detail":{"grain":"unchanged: the contract's rows, one file per service day","joins":["the registry must hold an active transfer-totals contract for the party"],"filters":["only the service day just ended","no row under 5 cards is in the file: the check at the region refuses the file otherwise"],"dedup":["a file sent twice replaces the first (same object key)"],"nulls":["unchanged"],"units":["unchanged"],"privacy":["the contract's privacy clause, already applied at home"],"key":"the agency's KMS key on the object (SSE-KMS); the region holds a revocable grant (decision 41)"},"columns":[{"out":"inbox.party_id","expr":"the folder the adapter writes to, which only its party's role may","from":[],"rule":"generate"},{"out":"inbox.service_date","expr":"from the file name","from":["a_totals.service_date"],"rule":"derive"},{"out":"inbox.object_key","expr":"party_id/service_date/transfer-totals-v1.parquet","from":["a_totals.party_id","a_totals.service_date"],"rule":"derive"},{"out":"inbox.received_at","expr":"now(), at the region","from":[],"rule":"generate"},{"out":"inbox.key_arn","expr":"the agency's key, from the object's encryption header","from":[],"rule":"generate"},{"out":"inbox.rows","expr":"count(*)","from":["a_totals.transfers"],"rule":"aggregate"},{"out":"inbox.row.party_id","expr":"party_id","from":["a_totals.party_id"],"rule":"copy"},{"out":"inbox.row.service_date","expr":"service_date","from":["a_totals.service_date"],"rule":"copy"},{"out":"inbox.row.from_operator","expr":"from_operator","from":["a_totals.from_operator"],"rule":"copy"},{"out":"inbox.row.to_route","expr":"to_route","from":["a_totals.to_route"],"rule":"copy"},{"out":"inbox.row.time_band","expr":"time_band","from":["a_totals.time_band"],"rule":"copy"},{"out":"inbox.row.transfers","expr":"transfers","from":["a_totals.transfers"],"rule":"copy"},{"out":"inbox.row.median_wait_min","expr":"median_wait_min","from":["a_totals.median_wait_min"],"rule":"copy"},{"out":"inbox.row.share_wait_over_15","expr":"share_wait_over_15","from":["a_totals.share_wait_over_15"],"rule":"copy"}],"drops":[],"source_id":"offline:T4","path":"offline"},{"id":"T9","name":"Poll every registered party's live feed into the lane and the archive","short":"Poll feeds","lane":"region","col":0.5,"row":"gap","service":"ECS on Fargate · poller; Data Firehose writes the archive","when":"every 10 s; the archive batched within 5 minutes","inputs":["rt","registry"],"outputs":["lane","archive"],"detail":{"grain":"one VehiclePosition entity → one lane record and one archive row; one stop of a TripUpdate → one archive row (positions only on the lane in v1)","joins":["registry.parties.feed_url_rt names the feed; the party id comes with it"],"filters":["only parties with status joined; a leaver is not watched (decision 54)","TripUpdate and Alert entities are read for the archive's deviation and the alert label, not written to the lane in v1","only parties with status joined"],"dedup":["a position with the same vehicle and timestamp as the last one polled is dropped (a repeated feed), so a frozen vehicle is one that moves in time but not in place","a position with the same vehicle and timestamp as the last one polled is dropped"],"nulls":["fields a party does not publish stay null; occupancy is optional","fields a party does not publish stay null"],"units":["GTFS-Realtime's: WGS-84 degrees, m/s, metres, epoch seconds","GTFS-Realtime's: WGS-84 degrees, epoch seconds"],"privacy":["public data"],"key":"the region's; the archive split by party so a leaver's part is one prefix delete"},"columns":[{"out":"lane.party_id","expr":"parties.party_id of the feed polled","from":["registry.parties.party_id","registry.parties.feed_url_rt"],"rule":"join"},{"out":"lane.record_kind","expr":"'position'","from":[],"rule":"constant"},{"out":"lane.sequence_number","expr":"assigned by the stream","from":[],"rule":"generate"},{"out":"lane.arrived_at","expr":"now()","from":[],"rule":"generate"},{"out":"lane.pos.vehicle_id","expr":"vp.vehicle.id","from":["rt.vp.vehicle.id"],"rule":"copy"},{"out":"lane.pos.trip_id","expr":"vp.trip.trip_id","from":["rt.vp.trip.trip_id"],"rule":"copy"},{"out":"lane.pos.route_id","expr":"vp.trip.route_id","from":["rt.vp.trip.route_id"],"rule":"copy"},{"out":"lane.pos.direction_id","expr":"vp.trip.direction_id","from":["rt.vp.trip.direction_id"],"rule":"copy"},{"out":"lane.pos.start_date","expr":"vp.trip.start_date","from":["rt.vp.trip.start_date"],"rule":"copy"},{"out":"lane.pos.schedule_relationship","expr":"vp.trip.schedule_relationship","from":["rt.vp.trip.schedule_relationship"],"rule":"copy"},{"out":"lane.pos.latitude","expr":"vp.position.latitude","from":["rt.vp.position.latitude"],"rule":"copy"},{"out":"lane.pos.longitude","expr":"vp.position.longitude","from":["rt.vp.position.longitude"],"rule":"copy"},{"out":"lane.pos.bearing","expr":"vp.position.bearing","from":["rt.vp.position.bearing"],"rule":"copy"},{"out":"lane.pos.speed","expr":"vp.position.speed","from":["rt.vp.position.speed"],"rule":"copy"},{"out":"lane.pos.odometer","expr":"vp.position.odometer","from":["rt.vp.position.odometer"],"rule":"copy"},{"out":"lane.pos.stop_id","expr":"vp.stop_id","from":["rt.vp.stop_id"],"rule":"copy"},{"out":"lane.pos.current_stop_sequence","expr":"vp.current_stop_sequence","from":["rt.vp.current_stop_sequence"],"rule":"copy"},{"out":"lane.pos.current_status","expr":"vp.current_status","from":["rt.vp.current_status"],"rule":"copy"},{"out":"lane.pos.occupancy_status","expr":"vp.occupancy_status","from":["rt.vp.occupancy_status"],"rule":"copy"},{"out":"lane.pos.timestamp","expr":"vp.timestamp, else header.timestamp","from":["rt.vp.timestamp","rt.header.timestamp"],"rule":"derive"},{"out":"archive.party_id","expr":"parties.party_id of the feed polled","from":["registry.parties.party_id","registry.parties.feed_url_rt"],"rule":"join"},{"out":"archive.record_kind","expr":"'position' for a VehiclePosition, 'trip_update' for a TripUpdate stop","from":["rt.vp.entity_id","rt.tu.trip.trip_id"],"rule":"derive"},{"out":"archive.polled_at","expr":"now()","from":[],"rule":"generate"},{"out":"archive.pos.vehicle_id","expr":"vp.vehicle.id","from":["rt.vp.vehicle.id"],"rule":"copy"},{"out":"archive.pos.trip_id","expr":"vp.trip.trip_id","from":["rt.vp.trip.trip_id"],"rule":"copy"},{"out":"archive.pos.route_id","expr":"vp.trip.route_id","from":["rt.vp.trip.route_id"],"rule":"copy"},{"out":"archive.pos.direction_id","expr":"vp.trip.direction_id","from":["rt.vp.trip.direction_id"],"rule":"copy"},{"out":"archive.pos.start_date","expr":"vp.trip.start_date","from":["rt.vp.trip.start_date"],"rule":"copy"},{"out":"archive.pos.latitude","expr":"vp.position.latitude","from":["rt.vp.position.latitude"],"rule":"copy"},{"out":"archive.pos.longitude","expr":"vp.position.longitude","from":["rt.vp.position.longitude"],"rule":"copy"},{"out":"archive.pos.current_stop_sequence","expr":"vp.current_stop_sequence","from":["rt.vp.current_stop_sequence"],"rule":"copy"},{"out":"archive.pos.stop_id","expr":"vp.stop_id","from":["rt.vp.stop_id"],"rule":"copy"},{"out":"archive.pos.current_status","expr":"vp.current_status","from":["rt.vp.current_status"],"rule":"copy"},{"out":"archive.pos.timestamp","expr":"vp.timestamp, else header.timestamp","from":["rt.vp.timestamp","rt.header.timestamp"],"rule":"derive"},{"out":"archive.tu.trip_id","expr":"tu.trip.trip_id","from":["rt.tu.trip.trip_id"],"rule":"copy"},{"out":"archive.tu.route_id","expr":"tu.trip.route_id","from":["rt.tu.trip.route_id"],"rule":"copy"},{"out":"archive.tu.start_date","expr":"tu.trip.start_date","from":["rt.tu.trip.start_date"],"rule":"copy"},{"out":"archive.tu.vehicle_id","expr":"tu.vehicle.id","from":["rt.tu.vehicle.id"],"rule":"copy"},{"out":"archive.tu.stop_sequence","expr":"tu.stop_time_update.stop_sequence","from":["rt.tu.stop_time_update.stop_sequence"],"rule":"copy"},{"out":"archive.tu.stop_id","expr":"tu.stop_time_update.stop_id","from":["rt.tu.stop_time_update.stop_id"],"rule":"copy"},{"out":"archive.tu.arrival_time","expr":"tu.stop_time_update.arrival.time","from":["rt.tu.stop_time_update.arrival.time"],"rule":"copy"},{"out":"archive.tu.departure_time","expr":"tu.stop_time_update.departure.time","from":["rt.tu.stop_time_update.departure.time"],"rule":"copy"},{"out":"archive.tu.schedule_relationship","expr":"tu.stop_time_update.schedule_relationship","from":["rt.tu.stop_time_update.schedule_relationship"],"rule":"copy"},{"out":"archive.tu.timestamp","expr":"tu.timestamp","from":["rt.tu.timestamp"],"rule":"copy"}],"drops":[],"source_id":"both:poll","path":"both"},{"id":"T10","name":"Fetch each party's timetable when it changes","short":"Fetch timetables","lane":"region","col":1.5,"row":"gap","service":"ECS on Fargate · poller","when":"when the published zip changes (its hash)","inputs":["gtfs","registry"],"outputs":["timetables"],"detail":{"grain":"unchanged: GTFS file by file","joins":["registry.parties.feed_url_gtfs names the zip; the party id comes with it"],"filters":["only parties with status joined"],"dedup":["a zip with a hash already stored is not stored again"],"nulls":["optional GTFS columns stay empty as published"],"units":["GTFS's: HH:MM:SS past 24:00 after midnight; YYYYMMDD"],"privacy":["public data"],"key":"the region's"},"columns":[{"out":"timetables.party_id","expr":"parties.party_id of the feed fetched","from":["registry.parties.party_id","registry.parties.feed_url_gtfs"],"rule":"join"},{"out":"timetables.feed_version","expr":"feed_info.feed_version, else sha256(zip)","from":["gtfs.feed_info.feed_version"],"rule":"derive"},{"out":"timetables.fetched_at","expr":"now()","from":[],"rule":"generate"},{"out":"timetables.agency.agency_id","expr":"agency.agency_id","from":["gtfs.agency.agency_id"],"rule":"copy"},{"out":"timetables.agency.agency_name","expr":"agency.agency_name","from":["gtfs.agency.agency_name"],"rule":"copy"},{"out":"timetables.agency.agency_timezone","expr":"agency.agency_timezone","from":["gtfs.agency.agency_timezone"],"rule":"copy"},{"out":"timetables.stops.stop_id","expr":"stops.stop_id","from":["gtfs.stops.stop_id"],"rule":"copy"},{"out":"timetables.stops.stop_code","expr":"stops.stop_code","from":["gtfs.stops.stop_code"],"rule":"copy"},{"out":"timetables.stops.stop_name","expr":"stops.stop_name","from":["gtfs.stops.stop_name"],"rule":"copy"},{"out":"timetables.stops.stop_lat","expr":"stops.stop_lat","from":["gtfs.stops.stop_lat"],"rule":"copy"},{"out":"timetables.stops.stop_lon","expr":"stops.stop_lon","from":["gtfs.stops.stop_lon"],"rule":"copy"},{"out":"timetables.stops.location_type","expr":"stops.location_type","from":["gtfs.stops.location_type"],"rule":"copy"},{"out":"timetables.stops.parent_station","expr":"stops.parent_station","from":["gtfs.stops.parent_station"],"rule":"copy"},{"out":"timetables.routes.route_id","expr":"routes.route_id","from":["gtfs.routes.route_id"],"rule":"copy"},{"out":"timetables.routes.agency_id","expr":"routes.agency_id","from":["gtfs.routes.agency_id"],"rule":"copy"},{"out":"timetables.routes.route_short_name","expr":"routes.route_short_name","from":["gtfs.routes.route_short_name"],"rule":"copy"},{"out":"timetables.routes.route_long_name","expr":"routes.route_long_name","from":["gtfs.routes.route_long_name"],"rule":"copy"},{"out":"timetables.routes.route_type","expr":"routes.route_type","from":["gtfs.routes.route_type"],"rule":"copy"},{"out":"timetables.trips.route_id","expr":"trips.route_id","from":["gtfs.trips.route_id"],"rule":"copy"},{"out":"timetables.trips.service_id","expr":"trips.service_id","from":["gtfs.trips.service_id"],"rule":"copy"},{"out":"timetables.trips.trip_id","expr":"trips.trip_id","from":["gtfs.trips.trip_id"],"rule":"copy"},{"out":"timetables.trips.trip_headsign","expr":"trips.trip_headsign","from":["gtfs.trips.trip_headsign"],"rule":"copy"},{"out":"timetables.trips.direction_id","expr":"trips.direction_id","from":["gtfs.trips.direction_id"],"rule":"copy"},{"out":"timetables.trips.block_id","expr":"trips.block_id","from":["gtfs.trips.block_id"],"rule":"copy"},{"out":"timetables.trips.shape_id","expr":"trips.shape_id","from":["gtfs.trips.shape_id"],"rule":"copy"},{"out":"timetables.stop_times.trip_id","expr":"stop_times.trip_id","from":["gtfs.stop_times.trip_id"],"rule":"copy"},{"out":"timetables.stop_times.arrival_time","expr":"stop_times.arrival_time","from":["gtfs.stop_times.arrival_time"],"rule":"copy"},{"out":"timetables.stop_times.departure_time","expr":"stop_times.departure_time","from":["gtfs.stop_times.departure_time"],"rule":"copy"},{"out":"timetables.stop_times.stop_id","expr":"stop_times.stop_id","from":["gtfs.stop_times.stop_id"],"rule":"copy"},{"out":"timetables.stop_times.stop_sequence","expr":"stop_times.stop_sequence","from":["gtfs.stop_times.stop_sequence"],"rule":"copy"},{"out":"timetables.stop_times.timepoint","expr":"stop_times.timepoint","from":["gtfs.stop_times.timepoint"],"rule":"copy"},{"out":"timetables.calendar_dates.service_id","expr":"calendar_dates.service_id","from":["gtfs.calendar_dates.service_id"],"rule":"copy"},{"out":"timetables.calendar_dates.date","expr":"calendar_dates.date","from":["gtfs.calendar_dates.date"],"rule":"copy"},{"out":"timetables.calendar_dates.exception_type","expr":"calendar_dates.exception_type","from":["gtfs.calendar_dates.exception_type"],"rule":"copy"},{"out":"timetables.shapes.shape_id","expr":"shapes.shape_id","from":["gtfs.shapes.shape_id"],"rule":"copy"},{"out":"timetables.shapes.shape_pt_lat","expr":"shapes.shape_pt_lat","from":["gtfs.shapes.shape_pt_lat"],"rule":"copy"},{"out":"timetables.shapes.shape_pt_lon","expr":"shapes.shape_pt_lon","from":["gtfs.shapes.shape_pt_lon"],"rule":"copy"},{"out":"timetables.shapes.shape_pt_sequence","expr":"shapes.shape_pt_sequence","from":["gtfs.shapes.shape_pt_sequence"],"rule":"copy"},{"out":"timetables.feed_info.feed_publisher_name","expr":"feed_info.feed_publisher_name","from":["gtfs.feed_info.feed_publisher_name"],"rule":"copy"},{"out":"timetables.feed_info.feed_version","expr":"feed_info.feed_version","from":["gtfs.feed_info.feed_version"],"rule":"copy"},{"out":"timetables.feed_info.feed_start_date","expr":"feed_info.feed_start_date","from":["gtfs.feed_info.feed_start_date"],"rule":"copy"},{"out":"timetables.feed_info.feed_end_date","expr":"feed_info.feed_end_date","from":["gtfs.feed_info.feed_end_date"],"rule":"copy"}],"drops":[],"source_id":"online:T6","path":"online"},{"id":"T11","name":"Archive the lane as TIDES vehicle_locations","short":"Archive lane","lane":"region","col":1.5,"row":0,"service":"Data Firehose → S3 + Iceberg","when":"batched, within 5 minutes","inputs":["lane"],"outputs":["vl_archive"],"detail":{"grain":"one position record → one row","joins":["none"],"filters":["record_kind = position; whether loads are archived too is open (decision 56)"],"dedup":["location_ping_id unique: a replayed shard writes no second row"],"nulls":["a missing start_date takes the service day of the timestamp, 04:00 rule"],"units":["epoch seconds → UTC timestamps; bearing → heading in degrees; speed stays m/s"],"privacy":["public positions; no rider"],"key":"the region's; split by party so a leaver's part is one prefix delete"},"columns":[{"out":"vl_archive.location_ping_id","expr":"sha1(party_id, pos.vehicle_id, pos.timestamp)","from":["lane.party_id","lane.pos.vehicle_id","lane.pos.timestamp"],"rule":"generate"},{"out":"vl_archive.service_date","expr":"pos.start_date, else the service day of pos.timestamp","from":["lane.pos.start_date","lane.pos.timestamp"],"rule":"derive"},{"out":"vl_archive.event_timestamp","expr":"to_timestamp(pos.timestamp)","from":["lane.pos.timestamp"],"rule":"derive"},{"out":"vl_archive.trip_id_performed","expr":"pos.trip_id","from":["lane.pos.trip_id"],"rule":"copy"},{"out":"vl_archive.trip_id_scheduled","expr":"pos.trip_id (the feed names the timetable trip)","from":["lane.pos.trip_id"],"rule":"copy"},{"out":"vl_archive.scheduled_stop_sequence","expr":"pos.current_stop_sequence","from":["lane.pos.current_stop_sequence"],"rule":"copy"},{"out":"vl_archive.vehicle_id","expr":"pos.vehicle_id","from":["lane.pos.vehicle_id"],"rule":"copy"},{"out":"vl_archive.stop_id","expr":"pos.stop_id","from":["lane.pos.stop_id"],"rule":"copy"},{"out":"vl_archive.current_status","expr":"pos.current_status","from":["lane.pos.current_status"],"rule":"copy"},{"out":"vl_archive.latitude","expr":"pos.latitude","from":["lane.pos.latitude"],"rule":"copy"},{"out":"vl_archive.longitude","expr":"pos.longitude","from":["lane.pos.longitude"],"rule":"copy"},{"out":"vl_archive.heading","expr":"pos.bearing","from":["lane.pos.bearing"],"rule":"copy"},{"out":"vl_archive.speed","expr":"pos.speed","from":["lane.pos.speed"],"rule":"copy"},{"out":"vl_archive.odometer","expr":"pos.odometer","from":["lane.pos.odometer"],"rule":"copy"},{"out":"vl_archive.schedule_relationship","expr":"pos.schedule_relationship","from":["lane.pos.schedule_relationship"],"rule":"copy"},{"out":"vl_archive.party_id","expr":"party_id","from":["lane.party_id"],"rule":"copy"},{"out":"vl_archive.route_id","expr":"pos.route_id","from":["lane.pos.route_id"],"rule":"copy"},{"out":"vl_archive.direction_id","expr":"pos.direction_id","from":["lane.pos.direction_id"],"rule":"copy"},{"out":"vl_archive.occupancy_status","expr":"pos.occupancy_status","from":["lane.pos.occupancy_status"],"rule":"copy"}],"drops":[],"source_id":"online:T7","path":"online"},{"id":"T12","name":"Derive the arrival at each stop; attach the stop crosswalk","short":"Derive arrivals","lane":"region","col":1.5,"row":2,"service":"Glue ETL · derive arrivals (or Databricks)","when":"nightly, 01:00, for the service day ended","inputs":["archive","registry"],"outputs":["arrivals"],"detail":{"grain":"positions and trip-update stops of one vehicle on one trip → one row per stop it served","joins":["positions and trip updates of the same party, trip and service day","registry.shared_stops on (party_id, stop_id) for the crosswalk","registry.parties for the PRESTO operator name"],"filters":["a stop with no position at it and no trip update for it is not written: no interpolation beyond one stop either side"],"dedup":["one row per party, service day, trip and stop sequence: the earliest STOPPED_AT position wins over the trip update, which wins over interpolation"],"nulls":["departure null when the vehicle was seen at the stop once"],"units":["epoch seconds → UTC timestamps"],"privacy":["public positions; no rider"],"key":"the region's; each agency reads it in place through a Lake Formation grant (decision 49)"},"columns":[{"out":"arrivals.party_id","expr":"party_id","from":["archive.party_id"],"rule":"copy"},{"out":"arrivals.operator_name","expr":"parties.presto_operator_name of party_id","from":["registry.parties.party_id","registry.parties.presto_operator_name"],"rule":"join"},{"out":"arrivals.service_date","expr":"pos.start_date, or tu.start_date","from":["archive.pos.start_date","archive.tu.start_date"],"rule":"derive"},{"out":"arrivals.trip_id_performed","expr":"pos.trip_id, or tu.trip_id","from":["archive.pos.trip_id","archive.tu.trip_id"],"rule":"derive"},{"out":"arrivals.trip_stop_sequence","expr":"rank of the stop within the trip's stops seen (1, 2, 3)","from":["archive.pos.current_stop_sequence","archive.tu.stop_sequence"],"rule":"derive"},{"out":"arrivals.stop_id","expr":"pos.stop_id where current_status = STOPPED_AT, or tu.stop_id","from":["archive.pos.stop_id","archive.pos.current_status","archive.tu.stop_id"],"rule":"derive"},{"out":"arrivals.route_id","expr":"pos.route_id, or tu.route_id","from":["archive.pos.route_id","archive.tu.route_id"],"rule":"derive"},{"out":"arrivals.vehicle_id","expr":"pos.vehicle_id, or tu.vehicle_id","from":["archive.pos.vehicle_id","archive.tu.vehicle_id"],"rule":"derive"},{"out":"arrivals.actual_arrival_time","expr":"min(pos.timestamp) while STOPPED_AT at the stop; else tu.arrival_time once past; else interpolated between the positions either side","from":["archive.pos.timestamp","archive.pos.current_status","archive.tu.arrival_time","archive.pos.latitude","archive.pos.longitude"],"rule":"aggregate"},{"out":"arrivals.actual_departure_time","expr":"max(pos.timestamp) while STOPPED_AT at the stop; else tu.departure_time","from":["archive.pos.timestamp","archive.pos.current_status","archive.tu.departure_time"],"rule":"aggregate"},{"out":"arrivals.source","expr":"'stopped_at', 'trip_update' or 'interpolated' by which rule gave the arrival","from":["archive.pos.current_status","archive.tu.arrival_time"],"rule":"derive"},{"out":"arrivals.shared_with","expr":"one entry per shared_stops row for (party_id, stop_id)","from":["registry.shared_stops.party_id","registry.shared_stops.stop_id"],"rule":"join"},{"out":"arrivals.shared_with[].party","expr":"shared_stops.neighbour_party","from":["registry.shared_stops.neighbour_party"],"rule":"copy"},{"out":"arrivals.shared_with[].stop_id","expr":"shared_stops.neighbour_stop_id","from":["registry.shared_stops.neighbour_stop_id"],"rule":"copy"}],"drops":[],"source_id":"offline:T6","path":"offline"},{"id":"T13","name":"Keep the last state per vehicle and counter; run the rules","short":"Rules → last state","lane":"region","col":2.5,"row":0,"service":"Lambda · rules","when":"on every record; rules checked each minute","inputs":["lane"],"outputs":["state"],"detail":{"grain":"one record → one item overwritten: per vehicle for positions, per route and stop for loads","joins":["the item read before it is written: the rules compare new against last"],"filters":["feed gap: no record from a party for 60 s while the heartbeat says the poller is alive","frozen: a vehicle on a trip whose moved_at is older than a threshold (proposed 10 minutes)","jump: the last move faster than a bus can go (proposed 40 m/s)","dead counter: a route and stop with nobody counted for a run of windows (proposed 36, three hours) while vehicles passed","loads late or off-contract: last_window older than 2 windows for a party under contract"],"dedup":["a record older than the item's last_seen is ignored"],"nulls":["a party not sharing loads has no counter items: crowding shows unknown"],"units":["metres and seconds for the thresholds; the thresholds are parameters to tune, not decided"],"privacy":["a vehicle as its own feed names it; no rider"],"key":"the region's; expires a day after the last sighting"},"columns":[{"out":"state.pk","expr":"party_id","from":["lane.party_id"],"rule":"copy"},{"out":"state.sk","expr":"'V#' || pos.vehicle_id, or 'C#' || load.route_id || '#' || load.stop_id","from":["lane.pos.vehicle_id","lane.load.route_id","lane.load.stop_id"],"rule":"derive"},{"out":"state.kind","expr":"'vehicle' for a position record, 'counter' for a load record","from":["lane.record_kind"],"rule":"derive"},{"out":"state.last_seen","expr":"to_timestamp(pos.timestamp)","from":["lane.pos.timestamp"],"rule":"derive"},{"out":"state.latitude","expr":"pos.latitude","from":["lane.pos.latitude"],"rule":"copy"},{"out":"state.longitude","expr":"pos.longitude","from":["lane.pos.longitude"],"rule":"copy"},{"out":"state.stop_id","expr":"pos.stop_id","from":["lane.pos.stop_id"],"rule":"copy"},{"out":"state.trip_id","expr":"pos.trip_id","from":["lane.pos.trip_id"],"rule":"copy"},{"out":"state.route_id","expr":"pos.route_id","from":["lane.pos.route_id"],"rule":"copy"},{"out":"state.direction_id","expr":"pos.direction_id","from":["lane.pos.direction_id"],"rule":"copy"},{"out":"state.moved_at","expr":"last_seen if distance(new position, last position) > 25 m, else the previous moved_at","from":["lane.pos.latitude","lane.pos.longitude","lane.pos.timestamp"],"rule":"derive"},{"out":"state.jump","expr":"distance(new, last) / (new timestamp − last_seen) > 40 m/s","from":["lane.pos.latitude","lane.pos.longitude","lane.pos.timestamp"],"rule":"derive"},{"out":"state.last_window","expr":"load.window_start","from":["lane.load.window_start"],"rule":"copy"},{"out":"state.last_nonzero_window","expr":"load.window_start if load.boardings + load.alightings > 0, else the previous value","from":["lane.load.window_start","lane.load.boardings","lane.load.alightings"],"rule":"derive"},{"out":"state.zero_windows","expr":"previous + 1 if load.boardings + load.alightings = 0, else 0","from":["lane.load.boardings","lane.load.alightings"],"rule":"derive"},{"out":"state.expires_at","expr":"last_seen + 24 h (the table's time-to-live)","from":["lane.pos.timestamp"],"rule":"derive"}],"drops":[],"source_id":"online:T8","path":"online"},{"id":"T14","name":"Match each position to its timetable; one delay and load value per route per window","short":"Match to timetable","lane":"region","col":2.5,"row":1,"service":"Lambda · delay and load","when":"every 5 minutes","inputs":["lane","timetables"],"outputs":["metrics"],"detail":{"grain":"positions and load rows → route × direction × 5-minute window, one value per metric","joins":["lane.pos.trip_id = timetables.trips.trip_id and pos.current_stop_sequence = stop_times.stop_sequence, in the party's feed version in force on service_date","the scheduled time is stop_times.arrival_time on pos.start_date (past 24:00 rolls over)"],"filters":["a window with fewer than 3 vehicles or stops gets no value, so the detector shows unknown, never normal (96% of 247,241 route-windows hold three or more visits in the sample)","a party not sharing loads gets no on_board series"],"dedup":["one value per series per window; a late record for a closed window is dropped"],"nulls":["no value is written for an empty window"],"units":["delay in minutes, late positive; on_board in people"],"privacy":["route-level values; no vehicle, no rider"],"key":"the region's; CloudWatch keeps 63 days"},"columns":[{"out":"metrics.namespace","expr":"'Region/Service'","from":[],"rule":"constant"},{"out":"metrics.metric_name","expr":"'delay_min' for positions, 'on_board' for load rows","from":["lane.record_kind"],"rule":"derive"},{"out":"metrics.party_id","expr":"party_id","from":["lane.party_id"],"rule":"copy"},{"out":"metrics.route_id","expr":"pos.route_id, or load.route_id","from":["lane.pos.route_id","lane.load.route_id"],"rule":"derive"},{"out":"metrics.direction_id","expr":"pos.direction_id, or load.direction_id","from":["lane.pos.direction_id","lane.load.direction_id"],"rule":"derive"},{"out":"metrics.timestamp","expr":"floor(pos.timestamp, 5 min), or load.window_start","from":["lane.pos.timestamp","lane.load.window_start"],"rule":"derive"},{"out":"metrics.value","expr":"median over the window's vehicles of (pos.timestamp − (start_date + stop_times.arrival_time at current_stop_sequence)) / 60; or mean(load.on_board) over the window's stops","from":["lane.pos.timestamp","lane.pos.start_date","lane.pos.trip_id","lane.pos.current_stop_sequence","timetables.trips.trip_id","timetables.stop_times.trip_id","timetables.stop_times.stop_sequence","timetables.stop_times.arrival_time","lane.load.on_board"],"rule":"aggregate"},{"out":"metrics.sample_count","expr":"count of vehicles, or of stops, in the window","from":["lane.pos.vehicle_id","lane.load.stop_id"],"rule":"aggregate"},{"out":"metrics.unit","expr":"'Count'","from":[],"rule":"constant"},{"out":"metrics.expected_low","expr":"CloudWatch anomaly detection, from two weeks of this series","from":[],"rule":"generate"},{"out":"metrics.expected_high","expr":"CloudWatch anomaly detection, from two weeks of this series","from":[],"rule":"generate"}],"drops":[],"source_id":"online:T9","path":"online"},{"id":"T15","name":"Check each file against its contract","short":"Check the file","lane":"region","col":1.5,"row":3,"service":"Lambda · contract check, on the file-arrived event","when":"as each file lands; the alarm at 06:00","inputs":["inbox","registry"],"outputs":["rejects"],"detail":{"grain":"one file → accepted (nothing written here) or one rejection","joins":["registry.contracts for the party's active transfer-totals contract and its terms","registry.parties.key_arn against the object's key"],"filters":["shape: the columns and types the contract names, nothing more","deadline: received_at before 06:00","privacy rule: no row with transfers under 5","key: the object is encrypted with the party's registered key","an active contract exists"],"dedup":["a file replaced after a rejection is checked again; the earlier message stays until it expires"],"nulls":["a null transfers value is a shape failure: the agency sends counts or nothing"],"units":["none"],"privacy":["the check reads counts; it never sees a tap"],"key":"the region's on the message; the file stays under the agency's"},"columns":[{"out":"rejects.party_id","expr":"inbox.party_id","from":["inbox.party_id"],"rule":"copy"},{"out":"rejects.service_date","expr":"inbox.service_date","from":["inbox.service_date"],"rule":"copy"},{"out":"rejects.object_key","expr":"inbox.object_key","from":["inbox.object_key"],"rule":"copy"},{"out":"rejects.reason","expr":"the first check that failed: shape, deadline, privacy_rule, wrong_key, no_contract","from":["inbox.row.transfers","inbox.received_at","inbox.key_arn","registry.contracts.terms","registry.contracts.deadline","registry.contracts.status","registry.parties.key_arn"],"rule":"derive"},{"out":"rejects.detail","expr":"which column, which row count, which key","from":["inbox.rows","inbox.row.transfers","inbox.key_arn"],"rule":"derive"},{"out":"rejects.checked_at","expr":"now()","from":[],"rule":"generate"},{"out":"rejects.notified_at","expr":"when the agency's bus took the message; the path back is still open","from":[],"rule":"generate"}],"drops":[],"source_id":"offline:T7","path":"offline"},{"id":"T16","name":"Add the accepted files up into the regional table","short":"Add up","lane":"region","col":2.5,"row":2,"service":"Glue ETL · add up (or Databricks)","when":"06:30, with what has landed","inputs":["inbox","registry"],"outputs":["regional"],"detail":{"grain":"unchanged rows, with the from-operator resolved to a party id; one unknown row per missing party and band","joins":["registry.parties.presto_operator_name = row.from_operator → from_party","registry.parties with status joined and an active contract: the parties expected tonight"],"filters":["only files T7 accepted","a party whose file is missing at 06:30 gets rows with status unknown and null counts, never zero (decision 50)"],"dedup":["one row per key; a file re-sent after 06:30 replaces its party's rows at the next run"],"nulls":["from_party 'unknown' for an operator name the registry does not hold (a party not on PRESTO is never named on a tap anyway)"],"units":["unchanged"],"privacy":["rows arrive already suppressed; the region adds, it never disaggregates"],"key":"each agency's rows stay under its own key, read through the grant (decision 41); revoke it and they go dark"},"columns":[{"out":"regional.party_id","expr":"row.party_id (checked against the folder)","from":["inbox.row.party_id","inbox.party_id"],"rule":"copy"},{"out":"regional.from_party","expr":"parties.party_id where presto_operator_name = row.from_operator; else 'unknown'","from":["inbox.row.from_operator","registry.parties.presto_operator_name","registry.parties.party_id"],"rule":"join"},{"out":"regional.service_date","expr":"row.service_date","from":["inbox.row.service_date"],"rule":"copy"},{"out":"regional.to_route","expr":"row.to_route","from":["inbox.row.to_route"],"rule":"copy"},{"out":"regional.time_band","expr":"row.time_band","from":["inbox.row.time_band"],"rule":"copy"},{"out":"regional.transfers","expr":"row.transfers; null for an unknown row","from":["inbox.row.transfers"],"rule":"copy"},{"out":"regional.median_wait_min","expr":"row.median_wait_min","from":["inbox.row.median_wait_min"],"rule":"copy"},{"out":"regional.share_wait_over_15","expr":"row.share_wait_over_15","from":["inbox.row.share_wait_over_15"],"rule":"copy"},{"out":"regional.status","expr":"'reported', or 'unknown' when the party's file was late or missing","from":["inbox.received_at","registry.parties.status"],"rule":"derive"},{"out":"regional.contract_version","expr":"contracts.version the file was checked against","from":["registry.contracts.version"],"rule":"join"},{"out":"regional.loaded_at","expr":"now()","from":[],"rule":"generate"}],"drops":[],"source_id":"offline:T8","path":"offline"},{"id":"T17","name":"Build who is affected from shared stops and transfer totals","short":"Who is affected","lane":"region","col":2.5,"row":3,"service":"Athena, nightly → DynamoDB","when":"nightly, after the transfer totals land","inputs":["regional","registry","timetables"],"outputs":["affects"],"detail":{"grain":"shared stop pair × neighbour's route × band → one item per party, route and stop, with a list of neighbours","joins":["registry.shared_stops gives (party, stop) ↔ (neighbour, neighbour_stop)","regional transfer rows where totals.party_id = neighbour and totals.from_party = party give who changes there, by the neighbour's route and band","the neighbour's timetables (stop_times, trips) say which of its routes serve neighbour_stop_id; the party's say which of its routes serve the stop"],"filters":["totals of the last four weeks, status reported only: an unknown row (file late or missing) is not a zero","a neighbour with no totals is not named: no transfer totals, no neighbour named"],"dedup":["one item per party, route and stop; replaced whole each night"],"nulls":["an empty neighbours list means unknown, not nobody"],"units":["transfers a day per band; share as a fraction"],"privacy":["the totals are already suppressed under 5 cards at home (decision 26); the item names parties and routes, never a rider"],"key":"built under each agency's key by grant: revoke it and that agency drops out at the next rebuild"},"columns":[{"out":"affects.pk","expr":"shared_stops.party_id","from":["registry.shared_stops.party_id"],"rule":"copy"},{"out":"affects.sk","expr":"route_id || '#' || shared_stops.stop_id, for each of the party's routes serving the stop","from":["registry.shared_stops.stop_id","timetables.stop_times.stop_id","timetables.stop_times.trip_id","timetables.trips.trip_id","timetables.trips.route_id"],"rule":"join"},{"out":"affects.neighbours","expr":"one entry per (neighbour, to_route, band) with totals","from":["registry.shared_stops.neighbour_party"],"rule":"aggregate"},{"out":"affects.neighbours[].party","expr":"shared_stops.neighbour_party","from":["registry.shared_stops.neighbour_party"],"rule":"copy"},{"out":"affects.neighbours[].stop_id","expr":"shared_stops.neighbour_stop_id","from":["registry.shared_stops.neighbour_stop_id"],"rule":"copy"},{"out":"affects.neighbours[].to_route","expr":"totals.to_route where it serves neighbour_stop_id","from":["regional.to_route","regional.party_id","regional.from_party","timetables.stop_times.stop_id","timetables.trips.route_id"],"rule":"join"},{"out":"affects.neighbours[].time_band","expr":"totals.time_band","from":["regional.time_band"],"rule":"copy"},{"out":"affects.neighbours[].transfers_typical","expr":"median(totals.transfers) over the last 28 service dates with status reported","from":["regional.transfers","regional.service_date","regional.status"],"rule":"aggregate"},{"out":"affects.neighbours[].share","expr":"transfers_typical / Σ transfers_typical over the item's neighbours","from":["regional.transfers"],"rule":"derive"},{"out":"affects.built_at","expr":"now()","from":[],"rule":"generate"}],"drops":[],"source_id":"online:T10","path":"online"},{"id":"T18","name":"Build the alert: kind, where, since, expected and seen, who is affected","short":"Build the alert","lane":"region","col":3.5,"row":0,"service":"Lambda · build the alert","when":"when a rule fires or a band breaks","inputs":["state","metrics","affects","weather"],"outputs":["alerts"],"detail":{"grain":"a rule firing, or a series outside its band, → one alert row, updated while open","joins":["affects on (party_id, route_id) for the route's shared stops","weather and events by place and time: planned, dashed, not sourced (decision 52)"],"filters":["a detector alert only after 2 consecutive windows outside the band (decision 54; about 48 delay and 46 crowding alerts a weekday at one agency in the replay)","late side and crowded side only"],"dedup":["one open alert per party, kind and route or vehicle; a further window updates seen and keeps since"],"nulls":["affects empty when unknown; label null until weather is sourced"],"units":["minutes late; people on board"],"privacy":["names a party, a route, a vehicle as its own feed names it, and a neighbour; never a rider"],"key":"the region's; 13 months; each receiver keeps its own copy"},"columns":[{"out":"alerts.alert_id","expr":"ULID: time-ordered, generated","from":[],"rule":"generate"},{"out":"alerts.party_id","expr":"state.pk, or metrics.party_id","from":["state.pk","metrics.party_id"],"rule":"derive"},{"out":"alerts.month","expr":"to_char(since, 'YYYY-MM')","from":["metrics.timestamp","state.last_seen"],"rule":"derive"},{"out":"alerts.kind","expr":"the rule that fired (feed_gap, frozen_vehicle, position_jump, dead_counter), or delay_anomaly / load_anomaly by metric_name","from":["state.kind","state.moved_at","state.jump","state.zero_windows","state.last_seen","metrics.metric_name"],"rule":"derive"},{"out":"alerts.route_id","expr":"state.route_id, or metrics.route_id","from":["state.route_id","metrics.route_id"],"rule":"derive"},{"out":"alerts.direction_id","expr":"state.direction_id, or metrics.direction_id","from":["state.direction_id","metrics.direction_id"],"rule":"derive"},{"out":"alerts.vehicle_id","expr":"state.sk after 'V#', for a vehicle rule; else null","from":["state.sk","state.kind"],"rule":"derive"},{"out":"alerts.stop_id","expr":"state.sk after the last '#', for a counter rule; else null","from":["state.sk","state.kind"],"rule":"derive"},{"out":"alerts.since","expr":"the first window's metrics.timestamp outside the band, or the rule's firing time","from":["metrics.timestamp","state.last_seen"],"rule":"derive"},{"out":"alerts.until","expr":"the first window back inside, or when the rule clears; null while open","from":["metrics.timestamp","metrics.value","metrics.expected_high"],"rule":"derive"},{"out":"alerts.expected_low","expr":"metrics.expected_low","from":["metrics.expected_low"],"rule":"copy"},{"out":"alerts.expected_high","expr":"metrics.expected_high","from":["metrics.expected_high"],"rule":"copy"},{"out":"alerts.seen","expr":"metrics.value","from":["metrics.value"],"rule":"copy"},{"out":"alerts.unit","expr":"'min late' for delay_min, 'on board' for on_board","from":["metrics.metric_name"],"rule":"derive"},{"out":"alerts.affects","expr":"affects.neighbours for (party_id, route_id, each shared stop of the route), by the band in force","from":["affects.pk","affects.sk","affects.neighbours"],"rule":"join"},{"out":"alerts.label","expr":"planned: condition or event_name near the route at since","from":["weather.condition","weather.event_name","weather.place","weather.observed_at"],"rule":"null"},{"out":"alerts.status","expr":"'open', then 'cleared' when until is set","from":["metrics.timestamp","metrics.value","metrics.expected_high"],"rule":"derive"},{"out":"alerts.created_at","expr":"now()","from":[],"rule":"generate"}],"drops":[],"source_id":"online:T11","path":"online"},{"id":"T19","name":"Serve the open alerts a reader may see","short":"Serve the feed","lane":"region","col":4,"row":0.5,"service":"API Gateway + Lambda; Verified Permissions","when":"on request","inputs":["alerts"],"outputs":["feed"],"detail":{"grain":"unchanged: one alert per row, filtered per reader","joins":["the sign-in token names the reader's party; Verified Permissions decides from the compiled agreements"],"filters":["status = open","the reader is the alert's party, a party named in affects, or the region","every read is an audit event"],"dedup":["none"],"nulls":["affects and label pass through as they are"],"units":["unchanged"],"privacy":["allow-or-deny per reader; nothing about a rider exists to leak"],"key":"the region's; TLS to the reader; not stored"},"columns":[{"out":"feed.alert_id","expr":"alerts.alert_id","from":["alerts.alert_id"],"rule":"copy"},{"out":"feed.party_id","expr":"alerts.party_id","from":["alerts.party_id"],"rule":"copy"},{"out":"feed.kind","expr":"alerts.kind","from":["alerts.kind"],"rule":"copy"},{"out":"feed.route_id","expr":"alerts.route_id","from":["alerts.route_id"],"rule":"copy"},{"out":"feed.direction_id","expr":"alerts.direction_id","from":["alerts.direction_id"],"rule":"copy"},{"out":"feed.vehicle_id","expr":"alerts.vehicle_id","from":["alerts.vehicle_id"],"rule":"copy"},{"out":"feed.stop_id","expr":"alerts.stop_id","from":["alerts.stop_id"],"rule":"copy"},{"out":"feed.since","expr":"alerts.since","from":["alerts.since"],"rule":"copy"},{"out":"feed.seen","expr":"alerts.seen","from":["alerts.seen"],"rule":"copy"},{"out":"feed.unit","expr":"alerts.unit","from":["alerts.unit"],"rule":"copy"},{"out":"feed.affects","expr":"alerts.affects","from":["alerts.affects"],"rule":"copy"},{"out":"feed.label","expr":"alerts.label","from":["alerts.label"],"rule":"copy"},{"out":"feed.expected","expr":"expected_low || ' to ' || expected_high","from":["alerts.expected_low","alerts.expected_high"],"rule":"derive"},{"out":"feed.served_at","expr":"now()","from":[],"rule":"generate"}],"drops":[],"source_id":"online:T12","path":"online"},{"id":"T20","name":"Serve the four reports a reader may see","short":"Serve reports","lane":"region","col":3.5,"row":2,"service":"Athena · queries; API Gateway; Verified Permissions","when":"on request; cached","inputs":["regional"],"outputs":["api"],"detail":{"grain":"rows → a matrix by party pair and band; waits and crossing points by route; connection times for the journey view","joins":["the sign-in token names the reader's party; Verified Permissions decides from the compiled agreements"],"filters":["a planner sees the whole matrix; the journey view sees connection times only","every read is an audit event"],"dedup":["none"],"nulls":["an unknown party stays unknown in every report; it is never filled by an average"],"units":["transfers a typical weekday; minutes; shares"],"privacy":["allow-or-deny per reader; nothing finer than a route and a 3-hour band exists to leak"],"key":"the region's; TLS to the reader; the cache purged when a party leaves"},"columns":[{"out":"api.matrix.from_party","expr":"from_party","from":["regional.from_party"],"rule":"copy"},{"out":"api.matrix.to_party","expr":"party_id","from":["regional.party_id"],"rule":"copy"},{"out":"api.matrix.time_band","expr":"time_band","from":["regional.time_band"],"rule":"copy"},{"out":"api.matrix.transfers","expr":"median over the last 12 weekdays of Σ transfers over to_route","from":["regional.transfers","regional.to_route","regional.service_date"],"rule":"aggregate"},{"out":"api.matrix.status","expr":"'unknown' if any row of the pair is unknown","from":["regional.status"],"rule":"derive"},{"out":"api.waits.to_party","expr":"party_id","from":["regional.party_id"],"rule":"copy"},{"out":"api.waits.to_route","expr":"to_route","from":["regional.to_route"],"rule":"copy"},{"out":"api.waits.time_band","expr":"time_band","from":["regional.time_band"],"rule":"copy"},{"out":"api.waits.median_wait_min","expr":"median over days of median_wait_min","from":["regional.median_wait_min","regional.service_date"],"rule":"aggregate"},{"out":"api.waits.share_wait_over_15","expr":"mean over days of share_wait_over_15","from":["regional.share_wait_over_15","regional.service_date"],"rule":"aggregate"},{"out":"api.crossing.to_party","expr":"party_id","from":["regional.party_id"],"rule":"copy"},{"out":"api.crossing.to_route","expr":"to_route","from":["regional.to_route"],"rule":"copy"},{"out":"api.crossing.from_party","expr":"from_party","from":["regional.from_party"],"rule":"copy"},{"out":"api.crossing.transfers","expr":"Σ transfers over bands, ranked across the region","from":["regional.transfers","regional.time_band"],"rule":"aggregate"},{"out":"api.connection.from_party","expr":"from_party","from":["regional.from_party"],"rule":"copy"},{"out":"api.connection.to_party","expr":"party_id","from":["regional.party_id"],"rule":"copy"},{"out":"api.connection.to_route","expr":"to_route","from":["regional.to_route"],"rule":"copy"},{"out":"api.connection.time_band","expr":"time_band","from":["regional.time_band"],"rule":"copy"},{"out":"api.connection.median_wait_min","expr":"median_wait_min of the latest reported day","from":["regional.median_wait_min","regional.status"],"rule":"derive"},{"out":"api.served_at","expr":"now()","from":[],"rule":"generate"}],"drops":[],"source_id":"offline:T9","path":"offline"}],"edges":[{"from":"avl","to":"T1","kind":"data"},{"from":"apc","to":"T1","kind":"data"},{"from":"T1","to":"b_avl","kind":"data"},{"from":"T1","to":"b_apc","kind":"data"},{"from":"b_avl","to":"T2","kind":"data"},{"from":"b_apc","to":"T2","kind":"data"},{"from":"gtfs","to":"T2","kind":"cross","fs":"t","fo":-40,"ts":"b","via":[["y","gap:public:-30"]],"label":"fetched when they change"},{"from":"T2","to":"a_silver","kind":"data"},{"from":"T2","to":"a_trips","kind":"data"},{"from":"a_silver","to":"T3","kind":"data"},{"from":"a_trips","to":"T3","kind":"data","fs":"r","ts":"l","tof":14,"via":[["x","colR:2:20"]]},{"from":"T3","to":"a_loads","kind":"data"},{"from":"a_loads","to":"T4","kind":"data"},{"from":"T4","to":"lane","kind":"cross","fs":"b","fo":-20,"ts":"t","via":[["y","top:region:1"]],"label":"5-minute loads, every 5 min, within 2"},{"from":"afc","to":"T5","kind":"data"},{"from":"T5","to":"b_afc","kind":"data"},{"from":"b_afc","to":"T6","kind":"data"},{"from":"T6","to":"a_fares","kind":"data"},{"from":"a_fares","to":"T7","kind":"data"},{"from":"arrivals","to":"T7","kind":"cross","fs":"t","fo":40,"ts":"b","via":[["y","bot:agency:0"],["x","x:T7"]],"label":"read in place, by grant: arrivals on shared stop ids, with the crosswalk"},{"from":"T7","to":"a_totals","kind":"data"},{"from":"a_totals","to":"T8","kind":"data"},{"from":"T8","to":"inbox","kind":"cross","fs":"b","ts":"t","via":[["y","row:region:2.5"],["x","x:inbox"]],"lseg":"v","lp":0.3,"label":"the nightly file: SSE-KMS with the agency's key, by 06:00, rows under 5 cards already dropped"},{"from":"rt","to":"T9","kind":"cross","fs":"r","ts":"t","via":[["x","x:T9"]],"label":"every 10 s"},{"from":"registry","to":"T9","kind":"ctl","fs":"t","fo":40,"ts":"b","tof":30,"via":[["y","row:region:0.5"],["x","x:T9:30"]],"label":"which feeds"},{"from":"T9","to":"lane","kind":"data","fs":"b","ts":"l","via":[["y","row:region:0"]]},{"from":"T9","to":"archive","kind":"data","fs":"b","fo":24,"ts":"l","tof":-12,"via":[["y","row:region:1:-12"]]},{"from":"gtfs","to":"T10","kind":"cross","fs":"r","ts":"t","via":[["x","x:T10"]],"label":"when they change"},{"from":"registry","to":"T10","kind":"ctl","fs":"t","fo":70,"ts":"b","tof":-20,"via":[["y","row:region:1.5"],["x","x:T10:-20"]],"label":"which timetables"},{"from":"T10","to":"timetables","kind":"data","fs":"b","ts":"l","tof":12,"via":[["y","row:region:1:12"]]},{"from":"lane","to":"T11","kind":"data","fs":"r","fo":-14,"ts":"l","tof":-10,"via":[["x","colR:1:20"]]},{"from":"T11","to":"vl_archive","kind":"data"},{"from":"archive","to":"T12","kind":"data","fs":"b","ts":"l","via":[["y","row:region:2"]]},{"from":"registry","to":"T12","kind":"plan","fs":"r","fo":14,"ts":"l","tof":12,"via":[["x","colR:0:34"]],"label":"shared stops, operator names"},{"from":"T12","to":"arrivals","kind":"data"},{"from":"lane","to":"T13","kind":"data"},{"from":"T13","to":"state","kind":"data"},{"from":"lane","to":"T14","kind":"data","fs":"r","fo":14,"ts":"l","tof":-12,"via":[["x","colR:2:14"]]},{"from":"timetables","to":"T14","kind":"data","fs":"r","fo":-14,"ts":"l","tof":12,"via":[["x","colR:2:28"]]},{"from":"T14","to":"metrics","kind":"data"},{"from":"inbox","to":"T15","kind":"data","fs":"b","ts":"l","via":[["y","row:region:3"]]},{"from":"registry","to":"T15","kind":"plan","fs":"r","fo":28,"ts":"l","tof":12,"label":"contract terms, keys"},{"from":"T15","to":"rejects","kind":"data","fs":"r","ts":"l","label":"rejected, with the reason; the agency told"},{"from":"inbox","to":"T16","kind":"data","fs":"r","ts":"l","tof":-12,"via":[["x","colR:1:34"]]},{"from":"registry","to":"T16","kind":"plan","fs":"r","fo":0,"ts":"b","tof":-20,"via":[["x","colR:0:48"],["y","row:region:2.5"],["x","x:T16:-20"]],"label":"parties expected"},{"from":"T16","to":"regional","kind":"data"},{"from":"regional","to":"T17","kind":"data","fs":"b","ts":"t","tof":20,"via":[["y","row:region:2.5"],["x","x:T17:20"]],"label":"status reported only"},{"from":"registry","to":"T17","kind":"plan","fs":"r","fo":-14,"ts":"l","tof":-14,"via":[["x","colR:0:20"]]},{"from":"timetables","to":"T17","kind":"data","fs":"r","fo":14,"ts":"l","tof":14,"via":[["x","colR:2:28"]]},{"from":"T17","to":"affects","kind":"data"},{"from":"state","to":"T18","kind":"data"},{"from":"metrics","to":"T18","kind":"data","fs":"r","ts":"l","tof":12,"via":[["x","colR:3:28"]]},{"from":"affects","to":"T18","kind":"data","fs":"r","ts":"b","tof":-30,"via":[["x","colR:3:14"]]},{"from":"weather","to":"T18","kind":"plan","fs":"r","ts":"t","tof":24,"via":[["x","colR:0:16"],["y","gap:region:32"],["x","x:T18:24"]],"label":"a label, planned"},{"from":"T18","to":"alerts","kind":"data","fs":"r","ts":"l"},{"from":"alerts","to":"T19","kind":"data","fs":"b","ts":"t"},{"from":"T19","to":"feed","kind":"data","fs":"b","ts":"t"},{"from":"regional","to":"T20","kind":"data"},{"from":"T20","to":"api","kind":"data"}],"notes":{"planned":"A proposal (decisions 62 to 65). Columns of the regional tables are proposals (decisions 57, 58). Nothing is deployed.","pages":{"tables":"@/digital-twin/merged-tables"}}}
