fix: address M3 verifier findings on soak invariants and probe tests
This commit is contained in:
@@ -268,6 +268,26 @@ def inv_errors_classified(rows: list[Row], known_prefixes: tuple[str, ...]) -> N
|
||||
assert not unknown, f"未分类错误前缀: {dict(unknown)}"
|
||||
|
||||
|
||||
def inv_rss_absolute(samples_mb: list[float], *, max_mb: float) -> None:
|
||||
"""P7 不变量⑤(计划 T8): 全程 RSS 绝对值有界(与增长口径互补)。"""
|
||||
assert samples_mb, "RSS 采样为空"
|
||||
peak = max(samples_mb)
|
||||
assert peak < max_mb, f"RSS 峰值 {peak:.1f}MB ≥ 绝对上限 {max_mb}MB"
|
||||
|
||||
|
||||
async def inv_healthy_gates_closed(gate, healthy_names: list[str]) -> None:
|
||||
"""P7 不变量③(计划 T8): 跑后真源熔断门 CLOSED 可准入 = 真源零误熔的
|
||||
机械化终态判据(误熔必由该源失败计数驱动,配合遥测"真源零错误行"覆盖全程)。
|
||||
拿到探针当场归还,不留悬挂。"""
|
||||
for name in healthy_names:
|
||||
decision = await gate.try_enter(name, "scoreboard-healthy-probe")
|
||||
if decision.allowed and decision.is_probe:
|
||||
await gate.release_probe(decision)
|
||||
assert decision.allowed and str(decision.state) == "closed", (
|
||||
f"真源 {name} 跑后门态 {decision.state}(allowed={decision.allowed})——疑似误熔"
|
||||
)
|
||||
|
||||
|
||||
def inv_any_errors(rows: list[Row]) -> None:
|
||||
"""不变量 2c 的兜底形态(P5/P6): 故障源混编池下错误行必然存在。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user