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>
24 lines
822 B
Lean4
24 lines
822 B
Lean4
import Spec.Courseware.Model.Primitives
|
|
|
|
/-!
|
|
# Element —— 课程内容的最小单位
|
|
|
|
一个 element = 一个 kind 标签 + 符合该 kind schema 的数据(ADR-0005)。
|
|
用依赖结构编码,使"数据必须匹配 kind"成为类型层面的事实,不是运行时校验。
|
|
-/
|
|
|
|
namespace Spec.Courseware
|
|
|
|
variable (P : Primitives)
|
|
|
|
/-- 一个 element 实例(ADR-0005)。data 的类型由 kind 决定,所以没法造出数据和 kind
|
|
不符的 element——schema 合规由类型保证。逐字稿、重点圈划这类跟具体 kind 强相关
|
|
的字段,落在该 kind 的 ElementData 里,不放在这个通用结构上。 -/
|
|
structure Element where
|
|
/-- 这个 element 的 kind。 -/
|
|
kind : P.KindId
|
|
/-- 符合 kind schema 的数据,类型随 kind 变。 -/
|
|
data : P.ElementData kind
|
|
|
|
end Spec.Courseware
|