From 5787f105b534dde780f94ac74a589766ae99adca Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Sun, 5 Jul 2026 04:39:03 +0800 Subject: [PATCH] Support US core combo shadow profile Co-Authored-By: Codex --- pyproject.toml | 2 +- tests/test_runtime_config_support.py | 19 +++++++++++++++++++ uv.lock | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2819b36..ef24930 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "google-cloud-storage", "yfinance", "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@0063af3b4a974650ea58a7d3f26dd1b94f65d3e8", - "us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@cd959e30e91e57697ad878d98799c1afb43bf5fb", + "us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@67e1ed69d7b9c318f94c8809121d2b9481d6b11a", "hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@61993bf261aeccf64b5a75428b9405f4e1d1d682", ] diff --git a/tests/test_runtime_config_support.py b/tests/test_runtime_config_support.py index a0538af..80cc8f0 100644 --- a/tests/test_runtime_config_support.py +++ b/tests/test_runtime_config_support.py @@ -73,6 +73,7 @@ "soxl_soxx_trend_income", "tqqq_growth_income", "us_equity_combo", + "us_equity_combo_core", "us_equity_combo_leveraged", "hk_global_etf_tactical_rotation", "hk_low_vol_dividend_quality_snapshot", @@ -748,6 +749,18 @@ def test_load_platform_runtime_settings_accepts_nasdaq_sp500_smart_dca(monkeypat assert settings.strategy_profile == "nasdaq_sp500_smart_dca" +def test_load_platform_runtime_settings_accepts_us_equity_combo_core(monkeypatch): + monkeypatch.setenv("RUNTIME_TARGET_JSON", runtime_target_json("us_equity_combo_core")) + monkeypatch.setenv("ACCOUNT_GROUP", "paper") + monkeypatch.setenv("IB_ACCOUNT_GROUP_CONFIG_JSON", MINIMAL_GROUP_JSON) + + settings = load_platform_runtime_settings(project_id_resolver=lambda: "project-1") + + assert settings.strategy_profile == "us_equity_combo_core" + assert settings.strategy_display_name == "US Core Combo Shadow" + assert settings.strategy_target_mode == "weight" + + def test_load_platform_runtime_settings_rejects_legacy_qqq_tech_alias(monkeypatch): monkeypatch.setenv("RUNTIME_TARGET_JSON", runtime_target_json("tech_pullback_cash_buffer")) monkeypatch.setenv("ACCOUNT_GROUP", "paper") @@ -788,6 +801,9 @@ def test_platform_profile_status_matrix_matches_current_ibkr_rollout(): assert by_profile["tqqq_growth_income"]["enabled"] is True assert "nasdaq_sp500_smart_dca" in by_profile assert "ibit_smart_dca" in by_profile + assert by_profile["us_equity_combo_core"]["display_name"] == "US Core Combo Shadow" + assert by_profile["us_equity_combo_core"]["eligible"] is True + assert by_profile["us_equity_combo_core"]["enabled"] is True assert by_profile["hk_global_etf_tactical_rotation"] == { "canonical_profile": "hk_global_etf_tactical_rotation", "display_name": "HK Global ETF Tactical Rotation", @@ -834,6 +850,9 @@ def test_print_strategy_profile_status_json_matches_registry(): assert by_profile["global_etf_rotation"]["requires_strategy_config_path"] is False assert "nasdaq_sp500_smart_dca" in by_profile assert "ibit_smart_dca" in by_profile + assert by_profile["us_equity_combo_core"]["profile_group"] == "direct_runtime_inputs" + assert by_profile["us_equity_combo_core"]["input_mode"] == "current_holdings+russell_snapshot" + assert by_profile["us_equity_combo_core"]["requires_strategy_config_path"] is False assert by_profile["us_equity_combo_leveraged"]["profile_group"] == "direct_runtime_inputs" assert by_profile["us_equity_combo_leveraged"]["input_mode"] == "market_data" assert by_profile["us_equity_combo_leveraged"]["requires_strategy_config_path"] is False diff --git a/uv.lock b/uv.lock index 4a7ba91..9c1b094 100644 --- a/uv.lock +++ b/uv.lock @@ -791,7 +791,7 @@ requires-dist = [ { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=0063af3b4a974650ea58a7d3f26dd1b94f65d3e8" }, { name = "requests" }, { name = "ruff", marker = "extra == 'test'" }, - { name = "us-equity-strategies", git = "https://github.com/QuantStrategyLab/UsEquityStrategies.git?rev=cd959e30e91e57697ad878d98799c1afb43bf5fb" }, + { name = "us-equity-strategies", git = "https://github.com/QuantStrategyLab/UsEquityStrategies.git?rev=67e1ed69d7b9c318f94c8809121d2b9481d6b11a" }, { name = "yfinance" }, ] provides-extras = ["test"] @@ -1490,7 +1490,7 @@ wheels = [ [[package]] name = "us-equity-strategies" version = "0.7.60" -source = { git = "https://github.com/QuantStrategyLab/UsEquityStrategies.git?rev=cd959e30e91e57697ad878d98799c1afb43bf5fb#cd959e30e91e57697ad878d98799c1afb43bf5fb" } +source = { git = "https://github.com/QuantStrategyLab/UsEquityStrategies.git?rev=67e1ed69d7b9c318f94c8809121d2b9481d6b11a#67e1ed69d7b9c318f94c8809121d2b9481d6b11a" } dependencies = [ { name = "pandas" }, { name = "pytz" },