|
27 | 27 |
|
28 | 28 | DEFAULT_ARTIFACT_BUCKET_URI = "gs://qsl-runtime-logs-shared" |
29 | 29 | PLATFORM_CONFIG_PATH = ROOT / "platform-config.json" |
30 | | -# Keep this list limited to strategy-scope artifacts that the publisher |
31 | | -# currently produces. QPK may parse broader explicit mounts for forward |
32 | | -# compatibility, but auto mode must not generate missing latest_signal paths. |
33 | | -MARKET_REGIME_CONTROL_PROFILES = frozenset( |
34 | | - { |
35 | | - "tqqq_growth_income", |
36 | | - "soxl_soxx_trend_income", |
37 | | - } |
38 | | -) |
39 | 30 | IBIT_ZSCORE_EXIT_STRATEGY_PROFILE = "ibit_smart_dca" |
40 | | -IBIT_ZSCORE_EXIT_PLUGIN = "ibit_zscore_exit" |
41 | 31 | PLATFORM_DRY_RUN_VARIABLES = { |
42 | 32 | "schwab": "SCHWAB_DRY_RUN_ONLY", |
43 | 33 | "longbridge": "LONGBRIDGE_DRY_RUN_ONLY", |
@@ -616,62 +606,21 @@ def _ibit_zscore_exit_extra_variables( |
616 | 606 |
|
617 | 607 |
|
618 | 608 | def _auto_plugin_mounts(strategy_profile: str, artifact_bucket_uri: str, dca_mode: str = "") -> list[dict[str, Any]]: |
619 | | - prefix = artifact_bucket_uri.rstrip("/") |
620 | | - mounts: list[dict[str, Any]] = [] |
621 | | - if strategy_profile in MARKET_REGIME_CONTROL_PROFILES: |
622 | | - mounts.append( |
623 | | - { |
624 | | - "strategy": strategy_profile, |
625 | | - "plugin": "market_regime_control", |
626 | | - "signal_path": ( |
627 | | - f"{prefix}/strategy-artifacts/us_equity/{strategy_profile}" |
628 | | - "/plugins/market_regime_control/latest_signal.json" |
629 | | - ), |
630 | | - "enabled": True, |
631 | | - "expected_mode": "shadow", |
632 | | - "expected_schema_version": "market_regime_control.v1", |
633 | | - } |
634 | | - ) |
635 | | - if strategy_profile == IBIT_ZSCORE_EXIT_STRATEGY_PROFILE and dca_mode == "smart": |
636 | | - mounts.append( |
637 | | - { |
638 | | - "strategy": strategy_profile, |
639 | | - "plugin": IBIT_ZSCORE_EXIT_PLUGIN, |
640 | | - "signal_path": ( |
641 | | - f"{prefix}/strategy-artifacts/us_equity/{strategy_profile}" |
642 | | - f"/plugins/{IBIT_ZSCORE_EXIT_PLUGIN}/latest_signal.json" |
643 | | - ), |
644 | | - "enabled": True, |
645 | | - "expected_mode": "shadow", |
646 | | - "expected_schema_version": "ibit_zscore_exit.v1", |
647 | | - } |
648 | | - ) |
649 | | - return mounts |
650 | | - |
651 | | - |
652 | | -def _custom_plugin_mounts(raw_json: str) -> list[dict[str, Any]]: |
653 | | - text = str(raw_json or "").strip() |
654 | | - if not text: |
655 | | - return [] |
656 | | - try: |
657 | | - payload = json.loads(text) |
658 | | - except json.JSONDecodeError as exc: |
659 | | - raise ValueError("custom_plugin_mounts_json must be valid JSON") from exc |
660 | | - if isinstance(payload, dict): |
661 | | - payload = payload.get("strategy_plugins", payload.get("plugins")) |
662 | | - if not isinstance(payload, list): |
663 | | - raise ValueError("custom_plugin_mounts_json must be a list or object with strategy_plugins") |
664 | | - return [dict(item) for item in payload] |
| 609 | + """Retire name-based plugin selection without expanding runtime authority.""" |
| 610 | + del strategy_profile, artifact_bucket_uri, dca_mode |
| 611 | + return [] |
665 | 612 |
|
666 | 613 |
|
667 | 614 | def _plugin_mounts(args: argparse.Namespace, strategy_profile: str, dca_mode: str = "") -> list[dict[str, Any]]: |
668 | | - mode = str(args.plugin_mode or "auto").strip().lower() |
| 615 | + mode = str(args.plugin_mode or "none").strip().lower() |
669 | 616 | if mode == "none": |
670 | 617 | return [] |
671 | 618 | if mode == "auto": |
672 | 619 | return _auto_plugin_mounts(strategy_profile, args.artifact_bucket_uri, dca_mode) |
673 | 620 | if mode == "custom": |
674 | | - return _custom_plugin_mounts(args.custom_plugin_mounts_json) |
| 621 | + raise ValueError( |
| 622 | + "legacy custom plugin mounts are retired; a P1/P2/P3-bound strategy_plugin_signal.v2 adapter is required" |
| 623 | + ) |
675 | 624 | raise ValueError(f"unsupported plugin_mode {args.plugin_mode!r}") |
676 | 625 |
|
677 | 626 |
|
@@ -987,11 +936,14 @@ def build_switch_target(args: argparse.Namespace) -> dict[str, Any]: |
987 | 936 | extra_variables.update(_cash_only_extra_variables(args, platform)) |
988 | 937 | extra_variables.update(_option_overlay_extra_variables(args, runtime_target["strategy_profile"])) |
989 | 938 | extra_variables.update(_dca_extra_variables(args, runtime_target["strategy_profile"], dca_controls)) |
| 939 | + effective_plugin_mode = str(args.plugin_mode or "none").strip().lower() |
| 940 | + if effective_plugin_mode == "auto": |
| 941 | + effective_plugin_mode = "none" |
990 | 942 | extra_variables.update( |
991 | 943 | _ibit_zscore_exit_extra_variables( |
992 | 944 | args, |
993 | 945 | runtime_target["strategy_profile"], |
994 | | - str(args.plugin_mode or "auto").strip().lower(), |
| 946 | + effective_plugin_mode, |
995 | 947 | effective_dca_mode, |
996 | 948 | ) |
997 | 949 | ) |
@@ -1059,7 +1011,7 @@ def build_parser() -> argparse.ArgumentParser: |
1059 | 1011 | parser.add_argument("--account-scope", default="") |
1060 | 1012 | parser.add_argument("--service-name", default="") |
1061 | 1013 | parser.add_argument("--execution-windows-json", default="") |
1062 | | - parser.add_argument("--plugin-mode", choices=("auto", "none", "custom"), default="auto") |
| 1014 | + parser.add_argument("--plugin-mode", choices=("auto", "none", "custom"), default="none") |
1063 | 1015 | parser.add_argument("--custom-plugin-mounts-json", default="") |
1064 | 1016 | parser.add_argument("--artifact-bucket-uri", default=DEFAULT_ARTIFACT_BUCKET_URI) |
1065 | 1017 | parser.add_argument("--extra-variables-json", default="", help="JSON object of non-secret extra variables") |
|
0 commit comments