{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://grids365.dev/example-contracts.schema.json","title":"Grid canonical example verification contracts","type":"object","required":["schemaVersion","appliesTo","reviewedAt","examples"],"properties":{"schemaVersion":{"const":1},"appliesTo":{"type":"object","required":["gridVersion","sourceCommit","hashAlgorithm"],"properties":{"gridVersion":{"type":"string"},"sourceCommit":{"type":"string","pattern":"^[0-9a-f]{40,64}$"},"hashAlgorithm":{"const":"sha256"}},"additionalProperties":false},"reviewedAt":{"type":"string","format":"date"},"semantics":{"type":"object","additionalProperties":{"type":"string"}},"examples":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/example"}}},"$defs":{"digest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"source":{"type":"object","required":["bytes","sha256"],"properties":{"bytes":{"type":"integer","minimum":1},"sha256":{"$ref":"#/$defs/digest"}},"additionalProperties":false},"fixture":{"type":"object","required":["role","path","bytes","sha256"],"properties":{"role":{"enum":["table","external-stub","clock","history","module","surface"]},"path":{"type":"string","pattern":"^content/example-fixtures/.+\\.json$"},"bytes":{"type":"integer","minimum":1},"sha256":{"$ref":"#/$defs/digest"}},"additionalProperties":false},"assertion":{"type":"object","required":["id","phase","subject","matcher"],"properties":{"id":{"type":"string","minLength":1},"phase":{"enum":["compile","initial","after-action","render"]},"subject":{"type":"object","required":["kind","name"],"properties":{"kind":{"enum":["binding","frame","diagnostic","format","surface","provenance"]},"name":{"type":"string","minLength":1}},"additionalProperties":false},"matcher":{"type":"object","required":["op"],"properties":{"op":{"enum":["equals","approx","rowsEqual","status","diagnostic","invariant"]}},"additionalProperties":true}},"additionalProperties":false},"scenario":{"type":"object","required":["id","classification","capabilities","assertions"],"properties":{"id":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"classification":{"enum":["portable-exact","fixture-exact","clocked-exact","history-dependent","provider-dependent","surface-dependent","solver-dependent","simulation-dependent"]},"capabilities":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"fixtures":{"type":"array","items":{"$ref":"#/$defs/fixture"}},"assertions":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/assertion"}}},"additionalProperties":false},"example":{"type":"object","required":["slug","file","source","scenarios"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"file":{"type":"string","pattern":"^examples/canonical/[0-9]{2}-.+\\.grid$"},"source":{"$ref":"#/$defs/source"},"scenarios":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/scenario"}}},"additionalProperties":false}},"additionalProperties":true}