fix(research): apply CN parameters and reject failed promotion reviews - #254
Merged
Conversation
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.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.
CN proxy backtests previously recorded candidate parameters while only applying min_history_days. The runner now forwards the actual parameters, preserves an explicitly empty defensive universe, and retains warmup by observed trading dates instead of weekday offsets. The reproduced holiday case retained 211 observations where 225 were requested.
The existing pilot now exposes a bounded optimize(drift, budget) callback for the 510300/510500/cash example through BacktestOrchestrator and run_grid_search. It searches at most 12 combinations over three parameter keys, with a baseline and up to three development diagnostics. Explicit development inputs, calendar coverage and warmup are required; holdout prices are excluded, failed trials are retained, and missing inputs park without synthetic fallback. Signals also check their actually visible history before firing: a reproduced month-end case previously called a 220-day strategy with only 219 prior dates. Current-day prices and duplicate asset rows cannot satisfy that warmup.
Validation: 71 tests and 4 subtests passed on the currently pinned QPK, with two HITL integration tests explicitly skipped because that pin lacks the cycle. Seven bad-input cases passed after the final nullable-price regression. Those two integration tests separately passed against the frozen QPK source now proposed in QuantStrategyLab/QuantPlatformKit#595. Full Ruff and diff checks passed. Independent review found no new P1/P2.
The final warmup/accounting regression slice passed 64 tests and 4 subtests across four related files, with the same two explicit HITL integration skips. It covers the exact history threshold, later rebalances, next-trading-day execution and cash→ETF→cash commission conservation. The current pin already runs the full 12-combination learning search and contains the strict runner protocol; missing HITL cycle and CN's unimplemented strict runner are separate limitations.
This is a close-only learning proxy, not promotion-grade or live evidence. Existing legacy Tencent CSV artifacts lack the verified license/adjustment manifest required by the strict publisher. Real executable accounting, strict WFA/OOS, approved forward paired-shadow inputs and eventual QPK package adoption remain outstanding. No provider request, model call, broker connection, deployment or dependency-pin upgrade is included.
The evidence-gate caller also rejects every nonzero review-process exit, including exit 1 and termination by a signal. A successful later artifact no longer hides an earlier failed review. Five regression tests with eight subtests use real local synthetic child processes; the primary agent independently reproduced the old exit-1 success and reran the fixed tests. Existing explicit skips, optional-script behavior, validators and dependency pins remain unchanged.