Add CN growth sleeves and lifecycle gates#34
Conversation
Co-Authored-By: Codex <noreply@openai.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77160feb4a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| resolved_dividend = dict(DIVIDEND_DEFAULT_CONFIG) | ||
| resolved_dividend.update(dividend_config or {}) | ||
|
|
||
| resolved_growth_weight = growth_weight if growth_weight is not None else stock_weight |
There was a problem hiding this comment.
Preserve stock_weight overrides
Because the new catalog/manifest defaults always include growth_weight=0.50, callers that merge defaults with a runtime override for the legacy stock_weight key can no longer change the growth sleeve: e.g. stock_weight=0.30 still arrives here with growth_weight=0.50, so the combo allocates 50% to growth instead of the requested 30%. This silently corrupts existing combo experiments/configs that still use the old knob; either avoid defaulting both aliases or make an explicit stock_weight override update the resolved growth weight.
Useful? React with 👍 / 👎.
| kwargs = { | ||
| "universe_symbols": DEFAULT_UNIVERSE_SYMBOLS, | ||
| "defensive_symbols": DEFAULT_DEFENSIVE_SYMBOLS, | ||
| "benchmark_symbol": DEFAULT_BENCHMARK_SYMBOL, |
There was a problem hiding this comment.
Enable the growth benchmark gate by default
These new growth sleeves wrap industry_etf_rotation_core.compute_latest_signal, where benchmark_symbol is ignored unless enable_benchmark_risk_off is true. Since the default kwargs set only benchmark_symbol, the advertised benchmark risk-off path never runs for default ChiNext/STAR evaluations or combo sub-legs; in a CSI300 downtrend they keep ranking offensive ETFs instead of switching to the defensive symbols. Add the enable flag to both growth wrappers/default configs.
Useful? React with 👍 / 👎.
|
|
||
| DEFAULT_BENCHMARK_SYMBOL = base.DEFAULT_BENCHMARK_SYMBOL | ||
| DEFAULT_DEFENSIVE_SYMBOLS = base.DEFAULT_DEFENSIVE_SYMBOLS | ||
| DEFAULT_UNIVERSE_SYMBOLS = (CHINEXT_ETF_SYMBOL, CSI1000_ETF_SYMBOL) |
There was a problem hiding this comment.
Keep growth sleeve universes board-specific
For the new ChiNext profile, DEFAULT_UNIVERSE_SYMBOLS includes CSI1000_ETF_SYMBOL, which is a broad CSI1000 ETF rather than a ChiNext instrument (and the STAR wrapper has the same problem by including CHINEXT_ETF_SYMBOL). In normal risk-on evaluations these profiles can select the non-board ETF, so a caller asking for a board-specific sleeve or combo leg gets exposure outside the advertised universe and a skewed growth allocation.
Useful? React with 👍 / 👎.
| resolved_stock = dict(STOCK_DEFAULT_CONFIG) | ||
| resolved_stock.update(stock_config or {}) | ||
| resolved_growth = dict(GROWTH_DEFAULT_CONFIG) | ||
| resolved_growth.update(stock_config or {}) |
There was a problem hiding this comment.
Translate legacy stock_config overrides
Existing combo callers can still pass the legacy flat stock_config shape, but this now merges keys like top_n or target_annual_volatility beside the nested chinext/star configs while the sub-strategy calls only read those nested dicts. In that scenario the override is silently dropped and the growth legs run with defaults, changing configured research runs without warning; translate flat overrides to both sleeves or reject them explicitly.
Useful? React with 👍 / 👎.
Summary
Validation
PYTHONPATH=src:/Users/lisiyi/Projects/QuantPlatformKit/src python3 -m pytest -q tests/test_catalog.py tests/test_entrypoints.py tests/test_runtime_adapters.py tests/test_cn_equity_combo.pygit diff --check origin/main...HEAD