Skip to content

feat(validation): accept a checkout as a meta-schema source - #132

Merged
simontaurus merged 1 commit into
mainfrom
feat/local-meta-source
Aug 24, 2026
Merged

feat(validation): accept a checkout as a meta-schema source#132
simontaurus merged 1 commit into
mainfrom
feat/local-meta-source

Conversation

@simontaurus

Copy link
Copy Markdown
Contributor

The blocker for replacing validate.mjs in oold-schema's CI.

The problem

Every route this package has to a meta-schema is a released tag or refs/heads/main:

selector resolves to
latest, 0.7.0, ... a vendored release tag
remote refs/heads/main, and its file list carries no oold-rules.json at all

So a rule added on a branch is invisible to both. The rule.* checks bound to it skip, each reporting that the version never stated it, and the run passes. The pull request that introduces a rule is the one run that cannot enforce it. Pointing oold-schema's CI at this validator without fixing that would be a straight regression against validate.mjs, which reads the working tree.

The change

--meta <path> loads the meta-schemas and the catalogue from a checkout. Both the repository root and its meta/ directory work.

A selector is treated as a path by being a directory, not by a prefix, so --meta ../oold-schema reads the way a path should and no tracked version name can collide - none of them is a directory here.

Nothing loaded this way is checksummed, deliberately. These are working files and expected to change, which is the point. load_tracked stays the only route to a released version, so its checksums keep meaning what they say.

Verified against the real repository

Planting an unreleased rule in an oold-schema checkout and reading both sources:

1.0.0-rc.3  rules= 73  CNF rules=[OOLD-CNF-1120, OOLD-CNF-22d3, OOLD-CNF-d71d]
local       rules= 74  CNF rules=[OOLD-CNF-1120, OOLD-CNF-22d3, OOLD-CNF-d71d, OOLD-CNF-dabd]

The vendored release cannot see OOLD-CNF-dabd; the checkout can. Tests cover both selector forms, that the tracked copy is untouched, and that a directory holding no meta-schemas is rejected by name - the likely mistake being a wrong path.

558 tests pass, make check exits 0.

Next

With this in place, oold-schema's CI can run oold validate --meta <working tree> and see every rule in the branch under test. Parity gating (#125 item 1) should land before the swap, so the equivalence claim is enforced at the moment it becomes load-bearing.

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Release preview

Merging this PR would release v0.18.0 (current: v0.17.1).

Changelog preview (truncated)
## v0.18.0 (2026-08-24)

### Features

- **validation**: Accept a checkout as a meta-schema source
  ([`d2b632f`](https://github.com/OO-LD/oold-python/commit/d2b632f820a933ab242a3f2cfd00bbf2cd0901d1))

Preview via python-semantic-release and conventional commits.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Click to see benchmark comparison
📊 Benchmark Comparison (threshold: 1.3x)
============================================================

✅ Performance Improvements:
  ✅ test_core[v1]: 0.0335s → 0.0241s (-28.2%, ratio: 0.72x)

➖ Unchanged (within threshold):
  ➖ test_simple_dict_document_store: 0.0010s → 0.0011s (+7.1%)
  ➖ test_sqlite_document_store: 0.0011s → 0.0011s (-1.7%)
  ➖ test_local_sparql_store: 0.0237s → 0.0258s (+8.6%)
  ➖ test_oneof_subschema: 0.0385s → 0.0365s (-5.1%)
  ➖ test_enum_docstrings: 0.0503s → 0.0417s (-17.1%)
  ➖ test_subclass_inheritance: 0.0362s → 0.0387s (+7.1%)
  ➖ test_class_hierarchy: 0.0413s → 0.0485s (+17.6%)
  ➖ test_core[v2]: 0.0426s → 0.0329s (-22.7%)
  ➖ test_schema_generation[v1]: 0.0010s → 0.0012s (+18.3%)
  ➖ test_schema_generation[v2]: 0.0017s → 0.0020s (+17.2%)
  ➖ test_simple_json: 0.0004s → 0.0005s (+16.0%)
  ➖ test_complex_graph: 0.0009s → 0.0010s (+12.6%)

============================================================
Summary: 0 regressions, 1 improvements, 12 unchanged
============================================================

✅ No significant performance regressions

Threshold: 1.3x (30% slower triggers a regression warning)

Note: Benchmarks are informational only and won't fail the build.

💡 Tip: Download the benchmark-results artifact for detailed JSON data

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- a tracked version is a tag and remote is refs/heads/main, so a rule
  added on a branch was invisible to both: its checks skipped, and the
  PR introducing a rule was the one run that could not enforce it
- --meta <path> reads oold-schema's working tree, catalogue included
- a directory selector is recognised by being a directory, so no tracked
  version name can collide
- nothing here is checksummed, deliberately: these are working files
@simontaurus
simontaurus force-pushed the feat/local-meta-source branch from 5b251c9 to d2b632f Compare August 24, 2026 03:21
@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Click to see benchmark comparison
📊 Benchmark Comparison (threshold: 1.3x)
============================================================

➖ Unchanged (within threshold):
  ➖ test_simple_dict_document_store: 0.0018s → 0.0018s (+1.1%)
  ➖ test_sqlite_document_store: 0.0020s → 0.0019s (-0.8%)
  ➖ test_local_sparql_store: 0.0442s → 0.0447s (+1.2%)
  ➖ test_oneof_subschema: 0.0661s → 0.0656s (-0.8%)
  ➖ test_enum_docstrings: 0.0553s → 0.0554s (+0.1%)
  ➖ test_subclass_inheritance: 0.0602s → 0.0595s (-1.2%)
  ➖ test_class_hierarchy: 0.0575s → 0.0570s (-0.9%)
  ➖ test_core[v1]: 0.0422s → 0.0546s (+29.3%)
  ➖ test_core[v2]: 0.0486s → 0.0484s (-0.4%)
  ➖ test_schema_generation[v1]: 0.0017s → 0.0018s (+2.1%)
  ➖ test_schema_generation[v2]: 0.0030s → 0.0030s (+1.0%)
  ➖ test_simple_json: 0.0007s → 0.0007s (-0.1%)
  ➖ test_complex_graph: 0.0016s → 0.0016s (-0.5%)

============================================================
Summary: 0 regressions, 0 improvements, 13 unchanged
============================================================

✅ No significant performance regressions

Threshold: 1.3x (30% slower triggers a regression warning)

Note: Benchmarks are informational only and won't fail the build.

💡 Tip: Download the benchmark-results artifact for detailed JSON data

@simontaurus
simontaurus merged commit 7a1030e into main Aug 24, 2026
21 checks passed
@simontaurus
simontaurus deleted the feat/local-meta-source branch August 24, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant