@thanh01.pmt/curriculum-kit 1.4.40 → 1.4.42

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 (105) hide show
  1. package/dist/ai/index.cjs +31 -31
  2. package/dist/ai/index.cjs.map +1 -1
  3. package/dist/ai/index.mjs +31 -31
  4. package/dist/ai/index.mjs.map +1 -1
  5. package/dist/index.cjs +290 -2027
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +84 -142
  8. package/dist/index.d.ts +84 -142
  9. package/dist/index.mjs +286 -2007
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/pipeline/index.cjs +31 -31
  12. package/dist/pipeline/index.cjs.map +1 -1
  13. package/dist/pipeline/index.mjs +31 -31
  14. package/dist/pipeline/index.mjs.map +1 -1
  15. package/dist/templates/ACT_template.md +58 -0
  16. package/dist/templates/ALIGNMENT_MATRIX_template.md +45 -0
  17. package/dist/templates/ART_DIRECTION_template.md +43 -0
  18. package/dist/templates/ASSET_MANIFEST_template.md +27 -0
  19. package/dist/templates/BASELINE_STANDARD.md +37 -0
  20. package/dist/templates/BELL_RINGER_template.md +108 -0
  21. package/dist/templates/CHANGELOG_template.md +19 -0
  22. package/dist/templates/CHOICE_BOARD_template.md +64 -0
  23. package/dist/templates/CODE_template.md +70 -0
  24. package/dist/templates/CONTENT_CONTINUITY_template.md +38 -0
  25. package/dist/templates/CONTENT_STYLE_GUIDE_template.md +49 -0
  26. package/dist/templates/CURRICULUM_FRAMEWORK_template.md +63 -0
  27. package/dist/templates/DEPENDENCY_MAP_template.md +65 -0
  28. package/dist/templates/EXIT_TICKET_template.md +85 -0
  29. package/dist/templates/EXT_template.md +35 -0
  30. package/dist/templates/GLOSSARY_template.md +108 -0
  31. package/dist/templates/GRAPHIC_ORGANIZER_template.md +100 -0
  32. package/dist/templates/GUIDE_template.md +56 -0
  33. package/dist/templates/HANDOUT_template.md +61 -0
  34. package/dist/templates/HANDOVER_DOCUMENT_template.md +69 -0
  35. package/dist/templates/KNOWLEDGE_EXPOSITION_template.md +56 -0
  36. package/dist/templates/LEARNER_PROFILE_template.md +51 -0
  37. package/dist/templates/LESSONS_LEARNED_template.md +49 -0
  38. package/dist/templates/LESSON_5E_template.md +127 -0
  39. package/dist/templates/LESSON_EDP_template.md +104 -0
  40. package/dist/templates/LESSON_GENERAL_template.md +117 -0
  41. package/dist/templates/OUTPUT_CONSTRAINTS_template.md +38 -0
  42. package/dist/templates/PACKAGING_SPEC_template.md +56 -0
  43. package/dist/templates/PILOT_FEEDBACK_template.md +49 -0
  44. package/dist/templates/PROJECT_BRIEF_template.md +45 -0
  45. package/dist/templates/PROJECT_STATUS_template.md +64 -0
  46. package/dist/templates/QUIZ_template.md +58 -0
  47. package/dist/templates/QUIZ_v4.6_template.md +65 -0
  48. package/dist/templates/REFERENCE_PACK_template.md +26 -0
  49. package/dist/templates/REVIEW_GAME_template.md +79 -0
  50. package/dist/templates/RUBRIC_template.md +54 -0
  51. package/dist/templates/SCIENCE_LAB_template.md +88 -0
  52. package/dist/templates/SLIDE_template.md +389 -0
  53. package/dist/templates/STATION_ROTATION_template.md +80 -0
  54. package/dist/templates/TASK_CARDS_template.md +111 -0
  55. package/dist/templates/TIERED_PRACTICE_template.md +114 -0
  56. package/dist/templates/UPDATE_ROADMAP_template.md +53 -0
  57. package/dist/templates/WKS_template.md +71 -0
  58. package/dist/workflow/index.cjs +99 -79
  59. package/dist/workflow/index.cjs.map +1 -1
  60. package/dist/workflow/index.mjs +97 -77
  61. package/dist/workflow/index.mjs.map +1 -1
  62. package/docs/refs/templates/ACT_template.md +58 -0
  63. package/docs/refs/templates/ALIGNMENT_MATRIX_template.md +45 -0
  64. package/docs/refs/templates/ART_DIRECTION_template.md +43 -0
  65. package/docs/refs/templates/ASSET_MANIFEST_template.md +27 -0
  66. package/docs/refs/templates/BASELINE_STANDARD.md +37 -0
  67. package/docs/refs/templates/BELL_RINGER_template.md +108 -0
  68. package/docs/refs/templates/CHANGELOG_template.md +19 -0
  69. package/docs/refs/templates/CHOICE_BOARD_template.md +64 -0
  70. package/docs/refs/templates/CODE_template.md +70 -0
  71. package/docs/refs/templates/CONTENT_CONTINUITY_template.md +38 -0
  72. package/docs/refs/templates/CONTENT_STYLE_GUIDE_template.md +49 -0
  73. package/docs/refs/templates/CURRICULUM_FRAMEWORK_template.md +63 -0
  74. package/docs/refs/templates/DEPENDENCY_MAP_template.md +65 -0
  75. package/docs/refs/templates/EXIT_TICKET_template.md +85 -0
  76. package/docs/refs/templates/EXT_template.md +35 -0
  77. package/docs/refs/templates/GLOSSARY_template.md +108 -0
  78. package/docs/refs/templates/GRAPHIC_ORGANIZER_template.md +100 -0
  79. package/docs/refs/templates/GUIDE_template.md +56 -0
  80. package/docs/refs/templates/HANDOUT_template.md +61 -0
  81. package/docs/refs/templates/HANDOVER_DOCUMENT_template.md +69 -0
  82. package/docs/refs/templates/KNOWLEDGE_EXPOSITION_template.md +56 -0
  83. package/docs/refs/templates/LEARNER_PROFILE_template.md +51 -0
  84. package/docs/refs/templates/LESSONS_LEARNED_template.md +49 -0
  85. package/docs/refs/templates/LESSON_5E_template.md +127 -0
  86. package/docs/refs/templates/LESSON_EDP_template.md +104 -0
  87. package/docs/refs/templates/LESSON_GENERAL_template.md +117 -0
  88. package/docs/refs/templates/OUTPUT_CONSTRAINTS_template.md +38 -0
  89. package/docs/refs/templates/PACKAGING_SPEC_template.md +56 -0
  90. package/docs/refs/templates/PILOT_FEEDBACK_template.md +49 -0
  91. package/docs/refs/templates/PROJECT_BRIEF_template.md +45 -0
  92. package/docs/refs/templates/PROJECT_STATUS_template.md +64 -0
  93. package/docs/refs/templates/QUIZ_template.md +58 -0
  94. package/docs/refs/templates/QUIZ_v4.6_template.md +65 -0
  95. package/docs/refs/templates/REFERENCE_PACK_template.md +26 -0
  96. package/docs/refs/templates/REVIEW_GAME_template.md +79 -0
  97. package/docs/refs/templates/RUBRIC_template.md +54 -0
  98. package/docs/refs/templates/SCIENCE_LAB_template.md +88 -0
  99. package/docs/refs/templates/SLIDE_template.md +389 -0
  100. package/docs/refs/templates/STATION_ROTATION_template.md +80 -0
  101. package/docs/refs/templates/TASK_CARDS_template.md +111 -0
  102. package/docs/refs/templates/TIERED_PRACTICE_template.md +114 -0
  103. package/docs/refs/templates/UPDATE_ROADMAP_template.md +53 -0
  104. package/docs/refs/templates/WKS_template.md +71 -0
  105. package/package.json +6 -4
package/dist/index.cjs CHANGED
@@ -4204,334 +4204,35 @@ This lab focuses on the practical implementation of core technical concepts, bri
4204
4204
  {{CHECKLIST_ITEMS}}
4205
4205
  `.trim();
4206
4206
 
4207
- // src/templates/handoutTemplate.ts
4208
- var HANDOUT_TEMPLATE = `
4209
- ---
4210
- id: "{{ID}}"
4211
- title: "{{TITLE}}"
4212
- type: "HANDOUT"
4213
- created_by: "Curriculum OS Builder"
4214
- phase: "{{PHASE}}"
4215
- deliverable: "P3-T6"
4216
- version: "{{VERSION}}"
4217
- date: "{{DATE}}"
4218
- ---
4219
-
4220
- # STUDENT HANDOUT: {{TITLE}}
4221
- **Quick-Reference Cheat Sheet & Concept Summary**
4222
-
4223
- > **For Students:** This document summarizes the core concepts and the most important syntax following the **5-Second Rule** (instant look-up). Use it as a quick reference during your lab tasks or projects.
4224
-
4225
- ## \u{1F4D6} 1. Core Concepts
4226
- {{CORE_CONCEPTS_SUMMARY}}
4227
-
4228
- ## \u26A1 2. Common Syntax & Configurations
4229
- | Syntax / Config | Meaning & Function | Example / Snippet |
4230
- | :--- | :--- | :--- |
4231
- {{SYNTAX_TABLE_ROWS}}
4232
-
4233
- ## \u{1F680} 3. General Problem-Solving Procedure
4234
- *Three general thinking steps when tackling problems in this domain:*
4235
- 1. **Step 1 (Input/Trigger):** {{STEP1_TRIGGER}}
4236
- 2. **Step 2 (Logic/Transform):** {{STEP2_LOGIC}}
4237
- 3. **Step 3 (Output/Verify):** {{STEP3_OUTPUT}}
4238
-
4239
- ---
4240
-
4241
- ### \u{1F4A1} Pro-tip
4242
- {{PRO_TIPS}}
4243
- `.trim();
4244
-
4245
- // src/templates/slideTemplate.ts
4246
- var SLIDE_TEMPLATE = `
4247
- ---
4248
- marp: true
4249
- theme: {{THEME}}
4250
- paginate: true
4251
- header: "{{HEADER_TITLE}}"
4252
- footer: "LearnWell Platform | {{LESSON_ID}}"
4253
- ---
4254
-
4255
- # \u{1F680} {{TITLE}}
4256
- ### {{SUBTITLE}}
4257
-
4258
- **Audience:** {{AUDIENCE}}
4259
- **Tech Stack:** {{TECH_STACK}}
4260
- **Estimated Time:** {{DURATION_MINS}} mins
4261
-
4262
- <!--
4263
- Presenter Notes:
4264
- {{TITLE_PRESENTER_NOTES}}
4265
- -->
4266
-
4267
- ---
4268
-
4269
- ## \u{1F5FA}\uFE0F Agenda & Milestone Journey Map
4270
-
4271
- | Time | Stage | Focus Activity |
4272
- |:---:|---|---|
4273
- {{AGENDA_ROWS}}
4274
-
4275
- <!--
4276
- Presenter Notes:
4277
- {{AGENDA_PRESENTER_NOTES}}
4278
- -->
4279
-
4280
- ---
4281
-
4282
- ## \u26A1 Warm-Up & Prior Knowledge Recall
4283
-
4284
- {{WARMUP_CONTENT}}
4285
-
4286
- <!--
4287
- Presenter Notes:
4288
- {{WARMUP_PRESENTER_NOTES}}
4289
- -->
4290
-
4291
- ---
4292
-
4293
- ## \u{1F3AF} Hook Scenario: The Real-World Engineering Challenge
4294
-
4295
- > \u26A0\uFE0F **The Problem / System Failure:**
4296
- > {{HOOK_SCENARIO}}
4297
-
4298
- - **Key Constraint:** {{HOOK_CONSTRAINT}}
4299
- - **Mission Question:** {{HOOK_QUESTION}}
4300
-
4301
- <!--
4302
- Presenter Notes:
4303
- {{HOOK_PRESENTER_NOTES}}
4304
- -->
4305
-
4306
- ---
4307
-
4308
- <!-- [CONCEPT_MICRO_CYCLES_START] -->
4309
- {{CONCEPT_MICRO_CYCLES_SECTION}}
4310
- <!-- [CONCEPT_MICRO_CYCLES_END] -->
4311
-
4312
- ---
4313
-
4314
- ## \u{1F6E0}\uFE0F Integrated Hands-On Lab: Capstone Challenge
4315
-
4316
- ### \u{1F3AF} Mission Goal:
4317
- {{ADVANCED_LAB_GOAL}}
4318
-
4319
- ### 3-Tier Progressive Differentiation:
4320
- - \u{1F949} **Bronze Tier:** {{BRONZE_TASK}}
4321
- - \u{1F948} **Silver Tier:** {{SILVER_TASK}}
4322
- - \u{1F947} **Gold Tier:** {{GOLD_TASK}}
4323
-
4324
- <!--
4325
- Presenter Notes:
4326
- {{ADVANCED_LAB_PRESENTER_NOTES}}
4327
- -->
4328
-
4329
- ---
4330
-
4331
- ## \u{1F6A6} Formative Checkpoint: Traffic Light Assessment
4332
-
4333
- - \u{1F7E2} **Ready to Accelerate:** Solved Bronze + Silver, ready for Gold tier!
4334
- - \u{1F7E1} **Need Quick Help:** Stuck on syntax or compilation error $\rightarrow$ Call assistant / check troubleshooting matrix.
4335
- - \u{1F534} **Blocked:** Concept unclear $\rightarrow$ Step back to Micro-Practice 1.
4336
-
4337
- <!--
4338
- Presenter Notes:
4339
- {{CHECKPOINT_PRESENTER_NOTES}}
4340
- -->
4341
-
4342
- ---
4343
-
4344
- ## \u{1F39F}\uFE0F Exit Ticket & Metacognitive Reflection
4345
-
4346
- 1. **Scenario Question 1:** {{EXIT_Q1}}
4347
- 2. **Scenario Question 2:** {{EXIT_Q2}}
4348
- 3. **Metacognitive Reflection:** {{EXIT_REFLECTION}}
4349
-
4350
- <!--
4351
- Presenter Notes:
4352
- {{EXIT_PRESENTER_NOTES}}
4353
- -->
4354
-
4355
- ---
4356
-
4357
- ## \u{1F3C1} Summary & Key Takeaways
4358
-
4359
- - \u2705 **Rule 1:** {{TAKEAWAY_1}}
4360
- - \u2705 **Rule 2:** {{TAKEAWAY_2}}
4361
- - \u2705 **Rule 3:** {{TAKEAWAY_3}}
4362
-
4363
- \u{1F449} **Next Milestone Preview:** {{NEXT_MILESTONE_PREVIEW}}
4364
- `.trim();
4365
-
4366
- // src/templates/worksheetTemplate.ts
4367
- var WORKSHEET_TEMPLATE = `
4368
- ---
4369
- id: "{{ID}}"
4370
- title: "{{TITLE}}"
4371
- type: "WKS"
4372
- created_by: "Curriculum OS Builder"
4373
- phase: "{{PHASE}}"
4374
- deliverable: "P3-T7"
4375
- version: "{{VERSION}}"
4376
- date: "{{DATE}}"
4377
- ---
4378
-
4379
- # WORKSHEET: {{TITLE}}
4380
-
4381
- **Student Name:** _______________________
4382
- **Class / Cohort:** _______________________
4383
- **Date:** _______________________
4384
-
4385
- > **For Students:** This document guides you step-by-step through practical tasks. Read carefully, fill in the blanks, and check off [x] once completed. If you encounter errors, refer back to your **HANDOUT**.
4386
-
4387
- ## Part 1: Knowledge Check
4388
- {{PART1_KNOWLEDGE_CHECK}}
4389
-
4390
- ## Part 2: Guided Practice (Step-by-Step)
4391
- **Task Objective:** {{PART2_OBJECTIVE}}
4392
-
4393
- {{PART2_STEPS}}
4394
-
4395
- ## Part 3: Reflection / Computational Thinking
4396
- - What is the most critical lesson learned from today's practice?
4397
- ____________________________________________________________________
4398
- - If you wanted to scale this system for 10,000 active users, where do you predict the primary bottleneck will be?
4399
- ____________________________________________________________________
4400
- `.trim();
4401
-
4402
- // src/templates/projectInstructionTemplate.ts
4403
- var PROJECT_INSTRUCTION_TEMPLATE = `
4207
+ // src/templates/quizTemplate.ts
4208
+ var QUIZ_TEMPLATE = `
4404
4209
  ---
4405
4210
  id: "{{ID}}"
4406
4211
  title: "{{TITLE}}"
4407
- type: "INSTRUCTION"
4212
+ type: "QUIZ"
4408
4213
  language: "{{LANGUAGE}}"
4409
- difficulty: "{{DIFFICULTY}}"
4410
- estimated_minutes: {{ESTIMATED_MINUTES}}
4411
- tech_stack: {{TECH_STACK}}
4412
- ---
4413
-
4414
- # \u{1F6E0}\uFE0F {{TITLE}}
4415
-
4416
- > \u23F1\uFE0F **Estimated Duration:** ~{{ESTIMATED_MINUTES}} mins
4417
- > \u{1F3AF} **Difficulty:** {{DIFFICULTY_UPPER}}
4418
- > \u{1F9F0} **Tech Stack:** {{TECH_STACK_STR}}
4419
-
4420
- ---
4421
-
4422
- ## \u{1F4CB} Prerequisites & Tools
4423
- * **Prerequisites:** {{PREREQUISITES}}
4424
- * **Materials & Tools:** {{MATERIALS_AND_TOOLS}}
4425
-
4426
- ---
4427
-
4428
- {{SECTIONS_CONTENT}}
4429
-
4430
- ---
4431
-
4432
- ## \u{1F3C1} Verification Checklist
4433
- {{VERIFICATION_CHECKLIST}}
4434
- `.trim();
4435
-
4436
- // src/templates/rubricTemplate.ts
4437
- var RUBRIC_TEMPLATE = `
4438
- ---
4439
- id: "{{ID}}"
4440
- title: "{{TITLE}}"
4441
- type: "RUBRIC"
4442
- created_by: "Curriculum OS Builder"
4443
- phase: "{{PHASE}}"
4444
- deliverable: "P3-T5"
4445
- version: "{{VERSION}}"
4446
- date: "{{DATE}}"
4447
- template_contract: "artifact-template-v1"
4448
- template_required_sections:
4449
- - "Assessment Overview"
4450
- - "Assessment Rubric"
4451
- ---
4452
-
4453
- # ASSESSMENT: {{TITLE}}
4454
-
4455
- _Milestone: {{MILESTONE_ID}} | Lesson: {{LESSON_ID}}_
4456
-
4457
- ## [REQUIRED] Assessment Overview
4458
- - **Type:** {{ASSESSMENT_TYPE}}
4459
- - **Format:** {{ASSESSMENT_FORMAT}}
4460
- - **Learning Objectives Measured:** {{LEARNING_OBJECTIVES_MEASURED}}
4461
- - **Target Language:** {{TARGET_AUDIENCE_NOTE}}
4462
-
4214
+ total_questions: {{TOTAL_QUESTIONS}}
4215
+ passing_score_pct: {{PASSING_SCORE_PCT}}
4463
4216
  ---
4464
4217
 
4465
- ## [REQUIRED] Assessment Rubric
4466
- _Note for @assessor: Describe SPECIFIC behaviors. Avoid vague words like "good" or "understand."_
4467
-
4468
- | Criteria | Weight | Excellent (4) | Proficient (3) | Developing (2) | Beginning (1) |
4469
- |---|:---:|---|---|---|---|
4470
- {{RUBRIC_TABLE_ROWS}}
4471
-
4472
- ---
4218
+ # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
4473
4219
 
4474
- ## [OPTIONAL] Exit Ticket
4475
- _Used at the end of class for a quick pulse check (Max 3 questions)._
4476
- {{EXIT_TICKET_QUESTIONS}}
4220
+ > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
4221
+ > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
4222
+ > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
4477
4223
 
4478
4224
  ---
4479
4225
 
4480
- ## [OPTIONAL] Student Self-Assessment Checklist
4481
- _Simple language for students to reflect after completing a project._
4482
- {{SELF_ASSESSMENT_CHECKLIST}}
4483
- `.trim();
4226
+ {{QUESTIONS_SECTION}}
4484
4227
 
4485
- // src/templates/guideTemplate.ts
4486
- var TEACHER_GUIDE_TEMPLATE = `
4487
4228
  ---
4488
- id: "{{ID}}"
4489
- title: "{{TITLE}}"
4490
- type: "GUIDE"
4491
- created_by: "Curriculum OS Builder"
4492
- phase: "{{PHASE}}"
4493
- deliverable: "P3-T5"
4494
- version: "{{VERSION}}"
4495
- date: "{{DATE}}"
4496
- ---
4497
-
4498
- # TEACHER GUIDE: {{TITLE}}
4499
- _For Teacher Use Only | Milestone: {{MILESTONE_ID}} | Lesson: {{LESSON_ID}}_
4500
-
4501
- ## 1. Objectives & Preparation
4502
- - **Pedagogical Goal:** {{PEDAGOGICAL_GOAL}}
4503
- - **Common Student Blindspots:** {{COMMON_BLINDSPOTS}}
4504
- - **Technical Checklist:**
4505
- {{TECHNICAL_CHECKLIST}}
4506
-
4507
- ## 2. Teaching Script & Progression
4508
-
4509
- ### Hook / Engage (5-10 minutes)
4510
- - **The Delivery:** {{HOOK_DELIVERY}}
4511
- - **Key Point:** {{HOOK_KEY_POINT}}
4512
-
4513
- ### Explore / Core Concepts (15-20 minutes)
4514
- - **Explanation Strategy:** {{EXPLANATION_STRATEGY}}
4515
- - **Quick Check Questions:**
4516
- {{QUICK_CHECK_QUESTIONS}}
4517
- - **Time Management:** {{TIME_MANAGEMENT_TIPS}}
4518
-
4519
- ### Elaborate / Hands-on Activity (30-45 minutes)
4520
- - **Classroom Management:** {{CLASSROOM_MANAGEMENT}}
4521
- - **Facilitation:** {{FACILITATION_TIPS}}
4522
- - **Pro-tips:** {{PRO_TIPS}}
4523
-
4524
- ### Evaluate / Wrap-up (5-10 minutes)
4525
- - **Exit Ticket Strategy:** {{EXIT_TICKET_STRATEGY}}
4526
- - **Minimum Requirement:** {{MINIMUM_REQUIREMENT}}
4527
4229
 
4528
- ## 3. Troubleshooting & FAQs
4529
- {{TROUBLESHOOTING_FAQS}}
4230
+ ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
4231
+ <details>
4232
+ <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
4530
4233
 
4531
- ## 4. Assessment & Differentiation Tips
4532
- - **Proficient:** {{PROFICIENT_THRESHOLD}}
4533
- - **Advanced:** {{ADVANCED_EXTENSIONS}}
4534
- - **Enrichment Question:** {{ENRICHMENT_QUESTIONS}}
4234
+ {{ANSWER_KEY_SECTION}}
4235
+ </details>
4535
4236
  `.trim();
4536
4237
 
4537
4238
  // src/templates/selfLabTemplate.ts
@@ -4627,1459 +4328,83 @@ tech_stack: {{TECH_STACK}}
4627
4328
  <details>
4628
4329
  <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
4629
4330
 
