SAFETY-107 review: test a writer that turns round on a dead pack; say when rule 3 applies
checks / unit (pull_request) Successful in 35m22s
infra-pin / fresh (pull_request) Successful in 2s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 03:52:39 +02:00
co-authored by Claude Opus 5.5
parent d12228d986
commit 848140c29f
2 changed files with 15 additions and 1 deletions
@@ -37,7 +37,10 @@ probe, exactly as before the change. Then:
while another writer is; while another writer is;
2. it does not: the refusal ends, logged "another writer", or "the battery 2. it does not: the refusal ends, logged "another writer", or "the battery
gives power" when the reading shows it (it was "another writer" before); gives power" when the reading shows it (it was "another writer" before);
3. it finds the other direction: end, then a new start, as before. 3. it finds the other direction: end, then a new start, as before. In
practice 2 comes first: SAFETY-94's evidence restarts when the ask changes
sign, so a writer that turns round ends the refusal at once and the other
way is learned ~12 cycles later (`test_safety107.py` part 3e).
**Why this rule.** The end now means what SAFETY-52 meant by it: the refusal no **Why this rule.** The end now means what SAFETY-52 meant by it: the refusal no
longer describes what is on the wire, judged by the same test that learns it. longer describes what is on the wire, judged by the same test that learns it.
+11
View File
@@ -272,6 +272,17 @@ check("the refusal carries over to the loop with no line",
check("the first probe after the writer left comes PROBE_EVERY_S later", check("the first probe after the writer left comes PROBE_EVERY_S later",
close[0] is not None and bool(probes) close[0] is not None and bool(probes)
and probes[0] >= close[0] + control.PROBE_EVERY_S - 10.0) and probes[0] >= close[0] + control.PROBE_EVERY_S - 10.0)
# e. A writer turns round on a dead pack with no gap. The evidence restarts
# on the new sign (SAFETY-94), so the old refusal ends at once and the
# other way is learned once, ~12 cycles later.
rows, log, _ = run(1, plant=lambda u, t, cmd: (
-2.0 - int(t) % 3 if u == "a" else round(cmd)), house=lambda t: 2000.0,
maint=False, trade=lambda t: 2000.0 if t < 300.0 else -2000.0)
e = ends(log)
print(" " + " / ".join(f"{x[0]:.0f} s {x[1][:45]}" for x in lines(log)))
check("a writer turns round on a dead pack: one end, then the other way",
len(lines(log)) == 3 and len(e) == 1 and 300.0 < e[0][0] < 400.0
and present(nth(rows, -1)) and nth(rows, -1)[4] == -1)
# ============================================================================== # ==============================================================================
print("\n4. not covered: a perfectly flat reading under a writer") print("\n4. not covered: a perfectly flat reading under a writer")