English
alta.onboarding/0.2: the guide
Generated from docs/standards/alta-onboarding-0.2.md · npm run docs:gen
Code: core/onboarding/onboarding.ts. Tests: tests/contracts.test.ts, tests/onboarding.test.ts. Design: docs/ONBOARDING-V2.md (the guide on a Mac and in the cloud).
The guide is a list of beats over the campaign quests; each world may ship universes/<id>/onboarding.json, content/onboarding.json is the neutral fallback. 0.1 files are still read.
0.2 adds:
- on a step:
setup(the id of a setup plan the step shows; lot D1) andcutscene(a scene id of alta-cinematics-0.1); - on a beat:
auto: "app-open" | "hosted"(the proof given by the app being open, or by running hosted:AUTO_PROOFS), andwait(the beat waits for its proof instead of offering "Next"); - on a beat and on a tour stop:
host: "local" | "hosted" | "hosted-free" | "hosted-paid"(HostCond, see platform): where it is played. Absent = everywhere.
Host and axis: two questions, two mechanisms
| Host: where it runs | Axis: who arrives | |
|---|---|---|
| Changes | the facts: which quests and steps exist | the tone: lines, order, first tracked quest |
| Mechanism | the host condition inside the file | a file variant onboarding.<axis>.json |
| Comes from | /api/game.host (mode, tier) | host.axis |
beatsFor(o, host): the beats played on this host, in file order. Anautobeat implies its host (app-open= local,hosted= hosted), so the two doors are two quests, hence two beats.stopsFor(beat, host),resumeAt(o, at, host): if the saved beat is not played on this host, the guide resumes at the first played beat after it in the file; if there is none, the guide ends.- The counter "n / total" counts the played beats;
trackis read on the last played beat. guideProofs(o, at, done, host?)proves only theautoquests of played beats.onboardingFor(files, universe, variant?): the first file that exists inuniverses/<u>/onboarding.<v>.json→universes/<u>/onboarding.json→content/onboarding.<v>.json→content/onboarding.json. A host mode is never a variant name (HOST_VARIANT_NAMES): such a variant is ignored.
Validation
checkOnboarding(o, questUids, sceneIds?, opts?: { game?, variant? }) refuses unknown quests, unknown scenes (when sceneIds is given), an unknown auto, any 0.2 field in a file that declares 0.1, and:
- a
hostoutsideHOST_CONDS; - a
hostthat contradictsauto(auto: "app-open"with a hosted condition,auto: "hosted"withlocal); - a reference host (
local,hosted-free,hosted-paid) on which no beat is played; - two beats of the same quest played on the same host (a variant that wants other lines per mode writes
wakeandwake-hosted, each with its host); opts.variantequal tolocal,hosted,freeorpaid;- with
opts.game: a played beat whose quest cannot be played on that host, atrackto such a quest, a key ofstepsor atickthat is not a step of the beat's quest.