Skip to content

feat(brief): support ETD — Skywatch.brief(..., departing_at:) (#7)#20

Merged
jayrav13 merged 1 commit into
mainfrom
feat/brief-etd-input
May 2, 2026
Merged

feat(brief): support ETD — Skywatch.brief(..., departing_at:) (#7)#20
jayrav13 merged 1 commit into
mainfrom
feat/brief-etd-input

Conversation

@jayrav13

@jayrav13 jayrav13 commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds departing_at: keyword to Skywatch.brief, Composer#compose, and Brief model
  • TAF group selection: when ETD is given, uses taf.group_at(etd) to pick the active forecast group; falls back to the first group with a note: field if the ETD is outside the TAF valid window
  • Winds aloft: parameterizes the AWC fcst field based on hours until ETD (<=6h -> 06, 6-18h -> 12, >18h -> 24); WindsAloft#fetch gains fcst: kwarg (default '06' for backward compat)
  • Brief#departing_at is always present in to_h (ISO8601 or nil) for predictable JSON shape
  • CLI gains --departing-at option with Time.parse validation and non-zero exit on failure
  • Adverse conditions, fetched_at, and all other slots are unaffected

Closes #7

Test plan

  • bundle exec rspec — 477 examples, 0 failures (up from 461 on main)
  • bundle exec rubocop — no offenses
  • Brief#departing_at nil by default; present in to_h as nil or ISO8601 string
  • Composer selects TAF group at ETD via taf.group_at; falls back with note when outside window
  • Winds fcst bucket: 3h ETD -> 06, 10h -> 12, 20h -> 24; nil ETD -> 06
  • CLI --departing-at 2026-05-01T16:00:00Z passes parsed Time to Skywatch.brief
  • CLI --departing-at not-a-time exits non-zero with error message
  • Works with both airport and coordinate (at:) input paths

Generated with Claude Code

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>
@jayrav13 jayrav13 merged commit c5211ba into main May 2, 2026
3 checks passed
@jayrav13 jayrav13 deleted the feat/brief-etd-input branch May 2, 2026 01:42
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.

Skywatch.brief: support ETD (departing_at:)

1 participant