feat(brief): support ETD — Skywatch.brief(..., departing_at:) (#7)#20
Merged
Conversation
Add departing_at: keyword to Skywatch.brief, Composer#compose, and Brief model. When an ETD is given, TAF group selection uses taf.group_at(etd) (falling back to the first group with a note if ETD is outside the valid window) and winds-aloft fetches the bulletin closest to ETD (fcst 06/12/24 based on hours from now). The CLI accepts --departing-at with Time.parse validation. Backward compat: departing_at defaults to nil; behavior is unchanged when omitted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
departing_at:keyword toSkywatch.brief,Composer#compose, andBriefmodeltaf.group_at(etd)to pick the active forecast group; falls back to the first group with anote:field if the ETD is outside the TAF valid windowfcstfield based on hours until ETD (<=6h -> 06, 6-18h -> 12, >18h -> 24);WindsAloft#fetchgainsfcst:kwarg (default '06' for backward compat)Brief#departing_atis always present into_h(ISO8601 or nil) for predictable JSON shape--departing-atoption withTime.parsevalidation and non-zero exit on failurefetched_at, and all other slots are unaffectedCloses #7
Test plan
bundle exec rspec— 477 examples, 0 failures (up from 461 on main)bundle exec rubocop— no offensesBrief#departing_atnil by default; present into_has nil or ISO8601 stringtaf.group_at; falls back with note when outside window--departing-at 2026-05-01T16:00:00Zpasses parsed Time toSkywatch.brief--departing-at not-a-timeexits non-zero with error messageGenerated with Claude Code