4630
- {{SILVER_HINT_1}}
4631
- </details>
4632
-
4633
- <details>
4634
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
4635
-
4636
- \`\`\`{{CODE_LANGUAGE}}
4637
- {{SILVER_HINT_2}}
4638
- \`\`\`
4639
- </details>
4640
-
4641
- <details>
4642
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
4643
-
4644
- \`\`\`{{CODE_LANGUAGE}}
4645
- {{SILVER_HINT_3_CODE}}
4646
- \`\`\`
4647
-
4648
- **Why this solution works:**
4649
- {{SILVER_HINT_3_EXPLANATION}}
4650
- </details>
4651
-
4652
- ---
4653
-
4654
- ### \u{1F947} Challenge 3: Edge Cases & Optimization (Gold) \u2014 ~{{GOLD_MINS}} mins
4655
- **Objective:** {{GOLD_OBJECTIVE}}
4656
-
4657
- #### Tasks & Implementation Details:
4658
- {{GOLD_TASKS}}
4659
-
4660
- #### \u{1F9EA} Self-Verification Command:
4661
- \`\`\`bash
4662
- {{GOLD_VERIFY_COMMAND}}
4663
- \`\`\`
4664
- *Expected Terminal Output:*
4665
- \`\`\`text
4666
- {{GOLD_EXPECTED_OUTPUT}}
4667
- \`\`\`
4668
-
4669
- #### \u{1F4A1} Progressive Hints (Expand only if stuck):
4670
- <details>
4671
- <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
4672
-
4673
- {{GOLD_HINT_1}}
4674
- </details>
4675
-
4676
- <details>
4677
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
4678
-
4679
- \`\`\`{{CODE_LANGUAGE}}
4680
- {{GOLD_HINT_2}}
4681
- \`\`\`
4682
- </details>
4683
-
4684
- <details>
4685
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
4686
-
4687
- \`\`\`{{CODE_LANGUAGE}}
4688
- {{GOLD_HINT_3_CODE}}
4689
- \`\`\`
4690
-
4691
- **Why this solution works:**
4692
- {{GOLD_HINT_3_EXPLANATION}}
4693
- </details>
4694
-
4695
- ---
4696
-
4697
- ## \u{1F50D} Self-Learner Troubleshooting Matrix
4698
- | Symptom / Error Message | Root Cause | Exact Fix |
4699
- | :--- | :--- | :--- |
4700
- {{TROUBLESHOOTING_ROWS}}
4701
-
4702
- ---
4703
-
4704
- ## \u{1F3C1} Final Lab Submission & Mastery Checklist
4705
- {{FINAL_CHECKLIST}}
4706
- `.trim();
4707
-
4708
- // src/templates/quizTemplate.ts
4709
- var QUIZ_TEMPLATE = `
4710
- ---
4711
- id: "{{ID}}"
4712
- title: "{{TITLE}}"
4713
- type: "QUIZ"
4714
- language: "{{LANGUAGE}}"
4715
- total_questions: {{TOTAL_QUESTIONS}}
4716
- passing_score_pct: {{PASSING_SCORE_PCT}}
4717
- ---
4718
-
4719
- # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
4720
-
4721
- > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
4722
- > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
4723
- > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
4724
-
4725
- ---
4726
-
4727
- {{QUESTIONS_SECTION}}
4728
-
4729
- ---
4730
-
4731
- ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
4732
- <details>
4733
- <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
4734
-
4735
- {{ANSWER_KEY_SECTION}}
4736
- </details>
4737
- `.trim();
4738
-
4739
- // src/templates/extTemplate.ts
4740
- var EXT_TEMPLATE = `---
4741
- id: "{{ID}}"
4742
- title: "{{TITLE}}"
4743
- type: "EXT"
4744
- created_by: "Curriculum OS Builder"
4745
- phase: "{{PHASE}}"
4746
- deliverable: "P3-T8"
4747
- version: "{{VERSION}}"
4748
- date: "{{DATE}}"
4749
- template_contract: "artifact-template-v1"
4750
- template_required_sections:
4751
- - "Target Mastery & Acceleration"
4752
- - "Challenge 1"
4753
- - "Challenge 2"
4754
- - "Verification Criteria"
4755
- ---
4756
- <!-- INJECT_BODY -->
4757
-
4758
- # EXTENSION CHALLENGES: {{TITLE}}
4759
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Lesson: {{LESSON_ID}}_
4760
-
4761
- ## [REQUIRED] Target Mastery & Acceleration
4762
- > *Designed for advanced learners who have successfully completed the core lesson requirements ahead of schedule.*
4763
-
4764
- ---
4765
-
4766
- ## [REQUIRED] Challenge 1: {{CHALLENGE_1_TITLE}} (Difficulty: \u2B50\u2B50\u2B50)
4767
- - **Problem Statement:** {{CHALLENGE_1_DESCRIPTION}}
4768
- - **Architectural Clues & Hints:**
4769
- {{CHALLENGE_1_HINTS}}
4770
- - **Expected Outcome & Deliverable:** {{CHALLENGE_1_OUTCOME}}
4771
-
4772
- ---
4773
-
4774
- ## [REQUIRED] Challenge 2: {{CHALLENGE_2_TITLE}} (Difficulty: \u2B50\u2B50\u2B50\u2B50)
4775
- - **Problem Statement:** {{CHALLENGE_2_DESCRIPTION}}
4776
- - **Architectural Clues & Hints:**
4777
- {{CHALLENGE_2_HINTS}}
4778
- - **Expected Outcome & Deliverable:** {{CHALLENGE_2_OUTCOME}}
4779
-
4780
- ---
4781
-
4782
- ## [REQUIRED] Verification Criteria
4783
- - [ ] Code passes all extended unit tests.
4784
- - [ ] No regression introduced into core components.
4785
- - [ ] Demonstrates high-order optimization or architectural separation.
4786
- `;
4787
-
4788
- // src/templates/glossaryTemplate.ts
4789
- var GLOSSARY_TEMPLATE = `---
4790
- id: "{{ID}}"
4791
- title: "{{TITLE}}"
4792
- type: "GLOSSARY"
4793
- created_by: "Curriculum OS Builder"
4794
- phase: "{{PHASE}}"
4795
- deliverable: "P3-T9"
4796
- version: "{{VERSION}}"
4797
- date: "{{DATE}}"
4798
- template_contract: "artifact-template-v1"
4799
- template_required_sections:
4800
- - "Core Technical Terminology"
4801
- - "Conceptual Analogies & Non-examples"
4802
- - "Cross-Technology Crosswalk"
4803
- ---
4804
- <!-- INJECT_BODY -->
4805
-
4806
- # TECHNICAL GLOSSARY & VOCABULARY: {{TITLE}}
4807
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Reference Standard: CS2023_
4808
-
4809
- ## [REQUIRED] Core Technical Terminology
4810
-
4811
- | Term / Keyword | Formal Engineering Definition | Code Usage Context | Common Misconception |
4812
- | :--- | :--- | :--- | :--- |
4813
- {{GLOSSARY_TABLE_ROWS}}
4814
-
4815
- ---
4816
-
4817
- ## [REQUIRED] Conceptual Analogies & Non-examples
4818
-
4819
- {{ANALOGY_SECTIONS}}
4820
-
4821
- ---
4822
-
4823
- ## [REQUIRED] Cross-Technology Crosswalk (Neutral vs. Specific)
4824
-
4825
- | Universal Concept (Marr Level 1/2) | Target Language Syntax (Level 3) | Alternative Language Equivalent |
4826
- | :--- | :--- | :--- |
4827
- {{CROSSWALK_ROWS}}
4828
- `;
4829
- var BOM_TEMPLATE = `---
4830
- id: "{{ID}}"
4831
- title: "{{TITLE}}"
4832
- type: "BOM"
4833
- created_by: "Curriculum OS Builder"
4834
- phase: "{{PHASE}}"
4835
- deliverable: "P3-T6"
4836
- version: "{{VERSION}}"
4837
- date: "{{DATE}}"
4838
- template_contract: "artifact-template-v1"
4839
- template_required_sections:
4840
- - "Hardware & Sensor Specification"
4841
- - "Software & Environment Invariants"
4842
- - "Procurement & Safety Requirements"
4843
- ---
4844
- <!-- INJECT_BODY -->
4845
-
4846
- # BILL OF MATERIALS & LAB PREREQUISITES: {{TITLE}}
4847
- _Unit: {{UNIT_ID}} | Target Class Size: {{CLASS_SIZE}} Students_
4848
-
4849
- ## [REQUIRED] Hardware & Sensor Specification
4850
-
4851
- | Item Code | Component Name | Required Qty per Student/Group | Min Spec / Pinout | Alternative Substitute |
4852
- | :--- | :--- | :--- | :--- | :--- |
4853
- {{HARDWARE_BOM_ROWS}}
4854
-
4855
- ---
4856
-
4857
- ## [REQUIRED] Software & Environment Invariants
4858
-
4859
- | Tool / Runtime | Required Version | Licensing / Cost | Fallback Offline Mode |
4860
- | :--- | :--- | :--- | :--- |
4861
- {{SOFTWARE_BOM_ROWS}}
4862
-
4863
- ---
4864
-
4865
- ## [REQUIRED] Procurement & Safety Requirements
4866
- - \u26A0\uFE0F **Voltage & Current Constraints:** {{POWER_CONSTRAINTS}}
4867
- - \u{1F512} **API Quota & Rate Limits:** {{API_LIMITS}}
4868
- `;
4869
-
4870
- // src/templates/exitTicketTemplate.ts
4871
- var EXIT_TICKET_TEMPLATE = `---
4872
- id: "{{ID}}"
4873
- title: "{{TITLE}}"
4874
- type: "EXIT_TICKET"
4875
- created_by: "Curriculum OS Builder"
4876
- phase: "{{PHASE}}"
4877
- deliverable: "P3-T10"
4878
- version: "{{VERSION}}"
4879
- date: "{{DATE}}"
4880
- template_contract: "artifact-template-v1"
4881
- template_required_sections:
4882
- - "Target Learning Objectives"
4883
- - "Recall & Conceptual Anchor"
4884
- - "Application & Bug Hunt"
4885
- - "Metacognitive Reflection & Confidence Check"
4886
- - "Scoring & Teacher Intervention Trigger"
4887
- ---
4888
- <!-- INJECT_BODY -->
4889
-
4890
- # FORMATIVE EXIT TICKET: {{TITLE}}
4891
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Lesson: {{LESSON_ID}} | Estimated Time: 5-7 mins_
4892
-
4893
- ## [REQUIRED] Target Learning Objectives
4894
- - **Target LO 1 (ULO):** {{TARGET_LO_1}}
4895
- - **Target LO 2 (CIO/SIO):** {{TARGET_LO_2}}
4896
-
4897
- ---
4898
-
4899
- ## [REQUIRED] Part 1: Recall & Conceptual Anchor (Prompt 1)
4900
- > *Objective: Test core mental model without allowing rote syntax memorization.*
4901
-
4902
- **Question 1:**
4903
- {{CONCEPTUAL_QUESTION}}
4904
-
4905
- - **Student Answer Area:**
4906
- \`\`\`text
4907
- [Write 1-2 concise sentences explaining the difference in runtime mechanism]
4908
- \`\`\`
4909
-
4910
- ---
4911
-
4912
- ## [REQUIRED] Part 2: Application & Bug Hunt (Prompt 2)
4913
- > *Objective: Test code diagnosis and precise correction in \u2264 3 lines of modification.*
4914
-
4915
- **Code Snippet:**
4916
- \`\`\`{{CODE_LANGUAGE}}
4917
- {{BUGGY_CODE_SNIPPET}}
4918
- \`\`\`
4919
-
4920
- **Task:**
4921
- 1. **Identify the Compiler/Runtime Error:** {{BUG_SYMPTOM_HINT}}
4922
- 2. **Corrected Line:**
4923
- \`\`\`{{CODE_LANGUAGE}}
4924
- {{CORRECTED_CODE_SLOT}}
4925
- \`\`\`
4926
-
4927
- ---
4928
-
4929
- ## [REQUIRED] Part 3: Metacognitive Reflection & Confidence Check (Prompt 3)
4930
- > *Objective: Empower student self-regulation and provide immediate diagnostic signals.*
4931
-
4932
- **Traffic Light Self-Assessment:**
4933
- - [ ] \u{1F7E2} **Green (Mastered):** "I can build and explain this concept to a peer without any hints."
4934
- - [ ] \u{1F7E1} **Yellow (Needs Practice):** "I understand the concept but got stuck on syntax or error messages."
4935
- - [ ] \u{1F534} **Red (Blocked):** "I need help understanding why this architecture is used."
4936
-
4937
- **One Lingering Question (Exit Ticket Note):**
4938
- \`\`\`text
4939
- [What is one question you still have before leaving today's lab?]
4940
- \`\`\`
4941
-
4942
- ---
4943
-
4944
- ## [REQUIRED] Scoring & Teacher Intervention Trigger
4945
- - **Proficiency Threshold:** Green/Yellow check + Correct Answer to Part 2 Bug Hunt.
4946
- - **Intervention Protocol:** {{INTERVENTION_PROTOCOL}}
4947
- `;
4948
-
4949
- // src/templates/tieredPracticeTemplate.ts
4950
- var TIERED_PRACTICE_TEMPLATE = `---
4951
- id: "{{ID}}"
4952
- title: "{{TITLE}}"
4953
- type: "TIERED_PRACTICE"
4954
- created_by: "Curriculum OS Builder"
4955
- phase: "{{PHASE}}"
4956
- deliverable: "P3-T11"
4957
- version: "{{VERSION}}"
4958
- date: "{{DATE}}"
4959
- template_contract: "artifact-template-v1"
4960
- template_required_sections:
4961
- - "Computational Objective & Tier Matrix"
4962
- - "Bronze Tier (Foundational Scaffolding)"
4963
- - "Silver Tier (Independent Application)"
4964
- - "Gold Tier (Enrichment & Optimization)"
4965
- - "Automated Test Verification Matrix"
4966
- - "Answer Key & Mentor Hints"
4967
- ---
4968
- <!-- INJECT_BODY -->
4969
-
4970
- # 3-TIER DIFFERENTIATED PRACTICE LAB: {{TITLE}}
4971
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Lesson: {{LESSON_ID}} | Mode: Adaptive Lab_
4972
-
4973
- ## [REQUIRED] Computational Objective & Tier Matrix
4974
-
4975
- | Tier Level | Cognitive Target (Bloom) | Scaffolding Ratio | Success Criteria |
4976
- | :--- | :--- | :--- | :--- |
4977
- | \u{1F949} **Bronze** | Remember / Understand | **70% Starter Code / 30% Fill-in** | Complete basic syntax & pass Baseline Unit Test. |
4978
- | \u{1F948} **Silver** | Apply / Analyze | **30% Starter Code / 70% Implementation** | Implement business logic, edge-case handling & multi-component binding. |
4979
- | \u{1F947} **Gold** | Evaluate / Create | **0% Code / Open Architecture** | Optimize performance, refactor with concurrency/state isolation & self-author tests. |
4980
-
4981
- ---
4982
-
4983
- ## [REQUIRED] \u{1F949} Bronze Tier: Foundational Scaffolding (Baseline for All)
4984
- - **Target Audience:** All learners (mandatory milestone).
4985
- - **Guiding Prompt:** {{BRONZE_PROMPT}}
4986
-
4987
- ### Starter Code & Fill-in Slots:
4988
- \`\`\`{{CODE_LANGUAGE}}
4989
- {{BRONZE_STARTER_CODE}}
4990
- \`\`\`
4991
-
4992
- - **Verification Check:** Run test \`testBronzeBaseline()\` \u2014 Expect status \`PASS\`.
4993
-
4994
- ---
4995
-
4996
- ## [REQUIRED] \u{1F948} Silver Tier: Independent Application (Target Mastery)
4997
- - **Target Audience:** Learners who completed Bronze without mentor intervention.
4998
- - **Guiding Prompt:** {{SILVER_PROMPT}}
4999
-
5000
- ### Specification & Requirements:
5001
- {{SILVER_SPECIFICATIONS}}
5002
-
5003
- ### Implementation Target:
5004
- \`\`\`{{CODE_LANGUAGE}}
5005
- {{SILVER_IMPLEMENTATION_SLOT}}
5006
- \`\`\`
5007
-
5008
- - **Verification Check:** Run test \`testSilverLogicAndValidation()\` \u2014 Expect status \`PASS\`.
5009
-
5010
- ---
5011
-
5012
- ## [REQUIRED] \u{1F947} Gold Tier: Enrichment & Optimization (Open Extension)
5013
- - **Target Audience:** Advanced learners finished ahead of schedule.
5014
- - **Architectural Challenge:** {{GOLD_CHALLENGE}}
5015
-
5016
- ### Constraints & Invariants:
5017
- {{GOLD_CONSTRAINTS}}
5018
-
5019
- ---
5020
-
5021
- ## [REQUIRED] Automated Test Verification Matrix & Mentor Hints
5022
- \`\`\`{{CODE_LANGUAGE}}
5023
- {{TEST_HARNESS_CODE}}
5024
- \`\`\`
5025
-
5026
- ### Mentor Debugging Cheatsheet:
5027
- {{MENTOR_DEBUG_CHEATSHEET}}
5028
- `;
5029
- var CHOICE_BOARD_TEMPLATE = `---
5030
- id: "{{ID}}"
5031
- title: "{{TITLE}}"
5032
- type: "CHOICE_BOARD"
5033
- created_by: "Curriculum OS Builder"
5034
- phase: "{{PHASE}}"
5035
- deliverable: "P3-T12"
5036
- version: "{{VERSION}}"
5037
- date: "{{DATE}}"
5038
- template_contract: "artifact-template-v1"
5039
- template_required_sections:
5040
- - "Learning Goals & Rule of Choice"
5041
- - "The 9-Square Activity Matrix"
5042
- - "Activity Detailed Blueprints"
5043
- - "Universal Assessment Rubric"
5044
- ---
5045
- <!-- INJECT_BODY -->
5046
-
5047
- # 9-SQUARE CHOICE BOARD: {{TITLE}}
5048
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Target Competency: {{CORE_COMPETENCY}}_
5049
-
5050
- ## [REQUIRED] Learning Goals & Rule of Choice
5051
- - **Core Concept Anchor:** {{CORE_CONCEPT_ANCHOR}}
5052
- - **Rule of Choice (Tic-Tac-Toe / Point Model):**
5053
- - *Option A (Tic-Tac-Toe):* Complete 3 activities in a row (Horizontal, Vertical, or Diagonal).
5054
- - *Option B (Point Balance):* Reach $\\ge 100\\text{ pts}$ (Choose $\\ge 1$ Technical Lab + $\\ge 1$ Explanatory/Visual + $\\ge 1$ Creative Challenge).
5055
-
5056
- ---
5057
-
5058
- ## [REQUIRED] The 9-Square Activity Matrix
5059
-
5060
- | Column 1: Analytical & Code | Column 2: Visual & Architecture | Column 3: Creative & Applied |
5061
- | :--- | :--- | :--- |
5062
- | **Square 1: {{SQ1_TITLE}} ({{SQ1_PTS}} pts)**<br>{{SQ1_DESC}} | **Square 2: {{SQ2_TITLE}} ({{SQ2_PTS}} pts)**<br>{{SQ2_DESC}} | **Square 3: {{SQ3_TITLE}} ({{SQ3_PTS}} pts)**<br>{{SQ3_DESC}} |
5063
- | **Square 4: {{SQ4_TITLE}} ({{SQ4_PTS}} pts)**<br>{{SQ4_DESC}} | **\u2B50 Square 5: {{SQ5_TITLE}} ({{SQ5_PTS}} pts)**<br>{{SQ5_DESC}} | **Square 6: {{SQ6_TITLE}} ({{SQ6_PTS}} pts)**<br>{{SQ6_DESC}} |
5064
- | **Square 7: {{SQ7_TITLE}} ({{SQ7_PTS}} pts)**<br>{{SQ7_DESC}} | **Square 8: {{SQ8_TITLE}} ({{SQ8_PTS}} pts)**<br>{{SQ8_DESC}} | **Square 9: {{SQ9_TITLE}} ({{SQ9_PTS}} pts)**<br>{{SQ9_DESC}} |
5065
-
5066
- ---
5067
-
5068
- ## [REQUIRED] Activity Detailed Blueprints
5069
-
5070
- ### Detail: Square 1 \u2014 {{SQ1_TITLE}}
5071
- {{SQ1_BLUEPRINT}}
5072
-
5073
- ### Detail: Square 2 \u2014 {{SQ2_TITLE}}
5074
- {{SQ2_BLUEPRINT}}
5075
-
5076
- ### Detail: \u2B50 Square 5 \u2014 {{SQ5_TITLE}} (Mandatory Center Option)
5077
- {{SQ5_BLUEPRINT}}
5078
-
5079
- ---
5080
-
5081
- ## [REQUIRED] Universal Assessment Rubric
5082
- | Criteria | Exemplary (4) | Proficient (3) | Developing (2) | Beginning (1) |
5083
- | :--- | :--- | :--- | :--- | :--- |
5084
- | **Technical Accuracy** | 100% executable, idiomatic syntax, zero race conditions. | Compiles and runs; minor non-critical styling issue. | Runs with partial errors or missing edge cases. | Does not compile or contains critical syntax bugs. |
5085
- | **Conceptual Clarity** | Explains architectural trade-offs using rigorous engineering terms. | Explains the "how" accurately with basic rationale. | Description is vague or confuses terminology. | Cannot explain how code works. |
5086
- | **Creativity & Autonomy** | Goes beyond specifications with thoughtful UX or performance optimizations. | Fulfills all specified criteria independently. | Needs significant scaffolding hints to complete. | Incomplete submission. |
5087
- `;
5088
-
5089
- // src/templates/scienceLabTemplate.ts
5090
- var SCIENCE_LAB_TEMPLATE = `---
5091
- id: "{{ID}}"
5092
- title: "{{TITLE}}"
5093
- type: "SCIENCE_LAB"
5094
- created_by: "Curriculum OS Builder"
5095
- phase: "{{PHASE}}"
5096
- deliverable: "P3-T13"
5097
- version: "{{VERSION}}"
5098
- date: "{{DATE}}"
5099
- template_contract: "artifact-template-v1"
5100
- template_required_sections:
5101
- - "Guiding Inquiry & Driving Question"
5102
- - "Hypothesis & Experimental Design"
5103
- - "Data Collection & Code Lab Protocol"
5104
- - "CER Scientific Conclusion (Claim, Evidence, Reasoning)"
5105
- - "Peer Review & Verification Protocol"
5106
- ---
5107
- <!-- INJECT_BODY -->
5108
-
5109
- # STEM / CODE INVESTIGATION LAB (CER): {{TITLE}}
5110
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Domain: {{DOMAIN_NAME}}_
5111
-
5112
- ## [REQUIRED] Guiding Inquiry & Driving Question
5113
- - **Real-World Driving Question:** {{DRIVING_QUESTION}}
5114
- - **Engineering Phenomenon:** {{ENGINEERING_PHENOMENON}}
5115
-
5116
- ---
5117
-
5118
- ## [REQUIRED] Hypothesis & Experimental Design
5119
- - **Student Hypothesis Template:**
5120
- > *"If we [Action / Variable Manipulation], then [Predicted Outcome] because [Scientific / Engineering Rationale]."*
5121
-
5122
- ### Controlled Variables:
5123
- - **Independent Variable (Manipulated):** {{INDEPENDENT_VARIABLE}}
5124
- - **Dependent Variable (Measured):** {{DEPENDENT_VARIABLE}}
5125
- - **Control Variables (Constant):** {{CONTROL_VARIABLES}}
5126
-
5127
- ---
5128
-
5129
- ## [REQUIRED] Data Collection & Code Lab Protocol
5130
-
5131
- ### Lab Setup & Instrumentation Code:
5132
- \`\`\`{{CODE_LANGUAGE}}
5133
- {{BENCHMARK_PROBE_CODE}}
5134
- \`\`\`
5135
-
5136
- ### Data Collection Table:
5137
- | Trial | Variable State | Memory (MB) | Latency (ms) | Error / Anomaly Count |
5138
- | :---: | :--- | :---: | :---: | :---: |
5139
- {{DATA_COLLECTION_ROWS}}
5140
-
5141
- ---
5142
-
5143
- ## [REQUIRED] CER Scientific Conclusion (Claim, Evidence, Reasoning)
5144
-
5145
- ### 1. \u{1F4CC} Claim (Kh\u1EB3ng \u0111\u1ECBnh):
5146
- - *Direct answer to the driving question in 1 concise sentence:*
5147
- \`\`\`text
5148
- [State clear conclusion based on data]
5149
- \`\`\`
5150
-
5151
- ### 2. \u{1F4CA} Evidence (B\u1EB1ng ch\u1EE9ng s\u1ED1 li\u1EC7u):
5152
- - *Specific quantitative data points cited directly from the Data Collection Table:*
5153
- \`\`\`text
5154
- [Cite concrete numerical metrics and trials]
5155
- \`\`\`
5156
-
5157
- ### 3. \u{1F9E0} Reasoning (L\u1EADp lu\u1EADn khoa h\u1ECDc):
5158
- - *Connect the evidence back to the underlying technical principle:*
5159
- \`\`\`text
5160
- [Explain why the runtime/hardware behaved this way]
5161
- \`\`\`
5162
-
5163
- ---
5164
-
5165
- ## [REQUIRED] Peer Review & Verification Protocol
5166
- - **Reproducibility Test:** Exchange code probes with another group to verify if results match within $\\pm 10\\%$ tolerance.
5167
- `;
5168
- var TASK_CARDS_TEMPLATE = `---
5169
- id: "{{ID}}"
5170
- title: "{{TITLE}}"
5171
- type: "TASK_CARDS"
5172
- created_by: "Curriculum OS Builder"
5173
- phase: "{{PHASE}}"
5174
- deliverable: "P3-T14"
5175
- version: "{{VERSION}}"
5176
- date: "{{DATE}}"
5177
- template_contract: "artifact-template-v1"
5178
- template_required_sections:
5179
- - "Deck Overview & Print Instructions"
5180
- - "Task Cards 1 to 4 (Foundational Concepts)"
5181
- - "Task Cards 5 to 8 (Code Diagnosis & Debugging)"
5182
- - "Task Cards 9 to 12 (Application & Synthesis)"
5183
- - "Teacher Answer Key & Scoring Matrix"
5184
- ---
5185
- <!-- INJECT_BODY -->
5186
-
5187
- # PRINTABLE TASK CARDS PACK: {{TITLE}}
5188
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Total Cards: {{CARD_COUNT}} Cards_
5189
-
5190
- ## [REQUIRED] Deck Overview & Print Instructions
5191
- - **Card Format:** 4 cards per page (A4 layout with cutting guidelines and QR code link).
5192
- - **Target Skills:** Conceptual Understanding, Code Tracing, Bug Hunting, Architectural Reasoning.
5193
- - **Scoring System:** Bronze Cards (1 pt), Silver Cards (2 pts), Gold Cards (3 pts).
5194
-
5195
- ---
5196
-
5197
- ## [REQUIRED] Set A: Foundational Concepts (Cards 1\u20134)
5198
- {{TASK_CARDS_SET_A}}
5199
-
5200
- ---
5201
-
5202
- ## [REQUIRED] Set B: Code Diagnosis & Debugging (Cards 5\u20138)
5203
- {{TASK_CARDS_SET_B}}
5204
-
5205
- ---
5206
-
5207
- ## [REQUIRED] Set C: Application & Synthesis (Cards 9\u201312)
5208
- {{TASK_CARDS_SET_C}}
5209
-
5210
- ---
5211
-
5212
- ## [REQUIRED] Teacher Answer Key & Scoring Matrix
5213
- | Card ID | Correct Answer / Solution Blueprint | Max Points |
5214
- | :---: | :--- | :---: |
5215
- {{TASK_CARDS_ANSWER_ROWS}}
5216
- `;
5217
-
5218
- // src/templates/stationRotationTemplate.ts
5219
- var STATION_ROTATION_TEMPLATE = `---
5220
- id: "{{ID}}"
5221
- title: "{{TITLE}}"
5222
- type: "STATION_ROTATION"
5223
- created_by: "Curriculum OS Builder"
5224
- phase: "{{PHASE}}"
5225
- deliverable: "P3-T15"
5226
- version: "{{VERSION}}"
5227
- date: "{{DATE}}"
5228
- template_contract: "artifact-template-v1"
5229
- template_required_sections:
5230
- - "Station Architecture & Timer Overview"
5231
- - "Station 1: Teacher-Led Small Group (Deep Dive)"
5232
- - "Station 2: Collaborative Hands-On Lab (Peer Pair)"
5233
- - "Station 3: Independent Digital Practice (Async Code)"
5234
- - "Station 4: Offline Modeling & Architecture (Whiteboard)"
5235
- - "Station Recording Sheet & Rotation Bell Protocol"
5236
- ---
5237
- <!-- INJECT_BODY -->
5238
-
5239
- # STATION ROTATION LESSON PACK: {{TITLE}}
5240
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Format: 4 Stations x 15 Mins_
5241
-
5242
- ## [REQUIRED] Station Architecture & Timer Overview
5243
- - **Classroom Layout:** 4 designated physical zones with clear signage and materials.
5244
- - **Rotation Time:** 15 minutes per station + 2 minutes clean transition buffer.
5245
- - **Audience Grouping:** Heterogeneous groups of 4-6 students rotating simultaneously.
5246
-
5247
- ---
5248
-
5249
- ## [REQUIRED] Station 1: Teacher-Led Small Group (Guided Inquiry)
5250
- - **Goal:** Direct coaching, conceptual check, and resolving misconceptions in real-time.
5251
- - **Teacher Script & Inquiry Questions:**
5252
- {{STATION_1_GUIDANCE}}
5253
-
5254
- ---
5255
-
5256
- ## [REQUIRED] Station 2: Collaborative Hands-On Lab (Pair Programming)
5257
- - **Goal:** Students work in pairs (Driver / Navigator) to solve a 2-stage challenge.
5258
- - **Task Materials:** {{STATION_2_MATERIALS}}
5259
- - **Success Milestone:** {{STATION_2_MILESTONE}}
5260
-
5261
- ---
5262
-
5263
- ## [REQUIRED] Station 3: Independent Digital Practice (Self-Paced Code Lab)
5264
- - **Goal:** Autonomy and individual mastery verification.
5265
- - **Student Instructions:**
5266
- {{STATION_3_INSTRUCTIONS}}
5267
-
5268
- ---
5269
-
5270
- ## [REQUIRED] Station 4: Offline Modeling & Architecture (No Screens)
5271
- - **Goal:** Cognitive unloading and physical spatial reasoning.
5272
- - **Materials:** Whiteboard markers, physical Task Cards deck, and laminated architecture templates.
5273
- - **Task:** {{STATION_4_TASK}}
5274
-
5275
- ---
5276
-
5277
- ## [REQUIRED] Station Recording Sheet (Student Passport)
5278
- | Station | Task Completed | Signature / Verification Stamp | 1 Key Insight Learned |
5279
- | :---: | :--- | :--- | :--- |
5280
- | **1 (Teacher)** | Debugging Probe Discussion | [Teacher Stamp] | |
5281
- | **2 (Pair Lab)** | Stage 1 & 2 Test Suite | [Peer Signature] | |
5282
- | **3 (Digital)** | Micro-Challenges Token | [Auto Token] | |
5283
- | **4 (Offline)** | Flowchart Diagram Approved | [Mentor Stamp] | |
5284
- `;
5285
- var BELL_RINGER_TEMPLATE = `---
5286
- id: "{{ID}}"
5287
- title: "{{TITLE}}"
5288
- type: "BELL_RINGER"
5289
- created_by: "Curriculum OS Builder"
5290
- phase: "{{PHASE}}"
5291
- deliverable: "P3-T16"
5292
- version: "{{VERSION}}"
5293
- date: "{{DATE}}"
5294
- template_contract: "artifact-template-v1"
5295
- template_required_sections:
5296
- - "Weekly Objective & Schedule"
5297
- - "Monday: Mental Model Recall"
5298
- - "Tuesday: Code Spot-Check"
5299
- - "Wednesday: Bug Hunt & Fix"
5300
- - "Thursday: Architecture Tracing"
5301
- - "Friday: Creative Synthesis & Bridge"
5302
- - "Answer Key & Scoring Guide"
5303
- ---
5304
- <!-- INJECT_BODY -->
5305
-
5306
- # WEEKLY BELL RINGERS (5-DAY WARM-UP PACK): {{TITLE}}
5307
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Time: 3-5 Mins per Session_
5308
-
5309
- ## [REQUIRED] Weekly Objective & Schedule
5310
- - **Weekly Core Theme:** {{WEEKLY_THEME}}
5311
- - **Routine Protocol:** Display prompt on projector immediately as students enter.
5312
-
5313
- ---
5314
-
5315
- ## [REQUIRED] Day 1 (Monday): Mental Model Recall & Analogy
5316
- {{DAY_1_PROMPT}}
5317
-
5318
- ---
5319
-
5320
- ## [REQUIRED] Day 2 (Tuesday): Rapid Code Tracing
5321
- {{DAY_2_PROMPT}}
5322
-
5323
- ---
5324
-
5325
- ## [REQUIRED] Day 3 (Wednesday): Quick Bug Hunt (Spot the Defect)
5326
- {{DAY_3_PROMPT}}
5327
-
5328
- ---
5329
-
5330
- ## [REQUIRED] Day 4 (Thursday): Visual Diagram Tracing
5331
- {{DAY_4_PROMPT}}
5332
-
5333
- ---
5334
-
5335
- ## [REQUIRED] Day 5 (Friday): Creative Synthesis & Bridge Forward
5336
- {{DAY_5_PROMPT}}
5337
-
5338
- ---
5339
-
5340
- ## [REQUIRED] Teacher Answer Key & Scoring Guide
5341
- {{TEACHER_ANSWER_KEY}}
5342
- `;
5343
- var REVIEW_GAME_TEMPLATE = `---
5344
- id: "{{ID}}"
5345
- title: "{{TITLE}}"
5346
- type: "REVIEW_GAME"
5347
- created_by: "Curriculum OS Builder"
5348
- phase: "{{PHASE}}"
5349
- deliverable: "P3-T17"
5350
- version: "{{VERSION}}"
5351
- date: "{{DATE}}"
5352
- template_contract: "artifact-template-v1"
5353
- template_required_sections:
5354
- - "Game Rules & Setup Guide"
5355
- - "Round 1: Speed Round (100-200 Pts)"
5356
- - "Round 2: Code Duel & Debugging (300-400 Pts)"
5357
- - "Round 3: Final Boss Architecture Challenge (500 Pts)"
5358
- - "Kahoot / Quizizz CSV Export Format"
5359
- ---
5360
- <!-- INJECT_BODY -->
5361
-
5362
- # INTERACTIVE REVIEW GAME (QUIZ SHOW PACK): {{TITLE}}
5363
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Format: Live Classroom Quiz Show_
5364
-
5365
- ## [REQUIRED] Game Rules & Setup Guide
5366
- - **Format:** 3 Rounds of progressive difficulty with team buzzers.
5367
- - **Team Size:** 3-5 students per squad.
5368
-
5369
- ---
5370
-
5371
- ## [REQUIRED] Round 1: Rapid-Fire Speed Round (100\u2013200 Points)
5372
- {{ROUND_1_QUESTIONS}}
5373
-
5374
- ---
5375
-
5376
- ## [REQUIRED] Round 2: Code Duel & Debugging (300\u2013400 Points)
5377
- {{ROUND_2_CHALLENGES}}
5378
-
5379
- ---
5380
-
5381
- ## [REQUIRED] Round 3: Final Boss Architecture Challenge (500 Points)
5382
- {{ROUND_3_BOSS_CHALLENGE}}
5383
-
5384
- ---
5385
-
5386
- ## [REQUIRED] Kahoot / Quizizz CSV Export Format
5387
- \`\`\`csv
5388
- {{KAHOOT_CSV_CONTENT}}
5389
- \`\`\`
5390
- `;
5391
- var GRAPHIC_ORGANIZER_TEMPLATE = `---
5392
- id: "{{ID}}"
5393
- title: "{{TITLE}}"
5394
- type: "GRAPHIC_ORGANIZER"
5395
- created_by: "Curriculum OS Builder"
5396
- phase: "{{PHASE}}"
5397
- deliverable: "P3-T18"
5398
- version: "{{VERSION}}"
5399
- date: "{{DATE}}"
5400
- template_contract: "artifact-template-v1"
5401
- template_required_sections:
5402
- - "Visual Paradigm Overview"
5403
- - "Organizer 1: Architectural Data Flow (Mermaid Flowchart)"
5404
- - "Organizer 2: Comparative Analysis (Mermaid / Markdown Venn)"
5405
- - "Organizer 3: State Machine & Lifecycle (Mermaid StateDiagram)"
5406
- - "Student Fill-in Worksheet Format"
5407
- ---
5408
- <!-- INJECT_BODY -->
5409
-
5410
- # VISUAL GRAPHIC ORGANIZERS: {{TITLE}}
5411
- _Unit: {{UNIT_ID}} | Module: {{MODULE_ID}} | Format: Mermaid Diagrams + Printable Handouts_
5412
-
5413
- ## [REQUIRED] Visual Paradigm Overview
5414
- - **Cognitive Purpose:** Unload mental processing burden through spatial diagramming.
5415
-
5416
- ---
5417
-
5418
- ## [REQUIRED] Organizer 1: Architectural Data Flow (Mermaid Flowchart)
5419
- \`\`\`mermaid
5420
- {{MERMAID_FLOWCHART}}
5421
- \`\`\`
5422
-
5423
- ---
5424
-
5425
- ## [REQUIRED] Organizer 2: Comparative Analysis (Venn Diagram / Matrix)
5426
- \`\`\`mermaid
5427
- {{MERMAID_VENN_OR_MATRIX}}
5428
- \`\`\`
5429
-
5430
- ---
5431
-
5432
- ## [REQUIRED] Organizer 3: State Machine & Lifecycle (State Diagram)
5433
- \`\`\`mermaid
5434
- {{MERMAID_STATE_DIAGRAM}}
5435
- \`\`\`
5436
-
5437
- ---
5438
-
5439
- ## [REQUIRED] Student Fill-in Worksheet Format (Offline Handout)
5440
- {{OFFLINE_WORKSHEET_FORMAT}}
5441
- `;
5442
-
5443
- // src/templates/slidePresets.ts
5444
- var SLIDE_LAYOUT_PRESETS = [
5445
- {
5446
- id: "title-hero",
5447
- name: "Title & Speaker Cover",
5448
- category: "cover",
5449
- description: "High-impact opening slide with large title, subtitle, and speaker credentials.",
5450
- layout: {
5451
- boxes: [
5452
- {
5453
- id: "title",
5454
- target: "h1",
5455
- pos: [100, 180, 1080, 140],
5456
- fontSize: "3rem",
5457
- textAlign: "center"
5458
- },
5459
- {
5460
- id: "subtitle",
5461
- target: "h3",
5462
- pos: [100, 350, 1080, 70],
5463
- fontSize: "1.5rem",
5464
- textAlign: "center"
5465
- },
5466
- {
5467
- id: "speaker-meta",
5468
- target: "p",
5469
- pos: [100, 460, 1080, 80],
5470
- fontSize: "1.1rem",
5471
- textAlign: "center"
5472
- }
5473
- ]
5474
- },
5475
- markdownSnippet: `<!-- layout:
5476
- boxes:
5477
- - id: title
5478
- target: h1
5479
- pos: [100, 180, 1080, 140]
5480
- fontSize: 3rem
5481
- textAlign: center
5482
- - id: subtitle
5483
- target: h3
5484
- pos: [100, 350, 1080, 70]
5485
- fontSize: 1.5rem
5486
- textAlign: center
5487
- - id: speaker-meta
5488
- target: p
5489
- pos: [100, 460, 1080, 80]
5490
- fontSize: 1.1rem
5491
- textAlign: center
5492
- -->
5493
-
5494
- # \u{1F680} Engineering Scalable Cloud Systems
5495
- ### Principles, Bottlenecks, and Real-World Architecture Patterns
5496
-
5497
- **Presenter:** Senior Systems Architect | **Duration:** 45 mins | **Level:** Intermediate
5498
-
5499
- <!--
5500
- Presenter Notes:
5501
- - Welcome the audience and outline today's primary engineering goals.
5502
- - Spark curiosity with an opening hook about scaling under high concurrency.
5503
- -->`
5504
- },
5505
- {
5506
- id: "two-column-split",
5507
- name: "Two-Column Comparison",
5508
- category: "split",
5509
- description: "Balanced side-by-side comparison for legacy vs modern patterns or pros vs cons.",
5510
- layout: {
5511
- boxes: [
5512
- {
5513
- id: "heading",
5514
- target: "h2",
5515
- pos: [80, 50, 1120, 70],
5516
- fontSize: "2rem"
5517
- },
5518
- {
5519
- id: "col-left",
5520
- target: ".columns-2 > div:first-child",
5521
- pos: [80, 150, 530, 510]
5522
- },
5523
- {
5524
- id: "col-right",
5525
- target: ".columns-2 > div:last-child",
5526
- pos: [670, 150, 530, 510]
5527
- }
5528
- ]
5529
- },
5530
- markdownSnippet: `<!-- layout:
5531
- boxes:
5532
- - id: heading
5533
- target: h2
5534
- pos: [80, 50, 1120, 70]
5535
- fontSize: 2rem
5536
- - id: col-left
5537
- target: '.columns-2 > div:first-child'
5538
- pos: [80, 150, 530, 510]
5539
- - id: col-right
5540
- target: '.columns-2 > div:last-child'
5541
- pos: [670, 150, 530, 510]
5542
- -->
5543
-
5544
- ## \u2696\uFE0F Monolithic Polling vs Event-Driven Architecture
5545
-
5546
- <div class="columns-2">
5547
- <div>
5548
-
5549
- ### \u{1F534} Legacy Polling
5550
- - Heavy database CPU overhead on idle cycles
5551
- - High network latency between updates
5552
- - Prone to cascading timeouts during spikes
5553
-
5554
- </div>
5555
- <div>
5556
-
5557
- ### \u{1F7E2} Event-Driven Streams
5558
- - Real-time event propagation via webhooks
5559
- - Zero idle compute waste with serverless consumers
5560
- - Automatic backpressure and queue isolation
5561
-
5562
- </div>
5563
- </div>
5564
-
5565
- <!--
5566
- Presenter Notes:
5567
- - Emphasize the core failure mode of periodic polling under sudden load spikes.
5568
- - Ask the room if anyone has experienced database lockups caused by polling loops.
5569
- -->`
5570
- },
5571
- {
5572
- id: "code-explainer",
5573
- name: "Code Walkthrough & Analysis",
5574
- category: "code",
5575
- description: "Syntax-highlighted code block on the left with step-by-step key annotations on the right.",
5576
- layout: {
5577
- boxes: [
5578
- {
5579
- id: "heading",
5580
- target: "h2",
5581
- pos: [80, 45, 1120, 65],
5582
- fontSize: "1.9rem"
5583
- },
5584
- {
5585
- id: "code-box",
5586
- target: ".columns-2 > div:first-child",
5587
- pos: [80, 135, 630, 535]
5588
- },
5589
- {
5590
- id: "notes-box",
5591
- target: ".columns-2 > div:last-child",
5592
- pos: [740, 135, 460, 535]
5593
- }
5594
- ]
5595
- },
5596
- markdownSnippet: `<!-- layout:
5597
- boxes:
5598
- - id: heading
5599
- target: h2
5600
- pos: [80, 45, 1120, 65]
5601
- fontSize: 1.9rem
5602
- - id: code-box
5603
- target: '.columns-2 > div:first-child'
5604
- pos: [80, 135, 630, 535]
5605
- - id: notes-box
5606
- target: '.columns-2 > div:last-child'
5607
- pos: [740, 135, 460, 535]
5608
- -->
5609
-
5610
- ## \u{1F4BB} Robust Async Transaction Pipeline
5611
-
5612
- <div class="columns-2">
5613
- <div>
5614
-
5615
- \`\`\`ts
5616
- // Process payment with idempotency guarantee
5617
- export async function processPayment(order: Order) {
5618
- const isValid = await validateOrder(order);
5619
- if (!isValid) throw new Error("ValidationFailed");
5620
-
5621
- const receipt = await chargeCard(order);
5622
- return sendConfirmation(receipt);
5623
- }
5624
- \`\`\`
5625
-
5626
- </div>
5627
- <div>
5628
-
5629
- ### \u{1F50D} Key Engineering Invariants:
5630
- 1. **Early Guard Clause:** Validates payload immediately at line 3 before triggering external calls.
5631
- 2. **Deterministic Sequence:** Enforces strict order of operations using native \`await\`.
5632
- 3. **Audit Trail:** Returns immutable payment receipt upon successful execution.
5633
-
5634
- </div>
5635
- </div>
5636
-
5637
- <!--
5638
- Presenter Notes:
5639
- - Walk through lines 1 to 7 sequentially.
5640
- - Cold-call check: "What happens if line 6 throws a network timeout?"
5641
- - Cognitive scaffolding: Highlight the importance of idempotency keys in payment APIs.
5642
- -->`
5643
- },
5644
- {
5645
- id: "metrics-3-card",
5646
- name: "3-Metric Key Results Grid",
5647
- category: "metrics",
5648
- description: "Three high-visibility KPI stat cards for benchmarks, impact, and success criteria.",
5649
- layout: {
5650
- boxes: [
5651
- {
5652
- id: "heading",
5653
- target: "h2",
5654
- pos: [80, 50, 1120, 70],
5655
- fontSize: "2rem",
5656
- textAlign: "center"
5657
- },
5658
- {
5659
- id: "metric-1",
5660
- target: ".columns-3 > div:nth-child(1)",
5661
- pos: [80, 165, 340, 485]
5662
- },
5663
- {
5664
- id: "metric-2",
5665
- target: ".columns-3 > div:nth-child(2)",
5666
- pos: [470, 165, 340, 485]
5667
- },
5668
- {
5669
- id: "metric-3",
5670
- target: ".columns-3 > div:nth-child(3)",
5671
- pos: [860, 165, 340, 485]
5672
- }
5673
- ]
5674
- },
5675
- markdownSnippet: `<!-- layout:
5676
- boxes:
5677
- - id: heading
5678
- target: h2
5679
- pos: [80, 50, 1120, 70]
5680
- fontSize: 2rem
5681
- textAlign: center
5682
- - id: metric-1
5683
- target: '.columns-3 > div:nth-child(1)'
5684
- pos: [80, 165, 340, 485]
5685
- - id: metric-2
5686
- target: '.columns-3 > div:nth-child(2)'
5687
- pos: [470, 165, 340, 485]
5688
- - id: metric-3
5689
- target: '.columns-3 > div:nth-child(3)'
5690
- pos: [860, 165, 340, 485]
5691
- -->
5692
-
5693
- ## \u{1F4CA} Performance & Reliability Benchmarks
5694
-
5695
- <div class="columns-3">
5696
- <div>
5697
-
5698
- # \u26A1 99.99%
5699
- ### SLA Availability
5700
- High-availability multi-region cluster with automated failover routing.
5701
-
5702
- </div>
5703
- <div>
5704
-
5705
- # \u{1F680} 15ms
5706
- ### P99 Latency
5707
- Sub-20ms roundtrip response time via distributed edge caching.
5708
-
5709
- </div>
5710
- <div>
5711
-
5712
- # \u{1F6E1}\uFE0F Zero
5713
- ### Unhandled Breaches
5714
- Full SOC2 Type II compliance and end-to-end payload encryption.
5715
-
5716
- </div>
5717
- </div>
5718
-
5719
- <!--
5720
- Presenter Notes:
5721
- - Highlight the 15ms P99 latency target as the primary technical milestone.
5722
- - Connect these metrics directly to the architecture decisions discussed next.
5723
- -->`
5724
- },
5725
- {
5726
- id: "process-flow",
5727
- name: "Architecture & Process Flow",
5728
- category: "diagram",
5729
- description: "Multi-stage workflow with responsive Mermaid diagram and phase summaries.",
5730
- layout: {
5731
- boxes: [
5732
- {
5733
- id: "heading",
5734
- target: "h2",
5735
- pos: [80, 45, 1120, 65],
5736
- fontSize: "1.9rem"
5737
- },
5738
- {
5739
- id: "diagram-box",
5740
- target: "pre.mermaid, .mermaid",
5741
- pos: [80, 130, 1120, 310]
5742
- },
5743
- {
5744
- id: "summary-box",
5745
- target: "ul, p",
5746
- pos: [80, 465, 1120, 205]
5747
- }
5748
- ]
5749
- },
5750
- markdownSnippet: `<!-- layout:
5751
- boxes:
5752
- - id: heading
5753
- target: h2
5754
- pos: [80, 45, 1120, 65]
5755
- fontSize: 1.9rem
5756
- - id: diagram-box
5757
- target: 'pre.mermaid, .mermaid'
5758
- pos: [80, 130, 1120, 310]
5759
- - id: summary-box
5760
- target: 'ul, p'
5761
- pos: [80, 465, 1120, 205]
5762
- -->
5763
-
5764
- ## \u{1F504} End-to-End Data Ingestion Pipeline
5765
-
5766
- \`\`\`mermaid
5767
- graph LR
5768
- A[1. Client Ingress] --> B[2. API Gateway]
5769
- B --> C[3. Auth Verifier]
5770
- C --> D[4. Distributed DB]
5771
- style A fill:#0284c7,stroke:#38bdf8,stroke-width:2px,color:#fff
5772
- style B fill:#1e293b,stroke:#64748b,stroke-width:2px,color:#fff
5773
- style C fill:#059669,stroke:#34d399,stroke-width:2px,color:#fff
5774
- style D fill:#7c3aed,stroke:#a78bfa,stroke-width:2px,color:#fff
5775
- \`\`\`
5776
-
5777
- - **Ingress & Gateway:** Rate-limits traffic and applies reverse-proxy load balancing.
5778
- - **Verification & Storage:** Decodes cryptographic JWT tokens before transactional write commit.
5779
-
5780
- <!--
5781
- Presenter Notes:
5782
- - Trace each hop across the diagram from left to right.
5783
- - Ask: "Where should rate limiting be applied to prevent DDoS attacks?"
5784
- -->`
5785
- },
5786
- {
5787
- id: "quote-highlight",
5788
- name: "Core Principle & Quote Highlight",
5789
- category: "quote",
5790
- description: "Prominent quote callout for fundamental engineering rules or memorable mantras.",
5791
- layout: {
5792
- boxes: [
5793
- {
5794
- id: "heading",
5795
- target: "h2",
5796
- pos: [100, 100, 1080, 80],
5797
- fontSize: "2.2rem",
5798
- textAlign: "center"
5799
- },
5800
- {
5801
- id: "quote-box",
5802
- target: "blockquote",
5803
- pos: [140, 230, 1e3, 360],
5804
- fontSize: "1.4rem"
5805
- }
5806
- ]
5807
- },
5808
- markdownSnippet: `<!-- layout:
5809
- boxes:
5810
- - id: heading
5811
- target: h2
5812
- pos: [100, 100, 1080, 80]
5813
- fontSize: 2.2rem
5814
- textAlign: center
5815
- - id: quote-box
5816
- target: blockquote
5817
- pos: [140, 230, 1000, 360]
5818
- fontSize: 1.4rem
5819
- -->
5820
-
5821
- ## \u{1F4A1} Foundational Architecture Principle
5822
-
5823
- > "Simplicity is prerequisite for reliability. A well-engineered distributed system is one where a new engineer can understand the request flow within their first hour."
5824
- >
5825
- > \u2014 **Edsger W. Dijkstra**
5826
-
5827
- <!--
5828
- Presenter Notes:
5829
- - Pause for 5 seconds of silence to let the quote sink in.
5830
- - Ask: "How do our current architectural choices reflect this principle?"
5831
- -->`
5832
- },
5833
- {
5834
- id: "quiz-checkpoint",
5835
- name: "Interactive Formative Checkpoint",
5836
- category: "assessment",
5837
- description: "Interactive multiple-choice diagnostic checkpoint with A/B/C/D voting options.",
5838
- layout: {
5839
- boxes: [
5840
- {
5841
- id: "heading",
5842
- target: "h2",
5843
- pos: [80, 45, 1120, 65],
5844
- fontSize: "1.9rem"
5845
- },
5846
- {
5847
- id: "question-callout",
5848
- target: "blockquote",
5849
- pos: [80, 130, 1120, 110],
5850
- fontSize: "1.2rem"
5851
- },
5852
- {
5853
- id: "options-list",
5854
- target: "ul",
5855
- pos: [80, 260, 1120, 390],
5856
- fontSize: "1.15rem"
5857
- }
5858
- ]
5859
- },
5860
- markdownSnippet: `<!-- layout:
5861
- boxes:
5862
- - id: heading
5863
- target: h2
5864
- pos: [80, 45, 1120, 65]
5865
- fontSize: 1.9rem
5866
- - id: question-callout
5867
- target: blockquote
5868
- pos: [80, 130, 1120, 110]
5869
- fontSize: 1.2rem
5870
- - id: options-list
5871
- target: ul
5872
- pos: [80, 260, 1120, 390]
5873
- fontSize: 1.15rem
5874
- -->
4331
+ {{SILVER_HINT_1}}
4332
+ </details>
5875
4333
 
5876
- ## \u{1F3AF} Formative Checkpoint: Verify Your Understanding
4334
+ <details>
4335
+ <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
5877
4336
 
5878
- > **Question:** In an event-driven architecture, which pattern guarantees that messages are never permanently lost if a downstream consumer crashes?
4337
+ \`\`\`{{CODE_LANGUAGE}}
4338
+ {{SILVER_HINT_2}}
4339
+ \`\`\`
4340
+ </details>
5879
4341
 
5880
- - **A.** Direct synchronous HTTP request with short 2-second timeout
5881
- - **B.** Persistent Message Broker with Dead-Letter Queue (DLQ) & retry policy
5882
- - **C.** In-memory client RAM cache without persistence
5883
- - **D.** Discarding failed packets and prompting the user to re-submit
4342
+ <details>
4343
+ <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
5884
4344
 
5885
- <!--
5886
- Presenter Notes:
5887
- - Give students 30 seconds to vote on option A, B, C, or D.
5888
- - Correct answer: B.
5889
- - Explain why options A and C introduce catastrophic data loss in production.
5890
- -->`
5891
- },
5892
- {
5893
- id: "tiered-practice-3cards",
5894
- name: "Tiered Differentiation (Bronze / Silver / Gold)",
5895
- category: "content",
5896
- description: "Three progressive competency tiers allowing self-paced learning acceleration.",
5897
- layout: {
5898
- boxes: [
5899
- {
5900
- id: "heading",
5901
- target: "h2",
5902
- pos: [80, 45, 1120, 65],
5903
- fontSize: "1.9rem"
5904
- },
5905
- {
5906
- id: "tier-bronze",
5907
- target: ".columns-3 > div:nth-child(1)",
5908
- pos: [80, 140, 350, 520]
5909
- },
5910
- {
5911
- id: "tier-silver",
5912
- target: ".columns-3 > div:nth-child(2)",
5913
- pos: [465, 140, 350, 520]
5914
- },
5915
- {
5916
- id: "tier-gold",
5917
- target: ".columns-3 > div:nth-child(3)",
5918
- pos: [850, 140, 350, 520]
5919
- }
5920
- ]
5921
- },
5922
- markdownSnippet: `<!-- layout:
5923
- boxes:
5924
- - id: heading
5925
- target: h2
5926
- pos: [80, 45, 1120, 65]
5927
- fontSize: 1.9rem
5928
- - id: tier-bronze
5929
- target: '.columns-3 > div:nth-child(1)'
5930
- pos: [80, 140, 350, 520]
5931
- - id: tier-silver
5932
- target: '.columns-3 > div:nth-child(2)'
5933
- pos: [465, 140, 350, 520]
5934
- - id: tier-gold
5935
- target: '.columns-3 > div:nth-child(3)'
5936
- pos: [850, 140, 350, 520]
5937
- -->
4345
+ \`\`\`{{CODE_LANGUAGE}}
4346
+ {{SILVER_HINT_3_CODE}}
4347
+ \`\`\`
5938
4348
 
5939
- ## \u{1F6E0}\uFE0F Hands-On Challenge: 3-Tier Differentiation
4349
+ **Why this solution works:**
4350
+ {{SILVER_HINT_3_EXPLANATION}}
4351
+ </details>
5940
4352
 
5941
- <div class="columns-3">
5942
- <div>
4353
+ ---
5943
4354
 
5944
- ### \u{1F949} Bronze Tier
5945
- - Implement baseline function
5946
- - Pass 3 baseline unit tests
5947
- - *Goal: Foundational mastery*
4355
+ ### \u{1F947} Challenge 3: Edge Cases & Optimization (Gold) \u2014 ~{{GOLD_MINS}} mins
4356
+ **Objective:** {{GOLD_OBJECTIVE}}
5948
4357
 
5949
- </div>
5950
- <div>
4358
+ #### Tasks & Implementation Details:
4359
+ {{GOLD_TASKS}}
5951
4360
 
5952
- ### \u{1F948} Silver Tier
5953
- - Add boundary error handling
5954
- - Enforce O(N) memory complexity
5955
- - *Goal: Production-ready code*
4361
+ #### \u{1F9EA} Self-Verification Command:
4362
+ \`\`\`bash
4363
+ {{GOLD_VERIFY_COMMAND}}
4364
+ \`\`\`
4365
+ *Expected Terminal Output:*
4366
+ \`\`\`text
4367
+ {{GOLD_EXPECTED_OUTPUT}}
4368
+ \`\`\`
5956
4369
 
5957
- </div>
5958
- <div>
4370
+ #### \u{1F4A1} Progressive Hints (Expand only if stuck):
4371
+ <details>
4372
+ <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
5959
4373
 
5960
- ### \u{1F947} Gold Tier
5961
- - Design distributed retry queue
5962
- - Add 95% automated test coverage
5963
- - *Goal: Architectural leadership*
4374
+ {{GOLD_HINT_1}}
4375
+ </details>
5964
4376
 
5965
- </div>
5966
- </div>
4377
+ <details>
4378
+ <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
5967
4379
 
5968
- <!--
5969
- Presenter Notes:
5970
- - All learners begin at Bronze to establish baseline competency.
5971
- - Accelerate self-directed learners to Silver and Gold as they complete each tier.
5972
- -->`
5973
- },
5974
- {
5975
- id: "agenda-timeline",
5976
- name: "Session Agenda & Milestones",
5977
- category: "content",
5978
- description: "Structured time-budgeted agenda mapping stages to measurable deliverables.",
5979
- layout: {
5980
- boxes: [
5981
- {
5982
- id: "heading",
5983
- target: "h2",
5984
- pos: [80, 45, 1120, 65],
5985
- fontSize: "1.9rem"
5986
- },
5987
- {
5988
- id: "table-box",
5989
- target: "table",
5990
- pos: [80, 140, 1120, 520]
5991
- }
5992
- ]
5993
- },
5994
- markdownSnippet: `<!-- layout:
5995
- boxes:
5996
- - id: heading
5997
- target: h2
5998
- pos: [80, 45, 1120, 65]
5999
- fontSize: 1.9rem
6000
- - id: table-box
6001
- target: table
6002
- pos: [80, 140, 1120, 520]
6003
- -->
4380
+ \`\`\`{{CODE_LANGUAGE}}
4381
+ {{GOLD_HINT_2}}
4382
+ \`\`\`
4383
+ </details>
6004
4384
 
6005
- ## \u{1F5FA}\uFE0F Milestone Roadmap & Time Budget
4385
+ <details>
4386
+ <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
6006
4387
 
6007
- | Allocated Time | Session Stage | Core Learning Focus | Deliverable Milestone |
6008
- |:---:|---|---|---|
6009
- | **05 mins** | Warm-Up | Real-World Scenario & Context | Identify system bottleneck |
6010
- | **15 mins** | Concept Discovery | Core Architectural Patterns | Deconstruct message queue models |
6011
- | **20 mins** | Hands-On Lab | Tiered Code Implementation | Complete Bronze + Silver tasks |
6012
- | **05 mins** | Wrap-Up | Formative Checkpoint & Debrief | Consolidate key principles |
4388
+ \`\`\`{{CODE_LANGUAGE}}
4389
+ {{GOLD_HINT_3_CODE}}
4390
+ \`\`\`
6013
4391
 
6014
- <!--
6015
- Presenter Notes:
6016
- - Walk through the time budget so students understand expectations and pacing.
6017
- -->`
6018
- },
6019
- {
6020
- id: "takeaways-summary",
6021
- name: "Key Takeaways & Wrap-up",
6022
- category: "content",
6023
- description: "Three memorable synthesis takeaways with actionable next steps.",
6024
- layout: {
6025
- boxes: [
6026
- {
6027
- id: "heading",
6028
- target: "h2",
6029
- pos: [80, 50, 1120, 70],
6030
- fontSize: "2rem"
6031
- },
6032
- {
6033
- id: "list-box",
6034
- target: "ol",
6035
- pos: [80, 150, 1120, 340],
6036
- fontSize: "1.25rem"
6037
- },
6038
- {
6039
- id: "callout-next",
6040
- target: "blockquote",
6041
- pos: [80, 520, 1120, 140],
6042
- fontSize: "1.1rem"
6043
- }
6044
- ]
6045
- },
6046
- markdownSnippet: `<!-- layout:
6047
- boxes:
6048
- - id: heading
6049
- target: h2
6050
- pos: [80, 50, 1120, 70]
6051
- fontSize: 2rem
6052
- - id: list-box
6053
- target: ol
6054
- pos: [80, 150, 1120, 340]
6055
- fontSize: 1.25rem
6056
- - id: callout-next
6057
- target: blockquote
6058
- pos: [80, 520, 1120, 140]
6059
- fontSize: 1.1rem
6060
- -->
4392
+ **Why this solution works:**
4393
+ {{GOLD_HINT_3_EXPLANATION}}
4394
+ </details>
6061
4395
 
6062
- ## \u{1F3C1} Key Takeaways & Action Items
4396
+ ---
6063
4397
 
6064
- 1. **Decouple Before Scaling:** Separate producer rate from consumer processing capacity.
6065
- 2. **Design for Failure:** Always configure retries, backoff intervals, and dead-letter queues.
6066
- 3. **Measure End-to-End:** Track P99 latency and error rates across all distributed boundaries.
4398
+ ## \u{1F50D} Self-Learner Troubleshooting Matrix
4399
+ | Symptom / Error Message | Root Cause | Exact Fix |
4400
+ | :--- | :--- | :--- |
4401
+ {{TROUBLESHOOTING_ROWS}}
6067
4402
 
6068
- > \u{1F4DD} **Next Action Item:** Complete the Silver Tier refactoring challenge before our next peer-review session.
4403
+ ---
6069
4404
 
6070
- <!--
6071
- Presenter Notes:
6072
- - Deliver a crisp 2-minute wrap-up reinforcing the 3 core takeaways.
6073
- - Acknowledge strong peer collaboration during the hands-on lab.
6074
- -->`
6075
- }
6076
- ];
6077
- function getSlideLayoutPresetById(id) {
6078
- return SLIDE_LAYOUT_PRESETS.find((p) => p.id === id);
6079
- }
6080
- function getSlideLayoutPresetsByCategory(category) {
6081
- return SLIDE_LAYOUT_PRESETS.filter((p) => p.category === category);
6082
- }
4405
+ ## \u{1F3C1} Final Lab Submission & Mastery Checklist
4406
+ {{FINAL_CHECKLIST}}
4407
+ `.trim();
6083
4408
 
6084
4409
  // src/ai/prompts/lessonMasterPrompt.ts
6085
4410
  function buildLessonMasterPrompt(input) {
@@ -27136,33 +25461,117 @@ function evaluateActivityAlignment(canonicalExcerpt, generatedContent, now = /*
27136
25461
  const passed = matchedTokens.length > 0;
27137
25462
  return { checked: true, passed, matchedTokens: matchedTokens.slice(0, 10), missingTokens: missingTokens.slice(0, 10), mode };
27138
25463
  }
27139
-
27140
- // src/services/lessonProductionService.ts
27141
- var __filename2 = typeof (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) === "string" && typeof url.fileURLToPath === "function" ? url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))) : "";
27142
- var _resolvedDir = __filename2 ? path3__default.default.dirname(__filename2) : typeof __dirname !== "undefined" ? __dirname : process.cwd();
27143
- function loadCurriculumTemplate(templateName) {
27144
- const candidatePaths = [
27145
- path3__default.default.resolve("/Users/tonypham/MEGA/WebApp/WIP/learnwell-platform/packages/curriculum-kit/docs/refs/templates", templateName),
27146
- path3__default.default.resolve(process.cwd(), "packages/curriculum-kit/docs/refs/templates", templateName),
27147
- path3__default.default.resolve(process.cwd(), "_templates", templateName),
27148
- path3__default.default.resolve(process.cwd(), "docs/refs/templates", templateName),
27149
- path3__default.default.resolve(_resolvedDir, "../docs/refs/templates", templateName),
27150
- path3__default.default.resolve(_resolvedDir, "../../docs/refs/templates", templateName),
27151
- path3__default.default.resolve(_resolvedDir, "../../../docs/refs/templates", templateName),
27152
- path3__default.default.resolve("/Users/tonypham/MEGA/WebApp/content-gen/the-ultimate-curriculum-agent-os/_templates", templateName),
27153
- path3__default.default.resolve(_resolvedDir, "../../../../the-ultimate-curriculum-agent-os/_templates", templateName)
27154
- ];
27155
- for (const p of candidatePaths) {
27156
- if (fs2__default.default.existsSync(p)) {
27157
- try {
27158
- return fs2__default.default.readFileSync(p, "utf-8");
27159
- } catch {
27160
- }
25464
+ function stripTemplateFrontmatter(raw) {
25465
+ let body = raw;
25466
+ if (body.startsWith("---")) {
25467
+ const end = body.indexOf("\n---", 3);
25468
+ if (end !== -1) body = body.slice(end + 4);
25469
+ }
25470
+ return body.split("\n").filter((l) => l.trim() !== "<!-- INJECT_BODY -->").join("\n").replace(/^\s*\n/, "").trimEnd();
25471
+ }
25472
+ function extractRequiredSections(raw) {
25473
+ const lines = raw.split("\n");
25474
+ const start = lines.findIndex((l) => /^template_required_sections:\s*$/.test(l.trim()));
25475
+ if (start === -1) return null;
25476
+ const items = [];
25477
+ for (let i = start + 1; i < lines.length; i++) {
25478
+ const line = lines[i] ?? "";
25479
+ if (line.trim() === "") continue;
25480
+ if (!/^\s+-\s/.test(line)) break;
25481
+ items.push(line.trim().replace(/^-\s+/, "").replace(/^["']|["']$/g, ""));
25482
+ }
25483
+ return items.length > 0 ? items : null;
25484
+ }
25485
+ function normalizeHeading2(h) {
25486
+ return h.replace(/\[(REQUIRED|OPTIONAL|CONDITIONAL)\]\s*/gi, "").replace(/\s+/g, " ").trim();
25487
+ }
25488
+ function extractBodySections(raw) {
25489
+ const body = stripTemplateFrontmatter(raw);
25490
+ return body.split("\n").filter((l) => l.startsWith("## ")).map((l) => normalizeHeading2(l.slice(3).trim())).filter((s) => s.length > 0);
25491
+ }
25492
+ var KIT_TEMPLATE_FALLBACK_DIRS = [
25493
+ // Packaged with the npm bundle (dist/templates) — resolves from node_modules.
25494
+ "templates",
25495
+ // Repo checkout layouts.
25496
+ "docs/refs/templates"
25497
+ ];
25498
+ var _moduleDir = (() => {
25499
+ try {
25500
+ if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== "undefined" && typeof (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) === "string") {
25501
+ return path3__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
27161
25502
  }
25503
+ } catch {
25504
+ }
25505
+ return typeof __dirname !== "undefined" ? __dirname : process.cwd();
25506
+ })();
25507
+ function candidateDirs(explicitDir) {
25508
+ const dirs = [];
25509
+ if (explicitDir) dirs.push(explicitDir);
25510
+ if (process.env.CURRICULUM_TEMPLATES_DIR) dirs.push(process.env.CURRICULUM_TEMPLATES_DIR);
25511
+ dirs.push(path3__default.default.resolve(process.cwd(), "_templates"));
25512
+ for (const rel of KIT_TEMPLATE_FALLBACK_DIRS) {
25513
+ dirs.push(path3__default.default.resolve(_moduleDir, rel));
25514
+ dirs.push(path3__default.default.resolve(process.cwd(), rel));
25515
+ dirs.push(path3__default.default.resolve(process.cwd(), "packages/curriculum-kit", rel));
25516
+ }
25517
+ return dirs;
25518
+ }
25519
+ function findTemplatePath(templateName, explicitDir) {
25520
+ for (const dir of candidateDirs(explicitDir)) {
25521
+ const p = path3__default.default.join(dir, templateName);
25522
+ if (!fs2__default.default.existsSync(p)) continue;
25523
+ try {
25524
+ fs2__default.default.accessSync(p, fs2__default.default.constants.R_OK);
25525
+ return p;
25526
+ } catch {
25527
+ }
25528
+ }
25529
+ return null;
25530
+ }
25531
+ function resolveArtifactTemplate(templateName, opts) {
25532
+ const p = findTemplatePath(templateName, opts?.templatesDir);
25533
+ if (!p) return null;
25534
+ try {
25535
+ const raw = fs2__default.default.readFileSync(p, "utf-8");
25536
+ return {
25537
+ content: stripTemplateFrontmatter(raw),
25538
+ sections: extractRequiredSections(raw) ?? extractBodySections(raw),
25539
+ sourcePath: p
25540
+ };
25541
+ } catch {
25542
+ return null;
25543
+ }
25544
+ }
25545
+ function loadCurriculumTemplate(templateName, templatesDir) {
25546
+ const p = findTemplatePath(templateName, templatesDir);
25547
+ if (!p) return "";
25548
+ try {
25549
+ return fs2__default.default.readFileSync(p, "utf-8");
25550
+ } catch {
25551
+ return "";
27162
25552
  }
27163
- console.warn(`[curriculum-kit:loadCurriculumTemplate] \u26A0\uFE0F Template "${templateName}" not found across candidate paths. Falling back to inline structural scaffolding.`);
27164
- return "";
27165
25553
  }
25554
+
25555
+ // src/services/lessonProductionService.ts
25556
+ var LESSON_TEMPLATE_BY_PEDAGOGY = {
25557
+ edp: "LESSON_EDP_template.md",
25558
+ general: "LESSON_GENERAL_template.md",
25559
+ pbl: "LESSON_GENERAL_template.md",
25560
+ "5e": "LESSON_5E_template.md"
25561
+ };
25562
+ function buildArtifactPrompt(parts, opts) {
25563
+ const resolved = resolveArtifactTemplate(parts.templateFile, opts);
25564
+ const body = resolved?.content ?? parts.epilogue ?? "";
25565
+ const source = resolved ? `
25566
+ <!-- P52 template: ${parts.templateFile} \u2190 ${resolved.sourcePath} -->
25567
+ ` : "\n<!-- P52 template: NOT FOUND \u2014 inline fallback scaffold -->\n";
25568
+ return `${parts.directive}${source}${body}`;
25569
+ }
25570
+ var NO_VERBATIM_COPYING = `
25571
+ VERBATIM SOURCING RULE: When a section in the template says to extract a table
25572
+ or list from the canonical knowledge context (KX/LESSON), copy that table
25573
+ VERBATIM \u2014 do not re-invent or paraphrase it. Every fact must live in exactly
25574
+ one canonical artifact; your document references, it does not restate.`;
27166
25575
  function detectProjectPedagogy(frameworkText, styleGuideText, explicitPedagogy) {
27167
25576
  if (explicitPedagogy) return explicitPedagogy;
27168
25577
  const combined = (frameworkText + " " + styleGuideText).toLowerCase();
@@ -27323,7 +25732,21 @@ ${nextRow}`
27323
25732
  return parts.join("\n\n") || framework.slice(0, 1500);
