[codex] Add IBIT zscore switch controls#69
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f16031d364
ℹ️ 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 profile == IBIT_ZSCORE_EXIT_STRATEGY_PROFILE and _has_enabled_plugin_mount( | ||
| plugin_mounts, | ||
| strategy_profile=profile, | ||
| plugin=IBIT_ZSCORE_EXIT_PLUGIN, | ||
| ): | ||
| return dict(US_DAILY_SCHEDULER) |
There was a problem hiding this comment.
Keep disabled IBIT mode on the DCA schedule
When a user selects ibit_zscore_exit_mode=disabled while leaving plugin_mode=auto (the console exposes this as “Disabled (buy only)”), _plugin_mounts still auto-mounts ibit_zscore_exit, so this branch returns US_DAILY_SCHEDULER even though the generated variables set IBIT_ZSCORE_EXIT_ENABLED=false. That changes a disabled/buy-only ibit_smart_dca target from the existing monthly DCA window to the daily main/probe cron, so ordinary DCA runs can be attempted every trading day. Gate the daily schedule on the exit mode being paper/live, or disable the mount when the mode is disabled.
Useful? React with 👍 / 👎.
| } else if ("ibit_zscore_exit_mode" in nextOption) { | ||
| delete nextOption.ibit_zscore_exit_mode; |
There was a problem hiding this comment.
Preserve saved IBIT mode when sync payload omits it
For IBIT accounts, this deletes ibit_zscore_exit_mode whenever the sync input lacks that field. The existing workflow sync payload in .github/workflows/manual-strategy-switch.yml only forwards DCA fields from extra_variables (lines 398-402), so a manual workflow run that posts to /api/internal/sync-account-default will clear a previously saved paper/disabled IBIT mode even though the builder may have just applied IBIT runtime controls. Treat a missing mode as “leave unchanged” or include the mode in the workflow sync payload.
Useful? React with 👍 / 👎.
Summary
ibit_zscore_exitplugin foribit_smart_dca, expose paper/live/disabled modes, and keep direct runtime variable writes guarded behind typed control fields.Test Plan
git diff-tree --check --no-commit-id --root -r HEADpython3 scripts/runtime_settings.py validatepython3 -m unittest discover -s tests -vpython3 scripts/check_internal_dependency_matrix.py --projects-root .. --jsonpython3 scripts/sync_strategy_switch_page_asset.py && git diff --exit-code -- web/strategy-switch-console/page_asset.js web/strategy-switch-console/strategy_profiles_asset.jsjq empty web/strategy-switch-console/strategy-profiles.example.jsonnode tests/strategy_switch_worker_validation.mjssed -n '/<script>/,/<\/script>/p' web/strategy-switch-console/index.html | sed '1d;$d' | node --check --input-type=commonjsnode --check --input-type=module < web/strategy-switch-console/page_asset.jsnode --check --input-type=module < web/strategy-switch-console/strategy_profiles_asset.jsnode --check --input-type=module < web/strategy-switch-console/worker.js