Skip to content

fix(trading): accept paper host version paths in capacity env URLs - #1069

Merged
seathatflowsinourveins merged 1 commit into
mainfrom
codex/ns2604-capacity-paper-url-20261013
Oct 13, 2026
Merged

seathatflowsinourveins merged 1 commit into
mainfrom
codex/ns2604-capacity-paper-url-20261013

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

Scope

Accept the paper host's /v2 env-file form while keeping every request pinned to transport.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 existing non_paper_base_url refusal.

  • Base commit: 107bcca66133db379e9bf31560ba617519c59bec (fresh origin/main).
  • Lane: lane:trading.
  • Owned paths: blueprints/us-equities/order-throughput/capacity.py, tests/test_order_throughput.py, and that test's hash/byte registration in manifests/evidence.json.
  • One commit, as directed. No real credential file was read and no broker request was made.

SOTA sources

Evidence-class table

Claim Evidence class Command / receipt
Current main refuses the paper /v2 form synthetic red-main.log: same new regression against unmodified main production source; CLI refuses with non_paper_base_url
The fix accepts all eight path/port combinations and normalizes to PAPER_URL synthetic green-url.log: fake-key, mode-0600 env files under /var/tmp pass the actual credential-file ownership gate, URL reader and config validation
The CLI accepts /v2 through its URL gate without a broker call synthetic It reaches a planted STOP guard instead of non_paper_base_url; receipt config is canonical PAPER_URL, fake broker call log is empty
Live host, lookalikes, /v1, /v2/extra, HTTP, 8443, userinfo and query still refuse synthetic Same regression; also empty query/fragment delimiters, fragments, repeated slash, malformed/empty port and control/whitespace inputs
Existing capacity behavior remains covered local_integration Complete tests.test_order_throughput: 79 tests, exit 0, one pre-existing isolated-SDK skip
Registered evidence integrity passes local_integration scripts/validate.py: 71 components, 11878 hashes, 4 profiles, 240 receipts; manifest ordering check passes

Local commands run

TMPDIR=<task /var/tmp scratch> python3 -m unittest tests.test_order_throughput.PaperEnvURLTests -v
main production source: exit 1, CLI non_paper_base_url; 1 failure / 7 errors
fixed production source: exit 0, 3 tests / 0.055 seconds

TMPDIR=<task /var/tmp scratch> python3 -m unittest tests.test_order_throughput -v
exit 0, 79 tests / 7.997 seconds, 1 existing skip

TMPDIR=<task /var/tmp scratch> python3 scripts/validate.py
exit 0; 71 components, 11878 hashed files, 4 profiles, 240 receipts

python3 scripts/evidence_manifest.py --check
exit 0

git diff --check
exit 0

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.py has no current files[] 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_url call site (the CLI and tests), missing/invalid env values, strict internal config validation, and the unchanged request transport. The CLI no longer uses rstrip('/'), 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

  • No GitHub Actions or workflow permissions changed.
  • No real credentials read, printed or committed; only fake-key temporary fixtures were used.
  • No broker request, paid hosting or new billing surface was introduced.
  • Peer-owned files and worktrees were preserved.

@seathatflowsinourveins seathatflowsinourveins added the lane:trading Trading lane: sim, paper and live north star label Oct 13, 2026
@seathatflowsinourveins
seathatflowsinourveins marked this pull request as ready for review October 13, 2026 09:10
@seathatflowsinourveins
seathatflowsinourveins merged commit d605683 into main Oct 13, 2026
31 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the codex/ns2604-capacity-paper-url-20261013 branch October 13, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:trading Trading lane: sim, paper and live north star

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant