[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
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"$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}$"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://rosea.invalid/schema/hope-sentence.json",
|
||||
"title": "HopeSentence",
|
||||
"description": "One entry of the curated hope library (CLAUDE.md §6.1). The only words one player can send another are ids of these.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "text", "source", "use", "tone", "promisesOutcome"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Stable, lowercase, hyphenated. A message between players carries only this.",
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
||||
"maxLength": 64
|
||||
},
|
||||
"text": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["en"],
|
||||
"properties": {
|
||||
"en": { "type": "string", "minLength": 1 },
|
||||
"cs": { "type": "string", "minLength": 1 }
|
||||
}
|
||||
},
|
||||
"source": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["work", "author", "tradition", "translation", "publicDomain", "verifiedBy", "verifiedAt"],
|
||||
"properties": {
|
||||
"work": { "type": "string", "minLength": 1 },
|
||||
"author": { "type": ["string", "null"] },
|
||||
"tradition": {
|
||||
"description": "A lowercase tag such as `biblical` or `stoic`. `rosea` marks a line the author wrote for this game.",
|
||||
"type": "string",
|
||||
"pattern": "^[a-z]+(-[a-z]+)*$"
|
||||
},
|
||||
"translation": { "type": ["string", "null"] },
|
||||
"publicDomain": { "type": "boolean" },
|
||||
"verifiedBy": { "type": "string", "minLength": 1 },
|
||||
"verifiedAt": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
|
||||
}
|
||||
},
|
||||
"use": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": { "type": "string", "enum": ["sunset", "comfort", "thanks"] }
|
||||
},
|
||||
"tone": { "type": "string", "pattern": "^[a-z]+(-[a-z]+)*$" },
|
||||
"promisesOutcome": { "type": "boolean" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://rosea.invalid/schema/trace.json",
|
||||
"title": "Trace",
|
||||
"description": "An anonymous shared-sky trace, Phase 4, opt-in only (CLAUDE.md §6.3). No timestamp finer than a day, no precise location, no free text, no link to the friend graph.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["traceId", "geocell", "dayBucket", "gesture", "sig"],
|
||||
"properties": {
|
||||
"traceId": { "description": "Random and rotating.", "type": "string", "pattern": "^[A-Za-z0-9_-]{16,64}$" },
|
||||
"geocell": {
|
||||
"description": "A coarse cell id. The cell system and its density-adaptive size are decided in the Phase 4 feature doc.",
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9]{4,16}$"
|
||||
},
|
||||
"dayBucket": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
||||
"gesture": { "type": "string", "enum": ["petal", "light"] },
|
||||
"sig": { "type": "string", "pattern": "^[A-Za-z0-9_-]{16,256}$" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user