-
Notifications
You must be signed in to change notification settings - Fork 0
primitives
Dylan McCavitt edited this page Jul 4, 2026
·
1 revision
Primitives are the foundational domain objects defined in src/core/ that appear across three or more systems. A change to a primitive ripples through every consumer, so they are documented separately from the systems that use them. Each primitive group has its own page with the key types, how they connect to the systems, and the validation rules.
-
Domain model:
Quest,Level,Pack, andCheckplus the check DSL as a Zod discriminated union of nine types. These schemas are the shape of every quest, pack, and level in the curriculum, and the verifier evaluates checks against them. Defined insrc/core/quest.ts,src/core/level.ts,src/core/pack.ts, andsrc/core/checks.ts. -
Progression events: the
ProgressionEventdiscriminated union (quest_completed,unlock,xp_award,badge_award,hint_opened) that forms the append-only event log.events.jsonlis the source of truth andfoldEventsis the pure fold that rebuilds state. Defined insrc/core/progression.ts. -
Domain IDs: the branded slug types
QuestId,LevelId,PackId, andFeatureId. Branding prevents mixing ID kinds at compile time. Defined insrc/core/ids.ts.
These types appear in core, the adapter, loader, verifier, progression, CLI, and extension. For the cross-cutting capabilities that move these objects around, see features.