feat(markup): finish v0.3 stock migration and green gold

Migrate remaining .mq.md (tests/ext/public/examples), stop elevating local assigns to params, inject form_target in Go libweb, and skip live LLM gold without a real key.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-13 23:43:44 +08:00
1 parent bfb10d172b
commit b5c07385e9
324 files changed
+4572 -4339

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ ext/llm — OpenAI-compatible chat. Design: doc/design/ext-llm.md
ext/agent — agent framework + native plugin. Design: doc/design/ext-agent.md
ext/web — HTTP / SQLite·Postgres site helpers + native plugin (default **Go libweb**, v0.4.0). **W0–W7 + P3 + W8** + **customization C0–C4**; acceptance example `examples/anlian-mq/`. **Browser embed (routes D/E/F, v0.3.4)**: `web.client_embed` auto-mounts WASM — zero author JS; `lib/browser` + GFM tables; build with `marqdo wasm build`; examples: browser-hello · browser-app · browser-media · web-client-site. Design: doc/design/ext-web.md · WASM: doc/adr/0002-browser-marqdo-wasm.md · roadmaps D/E/F.
ext/web — HTTP / SQLite·Postgres site helpers + native plugin (default *Go libweb*, v0.4.0). **W0–W7 + P3 + W8** + **customization C0–C4**; acceptance example `examples/anlian-mq/`. **Browser embed (routes D/E/F, v0.3.4)**: `web.client_embed` auto-mounts WASM — zero author JS; `lib/browser` + GFM tables; build with `marqdo wasm build`; examples: browser-hello · browser-app · browser-media · web-client-site. Design: doc/design/ext-web.md · WASM: doc/adr/0002-browser-marqdo-wasm.md · roadmaps D/E/F.
ext/quantum — circuits, draw, noise, formula matrix custom gates, Q7 density/viz, Q8 themed SVG (`theme=dark|light|bw`). Design: doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md
+1 -1
View File
@@ -34,7 +34,7 @@ ext/llm(大模型)— OpenAI 兼容聊天。设计:doc/design/ext-llm.md
ext/agent(智能体)— 智能体框架 + 原生插件。设计:doc/design/ext-agent.md
ext/web(网页)— HTTP / SQLite 站点助手 + 原生插件(默认 **Go libweb**,v0.4.0)。**W0–W7 + P3 + W8** + **定制 C0–C4**;验收示例 `examples/anlian-mq/`。**浏览器挂载(路线 D/E/F,v0.3.4)**:`网页.客户端挂载` / `web.client_embed` 自动 mount(作者零业务 JS);`lib/浏览器` + GFM;先 `marqdo wasm build`;示例 examples/browser-hello/ · examples/browser-app/ · examples/browser-media/ · examples/web-client-site/。设计:doc/design/ext-web.md · WASM:doc/adr/0002-browser-marqdo-wasm.md · 路线 D/E/F:doc/roadmap/browser-wasm-*.md
ext/web(网页)— HTTP / SQLite 站点助手 + 原生插件(默认 *Go libweb*,v0.4.0)。**W0–W7 + P3 + W8** + **定制 C0–C4**;验收示例 `examples/anlian-mq/`。**浏览器挂载(路线 D/E/F,v0.3.4)**:`网页.客户端挂载` / `web.client_embed` 自动 mount(作者零业务 JS);`lib/浏览器` + GFM;先 `marqdo wasm build`;示例 examples/browser-hello/ · examples/browser-app/ · examples/browser-media/ · examples/web-client-site/。设计:doc/design/ext-web.md · WASM:doc/adr/0002-browser-marqdo-wasm.md · 路线 D/E/F:doc/roadmap/browser-wasm-*.md
ext/quantum(量子)— 电路、绘图、噪声、公式矩阵自定义门、Q7 密度/高级图、Q8 主题 SVG(`主题=dark|light|bw`)。设计:doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md
+5 -5
View File
@@ -22,11 +22,11 @@ Q8: `draw theme="dark"|"light"|"bw"` (default dark lab look) on circuit / probs
| 2 | CX | 0,1 |
| 3 | CX | 0,2 |
*`qc` = > quantum.circuit qubits=3 steps=`steps`*
*`p` = > `qc`.probabilities*
*`_` = > `qc`.draw kind="probs" theme="dark"*
*`H` = > quantum.gate name="H"*
*`__` = > `H`.draw kind="matrix"*
**`qc` = > quantum.circuit qubits=3 steps=`steps`**
**`p` = > `qc`.probabilities**
**`_` = > `qc`.draw kind="probs" theme="dark"**
**`H` = > quantum.gate name="H"**
**`__` = > `H`.draw kind="matrix"**
> print text=`p`
> print text=quantum-feature-ok
+5 -5
View File
@@ -22,11 +22,11 @@ Q8:`绘图 主题="dark"|"light"|"bw"`(默认 dark 科技感)作用于电
| 2 | CX | 0,1 |
| 3 | CX | 0,2 |
*`qc` = > 量子.电路 比特数=3 步骤=`步骤`*
*`p` = > `qc`.概率*
*`_` = > `qc`.绘图 种类="probs" 主题="dark"*
*`H` = > 量子.门 名="H"*
*`__` = > `H`.绘图 种类="matrix"*
**`qc` = > 量子.电路 比特数=3 步骤=`步骤`**
**`p` = > `qc`.概率**
**`_` = > `qc`.绘图 种类="probs" 主题="dark"**
**`H` = > 量子.门 名="H"**
**`__` = > `H`.绘图 种类="matrix"**
> 打印 内容=`p`
> 打印 内容=量子特性-ok
+6 -6
View File
@@ -8,7 +8,7 @@ import la:ext/linalg/linalg.mq.md
Not stdlib. Install: `marqdo ext add linalg` (or build `marqdo_plugin_linalg`).
**Idea:** if the `.mq.md` runs and the asserted form matches, the identity holds under the library rules. Algebra reads like a lecture; `factorize` / `lstsq` / `draw` stay explicit calculation steps.
*Idea:* if the `.mq.md` runs and the asserted form matches, the identity holds under the library rules. Algebra reads like a lecture; `factorize` / `lstsq` / `draw` stay explicit calculation steps.
# main
@@ -21,11 +21,11 @@ Declare symbols in a table, multiply, transpose — `T_ascii` is one-step displa
| 1 | A | 2 | 3 |
| 2 | B | 3 | 2 |
*`env` = > la.declare table=`shapes`*
*`A` = env[^A]*
*`B` = env[^B]*
*`P` = `A` * `B`*
*`t` = > `P`.T_ascii*
**`env` = > la.declare table=`shapes`**
**`A` = env[^A]**
**`B` = env[^B]**
**`P` = `A` * `B`**
**`t` = > `P`.T_ascii**
> print text=`t`
1. `t` == "B^T*A^T"
> print text=formula-doc-ok
+6 -6
View File
@@ -8,7 +8,7 @@ description: ext/linalg 公式文档面 — 声明、中缀、跑通即正确
可选扩展(非 stdlib)。安装:`marqdo ext add linalg`(中文 id:`线性代数`)。
**思想:** `.mq.md` 能跑通且断言的规范形一致,则在库规则下该恒等式成立。代数叙述像讲义;`分解` / `最小二乘` / `绘图` 才是显式计算步骤。
*思想:* `.mq.md` 能跑通且断言的规范形一致,则在库规则下该恒等式成立。代数叙述像讲义;`分解` / `最小二乘` / `绘图` 才是显式计算步骤。
# main
@@ -21,11 +21,11 @@ description: ext/linalg 公式文档面 — 声明、中缀、跑通即正确
| 1 | A | 2 | 3 |
| 2 | B | 3 | 2 |
*`环境` = > la.声明 表=`形状`*
*`A` = 环境[^A]*
*`B` = 环境[^B]*
*`P` = `A` * `B`*
*`t` = > `P`.转置文本*
**`环境` = > la.声明 表=`形状`**
**`A` = 环境[^A]**
**`B` = 环境[^B]**
**`P` = `A` * `B`**
**`t` = > `P`.转置文本**
> 打印 内容=`t`
1. `t` == "B^T*A^T"
> 打印 内容=formula-doc-ok
+3 -3
View File
@@ -11,9 +11,9 @@ Mid-tier stdlib: everyday primitives stay in `lib/`, not ABI plugins.
# main
*`ok` = > re.is_match text="user@example.com" pattern="^[^@]+@[^@]+$"*
*`tok` = > enc.base64_encode text="marqdo"*
*`hex` = > enc.hex_encode text="ok"*
**`ok` = > re.is_match text="user@example.com" pattern="^[^@]+@[^@]+$"**
**`tok` = > enc.base64_encode text="marqdo"**
**`hex` = > enc.hex_encode text="ok"**
> print text=`ok`
> print text=`tok`
> print text=`hex`
+3 -3
View File
@@ -11,9 +11,9 @@ description: lib/正则 + lib/编码,无需插件(中层 M1)
# main
*`ok` = > 正则.匹配 内容="user@example.com" 模式="^[^@]+@[^@]+$"*
*`tok` = > 编码.基64编码 内容="marqdo"*
*`hex` = > 编码.十六进制编码 内容="ok"*
**`ok` = > 正则.匹配 内容="user@example.com" 模式="^[^@]+@[^@]+$"**
**`tok` = > 编码.基64编码 内容="marqdo"**
**`hex` = > 编码.十六进制编码 内容="ok"**
> 打印 内容=`ok`
> 打印 内容=`tok`
> 打印 内容=`hex`
+3 -3
View File
@@ -11,11 +11,11 @@ Join and normalize without plugins; copy/move stay sandboxed under the program d
# main
*`p` = > path.join a="out" b="demo.txt"*
*`n` = > path.normalize path="out/./x/../demo.txt"*
**`p` = > path.join a="out" b="demo.txt"**
**`n` = > path.normalize path="out/./x/../demo.txt"**
> fs.write_text path=`p` text="path-m2"
> fs.copy_file src=`p` dest="out/demo-copy.txt"
*`body` = > fs.read_text path="out/demo-copy.txt"*
**`body` = > fs.read_text path="out/demo-copy.txt"**
> print text=`p`
> print text=`n`
> print text=`body`
+3 -3
View File
@@ -11,11 +11,11 @@ description: lib/路径 + 文件复制/移动/临时(中层 M2)
# main
*`p` = > 路径.拼接 甲="out" 乙="demo.txt"*
*`n` = > 路径.规范化 路径="out/./x/../demo.txt"*
**`p` = > 路径.拼接 甲="out" 乙="demo.txt"**
**`n` = > 路径.规范化 路径="out/./x/../demo.txt"**
> 文件.写文本 路径=`p` 内容="path-m2"
> 文件.复制文件 源=`p` 目标="out/demo-copy.txt"
*`body` = > 文件.读文本 路径="out/demo-copy.txt"*
**`body` = > 文件.读文本 路径="out/demo-copy.txt"**
> 打印 内容=`p`
> 打印 内容=`n`
> 打印 内容=`body`
+3 -3
View File
@@ -11,9 +11,9 @@ Integrity digests and cryptographic tokens stay in `lib/` — do not use `math.r
# main
*`d` = > hash.sha256 text="marqdo"*
*`t` = > sec.token_hex n=8*
*`L` = > len `t`*
**`d` = > hash.sha256 text="marqdo"**
**`t` = > sec.token_hex n=8**
**`L` = > len `t`**
> print text=`d`
> print text=`L`
1. `L` == 16
+3 -3
View File
@@ -11,9 +11,9 @@ description: lib/哈希 + lib/机密,无需插件(中层 M3)
# main
*`d` = > 哈希.哈希256 内容="marqdo"*
*`t` = > 机密.十六进制令牌 字节数=8*
*`L` = > 长度 `t`*
**`d` = > 哈希.哈希256 内容="marqdo"**
**`t` = > 机密.十六进制令牌 字节数=8**
**`L` = > 长度 `t`**
> 打印 内容=`d`
> 打印 内容=`L`
1. `L` == 16
+5 -5
View File
@@ -11,13 +11,13 @@ Parse a tiny CSV, normalize a field, print — no plugins.
# main
*raw = "name,city\nAda,london\nBob,PARIS\n"*
*rows = > csv.parse text=`raw`*
*r0 = > at value=`rows` index=0*
*city = > text.to_upper text=`r0`[^city]*
**raw = "name,city\nAda,london\nBob,PARIS\n"**
**rows = > csv.parse text=`raw`**
**r0 = > at value=`rows` index=0**
**city = > text.to_upper text=`r0`[^city]**
> print text=`r0`[^name]
> print text=`city`
*n = > len `rows`*
**n = > len `rows`**
1. `n` == 2
> print text=mid-m4-ok
2. *
+5 -5
View File
@@ -11,13 +11,13 @@ description: lib/逗号表 + 加厚 lib/文本(中层 M4)
# main
*raw = "name,city\nAda,london\nBob,PARIS\n"*
*rows = > 逗号表.解析 内容=`raw`*
*r0 = > at value=`rows` index=0*
*city = > 文本.大写 内容=`r0`[^city]*
**raw = "name,city\nAda,london\nBob,PARIS\n"**
**rows = > 逗号表.解析 内容=`raw`**
**r0 = > at value=`rows` index=0**
**city = > 文本.大写 内容=`r0`[^city]**
> 打印 内容=`r0`[^name]
> 打印 内容=`city`
*n = > 长度 `rows`*
**n = > 长度 `rows`**
1. `n` == 2
> 打印 内容=mid-m4-ok
2. *
+6 -6
View File
@@ -12,14 +12,14 @@ Zero plugins: parse CSV, sort by key, parse `--input`.
# main
*raw = "name,score\nbob,2\nalice,10\n"*
*rows = > csv.parse text=`raw`*
*rows = > table.sort_by list=`rows` key="name"*
*r0 = > at value=`rows` index=0*
**raw = "name,score\nbob,2\nalice,10\n"**
**rows = > csv.parse text=`raw`**
**rows = > table.sort_by list=`rows` key="name"**
**r0 = > at value=`rows` index=0**
> print text=`r0`[^name]
*args = > split value="--input,scores.csv,--pretty" sep=","*
*flags = > cli.parse args=`args`*
**args = > split value="--input,scores.csv,--pretty" sep=","**
**flags = > cli.parse args=`args`**
> print text=`flags`[^input]
1. `flags`[^pretty]
> print text=mid-m5-ok
+6 -6
View File
@@ -12,14 +12,14 @@ description: 表排序/去重 + 命令行解析(中层 M5)
# main
*raw = "name,score\nbob,2\nalice,10\n"*
*rows = > 逗号表.解析 内容=`raw`*
*rows = > 表.按键排序 list=`rows` key="name"*
*r0 = > at value=`rows` index=0*
**raw = "name,score\nbob,2\nalice,10\n"**
**rows = > 逗号表.解析 内容=`raw`**
**rows = > 表.按键排序 list=`rows` key="name"**
**r0 = > at value=`rows` index=0**
> 打印 内容=`r0`[^name]
*args = > split value="--input,scores.csv,--pretty" sep=","*
*flags = > 命令行.解析 参数=`args`*
**args = > split value="--input,scores.csv,--pretty" sep=","**
**flags = > 命令行.解析 参数=`args`**
> 打印 内容=`flags`[^input]
1. `flags`[^pretty]
> 打印 内容=mid-m5-ok
+2 -2
View File
@@ -19,6 +19,6 @@ Default log level is info; raise to debug when you need more. Mint ids with uuid
> log.debug text="now-visible"
*id = > uuid.v4*
*n = > len `id`*
**id = > uuid.v4**
**n = > len `id`**
> print text=`n`
+2 -2
View File
@@ -19,6 +19,6 @@ description: 按级别过滤的日志 + UUID 版本4(中层 M6)
> 日志.调试 内容="现在可见"
*id = > 标识.版本4*
*n = > 长度 `id`*
**id = > 标识.版本4**
**n = > 长度 `id`**
> 打印 内容=`n`
+2 -2
View File
@@ -11,9 +11,9 @@ Moments are maps `{unix, zone, iso}`. Parse HTTPS URLs and round-trip query stri
# main
*epoch = > dt.from_unix unix=0 zone="Asia/Shanghai"*
**epoch = > dt.from_unix unix=0 zone="Asia/Shanghai"**
> print text=`epoch`[^iso]
*u = > url.parse text="https://example.com/path?q=1#top"*
**u = > url.parse text="https://example.com/path?q=1#top"**
> print text=`u`[^host]
> print text=`u`[^query]
+2 -2
View File
@@ -11,9 +11,9 @@ description: 日历时刻 + URL/查询串(Mid2 M7)
# main
*epoch = > 日时.自戳 秒=0 区="Asia/Shanghai"*
**epoch = > 日时.自戳 秒=0 区="Asia/Shanghai"**
> print text=`epoch`[^iso]
*u = > 址.解析 内容="https://example.com/path?q=1"*
**u = > 址.解析 内容="https://example.com/path?q=1"**
> print text=`u`[^host]
> print text=`u`[^query]
+4 -4
View File
@@ -12,13 +12,13 @@ Parse a TOML subset for tools, escape HTML before assembly, encode with base32.
# main
*cfg = > toml.parse text="app = \"demo\"\n[server]\nport = 8080\n"*
**cfg = > toml.parse text="app = \"demo\"\n[server]\nport = 8080\n"**
> print text=`cfg`[^app]
*srv = `cfg`[^server]*
**srv = `cfg`[^server]**
> print text=`srv`[^port]
*safe = > html.escape text="<tag>"*
**safe = > html.escape text="<tag>"**
> print text=`safe`
*b = > enc.base32_encode text="ok"*
**b = > enc.base32_encode text="ok"**
> print text=`b`
@@ -10,11 +10,11 @@ description: TOML 配置 + HTML 转义 + base32(Mid2 M8)
# main
*cfg = > 配置.解析 内容="app = \"演示\"\n"*
**cfg = > 配置.解析 内容="app = \"演示\"\n"**
> print text=`cfg`[^app]
*safe = > 超.转义 内容="<tag>"*
**safe = > 超.转义 内容="<tag>"**
> print text=`safe`
*b = > 编.基32编码 内容="ok"*
**b = > 编.基32编码 内容="ok"**
> print text=`b`
+3 -3
View File
@@ -14,11 +14,11 @@ import fs:lib/fs.mq.md
> fs.write_text path="m9-demo/readme.txt" text="ok"
*st = > fs.stat path="m9-demo/readme.txt"*
**st = > fs.stat path="m9-demo/readme.txt"**
> print text=`st`[^size]
*w = > fs.walk path="m9-demo"*
*n = > len `w`*
**w = > fs.walk path="m9-demo"**
**n = > len `w`**
> print text=`n`
> fs.remove_tree path="m9-demo"
+3 -3
View File
@@ -12,11 +12,11 @@ description: 递归目录、遍历与元数据(Mid2 M9)
> 文件.写文本 路径="m9-演示/说明.txt" 内容="好"
*st = > 文件.状态 路径="m9-演示/说明.txt"*
**st = > 文件.状态 路径="m9-演示/说明.txt"**
> print text=`st`[^size]
*w = > 文件.遍历 路径="m9-演示"*
*n = > 长度 `w`*
**w = > 文件.遍历 路径="m9-演示"**
**n = > 长度 `w`**
> print text=`n`
> 文件.删目录树 路径="m9-演示"
+1 -1
View File
@@ -19,7 +19,7 @@ Light statistics and optional `fields=` on log lines — no remote sinks, no dat
| 20 |
| 30 |
*m = > stats.mean list=`xs`*
**m = > stats.mean list=`xs`**
> print text=`m`
`fld` =
+1 -1
View File
@@ -17,7 +17,7 @@ description: 薄均值/中位数/标准差 + 日志 fields(Mid2 M10)
| 20 |
| 30 |
*m = > 统计.均值 列表=`xs`*
**m = > 统计.均值 列表=`xs`**
> print text=`m`
`fld` =