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:
cflmy committed 2026-11-22 14:54:23 +08:00
1 parent 807c24b952
commit 0fceb40088
24 files changed
+1227 -171

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# @knowledge 分支与循环
## @exec main
`n = 3`
**while n > 0**
`n = n - 1`
**end**
*return n*
+9
View File
@@ -0,0 +1,9 @@
# @knowledge 计算示例
这是一个可读取、可独立调用的函数。未点击运行时不能发生计算副作用。
## @exec double
`params(n: Int)`
`return n * 2`
+9
View File
@@ -0,0 +1,9 @@
# @knowledge 只读知识文档
本文件只有知识单元与说明文字,没有 `@exec` 函数,因此不能运行 `main`,
也不能被替换成“随便挑一个函数”执行。View 会解释原因并建议改选函数。
## @knowledge 为什么没有 main
知识不等于可执行程序入口;`@knowledge` 也不等于“已经数学证明”。
这里的内容只用于阅读与静态语义展示。
+17
View File
@@ -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 写入*
+6
View File
@@ -0,0 +1,6 @@
{
"schema": "marqdo.view-config",
"schema_version": 1,
"welcome": "welcome.mq.md",
"site_title": "Marqdo View 示例"
}
+12
View File
@@ -0,0 +1,12 @@
# @knowledge 欢迎来到 Marqdo View
这是一份普通的可执行 Markdown 文档:你可以像读任何文档一样从头读到尾,
也可以在明确选择后调用其中的函数。阅读、搜索、刷新与导出都不会执行任何代码。
## @knowledge 阅读约定
- 正文顺序就是原始 Markdown 顺序;
- 函数与知识标识来自冻结 CLI 的 Analysis v2,而不是路径名或标题猜测;
- 运行必须由你显式确认,结果来自官方 `run/call --json` 与 Trace v2。
> 深色主题、字号与标注显隐可以在“设置”中调整。