feat: migrate View 0.3.0 to marqdo 3.0.0-rc.4 contracts
ci/woodpecker/push/woodpecker Pipeline was successful

Replace the retired rc.2 Analysis v2/Trace v2/Execution Events v1 stack with the
single current contract family:

- Analysis v3 (ADR-0069 public boundary): one check --emit artifact carries the
  exact source, Markdown AST, heading scopes (heading_span + complete span),
  anchors, state-bearing references, calls, resources and diagnostics; the old
  revision-3 shape is rejected with a rebuild hint.
- Observation v1: one run/call --output jsonl stream (+ atomic
  --observation-file snapshot) decoded by one decoder and projected into the
  reader/SSE/export layers; stale/malformed/truncated/incomplete never render
  as success.
- CLI Tool revision 1: requires {api_revision:1, analysis:3, observation:1},
  product range >=3.0.0-rc.3,<4.0.0, only MARQDO_BIN and
  MARQDO_API_REVISION are consumed.
- Remove compatibility branches, retired flags/env vars and duplicate decoders;
  re-record Analysis v3 and Observation v1 fixtures; rewrite contract,
  integration and security tests (173 passing locally).
- Add check-no-legacy/check-docs/check-observation gates, rc.4 pins in the
  CI pipelines, 0.3.0 Tool bundle and evidence manifest support.

See issues #4, #5 and #6; acceptance baseline is CLI source
452e9a32bd9e40dba427d4180691c58bab74449e, archive
9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8.
This commit is contained in:
Marqdo View committed 2026-11-25 21:58:15 +08:00
1 parent 7b34199c96
commit a802f96b6e
109 files changed
+14000 -6461

No files matched your search

