Add live API monitoring to detect schema drift #87
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
Implements daily scheduled integration tests that make real API calls to detect schema drift and breaking changes from upstream Mapbox APIs.
This addresses the issue where Mapbox APIs don't follow strict semantic versioning - responses can change without notice, breaking our output schemas.
What This Adds
Monitoring System
Test Coverage
SearchAndGeocodeTool: 6 representative queries (Starbucks, Tokyo, addresses, generic terms)CategorySearchTool: 5 common categories (restaurant, coffee, hotel, gas_station, parking)ReverseGeocodeTool: 4 major cities (San Francisco, Tokyo, London, Paris)Files
test/integration/live-api-monitoring.test.ts: Integration test suite.github/workflows/api-monitoring.yml: Daily scheduled workflowtest/integration/README.md: Complete documentation.gitignore: Excludestest/failures/directoryHow It Works
RUN_API_MONITORING=trueto run)test/failures/with timestampapi-monitoring,schema-validation,needs-triageSecurity
Secret Protection (Public Repo)
The workflow uses
MAPBOX_ACCESS_TOKENsecret safely through multiple protection layers:GitHub's Built-in Protection (Primary):
***Defense in Depth Measures:
permissionsblock (least privilege:contents: read,issues: write,actions: read)Note: Mapbox APIs require tokens as query parameters (not headers), so tokens appear in URLs. GitHub's automatic redaction masks these in all workflow logs before display.
Running Locally
Relationship to PR #73
This complements PR #73's non-fatal validation approach:
Together they provide:
Testing
All existing tests pass. The 3 new monitoring tests are properly skipped by default:
🤖 Generated with Claude Code