feat(PR-06): RFC §13.3 examples, export closure, acceptance and docs finalization
- add examples/{welcome,branch-loop,function-params,knowledge-only,
unsafe-side-effect}.mq.md + explicit examples/view.json; all validated against
the frozen CLI (double(5)=Int 10, branch-loop Int 0 with loop/return Trace,
knowledge-only sem.no_entry_function, unsafe write only with explicit project
grants) via scripts/check-examples.sh
- add scripts/test-no-exec.sh sentinel suite: browse/list/search/reload/export of
the write fixture keeps source+lock hashes unchanged, writes no sentinel and
produces exported HTML with no run controls/CSRF/external URLs
- static export no longer renders run controls (no run dock button/tab/call
buttons/run dialog); only settings/more remain
- extend scripts/acceptance.sh with examples_check and no_exec_suite gates and
extend the evidence manifest tests map
- rewrite docs/ACCEPTANCE.md against RFC §9/§10 with E01-E16/N01-N22 mapping;
finalize STATUS/CONFORMANCE/README/COMPATIBILITY/CHANGELOG for 0.2.0
- record PR-06 evidence logs (examples, no-exec, pre-commit acceptance)
This commit is contained in:
1 parent
807c24b952
commit
0fceb40088
24 files changed
+1227
-171
No files matched your search
+26
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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/`。
|
||||
|
||||
## 消费者契约
|
||||
|
||||
|
||||
@@ -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/<CLI-SHA>/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/`)。
|
||||
+110
-52
@@ -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 `<script>`/`onerror`/`javascript:` | PASS | `adversarial_markdown_never_injects...`;浏览器 security-project |
|
||||
| N06 | `../`、`%2e%2e`、符号链接出根 | PASS | `path_traversal...`、`symlink_escape...` |
|
||||
| N07 | 无 Cookie / 缺 CSRF / Origin 不符的 POST | PASS | `host_origin_session_csrf...`、`tests/security/` |
|
||||
| N08 | 跨站 SSE 读别人的 run | PASS | `sse_requires_a_session...`(401/404) |
|
||||
| N09 | 同 POST ID 同内容 → 同 run_id、只运行一次 | PASS | `same_client_request_id_is_idempotent...`、HTTP 版 |
|
||||
| N10 | 同 ID 不同目标 → 409 | PASS | `view.run_conflict` 测试 |
|
||||
| N11 | 运行中第二任务 → 409 busy | PASS | `second_run_is_busy...`、HTTP 版 |
|
||||
| N12 | 伪造/过期 Last-Event-ID | PASS | `last_event_id_replays_...`(snapshot) |
|
||||
| N13 | SSE 关闭后重连不重复启动 | PASS | 重放测试 + Controller 无重新 spawn 路径 |
|
||||
| N14 | 无 main/参数表达式非法 → 真实错误、无降级 | PASS | `document_without_main...`、CLI 错误包络测试 |
|
||||
| N15 | 输出超限/卡住/崩溃 → 上限与终态 | PASS | `process.rs` 有界输出/墙钟/取消单测;`view.output_limit` |
|
||||
| N16 | 取消后延迟返回 → 唯一终态 | PASS | `cancel_is_idempotent...`(单一 cancelled) |
|
||||
| N17 | project 自动获得 net/process/env/plugin | PASS | 请求 schema 只接受 read/write glob;`deny_unknown_fields` 测试 |
|
||||
| N18 | CLI SHA/版本不符 → CI 停止 | PASS | acceptance `core_sha`;`scripts/verify-frozen-cli.sh` |
|
||||
| N19 | 安装后修改 bundle 一字节 → 拒绝分发 | PASS | `docs/evidence/PR-01/README.md` 篡改实测 |
|
||||
| N20 | export 处理写文件文档 → 零源文件写入/网络/执行 | PASS | `no_exec_suite`(unsafe-side-effect:源/锁哈希不变、无 sentinel、导出无 run 控件) |
|
||||
| N21 | 同名函数/依赖模块同名 → 只允许入口模块 | PASS | `request.rs` function_id 解析与拒绝测试 |
|
||||
| N22 | 后台/多标签 SSE 竞态与清理 | PASS | 2 连接上限、跨会话、TTL/环形缓冲测试 |
|
||||
|
||||
## 4. §9.3 浏览器视觉与可达性
|
||||
|
||||
真实 Chromium 131(Playwright 1.49)三个项目(welcome/control-flow/
|
||||
security-project)全部 PASS:
|
||||
|
||||
- 宽度矩阵:2048×1133(源参考)、1664×920、1440×900、1024×768、768×1024、
|
||||
390×844:无横向溢出、Dock 在视口、无外部请求、无 console error;
|
||||
- 顶部仅 `文档/函数/运行`;Dock 刷新/设置/运行/清理/更多都有真实行为;
|
||||
- Welcome 只在显式 `view.json` welcome 配置出现;
|
||||
- 运行态经 SSE 更新、断线提示恢复、无轮询、无整页重载;
|
||||
- 静态导出/无 JS 完整可读;导出页不含运行控件或 CSRF;
|
||||
- 深色/暖纸主题、字号、标注显隐、打印可用。
|
||||
|
||||
**UNVERIFIED(人工项)**:与旧参考截图的像素级人工比对、完整 screen-reader
|
||||
走查。自动化几何/令牌/无外部资源/响应式证据已覆盖;
|
||||
`docs/evidence/PR-04/`、`docs/evidence/PR-05/` 含截图与浏览器日志。
|
||||
|
||||
## 5. 复现
|
||||
|
||||
```bash
|
||||
export MARQDO_BIN=/abs/path/to/frozen/marqdo-3.0.0-beta.1
|
||||
scripts/verify-frozen-cli.sh "$MARQDO_BIN" -- "$MARQDO_BIN" --version
|
||||
scripts/acceptance.sh
|
||||
cat docs/evidence/2c7c4f31e7a388d3fcfa717a77067e696ed13854/manifest.json
|
||||
```
|
||||
|
||||
CI 配置见 `.woodpecker.yml`;本环境未实际运行远端 CI,因此 `CI URL` 仍为
|
||||
**UNVERIFIED**(证据来自本地可复现命令,不冒称 CI 通过)。
|
||||
单项:
|
||||
|
||||
```bash
|
||||
cargo test --locked --offline # unit + contract + integration + security
|
||||
MARQDO_BIN=... scripts/check-examples.sh # RFC §13.3 fixtures
|
||||
MARQDO_BIN=... scripts/test-no-exec.sh # §13.4 零副作用
|
||||
MARQDO_BIN=... scripts/test-export.sh # 离线导出
|
||||
MARQDO_BIN=... scripts/test-browser.sh # 真实 Chromium
|
||||
```
|
||||
|
||||
## 6. 诚实限制
|
||||
|
||||
- 运行仅 `pure`(默认)与受控 `project` fs read/write;`strict`、网络/进程/环境/
|
||||
plugin/provider/kernel 不暴露到浏览器,需终端 CLI。
|
||||
- `project` 不是 OS 沙箱;View 不把项目 capability 声明自动提升为授权。
|
||||
- SSE 不承诺逐字 stdout/Token 流;Trace v2 不含参数实际值/逐语句变量/内存快照。
|
||||
- 平台:Linux x86_64 正式;Windows/macOS 不支持声明。
|
||||
- `.github/workflows/ci.yml` 已提供,但**远端 CI 未在本环境实际运行**;上述证据
|
||||
均来自本地可复现命令与真实进程/浏览器。
|
||||
+23
-23
@@ -5,20 +5,20 @@
|
||||
> `PENDING`(未开始)、`N/A`(0002 明确非目标/删除项)。
|
||||
> 证据列写测试/脚本文档;不得以视觉相似代替测试。
|
||||
|
||||
最后更新:2026-11-22(PR-05)
|
||||
最后更新:2026-11-22(PR-00~PR-06 完成)
|
||||
|
||||
## 1. §0 核心不可妥协条件
|
||||
|
||||
| # | 条款 | 状态 | 实现位置 / 证据 |
|
||||
|---|---|---|---|
|
||||
| M1 | 独立构建/测试/打包/安装;不改/不重编译 CLI;无私有 crate/Git/path 依赖 | PASS(0001 基线) | `Cargo.toml`、`tests/contract/no_coupling.rs`、`scripts/acceptance.sh`(SHA 前后一致) |
|
||||
| M2 | 语言真相=Analysis v2;运行真相=`run/call --json`+Trace v2;原文=`.mq.md`;Markdown 不判语义 | PARTIAL | 已实现 Analysis 严格校验与 Trace 绑定;`call` 入口与请求合同待 PR-03/04 |
|
||||
| M2 | 语言真相=Analysis v2;运行真相=`run/call --json`+Trace v2;原文=`.mq.md`;Markdown 不判语义 | PASS | `protocol/*`、`execution/controller.rs`、`reader/markdown.rs`;Trace 绑定/错误包络测试 |
|
||||
| M3 | 打开/刷新/搜索/切换/导出/预览/目录/诊断绝不运行 | PASS(0001 证据,待 0002 复核) | `tests/integration/http_live.rs`、`tests/integration/export.rs`、浏览器证据 |
|
||||
| M4 | 单一 Read Model / HTML 组件 / CSS / JS;Live=Export | PASS(0001 证据) | `src/render.rs`、`src/assets.rs`、`tests/contract/no_coupling.rs`、`tests/contract/asset_integrity.rs` |
|
||||
| M5 | 原生执行只经 `MARQDO_BIN run/call` 子进程;无第二运行时 | PARTIAL | 子进程已有;`call` 与取消/状态机待 PR-03/04 |
|
||||
| M6 | Tool 是普通进程;不得宣称 OS 沙箱 | PARTIAL | 文档已声明;UI 文案待 PR-04/06 复核 |
|
||||
| M5 | 原生执行只经 `MARQDO_BIN run/call` 子进程;无第二运行时 | PASS | `execution/process.rs` 唯一适配器;`no_coupling` 门禁;无第二解释器 |
|
||||
| M6 | Tool 是普通进程;不得宣称 OS 沙箱 | PASS | README/COMPATIBILITY/UI project 警告明确;无“安全运行”措辞 |
|
||||
| M7 | 不开发 lint/knowledge/prove;无硬依赖 | N/A(合规) | 无相关目录/依赖 |
|
||||
| M8 | 可见按钮必须有效;无公开数据/执行能力的面板删除 | PARTIAL | 现 UI 仍有“变量/内存不支持”入口(解释性);PR-04 复核 |
|
||||
| M8 | 可见按钮必须有效;无公开数据/执行能力的面板删除 | PASS | 每个 Dock/对话框动作有效;变量/内存仅一个 UNSUPPORTED 说明,无假按钮 |
|
||||
|
||||
## 2. §1.2 功能范围(MVP 强制项)
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
| 执行确认/取消/超时/单任务 | PASS | 两阶段确认、幂等取消、唯一终态、409 busy、墙钟上限 |
|
||||
| **SSE 状态与终态(禁止轮询)** | PASS | 逐帧 flush、心跳、Last-Event-ID、snapshot、2 连接上限;无轮询路由 |
|
||||
| 独立 Tool 安装/调用 | PASS(0001) | PR-01 迁移到 0.2.0/scripts |
|
||||
| 静态 HTML 导出 | PARTIAL | 已实现;PR-06 复核零执行/离线 |
|
||||
| 暖纸/品牌/樱花/侧注/Dock | PARTIAL | 已有;PR-05 视觉矩阵 |
|
||||
| 静态 HTML 导出 | PASS | `no_exec_suite`、`export_suite`;导出无运行控件/CSRF/外链 |
|
||||
| 暖纸/品牌/樱花/侧注/Dock | PASS | Chromium 宽度矩阵/截图 `docs/evidence/PR-04|05/`;像素级人工比对 UNVERIFIED |
|
||||
| 搜索 + 目录 | PASS | 浏览器证据 |
|
||||
| 有选择的 Observed 侧注/退化 | PARTIAL | 内联 chip 已有;SSE 后按本次运行更新(PR-04/05) |
|
||||
| 深色主题/字号/显示设置 | PARTIAL | 已有字号/标注开关/print;深色待 PR-05 |
|
||||
| 有选择的 Observed 侧注/退化 | PASS | Trace `source_id` 分组 chip;stale/无 Trace/截断降级(ADR-0010) |
|
||||
| 深色主题/字号/显示设置 | PASS | 单一 token 覆盖层 + localStorage;浏览器断言 |
|
||||
| project fs read/write grants | PASS(MVP CONTROLLED) | 请求校验 + 二次确认 + `--allow-read/--allow-write` argv 测试 |
|
||||
| net/process/env/plugin 等授权 | N/A(DEFERRED,必须拒绝并提示 CLI) | PR-03 校验 |
|
||||
| 变量/内存/Notebook/调试/Session/AI/Kernel | N/A(REMOVED) | 无路由/DOM/状态;仅一个明确 UNSUPPORTED 说明 |
|
||||
@@ -48,9 +48,9 @@
|
||||
|
||||
| 条款 | 状态 | 说明 |
|
||||
|---|---|---|
|
||||
| 唯一 Reader+Controller+CLI;无 DocumentService→Execution 隐式调用 | PARTIAL | 现同步架构无隐式执行;SSE 后复核 |
|
||||
| 层间数据结构(SourceDocument/AnalysisArtifact/SemanticAnchor/ExecutionRecord/PresentationModel) | PARTIAL | 现有类型可映射;PR-02/03 重整 |
|
||||
| §5.3 目标目录(protocol/reader/execution/server/scripts/tests 树) | PARTIAL | protocol/reader/config/scripts/tests(contract,integration) 已迁移;execution/server 拆分与 security 套件待 PR-03/04 |
|
||||
| 唯一 Reader+Controller+CLI;无 DocumentService→Execution 隐式调用 | PASS | 只有 `POST /api/runs` 处理函数持有 Controller;页面/导出/GET 无执行边 |
|
||||
| 层间数据结构(SourceDocument/AnalysisArtifact/SemanticAnchor/ExecutionRecord/PresentationModel) | PASS | `reader::{source,model,assemble}`、`StaticDocument`、`ExecutionRecord`-equivalent job/event DTO;serde 显式 DTO |
|
||||
| §5.3 目标目录(protocol/reader/execution/server/scripts/tests 树) | PASS | `src/{protocol,reader,execution,server}`、`scripts/`、`tests/{contract,integration,security,browser,fixtures,golden}`;`assets.rs` 归 reader |
|
||||
| §5.4 单一渲染流水线;Export 类型边界不可执行 | PASS(0001) | `src/export.rs` 不依赖执行层;PR-06 复核 |
|
||||
| 无第二 Markdown AST/解释器/主题/JS 入口 | PASS | `tests/contract/no_coupling.rs`、`tests/contract/asset_integrity.rs` |
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
| 进程组取消(TERM→2s→KILL)、墙钟上限、有界输出 | PASS(模块) | `src/execution/process.rs`、`tests/integration/execution.rs` |
|
||||
| 显式预算参数 | PASS(模块) | `src/execution/controller.rs`、`--run-timeout` 1..=120 |
|
||||
| 会话 Cookie(HttpOnly/SameSite=Strict)+ X-View-CSRF + Origin/Host | PASS | `server/security.rs`、`tests/security/`、浏览器测试 |
|
||||
| loopback only、请求体≤64KiB、CSP、路径 containment | PARTIAL | 大部分已有;会话 Cookie 待 PR-04 |
|
||||
| loopback only、请求体≤64KiB、CSP、路径 containment | PASS | `server/security.rs`;security 套件(Cookie/CSP/Host/path/symlink) |
|
||||
| SSE 按会话隔离、跨站读取拒绝 | PASS | 跨会话 404/401、Sec-Fetch-Site 拒绝 |
|
||||
|
||||
## 5. §8 里程碑
|
||||
@@ -81,7 +81,7 @@
|
||||
| PR-03 执行层/请求/进程/控制器 | **完成** | `src/execution/*`、ADR-0008、`docs/evidence/PR-03/` |
|
||||
| PR-04 SSE/路由/会话/前端闭环 | **完成** | `docs/evidence/PR-04/`(含真实 Chromium + 真实冻结 CLI) |
|
||||
| PR-05 Trace 绑定/标注/浏览器回归 | **完成** | ADR-0010、`docs/evidence/PR-05/` |
|
||||
| PR-06 导出/发布/文档闭环 | PENDING | — |
|
||||
| PR-06 导出/发布/文档闭环 | **完成** | `examples/`、`scripts/{check-examples,test-no-exec}.sh`、`docs/ACCEPTANCE.md`、最终 evidence manifest |
|
||||
|
||||
## 6. §9 验收测试矩阵(E01–E16 / N01–N22)
|
||||
|
||||
@@ -94,26 +94,26 @@
|
||||
| E05 main 运行 run --json --trace-file | PASS | 真实冻结 CLI SSE 证据 `docs/evidence/PR-04/real-run.log` |
|
||||
| E06 H2 Exec n=5 call | PASS | call argv 测试 + 前端函数表单;真实 CLI 在 PR-06 验收 |
|
||||
| E07 文本/列表常量参数 | PASS | `--arg` 原样表达式 + 前端输入;CLI 最终校验 |
|
||||
| E08 无 main 不自动运行别的函数 | PARTIAL | 现有 `can_offer_run` 逻辑;PR-04 复核 |
|
||||
| E08 无 main 不自动运行别的函数 | PASS | 400 `view.no_entry_function` + 无 run 调用测试 |
|
||||
| E09 Trace 事件映射不伪造变量 | PASS | Controller Trace 摘要 + JS 分组 chip;无变量值 |
|
||||
| E10 SSE text/event-stream 无 polling | PASS | 集成 + 浏览器请求记录 |
|
||||
| E11 Last-Event-ID 重连 | PASS | 重放/伪造游标 snapshot 测试 |
|
||||
| E12 长任务心跳/GET 不重启 | PASS | 心跳 + 2 连接 + GET 观察不启动任务 |
|
||||
| E13 取消终止进程树 | PASS | Controller/process 单测 + HTTP 取消唯一终态 + 浏览器取消路径 |
|
||||
| E14 静态导出零联网/相对链接 | PARTIAL | 已实现;PR-06 复核 |
|
||||
| E14 静态导出零联网/相对链接 | PASS | `export_suite`(file:// Chromium)、`no_exec_suite` |
|
||||
| E15 刷新/重开不自动执行 | PASS | `tests/integration/http_live.rs` |
|
||||
| E16 运行后改源码 → stale 无高亮 | PASS | `source_edit_during_a_run...`(stale + 全部 anchor=null) |
|
||||
| N01–N22 | PARTIAL | N01–N17/N19/N21/N22 已有对应测试(contract/integration/security);N18(CLI SHA/版本)与 N20(导出零执行)在 PR-06 冻结验收中登记 |
|
||||
| N01–N22 | PASS | 全部映射到测试/验收命令,见 `docs/ACCEPTANCE.md` §3 |
|
||||
|
||||
## 7. §10 发布门禁
|
||||
|
||||
| 门禁 | 状态 |
|
||||
|---|---|
|
||||
| 1. PR-00~06 + P0 检验,无伪交付 | PENDING |
|
||||
| 2. Tool 独立安装;CLI 无 View 核心提交;SHA 不变 | PARTIAL(0001 已证 SHA 不变,需 0.2.0 重跑) |
|
||||
| 3. 打开/刷新/导出零副作用;执行仅来自显式 POST;跨站/CSRF 全绿 | PARTIAL(同步模型已覆盖,SSE 模型待补) |
|
||||
| 4. SSE 生命周期/心跳/序号/重连/有界重放;无轮询 | **PENDING** |
|
||||
| 1. PR-00~06 + P0 检验,无伪交付 | PASS | `docs/ACCEPTANCE.md` §1/§2 |
|
||||
| 2. Tool 独立安装;CLI 无 View 核心提交;SHA 不变 | PASS | acceptance `archive_install`/`core_sha`(0.2.0 重跑) |
|
||||
| 3. 打开/刷新/导出零副作用;执行仅来自显式 POST;跨站/CSRF 全绿 | PASS | `no_exec_suite`、`security_suite`、`tests/security/` |
|
||||
| 4. SSE 生命周期/心跳/序号/重连/有界重放;无轮询 | PASS | HTTP/SSE 集成 + 浏览器请求记录 |
|
||||
| 5. 真值来自 CLI/Analysis/Trace;无假变量/内存/证明 | PASS(设计) |
|
||||
| 6. Live/Export 同一 HTML/CSS/JS;无旧叠层 | PASS(0001 证据) |
|
||||
| 7. Linux x86_64 可重现包;README/帮助/限制一致 | PENDING(PR-06) |
|
||||
| 8. N01–N22 至少覆盖;失败不执行不泄漏不提升权限 | PENDING |
|
||||
| 7. Linux x86_64 可重现包;README/帮助/限制一致 | PASS | `bundle`/`archive_install`;0.2.0 archive;文档一致性 |
|
||||
| 8. N01–N22 至少覆盖;失败不执行不泄漏不提升权限 | PASS | `docs/ACCEPTANCE.md` §3 |
|
||||
+57
-51
@@ -1,7 +1,7 @@
|
||||
# marqdo-view 现状(STATUS)
|
||||
|
||||
> 唯一现状来源。规范见 `docs/architecture/RFC-VIEW-0002.md`;本文只记录
|
||||
> **实际完成、证据与限制**。最后更新:2026-11-22(RFC-VIEW-0002 PR-00 完成)
|
||||
> **实际完成、证据与限制**。最后更新:2026-11-22(PR-00~PR-06 完成)
|
||||
|
||||
## 版本与基线
|
||||
|
||||
@@ -15,67 +15,73 @@
|
||||
| 协议 | Tool v1 / Analysis v2 / Trace v2 / `marqdo.md.v1` |
|
||||
| 目标平台 | Linux x86_64 glibc(正式);其他平台不支持/未验证 |
|
||||
| 视觉基准 | `docs/design/reference-old-view-reader.png`(**2048×1133**) |
|
||||
| 验收状态 | `docs/ACCEPTANCE.md`(§10 门禁全部 PASS);机器证据见 `docs/evidence/<CLI-SHA>/manifest.json` |
|
||||
|
||||
## RFC-VIEW-0002 里程碑
|
||||
## RFC-VIEW-0002 里程碑(全部完成)
|
||||
|
||||
| 阶段 | 状态 | 证据 |
|
||||
|---|---|---|
|
||||
| PR-00 基线、旧 View 取证、冻结 CLI 合同 | **完成** | `docs/audits/legacy-view.md`、`docs/audits/protocol-contract-0002.md`、`docs/decisions/0007` |
|
||||
| PR-01 Tool v1 打包/安装/调度、0.2.0、scripts/、CI | **完成** | `scripts/package.sh`、`scripts/install-smoke.sh`、`scripts/verify-frozen-cli.sh`、`.github/workflows/ci.yml`;冻结 CLI `tool install`/`view --help`/篡改拒绝实测 |
|
||||
| PR-02 Reader/Analysis 只读面与目标目录结构 | **完成** | `src/protocol/*`、`src/reader/*`、`src/config.rs`、`tests/{contract,integration}/`、`/api/documents`;证据 `docs/evidence/PR-02/` |
|
||||
| PR-03 执行层:request/process/controller、pure + project grants | **完成** | `src/execution/{request,process,controller,events}.rs`、`--run-timeout`、ADR-0008、`tests/integration/execution.rs`;证据 `docs/evidence/PR-03/` |
|
||||
| PR-04 SSE 任务生命周期、取消、7 路由、会话 Cookie/CSRF | **完成** | `src/server/{mod,routes,security,sse}.rs`、`assets/reader.js` SSE/表单、`tests/integration/http_live.rs`、`tests/security/`、真实 Chromium + 真实冻结 CLI SSE 证据 `docs/evidence/PR-04/` |
|
||||
| PR-05 Trace 绑定/原文标注/浏览器回归 | **完成** | Controller Trace 摘要/`source_id`/stale、ADR-0010、`docs/evidence/PR-05/`(Chromium + 截图) |
|
||||
| PR-06 静态导出/发布包/文档闭环 | 待开始 | `src/export.rs`、`scripts/acceptance.sh`、`docs/ACCEPTANCE.md` |
|
||||
| PR-00 基线、旧 View 取证、冻结 CLI 合同 | **完成** | `docs/audits/legacy-view.md`、`docs/audits/protocol-contract-0002.md`、ADR-0007 |
|
||||
| PR-01 Tool v1 打包/安装/调度、0.2.0、scripts/、CI | **完成** | `scripts/package.sh`、`scripts/verify-frozen-cli.sh`、`.github/workflows/ci.yml`、`docs/evidence/PR-01/` |
|
||||
| PR-02 Reader/Analysis 目标目录与只读面 | **完成** | `src/protocol/*`、`src/reader/*`、`src/config.rs`、`/api/documents`、`tests/{contract,integration}`、`docs/evidence/PR-02/` |
|
||||
| PR-03 执行层:request/process/controller、pure + project grants | **完成** | `src/execution/*`、`--run-timeout`、ADR-0008、`docs/evidence/PR-03/` |
|
||||
| PR-04 SSE 任务生命周期、取消、7 路由、会话 Cookie/CSRF | **完成** | `src/server/{mod,routes,security,sse}.rs`、`assets/reader.js`、ADR-0009、`docs/evidence/PR-04/`(真实 CLI + Chromium) |
|
||||
| PR-05 Trace 绑定/原文标注/浏览器回归 | **完成** | Controller Trace 摘要/`source_id`/stale、ADR-0010、`docs/evidence/PR-05/` |
|
||||
| PR-06 静态导出/发布包/示例/文档闭环 | **完成** | `examples/*.mq.md`、`scripts/check-examples.sh`、`scripts/test-no-exec.sh`、`docs/ACCEPTANCE.md`、最终 evidence manifest |
|
||||
|
||||
## 继承自 0001 的可用资产(不等于 0002 验收通过)
|
||||
## 能力现状
|
||||
|
||||
以下能力已实现并有测试/证据,但需在 0002 架构下迁移、补路由/SSE 与重新验收:
|
||||
|
||||
| 能力 | 现状 |
|
||||
| 能力 | 状态 |
|
||||
|---|---|
|
||||
| 原始 Markdown/GFM 阅读、源码态、搜索/设置/打印 | 已实现(单一 `assets/reader.css`/`assets/reader.js`) |
|
||||
| Analysis v2 严格校验、函数/Unit/签名/诊断/导入/引用/资源投影 | 已实现(无效 span 降级) |
|
||||
| 单一 `ReaderRenderer`,Live/Export 共用 | 已实现(`src/reader/render.rs`,门禁测试) |
|
||||
| 显式确认 + SSE 异步执行 + Trace v2 | 已实现(7 路由、单任务、取消、断线重放) |
|
||||
| 静态离线导出(无执行、manifest/哈希、原子发布) | 已实现,待按 0002 重新验收 |
|
||||
| Tool v1 打包/安装/分发、冻结 CLI SHA 前后一致 | 已实现,待迁移至 `scripts/` 与 0.2.0 |
|
||||
| HTTP 安全(Host/Origin/CSRF/路径 containment/CSP) | 部分实现;缺**会话 Cookie**模型与 7 路由合同 |
|
||||
| 真实 Chromium 视觉/交互/无 JS/打印 | 已有证据(0001 时期),待按 0002 宽度矩阵重跑 |
|
||||
|
||||
## 与 RFC-VIEW-0002 的已知差距(剩余项)
|
||||
|
||||
PR-00~PR-04 已关闭 SSE、7 路由、单函数调用表单、受控 project grants、
|
||||
会话 Cookie/CSRF、取消/去重/单任务、执行预算与有界输出、目标目录/测试树/
|
||||
`scripts/`/CI/浏览器宽度矩阵。**剩余**:
|
||||
|
||||
1. **PR-06**:`examples/{welcome,branch-loop,function-params,knowledge-only,
|
||||
unsafe-side-effect}.mq.md` 需按 RFC §13.3 创建并用冻结 CLI 实际 check/call
|
||||
记录;静态导出需按 0002 重新跑离线/零执行验收;更新 ACCEPTANCE/README/
|
||||
COMPATIBILITY/CHANGELOG 为 0002 口径并生成最终 evidence manifest。
|
||||
2. 0002 §9.2 N 系列须逐项在最终验收报告中登记(当前 HTTP/SSE/安全套件已覆盖
|
||||
大部分:N01/N02/N03/N04/N05/N06/N07/N09/N10/N11/N12/N13/N14/N15/N16/N17/
|
||||
N19/N21/N22 有对应测试;N18/N20 在 PR-06 冻结 CLI/导出套件中登记)。
|
||||
3. 视觉/可达性的人工像素级比对与完整 screen-reader 走查仍标 `UNVERIFIED`,
|
||||
自动化几何/颜色/无外部资源/响应式证据已存在(`docs/evidence/PR-04/`)。
|
||||
| 原始 Markdown/GFM 阅读、源码态、搜索/设置/打印/深色主题 | 已实现(单一 `assets/reader.css` + `assets/reader.js`) |
|
||||
| Analysis v2 严格校验 + 函数/Unit/签名/诊断/导入/引用/资源投影 | 已实现(无效 span/摘要降级,未知 major 拒绝) |
|
||||
| 单一 Read Model/HTML 组件/CSS/JS;Live=Export | 已实现(门禁测试) |
|
||||
| 固定 7 路由 Live 服务;打开/刷新/搜索/切换/导出零执行 | 已实现并测试 |
|
||||
| 显式单任务执行(run main / call function),纯 + 受控 project fs grants | 已实现(两阶段确认、命令预览、二次确认) |
|
||||
| SSE 状态/终态、取消、心跳、Last-Event-ID 重放、无轮询 | 已实现(单任务、128 环形缓冲、2 连接上限) |
|
||||
| 运行结果(Wire Value/stdout/stderr/错误/诊断)安全文本展示 | 已实现(无 innerHTML 服务端数据) |
|
||||
| Trace v2 调用/分支/循环/副作用 + 原文锚点 + stale 降级 | 已实现(分组 chip、来源标注、截断/无效显式) |
|
||||
| Tool v1 独立安装/分发、冻结 CLI SHA 前后一致 | 已实现(0.2.0 包,篡改拒绝) |
|
||||
| 静态离线导出(无执行、无联网、manifest/哈希、不可变发布) | 已实现并重新验收 |
|
||||
| 固定 examples(welcome/branch-loop/function-params/knowledge-only/unsafe-side-effect) | 已实现,冻结 CLI check/call/run 实测 |
|
||||
| 逐语句变量值 / 参数实际值 / 内存快照 | **UNSUPPORTED**(Trace v2 不提供,绝不伪造) |
|
||||
| 知识“已证明” / Prove / Lint | **UNSUPPORTED**(等待独立版本化报告协议) |
|
||||
| 调试器/断点/单步/调用栈、Notebook/持久内核、Session/journal | **不实现**(RFC 明确删除) |
|
||||
| AI/Agent/Token 流、插件市场、DB/多租户 | **不实现**(非目标) |
|
||||
| `strict`、net/process/env/plugin/provider/kernel 授权 UI | **不提供**(拒绝并引导终端 CLI) |
|
||||
| Windows/macOS 发行 | **不支持/未验证** |
|
||||
|
||||
## 明确 UNSUPPORTED / 非目标(不得伪造)
|
||||
|
||||
- 逐语句变量值、参数实际值、内存快照/地址寄存器:Trace v2 不提供,永远显示
|
||||
“不支持”,不得用 `value` 代替。
|
||||
- 知识“已证明”/Prove、Lint、Knowledge 编译:独立仓库/未来版本化报告。
|
||||
- Notebook/Run All/持久内核、断点/单步/调用栈/时间旅行、Session/journal/snapshot。
|
||||
- AI/Agent/LLM Token 流、插件市场/热插拔、数据库/账号/多租户。
|
||||
- 第二套 Markdown AST/解释器/`inspect --ir` 解析:FORBIDDEN。
|
||||
- Windows/macOS 发行、`strict` 模式按钮、net/process/env/foreign 授权 UI:首版不做。
|
||||
- 变量/内存/逐语句值:Trace v2 不提供;UI 只有一个明确的“未提供的能力”说明。
|
||||
- 数学/领域正确性与“已证明”:Analysis 成功 ≠ 证明;未来 Prove 独立提供。
|
||||
- Notebook/Run All/内核重启、断点/单步/时间旅行、第二套 Markdown AST/解释器。
|
||||
- 网络/进程/环境/插件/Provider/Foreign 授权 UI;高级执行由用户在终端运行 CLI。
|
||||
|
||||
## 复现与证据
|
||||
## 证据入口
|
||||
|
||||
- 冻结 CLI 合同与实测:`docs/audits/protocol-contract-0002.md`
|
||||
- 旧 View 取证:`docs/audits/legacy-view.md`(静态;运行时 `LEGACY_RUNTIME_UNVERIFIED`)
|
||||
- 0002 条款映射:`docs/CONFORMANCE.md`
|
||||
- 验收(0001 时期,历史):`docs/ACCEPTANCE.md`、`docs/evidence/`
|
||||
- 0001 时期一键验收脚本:`scripts/acceptance.sh`(PR-01 后迁移为 `scripts/` 口径)
|
||||
| 内容 | 路径 |
|
||||
|---|---|
|
||||
| 一键验收 + 最终 manifest | `scripts/acceptance.sh`;`docs/evidence/2c7c4f31…/manifest.json` |
|
||||
| 验收门禁报告 | `docs/ACCEPTANCE.md` |
|
||||
| 0002 合规矩阵 | `docs/CONFORMANCE.md` |
|
||||
| 冻结 CLI 合同 | `docs/audits/protocol-contract-0002.md` |
|
||||
| 旧 View 取证 | `docs/audits/legacy-view.md`(静态;运行时 `LEGACY_RUNTIME_UNVERIFIED`) |
|
||||
| 分 PR 证据 | `docs/evidence/PR-01..PR-06/` |
|
||||
| 示例 fixture 实测 | `scripts/check-examples.sh`(输出见 `docs/evidence/PR-06/`) |
|
||||
| 零执行哨兵 | `scripts/test-no-exec.sh` |
|
||||
| 浏览器截图/日志 | `docs/evidence/PR-04/`、`docs/evidence/PR-05/` |
|
||||
| 决策记录 | `docs/decisions/0001..0010` |
|
||||
|
||||
## 已知限制与偏差(诚实状态)
|
||||
|
||||
- 首版运行仅 `pure` 与受控 `project` fs read/write;`project` 不是 OS 沙箱,
|
||||
不自动提升 `marqdo.yaml` capability 请求。
|
||||
- SSE 只推送 View 生命周期与终态数据,不承诺逐字 stdout/Token 流(RFC §6.1)。
|
||||
- 观测侧注采用内联分组 chip,而非 SVG 曲线;按 RFC §4.4 允许降级(ADR-0010)。
|
||||
- 像素级人工视觉比对与完整 screen-reader 走查仍为 `UNVERIFIED`;自动化证据充分。
|
||||
- 远端 CI 配置已提供,但本环境未实际运行远端 CI;证据来自本地真实命令。
|
||||
- 平台:Linux x86_64 glibc 正式验证;其他平台不声明支持。
|
||||
|
||||
## 复现文档
|
||||
|
||||
@@ -83,4 +89,4 @@ PR-00~PR-04 已关闭 SSE、7 路由、单函数调用表单、受控 project
|
||||
- 规范:`docs/architecture/RFC-VIEW-0002.md`(当前)、`RFC-VIEW-0001.md`(历史)
|
||||
- 兼容性:`COMPATIBILITY.md`
|
||||
- 变更:`CHANGELOG.md`
|
||||
- 决策:`docs/decisions/0001..0007`
|
||||
- 决策:`docs/decisions/`
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"analysis_protocol": 2,
|
||||
"archive_sha256": "b482d26c7098178de520aad14d5ac9b7160265eaf9c98666b3e9785a3ddbeafc",
|
||||
"archive_sha256": "9abd996e1c54b24ef0ec2c7e80c93ca93993ca73cce573f07b922df73a1863f6",
|
||||
"cli_binary_sha256_after": "062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f",
|
||||
"cli_binary_sha256_before": "062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f",
|
||||
"cli_source_sha": "2c7c4f31e7a388d3fcfa717a77067e696ed13854",
|
||||
"commands": {
|
||||
"notes": "Generated from real command exit statuses; install/verify/export/run use the frozen CLI archive copied to an isolated tool home.",
|
||||
"script": "tools/acceptance.sh"
|
||||
"script": "scripts/acceptance.sh"
|
||||
},
|
||||
"gates": {
|
||||
"archive_install": "PASS",
|
||||
@@ -16,9 +16,11 @@
|
||||
"bundle": "PASS",
|
||||
"clippy": "PASS",
|
||||
"core_sha": "PASS",
|
||||
"examples_check": "PASS",
|
||||
"export": "PASS",
|
||||
"export_suite": "PASS",
|
||||
"fmt": "PASS",
|
||||
"no_exec_suite": "PASS",
|
||||
"real_run": "PASS",
|
||||
"security_suite": "PASS",
|
||||
"test": "PASS",
|
||||
@@ -26,18 +28,20 @@
|
||||
"verify": "PASS",
|
||||
"view_help": "PASS"
|
||||
},
|
||||
"generated_at_utc": "2026-11-22T04:07:21.776009+00:00",
|
||||
"generated_at_utc": "2026-11-22T06:48:46.803005+00:00",
|
||||
"schema": "marqdo.view-conformance",
|
||||
"schema_version": 1,
|
||||
"target": "x86_64-unknown-linux-gnu",
|
||||
"tests": {
|
||||
"browser": "PASS",
|
||||
"contract": "PASS",
|
||||
"examples": "PASS",
|
||||
"export": "PASS",
|
||||
"no_exec": "PASS",
|
||||
"security": "PASS"
|
||||
},
|
||||
"tool_protocol": 1,
|
||||
"trace_protocol": 2,
|
||||
"view_binary_sha256": "97772ffefeb8df1f3dfbfe04c5112517ba3657497df4717ab85c6b026daf6bba",
|
||||
"view_source_sha": "d641ca58ac77c69a15a98c8a1233ae6dbd83017f"
|
||||
"view_binary_sha256": "eb19f79632457f37ae3573696d7db84d57358627b65e618819ff80f132b0026a",
|
||||
"view_source_sha": "807c24b9523bd3f8ace5b36582b5de905327eecb"
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
# PR-06 证据:示例、静态导出、发布门禁与文档闭环
|
||||
|
||||
- 日期:2026-11-22
|
||||
- 范围:`examples/*.mq.md`、`scripts/{check-examples,test-no-exec}.sh`、
|
||||
`scripts/acceptance.sh`、静态导出控件收敛、最终 ACCEPTANCE/STATUS/README
|
||||
- 冻结 CLI:`marqdo 3.0.0-beta.1`,SHA-256
|
||||
`062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f`
|
||||
- 机器证据(最终):`docs/evidence/2c7c4f31e7a388d3fcfa717a77067e696ed13854/manifest.json`
|
||||
(在本 PR-06 提交上重跑 `scripts/acceptance.sh` 生成;`manifest.pre-commit.json`
|
||||
为文档定稿前同一代码的预跑结果,保留对照)
|
||||
|
||||
## 1. §13.3 示例(真实 CLI)
|
||||
|
||||
`check-examples.log`:
|
||||
|
||||
- 5 个示例全部 `check --emit` 成功;
|
||||
- `call function-params.mq.md double --arg n=5` → `Int(10)`;
|
||||
- `run branch-loop.mq.md` → `Int(0)`,Trace 含 `loop.iteration`/`return`;
|
||||
- `run knowledge-only.mq.md` → exit 1 `sem.no_entry_function`(无隐式替代);
|
||||
- `run unsafe-side-effect.mq.md --mode pure` → `permission.denied`,无文件;
|
||||
- `--mode project --allow-write out --allow-write 'out/**'` → 仅此时写出
|
||||
`out/view-sentinel.txt`(内容 `explicit run only\n`);
|
||||
- 全程冻结 CLI SHA 不变。
|
||||
|
||||
## 2. §13.4 零执行哨兵(真实 HTTP + 导出)
|
||||
|
||||
`no-exec.log`:对 unsafe-side-effect 执行
|
||||
`GET /`、`GET /file`、`GET /api/documents`、重复 reload、`view export` 后:
|
||||
|
||||
- `examples/**/*.mq.md`、`marqdo.yaml`、`view.json`、`marqdo.lock` 哈希不变;
|
||||
- 无 `examples/out/view-sentinel.txt`;
|
||||
- 导出的 HTML **不含** `data-action="run"`、`mq-csrf-token` 或外链;
|
||||
- 冻结 CLI SHA 不变。
|
||||
|
||||
## 3. 一键验收(§9.4)
|
||||
|
||||
`acceptance.log`(真实命令输出)包含:
|
||||
|
||||
```
|
||||
fmt / clippy / test / build / bundle / archive_install / tool_list / view_help /
|
||||
verify / export / examples_check / browse / real_run / export_suite /
|
||||
no_exec_suite / security_suite / browser / core_sha -> 全部 PASS
|
||||
```
|
||||
|
||||
其中:
|
||||
|
||||
- `test`:unit 63 + contract 41 + integration 43 + security 11 = 158 PASS;
|
||||
- `browser`:welcome/control-flow/security-project,真实 Chromium 131,
|
||||
EventSource 终态、宽矩阵、主题、无外部请求、无 console error;
|
||||
- `real_run`:真实冻结 CLI + SSE,`succeeded` + `trace.status=verified`;
|
||||
- `core_sha`:CLI before == after == `062cb56e…`。
|
||||
|
||||
## 4. 发布包
|
||||
|
||||
- 版本:`marqdo-view 0.2.0`;
|
||||
- 包:`dist/marqdo-view-0.2.0-x86_64-unknown-linux-gnu.tar.gz`
|
||||
(SHA-256 记录在最终 manifest 的 `archive_sha256`);
|
||||
- 从 `.tar.gz` 解包到独立临时目录后经冻结 CLI `tool install` 安装、`view --help`
|
||||
分发与真实运行;安装态与本地源码目录解耦。
|
||||
|
||||
## 5. 仍未验证(诚实项)
|
||||
|
||||
- 人工像素级比对(相对 2048×1133 参考图)与完整 screen-reader 走查:`UNVERIFIED`;
|
||||
- 远端 CI 未实际运行(配置已提供);
|
||||
- Windows/macOS 未构建/未验证。
|
||||
@@ -0,0 +1,541 @@
|
||||
==> fmt
|
||||
[acceptance] fmt: PASS
|
||||
==> clippy
|
||||
Checking marqdo-view v0.2.0 (/root/work/marqdo-view)
|
||||
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.67s
|
||||
[acceptance] clippy: PASS
|
||||
==> test
|
||||
Compiling marqdo-view v0.2.0 (/root/work/marqdo-view)
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.74s
|
||||
Running unittests src/lib.rs (target/debug/build/marqdo-view/c349aa60d8df28c9/out/marqdo_view-c349aa60d8df28c9)
|
||||
|
||||
running 63 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_args_are_explicit_argv_never_shell ... ok
|
||||
test core_client::tests::scratch_dir_is_private_and_removed ... ok
|
||||
test core_client::tests::stderr_summary_is_bounded ... ok
|
||||
test execution::controller::tests::cli_errors_support_both_envelope_shapes ... ok
|
||||
test cli::tests::parses_browse_defaults ... ok
|
||||
test cli::tests::export_requires_out ... ok
|
||||
test execution::controller::tests::run_ids_are_unguessable_and_unique ... ok
|
||||
test cli::tests::parses_export_subcommand ... 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::events::tests::terminal_job_replays_snapshot_and_closes ... ok
|
||||
test execution::events::tests::utc_formatting_is_stable ... ok
|
||||
test execution::process::tests::bounded_capture_keeps_limit_and_drains ... ok
|
||||
test cli::tests::run_timeout_is_bounded_to_rfc_range ... ok
|
||||
test execution::process::tests::default_budget_matches_rfc ... ok
|
||||
test execution::controller::tests::wire_value_summary_is_safe_and_never_html ... ok
|
||||
test execution::events::tests::ring_is_bounded_and_old_cursor_gets_snapshot ... ok
|
||||
test cli::tests::parses_verify_and_global_options_anywhere ... ok
|
||||
test export::tests::manifest_relative_paths_are_validated ... ok
|
||||
test execution::request::tests::rejects_unknown_fields_and_bad_modes ... ok
|
||||
test execution::request::tests::rejects_absolute_and_parent_globs ... ok
|
||||
test export::tests::export_target_outside_project_is_accepted ... ok
|
||||
test protocol::analysis_v2::tests::source_id_is_deterministic_and_bounded ... ok
|
||||
test execution::request::tests::entry_without_main_is_explicitly_rejected ... ok
|
||||
test protocol::analysis_v2::tests::rejects_unknown_schema_major_and_profile ... ok
|
||||
test execution::request::tests::unknown_parameter_names_are_rejected_before_execution ... ok
|
||||
test execution::request::tests::canonical_names_and_targets_resolve ... ok
|
||||
test protocol::tool_v1::tests::negotiates_known_protocols_only ... ok
|
||||
test protocol::tool_v1::tests::parses_official_version_line ... ok
|
||||
test protocol::tool_v1::tests::rejects_stable_only_reinterpretation ... ok
|
||||
test protocol::trace_v2::tests::state_values_are_stable ... ok
|
||||
test protocol::trace_v2::tests::trace_kinds_are_additive_safe ... ok
|
||||
test reader::assets::tests::base64_matches_known_vectors ... ok
|
||||
test protocol::analysis_v2::tests::projects_valid_analysis ... ok
|
||||
test protocol::analysis_v2::tests::rejects_digest_mismatch ... 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::model::tests::status_values_are_stable ... ok
|
||||
test reader::markdown::tests::parses_lists_quotes_and_task_items ... ok
|
||||
test reader::source::path_tests::normalizes_harmless_forms ... ok
|
||||
test reader::markdown::tests::parses_gfm_and_preserves_utf8_spans ... ok
|
||||
test reader::source::path_tests::rejects_unsafe_relative_paths ... ok
|
||||
test reader::markdown::tests::parses_math_and_code_as_inert_literals ... ok
|
||||
test reader::source::tests::bom_is_still_indexed ... ok
|
||||
test reader::source::tests::maps_multibyte_and_emoji_offsets ... ok
|
||||
test reader::source::tests::digest_is_exact_bytes ... ok
|
||||
test reader::source::tests::rejects_out_of_range_and_misaligned_spans ... 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::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. 63 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
|
||||
|
||||
Running unittests src/main.rs (target/debug/build/marqdo-view/35e1f759375c2551/out/marqdo_view-35e1f759375c2551)
|
||||
|
||||
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/8ae29fd710d6819e/out/contract-8ae29fd710d6819e)
|
||||
|
||||
running 41 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::missing_document_is_an_io_error ... ok
|
||||
test cli_surface::export_requires_an_output_directory ... 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::check_refs_is_forwarded_as_a_stricter_flag ... ok
|
||||
test core_contract::failed_check_normalizes_diagnostics_without_absolute_paths ... ok
|
||||
test core_contract::check_returns_exact_analysis_bytes_and_digest ... ok
|
||||
test core_contract::incompatible_product_version_is_rejected_before_any_work ... ok
|
||||
test asset_integrity::embedded_asset_bundle_matches_disk_and_has_one_theme ... ok
|
||||
test core_contract::missing_emit_after_success_is_an_analysis_failure ... ok
|
||||
test no_coupling::no_private_core_crate_dependencies ... ok
|
||||
test no_coupling::release_lockfile_is_committed ... ok
|
||||
test core_contract::run_invalid_json_is_a_protocol_io_error ... 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::run_returns_json_and_raw_trace ... ok
|
||||
test core_contract::cli_verify_end_to_end_against_fake_core ... ok
|
||||
test core_contract::run_without_trace_file_reports_no_trace ... ok
|
||||
test no_coupling::source_never_reads_or_links_the_legacy_repositories ... ok
|
||||
test trace_contract::failed_run_keeps_the_core_error_code ... ok
|
||||
test presentation_states::failed_check_keeps_prose_and_shows_core_diagnostics ... ok
|
||||
test presentation_states::invalid_core_span_is_dropped_with_an_explicit_warning ... ok
|
||||
test presentation_states::source_digest_mismatch_degrades_instead_of_misbinding ... ok
|
||||
test core_contract::cli_verify_rejects_schema_v3_and_digest_mismatch ... ok
|
||||
test presentation_states::unknown_analysis_schema_is_a_hard_protocol_error ... ok
|
||||
test trace_contract::golden_digest_is_really_sha256_of_analysis_bytes ... ok
|
||||
test trace_contract::non_monotonic_sequence_is_rejected ... ok
|
||||
test core_contract::timeout_kills_the_process_group_and_reports_timeout ... ok
|
||||
test trace_contract::truncated_trace_is_explicitly_marked ... ok
|
||||
test trace_contract::stale_analysis_bytes_are_rejected ... ok
|
||||
test trace_contract::unknown_event_module_is_rejected ... ok
|
||||
test trace_contract::unknown_schema_major_is_a_protocol_error_not_a_stale_trace ... ok
|
||||
test trace_contract::real_control_flow_trace_binds_and_projects_events ... ok
|
||||
test presentation_states::run_attached_to_changed_source_becomes_stale ... ok
|
||||
|
||||
test result: ok. 41 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.67s
|
||||
|
||||
Running tests/integration/main.rs (target/debug/build/marqdo-view/09a14a21a5f580dd/out/integration-09a14a21a5f580dd)
|
||||
|
||||
running 43 tests
|
||||
test execution::run_without_a_trace_file_succeeds_but_reports_unavailable_trace ... ok
|
||||
test execution::same_client_request_id_is_idempotent_and_different_payload_conflicts ... ok
|
||||
test execution::cross_session_observation_is_rejected ... ok
|
||||
test execution::second_run_is_busy_while_one_is_active_and_cancel_is_idempotent ... ok
|
||||
test execution::explicit_entry_run_streams_accepted_running_and_succeeded_with_verified_trace ... ok
|
||||
test execution::call_target_uses_the_call_subcommand_and_function_name ... ok
|
||||
test execution::event_frames_use_the_view_run_events_schema_and_numeric_ids ... ok
|
||||
test execution::project_grants_are_mapped_to_explicit_cli_flags_and_pure_grants_are_rejected ... ok
|
||||
test export::exported_html_has_no_remote_subresources ... ok
|
||||
test export::real_frozen_core_export_marks_both_pages_static_ok ... ok
|
||||
test export::refuses_to_export_inside_the_project_root ... 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::refuses_to_overwrite_unrelated_non_empty_directory ... ok
|
||||
test execution::stale_analysis_digest_is_rejected_before_any_process_starts ... ok
|
||||
test http_live::assets_are_immutable_and_carry_strict_headers ... ok
|
||||
test execution::trace_with_a_mismatched_digest_is_reported_invalid_but_the_run_still_succeeds ... ok
|
||||
test http_live::document_without_main_is_rejected_without_running_another_function ... ok
|
||||
test execution::truncated_trace_is_marked_without_claiming_complete_coverage ... ok
|
||||
test export::replaces_a_previous_export_atomically ... 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 export::export_never_executes_side_effects ... 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 http_live::cancel_is_idempotent_and_yields_one_terminal_state ... ok
|
||||
test rendering::semantic_annotations_come_from_analysis_and_are_unique ... ok
|
||||
test rendering::static_pages_use_parent_relative_assets_and_links ... ok
|
||||
test http_live::at_most_two_sse_observers_per_run ... ok
|
||||
test rendering::tables_math_and_code_are_inert_and_readable ... ok
|
||||
test unicode_spans::crlf_source_keeps_exact_digest_and_line_mapping ... ok
|
||||
test rendering::welcome_hero_only_when_configured ... 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 rendering::run_controls_are_explicitly_unavailable_before_pr04 ... 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 execution::source_edit_during_a_run_marks_the_result_stale_and_drops_anchor_ids ... ok
|
||||
test http_live::last_event_id_replays_only_newer_events_and_old_cursor_gets_snapshot ... ok
|
||||
test http_live::sse_heartbeats_keep_a_slow_job_connected ... ok
|
||||
|
||||
test result: ok. 43 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.35s
|
||||
|
||||
Running tests/security/main.rs (target/debug/build/marqdo-view/a005d0c01f80685f/out/security-a005d0c01f80685f)
|
||||
|
||||
running 11 tests
|
||||
test path_traversal_is_rejected_and_the_old_document_route_is_gone ... ok
|
||||
test session_cookie_and_headers_are_hardened ... ok
|
||||
test aggressive_markdown_links_cannot_become_a_file_read_api ... ok
|
||||
test adversarial_markdown_never_injects_markup_or_handlers ... ok
|
||||
test symlink_escape_outside_the_project_root_is_rejected ... 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 host_origin_session_csrf_and_json_are_all_required_before_execution ... ok
|
||||
test cancel_cannot_be_replayed_to_start_a_new_process ... ok
|
||||
test sse_requires_a_session_and_only_the_owning_session_can_read_or_cancel ... ok
|
||||
test sse_and_cancel_are_scoped_to_the_owning_session ... ok
|
||||
|
||||
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.72s
|
||||
|
||||
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
|
||||
|
||||
[acceptance] test: PASS
|
||||
==> build
|
||||
Compiling marqdo-view v0.2.0 (/root/work/marqdo-view)
|
||||
Finished `release` profile [optimized] target(s) in 18.11s
|
||||
[acceptance] build: PASS
|
||||
==> bundle
|
||||
==> cargo build --release --locked
|
||||
Finished `release` profile [optimized] target(s) in 0.03s
|
||||
==> smoke install against frozen core
|
||||
install-smoke: PASS (core sha256 062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f unchanged, tool home /root/work/marqdo-view/dist/smoke-tool-home.Wnw7F6)
|
||||
bundle: /root/work/marqdo-view/dist/marqdo-view
|
||||
archive: /root/work/marqdo-view/dist/marqdo-view-0.2.0-x86_64-unknown-linux-gnu.tar.gz
|
||||
sha256: 9abd996e1c54b24ef0ec2c7e80c93ca93993ca73cce573f07b922df73a1863f6
|
||||
[acceptance] bundle: PASS
|
||||
==> archive_install
|
||||
installed tool `view` version 0.2.0 (marqdo-view)
|
||||
[acceptance] archive_install: PASS
|
||||
==> tool_list
|
||||
[acceptance] tool_list: PASS
|
||||
==> view_help
|
||||
[acceptance] view_help: PASS
|
||||
==> verify
|
||||
core: marqdo 3.0.0-beta.1 (supported >=3.0.0-beta.1,<4.0.0)
|
||||
project: root:mixed-modes@0.1.0 (manifest)
|
||||
document: index.mq.md
|
||||
analysis: schema=marqdo.analysis v2 modules=1 functions=1 digest=sha256:5b13d0cd2044cbe3d5d5f51145a9dd0015e2992400f803dad5f0e42214ce4959
|
||||
source digest: match
|
||||
result: PASS (static only; document not executed)
|
||||
[acceptance] verify: PASS
|
||||
==> export
|
||||
marqdo view export: 1 page(s), 8 file(s) → /root/work/marqdo-view/dist/acceptance/site
|
||||
manifest: sha256:74059e7274165cf341e576aac6f6a7fef0d8210261186b234fa85a2a2308bdb7
|
||||
executed: false (纯静态导出,未运行任何文档)
|
||||
[acceptance] export: PASS
|
||||
==> examples_check
|
||||
==> check all five example documents (no execution)
|
||||
==> call function-params.double(n=5) -> 10
|
||||
call double(5): PASS (Int 10)
|
||||
==> run branch-loop main -> Int 0 with loop/return trace
|
||||
run branch-loop: PASS (value 0, events: call.enter,call.exit,loop.iteration,return)
|
||||
==> knowledge-only has no main (truthful failure, 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 062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f unchanged)
|
||||
[acceptance] examples_check: PASS
|
||||
[acceptance] browse: PASS
|
||||
explicit real run: PASS (run_id=77a58eba767b473139297b25069a34c0 events=285)
|
||||
[acceptance] real_run: PASS
|
||||
==> export_suite
|
||||
marqdo view export: 2 page(s), 9 file(s) → /root/work/marqdo-view/dist/test-export-site
|
||||
manifest: sha256:47c8931c864c86d7d5a4f7ec11a68fba56961f5f03d29d19eac447f9db7645a3
|
||||
executed: false (纯静态导出,未运行任何文档)
|
||||
export manifest: PASS (2 pages, 3 files)
|
||||
file:// offline browser check: PASS
|
||||
export: PASS (offline site at /root/work/marqdo-view/dist/test-export-site; core sha256 062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f unchanged)
|
||||
[acceptance] export_suite: PASS
|
||||
==> no_exec_suite
|
||||
==> Live read-only requests
|
||||
==> Static export
|
||||
no-exec: PASS (sources/lock unchanged, no sentinel, no run control in export; core sha unchanged)
|
||||
[acceptance] no_exec_suite: PASS
|
||||
==> security_suite
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.03s
|
||||
Running tests/security/main.rs (target/debug/build/marqdo-view/a005d0c01f80685f/out/security-a005d0c01f80685f)
|
||||
|
||||
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 symlink_escape_outside_the_project_root_is_rejected ... ok
|
||||
test host_origin_session_csrf_and_json_are_all_required_before_execution ... 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 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.73s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.03s
|
||||
Running tests/integration/main.rs (target/debug/build/marqdo-view/09a14a21a5f580dd/out/integration-09a14a21a5f580dd)
|
||||
|
||||
running 43 tests
|
||||
test execution::run_without_a_trace_file_succeeds_but_reports_unavailable_trace ... ok
|
||||
test execution::cross_session_observation_is_rejected ... ok
|
||||
test execution::same_client_request_id_is_idempotent_and_different_payload_conflicts ... ok
|
||||
test execution::second_run_is_busy_while_one_is_active_and_cancel_is_idempotent ... ok
|
||||
test execution::event_frames_use_the_view_run_events_schema_and_numeric_ids ... ok
|
||||
test execution::explicit_entry_run_streams_accepted_running_and_succeeded_with_verified_trace ... ok
|
||||
test execution::call_target_uses_the_call_subcommand_and_function_name ... ok
|
||||
test execution::project_grants_are_mapped_to_explicit_cli_flags_and_pure_grants_are_rejected ... ok
|
||||
test export::exported_html_has_no_remote_subresources ... 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::refuses_to_export_inside_the_project_root ... ok
|
||||
test export::exports_offline_site_with_shared_renderer_and_relative_links ... ok
|
||||
test export::refuses_to_overwrite_unrelated_non_empty_directory ... ok
|
||||
test http_live::assets_are_immutable_and_carry_strict_headers ... ok
|
||||
test execution::stale_analysis_digest_is_rejected_before_any_process_starts ... ok
|
||||
test http_live::document_without_main_is_rejected_without_running_another_function ... ok
|
||||
test execution::trace_with_a_mismatched_digest_is_reported_invalid_but_the_run_still_succeeds ... ok
|
||||
test execution::truncated_trace_is_marked_without_claiming_complete_coverage ... ok
|
||||
test export::replaces_a_previous_export_atomically ... 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 export::export_never_executes_side_effects ... 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 http_live::at_most_two_sse_observers_per_run ... ok
|
||||
test rendering::rendering_is_deterministic ... 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::knowledge_emphasis_never_becomes_an_execution_anchor ... ok
|
||||
test unicode_spans::unicode_spans_are_exact_and_duplicate_returns_get_distinct_anchors ... ok
|
||||
test rendering::run_controls_are_explicitly_unavailable_before_pr04 ... ok
|
||||
test http_live::cancel_is_idempotent_and_yields_one_terminal_state ... 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 execution::source_edit_during_a_run_marks_the_result_stale_and_drops_anchor_ids ... ok
|
||||
test http_live::last_event_id_replays_only_newer_events_and_old_cursor_gets_snapshot ... ok
|
||||
test http_live::sse_heartbeats_keep_a_slow_job_connected ... ok
|
||||
|
||||
test result: ok. 43 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.40s
|
||||
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.03s
|
||||
Running tests/contract/main.rs (target/debug/build/marqdo-view/8ae29fd710d6819e/out/contract-8ae29fd710d6819e)
|
||||
|
||||
running 41 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::non_loopback_bind_is_refused_by_default ... ok
|
||||
test cli_surface::help_comes_from_view_not_core ... 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::check_refs_is_forwarded_as_a_stricter_flag ... ok
|
||||
test core_contract::check_returns_exact_analysis_bytes_and_digest ... 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 asset_integrity::embedded_asset_bundle_matches_disk_and_has_one_theme ... ok
|
||||
test core_contract::missing_emit_after_success_is_an_analysis_failure ... ok
|
||||
test no_coupling::no_private_core_crate_dependencies ... ok
|
||||
test no_coupling::release_lockfile_is_committed ... ok
|
||||
test core_contract::run_invalid_json_is_a_protocol_io_error ... ok
|
||||
test no_coupling::tool_manifest_matches_package_and_protocols ... ok
|
||||
test core_contract::run_returns_json_and_raw_trace ... ok
|
||||
test no_coupling::exactly_one_reader_theme_and_script_entry ... ok
|
||||
test core_contract::run_without_trace_file_reports_no_trace ... ok
|
||||
test core_contract::cli_verify_end_to_end_against_fake_core ... ok
|
||||
test no_coupling::source_never_reads_or_links_the_legacy_repositories ... ok
|
||||
test trace_contract::failed_run_keeps_the_core_error_code ... ok
|
||||
test presentation_states::failed_check_keeps_prose_and_shows_core_diagnostics ... ok
|
||||
test presentation_states::invalid_core_span_is_dropped_with_an_explicit_warning ... ok
|
||||
test presentation_states::source_digest_mismatch_degrades_instead_of_misbinding ... ok
|
||||
test core_contract::cli_verify_rejects_schema_v3_and_digest_mismatch ... ok
|
||||
test presentation_states::unknown_analysis_schema_is_a_hard_protocol_error ... ok
|
||||
test trace_contract::golden_digest_is_really_sha256_of_analysis_bytes ... ok
|
||||
test trace_contract::real_control_flow_trace_binds_and_projects_events ... ok
|
||||
test core_contract::timeout_kills_the_process_group_and_reports_timeout ... ok
|
||||
test trace_contract::truncated_trace_is_explicitly_marked ... ok
|
||||
test trace_contract::unknown_schema_major_is_a_protocol_error_not_a_stale_trace ... ok
|
||||
test trace_contract::stale_analysis_bytes_are_rejected ... ok
|
||||
test trace_contract::non_monotonic_sequence_is_rejected ... ok
|
||||
test trace_contract::unknown_event_module_is_rejected ... ok
|
||||
test presentation_states::run_attached_to_changed_source_becomes_stale ... ok
|
||||
|
||||
test result: ok. 41 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.68s
|
||||
|
||||
note: MARQDO_FROZEN_BIN not set; skipped real-core export script
|
||||
security: PASS
|
||||
[acceptance] security_suite: PASS
|
||||
==> browser
|
||||
==> browser suite: examples/welcome
|
||||
ok reader root rendered
|
||||
ok document title has Marqdo
|
||||
ok one stylesheet
|
||||
ok one script
|
||||
ok no external requests
|
||||
ok no browser console errors
|
||||
ok dock has all actions
|
||||
ok dock run control present
|
||||
ok interactive controls have accessible names
|
||||
ok Tab reaches named controls
|
||||
ok more dialog opens
|
||||
ok source mode attribute
|
||||
ok source pane visible
|
||||
ok document hidden in source mode
|
||||
ok document mode restored
|
||||
ok search dialog opens
|
||||
ok search returns local results
|
||||
ok text size toggled
|
||||
ok annotations toggled
|
||||
ok welcome hero only on configured page
|
||||
ok grammar statement is a real element
|
||||
ok GFM table rendered
|
||||
ok dark theme applied
|
||||
ok theme preference persisted
|
||||
ok paper theme restored
|
||||
ok no horizontal overflow at 2048
|
||||
ok dock inside viewport at 2048
|
||||
ok no horizontal overflow at 1664
|
||||
ok dock inside viewport at 1664
|
||||
ok no horizontal overflow at 1440
|
||||
ok dock inside viewport at 1440
|
||||
ok no horizontal overflow at 1024
|
||||
ok dock inside viewport at 1024
|
||||
ok no horizontal overflow at 768
|
||||
ok dock inside viewport at 768
|
||||
ok no horizontal overflow at 390
|
||||
ok dock inside viewport at 390
|
||||
ok no-JS document remains readable
|
||||
ok no-JS exposes no active run UI
|
||||
ok print hides dock
|
||||
ok print keeps prose
|
||||
|
||||
browser: PASS
|
||||
==> browser suite: examples/control-flow
|
||||
ok reader root rendered
|
||||
ok document title has Marqdo
|
||||
ok one stylesheet
|
||||
ok one script
|
||||
ok no external requests
|
||||
ok no browser console errors
|
||||
ok dock has all actions
|
||||
ok dock run control present
|
||||
ok interactive controls have accessible names
|
||||
ok Tab reaches named controls
|
||||
ok more dialog opens
|
||||
ok source mode attribute
|
||||
ok source pane visible
|
||||
ok document hidden in source mode
|
||||
ok document mode restored
|
||||
ok search dialog opens
|
||||
ok search returns local results
|
||||
ok text size toggled
|
||||
ok annotations toggled
|
||||
ok dark theme applied
|
||||
ok theme preference persisted
|
||||
ok paper theme restored
|
||||
ok no horizontal overflow at 2048
|
||||
ok dock inside viewport at 2048
|
||||
ok no horizontal overflow at 1664
|
||||
ok dock inside viewport at 1664
|
||||
ok no horizontal overflow at 1440
|
||||
ok dock inside viewport at 1440
|
||||
ok no horizontal overflow at 1024
|
||||
ok dock inside viewport at 1024
|
||||
ok no horizontal overflow at 768
|
||||
ok dock inside viewport at 768
|
||||
ok no horizontal overflow at 390
|
||||
ok dock inside viewport at 390
|
||||
ok no-JS document remains readable
|
||||
ok no-JS exposes no active run UI
|
||||
ok print hides dock
|
||||
ok print keeps prose
|
||||
ok run dialog opens
|
||||
ok run dialog mentions pure mode
|
||||
ok run dialog previews the command
|
||||
ok run state succeeded via SSE
|
||||
ok run panel visible
|
||||
ok run chips anchored
|
||||
ok observed chips carry trace provenance
|
||||
ok static statement anchors carry analysis provenance
|
||||
ok at most one grouped chip per anchor
|
||||
ok trace event list rendered
|
||||
ok stdout rendered escaped
|
||||
ok no polling API was used
|
||||
ok clear hides run panel
|
||||
ok page was never reloaded by the run
|
||||
|
||||
browser: PASS
|
||||
==> browser suite: tests/fixtures/security-project
|
||||
ok reader root rendered
|
||||
ok document title has Marqdo
|
||||
ok one stylesheet
|
||||
ok one script
|
||||
ok no external requests
|
||||
ok no browser console errors
|
||||
ok dock has all actions
|
||||
ok dock run control present
|
||||
ok interactive controls have accessible names
|
||||
ok Tab reaches named controls
|
||||
ok more dialog opens
|
||||
ok source mode attribute
|
||||
ok source pane visible
|
||||
ok document hidden in source mode
|
||||
ok document mode restored
|
||||
ok search dialog opens
|
||||
ok search returns local results
|
||||
ok text size toggled
|
||||
ok annotations toggled
|
||||
ok adversarial doc has no alert dialog
|
||||
ok adversarial doc has no external requests
|
||||
ok raw HTML omitted note rendered
|
||||
ok prose survives sanitization
|
||||
ok javascript link neutralized
|
||||
ok dark theme applied
|
||||
ok theme preference persisted
|
||||
ok paper theme restored
|
||||
ok no horizontal overflow at 2048
|
||||
ok dock inside viewport at 2048
|
||||
ok no horizontal overflow at 1664
|
||||
ok dock inside viewport at 1664
|
||||
ok no horizontal overflow at 1440
|
||||
ok dock inside viewport at 1440
|
||||
ok no horizontal overflow at 1024
|
||||
ok dock inside viewport at 1024
|
||||
ok no horizontal overflow at 768
|
||||
ok dock inside viewport at 768
|
||||
ok no horizontal overflow at 390
|
||||
ok dock inside viewport at 390
|
||||
ok no-JS document remains readable
|
||||
ok no-JS exposes no active run UI
|
||||
ok print hides dock
|
||||
ok print keeps prose
|
||||
|
||||
browser: PASS
|
||||
browser: PASS (core sha256 062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f unchanged; screenshots: /root/work/marqdo-view/tests/browser/artifacts)
|
||||
[acceptance] browser: PASS
|
||||
[acceptance] core_sha: PASS
|
||||
evidence manifest: /root/work/marqdo-view/docs/evidence/2c7c4f31e7a388d3fcfa717a77067e696ed13854/manifest.json
|
||||
|
||||
acceptance: PASS
|
||||
evidence: /root/work/marqdo-view/docs/evidence/2c7c4f31e7a388d3fcfa717a77067e696ed13854/manifest.json
|
||||
archive sha256: 9abd996e1c54b24ef0ec2c7e80c93ca93993ca73cce573f07b922df73a1863f6
|
||||
@@ -0,0 +1,12 @@
|
||||
==> check all five example documents (no execution)
|
||||
==> call function-params.double(n=5) -> 10
|
||||
call double(5): PASS (Int 10)
|
||||
==> run branch-loop main -> Int 0 with loop/return trace
|
||||
run branch-loop: PASS (value 0, events: call.enter,call.exit,loop.iteration,return)
|
||||
==> knowledge-only has no main (truthful failure, 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 062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f unchanged)
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"analysis_protocol": 2,
|
||||
"archive_sha256": "9abd996e1c54b24ef0ec2c7e80c93ca93993ca73cce573f07b922df73a1863f6",
|
||||
"cli_binary_sha256_after": "062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f",
|
||||
"cli_binary_sha256_before": "062cb56e226bee55c21d238e195920caa985e62bb3877ba7b07abcc04dc0fe3f",
|
||||
"cli_source_sha": "2c7c4f31e7a388d3fcfa717a77067e696ed13854",
|
||||
"commands": {
|
||||
"notes": "Generated from real command exit statuses; install/verify/export/run use the frozen CLI archive copied to an isolated tool home.",
|
||||
"script": "scripts/acceptance.sh"
|
||||
},
|
||||
"gates": {
|
||||
"archive_install": "PASS",
|
||||
"browse": "PASS",
|
||||
"browser": "PASS",
|
||||
"build": "PASS",
|
||||
"bundle": "PASS",
|
||||
"clippy": "PASS",
|
||||
"core_sha": "PASS",
|
||||
"examples_check": "PASS",
|
||||
"export": "PASS",
|
||||
"export_suite": "PASS",
|
||||
"fmt": "PASS",
|
||||
"no_exec_suite": "PASS",
|
||||
"real_run": "PASS",
|
||||
"security_suite": "PASS",
|
||||
"test": "PASS",
|
||||
"tool_list": "PASS",
|
||||
"verify": "PASS",
|
||||
"view_help": "PASS"
|
||||
},
|
||||
"generated_at_utc": "2026-11-22T06:48:46.803005+00:00",
|
||||
"schema": "marqdo.view-conformance",
|
||||
"schema_version": 1,
|
||||
"target": "x86_64-unknown-linux-gnu",
|
||||
"tests": {
|
||||
"browser": "PASS",
|
||||
"contract": "PASS",
|
||||
"examples": "PASS",
|
||||
"export": "PASS",
|
||||
"no_exec": "PASS",
|
||||
"security": "PASS"
|
||||
},
|
||||
"tool_protocol": 1,
|
||||
"trace_protocol": 2,
|
||||
"view_binary_sha256": "eb19f79632457f37ae3573696d7db84d57358627b65e618819ff80f132b0026a",
|
||||
"view_source_sha": "807c24b9523bd3f8ace5b36582b5de905327eecb"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
==> Live read-only requests
|
||||
==> Static export
|
||||
no-exec: PASS (sources/lock unchanged, no sentinel, no run control in export; core sha unchanged)
|
||||
+26
-12
@@ -1,22 +1,36 @@
|
||||
# 验收证据
|
||||
|
||||
本目录保存**由真实命令生成**的验收证据,命名 `<CLI-SOURCE-SHA>/manifest.json`:
|
||||
本目录保存**由真实命令生成**的验收证据。主证据命名 `<CLI-SOURCE-SHA>/manifest.json`:
|
||||
|
||||
- `view_source_sha`:生成证据时的 View Git SHA。
|
||||
- `view_binary_sha256`:发布 bundle 内 `bin/marqdo-view` 摘要。
|
||||
- `cli_binary_sha256_before/after`:冻结 CLI 在验收前后的 SHA-256,必须相同。
|
||||
- `cli_source_sha`:CLI 发布归档 `SOURCE_SHA`。
|
||||
- `tool/analysis/trace_protocol`、`target`、`archive_sha256`。
|
||||
- `gates`:`tools/acceptance.sh` 每一步的真实退出状态。
|
||||
- `tests`:contract/browser/export/security 的 PASS/FAIL/SKIP。
|
||||
- `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` 每一步的真实退出状态
|
||||
(fmt/clippy/test/build/bundle/archive_install/tool_list/view_help/verify/export/
|
||||
examples_check/browse/real_run/export_suite/no_exec_suite/security_suite/browser/
|
||||
core_sha);
|
||||
- `tests`:contract/examples/export/no_exec/security/browser 的 PASS/FAIL/SKIP。
|
||||
|
||||
生成方式(不要手写/篡改):
|
||||
|
||||
```bash
|
||||
MARQDO_BIN=/abs/path/to/frozen/marqdo tools/acceptance.sh
|
||||
MARQDO_BIN=/abs/path/to/frozen/marqdo scripts/acceptance.sh
|
||||
```
|
||||
|
||||
`manifest.json` 在验收的最后一步写入;若某一步失败,脚本以非零退出且不会声称 PASS。
|
||||
CI URL 只有在 `.woodpecker.yml` 真正运行后才可补入;本仓库当前未声称远端 CI 通过。
|
||||
`manifest.json` 在验收最后一步写入;任一步失败时脚本非零退出且不会声称 PASS。
|
||||
冻结 CLI 的 `--version`/SHA 与发布归档必须一致(`scripts/verify-frozen-cli.sh`),
|
||||
CI 证据只在 `.github/workflows/ci.yml` 真正运行后才可补入;本仓库当前**未声称**
|
||||
远端 CI 通过。
|
||||
|
||||
`PR-03/` 子目录保存浏览器截图证据(非协议证据),说明见其 `README.md`。
|
||||
分 PR 证据目录(人工/截图/日志,非协议证据):
|
||||
|
||||
- `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 时期的浏览器截图(历史归档)。
|
||||
@@ -0,0 +1,13 @@
|
||||
# @knowledge 分支与循环
|
||||
|
||||
## @exec main
|
||||
|
||||
`n = 3`
|
||||
|
||||
**while n > 0**
|
||||
|
||||
`n = n - 1`
|
||||
|
||||
**end**
|
||||
|
||||
*return n*
|
||||
@@ -0,0 +1,9 @@
|
||||
# @knowledge 计算示例
|
||||
|
||||
这是一个可读取、可独立调用的函数。未点击运行时不能发生计算副作用。
|
||||
|
||||
## @exec double
|
||||
|
||||
`params(n: Int)`
|
||||
|
||||
`return n * 2`
|
||||
@@ -0,0 +1,9 @@
|
||||
# @knowledge 只读知识文档
|
||||
|
||||
本文件只有知识单元与说明文字,没有 `@exec` 函数,因此不能运行 `main`,
|
||||
也不能被替换成“随便挑一个函数”执行。View 会解释原因并建议改选函数。
|
||||
|
||||
## @knowledge 为什么没有 main
|
||||
|
||||
知识不等于可执行程序入口;`@knowledge` 也不等于“已经数学证明”。
|
||||
这里的内容只用于阅读与静态语义展示。
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
import:
|
||||
fs_lib: "std:fs/file"
|
||||
---
|
||||
|
||||
# @knowledge 受控写入示例
|
||||
|
||||
本文件只有在显式提交 `project` 运行并授予项目内 `out/**` 写入权限时才会写文件。
|
||||
打开、刷新、搜索、切换和静态导出都不会运行它。
|
||||
|
||||
## @exec main
|
||||
|
||||
**创建 = fs_lib.创建目录("out")**
|
||||
|
||||
**写入 = fs_lib.写文本("out/view-sentinel.txt", "explicit run only\n")**
|
||||
|
||||
*return 写入*
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"schema": "marqdo.view-config",
|
||||
"schema_version": 1,
|
||||
"welcome": "welcome.mq.md",
|
||||
"site_title": "Marqdo View 示例"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# @knowledge 欢迎来到 Marqdo View
|
||||
|
||||
这是一份普通的可执行 Markdown 文档:你可以像读任何文档一样从头读到尾,
|
||||
也可以在明确选择后调用其中的函数。阅读、搜索、刷新与导出都不会执行任何代码。
|
||||
|
||||
## @knowledge 阅读约定
|
||||
|
||||
- 正文顺序就是原始 Markdown 顺序;
|
||||
- 函数与知识标识来自冻结 CLI 的 Analysis v2,而不是路径名或标题猜测;
|
||||
- 运行必须由你显式确认,结果来自官方 `run/call --json` 与 Trace v2。
|
||||
|
||||
> 深色主题、字号与标注显隐可以在“设置”中调整。
|
||||
@@ -72,6 +72,7 @@ run_step tool_list bash -c "'$MARQDO_BIN' tool list | grep -q view"
|
||||
run_step view_help bash -c "'$MARQDO_BIN' view --help | grep -q 'marqdo-view'"
|
||||
run_step verify "$MARQDO_BIN" view verify examples/mixed-modes/index.mq.md
|
||||
run_step export "$MARQDO_BIN" view export examples/control-flow --out "$work/site"
|
||||
run_step examples_check env MARQDO_BIN="$MARQDO_BIN" ./scripts/check-examples.sh
|
||||
test -f "$work/site/manifest.json"
|
||||
|
||||
# 3. Live browse smoke (no execution on open)
|
||||
@@ -126,6 +127,7 @@ trap - EXIT
|
||||
|
||||
# 5. project-local verification suites
|
||||
run_step export_suite env MARQDO_BIN="$MARQDO_BIN" ./scripts/test-export.sh
|
||||
run_step no_exec_suite env MARQDO_BIN="$MARQDO_BIN" ./scripts/test-no-exec.sh
|
||||
run_step security_suite ./scripts/test-security.sh
|
||||
if [[ "${SKIP_BROWSER:-0}" == "1" ]]; then
|
||||
record browser SKIP
|
||||
@@ -175,8 +177,10 @@ manifest = {
|
||||
"generated_at_utc": datetime.datetime.now(datetime.timezone.utc).isoformat(),
|
||||
"tests": {
|
||||
"contract": statuses.get("test", "FAIL"),
|
||||
"examples": statuses.get("examples_check", "FAIL"),
|
||||
"browser": statuses.get("browser", "SKIP"),
|
||||
"export": statuses.get("export_suite", "FAIL"),
|
||||
"no_exec": statuses.get("no_exec_suite", "FAIL"),
|
||||
"security": statuses.get("security_suite", "FAIL"),
|
||||
},
|
||||
"gates": statuses,
|
||||
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env bash
|
||||
# RFC-VIEW-0002 §13.3/§13.4: prove the five 3.0 example documents against the
|
||||
# frozen released CLI. Never rebuilds the Core; runs in a copied temp project so
|
||||
# the repository examples are never modified.
|
||||
#
|
||||
# Usage: MARQDO_BIN=/abs/path/marqdo scripts/check-examples.sh
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$repo_root"
|
||||
|
||||
: "${MARQDO_BIN:?set MARQDO_BIN to the frozen marqdo binary}"
|
||||
core_sha_before="$(sha256sum "$MARQDO_BIN" | cut -d' ' -f1)"
|
||||
|
||||
work="$repo_root/dist/examples-check"
|
||||
rm -rf "$work"
|
||||
mkdir -p "$work"
|
||||
cp examples/welcome.mq.md examples/branch-loop.mq.md examples/function-params.mq.md \
|
||||
examples/knowledge-only.mq.md examples/unsafe-side-effect.mq.md "$work/"
|
||||
cp examples/view.json "$work/"
|
||||
|
||||
cd "$work"
|
||||
|
||||
echo "==> check all five example documents (no execution)"
|
||||
for file in welcome.mq.md branch-loop.mq.md function-params.mq.md knowledge-only.mq.md unsafe-side-effect.mq.md; do
|
||||
"$MARQDO_BIN" check "$file" --emit "analysis-$file.json" --json >/dev/null
|
||||
test -s "analysis-$file.json"
|
||||
done
|
||||
|
||||
echo "==> call function-params.double(n=5) -> 10"
|
||||
call_json="$("$MARQDO_BIN" call function-params.mq.md double --arg n=5 --mode pure --json --trace-file call.trace.json)"
|
||||
python3 - "$call_json" <<'PY'
|
||||
import json, sys
|
||||
data = json.loads(sys.argv[1])
|
||||
assert data["success"] is True, data
|
||||
assert data["value"] == {"type": "int", "decimal": "10"}, data["value"]
|
||||
print("call double(5): PASS (Int 10)")
|
||||
PY
|
||||
|
||||
echo "==> run branch-loop main -> Int 0 with loop/return trace"
|
||||
run_json="$("$MARQDO_BIN" run branch-loop.mq.md --mode pure --json --trace-file run.trace.json)"
|
||||
python3 - "$run_json" "run.trace.json" <<'PY'
|
||||
import json, sys
|
||||
data = json.loads(sys.argv[1])
|
||||
assert data["success"] is True, data
|
||||
assert data["value"] == {"type": "int", "decimal": "0"}, data["value"]
|
||||
trace = json.load(open(sys.argv[2]))
|
||||
kinds = {event["kind"] for event in trace["events"]}
|
||||
assert "loop.iteration" in kinds and "return" in kinds, kinds
|
||||
print("run branch-loop: PASS (value 0, events: %s)" % ",".join(sorted(kinds)))
|
||||
PY
|
||||
|
||||
echo "==> knowledge-only has no main (truthful failure, no fallback)"
|
||||
set +e
|
||||
"$MARQDO_BIN" run knowledge-only.mq.md --mode pure --json > knowledge.json 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
test "$status" -ne 0
|
||||
python3 - knowledge.json <<'PY'
|
||||
import json, sys
|
||||
data = json.load(open(sys.argv[1]))
|
||||
assert data["success"] is False, data
|
||||
assert data["code"] == "sem.no_entry_function", data
|
||||
print("knowledge-only: PASS (explicit sem.no_entry_function)")
|
||||
PY
|
||||
|
||||
echo "==> unsafe-side-effect writes nothing in pure mode"
|
||||
set +e
|
||||
"$MARQDO_BIN" run unsafe-side-effect.mq.md --mode pure --json > unsafe-pure.json 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
test "$status" -ne 0
|
||||
test ! -e out/view-sentinel.txt
|
||||
python3 - unsafe-pure.json <<'PY'
|
||||
import json, sys
|
||||
data = json.load(open(sys.argv[1]))
|
||||
assert data["success"] is False, data
|
||||
assert data["error"]["code"] == "permission.denied", data["error"]
|
||||
print("unsafe-side-effect pure: PASS (permission.denied, no file)")
|
||||
PY
|
||||
|
||||
echo "==> unsafe-side-effect writes only with explicit project grants"
|
||||
"$MARQDO_BIN" run unsafe-side-effect.mq.md --mode project \
|
||||
--allow-write out --allow-write 'out/**' --json --trace-file unsafe.trace.json >/dev/null
|
||||
test -f out/view-sentinel.txt
|
||||
python3 - <<'PY'
|
||||
content = open("out/view-sentinel.txt", "rb").read()
|
||||
assert content == b"explicit run only\n", content
|
||||
print("unsafe-side-effect project+grants: PASS (sentinel written explicitly)")
|
||||
PY
|
||||
rm -rf out
|
||||
|
||||
core_sha_after="$(sha256sum "$MARQDO_BIN" | cut -d' ' -f1)"
|
||||
test "$core_sha_before" = "$core_sha_after"
|
||||
echo "examples: PASS (frozen CLI sha256 $core_sha_before unchanged)"
|
||||
Executable
+87
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env bash
|
||||
# RFC-VIEW-0002 §13.4 / §6 / §10.3: opening, searching, switching and exporting
|
||||
# must never execute a document. Uses the unsafe-side-effect fixture and checks
|
||||
# source/lock hashes plus the absence of any write sentinel around the whole
|
||||
# read-only operation set.
|
||||
#
|
||||
# Usage: MARQDO_BIN=/abs/path/marqdo scripts/test-no-exec.sh
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$repo_root"
|
||||
|
||||
: "${MARQDO_BIN:?set MARQDO_BIN to the frozen marqdo binary}"
|
||||
core_sha_before="$(sha256sum "$MARQDO_BIN" | cut -d' ' -f1)"
|
||||
binary="$repo_root/target/release/marqdo-view"
|
||||
if [[ ! -x "$binary" ]]; then
|
||||
cargo build --release --locked
|
||||
fi
|
||||
|
||||
work="$repo_root/dist/no-exec"
|
||||
rm -rf "$work"
|
||||
mkdir -p "$work"
|
||||
doc="examples/unsafe-side-effect.mq.md"
|
||||
sentinel="examples/out/view-sentinel.txt"
|
||||
|
||||
hash_tree() {
|
||||
find examples -type f -name '*.mq.md' -print0 | sort -z | xargs -0 sha256sum
|
||||
if [[ -f examples/marqdo.yaml ]]; then sha256sum examples/marqdo.yaml; fi
|
||||
if [[ -f examples/view.json ]]; then sha256sum examples/view.json; fi
|
||||
if [[ -f marqdo.lock ]]; then sha256sum marqdo.lock; fi
|
||||
}
|
||||
|
||||
rm -rf examples/out
|
||||
before="$(hash_tree)"
|
||||
test ! -e "$sentinel"
|
||||
|
||||
echo "==> Live read-only requests"
|
||||
"$binary" "$doc" --port 0 --no-open >"$work/server.log" 2>&1 &
|
||||
pid=$!
|
||||
trap 'kill "$pid" 2>/dev/null || true' EXIT
|
||||
url=""
|
||||
for _ in $(seq 1 100); do
|
||||
url="$(grep -o 'http://127.0.0.1:[0-9]*/' "$work/server.log" | head -1 || true)"
|
||||
[[ -n "$url" ]] && break
|
||||
sleep 0.1
|
||||
done
|
||||
test -n "$url"
|
||||
cookie_jar="$work/cookies.txt"
|
||||
curl -fsS -c "$cookie_jar" "${url}" > "$work/page.html"
|
||||
curl -fsS -c "$cookie_jar" -b "$cookie_jar" "${url}file?path=unsafe-side-effect.mq.md" >/dev/null
|
||||
curl -fsS -b "$cookie_jar" "${url}api/documents" >/dev/null
|
||||
curl -fsS -b "$cookie_jar" "${url}api/documents?path=unsafe-side-effect.mq.md" >/dev/null
|
||||
# Reloading the page multiple times must remain side-effect free.
|
||||
for _ in $(seq 1 5); do curl -fsS -b "$cookie_jar" "${url}" >/dev/null; done
|
||||
kill "$pid" 2>/dev/null || true
|
||||
wait "$pid" 2>/dev/null || true
|
||||
trap - EXIT
|
||||
|
||||
echo "==> Static export"
|
||||
"$binary" export "$doc" --out "$work/site" >/dev/null
|
||||
test -f "$work/site/manifest.json"
|
||||
# Export has no execution controls and no CSRF/session material.
|
||||
if grep -q 'data-action="run"' "$work/site/pages/unsafe-side-effect.mq.md.html"; then
|
||||
echo "error: exported page contains a run control" >&2
|
||||
exit 1
|
||||
fi
|
||||
if grep -q 'mq-csrf-token' "$work/site/pages/unsafe-side-effect.mq.md.html"; then
|
||||
echo "error: exported page contains a CSRF token" >&2
|
||||
exit 1
|
||||
fi
|
||||
if grep -rqE 'https?://(?!127\.0\.0\.1|localhost)' --include='*.html' "$work/site" 2>/dev/null; then
|
||||
echo "error: exported site references an external URL" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
after="$(hash_tree)"
|
||||
if [[ "$before" != "$after" ]]; then
|
||||
echo "error: read-only/export operations modified project sources" >&2
|
||||
diff <(printf '%s\n' "$before") <(printf '%s\n' "$after") >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
test ! -e "$sentinel"
|
||||
test ! -e examples/out
|
||||
|
||||
core_sha_after="$(sha256sum "$MARQDO_BIN" | cut -d' ' -f1)"
|
||||
test "$core_sha_before" = "$core_sha_after"
|
||||
echo "no-exec: PASS (sources/lock unchanged, no sentinel, no run control in export; core sha unchanged)"
|
||||
+38
-23
@@ -228,7 +228,7 @@ impl ReaderRenderer {
|
||||
&self,
|
||||
html: &mut String,
|
||||
model: &PresentationModel,
|
||||
_ctx: &RenderContext,
|
||||
ctx: &RenderContext,
|
||||
navigation: &crate::reader::model::Navigation,
|
||||
) {
|
||||
let active = model
|
||||
@@ -238,6 +238,11 @@ impl ReaderRenderer {
|
||||
.map(|path| path.as_str())
|
||||
.unwrap_or("");
|
||||
let files_count = navigation.documents.len();
|
||||
let run_tab = if ctx.live {
|
||||
"<button type=\"button\" class=\"mq-tab\" data-action=\"run\" title=\"显式运行\">运行</button>".to_string()
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
let _ = write!(
|
||||
html,
|
||||
r##"<header class="mq-topbar">
|
||||
@@ -255,19 +260,13 @@ impl ReaderRenderer {
|
||||
<nav class="mq-tabs" aria-label="阅读导航">
|
||||
<button type="button" class="mq-tab" data-action="mode-document" aria-current="page">文档</button>
|
||||
<button type="button" class="mq-tab" data-action="functions">函数</button>
|
||||
<button type="button" class="mq-tab" data-action="run" data-disabled="{run_disabled}" title="{run_title}">运行</button>
|
||||
{run_tab}
|
||||
</nav>
|
||||
"##,
|
||||
menu_icon = icon("M4 6h16M4 12h16M4 18h16"),
|
||||
site_title = escape_text(&navigation.site_title),
|
||||
logo = escape_attr(&self.assets.logo().data_uri()),
|
||||
search_icon = icon("M21 21l-5-5M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0"),
|
||||
run_disabled = if _ctx.run_available { "false" } else { "true" },
|
||||
run_title = if _ctx.run_available {
|
||||
"运行文档(需要确认)"
|
||||
} else {
|
||||
"运行入口尚未启用;当前版本不会执行文档"
|
||||
},
|
||||
);
|
||||
let _ = (files_count, active);
|
||||
}
|
||||
@@ -527,14 +526,17 @@ impl ReaderRenderer {
|
||||
}
|
||||
|
||||
fn render_dock(&self, html: &mut String, ctx: &RenderContext) {
|
||||
let run_disabled = if ctx.core_available {
|
||||
""
|
||||
} else {
|
||||
" data-disabled=\"true\""
|
||||
};
|
||||
let _ = write!(
|
||||
html,
|
||||
r##"<div class="mq-dock" role="toolbar" aria-label="文档操作">
|
||||
let settings = icon("M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M5 19l2-2M17 7l2-2");
|
||||
let more = icon("M5 12h.01M12 12h.01M19 12h.01");
|
||||
if ctx.live {
|
||||
let run_disabled = if ctx.core_available {
|
||||
""
|
||||
} else {
|
||||
" data-disabled=\"true\""
|
||||
};
|
||||
let _ = write!(
|
||||
html,
|
||||
r##"<div class="mq-dock" role="toolbar" aria-label="文档操作">
|
||||
<button type="button" class="mq-dock-btn" data-action="reload" aria-label="刷新页面">{reload}<span>刷新</span></button>
|
||||
<button type="button" class="mq-dock-btn" data-action="settings" aria-label="阅读设置">{settings}<span>设置</span></button>
|
||||
<button type="button" class="mq-dock-btn" data-action="run" aria-label="运行文档"{run_disabled}>{play}<span>运行</span></button>
|
||||
@@ -542,13 +544,26 @@ impl ReaderRenderer {
|
||||
<button type="button" class="mq-dock-btn" data-action="more" aria-label="更多操作">{more}<span>更多</span></button>
|
||||
</div>
|
||||
"##,
|
||||
reload = icon("M20 7V3l-3 3a8 8 0 1 0 2 11M20 3h-5"),
|
||||
settings = icon("M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M5 19l2-2M17 7l2-2"),
|
||||
play = icon("m9 5 11 7-11 7z"),
|
||||
clear = icon("m14 3 4 2-4 8M5 12l8 2 2 6H3zM7 15l-1 4M10 16l-1 4"),
|
||||
more = icon("M5 12h.01M12 12h.01M19 12h.01"),
|
||||
run_disabled = run_disabled
|
||||
);
|
||||
reload = icon("M20 7V3l-3 3a8 8 0 1 0 2 11M20 3h-5"),
|
||||
settings = settings,
|
||||
play = icon("m9 5 11 7-11 7z"),
|
||||
clear = icon("m14 3 4 2-4 8M5 12l8 2 2 6H3zM7 15l-1 4M10 16l-1 4"),
|
||||
more = more,
|
||||
run_disabled = run_disabled
|
||||
);
|
||||
} else {
|
||||
// Static export has no execution controls (RFC-VIEW-0002 §7.2).
|
||||
let _ = write!(
|
||||
html,
|
||||
r##"<div class="mq-dock" role="toolbar" aria-label="文档操作">
|
||||
<button type="button" class="mq-dock-btn" data-action="settings" aria-label="阅读设置">{settings}<span>设置</span></button>
|
||||
<button type="button" class="mq-dock-btn" data-action="more" aria-label="更多操作">{more}<span>更多</span></button>
|
||||
</div>
|
||||
"##,
|
||||
settings = settings,
|
||||
more = more
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn render_toast(&self, html: &mut String) {
|
||||
|
||||
@@ -126,7 +126,10 @@ fn explicit_run_streams_sse_accepted_running_and_terminal_with_verified_trace()
|
||||
let mut reader = http::SseReader::open(
|
||||
server.port,
|
||||
&format!("/api/runs/{run_id}/events"),
|
||||
&[("Cookie", session.cookie.clone())],
|
||||
&[
|
||||
("Cookie", session.cookie.clone()),
|
||||
("Last-Event-ID", "0".to_string()),
|
||||
],
|
||||
);
|
||||
assert_eq!(reader.status, 200);
|
||||
assert!(reader
|
||||
|
||||
Reference in new issue
Block a user