27324
25733
  }
27325
25734
  function buildLessonPrompt(pedagogy, lessonCode, unitCode, lessonTitle, concept, bloomLevel, dateStr, targetLanguage = "vi", sectionLanguageContract) {
27326
- const commonFrontmatter = `id: "LESSON_${lessonCode}"
25735
+ const templateFile = LESSON_TEMPLATE_BY_PEDAGOGY[pedagogy] ?? "LESSON_5E_template.md";
25736
+ const artifactType = templateFile.replace("_template.md", "");
25737
+ const contract = resolveArtifactTemplate(templateFile)?.sections ?? [];
25738
+ const sectionsYaml = contract.map((s) => ` - "${s}"`).join("\n");
25739
+ const directive = `You are @content (Educational Content Editor & ${artifactType} Instructional Model Specialist).
25740
+ Author the comprehensive Master Lesson Plan \`LESSON_${lessonCode}.md\` for:
25741
+ - Lesson Code: ${lessonCode}
25742
+ - Title: ${lessonTitle}
25743
+ - Core Concept: ${concept}
25744
+ - Bloom Level: ${bloomLevel}
25745
+
25746
+ Format requirements:
25747
+ 1. EXACT YAML Frontmatter \u2014 copy verbatim, then fill in the blanks:
25748
+ ---
25749
+ id: "LESSON_${lessonCode}"
27327
25750
  title: "${lessonTitle}"
27328
25751
  created_by: "Curriculum OS Builder"
27329
25752
  phase: "P3"
@@ -27334,182 +25757,25 @@ lesson_id: "${lessonCode}"
27334
25757
  unit_id: "${unitCode}"
27335
25758
  template_contract: "lesson-plan-v2"
27336
25759
  template_required_sections:
27337
- - "A. Lesson Design Plan"
27338
- - "Learning Objectives & Evidence"
27339
- - "Activity Sequence"
27340
- - "Resource Map"
27341
- - "Assessment Map"
27342
- - "Artifact Contract"
27343
- - "B. Lesson Flow"
27344
- - "Artifact Linkage"`;
27345
- let prompt = "";
27346
- if (pedagogy === "edp") {
27347
- prompt = `You are @content (Educational Content Editor & EDP Engineering Design Process Specialist).
27348
- Author the comprehensive Master Lesson Plan adhering strictly to \`LESSON_EDP_template.md\` standards for:
27349
- - Lesson Code: ${lessonCode}
27350
- - Title: ${lessonTitle}
27351
- - Core Concept: ${concept}
27352
- - Bloom Level: ${bloomLevel}
27353
-
27354
- Mandatory Format Requirements:
27355
- 1. Standard YAML Frontmatter:
27356
- ---
27357
- ${commonFrontmatter}
27358
- type: "LESSON_EDP"
27359
- ---
27360
- 2. Mandatory Document Structure:
27361
- # LESSON [XX]: ${lessonTitle} (EDP Model - Engineering Design Process)
27362
-
27363
- ## [REQUIRED] A. Lesson Design Plan
27364
-
27365
- ### 1. Learning Objectives & Evidence
27366
- - **Estimated Duration:** 90 minutes
27367
- - **Project Objective:** [Complete engineering system or functional deliverable students build]
27368
- - **Materials & Equipment:** [Detailed hardware, software libraries, and workstation tools]
27369
- - **Learning Objectives Table:** (LO1, LO2 mapped with EDP Bloom level, Student Evidence, Success Criteria, and matching Standard ID from [STANDARDS STATEMENTS] if present, e.g. "CSTA: 1B-AP-10" or "CS2023-SDF-01")
27370
-
27371
- ### 2. Activity Sequence
27372
- > Activity Contract table with columns: Seq, EDP Phase (Ask, Imagine, Plan, Create, Test & Improve, Share & Evaluate), Activity Type, Actor, Purpose, Student Action, Teacher Move, Output/Evidence, LO, Time, Artifact Contract.
27373
-
27374
- ### 3. Resource Map (Slide, Handout, Starter Code, Lab Tools)
27375
- ### 4. Assessment Map (Rubric criteria, formative checkpoints, remediation paths)
27376
- ### 5. Artifact Contract & Code Symbol Ledger
27377
- - **Primary Struct / Class / Component:** [Explicit canonical identifier e.g. ProfileCardView]
27378
- - **Entry Source File:** [Explicit file name e.g. ProfileCardView.swift]
27379
- - **Key Functions & State Variables:** [Canonical identifiers used across all student activities]
27380
- - **Artifact Specifications:** [Deliverable requirements for ACT, SLIDE, QUIZ, GUIDE, WKS, CODE, EXT]
27381
-
27382
- ---
27383
-
27384
- ## [REQUIRED] B. Lesson Flow
27385
-
27386
- ### 1. ASK \u2014 [10 mins] (Problem Statement, High-Stakes Real-World Context & Engineering Challenge)
27387
- ### 2. IMAGINE \u2014 [15 mins] (Brainstorming Design Alternatives & Trade-off Evaluation)
27388
- ### 3. PLAN \u2014 [15 mins] (System Block Diagrams, Module Architecture & Task Decomposition)
27389
- ### 4. CREATE \u2014 [25 mins] (Implementation / Verified 100% Executable Code Blueprint)
27390
- ### 5. TEST & IMPROVE \u2014 [15 mins] (Diagnostic Testing, Telemetry & Iterative Debugging)
27391
- ### 6. SHARE & EVALUATE \u2014 [10 mins] (Showcase, Metacognitive Reflection & Peer Evaluation)
27392
-
27393
- ---
27394
-
27395
- ## [REQUIRED] Artifact Linkage (Master Index)
27396
- Linkage ledger mapping all satellite artifacts (\`ACT_...\`, \`QUIZ_...\`, \`SLIDE_...\`, \`GUIDE_...\`).
27397
-
27398
- 3. Ensure all sample code and schemas are 100% syntax-valid and executable.
27399
- 4. Output 100% clean Markdown directly.`;
27400
- } else if (pedagogy === "pbl" || pedagogy === "general") {
27401
- prompt = `You are @content (Educational Content Editor & PBL/General Pedagogy Specialist).
27402
- Author the comprehensive Master Lesson Plan adhering strictly to \`LESSON_GENERAL_template.md\` standards for:
27403
- - Lesson Code: ${lessonCode}
27404
- - Title: ${lessonTitle}
27405
- - Core Concept: ${concept}
27406
- - Bloom Level: ${bloomLevel}
27407
-
27408
- Mandatory Format Requirements:
27409
- 1. Standard YAML Frontmatter:
27410
- ---
27411
- ${commonFrontmatter}
27412
- type: "LESSON_GENERAL"
27413
- ---
27414
- 2. Mandatory Document Structure:
27415
- # LESSON [XX]: ${lessonTitle}
27416
-
27417
- ## [REQUIRED] A. Lesson Design Plan
27418
-
27419
- ### 1. Learning Objectives & Evidence
27420
- - **Estimated Duration:** 90 minutes
27421
- - **Materials & Equipment:** [Tools, IDE, workstations, resources]
27422
- - **Keywords / Core Concepts:** [Core domain terminology]
27423
- - **Learning Objectives Table:** (LO1, LO2 with Bloom action verbs, Student Evidence, Success Criteria, and matching Standard ID from [STANDARDS STATEMENTS] if present, e.g. "CSTA: 1B-AP-10" or "CS2023-SDF-01")
27424
-
27425
- ### 2. Activity Sequence
27426
- > Activity Contract table with columns: Seq, Lesson Stage (Warm-up, Core Concepts, Guided Practice, Independent Practice, Wrap-up), Activity Type, Actor, Purpose, Student Action, Teacher Move, Output/Evidence, LO, Time, Artifact Contract.
27427
-
27428
- ### 3. Resource Map
27429
- ### 4. Assessment Map
27430
- ### 5. Artifact Contract & Code Symbol Ledger
27431
- - **Primary Struct / Class / Component:** [Explicit canonical identifier e.g. MainComponent]
27432
- - **Entry Source File:** [Explicit file name e.g. MainComponent.ext]
27433
- - **Key Functions & State Variables:** [Canonical identifiers used across all student activities]
27434
- - **Artifact Specifications:** [Deliverable requirements for ACT, SLIDE, QUIZ, GUIDE, WKS, CODE, EXT]
27435
-
27436
- ---
27437
-
27438
- ## [REQUIRED] B. Lesson Flow
27439
-
27440
- ### 1. Warm-up & Hook \u2014 [10 mins]
27441
- ### 2. Core Concepts & Demo \u2014 [25 mins] (Accompanied by Mermaid Diagram or Code Blueprint)
27442
- ### 3. Guided Practice \u2014 [20 mins] (Step-by-step teacher-led scaffolding: I Do -> We Do)
27443
- ### 4. Independent Practice / Challenge \u2014 [25 mins] (Autonomous student lab / Mini-project)
27444
- ### 5. Wrap-up & Evaluation \u2014 [10 mins] (Synthesis & Formative Checkpoint)
27445
-
27446
- ---
27447
-
27448
- ## [REQUIRED] Artifact Linkage (Master Index)
27449
- Linkage ledger mapping all satellite artifacts (\`ACT_...\`, \`QUIZ_...\`, \`SLIDE_...\`).
27450
-
27451
- 3. Output 100% clean Markdown directly.`;
27452
- } else {
27453
- prompt = `You are @content (Educational Content Editor & 5E Instructional Model Specialist).
27454
- Author the comprehensive Master Lesson Plan adhering strictly to \`LESSON_5E_template.md\` standards for:
27455
- - Lesson Code: ${lessonCode}
27456
- - Title: ${lessonTitle}
27457
- - Core Concept: ${concept}
27458
- - Bloom Level: ${bloomLevel}
27459
-
27460
- Mandatory Format Requirements:
27461
- 1. Standard YAML Frontmatter:
27462
- ---
27463
- ${commonFrontmatter}
27464
- type: "LESSON_5E"
27465
- ---
27466
- 2. Mandatory Document Structure:
27467
- # LESSON [XX]: ${lessonTitle} (5E Model)
27468
-
27469
- ## [REQUIRED] A. Lesson Design Plan
27470
-
27471
- ### 1. Learning Objectives & Evidence
27472
- - **Estimated Duration:** 90 minutes
27473
- - **Materials & Equipment:** [Tools, IDE, hardware/software specifications]
27474
- - **Keywords / Core Concepts:** [Core domain terminology]
27475
- - **Learning Objectives Table:** (LO1, LO2 with Bloom action verbs, Student Evidence, Success Criteria, and matching Standard ID from [STANDARDS STATEMENTS] if present, e.g. "CSTA: 1B-AP-10" or "CS2023-SDF-01")
27476
-
27477
- ### 2. Activity Sequence
27478
- > Activity Contract table with columns: Seq, 5E Phase (Engage, Explore, Explain, Elaborate, Evaluate), Activity Type, Actor, Purpose, Student Action, Teacher Move, Output/Evidence, LO, Time, Artifact Contract.
27479
-
27480
- ### 3. Resource Map
27481
- ### 4. Assessment Map
27482
- ### 5. Artifact Contract & Code Symbol Ledger
27483
- - **Primary Struct / Class / Component:** [Explicit canonical identifier e.g. MainComponent]
27484
- - **Entry Source File:** [Explicit file name e.g. MainComponent.ext]
27485
- - **Key Functions & State Variables:** [Canonical identifiers used across all student activities]
27486
- - **Artifact Specifications:** [Deliverable requirements for ACT, SLIDE, QUIZ, GUIDE, WKS, CODE, EXT]
27487
-
27488
- ---
27489
-
27490
- ## [REQUIRED] B. Lesson Flow
27491
-
27492
- ### 1. ENGAGE \u2014 [10 mins] (High-Stakes Hook Scenario, Inquiry Question, Transition)
27493
- ### 2. EXPLORE \u2014 [20 mins] (Inquiry-Based Discovery, Hands-on Sandbox)
27494
- ### 3. EXPLAIN \u2014 [25 mins] (Core Definitions, Relatable Analogies, Mermaid Diagram & Code Blueprints)
27495
- ### 4. ELABORATE \u2014 [25 mins] (3-Tier Differentiated Scaffolding: \u{1F949} Bronze, \u{1F948} Silver, \u{1F947} Gold tasks)
27496
- ### 5. EVALUATE \u2014 [10 mins] (Exit Ticket, Metacognitive Reflection)
27497
-
25760
+ ${sectionsYaml}
25761
+ type: "${artifactType}"
27498
25762
  ---
27499
-
27500
- ## [REQUIRED] Artifact Linkage (Master Index)
27501
- Linkage ledger mapping all satellite artifacts (\`GUIDE_...\`, \`SLIDE_...\`, \`HANDOUT_...\`, \`ACT_...\`, \`WKS_...\`, \`QUIZ_...\`, \`EXT_...\`).
27502
-
27503
- 3. Ensure all sample code and syntax are 100% verified and runnable.
27504
- 4. Output 100% clean Markdown directly.`;
27505
- }
25763
+ 2. Fill in the template body below. Keep every header EXACTLY as written
25764
+ ([REQUIRED]/[CONDITIONAL] markers and canonical English headings included)
25765
+ and respect the template's OWNERSHIP note: each fact lives in exactly ONE
25766
+ section \u2014 never restate satellite lists, resources, or assessment content
25767
+ across sections, and never embed KX-owned question banks or self-check text.
25768
+ 3. Use the exact vocabulary of the canonical knowledge context for every
25769
+ concept and term.
25770
+ ${NO_VERBATIM_COPYING}`;
27506
25771
  const langDirective = buildLanguageDirective(targetLanguage);
27507
25772
  const headingDirective = buildHeadingDirective(
27508
25773
  pedagogy === "edp" ? "LESSON_EDP" : pedagogy === "general" || pedagogy === "pbl" ? "LESSON_GENERAL" : "LESSON_5E",
27509
25774
  sectionLanguageContract,
27510
25775
  targetLanguage
27511
25776
  );
27512
- return `${prompt}
25777
+ const body = buildArtifactPrompt({ directive, templateFile });
25778
+ return `${body}
27513
25779
 
27514
25780
  ${langDirective}${headingDirective ? `
27515
25781
 
@@ -28256,10 +26522,10 @@ ${currentContent}` }],
28256
26522
  if (artifactScope.includes("ACT") && (!existingAct || force || isStaleVsPlan(existingAct))) {
28257
26523
  onProgress?.("@activity", `[2/4] Authoring Hands-on Lab: \`ACT_${lessonCode}.md\`...`);
