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
}
| field | meaning | |
|---|---|---|
| id | required | string — stable, globally unique within the pack. |
| title | required | string. |
| premise | required | string — "why you're flying this," shown in OBJECTIVES. |
| grounded_in | optional, default [] | array of citation strings (what real-world data this lesson is grounded in). |
| unlock_requires | optional | string or null — another lesson's id that must be completed first. |
| dep_icao | required | string — the airport this lesson's route is built from. |
| shape | required | object — see below. For a script-authored, procedure-less mission, this is always { "kind": "ground_start", "icao": ..., "runway": ... }. |
| cruise_alt_ft | required | number. |
| xp_baseline | optional | number — what this lesson is worth at its best. Omitted falls back to the app-wide default (200). |
| fixed_scoring_rules | optional | object — a ScoringRules override, fixing grading tolerance regardless of the pilot's own global preset. Rare; omit unless a lesson specifically needs it. |
| steps | optional | array of strings — hand-authored PLAN list; omitted auto-derives one from the route. |
| scenario | optional | string. |
| script | optional | a 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_start | optional, default false | bool — 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:
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.
| icao | required | string. |
| runway | required | string. |
{ "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):
| kind | fields |
|---|---|
| departure | sid, runway, transition? |
| missed_approach_as_departure | approach |
| approach_then_miss | approach, transition?, continues_to? ({icao, approach, transition?}) |
| arrival | icao, star, transition, join_fix? |
| dme_arc_approach | approach, transition, termination (full_stop/missed_approach) |
| direct_to_radial_dme_then_hold | station, fix (a HoldSite), altitude_ft |
| direct_to_station_then_hold | station, inbound_true, right |
| depart_and_direct_to_station | station, altitude_ft? |
| depart_join_approach_then_miss | join_fix, approach_airport, approach, transition, continues_to? |
| depart_direct_to_station_then_hold | station, altitude_ft?, right |
| depart_direct_to_station_then_arrival | station, altitude_ft?, icao, star, transition, join_fix?, approach?, approach_transition? |
| depart_direct_to_fix_then_approach | fix_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
}
| id | required | string. |
| title | required | string. |
| icon | required | string — a plain SF Symbol name (fallback when icon_definition is absent). |
| lessons | required | array of RemoteLesson. Can be empty for a "coming soon" pack. |
| description | optional | string — shown even with zero lessons. |
| is_coming_soon | optional, default false | bool — true shows a "COMING SOON" flourish instead of real progress. |
| is_coming_soon_clickable | optional, default true | bool — only meaningful when is_coming_soon; false makes the tile un-tappable (title + flourish only, no description panel). |
| icon_definition | optional | a 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.