Skip to content

alta.game/0.3: steps that act, ask and say why ​

Generated from docs/standards/alta-game-0.3.md · npm run docs:gen

Code: core/quests/standard.ts (fields, checkGame, evaluate), core/runs/inputs.ts (inputs and arguments), core/runs/executors.ts (what each executor takes). Tests: tests/inputs.test.ts, tests/standard.test.ts, tests/sdk.test.ts. Everything of alta.game/0.2 still holds; this page says what 0.3 adds.

Schemas: alta.game/0.3 (a whole game) and alta.quests/0.3 (a fragment). A 0.1 or 0.2 file is read as is (upgradeGame keeps its version, 0.1 becomes 0.2) and evaluates the same as the same file declared 0.3: every 0.3 field is optional (tested on content/branches.json). A fragment is checked by its own version, whatever the version of the game it joins (checkFragment).

What a step can say ​

FieldTypeMeaning
inputsInput[]what the step asks before its run: a form in the plan card
run.argsRecord<string, ArgValue>literals, or { "input": "<id>" } (a value of the form), or { "answer": "answers.<key>" } (an answer already given, Save.answers). When the player changes that answer later ("Change" on the choice, also on a quest already done), a step whose run reads it and that has a check is played again: its earlier proof is set aside until its run succeeds with the new value (Save.redo); the same answer picked again changes nothing
humanspeak | approve | device | external | judge | beforewhy only the player can do this step
provenBystep idthe step has no proof of its own: it is done as soon as that step of the same quest is proven
json
{ "id": "connect-your-google", "kind": "action",
  "title": { "en": "Connect your Google account", "fr": "Branche ton compte Google" },
  "inputs": [ { "id": "email", "kind": "email", "label": { "en": "Your Google address", "fr": "Ton adresse Google" } } ],
  "run": { "do": "connector.connect", "args": { "id": "google", "email": { "input": "email" } } },
  "check": { "type": "account", "service": "google" } }

Inputs ​

Input { id, kind, label, hint?, required? (default true), default?, from?, saves?, choices?, max?, min?, pattern?, not?, must? }

