deepstack-api-v2-contracts / schemas /common.schema.json
mcauduro's picture
DeepStack API v2 contracts, package 7726f3ef2d6c (CC-BY-4.0)
1e3bc19 verified
Raw History Blame Contribute Delete
3.55 kB
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "common.schema.json",
"title": "Common definitions of the DeepStack ML contracts v1",
"description": "Shared definitions. Timestamps are UTC with an explicit Z or +00:00 offset; naive or non-UTC clocks are refused at the boundary.",
"$defs": {
"schema_version": {
"const": "ml.v1"
},
"utc": {
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,6})?(Z|\\+00:00)$"
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
},
"question_id": {
"description": "Exactly the game's testId (pNN-tNN, thNNN-tNN). The pattern only bounds the shape; existence is checked against the catalog on the server.",
"type": "string",
"pattern": "^[a-z0-9]{1,16}(-[a-z0-9]{1,16}){1,3}$"
},
"event_version": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"phase": {
"enum": [
"pre_lock",
"post_lock"
]
},
"purpose": {
"enum": [
"analyst",
"forecast_component",
"forecast_pool",
"resolution_explainer",
"evaluation"
]
},
"environment": {
"description": "Where an execution really ran. 'fake' marks test doubles and can never be presented as a real run.",
"enum": [
"fake",
"local",
"staging",
"production"
]
},
"https_url": {
"type": "string",
"pattern": "^https://[^\\s@/]+(/[^\\s]*)?$"
},
"polarity": {
"description": "Stance of a passage towards the question (vocabulary of artifacts/polarity/vault-stance.jsonl).",
"enum": [
"bull",
"bear",
"neutral"
]
},
"relation_kind": {
"description": "How a claim relates to its source (INT-002): the source states it, the source attributes a cause, or the graph inferred it.",
"enum": [
"observed",
"attributed_causal",
"inferred_hypothesis"
]
},
"rights_scope": {
"type": "object",
"additionalProperties": false,
"required": [
"policy_version",
"purposes"
],
"properties": {
"policy_version": {
"$ref": "#/$defs/id"
},
"purposes": {
"type": "array",
"uniqueItems": true,
"items": {
"enum": [
"read",
"process",
"external_provider",
"train",
"retain",
"publish"
]
}
}
}
},
"principal_scope": {
"description": "Built by the server from a verified session. Never an email or a bearer.",
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"subject_id",
"tenant_id"
],
"properties": {
"kind": {
"enum": [
"reader",
"guest",
"anonymous",
"service"
]
},
"subject_id": {
"type": [
"string",
"null"
],
"pattern": "^sub_[A-Za-z0-9_-]{8,64}$"
},
"tenant_id": {
"$ref": "#/$defs/id"
}
}
}
}
}