Skip to content

Fix 7 codebase gaps from audit#7

Merged
kavanaghpatrick merged 1 commit intomainfrom
fix/gaps-audit
Feb 10, 2026
Merged

Fix 7 codebase gaps from audit#7
kavanaghpatrick merged 1 commit intomainfrom
fix/gaps-audit

Conversation

@kavanaghpatrick
Copy link
Copy Markdown
Owner

Summary

  • Shared airports module: Created rtw/airports.py with fail-fast (exit 2 + Rich panel) replacing 4 separate silent-failure try/except blocks in distance.py, continents.py, search/query.py, cli.py
  • AONE first class fares: Added 32 entries (8 origins x 4 types) to fares.yaml using 1.6x DONE multiplier. Added FareLookupError exception + zero-fare guard so users see a clear error instead of $0
  • Oman Air (WY): Added to carriers.yaml (eligible, oneworld full member since June 2025) and ntp_rates.yaml (distance-based, D class = 12.5%)
  • S7 Airlines: Set eligible: false with EU/US/UK sanctions note
  • Dynamic US airports: Replaced hardcoded 42-airport set with airportsdata country lookup (1952 airports)
  • Test fixtures: Added DONE3 and LONE3 YAML fixtures for broader fare coverage
  • 18 new tests, 840 total pass, 0 regressions

Test plan

  • uv run pytest -x -q — 840 passed, 2 skipped, 0 failures
  • AONE fares nonzero for all 8 origins, AONE > DONE, ratio 1.4-1.8x
  • FareLookupError raised for unknown origins
  • WY passes EligibleCarrierRule, earns NTP > 0
  • S7 fails EligibleCarrierRule with sanctions message
  • Dynamic US airports includes all major codes (1952 vs 42)
  • DONE3/LONE3 fixtures load and cost correctly

🤖 Generated with Claude Code

…er, S7 sanctions

- Create rtw/airports.py shared airportsdata loader with fail-fast (exit 2)
  instead of 4 separate silent-failure try/except blocks
- Add 32 AONE first class fare entries to fares.yaml (8 origins x 4 types)
- Add FareLookupError exception + zero-fare guard in cost.py
- Add Oman Air (WY) to carriers.yaml and ntp_rates.yaml (oneworld June 2025)
- Set S7 Airlines eligible: false with sanctions note
- Replace hardcoded 42-airport US set with dynamic airportsdata lookup (1952)
- Add DONE3 and LONE3 test fixtures for broader coverage
- 840 tests pass, 18 new tests, 0 regressions

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@kavanaghpatrick kavanaghpatrick merged commit f8a1ba9 into main Feb 10, 2026
1 check failed
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.

2 participants