Guide

Maintaining this spec

This site is documentation of a real, implemented importer — not a design proposal. The importer is always correct; this site can go stale. There is no build step, no generator, no templating — six plain HTML files sharing docs.css and ../styles.css. Updating it means editing HTML by hand, the same way every other page in coach-home already works.

Where the ground truth lives

this site's pagereal Swift source (in coach-ios)
conditions.htmlCoachApp/ATC/ScriptImport.swift — makeCondition, the ConditionJSON struct's CodingKeys; resolved shape in CoachApp/Pilot/ArmedTrigger.swift — TriggerCondition/HoldCondition
actions.htmlCoachApp/ATC/ScriptImport.swift — makeAction, the ActionJSON struct; resolved shape in ArmedTrigger.swift — TriggerAction
grading.htmlCoachApp/ATC/ScriptImport+Grading.swift — makeGradingRules, RuleJSON; resolved shape in CoachApp/Debrief/DeclarativeGradingRule.swift. Objectives: CoachApp/ATC/ScriptImport+Objectives.swift
lessons-and-packs.htmlCoachApp/IFREssentials/RemoteLesson.swift + RemoteLesson+Codable.swift; CoachApp/Missions/RemotePack.swift
example.htmlCoachApp/Resources/multi-engine-essentials.mission1.json (the real file, copy-pasted verbatim) + Tests/CoachCoreTests/MultiEngineEssentialsMission1Tests.swift

When to update this site

After any coach-ios change that touches one of the files above — most commonly, a new condition/action/grading-rule kind added for a new mission's needs. The pattern every real addition so far has followed (verify this still holds before relying on it — grep the actual switch statement):

  1. A new case "my_new_kind": arm appears in makeCondition/makeAction/makeGradingRules's own switch.
  2. Its wire fields are added to ConditionJSON/ActionJSON/RuleJSON with a CodingKeys entry mapping camelCase Swift to snake_case JSON.
  3. A matching case is added to the resolved Swift type (TriggerCondition/TriggerAction/DeclarativeGradingRule), usually with a doc comment explaining why.

To add it here:

  1. Add an anchor to the page's .kind-index chip row near the top.
  2. Add an <h2 id="my_new_kind"> + .kind-card block, following an existing one on the same page exactly — copy one, don't improvise new markup. The kind-swift line under the name should name the real Swift case it resolves to (grep for it to get the exact signature).
  3. Fill the .field-table from the JSON struct's own property list and its doc comments, not from guessing — every required/optional/default distinction in this site should trace to an actual guard/?? default in makeCondition/makeAction/makeGradingRules.
  4. Write one minimal, real, valid example in a pre.code-block — ideally lifted from an actual shipped mission/grading JSON file in CoachApp/Resources/, not invented.
  5. If this closes a gap previously listed under a page's own "Not yet supported in JSON" section, remove it from that list.

Use kind-badge kind-badge-new on the kind name span when it's new enough that most existing lessons don't use it yet — drop the badge once it's been in a few shipped missions and is no longer novel (a judgment call, not a hard rule).

Verifying accuracy

Before trusting (or shipping an edit to) any page here, cross-check it against the real source directly — this site has drifted stale before (that's why this rewrite happened) and will again if it's edited from memory instead of the file:

Styling conventions

Everything here rides on ../styles.css's own design tokens (--av-black, --av-panel, --av-amber, etc. — lifted from the real app's own instrument-panel colors) plus this folder's own docs.css for the sidebar/content layout, field tables, kind cards, and code blocks. Don't add page-specific <style> blocks for anything that's really a shared docs-layout concern — put it in docs.css once, reused by every page, the same way coach-home's own marketing pages all share styles.css.

Code blocks are deliberately plain preformatted text, no syntax highlighting — anyone editing this site later just pastes raw JSON into a <pre class="code-block"><code> block, no manual span-wrapping to keep in sync with the content. Keep it that way; a "nicer" highlighted code block that breaks every time someone pastes new JSON is a maintenance regression, not an improvement.

Adding a whole new page

Copy an existing page's full <head>/nav/sidebar markup verbatim (every page in this folder repeats it — there's no templating), swap the <title>/meta description/ <h1>/content, and add the new page to every other page's sidebar (search this folder for docs-sidebar-group and add the link to each) and to index.html's chip grid if it's a top-level reference page. Missing even one page's sidebar link is the most common way this site goes subtly stale — there is no shared nav partial to update in one place.

What this replaced

This folder supersedes coach-home/mission-spec.agent.md, mission-spec.html, and mission-spec-examples/ — all now stale (missing all_of/not, vspeed-relative thresholds, RPM/runway-proximity conditions, the retry/rearm/counter system, continuous grading curves, objectives, and the whole RemoteLesson/RemotePack outer format). mission-spec.html now redirects here; the .agent.md file and mission-spec-examples/ are left in place, marked deprecated, for anything that still links to them directly, rather than deleted outright.