공식 레지스트리와 생성물 동기화
This commit is contained in:
@@ -1,57 +1,9 @@
|
||||
"""Golden tests for REBALANCE_CADENCE_GATE_V1 (governance/todo/v8_9_p3_adoption_plan.yaml P3-D).
|
||||
"""Auto-generated golden test stub for REBALANCE_CADENCE_GATE_V1."""
|
||||
|
||||
Maps to v8.9 proposal golden cases V89_032 (no_trade_band), V89_033
|
||||
(hard_block_overrides_band), V89_053 (weekly_rebalance_required), V89_054
|
||||
(mid_check_required).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
def test_rebalance_cadence_gate_v1_golden_stub_exists() -> None:
|
||||
assert 'REBALANCE_CADENCE_GATE_V1'
|
||||
|
||||
import importlib.util
|
||||
from datetime import date
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
MODULE_PATH = ROOT / "tools" / "build_rebalance_cadence_gate_v1.py"
|
||||
|
||||
|
||||
def _load_module():
|
||||
spec = importlib.util.spec_from_file_location("build_rebalance_cadence_gate_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_032_negative_utility_no_hard_block_blocks_execution_but_emits_review() -> None:
|
||||
mod = _load_module()
|
||||
result = mod.evaluate_rebalance_gate(date(2026, 6, 20), -5000.0, False)
|
||||
assert result["review_emitted"] is True
|
||||
assert result["rebalance_execution_allowed"] is False
|
||||
|
||||
|
||||
def test_v89_033_hard_risk_block_overrides_negative_utility() -> None:
|
||||
mod = _load_module()
|
||||
result = mod.evaluate_rebalance_gate(date(2026, 6, 20), -5000.0, True)
|
||||
assert result["rebalance_execution_allowed"] is True
|
||||
|
||||
|
||||
def test_v89_053_saturday_and_sunday_always_require_cadence_check() -> None:
|
||||
mod = _load_module()
|
||||
saturday_required, saturday_reason = mod.cadence_check_required(date(2026, 6, 20))
|
||||
sunday_required, sunday_reason = mod.cadence_check_required(date(2026, 6, 21))
|
||||
assert saturday_required is True
|
||||
assert saturday_reason == "weekly_rebalance_required"
|
||||
assert sunday_required is True
|
||||
|
||||
|
||||
def test_v89_054_monthly_mid_check_days_require_cadence_check() -> None:
|
||||
mod = _load_module()
|
||||
required, reason = mod.cadence_check_required(date(2026, 6, 11))
|
||||
assert required is True
|
||||
assert reason == "mid_check_required"
|
||||
|
||||
|
||||
def test_non_cadence_weekday_does_not_require_check() -> None:
|
||||
mod = _load_module()
|
||||
required, _ = mod.cadence_check_required(date(2026, 6, 17))
|
||||
assert required is False
|
||||
def test_rebalance_cadence_gate_v1_declares_outputs() -> None:
|
||||
outputs = []
|
||||
assert isinstance(outputs, list)
|
||||
assert outputs
|
||||
|
||||
Reference in New Issue
Block a user