diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d5b336..e5aaa55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ All notable changes to `marqdo-view` are documented here. The format follows Keep a Changelog and the project uses SemVer for the View product version. Protocol axes (Tool v1, Analysis v2, Trace v2) are versioned separately. -## [Unreleased] +`0.2.0` is the first release implementing RFC-VIEW-0002 end to end (SSE execution +loop, 7-route Live API, controlled project grants and Trace-bound annotations). +The earlier `0.1.0` development line was never published; its verified reader / +Analysis / export work is folded into this entry. + +## [0.2.0] - 2026-11-22 ### Added (RFC-VIEW-0002 PR-05) @@ -97,6 +102,26 @@ Protocol axes (Tool v1, Analysis v2, Trace v2) are versioned separately. - Tool v1 packaging now emits `0.2.0`; install/dispatch/tamper behaviour is re-verified against the frozen `3.0.0-beta.1` CLI. +### Added (RFC-VIEW-0002 PR-06) + +- Five RFC §13.3 example documents at `examples/{welcome,branch-loop, + function-params,knowledge-only,unsafe-side-effect}.mq.md` plus explicit + `examples/view.json`; all are checked with the frozen CLI and recorded via + `scripts/check-examples.sh` (double(5)=Int 10, branch-loop=Int 0 with + loop/return Trace, knowledge-only has no main, unsafe-side-effect writes only + with explicit project grants). +- `scripts/test-no-exec.sh`: opens/lists/searches/reloads/exports the + unsafe-side-effect document, hashes every example source and the lock file, + asserts no write sentinel appears and that exported HTML contains no run + controls, CSRF material or external URLs. +- Static export no longer renders run controls: no run Dock button, no run tab, + no call buttons and no run dialog; only settings/more remain offline. +- `scripts/acceptance.sh` extended with `examples_check` and `no_exec_suite` + gates and refreshed evidence manifest schema (`tests.examples`, `tests.no_exec`). +- Final documentation closure: `docs/ACCEPTANCE.md` rewritten against + RFC-VIEW-0002 §9/§10, STATUS/CONFORMANCE/README/COMPATIBILITY updated, final + evidence manifest generated from the frozen CLI release (CLI SHA unchanged). + ### Changed (RFC-VIEW-0002 PR-00) - Adopted `docs/architecture/RFC-VIEW-0002.md` as the sole implementation diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index be044e2..375b312 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -40,7 +40,7 @@ Beta 版 CLI 必须使用 prerelease 范围(`>=3.0.0-beta.1,<4.0.0`);`>=3. | 调试器/断点/单步 | **不实现**(首版非目标) | | Knowledge/Prove/Lint 引擎 | **不实现**(独立仓库/未来可选信息层) | -实际完成状态以 [`docs/STATUS.md`](docs/STATUS.md) 与 [`docs/ACCEPTANCE.md`](docs/ACCEPTANCE.md) 为准,本文不代替现状。远端 CI 未实际运行(`.woodpecker.yml` 已提供),本地冻结 CLI 验收证据见 `docs/evidence/`。 +实际完成状态以 [`docs/STATUS.md`](docs/STATUS.md) 与 [`docs/ACCEPTANCE.md`](docs/ACCEPTANCE.md) 为准,本文不代替现状。RFC-VIEW-0002 §10 门禁已按真实冻结 CLI + Chromium 验收 PASS;远端 CI 配置已提供但本环境未实际运行远端 CI,本地证据见 `docs/evidence/`。 ## 消费者契约 diff --git a/README.md b/README.md index 2bd77d3..bedaa1d 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,11 @@ Marqdo View(`0.2.0`)是一个独立的可执行文档阅读器:以**原始 - 兼容性:[`COMPATIBILITY.md`](COMPATIBILITY.md) / 变更:[`CHANGELOG.md`](CHANGELOG.md) - 决策记录:[`docs/decisions/`](docs/decisions/) -> **当前开发状态**:仓库正按 RFC-VIEW-0002 迭代(PR-00~PR-06)。下方能力表与 -> 限制按实际实现更新;未完成项以 `docs/STATUS.md` 为准,不宣称 0002 已完成。 +> **当前状态**:RFC-VIEW-0002 PR-00~PR-06 已完成,按 §10 发布门禁验收 +> **PASS**(真实冻结 CLI + 真实 Chromium;见 +> [`docs/ACCEPTANCE.md`](docs/ACCEPTANCE.md) 与 +> `docs/evidence//manifest.json`)。像素级人工比对与完整 +> screen-reader 走查仍为 `UNVERIFIED`,见 `docs/STATUS.md`。 ## 能力 @@ -57,6 +60,10 @@ marqdo view examples/control-flow --port 0 --no-open marqdo view verify examples/mixed-modes/index.mq.md marqdo view verify examples/mixed-modes --refs --json +# RFC §13.3 示例(可检查/调用/运行;无隐式执行) +marqdo view examples/function-params.mq.md --no-open +marqdo view examples/unsafe-side-effect.mq.md --no-open + # 纯只读静态导出(永不执行;导出后可用 file:// 离线打开) marqdo view export examples/welcome --out ./site marqdo view export examples/mixed-modes --out ./site --no-annotations @@ -117,6 +124,8 @@ export MARQDO_BIN=/absolute/path/to/frozen/marqdo 单独套件: ```bash +MARQDO_BIN=... ./scripts/check-examples.sh # RFC §13.3 示例真实 check/call/run +MARQDO_BIN=... ./scripts/test-no-exec.sh # 打开/导出零副作用哨兵 MARQDO_BIN=... ./scripts/test-contract.sh # code + Tool v1 + verify + export MARQDO_BIN=... ./scripts/test-export.sh # 纯只读导出 + file:// Chromium ./scripts/test-security.sh # HTTP/路径/XSS/导出对抗 @@ -134,5 +143,7 @@ MARQDO_BIN=... ./scripts/test-browser.sh # 真实 Chromium 视觉/交互/响 - SSE 只推送 View 生命周期与终态数据,不承诺逐字 stdout/Token 流;Trace v2 不含 参数实际值/逐语句变量/内存快照。 - 平台:仅 Linux x86_64 正式验证;Windows/macOS 不支持声明。 +- 远端 CI 配置已提供(`.github/workflows/ci.yml`),本环境未实际运行远端 CI; + 验收证据来自本地真实命令。 - 像素级人工视觉比对与完整 screen-reader 走查为 `UNVERIFIED`(自动化几何/响应式/ 无外部资源/无 JS/打印证据见 `docs/evidence/PR-04/`)。 diff --git a/docs/ACCEPTANCE.md b/docs/ACCEPTANCE.md index 1412c31..ed519c3 100644 --- a/docs/ACCEPTANCE.md +++ b/docs/ACCEPTANCE.md @@ -1,67 +1,125 @@ -# 验收状态(RFC-VIEW-0001 §18) +# 验收状态(RFC-VIEW-0002 §9 / §10) -> **历史证据说明(2026-11-22)**:本文件的 PASS 是 **RFC-VIEW-0001 时期** -> 的验收结论,用作已实现能力的证据来源,**不是 RFC-VIEW-0002 的发布门禁**。 -> 0002 要求 SSE、7 路由、单函数调用、project grants、0.2.0 发行包与新的浏览器 -> 矩阵;这些将在 PR-04~PR-06 重新验收并更新本文件(见 `docs/CONFORMANCE.md`)。 +> 结论:**RFC-VIEW-0002 PR-00~PR-06 的 BETA-CANDIDATE 强制门禁通过**。 +> 证据来自真实冻结 CLI(`marqdo 3.0.0-beta.1`)+ 真实进程 HTTP/SSE 测试 + +> 真实 Chromium 131;生成命令为 `MARQDO_BIN=… scripts/acceptance.sh`。 +> 机器可读证据:`docs/evidence/2c7c4f31e7a388d3fcfa717a77067e696ed13854/manifest.json` +> (最终 PR-06 提交上重跑;manifest 记录 View source/binary SHA、CLI 前后 SHA 与 +> 每个 gate 的真实退出状态)。 +- 日期:2026-11-22 +- View:`0.2.0`(Linux x86_64) +- 冻结 CLI:`marqdo 3.0.0-beta.1`,SHA-256 + `062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f` +- CLI 源码:tag `v3.0.0-beta.1`,`2c7c4f31e7a388d3fcfa717a77067e696ed13854` +- 规范:`docs/architecture/RFC-VIEW-0002.md`;矩阵:`docs/CONFORMANCE.md` -> 结论:首个 Beta 的 **P0 门禁全部 PASS**(由真实冻结 CLI + 真实 Chromium 生成, -> 见 `docs/evidence/2c7c4f31e7a388d3fcfa717a77067e696ed13854/manifest.json`)。 -> P1 视觉/交互门禁大部分 PASS,**U-01 像素级人工比对与 U-04 动态曲线侧注未完成/未实现**, -> 已在 README/CHANGELOG/STATUS 明确标注,不以自动化结果替代人工判断。 +## 1. §10 发布门禁(强制) -## P0 门禁 +| # | 门禁 | 结果 | 证据 | +|---|---|---|---| +| 1 | PR-00~06 完成、P0 检验、无伪交付 | **PASS** | 本文件 §2/§3;各 PR `docs/evidence/PR-0x/` | +| 2 | Tool v1 独立安装;CLI 无 View 核心提交;SHA 不变 | **PASS** | acceptance `archive_install`/`tool_list`/`view_help`/`core_sha`;CLI before=after=`062cb56e…` | +| 3 | 打开/刷新/导出零副作用;执行只来自显式 POST;跨站/CSRF 全绿 | **PASS** | `no_exec_suite`(源/锁哈希不变、无 sentinel、导出无执行控件)、`security_suite`、`tests/security/` | +| 4 | SSE 生命周期/心跳/序号/断线重连/有界重放;无轮询 | **PASS** | `tests/integration/http_live.rs`(10 SSE/HTTP 测试)、浏览器 EventSource 断言、`docs/evidence/PR-04/` | +| 5 | 真值来自 CLI `--json`/Trace v2;语义来自 Analysis v2;文档来自 `.mq.md` | **PASS** | `execution/controller.rs`、`protocol/*`、`trace_contract`;stale/invalid/truncated 测试 | +| 6 | Live/Export 同一 HTML/CSS/JS;无旧叠层 | **PASS** | `tests/contract/no_coupling.rs`、`asset_integrity.rs`、`integration/export.rs`、`test-export.sh` | +| 7 | Linux x86_64 可重现发行包;文档/帮助/限制一致 | **PASS** | `bundle`/`archive_install`;`dist/marqdo-view-0.2.0-x86_64-unknown-linux-gnu.tar.gz`;README/COMPATIBILITY/STATUS | +| 8 | N01–N22 负面回归;失败不执行不泄漏不提升权限 | **PASS** | §3 映射;`tests/security/`、`tests/integration/`、`scripts/check-examples.sh`、`scripts/test-no-exec.sh` | -| ID | 结果 | 证据 | -|---|---|---| -| A-01 无旧 crate 依赖 | PASS | `tests/contract/no_coupling.rs` 依赖/Cargo.lock/源码扫描 | -| A-02 独立新仓库 clean build | PASS | acceptance `build`;无 `marqdo`/`marqdo-cli` 源码依赖 | -| A-03 Tool v1 安装/分发 | PASS | acceptance `archive_install`、`tool_list`、`view_help`;`scripts/install-smoke.sh` | -| A-04 CLI SHA-256 前后相同 | PASS | acceptance `core_sha`;manifest 中 before==after=`062cb56e…` | -| A-05 旧审计与截图基准 | PASS(静态) | `docs/audits/legacy-render-paths.md`(`LEGACY_RUNTIME_UNVERIFIED` 已声明) | -| A-06 单一 Renderer/CSS 入口 | PASS | `tests/contract/no_coupling.rs`、`tests/contract/asset_integrity.rs`、ADR-0001/0002 | -| S-01 Knowledge/Exec/继承 | PASS | `tests/integration/rendering.rs`、`tests/integration/unicode_spans.rs`、冻结 Analysis golden | -| S-02 Emph/Strong/Code 载体 | PASS | `tests/integration/rendering.rs`(4 个 Exec 锚点)、`tests/integration/unicode_spans.rs` | -| S-03 Knowledge 惰性 | PASS | `knowledge_emphasis_never_becomes_an_execution_anchor` | -| S-04 中文/emoji/CRLF/重复语句 | PASS | `examples/unicode-spans` + 冻结 golden + `tests/integration/unicode_spans.rs` | -| S-05 check 失败可读 | PASS | `tests/contract/presentation_states.rs`、浏览器 diagnostics 区 | -| S-06 未知 Analysis major 拒绝 | PASS | `tests/semantic` 单测、`tests/contract/presentation_states.rs`、`verify` 负测 | -| S-07 digest/span 篡改 | PASS | `tests/contract/trace_contract.rs`、`tests/contract/presentation_states.rs` | -| R-01 刷新 10 次不运行 | PASS | `tests/integration/http_live.rs::opening_and_refreshing_never_runs_the_document` | -| R-02 导出纯静态 | PASS | `tests/integration/export.rs`(marker 假核心 + argv 无 run) | -| R-03 用户确认后真实运行 | PASS | acceptance `real_run`(安装态、CSRF、真实 Trace) | -| R-04 trace 不匹配 → STALE | PASS | `tests/contract/trace_contract.rs`、`tests/integration/http_live.rs` | -| R-05 截断/运行错误 | PASS | 真实 truncated/arity golden + 页面状态 | -| R-06 不猜未公开值 | PASS | Trace 模型无这些字段;UI `UNSUPPORTED`(`docs/design/state-matrix.md`) | -| X-01 恶意 Markdown | PASS | `tests/integration/rendering.rs`、`tests/fixtures/security-project` 浏览器 | -| X-02 路径穿越/symlink | PASS | `tests/integration/http_live.rs`、`SafeRelativePath` 单测 | -| X-03 跨站 POST run | PASS | `tests/integration/http_live.rs`(token/Origin/confirm/mode) | -| X-04 无 JS/禁网/file:// | PASS | 浏览器 no-JS/外部请求检查;`scripts/test-export.sh` file:// Chromium | -| X-05 stdout 注入转义 | PASS | `tests/integration/http_live.rs::program_stdout_is_escaped...` | -| X-06 超时/子进程清理 | PASS | `tests/contract/core_contract.rs::timeout_kills_the_process_group...` | -| P-01 文档可复现 | PASS | README / RFC / STATUS / COMPATIBILITY / ADR / 审计 / 证据 | -| P-02 archive clean install | PASS | acceptance 从 `.tar.gz` 解包到临时目录安装并运行 | -| P-03 协议审计 | PASS | `docs/audits/protocol-conformance.md` | +发布阻塞项(无意外执行失败、SSE 跨站读取/执行、过期 Trace 绑定、后台子进程 +泄漏、CLI 核心被迫改动、导出行程序、伪造实时结果、双解释器)逐项均无。 -## P1 门禁 +## 2. §9.1 正向端到端 -| ID | 结果 | 说明 | -|---|---|---| -| U-01 1664×920 视觉 | **PARTIAL** | 截图已采集(`docs/evidence/0001-pr03/`),几何/颜色令牌/无溢出/无外部资源 PASS;与参考截图的**像素级人工比对未执行(UNVERIFIED)** | -| U-02 多宽度 | PASS | 390/600/900/1280/1664/1920/2560 真实 Chromium:无横向溢出、Dock 在视口内 | -| U-03 键盘/焦点/屏幕阅读器 | PASS(基础) | Tab 可达命名控件、Esc 关闭、Ctrl/Cmd+K 搜索;完整 screen-reader 手工走查未做 | -| U-04 动态曲线侧注 | **PARTIAL** | 运行事件使用**内联 keyed chip**(无 JS/移动/打印均可读);SVG 曲线侧注未实现,不画错线 | -| U-05 Welcome 仅显式配置 | PASS | `view.json` 驱动;`tests/integration/rendering.rs`、浏览器 | -| U-06 Live/Export 内容对照 | PASS | `tests/integration/rendering.rs` 同模型对照;导出复用同一 renderer | +| ID | 测试 | 结果 | 证据 | +|---|---|---|---| +| E01 | Tool 安装/卸载/分发 `view` | PASS | acceptance `archive_install`/`tool_list`/`view_help`;`scripts/install-smoke.sh` | +| E02 | 打开含 `@knowledge`+H2 `@exec` 文件不运行 | PASS | `pages_issue_a_session_cookie_and_never_execute_the_document`;`no_exec_suite` | +| E03 | Source/Document 切换、字节保真 | PASS | `tests/integration/rendering.rs`、浏览器 source mode 断言 | +| E04 | 中文/Emoji/表格/公式 span | PASS | `tests/integration/unicode_spans.rs`、冻结 Analysis golden | +| E05 | 显式 `main` 运行(真实 run --json --trace-file) | PASS | acceptance `real_run`(真实冻结 CLI + SSE,285 条 Trace 事件) | +| E06 | H2 Exec `n=5` 调用 | PASS | `scripts/check-examples.sh`(Int 10);`execution.rs` 的 call argv;前端表单 | +| E07 | 文本/列表常量参数(无 shell) | PASS | `build_call_args` 单测/集成;`--arg name=expression` argv 测试 | +| E08 | 无 main 不运行其他函数 | PASS | `document_without_main_...`(400 `view.no_entry_function`,无 run 调用) | +| E09 | if/while Trace 事件映射、不伪造变量 | PASS | `execution.rs` Trace 摘要;`at most one grouped chip`;无变量字段 | +| E10 | `GET …/events` 为 SSE、accepted/running/terminal、无 polling | PASS | `explicit_run_streams_sse_...`;浏览器请求记录 | +| E11 | Last-Event-ID 重连有序、无重复、过期 snapshot | PASS | `last_event_id_replays_...` | +| E12 | 长任务 SSE 心跳、GET 不重启 | PASS | `sse_heartbeats_keep_a_slow_job_connected`、`at_most_two_sse_observers_per_run` | +| E13 | 取消终止进程树、唯一终态 | PASS | `cancel_is_idempotent...`、`process.rs` 单测 | +| E14 | 静态导出无执行/无联网/相对链接 | PASS | acceptance `export`/`export_suite`;`test-export.sh`(file:// Chromium) | +| E15 | 页面刷新/重开不自动执行 | PASS | `pages_issue...`(10 次刷新无 run);浏览器 | +| E16 | 运行后源码改变 → 结果可见但 stale、无错误高亮 | PASS | `source_edit_during_a_run...`(stale=true、全部 anchor/source_id=null) | -## 复现 +## 3. §9.2 必测失败与安全回归 + +| ID | 故障注入 | 结果 | 对应测试/证据 | +|---|---|---|---| +| N01 | 假 Analysis schema v3/缺 modules | PASS | `tests/contract/presentation_states.rs`、`verify` 负测 | +| N02 | check 失败 + 旧 analysis 残留 | PASS | `tools` 合同测试;View 只读 `check --emit`(CLI 删除 stale emit)+ 自缓存按 source digest | +| N03 | Trace digest/root_id/module_id 不匹配 | PASS | `trace_with_a_mismatched_digest...`、`trace_contract` | +| N04 | UTF-8 边界/span 越界 | PASS | `tests/contract/trace_contract.rs`、`unicode_spans` | +| N05 | 恶意 Markdown `