SAFETY-135 round 2: the first guard stop in a period may restart once; tests and docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
66d8777b39
commit
4066624cce
@@ -65,11 +65,16 @@ print("1. no usable forecast: byte-identical to 5a4cdc2 (P3 option A)")
|
||||
# OPT-15 head: a charge end now holds the loop at the house's level (F2). With
|
||||
# that hold and its reseed switched off they equal 5a4cdc2's again; the others
|
||||
# (no charge) never moved.
|
||||
# SAFETY-135: n1_ch re-pinned. A first guard stop no longer latches, so while
|
||||
# the charge waits its reason reads "(peak)" where the latch said
|
||||
# "(headroom)"; no command moves. With SAFETY-135 off it is OPT-15's pin
|
||||
# again (checked below).
|
||||
N1_CH_OPT15 = "97893a54f8a8e3f36ad24f100973b3ff35766527e7287a6ae30cc1c8941bac02"
|
||||
BASE_DIGESTS = {
|
||||
"n1_ls":
|
||||
"13f11c330263c91625acde7628426ff16dae3a9af99aebeef3051dc5b5a884ea",
|
||||
"n1_ch":
|
||||
"97893a54f8a8e3f36ad24f100973b3ff35766527e7287a6ae30cc1c8941bac02",
|
||||
"5d529f516307e4da4dca48714ee891332a2eea5e1b1763f0f1e049cfb0819a0a",
|
||||
"n2_sf_ls":
|
||||
"9424e1837b805a6a31293a28b8fbad6ba611ea0bfe3240d636d68d62dc5e9f22",
|
||||
"n2_ch_ls":
|
||||
@@ -81,7 +86,7 @@ BASE_DIGESTS = {
|
||||
"n1_ls_fc_down":
|
||||
"13f11c330263c91625acde7628426ff16dae3a9af99aebeef3051dc5b5a884ea",
|
||||
"n1_ch_fc_down":
|
||||
"97893a54f8a8e3f36ad24f100973b3ff35766527e7287a6ae30cc1c8941bac02",
|
||||
"5d529f516307e4da4dca48714ee891332a2eea5e1b1763f0f1e049cfb0819a0a",
|
||||
"n2_sf_ls_fc_down":
|
||||
"9424e1837b805a6a31293a28b8fbad6ba611ea0bfe3240d636d68d62dc5e9f22",
|
||||
"n2_ch_ls_fc_down":
|
||||
@@ -98,6 +103,38 @@ for k, v in BASE_DIGESTS.items():
|
||||
check(f"{k}: pinned digest (5a4cdc2; OPT-15 for the _ch ones)",
|
||||
got.get(k) == v)
|
||||
check("every scenario is pinned", set(got) == set(BASE_DIGESTS))
|
||||
|
||||
|
||||
class _Every:
|
||||
"""SAFETY-135 off: a stop period equal to every period, so every guard
|
||||
stop latches as before."""
|
||||
|
||||
def __eq__(self, other):
|
||||
return True
|
||||
|
||||
def __ne__(self, other):
|
||||
return False
|
||||
|
||||
|
||||
def _s135_off_digest(scn):
|
||||
from app import main as _m
|
||||
real = _m.Controller.__init__
|
||||
|
||||
def init(self, *a, **k):
|
||||
real(self, *a, **k)
|
||||
self._charge_stop = (_Every(), float("-inf"))
|
||||
young, restart = modetrade.YOUNG_S, modetrade.RESTART_S
|
||||
_m.Controller.__init__ = init
|
||||
modetrade.YOUNG_S = modetrade.RESTART_S = 0.0
|
||||
try:
|
||||
return ident.p3.digest(ident.run(**ident.SCENARIOS[scn])[0])
|
||||
finally:
|
||||
_m.Controller.__init__ = real
|
||||
modetrade.YOUNG_S, modetrade.RESTART_S = young, restart
|
||||
|
||||
|
||||
check("n1_ch with SAFETY-135 off is OPT-15's pin: only the reason word moved",
|
||||
_s135_off_digest("n1_ch") == N1_CH_OPT15)
|
||||
for k in [k for k in got if k.endswith("_fc_down")]:
|
||||
check(f"{k}: a set but unavailable forecast equals no forecast",
|
||||
got[k] == got[k[:-len('_fc_down')]])
|
||||
|
||||
Reference in New Issue
Block a user