Reference

Lessons & packs

A mission file (triggers/grading/objectives) is the INSIDE of one lesson. RemoteLesson is the OUTSIDE wrapper — route shape, title, premise, unlock order — and RemotePack is the catalog of lessons a server publishes together, downloadable to the app with no update. Source: CoachApp/IFREssentials/RemoteLesson.swift + RemoteLesson+Codable.swift, CoachApp/Missions/RemotePack.swift.

RemoteLesson

{
  "id": "multiengine-mission-1",
  "title": "Practicing Takeoffs",
  "premise": "Shown in the mission detail screen's OBJECTIVES section.",
  "grounded_in": ["optional array of citation strings"],
  "unlock_requires": null,
  "dep_icao": "KVCB",
  "shape": { "kind": "ground_start", "icao": "KVCB", "runway": "20" },
  "cruise_alt_ft": 3000,
  "xp_baseline": 20,
  "steps": ["optional hand-authored PLAN list, overrides the auto-derived one"],
  "scenario": "optional made-up narrative framing, shown alongside premise",
  "script": { /* the ScriptImport.File from index.html#anatomy — triggers/grading/objectives */ },
  "skips_mission_start": true
}
fieldmeaning
idrequiredstring — stable, globally unique within the pack.
titlerequiredstring.
premiserequiredstring — "why you're flying this," shown in OBJECTIVES.
grounded_inoptional, default []array of citation strings (what real-world data this lesson is grounded in).
unlock_requiresoptionalstring or null — another lesson's id that must be completed first.
dep_icaorequiredstring — the airport this lesson's route is built from.
shaperequiredobject — see below. For a script-authored, procedure-less mission, this is always { "kind": "ground_start", "icao": ..., "runway": ... }.
cruise_alt_ftrequirednumber.
xp_baselineoptionalnumber — what this lesson is worth at its best. Omitted falls back to the app-wide default (200).
fixed_scoring_rulesoptionalobject — a ScoringRules override, fixing grading tolerance regardless of the pilot's own global preset. Rare; omit unless a lesson specifically needs it.
stepsoptionalarray of strings — hand-authored PLAN list; omitted auto-derives one from the route.
scenariooptionalstring.
scriptoptionala full ScriptImport.File — the ONE field that actually makes a RemoteLesson flyable/graded from pure JSON. Omitted keeps a hand-authored Swift lesson's existing behavior unchanged.
skips_mission_startoptional, default falsebool — true only if this lesson's own script already handles its own "ask about Companion help, wait for connection" conversation inside triggers (ported verbatim from the shared flow, e.g. a faithful JSON extraction of Mission 1's own onboarding). Every other lesson leaves this false and gets the one shared connection gate automatically, before the script ever starts.

shape

How this lesson's route is built. 12 of the 13 kinds build a real, charted procedure from CIFP data — genuinely different route-building primitives for genuinely different IFR Essentials lesson premises, not something a JSON-authored script-driven mission typically needs. The one shape that IS for script-driven, procedure-less practice:

ground_start for JSON-authored missions

No charted procedure at all — the aircraft is simply placed at icao/runway for ground-based practice (engine-failure drills, pattern work). Grading and progression come entirely from the lesson's own script, not from a procedure's coded legs.

icaorequiredstring.
runwayrequiredstring.
{ "kind": "ground_start", "icao": "KVCB", "runway": "20" }

The other 12 kinds, for reference (all require real CIFP-charted procedures to exist at the named airport — consult RemoteLesson.swift's own doc comments for the full nuance on each):

kindfields
departuresid, runway, transition?
missed_approach_as_departureapproach
approach_then_missapproach, transition?, continues_to? ({icao, approach, transition?})
arrivalicao, star, transition, join_fix?
dme_arc_approachapproach, transition, termination (full_stop/missed_approach)
direct_to_radial_dme_then_holdstation, fix (a HoldSite), altitude_ft
direct_to_station_then_holdstation, inbound_true, right
depart_and_direct_to_stationstation, altitude_ft?
depart_join_approach_then_missjoin_fix, approach_airport, approach, transition, continues_to?
depart_direct_to_station_then_holdstation, altitude_ft?, right
depart_direct_to_station_then_arrivalstation, altitude_ft?, icao, star, transition, join_fix?, approach?, approach_transition?
depart_direct_to_fix_then_approachfix_ident, altitude_ft?, approach_airport, approach, transition, termination?

RemotePack

{
  "id": "multi-engine-essentials",
  "title": "Multi-Engine Essentials",
  "icon": "twin-engine",
  "lessons": [ /* array of RemoteLesson, above */ ],
  "description": "Shown at the bottom of the pack's map view.",
  "is_coming_soon": false,
  "is_coming_soon_clickable": true,
  "icon_definition": null
}
idrequiredstring.
titlerequiredstring.
iconrequiredstring — a plain SF Symbol name (fallback when icon_definition is absent).
lessonsrequiredarray of RemoteLesson. Can be empty for a "coming soon" pack.
descriptionoptionalstring — shown even with zero lessons.
is_coming_soonoptional, default falsebool — true shows a "COMING SOON" flourish instead of real progress.
is_coming_soon_clickableoptional, default truebool — only meaningful when is_coming_soon; false makes the tile un-tappable (title + flourish only, no description panel).
icon_definitionoptionala VectorIconDefinition object — a server-downloadable vector icon, taking priority over icon's SF Symbol when present.

Decoding is backward-compatible on purpose. A pack cached on disk from before description/is_coming_soon/icon_definition existed still loads — every new field falls back to the same default a hand-built pack's own initializer gives it. Keep new RemotePack/RemoteLesson fields optional with a safe default for the same reason when extending this format.