7878 import os
7979 import subprocess
8080 import sys
81- from us_equity_strategies import resolve_canonical_profile
81+ from pathlib import Path
82+
83+ from quant_platform_kit.common.strategies import derive_strategy_artifact_paths
84+ from us_equity_strategies import get_strategy_catalog, resolve_canonical_profile
8285
8386 profile = os.environ.get("STRATEGY_PROFILE", "").strip().lower()
8487 if not profile:
@@ -97,6 +100,16 @@ jobs:
97100 if not selected.get("eligible") or not selected.get("enabled"):
98101 raise SystemExit(f"STRATEGY_PROFILE={profile!r} is not eligible/enabled: {selected}")
99102
103+ artifact_paths = derive_strategy_artifact_paths(
104+ get_strategy_catalog(),
105+ canonical_profile,
106+ repo_root=Path.cwd(),
107+ )
108+ has_bundled_strategy_config = bool(
109+ artifact_paths.bundled_config_path is not None
110+ and Path(artifact_paths.bundled_config_path).exists()
111+ )
112+
100113 output_path = os.environ["GITHUB_OUTPUT"]
101114 with open(output_path, "a", encoding="utf-8") as output:
102115 output.write(
@@ -108,6 +121,9 @@ jobs:
108121 output.write(
109122 f"requires_strategy_config_path={str(bool(selected.get('requires_strategy_config_path'))).lower()}\n"
110123 )
124+ output.write(
125+ f"has_bundled_strategy_config={str(has_bundled_strategy_config).lower()}\n"
126+ )
111127 PY
112128
113129 - name : Validate HK env sync inputs
@@ -116,6 +132,7 @@ jobs:
116132 REQUIRES_SNAPSHOT_ARTIFACTS : ${{ steps.strategy_requirements.outputs.requires_snapshot_artifacts }}
117133 REQUIRES_SNAPSHOT_MANIFEST_PATH : ${{ steps.strategy_requirements.outputs.requires_snapshot_manifest_path }}
118134 REQUIRES_STRATEGY_CONFIG_PATH : ${{ steps.strategy_requirements.outputs.requires_strategy_config_path }}
135+ HAS_BUNDLED_STRATEGY_CONFIG : ${{ steps.strategy_requirements.outputs.has_bundled_strategy_config }}
119136 run : |
120137 set -euo pipefail
121138
@@ -155,7 +172,9 @@ jobs:
155172 missing_vars+=("LONGBRIDGE_FEATURE_SNAPSHOT_MANIFEST_PATH")
156173 fi
157174
158- if [ "${REQUIRES_STRATEGY_CONFIG_PATH:-}" = "true" ] && [ -z "${LONGBRIDGE_STRATEGY_CONFIG_PATH:-}" ]; then
175+ if [ "${REQUIRES_STRATEGY_CONFIG_PATH:-}" = "true" ] \
176+ && [ -z "${LONGBRIDGE_STRATEGY_CONFIG_PATH:-}" ] \
177+ && [ "${HAS_BUNDLED_STRATEGY_CONFIG:-}" != "true" ]; then
159178 missing_vars+=("LONGBRIDGE_STRATEGY_CONFIG_PATH")
160179 fi
161180
@@ -355,7 +374,10 @@ jobs:
355374 import os
356375 import subprocess
357376 import sys
358- from us_equity_strategies import resolve_canonical_profile
377+ from pathlib import Path
378+
379+ from quant_platform_kit.common.strategies import derive_strategy_artifact_paths
380+ from us_equity_strategies import get_strategy_catalog, resolve_canonical_profile
359381
360382 profile = os.environ.get("STRATEGY_PROFILE", "").strip().lower()
361383 if not profile:
@@ -374,6 +396,16 @@ jobs:
374396 if not selected.get("eligible") or not selected.get("enabled"):
375397 raise SystemExit(f"STRATEGY_PROFILE={profile!r} is not eligible/enabled: {selected}")
376398
399+ artifact_paths = derive_strategy_artifact_paths(
400+ get_strategy_catalog(),
401+ canonical_profile,
402+ repo_root=Path.cwd(),
403+ )
404+ has_bundled_strategy_config = bool(
405+ artifact_paths.bundled_config_path is not None
406+ and Path(artifact_paths.bundled_config_path).exists()
407+ )
408+
377409 output_path = os.environ["GITHUB_OUTPUT"]
378410 with open(output_path, "a", encoding="utf-8") as output:
379411 output.write(
@@ -385,6 +417,9 @@ jobs:
385417 output.write(
386418 f"requires_strategy_config_path={str(bool(selected.get('requires_strategy_config_path'))).lower()}\n"
387419 )
420+ output.write(
421+ f"has_bundled_strategy_config={str(has_bundled_strategy_config).lower()}\n"
422+ )
388423 PY
389424
390425 - name : Validate SG env sync inputs
@@ -393,6 +428,7 @@ jobs:
393428 REQUIRES_SNAPSHOT_ARTIFACTS : ${{ steps.strategy_requirements.outputs.requires_snapshot_artifacts }}
394429 REQUIRES_SNAPSHOT_MANIFEST_PATH : ${{ steps.strategy_requirements.outputs.requires_snapshot_manifest_path }}
395430 REQUIRES_STRATEGY_CONFIG_PATH : ${{ steps.strategy_requirements.outputs.requires_strategy_config_path }}
431+ HAS_BUNDLED_STRATEGY_CONFIG : ${{ steps.strategy_requirements.outputs.has_bundled_strategy_config }}
396432 run : |
397433 set -euo pipefail
398434
@@ -432,7 +468,9 @@ jobs:
432468 missing_vars+=("LONGBRIDGE_FEATURE_SNAPSHOT_MANIFEST_PATH")
433469 fi
434470
435- if [ "${REQUIRES_STRATEGY_CONFIG_PATH:-}" = "true" ] && [ -z "${LONGBRIDGE_STRATEGY_CONFIG_PATH:-}" ]; then
471+ if [ "${REQUIRES_STRATEGY_CONFIG_PATH:-}" = "true" ] \
472+ && [ -z "${LONGBRIDGE_STRATEGY_CONFIG_PATH:-}" ] \
473+ && [ "${HAS_BUNDLED_STRATEGY_CONFIG:-}" != "true" ]; then
436474 missing_vars+=("LONGBRIDGE_STRATEGY_CONFIG_PATH")
437475 fi
438476
0 commit comments