Files
curriculum-project-hub/spec/Spec/Courseware.lean
T
sjfhsjfh de87cddaf1 feat(spec): Artifact gets fields, target = artifact + typed steps, drop RenderRule (ADR-0011)
Fix the abstraction level review flagged. lake build green (20 jobs), no sorry.

- Artifact.lean: bare enum → ADT with fields — singleFile(filepath) /
  fileTree(root, outputs:glob). The product semantics (one file where, vs a tree
  of what) are pinned in fields + doc, not erased behind empty constructors.
  Paths/globs carried as String (semantics in doc; no filesystem algebra).
- Render.lean: Step inductive (typstCompile(template) | shell(run)) replaces the
  loose BuildStepForm. TargetSpec = artifact + steps:List Step + covers:Kind→Prop
  (the old renders:Kind→Option RenderRule is gone — coverage is now a plain
  declaration; the render "how" lives in the typstCompile template). covers /
  renderIgnored semantics continuous with ADR-0005.
- Primitives.lean: RenderRule field removed (the per-target payload is retired per
  ADR-0011); a note records where the "how" now lives.
- Diagnostic.lean unchanged in meaning (covers signature stable; Legal still
  quantifies over declared targets).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 09:46:34 +08:00

36 lines
1.7 KiB
Lean4

import Spec.Courseware.Primitives
import Spec.Courseware.RichContent
import Spec.Courseware.Artifact
import Spec.Courseware.Element
import Spec.Courseware.Lesson
import Spec.Courseware.Render
import Spec.Courseware.Diagnostic
import Spec.Courseware.Pipeline
import Spec.Courseware.QuestionBank
import Spec.Courseware.Course
/-!
# Courseware —— 产品层契约(课程工程文件)
护城河:课程"工程文件"的语义母本与合法性规则。决策出处 ADR-0005 / 0006 / 0007 / 0008
/ 0009 / 0010 / 0011。
已填实(PINNED):
- `Primitives` —— 基元载体(表示留给实现;schema 形态见 ADR-0006)。
- `RichContent` —— 富内容 = 带虚拟路径的 typst 源(ADR-0006 的 prose 母本)。
- `Artifact` —— export 产物(带字段 ADT:`singleFile filepath` / `fileTree root outputs`),
target 值的一部分(ADR-0009/0011)。
- `Element` —— kind 标签 + 依赖 schema 的数据。
- `Lesson` —— element 的有序序列(序载教学语义、不建模时长)。
- `Render` —— export target = artifact + 有序 typed steps:`TargetSpec` 携 `artifact` +
`steps : List Step`(`typstCompile template` / `shell run`)+ 覆盖声明 `covers`;
`RenderConfig.covers` 判定(ADR-0009/0011,修订 ADR-0005)。RenderRule 载荷已废止。
- `Diagnostic` —— Severity + 7 类诊断的含义与级别 + **合法 lesson = 无 error 级诊断**;
模型外设施诊断以抽象谓词 + `Oracle` 实现边界表示(ADR-0010)。
- `Pipeline` —— 检查管线的 5 阶段、执行序、compile 门控(ADR-0010)。
留白骨架(核心关系 OPEN,已 surface 不臆造):
- `QuestionBank` —— 题库与 element 的关系(引用 vs 内联)。
- `Course` —— course = lesson 编排的规则。
-/