From a7aee1bb20bbec95aea74250cfdae4f31f4c20ba Mon Sep 17 00:00:00 2001 From: Brett Heap <1513478+brettheap@users.noreply.github.com> Date: Wed, 7 Oct 2026 00:39:04 +0000 Subject: [PATCH] T021 follow-on: the cyclic-schema test asserts only that GateRefused escapes (jsonschema>=4.18) tests/test_gate_console_schema_source.py pinned the exact failure mode jsonschema gives a cyclic MAPPING schema ("could not be checked: RecursionError"). pyproject.toml allows jsonschema>=4.18 with no upper bound, so a supported version that refuses the cycle by another route (a SchemaError, a ValueError, a changed message) would turn the test red while the console still did its job: every such route lands in a GateRefused, because _schema_errors catches any exception at each of its three steps. The cyclic mapping now asserts what the cyclic list beside it already asserted, that the outcome is a GateRefused (an escaped exception reads "ESCAPED ..." and fails the prefix). The test's intent is unchanged; only the version-specific step and exception text are dropped. Refs opensoft/openXdox-code#40 (Copilot r4199337845, accepted limit under openxFactory#656 5988818366, assigned as a follow-on on 2026-10-06). Lane: openXfactory-3 Co-Authored-By: Claude Sonnet 5.5 --- tests/test_gate_console_schema_source.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/test_gate_console_schema_source.py b/tests/test_gate_console_schema_source.py index bb46f24..07d35fb 100644 --- a/tests/test_gate_console_schema_source.py +++ b/tests/test_gate_console_schema_source.py @@ -249,13 +249,16 @@ def test_a_host_schema_the_console_cannot_apply_refuses_as_gate_refused(tmp_path assert out[name].startswith( "GateRefused: the demotion execution receipt schema could not be " "parsed"), out[name] - # A cyclic mapping never finishes the meta-schema check. A cyclic list is - # refused by the check itself under the pinned jsonschema; either way, a - # GateRefused. - assert out["cyclic_mapping"].startswith( - "GateRefused: the demotion execution receipt schema could not be " - "checked: RecursionError"), out["cyclic_mapping"] - assert out["cyclic_list"].startswith("GateRefused: "), out["cyclic_list"] + # A cyclic mapping and a cyclic list must each come out as a GateRefused, + # and that is ALL these two assert. Which refusal each earns, and what it + # wraps, is the installed jsonschema's own behaviour, and `pyproject.toml` + # leaves it open (`jsonschema>=4.18`, no upper bound): the exception a + # cyclic mapping raises from the meta-schema check, and whether the check + # refuses a cyclic list itself, are not this console's contract. So neither + # case names the step it was refused at or the exception it wraps. An + # exception that ESCAPED reads `ESCAPED ...` and fails the prefix. + for name in ("cyclic_mapping", "cyclic_list"): + assert out[name].startswith("GateRefused: "), out[name] def test_the_console_reads_no_schema_from_beside_the_checkout() -> None: