feat(cph): implement nested outline manifest and batch/combined export

ADR-0029 — nested outline manifest, supersedes ADR-0008's flat [[parts]]:
- cph-model: recursive loader over manifest.toml containers / element.toml
  leaves; Lesson.parts (pure elements, DFS order) + Lesson.outline (elements
  interleaved with section headings at their DFS-open position); rejects
  ambiguous/incomplete folders and root-vs-container table misplacement
- cph-diag: new DiagCode::ManifestMalformed for carrier-document structure
  errors (discharges an existing TODO)
- cph-typst: augmented manifest now serializes the outline (element/section
  entries) instead of a flat parts array
- render/lib.typ: render-lesson renders section headings at their depth
- examples/TH-141 migrated to 5 nested section containers + 3 root segments,
  byte-identical element order; smoke-verified via cph check/build + pdftotext

ADR-0030 — batch & combined export, extends ADR-0009/0011:
- cph build with no --target batches every declared target (repeatable
  --target for an explicit subset); any target failure => non-zero exit,
  per-target ledger, independent per-target execution
- cph-model: bundle.toml loader (directory + [info]/[targets.*]/ordered
  lessons with per-lesson target overrides)
- cph-typst: augmented bundle manifest (path-prefixed member outlines),
  Engine::{compile_check_bundle,build_bundle_pdf}
- render/lib.typ: render-bundle assembles member lessons under per-lesson
  headings, depth-shifts their own section headings, resets example/lemma
  counters at each lesson boundary by default
- cph-cli: `cph bundle <path> --target <name>` subcommand, same batching
  contract as `cph build`
- new bundle fixtures/tests (cph-model unit + cph-typst through-template PDF
  compile), smoke-verified via a real 2-lesson merged PDF

Verification: cargo fmt/clippy/test clean across the workspace (68 tests);
real cph check/build/bundle runs against TH-141 and a bundle fixture, PDF
content inspected via pdftotext.
This commit is contained in:
2026-08-04 20:31:05 +08:00
committed by 洪佳荣
parent e0bd6120ec
commit 9927d38c18
165 changed files with 2638 additions and 691 deletions
@@ -0,0 +1 @@
kind = "lemma"
@@ -0,0 +1,5 @@
数缺键以几何方式进行。
简单立方中每个体相原子的 6 个最近邻分布在上下左右前后六个方向。(100) 面上的表面原子失去上方那 1 个邻居,故 $Z_s = 5$$zeta = 5\/6$
面心立方中每个体相原子的 12 个最近邻分布在该原子周围三个 (111) 面上。(111) 面是最密堆积,表面原子失去上方一层的 3 个邻居,$Z_s = 9$$zeta = 3\/4$。(100) 面失去 4 个上方邻居,$Z_s = 8$$zeta = 2\/3$。(110) 面失去的近邻更多,$zeta$ 进一步减小。
@@ -0,0 +1,8 @@
通过对几何晶格直接数缺键数,可以把 @缺键一般式 中的 $zeta$ 落到具体数字:
- 简单立方 (100) 面:$Z = 6$$Z_s = 5$$zeta = 5\/6$
- 面心立方 (111) 面:$Z = 12$$Z_s = 9$$zeta = 3\/4$
- 面心立方 (100) 面:$Z_s = 8$$zeta = 2\/3$
- 面心立方 (110) 面:$zeta < 2\/3$
后续讨论以 FCC (111) 面为代表,因其密度最大、$gamma$ 最低、平衡形貌中最易出现。