Repository navigation
fix(trading): accept paper host version paths in capacity env URLs - #1069
Merged
seathatflowsinourveins merged 1 commit intoOct 13, 2026
Merged
Conversation
seathatflowsinourveins
marked this pull request as ready for review
October 13, 2026 09:10
seathatflowsinourveins
deleted the
codex/ns2604-capacity-paper-url-20261013
branch
October 13, 2026 09:11
This was referenced Oct 13, 2026
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.
Scope
Accept the paper host's
/v2env-file form while keeping every request pinned totransport.PAPER_URL. Parse the URL strictly and normalize only HTTPS, the exact paper host, no port or port 443, no userinfo/query/fragment, and paths"",/,/v2,/v2/. Invalid values keep the existingnon_paper_base_urlrefusal.107bcca66133db379e9bf31560ba617519c59bec(freshorigin/main).lane:trading.blueprints/us-equities/order-throughput/capacity.py,tests/test_order_throughput.py, and that test's hash/byte registration inmanifests/evidence.json.SOTA sources
cc4cb3b7ba50ae250e621983c2779047fb16bb28:alpaca/common/enums.py:9definesBaseURL.TRADING_PAPERashttps://paper-api.alpaca.markets;alpaca/common/rest.py:36,64defaults/stores API versionv2, and lines 107–109 append the version separately. Verified in the pinned upstream mirror; exact blobs are retained for review.CapacityConfig.validate()still requires the canonicalPAPER_URL.Evidence-class table
/v2formsyntheticred-main.log: same new regression against unmodified main production source; CLI refuses withnon_paper_base_urlPAPER_URLsyntheticgreen-url.log: fake-key, mode-0600 env files under/var/tmppass the actual credential-file ownership gate, URL reader and config validation/v2through its URL gate without a broker callsyntheticnon_paper_base_url; receipt config is canonicalPAPER_URL, fake broker call log is empty/v1,/v2/extra, HTTP, 8443, userinfo and query still refusesyntheticlocal_integrationtests.test_order_throughput: 79 tests, exit 0, one pre-existing isolated-SDK skiplocal_integrationscripts/validate.py: 71 components, 11878 hashes, 4 profiles, 240 receipts; manifest ordering check passesLocal commands run
PR-range gitleaks and publication/privacy checks run before publication; their complete outputs are retained in the review packet.
Decision record
This PR records the CC's strict URL compatibility correction. Its private hashed attachment packet retains the main source, upstream pin, fail-first/fixed logs, complete module and validator results.
capacity.pyhas no currentfiles[]registration; runtime receipts compute its source hash automatically. Only the registered changed test hash is refreshed. Historical capacity receipts and source hashes are preserved.The wider check covers every
env_base_urlcall site (the CLI and tests), missing/invalid env values, strict internal config validation, and the unchanged request transport. The CLI no longer usesrstrip('/'), which previously admitted repeated trailing slashes. URL-parser control stripping cannot bypass the raw-input checks. No owner-managed env file is modified. Paper attempt a2 remains a separate operation after review and landing.Follow-ups
None identified within this correction.
Host evidence
Not applicable; no
evidence/hosts/changes.Checklist