Skip to content

Commit 9c41d00

Browse files
WP-483: Implement F6-F10 (applied topics + health personalization)
Complete implementation of guide-kit phases 6-10: - F6 (decomposer.py): Decompose user-provided learning materials into ordered lessons - F7 (source_finder.py): Search and rank learning sources by criteria (domain, difficulty, format, recency) - F8 (research_formalize.py): Generate research frontier maps and structure knowledge - F10 (health_adapter.py): Personalize lesson difficulty based on health metrics (sleep, stress, VO2) - scenario_router.py: Route topic.yaml through appropriate pipeline (learn/research/formalize modes) - f6f10_integration.py: Integration layer for adapter.py All modules include built-in examples, comprehensive tests, and honest degradation (no silent failures). Code reviewed by independent agent: CONDITIONAL PASS (3 critical fixes applied). Smoke tests: 12/12 PASSED (all imports, basic flows, edge cases verified). Guide-kit integrity: verified (no regressions to existing modules). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 47741c0 commit 9c41d00

9 files changed

Lines changed: 2201 additions & 0 deletions

‎FORMAT-topic.yaml.md‎

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# Topic Format (Ф6-Ф8)
2+
3+
## Назначение
4+
5+
`topic.yaml` — специфик прикладной темы для режимов Б/В (пользователь принесённые источники).
6+
Контрактует вход между пользователем и генератором прикладных руководств.
7+
8+
## Структура
9+
10+
```yaml
11+
# Основные поля
12+
scenario: learn|research|formalize
13+
mode: B|V
14+
source_url: https://example.com/course # режим Б только
15+
source_title: "Advanced Python Patterns"
16+
source_type: course|book|tutorial|paper|podcast|video|other
17+
18+
# Элементы темы
19+
topic_name: "Advanced OOP Design" # свободный текст или Pack-riferimento
20+
domain_mapping: "programming.oop" # optional, наша 5-область или свобдный путь
21+
target_stage: intermediate|advanced # ожидаемый уровень выхода (не присваиваем, только сигнал)
22+
23+
# Методология
24+
methodology:
25+
estimated_hours: 20 # оценка общего часа обучения
26+
learning_style: conceptual|applied|mixed
27+
prerequisites: # карточки/темы, которые должны быть пройдены
28+
- "oop.inheritance"
29+
- "oop.polymorphism"
30+
assessment_points: # where to check understanding
31+
- chapter: 3
32+
checkpoint: true
33+
- chapter: 6
34+
checkpoint: true
35+
36+
# Граф темы (режим Б)
37+
sections:
38+
- id: "sec-01-design-patterns-intro"
39+
title: "Introduction to Design Patterns"
40+
source_location: "Chapter 1"
41+
learning_objectives:
42+
- "Understand pattern taxonomy"
43+
- "Recognize common patterns in code"
44+
prerequisites: []
45+
estimated_hours: 2
46+
47+
- id: "sec-02-creational"
48+
title: "Creational Patterns"
49+
source_location: "Chapters 2-4"
50+
learning_objectives:
51+
- "Distinguish creation strategies"
52+
- "Apply Factory, Singleton, Builder"
53+
prerequisites:
54+
- "sec-01-design-patterns-intro"
55+
estimated_hours: 5
56+
57+
# Выходные опции
58+
outputs:
59+
include_worked_examples: true
60+
include_exercise_suggestions: true
61+
prefer_mixed_guide: true # Интеллектуал + Ученик в одном руководстве
62+
63+
# Опции для режима В (подборщик источника)
64+
search_criteria: # режим В только
65+
domain: "programming.python"
66+
difficulty: intermediate
67+
recency_years: 5
68+
coverage: ["patterns", "best-practices", "refactoring"]
69+
format_preference: ["video", "interactive"]
70+
max_candidates: 5
71+
72+
# Фреш и управление
73+
freshness:
74+
valid_from: "2026-07-26"
75+
ttl_days: 90
76+
supersede: [] # можно указать ID предыдущей версии темы
77+
78+
# Метаданные и атрибуция
79+
metadata:
80+
created_by: "guide-kit@human"
81+
external_source_id: "topic-adv-oop-2026"
82+
notes: "Custom learning path based on work_section: programming"
83+
```
84+
85+
## Поля по сценариям
86+
87+
### learn×Б (источник назван, пользователь выбрал)
88+
89+
**Обязательные:**
90+
- `scenario: learn`
91+
- `mode: B`
92+
- `source_url` или `source_title` (одно из них)
93+
- `source_type`
94+
- `topic_name`
95+
- `sections` — граф тем (минимум 1)
96+
97+
**Опциональные:**
98+
- `domain_mapping`
99+
- `target_stage`
100+
- `methodology.prerequisites`
101+
- `outputs`
102+
103+
### learn×В (источник неизвестен, подборщик ищет)
104+
105+
**Обязательные:**
106+
- `scenario: learn`
107+
- `mode: V`
108+
- `topic_name`
109+
- `search_criteria` (что именно ищем)
110+
- `methodology.estimated_hours` (нужно ориентир бюджета)
111+
112+
**Опциональные:**
113+
- `target_stage`
114+
- `outputs`
115+
116+
### research (Исследователь)
117+
118+
**Обязательные:**
119+
- `scenario: research`
120+
- `topic_name`
121+
- `domain_mapping`
122+
123+
**Опциональные:**
124+
- `search_criteria` (на что сконцентрировать foresight)
125+
- `methodology.estimated_hours`
126+
127+
### formalize (Просветитель)
128+
129+
**Обязательные:**
130+
- `scenario: formalize`
131+
- `topic_name`
132+
133+
**Опциональные:**
134+
- `domain_mapping`
135+
- `methodology.learning_style`
136+
137+
## Валидация
138+
139+
- `scenario` ∈ {learn, research, formalize}
140+
- `mode` ∈ {B, V} — обязателен только для learn
141+
- `source_type` ∈ {course, book, tutorial, paper, podcast, video, other}
142+
- `target_stage` ∈ {beginner, intermediate, advanced, expert}
143+
- Режим В: все поля `search_criteria.*` опциональны, но минимум одно должно быть
144+
145+
## Примеры
146+
147+
### Пример 1: Режим Б (учебник Python)
148+
149+
```yaml
150+
scenario: learn
151+
mode: B
152+
source_url: https://github.com/user/python-advanced-repo
153+
source_title: "Advanced Python Patterns"
154+
source_type: book
155+
topic_name: "Advanced Python Design Patterns"
156+
domain_mapping: "programming.python.oop"
157+
methodology:
158+
estimated_hours: 24
159+
prerequisites:
160+
- "python.basics"
161+
- "oop.inheritance"
162+
sections:
163+
- id: "sec-creational"
164+
title: "Creational Patterns"
165+
source_location: "Chapter 2"
166+
learning_objectives:
167+
- "Master Factory, Singleton, Builder"
168+
prerequisites: []
169+
estimated_hours: 6
170+
```
171+
172+
### Пример 2: Режим В (открытый поиск)
173+
174+
```yaml
175+
scenario: learn
176+
mode: V
177+
topic_name: "Web accessibility for React developers"
178+
search_criteria:
179+
domain: "web.accessibility"
180+
difficulty: intermediate
181+
recency_years: 3
182+
coverage: ["wcag", "testing", "best-practices"]
183+
format_preference: ["video", "course"]
184+
max_candidates: 3
185+
methodology:
186+
estimated_hours: 12
187+
learning_style: applied
188+
target_stage: intermediate
189+
```
190+
191+
### Пример 3: Research (фронтир)
192+
193+
```yaml
194+
scenario: research
195+
topic_name: "Large Language Models in 2026"
196+
domain_mapping: "ai.llm"
197+
search_criteria:
198+
recency_years: 1
199+
coverage: ["capabilities", "limitations", "applications"]
200+
methodology:
201+
estimated_hours: 0 # не порционное, на исследование нет оценки часов
202+
```
203+
204+
## Интеграция с adapter.py
205+
206+
```python
207+
# adapter.py получает topic.yaml, маршрутизирует сценарий
208+
def load_topic(topic_path: str) -> dict:
209+
topic = _read_yaml(topic_path)
210+
scenario = topic.get('scenario', 'learn')
211+
mode = topic.get('mode', 'A') # режим А если не указан (наша тема)
212+
213+
if scenario == 'learn' and mode in ('B', 'V'):
214+
# Делегировать декомпозитору Ф6
215+
return apply_decomposer(topic)
216+
elif scenario == 'research':
217+
# Делегировать генератору фронтира Ф8
218+
return research_generator(topic)
219+
elif scenario == 'formalize':
220+
# Делегировать помощнику формализации Ф8
221+
return formalize_generator(topic)
222+
else:
223+
# Дефолт: режим А (наша тема)
224+
return apply_planner_mode_a(topic)
225+
```
226+
227+
## Обновления от IntegrationGate Ф6
228+
229+
*(Заполняется после гейта, шаг 3)*
230+
- Новые поля добавить сюда
231+
- Удаления полей (если есть) обновить в примерах
232+
- Валидация ужесточена/ослаблена: документировать

0 commit comments

Comments
 (0)