Repository navigation
test: cover reference scopes at non-property locations - #127
Conversation
OP#8 and OP#12 reference-scope comparison was only exercised on top-level properties, but README §9.6.3 requires the same dialect-aware traversal at every schema location, including array-item schemas and allOf branches. Add OP#12 derivation and OP#8 evolution cases that place the same pattern- and entity-reference operands under array items (narrowing/equal/widening), plus an OP#12 case where a reference nested in a property's own allOf is conjoined with a sibling branch. Each uses the §9.6.2 RESOURCE ⊊ FAMILY and entity T ⊋ D operand pairs; docstrings state the expected verdict and the failure mode of a properties-only implementation. Signed-off-by: Artifizer <artifizer@gmail.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Derivation scope checks tests/test_op12_type_derivation_validation.py |
Tests check whether pattern, type, and instance reference scopes in array items are equal to or narrower than base scopes. They also check that widening is rejected and that a pattern-reference constraint in a property’s allOf is preserved. |
Compatibility scope checks tests/test_op8_compatibility_checking.py |
Tests check compatibility results for widening, narrowing, and equal pattern, type, and instance reference scopes in array items. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Suggested reviewers: aviator5
Merge Risk: 
Minimal · up to 67716
-
No merge-blocking concern is established for the added reference-scope tests; merge after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Summary
OP#8 (evolution) and OP#12 (derivation) reference-scope comparison was only exercised with reference keywords on top-level properties. README §9.6.3 requires the same dialect-aware traversal at every schema location — explicitly "array-item schemas" and composition branches — so a conformant implementation must apply the kind/coverage-aware subset comparison there too.
This adds conformance cases for the two locations that traversal is most likely to miss:
test_op12_type_derivation_validation.py)test_pattern_ref_derivation_compares_array_items—x-gts-pattern-refunder arrayitems(narrowing/equal/widening).test_entity_ref_derivation_compares_array_items—x-gts-type-ref/x-gts-instance-refunderitems.test_pattern_ref_derivation_conjoins_allof_within_a_property— a reference nested in a property's ownallOf, conjoined with a sibling branch, must not be dropped.test_op8_compatibility_checking.py)test_pattern_ref_evolution_compares_array_itemsandtest_entity_ref_evolution_compares_array_items— the same operands underitems, in both compatibility directions.All cases reuse the existing §9.6.2
RESOURCE ⊊ FAMILYand entityT ⊋ Doperand pairs and are parametrized across the three dialects. Docstrings and per-row comments state the expected verdict and the failure mode of a properties-only implementation.Test plan
items/allOfscopes (57 new cases).allOfcases) — confirming the tests exercise the gap rather than passing vacuously.Summary by CodeRabbit