Compare commits

...
Author SHA1 Message Date
cflmy 4e25b120af Merge branch 'codex/issue-10-ci-paths' of /tmp/marqdo-10-next/ci-policy into codex/issue-10-catalog-integration
ci/woodpecker/pr/eco Pipeline is pending
2026-11-27 21:29:13 +08:00
cflmy 3eeb574e6b ci: keep root Web composition and domain browser checks separate 2026-11-27 21:29:12 +08:00
cflmy 35234edb3f ci: reuse the existing Rust image for ecosystem candidates
ci/woodpecker/pr/eco Pipeline is running
2026-11-27 21:28:47 +08:00
cflmy e07cf9e7f1 ci: run ecosystem gates from the validated component catalog
ci/woodpecker/pr/eco Pipeline is pending
2026-11-27 21:11:37 +08:00
cflmy 69212ae01f ci: avoid redundant ecosystem runs for topic pushes and prose
ci/woodpecker/pr/eco Pipeline was canceled
2026-11-27 21:06:12 +08:00
cflmy 068f91cd31 ci: publish the web CI image and run the domain browser lane
ci/woodpecker/push/eco Pipeline is pending
ci/woodpecker/pr/eco Pipeline is pending
ci/woodpecker/manual/reconcile Pipeline was successful
ci/woodpecker/cron/reconcile Pipeline was successful
- Update ci/images/Dockerfile.web to build from Ubuntu 24.04 + Node/Playwright
  Chromium from the domestic npmmirror binary source (the MCR base pull was too
  slow) and use the full Chromium channel (headless-shell asset is absent from
  the mirror).
- Pin the Web domain to marqdo-ci-web:3.0.0-rc.5 (digest 0cccda99...) and fix the
  ext-web gitlink to its domain CI commit; pipeline 1 passed all three cases and
  the production API/Chromium E2E.
- Evidence records the image digest, pipeline result and the ghproxy/npmmirror
  mirror decision.

Refs cflmy/marqdo#10
2026-11-27 16:17:23 +08:00
9 changed files with 233 additions and 142 deletions

No files matched your search

