-
Notifications
You must be signed in to change notification settings - Fork 2
Native OO-LD validator driven by the specification rule catalogue #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
80ee29a
8e96921
f39b280
3030aa8
71c734c
8c965d6
988bc38
4fdda5e
26ceba9
264d71e
3ba00a6
08b9945
3b497b5
57c1945
f6fcbbb
bd34c1b
ca11109
a7a7f3c
92524af
6589527
793aaa1
ebc3907
fb99f5c
cbcf95a
5bcd043
09ede4a
bee7204
13ade19
5a6b6d7
fc4de8c
5feef83
7875b51
18a952c
c5d9324
6897095
ef375d3
b4e23ac
561d0b8
65d2ce3
7050e8b
2a03e2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Files copied verbatim from the oold-schema repository at a release tag must keep their exact | ||
| # bytes: `src/oold/validation/meta/index.json` records a sha256 for each vendored meta-schema, and | ||
| # the fixtures are refreshed by copying bytes straight out of a tag. With `core.autocrlf=true` - | ||
| # the Windows default - git would rewrite their line endings on checkout, silently breaking those | ||
| # checksums and making every refresh from upstream show a whole-file diff. | ||
| src/oold/validation/meta/*/** -text | ||
| tests/data/oold/** -text |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,6 +224,6 @@ benchmark_comparison.txt | |
| */osw_files/* | ||
|
|
||
| # Local | ||
| CLAUDE.md | ||
| AGENTS.md | ||
| .ign | ||
| graphify-out/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "mcpServers": { | ||
| "oold-validation": { | ||
| "command": "uv", | ||
| "args": [ | ||
| "run", | ||
| "--directory", | ||
| ".", | ||
| "python", | ||
| "-m", | ||
| "oold.validation.mcp_server" | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Working in this repository | ||
|
|
||
| Guidance for AI agents. Human contributors want the published contributing guide | ||
| ([docs/contributing.md](docs/contributing.md)), which this file does not repeat. | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| make check # lint, type-check, dependency audit | ||
| make test # pytest with coverage | ||
| make validate # run the validator over the committed fixtures | ||
| make docs-test # strict docs build, fails on any warning | ||
|
|
||
| OOLD_SCHEMA_DIR=../oold-schema uv run pytest -m parity # compare against oold-schema's own validator | ||
| ``` | ||
|
|
||
| The parity tests skip silently without `OOLD_SCHEMA_DIR`, so a green `make test` does not mean | ||
| parity holds. Run them explicitly when touching `src/oold/validation/`. | ||
|
|
||
| ## Where the details live | ||
|
|
||
| This file used to carry the validation subsystem's invariants, the vendoring rules for the | ||
| meta-schemas, and this repository's working conventions directly. They now live in the published | ||
| docs, redistributed by topic so each is maintained in one place: | ||
|
|
||
| - **Validation subsystem design** - the two identifier systems, why severity is read from the | ||
| rule catalogue rather than hardcoded, why a check skips rather than guesses, why checks judge | ||
| the resolved context, why check ids are a public interface, and why this repository and | ||
| oold-schema stay decoupled: [docs/architecture.md, "Validation subsystem design"](docs/architecture.md#validation-subsystem-design). | ||
| - **Vendored meta-schemas and fixtures** - byte-exactness, line endings, and how to add a | ||
| version: [docs/maintaining-meta-schemas.md](docs/maintaining-meta-schemas.md). | ||
| - **Working conventions** - commit style and releases, no AI attribution, regular dashes, and not | ||
| creating scratch files: [docs/contributing.md, "Conventions"](docs/contributing.md#conventions). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should avoid spreading between root level markdown and published docs => move all content in docs, keep shallow references in files like CONTRIBUTING.md + concise (overview/simple getting started only) root-level README that points to the docs
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,136 +1,11 @@ | ||
| # Contributing | ||
|
|
||
| Contributions are welcome! You can help by reporting bugs, implementing features, or improving documentation. File issues and PRs at [github.com/OO-LD/oold-python](https://github.com/OO-LD/oold-python). | ||
|
|
||
| ## Development Setup | ||
|
|
||
| Requires `uv` and `git`. | ||
|
|
||
| ```bash | ||
| git clone git@github.com:YOUR_NAME/oold-python.git | ||
| cd oold-python | ||
| ``` | ||
|
|
||
| With `make`: | ||
|
|
||
| ```bash | ||
| make install | ||
| ``` | ||
|
|
||
| Without `make`: | ||
|
|
||
| ```bash | ||
| uv sync --all-extras | ||
| uv run pre-commit install | ||
| ``` | ||
|
|
||
| `pre-commit install` installs both the `pre-commit` and `commit-msg` stage hooks | ||
| (via `default_install_hook_types`); the latter enforces Conventional Commits (see | ||
| below). | ||
|
|
||
| ## Making Changes | ||
|
|
||
| 1. Create a branch: `git checkout -b name-of-your-fix` | ||
| 2. Make your changes and add tests in `tests/` | ||
| 3. Run checks and tests (see below) | ||
| 4. Commit and push, then open a pull request | ||
|
|
||
| ### Checks and tests | ||
|
|
||
| With `make`: | ||
|
|
||
| ```bash | ||
| make check # lint, type-check, dependency audit | ||
| make test # pytest with coverage | ||
| ``` | ||
|
|
||
| Without `make`: | ||
|
|
||
| ```bash | ||
| uv lock --locked | ||
| uv run pre-commit run -a | ||
| uv run ty check | ||
| uv run deptry src | ||
| uv run python -m pytest --cov --cov-config=pyproject.toml --cov-report=xml | ||
| ``` | ||
|
|
||
| ### Docs | ||
|
|
||
| With `make`: | ||
|
|
||
| ```bash | ||
| make docs # serve with live reload at http://localhost:8000 | ||
| make docs-test # strict build, fails on any warning | ||
| ``` | ||
|
|
||
| Without `make`: | ||
|
|
||
| ```bash | ||
| uv run zensical serve | ||
| uv run zensical build -s | ||
| ``` | ||
|
|
||
| ## Commit messages (Conventional Commits) | ||
|
|
||
| This project uses [Conventional Commits](https://www.conventionalcommits.org/). | ||
| Commit messages drive versioning and the changelog automatically, so the format | ||
| matters. The local `commit-msg` hook rejects malformed messages. | ||
|
|
||
| Format: `type(scope): subject`, for example `fix: correct sidebar collapse on | ||
| small screens`. The scope is optional. | ||
|
|
||
| | Type | Release effect | Use for | | ||
| | ---- | -------------- | ------- | | ||
| | `feat` | minor bump | a new feature | | ||
| | `fix` | patch bump | a bug fix | | ||
| | `perf` | patch bump | a performance improvement | | ||
| | `docs`, `chore`, `test`, `refactor`, `ci`, `style`, `build` | no release | changes that do not ship user-facing behavior | | ||
| | `BREAKING CHANGE:` footer, or `!` after the type | major bump | an incompatible change | | ||
|
|
||
| A breaking change is marked either with a `!` (`feat!: drop Python 3.9`) or a | ||
| `BREAKING CHANGE:` footer in the commit body. | ||
|
|
||
| ## Releasing | ||
|
|
||
| Releases are fully automated by python-semantic-release. You do not tag or bump | ||
| the version by hand. | ||
|
|
||
| 1. Open a PR. CI comments the version that a merge would release, based on your | ||
| commits. | ||
| 2. Merge to `main`. On merge, CI reads the new conventional commits, bumps the | ||
| version in `pyproject.toml` and `CITATION.cff`, updates `CHANGELOG.md`, | ||
| commits with `[skip ci]`, and pushes the `vX.Y.Z` tag. | ||
| 3. CI then builds the package, publishes it to PyPI via OIDC trusted publishing, | ||
| and deploys the docs to GitHub Pages. | ||
|
|
||
| If a merge contains only non-releasing commit types (for example `docs` or | ||
| `chore`), no release is cut. The version lives in `pyproject.toml`; never edit it | ||
| manually. | ||
|
|
||
| ## Citation and authorship | ||
|
|
||
| Authors of the project are listed explicitly in [`CITATION.cff`](CITATION.cff). This list is the set of creators shown on each [Zenodo](https://zenodo.org/doi/10.5281/zenodo.8374237) release. We keep it opt-in and curated rather than auto-generated from GitHub, so nobody is listed without consent, and the entries in `CITATION.cff` take precedence over GitHub's automatic contributor detection. | ||
|
|
||
| To be officially listed as an author for future Zenodo releases, add yourself to the `authors:` list in `CITATION.cff`. Two ways, in order of preference: | ||
|
|
||
| 1. **Preferred - within your feature PR:** include the `CITATION.cff` edit directly in the same PR that contributes your feature or fix, so authorship is recorded together with the work. | ||
| 2. **Standalone PR:** if you are already a GitHub contributor and simply want to be listed as an author on Zenodo, open a single PR that only adds your entry. | ||
|
|
||
| In either case, add an entry like: | ||
|
|
||
| ```yaml | ||
| - given-names: Your | ||
| family-names: Name | ||
| affiliation: "Your institution" # optional | ||
| orcid: "https://orcid.org/0000-0000-0000-0000" # optional, use your real ORCID | ||
| ``` | ||
|
|
||
| Notes: | ||
|
|
||
| - Append yourself to the end of the list (order is the citation order); mention it in the PR if a different position is intended. | ||
| - `affiliation` and `orcid` are optional but recommended for durable, unambiguous attribution. | ||
| - Only entries present in `CITATION.cff` at the tagged commit appear on that release's Zenodo record, so add yourself before a release to be included. | ||
|
|
||
| ## AI Guidelines | ||
|
|
||
| We believe that AI, and in particular LLMs, can be helpful conventional tools to accelerate development and improve quality when used responsibly. AI or any other tool is never the author of code; a human developer always is. Therefore, it is mandatory to carefully review all generated content for correctness, quality, and the absence of legal and ethical issues. For consistency, please avoid patterns that are hard to maintain manually, such as duplicated content or special characters like em dashes or UTF icons. | ||
| Contributions are welcome! You can help by reporting bugs, implementing features, or improving | ||
| documentation. File issues and PRs at | ||
| [github.com/OO-LD/oold-python](https://github.com/OO-LD/oold-python). | ||
|
|
||
| The full contributing guide, including development setup, checks and tests, translating a | ||
| specification rule into a check, commit message conventions, the release process, and citation | ||
| and authorship, is published at | ||
| [oo-ld.github.io/oold-python/contributing](https://oo-ld.github.io/oold-python/contributing/) | ||
| (source: [`docs/contributing.md`](docs/contributing.md)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned: no AI only documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reduced to a pointer. The validation invariants moved to
docs/architecture.md("Validation subsystem design"), the vendoring rules todocs/maintaining-meta-schemas.md, the working conventions todocs/contributing.md. What is left is the command list plus links. No file undersrc/ortests/cites it any more.