Skip to content

Reject unsafe backtest settings and honor fractional-share controls - #2

Merged
dev-belly merged 1 commit into
mainfrom
codex/20261003-config-contract
Oct 4, 2026
Merged

dev-belly merged 1 commit into
mainfrom
codex/20261003-config-contract

Conversation

@dev-belly

@dev-belly dev-belly commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

A 1.9-session execution lag was silently truncated to one session, string "false" enabled fractional fills, and negative transaction-cost assumptions could increase portfolio NAV. Typed configuration parsing now rejects fractional or boolean session counts, validates supported rebalance schedules and ADV/warmup limits, parses explicit true/false strings, and checks finite nonnegative costs and valid broker participation limits.

Both direct dataclass construction and dictionary-based entry points share the validation. Integer text settings remain supported. A fill regression proves that disabling fractional shares actually produces an integer fill.

Validation: all 1,267 tests pass locally, including the full research pipeline and API integration, with 96% line coverage. The 48 targeted backtest/broker/cost tests include 24 new regression cases and an additional integer-text compatibility check. Ruff, formatting, mypy (63 source files), documentation navigation and diff checks pass. GitHub's Python 3.10–3.12 test jobs and documentation build also pass; the full integration result is tracked by the PR's CI checks.

@dev-belly
dev-belly merged commit 513abc6 into main Oct 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant