From 024d803494e9e8ce44cccdb90cc5fedb1c7f4d64 Mon Sep 17 00:00:00 2001 From: cflmy Date: Thu, 26 Nov 2026 13:25:35 +0800 Subject: [PATCH] test: verify installed View execution and document migration work --- docs/DEVELOPMENT.md | 2 +- docs/MIGRATION.md | 4 ++-- scripts/check-layout.py | 11 ++++++----- scripts/integration.sh | 22 ++++++++++++++++++++++ tests/integration/test_layout.py | 5 +++++ 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 3204b44..3a246e9 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -23,7 +23,7 @@ git diff --cached --submodule=log | C2 公共契约 | 真实 CLI 和 Worker、独立 Conformance 与消费者,覆盖当前协议、失败和正确身份 | | C3 生态集成 | 结构、公开冷克隆、精确 gitlink、官方基础发行、CLI Tool 和契约消费回归 | -本候选先对全部 active 组件运行集成。Woodpecker 的 `layout` 校验 Git tree,随后初始化公开直连子模块。`candidate` 用官方冻结归档验证冷安装、Conformance、View、Knowledge、Prove 和 Lint。C1 的完整构建、View 的全浏览器矩阵、Prove 的 Lean 后端以及 CLI 的 strict VM 和性能门禁沿用各组件独立流程。 +本候选先对全部 active 组件运行集成。Woodpecker 的 `layout` 校验 Git tree,随后初始化公开直连子模块。`candidate` 用官方冻结归档验证冷安装、Conformance、View、Knowledge、Prove 和 Lint。View 的集成测试包含安装、静态核验、显式执行、Observation 和移除。C1 的完整构建、View 的全浏览器矩阵、Prove 的 Lean 后端以及 CLI 的 strict VM 和性能门禁沿用各组件独立流程。 本地运行需要 Linux x86_64/glibc ≥ 2.39、Python 3.11+、jsonschema、Git、Rust、C 编译器和 curl。 diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 8bda07a..f22c99d 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -31,8 +31,8 @@ Conformance 使用 CLI 已固定的真实 fixture 提交。 | --- | --- | --- | | M0 盘点 | 自建 Git、历史标签、已有六组件和新仓位 | 通过真实远端候选持续维护台账 | | M1 集成骨架 | 六个 gitlink、布局门禁和 RC.4 组合 | 查看候选 Woodpecker 运行及各组件独立 CI | -| M2 标准库切换 | planned,CLI RC.4 提供官方完整 Bundle | CLI 接受显式外部 Bundle;九个标准库真实模块;HTTP、Regex、Archive 迁出与同步删除旧路径 | -| M3 跨仓闭环 | 工单、人工候选、同 SHA 门禁 | 以一个真实跨仓缺陷完成独立修复与消费者验收,建立通知鉴权和去重后再启用自动发起候选 | +| 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) 跟踪真实缺陷闭环、候选通知鉴权、去重和影响分析 | | 后续领域 | 空仓和预期职责 | 逐组件开展最小真实功能、独立 CI、制品与接入 | ### 标准库切换顺序 diff --git a/scripts/check-layout.py b/scripts/check-layout.py index 77ec687..69d091d 100644 --- a/scripts/check-layout.py +++ b/scripts/check-layout.py @@ -104,12 +104,13 @@ def validate(revision, checkouts): for path, item in active.items(): prefix = f"submodule.{path}." require(config.pop(prefix + "path", None) == path, f"missing or invalid submodule path: {path}") - url = config.pop(prefix + "url", "") - require(re.fullmatch(rf"https://git\.cflmy\.cn/cflmy/marqdo-{NAME}\.git", url), f"invalid submodule URL: {path}") - if item["kind"] == "stdlib": - require(url.endswith(f"/marqdo-{item['id']}.git"), f"invalid standard library repo name: {path}") + name = item["id"] if item["kind"] == "extension": - require(url.endswith(f"/marqdo-ext-{item['id']}.git"), f"invalid extension repo name: {path}") + name = f"ext-{name}" + elif item["kind"] == "test": + name = "extension-conformance" + url = config.pop(prefix + "url", "") + require(url == f"https://git.cflmy.cn/cflmy/marqdo-{name}.git", f"invalid submodule URL: {path}") if checkouts: checkout = ROOT / path sha = gitlinks[path] diff --git a/scripts/integration.sh b/scripts/integration.sh index e73b8c6..a317d9c 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -59,6 +59,28 @@ python3 cli/tools/ci/verify_extension_contracts.py \ "$MARQDO_BIN" tool install dist/marqdo-view/tool.json "$MARQDO_BIN" view verify examples/mixed-modes/index.mq.md "$MARQDO_BIN" view export examples/tables-math --out "$work/view-export" + setsid "$MARQDO_BIN" view examples/control-flow --port 0 --no-open >"$work/view-server.log" 2>&1 & + view_pid=$! + stop_view() { + kill -- "-$view_pid" 2>/dev/null || true + wait "$view_pid" 2>/dev/null || true + } + trap stop_view EXIT + view_url="" + for attempt in {1..100}; do + view_url="$(grep -m1 -o 'http://127\.0\.0\.1:[0-9]\+/' "$work/view-server.log" || true)" + if [[ -n "$view_url" ]] || ! kill -0 "$view_pid" 2>/dev/null; then + break + fi + sleep 0.1 + done + if [[ -z "$view_url" ]]; then + cat "$work/view-server.log" >&2 + exit 1 + fi + python3 scripts/acceptance-run.py "$view_url" + stop_view + trap - EXIT python3 scripts/check-observation.py stream-snapshot "$MARQDO_BIN" tool remove view if "$MARQDO_BIN" view --version; then diff --git a/tests/integration/test_layout.py b/tests/integration/test_layout.py index c1dc52c..c471d87 100644 --- a/tests/integration/test_layout.py +++ b/tests/integration/test_layout.py @@ -80,6 +80,11 @@ class LayoutTests(unittest.TestCase): with self.assertRaisesRegex(ValueError, "invalid submodule URL"): layout.validate("HEAD", False) + def test_rejects_wrong_repository_at_authority(self): + self.candidate(url="https://git.cflmy.cn/cflmy/marqdo-view.git") + with self.assertRaisesRegex(ValueError, "invalid submodule URL"): + layout.validate("HEAD", False) + def test_rejects_unstaged_checkout(self): self.candidate() with self.assertRaisesRegex(ValueError, "missing submodule checkout"):