forked from bai/curriculum-project-hub
5dc29fe558
一节课可多人署名(教研组),故 canonical author 是**有序列表**而非单值。on-disk 形式接受裸字符串(单作者)或数组(多作者),但此"字符串或数组"二态**只活在加载边界**: RawInfo 经归一化折叠成 canonical Info,其后系统只见 List。 Lean 母本(ADR-0008 范围):新增 Model/Info.lean,把 Info(canonical,authors: List String)与 RawInfo/RawAuthor(授权便利 surface)+ 归一化 RawInfo.toInfo 钉死—— canonical 接收端恒为列表,raw 形式不泄漏。ADR-0008 [info] 块补 author-as-list 决策。 impl 对齐:cph-model Info.author: Option<String> → authors: Vec<String>;RawAuthor untagged enum(One|Many)+ into_vec 归一化;augmented manifest 发射 author 数组 (typst document(author:) 与模板已接受 string/array)。doc 两端互引 spec。 测试:load.rs 单作者→单元素列表;target-configs fixture 加数组作者断言多作者。 验证:lake build 绿(25 jobs);cargo test 全绿;clippy 静默;TH-141(单字符串作者) check+build PDF 无回归。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
14 lines
483 B
Lean4
14 lines
483 B
Lean4
import Spec.Courseware.Model.Primitives
|
|
import Spec.Courseware.Model.RichContent
|
|
import Spec.Courseware.Model.Element
|
|
import Spec.Courseware.Model.Lesson
|
|
import Spec.Courseware.Model.Info
|
|
|
|
/-!
|
|
# Courseware.Model —— 工程文件的内容模型
|
|
|
|
留白基元(`Primitives`)、富内容锚点(`RichContent`)、原子单位(`Element`)、单节课
|
|
(`Lesson`)、课时元信息(`Info`:canonical author 为列表 vs `RawInfo` 授权 surface)。
|
|
决策出处 ADR-0005 / 0006 / 0008。
|
|
-/
|