28258
26524
  const actDateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
28259
- const actPrompt = `You are @activity (Lead Hands-on STEM & Laboratory Exercise Designer).
26525
+ const actDirective = `You are @activity (Lead Hands-on STEM & Laboratory Exercise Designer).
28260
26526
  Based on Master Lesson Plan \`LESSON_${lessonCode}.md\`, author the comprehensive hands-on lab guide: \`ACT_${lessonCode}.md\`.
28261
26527
 
28262
- Mandatory Format Requirements:
26528
+ Format requirements:
28263
26529
  1. EXACT YAML Frontmatter \u2014 copy verbatim, then fill in the blanks:
28264
26530
  ---
28265
26531
  id: "ACT_${lessonCode}"
@@ -28280,17 +26546,14 @@ template_required_sections:
28280
26546
  - "Reflection"
28281
26547
  ---
28282
26548
 
28283
- 2. Mandatory sections (matching ACT_template.md):
28284
- - ## [REQUIRED] Computational Thinking Focus (Problem statement, decomposition, algorithm design)
28285
- - ## [REQUIRED] Materials & Setup (Hardware BOM with <!-- [HARDWARE_BOM] --> marker, software, consumables)
28286
- - ## [REQUIRED] Constraints & Safety (Technical/safety warnings, design constraints)
28287
- - ## [REQUIRED] Active Learning Workflow with 3 phases:
28288
- - ### Phase 1: Planning & Design
28289
- - ### Phase 2: Implementation & Discovery
28290
- - ### Phase 3: Debugging & Testing
28291
- - ## [REQUIRED] 3-Tier Differentiation (Bronze/Silver/Gold tasks)
28292
- - ## [REQUIRED] Reflection (Discussion question)
28293
- 3. Output 100% clean Markdown directly \u2014 NO code fences around the document.
26549
+ 2. Fill in the ACT template body below. Keep every header EXACTLY as written.
26550
+ Physical hardware belongs inside the \`<!-- [HARDWARE_BOM] -->\` marker ONLY
26551
+ when this lesson's activity contract involves physical wiring; otherwise
26552
+ list software/consumables only.
26553
+ 3. Expand the Activity Contract rows the LESSON assigns to this artifact \u2014 do
26554
+ not invent a different sequence.
26555
+ ${NO_VERBATIM_COPYING}`;
26556
+ const actPrompt = `${buildArtifactPrompt({ directive: actDirective, templateFile: "ACT_template.md" })}
28294
26557
 
28295
26558
  ${languageDirective}
28296
26559
 
@@ -28327,7 +26590,7 @@ ${buildHeadingDirective("ACT", slcMarkdown, targetLang)}`;
28327
26590
  if (artifactScope.includes("QUIZ") && (!existingQuiz || force || isStaleVsPlan(existingQuiz))) {
28328
26591
  onProgress?.("@assessor", `[3/4] Authoring Assessment Bank: \`QUIZ_${lessonCode}.md\`...`);
28329
26592
  const quizDateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
28330
- const quizPrompt = `You are @assessor (Lead Psychometrician & Competency Assessment Specialist).
26593
+ const quizDirective = `You are @assessor (Lead Psychometrician & Competency Assessment Specialist).
28331
26594
  Based on Master Lesson Plan \`LESSON_${lessonCode}.md\`, author the scenario-based diagnostic question bank: \`QUIZ_${lessonCode}.md\`.
28332
26595
 
28333
26596
  SCOPE & PACING (prompt audit S-6):
@@ -28335,7 +26598,7 @@ SCOPE & PACING (prompt audit S-6):
28335
26598
  - Size the bank to fit the session's Wrap-up (~10 minutes of answering): the MCQ bank, code-tracing question, and rubric together must be completable by a student in that time.
28336
26599
  - Question ONLY concepts inside this session's scope (see SESSION SLICE + ALLOWED DESIGN SPACE in the context).
28337
26600
 
28338
- Mandatory Format Requirements:
26601
+ Format requirements:
28339
26602
  1. EXACT YAML Frontmatter \u2014 copy verbatim, then fill in the blanks:
28340
26603
  ---
28341
26604
  id: "QUIZ_${lessonCode}"
@@ -28354,13 +26617,14 @@ template_required_sections:
28354
26617
  - "Competency Rubric"
28355
26618
  ---
28356
26619
 
28357
- 2. Mandatory sections (matching QUIZ_v4.6_template.md):
28358
- - ## 1. Metadata Specs (Lesson ID, Bloom target levels, language)
28359
- - ## [REQUIRED] Assessment Objectives (Bloom taxonomy aligned goals for each LO)
28360
- - ## [REQUIRED] Multiple-Choice Question Bank (\u22655 scenario-based 4-option questions with: Question text, A/B/C/D options, Correct answer, Bloom level, Detailed distractor rationale)
28361
- - ## [REQUIRED] Code Analysis / Debugging Question (1 deep code tracing question requiring students to predict output or identify bugs)
28362
- - ## [REQUIRED] Competency Rubric (4-tier matrix: Developing \u2192 Proficient \u2192 Advanced \u2192 Exemplary)
28363
- 3. Output 100% clean Markdown directly \u2014 NO code fences around the document.
26620
+ 2. Fill in the QUIZ template body below. Keep every header EXACTLY as written.
26621
+ The Assessment Objectives table MUST reuse the LESSON A1 Learning
26622
+ Objectives verbatim \u2014 same Bloom verbs, same evidence. Do NOT re-target the
26623
+ Bloom level (drift guard: quiz Bloom = lesson Bloom).
26624
+ 3. Every distractor must be a real misconception from this lesson's Common
26625
+ Mistakes \u2014 never random filler.
26626
+ ${NO_VERBATIM_COPYING}`;
26627
+ const quizPrompt = `${buildArtifactPrompt({ directive: quizDirective, templateFile: "QUIZ_v4.6_template.md" })}
28364
26628
 
28365
26629
  ${languageDirective}
28366
26630
 
@@ -28535,10 +26799,10 @@ footer: "Curriculum OS \u2022 ${lessonCode} (${pedagogyLabel})"
28535
26799
  if (artifactScope.includes("GUIDE") && (!existingGuide || force || isStaleVsPlan(existingGuide))) {
28536
26800
  onProgress?.("@content", `Authoring Teacher Guide: \`GUIDE_${lessonCode}.md\`...`, { artifactType: "GUIDE" });
