113 lines
2.5 KiB
JSON
113 lines
2.5 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "https://rosea.invalid/schema/care-event.json",
|
|
"title": "CareEvent",
|
|
"description": "One act of care, append-only and never edited (CLAUDE.md §6.2). The other event kinds arrive with docs/GAMEPLAY.md.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"kind",
|
|
"ts",
|
|
"localDay",
|
|
"from",
|
|
"to",
|
|
"act",
|
|
"trace",
|
|
"messageId",
|
|
"clientVersion"
|
|
],
|
|
"properties": {
|
|
"kind": {
|
|
"const": "care"
|
|
},
|
|
"ts": {
|
|
"description": "Epoch milliseconds. Stays on the device; never part of a trace.",
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"localDay": {
|
|
"description": "The player's local day, from engine/src/time/localDay.ts and nowhere else.",
|
|
"type": "string",
|
|
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
|
|
},
|
|
"from": {
|
|
"$ref": "#/definitions/publicKey"
|
|
},
|
|
"to": {
|
|
"$ref": "#/definitions/publicKey"
|
|
},
|
|
"act": {
|
|
"type": "string",
|
|
"enum": [
|
|
"water",
|
|
"shade",
|
|
"weed",
|
|
"petals"
|
|
]
|
|
},
|
|
"trace": {
|
|
"type": "string",
|
|
"pattern": "^petal:[a-z]+(-[a-z]+)*$"
|
|
},
|
|
"messageId": {
|
|
"description": "A hope-library id or null. Never text: the pattern admits no space, so no sentence fits (CLAUDE.md §5.6 rule 1).",
|
|
"oneOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
"maxLength": 64
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"clientVersion": {
|
|
"type": "string",
|
|
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
},
|
|
"amount": {
|
|
"description": "How much was poured, 0 to 1 of a full can. Water only: the skill of watering by feel is replayed from it (.agents/features/rose.md R1).",
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 1
|
|
}
|
|
},
|
|
"if": {
|
|
"properties": {
|
|
"act": {
|
|
"const": "water"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"amount": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"amount"
|
|
]
|
|
},
|
|
"else": {
|
|
"not": {
|
|
"properties": {
|
|
"amount": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"amount"
|
|
]
|
|
}
|
|
},
|
|
"definitions": {
|
|
"publicKey": {
|
|
"description": "An opaque base64url public key. Its exact encoding is decided with packages/identity.",
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9_-]{32,128}$"
|
|
}
|
|
}
|
|
}
|