|
29 | 29 | - [ ] 1.1.2.5. Allow "invisible" arcs |
30 | 30 | - 1.1.2.5.1. Arcs can be defined as consisting of exactly 1 module each |
31 | 31 | - 1.1.2.5.2. In this scenario, the UI should obscure any reference to Arcs whilst still preserving them in the data structure |
32 | | -- [ ] 1.1.2.6. `ModuleGenerationList.svelte` is 895 lines; split it into smaller components: |
33 | | - - 1.1.2.6.1. `ArcSection.svelte`: arc header + module list |
34 | | - - 1.1.2.6.2. `ModuleCard.svelte`: individual module with status/actions |
35 | | - - 1.1.2.6.3. `ModulePreviewModal.svelte`: preview functionality |
36 | | - - 1.1.2.6.4. `ProgressSummary.svelte`: statistics and progress bar |
37 | | -- [ ] 1.1.2.7. Fix Duplicate Store Updates |
38 | | - - 1.1.2.7.1. The pattern of finding and updating modules is repeated multiple times |
39 | | - - 1.1.2.7.1.1. lines 74-82 |
40 | | - - 1.1.2.7.1.2. lines 195-211 |
41 | | - - 1.1.2.7.1.3. lines 221-236 |
42 | | - - 1.1.2.7.2.Extract to a utility |
43 | | -- [ ] 1.1.2.8. Timeout values (`src/routes/api/themis/module/+server.ts:52`) should be extracted to constants |
| 32 | +- [ ] 1.1.2.6. Timeout values (`src/routes/api/themis/module/+server.ts:52`) should be extracted to constants |
44 | 33 | - [ ] 1.1.2.9. Fix Race Condition in SSE Stream Cleanup |
45 | 34 | - 1.1.2.9.1. In `ModuleGenerationList.svelte:160-162`, the reader is removed from `activeReaders` in a `finally` block but, if `onDestroy` runs concurrently with a completing stream, the `reader.cancel()` call might fail or leave streams in an inconsistent state. |
46 | 35 | - [ ] 1.1.2.10. Fix SSE Parsing Vulnerability |
|
63 | 52 | --- |
64 | 53 |
|
65 | 54 | ## 2. MVP Milestones |
66 | | -- [ ] 2.1. Break over-large `/Themis` components into subcomponents |
67 | | -- [ ] 2.2. Radically improve module-to-module coherence at generation |
68 | | - - 2.2.1. **IMPORTANT:** confer with user to understand requirements |
69 | | - - 2.2.2. Insert interstitial step: generating module overviews first, allowing later generation of full module spec |
70 | | - - 2.2.3. Cumulatively build a reference snipped on what learners will already know by the time a module starts, then pass that snippet to Metis |
71 | | - - 2.2.4. Separate all prompt snippets into separate files for increased visibility to devs |
72 | | -- [ ] 2.3. Add Course XML Schema and Validator 📋 PENDING |
| 55 | +- [ ] 2.1. Radically improve module-to-module coherence at generation |
| 56 | + - 2.1.1. **IMPORTANT:** confer with user to understand requirements |
| 57 | + - 2.1.2. Insert interstitial step: generating module overviews first, allowing later generation of full module spec |
| 58 | + - 2.1.3. Cumulatively build a reference snipped on what learners will already know by the time a module starts, then pass that snippet to Metis |
| 59 | + - 2.1.4. Separate all prompt snippets into separate files for increased visibility to devs |
| 60 | +- [ ] 2.2. Add Course XML Schema and Validator 📋 PENDING |
73 | 61 | - Define course-level XML schema wrapping multiple modules |
74 | 62 | - Validation for complete course structure |
75 | 63 | - Include course narratives and metadata |
76 | 64 | - **Why eleventh:** Ensures exported courses meet quality standards |
77 | 65 | - **Status:** Not yet started - will reuse existing validation patterns |
78 | 66 | - **Note:** Current export uses Theia service which handles course-to-markdown/HTML conversion |
79 | | -- [ ] 2.4. Implement Export Functionality 📋 PENDING |
| 67 | +- [ ] 2.3. Implement Export Functionality 📋 PENDING |
80 | 68 | - XML export for complete course |
81 | 69 | - PDF export option (stretch goal) |
82 | 70 | - Individual module file exports |
|
97 | 85 |
|
98 | 86 | ## 4. Work Record |
99 | 87 | ### 4.1. Completed Milestones |
100 | | -- [x] 4.1. Create Hub Dashboard and Navigation Structure ✅ COMPLETED |
| 88 | +- [x] 4.1.1. Break over-large `/Themis` components into subcomponents ✅ COMPLETED (2025-10-27) |
| 89 | + - **Branch:** `themis/refactor/split-large-components` |
| 90 | + - **Commit:** `e744d71` |
| 91 | + - **Summary:** Split 896-line ModuleGenerationList.svelte into focused, reusable components |
| 92 | + - **Components Created:** |
| 93 | + - ProgressSummary.svelte (86 lines): Overall generation progress display |
| 94 | + - ModulePreviewModal.svelte (141 lines): XML preview modal |
| 95 | + - ModuleCard.svelte (221 lines): Individual module display with actions |
| 96 | + - ArcSection.svelte (140 lines): Collapsible arc container |
| 97 | + - moduleStoreHelpers.ts (80 lines): Centralized store update utilities |
| 98 | + - **Impact:** |
| 99 | + - Main component reduced from 896 to 441 lines (51% reduction) |
| 100 | + - Eliminated duplicate store update patterns |
| 101 | + - Improved maintainability and testability |
| 102 | + - Better component composition and reusability |
| 103 | + - **Why completed:** Addresses roadmap tasks 1.1.2.6 and 1.1.2.7, establishing foundation for future improvements |
| 104 | +- [x] 4.1.2. Create Hub Dashboard and Navigation Structure ✅ COMPLETED |
101 | 105 | - Created hub dashboard at `/` with cards for "Generate Module" and "Generate Course" |
102 | 106 | - Moved existing module generator to `/module/new` |
103 | 107 | - Added breadcrumb navigation in layout for all routes |
104 | 108 | - Hub-based architecture allows parallel workflows |
105 | 109 | - **Why first:** Foundation for organizing module vs. course workflows |
106 | | -- [x] 4.2. Create Course Types and Stores ✅ COMPLETED |
| 110 | +- [x] 4.1.3. Create Course Types and Stores ✅ COMPLETED |
107 | 111 | - Defined TypeScript interfaces in `src/lib/types/course.ts` |
108 | 112 | - CourseData interface with logistics, learners, structure, and modules |
109 | 113 | - ModuleSlot interface with status tracking, objectives, topics |
110 | 114 | - Created Svelte stores in `src/lib/courseStores.ts` |
111 | 115 | - Auto-save to localStorage on course changes |
112 | 116 | - Derived stores for computed values (totalModuleWeeks) |
113 | 117 | - **Why second:** Type-safe state management for course workflow |
114 | | -- [x] 4.3. Build CourseConfigForm Component (Step 1) ✅ COMPLETED |
| 118 | +- [x] 4.1.4. Build CourseConfigForm Component (Step 1) ✅ COMPLETED |
115 | 119 | - Created `src/lib/course/CourseConfigForm.svelte` |
116 | 120 | - Comprehensive form with course identity, logistics, learner configuration |
117 | 121 | - Validation for all inputs (weeks, cohort size, dates, etc.) |
118 | 122 | - Disabled SSR for localStorage compatibility |
119 | 123 | - Reactive statements ensure nested objects exist before access |
120 | 124 | - **Why third:** User input collection for course parameters |
121 | | -- [x] 4.4. Build ModuleStructurePlanner Component (Step 2) ✅ COMPLETED |
| 125 | +- [x] 4.1.5. Build ModuleStructurePlanner Component (Step 2) ✅ COMPLETED |
122 | 126 | - Created `src/lib/course/ModuleStructurePlanner.svelte` |
123 | 127 | - Visual timeline bar showing proportional week allocation |
124 | 128 | - Add/remove modules with validation |
125 | 129 | - Auto-suggest feature based on course duration |
126 | 130 | - Week budget tracking with overflow detection |
127 | 131 | - Module ordering and duration management |
128 | 132 | - **Why third:** High-level course structure before AI generation |
129 | | -- [x] 4.5. Create /api/course/structure Endpoint ✅ COMPLETED |
| 133 | +- [x] 4.1.6. Create /api/course/structure Endpoint ✅ COMPLETED |
130 | 134 | - Created `src/routes/api/course/structure/+server.ts` |
131 | 135 | - Uses Claude Sonnet 4.5 to generate detailed module structure |
132 | 136 | - Accepts course parameters and module skeleton |
133 | 137 | - Returns course narrative, module objectives/topics, progression narrative |
134 | 138 | - Web search tool integration for research |
135 | 139 | - **Why third:** AI-powered course structure generation |
136 | | -- [x] 4.6. Build CourseStructureReview Component (Step 3) ✅ COMPLETED |
| 140 | +- [x] 4.1.7. Build CourseStructureReview Component (Step 3) ✅ COMPLETED |
137 | 141 | - Created `src/lib/course/CourseStructureReview.svelte` |
138 | 142 | - Auto-generation on component mount |
139 | 143 | - Loading state with spinner during 30-60 second generation |
|
143 | 147 | - Regenerate button for fresh AI suggestions |
144 | 148 | - Saves refined data back to course store |
145 | 149 | - **Why third:** Review and refine AI-generated course structure before module generation |
146 | | -- [x] 4.7. Reimplement the Module Overview Generation Based on Thematic Arcs ✅ COMPLETED |
| 150 | +- [x] 4.1.8. Reimplement the Module Overview Generation Based on Thematic Arcs ✅ COMPLETED |
147 | 151 | - Introduced "arcs" as thematic organizational layer between courses and modules |
148 | 152 | - Created Arc interface with theme, arcThemeNarrative, and arcProgressionNarrative fields |
149 | 153 | - Built ArcStructurePlanner component for defining broad thematic arcs |
|
154 | 158 | - Implemented backward compatibility migration for existing module-only courses |
155 | 159 | - Arcs support thematic independence with temporal sequencing |
156 | 160 | - **Why completed:** Arcs provide the thematic organizational structure needed for coherent course narratives while maintaining module-level detail |
157 | | -- [x] 4.8. Add localStorage Persistence ✅ COMPLETED |
| 161 | +- [x] 4.1.9. Add localStorage Persistence ✅ COMPLETED |
158 | 162 | - Auto-save course progress to localStorage ✅ |
159 | 163 | - Restore course on page reload ✅ |
160 | 164 | - "Clear course" functionality ✅ |
161 | 165 | - Save/load multiple courses ✅ |
162 | 166 | - **Completed:** Implemented via `persistedStore()` utility in refactoring Phase 4 |
163 | 167 | - **Location:** `src/lib/stores/themisStores.ts` using `src/lib/utils/state/persistenceUtils.ts` |
164 | | -- [x] 4.9. Complete Module Generation Workflow (Steps 5-6) ✅ COMPLETED (2025-10-25) |
| 168 | +- [x] 4.1.10. Complete Module Generation Workflow (Steps 5-6) ✅ COMPLETED (2025-10-25) |
165 | 169 | - **Step 5 - Module Generation:** |
166 | 170 | - ModuleGenerationList component with arc-grouped display |
167 | 171 | - SSE streaming for real-time generation feedback |
|
175 | 179 | - Theia export integration (Markdown/HTML) |
176 | 180 | - Workflow navigation and reset functionality |
177 | 181 | - **Why completed:** Completes the end-to-end Themis MVP workflow from configuration to export |
178 | | -- [x] 4.11. Create /api/themis/module Endpoint ✅ COMPLETED (2025-10-25) |
| 182 | +- [x] 4.1.11. Create /api/themis/module Endpoint ✅ COMPLETED (2025-10-25) |
179 | 183 | - Created `src/routes/api/themis/module/+server.ts` (193 lines) |
180 | 184 | - Accepts module slot data with course context |
181 | 185 | - Calls existing module generation logic with course-aware prompts |
182 | 186 | - Returns XML module spec via SSE streaming |
183 | 187 | - Supports retry logic and validation |
184 | 188 | - **Status:** Complete - API layer for course-aware module generation |
185 | | -- [x] 4.12. Extend Module Generation with Course Context ✅ COMPLETED (2025-10-25) |
| 189 | +- [x] 4.1.12. Extend Module Generation with Course Context ✅ COMPLETED (2025-10-25) |
186 | 190 | - Added `buildCourseAwareModulePrompt()` to metisPromptFactory |
187 | 191 | - Includes course narrative, arc progression, and preceding modules in prompts |
188 | 192 | - Maintains backward compatibility with standalone module generation |
189 | 193 | - XML injection prevention via escapeXml utilities |
190 | 194 | - **Status:** Complete - reuses existing module generation with course awareness |
191 | | -- [x] 4.13. Build CourseOverview Component (Step 6) ✅ COMPLETED (2025-10-25) |
| 195 | +- [x] 4.1.13. Build CourseOverview Component (Step 6) ✅ COMPLETED (2025-10-25) |
192 | 196 | - Created `src/lib/components/themis/CourseOverview.svelte` (1462 lines) |
193 | 197 | - Displays complete course with metadata, narratives, and all generated modules |
194 | 198 | - Arc-grouped collapsible sections with module previews |
|
202 | 206 | #### 4.2.1. Record of Past Deadlines |
203 | 207 |
|
204 | 208 | #### 4.2.2. Record of Other Completed Tasks |
| 209 | +- [x] 4.2.2.1. `ModuleGenerationList.svelte` is 895 lines; split it into smaller components ✅ COMPLETED (2025-10-27) |
| 210 | + - Created `ArcSection.svelte`: arc header + module list (140 lines) |
| 211 | + - Created `ModuleCard.svelte`: individual module with status/actions (221 lines) |
| 212 | + - Created `ModulePreviewModal.svelte`: preview functionality (141 lines) |
| 213 | + - Created `ProgressSummary.svelte`: statistics and progress bar (86 lines) |
| 214 | + - Refactored main component from 896 to 441 lines |
| 215 | + - **Branch:** `themis/refactor/split-large-components` |
| 216 | + - **Addresses:** Original task 1.1.2.6 |
| 217 | +- [x] 4.2.2.2. Fix Duplicate Store Updates ✅ COMPLETED (2025-10-27) |
| 218 | + - Created `moduleStoreHelpers.ts` utility (80 lines) |
| 219 | + - Extracted repeated module update patterns into centralized functions |
| 220 | + - Functions: `updateModuleStatus()`, `updateModuleWithGeneratedData()`, `updateModuleWithError()` |
| 221 | + - Eliminated duplicate code across ModuleGenerationList |
| 222 | + - **Branch:** `themis/refactor/split-large-components` |
| 223 | + - **Addresses:** Original task 1.1.2.7 |
0 commit comments