Data contracts.
A contract is the one page an agency signs up to: what it sends, how often, under what rule, and what it gets back. The two use cases each have one. Below them, a proposed general form that any new contract would fill in. Both are proposals; no agency has agreed to anything.
The two contracts, side by side.
Same clauses, different answers. The offline one moves a file a night; the online one moves counts every five minutes.
| Clause | Transfer totals · v1 (offline) | Live loads · v1 (online) |
|---|---|---|
| Purpose | Transfer analysis: who changes agency, where, how long they wait | Anomaly detection: crowding and dead counters, beside the public feeds |
| Shape | TIDES station_activities | TIDES passenger_events, added up |
| Extra columns | from_operator, to_route, time_band, transfers (distinct cards), median_wait_min, share_wait_over_15; the party comes from the folder and the key | route_id, direction_id, window_start (5 minutes), visits, on_board as the mean load over the window's visits |
| Grain | From-operator × route × date × 3-hour band | Route × direction × stop × 5-minute window |
| Cadence and deadline | Nightly, by 06:00 | Every 5 minutes, within 2 |
| When late | Alarm at 06:00; the 06:30 report shows the agency as unknown | A rule fires; crowding alerts pause for that agency; delay alerts carry on |
| Privacy rule | Rows under 5 distinct cards dropped before leaving | Counts of people only; nothing about a rider or a card |
| Custody | Agency's key; the region holds a revocable grant | Region's key on arrival; 24 hours on the live lane |
| Readers | Regional planners, the journey view | The detector only |
| What comes back | Public arrivals archive, stop crosswalk, regional transfer report | Alerts on your own feed and vehicles; neighbours' delays that break your connections |
| Retention | 3 years, under your key | 24 hours on the lane; route metrics age out in 63 days; alerts 13 months at the region |
| On leaving | Grant revoked: rows go dark; files deleted; reports rebuilt | Polling stops; alarms, vehicle state and archive part deleted |
| Status | Drafted; its counting tested on the September 2024 sample | Drafted; its detector tested on the same sample |
What TIDES does not cover: the transfer operator (no field in the standard), the route and the distinct-card count (station_activities is per stop, not per route), the 5-minute window with its route, direction, visit count and mean load (passenger_events has no route and is per event), and alerts, which have no TIDES home at all. Each is named in the contract rather than slipped in. The column-level data architectures found the extras the first draft left out (decision 60, proposed).
A general data contract: proposed.
Decision 42 named nine clauses. Writing the two contracts added three: grain, when late, and custody. The form below is what a third contract would fill in.
What is sent
How it moves
- Cadence and deadline. How often, and by when.
- When late. What the region does, and what readers see: always unknown, never normal.
- Privacy rule. The smallest count, or the fields that may never appear.
- Custody. Whose key it rests under, and for how long.
What comes back, and the end
- Readers. Who may read, compiled to allow-or-deny rules.
- What comes back. The agency's return for sharing.
- Retention. How long, and where.
- On leaving. What is deleted at once, what ages out, what the agency keeps.
The same form, as the registry would hold it
Illustrative; field names are a proposal.
contract:
name: live-loads version: 1
purpose: anomaly detection
shape:
tides_table: passenger_events
extra_columns: [route_id: text, direction_id: integer, window_start: timestamp,
visits: integer, on_board: integer (mean load over the visits)]
grain: [route_id, direction_id, stop_id, window_start]
cadence: every 5 minutes deadline: within 2 minutes
when_late: pause crowding alerts for the sender; mark unknown
privacy_rule: counts only; no rider, no card
custody: region key; 24 hours on the lane
readers: [detector]
returns: [own alerts, neighbours' delays affecting connections]
retention: 24 hours lane; 63 days metrics; 13 months alerts
on_leaving: stop polling; delete alarms, state, archive part
status: drafted
- Why a form
- The region compiles each clause into a rule it checks on every request; a clause that is prose cannot be compiled. The agreement-to-policy exploration showed 20 of 55 sub-clauses compile today.