diff --git a/.gitmodules b/.gitmodules index 9493c80..92ae6ec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,87 @@ [submodule "tools/lint"] path = tools/lint url = https://git.cflmy.cn/cflmy/marqdo-lint.git +[submodule "extensions/ai"] + path = extensions/ai + url = https://git.cflmy.cn/cflmy/marqdo-ext-ai.git +[submodule "extensions/archive"] + path = extensions/archive + url = https://git.cflmy.cn/cflmy/marqdo-ext-archive.git +[submodule "extensions/browser"] + path = extensions/browser + url = https://git.cflmy.cn/cflmy/marqdo-ext-browser.git +[submodule "extensions/cache"] + path = extensions/cache + url = https://git.cflmy.cn/cflmy/marqdo-ext-cache.git +[submodule "extensions/crypto"] + path = extensions/crypto + url = https://git.cflmy.cn/cflmy/marqdo-ext-crypto.git +[submodule "extensions/database"] + path = extensions/database + url = https://git.cflmy.cn/cflmy/marqdo-ext-database.git +[submodule "extensions/datetime"] + path = extensions/datetime + url = https://git.cflmy.cn/cflmy/marqdo-ext-datetime.git +[submodule "extensions/document"] + path = extensions/document + url = https://git.cflmy.cn/cflmy/marqdo-ext-document.git +[submodule "extensions/engineering"] + path = extensions/engineering + url = https://git.cflmy.cn/cflmy/marqdo-ext-engineering.git +[submodule "extensions/http"] + path = extensions/http + url = https://git.cflmy.cn/cflmy/marqdo-ext-http.git +[submodule "extensions/linalg"] + path = extensions/linalg + url = https://git.cflmy.cn/cflmy/marqdo-ext-linalg.git +[submodule "extensions/math"] + path = extensions/math + url = https://git.cflmy.cn/cflmy/marqdo-ext-math.git +[submodule "extensions/mcp"] + path = extensions/mcp + url = https://git.cflmy.cn/cflmy/marqdo-ext-mcp.git +[submodule "extensions/quantum"] + path = extensions/quantum + url = https://git.cflmy.cn/cflmy/marqdo-ext-quantum.git +[submodule "extensions/regex"] + path = extensions/regex + url = https://git.cflmy.cn/cflmy/marqdo-ext-regex.git +[submodule "extensions/security"] + path = extensions/security + url = https://git.cflmy.cn/cflmy/marqdo-ext-security.git +[submodule "extensions/storage"] + path = extensions/storage + url = https://git.cflmy.cn/cflmy/marqdo-ext-storage.git +[submodule "extensions/web"] + path = extensions/web + url = https://git.cflmy.cn/cflmy/marqdo-ext-web.git +[submodule "extensions/websocket"] + path = extensions/websocket + url = https://git.cflmy.cn/cflmy/marqdo-ext-websocket.git +[submodule "stdlib/collections"] + path = stdlib/collections + url = https://git.cflmy.cn/cflmy/marqdo-std-collections.git +[submodule "stdlib/core"] + path = stdlib/core + url = https://git.cflmy.cn/cflmy/marqdo-std-core.git +[submodule "stdlib/data"] + path = stdlib/data + url = https://git.cflmy.cn/cflmy/marqdo-std-data.git +[submodule "stdlib/encoding"] + path = stdlib/encoding + url = https://git.cflmy.cn/cflmy/marqdo-std-encoding.git +[submodule "stdlib/fs"] + path = stdlib/fs + url = https://git.cflmy.cn/cflmy/marqdo-std-fs.git +[submodule "stdlib/io"] + path = stdlib/io + url = https://git.cflmy.cn/cflmy/marqdo-std-io.git +[submodule "stdlib/net"] + path = stdlib/net + url = https://git.cflmy.cn/cflmy/marqdo-std-net.git +[submodule "stdlib/system"] + path = stdlib/system + url = https://git.cflmy.cn/cflmy/marqdo-std-system.git +[submodule "stdlib/text"] + path = stdlib/text + url = https://git.cflmy.cn/cflmy/marqdo-std-text.git diff --git a/.woodpecker/eco.yml b/.woodpecker/eco.yml index 2401989..811c1e0 100644 --- a/.woodpecker/eco.yml +++ b/.woodpecker/eco.yml @@ -9,6 +9,12 @@ steps: - python3 scripts/check-layout.py - python3 -m unittest discover -s tests/integration - git submodule update --init + - | + set -eu + domains="$(python3 scripts/check-layout.py --domain-paths)" + for domain in $domains; do + git -C "$domain" submodule update --init + done - python3 scripts/check-layout.py --checkouts candidate: @@ -16,9 +22,18 @@ steps: image: mcr.microsoft.com/playwright:v1.49.0-noble depends_on: [layout] commands: - - apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git python3 python3-jsonschema build-essential - | set -eu + for attempt in 1 2 3; do + if apt-get -o Acquire::By-Hash=force -o Acquire::Retries=3 update --error-on=any; then + break + fi + if [ "$attempt" -eq 3 ]; then + exit 1 + fi + sleep 15 + done + apt-get -o Acquire::Retries=3 install -y --no-install-recommends ca-certificates curl git python3 python3-jsonschema build-essential curl -fsSL --retry 3 https://sh.rustup.rs -o /tmp/marqdo-rustup.sh sh /tmp/marqdo-rustup.sh -y --profile minimal --default-toolchain 1.100.0 --no-modify-path export PATH="$HOME/.cargo/bin:$PATH" diff --git a/AGENTS.md b/AGENTS.md index 9d70c7c..215ce11 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,7 +1,7 @@ # Marqdo 维护指引 1. 从 [各仓库任务](docs/REPOSITORY-TASKS.md)、[组件目录](components.toml) 与 [架构边界](docs/ARCHITECTURE.md) 确定**唯一**责任仓库:功能缺陷在功能仓库,领域合同/组合在领域聚合仓库,gitlink、跨领域集成、发行组合与治理在主仓库。主仓库和聚合仓库不实现子组件业务。 -2. 治理树最多两级:根 → 领域聚合(`kind = "domain"`)→ 功能组件。每个组件只有一个父级;全局 ID 与权威远端唯一;领域聚合仓库只做治理、合同、示例和组合验收。`planned` 组件不创建占位 gitlink、不伪造 `entry`;空仓状态只登记在迁移台账,激活前不得计入完成率。 +2. 治理树最多两级:根 → 领域聚合(`kind = "domain"`)→ 功能组件。每个组件只有一个父级,全局 ID 与权威远端唯一,领域聚合仓库只做治理、合同、示例和组合验收。已发布的 `planned` 仓库可以挂载真实 gitlink。激活时登记实际 `entry`,只有通过验收的 active 组件计入完成率。 3. 找到或建立责任仓库的工单,按 `.gitea/ISSUE_TEMPLATE/change.md` 记录目标、当前提交、最小复现、公共契约、影响消费者和验收命令。跨仓库阻塞在上游开关联工单,并在消费者记录回归条件。不要按错误最终显示的仓库定责,找第一个违反公开合同的所有者。 4. 在责任仓库独立修改、构建和测试。需要调整公共语义时,在 CLI 提交 ADR;调整 Web 作者面语义时,只在 `marqdo-ext-web` 的 [WEB-DESIGN 合同](https://git.cflmy.cn/cflmy/marqdo-ext-web/src/branch/main/docs/WEB-DESIGN.md) 走 ADR,并与实际消费者(Design/Preview)同候选验证;不得并列维护第二份现行规范或旧协议 fallback。 5. 逐层晋升:功能提交 C2 通过组件 CI → 领域 PR 更新 gitlink 至 C2 并通过领域 CI(B2)→ 主仓库 PR 更新领域 gitlink 至 B2 并通过根递归校验与受影响组合验收(A2)。先推送子仓库提交,再在主仓库提交精确 gitlink;区分组件 CI、公共契约 CI 和生态 CI 证据。以 [开发流程](docs/DEVELOPMENT.md) 为准。 diff --git a/README.md b/README.md index b9e6f0e..bcb8219 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ marqdo run hello.mq.md ### 标准库 -标准库组件负责低层通用能力,验收后共同组成基础发行的标准库 Bundle。 这些组件标为 `planned`,开发在对应独立仓库进行。 [标准库目录](stdlib/README.md) +标准库组件负责低层通用能力,验收后共同组成基础发行的标准库 Bundle。`stdlib/` 的子模块固定各独立仓库的开发提交,状态为 `planned`。 [标准库目录](stdlib/README.md) | 仓库 | 职责 | | --- | --- | @@ -81,7 +81,7 @@ marqdo run hello.mq.md ### 领域扩展 -领域扩展负责按需安装的算法、协议和业务能力。 这些组件标为 `planned`,开发在对应独立仓库进行。 [领域扩展目录](extensions/README.md) +领域扩展负责按需安装的算法、协议和业务能力。`extensions/` 的子模块链接各独立仓库,功能从 `planned` 状态开始开发。 [领域扩展目录](extensions/README.md) | 仓库 | 职责 | | --- | --- | @@ -106,7 +106,7 @@ marqdo run hello.mq.md ### Web 领域聚合 -Web 领域以设计文档为源材料,提供可交互的原型预览与工程交付;它不复刻前端框架,HTTP、数据库、认证和浏览器运行时仍是独立可选能力。领域当前为 `planned`,在主仓库登记为 planned domain,尚未以 gitlink 接入;子组件在领域仓库的 `components.toml` 登记,不重复登记到本仓库。唯一作者合同见 [WEB-DESIGN](https://git.cflmy.cn/cflmy/marqdo-ext-web/src/branch/main/docs/WEB-DESIGN.md)。 +Web 领域以设计文档为源材料,面向可交互的原型预览与工程交付。HTTP、数据库、认证和浏览器运行时各自独立维护。`extensions/web` 链接 `planned` 的 Web 领域仓,Design 和 Preview 由该领域仓固定。 [WEB-DESIGN](https://git.cflmy.cn/cflmy/marqdo-ext-web/src/branch/main/docs/WEB-DESIGN.md) | 仓库 | 职责 | | --- | --- | @@ -116,7 +116,7 @@ Web 领域以设计文档为源材料,提供可交互的原型预览与工程 ## 参与开发 -在负责的独立仓库提交实现和测试。主仓库用 Git 子模块按“根 → 领域 → 功能”最多两级固定已通过联合验收的组合。需要验证当前组合时,克隆主仓库后运行: +在负责的独立仓库提交实现和测试。主仓库用 Git 子模块按“根 → 领域 → 功能”最多两级固定提交,组件的发行状态由 catalog 独立记录。需要获取当前组合时,运行: ```sh git clone https://git.cflmy.cn/cflmy/marqdo.git @@ -126,7 +126,7 @@ python3 scripts/check-layout.py --checkouts python3 -m unittest discover -s tests/integration ``` -`check-layout.py` 校验每层 catalog 与 gitlink、权威远端、全局 ID 与依赖图;`--checkouts` 要求子模块已初始化,缺失或不一致会明确失败。`planned` 组件与空仓不计入完成率,也不创建占位 gitlink。 +`check-layout.py` 校验每层 catalog、gitlink、权威远端、全局 ID 和依赖图。`--checkouts` 同时核对递归检出的实际提交。`planned` 子模块提供固定开发快照,只有 `active` 组件进入发行验收。 [各仓库任务](docs/REPOSITORY-TASKS.md) · [组件目录](components.toml) · [架构边界](docs/ARCHITECTURE.md) · [开发流程](docs/DEVELOPMENT.md) · [迁移台账](docs/MIGRATION.md) · [架构决策记录](docs/adr/README.md) · [AGENTS](AGENTS.md) diff --git a/components.toml b/components.toml index af08068..5a85fb2 100644 --- a/components.toml +++ b/components.toml @@ -3,7 +3,8 @@ # 递归展平后全局 ID 与权威远端唯一;禁止在根同时登记某个计划中聚合及其后代路径。 # kind = "domain" 是治理角色:requires = [],release 为 none(普通领域)或 base(Stdlib Bundle 聚合), # 聚合仓自身不含生产实现;其子组件在领域仓库自己的 components.toml 登记。 -# planned 的 requires 是设计输入,接入前须核对实际 imports 和发布依赖;planned 不创建占位 gitlink。 +# planned 的 requires 是设计输入,激活前须核对实际 imports 和发布依赖。 +# 已发布的仓库提交可以作为 planned gitlink 固定,发行验收以 active 状态为准。 [[component]] id = "cli" diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 382b790..e418e85 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -19,11 +19,11 @@ - **领域(`kind = "domain"`)**:工程治理角色,不是语言层也不是运行协议。领域仓库只登记直属子组件,可拥有 `components.toml`、`.gitmodules`、领域公共规范、跨组件集成测试、综合示例、发布装配脚本、ADR 与维护指南;禁止在其中建立 renderer、解析器、数据库驱动等生产实现,也禁止把子仓库源码复制进普通目录。领域 `requires = []`,`release` 为 `none`(普通领域)或 `base`(Stdlib Bundle 聚合)。 - **功能组件**:`kind` 仍为 `core/stdlib/extension/tool/test`,在责任仓库独立实现、测试和发版;`release` 与 `kind` 的对应关系不变(base/optional/none)。 - **唯一归属**:一个功能只有一个权威实现,一个组件只有一个治理归属,一个公共边界只有一套现行合同。已有仓库直接复用,不能因为命名不符创建重复实现。 -- **`planned` 纪律**:planned 组件没有 gitlink、没有实际实现文件、禁止伪造 `entry`;空仓与预期职责只登记在 [迁移台账](MIGRATION.md)。激活领域时,其子组件记录迁入领域仓库自己的 `components.toml`,并在同一根候选清理旧的直属 planned 记录;根 catalog 不得同时登记某个计划中聚合及其后代路径。未激活的其他领域保留现有直属 planned 记录。 +- **`planned` 纪律**:已有仓库可以通过 gitlink 固定已发布的开发提交。尚无提交的仓库登记在 [迁移台账](MIGRATION.md)。组件通过联合验收后才晋升为 `active` 并登记实际 `entry`。将直属组件迁入领域时,在同一根候选转移清单和 gitlink,保证一个组件只有一个父级。 - **聚合准入**:功能拆分须至少有一种独立价值(独立维护责任、显著不同依赖/安全/平台边界、独立版本与制品、可重复独立验收)。若两个仓库几乎每个 PR 都必须一起改动且接口未稳定,应先收敛合同或合并,不能无限拆分。 - **工具目录**(`tools/`)暂不聚合,现有四个 Tool 保持原路径。 -**当前状态**(以 [components.toml](../components.toml) 与 [迁移台账](MIGRATION.md) 为准):根仓库有六个直属 active 组件(`cli`、`conformance`、`view`、`knowledge`、`prove`、`lint`);**尚未激活任何领域**。标准库九个 `std-*` 仍为根 catalog 的 planned 直属记录,`marqdo-stdlib` 聚合尚在计划中;Web 领域 `web` 为 planned domain(`extensions/web`),其 `web-design`/`web-preview` 子组件在 `marqdo-ext-web` 自己的 catalog 登记。其余候选领域继续作为 planned 直属组件或台账条目存在,不创建占位仓库。 +**当前状态**(以 [components.toml](../components.toml) 与 [迁移台账](MIGRATION.md) 为准):根仓库有六个直属 active 组件(`cli`、`conformance`、`view`、`knowledge`、`prove`、`lint`)。九个标准库和十八个独立扩展是根层的 planned 子模块。`extensions/web` 是 planned 领域子模块,Design 和 Preview 由 Web 领域仓挂载。`marqdo-stdlib` 聚合和 `web-components` 仍在计划中。 ## 语言与产品层(不因仓库变多而改变) @@ -47,7 +47,7 @@ | Git tree gitlink | 精确提交身份 | | Cargo.lock / `marqdo.lock` / 现行 Bundle manifest | 相应依赖与制品身份 | -主仓库 `scripts/check-layout.py` 在根 tree 上校验 catalog、gitlink、远端与文件白名单;`--checkouts` 模式下递归读取每个 active 领域固定提交的 catalog 与 `.gitmodules`,逐层验证 gitlink、远端、HEAD/dirty、入口,并展平为全局图校验全局 ID/远端唯一、active 依赖 planned、stdlib/extension/tool 边界、依赖 DAG 无环与深度限制。展平结果是内存对象或临时报告,用于测试调度,不是第二份可提交 catalog。CI 集成、统一制品输入与真实远端逐层证据仍在推进,见 [开发流程](DEVELOPMENT.md)。 +主仓库 `scripts/check-layout.py` 校验 catalog、gitlink、远端与文件白名单。`--checkouts` 递归读取每个已挂载领域的固定提交,逐层验证 gitlink、远端、工作树和活跃入口,并检查全局 ID、依赖边界和无环性。CI 用 `--domain-paths` 在检出子组件前校验领域远端。 [开发流程](DEVELOPMENT.md) ## 各领域排他边界 @@ -74,7 +74,7 @@ Web 领域的产品定义是**文档原生、可交互的前端设计原型及 - **Web Design** `marqdo-web-design`(planned):独立 Rust library,唯一解释作者合同、消费真实 CLI Analysis、产出设计模型/诊断/handoff;不启动服务、不渲染 DOM、不复制 CLI parser。 - **Web Preview** `marqdo-web-preview`(planned):独立 executable + `tool.json`,注册唯一 `web` 命令;消费 Design 公开 API,生成离线安全预览与有限状态交互;不自行解释表格、不写任务专用 JS、不启动生产服务器。 - **组件模板** `web-components`:候选,只有至少两个独立真实复用模板及稳定合同后才准入,不阻塞首版。 -- **边界**:首版不迁移 WASM、不重新实现语言、不要求旧 plugin 回调,不新增 CLI Web 关键字或 `@component` 语义;复杂视觉、真实登录/支付/数据库/网络和任意状态管理交给生产实现。Web 领域当前为 planned,未在根提交 gitlink;激活门禁见 [开发流程](DEVELOPMENT.md)。 +- **边界**:首版不迁移 WASM、不重新实现语言、不要求旧 plugin 回调,不新增 CLI Web 关键字或 `@component` 语义;复杂视觉、真实登录/支付/数据库/网络和任意状态管理交给生产实现。Web 领域已通过 gitlink 固定开发提交,状态为 `planned`。 [开发流程](DEVELOPMENT.md) ## 新增能力与公共边界 diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 5cf19da..1ec0bda 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -20,7 +20,7 @@ - 子模块的 detached HEAD 只用于复现与集成;开发应在子仓库独立创建分支后推送,禁止 `git submodule update --remote` 在发布/验收中追踪浮动分支。 - 同一份公共合同切换需要多个组件同步变化时,在一个候选组合中提交整组 gitlink,配对候选联调通过后再晋升;不允许主分支出现半套协议。 -- 领域激活(planned → active)的门禁:两个功能仓具备真实 `entry` 与候选提交;领域 `components.toml` 与 gitlink 一致;领域 CI 通过;根递归校验通过;Design/Preview 等有依赖关系的组件以同候选证据验证。未满足前不得写占位 gitlink。 +- 领域激活(planned → active)的门禁:两个功能仓具备真实 `entry` 与候选提交,领域 `components.toml` 与 gitlink 一致,领域 CI 和根递归校验通过,Design/Preview 等有依赖关系的组件获得同候选证据。已发布的开发提交可先作为 `planned` 子模块固定。 ## 递归校验与组合检查 @@ -32,7 +32,7 @@ python3 -m unittest discover -s tests/integration bash scripts/integration.sh # 生态候选:真实 CLI 制品 + 组件验收 ``` -- 校验器读取 Git tree 中固定提交的 catalog,不以工作区改动替代候选;`--checkouts` 需要子模块已初始化,缺失、错误 HEAD、脏工作区、错误入口都明确 FAIL/UNVERIFIED,不静默跳过。 +- 校验器读取 Git tree 中固定提交的 catalog,不以工作区改动替代候选;`--checkouts` 需要子模块已初始化,缺失、错误 HEAD、脏工作区、错误入口都明确 FAIL/UNVERIFIED,不静默跳过。CI 先验证并检出直属子模块,再用 `--domain-paths` 校验领域的子模块远端,最后逐个领域检出直属子库。 - 没有 active 领域时,新校验规则同样接受合法的直属功能组件,这不是历史协议兼容。 - 未知的 active 入口、未声明的 gitlink、目录与 catalog 不一致都必须让候选失败。`planned` 不进入验收计数。 - 当前 CI 为 `layout` 与 `candidate` 两段;统一 CLI 制品准备、声明驱动调度与递归影响分析仍在推进(见 `.woodpecker/eco.yml` 与主仓库工单),不得以本文件描述当作已实现。 diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 61a4aa0..0fa35f4 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -22,7 +22,7 @@ Conformance 使用 CLI 已固定的真实 fixture 提交。 ## 标准库和扩展目录 -主仓库的 [标准库目录](../stdlib/README.md) 和 [扩展目录](../extensions/README.md) 提供各组件的开发入口。组件独立维护源码与验收资料,接入状态以 [组件目录](../components.toml) 与该组件所在层的 catalog 为准;聚合领域的子组件在领域仓库自己的 `components.toml` 登记。 +主仓库的 [标准库目录](../stdlib/README.md) 和 [扩展目录](../extensions/README.md) 通过 Git 子模块固定独立仓库的开发提交。Web Design 和 Preview 从 Web 领域聚合仓递归获取。是否参加发行验收以 [组件目录](../components.toml) 与该组件所在层的 catalog 为准。 **标准库(planned,聚合仓库 marqdo-stdlib 尚未创建)** · [core](https://git.cflmy.cn/cflmy/marqdo-std-core) · [collections](https://git.cflmy.cn/cflmy/marqdo-std-collections) · [text](https://git.cflmy.cn/cflmy/marqdo-std-text) · [encoding](https://git.cflmy.cn/cflmy/marqdo-std-encoding) · [data](https://git.cflmy.cn/cflmy/marqdo-std-data) · [io](https://git.cflmy.cn/cflmy/marqdo-std-io) · [fs](https://git.cflmy.cn/cflmy/marqdo-std-fs) · [system](https://git.cflmy.cn/cflmy/marqdo-std-system) · [net](https://git.cflmy.cn/cflmy/marqdo-std-net) @@ -36,7 +36,7 @@ Conformance 使用 CLI 已固定的真实 fixture 提交。 - 每个拥有子模块的聚合仓库只登记直接子组件;全局 ID 与权威远端唯一;功能仓库仍只有一个父级。Gitlink 是提交身份唯一权威,`.gitmodules` 是权威远端唯一记录。 - 聚合仓库可拥有 `components.toml`、`.gitmodules`、领域公共规范、跨组件集成测试、综合示例、发布装配脚本、ADR 与维护指南;**禁止**生产实现与源码复制。 -- `planned` 组件不创建占位 gitlink、不伪造 `entry`、不计入完成率;空仓状态只登记在本台账。根 catalog 不得同时登记计划中的聚合与其后代路径;未激活领域继续保留现有直属 planned 记录。 +- 已有 `planned` 仓的 gitlink 固定真实开发提交。尚无提交的组件只登记计划,激活以后再填写真实 `entry` 并计入完成率。领域及其后代分别登记在各自父仓库。 - 领域激活门禁:子组件具备真实入口与候选提交、领域 catalog 与 gitlink 一致、领域 CI 通过、根 `check-layout.py --checkouts` 递归校验通过、存在依赖关系的组件以同候选证据验证。 - 主仓库 `scripts/check-layout.py` 已引入 domain 角色与递归校验;统一 CLI 制品准备、声明驱动调度、递归影响分析仍在推进,CI 证据以真实候选为准。 @@ -52,7 +52,7 @@ Conformance 使用 CLI 已固定的真实 fixture 提交。 | 阶段 | 当前范围 | 后续验收 | | --- | --- | --- | | M0 盘点 | 自建 Git、历史标签、已有六组件和新仓位 | 通过真实远端候选持续维护台账 | -| M1 集成骨架 | 六个 gitlink、布局门禁和 RC.4 组合 | 查看候选 Woodpecker 运行及各组件独立 CI | +| 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 迁出与同步删除旧路径 | | M3 跨仓闭环 | 工单、人工候选、同 SHA 门禁 | [跨仓库 CI](https://git.cflmy.cn/cflmy/marqdo/issues/3) 跟踪真实缺陷闭环、候选通知鉴权、去重和影响分析 | | M4 领域接入 | Web 领域 planned:三仓文档与工单就绪;根 catalog 登记 planned domain | W-M0 真实 CLI 风险探测、WEB-01/02 实现、领域 gitlink、根递归校验与冷安装验收;Stdlib 聚合按 STD-01..04 独立推进 | diff --git a/docs/REPOSITORY-TASKS.md b/docs/REPOSITORY-TASKS.md index 602995f..1d01e10 100644 --- a/docs/REPOSITORY-TASKS.md +++ b/docs/REPOSITORY-TASKS.md @@ -2,7 +2,7 @@ 按仓库领取任务。标为 **大改** 的条目可涉及模块拆分、实现重写或发布切换。责任仓库应先限定本轮交付范围,涉及公共接口时与实际消费者一起验收。 -生态治理采用“根 → 领域聚合 → 功能组件”最多两级 Gitlink:功能仓库实现与修复、领域聚合仓库维护合同与组合验收、主仓库固定 gitlink、治理与发行。`planned` 组件不创建占位 gitlink 或伪造入口。当前没有 active 领域;Web 领域为 planned(聚合仓 `marqdo-ext-web`,子组件 `marqdo-web-design`/`marqdo-web-preview` 在其 catalog 登记)。先推进 CLI 外部 Bundle、九个标准库,以及 HTTP、Regex、Archive 的迁出;这些改动在同一候选组合中验证后切换基础发行。官网和 VS Code 可独立推进。[迁移台账](MIGRATION.md) · [开发流程](DEVELOPMENT.md) +生态治理采用“根 → 领域聚合 → 功能组件”最多两级 Gitlink:功能仓库实现与修复、领域聚合仓库维护合同与组合验收、主仓库固定 gitlink、治理与发行。`planned` 组件可以挂载真实开发提交,实际入口随验收登记。当前没有 active 领域;Web 领域为 planned(聚合仓 `marqdo-ext-web`,子组件 `marqdo-web-design`/`marqdo-web-preview` 在其 catalog 登记)。先推进 CLI 外部 Bundle、九个标准库,以及 HTTP、Regex、Archive 的迁出;这些改动在同一候选组合中验证后切换基础发行。官网和 VS Code 可独立推进。[迁移台账](MIGRATION.md) · [开发流程](DEVELOPMENT.md) ## 集成和语言 diff --git a/docs/adr/0001-hierarchical-ecosystem-and-web-domain.md b/docs/adr/0001-hierarchical-ecosystem-and-web-domain.md index fff4752..6cba7a1 100644 --- a/docs/adr/0001-hierarchical-ecosystem-and-web-domain.md +++ b/docs/adr/0001-hierarchical-ecosystem-and-web-domain.md @@ -156,7 +156,7 @@ marqdo/ # 生态主仓库(唯一根) └── AGENTS.md ``` -实际仓库名以自建权威远端盘点为准;已有仓库直接复用,不能因为命名不符创建重复实现。上图不表示所有候选仓库需要立刻建立。首批只激活 Stdlib 聚合(随现有库源码拆分推进)和 Web 聚合(Design、Preview);其他候选领域在至少两个真实组件、共同测试或发行边界成立时转换。计划中的组件应保持 planned,不创建占位 gitlink,不将其计入完成率。未激活聚合仓时,其内部规划仅列在迁移台账中;不得在根 catalog 同时登记计划中的聚合与其后代路径。激活聚合时将原直属 planned 记录迁至该聚合自己的 catalog,并在同一根候选清理旧记录;尚未激活的其他领域可继续保留现有直属 planned 记录。工具目录暂不聚合,已有四个 Tool 保持原路径。 +实际仓库名以自建权威远端盘点为准;已有仓库直接复用,不能因为命名不符创建重复实现。上图不表示所有候选仓库需要立刻建立。首批只激活 Stdlib 聚合(随现有库源码拆分推进)和 Web 聚合(Design、Preview);其他候选领域在至少两个真实组件、共同测试或发行边界成立时转换。计划中的组件保持 planned,已有仓库可通过 gitlink 固定真实开发提交,激活后才计入完成率。规划中的领域及其后代分别登记在各自父级的 catalog 中。激活聚合时将原直属 planned 记录迁至该聚合自己的 catalog,并在同一根候选清理旧记录;尚未激活的其他领域可继续保留现有直属 planned 记录。工具目录暂不聚合,已有四个 Tool 保持原路径。 ### 3.2 聚合仓库的准入及内容 @@ -266,7 +266,7 @@ release = "optional" ### 4.2 校验算法(主仓库 G01/G02) 1. 读取指定候选 commit 的根 `components.toml` 和 `.gitmodules`,不要从可能已修改的工作区文件取代它。拒绝重复 TOML 字段、未知类型、非法路径、绝对路径、`..`、大小写或 NFC 冲突、同级路径重叠。 -2. 使用 `git ls-tree -rz --full-tree REV` 获取当前层 gitlink 和普通文件。active 与 gitlink 一一对应;planned 无 gitlink、无实际实现文件。聚合层普通文件仅限 docs/examples/scripts/tests/治理配置等白名单,功能层内部不套聚合白名单。 +2. 使用 `git ls-tree -rz --full-tree REV` 获取当前层 gitlink 和普通文件。active 必须有 gitlink;已发布的 planned 组件可有 gitlink,且父仓库只记录它的固定提交。聚合层普通文件仅限 docs/examples/scripts/tests/治理配置等白名单,功能层内部不套聚合白名单。 3. 先验证当前层 `.gitmodules` 的直属路径和远端,再检出确切 SHA(逐层进行)。允许的 URL 由维护者批准的自建 HTTPS 远端及明确的迁移映射决定;拒绝 `file://`、任意外部 URL、submodule update command、相对跳转、重复物理仓库及未批准别名。不要在未检查嵌套 `.gitmodules` 前使用携带凭证的盲目递归拉取。 4. 每个 domain 检出后在其固定 commit 重复步骤 1–3,深度最多 2;功能叶子不得再注册未批准 gitlink。检查 `HEAD` 与父 gitlink 一致、可获取、工作树无修改、入口为真实常规文件、无符号链接逃逸。缺失时明确 FAIL/UNVERIFIED,不静默略过。 5. 展平全局 ID、父级、逻辑路径、权威 URL、SHA、类型、state。全局 ID 与远端唯一;解析 `requires` / `checks_with` 至全局 ID;active 不依赖 planned;禁止 stdlib 依赖 extension/tool,禁止 core 构建依赖其他功能,禁止直接依赖 domain,禁止循环 DAG。检查实际 package imports/lock/Cargo/Tool requires 是否与治理声明相符;无法静态确定时列出验证项而非假装完整。 @@ -278,7 +278,7 @@ release = "optional" 1. 在自建远端核对现有仓库、可达性、分支保护和权限。保留根旧历史、标签及现有有效 gitlink。建立专门 `architecture/domains` 候选分支,不强推或删除历史。 2. 在主仓库先开发递归 checker 和临时 Git 仓库测试,现有六组件继续验证。该分支最终只保留一套新规则;没有 active domain 时新 checker 同样支持合法的直属功能组件,这不是历史协议兼容。 -3. 建立 `marqdo-ext-web`(或复用已存在的 Web 权威仓库);只有实际 Design/Preview 仓库具备可用入口与候选提交后才注册 active。维护者确认每个子库远端已推送,领域子模块锁定 SHA 并独立通过领域 CI,再在根挂入领域 commit。 +3. 建立 `marqdo-ext-web`(或复用已存在的 Web 权威仓库);只有实际 Design/Preview 仓库具备可用入口与候选提交后才注册 active。维护者确认每个子库远端已推送,领域子模块锁定 SHA,根可先固定 planned 组合。域内和根的联合验证通过后再激活。 4. 对已有直属组件移动,先在目标聚合仓库新增同一个远端同一个 SHA 的 gitlink(在领域候选上),验证该聚合仓库,根候选移除旧路径 gitlink 与旧清单记录、加入聚合 gitlink;一次 PR 内切换,不允许集成主分支同时出现两份同一远端。旧源码、历史工单不复制,旧根快照仍可重现。 5. 仅修改本轮相关治理文件和集成脚本。不得借此重构 CLI、Knowledge、Prove、View、Lint 的功能代码。涉及其验收入口时各自发工单,配对候选提交验证。根候选失败时不晋升;回退根 gitlink 组合即可,不重写子仓历史。 diff --git a/extensions/README.md b/extensions/README.md index 6d38dad..a956bf4 100644 --- a/extensions/README.md +++ b/extensions/README.md @@ -1,32 +1,32 @@ # 领域扩展与领域聚合 -本目录覆盖按需安装的领域能力。功能组件默认 `planned`,开发在独立责任仓库进行,验收后按治理规则接入;聚合仓库不实现子组件业务,根 catalog 只登记 `kind = "domain"` 的聚合本身,不重复登记其后代路径。 +本目录覆盖按需安装的领域能力。功能组件默认 `planned`,通过 Git 子模块固定独立仓库的开发提交,完成验收后晋升;聚合仓库不实现子组件业务,根 catalog 只登记 `kind = "domain"` 的聚合本身,不重复登记其后代路径。 ## 领域聚合(planned) | 路径 | 仓库 | 说明 | | --- | --- | --- | -| [web](web/README.md) | [marqdo-ext-web](https://git.cflmy.cn/cflmy/marqdo-ext-web) | Web 原型设计领域聚合:唯一设计合同、示例、组合验收与交付协调;子组件 [marqdo-web-design](https://git.cflmy.cn/cflmy/marqdo-web-design)、[marqdo-web-preview](https://git.cflmy.cn/cflmy/marqdo-web-preview) 在领域 `components.toml` 登记 | +| `web/` | [marqdo-ext-web](https://git.cflmy.cn/cflmy/marqdo-ext-web) | Web 原型设计领域聚合:唯一设计合同、示例、组合验收与交付协调;子组件 [marqdo-web-design](https://git.cflmy.cn/cflmy/marqdo-web-design)、[marqdo-web-preview](https://git.cflmy.cn/cflmy/marqdo-web-preview) 在领域 `components.toml` 登记 | ## 独立组件(planned) -- [marqdo-ext-math](math/README.md) · 数值算法、统计、符号数学及绘图 -- [marqdo-ext-linalg](linalg/README.md) · 复数、矩阵、分解及数值线性代数 -- [marqdo-ext-quantum](quantum/README.md) · 量子电路、态向量、采样与模拟 -- [marqdo-ext-http](http/README.md) · HTTP、URL、SSE 与报文生命周期 -- [marqdo-ext-websocket](websocket/README.md) · WebSocket 握手、帧与连接语义 -- [marqdo-ext-ai](ai/README.md) · 模型协议、流式输出与工具调用数据 -- [marqdo-ext-mcp](mcp/README.md) · MCP 协议、传输、发现和调用 -- [marqdo-ext-crypto](crypto/README.md) · 成熟密码学实现的封装 -- [marqdo-ext-database](database/README.md) · SQL 参数绑定、事务和驱动连接 -- [marqdo-ext-storage](storage/README.md) · 本地和对象存储接口 -- [marqdo-ext-cache](cache/README.md) · TTL、缓存和失效 -- [marqdo-ext-security](security/README.md) · 应用身份、会话及权限模型 -- [marqdo-ext-browser](browser/README.md) · 浏览器宿主、WASM 适配、DOM 和事件 -- [marqdo-ext-document](document/README.md) · Markdown 结构与显式文档编辑 -- [marqdo-ext-archive](archive/README.md) · 压缩、安全归档和解包 -- [marqdo-ext-engineering](engineering/README.md) · 工程操作、文件补丁与产物 -- [marqdo-ext-regex](regex/README.md) · 正则匹配、捕获、扫描和替换 -- [marqdo-ext-datetime](datetime/README.md) · IANA 时区、DST 和高级日历 +- [marqdo-ext-math](https://git.cflmy.cn/cflmy/marqdo-ext-math) · 数值算法、统计、符号数学及绘图 +- [marqdo-ext-linalg](https://git.cflmy.cn/cflmy/marqdo-ext-linalg) · 复数、矩阵、分解及数值线性代数 +- [marqdo-ext-quantum](https://git.cflmy.cn/cflmy/marqdo-ext-quantum) · 量子电路、态向量、采样与模拟 +- [marqdo-ext-http](https://git.cflmy.cn/cflmy/marqdo-ext-http) · HTTP、URL、SSE 与报文生命周期 +- [marqdo-ext-websocket](https://git.cflmy.cn/cflmy/marqdo-ext-websocket) · WebSocket 握手、帧与连接语义 +- [marqdo-ext-ai](https://git.cflmy.cn/cflmy/marqdo-ext-ai) · 模型协议、流式输出与工具调用数据 +- [marqdo-ext-mcp](https://git.cflmy.cn/cflmy/marqdo-ext-mcp) · MCP 协议、传输、发现和调用 +- [marqdo-ext-crypto](https://git.cflmy.cn/cflmy/marqdo-ext-crypto) · 成熟密码学实现的封装 +- [marqdo-ext-database](https://git.cflmy.cn/cflmy/marqdo-ext-database) · SQL 参数绑定、事务和驱动连接 +- [marqdo-ext-storage](https://git.cflmy.cn/cflmy/marqdo-ext-storage) · 本地和对象存储接口 +- [marqdo-ext-cache](https://git.cflmy.cn/cflmy/marqdo-ext-cache) · TTL、缓存和失效 +- [marqdo-ext-security](https://git.cflmy.cn/cflmy/marqdo-ext-security) · 应用身份、会话及权限模型 +- [marqdo-ext-browser](https://git.cflmy.cn/cflmy/marqdo-ext-browser) · 浏览器宿主、WASM 适配、DOM 和事件 +- [marqdo-ext-document](https://git.cflmy.cn/cflmy/marqdo-ext-document) · Markdown 结构与显式文档编辑 +- [marqdo-ext-archive](https://git.cflmy.cn/cflmy/marqdo-ext-archive) · 压缩、安全归档和解包 +- [marqdo-ext-engineering](https://git.cflmy.cn/cflmy/marqdo-ext-engineering) · 工程操作、文件补丁与产物 +- [marqdo-ext-regex](https://git.cflmy.cn/cflmy/marqdo-ext-regex) · 正则匹配、捕获、扫描和替换 +- [marqdo-ext-datetime](https://git.cflmy.cn/cflmy/marqdo-ext-datetime) · IANA 时区、DST 和高级日历 [组件目录](../components.toml) · [各仓库任务](../docs/REPOSITORY-TASKS.md) · [架构边界](../docs/ARCHITECTURE.md) diff --git a/extensions/ai b/extensions/ai new file mode 160000 index 0000000..4d2c3e4 --- /dev/null +++ b/extensions/ai @@ -0,0 +1 @@ +Subproject commit 4d2c3e4f1ac6266b0b9502ec585ec99175cfecb2 diff --git a/extensions/ai/README.md b/extensions/ai/README.md deleted file mode 100644 index 1839c15..0000000 --- a/extensions/ai/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-ai - -职责为模型协议、流式输出与工具调用数据。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-ai) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/archive b/extensions/archive new file mode 160000 index 0000000..527650e --- /dev/null +++ b/extensions/archive @@ -0,0 +1 @@ +Subproject commit 527650e726e11a1d6957b2ed946d2f5e440686ca diff --git a/extensions/archive/README.md b/extensions/archive/README.md deleted file mode 100644 index 8236722..0000000 --- a/extensions/archive/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-archive - -职责为压缩、安全归档和解包。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-archive) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/browser b/extensions/browser new file mode 160000 index 0000000..35c1a75 --- /dev/null +++ b/extensions/browser @@ -0,0 +1 @@ +Subproject commit 35c1a75fd00281e82d81f5dea5cdc853c93e9871 diff --git a/extensions/browser/README.md b/extensions/browser/README.md deleted file mode 100644 index 323a1cb..0000000 --- a/extensions/browser/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-browser - -职责为浏览器宿主、WASM 适配、DOM 和事件。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-browser) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/cache b/extensions/cache new file mode 160000 index 0000000..0357907 --- /dev/null +++ b/extensions/cache @@ -0,0 +1 @@ +Subproject commit 0357907e1decf0f4cb3057505a96077cacbe98b1 diff --git a/extensions/cache/README.md b/extensions/cache/README.md deleted file mode 100644 index d7d8929..0000000 --- a/extensions/cache/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-cache - -职责为TTL、缓存和失效。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-cache) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/crypto b/extensions/crypto new file mode 160000 index 0000000..21529b8 --- /dev/null +++ b/extensions/crypto @@ -0,0 +1 @@ +Subproject commit 21529b8b25cffc50054897127675b68ded8da6e7 diff --git a/extensions/crypto/README.md b/extensions/crypto/README.md deleted file mode 100644 index 201b2cc..0000000 --- a/extensions/crypto/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-crypto - -职责为成熟密码学实现的封装。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-crypto) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/database b/extensions/database new file mode 160000 index 0000000..e86a397 --- /dev/null +++ b/extensions/database @@ -0,0 +1 @@ +Subproject commit e86a397c8ebcd8c16049977f55fd320228eaddd8 diff --git a/extensions/database/README.md b/extensions/database/README.md deleted file mode 100644 index f0e6b0e..0000000 --- a/extensions/database/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-database - -职责为SQL 参数绑定、事务和驱动连接。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-database) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/datetime b/extensions/datetime new file mode 160000 index 0000000..5e2e2a1 --- /dev/null +++ b/extensions/datetime @@ -0,0 +1 @@ +Subproject commit 5e2e2a1b34455c123dd5023e4cb958e7c99eeb8b diff --git a/extensions/datetime/README.md b/extensions/datetime/README.md deleted file mode 100644 index 2e27e1f..0000000 --- a/extensions/datetime/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-datetime - -职责为IANA 时区、DST 和高级日历。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-datetime) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/document b/extensions/document new file mode 160000 index 0000000..eb88be3 --- /dev/null +++ b/extensions/document @@ -0,0 +1 @@ +Subproject commit eb88be346aa16703877754d5239c4c98421260d2 diff --git a/extensions/document/README.md b/extensions/document/README.md deleted file mode 100644 index 2a880ad..0000000 --- a/extensions/document/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-document - -职责为Markdown 结构与显式文档编辑。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-document) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/engineering b/extensions/engineering new file mode 160000 index 0000000..b9f3ddb --- /dev/null +++ b/extensions/engineering @@ -0,0 +1 @@ +Subproject commit b9f3ddba05f1f2a7df4163087d059aacc07fba79 diff --git a/extensions/engineering/README.md b/extensions/engineering/README.md deleted file mode 100644 index ed9eadd..0000000 --- a/extensions/engineering/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-engineering - -职责为工程操作、文件补丁与产物。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-engineering) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/http b/extensions/http new file mode 160000 index 0000000..f2dde42 --- /dev/null +++ b/extensions/http @@ -0,0 +1 @@ +Subproject commit f2dde4234c53739887dd5ef5307075a2d49a4c0b diff --git a/extensions/http/README.md b/extensions/http/README.md deleted file mode 100644 index c22b00c..0000000 --- a/extensions/http/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-http - -职责为HTTP、URL、SSE 与报文生命周期。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-http) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/linalg b/extensions/linalg new file mode 160000 index 0000000..773ba9e --- /dev/null +++ b/extensions/linalg @@ -0,0 +1 @@ +Subproject commit 773ba9ef2e5dc2f62c984c1702a34a4754519b30 diff --git a/extensions/linalg/README.md b/extensions/linalg/README.md deleted file mode 100644 index 5a39a51..0000000 --- a/extensions/linalg/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-linalg - -职责为复数、矩阵、分解及数值线性代数。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-linalg) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/math b/extensions/math new file mode 160000 index 0000000..f7ef250 --- /dev/null +++ b/extensions/math @@ -0,0 +1 @@ +Subproject commit f7ef25014ae805740a5778914abe8cdb10a5d5b1 diff --git a/extensions/math/README.md b/extensions/math/README.md deleted file mode 100644 index c398140..0000000 --- a/extensions/math/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-math - -职责为数值算法、统计、符号数学及绘图。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-math) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/mcp b/extensions/mcp new file mode 160000 index 0000000..df477bc --- /dev/null +++ b/extensions/mcp @@ -0,0 +1 @@ +Subproject commit df477bceecf6807295087bab8413b20ffa991526 diff --git a/extensions/mcp/README.md b/extensions/mcp/README.md deleted file mode 100644 index 525b73c..0000000 --- a/extensions/mcp/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-mcp - -职责为MCP 协议、传输、发现和调用。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-mcp) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/quantum b/extensions/quantum new file mode 160000 index 0000000..33f4780 --- /dev/null +++ b/extensions/quantum @@ -0,0 +1 @@ +Subproject commit 33f4780e9e9a9d591c93bb783186f5885ffc9739 diff --git a/extensions/quantum/README.md b/extensions/quantum/README.md deleted file mode 100644 index 9b300fb..0000000 --- a/extensions/quantum/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-quantum - -职责为量子电路、态向量、采样与模拟。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-quantum) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/regex b/extensions/regex new file mode 160000 index 0000000..5458dff --- /dev/null +++ b/extensions/regex @@ -0,0 +1 @@ +Subproject commit 5458dff039a84357af5dc83ad11044050df12675 diff --git a/extensions/regex/README.md b/extensions/regex/README.md deleted file mode 100644 index 5373bda..0000000 --- a/extensions/regex/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-regex - -职责为正则匹配、捕获、扫描和替换。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-regex) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/security b/extensions/security new file mode 160000 index 0000000..6939018 --- /dev/null +++ b/extensions/security @@ -0,0 +1 @@ +Subproject commit 693901824947422bac4a5f89f2af41b349dbc579 diff --git a/extensions/security/README.md b/extensions/security/README.md deleted file mode 100644 index e8283cf..0000000 --- a/extensions/security/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-security - -职责为应用身份、会话及权限模型。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-security) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/storage b/extensions/storage new file mode 160000 index 0000000..6a798f0 --- /dev/null +++ b/extensions/storage @@ -0,0 +1 @@ +Subproject commit 6a798f099eaa9e826016bd1555d4e354113531f9 diff --git a/extensions/storage/README.md b/extensions/storage/README.md deleted file mode 100644 index c979f80..0000000 --- a/extensions/storage/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-storage - -职责为本地和对象存储接口。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-storage) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/extensions/web b/extensions/web new file mode 160000 index 0000000..f70095d --- /dev/null +++ b/extensions/web @@ -0,0 +1 @@ +Subproject commit f70095d60af47a6831bb15e1933b38f788e7fbfa diff --git a/extensions/web/README.md b/extensions/web/README.md deleted file mode 100644 index 7a3b1e1..0000000 --- a/extensions/web/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# extensions/web(Web 领域聚合目标路径) - -该路径是 `kind = "domain"` 的 Web 领域聚合仓库 [marqdo-ext-web](https://git.cflmy.cn/cflmy/marqdo-ext-web) 的挂载路径。当前状态 `planned`:**没有 gitlink,也没有本目录内的实现源码**;本 README 只是根 catalog 的记录说明。 - -## 边界 - -- 领域聚合仓库只做治理:唯一设计合同、示例、跨组件集成测试、发布装配与交付协调;**不得**在其中实现 renderer、parser、数据库驱动或业务逻辑,也不得复制子仓库源码。 -- 子组件不在根 catalog 登记:[marqdo-web-design](https://git.cflmy.cn/cflmy/marqdo-web-design)(设计解释 Rust library)与 [marqdo-web-preview](https://git.cflmy.cn/cflmy/marqdo-web-preview)(`web` Tool 与离线预览)记录在领域仓库自己的 `components.toml`,激活时随领域 gitlink 一次接入根。 -- 唯一作者合同:[WEB-DESIGN](https://git.cflmy.cn/cflmy/marqdo-ext-web/src/branch/main/docs/WEB-DESIGN.md);领域开发指南:[DEVELOPMENT](https://git.cflmy.cn/cflmy/marqdo-ext-web/src/branch/main/docs/DEVELOPMENT.md)。 - -## 激活门禁 - -两个子组件具备真实独立入口与候选提交、领域 catalog 与 gitlink 一致、领域 CI 通过、根 `check-layout.py --checkouts` 递归校验通过、Design/Preview 同候选证据齐全。未满足前保持 `planned`,不创建占位 gitlink。详见 [迁移台账](../../docs/MIGRATION.md) 与 [开发流程](../../docs/DEVELOPMENT.md)。 diff --git a/extensions/websocket b/extensions/websocket new file mode 160000 index 0000000..e79f2e7 --- /dev/null +++ b/extensions/websocket @@ -0,0 +1 @@ +Subproject commit e79f2e78fa24257202daccd68f6135528c39a417 diff --git a/extensions/websocket/README.md b/extensions/websocket/README.md deleted file mode 100644 index f6acb79..0000000 --- a/extensions/websocket/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-ext-websocket - -职责为WebSocket 握手、帧与连接语义。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-ext-websocket) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/scripts/check-layout.py b/scripts/check-layout.py index a4811b0..10fea9b 100644 --- a/scripts/check-layout.py +++ b/scripts/check-layout.py @@ -5,8 +5,8 @@ The checker follows the hierarchical governance rules of the Marqdo ecosystem specification (sections 2-4, 13): * the root catalog describes direct components and domain aggregates; -* an active ``kind = "domain"`` gitlink is only expanded when ``--checkouts`` - is requested, at its exact pinned commit; +* a registered ``kind = "domain"`` gitlink is expanded at its exact pinned + commit for ``--checkouts`` or to validate URLs before updating its children; * each aggregate layer has its own ``components.toml`` / ``.gitmodules`` and registers only its direct children; * governance depth is limited to two gitlink levels (root -> domain -> leaf); @@ -59,7 +59,7 @@ def nfc(value): class Layer: """One governance level: the root tree or one expanded domain aggregate.""" - def __init__(self, repo, revision, label, depth, order, components, gitlinks, active, planned, urls): + def __init__(self, repo, revision, label, depth, order, components, gitlinks, linked, urls): self.repo = Path(repo) self.revision = revision self.label = label @@ -67,8 +67,7 @@ class Layer: self.order = order self.components = components self.gitlinks = gitlinks - self.active = active - self.planned = planned + self.linked = linked self.urls = urls @@ -209,16 +208,16 @@ def tree_entries(repo, revision, label): return entries -def check_root_tree(entries, active, planned, label): +def check_root_tree(entries, linked, unlinked, label): allowed_readmes = CATEGORY_READMES | { f'{item["path"]}/README.md' - for item in planned + for item in unlinked if item["kind"] in {"stdlib", "extension", "domain"} } for path, (mode, _) in entries.items(): root = path.split("/", 1)[0] require( - path in active or (mode == "100644" and path in allowed_readmes) + path in linked or (mode == "100644" and path in allowed_readmes) or (mode in {"100644", "100755"} and ( path in ROOT_FILES or root in ROOT_DIRS and "/" in path or path.startswith("tests/integration/") )), @@ -226,15 +225,15 @@ def check_root_tree(entries, active, planned, label): ) -def check_domain_tree(entries, active, planned, label): +def check_domain_tree(entries, linked, unlinked, label): """Aggregate layers only carry governance, docs, examples and tests. Production implementations stay in the child repositories: an aggregate may not add a renderer, parser or driver under its own tree. """ - allowed_readmes = {f'{item["path"]}/README.md' for item in planned} + allowed_readmes = {f'{item["path"]}/README.md' for item in unlinked} for path, (mode, _) in entries.items(): - if path in active: + if path in linked: continue if mode == "100644" and path in allowed_readmes: continue @@ -264,7 +263,7 @@ def read_submodules(repo, revision, label): return config -def check_submodules(config, active, depth, label, urls): +def check_submodules(config, linked, depth, label, urls): """Match ``.gitmodules`` sections by ``path``, not by section name. Git configuration keys are keyed by the submodule section name, which is @@ -290,7 +289,7 @@ def check_submodules(config, active, depth, label, urls): require(path not in by_path, f"{label}: duplicate submodule path: {path}") by_path[path] = fields["url"] require(not extras, f"{label}: unexpected submodule settings: {sorted(extras)}") - for path, component in active.items(): + for path, component in linked.items(): require(path in by_path, f"{label}: missing or invalid submodule path: {path}") url = by_path.pop(path) expected = expected_remote(component, depth) @@ -310,17 +309,18 @@ def read_layer(repo, revision, label, depth): order.append(check_component(raw, depth, label, components, paths, path_keys)) entries = tree_entries(repo, revision, label) gitlinks = {path: sha for path, (mode, sha) in entries.items() if mode == "160000"} - active = {item["path"]: item for item in order if item["state"] == "active"} - planned = [item for item in order if item["state"] == "planned"] - require(gitlinks.keys() == active.keys(), - f"{label}: gitlink/catalog mismatch: {sorted(gitlinks.keys() ^ active.keys())}") + active_paths = {item["path"] for item in order if item["state"] == "active"} + mismatch = (active_paths - gitlinks.keys()) | (gitlinks.keys() - paths) + require(not mismatch, f"{label}: gitlink/catalog mismatch: {sorted(mismatch)}") + linked = {item["path"]: item for item in order if item["path"] in gitlinks} + unlinked = [item for item in order if item["path"] not in gitlinks] if depth == 0: - check_root_tree(entries, active, planned, label) + check_root_tree(entries, linked, unlinked, label) else: - check_domain_tree(entries, active, planned, label) + check_domain_tree(entries, linked, unlinked, label) urls = {} - check_submodules(read_submodules(repo, revision, label), active, depth, label, urls) - return Layer(repo, revision, label, depth, order, components, gitlinks, active, planned, urls) + check_submodules(read_submodules(repo, revision, label), linked, depth, label, urls) + return Layer(repo, revision, label, depth, order, components, gitlinks, linked, urls) def verify_checkout(layer, component): @@ -342,9 +342,10 @@ def verify_checkout(layer, component): status.append("--ignore-submodules=all") require(not git(*status, cwd=checkout), f"{layer.label}: dirty submodule: {path}") - entry = checkout / component["entry"] - require(entry.is_file() and entry.resolve() == entry, - f"{layer.label}: missing or symbolic entry: {path}/{component['entry']}") + if component["state"] == "active": + entry = checkout / component["entry"] + require(entry.is_file() and entry.resolve() == entry, + f"{layer.label}: missing or symbolic entry: {path}/{component['entry']}") return checkout @@ -402,35 +403,50 @@ def validate_graph(layers): raise ValueError(f"root: requires DAG cycle: {error}") from None -def validate(revision, checkouts): +def validate(revision, checkouts, expand_domains=False): layers = [read_layer(ROOT, revision, "root", 0)] - if checkouts: + if checkouts or expand_domains: root = layers[0] - for component in root.active.values(): - verify_checkout(root, component) - for path, component in root.active.items(): + for path, component in root.linked.items(): if component["kind"] != "domain": + if checkouts: + verify_leaf(root, component) continue - domain_repo = ROOT / path + domain_repo = verify_checkout(root, component) domain = read_layer(domain_repo, root.gitlinks[path], f"domain {component['id']} ({path})", 1) layers.append(domain) - for child in domain.active.values(): - verify_leaf(domain, child) + if checkouts: + for child in domain.linked.values(): + verify_leaf(domain, child) validate_graph(layers) - for layer in layers: - for component in layer.order: - if component["state"] == "active": - print(f'{component["id"]} {component["path"]} {layer.gitlinks[component["path"]]}') + return layers def main(): parser = argparse.ArgumentParser(description="Validate a Marqdo ecosystem Git tree") parser.add_argument("revision", nargs="?", default="HEAD") parser.add_argument("--checkouts", action="store_true") + paths = parser.add_mutually_exclusive_group() + paths.add_argument("--active-paths", action="store_true", help="print only direct active component paths") + paths.add_argument("--domain-paths", action="store_true", help="validate domain URLs and print domain paths") args = parser.parse_args() try: - validate(git("rev-parse", "--verify", args.revision + "^{commit}").strip(), args.checkouts) + revision = git("rev-parse", "--verify", args.revision + "^{commit}").strip() + layers = validate(revision, args.checkouts, expand_domains=args.domain_paths) + if args.active_paths: + for path, component in sorted(layers[0].linked.items()): + if component["state"] == "active": + print(path) + elif args.domain_paths: + for path, component in sorted(layers[0].linked.items()): + if component["kind"] == "domain": + print(path) + else: + for layer in layers: + for path, component in sorted(layer.linked.items()): + relative = (layer.repo / path).relative_to(ROOT).as_posix() + print(f'{component["id"]} {relative} {layer.gitlinks[path]} {component["state"]}') except (AttributeError, KeyError, OSError, subprocess.CalledProcessError, TypeError, ValueError) as error: sys.exit(f"layout: {error}") diff --git a/scripts/integration.sh b/scripts/integration.sh index a317d9c..a33c308 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -3,8 +3,7 @@ set -euo pipefail cd "$(dirname "$0")/.." root="$PWD" -python3 scripts/check-layout.py --checkouts -active="$(git ls-tree -r HEAD | awk '$1 == "160000" { print $4 }')" +active="$(python3 scripts/check-layout.py --checkouts --active-paths)" expected=$'cli\ntests/conformance\ntools/knowledge\ntools/lint\ntools/prove\ntools/view' if [[ "$active" != "$expected" ]]; then echo "UNVERIFIED: update the integration plan for the changed active component set" >&2 @@ -17,7 +16,7 @@ echo "integration evidence: $work" exec > >(tee "$work/run.log") 2>&1 set -x git rev-parse HEAD -git submodule status +git submodule status --recursive uname -m ldd --version cargo --version diff --git a/stdlib/README.md b/stdlib/README.md index bd6d414..b63510e 100644 --- a/stdlib/README.md +++ b/stdlib/README.md @@ -1,15 +1,15 @@ # 标准库 -标准库组件负责低层通用能力,验收后共同组成基础发行的标准库 Bundle。 进入各组件目录查看独立仓库和开发任务。 +标准库组件负责低层通用能力,验收后共同组成基础发行的标准库 Bundle。各目录通过 Git 子模块固定独立标准库仓库的开发提交。 -- [marqdo-std-core](core/README.md) · Result 与基础数值 -- [marqdo-std-collections](collections/README.md) · List、Map 和 Table 值操作 -- [marqdo-std-text](text/README.md) · Unicode 文本、字节值与 UTF-8 -- [marqdo-std-encoding](encoding/README.md) · Base64、Base32 和 Hex -- [marqdo-std-data](data/README.md) · JSON、CSV、TOML 与 GFM 数据转换 -- [marqdo-std-io](io/README.md) · Console、Stream、格式化和官方 print 别名 -- [marqdo-std-fs](fs/README.md) · 文件、目录与路径 -- [marqdo-std-system](system/README.md) · 时钟、UTC、环境、进程与随机 -- [marqdo-std-net](net/README.md) · TCP、UDP、TLS 和网络字节流 +- [marqdo-std-core](https://git.cflmy.cn/cflmy/marqdo-std-core) · Result 与基础数值 +- [marqdo-std-collections](https://git.cflmy.cn/cflmy/marqdo-std-collections) · List、Map 和 Table 值操作 +- [marqdo-std-text](https://git.cflmy.cn/cflmy/marqdo-std-text) · Unicode 文本、字节值与 UTF-8 +- [marqdo-std-encoding](https://git.cflmy.cn/cflmy/marqdo-std-encoding) · Base64、Base32 和 Hex +- [marqdo-std-data](https://git.cflmy.cn/cflmy/marqdo-std-data) · JSON、CSV、TOML 与 GFM 数据转换 +- [marqdo-std-io](https://git.cflmy.cn/cflmy/marqdo-std-io) · Console、Stream、格式化和官方 print 别名 +- [marqdo-std-fs](https://git.cflmy.cn/cflmy/marqdo-std-fs) · 文件、目录与路径 +- [marqdo-std-system](https://git.cflmy.cn/cflmy/marqdo-std-system) · 时钟、UTC、环境、进程与随机 +- [marqdo-std-net](https://git.cflmy.cn/cflmy/marqdo-std-net) · TCP、UDP、TLS 和网络字节流 [组件目录](../components.toml) · [各仓库任务](../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/collections b/stdlib/collections new file mode 160000 index 0000000..0851e1f --- /dev/null +++ b/stdlib/collections @@ -0,0 +1 @@ +Subproject commit 0851e1f8a05256dc50a9930df5deedbb7cd8f481 diff --git a/stdlib/collections/README.md b/stdlib/collections/README.md deleted file mode 100644 index bc3f5cf..0000000 --- a/stdlib/collections/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-collections - -职责为List、Map 和 Table 值操作。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-collections) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/core b/stdlib/core new file mode 160000 index 0000000..997a970 --- /dev/null +++ b/stdlib/core @@ -0,0 +1 @@ +Subproject commit 997a970f9e28ac7ada1384a9f0498d9826c63e77 diff --git a/stdlib/core/README.md b/stdlib/core/README.md deleted file mode 100644 index 7befd5f..0000000 --- a/stdlib/core/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-core - -职责为Result 与基础数值。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-core) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/data b/stdlib/data new file mode 160000 index 0000000..e3c9488 --- /dev/null +++ b/stdlib/data @@ -0,0 +1 @@ +Subproject commit e3c9488dcac424fdcfe705ed049db7775d6ca16b diff --git a/stdlib/data/README.md b/stdlib/data/README.md deleted file mode 100644 index 0a62457..0000000 --- a/stdlib/data/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-data - -职责为JSON、CSV、TOML 与 GFM 数据转换。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-data) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/encoding b/stdlib/encoding new file mode 160000 index 0000000..1aab705 --- /dev/null +++ b/stdlib/encoding @@ -0,0 +1 @@ +Subproject commit 1aab705e5b25445ff03b13dae6c867323d5b9028 diff --git a/stdlib/encoding/README.md b/stdlib/encoding/README.md deleted file mode 100644 index 6d19c56..0000000 --- a/stdlib/encoding/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-encoding - -职责为Base64、Base32 和 Hex。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-encoding) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/fs b/stdlib/fs new file mode 160000 index 0000000..3ef21c7 --- /dev/null +++ b/stdlib/fs @@ -0,0 +1 @@ +Subproject commit 3ef21c7de018b3ed29e95dedac276ef3b475e544 diff --git a/stdlib/fs/README.md b/stdlib/fs/README.md deleted file mode 100644 index f8d6885..0000000 --- a/stdlib/fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-fs - -职责为文件、目录与路径。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-fs) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/io b/stdlib/io new file mode 160000 index 0000000..945e76e --- /dev/null +++ b/stdlib/io @@ -0,0 +1 @@ +Subproject commit 945e76eed8adb589ea00fb5343138d5b99cdf0ea diff --git a/stdlib/io/README.md b/stdlib/io/README.md deleted file mode 100644 index 91d2836..0000000 --- a/stdlib/io/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-io - -职责为Console、Stream、格式化和官方 print 别名。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-io) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/net b/stdlib/net new file mode 160000 index 0000000..8aad76d --- /dev/null +++ b/stdlib/net @@ -0,0 +1 @@ +Subproject commit 8aad76d87f8b0ab5f563376da12713fb30a5a394 diff --git a/stdlib/net/README.md b/stdlib/net/README.md deleted file mode 100644 index 87bedf9..0000000 --- a/stdlib/net/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-net - -职责为TCP、UDP、TLS 和网络字节流。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-net) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/system b/stdlib/system new file mode 160000 index 0000000..e1c4da4 --- /dev/null +++ b/stdlib/system @@ -0,0 +1 @@ +Subproject commit e1c4da4cc5f2940604242066067cfae111b0c428 diff --git a/stdlib/system/README.md b/stdlib/system/README.md deleted file mode 100644 index 953ea07..0000000 --- a/stdlib/system/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-system - -职责为时钟、UTC、环境、进程与随机。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-system) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/stdlib/text b/stdlib/text new file mode 160000 index 0000000..9f1e862 --- /dev/null +++ b/stdlib/text @@ -0,0 +1 @@ +Subproject commit 9f1e862953f018f76bef6f35dc142a0c021154b7 diff --git a/stdlib/text/README.md b/stdlib/text/README.md deleted file mode 100644 index 1e73d30..0000000 --- a/stdlib/text/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# marqdo-std-text - -职责为Unicode 文本、字节值与 UTF-8。当前状态为 `planned`。 - -开发和验收在独立仓库进行。 [独立仓库](https://git.cflmy.cn/cflmy/marqdo-std-text) · [各仓库任务](../../docs/REPOSITORY-TASKS.md) diff --git a/tests/integration/test_layout.py b/tests/integration/test_layout.py index cfc74f6..aa9a4e7 100644 --- a/tests/integration/test_layout.py +++ b/tests/integration/test_layout.py @@ -124,9 +124,12 @@ class LayoutTests(unittest.TestCase): def git(self, *args, cwd=None): return subprocess.check_output(["git", "-C", cwd or self.root, *args]).decode() - def candidate(self, metadata=CLI, url=CORE_URL, extra=None, file=None): + def candidate(self, metadata=CLI, url=CORE_URL, extra=None, file=None, extra_url=None): (self.root / "components.toml").write_text(metadata) - (self.root / ".gitmodules").write_text(f'[submodule "cli"]\npath = cli\nurl = {url}\n') + modules = f'[submodule "cli"]\npath = cli\nurl = {url}\n' + if extra_url: + modules += f'[submodule "{extra}"]\npath = {extra}\nurl = {extra_url}\n' + (self.root / ".gitmodules").write_text(modules) self.git("add", ".gitmodules", "components.toml") self.git("update-index", "--add", "--cacheinfo", f"160000,{self.sha},cli") if extra: @@ -156,11 +159,17 @@ class LayoutTests(unittest.TestCase): with self.assertRaisesRegex(ValueError, "unexpected tracked path or mode"): layout.validate("HEAD", False) - def test_rejects_planned_gitlink(self): + def test_rejects_a_planned_gitlink_without_a_registered_remote(self): self.candidate(CLI + PLANNED, extra="stdlib/core") - with self.assertRaisesRegex(ValueError, "gitlink/catalog mismatch"): + with self.assertRaisesRegex(ValueError, "missing or invalid submodule path: stdlib/core"): layout.validate("HEAD", False) + def test_accepts_a_planned_gitlink_with_its_remote(self): + self.candidate(CLI + PLANNED, extra="stdlib/core", + extra_url="https://git.cflmy.cn/cflmy/marqdo-std-core.git") + root = layout.validate("HEAD", False)[0] + self.assertEqual(root.linked["stdlib/core"]["state"], "planned") + def test_rejects_active_dependency_on_planned(self): self.candidate(CLI.replace("requires = []", 'requires = ["std-core"]') + PLANNED) with self.assertRaisesRegex(ValueError, "active depends on planned"): @@ -325,6 +334,17 @@ class HierarchicalLayoutTests(unittest.TestCase): layout.validate("HEAD", True) layout.validate("HEAD", False) + def test_accepts_a_planned_domain_and_planned_child_gitlinks(self): + web = WEB_DOMAIN.replace('state = "active"', 'state = "planned"').replace( + 'entry = "scripts/integration.sh"\n', '') + children = DOMAIN.replace('state = "active"', 'state = "planned"').replace( + 'entry = "scripts/ci.sh"\n', '') + self.assemble(root_catalog=CLI + web, domain_catalog=children) + root, domain = layout.validate("HEAD", True) + self.assertEqual(root.linked["extensions/web"]["state"], "planned") + self.assertEqual(set(domain.linked), {"design", "preview"}) + self.assertTrue(all(child["state"] == "planned" for child in domain.linked.values())) + def test_non_checkout_mode_only_validates_the_root_layer(self): self.assemble() shutil.rmtree(self.root / "extensions" / "web") @@ -487,8 +507,9 @@ release = "base" "design": "https://git.cflmy.cn/cflmy/marqdo-ext-design.git", "preview": "https://git.cflmy.cn/cflmy/marqdo-web-preview.git", }) + shutil.rmtree(self.root / "extensions/web/design") with self.assertRaisesRegex(ValueError, "invalid submodule URL: design"): - layout.validate("HEAD", True) + layout.validate("HEAD", False, expand_domains=True) # -- global graph failures ---------------------------------------------