Huginn/schemas/cultnet/huginn.desk_request.v1.schema.json

230 lines
No EOL
6.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "DeskRequest",
"description": "Every request the desk door answers. The fields are the wire names: the `mind` addressed\n(the persona and pipeline requests say `instance`; the sets are separate), the verified\n`subject` and `authority` Bifrost vouches for (door context, never body fields), and the\n`deciders` of this call (1 to 64, distinct; the Mind never stores them). Closed: a key outside\nthe set refuses the whole payload.\n\nThe reads, `Forks` and `Fork`, carry NO `authority` (CultLib `list_request` and\n`read_request` are closed and have none; one that names it is refused whole). Their `deciders`\nfeed the showability gate, and `subject` decides the view: a subject in `deciders` is a decider,\nsees every showable fork and is told the ids; any other reads only the forks the Mind lists\n(a `desk_listing` in force) and is told counts in the ids' place. `Forks` takes the contract's `list_request` fields flat\nbeside them (`status`, `cursor`, `limit`), each key written, `null` where absent. Bifrost\nstrips notes; see `DeskResponse` for the trust boundary. These docs and the doc of `Mind::desk_forks`/`Mind::desk_fork` are the\nreads spec.",
"oneOf": [
{
"type": "object",
"properties": {
"Answer": {
"type": "object",
"properties": {
"authority": {
"$ref": "#/$defs/DeskAuthority"
},
"deciders": {
"type": "array",
"items": {
"$ref": "#/$defs/AccountId"
},
"maxItems": 64,
"minItems": 1,
"uniqueItems": true
},
"mind": {
"$ref": "#/$defs/Slug"
},
"request": {
"$ref": "#/$defs/ForkAnswerRequest"
},
"subject": {
"$ref": "#/$defs/AccountId"
}
},
"additionalProperties": false,
"required": [
"mind",
"subject",
"authority",
"deciders",
"request"
]
}
},
"additionalProperties": false,
"required": [
"Answer"
]
},
{
"type": "object",
"properties": {
"Forks": {
"type": "object",
"properties": {
"cursor": {
"type": "string",
"pattern": "^c[1-9][0-9]*$"
},
"deciders": {
"type": "array",
"items": {
"$ref": "#/$defs/AccountId"
},
"maxItems": 64,
"minItems": 1,
"uniqueItems": true
},
"limit": {
"$ref": "#/$defs/ForkLimit"
},
"mind": {
"$ref": "#/$defs/Slug"
},
"status": {
"description": "Which forks a list asks for; absent is both. `recorded` is a closed card.",
"type": "string",
"enum": [
"open",
"recorded"
]
},
"subject": {
"$ref": "#/$defs/AccountId"
}
},
"additionalProperties": false,
"required": [
"mind",
"subject",
"deciders",
"status",
"cursor",
"limit"
]
}
},
"additionalProperties": false,
"required": [
"Forks"
]
},
{
"type": "object",
"properties": {
"Fork": {
"type": "object",
"properties": {
"deciders": {
"type": "array",
"items": {
"$ref": "#/$defs/AccountId"
},
"maxItems": 64,
"minItems": 1,
"uniqueItems": true
},
"fork_id": {
"type": "string"
},
"mind": {
"$ref": "#/$defs/Slug"
},
"subject": {
"$ref": "#/$defs/AccountId"
}
},
"additionalProperties": false,
"required": [
"mind",
"subject",
"deciders",
"fork_id"
]
}
},
"additionalProperties": false,
"required": [
"Fork"
]
}
],
"$defs": {
"AccountId": {
"description": "A Bifrost account id: a lowercase D-format UUID (`UserAccount.Id`). A Matrix id, an email or a\nhandle is never one.",
"type": "string",
"maxLength": 36,
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"DeskAuthority": {
"type": "string",
"enum": [
"Operator",
"Steward",
"Member"
]
},
"ForkAnswerRequest": {
"description": "`gamecult.fork.answer_request.v0`: closed, her field order. The wire types hold text; the\nshape step of `Mind::answer_desk` judges it. The subject and the authority are the\ndoor's context and are no field here.",
"type": "object",
"properties": {
"answer": {
"description": "The person's words: a choice, a note, or both.",
"type": "object",
"properties": {
"choice": {
"type": "string"
},
"note": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"choice",
"note"
]
},
"answered_at": {
"type": "string"
},
"fork_id": {
"type": "string"
},
"options_hash": {
"type": "string"
},
"request_id": {
"type": "string"
},
"retracted": {
"type": "boolean"
},
"retracts": {
"type": "string"
},
"schemaVersion": {
"$ref": "#/$defs/RequestSchema"
}
},
"additionalProperties": false,
"required": [
"schemaVersion",
"fork_id",
"options_hash",
"answer",
"retracted",
"retracts",
"answered_at",
"request_id"
]
},
"ForkLimit": {
"type": "integer",
"maximum": 50,
"minimum": 0
},
"RequestSchema": {
"description": "The request document's schema id; any other value fails to decode.",
"type": "string",
"enum": [
"gamecult.fork.answer_request.v0"
]
},
"Slug": {
"description": "A campaign slug or key segment: label parts joined by `.`.",
"type": "string",
"maxLength": 64
}
}
}