Repository navigation
T021 follow-on: the cyclic-schema test asserts only that GateRefused escapes (jsonschema>=4.18) - #55
Conversation
…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 #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 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR removes a brittle jsonschema implementation-detail assertion from the cyclic-schema console test and verifies instead that both cyclic schema variants are refused as GateRefused, preserving the intended behavior across supported jsonschema versions. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test change preserves escaped-exception detection while removing brittle implementation-specific expectations.
Review effort: Balanced
Findings: None
What changed in this PR
Updates cyclic-schema tests to verify the stable GateRefused contract without depending on jsonschema internals.
Changes:
- Applies one prefix assertion to both cyclic schema variants.
- Documents why validation-step and exception details are intentionally excluded.
| File | Description |
|---|---|
tests/test_gate_console_schema_source.py |
Makes cyclic-schema assertions version-independent. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 16 hours and 34 minutes by commenting |
|
|
READY at 38b1912 Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Holder, automatic READY on Brett's word "land lane 3's PRs when green" (2026-10-06). At the head: |
Brings T101 (#48), T098 (#51), T103 (#49), T096 (#53), T100 (#54), T099 (#47), T021's follow-on (#55), T102 (#52), T022 (#41, landed as aefd109), T097 (#50) and T096's follow-on (#56). Conflicted: scripts/composed_placements.py and tests/test_composed_placements.py, both T022's files, which this branch carried from #41 through #44. Main's landed side is kept for both. tests/declared_exclusion.yaml merged clean (T101's entry edits beside T073's header and open_until). Lane: openXfactory-3 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>



Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Authored by lane openXfactory-3, delegated by lane openxfactory-4 (lane4-to-lane3.log 2026-10-06T19:07:30Z; READY note #656 6023492215)
T021 follow-on: the cyclic-schema test asserts only that
GateRefusedescapes (jsonschema>=4.18)The defect
tests/test_gate_console_schema_source.py::test_a_host_schema_the_console_cannot_apply_refuses_as_gate_refusedpinned the exact failure modejsonschemagives a cyclic MAPPING schema: it asserted the refusal text...could not be checked: RecursionError.pyproject.tomlallowsjsonschema>=4.18with no upper bound, so a supported version that refuses the cycle by another route (aSchemaError, aValueError, a changed message) would turn the test red while the console still did its job. Copilot raised it on #40 (r4199337845); the holder classed it an accepted limit under #6565988818366and assigned this follow-on (READY note #6566023492215).The fix
The cyclic mapping now asserts what the cyclic list beside it already asserted: the outcome starts with
GateRefused:. An exception that escaped readsESCAPED ...and fails that prefix. The test's intent is unchanged (a cyclic schema a host supplies refuses asGateRefused, never as another exception); only the version-specific step and exception text are dropped. The product code is untouched:_schema_errorsalready catches any exception at each of its three steps.Files changed:
tests/test_gate_console_schema_source.pyonly (+10 -7).The falsifier, stated plainly
The old assertion does not fail under any released
jsonschemain the supported range today. I installed 10 versions in throwaway venvs (the repository's CI install,pip install -e ".[test]", withjsonschemapinned to each) and ran the same child-interpreter body the test runs:So the defect is latent, not live: no version in 4.18.0 to 4.26.0 breaks the old assertion. What I measured instead is that the old assertion pins a library implementation detail (the exception class and step of a pathological traversal), and what happens when the library changes it.
A simulated library change. A throwaway
sitecustomize(in a copy of the tree, never committed) makesDraft202012Validator.check_schemarefuse a cyclic schema by another route (the cycle becomes aSchemaError, or aValueError), run under 4.18.0 and under 4.26.0, the installed version, old test file against the new:In both, the console still refuses as
GateRefused; only the old assertion's pinned text was wrong.Mutants of the new guard, killed. Throwaway copies of
gate_console.py, run against the NEW test:So the loosened assertion still catches what matters: a cyclic schema whose refusal is not a
GateRefused.Run counts
jsonschemaversions above (4.18.0 to 4.26.0):6 passedeach.python -m pytest -q --deselect <LEFT_OUT>, thepyteststep ofvalidate.yml;FORCE_COLOR,CLICOLOR,PY_COLORS,COLORTERMunset,TERM=dumb; installedjsonschema4.26.0), at this head on6f25915:1161 passed, 4 skipped, 1 deselected. Test count unchanged, so the pinned triple's floors do not move.Ruled / decisions
Ruled: Copilot r4199337845 accepted limit under #656
5988818366; this follow-on assigned by the holder (lane4-to-lane3.log 2026-10-06T19:07:30Z). Decision: take Copilot's one-line remedy as given (assert onlyGateRefusedescapes), not a version cap inpyproject.toml.Not done
pyproject.tomlchange (no upper bound added): the loosened assertion is the remedy.gate_console.py.🤖 Generated with Claude Code
Summary by Sourcery
Make cyclic-schema tests validate the console’s refusal contract without depending on jsonschema-specific exception details.
Enhancements:
GateRefused, independent of jsonschema’s version-specific refusal details.Tests:
GateRefusedprefix assertions.