feat(exam): Phase 5 — исправление subtopic-фолбэков (058_exam_topics_textbook_fix.sql)

alg-equations: §10(drobno) -> algebra-8-ch2 §8 (дискриминант, массовый тип)
alg-inequalities: §13 -> algebra-8-ch3 §17 (квадратные/метод интервалов)
alg-polynomials: algebra-9 -> algebra-7-ch2 §14 (разложение, основной тип)
alg-numbers: algebra-9 hub -> math-6-ch4 (рациональные числа)
alg-arithmetic: algebra-9 hub -> math-6-ch1 (десятичные дроби)
alg-powers: algebra-9 hub -> algebra-7-ch1 §1 (натур. показатель)
alg-word-problems: algebra-9 hub -> math-6-ch2 (проценты, массовый тип)
geom-quadrilaterals: geometry-9-ch2 §9 -> geometry-8-ch1 §4 (параллелограмм)
geom-circle: geometry-9-ch2 §7 -> geometry-8-ch4 §8 (центральный/вписанный угол)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-06-03 16:18:51 +03:00
parent a096f3bcd9
commit a88b69797f
@@ -0,0 +1,73 @@
-- ═══════════════════════════════════════════════════════════════
-- 058: Fix exam_topics textbook_slug/paragraph (subtopic-level fallback)
--
-- Migration 028 set coarse fallback values. This migration corrects them
-- to align with the detailed per-subtopic maps from PLAN.md.
-- These values act as fallback when a task has no task-level textbook_slug
-- (e.g. theory-statements or newly added tasks not yet classified).
-- ═══════════════════════════════════════════════════════════════
-- ── Algebra subtopics (fix / improve) ──────────────────────────
-- alg-numbers: rational numbers are in math-6-ch4 (better than algebra-9 hub)
UPDATE exam_topics SET textbook_slug = 'math-6-ch4', textbook_paragraph = NULL
WHERE slug = 'alg-numbers' AND exam_key = 'math9';
-- alg-arithmetic: basic arithmetic → math-6-ch1 (decimals, most common 5-6 topic)
UPDATE exam_topics SET textbook_slug = 'math-6-ch1', textbook_paragraph = NULL
WHERE slug = 'alg-arithmetic' AND exam_key = 'math9';
-- alg-powers: primary is natural exponent → algebra-7-ch1 §1
UPDATE exam_topics SET textbook_slug = 'algebra-7-ch1', textbook_paragraph = 1
WHERE slug = 'alg-powers' AND exam_key = 'math9';
-- alg-expressions: primary → algebra-9-ch1 §5 (rational expression transform)
-- (028 already set this correctly)
-- alg-polynomials: primary → algebra-7-ch2 §14 (factoring, most tested)
UPDATE exam_topics SET textbook_slug = 'algebra-7-ch2', textbook_paragraph = 14
WHERE slug = 'alg-polynomials' AND exam_key = 'math9';
-- alg-fractions: primary → algebra-9-ch1 §3 (add/subtract rational fractions)
-- (028 already set §3; keep it)
-- alg-equations: primary → algebra-8-ch2 §8 (quadratic by discriminant, most common)
-- (028 had §10 from algebra-9-ch3 which is drobno-rational — fix to quadratic)
UPDATE exam_topics SET textbook_slug = 'algebra-8-ch2', textbook_paragraph = 8
WHERE slug = 'alg-equations' AND exam_key = 'math9';
-- alg-inequalities: primary → algebra-8-ch3 §17 (quadratic inequalities, method of intervals)
-- (028 already set §13; fix to §17 which is the most common exam topic)
UPDATE exam_topics SET textbook_slug = 'algebra-8-ch3', textbook_paragraph = 17
WHERE slug = 'alg-inequalities' AND exam_key = 'math9';
-- alg-functions: primary → algebra-9-ch2 §6 (function of numeric argument)
-- (028 already set §6; keep it)
-- alg-progressions: primary → algebra-9-ch4 §15 (arithmetic progression)
-- (028 already set §15; keep it)
-- alg-word-problems: primary → math-6-ch2 (percentages — most common type)
UPDATE exam_topics SET textbook_slug = 'math-6-ch2', textbook_paragraph = NULL
WHERE slug = 'alg-word-problems' AND exam_key = 'math9';
-- ── Geometry subtopics (fix / improve) ──────────────────────────
-- geom-triangles: primary → geometry-9-ch1 §1 (trig in right triangle, most tested)
-- (028 had §1 of geometry-9-ch1; keep it)
-- geom-quadrilaterals: primary → geometry-8-ch1 §4 (parallelogram, most common)
-- (028 had §9 of geometry-9-ch2 — too specific; fix to general parallelogram)
UPDATE exam_topics SET textbook_slug = 'geometry-8-ch1', textbook_paragraph = 4
WHERE slug = 'geom-quadrilaterals' AND exam_key = 'math9';
-- geom-circle: primary → geometry-8-ch4 §8 (central angle / inscribed angle)
-- (028 had §7 of geometry-9-ch2; fix to geometry-8-ch4 §8)
UPDATE exam_topics SET textbook_slug = 'geometry-8-ch4', textbook_paragraph = 8
WHERE slug = 'geom-circle' AND exam_key = 'math9';
-- geom-coordinates: primary → algebra-9-ch3 §12 (circle equation)
-- (028 already set §12; keep it)
-- theory-statements: leave NULL — no single textbook home
-- (028 already left NULL; keep it)