docs(architecture): update impact map, data, audit report, troubleshooting
Some checks failed
CI / scheduled-backup (push) Has been skipped
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled

- Update 004_architecture_impact_map.md

- Update 005_architecture_data.json

- Add lesson-preparation-audit-report-v5.md

- Add troubleshooting docs
This commit is contained in:
SpecialX
2026-07-04 10:24:08 +08:00
parent cbc6e259fa
commit 872d5fb085
4 changed files with 1176 additions and 12 deletions

View File

@@ -6443,11 +6443,21 @@
"name": "GraphViewMode",
"type": "type",
"definition": "\"structure\" | \"student-mastery\" | \"class-mastery\"",
"purpose": "Task 7 新增:图谱视图模式",
"purpose": "Task 7 新增:图谱数据视角(结构 / 学生掌握度 / 班级掌握度)",
"usedBy": [
"getKnowledgeGraphDataAction"
]
},
{
"name": "GraphLayoutMode",
"type": "type",
"definition": "\"hierarchical\" | \"force\"",
"purpose": "v4 新增图谱渲染布局hierarchical=分层有向图 ReactFlow+dagreforce=Obsidian 风格力导向图 react-force-graph-2d",
"usedBy": [
"components/knowledge-graph.tsx",
"components/graph-toolbar.tsx"
]
},
{
"name": "MasteryInfo",
"type": "interface",
@@ -6648,7 +6658,17 @@
},
{
"name": "KnowledgeGraph",
"purpose": "知识图谱可视化"
"purpose": "知识图谱可视化v4 新增:支持 hierarchical/force 两种布局模式切换hierarchical=ReactFlow+dagre 分层有向图force=Obsidian 风格力导向图;外层共享状态/详情面板/前置依赖增删对话框)"
},
{
"name": "ForceKnowledgeGraph",
"file": "components/force-graph.tsx",
"purpose": "v4 新增Obsidian 风格力导向图谱组件,基于 react-force-graph-2d + d3-force圆形节点+曲线连接+物理力导向+邻居高亮+拖拽联动;通过 next/dynamic ssr:false 加载避免 SSR canvas/window 报错"
},
{
"name": "GraphToolbar",
"file": "components/graph-toolbar.tsx",
"purpose": "图谱工具栏v4 新增 hierarchical/force 布局模式切换 Select保留视图模式切换/搜索/重置视图)"
},
{
"name": "GraphNodeDetailPanel",
@@ -6693,7 +6713,10 @@
],
"uiDeps": [],
"uiDepsNote": "已通过 render prop 解耦TeacherTextbookReader 已移至 app 层src/app/(dashboard)/teacher/textbooks/[id]/_components/textbooks 模块不再直接 import questions 模块组件",
"npmDeps": ["@xyflow/react", "@dagrejs/dagre", "react-force-graph-2d"],
"npmDepsNote": "v4 新增 react-force-graph-2d基于 d3-force + Canvas实现 Obsidian 风格力导向图谱;通过 next/dynamic ssr:false 加载避免 SSR canvas/window 报错;@xyflow/react + @dagrejs/dagre 用于分层有向图布局",
"knownIssues": [
"v4 新增2026-07-03知识点图谱新增 Obsidian 风格力导向布局force 模式与原分层有向图hierarchical 模式)共存,工具栏可切换;新增组件 force-graph.tsx新增类型 GraphLayoutMode保留全部现有功能掌握度视图/搜索高亮/邻居高亮/前置依赖增删)",
"i18n 覆盖率约 99%v3 新增 notFound/noClassMasteryPermission/close/prerequisiteAddFailed/prerequisiteRemoveFailed 等键data-access 层硬编码英文异常文案已改为 NotFoundError 错误码化)",
"v3 审计修复2026-06-24学生端两个页面添加 requirePermission(Permissions.TEXTBOOK_READ) 显式权限校验",
"v3 审计修复2026-06-24getKnowledgeGraphDataAction 添加学生/家长年级 scope 过滤class-mastery 视图模式限制为 teacher/admin",
@@ -6749,8 +6772,9 @@
"components/graph-kp-node.tsx": 92,
"components/graph-node-detail-panel.tsx": 171,
"components/graph-prerequisite-edge.tsx": 43,
"components/graph-toolbar.tsx": 84,
"components/knowledge-graph.tsx": 356,
"components/graph-toolbar.tsx": 121,
"components/force-graph.tsx": 454,
"components/knowledge-graph.tsx": 408,
"components/knowledge-point-dialogs.tsx": 167,
"components/knowledge-point-list.tsx": 117,
"components/section-error-boundary.tsx": 53,
@@ -20513,6 +20537,76 @@
"name": "suggestKnowledgePoints",
"file": "ai-suggest.ts",
"purpose": "AI 建议知识点(基于课案内容)"
},
{
"name": "autoLayout",
"file": "lib/auto-layout.ts",
"purpose": "V5-8 U2 新增:基于 @dagrejs/dagre 的 DAG 自动布局算法,按 edges 拓扑排序计算 nodes 位置"
},
{
"name": "diffDocuments",
"file": "lib/version-diff.ts",
"purpose": "V5-16 T2 新增:纯函数对比两个 LessonPlanDocument 节点级差异,返回 added/removed/modified/unchanged + changedFields"
},
{
"name": "hasChanges",
"file": "lib/version-diff.ts",
"purpose": "V5-16 T2 新增:判断 VersionDiffResult 是否存在变更"
},
{
"name": "checkConsistency",
"file": "lib/consistency-check.ts",
"purpose": "V5-19 T3 新增:纯函数目标-评价一致性校验,输出 ConsistencyResult缺少 objective/exercise 警告、exercise 无知识点警告、objective 未被评价覆盖警告)"
},
{
"name": "hasConsistencyWarnings",
"file": "lib/consistency-check.ts",
"purpose": "V5-19 T3 新增:判断 ConsistencyResult 是否存在警告"
},
{
"name": "computeCurriculumCoverage",
"file": "lib/curriculum-coverage.ts",
"purpose": "V5-20 T4 新增:纯函数按 chapterId 分组统计教师所有课案对教材知识点的覆盖率,识别 isBlindSpot 教学盲点"
},
{
"name": "getHeatLevel",
"file": "lib/curriculum-coverage.ts",
"purpose": "V5-20 T4 新增根据覆盖率返回热力图颜色等级0-4"
},
{
"name": "generateLessonPlanFeedback",
"file": "lib/ai-feedback.ts",
"purpose": "V5-17 A1/A2 新增AI 反馈闭环纯服务端函数4 维度 strengths/improvements/alignment/differentiation含解释性 reason 字段AI 不可用时返回空结果"
},
{
"name": "generateDifferentiationSuggestions",
"file": "lib/ai-differentiation.ts",
"purpose": "V5-21 A3 新增AI 差异化教学建议生成,按 basic/intermediate/advanced 三层生成建议"
},
{
"name": "checkCurriculumAlignment",
"file": "lib/ai-differentiation.ts",
"purpose": "V5-21 A4 新增AI 课标实时核对,检查课案是否覆盖教材知识点"
},
{
"name": "generateExplainableAssessment",
"file": "lib/ai-differentiation.ts",
"purpose": "V5-21 A5 新增AI 可解释评估,对 exercise 节点给出 conclusion/rationale/suggestion"
},
{
"name": "getLessonPlanSchedules",
"file": "data-access-schedules.ts",
"purpose": "V5-7 W3/W4 新增:查询课案绑定的课时列表"
},
{
"name": "createLessonPlanSchedule",
"file": "data-access-schedules.ts",
"purpose": "V5-7 W3/W4 新增:课案绑定课时"
},
{
"name": "deleteLessonPlanSchedule",
"file": "data-access-schedules.ts",
"purpose": "V5-7 W3/W4 新增:删除课时绑定"
}
],
"actions": [
@@ -20629,6 +20723,60 @@
"permission": "LESSON_PLAN_READ",
"file": "actions.ts",
"purpose": "按 textbookId 获取章节树(供 template-picker 选择章节)"
},
{
"name": "duplicateLessonPlanFormAction",
"permission": "LESSON_PLAN_CREATE",
"file": "actions.ts",
"purpose": "V5-12 R4 新增FormData wrapper 适配 <form action={...}>,内部调用 duplicateLessonPlanAction 后 redirect 到新课案编辑页"
},
{
"name": "getLessonPlanSchedulesAction",
"permission": "LESSON_PLAN_READ",
"file": "actions-schedules.ts",
"purpose": "V5-7 W3/W4 新增:查询课案绑定的课时列表"
},
{
"name": "createLessonPlanScheduleAction",
"permission": "LESSON_PLAN_UPDATE",
"file": "actions-schedules.ts",
"purpose": "V5-7 W3/W4 新增:课案绑定课时"
},
{
"name": "deleteLessonPlanScheduleAction",
"permission": "LESSON_PLAN_UPDATE",
"file": "actions-schedules.ts",
"purpose": "V5-7 W3/W4 新增:删除课时绑定"
},
{
"name": "generateLessonPlanFeedbackAction",
"permission": "LESSON_PLAN_READ + AI_CHAT",
"file": "actions-ai.ts",
"purpose": "V5-17 A1/A2 新增AI 反馈闭环,调用 generateLessonPlanFeedback 生成结构化反馈"
},
{
"name": "generateDifferentiationSuggestionsAction",
"permission": "LESSON_PLAN_READ + AI_CHAT",
"file": "actions-ai.ts",
"purpose": "V5-21 A3 新增AI 差异化教学建议生成"
},
{
"name": "checkCurriculumAlignmentAction",
"permission": "LESSON_PLAN_READ + AI_CHAT",
"file": "actions-ai.ts",
"purpose": "V5-21 A4 新增AI 课标实时核对"
},
{
"name": "generateExplainableAssessmentAction",
"permission": "LESSON_PLAN_READ + AI_CHAT",
"file": "actions-ai.ts",
"purpose": "V5-21 A5 新增AI 可解释评估"
},
{
"name": "getKnowledgePointsForAlignmentAction",
"permission": "LESSON_PLAN_READ",
"file": "actions-ai.ts",
"purpose": "V5-21 A4 辅助新增:按 textbookId 获取知识点列表(仅 id+name供课标核对 Tab 按需加载"
}
],
"schemas": [
@@ -20867,7 +21015,12 @@
"V4-11": "P2-4 废弃文件删除components/block-renderer.tsx@deprecated无源码引用删除",
"V4-12": "P2-5 anchor-injector regex 一致性markdownToPlainText 的 /^>\\s+/gm 改为 /^\\s*>\\s+/gmskipPatterns 5 个 regex 统一添加 g 标志,与 markdownToPlainText 保持一致",
"V4-13": "P2-6 Zustand store 拆 slicehooks/use-lesson-plan-editor.ts 从 303 行单体 store 拆分为 3 个独立 slice——hooks/editor-slice.ts文档结构+文档操作)/hooks/selection-slice.ts选中状态/hooks/version-slice.ts版本与保存状态主文件重写为 25 行薄层,组合 3 个 slice 并导出 EditorState 类型",
"V4-14": "type-guards 导出补全lib/type-guards.ts 的 VALID_QUESTION_TYPES 常量从模块私有改为 export供 inline-question-editor.tsx 复用,消除重复定义)"
"V4-14": "type-guards 导出补全lib/type-guards.ts 的 VALID_QUESTION_TYPES 常量从模块私有改为 export供 inline-question-editor.tsx 复用,消除重复定义)",
"V5-1": "自动保存失败 UI 兜底version-slice.ts 新增 saveError/isOnline 状态 + setSaveError/setOnline 方法lesson-plan-editor.tsx 自动保存失败时 toast 提示 + 设置 saveError断网时不触发保存请求监听 window online/offline 事件 toast 提示saveError 时显示重试按钮,恢复时提示已恢复",
"V5-2": "撤销/重做:新增 hooks/history-slice.tspast/future 栈50 步上限canUndo/canRedo/pushHistory/undo/redo/clearHistory 方法editor-slice.ts 所有 mutation 方法setTitle/addNode/updateNode/removeNode/updateTextbookContent/addAnchor/removeAnchor/updateAnchor/connect/disconnect/setEdges包装 pushHistoryupdateNodePosition 除外(拖拽过程中由调用方在 onDragStart 时推入version-slice hydrate/replaceDoc 调用 clearHistorylesson-plan-editor.tsx 顶部新增 Undo/Redo 按钮 + Ctrl/Cmd+Z 撤销 + Ctrl/Cmd+Shift+Z 或 Ctrl/Cmd+Y 重做快捷键",
"V5-3": "发布前作业单预览publish-homework-dialog.tsx 改为 3 步流程step=select 选班级+时间 → step=preview 预览题目+总分+班级数 → step=confirm 确认发布),第二步显示题目列表(题型/来源/题干预览/分值)+汇总信息(班级数/题目数/总分),第三步显示最终确认信息+警告文案exercise-block.tsx 调用 PublishHomeworkDialog 时传入 items={data.items}",
"V5-4": "导出/打印:新增 lib/export.tsflattenLessonPlanForPrint 函数,将画布式 LessonPlanDocument 扁平化为 PrintableLessonPlan 线性结构,支持 detailed/concise 两种 variantconcise 仅含 objective/new_teaching/exercise/homework+ components/print-view.tsx打印视图组件详细版/简洁版切换 + 调用 window.print() 通过浏览器原生能力保存为 PDF + print: CSS 媒体查询隐藏工具栏 + 页眉含教材/教师/班级/教学时长/最后保存时间 + break-inside-avoid 防止段落跨页lesson-plan-editor.tsx 新增 printablePlan useMemo 构造 + 导出按钮 + PrintView 渲染",
"V5-5": "多媒体嵌入 + 我的素材库types.ts RichTextBlockData 新增 attachments?: RichTextAttachment[] 字段 + RichTextAttachment 类型attachmentId/fileId/displayName/kind: image|audio|video|file/url/mimeType?rich-text-block.tsx 集成 @tiptap/extension-imageImage.configure inline:false allowBase64:false+ 新增附件入口按钮 + 已嵌入附件列表渲染(非图片附件列表 + 图片附件缩略图,含删除按钮)+ 图片附件通过 editor.commands.setImage 直接插入富文本;新增 components/attachment-picker.tsx素材库 picker复用 use-file-upload hook 调用 /api/upload + 调用 service.createLessonPlanAttachment 落库到 M6 lessonPlanAttachments 表 + 列出 service.getLessonPlanAttachments + 删除 service.deleteLessonPlanAttachment + inferAttachmentKind 工具函数LessonPlanDataService 接口新增 getLessonPlanAttachments/createLessonPlanAttachment/deleteLessonPlanAttachment 三个方法 + LessonPlanAttachmentOption 导出类型default-data-service.ts 实现三个方法DB 层 Date 转 ISO string 以匹配接口类型BlockRenderProps 新增 planId? 字段NodeEditPanel 新增 planId prop 透传lesson-plan-editor.tsx NodeEditPanel 调用传入 planId新增依赖 @tiptap/extension-imagefiles/types.ts FileTargetType 新增 'lesson_plan' 类型"
}
},
"error-book": {
@@ -22029,6 +22182,13 @@
"columns": 6,
"indexes": 2,
"foreignKeys": 2
},
"lessonPlanSchedules": {
"owner": "lesson-preparation",
"description": "V5-7 W3/W4 课案绑定课时表(planId+classId+lessonDate 唯一约束2026-07-03 新增)",
"columns": 6,
"indexes": 3,
"foreignKeys": 2
}
}
},
@@ -25438,11 +25598,45 @@
"duplicateLessonPlanAction",
"saveAsTemplateAction",
"suggestKnowledgePointsAction",
"publishLessonPlanHomeworkAction"
"publishLessonPlanHomeworkAction",
"getLessonPlanSchedulesAction",
"createLessonPlanScheduleAction",
"deleteLessonPlanScheduleAction",
"generateLessonPlanFeedbackAction",
"generateDifferentiationSuggestionsAction",
"checkCurriculumAlignmentAction",
"generateExplainableAssessmentAction",
"getKnowledgePointsForAlignmentAction"
],
"permission": "lesson_plan:update",
"permissionRead": "lesson_plan:read",
"description": "编辑课案页面权限requirePermission(LESSON_PLAN_UPDATE);只读访问需 LESSON_PLAN_READ"
"description": "编辑课案页面权限requirePermission(LESSON_PLAN_UPDATE);只读访问需 LESSON_PLAN_READV5-7 新增课时绑定 actionsV5-17/V5-21 新增 AI 反馈/差异化 actions"
},
"/teacher/lesson-plans/library": {
"component": "LibraryPage",
"type": "server",
"module": "lesson-preparation",
"method": "GET",
"dataAccess": [
"lesson-preparation/data-access.getLessonPlans"
],
"actions": [
"duplicateLessonPlanFormAction"
],
"permission": "lesson_plan:read",
"description": "V5-12 R4 新增校内课案库页面展示其他教师发布的课案支持一键复制权限requirePermission(LESSON_PLAN_READ)"
},
"/teacher/lesson-plans/heatmap": {
"component": "HeatmapPage",
"type": "server",
"module": "lesson-preparation",
"method": "GET",
"dataAccess": [
"lesson-preparation/data-access.getLessonPlans",
"textbooks/data-access.getKnowledgePointsByTextbookId"
],
"permission": "lesson_plan:read",
"description": "V5-20 T4 新增课标覆盖热力图页面统计教师所有课案对教材知识点的覆盖情况权限requirePermission(LESSON_PLAN_READ)"
},
"/teacher/error-book": {
"component": "TeacherErrorBookPage + SubjectTabs + ClassFilter + AnalyticsStatsCards + ClassErrorBarChart + KnowledgePointWeaknessChart + ChapterWeaknessChart + GroupedStudentErrorTable + TopWrongQuestions",