src/oold/validation/resolve.py is about 500 lines covering document loading, $ref dereferencing and schema bounding. referencing is already a dependency and is already used for the meta-schema registry in src/oold/validation/meta_store.py, so part of this is hand-rolled where a library the project already ships would do.
What the module does, and what referencing covers
| Responsibility |
Covered by referencing |
| Normalise dict / Path / str / JSON text / URL to a base URI |
yes, largely |
Remote fetch with disk cache and offline=True |
no |
dereference() producing a materialised graph with shared and circular refs |
no, resolution is lazy during validation |
bound_schema() cutting that graph into a finite tree |
no |
The last two are why the module exists in this form: instance generation and round-trip need a concrete finite document, not lazy lookup at validation time.
Work
- Move the URI normalisation and retrieval layer onto
referencing, keeping Resolver's cache and offline behaviour as the retrieve hook
- Leave
dereference() and bound_schema() in place unless a replacement provides the same graph semantics
- Measure the reduction; if it is small, close this and record why
Constraint
$ref resolution feeds every check, so all parity verdicts must be re-checked: OOLD_SCHEMA_DIR=../oold-schema uv run pytest -m parity. Cut markers from bound_schema() are observable in generated instances, so the round-trip fixtures are also a gate.
Raised from review of #114 (comment).
src/oold/validation/resolve.pyis about 500 lines covering document loading,$refdereferencing and schema bounding.referencingis already a dependency and is already used for the meta-schema registry insrc/oold/validation/meta_store.py, so part of this is hand-rolled where a library the project already ships would do.What the module does, and what
referencingcoversreferencingoffline=Truedereference()producing a materialised graph with shared and circular refsbound_schema()cutting that graph into a finite treeThe last two are why the module exists in this form: instance generation and round-trip need a concrete finite document, not lazy lookup at validation time.
Work
referencing, keepingResolver's cache and offline behaviour as the retrieve hookdereference()andbound_schema()in place unless a replacement provides the same graph semanticsConstraint
$refresolution feeds every check, so all parity verdicts must be re-checked:OOLD_SCHEMA_DIR=../oold-schema uv run pytest -m parity. Cut markers frombound_schema()are observable in generated instances, so the round-trip fixtures are also a gate.Raised from review of #114 (comment).