Skip to content

feat(glides): add nextTripKey field to trips_updated.v1#20

Merged
andrewdolce merged 2 commits into
mainfrom
asd-glides-next-trip
Jun 23, 2026
Merged

feat(glides): add nextTripKey field to trips_updated.v1#20
andrewdolce merged 2 commits into
mainfrom
asd-glides-next-trip

Conversation

@andrewdolce

Copy link
Copy Markdown
Contributor

Pullout inspectors using Glides may decide to assign a vehicle to an upcoming trip in a way that breaks the vehicle's expected block of trips from the HASTUS schedule. Currently Glides can only convey this information via a vehicle_trip_assignment.v1 message, which cannot be emitted until the vehicle has finished turning around and is in position to begin the trip. Unfortunately this may be too late for RTR to make timely terminal predictions.

The solution is to allow Glides to indicate the change in the block sequence ahead of time as part of a trips_updated.v1 message, by populating a nextTripKey field. (This is somewhat analogous to the TSCH LNK messages used by OCS to indicate block changes for heavy rail.)

- `revenue` (`"revenue"` | `"nonrevenue"`, optional): Whether the trip is in revenue service.
- `dropped` ([DroppedReason](#droppedreason) | false, optional): If present the trip was dropped for the provided reason. If set to `false`, the trip is not dropped (and restored if previously dropped).
- `scheduled` ([Scheduled](#scheduled) | null): For trips in Glides' schedule, this represents the scheduled data for the trip. It will always be present and won't change between subsequent updates to the same trip. For added trips, this will always be `null`.
- `nextTripKey` ([TripKey](#tripkey), optional): If present, this specifies the key of another trip that will happen immediately after this trip. This field MAY refer to a trip that has not been already seen in the event stream. This field is intended to communicate a change in the expected sequence of trips, such as the sequence implied by blocks in the schedule from HASTUS. Note that a single change indicating a sequential link between two trips may imply additional changes to other links. For example, consider an initial schedule containing sequences between trips A1 --> A2, and B1 --> B2. If Glides emits an update to A1 with `nextTripKey` referencing B2, this implies a break to the two initial links. Clients are expected to maintain a consistent schedule such that no two trips may link to the same "next" trip. Note also that this field does not support an "unset" value. If Glides wishes to restore the initial schedule after changing some links, it must explicitly emit the links to be restored.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: a couple of things:

  1. Reword this:

If present, this specifies the key of another trip that will happen immediately after this trip.

to something like

If present, this specifies the key of another trip that the vehicle performing this trip will perform immediately after.

  1. Re:

this implies a break to the two initial links.

can you be explicit and list out what links would be broken and which would be formed by processing the message?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take another pass at expanding it. Might break this out into a little subsection since it's getting a bit long to be an in-line property description?

@andrewdolce

Copy link
Copy Markdown
Contributor Author

I took the rewording suggestion and expanded the block break example. I also added a callout for the lack of a "none" value, which I'm still slightly up in the air about? I don't yet see a reason we'd need it, but had considered adding it just in case it becomes useful in the future. Going to leave as-is, but open to feedback on that.

@andrewdolce andrewdolce requested a review from lemald June 12, 2026 14:58

@lemald lemald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Not sure if @rudiejd has any thoughts to add.

@rudiejd

rudiejd commented Jun 18, 2026

Copy link
Copy Markdown
Member

this looks good to me! sorry, I reviewed but forgot to leave an approval

@rudiejd

rudiejd commented Jun 18, 2026

Copy link
Copy Markdown
Member

one note is that I think it might simplify this schema for glides to send trip_id as the identifier instead of trip_key. RTR uses the trip_id for deduplication internally, so right now the information in the trip_key is simply redundant given the rest of the message. but I realize that does not match with our current data model

@andrewdolce

Copy link
Copy Markdown
Contributor Author

one note is that I think it might simplify this schema for glides to send trip_id as the identifier instead of trip_key. RTR uses the trip_id for deduplication internally, so right now the information in the trip_key is simply redundant given the rest of the message. but I realize that does not match with our current data model

How strongly do you feel about this? Even if it's redundant, my instinct is to stick with trip key to keep it consistent with the other fields. Also just to clarify, you're talking about for the next trip right? Not changing the existing tripKey field on the update message (which I feel like would be a non-starter)?

@andrewdolce

Copy link
Copy Markdown
Contributor Author

(@rudiejd Forgot to tag you in my reply)

@andrewdolce andrewdolce merged commit 1a08b6d into main Jun 23, 2026
1 check passed
@rudiejd

rudiejd commented Jun 23, 2026

Copy link
Copy Markdown
Member

My comment was not blocking, but for reference I think all of the references to trip_key should use trip_id instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants