forked from bai/curriculum-project-hub
73e9d258d6
按新文风(简洁书面中文)重写 spec/ 全部 Lean doc 注释、spec/README, 并顺根 README。核心:讲清产品逻辑、去伪术语、去 ADR 黑话、DRY。 语言:砍钉死/留痕/实现侧/将就/脑补/刻意等伪术语;短句;不复述文件系统 能看到的东西;typst 考据移出 spec 指向 ADR。 内容取舍(动结构): - System 层大改:删 can_mono 形式化定理、Capability 9 项枚举与 requiredRole 映射、RunState 6 构造子;Audit.lean 删除并入 System 顶部。 Hub 未建的部分一律 prose 占位,只留 Lock 的 owner=run 与 WellFormed。 - 澄清两个"检查":产品 checker(LLM 判不了合法性,checker 真跑工具补这块) vs 开发时 spec↔impl 一致性检查(无自动闸门)。Oracle 重新定位为 "checker 得委托外部工具才能判的事实",不是"Lean 没写形式化"。 - spec/README 补取舍判据 checklist(自顶向下逐步细化、不在 Lean 里验证实现)。 - 根 README 去 DRY:删硬编码版本号、cache 路径细节;宪法第 3 条吸收 "人/coding assistant 核对"修正;第 5 条与 spec/README 判据去重。 保留:Export/Render 执行语义、Info 的 raw→canonical 设计模式(产品语义, 只顺文风不砍结构);renderIgnoredSeverity(实现对齐依赖)。 lake build 通过(24 jobs)。 Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.6 KiB
Lean4
42 lines
1.6 KiB
Lean4
/-!
|
|
# 富内容
|
|
|
|
element schema 的叶子可以是 content 类型:一段源文本,按 format 决定语义
|
|
(ADR-0006、ADR-0015)。
|
|
|
|
两种 format:
|
|
|
|
- typst:一段 typst 源,求值后得到讲义/教案用的内容。
|
|
- markdown:一段 markdown + KaTeX 源,原样保留,不经 typst 求值(slides 大纲、
|
|
逐字稿口播)。直接用 markdown 写,公式一开始就是 KaTeX(`$…$`),绕开了
|
|
typst→markdown 的公式转换这个难题(ADR-0014)。
|
|
|
|
约束:typst 内容必须挂在一个虚拟路径上(原因见 ADR-0006 的考据)。markdown 内容
|
|
不经 typst 求值,但同样用虚拟路径定位,供 markdown 装配按序读取。
|
|
|
|
本模块只钉两条关系:富内容由一个虚拟路径定位、叶子带 format。typst 的 Content/Module
|
|
内部结构、JSON Schema 形状、format 怎么判别,都是实现细节,不进契约。
|
|
-/
|
|
|
|
namespace Spec.Courseware
|
|
|
|
/-- 富内容在工程文件里的虚拟路径(ADR-0006)。落盘后是真实相对路径(ADR-0007),
|
|
这层不承诺,所以 opaque。 -/
|
|
opaque VPath : Type
|
|
|
|
/-- 富内容的 format(ADR-0015)。 -/
|
|
inductive ContentFormat where
|
|
/-- typst 源:求值后得到讲义/教案用的内容。 -/
|
|
| typst
|
|
/-- markdown + KaTeX 源:原样保留,不经 typst 求值(slides、逐字稿)。 -/
|
|
| markdown
|
|
|
|
/-- 对一段富内容的引用:它挂在一个虚拟路径上(ADR-0006),带一个 format(ADR-0015)。
|
|
不建模源文本,也不建模求值出的内容——那是实现的事;这里只钉"富内容由虚拟路径定位
|
|
+ 带 format",作为 ElementData 里 content 叶子的语义锚点。 -/
|
|
structure RichContentRef where
|
|
vpath : VPath
|
|
format : ContentFormat
|
|
|
|
end Spec.Courseware
|