Skip to content

Update JSON Schema to match new Terms #2415

@acl-cqc

Description

@acl-cqc

Following #2309 and #2360, our impl Arbitrary for Term (and hence Type and others) generated instances that did not conform to the Hugr JSON schema. The ideal solution here is to update the schema.


Further history: prior to #2412, we were roundtrip testing these non-schema-compliant instances, but not checking schema conformance.

#2412 changed so that our impl Arbitrarys generate only instances that do conform to the schema. However, this leads to several problems:

  • Any other code/proptests using Arbitrary run only on Terms that conform to the old schema, a significant narrowing
  • e.g. we no longer check that non-conforming instances roundtrip (we could check this without checking schema compliance)
  • The restriction to schema-conforming instances is done via an inefficient (not recommended) prop_filter

Thus, if we can't update the JSON schema, we could still fix some of these problems, albeit requiring significant refactoring of the impl Arbitrarys / #[derive(Arbitrary)]s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions