TransitAI Core

Digital twin · anomaly detection · data architecture · planned

Anomaly detection: the data.

The solution architecture says which services run. This page says what data they hold, down to the column: where each table comes from (its lineage), which step builds it and from which fields, which layer it sits in, whose account and key it rests under, and what crosses between parties. The open standards are the table shapes, not an export at the end.

The lineageTables, keys and rules

Lineage: from a vendor file to an alert, column by column.

Three lanes are three places data rests; five columns are the layers. A box is a table; a pill is a step, numbered and named with a verb; blue arrows cross an account border. Hover anything and only its neighbours stay lit. Hold Shift to see the fields joined, or everything a step does.

Hover a table, a step or an arrow. Hold Shift while hovering for the entity-relationship view of the tables, or the full detail of a step. Esc or moving away closes it. Click to pin.The specification (JSON)

Hover a table to see what feeds it and what it feeds.

  • Source
  • Bronze
  • Silver
  • Gold
  • Out
  • tested on the sample
  • replayed on the sample
  • already standard
  • the sample files
  • planned
  • T3a step: a numbered transformation with a verb
Dots mark status: only stop_visits has been built by an exploration. Nothing is deployed. The planned weather input is dashed and uncosted (decision 52). The regional tables' columns are a proposal (decision 57).

The 12 steps.

Named as a lineage tool would name them. Each one's full detail, every output column with its expression, the joins, filters, dedup, nulls, units, privacy rule and key, opens on the picture with Shift.

StepWhat it doesReadsWritesRuns asWhenColumns mapped
T1Land the vendor exportsAVL stop times, APC countersRaw AVL export, Raw APC exportS3 landingmonthly in the sample; nightly in a live agency48
T2Conform the exports to TIDES stop_visits and trips_performedRaw AVL export, Raw APC export, GTFS timetablesTIDES stop_visits, TIDES trips_performedthe adapter (Glue ETL or Lambda)per service day34
T3Sum the visits into 5-minute loadsTIDES stop_visits, TIDES trips_performed5-minute loadsthe adapter (Lambda)every 5 minutes, for the window just closed9
T4Push the loads to the live lane5-minute loadsLive lanethe adapter (Lambda), in the agency's accountevery 5 minutes, within 2 of the window closing13
T5Poll every registered party's live feedGTFS-Realtime feeds, RegistryLive laneECS on Fargate · pollerevery 10 s20
T6Fetch each party's timetable when it changesGTFS timetables, RegistryTimetablesECS on Fargate · pollerwhen the published zip changes (its hash)42
T7Archive the lane as TIDES vehicle_locationsLive laneTIDES vehicle_locationsData Firehose → S3 + Icebergbatched, within 5 minutes19
T8Keep the last state per vehicle and counter; run the rulesLive laneLast state per vehicleLambda · ruleson every record; rules checked each minute16
T9Match each position to its timetable; one delay and load value per route per windowLive lane, TimetablesDelay and load per routeLambda · delay and loadevery 5 minutes11
T10Build who is affected from shared stops and transfer totalsRegional transfer table, Registry, TimetablesWho is affectedAthena, nightly → DynamoDBnightly, after the transfer totals land10
T11Build the alert: kind, where, since, expected and seen, who is affectedLast state per vehicle, Delay and load per route, Who is affected, Weather and eventsAlertsLambda · build the alertwhen a rule fires or a band breaks18
T12Serve the open alerts a reader may seeAlertsLive alert feedAPI Gateway + Lambda; Verified Permissionson request14

Columns mapped counts output columns; a step reads more columns than it writes. Steps T1 to T4 run in the agency's account, T5 to T12 in the region's. T5 and T6 sit on the border because the poller reads across it.

Bronze, Silver, Gold, in two accounts.

The agency refines its own data at home; the region refines what it is allowed to see. Each layer's rule is the same in both places.

Bronze: as received

  • At home the vendor exports, untouched: dates as 1YYYYMMDD, times as seconds, the string NULL.
  • At the region the live lane: positions and loads in arrival order, 24 hours, under the region's key.
  • Rule never edited, so Silver can be rebuilt from it.

Silver: the standard shapes

  • At home TIDES stop_visits and trips_performed: one row per trip per stop, times and counts together; one row per trip with its route and timetable trip.
  • At the region TIDES vehicle_locations as the feed archive, and every party's GTFS as published.
  • Rule a table takes the standard's shape or names its extra columns in the contract.

Gold: one purpose each

  • At home 5-minute loads per route and stop: the only Gold table that leaves.
  • At the region delay and load per route per window, the last state per vehicle, who is affected.
  • Out alerts, which have no TIDES home, and the live alert feed.

The agency's Bronze and Silver are its own business: the region never reads them (decision 5). The sample stands in for a live feed, so stop-level arrivals play the part of positions.

What crosses, and under whose key.

Six flows cross an account border. Everything else stays where it was made.

WayWhatShapeWhenKeyWho
InPublic feedsGTFS-Realtime, as publishedevery 10 s, pulled by the regionnone: openevery registered party
InTimetablesGTFS, as publishedwhen they changenone: openevery registered party
In5-minute loadsTIDES passenger_events, summedevery 5 min, pushed by the adapterregion's, on arrival; 24 hoursfull sharers only
InTransfer totalsTIDES station_activities plus extrasnightlyagency's; read by revocable grantfull sharers only
OutAlertsthe contract's shape; no TIDES homeas they happeneach receiver's ownthe party, the region, named neighbours
OutLive alert feedJSONon requestregion's; allow-or-deny per readersigned-in control rooms and views
Stays home
Counter records, stop-level history, the vendor files. The agency's key; the region receives totals only.
Regional, agency's key
Transfer totals, read by a revocable grant. Revoke it and the who-is-affected lookup loses that agency at the next nightly rebuild.
Regional, region's key
The live lane, the loads on it for 24 hours, metrics, vehicle state, alerts. Counts that name nobody; the trade-off decision 54 proposes.
Public
Timetables and live feeds, mirrored; a leaver's part dropped. No key, the data is open.

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