@plasius/learning 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/courses/adventure-mission-planner.ts","../../src/mission-authoring.ts","../../src/course-contracts.ts","../../src/courses/course-authoring.ts","../../src/courses/web-course-authoring.ts"],"sourcesContent":["import { authorCourse } from \"./course-authoring.js\";\nimport { webProjectFiles, webReferences, webStarterCss } from \"./web-course-authoring.js\";\n\nexport const { course, practice } = authorCourse({\n slug: \"adventure-mission-planner\", title: \"Adventure Mission Planner\", category: \"web-app\",\n summary: \"Build a real three-file web application for a fictional expedition. Structure a readable page, validate a labelled form, create and revise mission records, then recover a saved plan without accepting corrupt data. Finish an accessible planner with truthful counts and explicit feedback, using simulated storage inside the preview.\",\n projectFiles: webProjectFiles,\n starterProject: { files: [\n { path: \"index.html\", source: `<main>\n <h1>Adventure Mission Planner</h1>\n <p>Plan a fictional expedition, one mission at a time.</p>\n <section aria-labelledby=\"entry-heading\">\n <h2 id=\"entry-heading\">New mission</h2>\n <form data-action=\"add\" novalidate>\n <label for=\"title\">Mission title</label>\n <input id=\"title\" name=\"title\" type=\"text\" maxlength=\"80\" aria-required=\"true\" aria-describedby=\"title-error\" data-value=\"draft.title\" data-invalid=\"titleInvalid\">\n <p id=\"title-error\" class=\"error\" role=\"alert\" data-text=\"titleError\"></p>\n <label for=\"minutes\">Minutes, from 5 to 180</label>\n <input id=\"minutes\" name=\"minutes\" type=\"number\" min=\"5\" max=\"180\" step=\"1\" aria-required=\"true\" aria-describedby=\"minutes-error\" data-value=\"draft.minutes\" data-invalid=\"minutesInvalid\">\n <p id=\"minutes-error\" class=\"error\" role=\"alert\" data-text=\"minutesError\"></p>\n <label for=\"priority\">Priority</label>\n <select id=\"priority\" name=\"priority\" data-value=\"draft.priority\"><option value=\"low\">Low</option><option value=\"normal\">Normal</option><option value=\"high\">High</option></select>\n <button type=\"submit\">Add mission</button>\n </form>\n </section>\n <section aria-labelledby=\"plan-heading\"><h2 id=\"plan-heading\">Your plan</h2>\n <p data-text=\"summary\"></p><ul class=\"cards\"><li data-repeat=\"missions\"><strong data-text=\"title\"></strong><p data-text=\"details\"></p></li></ul>\n </section>\n <p role=\"status\" data-text=\"message\"></p>\n <button type=\"button\" data-action=\"reset\">Reset preview</button>\n</main>` },\n { path: \"app.css\", source: webStarterCss },\n { path: \"app.js\", source: `function initialState() {\n return { missions: [], draft: { title: \"\", minutes: \"15\", priority: \"normal\" }, editingId: null,\n filter: \"all\", nextId: 1, savedSnapshot: null, titleError: \"\", minutesError: \"\", message: \"Add a fictional mission to begin.\" };\n}\nfunction update(state, input) {\n if (input.type === \"reset\") return initialState();\n return JSON.parse(JSON.stringify(state));\n}\nfunction validateDraft(draft) { return { valid: false, titleError: \"Check the title.\", minutesError: \"Check the minutes.\" }; }\nfunction snapshot(state) { return \"\"; }\nfunction restoreSnapshot(text) { return null; }\nfunction view(state) {\n return { draft: { ...state.draft }, missions: [], totalCount: state.missions.length, completedCount: 0,\n totalMinutes: 0, summary: \"No missions yet.\", isCreating: state.editingId === null, isEditing: state.editingId !== null,\n titleError: state.titleError, minutesError: state.minutesError, titleInvalid: state.titleError !== \"\",\n minutesInvalid: state.minutesError !== \"\", hasSavedPlan: state.savedSnapshot !== null, message: state.message };\n}\n` },\n ] },\n reference: [...webReferences,\n { name: \"initialState\", signature: \"initialState() → empty planner\", description: \"Fresh state has missions=[], draft {title:'',minutes:'15',priority:'normal'}, editingId=null, filter='all', nextId=1, savedSnapshot=null, empty titleError/minutesError and a useful message. Records have only id, title, minutes, priority and done. There are at most 20 missions. IDs are mission-N for integers N from 1 to 999999; nextId is an integer from 1 to 1000000 and always exceeds every allocated ID.\", example: '{ id: \"mission-1\", title: \"Find the beacon\", minutes: 15, priority: \"normal\", done: false }' },\n { name: \"validateDraft\", signature: \"validateDraft(draft) → {valid,titleError,minutesError}\", description: \"Title is trimmed, 1–80 characters; reject control characters. Minutes is a string of one to three decimal digits whose integer value is 5–180; reject blanks, signs, fractions and exponent notation. Priority must be low, normal or high. Return empty errors for valid fields and useful field errors otherwise. valid requires all three fields; an invalid priority also produces general feedback. Do not change the supplied draft.\", example: 'const minutesValid = /^\\\\d{1,3}$/.test(draft.minutes) && Number(draft.minutes) >= 5 && Number(draft.minutes) <= 180;' },\n { name: \"update\", signature: \"update(state, input) → detached next state\", description: \"field accepts string title/minutes/priority values bounded to 80/3/6 characters; unrecognised fields or invalid priorities preserve state. add requires creating mode, a valid draft, room below 20 and an available ID. Append one trimmed record, increment nextId, clear draft/errors, preserve existing records and give feedback. Failed add/save keeps records, nextId and draft intact while setting errors/message. Unknown actions preserve values.\", example: 'update(state, { type: \"field\", name: \"title\", value: \"Find the beacon\" });' },\n { name: \"revision actions\", signature: \"edit/save/cancel/toggle/remove/filter\", description: \"edit{id} copies an existing record into the draft and selects its ID; save validates then changes its title/minutes/priority while retaining ID/done; cancel clears draft and editingId. toggle{id} flips done once. remove{id} removes exactly that record, cancelling if it was being edited. Unknown IDs preserve state. filter is a named field whose value is all/open/done; it changes only filter and cancels editing. add never acts as save and save never acts as add.\", example: 'update(state, { type: \"edit\", id: \"mission-1\" });' },\n { name: \"view\", signature: \"view(state) → labelled display projection\", description: \"Return draft, filtered missions with id/title/done/details/toggleLabel/editLabel/removeLabel, totalCount/completedCount/totalMinutes from all records, summary, isCreating/isEditing, titleError/minutesError and matching titleInvalid/minutesInvalid booleans, hasSavedPlan and message. Include filter for a bound select. Render record actions with data-id and data-label; never use record text as HTML. Reading view changes no state.\", example: 'const toggleLabel = (mission.done ? \"Reopen \" : \"Complete \") + mission.title;' },\n { name: \"snapshot\", signature: \"snapshot(state) → JSON string\", description: \"Serialize only {schemaVersion:1,nextId,missions}, at most 16000 characters. store sets savedSnapshot to that string and reports success. Preview storage is simulated in state: it is not localStorage, an account API or a cloud backup. reset clears the preview including this snapshot; account project saves remain separate.\", example: 'JSON.stringify({ schemaVersion: 1, nextId: state.nextId, missions: state.missions });' },\n { name: \"restoreSnapshot\", signature: \"restoreSnapshot(text) → validated snapshot | null\", description: \"Check string length, parse errors, exact object/record keys, version 1, 0–20 records, unique mission-N IDs, trimmed valid titles, bounded integer minutes, allowed priorities, boolean done and nextId greater than every record ID. Reject duplicate IDs, extra properties and corrupt data as null. reload validates savedSnapshot before replacing records/nextId; success clears draft/errors/editing and resets filter to all. Invalid/missing snapshots preserve working data and change only message. Retain savedSnapshot on either outcome.\", example: 'const restored = restoreSnapshot(state.savedSnapshot); if (restored === null) return { ...state, message: \"Saved plan could not be loaded.\" };' },\n ],\n}, [\n {\n title: \"A page with a purpose\", concepts: [\"Semantic HTML\", \"CSS layout\", \"Display data\"],\n goals: [\"Give a fictional planner a clear heading structure and readable responsive layout.\", \"Distinguish editable HTML, CSS and JavaScript responsibilities.\"],\n extension: \"Create a second expedition theme in a named save while preserving semantic headings, readable text and the same data contract.\",\n activities: {\n learn: [\"The planner uses three editable files. HTML names the page, form and mission list; CSS controls readable layout; JavaScript produces state and display data. Start with one main landmark and an h1, then h2 headings for entering and reviewing missions.\", \"The preview accepts an HTML fragment. It supplies the surrounding document and loads app.css separately, so do not add script or link tags.\"],\n predict: [\"Predict what changes when you edit only the heading text, only the main padding, or only the initial message. Identify which file owns each effect before running the starter.\", \"A visual change does not automatically change the mission records stored in JavaScript state.\"],\n build: [\"Give the page a fictional expedition identity, retain visible field labels and organise the two sections. Adjust app.css so the form and list fit 320px without horizontal page scrolling and remain readable in both colour themes.\", \"Use flexible widths, wrapping text and min-width:0 for layout children. Keep visible focus outlines on controls.\"],\n run: [\"Open the empty planner, move through its controls with the keyboard and inspect its heading order. Zoom the page and compare narrow and wide views. The initial summary should truthfully say there are no missions.\", \"The Add button is intentionally unfinished at this stage; later lessons connect its action to validated state changes.\"],\n assess: [\"Check the main landmark, meaningful headings, visible control labels, empty-state projection and responsive style rules. Confirm view reads state without changing it and reset produces a fresh empty planner.\", \"This milestone assesses an honest starting interface; it does not require the later record-creation behaviour yet.\"],\n inspect: [\"If a panel overflows, inspect widths and long text before shrinking the font. If a control is hard to find, inspect its label and focus styling rather than relying on a decorative icon.\", \"A narrow preview is a useful way to reveal assumptions that a wide desktop view hides.\"],\n fix: [\"Repair the page structure or styles and repeat the keyboard, zoom and 320px checks. Keep the message bound through data-text so changing state updates actual text instead of executable markup.\", \"The same source should work at multiple widths; avoid separate narrow-page copies that drift apart.\"],\n explain: [\"Explain why headings describe the document while colours and spacing belong in CSS. Choose the change that improves navigation for someone using a screen reader.\", \"A heading's meaning comes from its HTML level and text, not from making an ordinary paragraph look large.\"],\n reward: [\"Save Readable expedition. Your planner now has a clear structure and a truthful empty view. The next mission gives the form useful validation and feedback.\", \"Keep this working three-file starting point so later changes can be compared with it.\"],\n },\n questions: {\n learn: { question: \"Which file should describe the planner's heading structure?\", choices: [\"index.html\", \"app.css only\", \"The saved snapshot\"], correctChoice: 0, feedback: \"Semantic headings belong in HTML, while CSS styles their appearance and JavaScript supplies changing application data.\" },\n predict: { question: \"What does changing only main padding normally affect?\", choices: [\"The mission IDs\", \"The space around page content\", \"The number of saved missions\"], correctChoice: 1, feedback: \"Padding is a layout property, so it changes spacing without changing the planner's records or identities.\" },\n explain: { question: \"Which change helps heading-based screen-reader navigation?\", choices: [\"A larger paragraph font\", \"A decorative border\", \"Meaningful h1 and h2 elements\"], correctChoice: 2, feedback: \"Real heading elements expose document structure to assistive technology instead of communicating it only visually.\" },\n },\n },\n {\n title: \"A form that explains itself\", concepts: [\"Native controls\", \"Validation\", \"Accessible errors\"],\n goals: [\"Handle bounded field input without changing mission records.\", \"Validate titles, minutes and priorities and explain invalid fields accessibly.\"],\n extension: \"Compare error wording with a partner using fictional input. Revise the wording to describe how to recover while keeping the same validation rules.\",\n activities: {\n learn: [\"A form needs to explain what went wrong without losing the user's work. Native controls emit field actions. validateDraft checks trimmed title, decimal minutes and allowed priority. A labelled error linked with aria-describedby and a matching aria-invalid state makes the failure discoverable.\", \"The form uses novalidate so your own consistent feedback can run; JavaScript must still enforce every documented rule.\"],\n predict: [\"Predict validation for a blank title, whitespace around Beacon walk, minutes 4, 15.5, 1e2 and 180. Separate the displayed draft from the normalised values you will eventually save.\", \"Number inputs still emit strings. Accepting Number(value) alone would also accept some formats the planner explicitly excludes.\"],\n build: [\"Handle title, minutes and priority field actions using detached state. Implement validateDraft and make add report field errors for invalid input without creating records yet. Bind the error text and booleans, and clear a field's stale error when that field changes.\", \"Do not replace the draft with trimmed data while the user is typing. Normalise only when a valid submission is committed.\"],\n run: [\"Submit empty and malformed drafts, then correct them using the keyboard. Verify visible errors, retained input, screen-reader associations and focus preservation while typing. Try the same form at 320px.\", \"A repeated render should not move focus to the page top or replace the active field's editing selection.\"],\n assess: [\"Check accepted boundaries 5 and 180, rejected blank/fraction/exponent minutes, whitespace-only and overlong titles, forbidden control characters and invalid priorities. Verify errors match fields and validation has no mutation effects.\", \"Useful validation checks both the successful case and nearby inputs that look plausible but violate a documented rule.\"],\n inspect: [\"If a rejected input disappears, inspect draft updates. If an error remains after correction, inspect error clearing. If the form reloads the preview, inspect submission ownership and remove any separate action on its submit button.\", \"One submission belongs to the form; two independent handlers can accidentally create duplicate transitions later.\"],\n fix: [\"Repair validation and field feedback, then replay invalid-to-valid input. Confirm a valid draft reports empty field errors, invalid priority cannot slip through, and no attempt has changed missions or nextId.\", \"Form correction is separate from record creation; preserve that boundary until the next mission implements commit behaviour.\"],\n explain: [\"Explain why the original draft is kept after failure and why aria-invalid alone is insufficient without useful text. Identify the format check that prevents exponent notation being accepted as ordinary minutes.\", \"A person needs both an indication of the problem and enough information to correct it.\"],\n reward: [\"Save Helpful form. Your controls accept bounded input and explain validation failures. Next you will commit valid drafts into uniquely identified mission records.\", \"Retain the invalid-to-valid examples as regression cases for later editing and storage work.\"],\n },\n questions: {\n learn: { question: \"What should a failed submission preserve for the user?\", choices: [\"Only the heading\", \"Their draft and existing mission records\", \"Only the invalid field's colour\"], correctChoice: 1, feedback: \"Keeping the draft and existing records lets the person correct the problem without losing their current or earlier work.\" },\n predict: { question: \"Which minutes string satisfies the documented format and bounds?\", choices: [\"15.5\", \"1e2\", \"180\"], correctChoice: 2, feedback: \"The planner accepts one to three decimal digits with an integer value from five to one hundred and eighty.\" },\n explain: { question: \"Why link an invalid input to a written error?\", choices: [\"To explain how to correct it beyond colour or a flag\", \"To submit twice\", \"To remove the field label\"], correctChoice: 0, feedback: \"A linked, useful error communicates the reason and recovery step to people who may not perceive the visual styling.\" },\n },\n },\n {\n title: \"Turn entries into missions\", concepts: [\"Arrays and records\", \"Stable identity\", \"Atomic changes\"],\n goals: [\"Commit valid drafts as unique records with bounded storage.\", \"Project mission cards and summary counts from the same source of truth.\"],\n extension: \"Show a total-time sentence that changes as missions are added. Keep the calculation derived from records rather than maintaining a second editable total.\",\n activities: {\n learn: [\"A mission is a record with a stable ID, title, minutes, priority and done flag. Valid add commits one record and increments nextId together. Keep at most 20 missions and never reuse IDs after removal; summaries are calculated from records rather than separately counted clicks.\", \"Stable identity matters even when two fictional missions share the same title.\"],\n predict: [\"Predict IDs and totals after adding two valid missions with an invalid submission between them. Then predict an attempt to add a twenty-first mission and whether its failure should consume an ID.\", \"A refused operation must not partly update the list or counter before checking all prerequisites.\"],\n build: [\"Complete add in creating mode: validate, check capacity and ID availability, append one trimmed record, increment nextId and clear the successful draft. Implement view with repeated mission records, total/completed counts, total minutes and a truthful summary.\", \"Use data-repeat with unique id values and data-text for mission text. Keep HTML IDs out of repeated card content.\"],\n run: [\"Create two missions, compare their labels, IDs and minute total, then attempt an invalid third. Check that typing text resembling HTML displays as text and cannot create elements in the page.\", \"The renderer's text boundary and your app's record validation serve different purposes; both must remain intact.\"],\n assess: [\"Check single-record commits, trimmed titles, numeric minutes, unique increasing IDs, 20-record capacity, exhausted IDs, unchanged records on refusal and nonmutating display projection. Verify summaries describe the complete list.\", \"An attractive card cannot establish that the underlying record or identity was committed correctly.\"],\n inspect: [\"If duplicates appear, inspect whether the form submits twice or nextId increments separately from insertion. If totals drift after refusal, replace independent counters with calculations over the current records.\", \"Look for the first state transition that differs from your prediction, not just the last visible symptom.\"],\n fix: [\"Repair the commit boundary and rerun valid-invalid-valid submissions. Confirm the failed attempt leaves no partial record, the successful draft clears, and the next record receives the next unused ID.\", \"Prepare a detached next state, then return the coherent result only after all required conditions are known.\"],\n explain: [\"Explain why a title is a poor identifier and why a failed add should leave nextId unchanged. Choose the implementation that keeps list and count changes coherent.\", \"Identity lets later edits target a record even when its title or displayed position changes.\"],\n reward: [\"Save Mission maker. Your planner now turns valid input into meaningful records and honest summaries. The next mission adds editing, completion and focused views.\", \"Keep a two-record example with different priorities for exercising revision without confusing identity with position.\"],\n },\n questions: {\n learn: { question: \"Why does each mission need an ID separate from its title?\", choices: [\"Titles can never change\", \"Titles must be secret\", \"A record must remain identifiable after edits or reordering\"], correctChoice: 2, feedback: \"Stable identity keeps later actions attached to the intended record even when its human-readable title changes.\" },\n predict: { question: \"Two valid adds with one refused add between them produce which IDs?\", choices: [\"mission-1 and mission-2\", \"mission-1 and mission-3\", \"Two copies of mission-1\"], correctChoice: 0, feedback: \"The refused add commits neither a record nor an ID increment, so the next successful record receives mission-2.\" },\n explain: { question: \"Where should totalMinutes come from?\", choices: [\"The number of Add clicks\", \"The current complete mission list\", \"The last typed minutes field\"], correctChoice: 1, feedback: \"Deriving the summary from current records prevents rejected attempts and later edits from drifting a separate total.\" },\n },\n },\n {\n title: \"Revise without losing the plan\", concepts: [\"Editing state\", \"Record actions\", \"Filtering\"],\n goals: [\"Edit, complete and remove exactly the intended record.\", \"Separate filtered presentation from stored data and keep editing modes explicit.\"],\n extension: \"Add a visible explanation of the current filter. Check that global totals remain understandable when only one part of the plan is visible.\",\n activities: {\n learn: [\"Editing copies a record into a draft while preserving its ID and done status until save. Toggle and remove also target IDs. Filtering changes what view returns, never what missions contains. Cancelling or changing filter clears editing so a hidden record is not accidentally modified.\", \"Creating and editing are distinct modes: add must not become save merely because a draft happens to contain existing text.\"],\n predict: [\"Predict a plan after completing its first record, filtering to open, editing the second and cancelling. Compare visible cards with global counts, then predict removing the record currently being edited.\", \"The total count describes all records even when the filtered list is smaller.\"],\n build: [\"Add labelled per-record edit/toggle/remove buttons using data-id and data-label. Implement edit, save, cancel, toggle, remove and the filter field. Show the correct Add or Save controls for each mode, retain ID/done on save and clear editing when removal targets it.\", \"Use data-if for mode-specific controls and data-pressed for completion state, with readable labels that do not rely on colour.\"],\n run: [\"Use the keyboard to edit one of two similarly titled missions, submit an invalid edit, correct it, cancel another edit and change filters. Remove one record and add a new one to check that its ID is not reused.\", \"Follow focus through the interaction; when a clicked record disappears, the host should restore focus to a sensible surviving control.\"],\n assess: [\"Check exact-ID targeting, invalid-edit preservation, retained completion state, cancel without effects, unknown IDs, filter preservation and no ID reuse. Check that save cannot create a record and add cannot overwrite one.\", \"These cases cross several features, so include them alongside the earlier creation and validation checks.\"],\n inspect: [\"If the wrong card changes, inspect index-based targeting. If completed work vanishes after filtering, inspect whether a filtered array replaced the source list. If an edit becomes a duplicate, inspect mode guards.\", \"A display index is temporary and should never become the record's long-term identity.\"],\n fix: [\"Repair the responsible transition and replay edit, filter, remove and add with two similar titles. Recheck summaries and focus, including the case where no visible missions remain.\", \"An empty filtered list needs an understandable message while preserving the hidden records.\"],\n explain: [\"Explain the difference between filtering records and deleting them. Choose which fields a successful edit must retain and describe why separate modes protect the plan.\", \"Useful editing changes the intended content while preserving the record's identity and established completion state.\"],\n reward: [\"Save Revisable plan. Your planner can change its mind without losing records or confusing identities. Next you will store and safely restore a complete plan.\", \"Keep the mixed completed/open example as a useful snapshot recovery fixture.\"],\n },\n questions: {\n learn: { question: \"What should filtering change in the stored mission list?\", choices: [\"Nothing; it changes the view\", \"It deletes hidden records\", \"It replaces every ID\"], correctChoice: 0, feedback: \"Filtering selects a presentation of the existing records, so switching back can reveal the same intact plan.\" },\n predict: { question: \"What survives a successful title-and-minutes edit?\", choices: [\"Only the old title\", \"The record's ID and done flag\", \"No part of the existing record\"], correctChoice: 1, feedback: \"An edit changes the draft-owned fields while retaining stable identity and the record's completion state.\" },\n explain: { question: \"Why should add refuse to run during editing mode?\", choices: [\"To disable all keyboard controls\", \"To hide field errors\", \"To prevent an edit from accidentally becoming a duplicate record\"], correctChoice: 2, feedback: \"Explicit operation modes prevent one user intention from silently creating a different kind of state change.\" },\n },\n },\n {\n title: \"Recover a saved plan\", concepts: [\"Serialization\", \"Untrusted data\", \"Recovery\"],\n goals: [\"Serialize only the plan data needed for recovery.\", \"Validate a whole snapshot before replacing working state and explain recovery failures.\"],\n extension: \"Design a recovery message for an unsupported future snapshot version. Explain why guessing at its meaning could damage an otherwise valid current plan.\",\n activities: {\n learn: [\"Saved text is input that must be checked again. snapshot writes version, nextId and missions; restoreSnapshot validates the full shape and every record before returning data. The exercise uses simulated storage in preview state, separate from account saves of the source project.\", \"A snapshot does not include errors, active editing or filters, because recovery should reopen a stable plan rather than a half-finished interaction.\"],\n predict: [\"Predict recovery for valid data, truncated JSON, duplicate IDs, a wrong version and nextId equal to an existing record number. Decide which state should survive when restoreSnapshot returns null.\", \"Successful JSON parsing proves syntax only; it does not establish that the data describes a valid plan.\"],\n build: [\"Implement bounded snapshot and restoreSnapshot, checking exact keys, types, record limits, identity uniqueness and nextId ordering. Add Store plan and Reload plan controls. On valid reload replace records/nextId together and reset interaction state; on failure preserve the working plan and report a useful message.\", \"Validate before replacement. A try/catch around JSON.parse is necessary but insufficient for record and identity rules.\"],\n run: [\"Store a mixed plan, edit it, then reload the stored version. Use the supplied corrupt-snapshot scenarios and confirm current records survive each refusal. Try reload before any snapshot exists and compare the feedback.\", \"The saved snapshot lives only in this preview session; the course's account-bound source saves are a separate feature.\"],\n assess: [\"Check round-trip equality, version and exact-key rules, malformed/oversized input, invalid record fields, duplicate identities and invalid nextId. Verify corrupt reload has no partial effects and successful reload resets filter, draft and editing consistently.\", \"Restoring valid records one at a time before the whole snapshot passes can leave a mixed old-and-new plan.\"],\n inspect: [\"If restore accepts broken data, identify the first missing validation rule. If failure destroys the current plan, inspect assignment order. If a later add duplicates an ID, inspect nextId against the greatest restored record number.\", \"A saved counter and its records form one coherent data set; checking them separately is not enough.\"],\n fix: [\"Repair the validator or replacement boundary and replay valid-corrupt-valid recovery. Confirm the snapshot itself remains available, recovery errors are readable, and the current source still passes earlier editing and creation checks.\", \"Keep rejected data from altering either working records or the snapshot that the user deliberately stored.\"],\n explain: [\"Explain why syntactically valid JSON can still be invalid application data. Describe the difference between storing a preview plan and saving this three-file project to your Plasius account.\", \"One preserves simulated application data for the exercise; the other preserves authored source and learning progress.\"],\n reward: [\"Save Recoverable plan. Your planner can recover known data and refuse corrupt input without losing current work. The final mission combines the whole journey into a complete accessible application.\", \"Retain the duplicate-ID and wrong-version cases because they test different recovery boundaries.\"],\n },\n questions: {\n learn: { question: \"What does successful JSON.parse establish?\", choices: [\"All mission IDs are unique\", \"The text has valid JSON syntax\", \"The nextId counter is safe\"], correctChoice: 1, feedback: \"Parsing checks representation syntax; application rules such as uniqueness, versions and counter ordering still need validation.\" },\n predict: { question: \"What should remain after reloading a corrupt snapshot?\", choices: [\"An empty planner\", \"Half of the snapshot's records\", \"The current working plan with useful failure feedback\"], correctChoice: 2, feedback: \"Validation must finish before replacement, so a rejected snapshot cannot partially overwrite or erase the working plan.\" },\n explain: { question: \"Why must restored nextId exceed every existing mission number?\", choices: [\"To prevent the next add reusing an existing identity\", \"To make JSON prettier\", \"To change all old mission titles\"], correctChoice: 0, feedback: \"The allocation counter must agree with restored records or a future add could create an ambiguous duplicate identity.\" },\n },\n },\n {\n title: \"Your complete adventure planner\", concepts: [\"Integrated behaviour\", \"Accessibility evidence\", \"Capstone\"],\n goals: [\"Deliver a coherent planner with validation, revision, summaries and recoverable data.\", \"Demonstrate the complete keyboard journey and assess the exact saved source.\"],\n extension: \"Propose a new planning feature in a separate save, naming its data invariants, accessible interactions and recovery implications before implementing it.\",\n activities: {\n learn: [\"A complete planner connects structure, validation, record identity, revision and recovery into one understandable task. Its visual theme supports that task, while readable errors and stable focus help people recover from mistakes. The capstone checks the whole current source.\", \"A previous successful assessment cannot prove a later edit still works; final evidence must match the saved project.\"],\n predict: [\"Plan a demonstration that adds two missions, rejects an invalid edit, completes one, filters the list, stores a snapshot, removes a record and reloads. Predict counts, minutes, identities and editing mode at each step.\", \"Include a refusal and a recovery so the demonstration covers more than the easiest successful path.\"],\n build: [\"Finish the authored page, labels, summaries and status messages. Review the three files together, remove abandoned controls, keep Store/Reload clearly described as simulated preview storage and ensure reset is separate from account saving.\", \"Consistency means a visible action, its JavaScript rule and its explanatory text describe the same operation.\"],\n run: [\"Perform the demonstration with keyboard and touch, then at 320px, with zoom, both colour themes and reduced motion. Check headings, errors and status with a screen reader. Save and reload the project source, then repeat the same plan.\", \"Avoid announcing every keystroke as a status update; announce completed actions and useful failures without duplicating field errors.\"],\n assess: [\"Run the final validation, creation, edit/cancel, toggle/remove, filter, identity, capacity, serialization and corrupt-recovery scenarios. Verify detached state, inert text and responsive accessible controls, then obtain current-source evidence for the final project.\", \"The reference scenarios check actual behaviour; a filled-out page alone does not complete this module.\"],\n inspect: [\"For any failure, locate the earliest incorrect state transition and its owning file. Compare the saved source with the tested source, especially if a recent style or label edit changed bindings.\", \"A renamed binding can break data flow even when the page still looks convincing.\"],\n fix: [\"Repair the smallest responsible rule, rerun its focused scenario and then the complete demonstration. Save a named final project and assess it again before completing the course.\", \"Keep successful earlier scenarios in the final regression set so a local repair does not undo another mission's work.\"],\n explain: [\"Explain how validation and stable identity protect the plan, why recovery checks untrusted data, and how semantic controls make the same workflow usable through different input methods.\", \"Use one concrete example from your own tested project for each claim rather than relying on a general statement that it works.\"],\n reward: [\"Save Expedition ready and finish the final assessment. You have built a real editable web planner from semantic structure through recoverable application state. Replay a mission or extend a separate save while retaining earned completion.\", \"Your source project remains account-bound; the simulated plan can be reset independently for another demonstration.\"],\n },\n questions: {\n learn: { question: \"What establishes the final planner's behaviour?\", choices: [\"A screenshot of the title\", \"A previous assessment of different source\", \"Verified scenarios against the current saved source\"], correctChoice: 2, feedback: \"Evidence must exercise the implemented behaviour and match the exact source being submitted for completion.\" },\n predict: { question: \"Which demonstration best covers recovery as well as normal use?\", choices: [\"Create, edit, store, change and reload a plan\", \"Open the heading once\", \"Change only the background colour\"], correctChoice: 0, feedback: \"A sequence spanning creation, revision and recovery exposes interactions that an isolated visual check cannot establish.\" },\n explain: { question: \"What should a later extension preserve?\", choices: [\"Only the theme colours\", \"Existing invariants, accessible operation and recovery behaviour\", \"Only the newest feature\"], correctChoice: 1, feedback: \"Extending a useful application means retaining the working rules and access paths that its current users already depend on.\" },\n },\n },\n]);\n","import {\n MISSION_AUTHORING_CONTRACT_VERSION_V1,\n type LearningModuleVersionV1,\n type MissionArtifactKindV1,\n type MissionAuthoringBundleV1,\n type MissionAuthoringValidationIssueV1,\n type MissionInteractionModeV1,\n type MissionStageKindV1,\n} from \"./contracts.js\";\nimport { validateAssessmentRubric } from \"./rubric-validation.js\";\n\nexport const JUNIOR_CODER_MISSION_STAGE_ORDER_V1 = [\n \"learn\",\n \"predict\",\n \"build\",\n \"run\",\n \"assess\",\n \"inspect\",\n \"fix\",\n \"explain\",\n \"reward\",\n] as const satisfies readonly MissionStageKindV1[];\n\nconst LEARNER_STARTER_KINDS = new Set<MissionArtifactKindV1>([\n \"starter-code\",\n \"starter-assets\",\n \"sample-data\",\n]);\n\nconst LEARNER_FORBIDDEN_KINDS = new Set<MissionArtifactKindV1>([\n \"facilitator-note\",\n \"answer-key\",\n \"protected-test\",\n]);\n\nconst SINGLE_MODE_REQUIRES_ALTERNATIVE = new Set<MissionInteractionModeV1>([\n \"pointer\",\n \"drag\",\n \"audio\",\n \"colour\",\n \"motion\",\n]);\n\nfunction authoringIssue(\n code: MissionAuthoringValidationIssueV1[\"code\"],\n message: string,\n path: string,\n): MissionAuthoringValidationIssueV1 {\n return { code, message, path };\n}\n\nfunction reportDuplicateIds(\n ids: string[],\n path: string,\n): MissionAuthoringValidationIssueV1[] {\n const seen = new Set<string>();\n const issues: MissionAuthoringValidationIssueV1[] = [];\n for (const id of ids) {\n if (seen.has(id)) {\n issues.push(\n authoringIssue(\"duplicate-id\", `Duplicate authored ID ${id}.`, path),\n );\n }\n seen.add(id);\n }\n return issues;\n}\n\n/**\n * Validate learner/facilitator authoring against one immutable catalog module.\n * The complete issue set is returned so authoring tools can fix errors in one pass.\n */\nexport function validateMissionAuthoringBundle(\n bundle: MissionAuthoringBundleV1,\n module: LearningModuleVersionV1,\n): MissionAuthoringValidationIssueV1[] {\n const issues: MissionAuthoringValidationIssueV1[] = [];\n\n if (bundle.version !== MISSION_AUTHORING_CONTRACT_VERSION_V1) {\n issues.push(\n authoringIssue(\n \"bundle-version-mismatch\",\n `Unsupported mission authoring version ${bundle.version}.`,\n \"version\",\n ),\n );\n }\n\n if (bundle.moduleId !== module.id || bundle.moduleVersion !== module.version) {\n issues.push(\n authoringIssue(\n \"module-reference-mismatch\",\n `Bundle ${bundle.moduleId}@${bundle.moduleVersion} does not match ${module.id}@${module.version}.`,\n \"moduleId\",\n ),\n );\n }\n\n if (!module.missions.some((mission) => mission.id === bundle.missionId)) {\n issues.push(\n authoringIssue(\n \"mission-reference-mismatch\",\n `Mission ${bundle.missionId} does not exist in module ${module.id}.`,\n \"missionId\",\n ),\n );\n }\n\n const learner = bundle.learner;\n const facilitator = bundle.facilitator;\n\n if (learner.estimatedMinutes < 15 || learner.estimatedMinutes > 25) {\n issues.push(\n authoringIssue(\n \"invalid-duration\",\n \"A mission must last between 15 and 25 minutes.\",\n \"learner.estimatedMinutes\",\n ),\n );\n }\n\n const stageKinds = learner.stages.map((stage) => stage.kind);\n for (const requiredStage of JUNIOR_CODER_MISSION_STAGE_ORDER_V1) {\n const count = stageKinds.filter((stage) => stage === requiredStage).length;\n if (count === 0) {\n issues.push(\n authoringIssue(\n \"missing-stage\",\n `Mission stage ${requiredStage} is required.`,\n \"learner.stages\",\n ),\n );\n } else if (count > 1) {\n issues.push(\n authoringIssue(\n \"duplicate-stage\",\n `Mission stage ${requiredStage} appears more than once.`,\n \"learner.stages\",\n ),\n );\n }\n }\n if (\n stageKinds.length === JUNIOR_CODER_MISSION_STAGE_ORDER_V1.length\n && stageKinds.some(\n (stage, index) => stage !== JUNIOR_CODER_MISSION_STAGE_ORDER_V1[index],\n )\n ) {\n issues.push(\n authoringIssue(\n \"stage-order\",\n \"Mission stages must follow the canonical learner journey.\",\n \"learner.stages\",\n ),\n );\n }\n\n if (learner.readinessChecks.length === 0) {\n issues.push(\n authoringIssue(\n \"missing-readiness-check\",\n \"At least one unscored readiness check is required.\",\n \"learner.readinessChecks\",\n ),\n );\n }\n if (learner.readinessChecks.some((check) => check.scored !== false)) {\n issues.push(\n authoringIssue(\n \"scored-readiness-check\",\n \"Readiness checks must not affect the deterministic score.\",\n \"learner.readinessChecks\",\n ),\n );\n }\n issues.push(\n ...reportDuplicateIds(\n learner.readinessChecks.map((check) => check.id),\n \"learner.readinessChecks\",\n ),\n );\n\n const learnerArtifactIds = new Set(learner.artifacts.map((artifact) => artifact.id));\n if (!learner.artifacts.some((artifact) => LEARNER_STARTER_KINDS.has(artifact.kind))) {\n issues.push(\n authoringIssue(\n \"missing-starter-artifact\",\n \"At least one learner-safe starter artifact is required.\",\n \"learner.artifacts\",\n ),\n );\n }\n if (\n learner.artifacts.some(\n (artifact) =>\n artifact.audience !== \"learner\"\n || artifact.solutionBearing\n || LEARNER_FORBIDDEN_KINDS.has(artifact.kind),\n )\n ) {\n issues.push(\n authoringIssue(\n \"learner-artifact-leak\",\n \"Learner artifacts cannot contain facilitator or solution-bearing content.\",\n \"learner.artifacts\",\n ),\n );\n }\n if (facilitator.artifacts.some((artifact) => artifact.audience !== \"facilitator\")) {\n issues.push(\n authoringIssue(\n \"facilitator-artifact-leak\",\n \"Facilitator artifacts must remain in the facilitator projection.\",\n \"facilitator.artifacts\",\n ),\n );\n }\n issues.push(\n ...reportDuplicateIds(\n [...learner.artifacts, ...facilitator.artifacts].map((artifact) => artifact.id),\n \"artifacts\",\n ),\n );\n for (const [stageIndex, stage] of learner.stages.entries()) {\n for (const artifactId of stage.artifactIds) {\n if (!learnerArtifactIds.has(artifactId)) {\n issues.push(\n authoringIssue(\n \"unknown-artifact\",\n `Stage references unknown learner artifact ${artifactId}.`,\n `learner.stages[${stageIndex}].artifactIds`,\n ),\n );\n }\n }\n }\n\n if (learner.goals.length === 0) {\n issues.push(\n authoringIssue(\n \"missing-visible-goal\",\n \"At least one visible learner goal is required.\",\n \"learner.goals\",\n ),\n );\n }\n if (facilitator.protectedGoals.length === 0) {\n issues.push(\n authoringIssue(\n \"missing-protected-goal\",\n \"At least one protected facilitator goal is required.\",\n \"facilitator.protectedGoals\",\n ),\n );\n }\n\n const allGoals = [...learner.goals, ...facilitator.protectedGoals];\n const learnerGoalIds = new Set(learner.goals.map((goal) => goal.id));\n const seenGoalIds = new Set<string>();\n for (const goal of allGoals) {\n if (seenGoalIds.has(goal.id)) {\n issues.push(\n authoringIssue(\n \"duplicate-goal-id\",\n `Duplicate goal ID ${goal.id}.`,\n \"goals\",\n ),\n );\n }\n seenGoalIds.add(goal.id);\n }\n if (\n learner.goals.some((goal) => goal.visibility !== \"visible\")\n || facilitator.protectedGoals.some(\n (goal) => goal.visibility !== \"protected\" || goal.completionRequired,\n )\n ) {\n issues.push(\n authoringIssue(\n \"invalid-goal-projection\",\n \"Visible goals belong to learners and protected goals to facilitators.\",\n \"goals\",\n ),\n );\n }\n\n const criterionById = new Map(\n module.assessment.criteria.map((criterion) => [criterion.id, criterion]),\n );\n for (const goal of allGoals) {\n if (goal.criterionIds.length === 0) {\n issues.push(\n authoringIssue(\n \"unknown-criterion\",\n `Goal ${goal.id} must reference a deterministic criterion.`,\n \"goals\",\n ),\n );\n }\n for (const criterionId of goal.criterionIds) {\n const criterion = criterionById.get(criterionId);\n if (!criterion) {\n issues.push(\n authoringIssue(\n \"unknown-criterion\",\n `Goal ${goal.id} references unknown criterion ${criterionId}.`,\n \"goals\",\n ),\n );\n } else if (criterion.visibility !== goal.visibility) {\n issues.push(\n authoringIssue(\n \"criterion-visibility-mismatch\",\n `Goal ${goal.id} cannot expose a ${criterion.visibility} criterion as ${goal.visibility}.`,\n \"goals\",\n ),\n );\n }\n }\n if (goal.completionRequired && goal.aiRequired) {\n issues.push(\n authoringIssue(\n \"ai-dependent-completion\",\n `Completion goal ${goal.id} cannot require AI.`,\n \"goals\",\n ),\n );\n }\n }\n\n for (const rubricIssue of validateAssessmentRubric(module.assessment)) {\n if (\n rubricIssue.code === \"rubric-total\"\n || rubricIssue.code === \"rubric-dimension-total\"\n || rubricIssue.code === \"duplicate-criterion-id\"\n || rubricIssue.code === \"missing-mandatory-safety\"\n ) {\n issues.push(\n authoringIssue(rubricIssue.code, rubricIssue.message, rubricIssue.path),\n );\n }\n }\n\n const alternativeById = new Map(\n learner.accessibilityAlternatives.map((alternative) => [alternative.id, alternative]),\n );\n issues.push(\n ...reportDuplicateIds(\n learner.interactions.map((interaction) => interaction.id),\n \"learner.interactions\",\n ),\n ...reportDuplicateIds(\n learner.accessibilityAlternatives.map((alternative) => alternative.id),\n \"learner.accessibilityAlternatives\",\n ),\n );\n for (const [interactionIndex, interaction] of learner.interactions.entries()) {\n if (\n SINGLE_MODE_REQUIRES_ALTERNATIVE.has(interaction.primaryMode)\n && interaction.alternativeIds.length === 0\n ) {\n issues.push(\n authoringIssue(\n \"inaccessible-interaction\",\n `Interaction ${interaction.id} requires an equivalent alternative.`,\n `learner.interactions[${interactionIndex}]`,\n ),\n );\n }\n for (const alternativeId of interaction.alternativeIds) {\n const alternative = alternativeById.get(alternativeId);\n if (!alternative) {\n issues.push(\n authoringIssue(\n \"unknown-accessibility-alternative\",\n `Interaction ${interaction.id} references unknown alternative ${alternativeId}.`,\n `learner.interactions[${interactionIndex}].alternativeIds`,\n ),\n );\n } else if (\n alternative.equivalentOutcome !== true\n || alternative.modes.length === 0\n || alternative.modes.every((mode) => mode === interaction.primaryMode)\n ) {\n issues.push(\n authoringIssue(\n \"non-equivalent-accessibility-alternative\",\n `Alternative ${alternativeId} must provide an equivalent outcome through another mode.`,\n \"learner.accessibilityAlternatives\",\n ),\n );\n }\n }\n }\n\n if (learner.evidenceRequirements.length === 0) {\n issues.push(\n authoringIssue(\n \"missing-evidence\",\n \"At least one evidence requirement is required.\",\n \"learner.evidenceRequirements\",\n ),\n );\n }\n issues.push(\n ...reportDuplicateIds(\n learner.evidenceRequirements.map((evidence) => evidence.id),\n \"learner.evidenceRequirements\",\n ),\n );\n for (const [evidenceIndex, evidence] of learner.evidenceRequirements.entries()) {\n if (evidence.containsPersonalData !== false) {\n issues.push(\n authoringIssue(\n \"personal-data-evidence\",\n \"Mission evidence cannot request personal data.\",\n `learner.evidenceRequirements[${evidenceIndex}]`,\n ),\n );\n }\n for (const goalId of evidence.goalIds) {\n if (!learnerGoalIds.has(goalId)) {\n issues.push(\n authoringIssue(\n \"unknown-evidence-goal\",\n `Evidence references unknown goal ${goalId}.`,\n `learner.evidenceRequirements[${evidenceIndex}].goalIds`,\n ),\n );\n }\n }\n }\n for (const goal of learner.goals.filter((entry) => entry.completionRequired)) {\n if (\n !learner.evidenceRequirements.some((evidence) => evidence.goalIds.includes(goal.id))\n ) {\n issues.push(\n authoringIssue(\n \"missing-evidence\",\n `Completion goal ${goal.id} requires deterministic evidence.`,\n \"learner.evidenceRequirements\",\n ),\n );\n }\n }\n\n const mandatorySafetyGoals = learner.goals.filter(\n (goal) =>\n goal.completionRequired\n && goal.criterionIds.some((criterionId) => {\n const criterion = criterionById.get(criterionId);\n return criterion?.dimension === \"safety\" && criterion.mandatory;\n }),\n );\n if (\n mandatorySafetyGoals.length === 0\n || !mandatorySafetyGoals.some((goal) =>\n learner.evidenceRequirements.some((evidence) => evidence.goalIds.includes(goal.id)),\n )\n ) {\n issues.push(\n authoringIssue(\n \"missing-safety-evidence\",\n \"A completion-required goal must evidence a mandatory safety criterion.\",\n \"learner.evidenceRequirements\",\n ),\n );\n }\n\n issues.push(\n ...reportDuplicateIds(\n learner.sideAdventures.map((adventure) => adventure.id),\n \"learner.sideAdventures\",\n ),\n );\n if (learner.sideAdventures.length === 0) {\n issues.push(\n authoringIssue(\n \"missing-side-adventure\",\n \"At least one optional side adventure is required.\",\n \"learner.sideAdventures\",\n ),\n );\n }\n if (learner.sideAdventures.some((adventure) => adventure.completionRequired !== false)) {\n issues.push(\n authoringIssue(\n \"mandatory-side-adventure\",\n \"Side adventures must remain optional.\",\n \"learner.sideAdventures\",\n ),\n );\n }\n\n const badgeIds = new Set(module.badges.map((badge) => badge.id));\n issues.push(\n ...reportDuplicateIds(\n learner.rewardBindings.map((reward) => reward.id),\n \"learner.rewardBindings\",\n ),\n );\n for (const [rewardIndex, reward] of learner.rewardBindings.entries()) {\n const rewardInvalid =\n reward.deterministic !== true\n || reward.random !== false\n || reward.tokenConvertible !== false\n || reward.goalIds.length === 0\n || !badgeIds.has(reward.badgeId)\n || reward.goalIds.some((goalId) => !learnerGoalIds.has(goalId));\n if (rewardInvalid) {\n issues.push(\n authoringIssue(\n \"invalid-reward\",\n `Reward ${reward.id} must be deterministic, evidence-bound and non-convertible.`,\n `learner.rewardBindings[${rewardIndex}]`,\n ),\n );\n }\n }\n\n if (learner.functionReference) {\n const functionIds = new Set(\n learner.functionReference.map((entry) => entry.id),\n );\n const invalidFunctionReference =\n functionIds.size !== learner.functionReference.length\n || learner.functionReference.length === 0\n || learner.functionReference.some((entry) => {\n const parameterNames = new Set(\n entry.parameters.map((parameter) => parameter.name),\n );\n return entry.id.trim().length === 0\n || entry.signature.trim().length === 0\n || entry.summary.trim().length === 0\n || entry.effect.trim().length === 0\n || entry.example.trim().length === 0\n || parameterNames.size !== entry.parameters.length\n || entry.parameters.some(\n (parameter) =>\n parameter.name.trim().length === 0\n || parameter.type.trim().length === 0\n || parameter.description.trim().length === 0,\n );\n });\n if (invalidFunctionReference) {\n issues.push(\n authoringIssue(\n \"invalid-function-reference\",\n \"Function references require unique IDs, signatures, parameters, effects and examples.\",\n \"learner.functionReference\",\n ),\n );\n }\n }\n\n if (learner.boundedSuggestion) {\n const suggestion = learner.boundedSuggestion;\n const invalidBoundedSuggestion =\n suggestion.id.trim().length === 0\n || suggestion.source !== \"authored-fallback\"\n || suggestion.intent.trim().length === 0\n || suggestion.constraints.length === 0\n || suggestion.constraints.some((constraint) => constraint.trim().length === 0)\n || !learnerArtifactIds.has(suggestion.permittedArtifactId)\n || suggestion.originalSnippet.trim().length === 0\n || suggestion.replacementSnippet.trim().length === 0\n || suggestion.originalSnippet === suggestion.replacementSnippet\n || suggestion.explanationPrompt.trim().length === 0\n || suggestion.aiOptional !== false\n || suggestion.learnerApprovalRequired !== true\n || suggestion.alternatives.length !== 2\n || suggestion.alternatives[0] !== \"accept\"\n || suggestion.alternatives[1] !== \"reject\";\n if (invalidBoundedSuggestion) {\n issues.push(\n authoringIssue(\n \"invalid-bounded-suggestion\",\n \"A bounded suggestion requires one learner artifact, authored constraints, a visible diff and explicit accept/reject approval.\",\n \"learner.boundedSuggestion\",\n ),\n );\n }\n }\n\n const hardware = bundle.hardware;\n if (hardware) {\n if (\n module.category !== \"robot\"\n || module.hardware.mode !== \"physical-first\"\n || !module.hardware.simulatorAvailable\n ) {\n issues.push(\n authoringIssue(\n \"hardware-module-mismatch\",\n \"Mission hardware disclosure requires a simulator-backed physical robot module.\",\n \"hardware\",\n ),\n );\n }\n\n if (hardware.requirementsVersion !== module.hardware.requirementsVersion) {\n issues.push(\n authoringIssue(\n \"hardware-requirements-version-mismatch\",\n `Hardware disclosure ${hardware.requirementsVersion} does not match catalog requirements ${module.hardware.requirementsVersion}.`,\n \"hardware.requirementsVersion\",\n ),\n );\n }\n\n const catalogHardwareById = new Map(\n module.hardware.items.map((item) => [item.id, item]),\n );\n const completePathIds = new Set(hardware.completePathItemIds);\n const incrementalIds = new Set(hardware.incrementalItemIds);\n const componentIds = new Set(hardware.components.map((component) => component.itemId));\n const catalogIds = new Set(catalogHardwareById.keys());\n const hasDuplicateHardwareIds =\n completePathIds.size !== hardware.completePathItemIds.length\n || incrementalIds.size !== hardware.incrementalItemIds.length\n || componentIds.size !== hardware.components.length;\n const hasUnknownOrMissingItems =\n hasDuplicateHardwareIds\n || completePathIds.size !== catalogIds.size\n || componentIds.size !== catalogIds.size\n || [...catalogIds].some(\n (itemId) => !completePathIds.has(itemId) || !componentIds.has(itemId),\n )\n || [...incrementalIds].some((itemId) => !catalogIds.has(itemId));\n const hasMismatchedComponent = hardware.components.some((component) => {\n const catalogItem = catalogHardwareById.get(component.itemId);\n const expectedScope = incrementalIds.has(component.itemId)\n ? \"incremental\"\n : \"complete-path\";\n return !catalogItem\n || component.quantity !== catalogItem.quantity\n || component.acquisitionScope !== expectedScope;\n });\n if (hasUnknownOrMissingItems || hasMismatchedComponent) {\n issues.push(\n authoringIssue(\n \"hardware-item-mismatch\",\n \"Complete, incremental and per-component hardware disclosures must match the immutable catalog manifest.\",\n \"hardware.components\",\n ),\n );\n }\n\n if (\n hardware.components.some(\n (component) =>\n component.verificationStatus !== \"verified\"\n && component.compatibilityClaimed,\n )\n || (\n module.hardware.verificationStatus !== \"verified\"\n && !module.hardware.publicSaleBlocked\n )\n ) {\n issues.push(\n authoringIssue(\n \"hardware-verification-claim\",\n \"Unverified hardware cannot claim compatibility or unblock public physical sale.\",\n \"hardware.components\",\n ),\n );\n }\n\n const safeguards = hardware.safeguards;\n if (\n safeguards.adultAssemblyRequired !== true\n || safeguards.adultAcknowledgementRequiredForExport !== true\n || safeguards.websiteMayControlHardware !== false\n || safeguards.simulatorCompletionAvailable !== true\n || safeguards.physicalBadgeRequiresAdultSignoff !== true\n || safeguards.adultAssemblySteps.length === 0\n || safeguards.powerRequirements.length === 0\n || safeguards.cableRequirements.length === 0\n || safeguards.softwarePrerequisites.length === 0\n || safeguards.warnings.length === 0\n || hardware.components.some(\n (component) =>\n component.physicalCompletionEligible\n && (\n component.verificationStatus !== \"verified\"\n || module.hardware.verificationStatus !== \"verified\"\n ),\n )\n ) {\n issues.push(\n authoringIssue(\n \"unsafe-physical-export\",\n \"Physical export and completion require adult acknowledgement, verified hardware and a website that never controls hardware.\",\n \"hardware.safeguards\",\n ),\n );\n }\n\n const simulatedBadge = module.badges.find(\n (badge) => badge.id === safeguards.simulatedBadgeId,\n );\n const physicalBadge = module.badges.find(\n (badge) => badge.id === safeguards.physicalBadgeId,\n );\n if (\n simulatedBadge?.evidence === \"adult-physical-signoff\"\n || physicalBadge?.evidence !== \"adult-physical-signoff\"\n ) {\n issues.push(\n authoringIssue(\n \"invalid-hardware-reward\",\n \"Simulated and physical badges must be distinct, and only the physical badge may require adult sign-off.\",\n \"hardware.safeguards\",\n ),\n );\n }\n }\n\n return issues;\n}\n\n/** Fail fast for CI and immutable authoring registration. */\nexport function assertValidMissionAuthoringBundle(\n bundle: MissionAuthoringBundleV1,\n module: LearningModuleVersionV1,\n): void {\n const issues = validateMissionAuthoringBundle(bundle, module);\n if (issues.length === 0) return;\n\n const summary = issues\n .map((entry) => `${entry.code} at ${entry.path}: ${entry.message}`)\n .join(\"\\n\");\n throw new Error(`Invalid mission authoring bundle:\\n${summary}`);\n}\n\n/**\n * Original visual-programming mission for Robot Maze Dash. Learner content\n * contains no protected route, answer key or hidden assessment expectation.\n */\nexport const ROBOT_MAZE_DASH_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.robot-maze-dash\",\n moduleVersion: \"1.1.0\",\n missionId: \"robot-maze-dash-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Meet the move, turn-left and turn-right action blocks and read what each command does.\",\n artifactIds: [\"robot-maze-dash-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict where the robot will stop after it follows the blocks from top to bottom.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Arrange the action blocks so the rescue robot can reach the beacon.\",\n artifactIds: [\"robot-maze-dash-m1-program\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to watch the robot follow your visual program.\",\n artifactIds: [\"robot-maze-dash-m1-program\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic mission checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted block with the first goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Move, add or remove one action block, then run the mission again.\",\n artifactIds: [\"robot-maze-dash-m1-program\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how the order of your blocks changed the robot path.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the score and safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"robot-maze-dash-m1-read-order\",\n prompt: \"Point to the first action the robot will follow.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"robot-maze-dash-m1-program\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"robot-maze-dash-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"robot-maze-dash-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"robot-maze-dash-m1-starts\",\n statement: \"The visual program is structurally valid and starts.\",\n visibility: \"visible\",\n criterionIds: [\"robot-maze-dash-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"robot-maze-dash-m1-reaches-beacon\",\n statement: \"The robot follows the action order and reaches the rescue beacon.\",\n visibility: \"visible\",\n criterionIds: [\n \"robot-maze-dash-goal-one\",\n \"robot-maze-dash-goal-two\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"robot-maze-dash-m1-safe-preview\",\n statement: \"The robot stays inside the private maze simulator boundary.\",\n visibility: \"visible\",\n criterionIds: [\"robot-maze-dash-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"robot-maze-dash-m1-reorder-blocks\",\n description: \"Change the order of visual action blocks.\",\n primaryMode: \"drag\",\n alternativeIds: [\"robot-maze-dash-m1-button-reorder\"],\n },\n {\n id: \"robot-maze-dash-m1-run-control\",\n description: \"Start the private maze simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"robot-maze-dash-m1-keyboard-run\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"robot-maze-dash-m1-button-reorder\",\n modes: [\"keyboard\", \"pointer\"],\n equivalentOutcome: true,\n description: \"Use labelled Move up and Move down buttons instead of dragging a block.\",\n },\n {\n id: \"robot-maze-dash-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Start the same simulation by pressing Enter or Space on the Run button.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"robot-maze-dash-m1-assessment\",\n goalIds: [\n \"robot-maze-dash-m1-starts\",\n \"robot-maze-dash-m1-reaches-beacon\",\n \"robot-maze-dash-m1-safe-preview\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"robot-maze-dash-m1-explanation\",\n goalIds: [\"robot-maze-dash-m1-reaches-beacon\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"robot-maze-dash-m1-remix\",\n prompt: \"Invent a different safe route and describe which action block must change first.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"robot-maze-dash-m1-badge\",\n badgeId: \"robot-maze-dash-mission-complete\",\n goalIds: [\n \"robot-maze-dash-m1-starts\",\n \"robot-maze-dash-m1-reaches-beacon\",\n \"robot-maze-dash-m1-safe-preview\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"robot-maze-dash-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"robot-maze-dash-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"robot-maze-dash-m1-protected-bounds\",\n statement: \"The interpreter stops safely at walls, bounds and its action limit.\",\n visibility: \"protected\",\n criterionIds: [\n \"robot-maze-dash-edge-one\",\n \"robot-maze-dash-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to point to the first action block before suggesting a change.\",\n \"Use the command reference and visible goal; never reveal the protected route or expected block list.\",\n ],\n },\n};\n\n/**\n * Original first mission for Skywing Sprint. Learner content documents the\n * flight controls without exposing protected numeric targets or source answers.\n */\nexport const SKYWING_SPRINT_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.skywing-sprint\",\n moduleVersion: \"1.1.0\",\n missionId: \"skywing-sprint-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how lift, gravity and gate-gap functions change Skywing's flight.\",\n artifactIds: [\"skywing-sprint-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict whether Skywing will rise or fall after one lift pulse.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the three documented settings in the starter JavaScript.\",\n artifactIds: [\"skywing-sprint-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private flight preview.\",\n artifactIds: [\"skywing-sprint-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic flight checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted setting with the first goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one setting, run again and observe the flight telemetry.\",\n artifactIds: [\"skywing-sprint-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how lift and gravity changed Skywing's vertical speed.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the score and safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"skywing-sprint-m1-predict-velocity\",\n prompt: \"Point to the setting that changes Skywing's upward push.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"skywing-sprint-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"skywing-sprint-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"skywing-sprint-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"skywing-sprint-m1-starts\",\n statement: \"The JavaScript settings are valid and the private preview starts.\",\n visibility: \"visible\",\n criterionIds: [\"skywing-sprint-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"skywing-sprint-m1-safe-flight\",\n statement: \"Lift and gravity create a controllable flight through the rescue gate.\",\n visibility: \"visible\",\n criterionIds: [\n \"skywing-sprint-goal-one\",\n \"skywing-sprint-goal-two\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"skywing-sprint-m1-private-runtime\",\n statement: \"The game stays inside the private educational preview boundary.\",\n visibility: \"visible\",\n criterionIds: [\"skywing-sprint-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"skywing-sprint-m1-run-control\",\n description: \"Start the private flight simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"skywing-sprint-m1-keyboard-run\"],\n },\n {\n id: \"skywing-sprint-m1-flight-control\",\n description: \"Send a lift pulse while the preview is running.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"skywing-sprint-m1-flight-motion\",\n description: \"Observe Skywing moving through the animated gate preview.\",\n primaryMode: \"motion\",\n alternativeIds: [\"skywing-sprint-m1-reduced-motion\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"skywing-sprint-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"skywing-sprint-m1-reduced-motion\",\n modes: [\"text\"],\n equivalentOutcome: true,\n description: \"Use the position, velocity and gate-status text instead of animation.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"skywing-sprint-m1-assessment\",\n goalIds: [\n \"skywing-sprint-m1-starts\",\n \"skywing-sprint-m1-safe-flight\",\n \"skywing-sprint-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"skywing-sprint-m1-explanation\",\n goalIds: [\"skywing-sprint-m1-safe-flight\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"skywing-sprint-m1-remix\",\n prompt: \"Invent a new gate name and choose one setting to make the flight gentler.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"skywing-sprint-m1-badge\",\n badgeId: \"skywing-sprint-mission-complete\",\n goalIds: [\n \"skywing-sprint-m1-starts\",\n \"skywing-sprint-m1-safe-flight\",\n \"skywing-sprint-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"skywing-sprint-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"skywing-sprint-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"skywing-sprint-m1-protected-resilience\",\n statement: \"The runtime clamps unsafe values and terminates bounded simulations.\",\n visibility: \"protected\",\n criterionIds: [\n \"skywing-sprint-edge-one\",\n \"skywing-sprint-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner which direction a positive velocity moves Skywing before suggesting a setting change.\",\n \"Use the visible telemetry and function reference; never reveal protected numeric targets or expected source fragments.\",\n ],\n },\n};\n\n/**\n * Original first mission for Paddle Pulse. Learners tune documented paddle\n * and ball controls without receiving protected collision targets or answers.\n */\nexport const PADDLE_PULSE_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.paddle-pulse\",\n moduleVersion: \"1.1.0\",\n missionId: \"paddle-pulse-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how paddle width, ball speed and bounce angle change an energy-ball rally.\",\n artifactIds: [\"paddle-pulse-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict which direction the energy ball will travel after it reaches the paddle.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the three documented settings in the starter JavaScript.\",\n artifactIds: [\"paddle-pulse-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private energy-court preview.\",\n artifactIds: [\"paddle-pulse-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic rally checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted setting with the first goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one setting, run again and observe the bounce telemetry.\",\n artifactIds: [\"paddle-pulse-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how paddle width and bounce angle changed the energy ball path.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the score and safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"paddle-pulse-m1-find-angle\",\n prompt: \"Point to the setting that changes the direction of the bounce.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"paddle-pulse-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"paddle-pulse-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"paddle-pulse-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"paddle-pulse-m1-starts\",\n statement: \"The JavaScript settings are valid and the private preview starts.\",\n visibility: \"visible\",\n criterionIds: [\"paddle-pulse-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"paddle-pulse-m1-controlled-bounce\",\n statement: \"The paddle returns the energy ball toward the target wall with a controllable angle.\",\n visibility: \"visible\",\n criterionIds: [\n \"paddle-pulse-goal-one\",\n \"paddle-pulse-goal-two\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"paddle-pulse-m1-private-runtime\",\n statement: \"The game stays inside the private educational preview boundary.\",\n visibility: \"visible\",\n criterionIds: [\"paddle-pulse-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"paddle-pulse-m1-run-control\",\n description: \"Start the private energy-court simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"paddle-pulse-m1-keyboard-run\"],\n },\n {\n id: \"paddle-pulse-m1-paddle-control\",\n description: \"Move the paddle left or right during practice.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"paddle-pulse-m1-ball-motion\",\n description: \"Observe the energy ball moving and bouncing across the court.\",\n primaryMode: \"motion\",\n alternativeIds: [\"paddle-pulse-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"paddle-pulse-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"paddle-pulse-m1-telemetry\",\n modes: [\"text\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Use position, direction and target-status text instead of ball animation.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"paddle-pulse-m1-assessment\",\n goalIds: [\n \"paddle-pulse-m1-starts\",\n \"paddle-pulse-m1-controlled-bounce\",\n \"paddle-pulse-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"paddle-pulse-m1-explanation\",\n goalIds: [\"paddle-pulse-m1-controlled-bounce\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"paddle-pulse-m1-remix\",\n prompt: \"Invent an original energy power-up and describe one bounded setting it would change.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"paddle-pulse-m1-badge\",\n badgeId: \"paddle-pulse-mission-complete\",\n goalIds: [\n \"paddle-pulse-m1-starts\",\n \"paddle-pulse-m1-controlled-bounce\",\n \"paddle-pulse-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"paddle-pulse-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"paddle-pulse-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"paddle-pulse-m1-protected-resilience\",\n statement: \"The runtime clamps unsafe settings and terminates bounded collision simulations.\",\n visibility: \"protected\",\n criterionIds: [\n \"paddle-pulse-edge-one\",\n \"paddle-pulse-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner which setting changes direction before suggesting a code edit.\",\n \"Use visible telemetry and the function reference; never reveal protected numeric targets or expected source fragments.\",\n ],\n },\n};\n\n/**\n * Original first mission for Pixel Trail Challenge. Learners use documented,\n * bounded Python host functions without receiving protected coordinates,\n * expected source fragments or list/collision edge answers.\n */\nexport const PIXEL_TRAIL_CHALLENGE_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.pixel-trail-challenge\",\n moduleVersion: \"1.1.0\",\n missionId: \"pixel-trail-challenge-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read what set_direction(), set_trail_limit() and place_energy_orb() do in the private Python preview.\",\n artifactIds: [\"pixel-trail-challenge-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict the next grid square and how the trail list will change after one move.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the three documented Python calls so the pixel follows a safe trail toward the energy orb.\",\n artifactIds: [\"pixel-trail-challenge-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private grid preview.\",\n artifactIds: [\"pixel-trail-challenge-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic trail checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted Python line with the first goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one direction, trail or orb setting, run again and inspect the position and list-length telemetry.\",\n artifactIds: [\"pixel-trail-challenge-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how the direction changed the position and why the trail list kept only recent squares.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the score and private-runtime safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"pixel-trail-challenge-m1-find-direction\",\n prompt: \"Point to the Python call that chooses the pixel's next direction.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"pixel-trail-challenge-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"pixel-trail-challenge-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"pixel-trail-challenge-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"pixel-trail-challenge-m1-starts\",\n statement: \"The Python settings are valid and the private grid preview starts.\",\n visibility: \"visible\",\n criterionIds: [\"pixel-trail-challenge-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"pixel-trail-challenge-m1-safe-trail\",\n statement: \"The pixel moves in the chosen direction, keeps a bounded trail list and reaches the energy orb.\",\n visibility: \"visible\",\n criterionIds: [\n \"pixel-trail-challenge-goal-one\",\n \"pixel-trail-challenge-goal-two\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"pixel-trail-challenge-m1-private-runtime\",\n statement: \"The program stays inside the private Python worker and host-provided grid API.\",\n visibility: \"visible\",\n criterionIds: [\"pixel-trail-challenge-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"pixel-trail-challenge-m1-run-control\",\n description: \"Start the private Python grid simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"pixel-trail-challenge-m1-keyboard-run\"],\n },\n {\n id: \"pixel-trail-challenge-m1-direction-control\",\n description: \"Change the active movement direction with labelled arrow controls or arrow keys.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"pixel-trail-challenge-m1-trail-motion\",\n description: \"Observe the pixel, recent trail squares and energy orb on the grid.\",\n primaryMode: \"motion\",\n alternativeIds: [\"pixel-trail-challenge-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"pixel-trail-challenge-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"pixel-trail-challenge-m1-telemetry\",\n modes: [\"text\", \"shape\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read row, column, direction, trail length and orb status without animation or colour dependence.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"pixel-trail-challenge-m1-assessment\",\n goalIds: [\n \"pixel-trail-challenge-m1-starts\",\n \"pixel-trail-challenge-m1-safe-trail\",\n \"pixel-trail-challenge-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"pixel-trail-challenge-m1-explanation\",\n goalIds: [\"pixel-trail-challenge-m1-safe-trail\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"pixel-trail-challenge-m1-remix\",\n prompt: \"Invent an original energy-orb symbol and describe a new safe grid rule for collecting it.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"pixel-trail-challenge-m1-badge\",\n badgeId: \"pixel-trail-challenge-mission-complete\",\n goalIds: [\n \"pixel-trail-challenge-m1-starts\",\n \"pixel-trail-challenge-m1-safe-trail\",\n \"pixel-trail-challenge-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"pixel-trail-challenge-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"pixel-trail-challenge-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"pixel-trail-challenge-m1-protected-resilience\",\n statement: \"The worker rejects invalid directions, clamps trail capacity and terminates bounded grid simulations before list or collision abuse.\",\n visibility: \"protected\",\n criterionIds: [\n \"pixel-trail-challenge-edge-one\",\n \"pixel-trail-challenge-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict the next row and column before suggesting a Python edit.\",\n \"Use the function reference and visible telemetry; never reveal protected coordinates, numeric targets or expected source fragments.\",\n ],\n },\n};\n\n/**\n * Original first mission for Star Defender Squadron. Learners launch bounded\n * JavaScript entities, patterns, health and rescue projectiles while protected\n * pass targets and runtime edge cases remain facilitator-only.\n */\nexport const STAR_DEFENDER_SQUADRON_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.star-defender-squadron\",\n moduleVersion: \"1.1.0\",\n missionId: \"star-defender-squadron-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read what createSquadron(), setRescueWave(), setShieldHealth() and launchRescueBeam() do in the private JavaScript preview.\",\n artifactIds: [\"star-defender-squadron-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict where the squadron and rescue beam will travel, and which health value will change after the wave.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the four documented JavaScript calls so the original squadron launches a safe rescue wave.\",\n artifactIds: [\"star-defender-squadron-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private Star Defender preview.\",\n artifactIds: [\"star-defender-squadron-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic squadron checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted JavaScript line with the first mission goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one squadron, wave, shield or beam setting, then rerun and inspect the entity and health telemetry.\",\n artifactIds: [\"star-defender-squadron-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how the wave pattern moved the entities and how shields protected the rescue mission.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the score and private-runtime safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"star-defender-squadron-m1-find-wave\",\n prompt: \"Point to the JavaScript call that chooses the rescue-wave pattern.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"star-defender-squadron-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"star-defender-squadron-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"star-defender-squadron-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"star-defender-squadron-m1-starts\",\n statement: \"The JavaScript settings are valid and the private squadron preview starts.\",\n visibility: \"visible\",\n criterionIds: [\"star-defender-squadron-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"star-defender-squadron-m1-rescue-wave\",\n statement: \"The original squadron follows the chosen pattern, keeps safe shield health and launches a rescue beam.\",\n visibility: \"visible\",\n criterionIds: [\n \"star-defender-squadron-goal-one\",\n \"star-defender-squadron-goal-two\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"star-defender-squadron-m1-private-runtime\",\n statement: \"The program stays inside the private JavaScript worker and host-provided space-rescue API.\",\n visibility: \"visible\",\n criterionIds: [\"star-defender-squadron-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"star-defender-squadron-m1-run-control\",\n description: \"Start the private JavaScript squadron simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"star-defender-squadron-m1-keyboard-run\"],\n },\n {\n id: \"star-defender-squadron-m1-code-control\",\n description: \"Edit the documented squadron, wave, shield and beam calls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"star-defender-squadron-m1-wave-motion\",\n description: \"Observe squadron entities, wave paths, shields and the rescue beam.\",\n primaryMode: \"motion\",\n alternativeIds: [\"star-defender-squadron-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"star-defender-squadron-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"star-defender-squadron-m1-telemetry\",\n modes: [\"text\", \"shape\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read entity count, pattern, shield health, beam state and rescue result without animation or colour dependence.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"star-defender-squadron-m1-assessment\",\n goalIds: [\n \"star-defender-squadron-m1-starts\",\n \"star-defender-squadron-m1-rescue-wave\",\n \"star-defender-squadron-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"star-defender-squadron-m1-explanation\",\n goalIds: [\"star-defender-squadron-m1-rescue-wave\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"star-defender-squadron-m1-remix\",\n prompt: \"Invent an original rescue-squadron emblem and describe a new safe wave pattern for a later level.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"star-defender-squadron-m1-badge\",\n badgeId: \"star-defender-squadron-mission-complete\",\n goalIds: [\n \"star-defender-squadron-m1-starts\",\n \"star-defender-squadron-m1-rescue-wave\",\n \"star-defender-squadron-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"star-defender-squadron-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"star-defender-squadron-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"star-defender-squadron-m1-protected-resilience\",\n statement: \"The worker rejects invalid entity, pattern, health and projectile settings and terminates bounded wave simulations.\",\n visibility: \"protected\",\n criterionIds: [\n \"star-defender-squadron-edge-one\",\n \"star-defender-squadron-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict the squadron path and shield change before suggesting a JavaScript edit.\",\n \"Use the function reference and visible telemetry; never reveal protected numeric targets, pattern answers or expected source fragments.\",\n ],\n },\n};\n\n/**\n * First Beacon Bot robotics mission. The learner completes a bounded simulator\n * route; every physical item remains unverified, public-sale blocked and\n * ineligible for physical completion until an adult bench-test authority says\n * otherwise.\n */\nexport const BEACON_BOT_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.beacon-bot\",\n moduleVersion: \"1.1.0\",\n missionId: \"beacon-bot-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read what setVisibleSignal(), waitMs(), repeatSignal() and readIrReceiver() do in the private Beacon Bot simulator.\",\n artifactIds: [\"beacon-bot-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict the visible signal order, elapsed time and simulated IR reading before the sequence runs.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the four documented C++-style calls to create one bounded rescue signal.\",\n artifactIds: [\"beacon-bot-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private Beacon Bot simulator.\",\n artifactIds: [\"beacon-bot-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic beacon checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted C++-style line with the first signal goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one signal, wait, repeat or simulated IR setting, then rerun and inspect the text telemetry.\",\n artifactIds: [\"beacon-bot-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how the function calls created a timed signal and how the simulated receiver changed the result.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the simulated badge when the score and private-runtime safety check pass; physical completion remains adult-only.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"beacon-bot-m1-find-wait\",\n prompt: \"Point to the documented call that controls how long a visible signal stays on.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"beacon-bot-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"beacon-bot-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"beacon-bot-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"beacon-bot-m1-starts\",\n statement: \"The documented C++-style settings are valid and the private simulator starts.\",\n visibility: \"visible\",\n criterionIds: [\"beacon-bot-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"beacon-bot-m1-signal-sequence\",\n statement: \"The beacon produces a bounded timed pattern and reports one simulated IR receiver state.\",\n visibility: \"visible\",\n criterionIds: [\"beacon-bot-goal-one\", \"beacon-bot-goal-two\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"beacon-bot-m1-private-runtime\",\n statement: \"The program stays inside the private simulator and never accesses physical hardware, the network or browser storage.\",\n visibility: \"visible\",\n criterionIds: [\"beacon-bot-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"beacon-bot-m1-run-control\",\n description: \"Start the private Beacon Bot signal simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"beacon-bot-m1-keyboard-run\"],\n },\n {\n id: \"beacon-bot-m1-code-control\",\n description: \"Edit the documented signal, timing, repeat and receiver calls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"beacon-bot-m1-signal-colour\",\n description: \"Observe the visible rescue signal without relying on colour alone.\",\n primaryMode: \"colour\",\n alternativeIds: [\"beacon-bot-m1-signal-telemetry\"],\n },\n {\n id: \"beacon-bot-m1-signal-motion\",\n description: \"Observe the bounded signal sequence and receiver state changes.\",\n primaryMode: \"motion\",\n alternativeIds: [\"beacon-bot-m1-signal-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"beacon-bot-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same simulator.\",\n },\n {\n id: \"beacon-bot-m1-signal-telemetry\",\n modes: [\"text\", \"shape\", \"symbol\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read the signal name, step count, elapsed milliseconds and receiver state without colour or animation.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"beacon-bot-m1-assessment\",\n goalIds: [\n \"beacon-bot-m1-starts\",\n \"beacon-bot-m1-signal-sequence\",\n \"beacon-bot-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"beacon-bot-m1-explanation\",\n goalIds: [\"beacon-bot-m1-signal-sequence\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"beacon-bot-m1-remix\",\n prompt: \"Invent an original rescue-signal name and describe a text or shape cue that makes it understandable without colour.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"beacon-bot-m1-simulated-badge\",\n badgeId: \"beacon-bot-mission-complete\",\n goalIds: [\n \"beacon-bot-m1-starts\",\n \"beacon-bot-m1-signal-sequence\",\n \"beacon-bot-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"beacon-bot-function-visible-signal\",\n signature: \"setVisibleSignal(colour)\",\n summary: \"Chooses the named visible signal used by the next bounded step.\",\n parameters: [\n {\n name: \"colour\",\n type: \"string\",\n description: \"Use red, amber or green.\",\n },\n ],\n effect: \"Updates the simulator's labelled light and equivalent shape cue without accessing a physical LED.\",\n example: \"setVisibleSignal(\\\"green\\\");\",\n },\n {\n id: \"beacon-bot-function-wait\",\n signature: \"waitMs(duration)\",\n summary: \"Adds one safe wait to the simulated signal timeline.\",\n parameters: [\n {\n name: \"duration\",\n type: \"whole number\",\n description: \"A bounded number of milliseconds from 100 to 1000.\",\n },\n ],\n effect: \"Advances simulated elapsed time; it never blocks the website or controls hardware.\",\n example: \"waitMs(250);\",\n },\n {\n id: \"beacon-bot-function-repeat\",\n signature: \"repeatSignal(count)\",\n summary: \"Repeats the current visible signal a safe number of times.\",\n parameters: [\n {\n name: \"count\",\n type: \"whole number\",\n description: \"A bounded repeat count from 1 to 4.\",\n },\n ],\n effect: \"Adds a fixed number of labelled signal steps to the private simulator timeline.\",\n example: \"repeatSignal(3);\",\n },\n {\n id: \"beacon-bot-function-ir-receiver\",\n signature: \"readIrReceiver()\",\n summary: \"Reads the simulator's fictional infrared receiver state.\",\n parameters: [],\n effect: \"Returns detected or clear from simulator state only; it cannot access a real sensor.\",\n example: \"const receiverState = readIrReceiver();\",\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"beacon-bot-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"beacon-bot-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"beacon-bot-m1-adult-hardware-guide\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"beacon-bot-m1-protected-resilience\",\n statement: \"The simulator rejects unsupported signals, excessive waits or repeats and any hardware, network or storage request.\",\n visibility: \"protected\",\n criterionIds: [\"beacon-bot-edge-one\", \"beacon-bot-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict the labelled signal timeline before suggesting one bounded change.\",\n \"Use the function reference and visible telemetry; never provide wiring or physical power advice to a learner.\",\n \"Physical export stays unavailable until an adult acknowledges the exact manifest and every component has verified bench-test evidence.\",\n ],\n },\n hardware: {\n requirementsVersion: \"1.0.0\",\n hardwareIncluded: false,\n completePathItemIds: [\n \"pico-2-w\",\n \"breadboard\",\n \"usb-data-cable\",\n \"jumper-wires\",\n \"led-pack\",\n \"led-resistors\",\n \"ir-pair\",\n ],\n incrementalItemIds: [\"led-pack\", \"led-resistors\", \"ir-pair\"],\n components: [\n {\n itemId: \"pico-2-w\",\n quantity: 1,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"breadboard\",\n quantity: 1,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"usb-data-cable\",\n quantity: 1,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"jumper-wires\",\n quantity: 12,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"led-pack\",\n quantity: 3,\n acquisitionScope: \"incremental\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"led-resistors\",\n quantity: 3,\n acquisitionScope: \"incremental\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"ir-pair\",\n quantity: 1,\n acquisitionScope: \"incremental\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n ],\n safeguards: {\n adultAssemblyRequired: true,\n adultAcknowledgementRequiredForExport: true,\n websiteMayControlHardware: false,\n simulatorCompletionAvailable: true,\n simulatedBadgeId: \"beacon-bot-mission-complete\",\n physicalBadgeId: \"beacon-bot-physical-builder\",\n physicalBadgeRequiresAdultSignoff: true,\n adultAssemblySteps: [\n \"Confirm every exact component identity against the requirements manifest.\",\n \"Assemble and inspect the disconnected breadboard circuit before learner use.\",\n \"Run known-good recovery firmware and complete the adult bench-test record.\",\n ],\n powerRequirements: [\n \"Use Pico USB power only for the published Beacon Bot reference circuit.\",\n \"Disconnect USB power before changing any wiring.\",\n ],\n cableRequirements: [\n \"One known data-capable USB cable compatible with the Pico 2 W.\",\n \"Insulated male-to-male breadboard jumper wires matching the manifest quantity.\",\n ],\n softwarePrerequisites: [\n \"Supported Pico SDK toolchain on Raspberry Pi OS or a documented desktop environment.\",\n \"Known-good Beacon Bot recovery firmware prepared by an adult.\",\n ],\n warnings: [\n \"Hardware is not included with the module.\",\n \"No listed component currently claims compatibility or physical-completion eligibility.\",\n \"The simulator and simulated badge remain available without physical equipment.\",\n ],\n unrelatedHardwareNotRequired: [\n \"Camera Module 3\",\n \"motor driver or motors\",\n \"servo\",\n ],\n },\n },\n};\n\n/**\n * First Servo Creature robotics mission. The learner creates a bounded pose,\n * mood and interaction sequence in the simulator. Physical servo power and\n * movement remain unavailable until the exact reference build is bench tested.\n */\nexport const SERVO_CREATURE_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.servo-creature\",\n moduleVersion: \"1.1.0\",\n missionId: \"servo-creature-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read what setServoAngle(), waitMs(), repeatMovement(), setCreatureMood() and readTouchSensor() do in the private Servo Creature simulator.\",\n artifactIds: [\"servo-creature-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict the creature's labelled angle, mood, repeat count and simulated touch response before the sequence runs.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the five documented C++-style calls to create one bounded creature movement sequence.\",\n artifactIds: [\"servo-creature-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private Servo Creature simulator.\",\n artifactIds: [\"servo-creature-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic pose, mood and interaction checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted C++-style line with the first movement goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one angle, wait, repeat, mood or simulated touch call, then rerun and inspect the text telemetry.\",\n artifactIds: [\"servo-creature-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how the bounded calls created a safe movement and how the simulated interaction changed the creature's response.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the simulated badge when the score and private-runtime safety check pass; physical completion remains adult-only.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"servo-creature-m1-find-angle-limit\",\n prompt: \"Find the documented safe minimum and maximum angle before changing the creature's pose.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"servo-creature-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"servo-creature-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"servo-creature-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"servo-creature-m1-starts\",\n statement: \"The documented C++-style settings are valid and the private simulator starts.\",\n visibility: \"visible\",\n criterionIds: [\"servo-creature-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"servo-creature-m1-movement-sequence\",\n statement: \"The creature completes a bounded angle, timing, mood and interaction sequence.\",\n visibility: \"visible\",\n criterionIds: [\"servo-creature-goal-one\", \"servo-creature-goal-two\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"servo-creature-m1-private-runtime\",\n statement: \"The program stays inside the private simulator and never accesses physical hardware, the network or browser storage.\",\n visibility: \"visible\",\n criterionIds: [\"servo-creature-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"servo-creature-m1-run-control\",\n description: \"Start the private Servo Creature movement simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"servo-creature-m1-keyboard-run\"],\n },\n {\n id: \"servo-creature-m1-code-control\",\n description: \"Edit the documented angle, timing, repeat, mood and interaction calls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"servo-creature-m1-pose-motion\",\n description: \"Observe the bounded creature pose and movement sequence.\",\n primaryMode: \"motion\",\n alternativeIds: [\"servo-creature-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"servo-creature-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same simulator.\",\n },\n {\n id: \"servo-creature-m1-telemetry\",\n modes: [\"text\", \"shape\", \"symbol\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read the angle, mood, repeat count, elapsed milliseconds and touch state without animation.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"servo-creature-m1-assessment\",\n goalIds: [\n \"servo-creature-m1-starts\",\n \"servo-creature-m1-movement-sequence\",\n \"servo-creature-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"servo-creature-m1-explanation\",\n goalIds: [\"servo-creature-m1-movement-sequence\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"servo-creature-m1-remix\",\n prompt: \"Invent an original creature mood and describe a text or symbol cue that makes its pose understandable without movement.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"servo-creature-m1-simulated-badge\",\n badgeId: \"servo-creature-mission-complete\",\n goalIds: [\n \"servo-creature-m1-starts\",\n \"servo-creature-m1-movement-sequence\",\n \"servo-creature-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"servo-creature-function-angle\",\n signature: \"setServoAngle(degrees)\",\n summary: \"Chooses one safe labelled creature pose in the private simulator.\",\n parameters: [\n {\n name: \"degrees\",\n type: \"whole number\",\n description: \"A bounded angle from 30 to 150 degrees.\",\n },\n ],\n effect: \"Updates the simulator's labelled angle and pose cue without generating PWM or accessing a physical servo.\",\n example: \"setServoAngle(90);\",\n },\n {\n id: \"servo-creature-function-wait\",\n signature: \"waitMs(duration)\",\n summary: \"Adds one safe wait to the simulated movement timeline.\",\n parameters: [\n {\n name: \"duration\",\n type: \"whole number\",\n description: \"A bounded number of milliseconds from 100 to 1000.\",\n },\n ],\n effect: \"Advances simulated elapsed time; it never blocks the website or holds a physical servo under load.\",\n example: \"waitMs(300);\",\n },\n {\n id: \"servo-creature-function-repeat\",\n signature: \"repeatMovement(count)\",\n summary: \"Repeats the current simulated pose a safe number of times.\",\n parameters: [\n {\n name: \"count\",\n type: \"whole number\",\n description: \"A bounded repeat count from 1 to 4.\",\n },\n ],\n effect: \"Adds a fixed number of labelled pose steps to the private simulator timeline.\",\n example: \"repeatMovement(3);\",\n },\n {\n id: \"servo-creature-function-mood\",\n signature: \"setCreatureMood(mood)\",\n summary: \"Chooses the creature's labelled expression for the simulated pose.\",\n parameters: [\n {\n name: \"mood\",\n type: \"string\",\n description: \"Use calm, curious or happy.\",\n },\n ],\n effect: \"Updates the simulator's text and symbol mood cue without moving physical parts.\",\n example: \"setCreatureMood(\\\"curious\\\");\",\n },\n {\n id: \"servo-creature-function-touch\",\n signature: \"readTouchSensor()\",\n summary: \"Reads the simulator's fictional touch state for one interaction response.\",\n parameters: [],\n effect: \"Returns touched or clear from simulator state only; it cannot access a physical sensor.\",\n example: \"const touchState = readTouchSensor();\",\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"servo-creature-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"servo-creature-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"servo-creature-m1-adult-hardware-guide\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"servo-creature-m1-protected-resilience\",\n statement: \"The simulator rejects unsupported moods, out-of-range angles, excessive waits or repeats and any physical-hardware request.\",\n visibility: \"protected\",\n criterionIds: [\"servo-creature-edge-one\", \"servo-creature-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict the labelled pose timeline before suggesting one bounded change.\",\n \"Use the function reference and visible telemetry; never provide servo wiring, power or movement advice to a learner.\",\n \"Physical export stays unavailable until an adult acknowledges the exact manifest and every servo power component has verified bench-test evidence.\",\n ],\n },\n hardware: {\n requirementsVersion: \"1.0.0\",\n hardwareIncluded: false,\n completePathItemIds: [\n \"pico-2-w\",\n \"breadboard\",\n \"usb-data-cable\",\n \"jumper-wires\",\n \"micro-servo\",\n \"servo-power\",\n ],\n incrementalItemIds: [\"micro-servo\", \"servo-power\"],\n components: [\n {\n itemId: \"pico-2-w\",\n quantity: 1,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"breadboard\",\n quantity: 1,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"usb-data-cable\",\n quantity: 1,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"jumper-wires\",\n quantity: 12,\n acquisitionScope: \"complete-path\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"micro-servo\",\n quantity: 1,\n acquisitionScope: \"incremental\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n {\n itemId: \"servo-power\",\n quantity: 1,\n acquisitionScope: \"incremental\",\n verificationStatus: \"pending-bench-test\",\n compatibilityClaimed: false,\n physicalCompletionEligible: false,\n },\n ],\n safeguards: {\n adultAssemblyRequired: true,\n adultAcknowledgementRequiredForExport: true,\n websiteMayControlHardware: false,\n simulatorCompletionAvailable: true,\n simulatedBadgeId: \"servo-creature-mission-complete\",\n physicalBadgeId: \"servo-creature-physical-builder\",\n physicalBadgeRequiresAdultSignoff: true,\n adultAssemblySteps: [\n \"Confirm the exact servo, external supply and connector identities against the requirements manifest.\",\n \"Assemble and inspect the disconnected signal and common-ground wiring before learner use.\",\n \"Secure the creature linkage, lift or restrain moving parts and complete the adult bench-test record.\",\n ],\n powerRequirements: [\n \"Use an external regulated servo supply sized for the verified servo; do not power the servo from a Pico GPIO pin.\",\n \"Connect one common signal ground between the verified servo supply and Pico only as shown in the adult guide.\",\n \"Disconnect every power source before changing wiring or creature linkages.\",\n ],\n cableRequirements: [\n \"One known data-capable USB cable compatible with the Pico 2 W.\",\n \"Insulated jumper leads and a verified servo connector arrangement documented by the adult guide.\",\n ],\n softwarePrerequisites: [\n \"Supported Pico SDK toolchain on Raspberry Pi OS or a documented desktop environment.\",\n \"Known-good Servo Creature recovery firmware with adult-owned neutral-pose and stop behaviour.\",\n ],\n warnings: [\n \"Hardware is not included with the module.\",\n \"No listed servo or power arrangement currently claims compatibility or physical-completion eligibility.\",\n \"Pinch points, stalled servos and unsuitable power supplies can cause heat or movement; adult assembly and testing are mandatory.\",\n \"The simulator and simulated badge remain available without physical equipment.\",\n ],\n unrelatedHardwareNotRequired: [\n \"Camera Module 3 or Raspberry Pi Zero 2 W\",\n \"motor driver, motors or rover chassis\",\n \"physical touch or IR sensor\",\n \"LED or infrared beacon parts\",\n ],\n },\n },\n};\n\n/**\n * First Dance Rover robotics mission. Learners choreograph a bounded rover\n * sequence in the private simulator. Motor power, firmware export and physical\n * movement remain unavailable until the exact reference build is bench tested.\n */\nexport const DANCE_ROVER_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.dance-rover\",\n moduleVersion: \"1.1.0\",\n missionId: \"dance-rover-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read what driveRover(), turnRover(), waitMs(), repeatDance() and emergencyStop() do in the private Dance Rover simulator.\",\n artifactIds: [\"dance-rover-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict the rover's labelled direction, speed, turn, repeat count and final stopped state before the dance runs.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the five documented C++-style calls to create one bounded rover dance with an emergency stop.\",\n artifactIds: [\"dance-rover-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private Dance Rover simulator.\",\n artifactIds: [\"dance-rover-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic direction, speed, sequence and stop checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted C++-style line with the first dance goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one bounded direction, speed, wait, repeat or stop call, then rerun and inspect the text telemetry.\",\n artifactIds: [\"dance-rover-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how reusable movement calls created the choreography and why every safe dance ends stopped.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the simulated badge when the score and fail-safe stop pass; physical completion remains adult-only.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"dance-rover-m1-find-stop\",\n prompt: \"Find the emergencyStop() call and explain why it must finish every physical movement sequence.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"dance-rover-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"dance-rover-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"dance-rover-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"dance-rover-m1-starts\",\n statement: \"The documented C++-style settings are valid and the private simulator starts.\",\n visibility: \"visible\",\n criterionIds: [\"dance-rover-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"dance-rover-m1-choreography\",\n statement: \"The rover completes a bounded direction, speed, turn and repeat sequence before stopping.\",\n visibility: \"visible\",\n criterionIds: [\"dance-rover-goal-one\", \"dance-rover-goal-two\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"dance-rover-m1-private-runtime\",\n statement: \"The program stays inside the private simulator and never accesses physical motors, the network or browser storage.\",\n visibility: \"visible\",\n criterionIds: [\"dance-rover-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"dance-rover-m1-run-control\",\n description: \"Start the private Dance Rover choreography simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"dance-rover-m1-keyboard-run\"],\n },\n {\n id: \"dance-rover-m1-code-control\",\n description: \"Edit the documented direction, speed, wait, repeat and stop calls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"dance-rover-m1-motion-preview\",\n description: \"Observe the bounded rover route and stopped state.\",\n primaryMode: \"motion\",\n alternativeIds: [\"dance-rover-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"dance-rover-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same simulator.\",\n },\n {\n id: \"dance-rover-m1-telemetry\",\n modes: [\"text\", \"shape\", \"symbol\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read direction, speed, turn, repeat count, elapsed milliseconds and stopped state without animation.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"dance-rover-m1-assessment\",\n goalIds: [\n \"dance-rover-m1-starts\",\n \"dance-rover-m1-choreography\",\n \"dance-rover-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"dance-rover-m1-explanation\",\n goalIds: [\"dance-rover-m1-choreography\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"dance-rover-m1-remix\",\n prompt: \"Invent an original rover dance and add a text or symbol route cue that makes it understandable without motion.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"dance-rover-m1-simulated-badge\",\n badgeId: \"dance-rover-mission-complete\",\n goalIds: [\n \"dance-rover-m1-starts\",\n \"dance-rover-m1-choreography\",\n \"dance-rover-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"dance-rover-function-drive\",\n signature: \"driveRover(direction, speed)\",\n summary: \"Adds one straight movement to the private simulator route.\",\n parameters: [\n {\n name: \"direction\",\n type: \"string\",\n description: \"Use forward or backward.\",\n },\n {\n name: \"speed\",\n type: \"whole number\",\n description: \"A bounded simulated speed from 0 to 60 percent.\",\n },\n ],\n effect: \"Updates the simulator's labelled route without generating motor PWM or accessing a physical driver.\",\n example: \"driveRover(\\\"forward\\\", 40);\",\n },\n {\n id: \"dance-rover-function-turn\",\n signature: \"turnRover(direction, speed)\",\n summary: \"Adds one left or right turn to the private simulator route.\",\n parameters: [\n {\n name: \"direction\",\n type: \"string\",\n description: \"Use left or right.\",\n },\n {\n name: \"speed\",\n type: \"whole number\",\n description: \"A bounded simulated turn speed from 0 to 60 percent.\",\n },\n ],\n effect: \"Updates labelled simulator direction without energising motors or a driver.\",\n example: \"turnRover(\\\"left\\\", 30);\",\n },\n {\n id: \"dance-rover-function-wait\",\n signature: \"waitMs(duration)\",\n summary: \"Adds one bounded wait to the simulated dance timeline.\",\n parameters: [\n {\n name: \"duration\",\n type: \"whole number\",\n description: \"A bounded number of milliseconds from 100 to 1000.\",\n },\n ],\n effect: \"Advances simulated elapsed time; it never blocks the website or holds physical motors under load.\",\n example: \"waitMs(300);\",\n },\n {\n id: \"dance-rover-function-repeat\",\n signature: \"repeatDance(count)\",\n summary: \"Repeats the current simulated dance a safe number of times.\",\n parameters: [\n {\n name: \"count\",\n type: \"whole number\",\n description: \"A bounded repeat count from 1 to 4.\",\n },\n ],\n effect: \"Adds a fixed number of labelled route sequences to the private simulator.\",\n example: \"repeatDance(3);\",\n },\n {\n id: \"dance-rover-function-stop\",\n signature: \"emergencyStop()\",\n summary: \"Ends the simulated dance in a fail-safe stopped state.\",\n parameters: [],\n effect: \"Marks both motors stopped in the simulator; it cannot activate, stop or otherwise control physical hardware.\",\n example: \"emergencyStop();\",\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"dance-rover-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"dance-rover-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"dance-rover-m1-adult-hardware-guide\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"dance-rover-m1-protected-resilience\",\n statement: \"The simulator rejects unsupported directions, excessive speeds, waits, repeats, missing stop calls and physical-hardware requests.\",\n visibility: \"protected\",\n criterionIds: [\"dance-rover-edge-one\", \"dance-rover-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict the labelled route and final stopped state before suggesting one bounded change.\",\n \"Use the function reference and visible telemetry; never provide motor wiring, power or movement advice to a learner.\",\n \"Physical export stays unavailable until an adult acknowledges the exact manifest and every driver, motor and power component has verified bench-test evidence.\",\n ],\n },\n hardware: {\n requirementsVersion: \"1.0.0\",\n hardwareIncluded: false,\n completePathItemIds: [\n \"pico-2-w\",\n \"breadboard\",\n \"usb-data-cable\",\n \"jumper-wires\",\n \"dual-motor-driver\",\n \"geared-motors\",\n \"rover-chassis\",\n \"motor-power\",\n ],\n incrementalItemIds: [\n \"dual-motor-driver\",\n \"geared-motors\",\n \"rover-chassis\",\n \"motor-power\",\n ],\n components: [\n { itemId: \"pico-2-w\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"breadboard\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"usb-data-cable\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"jumper-wires\", quantity: 12, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"dual-motor-driver\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"geared-motors\", quantity: 2, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"rover-chassis\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"motor-power\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n ],\n safeguards: {\n adultAssemblyRequired: true,\n adultAcknowledgementRequiredForExport: true,\n websiteMayControlHardware: false,\n simulatorCompletionAvailable: true,\n simulatedBadgeId: \"dance-rover-mission-complete\",\n physicalBadgeId: \"dance-rover-physical-builder\",\n physicalBadgeRequiresAdultSignoff: true,\n adultAssemblySteps: [\n \"Confirm the exact driver, motors, chassis and switched power identities against the requirements manifest.\",\n \"Assemble and inspect all wiring with motor power disconnected and secure every moving or pinch-point part.\",\n \"Complete the first direction and emergency-stop bench test with the wheels lifted clear of the surface.\",\n ],\n powerRequirements: [\n \"Use a switched protected motor supply within the verified driver and motor ratings; never power motors from a Pico GPIO pin.\",\n \"Connect one common signal ground between the verified motor supply, driver and Pico only as shown in the adult guide.\",\n \"Keep the power switch accessible and disconnect every source before changing wiring, wheels or chassis parts.\",\n ],\n cableRequirements: [\n \"One known data-capable USB cable compatible with the Pico 2 W.\",\n \"Insulated jumper leads and verified motor, driver and power connectors documented by the adult guide.\",\n ],\n softwarePrerequisites: [\n \"Supported Pico SDK toolchain on Raspberry Pi OS or a documented desktop environment.\",\n \"Known-good Dance Rover recovery firmware with adult-owned watchdog and emergency-stop behaviour.\",\n ],\n warnings: [\n \"Hardware is not included with the module.\",\n \"No listed driver, motor, chassis or power arrangement currently claims compatibility or physical-completion eligibility.\",\n \"Moving wheels, pinch points, stalled motors and unsuitable supplies can cause injury or heat; adult assembly and testing are mandatory.\",\n \"The simulator and simulated badge remain available without physical equipment.\",\n ],\n unrelatedHardwareNotRequired: [\n \"Camera Module 3 or Raspberry Pi Zero 2 W\",\n \"obstacle or colour sensors\",\n \"servo, LED or infrared beacon parts\",\n ],\n },\n },\n};\n\n/**\n * First Obstacle Explorer robotics mission. Learners use bounded simulated IR\n * readings, Boolean decisions, recovery state and a watchdog to plan a safe\n * route. Sensor input, firmware export and physical movement remain unavailable\n * until the exact reference build is calibrated and bench tested by an adult.\n */\nexport const OBSTACLE_EXPLORER_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.obstacle-explorer\",\n moduleVersion: \"1.1.0\",\n missionId: \"obstacle-explorer-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read what readObstacle(), chooseSafeRoute(), setRecoveryAttempts(), armWatchdog() and failSafeStop() do in the private Obstacle Explorer simulator.\",\n artifactIds: [\"obstacle-explorer-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict the simulated obstacle reading, safe route, recovery count, watchdog time and final stopped state before the explorer runs.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the five documented C++-style calls to make one bounded obstacle decision with a watchdog and fail-safe stop.\",\n artifactIds: [\"obstacle-explorer-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private Obstacle Explorer simulator.\",\n artifactIds: [\"obstacle-explorer-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic sensor, route, recovery, watchdog and stop checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted C++-style line with the first explorer goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one bounded sensor side, route, recovery count, watchdog or stop call, then rerun and inspect the text telemetry.\",\n artifactIds: [\"obstacle-explorer-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how a Boolean obstacle reading selected a route and why the watchdog and fail-safe stop protect every explorer state.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the simulated badge when the score and mandatory safety checks pass; physical completion remains adult-only.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"obstacle-explorer-m1-find-stop\",\n prompt: \"Find failSafeStop() and explain why the explorer must stop when a sensor or watchdog result is uncertain.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"obstacle-explorer-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"obstacle-explorer-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"obstacle-explorer-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"obstacle-explorer-m1-starts\",\n statement: \"The documented C++-style settings are valid and the private simulator starts.\",\n visibility: \"visible\",\n criterionIds: [\"obstacle-explorer-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"obstacle-explorer-m1-navigation\",\n statement: \"The explorer reads one simulated obstacle and chooses a bounded route with three recovery attempts.\",\n visibility: \"visible\",\n criterionIds: [\"obstacle-explorer-goal-one\", \"obstacle-explorer-goal-two\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"obstacle-explorer-m1-private-runtime\",\n statement: \"The program arms a watchdog, ends fail-safe stopped and never accesses sensors, motors, the network or browser storage.\",\n visibility: \"visible\",\n criterionIds: [\"obstacle-explorer-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"obstacle-explorer-m1-run-control\",\n description: \"Start the private Obstacle Explorer navigation simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"obstacle-explorer-m1-keyboard-run\"],\n },\n {\n id: \"obstacle-explorer-m1-code-control\",\n description: \"Edit the documented sensor, route, recovery, watchdog and stop calls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"obstacle-explorer-m1-route-preview\",\n description: \"Observe the bounded obstacle decision, route and stopped state.\",\n primaryMode: \"motion\",\n alternativeIds: [\"obstacle-explorer-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"obstacle-explorer-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same simulator.\",\n },\n {\n id: \"obstacle-explorer-m1-telemetry\",\n modes: [\"text\", \"shape\", \"symbol\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read sensor side, blocked state, route, recovery count, watchdog milliseconds and stopped state without animation or colour alone.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"obstacle-explorer-m1-assessment\",\n goalIds: [\n \"obstacle-explorer-m1-starts\",\n \"obstacle-explorer-m1-navigation\",\n \"obstacle-explorer-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"obstacle-explorer-m1-explanation\",\n goalIds: [\"obstacle-explorer-m1-navigation\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"obstacle-explorer-m1-remix\",\n prompt: \"Invent an original maze response and add a text or symbol cue that explains the Boolean decision without motion or colour alone.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"obstacle-explorer-m1-simulated-badge\",\n badgeId: \"obstacle-explorer-mission-complete\",\n goalIds: [\n \"obstacle-explorer-m1-starts\",\n \"obstacle-explorer-m1-navigation\",\n \"obstacle-explorer-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"obstacle-explorer-function-read\",\n signature: \"readObstacle(side)\",\n summary: \"Reads one labelled obstacle state from the private simulator.\",\n parameters: [\n {\n name: \"side\",\n type: \"string\",\n description: \"Use front, left or right.\",\n },\n ],\n effect: \"Returns a simulator Boolean blocked or clear reading and never accesses an IR sensor or GPIO pin.\",\n example: \"readObstacle(\\\"front\\\");\",\n },\n {\n id: \"obstacle-explorer-function-route\",\n signature: \"chooseSafeRoute(blockedAction, clearAction)\",\n summary: \"Chooses one bounded route for blocked and clear simulated states.\",\n parameters: [\n {\n name: \"blockedAction\",\n type: \"string\",\n description: \"Use turn-left, turn-right, back-up or stop.\",\n },\n {\n name: \"clearAction\",\n type: \"string\",\n description: \"Use forward or stop.\",\n },\n ],\n effect: \"Updates labelled simulator navigation state without energising motors or a driver.\",\n example: \"chooseSafeRoute(\\\"turn-left\\\", \\\"forward\\\");\",\n },\n {\n id: \"obstacle-explorer-function-recovery\",\n signature: \"setRecoveryAttempts(count)\",\n summary: \"Sets a bounded number of simulated recovery attempts.\",\n parameters: [\n {\n name: \"count\",\n type: \"whole number\",\n description: \"A bounded recovery count from 1 to 3.\",\n },\n ],\n effect: \"Limits the private simulator recovery state so an uncertain route cannot loop forever.\",\n example: \"setRecoveryAttempts(3);\",\n },\n {\n id: \"obstacle-explorer-function-watchdog\",\n signature: \"armWatchdog(duration)\",\n summary: \"Arms a bounded simulated watchdog timer.\",\n parameters: [\n {\n name: \"duration\",\n type: \"whole number\",\n description: \"A bounded timeout from 250 to 1000 milliseconds.\",\n },\n ],\n effect: \"Records simulator timeout telemetry and cannot hold or control physical movement.\",\n example: \"armWatchdog(500);\",\n },\n {\n id: \"obstacle-explorer-function-stop\",\n signature: \"failSafeStop()\",\n summary: \"Ends the navigation simulation in a fail-safe stopped state.\",\n parameters: [],\n effect: \"Marks the private simulator stopped on completion or uncertainty; it cannot activate, stop or otherwise control physical hardware.\",\n example: \"failSafeStop();\",\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"obstacle-explorer-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"obstacle-explorer-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"obstacle-explorer-m1-adult-hardware-guide\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"obstacle-explorer-m1-protected-resilience\",\n statement: \"The simulator rejects unsupported sensor sides, unsafe routes, excessive recovery attempts, invalid watchdogs, missing stop calls and physical-hardware requests.\",\n visibility: \"protected\",\n criterionIds: [\"obstacle-explorer-edge-one\", \"obstacle-explorer-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict the Boolean blocked state, labelled route and final stopped state before suggesting one bounded change.\",\n \"Use the function reference and visible telemetry; never provide sensor wiring, motor power or movement advice to a learner.\",\n \"Physical export stays unavailable until an adult acknowledges the exact manifest and every rover and sensor component has calibration and bench-test evidence.\",\n ],\n },\n hardware: {\n requirementsVersion: \"1.0.0\",\n hardwareIncluded: false,\n completePathItemIds: [\n \"pico-2-w\",\n \"breadboard\",\n \"usb-data-cable\",\n \"jumper-wires\",\n \"verified-rover\",\n \"obstacle-sensors\",\n ],\n incrementalItemIds: [\n \"verified-rover\",\n \"obstacle-sensors\",\n ],\n components: [\n { itemId: \"pico-2-w\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"breadboard\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"usb-data-cable\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"jumper-wires\", quantity: 12, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"verified-rover\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"obstacle-sensors\", quantity: 2, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n ],\n safeguards: {\n adultAssemblyRequired: true,\n adultAcknowledgementRequiredForExport: true,\n websiteMayControlHardware: false,\n simulatorCompletionAvailable: true,\n simulatedBadgeId: \"obstacle-explorer-mission-complete\",\n physicalBadgeId: \"obstacle-explorer-physical-builder\",\n physicalBadgeRequiresAdultSignoff: true,\n adultAssemblySteps: [\n \"Confirm the exact bench-signed rover and IR sensor identities against the requirements manifest.\",\n \"Assemble and inspect all disconnected sensor wiring, then complete the adult sensor calibration record for clear and blocked surfaces.\",\n \"Complete direction, obstacle recovery, watchdog and fail-safe-stop tests with the wheels lifted clear of the surface.\",\n ],\n powerRequirements: [\n \"Use the verified switched protected motor supply and sensor voltage; never power motors or unsuitable sensors from a Pico GPIO pin.\",\n \"Connect one common signal ground between the verified sensor, motor supply, driver and Pico only as shown in the adult guide.\",\n \"Keep the power switch accessible and disconnect every source before changing wiring, sensors, wheels or chassis parts.\",\n ],\n cableRequirements: [\n \"One known data-capable USB cable compatible with the Pico 2 W.\",\n \"Insulated jumper leads and verified sensor, motor, driver and power connectors documented by the adult guide.\",\n ],\n softwarePrerequisites: [\n \"Supported Pico SDK toolchain on Raspberry Pi OS or a documented desktop environment.\",\n \"Known-good Obstacle Explorer recovery firmware with adult-owned watchdog, sensor-failure and emergency-stop behaviour.\",\n ],\n warnings: [\n \"Hardware is not included with the module.\",\n \"No listed rover or sensor currently claims compatibility or physical-completion eligibility for this module.\",\n \"Moving wheels, pinch points, stalled motors, reflective sensor errors and unsuitable supplies can cause unsafe movement or heat; adult assembly, calibration and testing are mandatory.\",\n \"The simulator and simulated badge remain available without physical equipment.\",\n ],\n unrelatedHardwareNotRequired: [\n \"Camera Module 3 or Raspberry Pi Zero 2 W\",\n \"colour targets or camera ribbon\",\n \"servo, LED or infrared beacon parts\",\n ],\n },\n },\n};\n\nexport const RAINBOW_RESCUE_ROVER_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.rainbow-rescue-rover\",\n moduleVersion: \"1.1.0\",\n missionId: \"rainbow-rescue-rover-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read what detectColour(), locateTarget(), planSerialCommand(), armHeartbeat() and failSafeStop() do in the private Rainbow Rescue Rover simulator.\",\n artifactIds: [\"rainbow-rescue-rover-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict the simulated colour, target zone, bounded command, heartbeat time and final stopped state before the rescue plan runs.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the five documented integration calls to recognise one simulated target and plan one safe serial command with a heartbeat and fail-safe stop.\",\n artifactIds: [\"rainbow-rescue-rover-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private Rainbow Rescue Rover integration simulator.\",\n artifactIds: [\"rainbow-rescue-rover-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic colour, location, command, heartbeat and stop checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted integration-plan line with the first rescue goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one bounded colour, target zone, command, heartbeat or stop call, then rerun and inspect the text telemetry.\",\n artifactIds: [\"rainbow-rescue-rover-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how family-local colour evidence became a bounded command plan and why the heartbeat and fail-safe stop protect every uncertain state.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the simulated badge when the score and mandatory privacy and safety checks pass; physical completion remains adult-only.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"rainbow-rescue-rover-m1-find-privacy\",\n prompt: \"Find the rule that keeps Camera Module 3 frames on the family Raspberry Pi and explain why only bounded command labels may leave it.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"rainbow-rescue-rover-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"rainbow-rescue-rover-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"rainbow-rescue-rover-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"rainbow-rescue-rover-m1-starts\",\n statement: \"The documented integration-plan settings are valid and the private simulator starts.\",\n visibility: \"visible\",\n criterionIds: [\"rainbow-rescue-rover-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"rainbow-rescue-rover-m1-target-command\",\n statement: \"The rover plan recognises a green simulated target in the centre and selects one bounded forward command.\",\n visibility: \"visible\",\n criterionIds: [\"rainbow-rescue-rover-goal-one\", \"rainbow-rescue-rover-goal-two\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"rainbow-rescue-rover-m1-private-runtime\",\n statement: \"The plan arms a heartbeat, ends fail-safe stopped and never accesses a camera, serial port, motor, network or browser storage.\",\n visibility: \"visible\",\n criterionIds: [\"rainbow-rescue-rover-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"rainbow-rescue-rover-m1-run-control\",\n description: \"Start the private Rainbow Rescue Rover integration simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"rainbow-rescue-rover-m1-keyboard-run\"],\n },\n {\n id: \"rainbow-rescue-rover-m1-code-control\",\n description: \"Edit the documented colour, target, command, heartbeat and stop calls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"rainbow-rescue-rover-m1-target-preview\",\n description: \"Observe the simulated colour target, command route and stopped state.\",\n primaryMode: \"colour\",\n alternativeIds: [\"rainbow-rescue-rover-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"rainbow-rescue-rover-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same simulator.\",\n },\n {\n id: \"rainbow-rescue-rover-m1-telemetry\",\n modes: [\"text\", \"shape\", \"symbol\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read the colour name, target zone, command, heartbeat milliseconds and stopped state without camera access, animation or colour alone.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"rainbow-rescue-rover-m1-assessment\",\n goalIds: [\n \"rainbow-rescue-rover-m1-starts\",\n \"rainbow-rescue-rover-m1-target-command\",\n \"rainbow-rescue-rover-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"rainbow-rescue-rover-m1-explanation\",\n goalIds: [\"rainbow-rescue-rover-m1-target-command\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"rainbow-rescue-rover-m1-remix\",\n prompt: \"Invent an original colour rescue rule and add a text, shape or symbol cue that explains the command without camera frames, motion or colour alone.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"rainbow-rescue-rover-m1-simulated-badge\",\n badgeId: \"rainbow-rescue-rover-mission-complete\",\n goalIds: [\n \"rainbow-rescue-rover-m1-starts\",\n \"rainbow-rescue-rover-m1-target-command\",\n \"rainbow-rescue-rover-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"rainbow-rescue-rover-function-detect\",\n signature: \"detectColour(colour)\",\n summary: \"Selects one labelled colour result in the private simulator.\",\n parameters: [\n {\n name: \"colour\",\n type: \"string\",\n description: \"Use red, green, blue or yellow.\",\n },\n ],\n effect: \"Returns one simulator colour label and confidence state; it never opens a camera or receives a frame.\",\n example: \"detectColour(\\\"green\\\");\",\n },\n {\n id: \"rainbow-rescue-rover-function-locate\",\n signature: \"locateTarget(zone)\",\n summary: \"Places the simulated target in one labelled horizontal zone.\",\n parameters: [\n {\n name: \"zone\",\n type: \"string\",\n description: \"Use left, centre or right.\",\n },\n ],\n effect: \"Updates text, shape and coordinate cues in the simulator without analysing or storing an image.\",\n example: \"locateTarget(\\\"centre\\\");\",\n },\n {\n id: \"rainbow-rescue-rover-function-command\",\n signature: \"planSerialCommand(command)\",\n summary: \"Plans one bounded command label for the simulated rover link.\",\n parameters: [\n {\n name: \"command\",\n type: \"string\",\n description: \"Use forward, turn-left, turn-right or stop.\",\n },\n ],\n effect: \"Records a simulator-only command label; it never opens a serial port or activates motors.\",\n example: \"planSerialCommand(\\\"forward\\\");\",\n },\n {\n id: \"rainbow-rescue-rover-function-heartbeat\",\n signature: \"armHeartbeat(duration)\",\n summary: \"Arms a bounded simulated command heartbeat.\",\n parameters: [\n {\n name: \"duration\",\n type: \"whole number\",\n description: \"A bounded heartbeat from 250 to 1000 milliseconds.\",\n },\n ],\n effect: \"Records heartbeat telemetry so an uncertain simulator link becomes stopped; it cannot maintain physical movement.\",\n example: \"armHeartbeat(500);\",\n },\n {\n id: \"rainbow-rescue-rover-function-stop\",\n signature: \"failSafeStop()\",\n summary: \"Ends the integration simulation in a fail-safe stopped state.\",\n parameters: [],\n effect: \"Marks the private simulator stopped after the bounded command plan; it cannot activate, stop or otherwise control physical hardware.\",\n example: \"failSafeStop();\",\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"rainbow-rescue-rover-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"rainbow-rescue-rover-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"rainbow-rescue-rover-m1-adult-hardware-guide\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"rainbow-rescue-rover-m1-protected-resilience\",\n statement: \"The simulator rejects unsupported colours, zones, serial commands, invalid heartbeats, missing stop calls and any camera, serial or physical-hardware request.\",\n visibility: \"protected\",\n criterionIds: [\"rainbow-rescue-rover-edge-one\", \"rainbow-rescue-rover-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict the labelled target, bounded command and final stopped state before suggesting one change.\",\n \"Use only authored function guidance and simulator telemetry; never request camera frames or give learner wiring, power or motor-control advice.\",\n \"Physical export stays unavailable until an adult acknowledges the exact manifest and every camera, computer, serial, rover and power component has bench-test evidence.\",\n ],\n },\n hardware: {\n requirementsVersion: \"1.0.0\",\n hardwareIncluded: false,\n completePathItemIds: [\n \"pico-2-w\",\n \"breadboard\",\n \"usb-data-cable\",\n \"jumper-wires\",\n \"verified-explorer\",\n \"pi-zero-2-w\",\n \"camera-3\",\n \"pi-storage-power\",\n ],\n incrementalItemIds: [\n \"verified-explorer\",\n \"pi-zero-2-w\",\n \"camera-3\",\n \"pi-storage-power\",\n ],\n components: [\n { itemId: \"pico-2-w\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"breadboard\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"usb-data-cable\", quantity: 1, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"jumper-wires\", quantity: 12, acquisitionScope: \"complete-path\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"verified-explorer\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"pi-zero-2-w\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"camera-3\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n { itemId: \"pi-storage-power\", quantity: 1, acquisitionScope: \"incremental\", verificationStatus: \"pending-bench-test\", compatibilityClaimed: false, physicalCompletionEligible: false },\n ],\n safeguards: {\n adultAssemblyRequired: true,\n adultAcknowledgementRequiredForExport: true,\n websiteMayControlHardware: false,\n simulatorCompletionAvailable: true,\n simulatedBadgeId: \"rainbow-rescue-rover-mission-complete\",\n physicalBadgeId: \"rainbow-rescue-rover-physical-builder\",\n physicalBadgeRequiresAdultSignoff: true,\n adultAssemblySteps: [\n \"Confirm the exact bench-signed rover, Pi Zero 2 W, Camera Module 3 and correct Zero-series camera ribbon identities against the manifest.\",\n \"With all power disconnected, fit and inspect the camera ribbon, storage, Pi power, Pico data link and isolated rover assemblies using the adult guide.\",\n \"Complete local colour calibration, bounded serial-command, heartbeat, link-loss and fail-safe-stop tests with the wheels lifted clear of the surface.\",\n ],\n powerRequirements: [\n \"Use a separate regulated Raspberry Pi power supply for the Pi Zero 2 W and Camera Module 3.\",\n \"Use the verified switched protected motor supply for the rover; never power motors, the Pi Zero 2 W or Camera Module 3 from a Pico GPIO pin.\",\n \"Keep every power switch accessible and disconnect every source before changing the camera ribbon, storage, wiring, sensors, wheels or chassis parts.\",\n ],\n cableRequirements: [\n \"One known data-capable USB cable compatible with the Pico 2 W and Pi Zero 2 W serial plan.\",\n \"The correct Zero-series Camera Module 3 ribbon and adult-verified insulated rover and power connectors.\",\n ],\n softwarePrerequisites: [\n \"Current Raspberry Pi OS with supported rpicam and Picamera2 software on the family-owned Pi Zero 2 W.\",\n \"Supported Pico SDK toolchain and known-good recovery firmware with adult-owned heartbeat, link-loss and emergency-stop behaviour.\",\n \"A family-local colour-calibration utility that never uploads, publishes or transmits Camera Module 3 frames.\",\n ],\n warnings: [\n \"Hardware is not included with the module.\",\n \"No listed camera, computer, rover, serial or power configuration currently claims compatibility or physical-completion eligibility.\",\n \"Camera frames remain on the family Raspberry Pi and must never be submitted to Plasius, an agent service or a published project.\",\n \"The website never activates motors, opens a camera or serial port, and an uncertain or missing heartbeat must stop the physical rover.\",\n \"Moving wheels, pinch points, stalled motors, camera ribbon damage and unsuitable supplies can cause unsafe movement, heat or damage; adult assembly, calibration and testing are mandatory.\",\n \"The simulator and simulated badge remain available without physical equipment.\",\n ],\n unrelatedHardwareNotRequired: [\n \"cloud camera, object-recognition or face-recognition services\",\n \"microphone, speaker, location or biometric sensors\",\n \"public hosting, analytics, advertising or external network access\",\n ],\n },\n },\n};\n\n/**\n * Original first mission for Rescue Crew Commander. The learner arranges a\n * typed visual program and can inspect its synchronized JavaScript projection,\n * while protected route and action-limit checks stay facilitator-only.\n */\nexport const RESCUE_CREW_COMMANDER_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.rescue-crew-commander\",\n moduleVersion: \"1.1.0\",\n missionId: \"rescue-crew-commander-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Meet the helper, job, route and priority blocks and read what each block does in the synchronized JavaScript view.\",\n artifactIds: [\"rescue-crew-commander-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict which helper will act first and which safe route it will follow.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Arrange the visual blocks to give each helper one safe rescue job.\",\n artifactIds: [\"rescue-crew-commander-m1-program\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to watch the crew follow the typed visual program.\",\n artifactIds: [\"rescue-crew-commander-m1-program\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic crew checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted block with the first goal that did not pass and inspect the matching JavaScript line.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Move or replace one job, route or priority block, then run the mission again.\",\n artifactIds: [\"rescue-crew-commander-m1-program\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how job order and priority changed the crew state and rescue result.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the score and private-simulator safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"rescue-crew-commander-m1-find-priority\",\n prompt: \"Point to the block that decides which helper acts first.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"rescue-crew-commander-m1-program\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"rescue-crew-commander-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"rescue-crew-commander-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"rescue-crew-commander-m1-starts\",\n statement: \"The typed visual program is structurally valid and starts.\",\n visibility: \"visible\",\n criterionIds: [\"rescue-crew-commander-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"rescue-crew-commander-m1-safe-jobs\",\n statement: \"Every helper receives one suitable job and the highest-priority rescue starts first.\",\n visibility: \"visible\",\n criterionIds: [\n \"rescue-crew-commander-goal-one\",\n \"rescue-crew-commander-goal-two\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"rescue-crew-commander-m1-private-runtime\",\n statement: \"The crew stays inside the private simulator and follows only host-provided actions.\",\n visibility: \"visible\",\n criterionIds: [\"rescue-crew-commander-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"rescue-crew-commander-m1-reorder-blocks\",\n description: \"Change the order of typed job, route and priority blocks.\",\n primaryMode: \"drag\",\n alternativeIds: [\"rescue-crew-commander-m1-button-reorder\"],\n },\n {\n id: \"rescue-crew-commander-m1-run-control\",\n description: \"Start the private rescue-crew simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"rescue-crew-commander-m1-keyboard-run\"],\n },\n {\n id: \"rescue-crew-commander-m1-crew-motion\",\n description: \"Observe helpers change state and follow their assigned routes.\",\n primaryMode: \"motion\",\n alternativeIds: [\"rescue-crew-commander-m1-status-view\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"rescue-crew-commander-m1-button-reorder\",\n modes: [\"keyboard\", \"pointer\"],\n equivalentOutcome: true,\n description: \"Use labelled Move up and Move down buttons instead of dragging a visual block.\",\n },\n {\n id: \"rescue-crew-commander-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"rescue-crew-commander-m1-status-view\",\n modes: [\"text\", \"symbol\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read each helper's job, route, priority and state from the status list without animation or colour dependence.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"rescue-crew-commander-m1-assessment\",\n goalIds: [\n \"rescue-crew-commander-m1-starts\",\n \"rescue-crew-commander-m1-safe-jobs\",\n \"rescue-crew-commander-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"rescue-crew-commander-m1-explanation\",\n goalIds: [\"rescue-crew-commander-m1-safe-jobs\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"rescue-crew-commander-m1-remix\",\n prompt: \"Invent an original helper role and explain which safe route and priority it should receive.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"rescue-crew-commander-m1-badge\",\n badgeId: \"rescue-crew-commander-mission-complete\",\n goalIds: [\n \"rescue-crew-commander-m1-starts\",\n \"rescue-crew-commander-m1-safe-jobs\",\n \"rescue-crew-commander-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"rescue-crew-commander-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"rescue-crew-commander-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"rescue-crew-commander-m1-protected-resilience\",\n statement: \"The interpreter rejects unknown blocks, duplicate assignments and programs over the action limit.\",\n visibility: \"protected\",\n criterionIds: [\n \"rescue-crew-commander-edge-one\",\n \"rescue-crew-commander-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner which helper should act first before suggesting a block change.\",\n \"Use the block reference, status list and visible goal; never reveal the protected assignment order or expected block sequence.\",\n ],\n },\n};\n\n/**\n * Original first mission for Meteor Shield. Learners tune documented targeting,\n * energy and timing controls without receiving protected resource targets or\n * projectile answers.\n */\nexport const METEOR_SHIELD_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.meteor-shield\",\n moduleVersion: \"1.1.0\",\n missionId: \"meteor-shield-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how target column, shield energy and launch delay change a rescue defence.\",\n artifactIds: [\"meteor-shield-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict which rescue base the shield will protect first.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Adjust the three documented settings in the starter JavaScript.\",\n artifactIds: [\"meteor-shield-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private meteor-wave preview.\",\n artifactIds: [\"meteor-shield-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic defence checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted setting with the first goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one setting, run again and observe the energy and target telemetry.\",\n artifactIds: [\"meteor-shield-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how targeting and launch timing affected the remaining shield energy.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the score and safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"meteor-shield-m1-find-energy\",\n prompt: \"Point to the setting that limits how many shields can launch.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"meteor-shield-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"meteor-shield-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"meteor-shield-m1-printable\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"meteor-shield-m1-starts\",\n statement: \"The JavaScript settings are valid and the private preview starts.\",\n visibility: \"visible\",\n criterionIds: [\"meteor-shield-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"meteor-shield-m1-resource-defence\",\n statement: \"A shield launches toward the selected meteor while keeping enough energy for the next wave.\",\n visibility: \"visible\",\n criterionIds: [\n \"meteor-shield-goal-one\",\n \"meteor-shield-goal-two\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"meteor-shield-m1-private-runtime\",\n statement: \"The game stays inside the private educational preview boundary.\",\n visibility: \"visible\",\n criterionIds: [\"meteor-shield-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"meteor-shield-m1-run-control\",\n description: \"Start the private meteor-wave simulation.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"meteor-shield-m1-keyboard-run\"],\n },\n {\n id: \"meteor-shield-m1-target-control\",\n description: \"Move the targeting reticle between rescue columns and launch a shield.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"meteor-shield-m1-wave-motion\",\n description: \"Observe meteors and shield pulses crossing the rescue zone.\",\n primaryMode: \"motion\",\n alternativeIds: [\"meteor-shield-m1-telemetry\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"meteor-shield-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"meteor-shield-m1-telemetry\",\n modes: [\"text\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Use target column, wave, distance and energy text instead of projectile animation.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"meteor-shield-m1-assessment\",\n goalIds: [\n \"meteor-shield-m1-starts\",\n \"meteor-shield-m1-resource-defence\",\n \"meteor-shield-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"meteor-shield-m1-explanation\",\n goalIds: [\"meteor-shield-m1-resource-defence\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"meteor-shield-m1-remix\",\n prompt: \"Invent an original rescue-base signal and describe the safe game event that activates it.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"meteor-shield-m1-badge\",\n badgeId: \"meteor-shield-mission-complete\",\n goalIds: [\n \"meteor-shield-m1-starts\",\n \"meteor-shield-m1-resource-defence\",\n \"meteor-shield-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"meteor-shield-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"meteor-shield-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"meteor-shield-m1-protected-resilience\",\n statement: \"The runtime clamps unsafe resources and terminates bounded projectile simulations.\",\n visibility: \"protected\",\n criterionIds: [\n \"meteor-shield-edge-one\",\n \"meteor-shield-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner which setting controls a limited resource before suggesting a code edit.\",\n \"Use visible telemetry and the function reference; never reveal protected numeric targets or expected source fragments.\",\n ],\n },\n};\n\n/** Bounded first Vibe mission; no open prompt or provider is required. */\nexport const VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.vibe-game-remix-lab\",\n moduleVersion: \"1.1.0\",\n missionId: \"vibe-game-remix-lab-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how setRescueSpeed(), setGateSpacing() and setGoalCount() change the supplied mini-game.\",\n artifactIds: [\"vibe-game-remix-lab-m1-guide\"],\n },\n {\n kind: \"predict\",\n instruction: \"Choose one bounded intent card and predict what its one-line diff will change before viewing it.\",\n artifactIds: [\"vibe-game-remix-lab-m1-intent-cards\"],\n },\n {\n kind: \"build\",\n instruction: \"Open the supplied mini-game and keep changes inside its documented settings file.\",\n artifactIds: [\"vibe-game-remix-lab-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to start the private JavaScript preview.\",\n artifactIds: [\"vibe-game-remix-lab-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run deterministic checks before requesting or applying any suggestion.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the single authored diff with your prediction and the failed goal evidence.\",\n artifactIds: [\"vibe-game-remix-lab-m1-code\"],\n },\n {\n kind: \"fix\",\n instruction: \"Accept or reject the proposed change yourself, then rerun the preview and assessment.\",\n artifactIds: [\"vibe-game-remix-lab-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain why you accepted or rejected the change and what the new evidence shows.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge after the deterministic score reaches 80 and every safety check passes.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"vibe-game-remix-lab-m1-find-setting\",\n prompt: \"Point to the documented function that changes how many rescue goals appear.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"vibe-game-remix-lab-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"vibe-game-remix-lab-m1-guide\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"vibe-game-remix-lab-m1-intent-cards\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"vibe-game-remix-lab-m1-starts\",\n statement: \"The supplied JavaScript mini-game remains structurally valid and starts.\",\n visibility: \"visible\",\n criterionIds: [\"vibe-game-remix-lab-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"vibe-game-remix-lab-m1-bounded-remix\",\n statement: \"The approved one-file change matches the chosen intent and every published behaviour goal.\",\n visibility: \"visible\",\n criterionIds: [\n \"vibe-game-remix-lab-goal-one\",\n \"vibe-game-remix-lab-goal-two\",\n \"vibe-game-remix-lab-goal-three\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"vibe-game-remix-lab-m1-private-runtime\",\n statement: \"The remix stays inside the private sandbox with no network, personal data or automatic code changes.\",\n visibility: \"visible\",\n criterionIds: [\"vibe-game-remix-lab-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"vibe-game-remix-lab-m1-run-control\",\n description: \"Start the supplied mini-game preview.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-game-remix-lab-m1-keyboard-run\"],\n },\n {\n id: \"vibe-game-remix-lab-m1-diff-review\",\n description: \"Read the removed and added source line before choosing what to do.\",\n primaryMode: \"text\",\n alternativeIds: [],\n },\n {\n id: \"vibe-game-remix-lab-m1-accept-control\",\n description: \"Approve the exact immutable suggestion snapshot.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-game-remix-lab-m1-keyboard-review\"],\n },\n {\n id: \"vibe-game-remix-lab-m1-reject-control\",\n description: \"Reject the suggestion and preserve the current source.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-game-remix-lab-m1-keyboard-review\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"vibe-game-remix-lab-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"vibe-game-remix-lab-m1-keyboard-review\",\n modes: [\"keyboard\", \"text\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read the labelled removed and added lines, then focus Accept or Reject and press Enter or Space.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"vibe-game-remix-lab-m1-assessment\",\n goalIds: [\n \"vibe-game-remix-lab-m1-starts\",\n \"vibe-game-remix-lab-m1-bounded-remix\",\n \"vibe-game-remix-lab-m1-private-runtime\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"vibe-game-remix-lab-m1-explanation\",\n goalIds: [\"vibe-game-remix-lab-m1-bounded-remix\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"vibe-game-remix-lab-m1-inventor\",\n prompt: \"Write a new bounded remix intent card with one permitted setting, one constraint and one success test.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"vibe-game-remix-lab-m1-badge\",\n badgeId: \"vibe-game-remix-lab-mission-complete\",\n goalIds: [\n \"vibe-game-remix-lab-m1-starts\",\n \"vibe-game-remix-lab-m1-bounded-remix\",\n \"vibe-game-remix-lab-m1-private-runtime\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"vibe-game-remix-lab-function-speed\",\n signature: \"setRescueSpeed(speed)\",\n summary: \"Sets the supplied rescue robot's bounded movement speed.\",\n parameters: [{ name: \"speed\", type: \"whole number\", description: \"A safe speed from 1 to 5.\" }],\n effect: \"Changes only the private mini-game simulation speed.\",\n example: \"setRescueSpeed(3);\",\n },\n {\n id: \"vibe-game-remix-lab-function-spacing\",\n signature: \"setGateSpacing(spacing)\",\n summary: \"Sets the gap between original rescue gates.\",\n parameters: [{ name: \"spacing\", type: \"whole number\", description: \"A bounded spacing from 2 to 6.\" }],\n effect: \"Changes only the generated gate layout in the private preview.\",\n example: \"setGateSpacing(4);\",\n },\n {\n id: \"vibe-game-remix-lab-function-goals\",\n signature: \"setGoalCount(count)\",\n summary: \"Chooses how many fictional rescue goals the round contains.\",\n parameters: [{ name: \"count\", type: \"whole number\", description: \"A bounded goal count from 1 to 4.\" }],\n effect: \"Changes the labelled rescue-goal count without network or account access.\",\n example: \"setGoalCount(3);\",\n },\n ],\n boundedSuggestion: {\n id: \"vibe-game-remix-lab-m1-authored-goal-diff\",\n source: \"authored-fallback\",\n intent: \"Make the round contain one more rescue goal.\",\n constraints: [\n \"Change exactly one documented setting.\",\n \"Keep the goal count inside the published range.\",\n \"Do not add network, storage, DOM or account access.\",\n ],\n permittedArtifactId: \"vibe-game-remix-lab-m1-code\",\n originalSnippet: \"setGoalCount(2);\",\n replacementSnippet: \"setGoalCount(3);\",\n explanationPrompt: \"Did the new goal count match your prediction, and which assessment evidence proves it?\",\n aiOptional: false,\n learnerApprovalRequired: true,\n alternatives: [\"accept\", \"reject\"],\n },\n },\n facilitator: {\n artifacts: [\n {\n id: \"vibe-game-remix-lab-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"vibe-game-remix-lab-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"vibe-game-remix-lab-m1-safety-notes\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"vibe-game-remix-lab-m1-protected-resilience\",\n statement: \"The sandbox rejects prompt injection, answer dumping, disallowed files, network access and changes outside the approved diff.\",\n visibility: \"protected\",\n criterionIds: [\"vibe-game-remix-lab-edge-one\", \"vibe-game-remix-lab-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask for the learner's prediction before revealing the authored diff.\",\n \"Do not invite free-form chat; keep intent, evidence and suggestions bound to the current project, rubric and permitted artifact.\",\n \"A rejection must leave source unchanged, and AI/provider failure must never block deterministic completion.\",\n ],\n },\n};\n\n/** Evidence-led Vibe repair mission; no open prompt or provider is required. */\nexport const VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.vibe-bug-detective\",\n moduleVersion: \"1.1.0\",\n missionId: \"vibe-bug-detective-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how setRobotDirection(), setRobotSteps() and placeRescueBeacon() control the supplied mini-game.\",\n artifactIds: [\"vibe-bug-detective-m1-guide\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict why the robot moves away from the beacon before viewing the one-line repair.\",\n artifactIds: [\"vibe-bug-detective-m1-evidence-card\"],\n },\n {\n kind: \"build\",\n instruction: \"Open the intentionally broken mini-game without changing files outside its documented settings artifact.\",\n artifactIds: [\"vibe-bug-detective-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to reproduce the bug in the private JavaScript preview.\",\n artifactIds: [\"vibe-bug-detective-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run deterministic checks to collect failure evidence before reviewing any suggested fix.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare observed leftward movement with the expected right-side beacon goal and the single authored diff.\",\n artifactIds: [\"vibe-bug-detective-m1-code\"],\n },\n {\n kind: \"fix\",\n instruction: \"Accept or reject the exact direction repair yourself, then rerun every regression check.\",\n artifactIds: [\"vibe-bug-detective-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain which evidence identified the bug and why the minimal change fixed it without changing other behaviour.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge after the deterministic score reaches 80 and every safety check passes.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"vibe-bug-detective-m1-read-evidence\",\n prompt: \"Point to the observed direction and the beacon position before choosing a repair.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"vibe-bug-detective-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"vibe-bug-detective-m1-guide\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"vibe-bug-detective-m1-evidence-card\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"vibe-bug-detective-m1-starts\",\n statement: \"The intentionally broken JavaScript mini-game remains structurally valid and starts.\",\n visibility: \"visible\",\n criterionIds: [\"vibe-bug-detective-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"vibe-bug-detective-m1-repair\",\n statement: \"The robot travels three steps toward the right-side rescue beacon after one minimal direction repair.\",\n visibility: \"visible\",\n criterionIds: [\n \"vibe-bug-detective-goal-one\",\n \"vibe-bug-detective-goal-two\",\n \"vibe-bug-detective-goal-three\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"vibe-bug-detective-m1-regression-safety\",\n statement: \"The repair preserves the bounded step and beacon settings inside the private sandbox.\",\n visibility: \"visible\",\n criterionIds: [\"vibe-bug-detective-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"vibe-bug-detective-m1-run-control\",\n description: \"Reproduce the supplied mini-game bug in the private preview.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-bug-detective-m1-keyboard-run\"],\n },\n {\n id: \"vibe-bug-detective-m1-diff-review\",\n description: \"Read the labelled removed and added direction lines beside the assessment evidence.\",\n primaryMode: \"text\",\n alternativeIds: [],\n },\n {\n id: \"vibe-bug-detective-m1-accept-control\",\n description: \"Approve the exact immutable repair snapshot.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-bug-detective-m1-keyboard-review\"],\n },\n {\n id: \"vibe-bug-detective-m1-reject-control\",\n description: \"Reject the repair and preserve the current broken source.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-bug-detective-m1-keyboard-review\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"vibe-bug-detective-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to reproduce the same bug.\",\n },\n {\n id: \"vibe-bug-detective-m1-keyboard-review\",\n modes: [\"keyboard\", \"text\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read the text evidence and labelled diff, then focus Accept or Reject and press Enter or Space.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"vibe-bug-detective-m1-assessment\",\n goalIds: [\n \"vibe-bug-detective-m1-starts\",\n \"vibe-bug-detective-m1-repair\",\n \"vibe-bug-detective-m1-regression-safety\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"vibe-bug-detective-m1-explanation\",\n goalIds: [\"vibe-bug-detective-m1-repair\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"vibe-bug-detective-m1-regression-inventor\",\n prompt: \"Invent one extra regression test that proves the robot still stops at the rescue beacon.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"vibe-bug-detective-m1-badge\",\n badgeId: \"vibe-bug-detective-mission-complete\",\n goalIds: [\n \"vibe-bug-detective-m1-starts\",\n \"vibe-bug-detective-m1-repair\",\n \"vibe-bug-detective-m1-regression-safety\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"vibe-bug-detective-function-direction\",\n signature: \"setRobotDirection(direction)\",\n summary: \"Chooses the horizontal direction used by the supplied rescue robot.\",\n parameters: [{ name: \"direction\", type: \"text\", description: \"Use left or right.\" }],\n effect: \"Changes only the labelled movement direction in the private mini-game.\",\n example: \"setRobotDirection(\\\"right\\\");\",\n },\n {\n id: \"vibe-bug-detective-function-steps\",\n signature: \"setRobotSteps(count)\",\n summary: \"Chooses how many bounded grid steps the robot attempts.\",\n parameters: [{ name: \"count\", type: \"whole number\", description: \"A bounded count from 1 to 4.\" }],\n effect: \"Changes the private preview path length without controlling physical hardware.\",\n example: \"setRobotSteps(3);\",\n },\n {\n id: \"vibe-bug-detective-function-beacon\",\n signature: \"placeRescueBeacon(position)\",\n summary: \"Places the fictional rescue beacon on one labelled side.\",\n parameters: [{ name: \"position\", type: \"text\", description: \"Use left or right.\" }],\n effect: \"Changes only the fictional beacon position in the private preview.\",\n example: \"placeRescueBeacon(\\\"right\\\");\",\n },\n ],\n boundedSuggestion: {\n id: \"vibe-bug-detective-m1-authored-direction-repair\",\n source: \"authored-fallback\",\n intent: \"Make the robot move toward the right-side rescue beacon.\",\n constraints: [\n \"Change exactly one documented direction setting.\",\n \"Preserve the step count and beacon position.\",\n \"Do not add network, storage, DOM, account or physical hardware access.\",\n ],\n permittedArtifactId: \"vibe-bug-detective-m1-code\",\n originalSnippet: \"setRobotDirection(\\\"left\\\");\",\n replacementSnippet: \"setRobotDirection(\\\"right\\\");\",\n explanationPrompt: \"Which observed-versus-expected evidence identified the direction bug, and which regression result proves the repair?\",\n aiOptional: false,\n learnerApprovalRequired: true,\n alternatives: [\"accept\", \"reject\"],\n },\n },\n facilitator: {\n artifacts: [\n {\n id: \"vibe-bug-detective-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"vibe-bug-detective-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"vibe-bug-detective-m1-safety-notes\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"vibe-bug-detective-m1-protected-regressions\",\n statement: \"The repaired sandbox rejects extra statements, disallowed values, prompt injection, answer dumping, network access and changes outside the approved diff.\",\n visibility: \"protected\",\n criterionIds: [\"vibe-bug-detective-edge-one\", \"vibe-bug-detective-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to describe observed and expected directions before revealing the authored repair.\",\n \"Keep every diagnostic choice tied to the current failing goal and permitted artifact; never invite free-form chat.\",\n \"A rejection must preserve the broken source, and AI/provider failure must never block deterministic repair or regression checks.\",\n ],\n },\n};\n\n/** Goal-led Vibe prototype mission; all idea choices and changes are bounded. */\nexport const VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.vibe-idea-studio\",\n moduleVersion: \"1.1.0\",\n missionId: \"vibe-idea-studio-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how choosePrototype(), setStarCount() and setSuccessMessage() shape the bounded rescue-card template.\",\n artifactIds: [\"vibe-idea-studio-m1-guide\"],\n },\n {\n kind: \"predict\",\n instruction: \"Choose one idea, audience and acceptance test card, then predict what the one-line prototype change will show.\",\n artifactIds: [\"vibe-idea-studio-m1-idea-cards\"],\n },\n {\n kind: \"build\",\n instruction: \"Open the supplied template and keep every change inside its documented prototype settings artifact.\",\n artifactIds: [\"vibe-idea-studio-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the Run action button to preview the current rescue card in the private JavaScript simulator.\",\n artifactIds: [\"vibe-idea-studio-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run deterministic checks against the selected goal and acceptance test before viewing a suggestion.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the exact one-line diff with your prediction, chosen goal and failed acceptance-test evidence.\",\n artifactIds: [\"vibe-idea-studio-m1-code\"],\n },\n {\n kind: \"fix\",\n instruction: \"Accept or reject the immutable prototype change yourself, then rerun the preview and tests.\",\n artifactIds: [\"vibe-idea-studio-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how the final evidence proves the prototype meets the selected idea, audience and success test.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge after the deterministic score reaches 80 and every safety check passes.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"vibe-idea-studio-m1-match-test\",\n prompt: \"Match the three-star acceptance test to the documented setting that controls star count.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"vibe-idea-studio-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"vibe-idea-studio-m1-guide\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"vibe-idea-studio-m1-idea-cards\",\n kind: \"printable\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"vibe-idea-studio-m1-starts\",\n statement: \"The supplied JavaScript rescue-card template remains structurally valid and starts.\",\n visibility: \"visible\",\n criterionIds: [\"vibe-idea-studio-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"vibe-idea-studio-m1-prototype-goal\",\n statement: \"The prototype is a space rescue card for a friendly robot crew with three stars and a visible success message.\",\n visibility: \"visible\",\n criterionIds: [\n \"vibe-idea-studio-goal-one\",\n \"vibe-idea-studio-goal-two\",\n \"vibe-idea-studio-goal-three\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"vibe-idea-studio-m1-private-boundary\",\n statement: \"The prototype stays inside the selected template, permitted artifact and private sandbox.\",\n visibility: \"visible\",\n criterionIds: [\"vibe-idea-studio-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"vibe-idea-studio-m1-idea-cards\",\n description: \"Choose one bounded idea, audience and acceptance-test card.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-idea-studio-m1-keyboard-cards\"],\n },\n {\n id: \"vibe-idea-studio-m1-run-control\",\n description: \"Start the private rescue-card preview.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-idea-studio-m1-keyboard-run\"],\n },\n {\n id: \"vibe-idea-studio-m1-diff-review\",\n description: \"Read the labelled removed and added star-count lines before deciding.\",\n primaryMode: \"text\",\n alternativeIds: [],\n },\n {\n id: \"vibe-idea-studio-m1-accept-control\",\n description: \"Approve the exact immutable prototype change.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-idea-studio-m1-keyboard-review\"],\n },\n {\n id: \"vibe-idea-studio-m1-reject-control\",\n description: \"Reject the suggestion and preserve the current source.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"vibe-idea-studio-m1-keyboard-review\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"vibe-idea-studio-m1-keyboard-cards\",\n modes: [\"keyboard\", \"text\"],\n equivalentOutcome: true,\n description: \"Use labelled radio-card controls with arrow keys and Space to choose the same bounded goal.\",\n },\n {\n id: \"vibe-idea-studio-m1-keyboard-run\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the play-icon Run button to start the same preview.\",\n },\n {\n id: \"vibe-idea-studio-m1-keyboard-review\",\n modes: [\"keyboard\", \"text\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Read the labelled diff and acceptance evidence, then focus Accept or Reject and press Enter or Space.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"vibe-idea-studio-m1-assessment\",\n goalIds: [\n \"vibe-idea-studio-m1-starts\",\n \"vibe-idea-studio-m1-prototype-goal\",\n \"vibe-idea-studio-m1-private-boundary\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"vibe-idea-studio-m1-explanation\",\n goalIds: [\"vibe-idea-studio-m1-prototype-goal\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"vibe-idea-studio-m1-test-inventor\",\n prompt: \"Write one new bounded audience card and one matching acceptance test without changing the template boundary.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"vibe-idea-studio-m1-badge\",\n badgeId: \"vibe-idea-studio-mission-complete\",\n goalIds: [\n \"vibe-idea-studio-m1-starts\",\n \"vibe-idea-studio-m1-prototype-goal\",\n \"vibe-idea-studio-m1-private-boundary\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"vibe-idea-studio-function-prototype\",\n signature: \"choosePrototype(kind)\",\n summary: \"Chooses one supplied, age-appropriate interactive prototype template.\",\n parameters: [{ name: \"kind\", type: \"text\", description: \"Use rescue-card, creature-card or mission-sign.\" }],\n effect: \"Changes only the labelled template in the private preview.\",\n example: \"choosePrototype(\\\"rescue-card\\\");\",\n },\n {\n id: \"vibe-idea-studio-function-stars\",\n signature: \"setStarCount(count)\",\n summary: \"Chooses how many decorative success stars appear on the card.\",\n parameters: [{ name: \"count\", type: \"whole number\", description: \"A bounded count from 1 to 4.\" }],\n effect: \"Changes only the visible star count in the private preview.\",\n example: \"setStarCount(3);\",\n },\n {\n id: \"vibe-idea-studio-function-message\",\n signature: \"setSuccessMessage(message)\",\n summary: \"Chooses one supplied child-safe success message.\",\n parameters: [{ name: \"message\", type: \"text\", description: \"Use Mission ready!, Great teamwork! or Rescue complete!\" }],\n effect: \"Changes only the fictional card message and never sends or stores text.\",\n example: \"setSuccessMessage(\\\"Mission ready!\\\");\",\n },\n ],\n boundedSuggestion: {\n id: \"vibe-idea-studio-m1-authored-star-diff\",\n source: \"authored-fallback\",\n intent: \"Meet the selected acceptance test by showing three stars.\",\n constraints: [\n \"Change exactly one documented star-count setting.\",\n \"Preserve the selected prototype and supplied success message.\",\n \"Do not add free-form content, network, storage, DOM, account or hardware access.\",\n ],\n permittedArtifactId: \"vibe-idea-studio-m1-code\",\n originalSnippet: \"setStarCount(2);\",\n replacementSnippet: \"setStarCount(3);\",\n explanationPrompt: \"Did the accepted change satisfy the three-star acceptance test, and which evidence proves it?\",\n aiOptional: false,\n learnerApprovalRequired: true,\n alternatives: [\"accept\", \"reject\"],\n },\n },\n facilitator: {\n artifacts: [\n {\n id: \"vibe-idea-studio-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"vibe-idea-studio-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"vibe-idea-studio-m1-safety-notes\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"vibe-idea-studio-m1-protected-boundaries\",\n statement: \"The sandbox rejects free-form prompts, personal data, disallowed messages, extra statements, network access and changes outside the approved diff.\",\n visibility: \"protected\",\n criterionIds: [\"vibe-idea-studio-edge-one\", \"vibe-idea-studio-edge-two\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to name the idea, audience and acceptance test before revealing the authored diff.\",\n \"Keep choices bound to supplied child-safe cards, the current rubric and permitted artifact; never invite free-form chat.\",\n \"A rejection must preserve source, and AI/provider failure must never block deterministic prototype completion.\",\n ],\n },\n};\n\n/** Accessible fictional care dashboard with bounded component and timer state. */\nexport const CREATURE_CARE_DASHBOARD_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.creature-care-dashboard\",\n moduleVersion: \"1.1.0\",\n missionId: \"creature-care-dashboard-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how components, events, status displays, timers, responsive layout and reduced motion build an accessible fictional creature dashboard.\",\n artifactIds: [\"creature-care-dashboard-m1-guide\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict which parts of the status card should update and which movement should stop when reduced motion is enabled.\",\n artifactIds: [\"creature-care-dashboard-m1-status-cards\"],\n },\n {\n kind: \"build\",\n instruction: \"Change only the supplied creature, care status, timer, layout and reduced-motion settings.\",\n artifactIds: [\"creature-care-dashboard-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the action-icon Run button to update the private dashboard preview and its equivalent text status.\",\n artifactIds: [\"creature-care-dashboard-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run deterministic component, event, timer, status, responsive-layout and accessibility checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the observed dashboard state with the selected status card and highlighted reduced-motion setting.\",\n artifactIds: [\"creature-care-dashboard-m1-code\"],\n },\n {\n kind: \"fix\",\n instruction: \"Review and accept or reject the exact reduced-motion change yourself, then rerun every check.\",\n artifactIds: [\"creature-care-dashboard-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how events update component state, how the timer stays bounded and why reduced motion matters.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound care badge after the score reaches 80 and every privacy and accessibility check passes.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"creature-care-dashboard-m1-status-check\",\n prompt: \"Find the creature card, care status, timer and text summary that must all describe the same private state.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"creature-care-dashboard-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"creature-care-dashboard-m1-guide\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"creature-care-dashboard-m1-status-cards\",\n kind: \"sample-data\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"creature-care-dashboard-m1-starts\",\n statement: \"The responsive creature-card component, labelled status display and bounded timer state are valid and start.\",\n visibility: \"visible\",\n criterionIds: [\"creature-care-dashboard-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"creature-care-dashboard-m1-behaviour\",\n statement: \"A supplied event updates the fictional creature status and timer while the responsive dashboard keeps one consistent state.\",\n visibility: \"visible\",\n criterionIds: [\n \"creature-care-dashboard-goal-one\",\n \"creature-care-dashboard-goal-two\",\n \"creature-care-dashboard-goal-three\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"creature-care-dashboard-m1-accessible-private\",\n statement: \"The dashboard enables reduced motion, keeps an equivalent text status and uses no network, personal data or real schedule.\",\n visibility: \"visible\",\n criterionIds: [\"creature-care-dashboard-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"creature-care-dashboard-m1-editor\",\n description: \"Edit the five documented dashboard calls using keyboard or pointer controls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"creature-care-dashboard-m1-run\",\n description: \"Activate the labelled action-icon Run control.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"creature-care-dashboard-m1-keyboard-run\"],\n },\n {\n id: \"creature-care-dashboard-m1-review\",\n description: \"Review and accept or reject the exact labelled diff.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"creature-care-dashboard-m1-keyboard-run\",\n description: \"Focus the Run action button and press Enter or Space to produce the same dashboard and text telemetry.\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n },\n ],\n evidenceRequirements: [\n {\n id: \"creature-care-dashboard-m1-assessment\",\n goalIds: [\n \"creature-care-dashboard-m1-starts\",\n \"creature-care-dashboard-m1-behaviour\",\n \"creature-care-dashboard-m1-accessible-private\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"creature-care-dashboard-m1-explanation\",\n goalIds: [\"creature-care-dashboard-m1-accessible-private\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"creature-care-dashboard-m1-remix\",\n prompt: \"Choose another supplied creature, status and responsive layout while preserving the timer and reduced-motion evidence.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"creature-care-dashboard-m1-badge\",\n badgeId: \"creature-care-dashboard-mission-complete\",\n goalIds: [\n \"creature-care-dashboard-m1-starts\",\n \"creature-care-dashboard-m1-behaviour\",\n \"creature-care-dashboard-m1-accessible-private\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"creature-care-dashboard-function-creature\",\n signature: \"chooseCreature(creature)\",\n summary: \"Chooses one supplied fictional creature for the main component card.\",\n parameters: [{ name: \"creature\", type: \"text\", description: \"Use Moon Moth, Cloud Cat or Pebble Dragon.\" }],\n effect: \"Updates the creature card heading, illustration label and equivalent text status.\",\n example: \"chooseCreature(\\\"Moon Moth\\\");\",\n },\n {\n id: \"creature-care-dashboard-function-status\",\n signature: \"setCareStatus(status)\",\n summary: \"Chooses one supplied care state for the fictional creature.\",\n parameters: [{ name: \"status\", type: \"text\", description: \"Use Resting, Ready to play or Snack time.\" }],\n effect: \"Updates the visible component status and accessible live-status text.\",\n example: \"setCareStatus(\\\"Ready to play\\\");\",\n },\n {\n id: \"creature-care-dashboard-function-timer\",\n signature: \"setCareTimer(seconds)\",\n summary: \"Sets a short simulated care timer from a supplied safe value.\",\n parameters: [{ name: \"seconds\", type: \"number\", description: \"Use 5, 10 or 15 simulated seconds.\" }],\n effect: \"Updates bounded timer state and text telemetry without scheduling background work.\",\n example: \"setCareTimer(10);\",\n },\n {\n id: \"creature-care-dashboard-function-layout\",\n signature: \"setDashboardLayout(layout)\",\n summary: \"Chooses one supplied responsive card arrangement.\",\n parameters: [{ name: \"layout\", type: \"text\", description: \"Use single, cosy-grid or wide-grid.\" }],\n effect: \"Changes the simulated preview layout while keeping the same reading and keyboard order.\",\n example: \"setDashboardLayout(\\\"cosy-grid\\\");\",\n },\n {\n id: \"creature-care-dashboard-function-motion\",\n signature: \"setReducedMotion(enabled)\",\n summary: \"Turns the reduced-motion presentation on or off.\",\n parameters: [{ name: \"enabled\", type: \"Boolean\", description: \"Use true to stop decorative movement.\" }],\n effect: \"Disables decorative preview animation while preserving status, timer and event feedback.\",\n example: \"setReducedMotion(true);\",\n },\n ],\n boundedSuggestion: {\n id: \"creature-care-dashboard-m1-reduced-motion-diff\",\n source: \"authored-fallback\",\n intent: \"Keep the fictional care dashboard understandable without decorative movement.\",\n constraints: [\n \"Change exactly one documented reduced-motion setting.\",\n \"Preserve the supplied creature, status, timer, responsive layout and text telemetry.\",\n \"Do not add network, external scripts, trackers, personal data, real schedules or background tasks.\",\n ],\n permittedArtifactId: \"creature-care-dashboard-m1-code\",\n originalSnippet: \"setReducedMotion(false);\",\n replacementSnippet: \"setReducedMotion(true);\",\n explanationPrompt: \"Which decorative movement stopped, and which event, timer and text evidence stayed available?\",\n aiOptional: false,\n learnerApprovalRequired: true,\n alternatives: [\"accept\", \"reject\"],\n },\n },\n facilitator: {\n artifacts: [\n {\n id: \"creature-care-dashboard-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"creature-care-dashboard-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"creature-care-dashboard-m1-safety-notes\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"creature-care-dashboard-m1-protected-boundary\",\n statement: \"The dashboard rejects arbitrary text, personal data, real schedules, scripts, network calls, tracking, unbounded timers and inaccessible motion-only feedback.\",\n visibility: \"protected\",\n criterionIds: [\n \"creature-care-dashboard-edge-one\",\n \"creature-care-dashboard-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to identify the component state, event result, timer and text-equivalent evidence before discussing reduced motion.\",\n \"Use only the supplied fictional creature and status cards; redirect names, real schedules and personal details to safe choices.\",\n \"Reject must preserve source, and provider failure must never block the deterministic authored path.\",\n ],\n },\n};\n\n/** Safe responsive mission-control dashboard backed only by a serial simulator. */\nexport const ROBOT_MISSION_CONTROL_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.robot-mission-control\",\n moduleVersion: \"1.1.0\",\n missionId: \"robot-mission-control-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how commands, a fail-safe state machine, confirmations, telemetry charts and the five documented functions build a simulated mission-control panel.\",\n artifactIds: [\"robot-mission-control-m1-guide\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict whether a planned command may leave STOP when the safety confirmation is disabled.\",\n artifactIds: [\"robot-mission-control-m1-command-cards\"],\n },\n {\n kind: \"build\",\n instruction: \"Change only the supplied command, confirmation, telemetry rate, chart mode and serial-simulation settings.\",\n artifactIds: [\"robot-mission-control-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the action-icon Run button to update the private simulated controls, chart and text telemetry.\",\n artifactIds: [\"robot-mission-control-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run deterministic command, state-machine, safety-confirmation, telemetry and responsive-layout checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the observed STOP state with the planned command and highlighted safety-confirmation setting.\",\n artifactIds: [\"robot-mission-control-m1-code\"],\n },\n {\n kind: \"fix\",\n instruction: \"Review and accept or reject the exact safety-confirmation change yourself, then rerun every check.\",\n artifactIds: [\"robot-mission-control-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how confirmation changes the state machine and why the chart and text telemetry must agree.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound mission-control badge after the score reaches 80 and every mandatory STOP test passes.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"robot-mission-control-m1-stop-check\",\n prompt: \"Find the planned command, current STOP state, confirmation and text telemetry before running the simulator.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"robot-mission-control-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"robot-mission-control-m1-guide\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"robot-mission-control-m1-command-cards\",\n kind: \"sample-data\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"robot-mission-control-m1-starts\",\n statement: \"The responsive control component, chart and text telemetry build with a valid simulated command state machine.\",\n visibility: \"visible\",\n criterionIds: [\"robot-mission-control-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"robot-mission-control-m1-behaviour\",\n statement: \"A confirmed command moves the state machine from STOP and updates the chart and serial simulation with matching bounded telemetry.\",\n visibility: \"visible\",\n criterionIds: [\n \"robot-mission-control-goal-one\",\n \"robot-mission-control-goal-two\",\n \"robot-mission-control-goal-three\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"robot-mission-control-m1-safe-private\",\n statement: \"Without confirmation the simulator stays in STOP, exposes responsive text telemetry and never opens a real serial port or controls hardware.\",\n visibility: \"visible\",\n criterionIds: [\"robot-mission-control-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"robot-mission-control-m1-editor\",\n description: \"Edit the five documented mission-control calls using keyboard or pointer controls.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n {\n id: \"robot-mission-control-m1-run\",\n description: \"Activate the labelled action-icon Run control.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"robot-mission-control-m1-keyboard-run\"],\n },\n {\n id: \"robot-mission-control-m1-review\",\n description: \"Review and accept or reject the exact labelled safety diff.\",\n primaryMode: \"keyboard\",\n alternativeIds: [],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"robot-mission-control-m1-keyboard-run\",\n description: \"Focus the Run action button and press Enter or Space to produce the same controls, chart and text telemetry.\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n },\n ],\n evidenceRequirements: [\n {\n id: \"robot-mission-control-m1-assessment\",\n goalIds: [\n \"robot-mission-control-m1-starts\",\n \"robot-mission-control-m1-behaviour\",\n \"robot-mission-control-m1-safe-private\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"robot-mission-control-m1-explanation\",\n goalIds: [\"robot-mission-control-m1-safe-private\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"robot-mission-control-m1-remix\",\n prompt: \"Choose another supplied command or chart mode and explain which confirmation and STOP evidence must remain.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"robot-mission-control-m1-badge\",\n badgeId: \"robot-mission-control-mission-complete\",\n goalIds: [\n \"robot-mission-control-m1-starts\",\n \"robot-mission-control-m1-behaviour\",\n \"robot-mission-control-m1-safe-private\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"robot-mission-control-function-command\",\n signature: \"planCommand(command)\",\n summary: \"Plans one supplied command for the simulated robot state machine.\",\n parameters: [{ name: \"command\", type: \"text\", description: \"Use scan, hold-position or return-to-base.\" }],\n effect: \"Updates the planned-command panel but cannot leave STOP without confirmation.\",\n example: \"planCommand(\\\"scan\\\");\",\n },\n {\n id: \"robot-mission-control-function-confirmation\",\n signature: \"setSafetyConfirmation(enabled)\",\n summary: \"Controls whether the planned simulated command has explicit safety confirmation.\",\n parameters: [{ name: \"enabled\", type: \"Boolean\", description: \"Use true only after checking the planned command.\" }],\n effect: \"Allows the simulator state machine to leave STOP; it never approves or controls physical hardware.\",\n example: \"setSafetyConfirmation(true);\",\n },\n {\n id: \"robot-mission-control-function-rate\",\n signature: \"setTelemetryRate(samplesPerSecond)\",\n summary: \"Sets a bounded simulated telemetry sampling rate.\",\n parameters: [{ name: \"samplesPerSecond\", type: \"number\", description: \"Use 1, 2 or 4 simulated samples per second.\" }],\n effect: \"Changes bounded chart and text sample spacing without starting background work.\",\n example: \"setTelemetryRate(2);\",\n },\n {\n id: \"robot-mission-control-function-chart\",\n signature: \"setChartMode(mode)\",\n summary: \"Chooses one supplied responsive telemetry presentation.\",\n parameters: [{ name: \"mode\", type: \"text\", description: \"Use line, bars or text-only.\" }],\n effect: \"Changes the preview chart while preserving equivalent labelled text telemetry.\",\n example: \"setChartMode(\\\"line\\\");\",\n },\n {\n id: \"robot-mission-control-function-serial\",\n signature: \"simulateSerial(enabled)\",\n summary: \"Turns the bounded serial-message simulator on or off.\",\n parameters: [{ name: \"enabled\", type: \"Boolean\", description: \"Use true to show simulated messages.\" }],\n effect: \"Produces labelled local simulator messages; it never opens Web Serial or a physical connection.\",\n example: \"simulateSerial(true);\",\n },\n ],\n boundedSuggestion: {\n id: \"robot-mission-control-m1-confirmation-diff\",\n source: \"authored-fallback\",\n intent: \"Confirm the supplied simulated command before the state machine leaves STOP.\",\n constraints: [\n \"Change exactly one documented safety-confirmation setting.\",\n \"Preserve the supplied command, telemetry rate, chart mode, serial simulation and text telemetry.\",\n \"Do not add Web Serial, network, external scripts, hardware control, personal data or automatic approval.\",\n ],\n permittedArtifactId: \"robot-mission-control-m1-code\",\n originalSnippet: \"setSafetyConfirmation(false);\",\n replacementSnippet: \"setSafetyConfirmation(true);\",\n explanationPrompt: \"Which state-machine transition became possible, and what keeps the exercise separate from physical hardware?\",\n aiOptional: false,\n learnerApprovalRequired: true,\n alternatives: [\"accept\", \"reject\"],\n },\n },\n facilitator: {\n artifacts: [\n {\n id: \"robot-mission-control-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"robot-mission-control-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"robot-mission-control-m1-safety-notes\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"robot-mission-control-m1-protected-boundary\",\n statement: \"The dashboard rejects arbitrary commands, invalid rates, scripts, network access, Web Serial, hardware control, personal data and any unconfirmed transition away from STOP.\",\n visibility: \"protected\",\n criterionIds: [\n \"robot-mission-control-edge-one\",\n \"robot-mission-control-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to identify the planned command, current state, confirmation and equivalent text telemetry before suggesting a change.\",\n \"Keep every command and message inside the simulator; the website never opens serial or controls hardware.\",\n \"Reject must preserve source, and provider failure must never block deterministic completion.\",\n ],\n },\n};\n\n/** Accessible fictional planner mission with a private bounded persistence simulator. */\nexport const ADVENTURE_MISSION_PLANNER_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.adventure-mission-planner\",\n moduleVersion: \"1.1.0\",\n missionId: \"adventure-mission-planner-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Read how semantic headings, labelled mission fields, arrays, state and the five documented functions build an accessible fictional planner.\",\n artifactIds: [\"adventure-mission-planner-m1-guide\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict what will still be available after the private preview restarts when local save is disabled.\",\n artifactIds: [\"adventure-mission-planner-m1-test-card\"],\n },\n {\n kind: \"build\",\n instruction: \"Change only the supplied planner settings and keep the fictional mission free of names, contact details and real locations.\",\n artifactIds: [\"adventure-mission-planner-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Use the action-icon Run button to render the semantic private planner preview and its text equivalent.\",\n artifactIds: [\"adventure-mission-planner-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run deterministic structure, validation, array, state, local-save and accessibility checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the observed restart result with the selected persistence goal and highlighted setting.\",\n artifactIds: [\"adventure-mission-planner-m1-code\"],\n },\n {\n kind: \"fix\",\n instruction: \"Review and accept or reject the exact local-save change yourself, then rerun every check.\",\n artifactIds: [\"adventure-mission-planner-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how semantic labels, validation and private local save make the planner easier and safer to use.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound planner badge after the score reaches 80 and every privacy and accessibility check passes.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"adventure-mission-planner-m1-label-check\",\n prompt: \"Find the visible heading, mission title, day and validation message that a screen reader must also announce.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"adventure-mission-planner-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"adventure-mission-planner-m1-guide\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"adventure-mission-planner-m1-test-card\",\n kind: \"sample-data\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"adventure-mission-planner-m1-starts\",\n statement: \"The semantic planner structure, labelled validation message and fictional mission array are valid and start.\",\n visibility: \"visible\",\n criterionIds: [\"adventure-mission-planner-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"adventure-mission-planner-m1-behaviour\",\n statement: \"The planner state contains the supplied fictional mission and its approved private local save survives a simulated restart.\",\n visibility: \"visible\",\n criterionIds: [\n \"adventure-mission-planner-goal-one\",\n \"adventure-mission-planner-goal-two\",\n \"adventure-mission-planner-goal-three\",\n ],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"adventure-mission-planner-m1-accessible-private\",\n statement: \"The planner keeps an accessible text summary and uses only private simulated local save with no network or personal data.\",\n visibility: \"visible\",\n criterionIds: [\"adventure-mission-planner-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"adventure-mission-planner-m1-editor\",\n description: \"Edit the documented planner settings.\",\n primaryMode: \"text\",\n alternativeIds: [],\n },\n {\n id: \"adventure-mission-planner-m1-run\",\n description: \"Run the private semantic planner preview.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"adventure-mission-planner-m1-keyboard-run\"],\n },\n {\n id: \"adventure-mission-planner-m1-review\",\n description: \"Read the labelled removed and added local-save lines and choose Accept or Reject.\",\n primaryMode: \"text\",\n alternativeIds: [],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"adventure-mission-planner-m1-keyboard-run\",\n modes: [\"keyboard\", \"text\", \"reduced-motion\"],\n equivalentOutcome: true,\n description: \"Press Enter or Space on the action-icon button and use the same text planner summary without motion or drag.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"adventure-mission-planner-m1-assessment\",\n goalIds: [\n \"adventure-mission-planner-m1-starts\",\n \"adventure-mission-planner-m1-behaviour\",\n \"adventure-mission-planner-m1-accessible-private\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"adventure-mission-planner-m1-explanation\",\n goalIds: [\"adventure-mission-planner-m1-accessible-private\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"adventure-mission-planner-m1-remix\",\n prompt: \"Add one supplied fictional mission and describe the validation and accessible summary it needs.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"adventure-mission-planner-m1-badge\",\n badgeId: \"adventure-mission-planner-mission-complete\",\n goalIds: [\n \"adventure-mission-planner-m1-starts\",\n \"adventure-mission-planner-m1-behaviour\",\n \"adventure-mission-planner-m1-accessible-private\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n functionReference: [\n {\n id: \"adventure-mission-planner-function-heading\",\n signature: \"setPlannerHeading(heading)\",\n summary: \"Chooses one supplied fictional heading for the semantic planner.\",\n parameters: [{ name: \"heading\", type: \"text\", description: \"Use Moonbase Missions, Forest Rescue Plans or Ocean Quest Board.\" }],\n effect: \"Updates the visible and screen-reader planner heading in the private preview.\",\n example: \"setPlannerHeading(\\\"Moonbase Missions\\\");\",\n },\n {\n id: \"adventure-mission-planner-function-mission\",\n signature: \"addMission(title, day)\",\n summary: \"Adds one supplied fictional mission to the in-memory mission array.\",\n parameters: [\n { name: \"title\", type: \"text\", description: \"Use a supplied fictional mission title.\" },\n { name: \"day\", type: \"text\", description: \"Use Saturday, Sunday or School holiday.\" },\n ],\n effect: \"Adds one validated fictional item to private preview state without sending a form.\",\n example: \"addMission(\\\"Find the moon crystal\\\", \\\"Saturday\\\");\",\n },\n {\n id: \"adventure-mission-planner-function-validation\",\n signature: \"showValidationMessage(message)\",\n summary: \"Chooses one supplied child-readable form validation message.\",\n parameters: [{ name: \"message\", type: \"text\", description: \"Use Choose a day, Add a mission title or Mission ready!\" }],\n effect: \"Shows the message visibly and in the accessible text summary.\",\n example: \"showValidationMessage(\\\"Mission ready!\\\");\",\n },\n {\n id: \"adventure-mission-planner-function-save\",\n signature: \"enableLocalSave(enabled)\",\n summary: \"Turns the private simulated local-save behaviour on or off.\",\n parameters: [{ name: \"enabled\", type: \"Boolean\", description: \"Use true or false.\" }],\n effect: \"Controls only the bounded simulated restart; it never writes Plasius or server storage.\",\n example: \"enableLocalSave(true);\",\n },\n {\n id: \"adventure-mission-planner-function-summary\",\n signature: \"setAccessibleSummary(enabled)\",\n summary: \"Keeps an equivalent text summary beside the visual planner.\",\n parameters: [{ name: \"enabled\", type: \"Boolean\", description: \"Use true to keep the equivalent summary.\" }],\n effect: \"Controls the private preview text equivalent used by assistive technology and reduced-motion routes.\",\n example: \"setAccessibleSummary(true);\",\n },\n ],\n boundedSuggestion: {\n id: \"adventure-mission-planner-m1-local-save-diff\",\n source: \"authored-fallback\",\n intent: \"Make the fictional mission survive the simulated private restart.\",\n constraints: [\n \"Change exactly one documented local-save setting.\",\n \"Preserve the supplied semantic heading, fictional mission, validation and accessible summary.\",\n \"Do not add network, external scripts, transmitting forms, trackers, personal data or server storage.\",\n ],\n permittedArtifactId: \"adventure-mission-planner-m1-code\",\n originalSnippet: \"enableLocalSave(false);\",\n replacementSnippet: \"enableLocalSave(true);\",\n explanationPrompt: \"Did the mission survive the simulated restart, and which accessibility and privacy evidence stayed unchanged?\",\n aiOptional: false,\n learnerApprovalRequired: true,\n alternatives: [\"accept\", \"reject\"],\n },\n },\n facilitator: {\n artifacts: [\n {\n id: \"adventure-mission-planner-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"adventure-mission-planner-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"adventure-mission-planner-m1-safety-notes\",\n kind: \"facilitator-note\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"adventure-mission-planner-m1-protected-boundary\",\n statement: \"The planner rejects arbitrary text, personal data, scripts, network calls, transmitting forms, tracking and persistence outside the bounded simulator.\",\n visibility: \"protected\",\n criterionIds: [\n \"adventure-mission-planner-edge-one\",\n \"adventure-mission-planner-edge-two\",\n ],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to name the semantic heading, validation message and text-equivalent evidence before discussing local save.\",\n \"Use only fictional supplied content; redirect names, contacts and real locations to the safe cards.\",\n \"Reject must preserve source, and provider failure must never block the deterministic authored path.\",\n ],\n },\n};\n\nexport const ROAD_HOPPER_RALLY_MISSION_ONE_AUTHORING_V1: MissionAuthoringBundleV1 = {\n version: MISSION_AUTHORING_CONTRACT_VERSION_V1,\n moduleId: \"junior-coder.road-hopper-rally\",\n moduleVersion: \"1.1.0\",\n missionId: \"road-hopper-rally-mission-1\",\n learner: {\n estimatedMinutes: 20,\n stages: [\n {\n kind: \"learn\",\n instruction: \"Find the x and y coordinates that place a rescue marker on the road.\",\n artifactIds: [\"road-hopper-rally-m1-art\"],\n },\n {\n kind: \"predict\",\n instruction: \"Predict where the marker will appear before you run the starter project.\",\n artifactIds: [],\n },\n {\n kind: \"build\",\n instruction: \"Complete the two road-lane drawing commands in the starter code.\",\n artifactIds: [\"road-hopper-rally-m1-code\"],\n },\n {\n kind: \"run\",\n instruction: \"Run the private preview and use the keyboard start control.\",\n artifactIds: [\"road-hopper-rally-m1-code\"],\n },\n {\n kind: \"assess\",\n instruction: \"Run the visible and protected deterministic mission checks.\",\n artifactIds: [],\n },\n {\n kind: \"inspect\",\n instruction: \"Compare the highlighted line with the goal that did not pass.\",\n artifactIds: [],\n },\n {\n kind: \"fix\",\n instruction: \"Change one coordinate or drawing command, then run the checks again.\",\n artifactIds: [\"road-hopper-rally-m1-code\"],\n },\n {\n kind: \"explain\",\n instruction: \"Explain how your coordinates changed the road on screen.\",\n artifactIds: [],\n },\n {\n kind: \"reward\",\n instruction: \"Collect the evidence-bound badge when the mission score and safety check pass.\",\n artifactIds: [],\n },\n ],\n readinessChecks: [\n {\n id: \"road-hopper-rally-m1-predict-coordinate\",\n prompt: \"Point to the pair of numbers that controls horizontal and vertical position.\",\n scored: false,\n },\n ],\n artifacts: [\n {\n id: \"road-hopper-rally-m1-code\",\n kind: \"starter-code\",\n audience: \"learner\",\n solutionBearing: false,\n },\n {\n id: \"road-hopper-rally-m1-art\",\n kind: \"starter-assets\",\n audience: \"learner\",\n solutionBearing: false,\n },\n ],\n goals: [\n {\n id: \"road-hopper-rally-m1-starts\",\n statement: \"The starter project is structurally valid and starts.\",\n visibility: \"visible\",\n criterionIds: [\"road-hopper-rally-build\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"road-hopper-rally-m1-draws-road\",\n statement: \"Two original road lanes appear at the expected coordinates.\",\n visibility: \"visible\",\n criterionIds: [\"road-hopper-rally-goal-one\"],\n completionRequired: true,\n aiRequired: false,\n },\n {\n id: \"road-hopper-rally-m1-safe-preview\",\n statement: \"The project stays inside the private educational preview boundary.\",\n visibility: \"visible\",\n criterionIds: [\"road-hopper-rally-safety\"],\n completionRequired: true,\n aiRequired: false,\n },\n ],\n interactions: [\n {\n id: \"road-hopper-rally-m1-start-control\",\n description: \"Start the private preview.\",\n primaryMode: \"pointer\",\n alternativeIds: [\"road-hopper-rally-m1-keyboard-start\"],\n },\n ],\n accessibilityAlternatives: [\n {\n id: \"road-hopper-rally-m1-keyboard-start\",\n modes: [\"keyboard\"],\n equivalentOutcome: true,\n description: \"Start the same preview with Enter while the control has focus.\",\n },\n ],\n evidenceRequirements: [\n {\n id: \"road-hopper-rally-m1-assessment\",\n goalIds: [\n \"road-hopper-rally-m1-starts\",\n \"road-hopper-rally-m1-draws-road\",\n \"road-hopper-rally-m1-safe-preview\",\n ],\n kind: \"assessment-result\",\n retention: \"entitlement\",\n containsPersonalData: false,\n },\n {\n id: \"road-hopper-rally-m1-explanation\",\n goalIds: [\"road-hopper-rally-m1-draws-road\"],\n kind: \"learner-explanation\",\n retention: \"attempt\",\n containsPersonalData: false,\n },\n ],\n sideAdventures: [\n {\n id: \"road-hopper-rally-m1-remix\",\n prompt: \"Remix the lane colours while keeping text or shape cues available.\",\n completionRequired: false,\n },\n ],\n rewardBindings: [\n {\n id: \"road-hopper-rally-m1-badge\",\n badgeId: \"road-hopper-rally-mission-complete\",\n goalIds: [\n \"road-hopper-rally-m1-starts\",\n \"road-hopper-rally-m1-draws-road\",\n \"road-hopper-rally-m1-safe-preview\",\n ],\n deterministic: true,\n random: false,\n tokenConvertible: false,\n },\n ],\n },\n facilitator: {\n artifacts: [\n {\n id: \"road-hopper-rally-m1-answer-key\",\n kind: \"answer-key\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n {\n id: \"road-hopper-rally-m1-protected-tests\",\n kind: \"protected-test\",\n audience: \"facilitator\",\n solutionBearing: true,\n },\n ],\n protectedGoals: [\n {\n id: \"road-hopper-rally-m1-protected-edge\",\n statement: \"The drawing remains bounded when a protected coordinate edge case runs.\",\n visibility: \"protected\",\n criterionIds: [\"road-hopper-rally-edge-one\"],\n completionRequired: false,\n aiRequired: false,\n },\n ],\n prompts: [\n \"Ask the learner to predict one coordinate before offering a hint.\",\n \"Do not reveal protected expected values; point back to the visible goal.\",\n ],\n },\n};\n","import type { MissionStageKindV1, ModuleCategoryV1 } from \"./contracts.js\";\nimport { JUNIOR_CODER_MISSION_STAGE_ORDER_V1 } from \"./mission-authoring.js\";\n\n/** Stable activity order for complete courses; legacy authoring remains immutable. */\nexport const LEARNING_COURSE_STAGE_ORDER = JUNIOR_CODER_MISSION_STAGE_ORDER_V1;\nexport const LEARNING_COURSE_LIMITS = Object.freeze({\n missions: 6, stagesPerMission: 9, projectFiles: 8,\n sourceCharactersPerFile: 64_000, sourceCharactersPerProject: 96_000,\n});\n\nexport type LearningProjectLanguageV1 = \"javascript\" | \"python\" | \"cpp\" | \"html\" | \"css\" | \"blocks\" | \"json\";\nexport interface LearningProjectFileV1 { path: string; source: string }\nexport interface LearningProjectV1 { files: LearningProjectFileV1[] }\nexport interface LearningCourseStageV1 {\n id: string;\n kind: MissionStageKindV1;\n title: string;\n instruction: string;\n help: string;\n}\nexport interface LearningCourseMissionV1 {\n id: string;\n title: string;\n concepts: string[];\n estimatedMinutes: number;\n goals: string[];\n assessmentId: string;\n stages: LearningCourseStageV1[];\n extension: string;\n}\n\n/** Learner-safe content only. Protected scenarios and solutions are host-owned. */\nexport interface LearningCourseV1 {\n schemaVersion: \"1\";\n moduleId: string;\n moduleVersion: string;\n slug: string;\n title: string;\n summary: string;\n runtimeId: string;\n category: ModuleCategoryV1;\n estimatedMinutes: number;\n completionAssessmentId: string;\n projectFiles: { path: string; language: LearningProjectLanguageV1; maximumCharacters: number }[];\n starterProject: LearningProjectV1;\n reference: { name: string; signature: string; description: string; example: string }[];\n missions: LearningCourseMissionV1[];\n completionBadge: { id: string; title: string };\n}\n\n/** The only learner-owned save inputs. Progress/evidence are never draft authority. */\nexport interface LearningCourseDraftV1 {\n schemaVersion: \"1\";\n moduleVersion: string;\n activeStageId: string;\n project: LearningProjectV1;\n}\nexport type LearningSaveSlotIdV1 = \"auto\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\";\nexport interface LearningCourseValidationIssueV1 {\n code: \"invalid-manifest\" | \"mission-count\" | \"stage-order\" | \"duplicate-id\" | \"incomplete-content\" | \"invalid-project\";\n path: string;\n}\n\nconst ID = /^[a-z0-9][a-z0-9.-]{0,159}$/u;\nconst FILE_PATH = /^[a-z0-9][a-z0-9_-]{0,63}\\.(?:js|py|cpp|html|css|json)$/u;\nconst VERSION = /^\\d+\\.\\d+\\.\\d+$/u;\nconst LANGUAGES: readonly string[] = [\"javascript\", \"python\", \"cpp\", \"html\", \"css\", \"blocks\", \"json\"];\nconst CATEGORIES: readonly string[] = [\"game\", \"robot\", \"vibe\", \"web-app\"];\nconst PLACEHOLDER = /\\b(?:TODO|TBD|coming soon|placeholder|lorem ipsum)\\b/iu;\nconst record = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\nconst text = (value: unknown, minimum = 1, maximum = 8000): value is string =>\n typeof value === \"string\" && value.trim().length >= minimum && value.length <= maximum;\nconst id = (value: unknown): value is string => typeof value === \"string\" && ID.test(value);\nconst integer = (value: unknown, minimum: number, maximum: number): value is number =>\n typeof value === \"number\" && Number.isSafeInteger(value) && value >= minimum && value <= maximum;\nconst exactKeys = (value: Record<string, unknown>, keys: readonly string[]): boolean =>\n Object.keys(value).length === keys.length && keys.every(key => Object.hasOwn(value, key));\n\n/** Errors contain no source, learner text or caller-supplied identifiers. */\nexport class LearningCourseInputError extends Error {\n constructor() { super(\"Invalid learning course input.\"); this.name = \"LearningCourseInputError\"; }\n}\n\nfunction fileDefinitions(value: unknown): value is LearningCourseV1[\"projectFiles\"] {\n return Array.isArray(value) && value.length >= 1 && value.length <= LEARNING_COURSE_LIMITS.projectFiles\n && value.every(file => record(file) && exactKeys(file, [\"path\", \"language\", \"maximumCharacters\"])\n && typeof file.path === \"string\" && FILE_PATH.test(file.path)\n && typeof file.language === \"string\" && LANGUAGES.includes(file.language)\n && integer(file.maximumCharacters, 1, LEARNING_COURSE_LIMITS.sourceCharactersPerFile))\n && new Set(value.map(file => (file as { path: string }).path)).size === value.length;\n}\n\n/** Validate every file against the declared editable set; never preserve extra fields. */\nexport function parseLearningProject(course: Pick<LearningCourseV1, \"projectFiles\">, value: unknown): LearningProjectV1 {\n if (!fileDefinitions(course.projectFiles) || !record(value) || !exactKeys(value, [\"files\"])\n || !Array.isArray(value.files) || value.files.length !== course.projectFiles.length) throw new LearningCourseInputError();\n const files: LearningProjectFileV1[] = [];\n const seen = new Set<string>();\n let characters = 0;\n for (const file of value.files) {\n if (!record(file) || !exactKeys(file, [\"path\", \"source\"]) || typeof file.path !== \"string\"\n || typeof file.source !== \"string\" || seen.has(file.path)) throw new LearningCourseInputError();\n const definition = course.projectFiles.find(candidate => candidate.path === file.path);\n if (!definition || file.source.length > definition.maximumCharacters || file.source.includes(\"\\u0000\")) throw new LearningCourseInputError();\n characters += file.source.length;\n if (characters > LEARNING_COURSE_LIMITS.sourceCharactersPerProject) throw new LearningCourseInputError();\n seen.add(file.path);\n files.push({ path: file.path, source: file.source });\n }\n // Stable ordering keeps host digests independent of the submitted array order.\n return { files: course.projectFiles.map(definition => files.find(file => file.path === definition.path)!) };\n}\n\n/** Parse untrusted saves without accepting identity, scores, completion or evidence. */\nexport function parseLearningCourseDraft(course: LearningCourseV1, value: unknown): LearningCourseDraftV1 {\n if (!record(value) || !exactKeys(value, [\"schemaVersion\", \"moduleVersion\", \"activeStageId\", \"project\"])\n || value.schemaVersion !== \"1\" || value.moduleVersion !== course.moduleVersion\n || typeof value.activeStageId !== \"string\"\n || !course.missions.some(mission => mission.stages.some(stage => stage.id === value.activeStageId))) throw new LearningCourseInputError();\n return { schemaVersion: \"1\", moduleVersion: course.moduleVersion, activeStageId: value.activeStageId,\n project: parseLearningProject(course, value.project) };\n}\n\n/** An account owns one autosave and nine explicitly managed slots per course version. */\nexport function parseLearningSaveSlotId(value: unknown): LearningSaveSlotIdV1 {\n if (value === \"auto\" || (typeof value === \"string\" && /^[1-9]$/u.test(value))) return value as LearningSaveSlotIdV1;\n throw new LearningCourseInputError();\n}\n\n/** Structural publication gate. Working runtime/curriculum acceptance is additional. */\nexport function validateLearningCourse(value: unknown): LearningCourseValidationIssueV1[] {\n const issues: LearningCourseValidationIssueV1[] = [];\n const add = (code: LearningCourseValidationIssueV1[\"code\"], path: string) => { issues.push({ code, path }); };\n if (!record(value)) return [{ code: \"invalid-manifest\", path: \"$\" }];\n if (!exactKeys(value, [\"schemaVersion\", \"moduleId\", \"moduleVersion\", \"slug\", \"title\", \"summary\", \"runtimeId\", \"category\",\n \"estimatedMinutes\", \"completionAssessmentId\", \"projectFiles\", \"starterProject\", \"reference\", \"missions\", \"completionBadge\"])\n || value.schemaVersion !== \"1\" || !id(value.moduleId) || !id(value.slug) || !id(value.runtimeId)\n || !text(value.moduleVersion) || !VERSION.test(value.moduleVersion)\n || typeof value.category !== \"string\" || !CATEGORIES.includes(value.category)\n || !text(value.title, 3, 160) || !text(value.summary, 40, 2000)\n || !integer(value.estimatedMinutes, 60, 3600) || !id(value.completionAssessmentId)\n || !record(value.completionBadge) || !exactKeys(value.completionBadge, [\"id\", \"title\"])\n || !id(value.completionBadge.id) || !text(value.completionBadge.title, 3, 160)) add(\"invalid-manifest\", \"$\");\n if (!fileDefinitions(value.projectFiles)) add(\"invalid-project\", \"projectFiles\");\n else {\n try { parseLearningProject({ projectFiles: value.projectFiles }, value.starterProject); }\n catch { add(\"invalid-project\", \"starterProject\"); }\n }\n if (!Array.isArray(value.reference) || value.reference.length < 1 || value.reference.length > 80\n || value.reference.some(entry => !record(entry) || !exactKeys(entry, [\"name\", \"signature\", \"description\", \"example\"])\n || !text(entry.name) || !text(entry.signature)\n || !text(entry.description, 20) || !text(entry.example))) add(\"incomplete-content\", \"reference\");\n if (!Array.isArray(value.missions)) { add(\"mission-count\", \"missions\"); return issues; }\n if (value.missions.length !== LEARNING_COURSE_LIMITS.missions) add(\"mission-count\", \"missions\");\n if (value.missions.length > LEARNING_COURSE_LIMITS.missions) return issues;\n const seen = new Set<string>();\n const checkId = (candidate: unknown, path: string) => {\n if (!id(candidate)) add(\"invalid-manifest\", path);\n else if (seen.has(candidate)) add(\"duplicate-id\", path);\n else seen.add(candidate);\n };\n let minutes = 0;\n value.missions.forEach((mission: unknown, missionIndex: number) => {\n const path = `missions[${missionIndex}]`;\n if (!record(mission)) { add(\"invalid-manifest\", path); return; }\n checkId(mission.id, `${path}.id`);\n checkId(mission.assessmentId, `${path}.assessmentId`);\n if (!exactKeys(mission, [\"id\", \"title\", \"concepts\", \"estimatedMinutes\", \"goals\", \"assessmentId\", \"stages\", \"extension\"])\n || !text(mission.title, 3, 160) || !integer(mission.estimatedMinutes, 10, 600)\n || !Array.isArray(mission.concepts) || mission.concepts.length < 1 || mission.concepts.length > 12\n || mission.concepts.some(concept => !text(concept, 2, 120))\n || !Array.isArray(mission.goals) || mission.goals.length < 1 || mission.goals.length > 12\n || mission.goals.some(goal => !text(goal, 20, 2000)) || !text(mission.extension, 30, 2000)) add(\"incomplete-content\", path);\n if (typeof mission.estimatedMinutes === \"number\") minutes += mission.estimatedMinutes;\n if (!Array.isArray(mission.stages) || mission.stages.length !== LEARNING_COURSE_LIMITS.stagesPerMission) {\n add(\"stage-order\", `${path}.stages`); return;\n }\n mission.stages.forEach((stage: unknown, stageIndex: number) => {\n const stagePath = `${path}.stages[${stageIndex}]`;\n if (!record(stage)) { add(\"invalid-manifest\", stagePath); return; }\n checkId(stage.id, `${stagePath}.id`);\n if (stage.kind !== LEARNING_COURSE_STAGE_ORDER[stageIndex]) add(\"stage-order\", stagePath);\n if (!exactKeys(stage, [\"id\", \"kind\", \"title\", \"instruction\", \"help\"])\n || !text(stage.title, 3, 160) || !text(stage.instruction, 40) || !text(stage.help, 30)\n || (typeof stage.instruction === \"string\" && PLACEHOLDER.test(stage.instruction))) add(\"incomplete-content\", stagePath);\n });\n });\n if (minutes !== value.estimatedMinutes) add(\"invalid-manifest\", \"estimatedMinutes\");\n return issues;\n}\n\n/** Validate an external learner manifest and detach it from the supplied object. */\nexport function parseLearningCourse(value: unknown): LearningCourseV1 {\n if (validateLearningCourse(value).length) throw new LearningCourseInputError();\n return structuredClone(value as LearningCourseV1);\n}\n","import { LEARNING_COURSE_STAGE_ORDER, parseLearningCourse, type LearningCourseV1 } from \"../course-contracts.js\";\nimport type { MissionStageKindV1 } from \"../contracts.js\";\n\n/** Formative checks are learner-visible teaching material, not protected assessments. */\nexport interface CoursePracticeQuestion {\n stageId: string;\n question: string;\n choices: [string, string, string];\n correctChoice: 0 | 1 | 2;\n feedback: string;\n}\nexport type PracticeDraft = Omit<CoursePracticeQuestion, \"stageId\">;\nexport interface CourseMissionDraft {\n title: string;\n concepts: string[];\n goals: string[];\n extension: string;\n activities: Record<MissionStageKindV1, [instruction: string, help: string]>;\n questions: Record<\"learn\" | \"predict\" | \"explain\", PracticeDraft>;\n}\ntype CourseHeader = Omit<LearningCourseV1, \"schemaVersion\" | \"moduleVersion\" | \"moduleId\" | \"runtimeId\" | \"estimatedMinutes\" | \"completionAssessmentId\" | \"completionBadge\" | \"missions\">;\n\n/** Only identifiers and activity framing are shared; each lesson is independently authored. */\nexport function authorCourse(header: CourseHeader, missions: CourseMissionDraft[]): { course: LearningCourseV1; practice: CoursePracticeQuestion[] } {\n const course = parseLearningCourse({ ...header, schemaVersion: \"1\", moduleVersion: \"2.0.0\", moduleId: `junior-coder.${header.slug}`,\n runtimeId: `${header.slug}.v2`, estimatedMinutes: missions.length * 60,\n completionAssessmentId: `${header.slug}.final`, completionBadge: { id: `${header.slug}.completed`, title: `${header.title} creator` },\n missions: missions.map((mission, index) => ({\n id: `${header.slug}.m${index + 1}`, title: mission.title, concepts: mission.concepts, goals: mission.goals,\n estimatedMinutes: 60, assessmentId: `${header.slug}.m${index + 1}.assessment`, extension: mission.extension,\n stages: LEARNING_COURSE_STAGE_ORDER.map(kind => ({ id: `${header.slug}.m${index + 1}.${kind}`, kind,\n title: `${kind.charAt(0).toUpperCase()}${kind.slice(1)}: ${mission.title}`,\n instruction: mission.activities[kind][0], help: mission.activities[kind][1] })),\n })),\n });\n const practice = structuredClone(missions.flatMap((mission, index) => ([\"learn\", \"predict\", \"explain\"] as const)\n .map(kind => ({ ...mission.questions[kind], stageId: `${header.slug}.m${index + 1}.${kind}` }))));\n for (const question of practice) {\n if (question.question.trim().length < 20 || question.feedback.trim().length < 40\n || question.choices.length !== 3 || question.choices.some(choice => choice.trim().length < 2) || new Set(question.choices).size !== 3\n || !Number.isInteger(question.correctChoice) || question.correctChoice < 0 || question.correctChoice > 2) throw new Error(\"Invalid course practice question.\");\n }\n return { course, practice };\n}\n","import type { LearningCourseV1 } from \"../course-contracts.js\";\n\n/** The web courses share file limits and a readable starting theme, not lesson content. */\nexport const webProjectFiles: LearningCourseV1[\"projectFiles\"] = [\n { path: \"index.html\", language: \"html\", maximumCharacters: 24000 },\n { path: \"app.css\", language: \"css\", maximumCharacters: 16000 },\n { path: \"app.js\", language: \"javascript\", maximumCharacters: 32000 },\n];\n\nexport const webStarterCss = `:root { color: #172a29; background-color: #f5f4ec; font-family: system-ui, sans-serif; line-height: 1.6; }\n* { box-sizing: border-box; }\nmain { max-width: 60rem; margin-inline: auto; padding: 1rem; overflow-wrap: anywhere; }\nh1, h2, p { margin-top: 0; }\nsection, article, fieldset { border: 1px solid #647874; border-radius: 0.5rem; padding: 1rem; margin-block: 1rem; min-width: 0; }\nlabel { display: block; font-weight: 700; }\nbutton, input, select, textarea { font-family: inherit; font-size: 1rem; line-height: 1.6; min-height: 2.75rem; max-width: 100%; border: 2px solid #465e59; border-radius: 0.25rem; padding: 0.5rem; color: inherit; background-color: #ffffff; }\nbutton { cursor: pointer; }\nbutton:disabled { cursor: default; border-style: dashed; }\n:focus-visible { outline: 3px solid #075bab; outline-offset: 3px; }\n[aria-invalid=\"true\"] { border-color: #a11c25; }\n.error { color: #a11c25; }\n.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }\n.cards { display: grid; gap: 1rem; padding: 0; list-style-type: none; }\nprogress, meter { width: 100%; }\n@media (min-width: 48rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n@media (prefers-reduced-motion: reduce) { * { transition-duration: 0s; } }\n@media (prefers-color-scheme: dark) {\n :root { color: #edf4ef; background-color: #142623; }\n button, input, select, textarea { color: #edf4ef; background-color: #203a34; border-color: #b8cec5; }\n :focus-visible { outline-color: #a8d6ff; }\n .error { color: #ffb8bf; }\n [aria-invalid=\"true\"] { border-color: #ffb8bf; }\n}\n`;\n\nexport const webReferences: LearningCourseV1[\"reference\"] = [\n { name: \"editable web files\", signature: \"index.html + app.css + app.js\", description: \"Write a semantic HTML fragment beginning with main, scoped responsive CSS and pure JavaScript initialState/update/view functions. The host compiles HTML/CSS and runs JavaScript separately. No document, DOM, imports, network, localStorage, timers, images or external resources are available. Fictional project data stays inside the preview; course source is saved through the bound account.\", example: '<main><h1>My project</h1><p role=\"status\" data-text=\"message\"></p></main>' },\n { name: \"bindings\", signature: \"view(state) → plain JSON display data\", description: \"data-text displays scalar text; data-value controls a native field; data-checked, data-disabled, data-pressed, data-invalid and data-if require booleans. data-label supplies a nonempty accessible label. data-repeat repeats its element for records with unique string id, resolving nested bindings within each record. Do not put static HTML IDs in repeated content. Paths use named fields up to four segments, without expressions.\", example: '<li data-repeat=\"missions\"><span data-text=\"title\"></span><button type=\"button\" data-action=\"toggle\" data-id=\"id\" data-pressed=\"done\" data-label=\"toggleLabel\">Toggle</button></li>' },\n { name: \"native events\", signature: '{ type: \"field\", name, value } or { type, id? }', description: \"A named input, textarea or select emits field with its string value (checkboxes use booleans). A type=button with data-action emits that action and optional bound data-id. A form with data-action owns submission; its submit button has no separate action. Prevent network submission. Preserve native labels, focus and keyboard operation; input text is never executable markup.\", example: '<form data-action=\"add\" novalidate><label for=\"title\">Mission</label><input id=\"title\" name=\"title\" data-value=\"draft.title\"><button type=\"submit\">Add mission</button></form>' },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,sCAAsC;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACjBO,IAAM,8BAA8B;AACpC,IAAM,yBAAyB,OAAO,OAAO;AAAA,EAClD,UAAU;AAAA,EAAG,kBAAkB;AAAA,EAAG,cAAc;AAAA,EAChD,yBAAyB;AAAA,EAAQ,4BAA4B;AAC/D,CAAC;AAuDD,IAAM,KAAK;AACX,IAAM,YAAY;AAClB,IAAM,UAAU;AAChB,IAAM,YAA+B,CAAC,cAAc,UAAU,OAAO,QAAQ,OAAO,UAAU,MAAM;AACpG,IAAM,aAAgC,CAAC,QAAQ,SAAS,QAAQ,SAAS;AACzE,IAAM,cAAc;AACpB,IAAM,SAAS,CAAC,UACd,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AACrE,IAAM,OAAO,CAAC,OAA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