diff --git a/decision_mapper.py b/decision_mapper.py index 760537b..fa3ade8 100644 --- a/decision_mapper.py +++ b/decision_mapper.py @@ -388,7 +388,13 @@ def _build_weight_translation_annotations( else None ), signal_date=( - str(execution_annotations.get("signal_date") or diagnostics.get("signal_date") or "").strip() or None + str( + execution_annotations.get("signal_date") + or diagnostics.get("signal_date") + or diagnostics.get("snapshot_as_of") + or "" + ).strip() + or None ), effective_date=( str(execution_annotations.get("effective_date") or diagnostics.get("effective_date") or "").strip() diff --git a/main.py b/main.py index b050ca6..8c39b46 100644 --- a/main.py +++ b/main.py @@ -295,6 +295,15 @@ def _summarize_cycle_result_for_report(cycle_result, *, dry_run: bool) -> dict: summary["quote_snapshot"] = { "quotes": [dict(snapshot) for snapshot in quote_snapshots], } + execution = dict(getattr(cycle_result, "execution", {}) or {}) + for field in ( + "signal_date", + "effective_date", + "execution_timing_contract", + "execution_calendar_source", + ): + if execution.get(field) not in (None, ""): + summary[field] = execution[field] return summary diff --git a/pyproject.toml b/pyproject.toml index 7752e6c..b329c1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "google-cloud-storage", "google-auth", "longport==3.0.23", - "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@92458590a463e7219f0369a3505031ee74414135", + "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@9618b4bd8e179760ac174914713598762cab15d7", "us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@17ddb86c72d44b2c7b78ba7a10d8f71b21180166", "hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@b6a8ac2ad3c8110b5ea74fb059c8206388d63bcd", ] @@ -61,5 +61,5 @@ include = [ [tool.uv] override-dependencies = [ - "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@92458590a463e7219f0369a3505031ee74414135", + "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@9618b4bd8e179760ac174914713598762cab15d7", ] diff --git a/qsl.toml b/qsl.toml index 3be3731..51cb53c 100644 --- a/qsl.toml +++ b/qsl.toml @@ -5,7 +5,7 @@ upgrade_ring = "ring_d" allow_legacy = false [qsl.requires] -quant_platform_kit = "92458590a463e7219f0369a3505031ee74414135" +quant_platform_kit = "9618b4bd8e179760ac174914713598762cab15d7" us_equity_strategies = "17ddb86c72d44b2c7b78ba7a10d8f71b21180166" hk_equity_strategies = "b6a8ac2ad3c8110b5ea74fb059c8206388d63bcd" diff --git a/tests/test_decision_mapper.py b/tests/test_decision_mapper.py index 2f0deab..62f9bf0 100644 --- a/tests/test_decision_mapper.py +++ b/tests/test_decision_mapper.py @@ -483,6 +483,7 @@ def test_translates_weight_decision_for_russell_strategy(self): "signal_description": "risk on", "status_description": "breadth=62.0% | regime=risk_on | benchmark=up", "benchmark_symbol": "SPY", + "snapshot_as_of": "2026-07-31", }, ) snapshot = PortfolioSnapshot( @@ -506,6 +507,7 @@ def test_translates_weight_decision_for_russell_strategy(self): self.assertEqual(plan["allocation"]["targets"]["AAPL"], 2550.0) self.assertEqual(plan["allocation"]["targets"]["BOXX"], 1700.0) self.assertEqual(plan["execution"]["signal_display"], "risk on") + self.assertEqual(plan["execution"]["signal_date"], "2026-07-31") self.assertEqual( plan["execution"]["status_display"], "breadth=62.0% | regime=risk_on | benchmark=up", diff --git a/tests/test_request_handling.py b/tests/test_request_handling.py index 1e17559..d8e66e9 100644 --- a/tests/test_request_handling.py +++ b/tests/test_request_handling.py @@ -854,6 +854,10 @@ def test_cycle_result_summary_counts_dry_run_order_previews(self): skip_logs=("skip",), note_logs=("note",), action_done=True, + execution={ + "signal_date": "2026-07-31", + "execution_timing_contract": "monthly_snapshot_window", + }, dry_run_orders=( {"symbol": "02800.HK", "side": "buy", "quantity": 100, "status": "dry_run"}, {"symbol": "03033.HK", "side": "buy", "quantity": 200, "status": "dry_run"}, @@ -872,6 +876,8 @@ def test_cycle_result_summary_counts_dry_run_order_previews(self): self.assertEqual(summary["orders_skipped_count"], 1) self.assertEqual(summary["notes_count"], 1) self.assertTrue(summary["dry_run_order_preview_available"]) + self.assertEqual(summary["signal_date"], "2026-07-31") + self.assertEqual(summary["execution_timing_contract"], "monthly_snapshot_window") self.assertEqual(summary["orders_previewed"][0]["symbol"], "02800.HK") self.assertEqual(summary["quote_snapshot"]["quotes"][0]["symbol"], "02800.HK") diff --git a/uv.lock b/uv.lock index 84ef5bc..c382f3f 100644 --- a/uv.lock +++ b/uv.lock @@ -17,7 +17,7 @@ resolution-markers = [ ] [manifest] -overrides = [{ name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=92458590a463e7219f0369a3505031ee74414135" }] +overrides = [{ name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=9618b4bd8e179760ac174914713598762cab15d7" }] [[package]] name = "blinker" @@ -727,7 +727,7 @@ requires-dist = [ { name = "pytest", marker = "extra == 'test'" }, { name = "pytest-cov", marker = "extra == 'test'" }, { name = "pytz" }, - { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=92458590a463e7219f0369a3505031ee74414135" }, + { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=9618b4bd8e179760ac174914713598762cab15d7" }, { name = "requests" }, { name = "ruff", marker = "extra == 'test'" }, { name = "us-equity-strategies", git = "https://github.com/QuantStrategyLab/UsEquityStrategies.git?rev=17ddb86c72d44b2c7b78ba7a10d8f71b21180166" }, @@ -1210,7 +1210,7 @@ wheels = [ [[package]] name = "quant-platform-kit" version = "0.10.0" -source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=92458590a463e7219f0369a3505031ee74414135#92458590a463e7219f0369a3505031ee74414135" } +source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=9618b4bd8e179760ac174914713598762cab15d7#9618b4bd8e179760ac174914713598762cab15d7" } [[package]] name = "requests"