Support income layer runtime controls#176
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 346dac2acf
ℹ️ 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".
| if runtime_settings.income_layer_enabled is not None: | ||
| overrides["income_layer_enabled"] = runtime_settings.income_layer_enabled | ||
| if runtime_settings.income_layer_max_ratio is not None: | ||
| overrides["income_layer_max_ratio"] = runtime_settings.income_layer_max_ratio |
There was a problem hiding this comment.
Gate income-layer overrides to compatible profiles
With the pinned UsEquityStrategies runtime used by this repo, the entrypoints merge these overrides into config and call the strategy implementation as **config; soxl_soxx_trend_income.build_rebalance_plan does not accept income_layer_enabled, and tqqq_growth_income.build_rebalance_plan accepts neither of these generic income-layer names. In any environment that sets INCOME_LAYER_ENABLED=false for the semiconductor profile, or sets these generic vars on a TQQQ account, the next evaluation fails with an unexpected-keyword TypeError instead of applying the control. Please only add the keys for profiles whose entrypoints accept them, or update the strategy dependency in the same change.
Useful? React with 👍 / 👎.
| if not validation_only and not force_run and not RUNTIME_SETTINGS.runtime_target_enabled: | ||
| print(f"[{datetime.now()}] Runtime target disabled; skip strategy execution.", flush=True) | ||
| return True |
There was a problem hiding this comment.
Persist a skipped report for disabled targets
When RUNTIME_TARGET_ENABLED=false on a scheduled /run, this returns before start_run(), finalize_runtime_report(), and persist_execution_report(). The heartbeat workflow still checks due Cloud Run services, and the heartbeat script already treats reports with status skipped as acceptable, so a paused account stops writing any accepted report and is treated as missing after the lookback window. Please record a skipped report/log event before returning.
Useful? React with 👍 / 👎.
Summary
Tests