Adopt real-schema idiom + generate HTML schema reference with xs3p#10
Merged
Conversation
…xs3p Two coordinated changes so the pipeline and docs are built against the real (proprietary) contract's shape rather than a convenient stand-in. Documenter — configure, don't create: - Replace the hand-rolled Markdown/Mermaid schema_docs.py (which broke on the real schema's idiom) with the off-the-shelf xs3p XSLT stylesheet, run via lxml. Vendored under tools/xs3p/ (DPL-1.1 license + provenance README). - `make gen-schema-docs` now emits docs/reference/schema/index.html, which is byte-deterministic and stays under the CI drift gate. - Add ADR 0010; mark ADR 0009 superseded in part. Add schema_html.py + test_schema_html.py; drop schema_docs.py + test_schema_docs.py. Schema + pipeline — match the real idiom: - Rewrite schema/acoustic_dataset.xsd to mirror the real contract's structure (invented names): no targetNamespace, XSD 1.1, salami-slice (all elements global + xs:element ref=...), xs:all, an enumeration value type, no inheritance. - Regenerate xsdata models (wrapper class per element); rewrite mapping.py to construct them and serialize.py to emit unqualified XML; regenerate the golden + migration-safety reference fixtures; update affected tests. Verified on Python 3.9.13: ruff + mypy + pytest (41) + mkdocs --strict green; model and HTML regeneration byte-idempotent (drift gate stable). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…diom # Conflicts: # docs/concepts/pipeline-data-flow.md # docs/how-to/change-the-schema.md # docs/index.md # docs/onboarding.md # docs/reference/index.md # docs/reference/schema/index.md # mkdocs.yml # src/acoustic_dataset/mapping.py # src/acoustic_dataset/schema_docs.py # tests/integration/test_gates.py # tests/integration/test_schema_docs.py # tests/unit/test_typed_vs_dict.py
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two course-corrections made while standing the pipeline up against the real (proprietary) contract, which can't be committed but which we can run tooling against locally:
xs:all, global-elementrefs). → switched to the off-the-shelf xs3p stylesheet.Documenter (xs3p)
tools/xs3p/(stylesheet unmodified +LICENSE.html+ provenance README).schema_html.pyruns xs3p via lxml;make gen-schema-docsemitsdocs/reference/schema/index.html(deterministic → CI drift-checked).schema_docs.py+test_schema_docs.py; addedtest_schema_html.py.Schema + pipeline
schema/acoustic_dataset.xsdrewritten: no targetNamespace, XSD 1.1, salami-slice (all-global +ref),xs:all, an enumeration value type, no inheritance.mapping.pyandserialize.py(unqualified XML); regenerated golden + migration-safety reference fixtures; updated tests.validate.pywas already XSD 1.1.Verification
Python 3.9.13:
ruff✅ ·mypy✅ · 41 tests ✅ ·mkdocs --strict✅ · model + HTML regeneration byte-idempotent ✅Note — licensing
xs3p is licensed under the DSTC Public License 1.1 (MPL-derived weak copyleft), distinct from this repo's license and scoped to
tools/xs3p/. Worth a conscious sign-off.🤖 Generated with Claude Code