KindFieldAccepted value (core first, then the server again)
texttext field1 to max characters (default 200, at most 2000), no control character, pattern (anchored ^…$, 200 characters at most), none of not.values (compared without case)
choicebuttons or listone of choices (same shape as Step.choices)
emaile-mail fielda plain address (x@y.z, 254 characters at most)
pathtext fieldstarts with ~/ or /Volumes/, no ..; the server resolves it, refuses it outside those roots and checks must (exist, dir, file)
numbernumber fielda finite number between min and max
booleanboxtrue or false
secretpassword fieldnot empty, 4096 characters at most; nothing else is read
  • from: "answers.<key>" prefills from an answer; saves: "answers.<key>" keeps the value in Save.answers.
  • not: { values, why } (text only): values the field refuses although they fit, such as names kept for something else (1 to 64 texts, compared without case), and the sentence the field says then (why, a Text: why, and what to type instead). The page, the server and alta check refuse them alike, before anything runs (rule step.input-not). The owner's short name of the Alta install refuses the engine's reserved names (engine/scripts/install/alta-bootstrap RESERVED_SLUGS; a test keeps the content and the examples equal to it).
  • inputProblems(input, value), resolveArgs(step, os, values, answers) → { args, secretIds, secretParams, saves, problems } and paramProblems(executor, args) (0.2's runArgsProblems is its alias) are the same pure functions in the page, the server and alta lint. No problem message repeats a value.

Inputs and executor arguments ​

An executor declares what a step may give it (ExecutorInfo.args, see runs, routes, checks): a closed list of values, or the kind of a value ({ kind, values?, max?, min?, pattern?, required? }). checkGame checks every reference: the input exists, its kind fits the argument (the same kind; a choice, email or path into a text; a choice whose choices are all in a closed list), and every input feeds an argument or is saved.

Secrets ​

A secret input is a password, a token, a key or a one-time code (AGENTS.md §2). The standard makes it impossible to keep one by mistake:

  • it has no default, from, saves or pattern, and is never prefilled (types: SecretInput; rule step.input-secret);
  • it only feeds an argument the executor declares kind: "secret", and such an argument only takes a secret input (never a literal, never an answer); such an executor offers the way page (ExecutorInfo.secret.via);
  • resolveArgs never puts it in args: it says which argument it feeds (secretParams), and the page sends the value once, in the body of the agreement (POST /api/runs/run, secrets), never in the plan, a URL or the save;
  • a literal of run.args, or a value given to an argument, that looks like a credential is refused (paramProblems).

The value is typed in the game page in a local world and in a hosted world alike: the page is served by the player's own server, and in a hosted world HTTPS ends on the player's own machine, so no service of Alta sees it in clear.

Steps that stay with the player ​

  • In 0.3 a manual step must say why (human, rule step.manual-reason): "I did it" never stays on a step the machine could do. human may sit on any kind of step (an action that needs the player to speak, for example).
  • A manual step may carry a helper run only if it changes nothing (an executor with card: "none", such as mac.open-pane; rule step.run-card). With a check, the proof decides.
  • provenBy names a step of the same quest that has a check (or is a mission), directly or through other provenBy; never a loop, never a step without a proof, never on a step with its own check (rule step.proven-by). evaluate counts the step done when that proof passes (a ticked target proves nothing).

A step proven by its own action ​

A seen { key } check whose key is not a scene (a scene is trailer, trailer:<world>, intro:<uid>, outro:<uid>, scene:<id>; isSceneKey in core/quests/standard.ts) is marked by the game itself, never by a "Watch" or "I did it" button:

  • on a step with run: once the run succeeded, unless its result says pass: false (voice.hear heard nothing); for voice.say, once the page has played the line;
  • on a step with ask (a message to its agent): once the agent answered;
  • on a step a guide's tour stop ticks (stops[].tick): when the stop is visited.

Keys used by the built-in quests: heard:<uid>.<step>, played:<uid>.<step>, read:<uid>.<step>, ran:<uid>.<step>, asked:<uid>.<step>, tour:<agent>. Use it only where no read-only check of the machine can see the result (what the player heard, read or was told); a state of the machine has its own check.

json
{ "id": "see-your-first", "kind": "action", "title": { "en": "See your first check", "fr": "Vois ta première vérification" },
  "run": { "do": "openclaw.read", "args": { "what": "update" } },
  "check": { "type": "seen", "key": "read:core.updates.see-your-first" } }

Check types added ​

CheckPasses when (read only)Answered by
bin { name }the program is found (server/lib/bins.mjs)server
permission { name }the OpenClaw app of this Mac has the permission: microphone, speech, accessibility, screen, notifications, camera, locationserver
channel { id, state? }the channel has an account (configured, the default), and no pairing request waits (paired)server
account { service, scope? }the account is connected (google, scope gmail or calendar)server
backup { maxAgeHours?, restoreTested? }a backup younger than that exists; its restore test passedserver
host { mode }the world runs local or hostedthe core when it knows the host, else the server
part { id }a part of the Alta install is applied: machine, mind, memory, agents, map, modules (the engine's own marker)server

Each is declared in server/checks/index.mjs; until its file exists the server answers it unverifiable ("not in this version"). A result never carries an address, a token or an account name.

Validator ​

checkGame adds, for a file that declares 0.3: step.manual-reason, step.human, step.proven-by, step.run-card, step.inputs, step.input-kind, step.input-ref, step.input-secret. For a file that declares 0.1 or 0.2 it refuses inputs, human, provenBy and any reference in run.args (game.v3-field). In every version it checks the fields of the check types above (check.bin, check.permission, check.channel, check.account, check.backup, check.host, check.part), refuses a check whose type is not in CHECK_TYPE_IDS (check.type: such a step could never be proven), and refuses a literal of run.args that looks like a credential.

Alta OS is open source (MIT).