Skip to content

Adopt real-schema idiom + generate HTML schema reference with xs3p#10

Merged
IanMayo merged 2 commits into
mainfrom
feature/real-schema-idiom
Jun 19, 2026
Merged

Adopt real-schema idiom + generate HTML schema reference with xs3p#10
IanMayo merged 2 commits into
mainfrom
feature/real-schema-idiom

Conversation

@IanMayo

@IanMayo IanMayo commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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:

  1. The hand-rolled Markdown/Mermaid schema documenter violated configure, don't create and produced near-empty output on the real schema's idiom (no-namespace, XSD 1.1, salami-slice, xs:all, global-element refs). → switched to the off-the-shelf xs3p stylesheet.
  2. The mock schema didn't resemble the real one, so the whole pipeline was built on assumptions that don't hold. → realigned the mock to the real idiom (with invented names) and reworked the pipeline to match.

Documenter (xs3p)

  • Vendored tools/xs3p/ (stylesheet unmodified + LICENSE.html + provenance README).
  • New schema_html.py runs xs3p via lxml; make gen-schema-docs emits docs/reference/schema/index.html (deterministic → CI drift-checked).
  • Removed schema_docs.py + test_schema_docs.py; added test_schema_html.py.
  • ADR 0010 records the switch; ADR 0009 marked superseded-in-part. Docs links/prose updated.

Schema + pipeline

  • schema/acoustic_dataset.xsd rewritten: no targetNamespace, XSD 1.1, salami-slice (all-global + ref), xs:all, an enumeration value type, no inheritance.
  • Regenerated xsdata models (wrapper-per-element); rewrote mapping.py and serialize.py (unqualified XML); regenerated golden + migration-safety reference fixtures; updated tests. validate.py was 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

IanMayo and others added 2 commits June 19, 2026 09:48
…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
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-19 10:00 UTC

@IanMayo IanMayo merged commit df37c89 into main Jun 19, 2026
3 checks passed
@IanMayo IanMayo deleted the feature/real-schema-idiom branch June 19, 2026 10:00
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