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 @@
剥离单位面积固液界面前后的界面能账目变化为:消失一份固液界面贡献 $-gamma_(S L)$,新生成一份固气面与一份液气面贡献 $+(gamma_(S G) + gamma_(L G))$。剥离所做的可逆功 $W_(S L)$ 等于界面能的净增量
$ W_(S L) = gamma_(S G) + gamma_(L G) - gamma_(S L) , $
整理即得 @Dupré关系。
@@ -0,0 +1,5 @@
设把单位面积固液界面剥离成各自暴露的固气面与液气面所需的可逆功为粘附功 $W_(S L)$,则
$ gamma_(S L) = gamma_(S G) + gamma_(L G) - W_(S L) . $ <Dupré关系>
$W_(S L)$ 越大,固液之间越"粘"得紧,$gamma_(S L)$ 越小。
@@ -0,0 +1 @@
kind = "lemma"
@@ -0,0 +1,13 @@
@GG公式 给出的 $gamma_(S L) = (sqrt(gamma_(S G)) - sqrt(gamma_(L G)))^2$ 代入 @Young方程:
$ cos theta = (gamma_(S G) - (sqrt(gamma_(S G)) - sqrt(gamma_(L G)))^2) / gamma_(L G) . $
展开右端分子:
$ gamma_(S G) - (gamma_(S G) - 2 sqrt(gamma_(S G) gamma_(L G)) + gamma_(L G)) = 2 sqrt(gamma_(S G) gamma_(L G)) - gamma_(L G) , $
代回得
$ cos theta = 2 sqrt(gamma_(S G) / gamma_(L G)) - 1 , $
@GGZ判据。
@@ -0,0 +1,5 @@
Berthelot 估计 @GG公式 代回 Young 方程 @Young方程,得到 GirifalcoGoodZisman 浸润判据
$ cos theta = 2 sqrt(gamma_(S G) / gamma_(L G)) - 1 . $ <GGZ判据>
接触角完全由比值 $gamma_(S G) \/ gamma_(L G)$ 一个无量纲数决定。
@@ -0,0 +1 @@
kind = "lemma"
@@ -0,0 +1,9 @@
@Berthelot粘附 代入 @Dupré关系:
$ gamma_(S L) = gamma_(S G) + gamma_(L G) - 2 sqrt(gamma_(S G) thin gamma_(L G)) , $
右端是完全平方差,化简得
$ gamma_(S L) approx (sqrt(gamma_(S G)) - sqrt(gamma_(L G)))^2 , $
@GG公式。
@@ -0,0 +1,7 @@
对色散力为主的固液体系,异种相互作用能由同种相互作用能的几何平均近似:$epsilon_(S L) approx sqrt(epsilon_(S S) thin epsilon_(L L))$。相应地粘附功
$ W_(S L) approx 2 sqrt(gamma_(S G) thin gamma_(L G)) . $ <Berthelot粘附>
代入 @Dupré关系 GirifalcoGood 公式
$ gamma_(S L) approx (sqrt(gamma_(S G)) - sqrt(gamma_(L G)))^2 . $ <GG公式>
@@ -0,0 +1 @@
kind = "lemma"
@@ -0,0 +1,9 @@
沿固体表面把接触线挪动 $dif x$,单位接触线长度上:固液界面增 $dif x$,固气界面减 $dif x$,液气界面长度按 $cos theta$ 投影增 $dif x cos theta$。总界面能的变化
$ dif F = gamma_(S L) dif x - gamma_(S G) dif x + gamma_(L G) cos theta thin dif x . $
平衡条件 $dif F = 0$ 给出
$ gamma_(S G) = gamma_(S L) + gamma_(L G) cos theta , $
@Young方程。
@@ -0,0 +1,3 @@
一滴液体落在固体表面上,与固气界面之间形成三相接触线。设浸润角即接触角为 $theta$,则三种界面张力满足
$ gamma_(S G) = gamma_(S L) + gamma_(L G) cos theta , quad arrow.r.double quad cos theta = (gamma_(S G) - gamma_(S L)) / gamma_(L G) . $ <Young方程>