+22 -11
View File
@@ -1,13 +1,26 @@
when:
event: [push, pull_request, manual]
- event: [pull_request, manual]
- event: push
branch: main
steps:
layout:
image: rust:1.100-bookworm
image: git.cflmy.cn/cflmy/marqdo-ci-shell:3.0.0-rc.5@sha256:8184439a201da451271f37596f4e38afeab16e044d7591853779887ef5ec28c1
commands:
- apt-get update && apt-get install -y --no-install-recommends ca-certificates git python3
- python3 scripts/check-layout.py
- python3 -m unittest discover -s tests/integration
checkouts:
image: git.cflmy.cn/cflmy/marqdo-ci-shell:3.0.0-rc.5@sha256:8184439a201da451271f37596f4e38afeab16e044d7591853779887ef5ec28c1
depends_on: [layout]
when: &needs_candidate
- event: manual
- event: [push, pull_request]
path:
# Governance, executable Markdown, packaging and unknown paths stay in scope.
exclude: [README.md, 'docs/evidence/*.md']
on_empty: true
commands:
- git submodule update --init
- |
set -eu
@@ -19,14 +32,14 @@ steps:
- python3 scripts/check-repo-conventions.py
candidate:
# Match the Linux/glibc environment already used by View for the RC.4 artifact.
image: mcr.microsoft.com/playwright:v1.49.0-noble
depends_on: [layout]
image: git.cflmy.cn/cflmy/marqdo-ci-rust:3.0.0-rc.5@sha256:73481a35339157b1a3f3b23076517e96e302fbb5158e6ffcb1582acf22c6af94
depends_on: [checkouts]
when: *needs_candidate
commands:
- |
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
if apt-get -o Acquire::By-Hash=force -o Acquire::http::Timeout=30 update --error-on=any; then
break
fi
if [ "$attempt" -eq 3 ]; then
@@ -34,8 +47,6 @@ steps:
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"
apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 install -y --no-install-recommends python3-jsonschema util-linux
unset MARQDO_BIN MARQDO_STDLIB_DIR
bash scripts/integration.sh
+24 -21
View File
@@ -1,24 +1,27 @@
# Shared Web-domain CI image: Playwright base (Node 20/Chromium, glibc 2.39),
# the published CLI/Bundle and the packaged preview web Tool. The domain runs
# its real browser acceptance without installing a Rust toolchain.
FROM mcr.microsoft.com/playwright:v1.49.0-noble
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl git python3 \
&& rm -rf /var/lib/apt/lists/*
COPY marqdo.tar.gz /tmp/marqdo.tar.gz
COPY marqdo-web-preview.tgz /tmp/marqdo-web-preview.tgz
RUN mkdir -p /opt/marqdo /opt/web-tool \
&& tar -xzf /tmp/marqdo.tar.gz -C /opt/marqdo \
&& tar -xzf /tmp/marqdo-web-preview.tgz -C /opt/web-tool --strip-components=1 \
&& rm /tmp/marqdo.tar.gz /tmp/marqdo-web-preview.tgz
ENV MARQDO_BIN=/opt/marqdo/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo \
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive \
PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \
PLAYWRIGHT_DOWNLOAD_HOST=https://cdn.npmmirror.com/binaries/playwright \
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com \
MARQDO_BIN=/opt/marqdo/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo \
MARQDO_STDLIB_DIR=/opt/marqdo/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/stdlib \
MARQDO_WEB_TOOL_JSON=/opt/web-tool/tool.json \
PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \
MARQDO_CLI_VERSION=3.0.0-rc.5
RUN test -x "$MARQDO_BIN" && "$MARQDO_BIN" --version && test -f "$MARQDO_WEB_TOOL_JSON"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl git python3 nodejs npm xz-utils unzip fonts-noto-cjk \
&& npm install -g playwright@1.49.0 \
&& npx playwright install-deps chromium \
&& curl -fsSL --retry 3 -o /tmp/chromium.zip "https://cdn.npmmirror.com/binaries/playwright/builds/chromium/1148/chromium-linux.zip" \
&& mkdir -p /ms-playwright/chromium-1148 \
&& unzip -q /tmp/chromium.zip -d /ms-playwright/chromium-1148 \
&& touch /ms-playwright/chromium-1148/INSTALLATION_COMPLETE \
&& rm /tmp/chromium.zip \
&& rm -rf /var/lib/apt/lists/*
COPY marqdo.tar.gz /tmp/marqdo.tar.gz
COPY marqdo-web-preview.tgz /tmp/web.tgz
RUN mkdir -p /opt/marqdo /opt/web-tool \
&& tar -xzf /tmp/marqdo.tar.gz -C /opt/marqdo \
&& tar -xzf /tmp/web.tgz -C /opt/web-tool --strip-components=1 \
&& rm /tmp/marqdo.tar.gz /tmp/web.tgz \
&& test -x "$MARQDO_BIN" && "$MARQDO_BIN" --version && test -f "$MARQDO_WEB_TOOL_JSON"
+4 -5
View File
@@ -7,7 +7,7 @@ container registry, per released CLI version:
| --- | --- | --- |
| `git.cflmy.cn/cflmy/marqdo-ci-shell:3.0.0-rc.5` | Ubuntu 24.04 (glibc 2.39), git/curl/python3/build tools, released CLI + Bundle (`MARQDO_BIN`/`MARQDO_STDLIB_DIR` preset) | standard library, extension, conformance and reconcile lanes |
| `git.cflmy.cn/cflmy/marqdo-ci-rust:3.0.0-rc.5` | shell image + pinned Rust 1.100 toolchain (rustfmt/clippy) + warm cargo cache | Design/Preview and Rust tool lanes |
| `git.cflmy.cn/cflmy/marqdo-ci-web:3.0.0-rc.5` (planned) | Playwright Chromium/Node + released CLI/Bundle + packaged preview web Tool | Web domain browser acceptance |
| `git.cflmy.cn/cflmy/marqdo-ci-web:3.0.0-rc.5` (digest `0cccda995d77...`) | Ubuntu 24.04 + Node/Playwright Chromium(npmmirror 二进制源)+ released CLI/Bundle + packaged preview web Tool | Web domain browser acceptance |
Rules:
@@ -16,9 +16,8 @@ Rules:
- Images are public for anonymous pull; CI never needs registry push credentials.
- Component lanes contain only their own `scripts/*` entry command. No per-repo
image variance, apt installs, Rust toolchain downloads or CLI rebuilds.
- Core CLI keeps its specialized Rust/Windows-cross gates; the root ecosystem
candidate keeps its Playwright/rustup image because it must build consumers and
run Docker archive checks. These two exceptions are documented in the
repository conventions, not copied per component.
- Core CLI keeps its specialized Rust/Windows-cross gates. The root ecosystem
candidate uses the shared Rust toolchain to build the fixed CLI/Worker/Bundle
combination. View and Web keep browser coverage in their own workflows.
- The images are CI infrastructure, not product releases; their provenance is
recorded here and in `docs/evidence/`.
+3 -1
View File
@@ -35,7 +35,9 @@ bash scripts/integration.sh # 生态候选:真实 CLI 制品 +
- 校验器读取 Git tree 中固定提交的 catalog,不以工作区改动替代候选;`--checkouts` 需要子模块已初始化,缺失、错误 HEAD、脏工作区、错误入口都明确 FAIL/UNVERIFIED,不静默跳过。CI 先验证并检出直属子模块,再用 `--domain-paths` 校验领域的子模块远端,最后逐个领域检出直属子库。
- 没有 active 领域时,新校验规则同样接受合法的直属功能组件,这不是历史协议兼容。
- 未知的 active 入口、未声明的 gitlink、目录与 catalog 不一致都必须让候选失败。`planned` 不进入验收计数。
- 当前 CI 为 `layout` 与 `candidate` 两段;统一 CLI 制品准备、声明驱动调度与递归影响分析仍在推进(见 `.woodpecker/eco.yml` 与主仓库工单),不得以本文件描述当作已实现。
- `python3 scripts/check-layout.py --active-entries` 从已验证的根与领域 checkout 输出验收计划。根集成按依赖顺序使用同一次安装的 CLI 和 Bundle 执行计划,领域验收晚于其 active 子组件。通用入口接收 `MARQDO_BIN`、`MARQDO_STDLIB_DIR` 和 `MARQDO_CI_OUT`,已有公共契约、真实 Tool 冷安装等组合门禁继续使用各自的现有入口。
- 根 Web 组合检查对该次构建的 Preview Tool 执行冷安装、`check`、`preview` 和 `handoff`。生产浏览器验收由 Web 聚合仓已有的 `scripts/domain-acceptance.sh` 负责。
- 根 `eco` 在 PR、`main` 推送和显式手动运行时执行。PR 始终保留 `layout` 状态。仅改动根 `README.md` 或 `docs/evidence/` 下的 Markdown 记录时,自动运行只执行轻量结构校验和脚本测试。混合改动、其他路径、缺失变更列表和手动运行都执行递归检出及完整生态验收。
## 三层验收
@@ -10,7 +10,7 @@
| --- | --- | --- | --- |
| `git.cflmy.cn/cflmy/marqdo-ci-shell:3.0.0-rc.5` | `sha256:8184439a201d...` | Ubuntu 24.04/glibc 2.39、git/curl/python3/build 工具、已发布 CLI+Bundle(`MARQDO_BIN`/`MARQDO_STDLIB_DIR` 预置) | stdlib、extension、conformance、reconcile |
| `git.cflmy.cn/cflmy/marqdo-ci-rust:3.0.0-rc.5` | `sha256:73481a353391...` | shell 镜像 + Rust 1.100(rustfmt/clippy)+ 预热 cargo cache | Design/Preview 与 Rust Tool |
| `git.cflmy.cn/cflmy/marqdo-ci-web:3.0.0-rc.5` | 未发布(Playwright 基础镜像拉取超时) | 计划:Playwright/Node + CLI/Bundle + 打包 preview web Tool | Web 领域浏览器验收 |
| `git.cflmy.cn/cflmy/marqdo-ci-web:3.0.0-rc.5` | `sha256:0cccda995d77...` | Ubuntu 24.04 + Node 18/Playwright 1.49 Chromium(npmmirror 二进制源,`channel: chromium`)+ CLI/Bundle + 打包 preview web Tool | Web domain 浏览器验收(pipeline 1 **success**) |
- 镜像通过 `ci/images/build.sh [--push]` 从**已发布 rc.5 CLI 归档**(sha256 固定)与固定预览包构建;标签不可变,按 CLI 版本发布;公开匿名拉取,CI 不需要 registry push 凭据。
- 单仓工作流因此只剩本仓入口命令;例如 stdlib/extension/conformance 为:
@@ -30,6 +30,7 @@
| Design / Preview(rust 镜像) | pipeline 6/7 **success** |
| knowledge / lint / prove(rust 镜像) | pipeline 22 / 12 / 17 **success** |
| View(rust 构建 + Playwright 浏览器两步) | pipeline 24 **success**(rc.5 CLI 适配) |
| Web domain(web 镜像:三案例 + 生产 API/Chromium E2E) | pipeline 1 **success** |
| 根 release 对账 | manual #71 **success**(创建 rc.5 追踪 Issue #22);cron #72 **success**(幂等 tracked) |
| 发布快速通知 | 临时 release 触发 std-text release pipeline #23 **success** → 根 manual #73 **success** 并创建追踪 Issue;测试 release/tag/Issue 已清理 |
@@ -51,7 +52,7 @@
## 未完成 / 限制
- `marqdo-ci-web` 未发布:本地拉取 Playwright 基础镜像超时;Web 领域 CI lane 与浏览器验收仍待该镜像或等价的 runner 缓存方案。当前 Web 组件已有 Design/Preview 的 Rust image lane,domain 只有入口脚本。
- `marqdo-ci-web` 已改为 Ubuntu + Node/Playwright Chromium(npmmirror 镜像源,避免 MCR 拉取超时)并发布;Web domain pipeline 1 success。ghproxy `https://ghproxy.cflmy.top` 对 GitHub 资源可用,但本轮浏览器资源使用 npmmirror,未依赖 ghproxy。
- View 已迁到 rust + Playwright 两步;knowledge/lint/prove 已迁到共享 rust 镜像。
- 组件 release 发布工作流(source archive/tool bundle 上传 + 快速通知)尚未全部落地;当前 CLI rc.5 已发布,reconcile 可追踪新发布。
- registry 镜像 digest/扫描策略、runner 拉取缓存与多架构未验证;CI 账号最小权限仍沿用现有项目 token(M0 记录限制)。
+27 -2
View File
@@ -423,18 +423,43 @@ def validate(revision, checkouts, expand_domains=False):
return layers
def active_entries(layers):
root = layers[0]
root_domains = {root.repo / path: item["id"] for path, item in root.linked.items()
if item["kind"] == "domain"}
entries = {}
requirements = {}
for layer in layers:
parent = root_domains.get(layer.repo)
for path, item in sorted(layer.linked.items()):
if item["state"] != "active":
continue
component_id = item["id"]
relative = (layer.repo / path).relative_to(root.repo).as_posix()
entries[component_id] = (component_id, item["kind"], relative, item["entry"])
requirements[component_id] = list(item["requires"])
if parent in requirements:
requirements[parent].append(component_id)
for component_id in graphlib.TopologicalSorter(requirements).static_order():
yield entries[component_id]
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("--active-entries", action="store_true", help="print validated active entries in dependency order")
paths.add_argument("--domain-paths", action="store_true", help="validate domain URLs and print domain paths")
args = parser.parse_args()
try:
revision = git("rev-parse", "--verify", args.revision + "^{commit}").strip()
layers = validate(revision, args.checkouts, expand_domains=args.domain_paths)
if args.active_paths:
layers = validate(revision, args.checkouts or args.active_entries, expand_domains=args.domain_paths)
if args.active_entries:
for entry in active_entries(layers):
print("\t".join(entry))
elif args.active_paths:
for path, component in sorted(layers[0].linked.items()):
if component["state"] == "active":
print(path)
+128 -99
View File
@@ -10,12 +10,30 @@ set -euo pipefail
cd "$(dirname "$0")/.."
root="$PWD"
active="$(python3 scripts/check-layout.py --checkouts --active-paths)"
expected=$'cli\nextensions/web\nstdlib/collections\nstdlib/data\nstdlib/fs\nstdlib/io\nstdlib/system\nstdlib/text\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
exit 1
fi
plan="$(python3 scripts/check-layout.py --active-entries)"
declare -a gates=()
cli_smoke=
while IFS=$'\t' read -r id kind path entry; do
case "$kind:$id:$entry" in
core:cli:tools/release/smoke.py) cli_smoke="$path/$entry"; gate=core ;;
stdlib:*:scripts/test.sh) gate=stdlib ;;
test:conformance:scripts/build_all.sh) gate=conformance ;;
domain:web:scripts/domain-acceptance.sh) gate=web ;;
tool:view:scripts/acceptance.sh) gate=view ;;
tool:knowledge:scripts/ci.sh) gate=knowledge ;;
tool:prove:scripts/package-tool.sh) gate=prove ;;
tool:lint:scripts/package-tool.sh) gate=lint ;;
tool:*:scripts/ci.sh|tool:*:scripts/integration.sh|extension:*:scripts/ci.sh|extension:*:scripts/integration.sh|test:*:scripts/ci.sh|test:*:scripts/integration.sh)
gate=entry
;;
*)
echo "UNVERIFIED: unsupported integration entry $id ($kind): $entry" >&2
exit 1
;;
esac
gates+=("$gate")
done <<< "$plan"
test -n "$cli_smoke"
mkdir -p .integration-work
work="$(mktemp -d "$root/.integration-work/run.XXXXXX")"
@@ -32,6 +50,7 @@ python3 --version
python3 -c 'import jsonschema'
python3 scripts/check-layout.py --checkouts > "$work/layout.txt"
cat "$work/layout.txt"
printf '%s\n' "$plan" > "$work/active-entries.tsv"
# Recursive impact analysis against the accepted root commit: the change set
# comes from the recursively expanded (global_id, parent, remote, SHA, state)
@@ -75,7 +94,7 @@ python3 cli/tools/release/package.py \
--source-sha "$source_sha" --version "$version" \
--stdlib-dir "$work/stdlib" --out-dir "$work/dist" | tee "$work/package.json"
archive="$(find "$work/dist" -maxdepth 1 -name 'marqdo-*.tar.gz' -print -quit)"
python3 cli/tools/release/smoke.py --archive "$archive"
python3 "$cli_smoke" --archive "$archive"
mkdir -p "$work/install"
tar -xzf "$archive" -C "$work/install"
installed="$(find "$work/install" -mindepth 1 -maxdepth 1 -type d -print -quit)"
@@ -85,106 +104,115 @@ test "$(cat "$installed/SOURCE_SHA")" = "$source_sha"
test "$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["version"])' "$installed/stdlib/stdlib.json")" = "$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["version"])' "$work/stdlib/stdlib.json")"
sha256sum "$archive" "$MARQDO_BIN" "$installed/marqdo-provider-worker"
# 4. Root stdlib acceptance: component entries, explicit Packages, composition
# fixtures and fail-closed negatives with the same installed CLI/Bundle.
python3 scripts/acceptance-stdlib.py \
--cli "$MARQDO_BIN" --bundle "$work/stdlib" \
--work "$work/stdlib-acceptance" --evidence "$work/stdlib-acceptance.json"
# 5. Frozen independent public-contract fixtures against the same CLI.
python3 cli/tools/ci/verify_extension_contracts.py \
--source-repo cli --tested-sha "$source_sha" --cli "$MARQDO_BIN" \
--release-info "$installed/RELEASE_INFO.json" \
--fixtures tests/conformance --out "$work/conformance.json"
# 5.5 Web domain: component entries from the pinned domain gitlink, then a cold
# install of the same-built web Tool with a generic check/preview/handoff run.
# Tool consumers use the same candidate installation and the catalog order.
# The candidate image uses a minimal Rust profile; component entries run
# fmt/clippy, so add those components once when the active toolchain lacks them.
if command -v rustup >/dev/null 2>&1 \
&& ! rustup component list --installed 2>/dev/null | grep -qx 'rustfmt.*'; then
rustup component add rustfmt clippy
fi
(
cd extensions/web/design
MARQDO_BIN="$MARQDO_BIN" scripts/ci.sh
)
(
cd extensions/web/preview
MARQDO_BIN="$MARQDO_BIN" scripts/ci.sh
)
web_tool="$root/extensions/web/preview/dist/marqdo-web-preview/tool.json"
test -f "$web_tool"
export MARQDO_TOOL_HOME="$work/web-tool-home"
cli_before="$(sha256sum "$MARQDO_BIN" | cut -d' ' -f1)"
"$MARQDO_BIN" tool install "$web_tool"
"$MARQDO_BIN" web check extensions/web/examples/research-workspace/index.mq.md \
--unit 工作台 --root extensions/web/examples/research-workspace
"$MARQDO_BIN" web preview extensions/web/examples/research-workspace/index.mq.md \
--unit 工作台 --root extensions/web/examples/research-workspace --out "$work/web-preview"
test -f "$work/web-preview/index.html"
"$MARQDO_BIN" web handoff extensions/web/examples/research-workspace/index.mq.md \
--unit 工作台 --root extensions/web/examples/research-workspace --out "$work/web-handoff.md"
test -s "$work/web-handoff.md"
"$MARQDO_BIN" tool remove web
cli_after="$(sha256sum "$MARQDO_BIN" | cut -d' ' -f1)"
test "$cli_before" = "$cli_after"
echo "web domain: component entries + cold Tool install PASS"
# 6. Existing consumers, same installed binary and adjacent Bundle.
(
cd tools/view
export MARQDO_TOOL_HOME="$work/view-registry"
scripts/package.sh
"$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
echo "view still dispatches after removal" >&2
exit 1
fi
)
(
cd tools/knowledge
MARQDO_TEST_BIN="$MARQDO_BIN" cargo test --locked --test core_cli --test compile
)
(
cd tools/prove
cargo test --locked --test analysis_document --test document_contract
)
(
cd tools/lint
export MARQDO_TOOL_HOME="$work/lint-registry"
scripts/package-tool.sh "$work/lint"
"$MARQDO_BIN" tool install "$work/lint/tool.json"
"$MARQDO_BIN" lint examples/nested/inventory.mq.md --format json
"$MARQDO_BIN" tool remove lint
run_consumer() (
cd "$root/$path"
export MARQDO_CI_OUT="$work/components/$id"
mkdir -p "$MARQDO_CI_OUT"
case "$gate" in
entry)
MARQDO_STDLIB_DIR="$installed/stdlib" "./$entry"
;;
web)
web_tool="$PWD/preview/dist/marqdo-web-preview/tool.json"
export MARQDO_TOOL_HOME="$MARQDO_CI_OUT/tool-home"
cli_before="$(sha256sum "$MARQDO_BIN")"
"$MARQDO_BIN" tool install "$web_tool"
example=examples/research-workspace
"$MARQDO_BIN" web check "$example/index.mq.md" --unit 工作台 --root "$example"
"$MARQDO_BIN" web preview "$example/index.mq.md" --unit 工作台 --root "$example" \
--out "$MARQDO_CI_OUT/preview"
test -s "$MARQDO_CI_OUT/preview/index.html"
"$MARQDO_BIN" web handoff "$example/index.mq.md" --unit 工作台 --root "$example" \
--out "$MARQDO_CI_OUT/handoff.md"
test -s "$MARQDO_CI_OUT/handoff.md"
"$MARQDO_BIN" tool remove web
test "$(sha256sum "$MARQDO_BIN")" = "$cli_before"
;;
view)
export MARQDO_TOOL_HOME="$work/view-registry"
scripts/package.sh
"$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
echo "view still dispatches after removal" >&2
exit 1
fi
;;
knowledge)
MARQDO_TEST_BIN="$MARQDO_BIN" cargo test --locked --test core_cli --test compile
;;
prove)
cargo test --locked --test analysis_document --test document_contract
;;
lint)
export MARQDO_TOOL_HOME="$work/lint-registry"
"./$entry" "$work/lint"
"$MARQDO_BIN" tool install "$work/lint/tool.json"
"$MARQDO_BIN" lint examples/nested/inventory.mq.md --format json
"$MARQDO_BIN" tool remove lint
;;
esac
)
stdlib_accepted=false
index=0
while IFS=$'\t' read -r -u 3 id kind path entry; do
gate="${gates[index]}"
index=$((index + 1))
echo "candidate gate: $id ($path/$entry)"
case "$gate" in
core) ;; # CLI/Worker packaging and smoke ran before consumer gates.
stdlib)
if [ "$stdlib_accepted" = false ]; then
python3 scripts/acceptance-stdlib.py \
--cli "$MARQDO_BIN" --bundle "$work/stdlib" \
--work "$work/stdlib-acceptance" --evidence "$work/stdlib-acceptance.json"
stdlib_accepted=true
fi
;;
conformance)
python3 cli/tools/ci/verify_extension_contracts.py \
--source-repo cli --tested-sha "$source_sha" --cli "$MARQDO_BIN" \
--release-info "$installed/RELEASE_INFO.json" \
--fixtures "$path" --out "$work/conformance.json"
;;
*) run_consumer ;;
esac
done 3<<< "$plan"
# 7. Evidence identity for the accepted candidate.
root_commit="$(git rev-parse HEAD)"
python3 - "$work" "$root_commit" "$source_sha" "$bundle_digest" "$bundle_aliases" "$archive" <<'PY'
@@ -202,6 +230,7 @@ evidence = {
"stdlib_aliases_digest": sys.argv[5],
"archive": archive.name,
"archive_sha256": "sha256:" + hashlib.sha256(archive.read_bytes()).hexdigest(),
"active_entries": [line.split("\t") for line in (work / "active-entries.tsv").read_text().splitlines()],
"impact": (
{
"changed": impact["changed"],
+21
View File
@@ -334,6 +334,27 @@ class HierarchicalLayoutTests(unittest.TestCase):
layout.validate("HEAD", True)
layout.validate("HEAD", False)
def test_active_entries_use_the_dependency_order_and_include_a_new_leaf(self):
design = self.leaf("design")
catalog_text = DOMAIN.replace('state = "planned"', 'state = "active"').replace(
'checks_with = ["web-preview"]\nrelease = "optional"',
'checks_with = ["web-preview"]\nrelease = "optional"\nentry = "scripts/ci.sh"',
)
self.assemble(domain_catalog=catalog_text, design=design,
extra_domain_link=("components", design[1]), domain_modules={
"design": "https://git.cflmy.cn/cflmy/marqdo-web-design.git",
"preview": "https://git.cflmy.cn/cflmy/marqdo-web-preview.git",
"components": "https://git.cflmy.cn/cflmy/marqdo-web-components.git",
})
layers = layout.validate("HEAD", True)
entries = list(layout.active_entries(layers))
ids = [entry[0] for entry in entries]
self.assertIn(("web-components", "extension", "extensions/web/components", "scripts/ci.sh"), entries)
self.assertLess(ids.index("cli"), ids.index("web-design"))
self.assertLess(ids.index("web-design"), ids.index("web-preview"))
self.assertLess(ids.index("web-components"), ids.index("web"))
self.assertEqual(set(ids), {"cli", "web", "web-design", "web-preview", "web-components"})
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', '')