TransitAI Core

Digital twin · transfer analysis · data architecture · planned

Tables, keys and rules.

Every table on the lineage picture, with what one row stands for, how it is keyed, how many columns it has, how its files are split, how long it is kept and under whose key. Then the joins that hold it together and the rules that keep it clean. The column lists themselves live on the picture: hover a table, or hold Shift for the entity-relationship view.

The tablesKeys and joinsQuality and privacy

Every table.

Grain, partitioning, retention and the columns of the regional tables are decision 58, proposed. Retention figures already in a contract or a cost model are kept as they stand.

TableLayerShapeGrain: one row isKeysColumnsSplit byKeptWhose key
PRESTO fare export
the sample files
Sourcevendor CSV, ,-delimited, with a headerone row per tapTransactionID18one file a month in the sample; nightly in a live agencythe agency's ruleagency
Raw fare export
the sample files
Bronzeas received, plus file and landing timeas receivednone imposed20by file and calendar datethree years (the raw landing); never leavesagency
TIDES fare_transactions
tested on the sample
SilverTIDES fare_transactions plus named extras: the transfer operator, the route, the hashed cardone row per taptransaction_id; stop_id = GTFS stop17by service daythe agency's rule; the region never reads itagency
Nightly transfer totals
replayed on the sample
GoldTIDES station_activities plus extras: the contract's rowfrom-operator × route × date × 3-hour bandparty_id, service_date, from_operator, to_route, time_band8one file per service daykept at home; the copy at the region 3 years under the agency's keyagency
GTFS-Realtime feeds
already standard
SourceGTFS-Realtime protobuf, as each party publishes itone position per vehicle every 10 s; one trip update per tripparty, vehicle id, trip id, timestamp23polled every 10 snot stored as such; see the feed archivenone, open
Feed archive
planned
Bronzerecords as polled, two kinds (Parquet in Iceberg)one row per position; one per trip update stopparty_id, record_kind, polled_at, then the feed's own ids24by party and service day3 years, as costed; a leaver's part deleted at once, snapshots expiredregion
Public arrivals
planned
SilverTIDES stop_visits, times only, plus the crosswalkparty × service day × trip × stopparty_id, service_date, trip_id_performed, trip_stop_sequence14by party and service day3 years, with the archiveregion; read in place by each agency through a grant
Registry
planned
SourceAurora tables: parties, contracts, shared_stopsone party; one contract version; one shared stop pairparty_id; contract_id; party_id, stop_id, neighbour_party22not partitionedwhile the region runs; a leaver's row marked left, kept for auditregion
Inbox: nightly files
planned
BronzeS3 objects, the contract's rows as sent, SSE-KMS with the agency's keyone file per party per service day; its rows as sentparty_id, service_date14by party and service day3 years, under the agency's key; deleted when it leavesagency, granted
Regional transfer table
planned
GoldIceberg table; the contract's row, with the party ids resolvedto-agency × from-party × route × date × 3-hour bandparty_id, from_party, service_date, to_route, time_band11by party (the to-agency) and service date3 years; a leaver's rows deleted, snapshots expired, reports rebuilteach agency's, by revocable grant
Rejected files
planned
OutSQS message per fileone message per rejected fileparty_id, service_date, object_key7not partitioned14 days, replayableregion
Report API
planned
OutJSON over the API; four reportsone report per request, filtered per readerreader's party; allow-or-deny rules20per request; cachedcached briefly; purged when a party leavesregion

Tested: an exploration built the table from the real month. Replayed: the sample analysis computed its values from the month's files. Standard: the shape is the published one already. Nothing is deployed. The column count links to the picture, where every column is listed with its type and key role.

Keys and joins.

Five identifiers carry every join in this use case. Each is written once in the sample's vendor form and once in the standard's.

