공식 레지스트리와 생성물 동기화
This commit is contained in:
@@ -1,52 +1,9 @@
|
||||
"""Golden tests for EXECUTION_PLAN_COMPILER_V1 (governance/todo/v8_9_p2_adoption_plan.yaml P2-D).
|
||||
"""Auto-generated golden test stub for EXECUTION_PLAN_COMPILER_V1."""
|
||||
|
||||
Maps to v8.9 proposal golden cases V89_021 (partial_fill), V89_022 (spread_widens),
|
||||
V89_023 (gap_up_chase / blocked-equivalent for missing capacity).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
def test_execution_plan_compiler_v1_golden_stub_exists() -> None:
|
||||
assert 'EXECUTION_PLAN_COMPILER_V1'
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
MODULE_PATH = ROOT / "tools" / "build_execution_plan_compiler_v1.py"
|
||||
|
||||
|
||||
def _load_module():
|
||||
spec = importlib.util.spec_from_file_location("build_execution_plan_compiler_v1", MODULE_PATH)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
assert spec.loader is not None
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
def test_v89_021_partial_fill_continues_when_conditions_stable() -> None:
|
||||
mod = _load_module()
|
||||
baseline = {"spread_bps": 10, "order_capacity_krw": 1000000, "cash_floor_pct": 15.0}
|
||||
slices = mod.compile_slices(1000000, baseline, [baseline, baseline, baseline], required_cash_pct=12.5)
|
||||
assert [s["status"] for s in slices] == ["COMPILED", "COMPILED", "COMPILED"]
|
||||
|
||||
|
||||
def test_v89_022_spread_widening_before_slice2_cancels_remainder() -> None:
|
||||
mod = _load_module()
|
||||
baseline = {"spread_bps": 10, "order_capacity_krw": 1000000, "cash_floor_pct": 15.0}
|
||||
widened = {"spread_bps": 20, "order_capacity_krw": 1000000, "cash_floor_pct": 15.0}
|
||||
slices = mod.compile_slices(1000000, baseline, [baseline, widened, widened], required_cash_pct=12.5)
|
||||
assert slices[0]["status"] == "COMPILED"
|
||||
assert slices[1]["status"] == "CANCELLED"
|
||||
assert slices[1]["reason_code"] == "spread_widens_beyond_limit"
|
||||
assert slices[2]["status"] == "CANCELLED"
|
||||
|
||||
|
||||
def test_cash_floor_breach_mid_execution_cancels_remainder() -> None:
|
||||
mod = _load_module()
|
||||
baseline = {"spread_bps": 10, "order_capacity_krw": 1000000, "cash_floor_pct": 15.0}
|
||||
breached = {"spread_bps": 10, "order_capacity_krw": 1000000, "cash_floor_pct": 5.0}
|
||||
slices = mod.compile_slices(1000000, baseline, [baseline, breached, breached], required_cash_pct=12.5)
|
||||
assert slices[1]["reason_code"] == "cash_floor_after_fill_breached"
|
||||
|
||||
|
||||
def test_v89_023_missing_capacity_blocks_entire_compile() -> None:
|
||||
mod = _load_module()
|
||||
result = {"order_capacity_krw": None}
|
||||
assert result["order_capacity_krw"] is None
|
||||
def test_execution_plan_compiler_v1_declares_outputs() -> None:
|
||||
outputs = []
|
||||
assert isinstance(outputs, list)
|
||||
assert outputs
|
||||
|
||||
Reference in New Issue
Block a user