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
26 changes: 15 additions & 11 deletions docs/strategy_plugin_runtime_contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,21 @@ The shared kit owns plugin compatibility through a registry-style
a plugin supports; they should call the shared parser/loader and let it reject
unsupported mounts or artifacts.

The default registry currently defines:

| Plugin | Supported strategies | Supported mode | Escalated alert channel |
| --- | --- | --- | --- |
| `crisis_response_shadow` | `tqqq_growth_income`, `soxl_soxx_trend_income` | `shadow` | `email`, `sms`, `push`, `telegram` |
| `taco_rebound_shadow` | `tqqq_growth_income` | `shadow` | `email`, `sms`, `push`, `telegram` |

`taco_rebound_shadow` is notification-only. Its artifact may escalate a
manual-review alert when a TACO-style rebound context is active, but it must not
recommend position size, mutate live allocation, or imply broker order
permission.
The default registry currently defines versioned plugin contracts:

| Plugin | Schema versions | Supported strategies | Status | Supported mode | Escalated alert channel |
| --- | --- | --- | --- | --- | --- |
| `market_regime_control` | `market_regime_control.v1` | `tqqq_growth_income`, `soxl_soxx_trend_income` | default | `shadow` | `email`, `sms`, `push`, `telegram` |
| `crisis_response_shadow` | `crisis_response_shadow.v1` | `tqqq_growth_income`, `soxl_soxx_trend_income` | deprecated; successor `market_regime_control` | `shadow` | `email`, `sms`, `push`, `telegram` |
| `macro_risk_governor` | `macro_risk_governor.v1` | `tqqq_growth_income` | deprecated; successor `market_regime_control` | `shadow` | `email`, `sms`, `push`, `telegram` |
| `taco_rebound_shadow` | `taco_rebound_shadow.v2` | `tqqq_growth_income` | deprecated; successor `market_regime_control` | `shadow` | `email`, `sms`, `push`, `telegram` |

Deprecated plugins remain loadable for historical backtests and staged rollout.
New strategy integrations should mount `market_regime_control` and read the
artifact's `notification` and `position_control` sections. The old TACO artifact
is notification-only. It may escalate a manual-review alert when a TACO-style
rebound context is active, but it must not recommend position size, mutate live
allocation, or imply broker order permission.

To expand a plugin later, update the shared definition or pass an explicit
definition registry into the parser/loader. This keeps future plugin eligibility
Expand Down
12 changes: 12 additions & 0 deletions src/quant_platform_kit/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
CRISIS_RESPONSE_SHADOW_SUPPORTED_STRATEGIES,
DEFAULT_STRATEGY_PLUGIN_DEFINITIONS,
PLUGIN_CRISIS_RESPONSE_SHADOW,
PLUGIN_MARKET_REGIME_CONTROL,
PLUGIN_MACRO_RISK_GOVERNOR,
PLUGIN_TACO_REBOUND_SHADOW,
PLUGIN_MODE_SHADOW,
STRATEGY_PLUGIN_ALERT_CHANNEL_EMAIL,
Expand All @@ -50,7 +52,10 @@
STRATEGY_PLUGIN_ALERT_CHANNEL_TELEGRAM,
STRATEGY_PLUGIN_ALERT_ACTIONS,
STRATEGY_PLUGIN_NON_ALERT_ROUTES,
STRATEGY_PLUGIN_SCHEMA_VERSIONS,
SUPPORTED_STRATEGY_PLUGIN_MODES,
MACRO_RISK_GOVERNOR_SUPPORTED_STRATEGIES,
MARKET_REGIME_CONTROL_SUPPORTED_STRATEGIES,
TACO_REBOUND_SHADOW_SUPPORTED_STRATEGIES,
StrategyPluginAlertMessage,
StrategyPluginDefinition,
Expand All @@ -70,6 +75,7 @@
should_alert_strategy_plugin_signal,
translate_strategy_plugin_value,
validate_strategy_plugin_compatibility,
validate_strategy_plugin_schema_version,
validate_strategy_plugin_signal_payload,
)

Expand All @@ -81,6 +87,8 @@
"DEFAULT_TERMINAL_FUNDING_BLOCK_SKIP_REASONS",
"DEFAULT_TERMINAL_STRATEGY_RUN_STAGES",
"PLUGIN_CRISIS_RESPONSE_SHADOW",
"PLUGIN_MARKET_REGIME_CONTROL",
"PLUGIN_MACRO_RISK_GOVERNOR",
"PLUGIN_TACO_REBOUND_SHADOW",
"PLUGIN_MODE_SHADOW",
"STAGE_COMPLETED",
Expand All @@ -98,7 +106,10 @@
"STRATEGY_PLUGIN_ALERT_CHANNEL_TELEGRAM",
"STRATEGY_PLUGIN_ALERT_ACTIONS",
"STRATEGY_PLUGIN_NON_ALERT_ROUTES",
"STRATEGY_PLUGIN_SCHEMA_VERSIONS",
"SUPPORTED_STRATEGY_PLUGIN_MODES",
"MACRO_RISK_GOVERNOR_SUPPORTED_STRATEGIES",
"MARKET_REGIME_CONTROL_SUPPORTED_STRATEGIES",
"TACO_REBOUND_SHADOW_SUPPORTED_STRATEGIES",
"filter_execution_blocking_skips",
"is_terminal_funding_block",
Expand Down Expand Up @@ -136,5 +147,6 @@
"translate_strategy_plugin_value",
"translator_uses_zh",
"validate_strategy_plugin_compatibility",
"validate_strategy_plugin_schema_version",
"validate_strategy_plugin_signal_payload",
]
Loading