@@ -0,0 +1,41 @@
# rc.4 验收证据(待生成)
本目录绑定冻结 CLI 源码 SHA `452e9a32bd9e40dba427d4180691c58bab74449e`
(`marqdo 3.0.0-rc.4`)。
- 归档 SHA-256:`sha256:9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8`
- 二进制 SHA-256:`sha256:a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e`
- 平台:`linux-x86_64-glibc2.39`
- 期望产物:`manifest.json`(schema `marqdo.view.acceptance`,`schema_version: 1`)
- 门禁:G01–G12(见 [`docs/ACCEPTANCE.md`](../../ACCEPTANCE.md),
schema 与状态含义见 [`docs/evidence/README.md`](../README.md))
## manifest 契约(`marqdo.view.acceptance` / `schema_version: 1`)
必填身份字段:`view_commit`、`view_binary_sha256`、`view_tool_bundle_digest`、
`cli_source_sha`、`cli_archive_sha256`、`cli_binary_sha256`、`platform`、
`generated_utc`、`gates`、`unverified`(完整示例见
[`docs/evidence/README.md`](../README.md))。
门禁 id 与状态:`G01_no_legacy`、`G02_build`、`G03_install`、`G04_static`、
`G05_run`、`G06_stream_snapshot`、`G07_binding_stale`、`G08_negative`、
`G09_security`、`G10_export`、`G11_evidence_ci`、`G12_docs`;
每项 `state ∈ {PASS, FAIL, UNVERIFIED}`,并带 `command`/`exit_code`/`log`。
`unverified` 列出所有非 PASS 门禁;`UNVERIFIED`/`PARTIAL`/`WARN` 不得读作或写成 PASS。
**当前状态:manifest 尚未生成。** 本文件不是验收证据,不包含任何 PASS 结果。
必须由真实命令生成,禁止手写、复制历史 manifest 或从别处伪造:
```bash
export MARQDO_BIN=/abs/unpacked/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo
scripts/frozen-beta.sh verify "$MARQDO_BIN"
scripts/acceptance.sh
```
生成后,`scripts/acceptance.sh` 会把 manifest 写入本目录,并把同一内容写到
`dist/acceptance/manifest.json`。任一 P0 门禁 `FAIL` 或 `UNVERIFIED` →
0.3.0 不发布;`UNVERIFIED` 不得写成 `PASS`。
历史 0.2.0 证据位于其他目录(`../2c7c4f31e7a388d3fcfa717a77067e696ed13854/`、
`../issue-2/`、`../issue-3/`、`../PR-01..PR-06/`),只作历史记录,
不能替代本目录的 rc.4 门禁。
@@ -0,0 +1,111 @@
{
"cli_archive_sha256": "sha256:9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8",
"cli_binary_sha256": "sha256:a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e",
"cli_source_sha": "452e9a32bd9e40dba427d4180691c58bab74449e",
"cli_version": "3.0.0-rc.4",
"contracts": {
"analysis": 3,
"api_revision": 1,
"observation": 1
},
"extras": {
"browser": "UNVERIFIED",
"cargo_tests_passed": 173,
"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": "dist/acceptance/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": "dist/acceptance/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": "dist/acceptance/logs/G03_install.log",
"state": "PASS"
},
"G04_static": {
"command": "\"/root/work/marqdo-cli/dist/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo\" view verify examples/mixed-modes/index.mq.md && MARQDO_BIN=\"/root/work/marqdo-cli/dist/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo\" ./scripts/check-examples.sh",
"exit_code": 0,
"log": "dist/acceptance/logs/G04_static.log",
"state": "PASS"
},
"G05_run": {
"command": "installed marqdo view examples/welcome + scripts/acceptance-run.py over SSE",
"exit_code": 0,
"log": "dist/acceptance/logs/G05_run.log",
"state": "PASS"
},
"G06_stream_snapshot": {
"command": "python3 scripts/check-observation.py stream-snapshot",
"exit_code": 0,
"log": "dist/acceptance/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": "dist/acceptance/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": "dist/acceptance/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-cli/dist/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo\" ./scripts/test-no-exec.sh && ./scripts/test-security.sh",
"exit_code": 0,
"log": "dist/acceptance/logs/G09_security.log",
"state": "PASS"
},
"G10_export": {
"command": "env MARQDO_BIN=\"/root/work/marqdo-cli/dist/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo\" ./scripts/test-export.sh && cargo test --locked --test contract",
"exit_code": 0,
"log": "dist/acceptance/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": "dist/acceptance/logs/G12_docs.log",
"state": "PASS"
}
},
"generated_utc": "2026-11-25T13:28:42.898071+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:93421d3dc83d39e99a547d9e9c34e1a2a69b7f3781016e08c46bf1ff72f0cf31",
"view_commit": "7b34199c967d1ea72652d98deb5173298e88010e",
"view_tool_bundle_digest": "sha256:19257a56d0598bbc6bc92d360db5cc51c19dece2b26c6eef810d2ef5a96dffc1",
"view_tool_bundle_digest_method": "sha256 of the canonical SHA256SUMS file bytes in the bundle"
}
+81 -25
View File
@@ -1,34 +1,90 @@
# 验收证据
本目录保存**由真实命令生成**的验收证据。历史证据使用 `<CLI-SOURCE-SHA>/manifest.json`,工单复验另存于 `issue-2/manifest.json`:
本目录只保存**由真实命令生成**的机器证据。当前基线:
`marqdo 3.0.0-rc.4`(源码 `452e9a32bd9e40dba427d4180691c58bab74449e`)。
`PASS/FAIL/UNVERIFIED` 一律以 manifest 为准;`UNVERIFIED`、`PARTIAL`、`WARN`
不得写成 `PASS`。缺证据即视为未完成,任一 P0 门禁失败/未证明 → 不发布 0.3.0。
- `schema`/`schema_version`:`marqdo.view-conformance` v1(View 自有,非 CLI 协议);
- `view_source_sha`:生成证据时的 View Git SHA;
- `view_binary_sha256`:发布 bundle 内 `bin/marqdo-view` 摘要;
- `cli_source_sha`:CLI 发布归档记录的源码 SHA;
- `cli_binary_sha256_before/after`:冻结 CLI 在验收前后的 SHA-256,必须相同;
- `tool_protocol`/`analysis_protocol`/`trace_protocol`、`target`、`archive_sha256`;
- `gates`:`scripts/acceptance.sh` 每一步的真实退出状态,包括冻结身份、代码、浏览器、Tool 完整性和卸载;
- `tests`:contract/examples/export/no_exec/security/browser 的 PASS/FAIL/SKIP。
## 目录布局
生成方式(不要手写/篡改):
- `docs/evidence/<CLI-SOURCE-SHA>/manifest.json`:当前契约的机器验收清单
(当前目录名固定为 `452e9a32bd9e40dba427d4180691c58bab74449e`);
- `docs/evidence/<CLI-SOURCE-SHA>/README.md`:该次证据的说明/附件索引;
- 历史目录(`2c7c4f31e7a388d3fcfa717a77067e696ed13854/`、`issue-2/`、
`issue-3/`、`PR-01..PR-06/`、`0001-pr03/`):0.2.0 旧预发布契约时代的证据,
**仅作历史记录,不能替代 rc.4 门禁**;
- 分 PR 的人工/截图/日志不是协议证据,只在对应 README 中说明。
```bash
# 输出到 dist/acceptance/manifest.json
MARQDO_BIN=/abs/path/to/frozen/marqdo scripts/acceptance.sh
## manifest schema:`marqdo.view.acceptance` / `schema_version: 1`
必填字段(按 issue #5 §0):
```json
{
"schema": "marqdo.view.acceptance",
"schema_version": 1,
"view_commit": "<40 hex>",
"view_binary_sha256": "sha256:<64 hex>",
"view_tool_bundle_digest": "sha256:<64 hex>",
"cli_source_sha": "452e9a32bd9e40dba427d4180691c58bab74449e",
"cli_archive_sha256": "sha256:9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8",
"cli_binary_sha256": "sha256:a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e",
"platform": "linux-x86_64-glibc2.39",
"generated_utc": "<UTC ISO-8601>",
"gates": {
"G01_no_legacy": {"state": "UNVERIFIED", "command": "...", "exit_code": null, "log": ""}
},
"unverified": []
}
```
`manifest.json` 在验收最后一步写入;任一步失败时脚本非零退出且不会声称 PASS。
冻结 CLI 的 `--version`/SHA 与发布归档必须一致(`scripts/verify-frozen-cli.sh`),
CI 证据只在 `.github/workflows/ci.yml` 真正运行后才可补入;本仓库当前**未声称**
远端 CI 通过。
生成器额外输出(不改变上述语义):
分 PR 证据目录(人工/截图/日志,非协议证据):
- `product {name, version, target}`、`cli_version`、`contracts {api_revision:1,
analysis:3, observation:1}`、`markdown_profile`、`product_range`;
- `result`:`PASS | PARTIAL | FAIL`;
- `gates.G01…G12`:每项 `{state, command, exit_code, log, note?}`,
`state ∈ {PASS, FAIL, UNVERIFIED}`;
- `unverified`:所有非 PASS 门禁 id 的显式列表;
- `extras`:cargo 测试数、浏览器状态、说明。
- `PR-01/`:Tool v1 安装/分发/篡改拒绝实测;
- `PR-02/`:Reader 结构与 `/api/documents` 只读面;
- `PR-03/`:执行层 request/process/controller/events 测试;
- `PR-04/`:SSE 闭环、7 路由、会话安全、真实 Chromium 与真实冻结 CLI run;
- `PR-05/`:Trace 绑定/标注/stale 与浏览器回归截图;
- `PR-06/`:示例 check/call/run、零执行哨兵、一键验收日志与发布包身份;
- `0001-pr03/`:RFC-VIEW-0001 时期的浏览器截图(历史归档)。
`view_tool_bundle_digest` 的计算方式:bundle 内规范化 `SHA256SUMS` 文件字节的
SHA-256(`sha256:` 前缀),字段旁会记录 `view_tool_bundle_digest_method`。
## 门禁状态含义
| 状态 | 含义 |
|---|---|
| `PASS` | 本环境真实命令 exit 0,且产物/日志与声明一致 |
| `FAIL` | 真实命令非 0 或断言失败;阻塞发布 |
| `UNVERIFIED` | 未运行、无法在本环境判定或缺少测试路径;**不得**读作 PASS;阻塞发布 |
G01–G12 的判定命令与通过判据见 [`docs/ACCEPTANCE.md`](../ACCEPTANCE.md)。
manifest 的 gate id 固定为:`G01_no_legacy`、`G02_build`、`G03_install`、
`G04_static`、`G05_run`、`G06_stream_snapshot`、`G07_binding_stale`、
`G08_negative`、`G09_security`、`G10_export`、`G11_evidence_ci`、`G12_docs`。
G11(证据与 CI)只在其实际运行的 CI 环境中可为 PASS;本地 manifest 中保持
`UNVERIFIED`,不能证明远端 CI 通过。
## 生成方式(不要手写/篡改)
```bash
export MARQDO_BIN=/abs/unpacked/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo
scripts/frozen-beta.sh verify "$MARQDO_BIN"
scripts/acceptance.sh
# → docs/evidence/452e9a32bd9e40dba427d4180691c58bab74449e/manifest.json
# → dist/acceptance/manifest.json(同一内容)
```
`manifest.json` 在验收最后一步写入;任一步 FAIL 时脚本非零退出且不会声称 PASS。
冻结 CLI 的 `--version`/SHA 与发布归档必须一致(`scripts/verify-frozen-cli.sh`)。
`VIEW_EVIDENCE_OUT` 可覆盖主输出路径,但不得用于伪造门禁结果。
## 历史证据声明
0.2.0 时代的 manifest 与 PR 证据使用旧预发布契约与旧 manifest 结构,
其中的 `PASS` 只对其当时的基线有效。它们不得被复制为 0.3.0 证据,
也不得在 README/COMPATIBILITY/CHANGELOG/STATUS/ACCEPTANCE 中作为当前能力证明。
远端 CI 证据只在 `.github/workflows/ci.yml` / `.woodpecker.yml` 真正运行后才可补入;
本仓库当前**未声称**远端 CI 通过。