[schema] CareEvent: Water carries the amount poured, so watering by feel can be replayed

This commit is contained in:
2026-11-02 00:20:56 +01:00
parent 5e41a449a4
commit b150c64af7
2 changed files with 97 additions and 12 deletions
+85 -10
View File
@@ -5,27 +5,102 @@
"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"],
"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 },
"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]+)*$" },
"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" }
{
"type": "string",
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
"maxLength": 64
},
{
"type": "null"
}
]
},
"clientVersion": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }
"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": {