# Quarto 中文书稿 docx — 本地验证沙盒

在 **harness 仓库内**验证 `scripts/quarto-docx/` 的 Word 参考文档与 Lua 滤镜。`run-check-all.ps1` 先跑网站样例，再跑 `test/book/`。产物不提交 Git。改过 canonical `lua/` 后先执行 `sync-mirror.ps1`，book 样例读的是 `test/lua/` 镜像。

## 快速开始（Windows 11）

在 harness 仓库根：

```powershell
cd scripts\quarto-docx\test
.\scripts\run-check-all.ps1
```

分步：

```powershell
.\scripts\run-module.ps1 -Module mod-acceptance
py -3 .\scripts\verify_docx.py .\output\modules\mod-acceptance\mod-acceptance.docx
```

从 canonical 刷新镜像：`.\scripts\sync-mirror.ps1`。

Linux / Cloud / Git Bash 可用同目录下的 `run-check-all.sh`、`run-module.sh`、`sync-mirror.sh`。

## 文档

- 专项规程：[quarto-docx-test-guide.md](quarto-docx-test-guide.md)
- 通用工作流：[docs/harness-asset-validation-workflow.qmd](../../../docs/harness-asset-validation-workflow.qmd)
- 资产长文：[docs/quarto-docx-chinese-book.qmd](../../../docs/quarto-docx-chinese-book.qmd)

## 迭代原则

1. 调试时**只改** `test/lua/` 与 `test/template/` 镜像；L1 全绿后再晋升 `../lua/` 与 `../reference-doc.docx`（先 `sync-mirror.ps1` 从 canonical 拉取，再改镜像）。
2. L1 通过 `run-module.ps1` 在**新进程**中 render，输出在 `output/modules/<名>/`（已 gitignore）。
3. `verify_docx.py` / `verify_book.py` 做 **OOXML 结构门禁**（网站：题注在表外、`图2-` 收紧、callout 仍为表；book：`图N-M`、一页 landscape）。列宽与五号表头仍建议 Word 目视。
4. 填写测试记录：复制 `TEST-LOG.example.md` → `TEST-LOG.md`（本地，不提交）。
