Consolidate fare/gflight into flight search with --backend auto-detect#3
Merged
Merged
Conversation
The fare/gflight split encoded the backend in the command name — a leaky abstraction that didn't scale (~90% overlap, --pp crosscut both, no path to a third provider). Replace with `flight search` that auto-picks Matrix when a Matrix-only flag is set (routing/extension/multi-city slice/time- of-day/extra pax types/PP config) and Google Flights otherwise. PP augmentation is now implicit on the Matrix backend when tokens load successfully (--no-pp opts out). fare and gflight become @app.command(deprecated=True) aliases that print a migration hint and forward to the same _run_matrix_path / _run_gflight_path helpers `search` uses. Scripts that pinned --pp still work; --pp on `fare` becomes a backcompat no-op (PP runs implicitly anyway). Tests cover every Matrix-only trigger plus the explicit/auto/conflict/ invalid-backend cases (17 new in tests/test_backend_dispatch.py). README "What it does" and the flight-search SKILL.md are rewritten around the new surface; fare/gflight remain documented as deprecated aliases. Closes work-0txq. Unblocks work-7a4s/zyt1/xyx7/6jqs/ngge/v7gb (gflight- flag passthrough issues, which now land on `search`) and work-z6zi (AwardProvider abstraction, which builds on the consolidated surface).
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
Collapses
flight fare(Matrix) andflight gflight(Google Flights) into a single capability-firstflight searchcommand with--backend auto|matrix|gflight. Auto-detect picks Matrix when a Matrix-only flag is set (routing/extension/multi-city slice/time-of-day/extra pax types/PP config) and Google Flights otherwise — addressing the leaky-abstraction problem that the old backend-named commands had.--no-pp;--pp-onlyhard-errors if tokens are missing.fareandgflightare now@app.command(deprecated=True)aliases that print a migration hint and forward to the same_run_matrix_path/_run_gflight_pathhelperssearchuses. Existing scripts keep working for one release.--pponfareis a backcompat no-op (PP is implicit either way).--backend gflightconflicts with a Matrix-only flag — the request is inexpressible onfli, so we fail at parse time rather than deep in the bridge.flight-searchSKILL.md are rewritten around the new surface; fare/gflight stay documented as deprecated aliases.Closes
work-0txq. Unblocks the downstreamgflight-flag-passthrough issues (work-7a4s/zyt1/xyx7/6jqs/ngge/v7gb) which now land onsearch, andwork-z6zi(AwardProvider abstraction) which builds on the consolidated surface.Test plan
make check(ruff lint + format + basedpyright strict + pytest) — all greentests/test_backend_dispatch.pycovering every Matrix-only trigger + explicit/auto/conflict/invalid-backend cases)flight --helpshows(deprecated)onfare/gflightflight search --helpdocuments--backend,--no-pp, and which flags are Matrix-onlyflight search JFK LHR --dep 2026-08-15 --backend gflight --routing "LH+"errors at parse time with a clear conflict messageflight fare ...still works; emits a typerDeprecationWarning+ custom migration hint to stderrflight gflight ...still works; emits a typerDeprecationWarning+ custom migration hint to stderr