Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf8a68cf5 | ||
|
|
277f9c307d |
No files matched your search
@@ -16,6 +16,7 @@ steps:
|
||||
git -C "$domain" submodule update --init
|
||||
done
|
||||
- python3 scripts/check-layout.py --checkouts
|
||||
- python3 scripts/check-repo-conventions.py
|
||||
|
||||
candidate:
|
||||
# Match the Linux/glibc environment already used by View for the RC.4 artifact.
|
||||
|
||||
@@ -8,3 +8,14 @@
|
||||
6. 新接入组件先核对公开 API、直接依赖、独立入口和实际测试。空仓在 [迁移台账](docs/MIGRATION.md) 中保持 `planned`;Web 领域的 Design/Preview 子组件记录在 `marqdo-ext-web` 自己的 `components.toml`,根目录不登记其后代路径。
|
||||
7. 记录 FAIL 和 UNVERIFIED 的具体环境、命令和日志。只有实际通过且匹配候选 SHA 的证据才可用于集成与发行;模拟、mock 或原型测试不能冒充生产验收。
|
||||
8. Web 边界硬约束:不新增 CLI 核心语法或 Web 专属关键字;不复制 Markdown/语言解析器;默认不允许 HTML 注入、业务 JS 或真实网络/数据库/认证;预览是有限确定性解释,生产实现由成熟框架在目标应用仓库承担。
|
||||
|
||||
## 生态仓库开发规范(防膨胀,强制)
|
||||
|
||||
本文件与 [docs/REPOSITORY-CONVENTIONS.md](docs/REPOSITORY-CONVENTIONS.md) 共同约束所有仓库;后者是仓库组织、准入、最低文件集、AGENTS 模板、CI/发布/晋升与防膨胀清单的详细规范。做任何跨仓、建仓、激活、拆目录、加合同/清单/发布线之前必须先读它。
|
||||
|
||||
- **禁止膨胀**:不为单个功能/页面/算法/实验建仓;不建空壳/镜像/docs-only 仓;治理树最多两级 gitlink;禁止第三级、重复 catalog、第二套 contract/manifest/lock/parser/发布服务。
|
||||
- **每个 active 仓最低集**:README、AGENTS.md(含 `<!-- marqdo:repo-conventions v1 -->` 与根规范链接)、真实 `entry`、正反例、可复现证据、独立 CI;planned 仓库不登记 entry、不批量生成模板、不计完成率,激活时补齐。
|
||||
- **单一事实源**:源码组合=gitlink+.gitmodules;职责/依赖=catalog;依赖=各仓锁/manifest;发布=Gitea tag/资产;CI=真实 pipeline;推进=Issue/PR。不手工维护“最新版本表”。
|
||||
- **四种事实分开**:组件 CI 通过、release 发布、消费者接入、父级接受互不推导。晋升固定顺序 C2(组件)→ B2(领域)→ A2(根),先推子仓再更 gitlink,父级 PR 不夹带子仓源码。
|
||||
- **证据纪律**:记录 SHA、制品摘要、平台、命令、退出码、日志范围;未运行写 `UNVERIFIED`;不伪造 entry/版本/CI/PASS/发布资产;不提交密钥或构建产物。
|
||||
- **检查入口**:`scripts/check-repo-conventions.py`、`scripts/check-layout.py --checkouts`、`tests/integration`;CI layout 阶段强制执行,规则变更必须同步测试与模板。
|
||||
+1
-1
Submodule cli updated: deadf6edee...13affa76dd.
+4
-4
@@ -6,7 +6,7 @@
|
||||
|
||||
| 已有仓库 | 审计时默认分支 | 发行或证据 |
|
||||
| --- | --- | --- |
|
||||
| [marqdo-cli](https://git.cflmy.cn/cflmy/marqdo-cli) | `master` | v3.0.0-rc.4 |
|
||||
| [marqdo-cli](https://git.cflmy.cn/cflmy/marqdo-cli) | `master` | v3.0.0-rc.5 |
|
||||
| [marqdo-extension-conformance](https://git.cflmy.cn/cflmy/marqdo-extension-conformance) | `main` | 有独立固定 fixture |
|
||||
| [marqdo-knowledge](https://git.cflmy.cn/cflmy/marqdo-knowledge) | `master` | v0.1.0-beta.3 |
|
||||
| [marqdo-lint](https://git.cflmy.cn/cflmy/marqdo-lint) | `main` | v0.2.0 |
|
||||
@@ -16,7 +16,7 @@
|
||||
| [marqdo-web-design](https://git.cflmy.cn/cflmy/marqdo-web-design) | `main` | Web Design 组件,planned;初始开发文档 |
|
||||
| [marqdo-web-preview](https://git.cflmy.cn/cflmy/marqdo-web-preview) | `main` | Web Preview 组件,planned;初始开发文档 |
|
||||
|
||||
CLI gitlink 采用 RC.4 正式发布源码,以匹配冻结归档和现有 View/Lint 契约。
|
||||
CLI gitlink 采用 RC.5 正式发布源码(`c44b0f9`,tag `v3.0.0-rc.5`),以匹配冻结归档和现有 View/Lint 契约。
|
||||
其文档后续提交曾用于 Knowledge 的独立 CI;生态候选以自身测试判定实际组合。
|
||||
Conformance 使用 CLI 已固定的真实 fixture 提交。
|
||||
|
||||
@@ -53,7 +53,7 @@ Conformance 使用 CLI 已固定的真实 fixture 提交。
|
||||
| --- | --- | --- |
|
||||
| M0 盘点 | 自建 Git、历史标签、已有六组件和新仓位 | 通过真实远端候选持续维护台账 |
|
||||
| M1 集成骨架 | 六个 active gitlink,另固定 28 个直属和 2 个 Web 子级的 planned 开发提交 | 查看候选 Woodpecker 运行及各组件独立 CI |
|
||||
| M2 标准库切换 | planned,CLI RC.4 提供官方完整 Bundle | [CLI 外部 Bundle](https://git.cflmy.cn/cflmy/marqdo-cli/issues/11) 和 [九组件切换](https://git.cflmy.cn/cflmy/marqdo/issues/2),包括 HTTP、Regex、Archive 迁出与同步删除旧路径 |
|
||||
| M2 标准库切换 | **已切换基础发行**:CLI/Worker/Stdlib rc.5 归档 + 单一外部 Bundle;HTTP/Regex/Archive 已验证 | [CLI 外部 Bundle](https://git.cflmy.cn/cflmy/marqdo-cli/issues/11) 与 [九组件切换](https://git.cflmy.cn/cflmy/marqdo/issues/2) 完成;strict/perf 门禁限制见 rc.5 release notes |
|
||||
| M3 跨仓闭环 | 工单、人工候选、同 SHA 门禁 | [跨仓库 CI](https://git.cflmy.cn/cflmy/marqdo/issues/3) 跟踪真实缺陷闭环、候选通知鉴权、去重和影响分析 |
|
||||
| M4 领域接入 | Web 领域 active:WEB-00..04 完成,领域 catalog/gitlink 固定 Design/Preview;根 catalog 激活与 gitlink 一次切换 | 根 `check-layout --checkouts`、领域组件入口、`web` Tool 冷安装与既有消费者同候选证据;Stdlib 聚合按 STD-01..04 独立推进 |
|
||||
| 后续领域 | 空仓和预期职责 | 逐组件开展最小真实功能、独立 CI、制品与接入 |
|
||||
@@ -63,7 +63,7 @@ Conformance 使用 CLI 已固定的真实 fixture 提交。
|
||||
1. CLI 打包器与产品测试接受单一显式外部 Bundle 输入。内核独立编译;制品仍附带一个校验过的标准库。
|
||||
2. 标准库在各组件维护唯一生产源码和自测。组装拒绝冲突、符号链接或测试污染,调用 CLI 权威打包器。std-io 维护 print/打印 的别名元数据。
|
||||
3. HTTP、Regex、Archive 的真实替代和授权回归先行。候选同时移除 CLI 中旧领域宿主服务和旧导入。
|
||||
4. 验证同输入两次组装结果、摘要及路径负例、C1/C2/C3、独立冷安装和真实工具集成后,再切换基础发行。当前状态为 UNVERIFIED。
|
||||
4. 验证同输入两次组装结果、摘要及路径负例、C1/C2/C3、独立冷安装和真实工具集成后,再切换基础发行。**2026-11-27 已切换:rc.5 归档(sha256 `fd7a313e...`)发布,CLI gitlink 固定 `c44b0f9`;strict L1 与获批节点 G4 仍为 UNVERIFIED 限制,见根证据 `docs/evidence/2026-11-27-base-release-rc5-switch.md`。**
|
||||
|
||||
## 标准库源码归位迁移(marqdo#9,2026-11-26 M0 冻结)
|
||||
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
# 仓库开发规范(生态级)
|
||||
|
||||
本文件把 [marqdo#10](https://git.cflmy.cn/cflmy/marqdo/issues/10) 与既有架构/开发/迁移文档中的仓库组织要求整理为**可执行的仓库规范**,供主仓库、领域聚合仓和功能仓共同遵守。它不新建第二套权威:仓库身份仍以 `components.toml` + Git tree/gitlink + `.gitmodules` 为准,合同仍以各仓现行规范为准,流程细节以 [DEVELOPMENT.md](DEVELOPMENT.md)、[ARCHITECTURE.md](ARCHITECTURE.md)、[REPOSITORY-TASKS.md](REPOSITORY-TASKS.md)、[MIGRATION.md](MIGRATION.md) 为准。
|
||||
|
||||
## 1. 目的:防膨胀,而不是少文件
|
||||
|
||||
建立子仓库的唯一理由是形成**明确职责、独立开发闭环和可追溯协作**;不是为了减少单仓文件数量。任何新增仓库、目录层级、合同、清单、构建入口或发布线都必须证明:
|
||||
|
||||
1. 存在唯一责任所有者,且没有现成仓库能承担;
|
||||
2. 有独立构建/测试/交付或独立合同边界,而不是"按功能/按文件"拆分;
|
||||
3. 至少一个真实消费者或明确的默认发行需求(新增标准库还须满足 ARCHITECTURE 的准入门槛);
|
||||
4. 有可验证的激活路径(entry、测试、证据、CI),不产生空壳仓库;
|
||||
5. 不引入第二套 parser、manifest、catalog、lock、版本表、制品服务或发布流程。
|
||||
|
||||
**治理树最多两级 gitlink**:根 → 领域聚合(可选)→ 功能组件。禁止第三级;禁止用目录复制模拟仓库;禁止为单个功能、页面、算法、表格或实验创建仓库。
|
||||
|
||||
## 2. 仓库准入与状态
|
||||
|
||||
- 新仓库必须先在根仓库开 Issue/ADR,记录责任、消费者、退出条件,并在 `components.toml` 登记 `planned`;不得先建空仓再补理由。
|
||||
- `planned` 仓库允许挂载真实开发提交,但**不计完成率**、不登记 `entry`、不要求发布制品;只能有 README/必要源码/最小测试,不得批量复制模板、CI 徽章、占位实现或假入口。
|
||||
- 从 `planned` 激活必须同时具备:真实实现、README(职责/构建/依赖/平台)、`AGENTS.md`(本仓边界与路由)、可执行 CI 入口、真实正反例、交付/发布方式、候选证据;并在父级 catalog 登记 `entry`。
|
||||
- 只有规范/fixture 的仓库允许源码归档交付,不强制二进制;但必须有确定性归档与证据。
|
||||
- `active` 仓库不得回退为"文档占位";若失去责任,必须记录替代仓库与迁移/归档计划。
|
||||
|
||||
## 3. 角色与禁止事项
|
||||
|
||||
| 所有者 | 应做 | 禁止 |
|
||||
| --- | --- | --- |
|
||||
| 功能仓库(core/stdlib/extension/tool/test) | 自身实现、测试、制品、发布、消费上游候选、修复本仓缺陷 | 实现其它仓库功能;依赖父仓或兄弟仓 checkout;复制其它仓实现/parser/合同;偷偷替换上游逻辑 |
|
||||
| 领域聚合仓(`kind=domain`) | 领域合同、组合、领域候选 gitlink、领域验收、通知父仓 | 重复叶子实现;第二套调用协议;登记后代到根 catalog |
|
||||
| 根仓库 | 展开依赖、传播协调、全局候选、递归集成、正式发行、滞后报告 | 实现子组件业务;批量直接改子仓代码;成为每个仓的构建前置 |
|
||||
| CLI | 语言/通用能力、公开协议、CLI/Worker/基础产品打包 | 生态调度代码;反向依赖 stdlib 源码;物理拆仓 |
|
||||
| Conformance | 独立公共契约运行验收 | 取代组件自测;伪造未支持平台的 PASS |
|
||||
|
||||
## 4. 每个 active 仓库的最低文件集
|
||||
|
||||
```text
|
||||
<repo>/
|
||||
├── README.md # 职责、构建、测试、依赖、支持平台、状态
|
||||
├── AGENTS.md # 本仓边界、禁止项、输入/输出、工单路由(含规范标记)
|
||||
├── scripts/ci.sh # 非交互构建+检查+真实功能测试;失败非零;不打印秘密
|
||||
├── scripts/package.sh # 有制品时:生成候选并验证冷使用
|
||||
├── scripts/upstream.sh # 有外部依赖时:消费候选/生成最小依赖更新
|
||||
├── tests/ 或 fixtures/ # 真实正反例
|
||||
├── .woodpecker/ # 独立远程 CI;发布门禁与普通 CI 分离
|
||||
└── docs/ 或 spec/ # 公开接口/合同/证据
|
||||
```
|
||||
|
||||
允许复用现有脚本名(如 `scripts/test.sh`、`scripts/acceptance.sh`、`scripts/package-tool.sh`),但 `entry` 必须真实存在、可本地执行、非交互、默认无网络写副作用。构建产物、缓存、日志只写声明输出(如 `MARQDO_CI_OUT`),不得污染源码树;不得提交 `target/`、`dist/`、浏览器产物、凭证或本地绝对路径。
|
||||
|
||||
## 5. `AGENTS.md` 规范
|
||||
|
||||
每个 active 仓库必须有 `AGENTS.md`,以 `<!-- marqdo:repo-conventions v1 -->` 开头,并至少包含:
|
||||
|
||||
1. 本仓定位、catalog ID、父级、唯一权威合同/输入;
|
||||
2. 必做/禁止边界(不复制、不越界、不建第二目录/清单/合同/发布线);
|
||||
3. 构建/测试入口、实际依赖输入、证据要求(SHA、摘要、平台、命令、退出码、日志;未运行 = UNVERIFIED);
|
||||
4. 工单路由(上游合同缺陷去哪、跨仓组合如何晋升);
|
||||
5. 指向根规范:`https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/REPOSITORY-CONVENTIONS.md`。
|
||||
|
||||
模板见 [templates/AGENTS.component.md](templates/AGENTS.component.md)。`AGENTS.md` 只写本仓边界,不复制全局规范正文;合同正文仍只在唯一权威仓维护。
|
||||
|
||||
## 6. 独立 CI/CD 与证据
|
||||
|
||||
- 每个 active 功能仓必须能在**全新临时目录独立 clone**、无父仓、无兄弟源码、无隐式 PATH/缓存的情况下完成声明的构建与测试;可从权威远端下载固定 SHA/摘要的依赖,冷安装阶段禁网。
|
||||
- 依赖 CLI 的组件用绝对 `MARQDO_BIN` 并验证相应 `SOURCE_SHA`/制品;需要外部 Bundle 时用显式 `MARQDO_STDLIB_DIR`,不得用它替代最终发行默认 Bundle 检查。
|
||||
- 工具链、镜像、锁文件、target、CI 脚本变化必须进入缓存 key;cache hit 不是 PASS;测试脚本与持有发布密钥的脚本分离。
|
||||
- 普通 push/PR 只做检查与回归;发布仅消费**准确同 SHA** 的受保护 tag/批准工作流;不得用历史 PASS、浮动分支或 tag 名代替。
|
||||
- 正式发布必须记录:tag→完整 source SHA、真实 CI 证据、资产 basename/size/sha256、实际依赖身份、平台。发布后通知失败只重试通知,不重复发布或覆盖已公开资产。
|
||||
|
||||
## 7. 四种事实与晋升
|
||||
|
||||
必须分别记录,禁止推导:
|
||||
|
||||
1. 组件提交已通过本仓 CI;
|
||||
2. 组件 release 资产已完整发布;
|
||||
3. 消费者已对特定候选组合验证/接入;
|
||||
4. 领域或根主分支/正式发行已接受该组合。
|
||||
|
||||
晋升顺序:组件提交 C2(组件 PR + 组件 CI)→ 领域提交 B2(领域 PR 更新子 gitlink + 领域验收)→ 根提交 A2(根 PR 更新领域 gitlink + 递归布局/受影响组合/冷安装)。先推送子仓提交,再更新父级 gitlink;父级 PR 只改计划中的 gitlink/catalog/证据,不夹带子仓源码。禁止自动合并、自动提升或把通知成功当作下游已处理。
|
||||
|
||||
## 8. 单一事实源
|
||||
|
||||
| 信息 | 唯一来源 |
|
||||
| --- | --- |
|
||||
| 源码组合 | 根 Git tree 的 gitlink(递归)+ `.gitmodules` 权威远端 |
|
||||
| 仓库职责/依赖/影响 | 各级 `components.toml` 的 `kind/state/entry/requires/checks_with` |
|
||||
| 组件真实依赖 | 各仓 Cargo.lock/Cargo.toml、`marqdo.yaml`/`marqdo.lock`、现行 Tool/Bundle manifest |
|
||||
| 发布身份与资产 | 权威 Gitea Release/tag、发布证据与 SHA-256 |
|
||||
| CI 结果 | Woodpecker 真实 pipeline/日志/同 SHA 证据 |
|
||||
| 推进/缺陷/搁置 | Gitea Issue/PR/评论 |
|
||||
|
||||
禁止手工维护"全生态最新版本表"、第二套 catalog、重复 contract、复制 lock/manifest、把组件 SHA 写进 catalog。报告、影响分析、候选计划、发布索引只做派生视图,且不成为新锁。
|
||||
|
||||
## 9. 硬禁止(防膨胀清单)
|
||||
|
||||
- 不因文件多、模块多、页面多、功能多而拆仓;不为单个功能/实验/平台建仓。
|
||||
- 不建空壳仓、占位仓、镜像仓、docs-only 副本、重复服务或第二套包管理/制品服务/消息队列/Issue 数据库。
|
||||
- 不复制 Markdown/语言/表格 parser 或其它仓实现;不并列维护第二份现行合同。
|
||||
- 不在根/领域仓库实现子组件业务;不把子仓源码复制到父仓。
|
||||
- 不让子仓依赖父仓 checkout、兄弟仓相对路径或 `../design` 类发布依赖。
|
||||
- 不新增未在 catalog 的路径/仓库层级;不在根 catalog 登记领域后代。
|
||||
- 不伪造 entry、CI 徽章、版本、gitlink、PASS 或发布资产;未运行写 UNVERIFIED。
|
||||
- 不自动 tag/release/合并;不覆盖已公开 tag/资产;不使用未审查分支发布。
|
||||
- 不提交密钥、凭证、完整 Analysis、生产配置或本地绝对路径。
|
||||
- 不为 planned 仓库批量生成模板/脚本;激活时按最低集补齐。
|
||||
|
||||
## 10. 审核清单
|
||||
|
||||
**新仓/激活**:唯一职责?现有仓为何不能承担?谁消费?entry/测试/证据/发布方式齐全?planned 未计入完成率?根 catalog 与 `.gitmodules` 一致?
|
||||
|
||||
**子仓 PR**:只改本仓?未复制/越界?合同变更在唯一权威仓?依赖以固定身份验证?证据可复现?没有假 PASS/未验证声明?
|
||||
|
||||
**领域/根晋升**:只改计划 gitlink/catalog/证据?固定完整 SHA?递归布局通过?受影响消费者同候选通过?冷安装/回滚已记录?
|
||||
|
||||
**发布**:tag 指向冻结 SHA?同 SHA CI 真实成功?资产可下载且摘要一致?旧资产未被覆盖?通知与后续接入有追踪?
|
||||
|
||||
## 11. 工具与检查
|
||||
|
||||
- `python3 scripts/check-repo-conventions.py`:校验 active 仓最低文件集/AGENTS 标记/entry/catalog 一致性/无后代重复登记/叶子仓无子模块/无第二 catalog。
|
||||
- `python3 scripts/check-layout.py --checkouts`:治理树、远端、路径、全局 ID、依赖 DAG 与固定 checkout。
|
||||
- `python3 -m unittest discover -s tests/integration`:布局、影响分析、候选、Webhook/对账、仓库规范测试。
|
||||
- 根 `.woodpecker/eco.yml` 的 layout 阶段执行上述检查;任何规则变更加测试,不删检查放行。
|
||||
|
||||
## 12. 例外与记录
|
||||
|
||||
任何偏离本规范的例外(例如临时 planned 实现、平台限制、无法运行的 strict/perf 门禁)必须在工单/ADR 中记录:原因、责任者、复查日期、退出条件;不得以"先这样"长期沉积。规范本身变更走根仓库 PR + Issue/ADR,并同步模板与检查器。
|
||||
@@ -0,0 +1,36 @@
|
||||
# 基础发行切换:rc.5 发布与根 gitlink 固定(2026-11-27)
|
||||
|
||||
父工单:[marqdo#2](https://git.cflmy.cn/cflmy/marqdo/issues/2)。本文件记录实际发布与根组合切换。
|
||||
|
||||
## 发布身份
|
||||
|
||||
| 对象 | 身份 |
|
||||
| --- | --- |
|
||||
| 发布 | [marqdo-cli v3.0.0-rc.5](https://git.cflmy.cn/cflmy/marqdo-cli/releases/tag/v3.0.0-rc.5) |
|
||||
| tag / 源码 | `v3.0.0-rc.5` → CLI `c44b0f943875d563bb7c170f8ccd3fd56a82360f` |
|
||||
| CLI 同 SHA CI | pull_request + push pipeline **success**(Woodpecker CLI repo) |
|
||||
| 归档 | `marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu.tar.gz`,4,907,427 bytes,sha256 `fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b` |
|
||||
| 归档资产 | release assets:tar.gz + `.sha256`;下载后 sha256 与本地构建一致 |
|
||||
| Bundle | `marqdo-stdlib@0.2.0`,digest `sha256:db905508...`,外部显式输入 |
|
||||
| 根 CLI gitlink | `c44b0f94`(本候选切换;旧 rc.4 源码 `452e9a3` 为回滚目标) |
|
||||
| 平台 | Linux x86_64 / glibc 2.39(Ubuntu 24.04 容器验证) |
|
||||
|
||||
## 发布门禁(同一最终归档上真实执行)
|
||||
|
||||
- CLI 发布 SHA 的 Woodpecker pull_request/push pipeline **success**。
|
||||
- 确定性归档:同一 `SOURCE_SHA` + 同一 Bundle 连续两次 package,sha256 完全一致(`fd7a313e...`)。
|
||||
- `smoke.py` PASS。
|
||||
- Ubuntu 24.04 / glibc 2.39、`--network none`、非 root、无 Cargo 冷安装 PASS(缺 Bundle fail-closed;语言-only 可运行)。
|
||||
- 归档 CLI + 归档 Bundle:三个迁出扩展 http/regex/archive PASS;冻结外部 conformance 七类 PASS。
|
||||
- 发布资产下载校验:下载归档 sha256 = `fd7a313e...`。
|
||||
- 根同候选:`check-layout --checkouts`、根集成测试与生态 candidate CI(含既有消费者)以 `cli/c44b0f9` 为输入;结果以根 PR CI 为准。
|
||||
|
||||
## 已记录的未验证限制(不冒充 PASS)
|
||||
|
||||
- Strict L1 独立 VM/非 root:本发布环境无 disposable VM/命名空间,**UNVERIFIED**;release notes 明示无 PASS。
|
||||
- G4 性能:paired shared-node 比较 9/9 工作负载、最大 p50 +5.15%、最大 RSS +4.87%,低于阈值,但**不是获批节点 PASS**;release notes 记录为 shared-node WARN 限制。
|
||||
- 维护者已明确批准本次 rc.5 发布并接受上述两项记录限制。
|
||||
|
||||
## 回滚
|
||||
|
||||
若不接受 rc.5,恢复根 `cli` gitlink 到 `452e9a3`(rc.4 发布源码)并重跑候选;已发布 tag/资产不可变,不回写。
|
||||
@@ -0,0 +1,46 @@
|
||||
# 仓库开发规范内化与防膨胀门禁(2026-11-27)
|
||||
|
||||
来源:[marqdo#10](https://git.cflmy.cn/cflmy/marqdo/issues/10)(生态独立 CI/CD、制品发布与跨仓库传播实施规范)中的职责模型、独立 CI 合同、制品/发布事务、晋升与对账要求,经与现有 ARCHITECTURE/DEVELOPMENT/REPOSITORY-TASKS/MIGRATION 对齐后整理为仓库级规范。
|
||||
|
||||
## 落地内容
|
||||
|
||||
| 类型 | 文件/工具 |
|
||||
| --- | --- |
|
||||
| 根规范 | `docs/REPOSITORY-CONVENTIONS.md`:仓库准入、两层治理、职责矩阵、最低文件集、AGENTS 规范、独立 CI/CD、四种事实与 C2→B2→A2 晋升、单一事实源、防膨胀硬禁止清单、审核清单、例外记录 |
|
||||
| 根约束 | `AGENTS.md` 增加“生态仓库开发规范(防膨胀,强制)”章节与规范链接 |
|
||||
| 模板 | `docs/templates/AGENTS.component.md`(含 `<!-- marqdo:repo-conventions v1 -->` 标记) |
|
||||
| 门禁 | `scripts/check-repo-conventions.py`:校验 active 仓 README/AGENTS 标记与链接/真实 entry、planned 不登记 entry、根 catalog 不重复登记领域后代、叶子仓无第二 catalog/.gitmodules、根 .gitmodules 权威远端 |
|
||||
| 测试 | `tests/integration/test_repo_conventions.py`(6 个正反例),并纳入根 `.woodpecker/eco.yml` layout 阶段 |
|
||||
| 子仓规范 | 每个 active 仓与已迁入实现的 extension 仓新增/更新 `AGENTS.md`,只写本仓边界并链接根规范 |
|
||||
|
||||
## 已传播的仓库(各自 PR 合并且按 fast-forward 合并)
|
||||
|
||||
| 仓库 | 规范提交 |
|
||||
| --- | --- |
|
||||
| marqdo-cli(根 gitlink,docs-only) | `13affa76dd8aa15d54ac89d580d5e60bff692384` |
|
||||
| marqdo-extension-conformance | `665c12e9b1c116121cbed82c9014db208587dd58` |
|
||||
| marqdo-view | `48e530935880989d95b54f81af0944a031543d65` |
|
||||
| marqdo-knowledge | `6e881000898b0130a4d783c285d8e2967f8d7a0b` |
|
||||
| marqdo-prove | `e9fce68551726a992167669d76c0bc1f9f0e4d14` |
|
||||
| marqdo-lint | `aa0bdac7de9ed5aaa96c660657770a6f6dd90ed2` |
|
||||
| marqdo-std-collections | `f18eec7ada16c5a28dd4f58daa5b1b7d2089b65d` |
|
||||
| marqdo-std-text | `5b5d3b67c3c114a305a08e3a90c0d3ae008f7c34` |
|
||||
| marqdo-std-data | `6f79b1345da0444418f5e9cd5a226d3df2a2e2bb` |
|
||||
| marqdo-std-io | `02d1ad172c077674b6a0c3d0bd7a61092b278b10` |
|
||||
| marqdo-std-fs | `104741bca034f8ae537389fef7c75c10eaed5b8c` |
|
||||
| marqdo-std-system | `1561a6b7b6a2eb1f249976aaf6e05941d2db5296` |
|
||||
| marqdo-ext-http | `6efcbc8c8cf90d4d5da36e923c0df0ac24a416a6` |
|
||||
| marqdo-ext-regex | `23f9417809fae669bf8e690d56637be8f86fd27a` |
|
||||
| marqdo-ext-archive | `86dcca0881c52e87cb3671e8cdace64a46f60c85` |
|
||||
| marqdo-ext-web(领域,含 Design/Preview 子 gitlink 更新) | `70ba4a27e592edab74348e599b6d3882dcdfcbaf` |
|
||||
| marqdo-web-design | `cbef7b622a96cd7057bd03cb206fe67089843dc4` |
|
||||
| marqdo-web-preview | `86a260c64634eee263e19e7620f56dd2a86330f8` |
|
||||
|
||||
- Design/Preview 的 stale `planned` 声明同步修正为 active,Web 领域 README/AGENTS 的组件状态表同步修正;`web-components` 仍 planned。
|
||||
- 根候选把上述子仓提交固定进 gitlink;本地 `check-repo-conventions.py` PASS(37 components)、`check-layout.py --checkouts` PASS、完整集成测试 **85 tests OK**;根 CI candidate 为最终门禁。
|
||||
|
||||
## 明确未做/后续
|
||||
|
||||
- 本 PR 只落“仓库组织/开发规范与门禁”,不实现 #10 的 CI/CD 工作流、发布索引、通知/reconcile 工作流、Woodpecker manual/cron;这些仍按 #10 逐项实施并需平台 M0 实测。
|
||||
- planned 仓库(core/encoding/net、其余扩展、web-components)不批量生成 AGENTS/CI 模板;按规范在激活时补齐。
|
||||
- 规范例外仍须在 Issue/ADR 记录原因、责任者、复查日期与退出条件。
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
<!-- marqdo:repo-conventions v1 -->
|
||||
# AGENTS.md — <repo>
|
||||
|
||||
本文件约束在本仓库工作的维护者与 AI Agent。全局规则唯一来源:
|
||||
[marqdo 仓库开发规范](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/REPOSITORY-CONVENTIONS.md)。
|
||||
本文件只写本仓边界,不复制全局规范或合同正文。
|
||||
|
||||
## 1. 本仓定位与唯一权威
|
||||
|
||||
- catalog ID:`<id>`;父级:`<root|domain>`;角色:`<core|stdlib|extension|tool|test|domain>`;状态:`<planned|active>`。
|
||||
- 职责:<scope>。
|
||||
- 本仓拥有:<唯一实现/合同/制品/测试>。
|
||||
- 本仓不拥有:<其它仓的实现/合同/调度/发布>。
|
||||
- 权威输入/合同:<e.g. 真实 CLI 公开 Analysis 3、MARQDO_BIN 绝对路径、WEB-DESIGN 合同、外部 Bundle>。
|
||||
|
||||
## 2. 必做 / 禁止
|
||||
|
||||
| 必做 | 禁止 |
|
||||
| --- | --- |
|
||||
| 只在本仓职责内修改,先开本仓工单 | 实现其它仓库功能、复制 parser/实现/合同 |
|
||||
| 用真实 CLI/制品与独立期望测试 | mock 或字符串检查冒充真实验收/PASS |
|
||||
| 依赖用固定 SHA/摘要,显式输入 | 依赖父仓 checkout、兄弟仓相对路径、浮动分支 |
|
||||
| 未运行写 `UNVERIFIED` | 伪造 entry/版本/CI 徽章/gitlink/发布资产 |
|
||||
| 记录 SHA、制品摘要、平台、命令、退出码 | 提交密钥、凭证、构建产物或本地绝对路径 |
|
||||
| 跨仓变更走 C2→B2→A2 晋升 | 自动 tag/release/合并,或直接改父仓/兄弟仓 |
|
||||
|
||||
- 不新增第二 catalog/manifest/lock/version 表/发布流程;不建空壳仓或为单功能拆仓。
|
||||
- 不在本仓登记其它仓库的后代路径;治理树最多两级。
|
||||
|
||||
## 3. 构建、测试与证据
|
||||
|
||||
- CI 入口:`<entry>`(非交互、失败非零、不打印秘密、只写声明输出;构建与发布权限分离)。
|
||||
- 输入:<MARQDO_BIN / MARQDO_STDLIB_DIR / lock/manifest;绝对路径并验证身份>。
|
||||
- 测试:真实正例 + 错误/授权/边界负例;本地可复现;默认禁网。
|
||||
- 证据:候选 SHA、依赖/制品 SHA-256、平台/工具链、命令与退出码、日志位置、测试范围;FAIL/UNVERIFIED 不得写成 PASS。
|
||||
- 交付:<source archive | tool bundle | domain evidence | none>;发布仅在受保护 tag/批准工作流后,不自动发布。
|
||||
|
||||
## 4. 变更与工单路由
|
||||
|
||||
- 本仓缺陷在本仓开工单;上游公共合同/协议缺陷路由到 `<repo>`;作者面/领域语义在领域仓 ADR。
|
||||
- 新仓库、新公共合同、新目录层级或破坏性语义:先在根/领域开 Issue/ADR,记录责任、消费者、退出条件。
|
||||
- 跨仓组合:组件 PR+CI → 领域 PR/验收 → 根 PR/递归与冷安装证据;父级只更新固定 gitlink 与证据。
|
||||
+1
-1
Submodule extensions/archive updated: aba6b60934...86dcca0881.
+1
-1
Submodule extensions/http updated: 368b33d241...6efcbc8c8c.
+1
-1
Submodule extensions/regex updated: 6e7e633798...23f9417809.
+1
-1
Submodule extensions/web updated: f6d0a9067c...70ba4a27e5.
Executable
+209
@@ -0,0 +1,209 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Check ecosystem repository development conventions.
|
||||
|
||||
This is a repository-hygiene gate, not a new catalog: it reads the existing
|
||||
root (and domain) components.toml, .gitmodules and gitlinks. It enforces the
|
||||
rules in docs/REPOSITORY-CONVENTIONS.md for active repositories, the AGENTS.md
|
||||
marker/links, real entry files, no duplicated descendant paths in the root
|
||||
catalog, no nested submodules in leaf components and no second catalog.
|
||||
|
||||
Exit code 0 = PASS, 1 = violations, 2 = usage/environment failure.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
MARKER = "<!-- marqdo:repo-conventions v1 -->"
|
||||
CONVENTIONS_URL = (
|
||||
"https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/REPOSITORY-CONVENTIONS.md"
|
||||
)
|
||||
ROOT_AGENTS_LINK = "docs/REPOSITORY-CONVENTIONS.md"
|
||||
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def read_toml(path: Path) -> dict:
|
||||
try:
|
||||
with path.open("rb") as handle:
|
||||
return tomllib.load(handle)
|
||||
except FileNotFoundError as error:
|
||||
raise Error(f"missing catalog: {path.relative_to(PROJECT_ROOT)}") from error
|
||||
except tomllib.TOMLDecodeError as error:
|
||||
raise Error(f"invalid TOML {path.relative_to(PROJECT_ROOT)}: {error}") from error
|
||||
|
||||
|
||||
def components(root: Path) -> list[dict]:
|
||||
return read_toml(root / "components.toml").get("component", [])
|
||||
|
||||
|
||||
def submodule_urls(root: Path) -> dict[str, str]:
|
||||
path = root / ".gitmodules"
|
||||
if not path.is_file():
|
||||
return {}
|
||||
result: dict[str, str] = {}
|
||||
current_path = None
|
||||
for raw in path.read_text().splitlines():
|
||||
line = raw.strip()
|
||||
if line.startswith("[submodule "):
|
||||
current_path = None
|
||||
continue
|
||||
if line.startswith("path ="):
|
||||
current_path = line.split("=", 1)[1].strip()
|
||||
elif line.startswith("url =") and current_path:
|
||||
result[current_path] = line.split("=", 1)[1].strip()
|
||||
return result
|
||||
|
||||
|
||||
def check_active(root: Path, component: dict, errors: list[str]) -> None:
|
||||
identifier = component.get("id", "?")
|
||||
rel = component.get("path", "")
|
||||
checkout = root / rel
|
||||
if not rel:
|
||||
errors.append(f"{identifier}: active component has no path")
|
||||
return
|
||||
if not checkout.is_dir():
|
||||
errors.append(f"{identifier}: checkout path missing: {rel}")
|
||||
return
|
||||
readme = checkout / "README.md"
|
||||
if not readme.is_file() or readme.stat().st_size < 100:
|
||||
errors.append(f"{identifier}: README.md missing or too small")
|
||||
agents = checkout / "AGENTS.md"
|
||||
if not agents.is_file():
|
||||
errors.append(f"{identifier}: AGENTS.md missing")
|
||||
else:
|
||||
text = agents.read_text()
|
||||
if MARKER not in text:
|
||||
errors.append(f"{identifier}: AGENTS.md lacks `{MARKER}`")
|
||||
if CONVENTIONS_URL not in text:
|
||||
errors.append(f"{identifier}: AGENTS.md does not link the root conventions")
|
||||
if len(text) < 300:
|
||||
errors.append(f"{identifier}: AGENTS.md is too small to state boundaries")
|
||||
entry = component.get("entry", "")
|
||||
if not entry:
|
||||
errors.append(f"{identifier}: active component has no entry")
|
||||
elif not (checkout / entry).is_file():
|
||||
errors.append(f"{identifier}: entry file missing: {rel}/{entry}")
|
||||
for forbidden in ("components.toml", ".gitmodules"):
|
||||
if (checkout / forbidden).is_file() and component.get("kind") != "domain":
|
||||
errors.append(f"{identifier}: leaf component must not own {forbidden}")
|
||||
|
||||
|
||||
def check_planned(component: dict, errors: list[str]) -> None:
|
||||
identifier = component.get("id", "?")
|
||||
if component.get("entry"):
|
||||
errors.append(f"{identifier}: planned component must not declare entry")
|
||||
|
||||
|
||||
def flatten(root: Path) -> tuple[list[dict], dict[str, dict]]:
|
||||
root_components = components(root)
|
||||
by_id: dict[str, dict] = {}
|
||||
for component in root_components:
|
||||
identifier = component.get("id")
|
||||
if identifier in by_id:
|
||||
raise Error(f"duplicate global component id: {identifier}")
|
||||
by_id[identifier] = component
|
||||
children: dict[str, dict] = {}
|
||||
for component in root_components:
|
||||
if component.get("kind") != "domain":
|
||||
continue
|
||||
domain = root / component.get("path", "")
|
||||
catalog = domain / "components.toml"
|
||||
if not catalog.is_file():
|
||||
raise Error(f"domain {component.get('id')} has no components.toml")
|
||||
for child in read_toml(catalog).get("component", []):
|
||||
child = dict(child)
|
||||
child["domain_path"] = component["path"]
|
||||
identifier = child.get("id")
|
||||
if identifier in by_id:
|
||||
raise Error(f"duplicate global component id: {identifier}")
|
||||
by_id[identifier] = child
|
||||
child["path"] = f"{component['path']}/{child.get('path', '')}"
|
||||
children[identifier] = child
|
||||
return root_components + list(children.values()), by_id
|
||||
|
||||
|
||||
def check(root: Path) -> list[str]:
|
||||
errors: list[str] = []
|
||||
flat, by_id = flatten(root)
|
||||
root_components = components(root)
|
||||
root_paths = {component.get("path") for component in root_components}
|
||||
domain_paths = [
|
||||
component["path"]
|
||||
for component in root_components
|
||||
if component.get("kind") == "domain" and component.get("path")
|
||||
]
|
||||
for component in root_components:
|
||||
path = component.get("path", "")
|
||||
for domain_path in domain_paths:
|
||||
if path.startswith(f"{domain_path}/"):
|
||||
errors.append(
|
||||
f"{component.get('id')}: descendant of {domain_path} is also registered in the root catalog"
|
||||
)
|
||||
for component in flat:
|
||||
if component.get("state") == "active":
|
||||
check_active(root, component, errors)
|
||||
elif component.get("state") == "planned":
|
||||
check_planned(component, errors)
|
||||
else:
|
||||
errors.append(f"{component.get('id')}: unknown state {component.get('state')!r}")
|
||||
root_agents = root / "AGENTS.md"
|
||||
if not root_agents.is_file():
|
||||
errors.append("root AGENTS.md missing")
|
||||
else:
|
||||
text = root_agents.read_text()
|
||||
if ROOT_AGENTS_LINK not in text:
|
||||
errors.append(f"root AGENTS.md does not link {ROOT_AGENTS_LINK}")
|
||||
if "防膨胀" not in text and "REPOSITORY-CONVENTIONS" not in text:
|
||||
errors.append("root AGENTS.md does not state the repository conventions")
|
||||
urls = submodule_urls(root)
|
||||
for component in root_components:
|
||||
path = component.get("path", "")
|
||||
if path not in urls:
|
||||
errors.append(f"{component.get('id')}: path {path!r} is not in root .gitmodules")
|
||||
else:
|
||||
url = urls[path]
|
||||
if not url.startswith("https://git.cflmy.cn/cflmy/") or not url.endswith(".git"):
|
||||
errors.append(f"{component.get('id')}: non-canonical submodule URL {url!r}")
|
||||
for component in root_components:
|
||||
if component.get("kind") == "domain":
|
||||
continue
|
||||
rel = component.get("path", "")
|
||||
checkout = root / rel
|
||||
if (checkout / "components.toml").is_file():
|
||||
errors.append(f"{component.get('id')}: leaf component owns a second catalog")
|
||||
return errors
|
||||
|
||||
|
||||
def main(argv: list[str]) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--root", default=str(PROJECT_ROOT), help="checkout root to inspect")
|
||||
parser.add_argument("--report", action="store_true", help="print the checked component set")
|
||||
args = parser.parse_args(argv)
|
||||
root = Path(args.root).resolve()
|
||||
try:
|
||||
errors = check(root)
|
||||
flat, _ = flatten(root)
|
||||
except Error as error:
|
||||
print(f"repo-conventions: error: {error}", file=sys.stderr)
|
||||
return 2
|
||||
if args.report:
|
||||
for component in flat:
|
||||
print(component.get("id"), component.get("path"), component.get("state"))
|
||||
if errors:
|
||||
for error in errors:
|
||||
print(f"repo-conventions: FAIL: {error}", file=sys.stderr)
|
||||
return 1
|
||||
print(f"repo-conventions: PASS ({len(flat)} components)")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main(sys.argv[1:]))
|
||||
+1
-1
Submodule stdlib/collections updated: 4907652268...f18eec7ada.
+1
-1
Submodule stdlib/data updated: 848af7a357...6f79b1345d.
+1
-1
Submodule stdlib/fs updated: 63bceae587...104741bca0.
+1
-1
Submodule stdlib/io updated: e18b0b1b40...02d1ad172c.
+1
-1
Submodule stdlib/system updated: 053ddb0e59...1561a6b7b6.
+1
-1
Submodule stdlib/text updated: c2a7d327e5...5b5d3b67c3.
+1
-1
Submodule tests/conformance updated: 015ff8ac15...665c12e9b1.
@@ -0,0 +1,183 @@
|
||||
"""Repository development conventions gate tests (docs/REPOSITORY-CONVENTIONS.md)."""
|
||||
|
||||
import importlib.util
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
SPEC = importlib.util.spec_from_file_location(
|
||||
"repo_conventions", ROOT / "scripts" / "check-repo-conventions.py"
|
||||
)
|
||||
conventions = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(conventions)
|
||||
|
||||
MARKER = conventions.MARKER
|
||||
URL = conventions.CONVENTIONS_URL
|
||||
|
||||
|
||||
def write(path: Path, text: str) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(text)
|
||||
|
||||
|
||||
def agents(role: str) -> str:
|
||||
return f"""{MARKER}
|
||||
# AGENTS.md — {role}
|
||||
|
||||
全局规范唯一来源:{URL}
|
||||
本文件只写本仓边界,不复制全局规范或合同正文。
|
||||
|
||||
## 本仓定位
|
||||
|
||||
catalog 角色 `{role}`;只在本仓职责范围内修改,先开本仓工单。
|
||||
本仓拥有自己的实现、测试与制品;不拥有其它仓的实现、合同或调度。
|
||||
|
||||
## 必做 / 禁止
|
||||
|
||||
- 必做:真实 CLI/制品验证、固定 SHA/摘要、证据记录、未运行写 UNVERIFIED。
|
||||
- 禁止:复制 parser/实现/合同;依赖父仓或兄弟仓 checkout;第二 catalog/manifest;伪造 PASS;提交密钥。
|
||||
- 禁止:自动 tag/release/合并;跨仓变更必须走 C2 → B2 → A2 晋升。
|
||||
|
||||
## 构建与证据
|
||||
|
||||
CI 入口非交互、失败非零、不打印秘密;证据含 SHA、制品摘要、平台、命令、退出码、日志。
|
||||
"""
|
||||
|
||||
|
||||
class RepoConventionsTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
self.root = Path(self.tmp.name)
|
||||
write(self.root / "AGENTS.md", f"# 根\n\n防膨胀规则见 docs/REPOSITORY-CONVENTIONS.md\n")
|
||||
write(self.root / "docs/REPOSITORY-CONVENTIONS.md", "规则")
|
||||
write(self.root / ".gitmodules", "")
|
||||
write(
|
||||
self.root / "components.toml",
|
||||
"""[[component]]
|
||||
id = "cli"
|
||||
path = "cli"
|
||||
kind = "core"
|
||||
state = "active"
|
||||
owner = "t"
|
||||
scope = "s"
|
||||
requires = []
|
||||
checks_with = []
|
||||
release = "base"
|
||||
entry = "scripts/ci.sh"
|
||||
""",
|
||||
)
|
||||
write(self.root / "cli/README.md", "x" * 200)
|
||||
write(self.root / "cli/AGENTS.md", agents("cli"))
|
||||
write(self.root / "cli/scripts/ci.sh", "#!/bin/sh\n")
|
||||
write(
|
||||
self.root / ".gitmodules",
|
||||
'[submodule "cli"]\n\tpath = cli\n\turl = https://git.cflmy.cn/cflmy/marqdo-cli.git\n',
|
||||
)
|
||||
|
||||
def tearDown(self):
|
||||
self.tmp.cleanup()
|
||||
|
||||
def test_active_repository_with_required_files_passes(self):
|
||||
self.assertEqual(conventions.check(self.root), [])
|
||||
|
||||
def test_missing_agents_or_marker_fails(self):
|
||||
(self.root / "cli/AGENTS.md").unlink()
|
||||
self.assertTrue(any("AGENTS.md missing" in item for item in conventions.check(self.root)))
|
||||
write(self.root / "cli/AGENTS.md", agents("cli").replace(MARKER, ""))
|
||||
self.assertTrue(
|
||||
any("lacks `<!-- marqdo:repo-conventions v1 -->`" in item for item in conventions.check(self.root))
|
||||
)
|
||||
|
||||
def test_active_entry_and_readme_are_required(self):
|
||||
(self.root / "cli/README.md").unlink()
|
||||
(self.root / "cli/scripts/ci.sh").unlink()
|
||||
errors = conventions.check(self.root)
|
||||
self.assertTrue(any("README.md missing" in item for item in errors))
|
||||
self.assertTrue(any("entry file missing" in item for item in errors))
|
||||
|
||||
def test_planned_component_must_not_declare_entry(self):
|
||||
text = (self.root / "components.toml").read_text().replace(
|
||||
'state = "active"', 'state = "planned"'
|
||||
)
|
||||
text = text.replace('entry = "scripts/ci.sh"', 'entry = "scripts/ci.sh"')
|
||||
write(self.root / "components.toml", text)
|
||||
self.assertTrue(
|
||||
any("planned component must not declare entry" in item for item in conventions.check(self.root))
|
||||
)
|
||||
|
||||
def test_leaf_repository_must_not_own_second_catalog_or_submodules(self):
|
||||
write(self.root / "cli/components.toml", "[[component]]\n")
|
||||
write(self.root / "cli/.gitmodules", "")
|
||||
errors = conventions.check(self.root)
|
||||
self.assertTrue(any("leaf component must not own components.toml" in item for item in errors))
|
||||
self.assertTrue(any("leaf component must not own .gitmodules" in item for item in errors))
|
||||
|
||||
def test_domain_child_must_not_be_registered_in_root_catalog(self):
|
||||
write(
|
||||
self.root / "components.toml",
|
||||
(self.root / "components.toml").read_text()
|
||||
+ """
|
||||
[[component]]
|
||||
id = "web"
|
||||
path = "extensions/web"
|
||||
kind = "domain"
|
||||
state = "active"
|
||||
owner = "t"
|
||||
scope = "d"
|
||||
requires = []
|
||||
checks_with = []
|
||||
release = "none"
|
||||
entry = "scripts/domain.sh"
|
||||
""",
|
||||
)
|
||||
write(self.root / "extensions/web/README.md", "x" * 200)
|
||||
write(self.root / "extensions/web/AGENTS.md", agents("web"))
|
||||
write(self.root / "extensions/web/scripts/domain.sh", "#!/bin/sh\n")
|
||||
write(
|
||||
self.root / "extensions/web/components.toml",
|
||||
"""[[component]]
|
||||
id = "web-design"
|
||||
path = "design"
|
||||
kind = "extension"
|
||||
state = "active"
|
||||
owner = "t"
|
||||
scope = "d"
|
||||
requires = ["cli"]
|
||||
checks_with = []
|
||||
release = "optional"
|
||||
entry = "scripts/ci.sh"
|
||||
""",
|
||||
)
|
||||
write(self.root / "extensions/web/design/README.md", "x" * 200)
|
||||
write(self.root / "extensions/web/design/AGENTS.md", agents("web-design"))
|
||||
write(self.root / "extensions/web/design/scripts/ci.sh", "#!/bin/sh\n")
|
||||
write(
|
||||
self.root / ".gitmodules",
|
||||
(self.root / ".gitmodules").read_text()
|
||||
+ '[submodule "web"]\n\tpath = extensions/web\n\turl = https://git.cflmy.cn/cflmy/marqdo-ext-web.git\n',
|
||||
)
|
||||
self.assertEqual(conventions.check(self.root), [])
|
||||
write(
|
||||
self.root / "components.toml",
|
||||
(self.root / "components.toml").read_text()
|
||||
+ """
|
||||
[[component]]
|
||||
id = "web-design-dup"
|
||||
path = "extensions/web/design"
|
||||
kind = "extension"
|
||||
state = "planned"
|
||||
owner = "t"
|
||||
scope = "d"
|
||||
requires = ["cli"]
|
||||
checks_with = []
|
||||
release = "optional"
|
||||
""",
|
||||
)
|
||||
self.assertTrue(
|
||||
any("also registered in the root catalog" in item for item in conventions.check(self.root))
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+1
-1
Submodule tools/knowledge updated: d8fa201b28...6e88100089.
+1
-1
Submodule tools/lint updated: 111e085f24...aa0bdac7de.
+1
-1
Submodule tools/prove updated: d8c340b6e2...e9fce68551.
+1
-1
Submodule tools/view updated: 04f3a0e9e5...48e5309358.
Reference in new issue
Block a user