feat(task): model the reader's own weekly and monthly tasks

A task is a period that rolls on the game's reset and a measure that
fills it: days ticked, or a number against a target. Its status is the
goal status shape, so the dailies strip treats it like any other item.
Its ids get their own reserved space, as do the built-ins to come.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Winther
2026-10-13 13:32:13 +02:00
co-authored by Claude Opus 5.5
parent e7ee43f92d
commit 9c2d63b73b
3 changed files with 259 additions and 4 deletions
+12 -4
View File
@@ -26,11 +26,19 @@ import { EventType, GachaEvent, Precision, slugify } from "./schema.ts";
*
* Every id in this app is colon-separated and the first segment decides which
* space it belongs to: `dailies:<game>` is a standing chore, `mygame:` and
* `myevent:` are the reader's own, and anything else is `<game>:<slug>:<date>`
* from a source. The day one of these becomes a game id is the day two key
* spaces merge silently, so a test pins it against `GameId.options`.
* `myevent:` are the reader's own, `mytask:` is a weekly or monthly task they
* set up (task.ts), `routine:` is held for the built-in ones, and anything else
* is `<game>:<slug>:<date>` from a source. The day one of these becomes a game
* id is the day two key spaces merge silently, so a test pins it against
* `GameId.options`.
*/
export const RESERVED_ID_SEGMENTS = ["dailies", "mygame", "myevent"] as const;
export const RESERVED_ID_SEGMENTS = [
"dailies",
"mygame",
"myevent",
"mytask",
"routine",
] as const;
const GAME_PREFIX = "mygame";
const EVENT_PREFIX = "myevent";