@plasius/learning 0.4.0 → 0.6.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.
Files changed (66) hide show
  1. package/README.md +28 -0
  2. package/dist/chunk-2UIOBMJZ.js +44 -0
  3. package/dist/chunk-2UIOBMJZ.js.map +1 -0
  4. package/dist/courses/beacon-bot.cjs +362 -0
  5. package/dist/courses/beacon-bot.cjs.map +1 -0
  6. package/dist/courses/beacon-bot.d.cts +6 -0
  7. package/dist/courses/beacon-bot.d.ts +6 -0
  8. package/dist/courses/beacon-bot.js +168 -0
  9. package/dist/courses/beacon-bot.js.map +1 -0
  10. package/dist/courses/dance-rover.cjs +374 -0
  11. package/dist/courses/dance-rover.cjs.map +1 -0
  12. package/dist/courses/dance-rover.d.cts +6 -0
  13. package/dist/courses/dance-rover.d.ts +6 -0
  14. package/dist/courses/dance-rover.js +180 -0
  15. package/dist/courses/dance-rover.js.map +1 -0
  16. package/dist/courses/meteor-shield.cjs +369 -0
  17. package/dist/courses/meteor-shield.cjs.map +1 -0
  18. package/dist/courses/meteor-shield.d.cts +6 -0
  19. package/dist/courses/meteor-shield.d.ts +6 -0
  20. package/dist/courses/meteor-shield.js +175 -0
  21. package/dist/courses/meteor-shield.js.map +1 -0
  22. package/dist/courses/obstacle-explorer.cjs +368 -0
  23. package/dist/courses/obstacle-explorer.cjs.map +1 -0
  24. package/dist/courses/obstacle-explorer.d.cts +6 -0
  25. package/dist/courses/obstacle-explorer.d.ts +6 -0
  26. package/dist/courses/obstacle-explorer.js +174 -0
  27. package/dist/courses/obstacle-explorer.js.map +1 -0
  28. package/dist/courses/pixel-trail-challenge.cjs +366 -0
  29. package/dist/courses/pixel-trail-challenge.cjs.map +1 -0
  30. package/dist/courses/pixel-trail-challenge.d.cts +6 -0
  31. package/dist/courses/pixel-trail-challenge.d.ts +6 -0
  32. package/dist/courses/pixel-trail-challenge.js +172 -0
  33. package/dist/courses/pixel-trail-challenge.js.map +1 -0
  34. package/dist/courses/rainbow-rescue-rover.cjs +377 -0
  35. package/dist/courses/rainbow-rescue-rover.cjs.map +1 -0
  36. package/dist/courses/rainbow-rescue-rover.d.cts +6 -0
  37. package/dist/courses/rainbow-rescue-rover.d.ts +6 -0
  38. package/dist/courses/rainbow-rescue-rover.js +183 -0
  39. package/dist/courses/rainbow-rescue-rover.js.map +1 -0
  40. package/dist/courses/rescue-crew-commander.cjs +369 -0
  41. package/dist/courses/rescue-crew-commander.cjs.map +1 -0
  42. package/dist/courses/rescue-crew-commander.d.cts +6 -0
  43. package/dist/courses/rescue-crew-commander.d.ts +6 -0
  44. package/dist/courses/rescue-crew-commander.js +175 -0
  45. package/dist/courses/rescue-crew-commander.js.map +1 -0
  46. package/dist/courses/robot-maze-dash.js +3 -38
  47. package/dist/courses/robot-maze-dash.js.map +1 -1
  48. package/dist/courses/servo-creature.cjs +369 -0
  49. package/dist/courses/servo-creature.cjs.map +1 -0
  50. package/dist/courses/servo-creature.d.cts +6 -0
  51. package/dist/courses/servo-creature.d.ts +6 -0
  52. package/dist/courses/servo-creature.js +175 -0
  53. package/dist/courses/servo-creature.js.map +1 -0
  54. package/dist/courses/skywing-sprint.cjs +367 -0
  55. package/dist/courses/skywing-sprint.cjs.map +1 -0
  56. package/dist/courses/skywing-sprint.d.cts +6 -0
  57. package/dist/courses/skywing-sprint.d.ts +6 -0
  58. package/dist/courses/skywing-sprint.js +173 -0
  59. package/dist/courses/skywing-sprint.js.map +1 -0
  60. package/dist/courses/star-defender-squadron.cjs +369 -0
  61. package/dist/courses/star-defender-squadron.cjs.map +1 -0
  62. package/dist/courses/star-defender-squadron.d.cts +6 -0
  63. package/dist/courses/star-defender-squadron.d.ts +6 -0
  64. package/dist/courses/star-defender-squadron.js +175 -0
  65. package/dist/courses/star-defender-squadron.js.map +1 -0
  66. package/package.json +51 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/courses/obstacle-explorer.ts","../../src/mission-authoring.ts","../../src/course-contracts.ts","../../src/courses/course-authoring.ts"],"sourcesContent":["import { authorCourse } from \"./course-authoring.js\";\n\nexport const { course, practice } = authorCourse({\n slug: \"obstacle-explorer\", title: \"Obstacle Explorer\", category: \"robot\",\n summary: \"Programme a simulated rover to explore a course using distance observations. Build a controller that remembers its decisions, turns for a bounded time and recognises stale data. Finish with deliberate recovery, a clear arrival state and evidence from both successful and interrupted journeys. No physical equipment is required.\",\n projectFiles: [{ path: \"robot.cpp\", language: \"cpp\", maximumCharacters: 24000 }],\n starterProject: { files: [{ path: \"robot.cpp\", source: `bool armed = false;\nbool wasEnabled = false;\nint mode = 0;\nint attempts = 0;\nint clearCount = 0;\nint lastSampleId = -1;\nint turnStart = 0;\n\nvoid setup() { stopMotors(); }\n\nvoid loop() {\n stopMotors();\n}\n` }] },\n reference: [\n { name: \"distance observation\", signature: 'numberSensor(\"distanceCm\"); numberSensor(\"sampleAgeMs\"); numberSensor(\"sampleId\");', description: \"Distance is valid from 0 through 400 cm, age from 0 through 250 ms and sampleId is a nonnegative integer. A repeated ID is the same observation; a decreasing ID is invalid. Read supplied values on every loop. Missing or malformed input stops the host simulation.\", example: 'double distance = numberSensor(\"distanceCm\");' },\n { name: \"stopMotors\", signature: \"stopMotors()\", description: \"Immediately set both simulated wheel powers to zero. Use at startup, explicit stop, disable, bumper, invalid or stale observation, turn deadline and arrival. A stop branch must return before another movement command.\", example: 'if (boolSensor(\"stop\")) { armed = false; stopMotors(); return; }' },\n { name: \"setMotorPower\", signature: \"setMotorPower(double left, double right)\", description: \"Each simulated output must stay from -25 through 25. Use (20,20) for driving and (-15,15) for a left turn on the spot. The simplified differential model has 120 mm wheel spacing and 5 mm/s per power unit. These outputs have no physical device connection.\", example: \"setMotorPower(-15, 15);\" },\n { name: \"clearance state\", signature: \"mode: 0 driving, 1 halted, 2 turning\", description: \"At distance at or below 20 cm, stop driving and enter halted. Resuming drive requires two distinct increasing sample IDs at or above 30 cm; another distinct sample below 30 resets clearCount. The 20–30 cm band preserves driving but cannot establish clearance while halted or turning.\", example: \"if (distance >= 30) { clearCount += 1; } else { clearCount = 0; }\" },\n { name: \"turn deadline\", signature: \"millis() - turnStart >= 600\", description: \"After entering halted, emit a stopped observation before considering a turn on the next loop. With no confirmed clearance, begin a left turn and increment attempts. Stop at 600 ms; the deadline wins over clearance on that observation. After the first two expired turns, a later halted observation may drive if clear or try another turn. The third expired turn disarms even if clearance arrives at its deadline.\", example: \"if (millis() - turnStart >= 600) { mode = 1; stopMotors(); return; }\" },\n { name: \"permission and recovery\", signature: 'boolSensor(\"enabled\"); boolSensor(\"stop\"); boolSensor(\"bumper\");', description: \"A fresh safe enable edge arms in halted mode, resets attempts and clearCount, and stops for that observation. Stop, disable, bumper, invalid or stale data disarm immediately. Track enable history even while blocked. After interruption or three failed turns, release and enable again; fault clearance alone never starts movement.\", example: 'bool enabled = boolSensor(\"enabled\"); bool rising = enabled && !wasEnabled; wasEnabled = enabled;' },\n { name: \"arrival\", signature: 'boolSensor(\"goal\")', description: \"The simulator supplies goal when the rover reaches the course destination. Goal disarms and stops before movement. It does not award course completion, and a still-true goal prevents rearming. Restarting the simulator creates fresh programme state and a fresh course position.\", example: 'if (boolSensor(\"goal\")) { armed = false; stopMotors(); return; }' },\n ],\n}, [\n {\n title: \"A distance you can trust\", concepts: [\"Sensor observations\", \"Ranges\", \"Safe default\"],\n goals: [\"Read the current distance and reject values outside its stated range.\", \"Command bounded forward motion only with permission and adequate clearance.\"],\n extension: \"Draw a distance number line including -1, 0, 20, 21, 400 and 401. Annotate invalid, too near and usable readings before testing them.\",\n activities: {\n learn: [\"A distance is an observation, not a promise of safety. In this simulator valid readings span 0–400 cm. Begin stopped; while enabled and not stopped or touching a bumper, drive at (20,20) only above 20 cm. Otherwise stop immediately.\", \"A negative reading or a value beyond the stated maximum is invalid, not a conveniently large empty space.\"],\n predict: [\"Predict the output for distances 19, 20, 21 and 401 with enable on. Then keep a clear reading but press stop. Identify the condition that must win before a motor command is emitted.\", \"At the 20 cm boundary the rover stops. The stop input has priority even when distance appears clear.\"],\n build: [\"Read distanceCm in loop and validate its range before using it. Add guards for disabled input, stop and bumper. Return after stopMotors on the stopped path; use setMotorPower(20,20) only on the valid clear path.\", \"Keep one movement command at the end so a later statement cannot accidentally undo the stop.\"],\n run: [\"Use the simulator's distance controls to cross the 20 cm threshold. Try an invalid reading and a bumper event while moving. Inspect the numeric wheel outputs and stopped reason alongside the rover picture.\", \"Pause and step through observations when continuous motion makes the first incorrect decision hard to find.\"],\n assess: [\"Check clear travel, the exact near boundary, both invalid range ends, disable, stop and bumper. All wheel outputs must remain within -25 through 25, including during awkward input combinations.\", \"The host checks emitted commands, so moving slowly on screen cannot conceal an out-of-range output.\"],\n inspect: [\"If 401 permits motion, inspect range validation before clearance. If stop appears briefly then motion returns on the same observation, inspect code after stopMotors. If 20 moves, inspect the comparison boundary.\", \"Find the earliest wrong command rather than relying on the final displayed position.\"],\n fix: [\"Repair the responsible comparison or control branch. Replay the failing boundary and a valid forward journey, then stop during movement to ensure the correction preserves ordinary control.\", \"Replacing every output with stop passes no genuine travel check; the project needs useful motion as well as safe refusal.\"],\n explain: [\"Choose why an invalid large distance must stop the controller. Explain the difference between an observation being inside its valid range and that observation providing enough clearance to drive.\", \"Validity and clearance answer different questions and deserve separate conditions.\"],\n reward: [\"Save Trusted distance. Your rover can make a simple decision from a valid current observation. Next you will add memory so small changes near the boundary do not make it repeatedly start and stop.\", \"Keep the exact 20 cm case as a regression example for later state changes.\"],\n },\n questions: {\n learn: { question: \"How should this controller treat a distance of 401 cm?\", choices: [\"As invalid and stop\", \"As guaranteed open space\", \"As a command to turn faster\"], correctChoice: 0, feedback: \"401 exceeds the documented sensor range, so it cannot be used as trustworthy evidence of clearance.\" },\n predict: { question: \"With permission active and distance exactly 20 cm, which output is required?\", choices: [\"Forward at full power\", \"Both wheels stopped\", \"Reverse until the reading changes\"], correctChoice: 1, feedback: \"The near boundary includes 20 cm, so the forward path must stop at that exact value.\" },\n explain: { question: \"Why validate range separately from available clearance?\", choices: [\"To avoid reading the sensor\", \"To make every valid reading move\", \"Because a valid reading can still describe an obstacle\"], correctChoice: 2, feedback: \"A reading such as 10 cm is valid sensor data but provides too little clearance for forward movement.\" },\n },\n },\n {\n title: \"Remember the last decision\", concepts: [\"State\", \"Hysteresis\", \"Distinct observations\"],\n goals: [\"Use separate stop and resume thresholds to avoid repeated switching.\", \"Confirm clearance from two distinct samples instead of counting duplicate observations.\"],\n extension: \"Write two traces containing the same distances but different sample IDs. Explain why only the trace with new observations can confirm clearance.\",\n activities: {\n learn: [\"Use mode=0 for driving and mode=1 for halted. Driving stops at distance≤20. A halted rover resumes only after two distinct increasing sample IDs with distance≥30. A new sample below 30 resets clearCount. Repeating one ID must not increase it.\", \"The gap between stop and resume thresholds is hysteresis: the decision depends on both distance and previous state.\"],\n predict: [\"While halted, observe (ID 7,35 cm), repeat ID 7, then observe (ID 8,32 cm). Predict clearCount after each. Compare a driving rover and a halted rover seeing 25 cm.\", \"A duplicate supplies no new evidence. In the 20–30 band, driving continues but a halted rover has not established clearance.\"],\n build: [\"Store mode, clearCount and lastSampleId. Update clearance only when sampleId increases; copy that ID after processing. Stop and reset clearance on the transition from driving to halted. Return to driving once two new clear samples confirm the path.\", \"Reset the counter for a new below-30 sample even if it is not close enough to trigger the driving stop threshold.\"],\n run: [\"Play a noisy sequence around 20 cm, then a clear sequence above 30 cm. Pause on a duplicated ID and compare the counter before and after. Inspect state text and the distance chart together.\", \"Use sample identity and value as two separate columns in your trace.\"],\n assess: [\"Check both threshold boundaries, the middle band, interrupted clearance and repeated IDs. The controller must neither chatter on every distance change nor restart from a single duplicated sample.\", \"An increasing display time does not automatically make an unchanged sensor ID a fresh sample.\"],\n inspect: [\"If a repeated reading resumes travel, inspect the ID comparison. If 25 cm restarts a halted rover, inspect the resume threshold. If it stops a driving rover, inspect which threshold applies to that state.\", \"Trace mode before the decision; the same distance can correctly produce different outcomes in different states.\"],\n fix: [\"Repair state or counter handling and replay duplicate-clear-clear and clear-near-clear sequences. Confirm the rover can still resume after two genuinely new clear samples.\", \"Do not count the near sample that caused the stop as evidence that the path is now clear.\"],\n explain: [\"Choose why two observations with one repeated ID count as one sample. Explain how hysteresis gives the controller a stable decision around a noisy boundary.\", \"Memory is useful when a decision needs evidence across time rather than one isolated reading.\"],\n reward: [\"Save Stable clearance. Your rover now distinguishes new evidence from repeated data. Next it will try a short turn when a halted route does not become clear.\", \"Keep a trace through the middle band to verify that the turn state uses the same clearance rule.\"],\n },\n questions: {\n learn: { question: \"What allows a halted rover to confirm clearance?\", choices: [\"One sample copied repeatedly\", \"Two distinct increasing IDs with distance at least 30 cm\", \"Any reading above zero\"], correctChoice: 1, feedback: \"Two genuinely new clear observations establish clearance; copies of one observation do not add evidence.\" },\n predict: { question: \"A halted rover sees ID 7 twice at 35 cm; how many clear samples has it counted?\", choices: [\"Zero\", \"Two\", \"One\"], correctChoice: 2, feedback: \"The repeated ID describes the same observation, so the clearance counter remains one.\" },\n explain: { question: \"Why use different stop and resume thresholds?\", choices: [\"To avoid repeated switching near one noisy boundary\", \"To ignore state entirely\", \"To allow invalid distances\"], correctChoice: 0, feedback: \"The gap between thresholds prevents a small fluctuation from repeatedly reversing the previous decision.\" },\n },\n },\n {\n title: \"Turn with a deadline\", concepts: [\"Finite state machine\", \"Non-blocking time\", \"Bounded attempts\"],\n goals: [\"Try a short left turn without blocking fresh observations.\", \"Stop each turn at its deadline and bound the number of attempts.\"],\n extension: \"Compare a 300 ms and a 600 ms turn in a separate saved experiment. Keep the same power and explain which property changes and which limits must remain.\",\n activities: {\n learn: [\"Add mode=2 for turning. After a stopped halted observation, an uncleared route may begin a left turn at (-15,15). Record turnStart and increment attempts once. At 600 ms stop and return to halted. Try at most three turns before waiting for deliberate recovery.\", \"Do not wait inside a loop for time to pass. Each observation must return so stop and sensor updates remain responsive.\"],\n predict: [\"A turn starts at 1000 ms. Predict outputs at 1599 and 1600 ms, then consider confirmed clearance arriving exactly at 1600. Decide which rule wins on the deadline observation.\", \"The turn deadline requires a stopped observation even when another decision could otherwise permit movement.\"],\n build: [\"Add a timed turning branch using millis. Evaluate the deadline before clearance in that branch. A turn may end earlier by returning to drive after confirmed clearance; reset attempts on that successful drive. Otherwise stop at the deadline and try again from halted on a later observation.\", \"Increment attempts on entry to turning, not on every loop that remains in the turning state.\"],\n run: [\"Step through stopped, turning and deadline observations. Present fresh clear samples during one turn and a permanently blocked distance during another. Check the turn counter and complete command trace.\", \"The controller makes bounded attempts; it is not a general solver for every possible maze.\"],\n assess: [\"Check motor direction, exact deadline, early confirmed clearance, one increment per turn, three-attempt bound and stop priority during turning. A fourth automatic turn must not start.\", \"A successful ordinary turn does not replace checking the persistent-obstacle case.\"],\n inspect: [\"If a turn never ends, inspect elapsed simulated time. If attempts rise too quickly, inspect the entry transition. If a deadline emits forward movement, inspect the order of the time and clearance branches.\", \"Inspect every command in the observation, including a movement command accidentally emitted after a stop.\"],\n fix: [\"Repair the transition and replay the deadline with simultaneous clearance, followed by a persistent obstacle. Keep a normal early-clearance turn as a regression case.\", \"Do not extend the turn indefinitely to force a favourable scene outcome; the documented deadline is part of the controller.\"],\n explain: [\"Choose why timed states are more responsive than a busy wait. Explain how a bounded attempt gives the rover an understandable failure state when its simple strategy cannot find a route.\", \"An honest stopped outcome is better evidence than silently repeating an action without a limit.\"],\n reward: [\"Save Bounded turn. Your rover can try a different heading while still accepting fresh input. Next you will handle the case where the distance stream itself stops providing usable observations.\", \"Preserve the third-turn deadline trace for later recovery checks.\"],\n },\n questions: {\n learn: { question: \"When should the turn attempt counter increase?\", choices: [\"On every displayed frame\", \"Whenever the distance is repeated\", \"Once on entry to the turning state\"], correctChoice: 2, feedback: \"The counter measures attempted turns, so each state entry adds one regardless of how many observations the turn spans.\" },\n predict: { question: \"A turn began at 1000 ms; what must happen at 1600 ms?\", choices: [\"Emit a stop before any later movement decision\", \"Always begin another turn immediately\", \"Ignore new stop input\"], correctChoice: 0, feedback: \"The 600 ms deadline is inclusive and takes priority over clearance on that observation.\" },\n explain: { question: \"Why return from loop while waiting for a turn deadline?\", choices: [\"To remove timing entirely\", \"So new stop and sensor observations can be processed\", \"To make the turn last forever\"], correctChoice: 1, feedback: \"A non-blocking timed state allows each new observation to apply safety and control decisions promptly.\" },\n },\n },\n {\n title: \"Notice a missing observation\", concepts: [\"Freshness\", \"Watchdog\", \"Fail-safe state\"],\n goals: [\"Stop on stale, malformed or out-of-order sensor observations.\", \"Prevent old clear data from continuing a moving command.\"],\n extension: \"Build a trace where distance remains 100 cm but sample age increases past 250 ms. Explain why unchanged distance is not evidence that the route stayed clear.\",\n activities: {\n learn: [\"A sensor watchdog checks freshness before movement. Valid sampleAgeMs is 0–250 inclusive. sampleId must be a nonnegative integer and may repeat but must not decrease. Invalid range, age or identity stops and disarms, even if the last distance looked clear.\", \"A duplicate within its age limit may preserve state, but it cannot add a new clearance sample.\"],\n predict: [\"Keep distance at 100 cm while age changes from 250 to 251 ms. Then supply a lower sample ID with age zero. Predict armed state and outputs for both failures.\", \"A recent timestamp cannot make an out-of-order identity valid, and a large distance cannot make an old sample fresh.\"],\n build: [\"Validate distance, age and identity before updating counters or emitting movement. On failure stop, disarm and reset clearance. Keep current enable history updated so a fault clearing under a held enable cannot create a false new start.\", \"Store the last accepted sample ID; do not replace it with a malformed or backwards observation.\"],\n run: [\"Freeze the distance stream during forward travel and during a turn. Watch age cross the limit. Try a backwards ID, a fractional ID and an invalid distance. Inspect the first stopped observation and the reason shown.\", \"The simulator supplies these fault cases; no physical sensor connection or permission is needed.\"],\n assess: [\"Check exact age boundaries, negative age, malformed identity, backwards identity, frozen samples and errors during turning. Programme or input failure must leave the host's virtual motors stopped.\", \"Passing the ordinary movement path does not establish a working watchdog; the missing-data paths are checked separately.\"],\n inspect: [\"If motion persists after expiry, inspect whether validation happens only at startup. If clearing a fault resumes movement, inspect armed state and enable history. If duplicate IDs increase clearCount, inspect the freshness and novelty checks separately.\", \"Fresh enough and genuinely new are different properties of an observation.\"],\n fix: [\"Repair validation order and replay clear travel, frozen input, expiry, fresh input and a still-held enable. The new valid sample removes the fault but must not itself restart the disarmed rover.\", \"Never replace missing data with a favourable distance just to keep the animation moving.\"],\n explain: [\"Choose why a watchdog uses the age of the observation rather than the age of the page. Explain why input freshness must be checked during every moving state.\", \"The browser can continue rendering normally while its simulated sensor stream has stopped.\"],\n reward: [\"Save Fresh observations. Your controller now recognises when its evidence is no longer usable. Next you will make starting again a clear, deliberate and testable action.\", \"Keep the 250/251 ms boundary to check later refactors.\"],\n },\n questions: {\n learn: { question: \"Which sample age is the first whole millisecond outside the allowed window?\", choices: [\"250 ms\", \"251 ms\", \"0 ms\"], correctChoice: 1, feedback: \"The valid range includes 250 ms; 251 ms exceeds it and must stop and disarm the controller.\" },\n predict: { question: \"A lower sample ID arrives with age zero; how should the controller respond?\", choices: [\"Treat it as two clear samples\", \"Ignore its identity and move\", \"Stop because the identity moved backwards\"], correctChoice: 2, feedback: \"Freshness does not repair an out-of-order sample identity; both validity requirements must hold.\" },\n explain: { question: \"Why check observation age while the preview still animates?\", choices: [\"Rendering can continue while sensor evidence becomes stale\", \"Animation guarantees fresh observations\", \"Only stopped robots need sensors\"], correctChoice: 0, feedback: \"The display and the observation stream are separate, so visible animation cannot prove that control data is current.\" },\n },\n },\n {\n title: \"Try again deliberately\", concepts: [\"Enable edges\", \"Recovery\", \"State reset\"],\n goals: [\"Require a fresh safe enable after interruption or exhausted turns.\", \"Reset one attempt coherently without erasing the learner's saved work.\"],\n extension: \"Draw the difference between clearing a bumper and asking the rover to explore again. Include a held enable and the later release/new-enable action.\",\n activities: {\n learn: [\"Detect rising=enabled&&!wasEnabled and update wasEnabled on every observation. A safe rising edge arms in halted mode, clears attempts and clearance, and emits a stop for that observation. Fault clearance, a held enable and completed turns do not create new permission.\", \"Disabling, stop, bumper and invalid observations clear armed immediately. Three unsuccessful turns also leave it disarmed.\"],\n predict: [\"After a bumper event, clear the bumper while enable remains true. Predict the result, then release and enable with valid fresh distance. Identify which observation resets attempts and which later observations can confirm clearance.\", \"The new enable observation begins from halted and stopped; it does not jump directly into movement.\"],\n build: [\"Add the explicit arming path before the state machine. On a safe edge initialise halted state and counters, stop and return. After the third unsuccessful turn, remain stopped; permit no new automatic turn until a fresh safe edge begins another attempt.\", \"Keep accepted sample history coherent across attempts so an old ID cannot masquerade as a new observation.\"],\n run: [\"Use keyboard and onscreen controls through start, obstacle, bumper, clearance, release and new enable. Repeat after exhausted turns and after watchdog expiry. Read the waiting reason at each stopped stage.\", \"The next required action should be stated in text instead of leaving apparently unresponsive controls unexplained.\"],\n assess: [\"Check held-enable interruption, deliberate recovery, stale input on a new edge, counter reset and the initially stopped arming observation. Repeated identical enable values must never create extra attempts.\", \"A request to begin is necessary but does not override unsafe current observations.\"],\n inspect: [\"If the rover resumes immediately on clearance, inspect rising versus enabled. If it cannot start after a release, inspect wasEnabled updates in stopped branches. If attempts remain exhausted, inspect the arming reset as one coherent transition.\", \"Trace permission separately from mode; a halted but armed rover and a disarmed rover have different next actions.\"],\n fix: [\"Repair recovery and run the full interrupted timeline. Confirm a fresh safe enable works, while a fresh enable during an active fault remains stopped and needs another deliberate edge after the fault clears.\", \"Update input history even when permission is refused, preventing a held unsafe request from later becoming an accidental start.\"],\n explain: [\"Choose why clearing a fault and starting another attempt are separate actions. Explain why resetting simulator state does not mean deleting course progress or named saves.\", \"Control state belongs to the current attempt; saved source and earned learning progress have a different lifetime.\"],\n reward: [\"Save Deliberate recovery. Your rover now communicates why it is waiting and how to begin again. The final mission combines distance, state, bounded turns and recovery on a complete exploration course.\", \"Keep a stopped recovery trace beside a successful journey for the final assessment.\"],\n },\n questions: {\n learn: { question: \"What output belongs to a successful fresh arming observation?\", choices: [\"Maximum forward motion\", \"An immediate repeated turn\", \"A stop with reset halted state\"], correctChoice: 2, feedback: \"Arming establishes a fresh attempt but emits a stopped observation before subsequent state-machine movement.\" },\n predict: { question: \"A bumper clears while enable remains held; what happens next?\", choices: [\"The rover waits for release and a new safe enable\", \"The old movement resumes\", \"The turn counter increases forever\"], correctChoice: 0, feedback: \"Fault clearance removes one barrier but supplies no fresh enable edge, so the interrupted rover stays disarmed.\" },\n explain: { question: \"Why update enable history while a fault blocks starting?\", choices: [\"To erase sensor history\", \"To avoid turning a held unsafe request into a later automatic start\", \"To ignore future enable changes\"], correctChoice: 1, feedback: \"Recording the held value prevents fault clearance from being misread as a new user invitation.\" },\n },\n },\n {\n title: \"The exploration course\", concepts: [\"Integration\", \"Arrival\", \"Evidence and limitations\"],\n goals: [\"Complete a simulated route with a clear stopped arrival state.\", \"Explain successful, blocked and interrupted journeys using the actual control trace.\"],\n extension: \"Design a route where a left-turn strategy gets stuck and keep the stopped result. Explain what extra sensing or planning another design would need rather than weakening the attempt limit.\",\n activities: {\n learn: [\"The finished controller reads inputs, updates enable history, validates observations, applies stop and goal, recognises safe arming, then runs one bounded state transition. goal is supplied on arrival and stops and disarms before any movement; it cannot directly award learning completion.\", \"This simple left-turn strategy succeeds on the supplied practice routes, not on every maze or real-world obstacle.\"],\n predict: [\"Predict a goal observation arriving at the same time as a new enable and confirmed clearance. Compare a persistent blocked route with a reachable one. Identify the legitimate terminal behaviour in each case.\", \"Goal and safety guards precede arming and movement; a route need not succeed to produce a correct safe outcome.\"],\n build: [\"Combine the verified distance, clearance, timed-turn, watchdog and recovery helpers. Add goal priority and preserve the motor bounds. Keep one readable decision order and ensure every stopped branch returns before another command.\", \"Avoid separate copies of safety checks in each movement mode; one shared guard prevents them drifting.\"],\n run: [\"Explore the complete course with keyboard controls and repeat using onscreen controls. Reach the goal, interrupt a turn and try a blocked route. Compare state, distance, sample age, attempts and path text with reduced motion enabled.\", \"The trace and status text must explain the journey without requiring continuous animation or colour recognition.\"],\n assess: [\"Run the final saved-source checks across reachable routes, persistent obstacles, noisy boundaries, duplicate data, stale sensors, simultaneous goal and stop, and fresh restart. Completion requires the integrated controller, not just visiting this lesson.\", \"The assessment executes the saved current source; save changes before expecting them to alter the result.\"],\n inspect: [\"Locate the earliest wrong transition and classify it as permission, observation, state, timing or output. Compare a failing route with a passing trace and select a focused change that explains both.\", \"A correct final stopped picture can hide an earlier incorrect command; inspect the full sequence.\"],\n fix: [\"Repair that decision and replay its scenario plus a complete normal route. Save and assess the corrected source. Keep a named final version before extending the strategy or changing the course layout.\", \"A later experiment may fail without removing already earned completion, but its new source still needs its own evidence.\"],\n explain: [\"Choose what the final assessment establishes and describe a limitation of the supplied observation model. Explain why the free account-bound simulator does not grant access to physical motors or replace separate guardian protections.\", \"Distinguish demonstrated programme behaviour from claims about equipment or environments you have not tested.\"],\n reward: [\"Save Exploration controller and finish the final assessment. You have built an observable rover with bounded decisions and deliberate recovery. Replay a mission or compare another route while keeping your earned progress and tested project.\", \"Use the final trace as the starting point for future design changes, including cases where stopping is the correct result.\"],\n },\n questions: {\n learn: { question: \"Where should the goal stop be checked in the controller?\", choices: [\"After every movement command\", \"Before arming and movement decisions\", \"Only after a long turn finishes\"], correctChoice: 1, feedback: \"Arrival must stop and disarm before another action can command movement or grant fresh permission.\" },\n predict: { question: \"What is correct after three unsuccessful turns on a blocked route?\", choices: [\"A fourth automatic attempt\", \"A claim that every maze is solved\", \"A stopped state awaiting deliberate recovery\"], correctChoice: 2, feedback: \"The strategy has a bounded failure outcome, so persistent obstruction leads to a clear stopped state instead of endless attempts.\" },\n explain: { question: \"What does the final assessment provide evidence for?\", choices: [\"The saved controller's documented simulated behaviour\", \"Guaranteed performance with any real sensor\", \"Automatic permission to drive physical hardware\"], correctChoice: 0, feedback: \"Its evidence applies to the saved source and documented simulated scenarios, with physical operation requiring separate protections and verification.\" },\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"],"mappings":"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","names":["course","course","practice"]}