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
8 changes: 7 additions & 1 deletion decision_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 9 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Comment on lines +305 to +306

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep no-order monthly cycles eligible for retry

Only persist this execution identity when the cycle actually placed or previewed an order. As written, a Russell cycle with action_done=False and no skip logs—such as the zero-equity path in _normalize_to_value_target_decision—is saved as a successful report with the snapshot-derived signal_date; _report_matches_execution explicitly treats such clean no-action reports as completed, so if the account is funded later in the same three-day window, has_prior_execution_report suppresses the rebalance for that snapshot even though _should_record_execution_marker deliberately did not record a marker.

Useful? React with 👍 / 👎.

return summary


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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",
]
2 changes: 1 addition & 1 deletion qsl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions tests/test_decision_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions tests/test_request_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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")

Expand Down
6 changes: 3 additions & 3 deletions uv.lock

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