Add GTFS-RT service alerts to SMS and voice (#8) - #23
Open
aaronbrethorst wants to merge 12 commits into
Open
Conversation
… SMS truncation, fix ordering test, use go vet
…rts to initial call
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (27)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8.
Summary
arrivals-and-departures-for-stopresponse'sreferences.situations— no new data source, config, or dependency.ActiveSituations()model method that filters situations by theiractiveWindowsagainst the server'scurrentTime(ms, with defensive seconds→ms normalization; fails open when the server time is unknown). Alert presentation is localized across all 10 supported languages.OneBusAwayResponse's anonymous nested structs into named exported types (OBAResponseData/OBAStopEntry/…) so situation fields could be added cleanly; field-access paths are unchanged.Scope note: per discussion, this iteration covers alerts tied to a queried stop/route. System-wide disruptions played at the very start of a call (before a stop is chosen) require a separate global source (e.g. a GTFS-RT ServiceAlerts feed) and are deferred to a follow-up issue — the
Situationmodel and formatter layer are built to be reused for it. See spec §8.How it was built
Spec → context7 review → live verification against
api.pugetsound(confirmedactiveWindowsare ms, field shapes, and that a real alert parses) → implementation plan → plan review → subagent-driven TDD execution (7 tasks, each spec+quality reviewed) → whole-branch review →/simplify. Design docs live underdocs/superpowers/.Test plan
make fmt,make vet,make lint(0 issues),make test— full suite green (15 packages)ActiveSituationsactive-window filtering (active/expired/future/open-ended/seconds-normalized/fail-open), SMS+voice formatters (caps, overflow, truncation, no-URL-read-aloud), SMS & voice handler injection, locale key parity1_75403, which had an active alert):<Say>, then arrivals<Say>, then menu<Gather>1_431,1_13721): output unchanged (no-op verified)Review notes (non-blocking)
⚠prefix forces UCS-2 encoding and up to 2 alerts × 140 runes can add SMS segments. Left atsmsMaxAlerts = 2; dropping to 1 is a one-line lever if segment cost matters.summary/descriptionin the agency's language (English on Puget Sound); only the lead-in/prefix is localized. Inherent to single-language situation data.