Repository navigation
fix(trading): share strict paper URL normalization across credential gates - #1080
Merged
seathatflowsinourveins merged 3 commits intoOct 13, 2026
Merged
Conversation
seathatflowsinourveins
deleted the
foundation/strict-paper-url-gates-20261013
branch
October 13, 2026 18:10
This was referenced Oct 13, 2026
Merged
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
Lane A's credential gate refused the inventory's valid paper
/v2URL beforepreflight could make a request. Reuse one strict paper-URL normalizer across
credential-source gates and the capacity env reader, accepting the canonical
HTTPS paper authority with no explicit port and paths empty,
/,/v2or/v2/.Every request still uses its existing pinned paper destination.
the README, credential decision/correction, and owner-derived source/evidence bindings.
is changed by the code PR.
SOTA sources
alpacahq/alpaca-py v0.44.0,
verified mirror pin cc4cb3b7ba50ae250e621983c2779047fb16bb28:
common/enums.py:9
pins TRADING_PAPER; common/rest.py:36,64,107-109
stores and appends API version v2 separately. Env spelling never becomes
the request destination.
Merged #1069 capacity correction,
reference commit 3acbb95: strict component
parsing and raw control/delimiter refusal. Its parser is replaced by the
shared helper; internal CapacityConfig remains canonical-only.
Existing credential-source design
and this correction:
fixed reasons, explicit source selection, env-key removal and ownership/
storage gates remain enforced.
RFC 3986 section 3.2.2: hosts are case-insensitive; this authority gate deliberately requires exact lowercase canonical spelling, and refuses every explicit port under the CC ruling. Capacity is now stricter than fix(trading): accept paper host version paths in capacity env URLs #1069's optional-443 rule.
Evidence-class table
/v2in credential/source selectionLocal commands run
Bounded run used the engine Python 3.12.3 venv and idle scope. Portable command
spelling below; the private lane report retains the absolute interpreter argv.
New tests use fake credential values only, outside Git. Initial diagnostic and
operating handoff evidence remain private; no provider text, account identifier
or private home path is copied into the PR. No new dependency is added.
CC review correction
Every explicit port, including
:443, is now refused. Empty path,/,/v2and/v2/remain accepted;/v2//is refused. The README and decision records state the exact policy, and both displaced test-class docstrings are restored.The final refusal regressions fail on unchanged 3b6279f production bytes for all four default-port paths across the shared normalizer/reason gate, both real guarded file loaders and capacity. Additional case, foreign-host userinfo and Unicode cases already refused at that head; their tests pin existing behavior. Unicode credential-file inputs hit the existing encoding refusal before capacity parsing. These are synthetic checks, with no broker calls.
Round 2 corrects the remaining contradictory sentence in the credential
decision's earlier dated correction: it now says NO explicit port and paths
empty,
/,/v2or/v2/, matching the implementation and later paragraph.Only that document and its evidence hash/bytes changed. The reason-gate and
manifest checks passed (13 tests), and validate.py passed; no parser or test
behavior changed in this documentation round.
Decision record
docs/decisions/2026-10-13-strict-paper-url-gates.md.
The same PR supplies override-free replacement ExecStart forms for preflight,
paper and recover: native credential runner directly starts keychain-env with
the inventory's original value. The temporary child env utility/URL assignment
is absent from all three replacements. Co-op materializes their exact ids,
paths and properties in a NEW sealed operating record at a merged pin;
this builder does not edit the sealed old-pin records or active units.
Follow-ups
inputs; synthetic URL tests do not claim a ready broker preflight.
3986 capture/provenance; verify the fix(trading): accept paper host version paths in capacity env URLs #1069 hyperlink in the offline packet.
retain their fail-before assertions and pinned Python docstring citation.
republication uses generic host labels without changing its evidence meaning.
Host evidence
Not applicable; no evidence/hosts changes.
Checklist