Repository navigation
Closed
Labels
area:devtoolsDevtools and repo control-plane toolingarea:schemaSchematheme:verifiabilitySchema-native proof and evidence architecturetool:codexCodextype:fixBug fix
Description
Problem
verify-schema-roundtrip now exists and is wired into quick verification, but it is still shallow relative to the intended inference-to-validation roundtrip.
Current behavior checks package/catalog structure: package versions, manifest roundtrip through SchemaVersionPackage, element presence, supported elements having schema_file, schema loadability, and root type.
The missing property is stronger: a schema inferred/promoted from representative provider samples should be consumed by the runtime parser/validator against those same kinds of samples.
Design constraints (from comment thread)
- Privacy-safe and deterministic: Use committed, minimized, redacted provider fixtures or generated fixtures, not ad hoc local exports. Must not depend on whatever live private archive happens to be present.
- Dependency order: refactor(manifests): type repo-control manifests and schema catalogs #629 (typed manifests/packages with Pydantic) should land first. Once schema packages use
model_validate(model_dump(original)), corpus-backed verification becomes a clean roundtrip test. - Do not create a second schema-package parser: Reuse the same typed loader as normal schema package loading and
verify-schema-roundtrip.
Acceptance criteria
- Extend
verify-schema-roundtripwith a--corpusflag for corpus-backed mode. - For each provider/package version, load representative or training samples, parse them through the runtime parser path, and validate emitted elements against committed package schemas.
- Report provider, element kind, package version, sample path, parser identity, schema path, instance pointer, and validation failure as machine-readable JSON.
- Keep the existing structural roundtrip as the fast/default check; make the stronger mode available to CI or a lab lane.
- Include at least one regression where a schema is syntactically valid but rejects a real emitted element shape (e.g., remove or type-change a required emitted field and assert corpus-backed verification fails).
Implementation anchors
devtools/verify_schema_roundtrip.py— the current gate; extend to accept--corpusflagpolylogue/schemas/verification.py—verify_raw_corpus()already does batched corpus reads with progress callback; pattern is reusablepolylogue/schemas/packages.py— Pydantic migration (refactor(manifests): type repo-control manifests and schema catalogs #629) should land first
Metadata
Metadata
Assignees
Labels
area:devtoolsDevtools and repo control-plane toolingarea:schemaSchematheme:verifiabilitySchema-native proof and evidence architecturetool:codexCodextype:fixBug fix
Activity
Sinity commentedon May 1, 2026
Corpus-backed schema roundtrip should be deterministic and privacy-safe, not dependent on whatever live private archive happens to be present.
Suggested acceptance additions:
This keeps the check from proving only “schemas load” while the runtime parser and validator still disagree.
Sinity commentedon May 1, 2026
Implementation anchors and acceptance additions from the 2026-05-01 follow-up audit.
Anchor for current shallow command:
devtools/verify_schema_roundtrip.py:36-68: validates package versions, package/catalog roundtrip, element presence, schema loadability, and roottype.Acceptance additions:
Sinity commentedon May 1, 2026
Schema roundtrip decision from 2026-05-01 bundle
Integrated decisions:
Acceptance refinements:
verify-schema-roundtripshould use the same typed package loader as normal schema package loading.Ref #629
Sinity commentedon May 2, 2026
Schema roundtrip current state
The existing roundtrip infrastructure:
devtools verify-schema-roundtrip— committed gate that verifies schema packages reload and roundtrip cleanlypolylogue/schemas/packages.py— schema package loading with customto_dict()/from_dict()polylogue/schemas/verification.py— raw corpus verification with keyset paginationThe gap this issue describes (making roundtrip "corpus-backed") means: instead of roundtripping against the committed schema package alone, verify that real observed message shapes from the raw corpus survive the parse → model → serialize → deserialize → compare cycle without loss.
Implementation anchors
devtools/verify_schema_roundtrip.py— the current gate; extend to accept--corpusflagpolylogue/schemas/verification.py—verify_raw_corpus()already does batched corpus reads with progress; itsprogress_callbackpattern is reusablepolylogue/schemas/packages.py— Pydantic migration (refactor(manifests): type repo-control manifests and schema catalogs #629) should land first, then corpus-backed verification becomes a cleanmodel_validate(model_dump(original))roundtripThe dependency order is: #629 (typed manifests/packages) → this issue (corpus-backed verification).
refactor(devtools): Click dispatch, split pipeline_probe, corpus roun…
Sinity commentedon May 3, 2026
Closed by #763.
devtools verify-schema-roundtrip --corpusvalidates all 5 providers against committed schema packages usingSyntheticCorpus.for_provider()+jsonschema.Draft202012Validator.refactor(devtools): Click dispatch, split pipeline_probe, corpus roun…