Skip to content

Enable paper monthly execution dedup#140

Merged
Pigbibi merged 1 commit into
mainfrom
codex/paper-monthly-dedup
Jun 5, 2026
Merged

Enable paper monthly execution dedup#140
Pigbibi merged 1 commit into
mainfrom
codex/paper-monthly-dedup

Conversation

@Pigbibi
Copy link
Copy Markdown
Collaborator

@Pigbibi Pigbibi commented Jun 5, 2026

Summary

  • Enable execution dedup by default for LongBridge PAPER account scope, including paper-account live mode.
  • Treat successful no-action execution reports as completed for dedup fallback.
  • Scope prior report scans to the signal month and match monthly snapshot dates from diagnostics.signal_snapshot.

Why

Monthly snapshot strategies may be triggered repeatedly inside the monthly execution window, but once a paper monthly signal has completed or produced a successful no-action result, later invocations should not generate another execution attempt.

Validation

  • PYTHONPATH=.:/home/ubuntu/Projects/QuantPlatformKit/src:/home/ubuntu/Projects/UsEquityStrategies/src:/home/ubuntu/Projects/HkEquityStrategies/src /tmp/qsl-pytest-venv/bin/python -m pytest -q tests/test_execution_state.py tests/test_runtime_composer.py::test_runtime_composer_builds_runtime_and_config_from_local_builders tests/test_rebalance_service.py::RebalanceServiceNotificationTests::test_run_strategy_skips_when_execution_marker_already_exists tests/test_rebalance_service.py::RebalanceServiceNotificationTests::test_run_strategy_skips_when_prior_report_matches_execution_signal

@Pigbibi Pigbibi merged commit 7e96acc into main Jun 5, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/paper-monthly-dedup branch June 5, 2026 01:40
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf6b230b27

ℹ️ 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".

execution_dedup_enabled=resolve_execution_dedup_enabled(
env_reader=self.env_reader,
dry_run_only=self.dry_run_only,
account_scope=self.account_region,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the runtime target account scope for PAPER defaults

When a deployment is described by RUNTIME_TARGET_JSON with account_scope: "PAPER" but keeps ACCOUNT_REGION as a market/region such as HK or US, this passes the region into resolve_execution_dedup_enabled, so the new PAPER default never activates for live paper-account runs. The runtime target already carries the account-scope field, so the default should be based on that value (falling back to the region only when no target scope exists) to match the intended PAPER account scope behavior.

Useful? React with 👍 / 👎.

effective = _first_non_empty(effective_date)
if not signal and not effective:
return False
month_segment = _month_segment(signal, effective)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid scanning the signal month as the only report month

This narrows prior-report fallback to the signal month, but runtime reports are persisted under the run started_at month, not necessarily the signal snapshot month. For monthly snapshots whose signal date is from the previous month but the execution/report is produced during the next month's execution window, this searches the previous-month prefix and misses the successful current-month report, allowing a duplicate execution attempt despite the fallback.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant