Skip to content

Commit e30353c

Browse files
authored
Conventions, project structure and the README: numbered docs with an index, governance files, and the member-directory form (#69)
* docs/: a numbered layout with an index, and every cross-reference follows * AGENTS.md and CODEOWNERS: the repository's rules in their shortest form, and review routing * README: the members table behind details, a maintainer column, and a Chinese mirror * a member may be a directory, and a unit's private region is a private module fragment * dist-apk, dist-apple and the lib root split to the member-directory form * README: the common members first, a contributing-and-maintenance section, clickable maintainers, and no layout or releases section * Revert "dist-apk, dist-apple and the lib root split to the member-directory form" This reverts commit 05a3357. * README: four-column member tables and a contributing ladder; the module and floor columns live in the documentation index * README: the participation path, the maintainer requirements, a maintainers list, and a maintainer-application issue template * a maintainers page in docs, a compact contributing section, and a per-member application with both contribution categories * the application states its contribution hints: pull requests and commits, articles and videos on public platforms * plugins, not members: the terminology, a new-plugin template with an RFC stage, and the maintainer's two cores as a table * the docs links move into the issue templates; the README opens the issues * the contributing section reads as one passage into the two issue links * the index link reads mcpp-index and points at the index itself * docs/03 states which plugins the repository takes, and the new-plugin template points at it * the maintainers table ends with the apply-to-maintain row and its document * both cells of the apply row are links, and the right one is one sentence
1 parent c874271 commit e30353c

37 files changed

Lines changed: 840 additions & 374 deletions

‎.agents/docs/2026-09-26-plugins-0.15-architecture-plan.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ rules-qt 的 SDK 查找顺序为 `options::root` → `QT_ROOT_DIR`(不采用 `
125125
## 6. 规范与文档
126126

127127
- **README**:精简为约 100 行(原 1113 行),开篇陈述 §0 的总纲;各成员细节移至 `docs/<成员>.md`。
128-
- **`docs/plugin-development.md`(新增)**:包含职责分层表和十条规则:
128+
- **`docs/01-plugin-development.md`(新增)**:包含职责分层表和十条规则:
129129
1. 机制而非策略;
130130
2. feature 只表达机制;
131131
3. build.mcpp 为先的三级配置;

‎.agents/docs/2026-09-27-mcpp-2026.9.27.1-ecosystem-plan.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ A1 至 A4 可以并行。B3 不依赖 B2:旧版 xlings 忽略 revision 字段
144144

145145
- **C0 预验证:** `ci.yml` 的 `workflow_dispatch` 接受 mcpp 的分支名。在 B4a 之后以该分支运行 plugins 全部 CI,mcpp 发布前就能发现生态回归。
146146
- **C1 内容:**
147-
- 引擎最低版本改为 2026.9.27.1:`ci.yml:54`、README 功能表、`docs/deps.md` 与 `docs/rules-qt.md` 的版本说明。
147+
- 引擎最低版本改为 2026.9.27.1:`ci.yml:54`、README 功能表、`docs/40-deps.md` 与 `docs/11-rules-qt.md` 的版本说明。
148148
- 删除 `rules/qt.cppm:365-374` 的静默分支:#715 修复后,引擎不再为这种包合成程序。fixture `qt-import-only` 改为断言"没有构建程序运行",作为引擎行为的回归测试。
149149
- 四个 Qt fixture 的 `cxx_runtime = "toolchain-coupled"` 从 `[build]` 移到 `[target.x86_64-linux-gnu]` 与 `[target.aarch64-linux-gnu]`,同时成为 #704 的端到端验证。
150150
- `check-deps-and-qt.sh` 中七处 `--profile dev` 是 #705 的规避手段。逐处去掉,并在三平台上确认第二次构建不重新安装。
151-
- `docs/rules-qt.md:62、98` 中关于 #715、#704 的规避说明改写为现行行为。
151+
- `docs/11-rules-qt.md:62、98` 中关于 #715、#704 的规避说明改写为现行行为。
152152
- **发布:** 按 mcpp-plugins 发布流程:tag、GitCode 镜像、mcpp-index 登记。
153153

154154
### 3.5 阶段 D:沙箱真实验证

‎.agents/docs/2026-09-27-plugins-0.15.2-plan.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ D1 的索引改动只是删除冗余键;消费方的切换不依赖它先合
4141
### 2.3 mcpp-plugins 0.15.2:一个 PR
4242

4343
- `rules/qt.cppm`:缺少 SDK 时的提示改为 `"xim:qt-base" = "6.11.1"`。
44-
- 测试 fixture(qt-consumer、qt-widgets-consumer)与 `docs/rules-qt.md`、README:版本改为 `6.11.1`。
44+
- 测试 fixture(qt-consumer、qt-widgets-consumer)与 `docs/11-rules-qt.md`、README:版本改为 `6.11.1`。
4545
- `ci.yml`:沙箱缓存 key 的前缀加代次(`mcpp-sandbox-v2-…`),`restore-keys` 同步修改。仅 fixture 哈希变化不够:现有 `restore-keys` 前缀会恢复持有旧 6.11.1 的缓存。
4646
- 验收:三平台 CI 全绿。其中 Linux 的 widgets 打包检查要确认新缓存下装出的 `6.11.1` 带有运行时闭包(libdbus、xkbcommon、fontconfig),这正是 D1 的实证。
4747
- 发布:tag v0.15.2、GitCode 镜像(sha256 比对)、mcpp-index 登记。

‎.agents/docs/2026-10-01-ecosystem-build-plugin-framework-plan.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ sha256 `40b9fa16be5628a5d277824f961faa33dadbf84d9520cff9fe2aeb9b0b217ebf`(下载
216216

217217
## 4.1 面向两类读者的参考文档(2026-10-02 追加)
218218

219-
`docs/tool-sources.md`(372 行,README 与 plugin-development.md 各有入口)。写它的理由是:
220-
机制此前在三处分别被记下——引擎的键在 mcpp docs/23、模块的接口在 plugin-development.md、
219+
`docs/02-tool-sources.md`(372 行,README 与 01-plugin-development.md 各有入口)。写它的理由是:
220+
机制此前在三处分别被记下——引擎的键在 mcpp docs/23、模块的接口在 01-plugin-development.md、
221221
每个成员的选项在各自页面——而**没有一处说出必须同时成立的那两半**:
222222
`build.mcpp` 里的 `tool::choice` 只有在插件把该载荷声明为 `provision = "on-request"` 时才等于
223223
「不下载」,因为 eager 的载荷在任何构建程序运行之前就已供给。这正是 mcpp#755 的原始症状,
@@ -291,7 +291,7 @@ framework-lab 的 8 个用例在 ubuntu-24.04、macos-15、windows-2022 上全
291291
| 用户体验 | 每个显式来源一行,带类与 `file:line`;每条拒绝都列出命名它的四种方式;`considered` 记下每一层问过什么、答了什么 |
292292
| 兼容性 | **未迁移的第三方插件无需改动即受益**(覆盖发生在引擎层,`xpkg_dir` 直接回答);成员的历史环境变量保留;地板不满足时的拒绝现在会点名地板与升级方式(第 7 处发现) |
293293
| 跨平台 | Linux / macOS / Windows 全绿。跨平台本身贡献了 5 处发现:响应文件的两种 tokenize 语法、Darwin 的 `environ`、宿主自己补的 `.exe` 后缀、Apple 链接形状拿不到 `--ld-path`、gcc 16 的 `always_inline` 拒绝 |
294-
| 一致性 | 优先级只写两份(核心、L2);中英文档结构一一对应;`docs/tool-sources.md` 补上了此前三处分散记述都没说出的那一对条件 |
294+
| 一致性 | 优先级只写两份(核心、L2);中英文档结构一一对应;`docs/02-tool-sources.md` 补上了此前三处分散记述都没说出的那一对条件 |
295295
| 无感升级 | 不写任何新键的工程行为与输出不变,由既有 e2e 与 framework-lab 的 `default` 用例断言;插件 0.19.0 的成员在默认路径上下载与输出不变 |
296296
| 测试覆盖 | 单测 144(新增 21);e2e 873-877 加 875 里 gcc 拒绝的反例;`plugin-logic` 29 例;framework-lab 10 例 × 3 平台;toolchain-lab 8 例 × 3 平台;CI 判据读 `resolution.json`,所以在已装载荷的 runner 上也能断言「这次没要求它」 |
297297

‎.agents/docs/2026-11-24-rules-qml-design.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Windows 与 macOS 没有实测机器:凡依赖它们的结论都标"推断",
178178
- QML:部署 `QtQuick/Layouts` 的插件后,包里没有 `libQt6QuickLayouts.so.6`;Controls 的 `libQt6QuickControls2Impl.so.6` 同样缺。
179179
- **现有 `rules-qt` 的平台插件也有同一缺口**:对已部署 `platforms/` 的打包目录逐个读依赖,缺 `libQt6XcbQpa.so.6`(`libqxcb.so`)、`libQt6WaylandClient.so.6`(`libqwayland.so`)、`libQt6EglFSDeviceIntegration.so.6`(`libqeglfs.so`)。真实 X11 桌面上,xcb 平台插件会因缺 `libQt6XcbQpa` 加载失败;现有 CI 只在 offscreen 下运行,所以没发现。(我没有显示环境,只在静态依赖层面确认,运行层面的失败是推断。)
180180

181-
**与仓库规则的关系**:`docs/plugin-development.md` 的规则 4(运行时闭包属于提供二进制的包;插件只命名库目录)与规则 8(引擎缺口要报告,不要打补丁;已有的补丁要在文档里记录 issue 号并在引擎支持后移除)。因此:
181+
**与仓库规则的关系**:`docs/01-plugin-development.md` 的规则 4(运行时闭包属于提供二进制的包;插件只命名库目录)与规则 8(引擎缺口要报告,不要打补丁;已有的补丁要在文档里记录 issue 号并在引擎支持后移除)。因此:
182182

183183
1. **向 mcpp 提 issue**(你同意后已提交):**mcpp-community/mcpp#1011**,建议能力是"`mcpp pack` 把 `role: library` 的已部署文件也作为闭包的根"。正文见 §15。提交前搜索过,没有重复(相关的 #615、#634、#630、#701 都是已关闭的、讨论别的缺口)。
184184
2. **本 PR 带 `link_plugin_libs` 补丁,按规则 8 标注**(这是你的决定:先 workaround,用户与开发者层面无感,mcpp 修复后自动没问题):
@@ -193,7 +193,7 @@ Windows 与 macOS 没有实测机器:凡依赖它们的结论都标"推断",
193193
// note: idempotent: linking a library the engine also stages changes nothing
194194
```
195195
196-
`docs/rules-qt.md`、`docs/rules-qml.md` 各有"引擎缺口"一节,写 mcpp#1011 与移除条件(规则 8);README 不提。
196+
`docs/11-rules-qt.md`、`docs/12-rules-qml.md` 各有"引擎缺口"一节,写 mcpp#1011 与移除条件(规则 8);README 不提。
197197
- **自动退场**:补丁是幂等的——引擎一旦把已部署库的依赖纳入闭包,我们多链的同一批库对结果没有任何影响(同一个文件、同一个目的地)。引擎没有向 build 程序暴露版本接口(`hostprogram.cppm` 只有 `package_version` 等,已查),所以不做版本门;退场靠下一条。
198198
- **金丝雀**:`qml-deploy` 的脚本多做一次构建:用环境变量让 fixture 的 `build.mcpp` 设 `plugin_closure = false`,打包,再用读取器检查闭包。若这次包里**已经**没有缺库,说明引擎修好了,脚本打印 `NOTICE: the engine now closes deployed libraries (mcpp#1011); remove the plugin_closure workaround` 并以成功退出(不失败,是提示);仍缺库则打印 `ok: the engine gap still exists (mcpp#1011)`。引擎修好后,CI 日志里会自动出现这条提示,不需要有人记得。
199199
- **链接旗标要防"未引用的库被丢弃"**(评审指出的风险,已用 lld 实测):Linux 上 lld 默认保留按全路径给出的库(NEEDED 保留),但加 `--as-needed`(Ubuntu 的 gcc 默认就是)后被丢弃(NEEDED 为 0);用 `-Wl,--push-state,--no-as-needed <库> -Wl,--pop-state` 包住后保留(实测,且包外的库仍按 `--as-needed` 处理)。macOS:`ld64.lld` 默认保留,`-dead_strip_dylibs` 丢弃,`-needed_library <路径>` 保留(实测,直接用 `ld64.lld` 与手工构建的 dylib)。因此补库在 ELF 上用 push/pop 包住,在 Mach-O 上用 `-needed_library`。
@@ -437,7 +437,7 @@ Qml2Imports = qml
437437
Translations = <qt.i18n.deploy_to> # 仅在不是默认的 translations 时写出
438438
```
439439

440-
并 `deploy` 到 `.`。检测到项目自己的 `qt.conf` 时不写(Q3)。副作用见 Q3,写进 `docs/rules-qml.md`。
440+
并 `deploy` 到 `.`。检测到项目自己的 `qt.conf` 时不写(Q3)。副作用见 Q3,写进 `docs/12-rules-qml.md`。
441441

442442
**Qt Quick 所需的插件目录**用一个独立字段 `options::quick_plugins`,与 `qt.deploy_plugins` 取并集,而不是"检测 `deploy_plugins` 是否为默认值再替换"(`std::vector` 分不清"没设置"和"设成了默认值",评审指出)。`quick_plugins` 的默认值:Linux `xcbglintegrations`、`platforminputcontexts`、`imageformats`;Windows/macOS `imageformats`、`platforminputcontexts`(目录不存在则只是 `rules-qt` 已有的警告)。用户把它设为空即不加。**这一项是推断**(真实 GL 窗口无法在无显示环境测试),由打包清单断言与 offscreen 运行约束,可按 CI 调整。`plugin_closure` 在两个规则里默认都是 `true`,不存在"未设置"问题。
443443

@@ -547,10 +547,10 @@ PE 与 Mach-O **读取器**的正确性已用真实构建的样本验证(样
547547
| `src/binary.cppm` | 新增(`mcpp.plugins.binary`) |
548548
| `rules/qt.cppm` | §7 的 a–f;头注释增加"见 `mcpp.rules.qml`" |
549549
| `mcpp.toml` | `version` 0.26.1 → 0.27.0;`[features.plugins-binary]`、`[features.rules-qml]`;`rules-qt` 的 `implies` 增加 `plugins-binary`;`src/plugins.cppm` 的版本常量同步 |
550-
| `docs/rules-qml.md` | 新增:开头一段摘要,随后用法、选项表、动作清单、部署与闭包、`qt.conf` 副作用、限制(§1 非目标)、平台表、"引擎缺口"一节(同上);遵守 `plugin-development.md` 规则 10 |
551-
| `docs/rules-qt.md` | `moc_json`、`moc_includes`、`compile_ex`、`i18n.extensions`、`plugin_closure`;新增"引擎缺口"一节(平台插件的闭包缺口、issue 号、移除条件、金丝雀);指向 `rules-qml` |
552-
| `docs/engine-and-rules.md` | `rules-qml` 不认领扩展名、不写 `rule_module` 的原因 |
553-
| `docs/plugin-development.md` | §3 的分层表加入 L2 单元 `mcpp.plugins.binary`;规则 8 的"已有补丁"一节指向 `check-engine-gaps.sh` |
550+
| `docs/12-rules-qml.md` | 新增:开头一段摘要,随后用法、选项表、动作清单、部署与闭包、`qt.conf` 副作用、限制(§1 非目标)、平台表、"引擎缺口"一节(同上);遵守 `01-plugin-development.md` 规则 10 |
551+
| `docs/11-rules-qt.md` | `moc_json`、`moc_includes`、`compile_ex`、`i18n.extensions`、`plugin_closure`;新增"引擎缺口"一节(平台插件的闭包缺口、issue 号、移除条件、金丝雀);指向 `rules-qml` |
552+
| `docs/00-engine-and-rules.md` | `rules-qml` 不认领扩展名、不写 `rule_module` 的原因 |
553+
| `docs/01-plugin-development.md` | §3 的分层表加入 L2 单元 `mcpp.plugins.binary`;规则 8 的"已有补丁"一节指向 `check-engine-gaps.sh` |
554554
| `.github/scripts/check-engine-gaps.sh` | 新增(Q9 的标记检查),并接入现有 `check-compat-retirement.sh` 所在的步骤 |
555555
| `README.md` | Members 表增加 `rules-qml`(mcpp 下限列 2026.10.1.3,注明整个包需要 2026.10.30.1、最低验证 2026.10.31.3);`plugins-binary` 进"通用库"一段;示例版本号 |
556556
| `tests/plugin-logic/…` | §10.1 |
@@ -564,7 +564,7 @@ PE 与 Mach-O **读取器**的正确性已用真实构建的样本验证(样
564564

565565
1. `mcpp.plugins.binary` 与单测(合成样本、截断扫描)。
566566
2. `rules-qt`:`moc_json`、`moc_includes`、`compile_ex`、导出函数,`plugin-logic` 的"现有 argv 不变"用例(先证明零回归)。
567-
3. `rules-qt`:`link_plugin_libs`、`plugin_closure`(默认开,带 `ENGINE-GAP WORKAROUND` 标记)、`check-engine-gaps.sh` 与对应单测(单独一个提交;`docs/rules-qt.md` 的"引擎缺口"一节随它提交,便于你单独审这一处行为变更)。
567+
3. `rules-qt`:`link_plugin_libs`、`plugin_closure`(默认开,带 `ENGINE-GAP WORKAROUND` 标记)、`check-engine-gaps.sh` 与对应单测(单独一个提交;`docs/11-rules-qt.md` 的"引擎缺口"一节随它提交,便于你单独审这一处行为变更)。
568568
4. `rules-qml` 的模块链路(§6),及其 `plugin-logic` 用例。
569569
5. 部署:文本闭包、`qt.conf`、补库(§8)及用例。
570570
6. `qsb`、`qmllint`、`lupdate` 扩展。
@@ -616,14 +616,14 @@ PE 与 Mach-O **读取器**的正确性已用真实构建的样本验证(样
616616

617617
| # | 意见(摘要) | 核实 | 处理 |
618618
|---|---|---|---|
619-
| 1 | 闭包补丁违反 `plugin-development.md` 规则 4、8;建议不打补丁、默认关或放进带到期日的 `compat/` | 属实:规则 8 原文是"引擎缺口要报告,不打补丁" | **你的决定**:先 workaround、默认开、无感、引擎修好后自动无事。我采纳了其中的"标注与强制移除"思想,做成与 `compat/` 同构的 `ENGINE-GAP` 标记 + `check-engine-gaps.sh`(因没有固定日期,不用到期日),并加金丝雀(Q9) |
619+
| 1 | 闭包补丁违反 `01-plugin-development.md` 规则 4、8;建议不打补丁、默认关或放进带到期日的 `compat/` | 属实:规则 8 原文是"引擎缺口要报告,不打补丁" | **你的决定**:先 workaround、默认开、无感、引擎修好后自动无事。我采纳了其中的"标注与强制移除"思想,做成与 `compat/` 同构的 `ENGINE-GAP` 标记 + `check-engine-gaps.sh`(因没有固定日期,不用到期日),并加金丝雀(Q9) |
620620
| 2 | `plugin_closure`、`deploy_plugins` 用普通类型分不清"未设置"与"设成默认值" | 属实 | 采纳:`plugin_closure` 两处都默认 `true`;Quick 插件目录改用独立字段 `quick_plugins` 取并集(§8) |
621621
| 3 | `qt.conf` 固定文本,`deploy_to` 非默认会丢翻译;未处理项目自带 `qt.conf` | 属实 | 采纳(Q3):`Translations` 随 `deploy_to`;检测并警告用户自己的 `qt.conf`。内嵌到 qrc 的方案未采纳:文件方案已实测,内嵌的 `Prefix` 相对谁未验证 |
622622
| 4 | README 下限列语义;`action::env` 是否存在 | README 列语义属实;`action::env` 存在(`hostprogram.cppm:441`,协议 13) | 采纳(Q4):列写 2026.10.1.3 并注明;Q4 证据改为只声称验证过的 API |
623623
| 5 | §6 的"都跑通"过度概括:单模块、`qsb`/`qmllint` 未运行、G4/C++ 单例无证据;延迟导入等没有真实样本;`closure.py` 写死路径、只认整行 `import` | 属实 | 采纳:补做多模块(`sum=19`)、跨模块继承、C++ `QML_SINGLETON`、无 C++ 类型模块、`lupdate` 的 qml 提取;§6 标题如实写明;Q2 列出只有合成样本覆盖的路径;`closure.py` 容忍行尾 `;`(4 个样本仍与 scanner 一致)。"40 个模块的样本用的是 Qt 自己的文件而不是用户代码":属实,写在 Q1 的覆盖说明里,结论限于 SDK 内部的 import 图 |
624624
| 6 | 规则 9:`qml-shaders` 永远不会失败;G9 无 fixture;`aot=false`、`styles` 等无运行用例 | 属实 | 采纳:G9 加进 `qml-consumer`;加三个变体(§10.2);`qml-shaders` 的跳过用 `::notice::` 可见,并在限制里承认 G7 在 `xim:qt-addons` 修复前只有 argv 级覆盖 |
625625
| 7 | 计划期读 `.qml` 内容,只声明 glob 不够 | 属实(`rules/qt.cppm` 对读过的头文件逐个声明) | 采纳(§5.1) |
626-
| 8 | 文档清单缺项:`plugin-development.md` L2 表、脚本的 usage/case;交叉引用错;`--format` 写法;`compile_ex`、`tool_path` 扩大契约;`rule_module` 的说法含糊 | 属实 | 采纳(§4.1、§7 e、§11、§15、spikes README) |
626+
| 8 | 文档清单缺项:`01-plugin-development.md` L2 表、脚本的 usage/case;交叉引用错;`--format` 写法;`compile_ex`、`tool_path` 扩大契约;`rule_module` 的说法含糊 | 属实 | 采纳(§4.1、§7 e、§11、§15、spikes README) |
627627
| 9 | 测试:`env -i` 挡不住 RUNPATH;`.qmltypes` 文本非契约;mtime 粒度;`grep -a` 不证明 AOT;随机改字节无种子、sanitizer 与模块单元的组合;`dumpbin` 需要 VS | 属实 | 采纳(§10.1、§10.3):挪走 SDK 目录;运行时断言继承;`sleep 2.2`;`llvm-nm` 符号;固定种子、sanitizer 不进 CI;统一用 `llvm-readobj`(也是你关于 LLVM 的意见的落点) |
628628
| S1 | `link_flag` 的库可能被 `--as-needed` 丢弃 | **实测属实**(lld `--as-needed` 下 NEEDED 为 0) | 采纳(Q9、§7):push/pop 包住;Mach-O 用 `-needed_library` |
629629
| S2 | macOS bundle 里 `Prefix = .` 含义不同 | 无法验证 | 写入 Q3,归入 Q7 的范围,标明推断 |

‎.github/CODEOWNERS‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Default owner: every path needs the package owner's review.
2+
* @Sunrisepeak
3+
4+
# Per-area rows: review is routed by family, and a new maintainer
5+
# takes a family by editing one line.
6+
/mcpp.toml @Sunrisepeak
7+
/src/ @Sunrisepeak
8+
/rules/ @Sunrisepeak
9+
/tools/ @Sunrisepeak
10+
/dist/ @Sunrisepeak
11+
/deps/ @Sunrisepeak
12+
/tests/ @Sunrisepeak
13+
/docs/ @Sunrisepeak
14+
/.github/ @Sunrisepeak

0 commit comments

Comments
 (0)