Skip to content

Verify types–schema parity as an adr.accept gate #768

Open

Description

@nathanacurtis

Problem

Two type–schema parity breaks shipped undetected and were found by a downstream consumer (recorded in ADR-105):

  • JSON Schema definitions missing the required members their TypeScript types declare non-optional (EnumProp, SlotProp), which broke the discrimination AnyProp's oneOf depends on
  • a oneOf union whose branches overlap by type extension (ImageBinding extends PropBinding in PropConfigurationValue), which oneOf rejects by definition

The constitution names type–schema parity as a gate, but nothing compares the types and the JSON Schema automatically — divergence surfaces in consumers.

Potential solution(s)

  • An automated parity check that derives each schema definition's required set from the types (or asserts the two against each other) and flags oneOf unions whose branches overlap by extension, run as one of the /specs.adr.accept gates and in CI.

Acceptance criteria

  • The accept gates fail on a required-set divergence between a type and its schema definition
  • The accept gates fail when an extension-overlapping union compiles to oneOf
  • Both ADR-105 defect patterns are covered as regressions

Case data

  • Territory: schema
  • Size: m

Notes

ADR-105 (Type–Schema Parity for Overlapping Prop Unions) records both defect instances and the principle the check enforces.


Implementation details are tracked internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

schemaspecs-schema types and JSON schema

Type

Fields

Priority

None yet

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions