@plasius/learning 0.2.8 → 0.2.9

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.
package/dist/index.js CHANGED
@@ -1079,6 +1079,112 @@ function validateMissionAuthoringBundle(bundle, module2) {
1079
1079
  );
1080
1080
  }
1081
1081
  }
1082
+ if (learner.functionReference) {
1083
+ const functionIds = new Set(
1084
+ learner.functionReference.map((entry) => entry.id)
1085
+ );
1086
+ const invalidFunctionReference = functionIds.size !== learner.functionReference.length || learner.functionReference.length === 0 || learner.functionReference.some((entry) => {
1087
+ const parameterNames = new Set(
1088
+ entry.parameters.map((parameter) => parameter.name)
1089
+ );
1090
+ return entry.id.trim().length === 0 || entry.signature.trim().length === 0 || entry.summary.trim().length === 0 || entry.effect.trim().length === 0 || entry.example.trim().length === 0 || parameterNames.size !== entry.parameters.length || entry.parameters.some(
1091
+ (parameter) => parameter.name.trim().length === 0 || parameter.type.trim().length === 0 || parameter.description.trim().length === 0
1092
+ );
1093
+ });
1094
+ if (invalidFunctionReference) {
1095
+ issues.push(
1096
+ authoringIssue(
1097
+ "invalid-function-reference",
1098
+ "Function references require unique IDs, signatures, parameters, effects and examples.",
1099
+ "learner.functionReference"
1100
+ )
1101
+ );
1102
+ }
1103
+ }
1104
+ const hardware = bundle.hardware;
1105
+ if (hardware) {
1106
+ if (module2.category !== "robot" || module2.hardware.mode !== "physical-first" || !module2.hardware.simulatorAvailable) {
1107
+ issues.push(
1108
+ authoringIssue(
1109
+ "hardware-module-mismatch",
1110
+ "Mission hardware disclosure requires a simulator-backed physical robot module.",
1111
+ "hardware"
1112
+ )
1113
+ );
1114
+ }
1115
+ if (hardware.requirementsVersion !== module2.hardware.requirementsVersion) {
1116
+ issues.push(
1117
+ authoringIssue(
1118
+ "hardware-requirements-version-mismatch",
1119
+ `Hardware disclosure ${hardware.requirementsVersion} does not match catalog requirements ${module2.hardware.requirementsVersion}.`,
1120
+ "hardware.requirementsVersion"
1121
+ )
1122
+ );
1123
+ }
1124
+ const catalogHardwareById = new Map(
1125
+ module2.hardware.items.map((item) => [item.id, item])
1126
+ );
1127
+ const completePathIds = new Set(hardware.completePathItemIds);
1128
+ const incrementalIds = new Set(hardware.incrementalItemIds);
1129
+ const componentIds = new Set(hardware.components.map((component) => component.itemId));
1130
+ const catalogIds = new Set(catalogHardwareById.keys());
1131
+ const hasDuplicateHardwareIds = completePathIds.size !== hardware.completePathItemIds.length || incrementalIds.size !== hardware.incrementalItemIds.length || componentIds.size !== hardware.components.length;
1132
+ const hasUnknownOrMissingItems = hasDuplicateHardwareIds || completePathIds.size !== catalogIds.size || componentIds.size !== catalogIds.size || [...catalogIds].some(
1133
+ (itemId) => !completePathIds.has(itemId) || !componentIds.has(itemId)
1134
+ ) || [...incrementalIds].some((itemId) => !catalogIds.has(itemId));
1135
+ const hasMismatchedComponent = hardware.components.some((component) => {
1136
+ const catalogItem = catalogHardwareById.get(component.itemId);
1137
+ const expectedScope = incrementalIds.has(component.itemId) ? "incremental" : "complete-path";
1138
+ return !catalogItem || component.quantity !== catalogItem.quantity || component.acquisitionScope !== expectedScope;
1139
+ });
1140
+ if (hasUnknownOrMissingItems || hasMismatchedComponent) {
1141
+ issues.push(
1142
+ authoringIssue(
1143
+ "hardware-item-mismatch",
1144
+ "Complete, incremental and per-component hardware disclosures must match the immutable catalog manifest.",
1145
+ "hardware.components"
1146
+ )
1147
+ );
1148
+ }
1149
+ if (hardware.components.some(
1150
+ (component) => component.verificationStatus !== "verified" && component.compatibilityClaimed
1151
+ ) || module2.hardware.verificationStatus !== "verified" && !module2.hardware.publicSaleBlocked) {
1152
+ issues.push(
1153
+ authoringIssue(
1154
+ "hardware-verification-claim",
1155
+ "Unverified hardware cannot claim compatibility or unblock public physical sale.",
1156
+ "hardware.components"
1157
+ )
1158
+ );
1159
+ }
1160
+ const safeguards = hardware.safeguards;
1161
+ if (safeguards.adultAssemblyRequired !== true || safeguards.adultAcknowledgementRequiredForExport !== true || safeguards.websiteMayControlHardware !== false || safeguards.simulatorCompletionAvailable !== true || safeguards.physicalBadgeRequiresAdultSignoff !== true || safeguards.adultAssemblySteps.length === 0 || safeguards.powerRequirements.length === 0 || safeguards.cableRequirements.length === 0 || safeguards.softwarePrerequisites.length === 0 || safeguards.warnings.length === 0 || hardware.components.some(
1162
+ (component) => component.physicalCompletionEligible && (component.verificationStatus !== "verified" || module2.hardware.verificationStatus !== "verified")
1163
+ )) {
1164
+ issues.push(
1165
+ authoringIssue(
1166
+ "unsafe-physical-export",
1167
+ "Physical export and completion require adult acknowledgement, verified hardware and a website that never controls hardware.",
1168
+ "hardware.safeguards"
1169
+ )
1170
+ );
1171
+ }
1172
+ const simulatedBadge = module2.badges.find(
1173
+ (badge) => badge.id === safeguards.simulatedBadgeId
1174
+ );
1175
+ const physicalBadge = module2.badges.find(
1176
+ (badge) => badge.id === safeguards.physicalBadgeId
1177
+ );
1178
+ if (simulatedBadge?.evidence === "adult-physical-signoff" || physicalBadge?.evidence !== "adult-physical-signoff") {
1179
+ issues.push(
1180
+ authoringIssue(
1181
+ "invalid-hardware-reward",
1182
+ "Simulated and physical badges must be distinct, and only the physical badge may require adult sign-off.",
1183
+ "hardware.safeguards"
1184
+ )
1185
+ );
1186
+ }
1187
+ }
1082
1188
  return issues;
1083
1189
  }
1084
1190
  function assertValidMissionAuthoringBundle(bundle, module2) {
@@ -2182,6 +2288,393 @@ var STAR_DEFENDER_SQUADRON_MISSION_ONE_AUTHORING_V1 = {
2182
2288
  ]
2183
2289
  }
2184
2290
  };
2291
+ var BEACON_BOT_MISSION_ONE_AUTHORING_V1 = {
2292
+ version: MISSION_AUTHORING_CONTRACT_VERSION_V1,
2293
+ moduleId: "junior-coder.beacon-bot",
2294
+ moduleVersion: "1.1.0",
2295
+ missionId: "beacon-bot-mission-1",
2296
+ learner: {
2297
+ estimatedMinutes: 20,
2298
+ stages: [
2299
+ {
2300
+ kind: "learn",
2301
+ instruction: "Read what setVisibleSignal(), waitMs(), repeatSignal() and readIrReceiver() do in the private Beacon Bot simulator.",
2302
+ artifactIds: ["beacon-bot-m1-art"]
2303
+ },
2304
+ {
2305
+ kind: "predict",
2306
+ instruction: "Predict the visible signal order, elapsed time and simulated IR reading before the sequence runs.",
2307
+ artifactIds: []
2308
+ },
2309
+ {
2310
+ kind: "build",
2311
+ instruction: "Adjust the four documented C++-style calls to create one bounded rescue signal.",
2312
+ artifactIds: ["beacon-bot-m1-code"]
2313
+ },
2314
+ {
2315
+ kind: "run",
2316
+ instruction: "Use the Run action button to start the private Beacon Bot simulator.",
2317
+ artifactIds: ["beacon-bot-m1-code"]
2318
+ },
2319
+ {
2320
+ kind: "assess",
2321
+ instruction: "Run the visible and protected deterministic beacon checks.",
2322
+ artifactIds: []
2323
+ },
2324
+ {
2325
+ kind: "inspect",
2326
+ instruction: "Compare the highlighted C++-style line with the first signal goal that did not pass.",
2327
+ artifactIds: []
2328
+ },
2329
+ {
2330
+ kind: "fix",
2331
+ instruction: "Change one signal, wait, repeat or simulated IR setting, then rerun and inspect the text telemetry.",
2332
+ artifactIds: ["beacon-bot-m1-code"]
2333
+ },
2334
+ {
2335
+ kind: "explain",
2336
+ instruction: "Explain how the function calls created a timed signal and how the simulated receiver changed the result.",
2337
+ artifactIds: []
2338
+ },
2339
+ {
2340
+ kind: "reward",
2341
+ instruction: "Collect the simulated badge when the score and private-runtime safety check pass; physical completion remains adult-only.",
2342
+ artifactIds: []
2343
+ }
2344
+ ],
2345
+ readinessChecks: [
2346
+ {
2347
+ id: "beacon-bot-m1-find-wait",
2348
+ prompt: "Point to the documented call that controls how long a visible signal stays on.",
2349
+ scored: false
2350
+ }
2351
+ ],
2352
+ artifacts: [
2353
+ {
2354
+ id: "beacon-bot-m1-code",
2355
+ kind: "starter-code",
2356
+ audience: "learner",
2357
+ solutionBearing: false
2358
+ },
2359
+ {
2360
+ id: "beacon-bot-m1-art",
2361
+ kind: "starter-assets",
2362
+ audience: "learner",
2363
+ solutionBearing: false
2364
+ },
2365
+ {
2366
+ id: "beacon-bot-m1-printable",
2367
+ kind: "printable",
2368
+ audience: "learner",
2369
+ solutionBearing: false
2370
+ }
2371
+ ],
2372
+ goals: [
2373
+ {
2374
+ id: "beacon-bot-m1-starts",
2375
+ statement: "The documented C++-style settings are valid and the private simulator starts.",
2376
+ visibility: "visible",
2377
+ criterionIds: ["beacon-bot-build"],
2378
+ completionRequired: true,
2379
+ aiRequired: false
2380
+ },
2381
+ {
2382
+ id: "beacon-bot-m1-signal-sequence",
2383
+ statement: "The beacon produces a bounded timed pattern and reports one simulated IR receiver state.",
2384
+ visibility: "visible",
2385
+ criterionIds: ["beacon-bot-goal-one", "beacon-bot-goal-two"],
2386
+ completionRequired: true,
2387
+ aiRequired: false
2388
+ },
2389
+ {
2390
+ id: "beacon-bot-m1-private-runtime",
2391
+ statement: "The program stays inside the private simulator and never accesses physical hardware, the network or browser storage.",
2392
+ visibility: "visible",
2393
+ criterionIds: ["beacon-bot-safety"],
2394
+ completionRequired: true,
2395
+ aiRequired: false
2396
+ }
2397
+ ],
2398
+ interactions: [
2399
+ {
2400
+ id: "beacon-bot-m1-run-control",
2401
+ description: "Start the private Beacon Bot signal simulation.",
2402
+ primaryMode: "pointer",
2403
+ alternativeIds: ["beacon-bot-m1-keyboard-run"]
2404
+ },
2405
+ {
2406
+ id: "beacon-bot-m1-code-control",
2407
+ description: "Edit the documented signal, timing, repeat and receiver calls.",
2408
+ primaryMode: "keyboard",
2409
+ alternativeIds: []
2410
+ },
2411
+ {
2412
+ id: "beacon-bot-m1-signal-colour",
2413
+ description: "Observe the visible rescue signal without relying on colour alone.",
2414
+ primaryMode: "colour",
2415
+ alternativeIds: ["beacon-bot-m1-signal-telemetry"]
2416
+ },
2417
+ {
2418
+ id: "beacon-bot-m1-signal-motion",
2419
+ description: "Observe the bounded signal sequence and receiver state changes.",
2420
+ primaryMode: "motion",
2421
+ alternativeIds: ["beacon-bot-m1-signal-telemetry"]
2422
+ }
2423
+ ],
2424
+ accessibilityAlternatives: [
2425
+ {
2426
+ id: "beacon-bot-m1-keyboard-run",
2427
+ modes: ["keyboard"],
2428
+ equivalentOutcome: true,
2429
+ description: "Press Enter or Space on the play-icon Run button to start the same simulator."
2430
+ },
2431
+ {
2432
+ id: "beacon-bot-m1-signal-telemetry",
2433
+ modes: ["text", "shape", "symbol", "reduced-motion"],
2434
+ equivalentOutcome: true,
2435
+ description: "Read the signal name, step count, elapsed milliseconds and receiver state without colour or animation."
2436
+ }
2437
+ ],
2438
+ evidenceRequirements: [
2439
+ {
2440
+ id: "beacon-bot-m1-assessment",
2441
+ goalIds: [
2442
+ "beacon-bot-m1-starts",
2443
+ "beacon-bot-m1-signal-sequence",
2444
+ "beacon-bot-m1-private-runtime"
2445
+ ],
2446
+ kind: "assessment-result",
2447
+ retention: "entitlement",
2448
+ containsPersonalData: false
2449
+ },
2450
+ {
2451
+ id: "beacon-bot-m1-explanation",
2452
+ goalIds: ["beacon-bot-m1-signal-sequence"],
2453
+ kind: "learner-explanation",
2454
+ retention: "attempt",
2455
+ containsPersonalData: false
2456
+ }
2457
+ ],
2458
+ sideAdventures: [
2459
+ {
2460
+ id: "beacon-bot-m1-remix",
2461
+ prompt: "Invent an original rescue-signal name and describe a text or shape cue that makes it understandable without colour.",
2462
+ completionRequired: false
2463
+ }
2464
+ ],
2465
+ rewardBindings: [
2466
+ {
2467
+ id: "beacon-bot-m1-simulated-badge",
2468
+ badgeId: "beacon-bot-mission-complete",
2469
+ goalIds: [
2470
+ "beacon-bot-m1-starts",
2471
+ "beacon-bot-m1-signal-sequence",
2472
+ "beacon-bot-m1-private-runtime"
2473
+ ],
2474
+ deterministic: true,
2475
+ random: false,
2476
+ tokenConvertible: false
2477
+ }
2478
+ ],
2479
+ functionReference: [
2480
+ {
2481
+ id: "beacon-bot-function-visible-signal",
2482
+ signature: "setVisibleSignal(colour)",
2483
+ summary: "Chooses the named visible signal used by the next bounded step.",
2484
+ parameters: [
2485
+ {
2486
+ name: "colour",
2487
+ type: "string",
2488
+ description: "Use red, amber or green."
2489
+ }
2490
+ ],
2491
+ effect: "Updates the simulator's labelled light and equivalent shape cue without accessing a physical LED.",
2492
+ example: 'setVisibleSignal("green");'
2493
+ },
2494
+ {
2495
+ id: "beacon-bot-function-wait",
2496
+ signature: "waitMs(duration)",
2497
+ summary: "Adds one safe wait to the simulated signal timeline.",
2498
+ parameters: [
2499
+ {
2500
+ name: "duration",
2501
+ type: "whole number",
2502
+ description: "A bounded number of milliseconds from 100 to 1000."
2503
+ }
2504
+ ],
2505
+ effect: "Advances simulated elapsed time; it never blocks the website or controls hardware.",
2506
+ example: "waitMs(250);"
2507
+ },
2508
+ {
2509
+ id: "beacon-bot-function-repeat",
2510
+ signature: "repeatSignal(count)",
2511
+ summary: "Repeats the current visible signal a safe number of times.",
2512
+ parameters: [
2513
+ {
2514
+ name: "count",
2515
+ type: "whole number",
2516
+ description: "A bounded repeat count from 1 to 4."
2517
+ }
2518
+ ],
2519
+ effect: "Adds a fixed number of labelled signal steps to the private simulator timeline.",
2520
+ example: "repeatSignal(3);"
2521
+ },
2522
+ {
2523
+ id: "beacon-bot-function-ir-receiver",
2524
+ signature: "readIrReceiver()",
2525
+ summary: "Reads the simulator's fictional infrared receiver state.",
2526
+ parameters: [],
2527
+ effect: "Returns detected or clear from simulator state only; it cannot access a real sensor.",
2528
+ example: "const receiverState = readIrReceiver();"
2529
+ }
2530
+ ]
2531
+ },
2532
+ facilitator: {
2533
+ artifacts: [
2534
+ {
2535
+ id: "beacon-bot-m1-answer-key",
2536
+ kind: "answer-key",
2537
+ audience: "facilitator",
2538
+ solutionBearing: true
2539
+ },
2540
+ {
2541
+ id: "beacon-bot-m1-protected-tests",
2542
+ kind: "protected-test",
2543
+ audience: "facilitator",
2544
+ solutionBearing: true
2545
+ },
2546
+ {
2547
+ id: "beacon-bot-m1-adult-hardware-guide",
2548
+ kind: "facilitator-note",
2549
+ audience: "facilitator",
2550
+ solutionBearing: true
2551
+ }
2552
+ ],
2553
+ protectedGoals: [
2554
+ {
2555
+ id: "beacon-bot-m1-protected-resilience",
2556
+ statement: "The simulator rejects unsupported signals, excessive waits or repeats and any hardware, network or storage request.",
2557
+ visibility: "protected",
2558
+ criterionIds: ["beacon-bot-edge-one", "beacon-bot-edge-two"],
2559
+ completionRequired: false,
2560
+ aiRequired: false
2561
+ }
2562
+ ],
2563
+ prompts: [
2564
+ "Ask the learner to predict the labelled signal timeline before suggesting one bounded change.",
2565
+ "Use the function reference and visible telemetry; never provide wiring or physical power advice to a learner.",
2566
+ "Physical export stays unavailable until an adult acknowledges the exact manifest and every component has verified bench-test evidence."
2567
+ ]
2568
+ },
2569
+ hardware: {
2570
+ requirementsVersion: "1.0.0",
2571
+ hardwareIncluded: false,
2572
+ completePathItemIds: [
2573
+ "pico-2-w",
2574
+ "breadboard",
2575
+ "usb-data-cable",
2576
+ "jumper-wires",
2577
+ "led-pack",
2578
+ "led-resistors",
2579
+ "ir-pair"
2580
+ ],
2581
+ incrementalItemIds: ["led-pack", "led-resistors", "ir-pair"],
2582
+ components: [
2583
+ {
2584
+ itemId: "pico-2-w",
2585
+ quantity: 1,
2586
+ acquisitionScope: "complete-path",
2587
+ verificationStatus: "pending-bench-test",
2588
+ compatibilityClaimed: false,
2589
+ physicalCompletionEligible: false
2590
+ },
2591
+ {
2592
+ itemId: "breadboard",
2593
+ quantity: 1,
2594
+ acquisitionScope: "complete-path",
2595
+ verificationStatus: "pending-bench-test",
2596
+ compatibilityClaimed: false,
2597
+ physicalCompletionEligible: false
2598
+ },
2599
+ {
2600
+ itemId: "usb-data-cable",
2601
+ quantity: 1,
2602
+ acquisitionScope: "complete-path",
2603
+ verificationStatus: "pending-bench-test",
2604
+ compatibilityClaimed: false,
2605
+ physicalCompletionEligible: false
2606
+ },
2607
+ {
2608
+ itemId: "jumper-wires",
2609
+ quantity: 12,
2610
+ acquisitionScope: "complete-path",
2611
+ verificationStatus: "pending-bench-test",
2612
+ compatibilityClaimed: false,
2613
+ physicalCompletionEligible: false
2614
+ },
2615
+ {
2616
+ itemId: "led-pack",
2617
+ quantity: 3,
2618
+ acquisitionScope: "incremental",
2619
+ verificationStatus: "pending-bench-test",
2620
+ compatibilityClaimed: false,
2621
+ physicalCompletionEligible: false
2622
+ },
2623
+ {
2624
+ itemId: "led-resistors",
2625
+ quantity: 3,
2626
+ acquisitionScope: "incremental",
2627
+ verificationStatus: "pending-bench-test",
2628
+ compatibilityClaimed: false,
2629
+ physicalCompletionEligible: false
2630
+ },
2631
+ {
2632
+ itemId: "ir-pair",
2633
+ quantity: 1,
2634
+ acquisitionScope: "incremental",
2635
+ verificationStatus: "pending-bench-test",
2636
+ compatibilityClaimed: false,
2637
+ physicalCompletionEligible: false
2638
+ }
2639
+ ],
2640
+ safeguards: {
2641
+ adultAssemblyRequired: true,
2642
+ adultAcknowledgementRequiredForExport: true,
2643
+ websiteMayControlHardware: false,
2644
+ simulatorCompletionAvailable: true,
2645
+ simulatedBadgeId: "beacon-bot-mission-complete",
2646
+ physicalBadgeId: "beacon-bot-physical-builder",
2647
+ physicalBadgeRequiresAdultSignoff: true,
2648
+ adultAssemblySteps: [
2649
+ "Confirm every exact component identity against the requirements manifest.",
2650
+ "Assemble and inspect the disconnected breadboard circuit before learner use.",
2651
+ "Run known-good recovery firmware and complete the adult bench-test record."
2652
+ ],
2653
+ powerRequirements: [
2654
+ "Use Pico USB power only for the published Beacon Bot reference circuit.",
2655
+ "Disconnect USB power before changing any wiring."
2656
+ ],
2657
+ cableRequirements: [
2658
+ "One known data-capable USB cable compatible with the Pico 2 W.",
2659
+ "Insulated male-to-male breadboard jumper wires matching the manifest quantity."
2660
+ ],
2661
+ softwarePrerequisites: [
2662
+ "Supported Pico SDK toolchain on Raspberry Pi OS or a documented desktop environment.",
2663
+ "Known-good Beacon Bot recovery firmware prepared by an adult."
2664
+ ],
2665
+ warnings: [
2666
+ "Hardware is not included with the module.",
2667
+ "No listed component currently claims compatibility or physical-completion eligibility.",
2668
+ "The simulator and simulated badge remain available without physical equipment."
2669
+ ],
2670
+ unrelatedHardwareNotRequired: [
2671
+ "Camera Module 3",
2672
+ "motor driver or motors",
2673
+ "servo"
2674
+ ]
2675
+ }
2676
+ }
2677
+ };
2185
2678
  var RESCUE_CREW_COMMANDER_MISSION_ONE_AUTHORING_V1 = {
2186
2679
  version: MISSION_AUTHORING_CONTRACT_VERSION_V1,
2187
2680
  moduleId: "junior-coder.rescue-crew-commander",
@@ -2976,6 +3469,7 @@ function assertValidLearningPath(path) {
2976
3469
  ${summary}`);
2977
3470
  }
2978
3471
  export {
3472
+ BEACON_BOT_MISSION_ONE_AUTHORING_V1,
2979
3473
  JUNIOR_CODER_MISSION_STAGE_ORDER_V1,
2980
3474
  JUNIOR_CODER_MODULE_PRICE_V1_1,
2981
3475
  JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT,