Files
Rosea/packages/schema/schemas/care-event.schema.json
T
mnovak 49c8def037 [repo] Workspace: Scaffold Phase 0 with schema, engine, content, ui and the PWA shell
pnpm + turbo workspace with the commands from CLAUDE.md §3. The contracts
from §6 as JSON Schemas with generated types; localDay as the one place a
day is computed; the forbidden-word list shared by lint:copy and the
library validator, with 13 negative fixtures; a Svelte 5 PWA shell built
under /Rosea/ with a meta CSP. E2E and offline suites run against the
built bundle; the offline one closes the server rather than emulating.

Analysis: .agents/features/phase0-workspace.md
2026-11-01 00:27:33 +01:00

38 lines
1.6 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+$" }
},
"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}$"
}
}
}