gates: the today-override announces itself; malformed no longer swallowed
gates / gates (push) Successful in 15s
gates / gates (push) Successful in 15s
Part 6 of the hub-blindness task, separable and done rather than dropped. Both due_checks_gate.py and instructions_gate.py read FELHOM_GATE_TODAY so their suites can control "today", and neither said so. A shell that still has it exported -- exactly what a session doing gate-test work leaves behind -- made both gates evaluate against a fabricated date and pass in SILENCE. That is this project's own named failure class: an instrument that can quietly return the wrong answer is not a measurement. The seam is legitimate and stays; the silence was the defect. Both now print a loud line naming the variable, its value, and that the real date is being ignored, before any verdict. And instructions_gate.py no longer swallows a MALFORMED override: it used to fall through to the real date without a word while due_checks_gate.py already exited 2 on the same input -- one variable, two gates, disagreeing about what a mistake means. Both exit 2 now. Tests extended in both suites (42 and 73 assertions, green). Red-proof: the announcement was deleted from due_checks_gate.py and its two assertions were seen failing, then reverted. Also adds REPORT-hub-blindness.md (topic-suffixed; the shared REPORT.md is left alone per the parallel-session rule).
This commit is contained in:
@@ -211,6 +211,27 @@ def test_g_gate_is_registered_in_the_runner():
|
||||
"due_checks_gate.py" in out)
|
||||
|
||||
|
||||
|
||||
# ── Part 6 — the today-override must ANNOUNCE itself ─────────────────────────────────────────
|
||||
def test_override_announces_itself():
|
||||
"""A shell that still has FELHOM_GATE_TODAY exported must not be able to fake a run in silence."""
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
reg = make_register(tmp, HEADER + "| R-341 | 2099-01-01 | far future |\n")
|
||||
rc, out = run_gate(reg, today="2026-08-20")
|
||||
check("P6: valid override is announced", "FELHOM_GATE_TODAY=2026-08-20" in out and "IS SET" in out)
|
||||
check("P6: the announcement says the real date is being ignored",
|
||||
"NOT" in out and "real UTC date" in out)
|
||||
check("P6: announcing does not change the verdict", rc == 0, "rc=%d" % rc)
|
||||
|
||||
|
||||
def test_malformed_override_is_inconclusive_not_a_silent_fallback():
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
reg = make_register(tmp, HEADER + "| R-341 | 2099-01-01 | far future |\n")
|
||||
rc, out = run_gate(reg, today="not-a-date")
|
||||
check("P6: malformed override exits 2", rc == 2, "rc=%d" % rc)
|
||||
check("P6: names the variable and the bad value", "FELHOM_GATE_TODAY" in out and "not-a-date" in out)
|
||||
|
||||
|
||||
def main():
|
||||
print("test_due_checks_gate")
|
||||
for fn in sorted((v for k, v in globals().items() if k.startswith("test_")),
|
||||
|
||||
Reference in New Issue
Block a user