TrustPager driver: run every API call next to the database (Sydney) - #4
Merged
Merged
Conversation
… ap-southeast-2) The API otherwise runs in the region nearest the caller; from the Philippines that was Singapore, about 3.3s a call against about 1.2s in Sydney, because every database read crossed the sea (measured 2026-09-28). Set once on TP_CFG through the kernel's vendor-neutral extra_headers, so the kernel stays clean; a driver test pins it. Co-Authored-By: Claude Opus 5.5 <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.
What
Every call the TrustPager driver makes now carries
x-region: ap-southeast-2, so the TrustPager API runs next to its database in Sydney.Why
The API runs in the region nearest whoever calls it. From the Philippines that was Singapore, and every database read inside each call crossed the sea: the app's calls averaged about 3.3 seconds. The same call run in Sydney takes about 1.2 seconds (measured 2026-09-28 through api.trustpager.com: 4.2s forced to us-west-2, 1.2s in ap-southeast-2).
How
drivers/trustpager/__init__.py:HOME_REGION_HEADERSset once onTP_CFGthrough the kernel's existing vendor-neutralextra_headers, which the transport merges into every request. The kernel is untouched (tools/check-kernel-clean.pypasses).tests/test_trustpager_driver.py: a test pins the header so it cannot silently disappear.Checks
BOS_OFFLINE=1 python -m unittest discover -s tests: 420 tests OK (39 skipped, as before)check-no-secrets,check-kernel-clean,check-doctrine-voice,check-connectors, and the_scripts/sweep.pyprivate-data sweep: all cleanInstalled copies pick this up on
bos update; no installer release is needed.🤖 Generated with Claude Code