Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ authors = [{ name = "QuantStrategyLab" }]
dependencies = [
"flask>=3.0",
"pandas>=2.0",
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@69a0256934d081b5ef309a885384b9eb9f62cf90",
"cn-equity-strategies @ git+https://github.com/QuantStrategyLab/CnEquityStrategies.git@12c0cd4801060fcb2f9452ffd9a7f48df446ddd0",
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@68fcad8c68ab48a1109d99715f8315af449de493",
"cn-equity-strategies @ git+https://github.com/QuantStrategyLab/CnEquityStrategies.git@33d605622ded78a006efef4297b7e786cadf1a27",
]

[project.optional-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions qsl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ allow_legacy = false
enforce_bundle = true

[qsl.requires]
quant_platform_kit = "69a0256934d081b5ef309a885384b9eb9f62cf90"
cn_equity_strategies = "12c0cd4801060fcb2f9452ffd9a7f48df446ddd0"
quant_platform_kit = "68fcad8c68ab48a1109d99715f8315af449de493"
cn_equity_strategies = "33d605622ded78a006efef4297b7e786cadf1a27"

[qsl.compat]
bundle = "2026.07.3"
18 changes: 13 additions & 5 deletions tests/test_dry_run_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def test_load_platform_runtime_settings_from_env(monkeypatch: pytest.MonkeyPatch
assert settings.market_history_path == market_history_csv


def test_dry_run_cycle_returns_target_weights(monkeypatch: pytest.MonkeyPatch, market_history_csv: str):
def test_dry_run_cycle_fails_closed_on_concentrated_target(
monkeypatch: pytest.MonkeyPatch,
market_history_csv: str,
):
monkeypatch.setenv("STRATEGY_PROFILE", CN_INDUSTRY_ETF_ROTATION_PROFILE)
monkeypatch.setenv("QMT_DRY_RUN_ONLY", "true")
monkeypatch.setenv("QMT_MARKET_HISTORY_PATH", market_history_csv)
Expand All @@ -55,12 +58,14 @@ def test_dry_run_cycle_returns_target_weights(monkeypatch: pytest.MonkeyPatch, m
)
assert report["status"] == "ok"
assert report["strategy_profile"] == CN_INDUSTRY_ETF_ROTATION_PROFILE
assert report["target_weights"]
assert report["order_previews"]
assert report["target_weights"] == {}
assert report["order_previews"] == []
assert report["risk_flags"] == ["rejected:concentration"]
assert report["diagnostics"]["risk_gate"] == "REJECT"
assert report["dry_run_only"] is True


def test_dry_run_cycle_supports_aggressive_industry_profile(
def test_aggressive_industry_profile_fails_closed_on_concentration(
monkeypatch: pytest.MonkeyPatch,
market_history_csv: str,
):
Expand All @@ -86,4 +91,7 @@ def test_dry_run_cycle_supports_aggressive_industry_profile(
)
assert report["status"] == "ok"
assert report["strategy_profile"] == CN_INDUSTRY_ETF_ROTATION_AGGRESSIVE_PROFILE
assert report["target_weights"]
assert report["target_weights"] == {}
assert report["order_previews"] == []
assert report["risk_flags"] == ["rejected:concentration"]
assert report["diagnostics"]["risk_gate"] == "REJECT"
5 changes: 4 additions & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ def test_dry_run_endpoint(client):
assert response.status_code == 200
payload = response.get_json()
assert payload["status"] == "ok"
assert payload["target_weights"]
assert payload["target_weights"] == {}
assert payload["order_previews"] == []
assert payload["risk_flags"] == ["rejected:concentration"]
assert payload["diagnostics"]["risk_gate"] == "REJECT"
4 changes: 2 additions & 2 deletions tests/test_qsl_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ def test_qsl_metadata_has_runtime_platform_fields() -> None:
assert qsl["enforce_bundle"] is True
assert qsl["compat"]["bundle"] == "2026.07.3"
requires = qsl["requires"]
assert requires["quant_platform_kit"] == "69a0256934d081b5ef309a885384b9eb9f62cf90"
assert requires["cn_equity_strategies"] == "12c0cd4801060fcb2f9452ffd9a7f48df446ddd0"
assert requires["quant_platform_kit"] == "68fcad8c68ab48a1109d99715f8315af449de493"
assert requires["cn_equity_strategies"] == "33d605622ded78a006efef4297b7e786cadf1a27"
12 changes: 6 additions & 6 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.