Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb1d967989 | ||
|
|
13f89f758d | ||
|
|
39e83554d7 | ||
|
|
3db45b6024 | ||
|
|
48e5309358 |
No files matched your search
@@ -6,3 +6,4 @@
|
||||
*.swp
|
||||
.DS_Store
|
||||
.cargo-home/
|
||||
dist/
|
||||
@@ -1,36 +0,0 @@
|
||||
# The published rc.4 CLI needs glibc 2.39. Use the matching Playwright image
|
||||
# so the installed-tool tests get both Ubuntu Noble and Chromium.
|
||||
when:
|
||||
- event: [pull_request, manual]
|
||||
- event: push
|
||||
branch: master
|
||||
|
||||
steps:
|
||||
no-legacy:
|
||||
image: mcr.microsoft.com/playwright:v1.49.0-noble
|
||||
commands:
|
||||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends ca-certificates curl git
|
||||
- scripts/check-no-legacy.sh
|
||||
- scripts/check-docs.sh
|
||||
|
||||
frozen-acceptance:
|
||||
image: mcr.microsoft.com/playwright:v1.49.0-noble
|
||||
environment:
|
||||
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
|
||||
RUST_MIN_STACK: "8388608"
|
||||
CI: "true"
|
||||
CI_SYSTEM: woodpecker
|
||||
commands:
|
||||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends build-essential ca-certificates curl git python3
|
||||
- curl -fsSL --retry 3 https://sh.rustup.rs -o /tmp/marqdo-view-rustup.sh
|
||||
- sh /tmp/marqdo-view-rustup.sh -y --profile minimal --default-toolchain 1.89.0 --component rustfmt --component clippy --no-modify-path
|
||||
- export PATH="$HOME/.cargo/bin:$PATH"
|
||||
- (cd tests/browser && npm ci --no-audit --no-fund)
|
||||
- |
|
||||
frozen_dir="$(mktemp -d)"
|
||||
MARQDO_BIN="$(scripts/frozen-beta.sh fetch "$frozen_dir")"
|
||||
export MARQDO_BIN
|
||||
scripts/acceptance.sh
|
||||
cat docs/evidence/452e9a32bd9e40dba427d4180691c58bab74449e/manifest.json
|
||||
@@ -0,0 +1,34 @@
|
||||
# Unified Woodpecker CI for marqdo-view.
|
||||
#
|
||||
# Rust build/non-browser acceptance reuses the shared rust image; the real
|
||||
# Chromium suite runs in the matching Playwright image against the binary built
|
||||
# in the previous step. No per-run rustup install.
|
||||
when:
|
||||
event: [push, pull_request, manual]
|
||||
|
||||
steps:
|
||||
build-acceptance:
|
||||
image: git.cflmy.cn/cflmy/marqdo-ci-rust:3.0.0-rc.5
|
||||
commands:
|
||||
- cargo fmt --all -- --check
|
||||
- cargo clippy --all-targets --locked -- -D warnings
|
||||
- cargo test --locked
|
||||
- cargo build --release --locked
|
||||
- SKIP_BROWSER=1 scripts/acceptance.sh
|
||||
|
||||
browser:
|
||||
depends_on: [build-acceptance]
|
||||
image: mcr.microsoft.com/playwright:v1.49.0-noble
|
||||
environment:
|
||||
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
|
||||
commands:
|
||||
- (cd tests/browser && npm ci --no-audit --no-fund)
|
||||
- |
|
||||
set -eu
|
||||
curl -fsSL --retry 3 -o /tmp/marqdo.tar.gz "https://git.cflmy.cn/cflmy/marqdo-cli/releases/download/v3.0.0-rc.5/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu.tar.gz"
|
||||
echo "fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b /tmp/marqdo.tar.gz" | sha256sum -c -
|
||||
mkdir -p /opt/marqdo
|
||||
tar -xzf /tmp/marqdo.tar.gz -C /opt/marqdo
|
||||
export MARQDO_BIN=/opt/marqdo/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo
|
||||
"$MARQDO_BIN" --version
|
||||
./scripts/test-browser.sh
|
||||
@@ -0,0 +1,60 @@
|
||||
when:
|
||||
- event: [tag, manual]
|
||||
|
||||
steps:
|
||||
publish:
|
||||
image: git.cflmy.cn/cflmy/marqdo-ci-rust:3.0.0-rc.5
|
||||
environment:
|
||||
GITEA_PUBLISH_TOKEN:
|
||||
from_secret: gitea_publish_token
|
||||
COMPONENT_ID: view
|
||||
REPOSITORY: cflmy/marqdo-view
|
||||
commands:
|
||||
- |
|
||||
set -eu
|
||||
test -n "${GITEA_PUBLISH_TOKEN:?}"
|
||||
test -n "${CI_COMMIT_TAG:?}"
|
||||
export SOURCE_SHA="${CI_COMMIT_SHA}"
|
||||
export VERSION="${CI_COMMIT_TAG#v}"
|
||||
export COMPONENT_ID=view
|
||||
export REPOSITORY=cflmy/marqdo-view
|
||||
# Build tool artifacts when the package entry exists; always emit source archive + evidence.
|
||||
if [ -x scripts/package.sh ] || [ -f scripts/package.sh ]; then
|
||||
scripts/package.sh || true
|
||||
fi
|
||||
sh scripts/package.sh
|
||||
ARCHIVE="dist/marqdo-view-${VERSION}-source.tar.gz"
|
||||
ASSETS="--asset $ARCHIVE --asset ${ARCHIVE}.sha256 --asset dist/release-evidence.json"
|
||||
for extra in dist/*.tar.gz dist/*.sha256 dist/RELEASE_INFO.json dist/tool.json; do
|
||||
[ -f "$extra" ] || continue
|
||||
case "$extra" in
|
||||
$ARCHIVE|${ARCHIVE}.sha256|dist/release-evidence.json) continue ;;
|
||||
esac
|
||||
ASSETS="$ASSETS --asset $extra"
|
||||
done
|
||||
# Rebuild evidence including any extra packaged assets.
|
||||
EXTRA_ARGS=""
|
||||
for extra in dist/*.tar.gz dist/*.sha256 dist/RELEASE_INFO.json dist/tool.json; do
|
||||
[ -f "$extra" ] || continue
|
||||
case "$extra" in
|
||||
$ARCHIVE|${ARCHIVE}.sha256|dist/release-evidence.json) continue ;;
|
||||
esac
|
||||
EXTRA_ARGS="$EXTRA_ARGS --asset $extra"
|
||||
done
|
||||
python3 scripts/release/write_evidence.py \
|
||||
--component-id view \
|
||||
--repository cflmy/marqdo-view \
|
||||
--tag "${CI_COMMIT_TAG}" \
|
||||
--source-sha "$SOURCE_SHA" \
|
||||
--asset "$ARCHIVE" \
|
||||
--asset "${ARCHIVE}.sha256" \
|
||||
$EXTRA_ARGS \
|
||||
--out dist/release-evidence.json
|
||||
python3 scripts/release/publish_gitea.py \
|
||||
--repo cflmy/marqdo-view \
|
||||
--tag "${CI_COMMIT_TAG}" \
|
||||
--target "$SOURCE_SHA" \
|
||||
--prerelease \
|
||||
--body "Automated release for view ${CI_COMMIT_TAG}." \
|
||||
$ASSETS \
|
||||
--evidence-out dist/gitea-publish-result.json
|
||||
@@ -0,0 +1,16 @@
|
||||
when:
|
||||
event: [release]
|
||||
|
||||
steps:
|
||||
notify:
|
||||
image: git.cflmy.cn/cflmy/marqdo-ci-shell:3.0.0-rc.5
|
||||
environment:
|
||||
WOODPECKER_NOTIFY_TOKEN:
|
||||
from_secret: woodpecker_notify_token
|
||||
commands:
|
||||
- |
|
||||
set -eu
|
||||
test -n "${WOODPECKER_NOTIFY_TOKEN:?woodpecker_notify_token secret missing}"
|
||||
python3 scripts/release/notify_root.py \
|
||||
--hint-component "view" \
|
||||
--hint-tag "${CI_COMMIT_TAG:-}"
|
||||
@@ -0,0 +1,37 @@
|
||||
<!-- marqdo:repo-conventions v1 -->
|
||||
# AGENTS.md — view
|
||||
|
||||
全局规范唯一来源:[marqdo 仓库开发规范](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/REPOSITORY-CONVENTIONS.md)。本文件只写本仓边界,不复制全局规范或合同正文。
|
||||
|
||||
## 1. 本仓定位与唯一权威
|
||||
|
||||
- catalog ID:`view`;父级:根;角色:tool;状态:active。
|
||||
- 职责/本仓拥有:独立文档阅读器与静态导出;消费公开 Analysis 3/Observation 1 的展示层
|
||||
- 本仓不拥有:Markdown/语言 parser、设计解释、CLI 版本选择、其它 Tool 的业务
|
||||
- 权威输入/合同:CLI 公开 Analysis 3/Observation 1;`MARQDO_BIN` 绝对路径与制品身份
|
||||
|
||||
## 2. 必做 / 禁止
|
||||
|
||||
| 必做 | 禁止 |
|
||||
| --- | --- |
|
||||
| 只在本仓职责内修改,先开本仓工单 | 实现其它仓库功能,复制 parser/实现/合同 |
|
||||
| 用真实 CLI/制品与独立期望测试 | mock、字符串检查或原型冒充真实验收/PASS |
|
||||
| 依赖使用固定 SHA/摘要与显式输入 | 依赖父仓 checkout、兄弟仓相对路径、浮动分支 |
|
||||
| 未运行写 `UNVERIFIED` | 伪造 entry/版本/CI 徽章/gitlink/发布资产 |
|
||||
| 记录 SHA、制品摘要、平台、命令、退出码 | 提交密钥、凭证、构建产物或本地绝对路径 |
|
||||
| 跨仓变更走 C2 → B2 → A2 晋升 | 自动 tag/release/合并,或直接改父仓/兄弟仓 |
|
||||
|
||||
- 不新增第二 catalog/manifest/lock/版本表/发布流程;不为单功能拆仓或建空壳仓。
|
||||
- 不在本仓登记其它仓库后代路径;治理树最多两级 gitlink。
|
||||
|
||||
## 3. 构建、测试与证据
|
||||
|
||||
- CI/验收入口:`scripts/acceptance.sh`(非交互、失败非零、不打印秘密、只写声明输出;构建与发布权限分离)。
|
||||
- 输入与依赖:CLI 公开 Analysis 3/Observation 1;`MARQDO_BIN` 绝对路径与制品身份
|
||||
- 交付:Tool bundle + `tool.json` 与安装/运行/卸载证据
|
||||
- 证据:候选 SHA、依赖/制品 SHA-256、平台/工具链、命令与退出码、日志位置、测试范围;FAIL/UNVERIFIED 不得写成 PASS。
|
||||
|
||||
## 4. 工单路由
|
||||
|
||||
- 公共协议/字段缺失 → `marqdo-cli`;阅读/导出行为 → 本仓。
|
||||
- 不复制 CLI 内部 crate 或私有输出;不新增 CLI 语法。
|
||||
+10
-1
@@ -37,7 +37,16 @@ old code paths, fixtures and documents were replaced, not branched.
|
||||
docs. Historical evidence and ADRs are exempt.
|
||||
- `scripts/check-docs.sh` (G12): README/COMPATIBILITY/CHANGELOG/STATUS/ACCEPTANCE
|
||||
must describe the rc.4 baseline; old CHANGELOG entries are allowed only under
|
||||
the explicit `## History` heading.
|
||||
the explicit `## Current acceptance baseline (0.3.0)
|
||||
|
||||
- Frozen CLI pin moved to the published `marqdo 3.0.0-rc.5` release
|
||||
(source `c44b0f943875d563bb7c170f8ccd3fd56a82360f`, archive
|
||||
`fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b`, binary
|
||||
`a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee`).
|
||||
Analysis v3 / Observation v1 / Tool revision 1 are unchanged; this is a
|
||||
release-line update, not a protocol change.
|
||||
|
||||
## History` heading.
|
||||
- `scripts/check-observation.py`: machine probes for stream/snapshot
|
||||
equivalence, truncation, exact Analysis binding and fail-closed retired input.
|
||||
- `docs/architecture/observation-v1-and-analysis-v3.md`: final layering
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@
|
||||
| 轴 | 本 View 值 | 说明 |
|
||||
|---|---|---|
|
||||
| View 产品版本 | `0.3.0` | 独立 SemVer,与 CLI 不共用 |
|
||||
| `marqdo` 产品范围 | `>=3.0.0-rc.3,<4.0.0` | 预发布契约只在 rc.3 起有意义;验收固定 `3.0.0-rc.4` |
|
||||
| `marqdo` 产品范围 | `>=3.0.0-rc.3,<4.0.0` | 预发布契约只在 rc.3 起有意义;验收固定 `3.0.0-rc.5` |
|
||||
| CLI Tool revision | `1` | `tool.json`:`requires.api_revision = 1`,无 `compatibility` 字段 |
|
||||
| Analysis revision | `3` | `marqdo.analysis`,ADR-0069 公共边界(含 source/document/anchors/references/heading_span) |
|
||||
| Observation revision | `1` | `marqdo.observation`,单一事件序列(JSONL 流 / 原子快照) |
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
`3.0.0-rc.3,<4.0.0` 是当前预发布范围;`>=3.0.0,<4.0.0` 不匹配任何 rc 预发布版。
|
||||
验收与证据只认绑定 CLI 源码 SHA / 归档 SHA / 二进制 SHA 的结果:
|
||||
`marqdo 3.0.0-rc.4`,源码 `452e9a32bd9e40dba427d4180691c58bab74449e`,
|
||||
归档 `9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8`,
|
||||
二进制 `a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e`。
|
||||
`marqdo 3.0.0-rc.5`,源码 `c44b0f943875d563bb7c170f8ccd3fd56a82360f`,
|
||||
归档 `fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b`,
|
||||
二进制 `a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee`。
|
||||
|
||||
## 契约替换(0.3.0 一次性完成)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
| 平台 | 状态 | 说明 |
|
||||
|---|---|---|
|
||||
| Linux x86_64 (glibc 2.39+) | **Supported** | 完整阅读、显式运行与导出使用官方 rc.4 验收;媒体需要 Linux 5.6+ |
|
||||
| Linux x86_64 (glibc 2.39+) | **Supported** | 完整阅读、显式运行与导出使用官方 rc.5 验收;媒体需要 Linux 5.6+ |
|
||||
| Linux aarch64 | 未构建 | 未验证 |
|
||||
| macOS / Windows | 未验证 | 不声明支持 |
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ Observation revision 1——附着回原文,而不是把文档翻译成另一
|
||||
- 冻结 CLI 合同审计:[`docs/audits/protocol-contract-0002.md`](docs/audits/protocol-contract-0002.md)
|
||||
- 兼容性:[`COMPATIBILITY.md`](COMPATIBILITY.md) / 变更:[`CHANGELOG.md`](CHANGELOG.md)
|
||||
|
||||
> 0.3.0 只支持当前预发布契约:`marqdo 3.0.0-rc.4`(产品范围
|
||||
> `>=3.0.0-rc.3,<4.0.0`;验收固定 rc.4)。静态语义只有一个来源
|
||||
> 0.3.0 只支持当前预发布契约:`marqdo 3.0.0-rc.5`(产品范围
|
||||
> `>=3.0.0-rc.3,<4.0.0`;验收固定 rc.5)。静态语义只有一个来源
|
||||
> `check --emit`(Analysis revision 3,含精确 source、Markdown AST、heading 作用域、
|
||||
> anchors 与状态化 references);运行事实只有一条 Observation revision 1 事件序列
|
||||
> (`run`/`call --output jsonl`,原子快照 `--observation-file`)。旧格式显式拒绝,
|
||||
@@ -22,7 +22,7 @@ Observation revision 1——附着回原文,而不是把文档翻译成另一
|
||||
|
||||
## 能力(0.3.0 实现范围)
|
||||
|
||||
> 下表的“实现”表示当前代码路径按 rc.4 契约实现;`PASS/FAIL/UNVERIFIED` 的机器
|
||||
> 下表的“实现”表示当前代码路径按 rc.5 契约实现;`PASS/FAIL/UNVERIFIED` 的机器
|
||||
> 验收结论只以 [`docs/evidence/`](docs/evidence/README.md) 中绑定 CLI 源码 SHA 的
|
||||
> manifest 为准。new manifest 生成前,全部发布门禁在 STATUS 中保持 `UNVERIFIED`。
|
||||
|
||||
@@ -50,9 +50,9 @@ Observation revision 1——附着回原文,而不是把文档翻译成另一
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
# 1) 取得官方冻结 CLI 发布包(验收固定 3.0.0-rc.4)
|
||||
MARQDO_BIN=/absolute/path/to/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo
|
||||
"$MARQDO_BIN" --version # marqdo 3.0.0-rc.4
|
||||
# 1) 取得官方冻结 CLI 发布包(验收固定 3.0.0-rc.5)
|
||||
MARQDO_BIN=/absolute/path/to/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo
|
||||
"$MARQDO_BIN" --version # marqdo 3.0.0-rc.5
|
||||
|
||||
# 2) 构建并制作 CLI Tool revision 1 bundle
|
||||
./scripts/package.sh
|
||||
@@ -135,7 +135,7 @@ scripts/check-no-legacy.sh # G01:当前树 0 条旧契约残留(cmd 可单
|
||||
scripts/check-docs.sh # G12:当前文档不把旧格式写成当前能力
|
||||
```
|
||||
|
||||
全链路验收使用 Rust 1.89 或更新版本,以及能运行官方 rc.4 的 Linux x86_64
|
||||
全链路验收使用 Rust 1.89 或更新版本,以及能运行官方 rc.5 的 Linux x86_64
|
||||
环境(glibc 2.39 起)。浏览器、显式运行和离线导出通过已安装的 Tool 执行。
|
||||
|
||||
```bash
|
||||
@@ -143,7 +143,7 @@ scripts/check-docs.sh # G12:当前文档不把旧格式写成当前能
|
||||
MARQDO_BIN="$(./scripts/frozen-beta.sh fetch "$(mktemp -d)")"
|
||||
export MARQDO_BIN
|
||||
./scripts/acceptance.sh # G01–G12,写 docs/evidence/452e9a32…/manifest.json
|
||||
cat docs/evidence/452e9a32bd9e40dba427d4180691c58bab74449e/manifest.json
|
||||
cat docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/manifest.json
|
||||
```
|
||||
|
||||
验收会核对 CLI 源码 SHA、归档 SHA-256 与二进制 SHA-256,并在前后两次记录 CLI 摘要。
|
||||
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
# 验收状态(marqdo-view 0.3.0 / rc.4 契约)
|
||||
# 验收状态(marqdo-view 0.3.0 / rc.5 契约)
|
||||
|
||||
> 本文件定义**当前**验收基线,不代替机器证据。`PASS/FAIL/UNVERIFIED` 只以
|
||||
> `docs/evidence/<CLI-SOURCE-SHA>/manifest.json` 为准;manifest 生成前,全部
|
||||
@@ -12,10 +12,10 @@
|
||||
| View 源码提交 | manifest 生成时的 `git rev-parse HEAD` |
|
||||
| View release 二进制 SHA-256 | `dist/marqdo-view/bin/marqdo-view`,`sha256:` 前缀 |
|
||||
| View Tool 包摘要 | bundle 内规范化 `SHA256SUMS` 字节的 SHA-256,`sha256:` 前缀 |
|
||||
| 冻结 CLI 版本 | `3.0.0-rc.4` |
|
||||
| 冻结 CLI 源码 SHA | `452e9a32bd9e40dba427d4180691c58bab74449e` |
|
||||
| 冻结 CLI 归档 SHA-256 | `sha256:9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8` |
|
||||
| 冻结 CLI 二进制 SHA-256 | `sha256:a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e` |
|
||||
| 冻结 CLI 版本 | `3.0.0-rc.5` |
|
||||
| 冻结 CLI 源码 SHA | `c44b0f943875d563bb7c170f8ccd3fd56a82360f` |
|
||||
| 冻结 CLI 归档 SHA-256 | `sha256:fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b` |
|
||||
| 冻结 CLI 二进制 SHA-256 | `sha256:a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee` |
|
||||
| 平台 | `linux-x86_64-glibc2.39` |
|
||||
| Markdown profile | `marqdo.md.v1` |
|
||||
| 生成时间 | UTC ISO-8601 |
|
||||
@@ -25,7 +25,7 @@ manifest schema:`marqdo.view.acceptance`,`schema_version: 1`。结构见
|
||||
[`docs/evidence/README.md`](evidence/README.md)。生成命令:
|
||||
|
||||
```bash
|
||||
export MARQDO_BIN=/abs/unpacked/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo
|
||||
export MARQDO_BIN=/abs/unpacked/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo
|
||||
scripts/check-no-legacy.sh
|
||||
scripts/check-docs.sh
|
||||
scripts/acceptance.sh # 生成 docs/evidence/452e9a32…/manifest.json + dist/acceptance/manifest.json
|
||||
@@ -33,13 +33,13 @@ scripts/acceptance.sh # 生成 docs/evidence/452e9a32…/manifest.json +
|
||||
|
||||
## 1. P0 发布门禁(G01–G12)
|
||||
|
||||
当前状态:**G01–G12 全部 `PASS`**(manifest `docs/evidence/452e9a32bd9e40dba427d4180691c58bab74449e/manifest.json`,`result: PASS`;View 源码提交 `340ecb035fbde0a825c1e5edf1d28b41342d1002`;远端 Woodpecker pipeline #10 对同一 SHA 成功)。
|
||||
当前状态:**G01–G12 全部 `PASS`**(manifest `docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/manifest.json`,`result: PASS`;View 源码提交 `340ecb035fbde0a825c1e5edf1d28b41342d1002`;远端 Woodpecker pipeline #10 对同一 SHA 成功)。
|
||||
|
||||
| # | 门禁 | 命令 / 方式 | 通过判据 | 当前 |
|
||||
|---|---|---|---|---|
|
||||
| G01 | 协议层无旧契约残留 | `scripts/check-no-legacy.sh` | 0 命中 | `PASS` |
|
||||
| G02 | 构建与静态检查 | `cargo fmt --all -- --check && cargo clippy --locked --all-targets -- -D warnings && cargo test --locked && cargo build --release --locked` | 全部 exit 0,记录测试数 | `PASS` |
|
||||
| G03 | rc.4 归档独立安装 | `scripts/package.sh` + 归档解包安装 + `scripts/install-smoke.sh` | `tool list` 含 `view`;`view --help` exit 0;`MARQDO_API_REVISION=1` 注入;CLI SHA 前后不变;篡改拒绝 | `PASS` |
|
||||
| G03 | rc.5 归档独立安装 | `scripts/package.sh` + 归档解包安装 + `scripts/install-smoke.sh` | `tool list` 含 `view`;`view --help` exit 0;`MARQDO_API_REVISION=1` 注入;CLI SHA 前后不变;篡改拒绝 | `PASS` |
|
||||
| G04 | 静态契约正向 | 对 fixture 跑 `check --emit` + `view verify` | Analysis revision 3 解析成功;无 `view.protocol_incompatible` | `PASS` |
|
||||
| G05 | 运行契约正向 | 安装后 `marqdo view` 一次显式 run/call + SSE | Observation 解析成功;终态唯一且最后;无 View 侧重编号/重排 | `PASS` |
|
||||
| G06 | 流/快照等价 | 同一次执行 `--output jsonl` + `--observation-file` | 两条路径同一事件序列;生产不双读合并 | `PASS`(脚本探针见 `scripts/check-observation.py stream-snapshot`) |
|
||||
@@ -56,7 +56,7 @@ scripts/acceptance.sh # 生成 docs/evidence/452e9a32…/manifest.json +
|
||||
|
||||
| ID | 场景 | 期望 | 当前 |
|
||||
|---|---|---|---|
|
||||
| E01 | Tool 安装/分发/卸载(rc.4 归档) | 安装成功;分发 `view`;退出码透传;卸载后分发失败 | `PASS` |
|
||||
| E01 | Tool 安装/分发/卸载(rc.5 归档) | 安装成功;分发 `view`;退出码透传;卸载后分发失败 | `PASS` |
|
||||
| E02 | 打开含 `@knowledge` 的文档 | 不执行;无 run 调用 | `PASS` |
|
||||
| E03 | Source/Document 切换 | 字节保真;span 来自 Analysis revision 3 | `PASS` |
|
||||
| E04 | 中文/Emoji/表格/公式 | span 按模块原始 UTF-8 半开字节解释;不越界 | `PASS` |
|
||||
@@ -111,14 +111,14 @@ scripts/acceptance.sh # 生成 docs/evidence/452e9a32…/manifest.json +
|
||||
## 5. 复现
|
||||
|
||||
```bash
|
||||
export MARQDO_BIN=/abs/unpacked/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo
|
||||
sha256sum "$MARQDO_BIN" # a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e
|
||||
export MARQDO_BIN=/abs/unpacked/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo
|
||||
sha256sum "$MARQDO_BIN" # a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee
|
||||
scripts/frozen-beta.sh verify "$MARQDO_BIN"
|
||||
scripts/check-no-legacy.sh
|
||||
scripts/check-docs.sh
|
||||
cargo fmt --all -- --check && cargo clippy --locked --all-targets -- -D warnings && cargo test --locked
|
||||
scripts/acceptance.sh
|
||||
cat docs/evidence/452e9a32bd9e40dba427d4180691c58bab74449e/manifest.json
|
||||
cat docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/manifest.json
|
||||
```
|
||||
|
||||
单项:
|
||||
@@ -147,4 +147,4 @@ MARQDO_BIN=... scripts/test-browser.sh
|
||||
|
||||
`0.2.0`(2026-11-22)按旧预发布契约完成过阅读/执行/导出验收,证据保留在
|
||||
`docs/evidence/2c7c4f31…/`、`docs/evidence/issue-2/`、`docs/evidence/issue-3/`、
|
||||
`docs/evidence/PR-01..PR-06/`。这些结果只记录历史,**不能**替代 rc.4 门禁。
|
||||
`docs/evidence/PR-01..PR-06/`。这些结果只记录历史,**不能**替代 rc.5 门禁。
|
||||
+11
-11
@@ -1,7 +1,7 @@
|
||||
# marqdo-view 现状(STATUS)
|
||||
|
||||
> 最后更新:2026-11-25。当前目标:`marqdo-view 0.3.0`,只支持
|
||||
> `marqdo 3.0.0-rc.4` 的公开契约(adaptation #4,验收 #5,公共 Analysis 边界 #6)。
|
||||
> `marqdo 3.0.0-rc.5` 的公开契约(adaptation #4,验收 #5,公共 Analysis 边界 #6)。
|
||||
> 机器证据只认绑定 CLI 源码 SHA 的 manifest;未生成的证据一律 `UNVERIFIED`。
|
||||
|
||||
## 版本与基线
|
||||
@@ -9,18 +9,18 @@
|
||||
| 项 | 值 |
|
||||
|---|---|
|
||||
| View 产品版本 | `0.3.0` |
|
||||
| 产品范围 | `>=3.0.0-rc.3,<4.0.0`;验收固定 `3.0.0-rc.4` |
|
||||
| 产品范围 | `>=3.0.0-rc.3,<4.0.0`;验收固定 `3.0.0-rc.5` |
|
||||
| CLI Tool | revision 1:`requires {api_revision: 1, analysis: 3, observation: 1}`,无 `compatibility` |
|
||||
| 静态语义 | Analysis revision 3(`marqdo.analysis`,ADR-0069 公共边界) |
|
||||
| 运行事实 | Observation revision 1(`marqdo.observation`,单一事件序列) |
|
||||
| Markdown profile | `marqdo.md.v1` |
|
||||
| 冻结 CLI 版本 | `marqdo 3.0.0-rc.4` |
|
||||
| CLI 源码 SHA | `452e9a32bd9e40dba427d4180691c58bab74449e` |
|
||||
| CLI 归档 SHA-256 | `9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8` |
|
||||
| CLI 二进制 SHA-256 | `a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e` |
|
||||
| 冻结 CLI 版本 | `marqdo 3.0.0-rc.5` |
|
||||
| CLI 源码 SHA | `c44b0f943875d563bb7c170f8ccd3fd56a82360f` |
|
||||
| CLI 归档 SHA-256 | `fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b` |
|
||||
| CLI 二进制 SHA-256 | `a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee` |
|
||||
| 平台 | Linux x86_64 / glibc 2.39(唯一正式验证) |
|
||||
| 视觉基准 | `docs/design/reference-old-view-reader.png`(**2048×1133**) |
|
||||
| 验收 manifest | `docs/evidence/452e9a32bd9e40dba427d4180691c58bab74449e/manifest.json`(**result: PASS,G01–G12 全部 PASS**) |
|
||||
| 验收 manifest | `docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/manifest.json`(**result: PASS,G01–G12 全部 PASS**) |
|
||||
|
||||
## 0.3.0 适配交付(实现状态)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
| G01 无旧契约静态检查 | 通过 | `scripts/check-no-legacy.sh` |
|
||||
| G12 文档事实一致 | 通过 | `scripts/check-docs.sh` |
|
||||
| 验收 manifest G01–G12 + `unverified` | 已生成 `result: PASS` | `scripts/acceptance.sh` |
|
||||
| CI 钉 rc.4 + 独立 no-legacy job | 远端 Woodpecker pipeline #10 对 `340ecb0` 成功 | `.github/workflows/ci.yml`、`.woodpecker.yml` |
|
||||
| CI 钉 rc.5 + 独立 no-legacy job | 远端 Woodpecker pipeline #10 对 `340ecb0` 成功 | `.github/workflows/ci.yml`、`.woodpecker.yml` |
|
||||
|
||||
## 发布门禁 G01–G12(issue #5)
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|---|---|---|
|
||||
| G01 | 协议层无旧契约残留(`scripts/check-no-legacy.sh`,0 命中) | `PASS` |
|
||||
| G02 | fmt + clippy + test + release build 全 exit 0 | `PASS` |
|
||||
| G03 | rc.4 归档独立安装、`view --help`、CLI SHA 前后不变、篡改拒绝 | `PASS` |
|
||||
| G03 | rc.5 归档独立安装、`view --help`、CLI SHA 前后不变、篡改拒绝 | `PASS` |
|
||||
| G04 | 静态契约正向:`check --emit` + `view verify` | `PASS` |
|
||||
| G05 | 运行契约正向:显式 run/call,终态与 CLI 一致 | `PASS` |
|
||||
| G06 | 流/快照等价(同一次执行两个目的地事件序列一致) | `PASS` |
|
||||
@@ -77,7 +77,7 @@
|
||||
| 引用/调用/分支/循环/副作用标注 + stale 降级 | 实现(分组 chip、来源标注、截断/无效显式) |
|
||||
| Tool revision 1 独立安装/分发、冻结 CLI SHA 前后一致 | 实现(0.3.0 包,篡改拒绝) |
|
||||
| 静态离线导出(无执行、无联网、manifest/哈希、不可变发布) | 实现 |
|
||||
| 固定 examples(welcome/branch-loop/function-params/knowledge-only/unsafe-side-effect) | 实现,rc.4 check/call/run 实测脚本 |
|
||||
| 固定 examples(welcome/branch-loop/function-params/knowledge-only/unsafe-side-effect) | 实现,rc.5 check/call/run 实测脚本 |
|
||||
| 逐语句变量值 / 参数实际值 / 内存快照 | **默认不请求、不展示**(协议支持显式选择;View 0.3.0 不请求,绝不伪造) |
|
||||
| 知识“已证明” / Prove / Lint | **UNSUPPORTED**(等待独立版本化报告协议) |
|
||||
| 调试器/断点/单步/调用栈、Notebook/持久内核、Session/journal | **不实现**(明确非目标) |
|
||||
@@ -123,7 +123,7 @@
|
||||
## 历史
|
||||
|
||||
`0.2.0`(2026-11-22)是旧预发布契约时代的完整阅读/执行/导出基线,相关证据
|
||||
仅作历史参考,不能替代 0.3.0 的 rc.4 门禁:`docs/evidence/2c7c4f31…/`、
|
||||
仅作历史参考,不能替代 0.3.0 的 rc.5 门禁:`docs/evidence/2c7c4f31…/`、
|
||||
`docs/evidence/issue-2/`、`docs/evidence/issue-3/`、`docs/evidence/PR-01..PR-06/`。
|
||||
旧实现规范与决策保留在 `docs/architecture/RFC-VIEW-0001*.md`、
|
||||
`docs/architecture/RFC-VIEW-0002.md`、`docs/decisions/0001..0011`(历史记录)。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
check-no-legacy: PASS (0 retired references in src/, tool.json and current docs; rc.4 baseline)
|
||||
@@ -0,0 +1,213 @@
|
||||
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.06s
|
||||
Running unittests src/lib.rs (target/debug/build/marqdo-view/01b4917d83f17a50/out/marqdo_view-01b4917d83f17a50)
|
||||
|
||||
running 65 tests
|
||||
test cli::tests::bind_policy_is_loopback_by_default ... ok
|
||||
test core_client::tests::missing_bin_has_stable_code ... ok
|
||||
test core_client::tests::check_args_are_plain_argv ... ok
|
||||
test core_client::tests::run_defaults_do_not_request_values ... ok
|
||||
test core_client::tests::scratch_dir_is_private_and_removed ... ok
|
||||
test cli::tests::parses_browse_defaults ... ok
|
||||
test execution::controller::tests::exit_code_two_is_a_hard_option_rejection_never_a_retry ... ok
|
||||
test execution::controller::tests::call_argv_carries_explicit_args_and_observation_file ... ok
|
||||
test core_client::tests::run_args_use_the_current_observation_flags_only ... ok
|
||||
test cli::tests::export_requires_out ... ok
|
||||
test cli::tests::parses_verify_and_global_options_anywhere ... ok
|
||||
test execution::controller::tests::run_argv_is_observation_jsonl_and_never_retired_trace_flags ... ok
|
||||
test execution::controller::tests::run_options_never_request_variable_values ... ok
|
||||
test execution::controller::tests::run_ids_are_unguessable_and_unique ... ok
|
||||
test execution::controller::tests::stale_and_incomplete_never_map_to_success ... ok
|
||||
test execution::controller::tests::truncated_observation_is_terminal_but_never_labelled_complete ... ok
|
||||
test cli::tests::parses_export_subcommand ... ok
|
||||
test cli::tests::run_timeout_is_bounded_to_rfc_range ... ok
|
||||
test execution::events::tests::newest_cursor_replays_only_new_events ... ok
|
||||
test execution::events::tests::states_have_stable_wire_values_and_terminals ... ok
|
||||
test execution::events::tests::frames_have_event_id_and_matching_data_seq ... ok
|
||||
test execution::events::tests::terminal_frame_carries_observation_summary_not_trace ... ok
|
||||
test execution::events::tests::utc_formatting_is_stable ... ok
|
||||
test execution::events::tests::terminal_job_replays_snapshot_and_closes ... ok
|
||||
test execution::export_candidate::tests::public_scalar_types_exclude_text_and_containers ... ok
|
||||
test execution::process::tests::bounded_capture_keeps_limit_and_drains ... ok
|
||||
test execution::process::tests::default_budget_matches_rfc ... ok
|
||||
test execution::events::tests::ring_is_bounded_and_old_cursor_gets_snapshot ... ok
|
||||
test execution::export_candidate::tests::bounded_text_never_splits_utf8 ... ok
|
||||
test execution::request::tests::entry_without_main_is_explicitly_rejected ... ok
|
||||
test execution::request::tests::canonical_names_and_targets_resolve ... ok
|
||||
test execution::request::tests::rejects_unknown_fields_and_bad_modes ... ok
|
||||
test export::tests::export_target_outside_project_is_accepted ... ok
|
||||
test export::tests::manifest_relative_paths_are_validated ... ok
|
||||
test execution::request::tests::rejects_absolute_and_parent_globs ... ok
|
||||
test protocol::tool_v1::tests::api_revision_is_an_exact_expectation ... ok
|
||||
test execution::request::tests::unknown_parameter_names_are_rejected_before_execution ... ok
|
||||
test protocol::tool_v1::tests::parses_official_version_line ... ok
|
||||
test protocol::tool_v1::tests::rejects_retired_and_future_product_lines ... ok
|
||||
test reader::assets::tests::base64_matches_known_vectors ... ok
|
||||
test reader::markdown::tests::front_matter_is_not_rendered_as_a_block ... ok
|
||||
test reader::markdown::tests::heading_spans_are_exact ... ok
|
||||
test reader::model::tests::heading_anchors_are_deterministic_and_collision_free ... ok
|
||||
test reader::markdown::tests::parses_lists_quotes_and_task_items ... ok
|
||||
test reader::model::tests::status_values_are_stable ... ok
|
||||
test reader::markdown::tests::parses_gfm_and_preserves_utf8_spans ... ok
|
||||
test reader::markdown::tests::parses_math_and_code_as_inert_literals ... ok
|
||||
test reader::source::path_tests::normalizes_harmless_forms ... ok
|
||||
test reader::source::path_tests::rejects_unsafe_relative_paths ... ok
|
||||
test reader::source::tests::bom_is_still_indexed ... ok
|
||||
test reader::source::tests::maps_multibyte_and_emoji_offsets ... ok
|
||||
test reader::source::tests::rejects_out_of_range_and_misaligned_spans ... ok
|
||||
test reader::source::tests::digest_is_exact_bytes ... ok
|
||||
test server::routes::tests::percent_decode_is_single_pass_and_strict ... ok
|
||||
test server::routes::tests::run_route_matching_is_strict ... ok
|
||||
test server::routes::tests::status_mapping_covers_execution_errors ... ok
|
||||
test server::security::tests::constant_time_eq_is_strict ... ok
|
||||
test server::security::tests::random_tokens_are_lower_hex_and_unique ... ok
|
||||
test server::sse::tests::headers_are_the_sse_contract ... ok
|
||||
test server::security::tests::session_cookie_is_parsed_from_a_real_request ... ok
|
||||
test server::sse::tests::heartbeat_interval_is_fifteen_seconds_by_default ... ok
|
||||
test execution::controller::tests::expired_terminal_job_is_never_returned_for_export ... ok
|
||||
test execution::process::tests::cancellation_terminates_the_process_group ... ok
|
||||
test reader::assets::tests::css_substitutes_images_and_keeps_one_asset ... ok
|
||||
test reader::assets::tests::bundle_digests_match_source_files ... ok
|
||||
|
||||
test result: ok. 65 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
|
||||
|
||||
Running unittests src/main.rs (target/debug/build/marqdo-view/436da4765b900725/out/marqdo_view-436da4765b900725)
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
|
||||
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 53 tests
|
||||
test cli_surface::degradation_without_core_keeps_prose_readable ... ok
|
||||
test asset_integrity::theme_has_one_token_layer_and_no_legacy_skin ... ok
|
||||
test cli_surface::browse_on_missing_path_fails_without_starting_a_server ... ok
|
||||
test cli_surface::export_requires_an_output_directory ... ok
|
||||
test cli_surface::missing_document_is_an_io_error ... ok
|
||||
test cli_surface::help_comes_from_view_not_core ... ok
|
||||
test cli_surface::non_loopback_bind_is_refused_by_default ... ok
|
||||
test cli_surface::verify_without_core_is_an_argument_error ... ok
|
||||
test cli_surface::version_is_the_tool_version ... ok
|
||||
test asset_integrity::reused_assets_match_their_recorded_hashes ... ok
|
||||
test core_contract::check_failure_preserves_core_stderr_and_code ... ok
|
||||
test core_contract::default_run_does_not_request_variable_or_parameter_values ... ok
|
||||
test core_contract::analysis_v2_revision_is_a_hard_protocol_error ... ok
|
||||
test core_contract::check_refs_is_forwarded_as_a_stricter_flag ... ok
|
||||
test core_contract::installed_tool_api_revision_is_enforced_at_the_process_boundary ... ok
|
||||
test core_contract::check_returns_exact_analysis_bytes_and_digest ... ok
|
||||
test core_contract::missing_required_analysis_fields_are_rejected ... ok
|
||||
test core_contract::current_rc_version_is_accepted ... ok
|
||||
test core_contract::run_and_call_argv_use_the_current_observation_flags_only ... ok
|
||||
test core_contract::failed_check_normalizes_diagnostics_without_absolute_paths ... ok
|
||||
test core_contract::strict_mode_run_request_is_rejected_by_view_validation ... ok
|
||||
test core_contract::tool_api_revision_environment_is_an_exact_expectation ... ok
|
||||
test core_contract::incompatible_product_version_is_rejected_before_any_work ... ok
|
||||
test core_contract::unknown_analysis_schema_name_or_major_is_rejected ... ok
|
||||
test core_contract::unknown_module_and_unit_references_are_rejected ... ok
|
||||
test no_coupling::no_private_core_crate_dependencies ... ok
|
||||
test no_coupling::release_lockfile_is_committed ... ok
|
||||
test core_contract::missing_emit_after_success_is_an_analysis_failure ... ok
|
||||
test core_contract::cli_verify_end_to_end_against_fake_core ... ok
|
||||
test no_coupling::tool_manifest_matches_package_and_protocols ... ok
|
||||
test no_coupling::exactly_one_reader_theme_and_script_entry ... ok
|
||||
test core_contract::retired_revision_3_shape_is_rejected_with_a_rebuild_hint ... ok
|
||||
test core_contract::source_digest_mismatch_is_not_silently_accepted ... ok
|
||||
test no_coupling::source_has_no_legacy_protocol_or_runtime_probing ... ok
|
||||
test observation_contract::rejected_before_start_is_a_valid_failed_terminal ... ok
|
||||
test observation_contract::eof_without_terminal_is_incomplete_never_success ... ok
|
||||
test observation_contract::real_jsonl_stream_verifies_and_binds_to_analysis_digest ... ok
|
||||
test observation_contract::truncated_observation_is_a_terminal_but_never_complete ... ok
|
||||
test observation_contract::unknown_schema_and_revision_are_rejected ... ok
|
||||
test asset_integrity::embedded_asset_bundle_matches_disk_and_has_one_theme ... ok
|
||||
test observation_contract::stream_and_snapshot_of_the_same_run_agree ... ok
|
||||
test observation_contract::stale_and_wrong_root_bindings_are_observation_stale ... ok
|
||||
test presentation_states::missing_core_stays_readable_and_explicitly_unverified ... ok
|
||||
test presentation_states::external_projection_can_be_rendered_from_artifact_source ... ok
|
||||
test presentation_states::truncated_and_incomplete_runs_never_display_as_success ... ok
|
||||
test no_coupling::source_never_reads_or_links_the_legacy_repositories ... ok
|
||||
test presentation_states::failed_check_keeps_prose_and_shows_core_diagnostics ... ok
|
||||
test presentation_states::invalid_analysis_span_is_rejected_not_trimmed ... ok
|
||||
test observation_contract::lifecycle_negative_cases_fail_closed ... ok
|
||||
test presentation_states::source_digest_mismatch_degrades_instead_of_misbinding ... ok
|
||||
test core_contract::cli_verify_rejects_schema_v2_and_digest_mismatch ... ok
|
||||
test presentation_states::unknown_analysis_schema_is_a_hard_protocol_error ... ok
|
||||
test presentation_states::run_attached_to_changed_source_becomes_stale ... ok
|
||||
|
||||
test result: ok. 53 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
|
||||
|
||||
Running tests/integration/main.rs (target/debug/build/marqdo-view/77a45afd23a2f454/out/integration-77a45afd23a2f454)
|
||||
|
||||
running 45 tests
|
||||
test execution::cross_session_observation_is_rejected ... ok
|
||||
test execution::same_client_request_id_is_idempotent_and_different_payload_conflicts ... ok
|
||||
test execution::missing_observation_stream_is_incomplete_never_success ... ok
|
||||
test execution::event_frames_use_the_view_run_events_schema_and_numeric_ids ... ok
|
||||
test execution::explicit_entry_run_streams_accepted_running_and_verified_observation ... ok
|
||||
test execution::project_grants_are_mapped_to_explicit_cli_flags_and_pure_grants_are_rejected ... ok
|
||||
test execution::call_target_uses_the_call_subcommand_and_function_name ... ok
|
||||
test execution::observation_with_a_mismatched_digest_is_rejected_as_stale ... ok
|
||||
test execution::stale_request_digest_is_rejected_before_any_process_starts ... ok
|
||||
test execution::truncated_observation_is_explicit_and_never_labelled_complete ... ok
|
||||
test execution::second_run_is_busy_while_one_is_active_and_cancel_is_idempotent ... ok
|
||||
test export::refuses_to_export_inside_the_project_root ... ok
|
||||
test export::refuses_to_overwrite_unrelated_non_empty_directory ... ok
|
||||
test http_live::assets_are_immutable_and_carry_strict_headers ... ok
|
||||
test http_live::at_most_two_sse_observers_per_run ... ok
|
||||
test http_live::cancel_is_idempotent_and_yields_one_terminal_state ... ok
|
||||
test http_live::document_without_main_is_rejected_without_running_another_function ... ok
|
||||
test execution::source_edit_during_a_run_marks_the_result_stale_and_drops_anchor_ids ... ok
|
||||
test http_live::duplicate_request_id_is_idempotent_and_busy_or_conflict_never_starts_a_second_process ... ok
|
||||
test http_live::explicit_run_streams_sse_accepted_running_and_terminal_with_verified_trace ... ok
|
||||
test http_live::last_event_id_replays_only_newer_events_and_old_cursor_gets_snapshot ... ok
|
||||
test http_live::pages_issue_a_session_cookie_and_never_execute_the_document ... ok
|
||||
test http_live::read_only_routes_are_the_target_contract_and_old_routes_are_gone ... ok
|
||||
test rendering::headings_use_heading_span_while_sections_use_the_complete_span ... ok
|
||||
test rendering::live_and_static_share_content_but_rewrite_links ... ok
|
||||
test rendering::malicious_markdown_cannot_inject_markup_or_scripts ... ok
|
||||
test rendering::page_has_exactly_one_theme_and_one_script ... ok
|
||||
test rendering::reader_exposes_simple_theme_toggle_and_no_variable_or_memory_tabs ... ok
|
||||
test rendering::rendering_is_deterministic ... ok
|
||||
test rendering::run_controls_are_explicitly_unavailable_before_an_explicit_run ... ok
|
||||
test rendering::semantic_annotations_come_from_analysis_and_are_unique ... ok
|
||||
test rendering::static_pages_use_parent_relative_assets_and_links ... ok
|
||||
test rendering::tables_math_and_code_are_inert_and_readable ... ok
|
||||
test rendering::welcome_hero_only_when_configured ... ok
|
||||
test unicode_spans::crlf_source_keeps_exact_digest_and_line_mapping ... ok
|
||||
test unicode_spans::heading_ui_uses_heading_span_and_section_span_includes_children ... ok
|
||||
test unicode_spans::knowledge_emphasis_never_becomes_an_execution_anchor ... ok
|
||||
test unicode_spans::unicode_spans_are_exact_and_duplicate_returns_get_distinct_anchors ... ok
|
||||
test http_live::sse_heartbeats_keep_a_slow_job_connected ... ok
|
||||
test export::exported_html_has_no_remote_subresources ... ok
|
||||
test export::export_never_executes_side_effects ... ok
|
||||
test export::real_frozen_core_export_marks_both_pages_static_ok ... ok
|
||||
test export::no_annotations_keeps_prose_but_removes_anchors ... ok
|
||||
test export::exports_offline_site_with_shared_renderer_and_relative_links ... ok
|
||||
test export::replaces_a_previous_export_atomically ... ok
|
||||
|
||||
test result: ok. 45 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 33.52s
|
||||
|
||||
Running tests/security/main.rs (target/debug/build/marqdo-view/6dc7f51fb0afdc26/out/security-6dc7f51fb0afdc26)
|
||||
|
||||
running 11 tests
|
||||
test path_traversal_is_rejected_and_the_old_document_route_is_gone ... ok
|
||||
test adversarial_markdown_never_injects_markup_or_handlers ... ok
|
||||
test host_origin_session_csrf_and_json_are_all_required_before_execution ... ok
|
||||
test aggressive_markdown_links_cannot_become_a_file_read_api ... ok
|
||||
test session_cookie_and_headers_are_hardened ... ok
|
||||
test oversized_and_unknown_fields_are_rejected_before_execution ... ok
|
||||
test sec_fetch_site_cross_site_is_rejected_even_with_a_valid_token ... ok
|
||||
test cancel_cannot_be_replayed_to_start_a_new_process ... ok
|
||||
test symlink_escape_outside_the_project_root_is_rejected ... ok
|
||||
test sse_and_cancel_are_scoped_to_the_owning_session ... ok
|
||||
test sse_requires_a_session_and_only_the_owning_session_can_read_or_cancel ... ok
|
||||
|
||||
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.32s
|
||||
|
||||
Doc-tests marqdo_view
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
|
||||
|
||||
Finished `release` profile [optimized] target(s) in 0.04s
|
||||
@@ -0,0 +1,55 @@
|
||||
CHANGELOG.md: OK
|
||||
COMPATIBILITY.md: OK
|
||||
LICENSE-APACHE: OK
|
||||
LICENSE-MIT: OK
|
||||
README.md: OK
|
||||
SOURCE_SHA: OK
|
||||
bin/marqdo-view: OK
|
||||
tool.json: OK
|
||||
== bundle digest: sha256:86cc2a9c10b1a83d33c51b3ceef8c9e9a9bc0143fb734ea0c40f9e745b8db826
|
||||
installed tool `view` version 0.3.0 (marqdo-view)
|
||||
view 0.3.0 (marqdo-view)
|
||||
Marqdo View renders the original Markdown and attaches verified Analysis v3 facts. Running is never implicit: it requires an explicit user action. Export is always a pure read-only operation.
|
||||
|
||||
Usage: marqdo-view [OPTIONS] [PATH] [COMMAND]
|
||||
|
||||
Commands:
|
||||
export Write a static, read-only HTML site (never executes the document)
|
||||
verify Check CLI/Analysis/source binding only; never executes
|
||||
|
||||
Arguments:
|
||||
[PATH]
|
||||
A `.mq.md` document or a project directory (default: `.`)
|
||||
|
||||
Options:
|
||||
--marqdo-bin <PATH>
|
||||
Development only: explicit path to the frozen `marqdo` binary. Installed Tool Protocol runs get the path from `MARQDO_BIN`
|
||||
|
||||
--host <HOST>
|
||||
Loopback host for the Live reader (default 127.0.0.1)
|
||||
|
||||
[default: 127.0.0.1]
|
||||
|
||||
--port <PORT>
|
||||
Port for the Live reader; `0` lets the OS choose and prints the real URL
|
||||
|
||||
[default: 7429]
|
||||
|
||||
--no-open
|
||||
Do not open a browser (the full local URL is still printed)
|
||||
|
||||
--run-timeout <RUN_TIMEOUT>
|
||||
Wall-clock limit for one explicit run, in seconds (RFC-VIEW-0002 §6.7). The frozen Core receives the same value via `--timeout`
|
||||
|
||||
[default: 30]
|
||||
|
||||
-h, --help
|
||||
Print help (see a summary with '-h')
|
||||
|
||||
-V, --version
|
||||
Print version
|
||||
manifest: PASS (revision 1 requires api_revision=1 analysis=3 observation=1)
|
||||
install-smoke: PASS (view installed/dispatched, api_revision 1 injected, core sha256 a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee unchanged, tool home /root/work/marqdo/tools/view/dist/smoke-tool-home.VCrwqm)
|
||||
removed tool `view`
|
||||
error: unknown command `view`; install a tool with `marqdo tool install <tool.json>`
|
||||
installed tool `view` version 0.3.0 (marqdo-view)
|
||||
@@ -0,0 +1,8 @@
|
||||
==> cargo build --release --locked
|
||||
Finished `release` profile [optimized] target(s) in 0.04s
|
||||
==> smoke install against frozen core
|
||||
manifest: PASS (revision 1 requires api_revision=1 analysis=3 observation=1)
|
||||
install-smoke: PASS (view installed/dispatched, api_revision 1 injected, core sha256 a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee unchanged, tool home /root/work/marqdo/tools/view/dist/smoke-tool-home.UZF9ni)
|
||||
bundle: /root/work/marqdo/tools/view/dist/marqdo-view
|
||||
archive: /root/work/marqdo/tools/view/dist/marqdo-view-0.3.0-x86_64-unknown-linux-gnu.tar.gz
|
||||
sha256: d2f19b9d7bb8fbfec450ce7ebd384e36c7cd5dd6fb9233162f30ed65c0be8fa8
|
||||
@@ -0,0 +1 @@
|
||||
error: tool `view` bundle hash mismatch; reinstall it
|
||||
@@ -0,0 +1,19 @@
|
||||
core: marqdo 3.0.0-rc.5 (supported >=3.0.0-rc.3,<4.0.0, api revision 1)
|
||||
project: root:mixed-modes@0.1.0 (manifest)
|
||||
document: index.mq.md
|
||||
analysis: schema=marqdo.analysis v3 modules=1 functions=1 references=0 digest=sha256:ccc8d8c4987ad2342e4e034fcd3430d096e296f17836074b2f33ffcaecca1c51
|
||||
source digest: match
|
||||
result: PASS (static only; document not executed)
|
||||
==> check all five example documents (one static source: check --emit)
|
||||
Analysis v3: PASS (schema_version 3, exact source/document/entry present)
|
||||
==> call function-params.double(n=5) -> 10 via Observation v1
|
||||
call double(5): PASS (Observation v1, Int 10)
|
||||
==> run branch-loop main -> Int 0 with loop/return events
|
||||
run branch-loop: PASS (Int 0, contiguous seq, kinds: stream.opened,run.started,call.enter,variable.assigned,loop.iteration,variable.assigned,loop.iteration,variable.assigned,loop.iteration,variable.assigned,loop.iteration,return,call.exit,run.completed)
|
||||
==> knowledge-only has no main (truthful rejection, no fallback)
|
||||
knowledge-only: PASS (explicit sem.no_entry_function)
|
||||
==> unsafe-side-effect writes nothing in pure mode
|
||||
unsafe-side-effect pure: PASS (permission.denied, no file)
|
||||
==> unsafe-side-effect writes only with explicit project grants
|
||||
unsafe-side-effect project+grants: PASS (sentinel written explicitly)
|
||||
examples: PASS (frozen CLI sha256 a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee unchanged)
|
||||
@@ -0,0 +1,3 @@
|
||||
browse: PASS
|
||||
explicit real run: PASS (run_id=a4e24b62e2ea4e3b85a5fcf3b98f867b observation=verified events=34)
|
||||
explicit run: PASS
|
||||
@@ -0,0 +1,2 @@
|
||||
stream/snapshot equivalence: PASS (7 events, one run_id, contiguous seq, one terminal)
|
||||
observation truncation: PASS (capture.truncated=event_budget, terminal=run.completed)
|
||||
@@ -0,0 +1,25 @@
|
||||
exact Analysis binding: PASS (digest=sha256:3fa3109fb671d21ebc161d41bb6193260b4119141569dc78c948d99ff0c9ab43, root/module/span checks, source edit invalidates)
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running unittests src/lib.rs (target/debug/build/marqdo-view/01b4917d83f17a50/out/marqdo_view-01b4917d83f17a50)
|
||||
|
||||
running 1 test
|
||||
test execution::controller::tests::stale_and_incomplete_never_map_to_success ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 64 filtered out; finished in 0.00s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/integration/main.rs (target/debug/build/marqdo-view/77a45afd23a2f454/out/integration-77a45afd23a2f454)
|
||||
|
||||
running 1 test
|
||||
test execution::source_edit_during_a_run_marks_the_result_stale_and_drops_anchor_ids ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 44 filtered out; finished in 1.08s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 1 test
|
||||
test observation_contract::stale_and_wrong_root_bindings_are_observation_stale ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 52 filtered out; finished in 0.01s
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
fail-closed retired --json: PASS (exit 2, no fallback retry)
|
||||
fail-closed retired --trace-file: PASS (exit 2, no fallback retry)
|
||||
fail-closed retired --event-stream: PASS (exit 2, no fallback retry)
|
||||
fail-closed strict live destination: PASS (exit 2, strict.unsupported_grant)
|
||||
fail-closed retired tool.json: PASS (unknown field `compatibility`, no migrator)
|
||||
fail-closed retired record_version 1: PASS (dispatch refused, remove+reinstall hint)
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running unittests src/lib.rs (target/debug/build/marqdo-view/01b4917d83f17a50/out/marqdo_view-01b4917d83f17a50)
|
||||
|
||||
running 25 tests
|
||||
test execution::controller::tests::exit_code_two_is_a_hard_option_rejection_never_a_retry ... ok
|
||||
test execution::controller::tests::run_ids_are_unguessable_and_unique ... ok
|
||||
test execution::controller::tests::stale_and_incomplete_never_map_to_success ... ok
|
||||
test execution::controller::tests::run_options_never_request_variable_values ... ok
|
||||
test execution::controller::tests::call_argv_carries_explicit_args_and_observation_file ... ok
|
||||
test execution::controller::tests::run_argv_is_observation_jsonl_and_never_retired_trace_flags ... ok
|
||||
test execution::events::tests::newest_cursor_replays_only_new_events ... ok
|
||||
test execution::events::tests::frames_have_event_id_and_matching_data_seq ... ok
|
||||
test execution::events::tests::states_have_stable_wire_values_and_terminals ... ok
|
||||
test execution::controller::tests::truncated_observation_is_terminal_but_never_labelled_complete ... ok
|
||||
test execution::events::tests::utc_formatting_is_stable ... ok
|
||||
test execution::events::tests::terminal_frame_carries_observation_summary_not_trace ... ok
|
||||
test execution::events::tests::terminal_job_replays_snapshot_and_closes ... ok
|
||||
test execution::export_candidate::tests::public_scalar_types_exclude_text_and_containers ... ok
|
||||
test execution::process::tests::bounded_capture_keeps_limit_and_drains ... ok
|
||||
test execution::process::tests::default_budget_matches_rfc ... ok
|
||||
test execution::export_candidate::tests::bounded_text_never_splits_utf8 ... ok
|
||||
test execution::events::tests::ring_is_bounded_and_old_cursor_gets_snapshot ... ok
|
||||
test execution::request::tests::entry_without_main_is_explicitly_rejected ... ok
|
||||
test execution::request::tests::rejects_unknown_fields_and_bad_modes ... ok
|
||||
test execution::request::tests::canonical_names_and_targets_resolve ... ok
|
||||
test execution::request::tests::rejects_absolute_and_parent_globs ... ok
|
||||
test execution::request::tests::unknown_parameter_names_are_rejected_before_execution ... ok
|
||||
test execution::process::tests::cancellation_terminates_the_process_group ... ok
|
||||
test execution::controller::tests::expired_terminal_job_is_never_returned_for_export ... ok
|
||||
|
||||
test result: ok. 25 passed; 0 failed; 0 ignored; 0 measured; 40 filtered out; finished in 0.02s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 8 tests
|
||||
test observation_contract::rejected_before_start_is_a_valid_failed_terminal ... ok
|
||||
test observation_contract::unknown_schema_and_revision_are_rejected ... ok
|
||||
test observation_contract::real_jsonl_stream_verifies_and_binds_to_analysis_digest ... ok
|
||||
test observation_contract::eof_without_terminal_is_incomplete_never_success ... ok
|
||||
test observation_contract::truncated_observation_is_a_terminal_but_never_complete ... ok
|
||||
test observation_contract::stream_and_snapshot_of_the_same_run_agree ... ok
|
||||
test observation_contract::stale_and_wrong_root_bindings_are_observation_stale ... ok
|
||||
test observation_contract::lifecycle_negative_cases_fail_closed ... ok
|
||||
|
||||
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.05s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 20 tests
|
||||
test core_contract::default_run_does_not_request_variable_or_parameter_values ... ok
|
||||
test core_contract::current_rc_version_is_accepted ... ok
|
||||
test core_contract::check_refs_is_forwarded_as_a_stricter_flag ... ok
|
||||
test core_contract::installed_tool_api_revision_is_enforced_at_the_process_boundary ... ok
|
||||
test core_contract::failed_check_normalizes_diagnostics_without_absolute_paths ... ok
|
||||
test core_contract::analysis_v2_revision_is_a_hard_protocol_error ... ok
|
||||
test core_contract::check_returns_exact_analysis_bytes_and_digest ... ok
|
||||
test core_contract::run_and_call_argv_use_the_current_observation_flags_only ... ok
|
||||
test core_contract::check_failure_preserves_core_stderr_and_code ... ok
|
||||
test core_contract::missing_required_analysis_fields_are_rejected ... ok
|
||||
test core_contract::tool_api_revision_environment_is_an_exact_expectation ... ok
|
||||
test core_contract::strict_mode_run_request_is_rejected_by_view_validation ... ok
|
||||
test core_contract::unknown_analysis_schema_name_or_major_is_rejected ... ok
|
||||
test core_contract::unknown_module_and_unit_references_are_rejected ... ok
|
||||
test core_contract::incompatible_product_version_is_rejected_before_any_work ... ok
|
||||
test core_contract::missing_emit_after_success_is_an_analysis_failure ... ok
|
||||
test core_contract::cli_verify_end_to_end_against_fake_core ... ok
|
||||
test core_contract::source_digest_mismatch_is_not_silently_accepted ... ok
|
||||
test core_contract::retired_revision_3_shape_is_rejected_with_a_rebuild_hint ... ok
|
||||
test core_contract::cli_verify_rejects_schema_v2_and_digest_mismatch ... ok
|
||||
|
||||
test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 33 filtered out; finished in 0.14s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 8 tests
|
||||
test presentation_states::missing_core_stays_readable_and_explicitly_unverified ... ok
|
||||
test presentation_states::external_projection_can_be_rendered_from_artifact_source ... ok
|
||||
test presentation_states::truncated_and_incomplete_runs_never_display_as_success ... ok
|
||||
test presentation_states::failed_check_keeps_prose_and_shows_core_diagnostics ... ok
|
||||
test presentation_states::unknown_analysis_schema_is_a_hard_protocol_error ... ok
|
||||
test presentation_states::source_digest_mismatch_degrades_instead_of_misbinding ... ok
|
||||
test presentation_states::invalid_analysis_span_is_rejected_not_trimmed ... ok
|
||||
test presentation_states::run_attached_to_changed_source_becomes_stale ... ok
|
||||
|
||||
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.09s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 6 tests
|
||||
test no_coupling::release_lockfile_is_committed ... ok
|
||||
test no_coupling::tool_manifest_matches_package_and_protocols ... ok
|
||||
test no_coupling::no_private_core_crate_dependencies ... ok
|
||||
test no_coupling::exactly_one_reader_theme_and_script_entry ... ok
|
||||
test no_coupling::source_has_no_legacy_protocol_or_runtime_probing ... ok
|
||||
test no_coupling::source_never_reads_or_links_the_legacy_repositories ... ok
|
||||
|
||||
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 47 filtered out; finished in 0.03s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/security/main.rs (target/debug/build/marqdo-view/6dc7f51fb0afdc26/out/security-6dc7f51fb0afdc26)
|
||||
|
||||
running 11 tests
|
||||
test path_traversal_is_rejected_and_the_old_document_route_is_gone ... ok
|
||||
test adversarial_markdown_never_injects_markup_or_handlers ... ok
|
||||
test session_cookie_and_headers_are_hardened ... ok
|
||||
test oversized_and_unknown_fields_are_rejected_before_execution ... ok
|
||||
test aggressive_markdown_links_cannot_become_a_file_read_api ... ok
|
||||
test host_origin_session_csrf_and_json_are_all_required_before_execution ... ok
|
||||
test sec_fetch_site_cross_site_is_rejected_even_with_a_valid_token ... ok
|
||||
test cancel_cannot_be_replayed_to_start_a_new_process ... ok
|
||||
test symlink_escape_outside_the_project_root_is_rejected ... ok
|
||||
test sse_and_cancel_are_scoped_to_the_owning_session ... ok
|
||||
test sse_requires_a_session_and_only_the_owning_session_can_read_or_cancel ... ok
|
||||
|
||||
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.30s
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
==> Live read-only requests
|
||||
==> Static export
|
||||
no-exec: PASS (sources/lock unchanged, no sentinel from read-only operations, explicit write control passed, no run control in export; core sha unchanged)
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/security/main.rs (target/debug/build/marqdo-view/6dc7f51fb0afdc26/out/security-6dc7f51fb0afdc26)
|
||||
|
||||
running 11 tests
|
||||
test path_traversal_is_rejected_and_the_old_document_route_is_gone ... ok
|
||||
test adversarial_markdown_never_injects_markup_or_handlers ... ok
|
||||
test aggressive_markdown_links_cannot_become_a_file_read_api ... ok
|
||||
test session_cookie_and_headers_are_hardened ... ok
|
||||
test sec_fetch_site_cross_site_is_rejected_even_with_a_valid_token ... ok
|
||||
test oversized_and_unknown_fields_are_rejected_before_execution ... ok
|
||||
test host_origin_session_csrf_and_json_are_all_required_before_execution ... ok
|
||||
test cancel_cannot_be_replayed_to_start_a_new_process ... ok
|
||||
test symlink_escape_outside_the_project_root_is_rejected ... ok
|
||||
test sse_and_cancel_are_scoped_to_the_owning_session ... ok
|
||||
test sse_requires_a_session_and_only_the_owning_session_can_read_or_cancel ... ok
|
||||
|
||||
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.34s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/integration/main.rs (target/debug/build/marqdo-view/77a45afd23a2f454/out/integration-77a45afd23a2f454)
|
||||
|
||||
running 45 tests
|
||||
test execution::same_client_request_id_is_idempotent_and_different_payload_conflicts ... ok
|
||||
test execution::missing_observation_stream_is_incomplete_never_success ... ok
|
||||
test execution::call_target_uses_the_call_subcommand_and_function_name ... ok
|
||||
test execution::cross_session_observation_is_rejected ... ok
|
||||
test execution::explicit_entry_run_streams_accepted_running_and_verified_observation ... ok
|
||||
test execution::project_grants_are_mapped_to_explicit_cli_flags_and_pure_grants_are_rejected ... ok
|
||||
test execution::observation_with_a_mismatched_digest_is_rejected_as_stale ... ok
|
||||
test execution::event_frames_use_the_view_run_events_schema_and_numeric_ids ... ok
|
||||
test execution::stale_request_digest_is_rejected_before_any_process_starts ... ok
|
||||
test execution::truncated_observation_is_explicit_and_never_labelled_complete ... ok
|
||||
test export::refuses_to_export_inside_the_project_root ... ok
|
||||
test execution::second_run_is_busy_while_one_is_active_and_cancel_is_idempotent ... ok
|
||||
test export::refuses_to_overwrite_unrelated_non_empty_directory ... ok
|
||||
test http_live::assets_are_immutable_and_carry_strict_headers ... ok
|
||||
test http_live::at_most_two_sse_observers_per_run ... ok
|
||||
test http_live::cancel_is_idempotent_and_yields_one_terminal_state ... ok
|
||||
test http_live::document_without_main_is_rejected_without_running_another_function ... ok
|
||||
test execution::source_edit_during_a_run_marks_the_result_stale_and_drops_anchor_ids ... ok
|
||||
test http_live::duplicate_request_id_is_idempotent_and_busy_or_conflict_never_starts_a_second_process ... ok
|
||||
test http_live::explicit_run_streams_sse_accepted_running_and_terminal_with_verified_trace ... ok
|
||||
test http_live::last_event_id_replays_only_newer_events_and_old_cursor_gets_snapshot ... ok
|
||||
test http_live::pages_issue_a_session_cookie_and_never_execute_the_document ... ok
|
||||
test http_live::read_only_routes_are_the_target_contract_and_old_routes_are_gone ... ok
|
||||
test rendering::headings_use_heading_span_while_sections_use_the_complete_span ... ok
|
||||
test rendering::live_and_static_share_content_but_rewrite_links ... ok
|
||||
test rendering::malicious_markdown_cannot_inject_markup_or_scripts ... ok
|
||||
test rendering::page_has_exactly_one_theme_and_one_script ... ok
|
||||
test rendering::reader_exposes_simple_theme_toggle_and_no_variable_or_memory_tabs ... ok
|
||||
test rendering::rendering_is_deterministic ... ok
|
||||
test rendering::run_controls_are_explicitly_unavailable_before_an_explicit_run ... ok
|
||||
test rendering::semantic_annotations_come_from_analysis_and_are_unique ... ok
|
||||
test rendering::static_pages_use_parent_relative_assets_and_links ... ok
|
||||
test rendering::tables_math_and_code_are_inert_and_readable ... ok
|
||||
test rendering::welcome_hero_only_when_configured ... ok
|
||||
test unicode_spans::crlf_source_keeps_exact_digest_and_line_mapping ... ok
|
||||
test unicode_spans::heading_ui_uses_heading_span_and_section_span_includes_children ... ok
|
||||
test unicode_spans::knowledge_emphasis_never_becomes_an_execution_anchor ... ok
|
||||
test unicode_spans::unicode_spans_are_exact_and_duplicate_returns_get_distinct_anchors ... ok
|
||||
test http_live::sse_heartbeats_keep_a_slow_job_connected ... ok
|
||||
test export::no_annotations_keeps_prose_but_removes_anchors ... ok
|
||||
test export::real_frozen_core_export_marks_both_pages_static_ok ... ok
|
||||
test export::exports_offline_site_with_shared_renderer_and_relative_links ... ok
|
||||
test export::exported_html_has_no_remote_subresources ... ok
|
||||
test export::export_never_executes_side_effects ... ok
|
||||
test export::replaces_a_previous_export_atomically ... ok
|
||||
|
||||
test result: ok. 45 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 38.56s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 53 tests
|
||||
test cli_surface::degradation_without_core_keeps_prose_readable ... ok
|
||||
test asset_integrity::theme_has_one_token_layer_and_no_legacy_skin ... ok
|
||||
test cli_surface::export_requires_an_output_directory ... ok
|
||||
test cli_surface::missing_document_is_an_io_error ... ok
|
||||
test cli_surface::browse_on_missing_path_fails_without_starting_a_server ... ok
|
||||
test cli_surface::help_comes_from_view_not_core ... ok
|
||||
test cli_surface::non_loopback_bind_is_refused_by_default ... ok
|
||||
test cli_surface::version_is_the_tool_version ... ok
|
||||
test cli_surface::verify_without_core_is_an_argument_error ... ok
|
||||
test asset_integrity::reused_assets_match_their_recorded_hashes ... ok
|
||||
test core_contract::check_failure_preserves_core_stderr_and_code ... ok
|
||||
test core_contract::default_run_does_not_request_variable_or_parameter_values ... ok
|
||||
test core_contract::check_refs_is_forwarded_as_a_stricter_flag ... ok
|
||||
test core_contract::analysis_v2_revision_is_a_hard_protocol_error ... ok
|
||||
test core_contract::check_returns_exact_analysis_bytes_and_digest ... ok
|
||||
test core_contract::installed_tool_api_revision_is_enforced_at_the_process_boundary ... ok
|
||||
test core_contract::missing_required_analysis_fields_are_rejected ... ok
|
||||
test core_contract::current_rc_version_is_accepted ... ok
|
||||
test core_contract::run_and_call_argv_use_the_current_observation_flags_only ... ok
|
||||
test core_contract::failed_check_normalizes_diagnostics_without_absolute_paths ... ok
|
||||
test core_contract::strict_mode_run_request_is_rejected_by_view_validation ... ok
|
||||
test core_contract::tool_api_revision_environment_is_an_exact_expectation ... ok
|
||||
test core_contract::unknown_analysis_schema_name_or_major_is_rejected ... ok
|
||||
test core_contract::incompatible_product_version_is_rejected_before_any_work ... ok
|
||||
test core_contract::unknown_module_and_unit_references_are_rejected ... ok
|
||||
test no_coupling::no_private_core_crate_dependencies ... ok
|
||||
test no_coupling::release_lockfile_is_committed ... ok
|
||||
test core_contract::missing_emit_after_success_is_an_analysis_failure ... ok
|
||||
test no_coupling::exactly_one_reader_theme_and_script_entry ... ok
|
||||
test no_coupling::tool_manifest_matches_package_and_protocols ... ok
|
||||
test core_contract::cli_verify_end_to_end_against_fake_core ... ok
|
||||
test core_contract::retired_revision_3_shape_is_rejected_with_a_rebuild_hint ... ok
|
||||
test core_contract::source_digest_mismatch_is_not_silently_accepted ... ok
|
||||
test no_coupling::source_has_no_legacy_protocol_or_runtime_probing ... ok
|
||||
test observation_contract::eof_without_terminal_is_incomplete_never_success ... ok
|
||||
test observation_contract::rejected_before_start_is_a_valid_failed_terminal ... ok
|
||||
test observation_contract::real_jsonl_stream_verifies_and_binds_to_analysis_digest ... ok
|
||||
test observation_contract::stream_and_snapshot_of_the_same_run_agree ... ok
|
||||
test observation_contract::unknown_schema_and_revision_are_rejected ... ok
|
||||
test asset_integrity::embedded_asset_bundle_matches_disk_and_has_one_theme ... ok
|
||||
test observation_contract::stale_and_wrong_root_bindings_are_observation_stale ... ok
|
||||
test observation_contract::truncated_observation_is_a_terminal_but_never_complete ... ok
|
||||
test presentation_states::missing_core_stays_readable_and_explicitly_unverified ... ok
|
||||
test presentation_states::external_projection_can_be_rendered_from_artifact_source ... ok
|
||||
test no_coupling::source_never_reads_or_links_the_legacy_repositories ... ok
|
||||
test presentation_states::truncated_and_incomplete_runs_never_display_as_success ... ok
|
||||
test presentation_states::failed_check_keeps_prose_and_shows_core_diagnostics ... ok
|
||||
test observation_contract::lifecycle_negative_cases_fail_closed ... ok
|
||||
test presentation_states::source_digest_mismatch_degrades_instead_of_misbinding ... ok
|
||||
test presentation_states::invalid_analysis_span_is_rejected_not_trimmed ... ok
|
||||
test core_contract::cli_verify_rejects_schema_v2_and_digest_mismatch ... ok
|
||||
test presentation_states::unknown_analysis_schema_is_a_hard_protocol_error ... ok
|
||||
test presentation_states::run_attached_to_changed_source_becomes_stale ... ok
|
||||
|
||||
test result: ok. 53 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
|
||||
|
||||
marqdo view export: 2 page(s), 11 file(s) → /root/work/marqdo/tools/view/dist/test-export-site
|
||||
manifest: sha256:6dc4450c51a9125aab737f457bb1a8133a7445c4bfc07b2c758e91f89d8bc5eb
|
||||
executed: false (纯静态导出,未运行任何文档)
|
||||
export manifest: PASS (2 pages, 3 files)
|
||||
note: Playwright not installed; skipped file:// browser check
|
||||
export: PASS (offline site at /root/work/marqdo/tools/view/dist/test-export-site; core sha256 a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee unchanged)
|
||||
security: PASS
|
||||
@@ -0,0 +1,67 @@
|
||||
marqdo view export: 2 page(s), 11 file(s) → /root/work/marqdo/tools/view/dist/test-export-site
|
||||
manifest: sha256:6dc4450c51a9125aab737f457bb1a8133a7445c4bfc07b2c758e91f89d8bc5eb
|
||||
executed: false (纯静态导出,未运行任何文档)
|
||||
export manifest: PASS (2 pages, 3 files)
|
||||
note: Playwright not installed; skipped file:// browser check
|
||||
export: PASS (offline site at /root/work/marqdo/tools/view/dist/test-export-site; core sha256 a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee unchanged)
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/4db88ce592e41fad/out/contract-4db88ce592e41fad)
|
||||
|
||||
running 53 tests
|
||||
test cli_surface::degradation_without_core_keeps_prose_readable ... ok
|
||||
test asset_integrity::theme_has_one_token_layer_and_no_legacy_skin ... ok
|
||||
test cli_surface::browse_on_missing_path_fails_without_starting_a_server ... ok
|
||||
test cli_surface::export_requires_an_output_directory ... ok
|
||||
test cli_surface::non_loopback_bind_is_refused_by_default ... ok
|
||||
test cli_surface::missing_document_is_an_io_error ... ok
|
||||
test cli_surface::help_comes_from_view_not_core ... ok
|
||||
test cli_surface::verify_without_core_is_an_argument_error ... ok
|
||||
test cli_surface::version_is_the_tool_version ... ok
|
||||
test asset_integrity::reused_assets_match_their_recorded_hashes ... ok
|
||||
test core_contract::analysis_v2_revision_is_a_hard_protocol_error ... ok
|
||||
test core_contract::default_run_does_not_request_variable_or_parameter_values ... ok
|
||||
test core_contract::check_failure_preserves_core_stderr_and_code ... ok
|
||||
test core_contract::check_refs_is_forwarded_as_a_stricter_flag ... ok
|
||||
test core_contract::check_returns_exact_analysis_bytes_and_digest ... ok
|
||||
test core_contract::installed_tool_api_revision_is_enforced_at_the_process_boundary ... ok
|
||||
test core_contract::missing_required_analysis_fields_are_rejected ... ok
|
||||
test core_contract::current_rc_version_is_accepted ... ok
|
||||
test core_contract::run_and_call_argv_use_the_current_observation_flags_only ... ok
|
||||
test core_contract::failed_check_normalizes_diagnostics_without_absolute_paths ... ok
|
||||
test core_contract::incompatible_product_version_is_rejected_before_any_work ... ok
|
||||
test core_contract::tool_api_revision_environment_is_an_exact_expectation ... ok
|
||||
test core_contract::strict_mode_run_request_is_rejected_by_view_validation ... ok
|
||||
test core_contract::unknown_analysis_schema_name_or_major_is_rejected ... ok
|
||||
test core_contract::unknown_module_and_unit_references_are_rejected ... ok
|
||||
test no_coupling::no_private_core_crate_dependencies ... ok
|
||||
test no_coupling::release_lockfile_is_committed ... ok
|
||||
test core_contract::missing_emit_after_success_is_an_analysis_failure ... ok
|
||||
test core_contract::cli_verify_end_to_end_against_fake_core ... ok
|
||||
test no_coupling::tool_manifest_matches_package_and_protocols ... ok
|
||||
test no_coupling::exactly_one_reader_theme_and_script_entry ... ok
|
||||
test core_contract::retired_revision_3_shape_is_rejected_with_a_rebuild_hint ... ok
|
||||
test core_contract::source_digest_mismatch_is_not_silently_accepted ... ok
|
||||
test no_coupling::source_has_no_legacy_protocol_or_runtime_probing ... ok
|
||||
test observation_contract::rejected_before_start_is_a_valid_failed_terminal ... ok
|
||||
test observation_contract::eof_without_terminal_is_incomplete_never_success ... ok
|
||||
test observation_contract::real_jsonl_stream_verifies_and_binds_to_analysis_digest ... ok
|
||||
test observation_contract::unknown_schema_and_revision_are_rejected ... ok
|
||||
test asset_integrity::embedded_asset_bundle_matches_disk_and_has_one_theme ... ok
|
||||
test observation_contract::stale_and_wrong_root_bindings_are_observation_stale ... ok
|
||||
test observation_contract::truncated_observation_is_a_terminal_but_never_complete ... ok
|
||||
test observation_contract::stream_and_snapshot_of_the_same_run_agree ... ok
|
||||
test presentation_states::missing_core_stays_readable_and_explicitly_unverified ... ok
|
||||
test presentation_states::external_projection_can_be_rendered_from_artifact_source ... ok
|
||||
test no_coupling::source_never_reads_or_links_the_legacy_repositories ... ok
|
||||
test presentation_states::truncated_and_incomplete_runs_never_display_as_success ... ok
|
||||
test presentation_states::failed_check_keeps_prose_and_shows_core_diagnostics ... ok
|
||||
test observation_contract::lifecycle_negative_cases_fail_closed ... ok
|
||||
test presentation_states::invalid_analysis_span_is_rejected_not_trimmed ... ok
|
||||
test core_contract::cli_verify_rejects_schema_v2_and_digest_mismatch ... ok
|
||||
test presentation_states::source_digest_mismatch_degrades_instead_of_misbinding ... ok
|
||||
test presentation_states::unknown_analysis_schema_is_a_hard_protocol_error ... ok
|
||||
test presentation_states::run_attached_to_changed_source_becomes_stale ... ok
|
||||
|
||||
test result: ok. 53 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
|
||||
|
||||
removed tool `view`
|
||||
@@ -0,0 +1 @@
|
||||
check-docs: PASS (README/COMPATIBILITY/CHANGELOG/STATUS/ACCEPTANCE describe the rc.5 baseline; CHANGELOG history is explicit)
|
||||
@@ -0,0 +1 @@
|
||||
browser: SKIP (SKIP_BROWSER=1)
|
||||
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"cli_archive_sha256": "sha256:fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b",
|
||||
"cli_binary_sha256": "sha256:a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee",
|
||||
"cli_source_sha": "c44b0f943875d563bb7c170f8ccd3fd56a82360f",
|
||||
"cli_version": "3.0.0-rc.5",
|
||||
"contracts": {
|
||||
"analysis": 3,
|
||||
"api_revision": 1,
|
||||
"observation": 1
|
||||
},
|
||||
"extras": {
|
||||
"browser": "UNVERIFIED",
|
||||
"cargo_tests_passed": 174,
|
||||
"notes": "Generated from real command exit statuses. UNVERIFIED gates are not release evidence and must never be read as PASS."
|
||||
},
|
||||
"gates": {
|
||||
"G01_no_legacy": {
|
||||
"command": "./scripts/check-no-legacy.sh",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G01_no_legacy.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G02_build": {
|
||||
"command": "cargo fmt --all -- --check && cargo clippy --locked --all-targets -- -D warnings && cargo test --locked && cargo build --release --locked",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G02_build.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G03_install": {
|
||||
"command": "scripts/package.sh && marqdo tool install/list/remove && marqdo view --help && scripts/install-smoke.sh && tamper refusal",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G03_install.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G04_static": {
|
||||
"command": "\"/root/work/marqdo/.build/release-rc5/install/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo\" view verify examples/mixed-modes/index.mq.md && MARQDO_BIN=\"/root/work/marqdo/.build/release-rc5/install/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo\" ./scripts/check-examples.sh",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G04_static.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G05_run": {
|
||||
"command": "installed marqdo view examples/welcome + scripts/acceptance-run.py over SSE",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G05_run.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G06_stream_snapshot": {
|
||||
"command": "python3 scripts/check-observation.py stream-snapshot",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G06_stream_snapshot.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G07_binding_stale": {
|
||||
"command": "python3 scripts/check-observation.py binding && cargo test --lib execution::controller::tests::stale_and_incomplete_never_map_to_success && cargo test --test integration execution::source_edit_during_a_run_marks_the_result_stale_and_drops_anchor_ids && cargo test --test contract observation_contract::stale_and_wrong_root_bindings_are_observation_stale",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G07_binding_stale.log",
|
||||
"note": "CLI exact-byte binding probe + controller unit mapping + real run/source-change e2e + wrong-digest stale contract all PASS",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G08_negative": {
|
||||
"command": "python3 scripts/check-observation.py fail-closed && cargo test --lib execution:: && cargo test --test contract observation_contract:: && cargo test --test contract core_contract:: && cargo test --test contract presentation_states:: && cargo test --test contract no_coupling:: && cargo test --test security",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G08_negative.log",
|
||||
"note": "N01-N11 decoder/contract negatives, N12-N13 controller hard rejection, N14-N15 CLI fail-closed probes, N16 G01 static check, N17 tool_v1 product-range unit test, N18-N20 security suite: all PASS",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G09_security": {
|
||||
"command": "env MARQDO_BIN=\"/root/work/marqdo/.build/release-rc5/install/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo\" ./scripts/test-no-exec.sh && ./scripts/test-security.sh",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G09_security.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G10_export": {
|
||||
"command": "env MARQDO_BIN=\"/root/work/marqdo/.build/release-rc5/install/marqdo-3.0.0-rc.5-x86_64-unknown-linux-gnu/marqdo\" ./scripts/test-export.sh && cargo test --locked --test contract",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G10_export.log",
|
||||
"state": "PASS"
|
||||
},
|
||||
"G11_evidence_ci": {
|
||||
"command": "remote CI run",
|
||||
"exit_code": null,
|
||||
"note": "remote CI was not executed in this environment; this local manifest cannot attest CI. CI red => no release.",
|
||||
"state": "UNVERIFIED"
|
||||
},
|
||||
"G12_docs": {
|
||||
"command": "./scripts/check-docs.sh",
|
||||
"exit_code": 0,
|
||||
"log": "docs/evidence/c44b0f943875d563bb7c170f8ccd3fd56a82360f/logs/G12_docs.log",
|
||||
"state": "PASS"
|
||||
}
|
||||
},
|
||||
"generated_utc": "2026-11-27T07:15:39.340746+00:00",
|
||||
"markdown_profile": "marqdo.md.v1",
|
||||
"platform": "linux-x86_64-glibc2.39",
|
||||
"product": {
|
||||
"name": "marqdo-view",
|
||||
"target": "linux-x86_64-glibc2.39",
|
||||
"version": "0.3.0"
|
||||
},
|
||||
"product_range": ">=3.0.0-rc.3,<4.0.0",
|
||||
"result": "PARTIAL",
|
||||
"schema": "marqdo.view.acceptance",
|
||||
"schema_version": 1,
|
||||
"unverified": [
|
||||
"G11_evidence_ci"
|
||||
],
|
||||
"view_binary_sha256": "sha256:9cf9468858d343d2cbc79981b87869660d1b6db4cad60ed5d7b66e8c96b6204e",
|
||||
"view_commit": "39e83554d75028990f0224cb1d791cc727419044",
|
||||
"view_tool_bundle_digest": "sha256:86cc2a9c10b1a83d33c51b3ceef8c9e9a9bc0143fb734ea0c40f9e745b8db826",
|
||||
"view_tool_bundle_digest_method": "sha256 of the canonical SHA256SUMS file bytes in the bundle"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# G12 (issue #5): current documentation must describe the rc.4 contracts as the
|
||||
# G12 (issue #5): current documentation must describe the rc.5 contracts as the
|
||||
# only current capability. Historical CHANGELOG entries may name retired
|
||||
# interfaces only under an explicit `## History` heading.
|
||||
#
|
||||
@@ -7,7 +7,7 @@
|
||||
# README.md, COMPATIBILITY.md, CHANGELOG.md, docs/STATUS.md, docs/ACCEPTANCE.md
|
||||
#
|
||||
# The script never rewrites files and never claims a gate is PASS: it only
|
||||
# reports fact drift between the current docs and the rc.4 contract baseline.
|
||||
# reports fact drift between the current docs and the rc.5 contract baseline.
|
||||
#
|
||||
# Usage: scripts/check-docs.sh
|
||||
set -euo pipefail
|
||||
@@ -73,17 +73,17 @@ if [[ "$fail" -ne 0 ]]; then
|
||||
cat >&2 <<'EOF'
|
||||
|
||||
check-docs: FAIL
|
||||
Update the current docs to the rc.4 baseline:
|
||||
Update the current docs to the rc.5 baseline:
|
||||
* one static source: `check --emit` Analysis revision 3 (ADR-0069);
|
||||
* one runtime sequence: Observation revision 1 (`--output jsonl` /
|
||||
`--observation-file`), no retired trace file or event stream;
|
||||
* CLI Tool revision 1 with exact `requires` (api_revision 1, analysis 3,
|
||||
observation 1), no `compatibility` field;
|
||||
* product range >=3.0.0-rc.3,<4.0.0, acceptance pinned to rc.4.
|
||||
* product range >=3.0.0-rc.3,<4.0.0, acceptance pinned to rc.5.
|
||||
Old release notes belong under CHANGELOG's explicit `## History` heading.
|
||||
Do not claim PASS/UNVERIFIED results that have no generated evidence.
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "check-docs: PASS (README/COMPATIBILITY/CHANGELOG/STATUS/ACCEPTANCE describe the rc.4 baseline; CHANGELOG history is explicit)"
|
||||
echo "check-docs: PASS (README/COMPATIBILITY/CHANGELOG/STATUS/ACCEPTANCE describe the rc.5 baseline; CHANGELOG history is explicit)"
|
||||
@@ -2,15 +2,15 @@
|
||||
# Identity of the released CLI used by the marqdo-view 0.3.0 acceptance gate.
|
||||
#
|
||||
# The pinned release is the current public-contract baseline:
|
||||
# marqdo 3.0.0-rc.4 (Analysis v3 / ADR-0069, Observation v1, CLI Tool revision 1)
|
||||
# marqdo 3.0.0-rc.5 (Analysis v3 / ADR-0069, Observation v1, CLI Tool revision 1)
|
||||
# The script only downloads, unpacks and verifies the official archive; it never
|
||||
# rebuilds or modifies the CLI.
|
||||
set -euo pipefail
|
||||
|
||||
version=3.0.0-rc.4
|
||||
source_sha=452e9a32bd9e40dba427d4180691c58bab74449e
|
||||
binary_sha=a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e
|
||||
archive_sha=9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8
|
||||
version=3.0.0-rc.5
|
||||
source_sha=c44b0f943875d563bb7c170f8ccd3fd56a82360f
|
||||
binary_sha=a19049ee111f41512a69c5ed748aaa4968eb3a3f5abd585ccdcf9bbb201bd7ee
|
||||
archive_sha=fd7a313e0ddaf38a9b1901ff2a9aa7b9a0a153e65522a9c0c60f01e2549f583b
|
||||
artifact="marqdo-$version-x86_64-unknown-linux-gnu"
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
|
||||
+42
-123
@@ -1,130 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build and assemble the CLI Tool revision 1 release bundle for marqdo-view 0.3.0.
|
||||
#!/bin/sh
|
||||
# Deterministic source archive + release-evidence.json for this component.
|
||||
#
|
||||
# Produces:
|
||||
# dist/marqdo-view/ stable bundle path
|
||||
# dist/marqdo-view-<version>-<target>.tar.gz (+ .sha256)
|
||||
#
|
||||
# The bundle contains only the runtime binary, the manifest and the legal /
|
||||
# release-note files. CSS/JS/images are compiled into the binary (ADR-0002),
|
||||
# so there is exactly one asset source for Live and Export.
|
||||
#
|
||||
# The current public contracts are exact: api_revision 1, Analysis 3 and
|
||||
# Observation 1. There is no version negotiation and no `compatibility` field.
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$repo_root"
|
||||
|
||||
: "${CARGO:=cargo}"
|
||||
: "${MARQDO_BIN:=}"
|
||||
|
||||
version="$("$CARGO" metadata --no-deps --format-version 1 \
|
||||
| python3 -c 'import json,sys; print(json.load(sys.stdin)["packages"][0]["version"])')"
|
||||
target="$("$CARGO" -vV 2>/dev/null | sed -n 's/^host: //p')"
|
||||
target="${target:-x86_64-unknown-linux-gnu}"
|
||||
|
||||
echo "==> cargo build --release --locked"
|
||||
"$CARGO" build --release --locked
|
||||
|
||||
dist="$repo_root/dist"
|
||||
bundle="$dist/marqdo-view"
|
||||
rm -rf "$bundle"
|
||||
mkdir -p "$bundle/bin"
|
||||
|
||||
binary="$repo_root/target/release/marqdo-view"
|
||||
if [[ ! -x "$binary" ]]; then
|
||||
echo "error: missing release binary $binary" >&2
|
||||
# Required env:
|
||||
# COMPONENT_ID catalog id (e.g. std-text)
|
||||
# REPOSITORY owner/name (e.g. cflmy/marqdo-std-text)
|
||||
# Optional:
|
||||
# VERSION without leading v (default: derived from CI_COMMIT_TAG)
|
||||
# SOURCE_SHA full commit (default: HEAD)
|
||||
# OUT_DIR default dist
|
||||
# DEPENDENCY repeatable write_evidence dependency specs via env DEP_ARGS
|
||||
set -eu
|
||||
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
COMPONENT_ID=${COMPONENT_ID:?COMPONENT_ID is required}
|
||||
REPOSITORY=${REPOSITORY:?REPOSITORY is required}
|
||||
SOURCE_SHA=${SOURCE_SHA:-$(git -C "$ROOT" rev-parse HEAD)}
|
||||
OUT_DIR=${OUT_DIR:-dist}
|
||||
TAG=${CI_COMMIT_TAG:-${TAG:-}}
|
||||
if [ -n "${VERSION:-}" ]; then
|
||||
:
|
||||
elif [ -n "$TAG" ]; then
|
||||
VERSION=${TAG#v}
|
||||
else
|
||||
echo "package.sh: set VERSION or CI_COMMIT_TAG" >&2
|
||||
exit 1
|
||||
fi
|
||||
TAG=${TAG:-v$VERSION}
|
||||
|
||||
cp "$binary" "$bundle/bin/marqdo-view"
|
||||
chmod 755 "$bundle/bin/marqdo-view"
|
||||
cp tool.json "$bundle/tool.json"
|
||||
cp README.md COMPATIBILITY.md CHANGELOG.md LICENSE-MIT LICENSE-APACHE "$bundle/"
|
||||
python3 "$ROOT/scripts/release/package_source.py" \
|
||||
--root "$ROOT" \
|
||||
--component-id "$COMPONENT_ID" \
|
||||
--version "$VERSION" \
|
||||
--out-dir "$OUT_DIR"
|
||||
|
||||
# Verify the tool manifest and the binary agree on the version.
|
||||
manifest_version="$(python3 -c 'import json;print(json.load(open("tool.json"))["version"])')"
|
||||
if [[ "$manifest_version" != "$version" ]]; then
|
||||
echo "error: tool.json version $manifest_version != package version $version" >&2
|
||||
exit 1
|
||||
ARCHIVE=$(ls "$ROOT/$OUT_DIR"/marqdo-"$COMPONENT_ID"-"$VERSION"-source.tar.gz)
|
||||
SHAFILE="$ARCHIVE.sha256"
|
||||
|
||||
EVIDENCE_ARGS="--component-id $COMPONENT_ID --repository $REPOSITORY --tag $TAG --source-sha $SOURCE_SHA --asset $ARCHIVE --asset $SHAFILE --out $ROOT/$OUT_DIR/release-evidence.json"
|
||||
if [ -n "${CI_PIPELINE_NUMBER:-}" ]; then
|
||||
EVIDENCE_ARGS="$EVIDENCE_ARGS --pipeline-number $CI_PIPELINE_NUMBER"
|
||||
fi
|
||||
binary_version="$("$bundle/bin/marqdo-view" --version | awk '{print $2}')"
|
||||
if [[ "$binary_version" != "$version" ]]; then
|
||||
echo "error: binary prints version $binary_version, package is $version" >&2
|
||||
exit 1
|
||||
if [ -n "${CI_PIPELINE_URL:-}" ]; then
|
||||
EVIDENCE_ARGS="$EVIDENCE_ARGS --pipeline-url $CI_PIPELINE_URL"
|
||||
fi
|
||||
|
||||
source_sha="unknown"
|
||||
if git rev-parse --verify HEAD >/dev/null 2>&1; then
|
||||
source_sha="$(git rev-parse HEAD)"
|
||||
fi
|
||||
printf '%s\n' "$source_sha" > "$bundle/SOURCE_SHA"
|
||||
|
||||
python3 - "$bundle" "$version" "$target" "$source_sha" <<'PY'
|
||||
import hashlib
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
bundle = pathlib.Path(sys.argv[1])
|
||||
version, target, source_sha = sys.argv[2], sys.argv[3], sys.argv[4]
|
||||
tool = json.loads((bundle / 'tool.json').read_text())
|
||||
requires = tool.get('requires') or {}
|
||||
if 'compatibility' in tool:
|
||||
raise SystemExit('tool.json must not contain a compatibility field')
|
||||
if requires != {'api_revision': 1, 'analysis': 3, 'observation': 1}:
|
||||
raise SystemExit('tool.json requires must be exactly api_revision 1 / analysis 3 / observation 1')
|
||||
files = []
|
||||
for path in sorted(bundle.rglob('*')):
|
||||
if not path.is_file():
|
||||
continue
|
||||
rel = path.relative_to(bundle).as_posix()
|
||||
if rel in ('RELEASE_INFO.json', 'SHA256SUMS'):
|
||||
continue
|
||||
data = path.read_bytes()
|
||||
files.append({
|
||||
'path': rel,
|
||||
'size': len(data),
|
||||
'sha256': hashlib.sha256(data).hexdigest(),
|
||||
})
|
||||
info = {
|
||||
'schema': 'marqdo.view-release-info',
|
||||
'schema_version': 1,
|
||||
'tool_name': 'marqdo-view',
|
||||
'tool_version': version,
|
||||
'command': 'view',
|
||||
'target': target,
|
||||
'source_sha': source_sha,
|
||||
'requires': {
|
||||
'api_revision': 1,
|
||||
'analysis': 3,
|
||||
'observation': 1,
|
||||
},
|
||||
'release': {
|
||||
'product_range': '>=3.0.0-rc.3,<4.0.0',
|
||||
'markdown_profile': 'marqdo.md.v1',
|
||||
'platform': 'linux-x86_64-glibc2.39',
|
||||
},
|
||||
'files': files,
|
||||
}
|
||||
(bundle / 'RELEASE_INFO.json').write_text(json.dumps(info, indent=2, sort_keys=True) + '\n')
|
||||
with (bundle / 'SHA256SUMS').open('w') as out:
|
||||
for entry in files:
|
||||
out.write(f"{entry['sha256']} {entry['path']}\n")
|
||||
PY
|
||||
|
||||
# Deterministic archive: sorted paths, fixed owner, gzip without timestamps.
|
||||
archive="marqdo-view-${version}-${target}.tar.gz"
|
||||
tar --sort=name --owner=0 --group=0 --numeric-owner --mtime='UTC 2026-01-01' \
|
||||
-C "$dist" -cf - marqdo-view | gzip -n > "$dist/$archive"
|
||||
( cd "$dist" && sha256sum "$archive" > "$archive.sha256" )
|
||||
|
||||
if [[ -n "$MARQDO_BIN" ]]; then
|
||||
echo "==> smoke install against frozen core"
|
||||
MARQDO_BIN="$MARQDO_BIN" "$repo_root/scripts/install-smoke.sh" "$bundle/tool.json"
|
||||
fi
|
||||
|
||||
echo "bundle: $bundle"
|
||||
echo "archive: $dist/$archive"
|
||||
echo "sha256: $(cut -d' ' -f1 "$dist/$archive.sha256")"
|
||||
# shellcheck disable=SC2086
|
||||
eval "python3 \"$ROOT/scripts/release/write_evidence.py\" $EVIDENCE_ARGS ${DEP_ARGS:-}"
|
||||
echo "$ARCHIVE"
|
||||
echo "$SHAFILE"
|
||||
echo "$ROOT/$OUT_DIR/release-evidence.json"
|
||||
@@ -0,0 +1,9 @@
|
||||
# Vendored from marqdo scripts/component-release
|
||||
#
|
||||
# Do not edit in place across repositories. Change the root copy, re-test,
|
||||
# then re-run install-vendor.sh and record the hashes below.
|
||||
#
|
||||
# package_source.py sha256=cb18c2f7fbe807f55d49e2cf77720f0d3e57d355177d2b127ac09e119f90c6ae
|
||||
# write_evidence.py sha256=bb194bfd251e39308bc1dd53f46fd9efac181082ea43f668484b067d9e54acfc
|
||||
# publish_gitea.py sha256=a21a84146d9ea826eb8d0632a18a991b0c39f17005d83bd988c92fc608f67523
|
||||
# notify_root.py sha256=8eee83eb2bb31b99d93981f2a97fc2f0f9a486cc3c5c072f7dc12cfb63baf025
|
||||
Executable
+103
@@ -0,0 +1,103 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Ask the root Marqdo reconcile workflow to scan after a release.
|
||||
|
||||
The payload is only a hint. Correctness comes from the root
|
||||
`scripts/reconcile-releases.py` reading authoritative Gitea releases.
|
||||
Lost notifications are recovered by the root `release-reconcile` cron.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
DEFAULT_URL = "https://ci.cflmy.cn/api/repos/6/pipelines"
|
||||
DEFAULT_BODY = {"branch": "main", "workflow": "reconcile"}
|
||||
|
||||
|
||||
class NotifyError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def token() -> str:
|
||||
value = (
|
||||
os.environ.get("WOODPECKER_NOTIFY_TOKEN")
|
||||
or os.environ.get("WOODPECKER_TOKEN")
|
||||
or os.environ.get("woodpecker_token")
|
||||
)
|
||||
if not value:
|
||||
raise NotifyError("WOODPECKER_NOTIFY_TOKEN (or WOODPECKER_TOKEN) is not set")
|
||||
return value
|
||||
|
||||
|
||||
def trigger(url: str, token_value: str, body: dict, attempts: int = 3) -> dict:
|
||||
payload = json.dumps(body).encode()
|
||||
last_error: Exception | None = None
|
||||
for attempt in range(1, attempts + 1):
|
||||
request = urllib.request.Request(
|
||||
url,
|
||||
data=payload,
|
||||
method="POST",
|
||||
headers={
|
||||
"Authorization": f"Bearer {token_value}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
},
|
||||
)
|
||||
try:
|
||||
with urllib.request.urlopen(request, timeout=60) as response:
|
||||
raw = response.read()
|
||||
decoded = json.loads(raw) if raw else {}
|
||||
return {
|
||||
"status": "triggered",
|
||||
"http_status": response.status,
|
||||
"pipeline_id": decoded.get("id"),
|
||||
"pipeline_number": decoded.get("number"),
|
||||
"attempt": attempt,
|
||||
}
|
||||
except urllib.error.HTTPError as error:
|
||||
# Auth/permission failures must not retry forever.
|
||||
if error.code in (401, 403, 404):
|
||||
raise NotifyError(f"trigger rejected with HTTP {error.code}") from error
|
||||
last_error = error
|
||||
except urllib.error.URLError as error:
|
||||
last_error = error
|
||||
if attempt < attempts:
|
||||
delay = (2 ** (attempt - 1)) + random.uniform(0, 0.5)
|
||||
time.sleep(delay)
|
||||
raise NotifyError(f"trigger failed after {attempts} attempts: {last_error}")
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--url", default=os.environ.get("MARQDO_RECONCILE_TRIGGER_URL", DEFAULT_URL))
|
||||
parser.add_argument("--branch", default="main")
|
||||
parser.add_argument("--workflow", default="reconcile")
|
||||
parser.add_argument("--hint-component", default="")
|
||||
parser.add_argument("--hint-tag", default="")
|
||||
parser.add_argument("--attempts", type=int, default=3)
|
||||
args = parser.parse_args(argv)
|
||||
body = {"branch": args.branch, "workflow": args.workflow}
|
||||
# Hints are informational only; the root reconcile never trusts them as commands.
|
||||
if args.hint_component or args.hint_tag:
|
||||
body["variables"] = {
|
||||
"MARQDO_RELEASE_HINT_COMPONENT": args.hint_component,
|
||||
"MARQDO_RELEASE_HINT_TAG": args.hint_tag,
|
||||
}
|
||||
try:
|
||||
result = trigger(args.url, token(), body, attempts=max(1, args.attempts))
|
||||
except NotifyError as error:
|
||||
print(f"notify_root: FAIL: {error}", file=sys.stderr)
|
||||
return 1
|
||||
print(json.dumps(result, indent=2, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Executable
+145
@@ -0,0 +1,145 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build a deterministic source archive for a Marqdo component release.
|
||||
|
||||
Only allowlisted relative paths are included. The archive uses fixed mtime,
|
||||
uid/gid, and sorted member names so the same tree always yields the same
|
||||
sha256. Output is written under an isolated directory (default: dist/).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
import tarfile
|
||||
from pathlib import Path
|
||||
|
||||
DEFAULT_ALLOWLIST = (
|
||||
"modules",
|
||||
"index.mq.md",
|
||||
"marqdo.yaml",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
)
|
||||
FIXED_MTIME = 0
|
||||
EVIDENCE_NAME = "release-evidence.json"
|
||||
|
||||
|
||||
class PackageError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def fail(message: str) -> None:
|
||||
raise PackageError(message)
|
||||
|
||||
|
||||
def is_safe_relative(path: str) -> bool:
|
||||
if not path or path.startswith("/") or path.startswith("\\"):
|
||||
return False
|
||||
parts = Path(path).parts
|
||||
return not any(part in (".", "..") for part in parts)
|
||||
|
||||
|
||||
def collect_files(root: Path, allowlist: list[str]) -> list[tuple[str, Path]]:
|
||||
selected: dict[str, Path] = {}
|
||||
for entry in allowlist:
|
||||
if not is_safe_relative(entry):
|
||||
fail(f"unsafe allowlist entry: {entry!r}")
|
||||
target = root / entry
|
||||
if not target.exists():
|
||||
continue
|
||||
if target.is_file():
|
||||
selected[entry.replace("\\", "/")] = target
|
||||
continue
|
||||
if not target.is_dir():
|
||||
fail(f"allowlist entry is not a regular file or directory: {entry}")
|
||||
for path in sorted(target.rglob("*")):
|
||||
if not path.is_file():
|
||||
continue
|
||||
if path.is_symlink():
|
||||
fail(f"symlinks are not publishable: {path.relative_to(root)}")
|
||||
relative = path.relative_to(root).as_posix()
|
||||
if not is_safe_relative(relative):
|
||||
fail(f"unsafe relative path: {relative}")
|
||||
selected[relative] = path
|
||||
if not selected:
|
||||
fail("allowlist matched no files")
|
||||
return sorted(selected.items(), key=lambda item: item[0])
|
||||
|
||||
|
||||
def archive_bytes(files: list[tuple[str, Path]]) -> bytes:
|
||||
buffer = io.BytesIO()
|
||||
with tarfile.open(fileobj=buffer, mode="w:gz", format=tarfile.PAX_FORMAT, compresslevel=9) as archive:
|
||||
for relative, path in files:
|
||||
data = path.read_bytes()
|
||||
info = tarfile.TarInfo(name=relative)
|
||||
info.size = len(data)
|
||||
info.mtime = FIXED_MTIME
|
||||
info.uid = 0
|
||||
info.gid = 0
|
||||
info.uname = ""
|
||||
info.gname = ""
|
||||
info.mode = 0o644
|
||||
archive.addfile(info, io.BytesIO(data))
|
||||
return buffer.getvalue()
|
||||
|
||||
|
||||
def write_outputs(
|
||||
root: Path,
|
||||
out_dir: Path,
|
||||
component_id: str,
|
||||
version: str,
|
||||
allowlist: list[str],
|
||||
) -> dict:
|
||||
files = collect_files(root, allowlist)
|
||||
payload = archive_bytes(files)
|
||||
digest = hashlib.sha256(payload).hexdigest()
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
archive_name = f"marqdo-{component_id}-{version}-source.tar.gz"
|
||||
archive_path = out_dir / archive_name
|
||||
sha_path = out_dir / f"{archive_name}.sha256"
|
||||
archive_path.write_bytes(payload)
|
||||
sha_path.write_text(f"{digest} {archive_name}\n", encoding="utf-8")
|
||||
return {
|
||||
"archive": str(archive_path),
|
||||
"sha256_file": str(sha_path),
|
||||
"name": archive_name,
|
||||
"size": len(payload),
|
||||
"sha256": digest,
|
||||
"files": [relative for relative, _ in files],
|
||||
}
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--root", default=".", help="component repository root")
|
||||
parser.add_argument("--component-id", required=True)
|
||||
parser.add_argument("--version", required=True, help="version without leading v")
|
||||
parser.add_argument("--out-dir", default="dist")
|
||||
parser.add_argument(
|
||||
"--allow",
|
||||
action="append",
|
||||
default=[],
|
||||
help="relative allowlist entry (repeatable); defaults applied when omitted",
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
allowlist = args.allow or list(DEFAULT_ALLOWLIST)
|
||||
root = Path(args.root).resolve()
|
||||
out_dir = Path(args.out_dir)
|
||||
if not out_dir.is_absolute():
|
||||
out_dir = root / out_dir
|
||||
try:
|
||||
result = write_outputs(root, out_dir, args.component_id, args.version, allowlist)
|
||||
except PackageError as error:
|
||||
print(f"package_source: FAIL: {error}", file=sys.stderr)
|
||||
return 1
|
||||
print(result["archive"])
|
||||
print(result["sha256_file"])
|
||||
print(f"sha256={result['sha256']} size={result['size']} files={len(result['files'])}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Executable
+352
@@ -0,0 +1,352 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Publish a Gitea release with a draft transaction and immutable public assets.
|
||||
|
||||
Order (issue #10 §4.2):
|
||||
create/reuse draft → upload non-index assets → upload release-evidence.json last
|
||||
→ re-read and verify → mark non-draft → re-confirm.
|
||||
|
||||
Never deletes or replaces assets on an already-published (non-draft) release.
|
||||
Identical published identity is treated as idempotent success.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import mimetypes
|
||||
import os
|
||||
import sys
|
||||
import urllib.error
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
|
||||
DEFAULT_API = "https://git.cflmy.cn/api/v1"
|
||||
INDEX_NAME = "release-evidence.json"
|
||||
|
||||
|
||||
class PublishError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def token() -> str:
|
||||
value = (
|
||||
os.environ.get("GITEA_PUBLISH_TOKEN")
|
||||
or os.environ.get("GITEA_TOKEN")
|
||||
or os.environ.get("gitea_token")
|
||||
)
|
||||
if not value:
|
||||
raise PublishError("GITEA_PUBLISH_TOKEN (or GITEA_TOKEN) is not set")
|
||||
return value
|
||||
|
||||
|
||||
def request(
|
||||
api: str,
|
||||
method: str,
|
||||
path: str,
|
||||
token_value: str,
|
||||
payload: dict | None = None,
|
||||
raw: bytes | None = None,
|
||||
content_type: str = "application/json",
|
||||
) -> tuple[int, bytes]:
|
||||
url = f"{api}{path}"
|
||||
headers = {"Authorization": f"token {token_value}", "Accept": "application/json"}
|
||||
data = None
|
||||
if payload is not None:
|
||||
data = json.dumps(payload).encode()
|
||||
headers["Content-Type"] = content_type
|
||||
elif raw is not None:
|
||||
data = raw
|
||||
headers["Content-Type"] = content_type
|
||||
req = urllib.request.Request(url, data=data, headers=headers, method=method)
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=120) as response:
|
||||
return response.status, response.read()
|
||||
except urllib.error.HTTPError as error:
|
||||
return error.code, error.read()
|
||||
|
||||
|
||||
def decode(body: bytes) -> object:
|
||||
if not body:
|
||||
return None
|
||||
try:
|
||||
return json.loads(body)
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
def sha256_file(path: Path) -> str:
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def get_release_by_tag(api: str, repo: str, tag: str, token_value: str) -> dict | None:
|
||||
status, body = request(
|
||||
api,
|
||||
"GET",
|
||||
f"/repos/{repo}/releases/tags/{urllib.parse.quote(tag, safe='')}",
|
||||
token_value,
|
||||
)
|
||||
if status == 404:
|
||||
return None
|
||||
if status != 200:
|
||||
raise PublishError(f"lookup release {tag} failed with HTTP {status}")
|
||||
release = decode(body)
|
||||
if not isinstance(release, dict) or "id" not in release:
|
||||
raise PublishError("release lookup response malformed")
|
||||
return release
|
||||
|
||||
|
||||
def create_draft(
|
||||
api: str,
|
||||
repo: str,
|
||||
tag: str,
|
||||
body: str,
|
||||
token_value: str,
|
||||
*,
|
||||
prerelease: bool,
|
||||
target: str,
|
||||
) -> dict:
|
||||
payload = {
|
||||
"tag_name": tag,
|
||||
"name": tag,
|
||||
"body": body,
|
||||
"draft": True,
|
||||
"prerelease": prerelease,
|
||||
"target_commitish": target,
|
||||
}
|
||||
status, response = request(api, "POST", f"/repos/{repo}/releases", token_value, payload)
|
||||
if status not in (200, 201):
|
||||
raise PublishError(f"creating draft release failed with HTTP {status}: {response[:200]!r}")
|
||||
release = decode(response)
|
||||
if not isinstance(release, dict) or "id" not in release:
|
||||
raise PublishError("draft create response malformed")
|
||||
return release
|
||||
|
||||
|
||||
def patch_release(api: str, repo: str, release_id: int, token_value: str, payload: dict) -> dict:
|
||||
status, response = request(
|
||||
api, "PATCH", f"/repos/{repo}/releases/{release_id}", token_value, payload
|
||||
)
|
||||
if status != 200:
|
||||
raise PublishError(f"updating release {release_id} failed with HTTP {status}")
|
||||
release = decode(response)
|
||||
if not isinstance(release, dict):
|
||||
raise PublishError("release patch response malformed")
|
||||
return release
|
||||
|
||||
|
||||
def list_assets(api: str, repo: str, release_id: int, token_value: str) -> list[dict]:
|
||||
status, response = request(
|
||||
api, "GET", f"/repos/{repo}/releases/{release_id}/assets", token_value
|
||||
)
|
||||
if status != 200:
|
||||
raise PublishError(f"listing assets failed with HTTP {status}")
|
||||
assets = decode(response)
|
||||
if not isinstance(assets, list):
|
||||
raise PublishError("asset list malformed")
|
||||
return assets
|
||||
|
||||
|
||||
def upload_asset(
|
||||
api: str, repo: str, release_id: int, path: Path, token_value: str
|
||||
) -> dict:
|
||||
name = path.name
|
||||
if not name or "/" in name or name in (".", ".."):
|
||||
raise PublishError(f"unsafe asset name: {name!r}")
|
||||
existing = list_assets(api, repo, release_id, token_value)
|
||||
for asset in existing:
|
||||
if asset.get("name") == name:
|
||||
raise PublishError(
|
||||
f"asset {name} already exists on draft/release {release_id}; "
|
||||
"refusing to overwrite"
|
||||
)
|
||||
boundary = f"----marqdo{uuid.uuid4().hex}"
|
||||
content_type = mimetypes.guess_type(name)[0] or "application/octet-stream"
|
||||
body = bytearray()
|
||||
body.extend(f"--{boundary}\r\n".encode())
|
||||
body.extend(
|
||||
f'Content-Disposition: form-data; name="attachment"; filename="{name}"\r\n'.encode()
|
||||
)
|
||||
body.extend(f"Content-Type: {content_type}\r\n\r\n".encode())
|
||||
body.extend(path.read_bytes())
|
||||
body.extend(f"\r\n--{boundary}--\r\n".encode())
|
||||
status, response = request(
|
||||
api,
|
||||
"POST",
|
||||
f"/repos/{repo}/releases/{release_id}/assets?name={urllib.parse.quote(name)}",
|
||||
token_value,
|
||||
raw=bytes(body),
|
||||
content_type=f"multipart/form-data; boundary={boundary}",
|
||||
)
|
||||
if status not in (200, 201):
|
||||
raise PublishError(f"uploading {name} failed with HTTP {status}: {response[:200]!r}")
|
||||
result = decode(response)
|
||||
if not isinstance(result, dict):
|
||||
raise PublishError(f"upload response for {name} malformed")
|
||||
return result
|
||||
|
||||
|
||||
def asset_identity(path: Path) -> dict:
|
||||
return {
|
||||
"name": path.name,
|
||||
"size": path.stat().st_size,
|
||||
"sha256": sha256_file(path),
|
||||
}
|
||||
|
||||
|
||||
def published_matches(release: dict, expected: list[dict]) -> bool:
|
||||
remote = {
|
||||
asset.get("name"): int(asset.get("size") or -1)
|
||||
for asset in (release.get("assets") or [])
|
||||
}
|
||||
if set(remote) != {item["name"] for item in expected}:
|
||||
return False
|
||||
for item in expected:
|
||||
if remote.get(item["name"]) != item["size"]:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def publish(
|
||||
*,
|
||||
api: str,
|
||||
repo: str,
|
||||
tag: str,
|
||||
body: str,
|
||||
target: str,
|
||||
assets: list[Path],
|
||||
prerelease: bool,
|
||||
token_value: str,
|
||||
) -> dict:
|
||||
if not assets:
|
||||
raise PublishError("no assets to publish")
|
||||
index_assets = [path for path in assets if path.name == INDEX_NAME]
|
||||
other_assets = [path for path in assets if path.name != INDEX_NAME]
|
||||
if len(index_assets) != 1:
|
||||
raise PublishError("exactly one release-evidence.json is required")
|
||||
ordered = other_assets + index_assets
|
||||
expected = [asset_identity(path) for path in ordered]
|
||||
|
||||
existing = get_release_by_tag(api, repo, tag, token_value)
|
||||
if existing and not existing.get("draft"):
|
||||
if published_matches(existing, expected):
|
||||
return {
|
||||
"status": "idempotent",
|
||||
"release_id": existing["id"],
|
||||
"html_url": existing.get("html_url"),
|
||||
"tag": tag,
|
||||
"assets": expected,
|
||||
}
|
||||
raise PublishError(
|
||||
f"published release {tag} already exists with different assets; "
|
||||
"refusing to overwrite"
|
||||
)
|
||||
|
||||
if existing and existing.get("draft"):
|
||||
release = existing
|
||||
# Keep draft body/target aligned when continuing an interrupted publish.
|
||||
release = patch_release(
|
||||
api,
|
||||
repo,
|
||||
int(release["id"]),
|
||||
token_value,
|
||||
{
|
||||
"name": tag,
|
||||
"body": body,
|
||||
"draft": True,
|
||||
"prerelease": prerelease,
|
||||
"target_commitish": target,
|
||||
},
|
||||
)
|
||||
else:
|
||||
release = create_draft(
|
||||
api, repo, tag, body, token_value, prerelease=prerelease, target=target
|
||||
)
|
||||
|
||||
release_id = int(release["id"])
|
||||
remote_names = {asset.get("name") for asset in list_assets(api, repo, release_id, token_value)}
|
||||
for path in ordered:
|
||||
if path.name in remote_names:
|
||||
# Same-name asset already on this draft: require identical size, else fail.
|
||||
match = next(
|
||||
asset
|
||||
for asset in list_assets(api, repo, release_id, token_value)
|
||||
if asset.get("name") == path.name
|
||||
)
|
||||
if int(match.get("size") or -1) != path.stat().st_size:
|
||||
raise PublishError(
|
||||
f"draft asset {path.name} size mismatch; refusing to overwrite"
|
||||
)
|
||||
continue
|
||||
upload_asset(api, repo, release_id, path, token_value)
|
||||
|
||||
refreshed = get_release_by_tag(api, repo, tag, token_value)
|
||||
if not refreshed or not published_matches(refreshed, expected):
|
||||
raise PublishError("post-upload release asset list does not match local files")
|
||||
|
||||
published = patch_release(
|
||||
api,
|
||||
repo,
|
||||
release_id,
|
||||
token_value,
|
||||
{"draft": False, "prerelease": prerelease, "name": tag, "body": body},
|
||||
)
|
||||
if published.get("draft"):
|
||||
raise PublishError("release remained draft after publish")
|
||||
final = get_release_by_tag(api, repo, tag, token_value)
|
||||
if not final or final.get("draft") or not published_matches(final, expected):
|
||||
raise PublishError("final release confirmation failed")
|
||||
return {
|
||||
"status": "published",
|
||||
"release_id": final["id"],
|
||||
"html_url": final.get("html_url"),
|
||||
"tag": tag,
|
||||
"assets": expected,
|
||||
}
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--api-url", default=os.environ.get("GITEA_API_URL", DEFAULT_API))
|
||||
parser.add_argument("--repo", required=True, help="owner/name")
|
||||
parser.add_argument("--tag", required=True)
|
||||
parser.add_argument("--target", required=True, help="full commit SHA for the tag")
|
||||
parser.add_argument("--body-file", default=None)
|
||||
parser.add_argument("--body", default="")
|
||||
parser.add_argument("--asset", action="append", default=[], required=True)
|
||||
parser.add_argument("--prerelease", action="store_true", default=False)
|
||||
parser.add_argument("--evidence-out", default="dist/gitea-publish-result.json")
|
||||
args = parser.parse_args(argv)
|
||||
body = args.body
|
||||
if args.body_file:
|
||||
body = Path(args.body_file).read_text(encoding="utf-8")
|
||||
assets = [Path(item) for item in args.asset]
|
||||
for path in assets:
|
||||
if not path.is_file():
|
||||
print(f"publish_gitea: FAIL: missing asset {path}", file=sys.stderr)
|
||||
return 1
|
||||
try:
|
||||
result = publish(
|
||||
api=args.api_url.rstrip("/"),
|
||||
repo=args.repo,
|
||||
tag=args.tag,
|
||||
body=body,
|
||||
target=args.target,
|
||||
assets=assets,
|
||||
prerelease=args.prerelease,
|
||||
token_value=token(),
|
||||
)
|
||||
except PublishError as error:
|
||||
print(f"publish_gitea: FAIL: {error}", file=sys.stderr)
|
||||
return 1
|
||||
out = Path(args.evidence_out)
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
out.write_text(json.dumps(result, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
||||
print(json.dumps(result, indent=2, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Executable
+165
@@ -0,0 +1,165 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Write the external release-evidence.json index for a component release.
|
||||
|
||||
The index references already-built assets. It never includes itself in
|
||||
`assets[]` (no self-referential digest). Downstream discoverers hash the index
|
||||
bytes separately when they download it.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
SHA_RE = re.compile(r"^[0-9a-f]{40}$")
|
||||
DIGEST_RE = re.compile(r"^[0-9a-f]{64}$")
|
||||
MAX_ASSETS = 128
|
||||
MAX_DEPENDENCIES = 256
|
||||
INDEX_NAME = "release-evidence.json"
|
||||
|
||||
|
||||
class EvidenceError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def sha256_file(path: Path) -> str:
|
||||
digest = hashlib.sha256()
|
||||
with path.open("rb") as handle:
|
||||
while True:
|
||||
chunk = handle.read(1024 * 1024)
|
||||
if not chunk:
|
||||
break
|
||||
digest.update(chunk)
|
||||
return digest.hexdigest()
|
||||
|
||||
|
||||
def parse_dependency(raw: str) -> dict:
|
||||
# id=cli,source_sha=<40hex>[,asset_sha256=<64hex>]
|
||||
fields = {}
|
||||
for part in raw.split(","):
|
||||
if "=" not in part:
|
||||
raise EvidenceError(f"invalid dependency field: {raw!r}")
|
||||
key, value = part.split("=", 1)
|
||||
fields[key.strip()] = value.strip()
|
||||
component_id = fields.get("id")
|
||||
source_sha = fields.get("source_sha")
|
||||
if not component_id or not source_sha or not SHA_RE.match(source_sha):
|
||||
raise EvidenceError(f"dependency requires id and 40-hex source_sha: {raw!r}")
|
||||
entry = {"id": component_id, "source_sha": source_sha}
|
||||
asset = fields.get("asset_sha256")
|
||||
if asset:
|
||||
if not DIGEST_RE.match(asset):
|
||||
raise EvidenceError(f"invalid asset_sha256 in dependency: {raw!r}")
|
||||
entry["asset_sha256"] = asset
|
||||
return entry
|
||||
|
||||
|
||||
def build_evidence(
|
||||
*,
|
||||
component_id: str,
|
||||
repository: str,
|
||||
tag: str,
|
||||
source_sha: str,
|
||||
assets: list[Path],
|
||||
dependencies: list[dict],
|
||||
pipeline_number: int | None,
|
||||
pipeline_url: str | None,
|
||||
) -> dict:
|
||||
if not component_id:
|
||||
raise EvidenceError("component_id is required")
|
||||
if "/" not in repository:
|
||||
raise EvidenceError("repository must be owner/name")
|
||||
if not tag:
|
||||
raise EvidenceError("tag is required")
|
||||
if not SHA_RE.match(source_sha):
|
||||
raise EvidenceError("source_sha must be a 40-hex commit")
|
||||
if not assets:
|
||||
raise EvidenceError("at least one non-index asset is required")
|
||||
if len(assets) > MAX_ASSETS:
|
||||
raise EvidenceError(f"more than {MAX_ASSETS} assets")
|
||||
if len(dependencies) > MAX_DEPENDENCIES:
|
||||
raise EvidenceError(f"more than {MAX_DEPENDENCIES} dependencies")
|
||||
|
||||
asset_entries = []
|
||||
seen_names: set[str] = set()
|
||||
for path in assets:
|
||||
if not path.is_file():
|
||||
raise EvidenceError(f"asset missing: {path}")
|
||||
name = path.name
|
||||
if name == INDEX_NAME:
|
||||
raise EvidenceError("assets must not include release-evidence.json itself")
|
||||
if name in seen_names or "/" in name or name in (".", ".."):
|
||||
raise EvidenceError(f"unsafe or duplicate asset name: {name!r}")
|
||||
seen_names.add(name)
|
||||
target = "source"
|
||||
if name.endswith(".tar.gz") and "linux" in name:
|
||||
target = "x86_64-unknown-linux-gnu"
|
||||
asset_entries.append(
|
||||
{
|
||||
"name": name,
|
||||
"target": target,
|
||||
"size": path.stat().st_size,
|
||||
"sha256": sha256_file(path),
|
||||
}
|
||||
)
|
||||
|
||||
evidence = {
|
||||
"component_id": component_id,
|
||||
"repository": repository,
|
||||
"tag": tag,
|
||||
"source_sha": source_sha,
|
||||
"ci": {
|
||||
"pipeline_number": pipeline_number,
|
||||
"url": pipeline_url,
|
||||
"source_sha": source_sha,
|
||||
},
|
||||
"assets": asset_entries,
|
||||
"dependencies": dependencies,
|
||||
}
|
||||
return evidence
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--component-id", required=True)
|
||||
parser.add_argument("--repository", required=True)
|
||||
parser.add_argument("--tag", required=True)
|
||||
parser.add_argument("--source-sha", required=True)
|
||||
parser.add_argument("--asset", action="append", default=[], required=True)
|
||||
parser.add_argument("--dependency", action="append", default=[])
|
||||
parser.add_argument("--pipeline-number", type=int, default=None)
|
||||
parser.add_argument("--pipeline-url", default=None)
|
||||
parser.add_argument("--out", default=f"dist/{INDEX_NAME}")
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
dependencies = [parse_dependency(item) for item in args.dependency]
|
||||
evidence = build_evidence(
|
||||
component_id=args.component_id,
|
||||
repository=args.repository,
|
||||
tag=args.tag,
|
||||
source_sha=args.source_sha,
|
||||
assets=[Path(item) for item in args.asset],
|
||||
dependencies=dependencies,
|
||||
pipeline_number=args.pipeline_number,
|
||||
pipeline_url=args.pipeline_url,
|
||||
)
|
||||
except EvidenceError as error:
|
||||
print(f"write_evidence: FAIL: {error}", file=sys.stderr)
|
||||
return 1
|
||||
out = Path(args.out)
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
payload = json.dumps(evidence, indent=2, sort_keys=True, ensure_ascii=False) + "\n"
|
||||
if len(payload.encode()) > 1024 * 1024:
|
||||
print("write_evidence: FAIL: index exceeds 1 MiB", file=sys.stderr)
|
||||
return 1
|
||||
out.write_text(payload, encoding="utf-8")
|
||||
print(out)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in new issue
Block a user