KeyIn the vendor fileIn the standardAt the regionChecked
TapTransactionIDtransaction_idnever: no tap leaves1.69 M taps, one malformed row
CardGSN, the serial; restrictedtoken_id null; card_hash extra, HMAC with the agency's secretnevercounted in taps in the sample because the card is never loaded there; the real adapter counts distinct hashes
Transfer operatorTransferServiceProviderID, _Name; 0 when nonefrom_operator_id, from_operator_name: named extras, no TIDES fieldfrom_party, resolved through the registry's PRESTO operator names818,562 taps name one; six operators on a weekday
StopTrxLocationID, without leading zeros (398,199 padded)stop_id = GTFS stopshared_stops in the registry: the crosswalk the arrivals carry99.1% of taps find their GTFS stop
RouteLineIDroute_id, an extra, with the agency's prefixto_routeevery tap has one
BandTimeevent_timestamptime_band: the hour floored to 31,352 from-operator × route × band cells on the reference day
Partythe file is one agency'sa party id from the registry, on every regional rowthe folder, and the key the file is signed withby contract: no registered party, no row

Taps between midnight and 04:00 sit on the calendar date (20,356 in the sample); six agencies adding up need one definition of the service day, which is still open (audit). The wait needs the from-operator's public arrivals at the crosswalked stop: the sample's sketch used the agency's own AVL instead, so it shows the method, not cross-agency waits.

Quality and privacy rules.

The same rules the data contracts page states, written against the tables above. Each is also written into the step that applies it, on the picture.

On the way into Silver

  • Every row checked against the published TIDES schema: types, required fields, enums, unique transaction id.
  • Stop must exist in the agency's GTFS; a device with no stop keeps a null, not a guess.
  • The three extras are named in the contract, not slipped in: transfer operator, route, hashed card.
  • Flagged, not rejected: a fare that differs from the amount paid (5,631 rows).

At the border

  • Every file checked against its contract before it counts (T7): shape, 06:00 deadline, no row under 5 cards, the party's own key, an active contract.
  • A file late or missing by 06:00 raises an alarm; the 06:30 table shows that agency as unknown, never zero.
  • A rejected file is held 14 days with its reason; the path back to the agency is still to be drawn.
  • A party not on PRESTO is never named on a tap, so it shows unknown (decision 37).

Never

  • The card serial never leaves the agency's account, raw or hashed; no card is matched across agencies (decisions 8, 25, 48).
  • No card serial or per-card record is written to the repo or the site (decision 16): the sample's counts are in taps because the card is never loaded.
  • Fare class and product are withheld even at home: they can reveal a concession.
  • Rows under 5 distinct cards are dropped before the file is written (decision 26); the region adds, it never disaggregates.

Decided

  • Transfers come from PRESTO's own flag, counted at home; only totals cross, nightly, under a published contract (25, 27)
  • Rows under 5 distinct cards are dropped; the card is hashed at home to count them (26, 48)
  • Each agency's rows at the region stay under its own key by revocable grant; leaving deletes them and rebuilds (41, 43, 50)
  • Arrivals are derived by the region from the public feeds and read in place with a stop crosswalk (49)

Open

  • Decision 58, proposed: grain, partitioning, retention and the columns of every table above, including the regional table's unknown rows and the four reports
  • Crossing points by stop: the contract's grain is by route, the sample's finding (Kipling) is by stop; one of them changes (audit)
  • One definition of the service day across six agencies
  • The rejected-file path back to the agency, and whether a corrected file may replace a counted one

Caveats

  • Tested means the adapter prototype built fare_transactions from one agency's month (100% pass the schema); the totals were replayed from it (20,234 cross-agency transfers a weekday); the regional tables exist on paper only
  • The sample's waits are MiWay-to-MiWay, from its own AVL: the method, not the cross-agency figure
  • Vendor ids and formats are one agency's; a second vendor would need its own adapter mapping
  • A PRESTO transfer flag means a tap within the fare's transfer window, which includes long stops and return trips; the pages treat every flag as a connection

↑ ↓ to move · ↵ to open · esc to close