ee3e799de1
주요 변경: - tools/build_rebalance_engine_v1.py: REBALANCE_ENGINE_V1 신규 * account_snapshot 직접 합산(_build_snap_position_map) → 소수주 분리 행 병합 * 레짐 소스 macro.REGIME_PRELIM 최우선 (GAS 와 동일) - src/gas_adapter_parts/gdf_06_rebalance.gs: runRebalanceSheet_() 신규 * Logger.log / getSpreadsheet_() 로 run_all 연동 수정 - src/gas_adapter_parts/gdc_01_fetch_fundamentals.gs * _mergePositionRecord_(): 소수주 중복 행 합산 신규 * parseInt → parseFloat (qty, availQty) - src/gas_adapter_parts/gdf_01_price_metrics.gs * 미보유 종목 SELL_READY → WATCH_EXIT_SIGNAL - spec/41_release_dag.yaml: build_rebalance_sheet 노드 추가 (step_count 63) - spec/51_formula_lifecycle_registry.yaml: REBALANCE_ENGINE_V1 등록 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
57 lines
1.6 KiB
Python
57 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
import json
|
|
import yaml
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
def main():
|
|
registry_path = ROOT / "spec" / "48_module_io_contract_registry.yaml"
|
|
out_path = ROOT / "Temp" / "module_io_coverage_v1.json"
|
|
|
|
if not registry_path.exists():
|
|
print(f"Registry not found: {registry_path}")
|
|
return 1
|
|
|
|
with registry_path.open("r", encoding="utf-8") as f:
|
|
data = yaml.safe_load(f)
|
|
|
|
modules = data.get("modules", {})
|
|
total = len(modules)
|
|
covered = 0
|
|
|
|
module_details = []
|
|
for mid, m in modules.items():
|
|
# Check if schema and artifact exist
|
|
schema_exists = (ROOT / m["schema"]).exists()
|
|
artifact_exists = (ROOT / m["artifact_path"]).exists()
|
|
|
|
is_covered = schema_exists and artifact_exists
|
|
if is_covered:
|
|
covered += 1
|
|
|
|
module_details.append({
|
|
"id": mid,
|
|
"schema_exists": schema_exists,
|
|
"artifact_exists": artifact_exists,
|
|
"covered": is_covered
|
|
})
|
|
|
|
coverage_pct = (covered / total * 100) if total > 0 else 0
|
|
|
|
result = {
|
|
"formula_id": "MODULE_IO_COVERAGE_V1",
|
|
"total_modules": total,
|
|
"covered_modules": covered,
|
|
"coverage_pct": coverage_pct,
|
|
"module_details": module_details
|
|
}
|
|
|
|
out_path.parent.mkdir(parents=True, exist_ok=True)
|
|
out_path.write_text(json.dumps(result, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
print(f"Coverage: {coverage_pct:.1f}%")
|
|
return 0
|
|
|
|
if __name__ == "__main__":
|
|
main()
|