28537
26801
  const guideDateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
28538
- const guidePrompt = `You are @content (Senior Curriculum Developer & Teacher Facilitation Specialist).
26802
+ const guideDirective = `You are @content (Senior Curriculum Developer & Teacher Facilitation Specialist).
28539
26803
  Based on Master Lesson Plan \`LESSON_${lessonCode}.md\` and pedagogical context, author the comprehensive Teacher Guide: \`GUIDE_${lessonCode}.md\`.
28540
26804
 
28541
- Mandatory Format Requirements:
26805
+ Format requirements:
28542
26806
  1. EXACT YAML Frontmatter \u2014 copy verbatim, then fill in the blanks:
28543
26807
  ---
28544
26808
  id: "GUIDE_${lessonCode}"
@@ -28550,15 +26814,22 @@ deliverable: "P3-T5"
28550
26814
  version: "v1.0"
28551
26815
  date: "${guideDateStr}"
28552
26816
  template_contract: "artifact-template-v1"
26817
+ template_required_sections:
26818
+ - "Objectives & Preparation"
26819
+ - "Preparation Checklist & Workstation Setup"
26820
+ - "Facilitation Script & Timeline"
26821
+ - "Common Misconceptions & Diagnostic Remediation Matrix"
26822
+ - "Differentiated Support Strategies"
28553
26823
  ---
28554
26824
 
28555
- 2. Mandatory sections (matching GUIDE_template.md):
28556
- - ## [REQUIRED] Objectives & Preparation (Pedagogical goal, common blindspots, technical checklist)
28557
- - ## [REQUIRED] Preparation Checklist & Workstation Setup
28558
- - ## [REQUIRED] Facilitation Script & Timeline (Phase-by-phase teacher moves, inquiry questions, transitions)
28559
- - ## [REQUIRED] Common Misconceptions & Diagnostic Remediation Matrix
28560
- - ## [REQUIRED] Differentiated Support Strategies (Support scaffolds vs Extension challenges)
28561
- 3. Output 100% clean Markdown directly \u2014 NO code fences around the document.
26825
+ 2. Fill in the GUIDE template body below. Keep every header EXACTLY as written.
26826
+ - The Facilitation timeline MUST mirror the LESSON B-flow phase-by-phase \u2014
26827
+ same phases, same minutes. Do not invent a different allocation.
26828
+ - Misconceptions have ONE home: the Remediation Matrix. Extract the Common
26829
+ Mistakes table VERBATIM from the canonical knowledge context; do not
26830
+ restate them in Objectives & Preparation.
26831
+ ${NO_VERBATIM_COPYING}`;
26832
+ const guidePrompt = `${buildArtifactPrompt({ directive: guideDirective, templateFile: "GUIDE_template.md" })}
28562
26833
 
28563
26834
  ${languageDirective}
28564
26835
 
@@ -28587,10 +26858,10 @@ ${buildHeadingDirective("GUIDE", slcMarkdown, targetLang)}`;
28587
26858
  if (artifactScope.includes("HANDOUT") && (!existingHandout || force || isStaleVsPlan(existingHandout))) {
28588
26859
  onProgress?.("@content", `Authoring Student Handout: \`HANDOUT_${lessonCode}.md\`...`, { artifactType: "HANDOUT" });
28589
26860
  const handoutDateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
28590
- const handoutPrompt = `You are @content (Educational Content Specialist).
26861
+ const handoutDirective = `You are @content (Educational Content Specialist).
28591
26862
  Based on Master Lesson Plan \`LESSON_${lessonCode}.md\`, author the student self-paced reference handout: \`HANDOUT_${lessonCode}.md\`.
28592
26863
 
28593
- Mandatory Format Requirements:
26864
+ Format requirements:
28594
26865
  1. EXACT YAML Frontmatter \u2014 copy verbatim, then fill in the blanks:
28595
26866
  ---
28596
26867
  id: "HANDOUT_${lessonCode}"
@@ -28602,15 +26873,19 @@ deliverable: "P3-T6"
28602
26873
  version: "v1.0"
28603
26874
  date: "${handoutDateStr}"
28604
26875
  template_contract: "artifact-template-v1"
26876
+ template_required_sections:
26877
+ - "Core Concepts"
26878
+ - "Core Syntax & Mechanism Cheat Sheet"
26879
+ - "Visual Mental Model / Architecture Diagram"
26880
+ - "Step-by-Step Practical Quick-Start Guide"
26881
+ - "Self-Check Diagnostic Checklist"
28605
26882
  ---
28606
26883
 
28607
- 2. Mandatory sections (matching HANDOUT_template.md):
28608
- - ## [REQUIRED] \u{1F4D6} Core Concepts (Key terms, definitions, and student-friendly explanations)
28609
- - ## [REQUIRED] Core Syntax & Mechanism Cheat Sheet (Quick-scan reference table)
28610
- - ## [REQUIRED] Visual Mental Model / Architecture Diagram (Mermaid or ASCII diagram)
28611
- - ## [REQUIRED] Step-by-Step Practical Quick-Start Guide
28612
- - ## [REQUIRED] Self-Check Diagnostic Checklist (Can-do statements for student self-assessment)
28613
- 3. Output 100% clean Markdown directly \u2014 NO code fences around the document.
26884
+ 2. Fill in the HANDOUT template body below. Keep every header EXACTLY as
26885
+ written. Align term definitions with the canonical knowledge context (KX
26886
+ Key Terms) and can-do statements with the LESSON A1 evidence column.
26887
+ ${NO_VERBATIM_COPYING}`;
26888
+ const handoutPrompt = `${buildArtifactPrompt({ directive: handoutDirective, templateFile: "HANDOUT_template.md" })}
28614
26889
 
28615
26890
  ${languageDirective}
28616
26891
 
@@ -28639,10 +26914,10 @@ ${buildHeadingDirective("HANDOUT", slcMarkdown, targetLang)}`;
28639
26914
  if (artifactScope.includes("WKS") && (!existingWks || force || isStaleVsPlan(existingWks))) {
28640
26915
  onProgress?.("@content", `Authoring Student Worksheet: \`WKS_${lessonCode}.md\`...`, { artifactType: "WKS" });
28641
26916
  const wksDateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
28642
- const wksPrompt = `You are @content (Instructional Activity & Worksheet Designer).
26917
+ const wksDirective = `You are @content (Instructional Activity & Worksheet Designer).
28643
26918
  Based on Master Lesson Plan \`LESSON_${lessonCode}.md\`, author the guided student worksheet: \`WKS_${lessonCode}.md\`.
28644
26919
 
28645
- Mandatory Format Requirements:
26920
+ Format requirements:
28646
26921
  1. EXACT YAML Frontmatter \u2014 copy verbatim, then fill in the blanks:
28647
26922
  ---
28648
26923
  id: "WKS_${lessonCode}"
@@ -28654,19 +26929,19 @@ deliverable: "P3-T7"
28654
26929
  version: "v1.0"
28655
26930
  date: "${wksDateStr}"
28656
26931
  template_contract: "artifact-template-v1"
26932
+ template_required_sections:
26933
+ - "Part 1: Knowledge Check"
26934
+ - "Part 2: Concept Tracing & Diagram Fill-in"
26935
+ - "Part 3: Code Analysis & Bug Hunting Challenge"
26936
+ - "Part 4: Synthesis & Problem-Solving Application"
26937
+ - "Part 5: Self-Reflection & Learning Log"
28657
26938
  ---
28658
26939
 
28659
- **Student Name:** _______________________ **Class:** _______________ **Date:** _______________
28660
-
28661
- > **For Students:** This document guides you step-by-step through the practical tasks. Read carefully, fill in the blanks, and mark the checkbox [x] once completed. If you encounter errors, refer back to your **HANDOUT**.
28662
-
28663
- 2. Mandatory sections (matching WKS_template.md):
28664
- - ## [REQUIRED] Part 1: Knowledge Check (Warm-up \u2014 Prior knowledge retrieval tasks)
28665
- - ## [REQUIRED] Part 2: Concept Tracing & Diagram Fill-in
28666
- - ## [REQUIRED] Part 3: Code Analysis & Bug Hunting Challenge
28667
- - ## [REQUIRED] Part 4: Synthesis & Problem-Solving Application
28668
- - ## [REQUIRED] Part 5: Self-Reflection & Learning Log
28669
- 3. Output 100% clean Markdown directly \u2014 NO code fences around the document.
26940
+ 2. Fill in the WKS template body below (including the student name/class/date
26941
+ header line). Keep every header EXACTLY as written. The Part 3 bug must be
26942
+ a real mistake from this lesson's Common Mistakes table.
26943
+ ${NO_VERBATIM_COPYING}`;
26944
+ const wksPrompt = `${buildArtifactPrompt({ directive: wksDirective, templateFile: "WKS_template.md" })}
28670
26945
 
28671
26946
  ${languageDirective}
28672
26947
 
@@ -28695,10 +26970,10 @@ ${buildHeadingDirective("WKS", slcMarkdown, targetLang)}`;
28695
26970
  if ((artifactScope.includes("CODE") || artifactScope.includes("CODE_LAB")) && (!existingCode || force || isStaleVsPlan(existingCode))) {
28696
26971
  onProgress?.("@activity", `Authoring Executable Code Lab: \`CODE_${lessonCode}.md\`...`, { artifactType: "CODE" });
28697
26972
  const codeDateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
28698
- const codePrompt = `You are @activity & @tech_sme (Lead Software Engineer & Technical SME).
26973
+ const codeDirective = `You are @activity & @tech_sme (Lead Software Engineer & Technical SME).
28699
26974
  Based on Master Lesson Plan \`LESSON_${lessonCode}.md\`, hardware platform, and starter code requirements, author the comprehensive executable Code Lab: \`CODE_${lessonCode}.md\`.
28700
26975
 
28701
- Mandatory Format Requirements:
26976
+ Format requirements:
28702
26977
  1. EXACT YAML Frontmatter \u2014 copy verbatim, then fill in the blanks:
28703
26978
  ---
28704
26979
  id: "CODE_${lessonCode}"
@@ -28719,14 +26994,17 @@ template_required_sections:
28719
26994
  - "Common Syntax & Runtime Pitfalls Matrix"
28720
26995
  ---
28721
26996
 
28722
- 2. Mandatory sections:
28723
- - ## [REQUIRED] Technical Overview & Architecture Blueprint
28724
- - ## [REQUIRED] Hardware Pinout & Wiring Configuration Matrix
28725
- - ## [REQUIRED] Starter Code Sandbox (Skeleton code with explicit TODO comments for students)
28726
- - ## [REQUIRED] Verified Reference Solution Code (100% syntactically valid, production-ready, fully commented)
28727
- - ## [REQUIRED] Automated Test / Verification Script (How to compile, flash, or unit test)
28728
- - ## [REQUIRED] Common Syntax & Runtime Pitfalls Matrix
28729
- 3. Output 100% clean Markdown directly with runnable code snippets \u2014 NO outer code fences around the document.
26997
+ 2. Fill in the CODE template body below. Keep every header EXACTLY as written.
26998
+ - The Hardware Pinout & Wiring section is [CONDITIONAL]: include it ONLY
26999
+ when this lesson's activity contract involves physical hardware wiring.
27000
+ For pure-software lessons OMIT the entire section \u2014 never emit placeholder
27001
+ wiring tables.
27002
+ - Starter/Solution code MUST implement the exact Activity Contract rows the
27003
+ LESSON assigns to CODE_LAB, using the LESSON Code Symbol Ledger
27004
+ identifiers verbatim.
27005
+ 3. Output runnable code snippets \u2014 NO outer code fences around the document.
27006
+ ${NO_VERBATIM_COPYING}`;
27007
+ const codePrompt = `${buildArtifactPrompt({ directive: codeDirective, templateFile: "CODE_template.md" })}
28730
27008
 
28731
27009
  ${languageDirective}
28732
27010
 
@@ -32077,7 +30355,8 @@ var DeterministicStructuralLinter = class {
32077
30355
  const hasHeavyTech = heavyKeywords.some((k) => allTechStrings.includes(k));
32078
30356
  if (hasHeavyTech) {
32079
30357
  const declaredStrategy = scope?.provisioning_strategy || scope?.provisioning_model || graph.project?.provisioning_strategy;
32080
- const isValidStrategy = ENVIRONMENT_PROVISIONING_MODELS.includes(declaredStrategy);
30358
+ const normalizedStrategy = String(declaredStrategy || "").trim().toUpperCase().replace(/[-\s]/g, "_");
30359
+ const isValidStrategy = ENVIRONMENT_PROVISIONING_MODELS.includes(normalizedStrategy);
32081
30360
  if (!isValidStrategy) {
32082
30361
  score -= 15;
32083
30362
  findings.push({
@@ -32089,7 +30368,7 @@ var DeterministicStructuralLinter = class {
32089
30368
  remediationAdvice: `Specify provisioning_strategy as PRE_INSTALLED_LAB, CLOUD_MANAGED, or DEDICATED_SETUP to ensure classroom feasibility.`
32090
30369
  });
32091
30370
  } else {
32092
- strengths.push(`Heavy technology stack backed by explicit provisioning model: ${declaredStrategy}`);
30371
+ strengths.push(`Heavy technology stack backed by explicit provisioning model: ${normalizedStrategy}`);
32093
30372
  }
32094
30373
  }
32095
30374
  score = Math.max(0, Math.min(100, score));
@@ -33743,9 +32022,7 @@ exports.ActivityStepSchema = ActivityStepSchema;
33743
32022
  exports.ArtifactContractRowSchema = ArtifactContractRowSchema;
33744
32023
  exports.AssessmentMapRowSchema = AssessmentMapRowSchema;
33745
32024
  exports.AssessmentObjectiveSchema = AssessmentObjectiveSchema;
33746
- exports.BELL_RINGER_TEMPLATE = BELL_RINGER_TEMPLATE;
33747
32025
  exports.BLOOM_ACTION_VERBS = BLOOM_ACTION_VERBS;
33748
- exports.BOM_TEMPLATE = BOM_TEMPLATE;
33749
32026
  exports.BUNDLED_STANDARDS_PACK_IDS = BUNDLED_STANDARDS_PACK_IDS;
33750
32027
  exports.BellRingerDaySchema = BellRingerDaySchema;
33751
32028
  exports.BellRingerSchema = BellRingerSchema;
@@ -33754,7 +32031,6 @@ exports.BloomLevelSchema = BloomLevelSchema;
33754
32031
  exports.BloomTaxonomyEvaluator = BloomTaxonomyEvaluator;
33755
32032
  exports.BronzeTierSchema = BronzeTierSchema;
33756
32033
  exports.CERConclusionSchema = CERConclusionSchema;
33757
- exports.CHOICE_BOARD_TEMPLATE = CHOICE_BOARD_TEMPLATE;
33758
32034
  exports.CODE_LAB_TEMPLATE = CODE_LAB_TEMPLATE;
33759
32035
  exports.CURRICULUM_SLASH_COMMANDS = CURRICULUM_SLASH_COMMANDS;
33760
32036
  exports.CardTierEnum = CardTierEnum;
@@ -33795,9 +32071,7 @@ exports.DiagnosticQuestionSchema = DiagnosticQuestionSchema;
33795
32071
  exports.DiagnosticQuizSchema = DiagnosticQuizSchema;
33796
32072
  exports.EDPPhaseEnum = EDPPhaseEnum;
33797
32073
  exports.ENVIRONMENT_PROVISIONING_MODELS = ENVIRONMENT_PROVISIONING_MODELS;
33798
- exports.EXIT_TICKET_TEMPLATE = EXIT_TICKET_TEMPLATE;
33799
32074
  exports.EXPOSITION_REL = EXPOSITION_REL;
33800
- exports.EXT_TEMPLATE = EXT_TEMPLATE;
33801
32075
  exports.EntryLevelSchema = EntryLevelSchema;
33802
32076
  exports.ExitTicketBugHuntSchema = ExitTicketBugHuntSchema;
33803
32077
  exports.ExitTicketMetacognitionSchema = ExitTicketMetacognitionSchema;
@@ -33816,8 +32090,6 @@ exports.FrameworkMappingSchema = FrameworkMappingSchema;
33816
32090
  exports.FrameworkPackManifestSchema = FrameworkPackManifestSchema;
33817
32091
  exports.FrameworkPackSchema = FrameworkPackSchema;
33818
32092
  exports.FrameworkStatementSchema = FrameworkStatementSchema;
33819
- exports.GLOSSARY_TEMPLATE = GLOSSARY_TEMPLATE;
33820
- exports.GRAPHIC_ORGANIZER_TEMPLATE = GRAPHIC_ORGANIZER_TEMPLATE;
33821
32093
  exports.GlossaryQuickRefRowSchema = GlossaryQuickRefRowSchema;
33822
32094
  exports.GlossarySchema = GlossarySchema;
33823
32095
  exports.GlossaryTermSchema = GlossaryTermSchema;
@@ -33825,7 +32097,6 @@ exports.GoldTierSchema = GoldTierSchema;
33825
32097
  exports.GradeBandSchema = GradeBandSchema;
33826
32098
  exports.GraphicOrganizerItemSchema = GraphicOrganizerItemSchema;
33827
32099
  exports.GraphicOrganizerSchema = GraphicOrganizerSchema;
33828
- exports.HANDOUT_TEMPLATE = HANDOUT_TEMPLATE;
33829
32100
  exports.HandoutSchema = HandoutSchema;
33830
32101
  exports.HandoutSectionSchema = HandoutSectionSchema;
33831
32102
  exports.InstructionSectionSchema = InstructionSectionSchema;
@@ -33864,7 +32135,6 @@ exports.MisconceptionSchema = MisconceptionSchema;
33864
32135
  exports.ModelPolicyResolver = ModelPolicyResolver;
33865
32136
  exports.NodeKindSchema = NodeKindSchema;
33866
32137
  exports.OrganizerTypeEnum = OrganizerTypeEnum;
33867
- exports.PROJECT_INSTRUCTION_TEMPLATE = PROJECT_INSTRUCTION_TEMPLATE;
33868
32138
  exports.PhaseInputSchema = PhaseInputSchema;
33869
32139
  exports.PlanConstraintsSchema = PlanConstraintsSchema;
33870
32140
  exports.PlannerInputSchema = PlannerInputSchema;
@@ -33881,8 +32151,6 @@ exports.ProjectProfileSchema = ProjectProfileSchema;
33881
32151
  exports.QUIZ_TEMPLATE = QUIZ_TEMPLATE;
33882
32152
  exports.QualityAuditVerdictSchema = QualityAuditVerdictSchema;
33883
32153
  exports.QuizOptionSchema = QuizOptionSchema;
33884
- exports.REVIEW_GAME_TEMPLATE = REVIEW_GAME_TEMPLATE;
33885
- exports.RUBRIC_TEMPLATE = RUBRIC_TEMPLATE;
33886
32154
  exports.RecordProvenanceSchema = RecordProvenanceSchema;
33887
32155
  exports.ResourceMapRowSchema = ResourceMapRowSchema;
33888
32156
  exports.ReviewGameExportRowSchema = ReviewGameExportRowSchema;
@@ -33893,14 +32161,10 @@ exports.RotationStationSchema = RotationStationSchema;
33893
32161
  exports.RubricCriteriaSchema = RubricCriteriaSchema;
33894
32162
  exports.RubricSchema = RubricSchema;
33895
32163
  exports.SATELLITE_LESSON_PRIORITIES = SATELLITE_LESSON_PRIORITIES;
33896
- exports.SCIENCE_LAB_TEMPLATE = SCIENCE_LAB_TEMPLATE;
33897
32164
  exports.SELF_LAB_TEMPLATE = SELF_LAB_TEMPLATE;
33898
32165
  exports.SLIDE_CANONICAL_METHODOLOGY = SLIDE_CANONICAL_METHODOLOGY;
33899
- exports.SLIDE_LAYOUT_PRESETS = SLIDE_LAYOUT_PRESETS;
33900
- exports.SLIDE_TEMPLATE = SLIDE_TEMPLATE;
33901
32166
  exports.STANDARD_REF_REGEX = STANDARD_REF_REGEX;
33902
32167
  exports.STANDARD_SOT_FILES = STANDARD_SOT_FILES;
33903
- exports.STATION_ROTATION_TEMPLATE = STATION_ROTATION_TEMPLATE;
33904
32168
  exports.STUDENT_FRICTION_MULTIPLIER = STUDENT_FRICTION_MULTIPLIER;
33905
32169
  exports.ScaffoldDecisionEntrySchema = ScaffoldDecisionEntrySchema;
33906
32170
  exports.ScaffoldDecisionSchema = ScaffoldDecisionSchema;
@@ -33919,9 +32183,6 @@ exports.StationRecordRowSchema = StationRecordRowSchema;
33919
32183
  exports.StationRotationSchema = StationRotationSchema;
33920
32184
  exports.StationTypeEnum = StationTypeEnum;
33921
32185
  exports.SupabaseCurriculumAdapter = SupabaseCurriculumAdapter;
33922
- exports.TASK_CARDS_TEMPLATE = TASK_CARDS_TEMPLATE;
33923
- exports.TEACHER_GUIDE_TEMPLATE = TEACHER_GUIDE_TEMPLATE;
33924
- exports.TIERED_PRACTICE_TEMPLATE = TIERED_PRACTICE_TEMPLATE;
33925
32186
  exports.TaskCardSchema = TaskCardSchema;
33926
32187
  exports.TaskCardsSchema = TaskCardsSchema;
33927
32188
  exports.TeacherGuideSchema = TeacherGuideSchema;
@@ -33934,7 +32195,6 @@ exports.TroubleshootingEntrySchema = TroubleshootingEntrySchema;
33934
32195
  exports.TroubleshootingRowSchema = TroubleshootingRowSchema;
33935
32196
  exports.UnitPlanSchema = UnitPlanSchema;
33936
32197
  exports.UserJourneySchema = UserJourneySchema;
33937
- exports.WORKSHEET_TEMPLATE = WORKSHEET_TEMPLATE;
33938
32198
  exports.WalkingSkeletonSchema = WalkingSkeletonSchema;
33939
32199
  exports.WorksheetItemSchema = WorksheetItemSchema;
33940
32200
  exports.WorksheetItemTypeEnum = WorksheetItemTypeEnum;
@@ -33953,6 +32213,7 @@ exports.auditCurriculumQualityFlow = auditCurriculumQualityFlow;
33953
32213
  exports.auditProjectGraphFlow = auditProjectGraphFlow;
33954
32214
  exports.auditQualityReport = auditQualityReport;
33955
32215
  exports.buildActivityPrompt = buildActivityPrompt;
32216
+ exports.buildArtifactPrompt = buildArtifactPrompt;
33956
32217
  exports.buildCodeLabPrompt = buildCodeLabPrompt;
33957
32218
  exports.buildConceptPrerequisites = buildConceptPrerequisites;
33958
32219
  exports.buildCurriculumContext = buildCurriculumContext;
@@ -34019,8 +32280,10 @@ exports.exportAllProjectQuizzes = exportAllProjectQuizzes;
34019
32280
  exports.expositionCacheKey = expositionCacheKey;
34020
32281
  exports.extractActivityContractRows = extractActivityContractRows;
34021
32282
  exports.extractAssessmentMap = extractAssessmentMap;
32283
+ exports.extractBodySections = extractBodySections;
34022
32284
  exports.extractCurriculumHorizon = extractCurriculumHorizon;
34023
32285
  exports.extractJsonArray = extractJsonArray;
32286
+ exports.extractRequiredSections = extractRequiredSections;
34024
32287
  exports.extractScopeSequenceRows = extractScopeSequenceRows;
34025
32288
  exports.extractSectionHeadingsFromSLC = extractSectionHeadingsFromSLC;
34026
32289
  exports.extractSessionSlice = extractSessionSlice;
@@ -34059,8 +32322,6 @@ exports.getDesignatedFallbackConfig = getDesignatedFallbackConfig;
34059
32322
  exports.getLessonMetadata = getLessonMetadata;
34060
32323
  exports.getProjectArtifactScope = getProjectArtifactScope;
34061
32324
  exports.getProjectStatusReport = getProjectStatusReport;
34062
- exports.getSlideLayoutPresetById = getSlideLayoutPresetById;
34063
- exports.getSlideLayoutPresetsByCategory = getSlideLayoutPresetsByCategory;
34064
32325
  exports.getSmartResumeContext = getSmartResumeContext;
34065
32326
  exports.glossaryTermsForSession = glossaryTermsForSession;
34066
32327
  exports.illustratorTools = illustratorTools;
@@ -34097,6 +32358,7 @@ exports.renderHorizonPromptBlock = renderHorizonPromptBlock;
34097
32358
  exports.renderMediaPlaceholder = renderMediaPlaceholder;
34098
32359
  exports.researcherTools = researcherTools;
34099
32360
  exports.resolveApiKey = resolveApiKey;
32361
+ exports.resolveArtifactTemplate = resolveArtifactTemplate;
34100
32362
  exports.resolveGateSettings = resolveGateSettings;
34101
32363
  exports.resolveStandardsPacks = resolveStandardsPacks;
34102
32364
  exports.resolveStreamBudget = resolveStreamBudget;
@@ -34124,6 +32386,7 @@ exports.streamLayerPrefillWithFallback = streamLayerPrefillWithFallback;
34124
32386
  exports.streamLessonMasterFlow = streamLessonMasterFlow;
34125
32387
  exports.streamSelfLabFlow = streamSelfLabFlow;
34126
32388
  exports.stripLlmJsonWrappers = stripLlmJsonWrappers;
32389
+ exports.stripTemplateFrontmatter = stripTemplateFrontmatter;
34127
32390
  exports.targetLanguageDisplayName = targetLanguageDisplayName;
34128
32391
  exports.techSmeTools = techSmeTools;
34129
32392
  exports.topoSort = topoSort;