From aea86746e782772b8f80917e73158c3afd7e9c4c Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 23 Oct 2026 12:45:01 +0000 Subject: [PATCH] feat: migrate corpus to file-scoped occlusion --- CHANGELOG.md | 7 + README.md | 10 +- ...Marqdo_Executable_Knowledge_Development.md | 6 +- examples/agent-okf-flywheel/index.mq.md | 1 + examples/agent-pong/index.mq.md | 1 + examples/agent-sandbox-okf/index.mq.md | 11 +- examples/anlian-mq/components/chrome.mq.md | 1 + examples/anlian-mq/components/foot.mq.md | 4 + examples/anlian-mq/components/fragments.mq.md | 1 + examples/anlian-mq/components/hero.mq.md | 4 + examples/anlian-mq/components/home_body.mq.md | 7 +- examples/anlian-mq/components/nav.mq.md | 4 + examples/anlian-mq/components/page.mq.md | 1 + examples/anlian-mq/db/index.mq.md | 1 + examples/anlian-mq/db/schema.mq.md | 4 + examples/anlian-mq/db/seed.mq.md | 4 + examples/anlian-mq/index.mq.md | 17 +- examples/anlian-mq/offline-smoke.mq.md | 9 +- examples/anlian-mq/styles/shell.mq.md | 1 + examples/browser-hello/counter.mq.md | 1 + examples/browser-hello/fetch.mq.md | 1 + examples/browser-hello/form.mq.md | 1 + examples/browser-media/media.mq.md | 1 + .../config/resolve.mq.md | 1 + examples/engineering-knowledge/index.mq.md | 1 + .../docs/invoice-answer.mq.md | 3 +- .../executable-knowledge/schema/order.mq.md | 1 + examples/knowledge-layers/libai.mq.md | 1 + examples/knowledge-layers/main.compat.mq.md | 1 + examples/knowledge-layers/main.mq.md | 4 + examples/knowledge-layers/poet.mq.md | 4 + examples/linalg-least-squares/index.mq.md | 5 +- examples/linalg-svd/index.mq.md | 3 +- examples/linalg-transpose/index.mq.md | 5 +- examples/link-syntax/libai.mq.md | 1 + examples/link-syntax/main.mq.md | 4 + examples/marqdo-blog/api/echo.mq.md | 1 + examples/marqdo-blog/api/ping.mq.md | 1 + examples/marqdo-blog/components/foot.mq.md | 4 + examples/marqdo-blog/components/nav.mq.md | 4 + examples/marqdo-blog/components/side.mq.md | 4 + examples/marqdo-blog/db/posts.mq.md | 1 + examples/marqdo-blog/db/schema.mq.md | 4 + examples/marqdo-blog/db/seed.mq.md | 4 + examples/marqdo-blog/index.mq.md | 1 + examples/marqdo-blog/pages/about.mq.md | 1 + examples/marqdo-blog/pages/post.mq.md | 1 + examples/marqdo-blog/serve.mq.md | 1 + examples/marqdo-blog/styles/theme.mq.md | 1 + examples/oa2026-showcase/add.mq.md | 4 + examples/oa2026-showcase/bell.mq.md | 5 +- examples/oa2026-showcase/calculus.mq.md | 1 + examples/quantum-bell/index.mq.md | 1 + examples/quantum-entanglement/index.mq.md | 3 +- examples/quantum-ghz/index.mq.md | 1 + examples/web-client-site/index.mq.md | 1 + examples/web-client-site/serve.mq.md | 1 + examples/web-client-site/static/client.mq.md | 1 + examples/web-collab-doc/index.mq.md | 1 + examples/web-collab-doc/static/client.mq.md | 1 + .../web-net-site-zh/components/foot.mq.md | 4 + examples/web-net-site-zh/components/nav.mq.md | 4 + .../web-net-site-zh/components/side.mq.md | 4 + examples/web-net-site-zh/db/articles.mq.md | 4 + examples/web-net-site-zh/db/index.mq.md | 1 + examples/web-net-site-zh/index.mq.md | 9 +- examples/web-net-site-zh/styles/shell.mq.md | 4 + examples/web-net-site/components/foot.mq.md | 4 + examples/web-net-site/components/nav.mq.md | 4 + examples/web-net-site/components/side.mq.md | 4 + examples/web-net-site/db/articles.mq.md | 4 + examples/web-net-site/db/index.mq.md | 1 + examples/web-net-site/index.mq.md | 9 +- examples/web-net-site/styles/shell.mq.md | 4 + examples/web-site-zh/components/desk.mq.md | 1 + examples/web-site-zh/components/foot.mq.md | 4 + examples/web-site-zh/components/nav.mq.md | 4 + examples/web-site-zh/components/side.mq.md | 4 + examples/web-site-zh/db/articles.mq.md | 4 + examples/web-site-zh/db/index.mq.md | 1 + examples/web-site-zh/index.mq.md | 1 + examples/web-site-zh/styles/shell.mq.md | 1 + examples/web-site/components/desk.mq.md | 1 + examples/web-site/components/foot.mq.md | 4 + examples/web-site/components/nav.mq.md | 4 + examples/web-site/components/side.mq.md | 4 + examples/web-site/db/articles.mq.md | 4 + examples/web-site/db/index.mq.md | 1 + examples/web-site/index.mq.md | 1 + examples/web-site/styles/shell.mq.md | 1 + examples/web-spa-app/index.mq.md | 1 + examples/web-tenant-saas/index.mq.md | 1 + examples/web-ws-room/index.mq.md | 1 + ext/ai/agent.mq.md | 29 ++-- ext/ai/llm.mq.md | 5 +- ext/ai/llm/ollama.mq.md | 1 + ext/ai/policies/step-route.mq.md | 1 + ext/ai/大模型.mq.md | 27 ++-- ext/ai/智能体.mq.md | 3 +- ext/ai/沙盒.mq.md | 1 + ext/linalg/linalg.mq.md | 1 + ext/linalg/线性代数.mq.md | 1 + ext/net/http.mq.md | 1 + ext/net/url.mq.md | 1 + ext/quantum/quantum.mq.md | 1 + ext/quantum/量子.mq.md | 1 + ext/security/oidc.mq.md | 1 + ext/security/rbac.mq.md | 1 + ext/web/_capability.mq.md | 1 + ext/web/client.mq.md | 1 + ext/web/component.mq.md | 1 + ext/web/dom.mq.md | 7 +- ext/web/page.mq.md | 5 +- ext/web/route.mq.md | 17 +- ext/web/web.mq.md | 1 + ext/web/网页.mq.md | 1 + lib/browser.mq.md | 1 + lib/cli.mq.md | 1 + lib/csv.mq.md | 1 + lib/datetime.mq.md | 1 + lib/encoding.mq.md | 1 + lib/foreign.mq.md | 1 + lib/fs.mq.md | 1 + lib/hash.mq.md | 1 + lib/html.mq.md | 1 + lib/json.mq.md | 1 + lib/log.mq.md | 1 + lib/math.mq.md | 1 + lib/net.mq.md | 1 + lib/path.mq.md | 1 + lib/plugin.mq.md | 1 + lib/re.mq.md | 1 + lib/secrets.mq.md | 1 + lib/stats.mq.md | 1 + lib/subtask.mq.md | 1 + lib/sys.mq.md | 1 + lib/table.mq.md | 1 + lib/text.mq.md | 1 + lib/time.mq.md | 1 + lib/toml.mq.md | 1 + lib/url.mq.md | 1 + lib/uuid.mq.md | 1 + lib/writeback.mq.md | 1 + lib/命令行.mq.md | 1 + lib/哈希.mq.md | 1 + lib/地址.mq.md | 1 + lib/外联.mq.md | 1 + lib/子任务.mq.md | 1 + lib/插件.mq.md | 1 + lib/数学.mq.md | 1 + lib/文件.mq.md | 1 + lib/文本.mq.md | 1 + lib/日志.mq.md | 1 + lib/日期时间.mq.md | 1 + lib/时间.mq.md | 1 + lib/机密.mq.md | 1 + lib/标识.mq.md | 1 + lib/正则.mq.md | 1 + lib/浏览器.mq.md | 1 + lib/系统.mq.md | 1 + lib/统计.mq.md | 1 + lib/编码.mq.md | 1 + lib/网络.mq.md | 1 + lib/自写回.mq.md | 1 + lib/表.mq.md | 1 + lib/超文本.mq.md | 1 + lib/路径.mq.md | 1 + lib/逗号表.mq.md | 1 + lib/配置表.mq.md | 1 + man-test/ext/agent-plan.mq.md | 1 + man-test/keyword/bool.mq.md | 1 + man-test/keyword/input.mq.md | 1 + man-test/keyword/print.mq.md | 1 + man-test/lib/math.mq.md | 1 + man-test/lib/writeback.mq.md | 1 + man-test/structure/loop.mq.md | 1 + public/features/01-phase-i-treewalk.mq.md | 1 + public/features/01-树遍历.mq.md | 1 + public/features/02-bytecode.mq.md | 1 + public/features/02-字节码.mq.md | 1 + public/features/03-view-and-docs.mq.md | 1 + public/features/03-view与文档.mq.md | 1 + public/features/04-objects.mq.md | 1 + public/features/04-对象.mq.md | 1 + public/features/05-extensions.mq.md | 1 + public/features/05-扩展.mq.md | 1 + public/features/06-quantum.mq.md | 1 + public/features/06-量子.mq.md | 1 + public/features/07-linalg.mq.md | 5 +- public/features/07-线性代数.mq.md | 5 +- public/features/08-re-encoding.mq.md | 1 + public/features/08-正则编解码.mq.md | 1 + public/features/09-path-fs.mq.md | 1 + public/features/09-路径文件.mq.md | 1 + public/features/10-hash-secrets.mq.md | 1 + public/features/10-哈希机密.mq.md | 1 + public/features/13-log-uuid.mq.md | 1 + public/features/13-日志标识.mq.md | 1 + public/features/17-stats-log.mq.md | 1 + public/features/17-统计日志.mq.md | 1 + public/features/18-AI原生闭环.mq.md | 1 + public/features/18-ai-native-loop.mq.md | 1 + public/features/20-OKF与EKC.mq.md | 1 + public/features/20-okf-ekc.mq.md | 1 + public/features/21-persistence.mq.md | 1 + public/features/21-持久化.mq.md | 1 + public/keywords/bool-logic.mq.md | 1 + public/keywords/input.mq.md | 1 + public/keywords/print.mq.md | 1 + public/keywords/stdlib.mq.md | 1 + public/keywords/内核双名.mq.md | 1 + public/keywords/布尔逻辑.mq.md | 1 + public/keywords/打印.mq.md | 1 + public/keywords/标准库.mq.md | 1 + public/keywords/输入.mq.md | 1 + public/stdlib/00-overview.mq.md | 1 + public/stdlib/00-索引.mq.md | 1 + public/stdlib/fs.mq.md | 1 + public/stdlib/json.mq.md | 1 + public/stdlib/math.mq.md | 1 + public/stdlib/net.mq.md | 1 + public/stdlib/plugin.mq.md | 1 + public/stdlib/subtask.mq.md | 1 + public/stdlib/sys.mq.md | 1 + public/stdlib/text.mq.md | 1 + public/stdlib/time.mq.md | 1 + public/stdlib/writeback.mq.md | 1 + public/stdlib/子任务.mq.md | 1 + public/stdlib/插件.mq.md | 1 + public/stdlib/数学.mq.md | 1 + public/stdlib/文件.mq.md | 1 + public/stdlib/文本.mq.md | 1 + public/stdlib/时间.mq.md | 1 + public/stdlib/系统.mq.md | 1 + public/stdlib/网络.mq.md | 1 + public/stdlib/自写回.mq.md | 1 + public/structure/01-hello.mq.md | 1 + public/structure/01-你好.mq.md | 1 + public/structure/02-function.mq.md | 1 + public/structure/02-函数.mq.md | 1 + public/structure/03-positional-call.mq.md | 1 + public/structure/03-位置调用.mq.md | 1 + public/structure/04-branch.mq.md | 1 + public/structure/04-分支.mq.md | 1 + public/structure/09-inherit.mq.md | 1 + public/structure/09-继承.mq.md | 1 + public/structure/import/main.mq.md | 1 + public/structure/import/utils.mq.md | 1 + public/structure/import/主.mq.md | 1 + public/structure/import/工具.mq.md | 1 + src/load.rs | 32 ++-- src/main.rs | 148 ++++++++++++++---- src/migrate.rs | 85 +++++++--- src/parse/expr.rs | 146 +++++++++++------ tests/contracts/arg_mismatch.mq.md | 4 + tests/contracts/bound_data_table.mq.md | 4 + tests/contracts/field_mismatch.mq.md | 4 + tests/contracts/ok_contract.mq.md | 4 + tests/contracts/return_mismatch.mq.md | 4 + tests/contracts/unknown_key.mq.md | 4 + tests/engineering/config_resolve.mq.md | 1 + tests/engineering/normalize_settings.mq.md | 1 + tests/errors/bad-arity.mq.md | 1 + tests/errors/bad-int.mq.md | 1 + tests/errors/bad-split-sep.mq.md | 1 + tests/errors/div-zero.mq.md | 1 + tests/errors/footnote-missing-key.mq.md | 1 + tests/errors/footnote-oob.mq.md | 1 + tests/errors/footnote-zero.mq.md | 1 + tests/errors/inherit-cycle.mq.md | 1 + tests/errors/inherit-unknown-base.mq.md | 1 + tests/errors/ns-instance-method.mq.md | 1 + tests/errors/undefined-var.mq.md | 1 + tests/errors/unknown-fn.mq.md | 1 + tests/ext/agent-constitution-b0.mq.md | 1 + tests/ext/agent-context-budget-a3.mq.md | 1 + tests/ext/agent-dump-context.mq.md | 1 + tests/ext/agent-inspect-fixture.mq.md | 1 + tests/ext/agent-kb-alias.mq.md | 1 + tests/ext/agent-kb-near.mq.md | 1 + tests/ext/agent-kb-plan-hit.mq.md | 1 + tests/ext/agent-kb-reuse.mq.md | 1 + tests/ext/agent-lib-call.mq.md | 1 + tests/ext/agent-llm-transport-soft.mq.md | 1 + tests/ext/agent-mcp-client.mq.md | 1 + tests/ext/agent-mcp-server-helpers.mq.md | 1 + tests/ext/agent-mcp-server-smoke.mq.md | 7 +- tests/ext/agent-p4-route.mq.md | 1 + tests/ext/agent-plan-confirm.mq.md | 1 + tests/ext/agent-plan-decision.mq.md | 1 + tests/ext/agent-plan-live.mq.md | 1 + tests/ext/agent-plan-observe.mq.md | 1 + tests/ext/agent-plan-preserve.mq.md | 5 +- tests/ext/agent-plan-stream-offline.mq.md | 1 + tests/ext/agent-resume.mq.md | 1 + tests/ext/agent-run-cold-efi.mq.md | 1 + tests/ext/agent-run-live.mq.md | 1 + tests/ext/agent-sandbox-optin.mq.md | 13 +- tests/ext/agent-small-llm-route.mq.md | 1 + tests/ext/agent-smoke.mq.md | 1 + tests/ext/agent-soft-match.mq.md | 1 + tests/ext/agent-step-route.mq.md | 7 +- tests/ext/agent-tools-rag-a4.mq.md | 1 + tests/ext/agent-v2-learn.mq.md | 1 + tests/ext/agent-workbook-patch-a0.mq.md | 1 + tests/ext/agent-writeback-shadow.mq.md | 1 + tests/ext/agent-zero-llm.mq.md | 1 + tests/ext/eng-preflight.mq.md | 1 + tests/ext/fixtures/preserve-skill.mq.md | 1 + tests/ext/fixtures/prompt-pong.mq.md | 1 + tests/ext/fs-text-patch.mq.md | 1 + tests/ext/linalg-basic-smoke.mq.md | 7 +- tests/ext/linalg-block-kron.mq.md | 3 +- tests/ext/linalg-doc-smoke.mq.md | 5 +- tests/ext/linalg-factor-smoke.mq.md | 15 +- tests/ext/linalg-formula-smoke.mq.md | 3 +- tests/ext/linalg-infix-smoke.mq.md | 5 +- tests/ext/linalg-metrics-smoke.mq.md | 13 +- tests/ext/linalg-zh-smoke.mq.md | 3 +- tests/ext/llm-ask-offline.mq.md | 5 +- tests/ext/llm-complete.mq.md | 1 + tests/ext/llm-ctor-offline.mq.md | 5 +- tests/ext/llm-entry-prompt-offline.mq.md | 1 + tests/ext/llm-import.mq.md | 1 + tests/ext/llm-meta-offline.mq.md | 5 +- tests/ext/llm-named-offline.mq.md | 13 +- tests/ext/llm-stream-live.mq.md | 1 + tests/ext/llm-stream-offline.mq.md | 1 + tests/ext/llm-tool-calls-offline.mq.md | 11 +- tests/ext/quantum-amp-damp-smoke.mq.md | 3 +- tests/ext/quantum-amp-damp-zh-smoke.mq.md | 3 +- tests/ext/quantum-author-api-smoke.mq.md | 7 +- tests/ext/quantum-author-api-zh-smoke.mq.md | 7 +- tests/ext/quantum-bell-smoke.mq.md | 7 +- tests/ext/quantum-custom-gate-smoke.mq.md | 3 +- tests/ext/quantum-custom-gate-zh-smoke.mq.md | 3 +- tests/ext/quantum-draw-smoke.mq.md | 5 +- tests/ext/quantum-gate-heatmap-smoke.mq.md | 3 +- tests/ext/quantum-gate-matrix-smoke.mq.md | 1 + tests/ext/quantum-gates-smoke.mq.md | 13 +- tests/ext/quantum-linalg-smoke.mq.md | 3 +- tests/ext/quantum-noise-smoke.mq.md | 3 +- tests/ext/quantum-noise-zh-smoke.mq.md | 3 +- tests/ext/quantum-steps-smoke.mq.md | 5 +- tests/ext/quantum-viz-advanced-smoke.mq.md | 1 + tests/ext/quantum-zh-smoke.mq.md | 3 +- tests/ext/sandbox-cow.mq.md | 5 +- tests/ext/sandbox-deny.mq.md | 9 +- tests/ext/sandbox-fixtures/guest-json.mq.md | 1 + tests/ext/sandbox-fixtures/guest-plugin.mq.md | 1 + tests/ext/sandbox-fixtures/promote-bad.mq.md | 1 + tests/ext/sandbox-fixtures/promote-good.mq.md | 1 + tests/ext/sandbox-run-lib.mq.md | 7 +- tests/ext/web-artifact-doc.mq.md | 1 + tests/ext/web-artifact-endpoint.mq.md | 1 + tests/ext/web-artifact-render-smoke.mq.md | 1 + tests/ext/web-artifact-site/api/ping.mq.md | 1 + tests/ext/web-artifact-site/index.mq.md | 1 + tests/ext/web-artifact-site/pages/about.mq.md | 1 + tests/ext/web-artifact-site/serve.mq.md | 1 + tests/ext/web-artifact-zh.mq.md | 1 + tests/ext/web-cache-artifact-smoke.mq.md | 3 +- tests/ext/web-data-db-smoke.mq.md | 1 + tests/ext/web-fixtures/components/foot.mq.md | 4 + tests/ext/web-fixtures/components/nav.mq.md | 4 + tests/ext/web-fixtures/components/side.mq.md | 4 + tests/ext/web-fixtures/db/articles.mq.md | 4 + tests/ext/web-fixtures/styles/shell.mq.md | 4 + tests/ext/web-rbac-artifact-smoke.mq.md | 5 +- tests/ext/web-static-artifact-smoke.mq.md | 5 +- tests/ext/web-use-smoke.mq.md | 5 +- tests/gold.rs | 24 +-- tests/keywords/bool-logic.mq.md | 1 + tests/keywords/input-escape.mq.md | 1 + tests/keywords/input.mq.md | 1 + tests/keywords/print.mq.md | 1 + tests/keywords/quoted-string.mq.md | 1 + tests/keywords/stdlib-more.mq.md | 1 + tests/keywords/stdlib.mq.md | 1 + tests/keywords/zh-bool.mq.md | 1 + tests/keywords/zh-builtins.mq.md | 1 + tests/lib/encoding-smoke.mq.md | 1 + tests/lib/foreign-call.mq.md | 1 + tests/lib/foreign-python.mq.md | 1 + tests/lib/foreign-run-lang.mq.md | 1 + tests/lib/fs-copy-move.mq.md | 1 + tests/lib/fs-read.mq.md | 1 + tests/lib/hash-smoke.mq.md | 1 + tests/lib/json-quote.mq.md | 1 + tests/lib/json-roundtrip.mq.md | 1 + tests/lib/log-uuid-smoke.mq.md | 1 + tests/lib/math-formula-chain.mq.md | 1 + tests/lib/math-formula.mq.md | 1 + tests/lib/math-plot.mq.md | 1 + tests/lib/math-random.mq.md | 1 + tests/lib/net-encode.mq.md | 1 + tests/lib/net-markdown.mq.md | 1 + tests/lib/net-openai-sse-reasoning.mq.md | 1 + tests/lib/path-smoke.mq.md | 1 + tests/lib/plugin-demo.mq.md | 1 + tests/lib/re-smoke.mq.md | 1 + tests/lib/secrets-smoke.mq.md | 1 + tests/lib/stats-log-smoke.mq.md | 1 + tests/lib/subtask-child-print.mq.md | 1 + tests/lib/subtask-child.mq.md | 1 + tests/lib/subtask-fn.mq.md | 1 + tests/lib/subtask-foreign.mq.md | 1 + tests/lib/subtask-quiet-io.mq.md | 1 + tests/lib/subtask-spawn.mq.md | 1 + tests/lib/sys-cwd.mq.md | 1 + tests/lib/sys-dotenv.mq.md | 1 + tests/lib/table-list-mid.mq.md | 1 + tests/lib/text-mid-smoke.mq.md | 1 + tests/lib/time-format.mq.md | 1 + tests/lib/writeback-async.mq.md | 1 + tests/lib/writeback-get.mq.md | 1 + tests/lib/哈希-烟测.mq.md | 1 + tests/lib/外联-python.mq.md | 1 + tests/lib/数学-数值.mq.md | 1 + tests/lib/文件-复制.mq.md | 1 + tests/lib/文件-读.mq.md | 1 + tests/lib/文本-加厚-烟测.mq.md | 1 + tests/lib/日志-标识-烟测.mq.md | 1 + tests/lib/机密-烟测.mq.md | 1 + tests/lib/正则-烟测.mq.md | 1 + tests/lib/统计-日志-烟测.mq.md | 1 + tests/lib/编码-烟测.mq.md | 1 + tests/lib/路径-烟测.mq.md | 1 + tests/markup-v03/bold-call.mq.md | 2 +- tests/markup-v03/bold-expr.mq.md | 1 + tests/markup-v03/branch-arm-prose.mq.md | 1 + tests/markup-v03/branch-cond-narrative.mq.md | 1 + tests/markup-v03/dead-bind.mq.md | 2 +- tests/markup-v03/decl-ident-only.mq.md | 1 + tests/markup-v03/dual-call.mq.md | 2 +- tests/markup-v03/dynamic-footnote.mq.md | 2 +- tests/markup-v03/empty-return-compat.mq.md | 2 +- tests/markup-v03/empty-return-hr.mq.md | 2 +- tests/markup-v03/empty-return-none.mq.md | 2 +- tests/markup-v03/empty-return-stars.mq.md | 2 +- tests/markup-v03/float-discount.mq.md | 2 +- tests/markup-v03/foreach-narrative.mq.md | 1 + tests/markup-v03/formula-meta-var.mq.md | 1 + tests/markup-v03/greet-default.mq.md | 2 +- tests/markup-v03/inc-prose.mq.md | 2 +- tests/markup-v03/inline-dollar-formula.mq.md | 1 + tests/markup-v03/leading-backtick-decl.mq.md | 1 + tests/markup-v03/module-hr.mq.md | 2 +- tests/markup-v03/multi-bold.mq.md | 2 +- tests/markup-v03/print-bold.mq.md | 2 +- tests/markup-v03/soft-emphasis.mq.md | 2 +- tests/notebook/no-foreign.mq.md | 1 + tests/notebook/python-insights.mq.md | 1 + tests/notebook/shared.mq.md | 1 + tests/occlusion.rs | 49 +++++- tests/structure/bare-id-italic-bold.mq.md | 1 + tests/structure/branch-consecutive.mq.md | 1 + tests/structure/branch.mq.md | 1 + tests/structure/fn-end-empty-return.mq.md | 1 + tests/structure/fn-end-hr.mq.md | 1 + tests/structure/footnote-index.mq.md | 1 + tests/structure/footnote-map-digits.mq.md | 1 + tests/structure/gap-star-json-body.mq.md | 1 + tests/structure/import-lib.mq.md | 1 + tests/structure/import/main.mq.md | 1 + tests/structure/import/utils.mq.md | 1 + tests/structure/inherit-explicit-super.mq.md | 1 + tests/structure/inherit-override.mq.md | 1 + tests/structure/inherit-parent-method.mq.md | 1 + tests/structure/interp-footnote-index.mq.md | 1 + tests/structure/meta-binding.mq.md | 1 + tests/structure/meta-lift.mq.md | 1 + tests/structure/narrative-bold.mq.md | 1 + tests/structure/nested-call.mq.md | 1 + tests/structure/new-path-stdlib.mq.md | 4 +- tests/structure/ns/associated.mq.md | 4 +- tests/structure/ns/helpers.mq.md | 1 + tests/structure/ns/path3.mq.md | 1 + tests/structure/ns/use.mq.md | 1 + tests/structure/object-handle.mq.md | 1 + tests/structure/optional-param.mq.md | 1 + tests/structure/paragraph-comment.mq.md | 1 + tests/structure/positional-call.mq.md | 1 + tests/structure/unbound-table.mq.md | 1 + tests/view/document-annot-demo.mq.md | 4 +- 485 files changed, 1160 insertions(+), 340 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6de2df1..0f74b79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,10 +45,17 @@ marqdo ext add web # CDN → 2.0.0 ### Added +- **文件级新语义迁移**:`marqdo migrate labels --mark` 可把整个库/目录迁移到显式 `markup: occlusion`,即使文件没有旧式索引也不再依赖进程默认值。迁移验证为语法级、无导入解析依赖,并在写入前比较 Classic 与 Occlusion AST 形状。 +- **显式过渡入口**:`marqdo run --legacy-markup` 与 `marqdo check --legacy-markup` 可在一个版本周期内审阅未迁移的旧文件;环境变量不再改变语法。 + ### Fixed +- 标准库、扩展库、示例、公开文档与可解析测试夹具迁移为文件级 Occlusion;旧的 `[键](集合)` 和 `- [项](集合)` 分别改为 `access` 与 `遍历`。 + ### Changed +- 未标注源码默认采用 Occlusion。Classic 仅能通过明确的 frontmatter 或 `--legacy-markup` 进入,避免同一文档因进程配置而静默改变含义。 + ## v1.5.2 — 2026-10-18 ### Highlights diff --git a/README.md b/README.md index aee02c2..c37eef3 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Marqdo 把 Markdown **标记当作编程语法**:同一个 `.mq.md` 文件, | **知识-代码一致性**
Knowledge-Code Coherence | 说明、数据、示例与实现**同一份源文件**:文档里的表格就是程序的数据,文档里的调用就是真实执行。「文档过期」不再是悄悄漂移,而是可被机器发现的**知识不一致**——知识陈述本身可以被测试。 | | **默认安全,AI 友好** | 无标记文字默认是叙述(注释),只有显式标记才进入执行。AI 自由发挥**不会污染**文档与代码的边界——这比「自然语言编程」安全得多,是 AI 原生语言的重要前提。 | | **multi-view artifact**
`.mq.md` 双后缀即开放接口 | `.mq` 告诉解释器「可执行」,`.md` 告诉整个 Markdown 生态「仍是文档」。GitHub 直接读、VS Code 直接改、搜索引擎直接索引、LLM 直接理解、Marqdo 直接运行。**Marqdo 不占有知识,只是给 Markdown 增加执行语义。** | -| **表格即数据结构** | 程序的数据结构直接就是文档的数据结构:单列竖表 → `List`;横表(1 数据行)→ `Map`;横表(多数据行)→ `Map` of `List`(列向聚合);首列写 `@` / `行` / `row` → 行向记录 `List` of `Map`。取元 `[键](集合)` 也是 Markdown 链接形。这是 literate programming 的下一步。 | +| **表格即数据结构** | 程序的数据结构直接就是文档的数据结构:单列竖表 → `List`;横表(1 数据行)→ `Map`;横表(多数据行)→ `Map` of `List`(列向聚合);首列写 `@` / `行` / `row` → 行向记录 `List` of `Map`。取元使用 `access(集合, "键")`,链接 `[描述](表达式)` 只承载叙述与执行体。这是 literate programming 的下一步。 | | **语义干净** | **返回是架构,打印只是函数**:`*…*` 改变控制流,`print` 只是副作用函数;分支与循环长在 Markdown 结构上(`1.` `2.` 递增 = 分支,`-` = 循环),不是所有列表都被粗暴当成 if。 | | **AI 的可靠上下文与长期记忆** | 一个 `.mq.md` 同时是 documentation + schema + code + examples + knowledge + executable behavior;AI 不必再拼装 README + OpenAPI + JSON Schema + prompt。整个工程天然就是 AI 的**世界模型**——比 RAG 更接近 Executable RAG。 | | **链接即调用**
Link as Call | 文档里的 `[描述](类.函数)` 不是装饰,是跨文档类调用;编译器解析类/函数并返回 **LinkInfo**,`view` 显示调用点,EKC 建边,`links.lock` 可选复现。**v2.1 设计目标**;v2.0.0 已具备本地表达式链接与 `import` + 实例调用。 | @@ -151,7 +151,7 @@ Marqdo 把 Markdown **标记当作编程语法**:同一个 `.mq.md` 文件, |------|------| | 无标记行 | 叙述(注释);行内 `` `名` `` 可声明 | | `**…**` | **代码**(赋值 / 调用 / 表达式) | -| `[描述](表达式)` | **链接(本地)**:描述 + 代码;`()` 与 `**…**` 同权(v2.0.0 需 `markup: occlusion`) | +| `[描述](表达式)` | **链接(本地)**:描述 + 代码;`()` 与 `**…**` 同权(默认语义) | | `[描述](类.函数)` | **链接(跨文档/类调用)**:描述 + 已有类函数调用;可解析、可执行(v2.1 目标) | | `[描述](url)` | 普通 Markdown 导航链接(惰性,不执行) | | `*…*` | **返回值**(整行、`返回*n*`、或表达式形) | @@ -163,11 +163,11 @@ Marqdo 把 Markdown **标记当作编程语法**:同一个 `.mq.md` 文件, | `` > `obj`.method … `` | 方法调用(`obj` 为带 `_type` 的 map) | | 叙述 `` `名` `` / `` `名`=默认 `` | 形参由体推断(`` + `名` `` 仍可用) | | `1.` … | 体内 `1.` `2.` … = 分支(`N. *` = else) | -| `-` | 循环(`` - `条件` `` 或 `` - [项](集合) ``) | -| 表格 | 集合(几何即类型,见下);取元优先 `[键](集合)` | +| `-` | 循环(`` - `条件` `` 或 `` - [项](遍历 集合 为 项) ``) | +| 表格 | 集合(几何即类型,见下);取元使用 `access(集合, "键")` | | 单独一行 `---` / `***` | **叙述分隔**(跳过;不是函数收束) | -> `[键](集合)` / `- [项](集合)` 是旧取元/循环形;v2 链接语法推荐 `[描述](表达式)` / `[描述](类.函数)` / `- [描述](遍历 集合 为 项)`。旧形在 Classic 下保留,见 [link-syntax.md](doc/design/link-syntax.md)。 +> `[键](集合)` / `- [项](集合)` 是旧取元/循环形;迁移后使用 `access(集合, "键")` 与 `- [描述](遍历 集合 为 项)`。旧形只在显式 `markup: classic` 或 `--legacy-markup` 过渡入口中保留,见 [link-syntax.md](doc/design/link-syntax.md)。 ```markdown # main diff --git a/doc/next/Marqdo_Executable_Knowledge_Development.md b/doc/next/Marqdo_Executable_Knowledge_Development.md index ae5eecb..f131247 100644 --- a/doc/next/Marqdo_Executable_Knowledge_Development.md +++ b/doc/next/Marqdo_Executable_Knowledge_Development.md @@ -1066,8 +1066,8 @@ View 至少展示: | 阶段 | 默认行为 | 兼容行为 | |---|---|---| -| 2.0.x | Classic 默认,Occlusion opt-in | 当前行为 | -| 2.1 preview | 新语义可显式开启;迁移报告必开 | Classic 发 deprecated warning | +| 2.0.x | Classic 默认,Occlusion opt-in | 历史行为 | +| 2.1 preview | 新语义默认;全仓语料具有文件级 `markup: occlusion` | `--legacy-markup` / 显式 `markup: classic` 只读过渡 | | 2.1 stable | 新语义默认;旧形状必须已迁移 | `--legacy-markup` 只读运行一个周期 | | 2.2 | 删除全局模式与旧 parser 分支 | 仅保留明确错误和迁移建议 | @@ -1085,7 +1085,7 @@ View 至少展示: ### 16.3 必须显式变化的能力 -- `[键](集合)` 迁为 `at`; +- `[键](集合)` 迁为 `access(集合, "键")`; - 链接不再依赖进程级 markup 模式; - `类.函数` 对无 receiver 函数成为合法 AssociatedFunction 调用; - 正文知识链接被解析和诊断,但不自动执行; diff --git a/examples/agent-okf-flywheel/index.mq.md b/examples/agent-okf-flywheel/index.mq.md index 1bfcce8..3e965e2 100644 --- a/examples/agent-okf-flywheel/index.mq.md +++ b/examples/agent-okf-flywheel/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent-okf-flywheel (Wave B0) description: Promote solidified workbook; second plan is cache=hit — document as knowledge base (OKF). import: diff --git a/examples/agent-pong/index.mq.md b/examples/agent-pong/index.mq.md index 1111fc7..35c6be7 100644 --- a/examples/agent-pong/index.mq.md +++ b/examples/agent-pong/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent-pong (Wave B0) description: >- Constitution demo — call_site + source in step context; optional live CALL via .env. diff --git a/examples/agent-sandbox-okf/index.mq.md b/examples/agent-sandbox-okf/index.mq.md index a96280e..744c1dd 100644 --- a/examples/agent-sandbox-okf/index.mq.md +++ b/examples/agent-sandbox-okf/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent-sandbox-okf — trial then commit description: > O1 example: opt-in sandbox trial with GFM-table returns and link-index reads. @@ -20,8 +21,8 @@ Short demo: write via `agent.trial`, prove the host is clean until commit. > fs.make_dir path="_example_sbx" **dry = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=False** -**dry_ok = [ok](dry)** -**dry_committed = [committed](dry)** +**dry_ok = [ok](access(dry, "ok"))** +**dry_committed = [committed](access(dry, "committed"))** 1. `dry_ok` 1. not `dry_committed` > print text=dry-ok @@ -37,8 +38,8 @@ Short demo: write via `agent.trial`, prove the host is clean until commit. > print text=host-clean **wet = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=True** -**wet_ok = [ok](wet)** -**wet_committed = [committed](wet)** +**wet_ok = [ok](access(wet, "ok"))** +**wet_committed = [committed](access(wet, "committed"))** 1. `wet_ok` 1. `wet_committed` > print text=wet-ok @@ -53,7 +54,7 @@ Short demo: write via `agent.trial`, prove the host is clean until commit. 2. * > print text=proof-missing -**pname = [name]([profile](wet))** +**pname = [name](access([profile](access(wet, "profile")), "name"))** 1. `pname` == "default" > print text=profile-default 2. * diff --git a/examples/anlian-mq/components/chrome.mq.md b/examples/anlian-mq/components/chrome.mq.md index b0acad0..75768bc 100644 --- a/examples/anlian-mq/components/chrome.mq.md +++ b/examples/anlian-mq/components/chrome.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: components/chrome description: 暗恋见君壳层 — head 资源表、导航 HTML、页脚 HTML(对齐 Django base / site_footer)。 --- diff --git a/examples/anlian-mq/components/foot.mq.md b/examples/anlian-mq/components/foot.mq.md index 62f4131..866e7e7 100644 --- a/examples/anlian-mq/components/foot.mq.md +++ b/examples/anlian-mq/components/foot.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 页脚 站点信息与站长链接(毛玻璃底由壳样式绘制)。 diff --git a/examples/anlian-mq/components/fragments.mq.md b/examples/anlian-mq/components/fragments.mq.md index be83076..d91ae0a 100644 --- a/examples/anlian-mq/components/fragments.mq.md +++ b/examples/anlian-mq/components/fragments.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: components/fragments description: AJAX 片段 — /post/ten、/news/five。 导入: diff --git a/examples/anlian-mq/components/hero.mq.md b/examples/anlian-mq/components/hero.mq.md index eff9384..1c21f38 100644 --- a/examples/anlian-mq/components/hero.mq.md +++ b/examples/anlian-mq/components/hero.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 首页引言 英雄区 HTML(品牌标语 + CTA + 漂浮主图)。样式在 `styles/shell` 的 Hero / 动效表。 diff --git a/examples/anlian-mq/components/home_body.mq.md b/examples/anlian-mq/components/home_body.mq.md index e2e7611..6c5090d 100644 --- a/examples/anlian-mq/components/home_body.mq.md +++ b/examples/anlian-mq/components/home_body.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: components/home_body description: 首页主体 HTML — hero + 公告 + 新闻时间线 + 论坛帖子(对齐 Django home.html,无外层导航)。 导入: @@ -20,9 +21,9 @@ description: 首页主体 HTML — hero + 公告 + 新闻时间线 + 论坛帖 **帖子行 = > 库.查询 表="posts" 上限=10 排序="-created_at"** **公告段 = None** -- [告](公告行) - **文 = [content](告)** - **时 = [created_at](告)** +- [告](遍历 公告行 为 告) + **文 = [content](access(告, "content"))** + **时 = [created_at](access(告, "created_at"))** **一项 = "
" + 文 + "

" + 时 + "

"** **公告段 = > table.append list=公告段 item=一项** 1. 公告段 diff --git a/examples/anlian-mq/components/nav.mq.md b/examples/anlian-mq/components/nav.mq.md index ff0dbff..bc5c50c 100644 --- a/examples/anlian-mq/components/nav.mq.md +++ b/examples/anlian-mq/components/nav.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 导航 顶栏:首页、帖子、新闻、搜索、聊天、发帖(登录后)、后台。 diff --git a/examples/anlian-mq/components/page.mq.md b/examples/anlian-mq/components/page.mq.md index 9e56855..aed9915 100644 --- a/examples/anlian-mq/components/page.mq.md +++ b/examples/anlian-mq/components/page.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: components/page description: 用原站 chrome 包一层完整 HTML 引言(bare 布局)。 import: diff --git a/examples/anlian-mq/db/index.mq.md b/examples/anlian-mq/db/index.mq.md index df47ea0..ae4b665 100644 --- a/examples/anlian-mq/db/index.mq.md +++ b/examples/anlian-mq/db/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: db/index description: 打开库、建全表、幂等种子、帖子全文索引。 导入: diff --git a/examples/anlian-mq/db/schema.mq.md b/examples/anlian-mq/db/schema.mq.md index 50d730a..b4b6f5b 100644 --- a/examples/anlian-mq/db/schema.mq.md +++ b/examples/anlian-mq/db/schema.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## posts 帖子主表。`slug` 用于详情路径;`board` 为板块显示名,`board_id` 关联 `boards`。 diff --git a/examples/anlian-mq/db/seed.mq.md b/examples/anlian-mq/db/seed.mq.md index c74c61d..af9ad39 100644 --- a/examples/anlian-mq/db/seed.mq.md +++ b/examples/anlian-mq/db/seed.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## boards 帖子板块:日常 / 开发 / 聊天。 diff --git a/examples/anlian-mq/index.mq.md b/examples/anlian-mq/index.mq.md index 4da3277..df66b49 100644 --- a/examples/anlian-mq/index.mq.md +++ b/examples/anlian-mq/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 暗恋见君 · Marqdo description: 对齐 Django 暗恋见君:原站 CSS/DOM、首页四段、列表详情、发帖门禁、聊天室、专题、搜索、API 指南。 导入: @@ -141,10 +142,10 @@ description: 对齐 Django 暗恋见君:原站 CSS/DOM、首页四段、列表 **房间行 = > store.查询 表="chat_rooms" 上限=50** **房间段 = None** -- [房](房间行) - **名 = [name](房)** - **链 = [slug](房)** - **摘 = [summary](房)** +- [房](遍历 房间行 为 房) + **名 = [name](access(房, "name"))** + **链 = [slug](access(房, "slug"))** + **摘 = [summary](access(房, "summary"))** **项 = "

" + 名 + "

" + 摘 + "

"** **房间段 = > table.append list=房间段 item=项** **房间内 = > text.str_join xs=房间段 sep=""** @@ -165,10 +166,10 @@ description: 对齐 Django 暗恋见君:原站 CSS/DOM、首页四段、列表 **专题行 = > store.查询 表="topics" 上限=50** **专题段 = None** -- [题](专题行) - **题名 = [title](题)** - **链 = [slug](题)** - **摘 = [summary](题)** +- [题](遍历 专题行 为 题) + **题名 = [title](access(题, "title"))** + **链 = [slug](access(题, "slug"))** + **摘 = [summary](access(题, "summary"))** **项 = "

" + 题名 + "

" + 摘 + "

slug: " + 链 + "

"** **专题段 = > table.append list=专题段 item=项** **专题内 = > text.str_join xs=专题段 sep=""** diff --git a/examples/anlian-mq/offline-smoke.mq.md b/examples/anlian-mq/offline-smoke.mq.md index def8026..220de64 100644 --- a/examples/anlian-mq/offline-smoke.mq.md +++ b/examples/anlian-mq/offline-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: anlian-mq offline smoke description: 不 listen:装配库表/页面/门禁/WS 路由袋,验证可读路径可构造。 导入: @@ -45,7 +46,7 @@ description: 不 listen:装配库表/页面/门禁/WS 路由袋,验证可读 **应用 = > 应用.门禁 路径="/write" 角色="admin" 匹配="prefix" 拒绝="redirect"** **应用 = > 应用.路由实时 路径="/chat/ws" 模式="broadcast"** -**gates = [gates](应用)** +**gates = [gates](access(应用, "gates"))** **n = > len value=`gates`** 1. `n` >= 2 > print text=gates-ok @@ -53,9 +54,9 @@ description: 不 listen:装配库表/页面/门禁/WS 路由袋,验证可读 > print text=gates-fail > sys.exit code=1 -**ws = [ws_routes](应用)** -**room = [/chat/ws](ws)** -**mode = [mode](room)** +**ws = [ws_routes](access(应用, "ws_routes"))** +**room = [/chat/ws](access(ws, "/chat/ws"))** +**mode = [mode](access(room, "mode"))** 1. `mode` == "broadcast" > print text=ws-ok 2. * diff --git a/examples/anlian-mq/styles/shell.mq.md b/examples/anlian-mq/styles/shell.mq.md index 653857f..8247f0e 100644 --- a/examples/anlian-mq/styles/shell.mq.md +++ b/examples/anlian-mq/styles/shell.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: styles/shell description: 暗恋见君壳样式——对照 Django 原站粉玻璃 + 动效,用表格声明。 导入: diff --git a/examples/browser-hello/counter.mq.md b/examples/browser-hello/counter.mq.md index f3d63ed..c624eb9 100644 --- a/examples/browser-hello/counter.mq.md +++ b/examples/browser-hello/counter.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: browser counter (C3) description: wire table + browser.set_text — no json glue import: diff --git a/examples/browser-hello/fetch.mq.md b/examples/browser-hello/fetch.mq.md index a053a6b..dd98c42 100644 --- a/examples/browser-hello/fetch.mq.md +++ b/examples/browser-hello/fetch.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: browser fetch (C4) description: fetch/after effects via lib/browser — no json glue import: diff --git a/examples/browser-hello/form.mq.md b/examples/browser-hello/form.mq.md index 8d81b22..63aa108 100644 --- a/examples/browser-hello/form.mq.md +++ b/examples/browser-hello/form.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: browser form (D3) description: input wire passes value; effects via lib/browser import: diff --git a/examples/browser-media/media.mq.md b/examples/browser-media/media.mq.md index 9aecf39..87a3532 100644 --- a/examples/browser-media/media.mq.md +++ b/examples/browser-media/media.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: browser-media (route F) description: file / canvas / audio / observers / drag — GFM tables + lib/browser import: diff --git a/examples/engineering-knowledge/config/resolve.mq.md b/examples/engineering-knowledge/config/resolve.mq.md index 07cea27..7b24860 100644 --- a/examples/engineering-knowledge/config/resolve.mq.md +++ b/examples/engineering-knowledge/config/resolve.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: resolve_config capability: config.resolve status: stable diff --git a/examples/engineering-knowledge/index.mq.md b/examples/engineering-knowledge/index.mq.md index 2bd54f3..bf43629 100644 --- a/examples/engineering-knowledge/index.mq.md +++ b/examples/engineering-knowledge/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Engineering Knowledge demo description: Tiny project demonstrating Capability Catalog + reuse + decisions. --- diff --git a/examples/executable-knowledge/docs/invoice-answer.mq.md b/examples/executable-knowledge/docs/invoice-answer.mq.md index ded309e..933e70d 100644 --- a/examples/executable-knowledge/docs/invoice-answer.mq.md +++ b/examples/executable-knowledge/docs/invoice-answer.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion id: document.invoice-answer type: Answer import: @@ -7,7 +8,7 @@ import: # 发票回答 -**总额 = [订单的含税总价](pricing.订单定价.含税总额(订单))** +**总额 = [订单的含税总价](access(pricing.订单定价.含税总额(订单), "订单的含税总价"))** 这张订单的含税总额是[含税总价](总额)。 diff --git a/examples/executable-knowledge/schema/order.mq.md b/examples/executable-knowledge/schema/order.mq.md index b6fcc57..61a98ed 100644 --- a/examples/executable-knowledge/schema/order.mq.md +++ b/examples/executable-knowledge/schema/order.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion id: schema.order type: Schema --- diff --git a/examples/knowledge-layers/libai.mq.md b/examples/knowledge-layers/libai.mq.md index aedb728..982ae9e 100644 --- a/examples/knowledge-layers/libai.mq.md +++ b/examples/knowledge-layers/libai.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: Fact id: libai title: 李白 diff --git a/examples/knowledge-layers/main.compat.mq.md b/examples/knowledge-layers/main.compat.mq.md index 818a55e..2cea87c 100644 --- a/examples/knowledge-layers/main.compat.mq.md +++ b/examples/knowledge-layers/main.compat.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion import: libai: libai.mq.md --- diff --git a/examples/knowledge-layers/main.mq.md b/examples/knowledge-layers/main.mq.md index 859010b..c3cc8ae 100644 --- a/examples/knowledge-layers/main.mq.md +++ b/examples/knowledge-layers/main.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # main 诗人李白的出生年份是[出生年份](李白.出生年份)。 diff --git a/examples/knowledge-layers/poet.mq.md b/examples/knowledge-layers/poet.mq.md index d5a78b4..3eead98 100644 --- a/examples/knowledge-layers/poet.mq.md +++ b/examples/knowledge-layers/poet.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # 诗人 | 字段 | 类型 | 说明 | diff --git a/examples/linalg-least-squares/index.mq.md b/examples/linalg-least-squares/index.mq.md index 339a3cc..eb32adb 100644 --- a/examples/linalg-least-squares/index.mq.md +++ b/examples/linalg-least-squares/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Least squares via lstsq description: Overdetermined Ax≈b with ext/linalg lstsq + heatmap. import: @@ -28,8 +29,8 @@ $$ **`_` = > la.draw factor=`A` kind="heatmap" theme="light" path="ls-heatmap.svg"** **`ls` = > la.lstsq a=`A` b=`b`** -**`x` = [x](ls)** -**`resid` = [residual_fro](ls)** +**`x` = [x](access(ls, "x"))** +**`resid` = [residual_fro](access(ls, "residual_fro"))** > print text=`x` > print text=`resid` diff --git a/examples/linalg-svd/index.mq.md b/examples/linalg-svd/index.mq.md index 0051463..42a36e5 100644 --- a/examples/linalg-svd/index.mq.md +++ b/examples/linalg-svd/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: SVD structure demo description: Diagonal SVD + structure SVG via ext/linalg. import: @@ -18,7 +19,7 @@ $$ **`M` = > la.from_formula formula=`M`** **`f` = > la.factorize matrix=`M` kind="svd"** -**`S` = [S](f)** +**`S` = [S](access(f, "S"))** **`_` = > la.draw factor=`f` kind="svd" theme="light" path="svd-structure.svg"** **`hm` = > la.draw factor=`M` kind="hinton" path="svd-hinton.svg"** diff --git a/examples/linalg-transpose/index.mq.md b/examples/linalg-transpose/index.mq.md index 0864f25..b598eab 100644 --- a/examples/linalg-transpose/index.mq.md +++ b/examples/linalg-transpose/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Transpose identity (formula document) description: (AB)^T = B^T A^T as a runnable lecture fragment. import: @@ -19,8 +20,8 @@ Declare shapes in a table, form \(P = AB\), then check \((AB)^\top = B^\top A^\t | 2 | B | 3 | 2 | **`env` = > la.declare table=`shapes`** -**`A` = [A](env)** -**`B` = [B](env)** +**`A` = [A](access(env, "A"))** +**`B` = [B](access(env, "B"))** **`P` = `A` * `B`** **`t` = > `P`.T_ascii** > print text=`t` diff --git a/examples/link-syntax/libai.mq.md b/examples/link-syntax/libai.mq.md index 8e6efae..d647918 100644 --- a/examples/link-syntax/libai.mq.md +++ b/examples/link-syntax/libai.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: Fact id: libai title: 李白 diff --git a/examples/link-syntax/main.mq.md b/examples/link-syntax/main.mq.md index ae490df..0ff2200 100644 --- a/examples/link-syntax/main.mq.md +++ b/examples/link-syntax/main.mq.md @@ -1,2 +1,6 @@ +--- +markup: occlusion +--- + # main 用户想要知道李白的出生年份,我们要告诉用户[李白的出生年份](李白.李白的出生年份) diff --git a/examples/marqdo-blog/api/echo.mq.md b/examples/marqdo-blog/api/echo.mq.md index 7348d76..1b75fa3 100644 --- a/examples/marqdo-blog/api/echo.mq.md +++ b/examples/marqdo-blog/api/echo.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: endpoint method: POST path: /api/echo diff --git a/examples/marqdo-blog/api/ping.mq.md b/examples/marqdo-blog/api/ping.mq.md index c6f824d..42dfff1 100644 --- a/examples/marqdo-blog/api/ping.mq.md +++ b/examples/marqdo-blog/api/ping.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: endpoint method: GET path: /api/ping diff --git a/examples/marqdo-blog/components/foot.mq.md b/examples/marqdo-blog/components/foot.mq.md index 877eb3c..3ecf33a 100644 --- a/examples/marqdo-blog/components/foot.mq.md +++ b/examples/marqdo-blog/components/foot.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 页脚 站点页脚。放版权与概览链接。 diff --git a/examples/marqdo-blog/components/nav.mq.md b/examples/marqdo-blog/components/nav.mq.md index b41153f..c67b75f 100644 --- a/examples/marqdo-blog/components/nav.mq.md +++ b/examples/marqdo-blog/components/nav.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 导航 站点顶部导航。首项是站点名(渐变 Logo 由主题 CSS 处理),`后台` 指向需要登录的 `/admin`。 diff --git a/examples/marqdo-blog/components/side.mq.md b/examples/marqdo-blog/components/side.mq.md index b43d879..07cf43c 100644 --- a/examples/marqdo-blog/components/side.mq.md +++ b/examples/marqdo-blog/components/side.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 侧栏 右侧归档面板:文章入口、标签、实时小部件。 diff --git a/examples/marqdo-blog/db/posts.mq.md b/examples/marqdo-blog/db/posts.mq.md index a5a3ba2..2c6e1ed 100644 --- a/examples/marqdo-blog/db/posts.mq.md +++ b/examples/marqdo-blog/db/posts.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: blog posts schema import: data: ext/data/db.mq.md diff --git a/examples/marqdo-blog/db/schema.mq.md b/examples/marqdo-blog/db/schema.mq.md index 2ad6403..5c3899c 100644 --- a/examples/marqdo-blog/db/schema.mq.md +++ b/examples/marqdo-blog/db/schema.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## posts 文章主表结构。`slug` 用于详情页 `/post/{slug}` 的动态路由;`content` 存 Markdown 正文;`tag` 是主标签(tags 表 slug)。 diff --git a/examples/marqdo-blog/db/seed.mq.md b/examples/marqdo-blog/db/seed.mq.md index 55de21c..225f95f 100644 --- a/examples/marqdo-blog/db/seed.mq.md +++ b/examples/marqdo-blog/db/seed.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## posts 种子文章。首页与详情页的初始数据。created_at 用于按时间倒序展示;tag 是主标签 slug。 diff --git a/examples/marqdo-blog/index.mq.md b/examples/marqdo-blog/index.mq.md index c622fb1..3ad7bee 100644 --- a/examples/marqdo-blog/index.mq.md +++ b/examples/marqdo-blog/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: web title: Marqdo 博客 route: / diff --git a/examples/marqdo-blog/pages/about.mq.md b/examples/marqdo-blog/pages/about.mq.md index fd50dd6..848830a 100644 --- a/examples/marqdo-blog/pages/about.mq.md +++ b/examples/marqdo-blog/pages/about.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion 类型: 网页 路由: /about 方法: GET diff --git a/examples/marqdo-blog/pages/post.mq.md b/examples/marqdo-blog/pages/post.mq.md index 4a9cdef..91d09d0 100644 --- a/examples/marqdo-blog/pages/post.mq.md +++ b/examples/marqdo-blog/pages/post.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: web title: Post route: /post/{slug} diff --git a/examples/marqdo-blog/serve.mq.md b/examples/marqdo-blog/serve.mq.md index f7e6f64..cbfed36 100644 --- a/examples/marqdo-blog/serve.mq.md +++ b/examples/marqdo-blog/serve.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: marqdo-blog serve description: Scan Artifact documents/endpoints and listen (ADR 0007). import: diff --git a/examples/marqdo-blog/styles/theme.mq.md b/examples/marqdo-blog/styles/theme.mq.md index 863d746..4d8f5f6 100644 --- a/examples/marqdo-blog/styles/theme.mq.md +++ b/examples/marqdo-blog/styles/theme.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: styles/theme description: 博客主题:样式即数据表格,装配即函数。 import: diff --git a/examples/oa2026-showcase/add.mq.md b/examples/oa2026-showcase/add.mq.md index 7519d39..a5d4b7b 100644 --- a/examples/oa2026-showcase/add.mq.md +++ b/examples/oa2026-showcase/add.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 加一 对于输入变量`n`,我们执行 **`n` = `n` + 1**,然后把更新后的值作为结果返回 *`n`*。 diff --git a/examples/oa2026-showcase/bell.mq.md b/examples/oa2026-showcase/bell.mq.md index 278b9ad..b308d33 100644 --- a/examples/oa2026-showcase/bell.mq.md +++ b/examples/oa2026-showcase/bell.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 贝尔态:两个量子比特如何一起回答 description: 从一条假设开始,搭电路、看概率、画图,并用断言验收。 import: @@ -31,8 +32,8 @@ import: 我们期待什么?如果假设成立,`概率`应该只在「00」与「11」上有值,而且各占一半。 先把两个关键概率取出来,读者不必在长映射里找: -**`p00` = [00](概率)** -**`p11` = [11](概率)** +**`p00` = [00](access(概率, "00"))** +**`p11` = [11](access(概率, "11"))** > print text=`p00` > print text=`p11` diff --git a/examples/oa2026-showcase/calculus.mq.md b/examples/oa2026-showcase/calculus.mq.md index 9d6ea65..6f09933 100644 --- a/examples/oa2026-showcase/calculus.mq.md +++ b/examples/oa2026-showcase/calculus.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 一份可执行的求导讲义 description: 公式、求导、求根、求值与绘图,在同一条叙述里完成。 import: diff --git a/examples/quantum-bell/index.mq.md b/examples/quantum-bell/index.mq.md index e6c4b93..69eeb16 100644 --- a/examples/quantum-bell/index.mq.md +++ b/examples/quantum-bell/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Bell state description: H then CX; probabilities ≈ 1/2; circuit SVG. import: diff --git a/examples/quantum-entanglement/index.mq.md b/examples/quantum-entanglement/index.mq.md index b1d6411..c020da3 100644 --- a/examples/quantum-entanglement/index.mq.md +++ b/examples/quantum-entanglement/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Entanglement lab description: Bell state — density, partial trace, Schmidt, themed SVG (Q7/Q8). import: @@ -31,7 +32,7 @@ Build |Φ⁺⟩ with H then CX. Full-state purity stays 1; tracing out one qubit **ezz = > `qc`.expect obs=`zz`** **sch = > `qc`.schmidt cut=1** -**ent = [entropy](sch)** +**ent = [entropy](access(sch, "entropy"))** **_ = > `qc`.draw path="entangle-circuit.svg" theme="dark"** **_ = > `qc`.draw kind="hinton" path="entangle-hinton.svg"** diff --git a/examples/quantum-ghz/index.mq.md b/examples/quantum-ghz/index.mq.md index 4eb3c82..7b5d023 100644 --- a/examples/quantum-ghz/index.mq.md +++ b/examples/quantum-ghz/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: GHZ state description: 3-qubit GHZ; |000⟩/|111⟩ ≈ 1/2; probs + H matrix heatmap. import: diff --git a/examples/web-client-site/index.mq.md b/examples/web-client-site/index.mq.md index 71a4d30..f284088 100644 --- a/examples/web-client-site/index.mq.md +++ b/examples/web-client-site/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: web title: Marqdo client site route: / diff --git a/examples/web-client-site/serve.mq.md b/examples/web-client-site/serve.mq.md index b518a9f..1736a9e 100644 --- a/examples/web-client-site/serve.mq.md +++ b/examples/web-client-site/serve.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web-client-site serve import: web: ext/web/web.mq.md diff --git a/examples/web-client-site/static/client.mq.md b/examples/web-client-site/static/client.mq.md index fe87215..929618f 100644 --- a/examples/web-client-site/static/client.mq.md +++ b/examples/web-client-site/static/client.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: client counter (route D) description: wired by client_embed auto-mount; GFM + lib/browser import: diff --git a/examples/web-collab-doc/index.mq.md b/examples/web-collab-doc/index.mq.md index fb1a756..c90e9fc 100644 --- a/examples/web-collab-doc/index.mq.md +++ b/examples/web-collab-doc/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web-collab-doc description: Two-browser collaborative plain-text editor over WS room (LWW snapshot sync) import: diff --git a/examples/web-collab-doc/static/client.mq.md b/examples/web-collab-doc/static/client.mq.md index f2e4481..816348f 100644 --- a/examples/web-collab-doc/static/client.mq.md +++ b/examples/web-collab-doc/static/client.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: collab client description: LWW text sync over WS room + presence (DOC\\t protocol) import: diff --git a/examples/web-net-site-zh/components/foot.mq.md b/examples/web-net-site-zh/components/foot.mq.md index 6d65a2d..b176732 100644 --- a/examples/web-net-site-zh/components/foot.mq.md +++ b/examples/web-net-site-zh/components/foot.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 页脚 `页脚` = diff --git a/examples/web-net-site-zh/components/nav.mq.md b/examples/web-net-site-zh/components/nav.mq.md index ef97d93..d03b57a 100644 --- a/examples/web-net-site-zh/components/nav.mq.md +++ b/examples/web-net-site-zh/components/nav.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 导航 站点顶部导航。`后台` 指向需要登录的 `/admin`。 diff --git a/examples/web-net-site-zh/components/side.mq.md b/examples/web-net-site-zh/components/side.mq.md index 0b83f3a..2cd0971 100644 --- a/examples/web-net-site-zh/components/side.mq.md +++ b/examples/web-net-site-zh/components/side.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 侧栏 本示例展示了哪些特性。 diff --git a/examples/web-net-site-zh/db/articles.mq.md b/examples/web-net-site-zh/db/articles.mq.md index b8b6ae7..7beebcf 100644 --- a/examples/web-net-site-zh/db/articles.mq.md +++ b/examples/web-net-site-zh/db/articles.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 结构 `字段` = diff --git a/examples/web-net-site-zh/db/index.mq.md b/examples/web-net-site-zh/db/index.mq.md index e1af68d..1b4c189 100644 --- a/examples/web-net-site-zh/db/index.mq.md +++ b/examples/web-net-site-zh/db/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: db/index description: 打开 sqlite、建表、幂等种子。 导入: diff --git a/examples/web-net-site-zh/index.mq.md b/examples/web-net-site-zh/index.mq.md index b7b56c4..120e732 100644 --- a/examples/web-net-site-zh/index.mq.md +++ b/examples/web-net-site-zh/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 网络扩展站(中文) description: 首页 + /about + /new(表单)+ /tools(lib/net)+ /admin(登录鉴权)+ /live(WebSocket)。 导入: @@ -56,18 +57,18 @@ description: 首页 + /about + /new(表单)+ /tools(lib/net)+ /admin( **解析请求 = > net.解析Cookie 内容="session=abc123; theme=dark"** -**请求块 = [1](解析请求)** +**请求块 = [1](access(解析请求, "1"))** **解析响应 = > net.解析Cookie 内容="id=42; Path=/; HttpOnly; SameSite=Lax" 是响应头=True** -**响应块 = [1](解析响应)** +**响应块 = [1](access(解析响应, "1"))** `边界` = ----b `正文` = "--`边界`\nContent-Disposition: form-data; name=\"title\"\n\n你好\n--`边界`\nContent-Disposition: form-data; name=\"封面\"; filename=\"pic.png\"\nContent-Type: image/png\n\n<字节>\n--`边界`--\n" **多部分 = > net.解析多部分 正文=`正文` 边界=`边界`** -**字段块 = [1](多部分)** -**文件块 = [2](多部分)** +**字段块 = [1](access(多部分, "1"))** +**文件块 = [2](access(多部分, "2"))** `工具段` = diff --git a/examples/web-net-site-zh/styles/shell.mq.md b/examples/web-net-site-zh/styles/shell.mq.md index 791e491..ea8d88a 100644 --- a/examples/web-net-site-zh/styles/shell.mq.md +++ b/examples/web-net-site-zh/styles/shell.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## 顶栏 `顶栏` = diff --git a/examples/web-net-site/components/foot.mq.md b/examples/web-net-site/components/foot.mq.md index 3fd1df0..5cf5167 100644 --- a/examples/web-net-site/components/foot.mq.md +++ b/examples/web-net-site/components/foot.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## foot `foot` = diff --git a/examples/web-net-site/components/nav.mq.md b/examples/web-net-site/components/nav.mq.md index 4bd502a..fda9f11 100644 --- a/examples/web-net-site/components/nav.mq.md +++ b/examples/web-net-site/components/nav.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## nav Site top navigation. The Admin tab points at the login-gated admin page. diff --git a/examples/web-net-site/components/side.mq.md b/examples/web-net-site/components/side.mq.md index c14038f..d294b80 100644 --- a/examples/web-net-site/components/side.mq.md +++ b/examples/web-net-site/components/side.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## side Sidebar index of what this example demonstrates. diff --git a/examples/web-net-site/db/articles.mq.md b/examples/web-net-site/db/articles.mq.md index d0da7bb..5484078 100644 --- a/examples/web-net-site/db/articles.mq.md +++ b/examples/web-net-site/db/articles.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## schema `fields` = diff --git a/examples/web-net-site/db/index.mq.md b/examples/web-net-site/db/index.mq.md index 80b4209..74eb540 100644 --- a/examples/web-net-site/db/index.mq.md +++ b/examples/web-net-site/db/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: db/index description: Open sqlite, init articles, seed once. import: diff --git a/examples/web-net-site/index.mq.md b/examples/web-net-site/index.mq.md index 7eceec5..df40a1d 100644 --- a/examples/web-net-site/index.mq.md +++ b/examples/web-net-site/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web-net-site description: Home + /about + /new (form) + /tools (net lib) + /admin (auth) + /live (WebSocket). import: @@ -47,12 +48,12 @@ About page: same shell. Parse a `Cookie` request header with the standard library. **parsed_req = > net.cookie_parse text="session=abc123; theme=dark"** -**req_cookie = [1](parsed_req)** +**req_cookie = [1](access(parsed_req, "1"))** Parse a `Set-Cookie` response header. **parsed_resp = > net.cookie_parse text="id=42; Path=/; HttpOnly; SameSite=Lax" is_response=True** -**resp_cookie = [1](parsed_resp)** +**resp_cookie = [1](access(parsed_resp, "1"))** Parse a `multipart/form-data` body. @@ -61,8 +62,8 @@ Parse a `multipart/form-data` body. `_body` = "--`_b`\nContent-Disposition: form-data; name=\"title\"\n\nHello\n--`_b`\nContent-Disposition: form-data; name=\"cover\"; filename=\"pic.png\"\nContent-Type: image/png\n\n\n--`_b`--\n" **mp = > net.multipart_parse body=`_body` boundary=`_b`** -**mp_title = [1](mp)** -**mp_cover = [2](mp)** +**mp_title = [1](access(mp, "1"))** +**mp_cover = [2](access(mp, "2"))** Build the tools page as one HTML intro (intro is served raw). diff --git a/examples/web-net-site/styles/shell.mq.md b/examples/web-net-site/styles/shell.mq.md index 83bc026..5a665b8 100644 --- a/examples/web-net-site/styles/shell.mq.md +++ b/examples/web-net-site/styles/shell.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## topnav `topnav` = diff --git a/examples/web-site-zh/components/desk.mq.md b/examples/web-site-zh/components/desk.mq.md index 5413714..5b220ef 100644 --- a/examples/web-site-zh/components/desk.mq.md +++ b/examples/web-site-zh/components/desk.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: components/desk description: 管理台壳 — 顶栏品牌为「后台」,无前台侧栏。 --- diff --git a/examples/web-site-zh/components/foot.mq.md b/examples/web-site-zh/components/foot.mq.md index 9b8e39b..db15bd8 100644 --- a/examples/web-site-zh/components/foot.mq.md +++ b/examples/web-site-zh/components/foot.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## foot `foot` = diff --git a/examples/web-site-zh/components/nav.mq.md b/examples/web-site-zh/components/nav.mq.md index 46dc894..6bd8ecc 100644 --- a/examples/web-site-zh/components/nav.mq.md +++ b/examples/web-site-zh/components/nav.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## nav 顶栏:**登录**(访客)/ **后台** + **退出**(已登录)。 diff --git a/examples/web-site-zh/components/side.mq.md b/examples/web-site-zh/components/side.mq.md index 29a96e6..b6bdf78 100644 --- a/examples/web-site-zh/components/side.mq.md +++ b/examples/web-site-zh/components/side.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## side `side` = diff --git a/examples/web-site-zh/db/articles.mq.md b/examples/web-site-zh/db/articles.mq.md index 6619d2e..6c063b3 100644 --- a/examples/web-site-zh/db/articles.mq.md +++ b/examples/web-site-zh/db/articles.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## schema `fields` = diff --git a/examples/web-site-zh/db/index.mq.md b/examples/web-site-zh/db/index.mq.md index e8a0121..60f7971 100644 --- a/examples/web-site-zh/db/index.mq.md +++ b/examples/web-site-zh/db/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: db/index description: 打开 sqlite、建表、幂等种子。 导入: diff --git a/examples/web-site-zh/index.mq.md b/examples/web-site-zh/index.mq.md index 5d3dee4..f52884e 100644 --- a/examples/web-site-zh/index.mq.md +++ b/examples/web-site-zh/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中文站点示例 description: >- 与 examples/web-site 对等的 WWW Demo 样站:表驱动全站;作者业务 JS=0;作者 .css=0。 diff --git a/examples/web-site-zh/styles/shell.mq.md b/examples/web-site-zh/styles/shell.mq.md index b9512e5..0342f1a 100644 --- a/examples/web-site-zh/styles/shell.mq.md +++ b/examples/web-site-zh/styles/shell.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: styles/shell description: >- Literary dark theme for examples/web-site — ink / wine / gold after the diff --git a/examples/web-site/components/desk.mq.md b/examples/web-site/components/desk.mq.md index e21f59c..ef726b0 100644 --- a/examples/web-site/components/desk.mq.md +++ b/examples/web-site/components/desk.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: components/desk description: Admin desk chrome — brand reads Admin; no public side rail. --- diff --git a/examples/web-site/components/foot.mq.md b/examples/web-site/components/foot.mq.md index 8cb6d3a..442c67e 100644 --- a/examples/web-site/components/foot.mq.md +++ b/examples/web-site/components/foot.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## foot `foot` = diff --git a/examples/web-site/components/nav.mq.md b/examples/web-site/components/nav.mq.md index 92461b7..39c199d 100644 --- a/examples/web-site/components/nav.mq.md +++ b/examples/web-site/components/nav.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## nav Brand first, then demo routes. Guest sees **Login**; signed-in sees **Admin** + **Logout**. diff --git a/examples/web-site/components/side.mq.md b/examples/web-site/components/side.mq.md index 5321ff7..fdbcf78 100644 --- a/examples/web-site/components/side.mq.md +++ b/examples/web-site/components/side.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## side Hands-on demo checklist (links only — no JS). diff --git a/examples/web-site/db/articles.mq.md b/examples/web-site/db/articles.mq.md index adec292..89788b8 100644 --- a/examples/web-site/db/articles.mq.md +++ b/examples/web-site/db/articles.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## schema `fields` = diff --git a/examples/web-site/db/index.mq.md b/examples/web-site/db/index.mq.md index d56deb8..3b5731e 100644 --- a/examples/web-site/db/index.mq.md +++ b/examples/web-site/db/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: db/index description: Open sqlite, init articles, seed once. import: diff --git a/examples/web-site/index.mq.md b/examples/web-site/index.mq.md index 2045b01..f837f8a 100644 --- a/examples/web-site/index.mq.md +++ b/examples/web-site/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web-site description: >- WWW Demo sample — GFM tables for shell, schema, forms, styles, and admin. diff --git a/examples/web-site/styles/shell.mq.md b/examples/web-site/styles/shell.mq.md index 2ecbec7..a37d333 100644 --- a/examples/web-site/styles/shell.mq.md +++ b/examples/web-site/styles/shell.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: styles/shell description: >- Literary dark theme for examples/web-site — ink / wine / gold after the diff --git a/examples/web-spa-app/index.mq.md b/examples/web-spa-app/index.mq.md index bc60a68..7c9856a 100644 --- a/examples/web-spa-app/index.mq.md +++ b/examples/web-spa-app/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web-spa-app description: Native Marqdo SPA — list/detail/edit via WASM client routes + memory store import: diff --git a/examples/web-tenant-saas/index.mq.md b/examples/web-tenant-saas/index.mq.md index b846c8e..fedb4c8 100644 --- a/examples/web-tenant-saas/index.mq.md +++ b/examples/web-tenant-saas/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web-tenant-saas demo description: Dual-tenant isolation via ?t= query + tenant_scope JSON API. import: diff --git a/examples/web-ws-room/index.mq.md b/examples/web-ws-room/index.mq.md index 0449f41..9ea9768 100644 --- a/examples/web-ws-room/index.mq.md +++ b/examples/web-ws-room/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web-ws-room demo description: Dynamic room WS with presence (G-WS1/2 bag). Open / and connect via bridge or wscat. import: diff --git a/ext/ai/agent.mq.md b/ext/ai/agent.mq.md index 0973755..cfcab6c 100644 --- a/ext/ai/agent.mq.md +++ b/ext/ai/agent.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/ai/agent description: Document-driven agent v2 — step / plan / run; Skill Compilation via ABI plugin (episodes → learn → llm_free). import: @@ -139,7 +140,7 @@ Find a human-readable call line: `CALL:` or `调用:` / `调用: split value=`text` sep=`nl`** **found = None** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) **t = > trim value=`line`** **parts = > split value=`t` sep=":"** **n = > len value=`parts`** @@ -245,7 +246,7 @@ Structured observation for the parent developer-agent: source, named writeback s **last_ok = None** **last_error = None** -- [`slot`](`slots`) +- [slot](遍历 `slots` 为 `slot`) **k = > json.get value=`slot` key="key"** **body = > json.get value=`slot` key="body"** 1. `k` == "ok" @@ -407,7 +408,7 @@ With `sandbox=True`, run via `## trial` first (commit on ok); host unchanged unt **acc = > table.empty_list** **chars = 0** **count = 0** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) 1. `count` < `max_lines` **ln = > len value=`line`** **next = chars + ln** @@ -441,7 +442,7 @@ With `sandbox=True`, run via `## trial` first (commit on ok); host unchanged unt **acc = > table.empty_list** **i = 0** **chars = 0** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) 1. `i` >= `start` **ln = > len value=`line`** **next = chars + ln** @@ -468,7 +469,7 @@ Drop `` blocks (including marqdo-out bodies) so parent excerpts stay **lines = > split value=`raw` sep=`nl`** **acc = > table.empty_list** **skip = None** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) 1. `skip` **end_parts = > split value=`line` sep="-->"** **en = > len value=`end_parts`** @@ -719,7 +720,7 @@ Parse `ARGS:{…}` JSON line, or a bare `{…}` line after CALL. **text = > trim value=`reply`** **lines = > split value=`text` sep=`nl`** **found = None** - - [`line`](`lines`) + - [line](遍历 `lines` 为 `line`) 1. `found` **_ = 1** 2. * @@ -909,7 +910,7 @@ Parse READ:source|stderr|stdout|slots|skill (Chinese: 读取:…). **text = > trim value=`reply`** **lines = > split value=`text` sep=`nl`** **found = None** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) **t = > trim value=`line`** **parts = > split value=`t` sep=":"** **n = > len value=`parts`** @@ -1005,7 +1006,7 @@ Parse NAME: id plus a triple-angle body after CALL:scratch_tool_write. **name = None** **body_lines = > table.empty_list** **in_body = None** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) 1. `in_body` **t = > trim value=`line`** 1. `t` == `close` @@ -1231,7 +1232,7 @@ Bounded observation for the parent prompt (actionable, short). **slots_brief = > table.empty_list** 1. `obs_slots` - - [`slot`](`obs_slots`) + - [slot](遍历 `obs_slots` 为 `slot`) **sk = > json.get value=`slot` key="key"** **sl = > json.get value=`slot` key="line"** **sb = > json.get value=`slot` key="body"** @@ -1296,7 +1297,7 @@ First matching DECISION / 决定 line wins (ignore later conflicting decisions i **lines = > split value=`text` sep=`nl`** **found = None** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) 1. `found` **_ = 1** 2. * @@ -1368,7 +1369,7 @@ Parse `SLUG: …` / `标识:…` after a soft-match REUSE decision. **lines = > split value=`text` sep=`nl`** **found = None** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) **t = > trim value=`line`** **parts = > split value=`t` sep=":"** **n = > len value=`parts`** @@ -1420,7 +1421,7 @@ Short parent prompt: REUSE+SLUG or NEW only. Candidates may include lexical `sco **st = > json.get value=`esc` key="st"** **lf = > json.get value=`esc` key="lf"** **lines = > table.empty_list** -- [`t`](`tasks`) +- [t](遍历 `tasks` 为 `t`) **slug = > json.get value=`t` key="slug"** **title = > json.get value=`t` key="title"** **row = slug + sep + title** @@ -1469,7 +1470,7 @@ First `SUMMARY:` / `汇总:` / `汇总:` line body, else trimmed reply. **lines = > split value=`text` sep=`nl`** **found = None** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) **t = > trim value=`line`** **parts = > split value=`t` sep=":"** **n = > len value=`parts`** @@ -1793,7 +1794,7 @@ Always append a `decision` event. SSE publish only when `stream=True`. Bubble parent `complete stream=True` reasoning/deltas (and errors) into the plan event list. Skip nested `done` so plan owns the final `done`. Always merge into `events` when present; `stream` reserved for callers that also SSE-publish upstream. -- [`ev`](`from`) +- [ev](遍历 `from` 为 `ev`) **t = > json.get value=`ev` key="type"** 1. `t` == delta **events = > table.append list=`events` item=`ev`** diff --git a/ext/ai/llm.mq.md b/ext/ai/llm.mq.md index 392d5a8..a5e5272 100644 --- a/ext/ai/llm.mq.md +++ b/ext/ai/llm.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/ai/llm description: >- Marqdo LLM intelligence primitive — ask / stream / collect / named handles. @@ -26,7 +27,7 @@ Collapse a stream event list to final answer text (`done.result` or `error.messa **answer = ""** -- [ev](events) +- [ev](遍历 events 为 ev) **t = > json.get value=`ev` key="type"** 1. `t` == "done" **answer = > json.get value=`ev` key="result"** @@ -357,7 +358,7 @@ Semantic stream: return the event list (use `llm.collect` to reduce to text). Om Transport pack via `ext/ai/llm/openai` (Ollama uses the same OpenAI-compatible path). Non-stream → `{text,usage,finish}`; stream → `{events}`. -*> openai.chat_completions base_url=[base_url](self) api_key=[api_key](self) model=[model](self) prompt=`prompt` stream=`stream` echo=`echo` suffix=[suffix](self) bearer=[bearer](self)* +*> openai.chat_completions base_url=[base_url](access(self, "base_url")) api_key=[api_key](access(self, "api_key")) model=[model](access(self, "model")) prompt=`prompt` stream=`stream` echo=`echo` suffix=[suffix](access(self, "suffix")) bearer=[bearer](access(self, "bearer"))* ## complete + `prompt` diff --git a/ext/ai/llm/ollama.mq.md b/ext/ai/llm/ollama.mq.md index 18cf1f3..7778331 100644 --- a/ext/ai/llm/ollama.mq.md +++ b/ext/ai/llm/ollama.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/ai/llm/ollama description: >- Ollama backend defaults. Transport reuses openai-compatible /v1 chat completions. diff --git a/ext/ai/policies/step-route.mq.md b/ext/ai/policies/step-route.mq.md index defe152..6db848c 100644 --- a/ext/ai/policies/step-route.mq.md +++ b/ext/ai/policies/step-route.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: step-route policy (O3) description: > Table-driven map from step class → Adaptive Routing backend. diff --git a/ext/ai/大模型.mq.md b/ext/ai/大模型.mq.md index 86cca78..82563cf 100644 --- a/ext/ai/大模型.mq.md +++ b/ext/ai/大模型.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/ai/大模型 description: >- Marqdo 大模型智能原语 — 提问 / 流式 / 收集 / 命名句柄。 @@ -21,15 +22,15 @@ description: >- **answer = ""** -- [ev](事件) - **t = [type](ev)** +- [ev](遍历 事件 为 ev) + **t = [type](access(ev, "type"))** 1. `t` == "done" - **answer = [result](ev)** + **answer = [result](access(ev, "result"))** 2. `t` == "error" - **answer = [message](ev)** + **answer = [message](access(ev, "message"))** 3. `t` == "delta" 4. `t` == "text" - **chunk = [text](ev)** + **chunk = [text](access(ev, "text"))** 1. `chunk` **answer = answer + chunk** 2. * @@ -142,7 +143,7 @@ description: >- **m = > 创建 模型=`模型` 基址=`基址` 密钥=`密钥`** **r = > m.提问 提示=`p`** -*[text](r)* +*[text](access(r, "text"))* # 大模型 + `模型`=None @@ -243,10 +244,10 @@ description: >- 表单元格会遮蔽 `自` / 列名,先取出字段再组结果表。 -**mdl = [model](自)** -**b = [backend](自)** -**nm = [name](自)** -**tt = [total_tokens](usage)** +**mdl = [model](access(自, "model"))** +**b = [backend](access(自, "backend"))** +**nm = [name](access(自, "name"))** +**tt = [total_tokens](access(usage, "total_tokens"))** `result` = @@ -276,7 +277,7 @@ description: >- + `流式`=False + `打印增量`=False -*> openai.chat_completions base_url=[base_url](自) api_key=[api_key](自) model=[model](自) prompt=`提示` stream=`流式` echo=`打印增量` suffix=[suffix](自) bearer=[bearer](自)* +*> openai.chat_completions base_url=[base_url](access(自, "base_url")) api_key=[api_key](access(自, "api_key")) model=[model](access(自, "model")) prompt=`提示` stream=`流式` echo=`打印增量` suffix=[suffix](access(自, "suffix")) bearer=[bearer](access(自, "bearer"))* ## 运行 + `提示` @@ -285,10 +286,10 @@ description: >- 1. `流式` **pack = > 自.完整结果 提示=`提示` 流式=True 打印增量=`打印增量`** - *[events](pack)* + *[events](access(pack, "events"))* 2. * **pack = > 自.完整结果 提示=`提示` 流式=False 打印增量=`打印增量`** - *[text](pack)* + *[text](access(pack, "text"))* ## 聊天 + `提示` diff --git a/ext/ai/智能体.mq.md b/ext/ai/智能体.mq.md index 1a856f7..ec468ed 100644 --- a/ext/ai/智能体.mq.md +++ b/ext/ai/智能体.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/ai/智能体 description: 文档驱动智能体 v2 — 单步 / 多步 / 运行;技能编译经 ABI v2 agent 插件(情景 → 学习 → llm_free)。 导入: @@ -38,7 +39,7 @@ description: 文档驱动智能体 v2 — 单步 / 多步 / 运行;技能编 **lines = > split value=`text` sep=`nl`** **found = 空** -- [`line`](`lines`) +- [line](遍历 `lines` 为 `line`) **t = > trim value=`line`** **parts = > split value=`t` sep=:** **n = > len value=`parts`** diff --git a/ext/ai/沙盒.mq.md b/ext/ai/沙盒.mq.md index 5f434c8..45f9bac 100644 --- a/ext/ai/沙盒.mq.md +++ b/ext/ai/沙盒.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/ai/沙盒 description: >- AI 试跑 CoW 工作区:打开 / 运行 / 差异 / 提交(中文面,委托英文 sandbox 模块)。 diff --git a/ext/linalg/linalg.mq.md b/ext/linalg/linalg.mq.md index 1aa3a0e..b0aeeef 100644 --- a/ext/linalg/linalg.mq.md +++ b/ext/linalg/linalg.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/linalg/linalg description: Formula-first linear algebra (English). MatExpr simplify + display; ABI plugin. import: diff --git a/ext/linalg/线性代数.mq.md b/ext/linalg/线性代数.mq.md index d8747d4..a61c632 100644 --- a/ext/linalg/线性代数.mq.md +++ b/ext/linalg/线性代数.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/linalg/线性代数 description: 公式优先的线性代数(中文)。矩阵表达式化简与展示;ABI 插件。 import: diff --git a/ext/net/http.mq.md b/ext/net/http.mq.md index 2500e61..36cf1ad 100644 --- a/ext/net/http.mq.md +++ b/ext/net/http.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/net/http description: HTTP primitives surface for Web Runtime (ADR 0007). Prefer Document/Endpoint Artifacts over raw calls. import: diff --git a/ext/net/url.mq.md b/ext/net/url.mq.md index 8e555f9..fe4dfec 100644 --- a/ext/net/url.mq.md +++ b/ext/net/url.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/net/url description: URL helpers (stdlib wrappers). ADR 0007. import: diff --git a/ext/quantum/quantum.mq.md b/ext/quantum/quantum.mq.md index d3c8232..292bb99 100644 --- a/ext/quantum/quantum.mq.md +++ b/ext/quantum/quantum.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/quantum/quantum description: Official quantum circuit simulator (English). Gates + circuits; ABI plugin. import: diff --git a/ext/quantum/量子.mq.md b/ext/quantum/量子.mq.md index f471ce6..ae11768 100644 --- a/ext/quantum/量子.mq.md +++ b/ext/quantum/量子.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/quantum/量子 description: 官方量子电路模拟(中文)。门 + 电路;ABI 插件。 import: diff --git a/ext/security/oidc.mq.md b/ext/security/oidc.mq.md index f06a15c..8864ae3 100644 --- a/ext/security/oidc.mq.md +++ b/ext/security/oidc.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/security/oidc description: OIDC attach helper for app handles (ADR 0007). Prefer declared auth metadata on Endpoints. import: diff --git a/ext/security/rbac.mq.md b/ext/security/rbac.mq.md index a9ed2f3..6e0a732 100644 --- a/ext/security/rbac.mq.md +++ b/ext/security/rbac.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/security/rbac description: RBAC Resource (ADR 0007). import: diff --git a/ext/web/_capability.mq.md b/ext/web/_capability.mq.md index 5a99d13..617f2cd 100644 --- a/ext/web/_capability.mq.md +++ b/ext/web/_capability.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/_capability description: Internal — load native web plugin once. Authors must not call this; import web = capability (ADR 0007). import: diff --git a/ext/web/client.mq.md b/ext/web/client.mq.md index d0da3bd..c0245b1 100644 --- a/ext/web/client.mq.md +++ b/ext/web/client.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/client description: Browser Runtime helpers (WASM bridge). Prefer lib/browser for effect tables (ADR 0007). import: diff --git a/ext/web/component.mq.md b/ext/web/component.mq.md index 1e78926..e80203c 100644 --- a/ext/web/component.mq.md +++ b/ext/web/component.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/component description: Reusable Document fragments as View node tables (ADR 0007). import: diff --git a/ext/web/dom.mq.md b/ext/web/dom.mq.md index e39c65e..aef8237 100644 --- a/ext/web/dom.mq.md +++ b/ext/web/dom.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/dom description: DOM Artifact — Markdown/body to structure; raw HTML is escape hatch only (ADR 0007). import: @@ -30,10 +31,10 @@ Escape hatch — wrap a raw HTML string. Prefer Markdown / View nodes. Render a DOM Artifact (markdown or raw) to HTML via native plugin. > cap.load -**kind = [kind](dom)** +**kind = [kind](access(dom, "kind"))** 1. `kind` == "raw" - **html = [html](dom)** + **html = [html](access(dom, "html"))** *html* 2. * - **text = [text](dom)** + **text = [text](access(dom, "text"))** *> web_dom_markdown text=`text`* diff --git a/ext/web/page.mq.md b/ext/web/page.mq.md index 7954ef7..d3c1383 100644 --- a/ext/web/page.mq.md +++ b/ext/web/page.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/page description: Document → View. Sole compose path is render(nodes=) with unified View schema (ADR 0007). import: @@ -37,13 +38,13 @@ Render Document to HTML. `nodes` is the unified View table; when omitted, uses ` > cap.load **n = nodes** 1. `n` == None - **n = [nodes](self)** + **n = [nodes](access(self, "nodes"))** 2. * **_ = 1** 1. `n` *> web_render_nodes page=`self` nodes=`n` db=`db`* 2. * - **body = [body](self)** + **body = [body](access(self, "body"))** *> web_render_document page=`self` body=`body` db=`db`* ## css diff --git a/ext/web/route.mq.md b/ext/web/route.mq.md index 6215d48..b782f45 100644 --- a/ext/web/route.mq.md +++ b/ext/web/route.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/route description: Declared Endpoint / Document route registration (ADR 0007). import: @@ -43,19 +44,19 @@ Register this declared route on an app handle. > cap.load **a = app** 1. `a` == None - **a = [app](self)** + **a = [app](access(self, "app"))** 2. * **_ = 1** -**page = [page](self)** -**fn = [fn](self)** +**page = [page](access(self, "page"))** +**fn = [fn](access(self, "fn"))** 1. `page` - **path = [path](self)** + **path = [path](access(self, "path"))** *> web_app_route app=`a` path=`path` page=`page`* 2. `fn` - **path = [path](self)** - **method = [method](self)** - **request = [request](self)** - **response = [response](self)** + **path = [path](access(self, "path"))** + **method = [method](access(self, "method"))** + **request = [request](access(self, "request"))** + **response = [response](access(self, "response"))** *> web_app_invoke app=`a` path=`path` method=`method` fn=`fn` body=`request` return=`response`* 3. * *> table.put in=None at="ok" value=False* diff --git a/ext/web/web.mq.md b/ext/web/web.mq.md index b3eef6d..2e5cfdd 100644 --- a/ext/web/web.mq.md +++ b/ext/web/web.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/web description: >- Web Artifact facade (ADR 0007) — page · route · serve · render · inspect · use. diff --git a/ext/web/网页.mq.md b/ext/web/网页.mq.md index 624ff8d..4de037a 100644 --- a/ext/web/网页.mq.md +++ b/ext/web/网页.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/web/网页 description: >- Web Artifact 中文 facade(ADR 0007)— 页面 · 路由 · 服务 · 渲染 · 检视 · 使用。 diff --git a/lib/browser.mq.md b/lib/browser.mq.md index 3512742..a8e9fb4 100644 --- a/lib/browser.mq.md +++ b/lib/browser.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/browser description: >- Readable browser effect helpers for WASM clients. Prefer GFM tables + these diff --git a/lib/cli.mq.md b/lib/cli.mq.md index 9eadcbb..c6b673f 100644 --- a/lib/cli.mq.md +++ b/lib/cli.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/cli description: Parse argv flags (Mid M5). --key value / --key=value / --flag; positionals under _. --- diff --git a/lib/csv.mq.md b/lib/csv.mq.md index ee94ba9..a0793fd 100644 --- a/lib/csv.mq.md +++ b/lib/csv.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/csv description: RFC4180-ish CSV parse/stringify (Mid M4). First row = headers → list of maps. --- diff --git a/lib/datetime.mq.md b/lib/datetime.mq.md index 28edc5f..9c8a25c 100644 --- a/lib/datetime.mq.md +++ b/lib/datetime.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/datetime description: Calendar moments as maps {unix, zone, iso} (Mid2 M7). Fixed offsets + a few IANA aliases. --- diff --git a/lib/encoding.mq.md b/lib/encoding.mq.md index b723e20..f81bf4a 100644 --- a/lib/encoding.mq.md +++ b/lib/encoding.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/encoding description: Base64, hex, and base32 encode/decode (Mid M1 + Mid2 M8). UTF-8 text round-trip. --- diff --git a/lib/foreign.mq.md b/lib/foreign.mq.md index 09010a5..98f76c5 100644 --- a/lib/foreign.mq.md +++ b/lib/foreign.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/foreign description: Run bound code fences and inline sources via local interpreters import: diff --git a/lib/fs.mq.md b/lib/fs.mq.md index 0056c27..cb771be 100644 --- a/lib/fs.mq.md +++ b/lib/fs.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/fs description: English filesystem wrappers --- diff --git a/lib/hash.mq.md b/lib/hash.mq.md index 67fc11c..aae98f7 100644 --- a/lib/hash.mq.md +++ b/lib/hash.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/hash description: Digests and HMAC (Mid M3). Integrity / cache keys — not password hashing. --- diff --git a/lib/html.mq.md b/lib/html.mq.md index 2835a74..5f85d45 100644 --- a/lib/html.mq.md +++ b/lib/html.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/html description: HTML escape / unescape (Mid2 M8). XSS floor for string assembly. --- diff --git a/lib/json.mq.md b/lib/json.mq.md index 380012c..49c6b88 100644 --- a/lib/json.mq.md +++ b/lib/json.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/json description: JSON parse/stringify (shared EN/ZH import). Not a dict builder — use lib/table. --- diff --git a/lib/log.mq.md b/lib/log.mq.md index 4592040..6251276 100644 --- a/lib/log.mq.md +++ b/lib/log.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/log description: Level-filtered one-line logs (Mid M6 + Mid2 M10 fields). Default level info. --- diff --git a/lib/math.mq.md b/lib/math.mq.md index 7f6a036..9896ba6 100644 --- a/lib/math.mq.md +++ b/lib/math.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/math description: High-school math — num, random, formula, plot --- diff --git a/lib/net.mq.md b/lib/net.mq.md index 212a410..88cc939 100644 --- a/lib/net.mq.md +++ b/lib/net.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/net description: English HTTP(S) wrappers. Optional headers / content_type via host aliases. --- diff --git a/lib/path.mq.md b/lib/path.mq.md index 0cf231d..b2f1a03 100644 --- a/lib/path.mq.md +++ b/lib/path.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/path description: Path algebra (Mid M2). No I/O; OS separators. --- diff --git a/lib/plugin.mq.md b/lib/plugin.mq.md index 38708c9..3bb13fb 100644 --- a/lib/plugin.mq.md +++ b/lib/plugin.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/plugin description: Load optional native ABI plugins (.dll / .so / .dylib) --- diff --git a/lib/re.mq.md b/lib/re.mq.md index 1897ba4..1282c4c 100644 --- a/lib/re.mq.md +++ b/lib/re.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/re description: Regular expressions (Mid M1). Unicode; no backreferences. --- diff --git a/lib/secrets.mq.md b/lib/secrets.mq.md index fb0ed3b..68c4aea 100644 --- a/lib/secrets.mq.md +++ b/lib/secrets.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/secrets description: Cryptographic tokens (Mid M3). Do not use math.random for secrets. --- diff --git a/lib/stats.mq.md b/lib/stats.mq.md index 205bc31..23e7c46 100644 --- a/lib/stats.mq.md +++ b/lib/stats.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/stats description: Thin mean / median / sample stdev (Mid2 M10). Not a dataframe library. --- diff --git a/lib/subtask.mq.md b/lib/subtask.mq.md index 271a176..069a7f7 100644 --- a/lib/subtask.mq.md +++ b/lib/subtask.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/subtask description: Concurrent subtasks — file, function, or foreign code --- diff --git a/lib/sys.mq.md b/lib/sys.mq.md index b3895b7..1d2c524 100644 --- a/lib/sys.mq.md +++ b/lib/sys.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/sys description: English system wrappers (load_dotenv accepts optional path via host alias) --- diff --git a/lib/table.mq.md b/lib/table.mq.md index 4538531..2a29afa 100644 --- a/lib/table.mq.md +++ b/lib/table.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/table description: >- List and map helpers. Prefer put (1-based path, same nesting as link-index get); diff --git a/lib/text.mq.md b/lib/text.mq.md index 8bbbb5d..32c211e 100644 --- a/lib/text.mq.md +++ b/lib/text.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/text description: Text helpers (Mid M4). Literal replace — use lib/re for regex. --- diff --git a/lib/time.mq.md b/lib/time.mq.md index fab39f3..0fd6fe5 100644 --- a/lib/time.mq.md +++ b/lib/time.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/time description: English time wrappers --- diff --git a/lib/toml.mq.md b/lib/toml.mq.md index ed85028..b5ba000 100644 --- a/lib/toml.mq.md +++ b/lib/toml.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/toml description: Read-only TOML subset parse (Mid2 M8). Tables, scalars, arrays; no array-of-tables. --- diff --git a/lib/url.mq.md b/lib/url.mq.md index 087a7d3..79b4a05 100644 --- a/lib/url.mq.md +++ b/lib/url.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/url description: Parse URLs and query strings (Mid2 M7). Segment encoding stays in net.url_encode. --- diff --git a/lib/uuid.mq.md b/lib/uuid.mq.md index f8e8ade..58b0797 100644 --- a/lib/uuid.mq.md +++ b/lib/uuid.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/uuid description: UUID v4 (Mid M6). Cryptographic random via getrandom. --- diff --git a/lib/writeback.mq.md b/lib/writeback.mq.md index bccbd6e..118b4b6 100644 --- a/lib/writeback.mq.md +++ b/lib/writeback.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/writeback description: Persist run output in .mq.md (Jupyter-style writeback) --- diff --git a/lib/命令行.mq.md b/lib/命令行.mq.md index 4be7558..4dbd947 100644 --- a/lib/命令行.mq.md +++ b/lib/命令行.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/命令行 description: 解析命令行参数(中层 M5)。--键 值 / --键=值 / --开关;位置参在 _。 --- diff --git a/lib/哈希.mq.md b/lib/哈希.mq.md index 0414429..24b168e 100644 --- a/lib/哈希.mq.md +++ b/lib/哈希.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/哈希 description: 摘要与 HMAC(中层 M3)。完整性 / 缓存键 — 非密码存储。 --- diff --git a/lib/地址.mq.md b/lib/地址.mq.md index 3fec7cb..e839f39 100644 --- a/lib/地址.mq.md +++ b/lib/地址.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/地址 description: 解析 URL 与查询串(中层 Mid2 M7)。单段编码仍用网络.网址编码。 --- diff --git a/lib/外联.mq.md b/lib/外联.mq.md index 02777a2..c0787f5 100644 --- a/lib/外联.mq.md +++ b/lib/外联.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/外联 description: 通过本机解释器运行绑定的代码围栏与内联源码 import: diff --git a/lib/子任务.mq.md b/lib/子任务.mq.md index 8b2b9f0..d794183 100644 --- a/lib/子任务.mq.md +++ b/lib/子任务.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/子任务 description: 并发子任务 — 文件、函数或外联代码 --- diff --git a/lib/插件.mq.md b/lib/插件.mq.md index fd26b8c..d68a9d8 100644 --- a/lib/插件.mq.md +++ b/lib/插件.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/插件 description: 加载可选原生 ABI 插件(.dll / .so / .dylib) --- diff --git a/lib/数学.mq.md b/lib/数学.mq.md index 463d302..719caa9 100644 --- a/lib/数学.mq.md +++ b/lib/数学.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/数学 description: 高中数学 — 数值、随机、公式、作图 --- diff --git a/lib/文件.mq.md b/lib/文件.mq.md index 3b5f64f..d295653 100644 --- a/lib/文件.mq.md +++ b/lib/文件.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/文件 description: 中文文件系统包装 --- diff --git a/lib/文本.mq.md b/lib/文本.mq.md index 8d5b546..07ea9b3 100644 --- a/lib/文本.mq.md +++ b/lib/文本.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/文本 description: 文本库加厚(中层 M4)。字面替换 — 正则请用 lib/正则。 --- diff --git a/lib/日志.mq.md b/lib/日志.mq.md index 344d536..23168cf 100644 --- a/lib/日志.mq.md +++ b/lib/日志.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/日志 description: 按级别过滤的一行日志(中层 M6 + Mid2 M10 字段)。默认级别 info。 --- diff --git a/lib/日期时间.mq.md b/lib/日期时间.mq.md index 2891e31..7530c47 100644 --- a/lib/日期时间.mq.md +++ b/lib/日期时间.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/日期时间 description: 日历时刻 map `{unix, zone, iso}`(中层 Mid2 M7)。固定偏移与少量 IANA 别名。 --- diff --git a/lib/时间.mq.md b/lib/时间.mq.md index 52a6378..a570190 100644 --- a/lib/时间.mq.md +++ b/lib/时间.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/时间 description: 中文时间包装 --- diff --git a/lib/机密.mq.md b/lib/机密.mq.md index 9db874c..792790c 100644 --- a/lib/机密.mq.md +++ b/lib/机密.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/机密 description: 安全随机令牌(中层 M3)。勿用 math.random 生成令牌。 --- diff --git a/lib/标识.mq.md b/lib/标识.mq.md index 8c4a74a..344f766 100644 --- a/lib/标识.mq.md +++ b/lib/标识.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/标识 description: UUID 版本 4(中层 M6)。经 getrandom 安全随机。 --- diff --git a/lib/正则.mq.md b/lib/正则.mq.md index dd42a12..94ee4c4 100644 --- a/lib/正则.mq.md +++ b/lib/正则.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/正则 description: 正则表达式(中层 M1)。Unicode;无回溯引用。 --- diff --git a/lib/浏览器.mq.md b/lib/浏览器.mq.md index da1c378..9dabfc2 100644 --- a/lib/浏览器.mq.md +++ b/lib/浏览器.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/浏览器 description: >- 浏览器效应助手(WASM 客户端)。优先 GFM 表格 + 本库;勿用 json.set 链拼效应。 diff --git a/lib/系统.mq.md b/lib/系统.mq.md index 179e5d7..e2039cd 100644 --- a/lib/系统.mq.md +++ b/lib/系统.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/系统 description: 中文系统包装(加载环境 可选 路径=) --- diff --git a/lib/统计.mq.md b/lib/统计.mq.md index 8fa5d79..82f19fa 100644 --- a/lib/统计.mq.md +++ b/lib/统计.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/统计 description: 薄均值 / 中位数 / 样本标准差(中层 Mid2 M10)。非数据框库。 --- diff --git a/lib/编码.mq.md b/lib/编码.mq.md index 9776631..2ac61dc 100644 --- a/lib/编码.mq.md +++ b/lib/编码.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/编码 description: Base64、十六进制与基32编解码(中层 M1 + Mid2 M8)。UTF-8 文本往返。 --- diff --git a/lib/网络.mq.md b/lib/网络.mq.md index 1c67c3e..8589255 100644 --- a/lib/网络.mq.md +++ b/lib/网络.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/网络 description: 中文 HTTP(S) 包装。可选 headers / content_type 经宿主别名绑定。 --- diff --git a/lib/自写回.mq.md b/lib/自写回.mq.md index a7748f0..4dc749c 100644 --- a/lib/自写回.mq.md +++ b/lib/自写回.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/自写回 description: 将运行结果写回 .mq.md(Jupyter 式自写回) --- diff --git a/lib/表.mq.md b/lib/表.mq.md index dad0d1f..6ffd73c 100644 --- a/lib/表.mq.md +++ b/lib/表.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/表 description: >- 列表与字典。优先用「改」(路径 1-based,与链接取元同构);取/改位/切片为 0-based。 diff --git a/lib/超文本.mq.md b/lib/超文本.mq.md index 3e1ae16..3ca9078 100644 --- a/lib/超文本.mq.md +++ b/lib/超文本.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/超文本 description: HTML 转义 / 还原(中层 Mid2 M8)。拼装字符串时的 XSS 底线。 --- diff --git a/lib/路径.mq.md b/lib/路径.mq.md index 4c99aa6..b404c10 100644 --- a/lib/路径.mq.md +++ b/lib/路径.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/路径 description: 路径代数(中层 M2)。无 I/O;分隔符随宿主 OS。 --- diff --git a/lib/逗号表.mq.md b/lib/逗号表.mq.md index 01792e6..313b994 100644 --- a/lib/逗号表.mq.md +++ b/lib/逗号表.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/逗号表 description: CSV 解析/序列化(中层 M4)。首行为表头 → 映射列表。 --- diff --git a/lib/配置表.mq.md b/lib/配置表.mq.md index 32af58a..c84b8e4 100644 --- a/lib/配置表.mq.md +++ b/lib/配置表.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/配置表 description: 只读 TOML 子集解析(中层 Mid2 M8)。表 / 标量 / 数组;无数组表。 --- diff --git a/man-test/ext/agent-plan.mq.md b/man-test/ext/agent-plan.mq.md index 27d974c..dc4e2ae 100644 --- a/man-test/ext/agent-plan.mq.md +++ b/man-test/ext/agent-plan.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/agent plan live (DeepSeek) description: Full plan loop — spawn workbook, inspect; simple pong goal. import: diff --git a/man-test/keyword/bool.mq.md b/man-test/keyword/bool.mq.md index 89caf98..444a046 100644 --- a/man-test/keyword/bool.mq.md +++ b/man-test/keyword/bool.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 手工构造的测试样例 description: AI禁止更改 --- diff --git a/man-test/keyword/input.mq.md b/man-test/keyword/input.mq.md index e355a95..6093147 100644 --- a/man-test/keyword/input.mq.md +++ b/man-test/keyword/input.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 手工构造的测试样例 description: AI禁止更改 --- diff --git a/man-test/keyword/print.mq.md b/man-test/keyword/print.mq.md index ae899e8..3c480c5 100644 --- a/man-test/keyword/print.mq.md +++ b/man-test/keyword/print.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 手工构造的测试样例 description: AI禁止更改 --- diff --git a/man-test/lib/math.mq.md b/man-test/lib/math.mq.md index 3e47fdc..2f98dc9 100644 --- a/man-test/lib/math.mq.md +++ b/man-test/lib/math.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 手工构造的测试样例 description: AI禁止更改 import: diff --git a/man-test/lib/writeback.mq.md b/man-test/lib/writeback.mq.md index 6e5da26..0e0f545 100644 --- a/man-test/lib/writeback.mq.md +++ b/man-test/lib/writeback.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 手工构造的测试样例 description: AI禁止更改 import: diff --git a/man-test/structure/loop.mq.md b/man-test/structure/loop.mq.md index 56709bf..af3877f 100644 --- a/man-test/structure/loop.mq.md +++ b/man-test/structure/loop.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 手工构造的测试样例 description: AI禁止更改 --- diff --git a/public/features/01-phase-i-treewalk.mq.md b/public/features/01-phase-i-treewalk.mq.md index 50f4397..b5de2b9 100644 --- a/public/features/01-phase-i-treewalk.mq.md +++ b/public/features/01-phase-i-treewalk.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Phase I — tree-walk interpreter description: Lex · parse · check · tree-walk end to end --- diff --git a/public/features/01-树遍历.mq.md b/public/features/01-树遍历.mq.md index 2e69b6c..1282d6a 100644 --- a/public/features/01-树遍历.mq.md +++ b/public/features/01-树遍历.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 第一阶段 — 树遍历解释器 description: 词法 · 语法 · 语义 · 树遍历已贯通 --- diff --git a/public/features/02-bytecode.mq.md b/public/features/02-bytecode.mq.md index 79a404a..645fde4 100644 --- a/public/features/02-bytecode.mq.md +++ b/public/features/02-bytecode.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Bytecode backend description: `--backend bytecode` shares semantics with tree-walk --- diff --git a/public/features/02-字节码.mq.md b/public/features/02-字节码.mq.md index 50e3b33..77b0158 100644 --- a/public/features/02-字节码.mq.md +++ b/public/features/02-字节码.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 字节码后端 description: `--backend bytecode` 与树遍历共用语义 --- diff --git a/public/features/03-view-and-docs.mq.md b/public/features/03-view-and-docs.mq.md index 7bb374f..5ca771a 100644 --- a/public/features/03-view-and-docs.mq.md +++ b/public/features/03-view-and-docs.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: view and the user docs site description: Local browse and static export from the interpreter --- diff --git a/public/features/03-view与文档.mq.md b/public/features/03-view与文档.mq.md index 9bc3dcf..dd49f1b 100644 --- a/public/features/03-view与文档.mq.md +++ b/public/features/03-view与文档.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: view 与用户文档站 description: 本地浏览与静态导出由解释器生成 --- diff --git a/public/features/04-objects.mq.md b/public/features/04-objects.mq.md index c7ed088..fd59381 100644 --- a/public/features/04-objects.mq.md +++ b/public/features/04-objects.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Objects and methods description: Sharp heading is a type; deeper headings are functions or methods --- diff --git a/public/features/04-对象.mq.md b/public/features/04-对象.mq.md index deee1e0..bff0a48 100644 --- a/public/features/04-对象.mq.md +++ b/public/features/04-对象.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 对象与方法 description: 一级标题是类型;更深标题是函数或方法 --- diff --git a/public/features/05-extensions.mq.md b/public/features/05-extensions.mq.md index 4a4f7e0..49fff60 100644 --- a/public/features/05-extensions.mq.md +++ b/public/features/05-extensions.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Official extensions (ext/) description: Optional packages — not stdlib --- diff --git a/public/features/05-扩展.mq.md b/public/features/05-扩展.mq.md index cd20da6..8d8c5b5 100644 --- a/public/features/05-扩展.mq.md +++ b/public/features/05-扩展.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 官方扩展(ext/) description: 可选包 — 不是标准库 --- diff --git a/public/features/06-quantum.mq.md b/public/features/06-quantum.mq.md index 1143a31..1d96764 100644 --- a/public/features/06-quantum.mq.md +++ b/public/features/06-quantum.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Quantum circuits (ext/quantum) description: Official quantum simulator — tables, gates, Q7 density, Q8 themed SVG import: diff --git a/public/features/06-量子.mq.md b/public/features/06-量子.mq.md index 2e1215c..b9e7399 100644 --- a/public/features/06-量子.mq.md +++ b/public/features/06-量子.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 量子电路(ext/quantum) description: 官方量子模拟 — 表、门、Q7 密度与高级图、Q8 主题 SVG 导入: diff --git a/public/features/07-linalg.mq.md b/public/features/07-linalg.mq.md index 598376e..a3d499b 100644 --- a/public/features/07-linalg.mq.md +++ b/public/features/07-linalg.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: How to write a linear-algebra formula document description: ext/linalg formula-doc — declare, infix, run-implies-correct import: @@ -23,8 +24,8 @@ Declare symbols in a table, multiply, transpose — `T_ascii` is one-step displa | 2 | B | 3 | 2 | **`env` = > la.declare table=`shapes`** -**`A` = [A](env)** -**`B` = [B](env)** +**`A` = [A](access(env, "A"))** +**`B` = [B](access(env, "B"))** **`P` = `A` * `B`** **`t` = > `P`.T_ascii** > print text=`t` diff --git a/public/features/07-线性代数.mq.md b/public/features/07-线性代数.mq.md index 9cbba72..5a2d966 100644 --- a/public/features/07-线性代数.mq.md +++ b/public/features/07-线性代数.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 如何写线性代数公式文档 description: ext/linalg 公式文档面 — 声明、中缀、跑通即正确 导入: @@ -23,8 +24,8 @@ description: ext/linalg 公式文档面 — 声明、中缀、跑通即正确 | 2 | B | 3 | 2 | **`环境` = > la.声明 表=`形状`** -**`A` = [A](环境)** -**`B` = [B](环境)** +**`A` = [A](access(环境, "A"))** +**`B` = [B](access(环境, "B"))** **`P` = `A` * `B`** **`t` = > `P`.转置文本** > 打印 内容=`t` diff --git a/public/features/08-re-encoding.mq.md b/public/features/08-re-encoding.mq.md index 1ead15b..7a45139 100644 --- a/public/features/08-re-encoding.mq.md +++ b/public/features/08-re-encoding.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Mid stdlib — regex and encoding description: lib/re + lib/encoding without plugins (Mid M1) import: diff --git a/public/features/08-正则编解码.mq.md b/public/features/08-正则编解码.mq.md index 304b415..068ccd0 100644 --- a/public/features/08-正则编解码.mq.md +++ b/public/features/08-正则编解码.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中层标准库 — 正则与编解码 description: lib/正则 + lib/编码,无需插件(中层 M1) 导入: diff --git a/public/features/09-path-fs.mq.md b/public/features/09-path-fs.mq.md index 0fe6bf6..142a6e1 100644 --- a/public/features/09-path-fs.mq.md +++ b/public/features/09-path-fs.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Mid stdlib — path and fs description: lib/path + fs copy/move/temp (Mid M2) import: diff --git a/public/features/09-路径文件.mq.md b/public/features/09-路径文件.mq.md index c9684ca..9c1d50e 100644 --- a/public/features/09-路径文件.mq.md +++ b/public/features/09-路径文件.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中层标准库 — 路径与文件 description: lib/路径 + 文件复制/移动/临时(中层 M2) 导入: diff --git a/public/features/10-hash-secrets.mq.md b/public/features/10-hash-secrets.mq.md index 99c5b75..3548425 100644 --- a/public/features/10-hash-secrets.mq.md +++ b/public/features/10-hash-secrets.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Mid stdlib — hash and secrets description: lib/hash + lib/secrets without plugins (Mid M3) import: diff --git a/public/features/10-哈希机密.mq.md b/public/features/10-哈希机密.mq.md index 8184e9e..4921ae4 100644 --- a/public/features/10-哈希机密.mq.md +++ b/public/features/10-哈希机密.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中层标准库 — 哈希与机密 description: lib/哈希 + lib/机密,无需插件(中层 M3) 导入: diff --git a/public/features/13-log-uuid.mq.md b/public/features/13-log-uuid.mq.md index 8fadc88..317c8a4 100644 --- a/public/features/13-log-uuid.mq.md +++ b/public/features/13-log-uuid.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Mid stdlib — log and uuid description: Level-filtered logs + UUID v4 (Mid M6) import: diff --git a/public/features/13-日志标识.mq.md b/public/features/13-日志标识.mq.md index b870379..3623694 100644 --- a/public/features/13-日志标识.mq.md +++ b/public/features/13-日志标识.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中层标准库 — 日志与标识 description: 按级别过滤的日志 + UUID 版本4(中层 M6) 导入: diff --git a/public/features/17-stats-log.mq.md b/public/features/17-stats-log.mq.md index 21b7c4e..803d8aa 100644 --- a/public/features/17-stats-log.mq.md +++ b/public/features/17-stats-log.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Mid stdlib — stats and log fields description: Thin mean/median/stdev + structured log fields (Mid2 M10) import: diff --git a/public/features/17-统计日志.mq.md b/public/features/17-统计日志.mq.md index 15824f6..167713b 100644 --- a/public/features/17-统计日志.mq.md +++ b/public/features/17-统计日志.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中层标准库 — 统计与日志字段 description: 薄均值/中位数/标准差 + 日志 fields(Mid2 M10) 导入: diff --git a/public/features/18-AI原生闭环.mq.md b/public/features/18-AI原生闭环.mq.md index ec8e707..6ca5951 100644 --- a/public/features/18-AI原生闭环.mq.md +++ b/public/features/18-AI原生闭环.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: AI 原生闭环(契约 + MLSP) description: 渐进式契约、结构化诊断与面向 AI 的 Marqdo 语言服务 --- diff --git a/public/features/18-ai-native-loop.mq.md b/public/features/18-ai-native-loop.mq.md index c44b80f..3c2116e 100644 --- a/public/features/18-ai-native-loop.mq.md +++ b/public/features/18-ai-native-loop.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: AI-native loop (contracts + MLSP) description: Progressive contracts, structured diagnostics, and the Marqdo Language Server for AI --- diff --git a/public/features/20-OKF与EKC.mq.md b/public/features/20-OKF与EKC.mq.md index 7f1acf1..40819a8 100644 --- a/public/features/20-OKF与EKC.mq.md +++ b/public/features/20-OKF与EKC.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 代码即文档,文档即知识 — OKF 与 EKC description: Marqdo 如何以一份可执行源为唯一权威,把它投影成 OKF 风格知识与 Engineering Knowledge Compiler 制品 --- diff --git a/public/features/20-okf-ekc.mq.md b/public/features/20-okf-ekc.mq.md index 9766b34..813c11a 100644 --- a/public/features/20-okf-ekc.mq.md +++ b/public/features/20-okf-ekc.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Code as documentation, documentation as knowledge — OKF and EKC description: How Marqdo keeps one executable source of truth while projecting it into OKF-style knowledge and Engineering Knowledge Compiler artifacts --- diff --git a/public/features/21-persistence.mq.md b/public/features/21-persistence.mq.md index de61de1..5c95076 100644 --- a/public/features/21-persistence.mq.md +++ b/public/features/21-persistence.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Persisting foreign execution results description: Static snapshots and writeback — how foreign results survive after the process exits import: diff --git a/public/features/21-持久化.mq.md b/public/features/21-持久化.mq.md index c58f0ad..c1dc650 100644 --- a/public/features/21-持久化.mq.md +++ b/public/features/21-持久化.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 外联执行结果的持久化 description: 静态快照与自写回 —— 外联结果在进程退出后如何保留 导入: diff --git a/public/keywords/bool-logic.mq.md b/public/keywords/bool-logic.mq.md index a7ad675..9d02908 100644 --- a/public/keywords/bool-logic.mq.md +++ b/public/keywords/bool-logic.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Booleans and logic description: True / False / None and and / or / not --- diff --git a/public/keywords/input.mq.md b/public/keywords/input.mq.md index 35f7a5c..fb17a3f 100644 --- a/public/keywords/input.mq.md +++ b/public/keywords/input.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Built-in input description: Read one line from stdin; optional prompt. Demo via frontmatter stdin. stdin: Ada diff --git a/public/keywords/print.mq.md b/public/keywords/print.mq.md index 8ce7708..0904f9c 100644 --- a/public/keywords/print.mq.md +++ b/public/keywords/print.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Built-in print description: Named and positional forms --- diff --git a/public/keywords/stdlib.mq.md b/public/keywords/stdlib.mq.md index c2b0a1c..9e573f7 100644 --- a/public/keywords/stdlib.mq.md +++ b/public/keywords/stdlib.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Built-ins len / str / int / type / trim / split / join / at description: Host builtins for strings and tables --- diff --git a/public/keywords/内核双名.mq.md b/public/keywords/内核双名.mq.md index b6684f0..1c29d62 100644 --- a/public/keywords/内核双名.mq.md +++ b/public/keywords/内核双名.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中英内核双名 description: 无需导入:打印、长度、文本、整数 与 print / len / … --- diff --git a/public/keywords/布尔逻辑.mq.md b/public/keywords/布尔逻辑.mq.md index 89d45ab..30c78de 100644 --- a/public/keywords/布尔逻辑.mq.md +++ b/public/keywords/布尔逻辑.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 布尔与逻辑 description: 真 / 假 / 空 与 且 / 或 / 非 --- diff --git a/public/keywords/打印.mq.md b/public/keywords/打印.mq.md index 07391e6..084bf3c 100644 --- a/public/keywords/打印.mq.md +++ b/public/keywords/打印.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 内置 打印 description: 具名与位置两种写法 --- diff --git a/public/keywords/标准库.mq.md b/public/keywords/标准库.mq.md index 7262bb3..7d729ed 100644 --- a/public/keywords/标准库.mq.md +++ b/public/keywords/标准库.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 内置 长度 / 文本 / 整数 与 trim 等 description: 主机内置;中文别名覆盖常用几个 --- diff --git a/public/keywords/输入.mq.md b/public/keywords/输入.mq.md index 58fd9ff..c37a995 100644 --- a/public/keywords/输入.mq.md +++ b/public/keywords/输入.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 内置 输入 description: 从 stdin 读一行;可选提示。演示数据写在 frontmatter 输入。 输入: 小明 diff --git a/public/stdlib/00-overview.mq.md b/public/stdlib/00-overview.mq.md index a68c418..07288f4 100644 --- a/public/stdlib/00-overview.mq.md +++ b/public/stdlib/00-overview.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Standard library — overview description: How to import official lib modules --- diff --git a/public/stdlib/00-索引.mq.md b/public/stdlib/00-索引.mq.md index 7f66cbd..40e9424 100644 --- a/public/stdlib/00-索引.mq.md +++ b/public/stdlib/00-索引.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 标准库 — 总览 description: 如何导入官方 lib 模块 --- diff --git a/public/stdlib/fs.mq.md b/public/stdlib/fs.mq.md index 65f8e51..c80dec1 100644 --- a/public/stdlib/fs.mq.md +++ b/public/stdlib/fs.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/fs — files description: Read and write text under the sandbox import: diff --git a/public/stdlib/json.mq.md b/public/stdlib/json.mq.md index bc8f234..13e8fb5 100644 --- a/public/stdlib/json.mq.md +++ b/public/stdlib/json.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/json — JSON description: Shared EN/ZH path; parse and stringify (code-as-docs pilot) import: diff --git a/public/stdlib/math.mq.md b/public/stdlib/math.mq.md index 41ee668..9dcc631 100644 --- a/public/stdlib/math.mq.md +++ b/public/stdlib/math.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/math — numbers, formulas, plots description: High-school math stdlib (English) import: diff --git a/public/stdlib/net.mq.md b/public/stdlib/net.mq.md index ab03842..e6acbc8 100644 --- a/public/stdlib/net.mq.md +++ b/public/stdlib/net.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/net — HTTP(S) description: Minimal HTTP(S) client and URL encode import: diff --git a/public/stdlib/plugin.mq.md b/public/stdlib/plugin.mq.md index 510d586..c3430d3 100644 --- a/public/stdlib/plugin.mq.md +++ b/public/stdlib/plugin.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/plugin — native ABI description: Load optional shared libraries (.dll / .so / .dylib) import: diff --git a/public/stdlib/subtask.mq.md b/public/stdlib/subtask.mq.md index 0d64b8e..9d6ee36 100644 --- a/public/stdlib/subtask.mq.md +++ b/public/stdlib/subtask.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/subtask — concurrent tasks description: Spawn file, function, or foreign code in parallel import: diff --git a/public/stdlib/sys.mq.md b/public/stdlib/sys.mq.md index 4e8ef79..d9b85bf 100644 --- a/public/stdlib/sys.mq.md +++ b/public/stdlib/sys.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/sys — process description: Env, dotenv, cwd, args, exit, exec import: diff --git a/public/stdlib/text.mq.md b/public/stdlib/text.mq.md index f95680d..e604ed9 100644 --- a/public/stdlib/text.mq.md +++ b/public/stdlib/text.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/text — strings description: Trim, split, join (code-as-docs pilot) import: diff --git a/public/stdlib/time.mq.md b/public/stdlib/time.mq.md index 8df2ba0..2cb06df 100644 --- a/public/stdlib/time.mq.md +++ b/public/stdlib/time.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/time — clock description: Unix time, format, parse, sleep import: diff --git a/public/stdlib/writeback.mq.md b/public/stdlib/writeback.mq.md index 169d1e2..ac7e0a7 100644 --- a/public/stdlib/writeback.mq.md +++ b/public/stdlib/writeback.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/writeback — Jupyter-style writeback description: Persist run output in the entry .mq.md file import: diff --git a/public/stdlib/子任务.mq.md b/public/stdlib/子任务.mq.md index c741c52..2b20472 100644 --- a/public/stdlib/子任务.mq.md +++ b/public/stdlib/子任务.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/子任务 — 并发子任务 description: 文件、函数或外联代码并行执行 导入: diff --git a/public/stdlib/插件.mq.md b/public/stdlib/插件.mq.md index 395afcf..81d883c 100644 --- a/public/stdlib/插件.mq.md +++ b/public/stdlib/插件.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/插件 — 原生 ABI description: 加载可选共享库(.dll / .so / .dylib) 导入: diff --git a/public/stdlib/数学.mq.md b/public/stdlib/数学.mq.md index 22a03dc..9f4b1ec 100644 --- a/public/stdlib/数学.mq.md +++ b/public/stdlib/数学.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/数学 — 数值、公式、作图 description: 高中数学标准库(中文) 导入: diff --git a/public/stdlib/文件.mq.md b/public/stdlib/文件.mq.md index 911cba4..dff678a 100644 --- a/public/stdlib/文件.mq.md +++ b/public/stdlib/文件.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/文件 — 文件系统 description: 沙箱内读写文本 导入: diff --git a/public/stdlib/文本.mq.md b/public/stdlib/文本.mq.md index 916b830..ebf3597 100644 --- a/public/stdlib/文本.mq.md +++ b/public/stdlib/文本.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/文本 — 字符串 description: 去空白、拆分、拼接(代码即文档试点) 导入: diff --git a/public/stdlib/时间.mq.md b/public/stdlib/时间.mq.md index ffb2ceb..f6a51c5 100644 --- a/public/stdlib/时间.mq.md +++ b/public/stdlib/时间.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/时间 — 时钟 description: Unix 时间、格式化、解析、睡眠 导入: diff --git a/public/stdlib/系统.mq.md b/public/stdlib/系统.mq.md index 7cd994a..32fa3b4 100644 --- a/public/stdlib/系统.mq.md +++ b/public/stdlib/系统.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/系统 — 进程 description: 环境变量、dotenv、工作目录、参数、退出、执行 导入: diff --git a/public/stdlib/网络.mq.md b/public/stdlib/网络.mq.md index daad6a1..2f69aab 100644 --- a/public/stdlib/网络.mq.md +++ b/public/stdlib/网络.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/网络 — HTTP description: HTTP(S) 与地址编码 导入: diff --git a/public/stdlib/自写回.mq.md b/public/stdlib/自写回.mq.md index 1371327..32b9e7c 100644 --- a/public/stdlib/自写回.mq.md +++ b/public/stdlib/自写回.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/自写回 — Jupyter 式写回 description: 把运行结果写回入口 .mq.md 导入: diff --git a/public/structure/01-hello.mq.md b/public/structure/01-hello.mq.md index 701da23..dc3313b 100644 --- a/public/structure/01-hello.mq.md +++ b/public/structure/01-hello.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Hello World description: Smallest runnable doc --- diff --git a/public/structure/01-你好.mq.md b/public/structure/01-你好.mq.md index 260e089..877d751 100644 --- a/public/structure/01-你好.mq.md +++ b/public/structure/01-你好.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 你好世界 description: 最小可运行文档 --- diff --git a/public/structure/02-function.mq.md b/public/structure/02-function.mq.md index 07b933a..630d10f 100644 --- a/public/structure/02-function.mq.md +++ b/public/structure/02-function.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Functions and named calls description: `#` defines functions; `>` calls; `-` lists parameter names --- diff --git a/public/structure/02-函数.mq.md b/public/structure/02-函数.mq.md index 6020840..005631e 100644 --- a/public/structure/02-函数.mq.md +++ b/public/structure/02-函数.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 函数与具名调用 description: `#` 定义函数;`>` 调用;`-` 列出参数名 --- diff --git a/public/structure/03-positional-call.mq.md b/public/structure/03-positional-call.mq.md index 84493c3..8b69aac 100644 --- a/public/structure/03-positional-call.mq.md +++ b/public/structure/03-positional-call.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Positional arguments description: Bind by parameter order; named form still works --- diff --git a/public/structure/03-位置调用.mq.md b/public/structure/03-位置调用.mq.md index cf41d96..321a7f8 100644 --- a/public/structure/03-位置调用.mq.md +++ b/public/structure/03-位置调用.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 位置实参 description: 按参数声明顺序绑定;具名写法仍然可用 --- diff --git a/public/structure/04-branch.mq.md b/public/structure/04-branch.mq.md index 106cb26..fb7245e 100644 --- a/public/structure/04-branch.mq.md +++ b/public/structure/04-branch.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Branch description: `+` arms; a lone `*` arm is else --- diff --git a/public/structure/04-分支.mq.md b/public/structure/04-分支.mq.md index b7c9f25..56f57c2 100644 --- a/public/structure/04-分支.mq.md +++ b/public/structure/04-分支.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 分支 description: `+` 各臂;单独的 `*` 臂为否则 --- diff --git a/public/structure/09-inherit.mq.md b/public/structure/09-inherit.mq.md index add8df2..430703b 100644 --- a/public/structure/09-inherit.mq.md +++ b/public/structure/09-inherit.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Object inheritance description: "# Child = > Parent; methods walk the base chain" --- diff --git a/public/structure/09-继承.mq.md b/public/structure/09-继承.mq.md index e54dea1..b95ed84 100644 --- a/public/structure/09-继承.mq.md +++ b/public/structure/09-继承.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 对象继承 description: "# 子类 = > 父类;方法沿基类链查找" --- diff --git a/public/structure/import/main.mq.md b/public/structure/import/main.mq.md index e498804..dcdc4ed 100644 --- a/public/structure/import/main.mq.md +++ b/public/structure/import/main.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Cross-file import description: Frontmatter nested import: map import: diff --git a/public/structure/import/utils.mq.md b/public/structure/import/utils.mq.md index 5c76ec1..7323745 100644 --- a/public/structure/import/utils.mq.md +++ b/public/structure/import/utils.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Utility module description: Imported by main; italic is return; print for side effects --- diff --git a/public/structure/import/主.mq.md b/public/structure/import/主.mq.md index 6ae18e2..2328521 100644 --- a/public/structure/import/主.mq.md +++ b/public/structure/import/主.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 跨文件导入 description: frontmatter 导入 bind:路径.mq.md 导入: diff --git a/public/structure/import/工具.mq.md b/public/structure/import/工具.mq.md index ae24097..4dd9436 100644 --- a/public/structure/import/工具.mq.md +++ b/public/structure/import/工具.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 工具模块 description: 被 main 导入;斜体为返回;副作用用打印 --- diff --git a/src/load.rs b/src/load.rs index e6416d5..1ca4bb7 100644 --- a/src/load.rs +++ b/src/load.rs @@ -14,7 +14,10 @@ use crate::parse::parse_source; /// Load `path` and recursively bind imported modules (no flat merge). pub fn load_module(path: &Path) -> Result { - load_module_with_ctx(path, &BindingContext::from_binds(&[], cwd_for_path(Some(path)))) + load_module_with_ctx( + path, + &BindingContext::from_binds(&[], cwd_for_path(Some(path))), + ) } /// Load with BindingContext (CLI `--bind`, cwd for `sys.cwd`). @@ -28,9 +31,7 @@ fn load_module_inner( visited: &mut HashSet, ctx: &BindingContext, ) -> Result { - let canon = path - .canonicalize() - .unwrap_or_else(|_| path.to_path_buf()); + let canon = path.canonicalize().unwrap_or_else(|_| path.to_path_buf()); if !visited.insert(canon.clone()) { bail!("circular import involving {}", path.display()); } @@ -86,7 +87,9 @@ fn read_module_source(path: &Path) -> Result { } fn read_embedded_for_path(path: &Path) -> Option { - lib_remainder(path).as_deref().and_then(embedded_lib::read_file) + lib_remainder(path) + .as_deref() + .and_then(embedded_lib::read_file) } fn lib_remainder(path: &Path) -> Option { @@ -156,10 +159,7 @@ pub fn resolve_import(from_dir: &Path, rel: &str) -> Result { if let Some(p) = find_in_ancestor_dir(from_dir, "ext", rest) { return Ok(p); } - let mut msg = format!( - "cannot resolve import `{rel}` from {}", - from_dir.display() - ); + let mut msg = format!("cannot resolve import `{rel}` from {}", from_dir.display()); #[cfg(feature = "cli")] { let user_ext = crate::ext_cli::default_user_ext_dir(); @@ -290,9 +290,10 @@ fn label_error(label: &str, e: anyhow::Error) -> anyhow::Error { /// Effective markup mode declared by the file itself. `` M7 /// /// Looks for `markup: occlusion` (or `标记: 遮蔽`) inside the leading frontmatter -/// block. Files that say nothing retain the compatibility default (`classic`) -/// until the full library migration lands. There is no environment/process -/// default: an explicit file declaration always decides its own grammar. +/// block. Unmarked sources use the new `occlusion` default; a legacy source +/// must opt in with `markup: classic` or be run through `--legacy-markup` for +/// the transition cycle. There is no environment/process default: an explicit +/// file declaration always decides its own grammar. /// Parse a standalone source the way the file itself declares (`markup:` in /// frontmatter). The viewer must use this — otherwise an occluded document is /// re-parsed in classic mode and fails. `` M7/M8 @@ -409,11 +410,8 @@ mod tests { let prev = env::var_os("MARQDO_EXT"); env::remove_var("MARQDO_EXT"); // Unique path so cwd/ext cannot satisfy the import. - let err = resolve_import( - Path::new("/tmp"), - "ext/__gap12_missing__/nope.mq.md", - ) - .unwrap_err(); + let err = + resolve_import(Path::new("/tmp"), "ext/__gap12_missing__/nope.mq.md").unwrap_err(); let msg = format!("{err:#}"); match prev { Some(v) => env::set_var("MARQDO_EXT", v), diff --git a/src/main.rs b/src/main.rs index 5be181b..2ffb69c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,6 +57,10 @@ enum MigrateAction { /// Actually rewrite files (default: dry run) #[arg(long)] write: bool, + /// Add `markup: occlusion` to every unmarked file, including files + /// with no legacy index. Use this when migrating a shipped library. + #[arg(long)] + mark: bool, /// One JSON object on stdout #[arg(long)] json: bool, @@ -550,7 +554,9 @@ fn resolve_knowledge_reference<'a>( anyhow::bail!("knowledge reference `{reference}` must be a dotted value path or mq:// URI"); }; if !call.args.is_empty() { - anyhow::bail!("knowledge resolve only binds a zero-argument path; `{reference}` has arguments"); + anyhow::bail!( + "knowledge resolve only binds a zero-argument path; `{reference}` has arguments" + ); } let path = call.path.ok_or_else(|| { anyhow::anyhow!("knowledge reference `{reference}` must start with an imported module bind") @@ -566,7 +572,9 @@ fn resolve_knowledge_reference<'a>( .imports .iter() .find(|item| item.bind == path[0]) - .ok_or_else(|| anyhow::anyhow!("unknown import bind `{}` in {}", path[0], from.display()))?; + .ok_or_else(|| { + anyhow::anyhow!("unknown import bind `{}` in {}", path[0], from.display()) + })?; let base = from.parent().unwrap_or_else(|| std::path::Path::new(".")); let imported_path = marqdo::load::resolve_import(base, &imported.path)?; let imported_path = imported_path.canonicalize().unwrap_or(imported_path); @@ -872,26 +880,36 @@ fn try_main(cli: Cli) -> Result { Ok(0) } Commands::Migrate { action } => match action { - MigrateAction::Labels { paths, write, json } => { + MigrateAction::Labels { + paths, + write, + mark, + json, + } => { let mut reports = Vec::new(); for p in &paths { - reports.extend(marqdo::migrate::migrate_path(p, write)?); + reports.extend(marqdo::migrate::migrate_path_with_options(p, write, mark)?); } - let (mut idx, mut loops, mut applied) = (0usize, 0usize, 0usize); + let (mut idx, mut loops, mut marked, mut applied) = + (0usize, 0usize, 0usize, 0usize); for r in &reports { idx += r.indexes; loops += r.loops; + marked += usize::from(r.mode_marked); applied += usize::from(r.applied); } if json { let arr: Vec = reports .iter() - .filter(|r| r.indexes > 0 || r.loops > 0 || r.note.is_some()) + .filter(|r| { + r.indexes > 0 || r.loops > 0 || r.mode_marked || r.note.is_some() + }) .map(|r| { serde_json::json!({ "file": r.file.display().to_string(), "indexes": r.indexes, "loops": r.loops, + "mode_marked": r.mode_marked, "applied": r.applied, "note": r.note, }) @@ -900,7 +918,7 @@ fn try_main(cli: Cli) -> Result { println!("{}", serde_json::Value::Array(arr)); } else { for r in &reports { - if r.indexes == 0 && r.loops == 0 { + if r.indexes == 0 && r.loops == 0 && !r.mode_marked { continue; } let state = if r.applied { @@ -911,10 +929,15 @@ fn try_main(cli: Cli) -> Result { "would change" }; println!( - "{} indexes={} loops={} {}{}", + "{} indexes={} loops={} mode={} {}{}", r.file.display(), r.indexes, r.loops, + if r.mode_marked { + "occlusion" + } else { + "unchanged" + }, state, r.note .as_ref() @@ -923,7 +946,7 @@ fn try_main(cli: Cli) -> Result { ); } println!( - "migrate labels: {idx} index, {loops} loop, {applied} file written{}", + "migrate labels: {idx} index, {loops} loop, {marked} explicit mode, {applied} file written{}", if write { "" } else { @@ -942,9 +965,10 @@ fn try_main(cli: Cli) -> Result { for r in &reports { bindings += r.bindings; applied += usize::from(r.applied); - if r.note.as_ref().is_some_and(|n| { - n != "no legacy import one-liners" - }) && r.bindings == 0 + if r.note + .as_ref() + .is_some_and(|n| n != "no legacy import one-liners") + && r.bindings == 0 { problems += 1; } @@ -952,7 +976,12 @@ fn try_main(cli: Cli) -> Result { if json { let arr: Vec = reports .iter() - .filter(|r| r.bindings > 0 || r.note.as_ref().is_some_and(|n| n != "no legacy import one-liners")) + .filter(|r| { + r.bindings > 0 + || r.note + .as_ref() + .is_some_and(|n| n != "no legacy import one-liners") + }) .map(|r| { serde_json::json!({ "file": r.file.display().to_string(), @@ -965,7 +994,11 @@ fn try_main(cli: Cli) -> Result { println!("{}", serde_json::Value::Array(arr)); } else { for r in &reports { - if r.bindings == 0 && r.note.as_ref().is_some_and(|n| n == "no legacy import one-liners") { + if r.bindings == 0 + && r.note + .as_ref() + .is_some_and(|n| n == "no legacy import one-liners") + { continue; } if r.bindings == 0 { @@ -1155,7 +1188,9 @@ fn try_main(cli: Cli) -> Result { "{}\n {}{} {} · module {}\n {}:{}", item.id, item.kind.as_str(), - item.callable.map(|kind| format!(" ({})", kind.as_str())).unwrap_or_default(), + item.callable + .map(|kind| format!(" ({})", kind.as_str())) + .unwrap_or_default(), item.declaration_path.join("."), item.module, item.source.display(), @@ -1172,15 +1207,17 @@ fn try_main(cli: Cli) -> Result { Ok(0) } KnowledgeAction::Resolve { reference, from } => { - let from = from.as_deref().or_else(|| path.is_file().then_some(path.as_path())); + let from = from + .as_deref() + .or_else(|| path.is_file().then_some(path.as_path())); let index = marqdo::sema::ProjectIndex::build(if path.is_dir() { marqdo::project::ProjectRoot::new(&path)? } else { marqdo::project::ProjectRoot::discover(&path)? })?; let symbol = resolve_knowledge_reference(&index, &reference, from)?; - let instance_only = symbol.callable - == Some(marqdo::sema::CallableKind::InstanceMethod); + let instance_only = + symbol.callable == Some(marqdo::sema::CallableKind::InstanceMethod); if json { println!( "{}", @@ -1209,32 +1246,83 @@ fn try_main(cli: Cli) -> Result { } KnowledgeAction::Lock { update, strict } => { let semantic_root = if path.is_file() { - path.parent().unwrap_or_else(|| std::path::Path::new(".")).to_path_buf() + path.parent() + .unwrap_or_else(|| std::path::Path::new(".")) + .to_path_buf() } else { path.clone() }; - let compilation = marqdo::sema::compile_project(&marqdo::sema::CompileOptions { - project_root: semantic_root, - entry: path.is_file().then(|| path.clone()), - lock_mode: if strict { marqdo::sema::LockMode::Strict } else { marqdo::sema::LockMode::Check }, - })?; + let compilation = + marqdo::sema::compile_project(&marqdo::sema::CompileOptions { + project_root: semantic_root, + entry: path.is_file().then(|| path.clone()), + lock_mode: if strict { + marqdo::sema::LockMode::Strict + } else { + marqdo::sema::LockMode::Check + }, + })?; if update { marqdo::sema::update_links_lock(&out, &compilation.semantics)?; let body = serde_json::json!({"schema_version": 1, "status": "updated", "path": out.join("links.lock.json")}); - if json { println!("{body}"); } else { println!("knowledge lock updated: {}", out.join("links.lock.json").display()); } + if json { + println!("{body}"); + } else { + println!( + "knowledge lock updated: {}", + out.join("links.lock.json").display() + ); + } Ok(0) } else { let report = marqdo::sema::check_links_lock(&out, &compilation.semantics)?; - if json { println!("{}", report.to_json()); } else { println!("knowledge lock: {}", report.status); for id in report.missing.iter().chain(report.changed.iter()).chain(report.removed.iter()) { println!(" {id}"); } } + if json { + println!("{}", report.to_json()); + } else { + println!("knowledge lock: {}", report.status); + for id in report + .missing + .iter() + .chain(report.changed.iter()) + .chain(report.removed.iter()) + { + println!(" {id}"); + } + } Ok(if strict && !report.is_clean() { 3 } else { 0 }) } } KnowledgeAction::Impact { query } => { - let semantic_root = if path.is_file() { path.parent().unwrap_or_else(|| std::path::Path::new(".")).to_path_buf() } else { path.clone() }; - let compilation = marqdo::sema::compile_project(&marqdo::sema::CompileOptions { project_root: semantic_root, entry: path.is_file().then(|| path.clone()), lock_mode: marqdo::sema::LockMode::Off })?; + let semantic_root = if path.is_file() { + path.parent() + .unwrap_or_else(|| std::path::Path::new(".")) + .to_path_buf() + } else { + path.clone() + }; + let compilation = + marqdo::sema::compile_project(&marqdo::sema::CompileOptions { + project_root: semantic_root, + entry: path.is_file().then(|| path.clone()), + lock_mode: marqdo::sema::LockMode::Off, + })?; let report = marqdo::sema::semantic_impact(&compilation.semantics, &query); - if json { println!("{report}"); } else { for item in report["affected"].as_array().into_iter().flatten() { println!("{} {}", item["artifact_id"].as_str().unwrap_or(""), item["display_name"].as_str().unwrap_or("")); } } - Ok(if report["resolved"].as_bool() == Some(true) { 0 } else { 1 }) + if json { + println!("{report}"); + } else { + for item in report["affected"].as_array().into_iter().flatten() { + println!( + "{} {}", + item["artifact_id"].as_str().unwrap_or(""), + item["display_name"].as_str().unwrap_or("") + ); + } + } + Ok(if report["resolved"].as_bool() == Some(true) { + 0 + } else { + 1 + }) } KnowledgeAction::Preflight { task, diff --git a/src/migrate.rs b/src/migrate.rs index 39c7964..c72ab49 100644 --- a/src/migrate.rs +++ b/src/migrate.rs @@ -20,6 +20,9 @@ pub struct FileReport { pub file: PathBuf, pub indexes: usize, pub loops: usize, + /// Whether this file will receive (or already has) an explicit + /// `markup: occlusion` declaration. + pub mode_marked: bool, pub applied: bool, pub note: Option, } @@ -45,7 +48,10 @@ fn has_marker(source: &str) -> bool { } let lower = t.to_ascii_lowercase(); if lower.starts_with("markup:") || t.starts_with("标记:") { - return lower.contains("occlusion") || lower.contains("purity") || t.contains("遮蔽") || t.contains("纯度"); + return lower.contains("occlusion") + || lower.contains("purity") + || t.contains("遮蔽") + || t.contains("纯度"); } } false @@ -64,10 +70,14 @@ fn add_marker(source: &str) -> String { if lower.starts_with("markup:") || line.trim().starts_with("标记:") { *line = "markup: occlusion".to_string(); let mut out = lines.join("\n"); - if source.ends_with('\n') { out.push('\n'); } + if source.ends_with('\n') { + out.push('\n'); + } return out; } - if line.trim() == "---" && index != 0 { break; } + if line.trim() == "---" && index != 0 { + break; + } } } if let Some(rest) = source.strip_prefix("---\n") { @@ -162,10 +172,7 @@ fn rewrite_one_innermost(line: &str) -> Option { } else { quote_key(k) }; - let replaced = format!( - "[{label}](access({}, {key_arg}))", - coll.trim() - ); + let replaced = format!("[{label}](access({}, {key_arg}))", coll.trim()); let mut out = String::new(); out.extend(chars[..i].iter()); out.push_str(&replaced); @@ -284,9 +291,7 @@ fn rewrite_loop(line: &str) -> Option { } let indent = &line[..line.len() - trimmed.len()]; let shown = item.trim_matches('`').to_string(); - Some(format!( - "{indent}- [{shown}](遍历 {coll} 为 {item})" - )) + Some(format!("{indent}- [{shown}](遍历 {coll} 为 {item})")) } fn says_foreach(s: &str) -> bool { @@ -310,7 +315,9 @@ fn denorm_expr(expr: &Expr) -> Expr { _ => return expr.clone(), }; let key_label = match key { - Expr::Literal(crate::ast::Literal::Text(t)) if t == label => Some(IndexKey::Lit(t.clone())), + Expr::Literal(crate::ast::Literal::Text(t)) if t == label => { + Some(IndexKey::Lit(t.clone())) + } Expr::Var(v) if v == label => Some(IndexKey::Var(v.clone())), _ => None, }; @@ -401,7 +408,10 @@ fn denorm_stmt(stmt: &Stmt) -> Stmt { }, }) .collect(); - Stmt::Call { call: c, span: *span } + Stmt::Call { + call: c, + span: *span, + } } Stmt::Branch { arms, span } => Stmt::Branch { arms: arms @@ -477,22 +487,40 @@ fn shape(module: &Module) -> String { /// Migrate one file. `write=false` performs a dry run (still fully verified). pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result { + migrate_file_with_options(path, write, false) +} + +/// Migrate one file and, when `mark_all` is set, give a file that has no +/// legacy index an explicit new-syntax declaration too. This is the mode used +/// for shipped libraries: their behavior must not depend on the process +/// default even if they happen not to contain a link-shaped index today. +pub fn migrate_file_with_options( + path: &Path, + write: bool, + mark_all: bool, +) -> anyhow::Result { let source = std::fs::read_to_string(path)?; let mut report = FileReport { file: path.to_path_buf(), indexes: 0, loops: 0, + mode_marked: false, applied: false, note: None, }; if has_marker(&source) { + report.mode_marked = true; report.note = Some("already marked `markup: occlusion`".into()); return Ok(report); } - // The original must be readable in classic mode (that is what it means today). + // Migration is deliberately syntax-only. Resolving imports here makes a + // library's safe local rewrite depend on the host checkout, unavailable + // plugins, or a transitive dependency that is itself being migrated. + // Import resolution and both execution backends are verified afterwards by + // the repository migration suite. let original = crate::parse::expr::with_markup(crate::parse::expr::Markup::Classic, || { - crate::load::load_module(path) + crate::parse::parse_source(&source) })?; let classified = crate::lex::classify_source(&source); @@ -516,7 +544,7 @@ pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result { lines[idx] = new_line; } } - if report.indexes == 0 && report.loops == 0 { + if report.indexes == 0 && report.loops == 0 && !mark_all { report.note = Some("no legacy index or loop".into()); return Ok(report); } @@ -526,11 +554,12 @@ pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result { body.push('\n'); } let migrated = add_marker(&body); + report.mode_marked = true; // Prove equivalence: the migrated file, parsed in occlusion mode and // denormalized, must be structurally identical to the original. let reparsed = crate::parse::expr::with_markup(crate::parse::expr::Markup::Occlusion, || { - crate::load::load_module_from_source(&migrated) + crate::parse::parse_source(&migrated) })?; if std::env::var("MARQDO_MIGRATE_DEBUG").is_ok() { eprintln!("ORIG: {}", shape(&original)); @@ -550,15 +579,25 @@ pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result { /// Recursively migrate every `*.mq.md` under `path`. pub fn migrate_path(path: &Path, write: bool) -> anyhow::Result> { + migrate_path_with_options(path, write, false) +} + +/// Recursive counterpart of [`migrate_file_with_options`]. +pub fn migrate_path_with_options( + path: &Path, + write: bool, + mark_all: bool, +) -> anyhow::Result> { let files = crate::migrate::collect_files(path); let mut out = Vec::new(); for f in files { - match migrate_file(&f, write) { + match migrate_file_with_options(&f, write, mark_all) { Ok(r) => out.push(r), Err(e) => out.push(FileReport { file: f, indexes: 0, loops: 0, + mode_marked: false, applied: false, note: Some(format!("load failed: {e:#}")), }), @@ -731,12 +770,17 @@ pub fn migrate_imports_path(path: &Path, write: bool) -> anyhow::Result Vec { fn walk(dir: &Path, out: &mut Vec) { - let Ok(rd) = std::fs::read_dir(dir) else { return }; + let Ok(rd) = std::fs::read_dir(dir) else { + return; + }; for e in rd.flatten() { let p = e.path(); let name = p.file_name().and_then(|n| n.to_str()).unwrap_or(""); if p.is_dir() { - if matches!(name, "target" | "dist" | "node_modules" | ".git" | ".marqdo") { + if matches!( + name, + "target" | "dist" | "node_modules" | ".git" | ".marqdo" + ) { continue; } walk(&p, out); @@ -760,7 +804,8 @@ mod tests { #[test] fn rewrites_import_oneliners_to_nested() { - let src = "---\ntitle: t\nimport json:lib/json.mq.md\nimport fmt:time.format\n---\n\n# main\n"; + let src = + "---\ntitle: t\nimport json:lib/json.mq.md\nimport fmt:time.format\n---\n\n# main\n"; let (out, n) = rewrite_import_frontmatter(src).unwrap().unwrap(); assert_eq!(n, 2); assert!(out.contains("import:\n json: lib/json.mq.md\n fmt: time.format\n")); diff --git a/src/parse/expr.rs b/src/parse/expr.rs index 48ace79..15c3791 100644 --- a/src/parse/expr.rs +++ b/src/parse/expr.rs @@ -11,13 +11,14 @@ pub fn parse_expr(input: &str) -> Result { /// Markup mode for `[描述](实现)` vs the legacy `[键](集合)` index. `` M2 /// /// `Classic` keeps the legacy index semantics; `Occlusion` reads the same shape -/// as an occlusion. The compatibility default remains `Classic` until every -/// shipped library has an explicit per-file declaration; new syntax opts in -/// with `markup: occlusion`. No environment/process switch exists. +/// as an occlusion. Every shipped module declares its mode and new/unmarked +/// sources use `Occlusion`. The legacy grammar is available only through an +/// explicit `markup: classic` declaration or the one-cycle CLI compatibility +/// flag. No environment/process switch exists. #[derive(Clone, Copy, PartialEq, Eq, Debug, Default)] pub enum Markup { - #[default] Classic, + #[default] Occlusion, } @@ -43,7 +44,7 @@ pub fn markup_default() -> Markup { if let Some(m) = MARKUP_OVERRIDE.with(|c| c.get()) { return m; } - Markup::Classic + Markup::Occlusion } /// Italic / bold value syntax: bare words are variables; text needs `"…"` / `'…'`. @@ -160,7 +161,10 @@ fn is_text_only_div_chain(e: &Expr) -> bool { op: BinaryOp::Div, left, right, - } => is_text_only_div_chain(left) && matches!(right.as_ref(), Expr::Literal(Literal::Text(_))), + } => { + is_text_only_div_chain(left) + && matches!(right.as_ref(), Expr::Literal(Literal::Text(_))) + } _ => false, } } @@ -196,7 +200,10 @@ fn has_hyphenated_prose(s: &str) -> bool { continue; } // `none-falsy` / `Hello-World` — not `` `n` - 1 `` - if left.is_alphanumeric() || right.is_alphanumeric() || !left.is_ascii() || !right.is_ascii() + if left.is_alphanumeric() + || right.is_alphanumeric() + || !left.is_ascii() + || !right.is_ascii() { return true; } @@ -598,7 +605,10 @@ impl<'a> Parser<'a> { self.i += '空'.len_utf8(); return Ok(Expr::Literal(Literal::None)); } - if self.peek_char().map(|c| c.is_ascii_digit()).unwrap_or(false) + if self + .peek_char() + .map(|c| c.is_ascii_digit()) + .unwrap_or(false) || (self.peek_char() == Some('.') && self .rest() @@ -608,13 +618,21 @@ impl<'a> Parser<'a> { .unwrap_or(false)) { let start = self.i; - while self.peek_char().map(|c| c.is_ascii_digit()).unwrap_or(false) { + while self + .peek_char() + .map(|c| c.is_ascii_digit()) + .unwrap_or(false) + { self.bump_char(); } if self.peek_char() == Some('.') { self.bump_char(); let frac_start = self.i; - while self.peek_char().map(|c| c.is_ascii_digit()).unwrap_or(false) { + while self + .peek_char() + .map(|c| c.is_ascii_digit()) + .unwrap_or(false) + { self.bump_char(); } // Require at least one digit on one side of the dot. @@ -633,7 +651,10 @@ impl<'a> Parser<'a> { } // Bare identifier / text word. If immediately followed by `[^…]`, treat as // variable + footnote index (exemption: ticks optional when `[^` marks the slot). - if self.peek_char().map(|c| c.is_alphanumeric() || c == '_' || !c.is_ascii()).unwrap_or(false) + if self + .peek_char() + .map(|c| c.is_alphanumeric() || c == '_' || !c.is_ascii()) + .unwrap_or(false) { let start = self.i; while let Some(c) = self.peek_char() { @@ -1105,7 +1126,6 @@ pub fn parse_call_tail(s: &str, prefer_var: bool) -> Result<(CallExpr, usize)> { )) } - /// Split a callee token into `(receiver, callee, lib path)`. fn split_callee(callee_tok: &str) -> (Option, String, Option>) { if let Some((r, m)) = split_method_callee(callee_tok) { @@ -1180,7 +1200,13 @@ fn try_bracket_marked_call(s: &str, prefer_var: bool) -> Result 0 && !s[..i].chars().last().map(|c| c.is_whitespace()).unwrap_or(false) { + if i > 0 + && !s[..i] + .chars() + .last() + .map(|c| c.is_whitespace()) + .unwrap_or(false) + { i += 1; continue; } @@ -1226,23 +1252,22 @@ fn try_bracket_marked_call(s: &str, prefer_var: bool) -> Result= 2 + { + callee_tok[1..callee_tok.len() - 1].to_string() } else { - let name = if callee_tok.starts_with('`') - && callee_tok.ends_with('`') - && callee_tok.len() >= 2 - { - callee_tok[1..callee_tok.len() - 1].to_string() - } else { - callee_tok - }; - (None, name, None) + callee_tok }; + (None, name, None) + }; let after_full = &s[close + 1..]; let args_src = after_full.trim_start(); let ws = after_full.len() - args_src.len(); @@ -1325,10 +1350,7 @@ fn parse_call_args( } else { parse_call_arg_value_mode(val_raw, prefer_var, paren_mode)? }; - args.push(Arg::Named { - name: key, - value, - }); + args.push(Arg::Named { name: key, value }); rest = after_eq[val_end..].trim_start(); } else { if seen_named { @@ -1647,7 +1669,6 @@ fn find_next_arg_boundary(after_eq: &str, paren_mode: bool) -> usize { after_eq.len() } - /// Parse `> callee args` call expression/statement text (without leading `>`). /// When `prefer_var` (inside `*…*` / `**…**`), bare call-arg words are variables /// and a bare dotted callee may be a method receiver (resolved at eval/compile). @@ -1685,7 +1706,13 @@ mod tests { let e = parse_expr_prefer_var("answer").unwrap(); assert!(matches!(e, Expr::Var(ref n) if n == "answer")); let e = parse_expr_prefer_var("n + 1").unwrap(); - assert!(matches!(e, Expr::Binary { op: BinaryOp::Add, .. })); + assert!(matches!( + e, + Expr::Binary { + op: BinaryOp::Add, + .. + } + )); let e = parse_expr_prefer_var("\"ok\"").unwrap(); assert!(matches!(e, Expr::Literal(Literal::Text(ref s)) if s == "ok")); let e = parse_expr_prefer_var("'hi'").unwrap(); @@ -1815,7 +1842,13 @@ mod tests { #[test] fn chinese_logic_and_literals() { let e = parse_expr("`a` 且 非 `b`").unwrap(); - assert!(matches!(e, Expr::Binary { op: BinaryOp::And, .. })); + assert!(matches!( + e, + Expr::Binary { + op: BinaryOp::And, + .. + } + )); assert!(matches!( parse_expr("真").unwrap(), Expr::Literal(Literal::Bool(true)) @@ -1887,7 +1920,13 @@ mod tests { let e = parse_expr("0.85").unwrap(); assert!(matches!(e, Expr::Literal(Literal::Num(n)) if (n - 0.85).abs() < 1e-12)); let e = parse_expr("28 * 0.85").unwrap(); - assert!(matches!(e, Expr::Binary { op: BinaryOp::Mul, .. })); + assert!(matches!( + e, + Expr::Binary { + op: BinaryOp::Mul, + .. + } + )); let e = parse_expr_prefer_var("菜单[^`名`]").unwrap(); match e { Expr::Index { base, label } => { @@ -1949,8 +1988,6 @@ mod tests { } } - - #[cfg(test)] mod bracket_call_tests { use super::*; @@ -2027,7 +2064,11 @@ mod bracket_call_tests { fn paren_call_bare_number_stops_at_paren() { // 历史缺陷:末个位置实参会吞掉 `)` let (c, used) = parse_call_tail("加(31)", false).unwrap(); - assert_eq!(used, "加(31)".len(), "consumed must cover the closing paren"); + assert_eq!( + used, + "加(31)".len(), + "consumed must cover the closing paren" + ); assert_eq!(c.args.len(), 1); } @@ -2069,7 +2110,10 @@ mod bracket_call_tests { fn paren_call_lib_path_and_method() { let c = call_of(parse_expr("txt.str_trim(s)").unwrap()); assert_eq!(c.callee, "str_trim"); - assert_eq!(c.path.as_deref(), Some(&["txt".to_string(), "str_trim".to_string()][..])); + assert_eq!( + c.path.as_deref(), + Some(&["txt".to_string(), "str_trim".to_string()][..]) + ); // 点号 callee 在 parse 期保存为 lib path;若 `obj` 是局部变量, // 运行期 eval_call 会把它当 method receiver(与 `> obj.方法` 一致)。 @@ -2088,11 +2132,13 @@ mod bracket_call_tests { assert_eq!(c.callee, "birth_year"); assert_eq!( c.path.as_deref(), - Some(&[ - "facts".to_string(), - "Person".to_string(), - "birth_year".to_string(), - ][..]) + Some( + &[ + "facts".to_string(), + "Person".to_string(), + "birth_year".to_string(), + ][..] + ) ); assert!(c.args.is_empty()); } @@ -2199,13 +2245,19 @@ mod bracket_call_tests { assert_eq!(label, "外层"); let (inner_label, inner_payload) = occl(payload.unwrap()); assert_eq!(inner_label, "内层"); - assert!(matches!(inner_payload, Some(Expr::Literal(Literal::Int(1))))); + assert!(matches!( + inner_payload, + Some(Expr::Literal(Literal::Int(1))) + )); } #[test] fn occlusion_classic_mode_keeps_index() { let e = parse_expr_markup("[键](表)", false, Markup::Classic).unwrap(); - assert!(matches!(e, Expr::Index { .. }), "classic must stay an index"); + assert!( + matches!(e, Expr::Index { .. }), + "classic must stay an index" + ); } #[test] diff --git a/tests/contracts/arg_mismatch.mq.md b/tests/contracts/arg_mismatch.mq.md index 97cc2c1..3c7de49 100644 --- a/tests/contracts/arg_mismatch.mq.md +++ b/tests/contracts/arg_mismatch.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # main > 加一 "七" diff --git a/tests/contracts/bound_data_table.mq.md b/tests/contracts/bound_data_table.mq.md index 92984eb..ef89fdd 100644 --- a/tests/contracts/bound_data_table.mq.md +++ b/tests/contracts/bound_data_table.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # main `列说明` = diff --git a/tests/contracts/field_mismatch.mq.md b/tests/contracts/field_mismatch.mq.md index 54b5b1d..7f7bd68 100644 --- a/tests/contracts/field_mismatch.mq.md +++ b/tests/contracts/field_mismatch.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # main | 字段 | 类型 | 可空 | diff --git a/tests/contracts/ok_contract.mq.md b/tests/contracts/ok_contract.mq.md index eca4759..784ae0e 100644 --- a/tests/contracts/ok_contract.mq.md +++ b/tests/contracts/ok_contract.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # main **结果 = > 加一 3** diff --git a/tests/contracts/return_mismatch.mq.md b/tests/contracts/return_mismatch.mq.md index b125bd2..fd40191 100644 --- a/tests/contracts/return_mismatch.mq.md +++ b/tests/contracts/return_mismatch.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # main **结果 = > 转换 "七"** diff --git a/tests/contracts/unknown_key.mq.md b/tests/contracts/unknown_key.mq.md index 6effc47..b264009 100644 --- a/tests/contracts/unknown_key.mq.md +++ b/tests/contracts/unknown_key.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + # main | 字段 | 类型 | 可空 | diff --git a/tests/engineering/config_resolve.mq.md b/tests/engineering/config_resolve.mq.md index 676fc3d..eb23ffe 100644 --- a/tests/engineering/config_resolve.mq.md +++ b/tests/engineering/config_resolve.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Resolve configuration capability: config.resolve status: stable diff --git a/tests/engineering/normalize_settings.mq.md b/tests/engineering/normalize_settings.mq.md index dd22208..e0805d1 100644 --- a/tests/engineering/normalize_settings.mq.md +++ b/tests/engineering/normalize_settings.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Normalize settings (near-duplicate) status: stable --- diff --git a/tests/errors/bad-arity.mq.md b/tests/errors/bad-arity.mq.md index 0fad187..dc35d7e 100644 --- a/tests/errors/bad-arity.mq.md +++ b/tests/errors/bad-arity.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: bad arity --- diff --git a/tests/errors/bad-int.mq.md b/tests/errors/bad-int.mq.md index 1423f52..cd42b54 100644 --- a/tests/errors/bad-int.mq.md +++ b/tests/errors/bad-int.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: bad int --- diff --git a/tests/errors/bad-split-sep.mq.md b/tests/errors/bad-split-sep.mq.md index aa80119..4dba869 100644 --- a/tests/errors/bad-split-sep.mq.md +++ b/tests/errors/bad-split-sep.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: empty split sep --- diff --git a/tests/errors/div-zero.mq.md b/tests/errors/div-zero.mq.md index 7e9cd51..c23a523 100644 --- a/tests/errors/div-zero.mq.md +++ b/tests/errors/div-zero.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: division by zero --- diff --git a/tests/errors/footnote-missing-key.mq.md b/tests/errors/footnote-missing-key.mq.md index f7a86de..82db8ee 100644 --- a/tests/errors/footnote-missing-key.mq.md +++ b/tests/errors/footnote-missing-key.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: footnote missing map key --- diff --git a/tests/errors/footnote-oob.mq.md b/tests/errors/footnote-oob.mq.md index 31f25e2..c9071c1 100644 --- a/tests/errors/footnote-oob.mq.md +++ b/tests/errors/footnote-oob.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: footnote list out of range --- diff --git a/tests/errors/footnote-zero.mq.md b/tests/errors/footnote-zero.mq.md index be58415..b3ff296 100644 --- a/tests/errors/footnote-zero.mq.md +++ b/tests/errors/footnote-zero.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: footnote [^0] invalid --- diff --git a/tests/errors/inherit-cycle.mq.md b/tests/errors/inherit-cycle.mq.md index 8ae56ca..72fbaa7 100644 --- a/tests/errors/inherit-cycle.mq.md +++ b/tests/errors/inherit-cycle.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: cyclic inheritance --- diff --git a/tests/errors/inherit-unknown-base.mq.md b/tests/errors/inherit-unknown-base.mq.md index 2124989..af07d98 100644 --- a/tests/errors/inherit-unknown-base.mq.md +++ b/tests/errors/inherit-unknown-base.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: unknown base type --- diff --git a/tests/errors/ns-instance-method.mq.md b/tests/errors/ns-instance-method.mq.md index de040ae..49e5013 100644 --- a/tests/errors/ns-instance-method.mq.md +++ b/tests/errors/ns-instance-method.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: path to instance method needs receiver import: helpers: ../structure/ns/helpers.mq.md diff --git a/tests/errors/undefined-var.mq.md b/tests/errors/undefined-var.mq.md index 8b88621..965b1f1 100644 --- a/tests/errors/undefined-var.mq.md +++ b/tests/errors/undefined-var.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: undefined variable --- diff --git a/tests/errors/unknown-fn.mq.md b/tests/errors/unknown-fn.mq.md index 7edb799..2d40bc4 100644 --- a/tests/errors/unknown-fn.mq.md +++ b/tests/errors/unknown-fn.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: unknown function --- diff --git a/tests/ext/agent-constitution-b0.mq.md b/tests/ext/agent-constitution-b0.mq.md index 6658569..fe58bfe 100644 --- a/tests/ext/agent-constitution-b0.mq.md +++ b/tests/ext/agent-constitution-b0.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent constitution markers (Wave B1 offline) description: Assert call_site / source / protocol order in build_step_context. import: diff --git a/tests/ext/agent-context-budget-a3.mq.md b/tests/ext/agent-context-budget-a3.mq.md index 2a9904b..e40f34b 100644 --- a/tests/ext/agent-context-budget-a3.mq.md +++ b/tests/ext/agent-context-budget-a3.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent context budget + progressive disclose (A3 offline) description: source/skill briefs truncate with markers; READ:skill deepen; step protocol mentions READ. import: diff --git a/tests/ext/agent-dump-context.mq.md b/tests/ext/agent-dump-context.mq.md index 968a3b1..37e2142 100644 --- a/tests/ext/agent-dump-context.mq.md +++ b/tests/ext/agent-dump-context.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: dump_step_context (Wave B1 offline) description: Assert dump_step_context exposes call_site + prompt without LLM. import: diff --git a/tests/ext/agent-inspect-fixture.mq.md b/tests/ext/agent-inspect-fixture.mq.md index 6170d02..bcc5455 100644 --- a/tests/ext/agent-inspect-fixture.mq.md +++ b/tests/ext/agent-inspect-fixture.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent inspect_workbook (offline) description: Parse named writeback slots from a fixture workbook path. import: diff --git a/tests/ext/agent-kb-alias.mq.md b/tests/ext/agent-kb-alias.mq.md index ba74f6c..93c13c1 100644 --- a/tests/ext/agent-kb-alias.mq.md +++ b/tests/ext/agent-kb-alias.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: OKF agent-kb alias lookup (offline) description: Promote resource; patch Task aliases; variant goal hits same resource. import: diff --git a/tests/ext/agent-kb-near.mq.md b/tests/ext/agent-kb-near.mq.md index 6335f28..3b66869 100644 --- a/tests/ext/agent-kb-near.mq.md +++ b/tests/ext/agent-kb-near.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: OKF agent-kb near_match (offline) description: Promote trip resource; near-dupe goals hit match=near; unrelated misses. import: diff --git a/tests/ext/agent-kb-plan-hit.mq.md b/tests/ext/agent-kb-plan-hit.mq.md index be7f9ab..d83e39e 100644 --- a/tests/ext/agent-kb-plan-hit.mq.md +++ b/tests/ext/agent-kb-plan-hit.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: OKF plan llm_free hit + list_tasks curation (A1 offline) description: Promote solidified workbook; plan same goal takes cache=hit; near→soft-hit; list_tasks exposes status/llm_free. import: diff --git a/tests/ext/agent-kb-reuse.mq.md b/tests/ext/agent-kb-reuse.mq.md index 644a281..e7e99a8 100644 --- a/tests/ext/agent-kb-reuse.mq.md +++ b/tests/ext/agent-kb-reuse.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: OKF agent-kb promote + lookup + spawn (offline) description: Promote a solidified workbook, lookup by goal, spawn without parent LLM. import: diff --git a/tests/ext/agent-lib-call.mq.md b/tests/ext/agent-lib-call.mq.md index dc5458c..21d6b4d 100644 --- a/tests/ext/agent-lib-call.mq.md +++ b/tests/ext/agent-lib-call.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Parent CALL:lib whitelist (offline) description: lib.fs.exists + ARGS; reject lib.net; catalog callable. import: diff --git a/tests/ext/agent-llm-transport-soft.mq.md b/tests/ext/agent-llm-transport-soft.mq.md index d1f6c06..e2e8a50 100644 --- a/tests/ext/agent-llm-transport-soft.mq.md +++ b/tests/ext/agent-llm-transport-soft.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent / llm soft transport errors description: >- Regression (2026-10): unreachable OpenAI upstream must not abort the VM. diff --git a/tests/ext/agent-mcp-client.mq.md b/tests/ext/agent-mcp-client.mq.md index 543e454..5f7aff9 100644 --- a/tests/ext/agent-mcp-client.mq.md +++ b/tests/ext/agent-mcp-client.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent MCP stdio client (offline) description: Oneshoot list+call against python mock MCP server. import: diff --git a/tests/ext/agent-mcp-server-helpers.mq.md b/tests/ext/agent-mcp-server-helpers.mq.md index 76248eb..2ebea8c 100644 --- a/tests/ext/agent-mcp-server-helpers.mq.md +++ b/tests/ext/agent-mcp-server-helpers.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent mcp server smoke helpers description: Tool target for MCP server smoke. --- diff --git a/tests/ext/agent-mcp-server-smoke.mq.md b/tests/ext/agent-mcp-server-smoke.mq.md index d895859..db9e26d 100644 --- a/tests/ext/agent-mcp-server-smoke.mq.md +++ b/tests/ext/agent-mcp-server-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent mcp server smoke description: Offline assemble mcp_server + one tool (no serve). import: @@ -18,15 +19,15 @@ import: **srv = > agent.mcp_server name="marqdo-test"** **srv = > `srv`.tool name="ping" fn="demo.ping" description="ping tool"** -**tools = [tools](srv)** +**tools = [tools](access(srv, "tools"))** **n = > len value=`tools`** 1. `n` == 1 > print text=mcp-tool-ok 2. * > print text=mcp-tool-fail -**t0 = [1](tools)** -**fn = [fn](t0)** +**t0 = [1](access(tools, "1"))** +**fn = [fn](access(t0, "fn"))** 1. `fn` == "demo.ping" > print text=mcp-fn-ok 2. * diff --git a/tests/ext/agent-p4-route.mq.md b/tests/ext/agent-p4-route.mq.md index 95f1665..b60dd37 100644 --- a/tests/ext/agent-p4-route.mq.md +++ b/tests/ext/agent-p4-route.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Agent Framework P4 — Adaptive Routing + Policy Compilation (offline) description: Learn skill, compile policy from skill-tagged episodes, route via marqdo backend without Jev/LLM. import: diff --git a/tests/ext/agent-plan-confirm.mq.md b/tests/ext/agent-plan-confirm.mq.md index a548d6f..a4f6fc7 100644 --- a/tests/ext/agent-plan-confirm.mq.md +++ b/tests/ext/agent-plan-confirm.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent plan confirm (offline) description: Create workbook skeleton with confirm=True; no LLM spawn loop. import: diff --git a/tests/ext/agent-plan-decision.mq.md b/tests/ext/agent-plan-decision.mq.md index 2e4a915..fda116a 100644 --- a/tests/ext/agent-plan-decision.mq.md +++ b/tests/ext/agent-plan-decision.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent plan decision + dual skeleton (offline) description: extract_plan_decision/summary; dual skeleton contains research+writer; patch apply on fixture. import: diff --git a/tests/ext/agent-plan-live.mq.md b/tests/ext/agent-plan-live.mq.md index 92d565d..7191f9a 100644 --- a/tests/ext/agent-plan-live.mq.md +++ b/tests/ext/agent-plan-live.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/agent plan live (DeepSeek) description: Full plan loop — spawn workbook, inspect, secondary plan; simple pong goal. import: diff --git a/tests/ext/agent-plan-observe.mq.md b/tests/ext/agent-plan-observe.mq.md index 8f4c946..894b659 100644 --- a/tests/ext/agent-plan-observe.mq.md +++ b/tests/ext/agent-plan-observe.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: parent observation excerpt + deepen (offline) import: agent: ext/ai/agent.mq.md diff --git a/tests/ext/agent-plan-preserve.mq.md b/tests/ext/agent-plan-preserve.mq.md index c7a72c7..f08a218 100644 --- a/tests/ext/agent-plan-preserve.mq.md +++ b/tests/ext/agent-plan-preserve.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: plan must not overwrite existing llm_free resources description: force+confirm plan keeps a pre-seeded compiled skill workbook intact (offline). import: @@ -28,12 +29,12 @@ import: **_ = 1** > fs.make_dirs path=`kb` **parts = > json.parse text={"res":"/resources/","ext":".mq.md","dir":"/resources"}** -**res_dir = kb + [dir](`parts`)** +**res_dir = kb + [dir](access(`parts`, "dir"))** > fs.make_dirs path=`res_dir` **goal = "Preserve compiled skill body under force plan"** **slug = > agent_goal_slug goal=`goal`** -**res = kb + [res](`parts`) + slug + [ext](`parts`)** +**res = kb + [res](access(`parts`, "res")) + slug + [ext](access(`parts`, "ext"))** **body = > fs.read_text path="fixtures/preserve-skill.mq.md"** > fs.write_text path=`res` text=`body` diff --git a/tests/ext/agent-plan-stream-offline.mq.md b/tests/ext/agent-plan-stream-offline.mq.md index 316afc9..9525f75 100644 --- a/tests/ext/agent-plan-stream-offline.mq.md +++ b/tests/ext/agent-plan-stream-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent plan stream helpers + confirm (offline) description: plan_append_*/plan_finish_stream; confirm=True with stream attaches done event. import: diff --git a/tests/ext/agent-resume.mq.md b/tests/ext/agent-resume.mq.md index 04c5ac0..b217cdf 100644 --- a/tests/ext/agent-resume.mq.md +++ b/tests/ext/agent-resume.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent resume checkpoint (offline) description: save / load / list / clear under .marqdo/agent-resume-test import: diff --git a/tests/ext/agent-run-cold-efi.mq.md b/tests/ext/agent-run-cold-efi.mq.md index 18d65d5..3466f39 100644 --- a/tests/ext/agent-run-cold-efi.mq.md +++ b/tests/ext/agent-run-cold-efi.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent.run cold OKF — resolve llm_free + self.preflight description: >- Regression for qdagent-facing bugs (2026-10): diff --git a/tests/ext/agent-run-live.mq.md b/tests/ext/agent-run-live.mq.md index 317f51a..04539de 100644 --- a/tests/ext/agent-run-live.mq.md +++ b/tests/ext/agent-run-live.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/agent step (DeepSeek) description: Real agent.step with tool via lib/subtask; default writeback to ok/error slots. import: diff --git a/tests/ext/agent-sandbox-optin.mq.md b/tests/ext/agent-sandbox-optin.mq.md index 79c9b9e..6a846b5 100644 --- a/tests/ext/agent-sandbox-optin.mq.md +++ b/tests/ext/agent-sandbox-optin.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent trial sandbox opt-in — host unchanged until commit description: > O1: agent.trial write stays upper until commit=True. @@ -24,8 +25,8 @@ Reset leftover workspace from prior runs. Trial with `commit=False`: upper write must not touch the host tree. **dry = agent.trial root="_sbx_optin" write_path="proof.txt" text=optin-ok commit=False** -**dry_ok = [ok](dry)** -**dry_committed = [committed](dry)** +**dry_ok = [ok](access(dry, "ok"))** +**dry_committed = [committed](access(dry, "committed"))** > print text=`dry_ok` > print text=`dry_committed` @@ -35,8 +36,8 @@ Trial with `commit=False`: upper write must not touch the host tree. Trial with `commit=True`: host sees the file after success. **wet = agent.trial root="_sbx_optin" write_path="proof.txt" text=optin-ok commit=True** -**wet_ok = [ok](wet)** -**wet_committed = [committed](wet)** +**wet_ok = [ok](access(wet, "ok"))** +**wet_committed = [committed](access(wet, "committed"))** > print text=`wet_ok` > print text=`wet_committed` @@ -45,6 +46,6 @@ Trial with `commit=True`: host sees the file after success. Profile row is attached (link-index readable). -**prof = [profile](wet)** -**pname = [name](prof)** +**prof = [profile](access(wet, "profile"))** +**pname = [name](access(prof, "name"))** > print text=`pname` diff --git a/tests/ext/agent-small-llm-route.mq.md b/tests/ext/agent-small-llm-route.mq.md index a75cde4..83ce286 100644 --- a/tests/ext/agent-small-llm-route.mq.md +++ b/tests/ext/agent-small-llm-route.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent small-llm route request (offline) description: router=small-llm returns needs_llm + prompt; jev alias same shape. import: diff --git a/tests/ext/agent-smoke.mq.md b/tests/ext/agent-smoke.mq.md index 993709c..45157ea 100644 --- a/tests/ext/agent-smoke.mq.md +++ b/tests/ext/agent-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/agent framework smoke description: Real llm handle from tests/ext/.env; context, extract_tool_name, run_tool via subtask. import: diff --git a/tests/ext/agent-soft-match.mq.md b/tests/ext/agent-soft-match.mq.md index 96d288f..6f637c6 100644 --- a/tests/ext/agent-soft-match.mq.md +++ b/tests/ext/agent-soft-match.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: OKF soft_match protocol parse (offline) description: REUSE/NEW + SLUG extractors; no network. import: diff --git a/tests/ext/agent-step-route.mq.md b/tests/ext/agent-step-route.mq.md index 867f747..da5fcc2 100644 --- a/tests/ext/agent-step-route.mq.md +++ b/tests/ext/agent-step-route.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: O3 step_route table backends description: lookup → marqdo; net → llm; default → auto. import: @@ -8,13 +9,13 @@ import: # main **a = agent.step_route kind="lookup"** -**ba = [backend](a)** +**ba = [backend](access(a, "backend"))** > print text=`ba` **b = agent.step_route kind="net"** -**bb = [backend](b)** +**bb = [backend](access(b, "backend"))** > print text=`bb` **c = agent.step_route kind="default"** -**bc = [backend](c)** +**bc = [backend](access(c, "backend"))** > print text=`bc` diff --git a/tests/ext/agent-tools-rag-a4.mq.md b/tests/ext/agent-tools-rag-a4.mq.md index dc4d796..554c77a 100644 --- a/tests/ext/agent-tools-rag-a4.mq.md +++ b/tests/ext/agent-tools-rag-a4.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent corpus_search + mcp fixture tools (A4 offline) description: Local RAG-lite corpus search and MCP fixture call; authority stays workbook. import: diff --git a/tests/ext/agent-v2-learn.mq.md b/tests/ext/agent-v2-learn.mq.md index 288a834..7448a50 100644 --- a/tests/ext/agent-v2-learn.mq.md +++ b/tests/ext/agent-v2-learn.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Agent Framework v2 — episode → learn → compile (offline) description: Record three identical successes, maybe_learn compiles llm_free skill, resolve hits compiled path. import: diff --git a/tests/ext/agent-workbook-patch-a0.mq.md b/tests/ext/agent-workbook-patch-a0.mq.md index 7b11789..d479646 100644 --- a/tests/ext/agent-workbook-patch-a0.mq.md +++ b/tests/ext/agent-workbook-patch-a0.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: agent workbook multi-CONTINUE patch + solidify (A0 offline) description: Two precise CONTINUE patches then agent_workbook_solidify freezes step workbook. import: diff --git a/tests/ext/agent-writeback-shadow.mq.md b/tests/ext/agent-writeback-shadow.mq.md index 67bf1f3..a5f5932 100644 --- a/tests/ext/agent-writeback-shadow.mq.md +++ b/tests/ext/agent-writeback-shadow.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: writeback param must not shadow writeback module description: Regression — step/plan param writeback=True used to break > writeback.record (bool is not a map). Use a non-colliding import alias. import: diff --git a/tests/ext/agent-zero-llm.mq.md b/tests/ext/agent-zero-llm.mq.md index 260ca4d..0b3f364 100644 --- a/tests/ext/agent-zero-llm.mq.md +++ b/tests/ext/agent-zero-llm.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Agent zero-LLM execution after policy/skill compile description: After Skill+Policy compilation, run with router=marqdo records llm_calls=0. import: diff --git a/tests/ext/eng-preflight.mq.md b/tests/ext/eng-preflight.mq.md index ae7ef92..c7f13cb 100644 --- a/tests/ext/eng-preflight.mq.md +++ b/tests/ext/eng-preflight.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: eng preflight offline import: plugin: lib/plugin.mq.md diff --git a/tests/ext/fixtures/preserve-skill.mq.md b/tests/ext/fixtures/preserve-skill.mq.md index 4530d5a..6fe65a4 100644 --- a/tests/ext/fixtures/preserve-skill.mq.md +++ b/tests/ext/fixtures/preserve-skill.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: skill status: compiled llm_free: true diff --git a/tests/ext/fixtures/prompt-pong.mq.md b/tests/ext/fixtures/prompt-pong.mq.md index 50e56d4..035c147 100644 --- a/tests/ext/fixtures/prompt-pong.mq.md +++ b/tests/ext/fixtures/prompt-pong.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: prompt title: marqdo-one-liner --- diff --git a/tests/ext/fs-text-patch.mq.md b/tests/ext/fs-text-patch.mq.md index e0abe01..8578dc0 100644 --- a/tests/ext/fs-text-patch.mq.md +++ b/tests/ext/fs-text-patch.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: fs text_patch / apply_patch_blocks (offline) import: fs: lib/fs.mq.md diff --git a/tests/ext/linalg-basic-smoke.mq.md b/tests/ext/linalg-basic-smoke.mq.md index d4f25c2..52940f1 100644 --- a/tests/ext/linalg-basic-smoke.mq.md +++ b/tests/ext/linalg-basic-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: linalg basic smoke (L2) description: from_formula, det, solve 2×2, explicit mul. import: @@ -39,8 +40,8 @@ $$ > print text=trace-fail **`sol` = > la.solve a=`A` b=`b`** -**`x` = [x](sol)** -**`data` = [data](x)** +**`x` = [x](access(sol, "x"))** +**`data` = [data](access(x, "data"))** **`row0` = > at value=`data` index=0** **`x0` = > at value=`row0` index=0** **`e0` = > math.sub a=`x0` b=2** @@ -53,7 +54,7 @@ $$ **`I` = > la.eye n=2** **`P` = > la.mul a=`A` b=`I`** **`E` = > la.explicit expr=`P`** -**`ed` = [data](E)** +**`ed` = [data](access(E, "data"))** **`ed0` = > at value=`ed` index=0** **`ed00` = > at value=`ed0` index=0** **`ee` = > math.sub a=`ed00` b=2** diff --git a/tests/ext/linalg-block-kron.mq.md b/tests/ext/linalg-block-kron.mq.md index 2310fdf..6b80da5 100644 --- a/tests/ext/linalg-block-kron.mq.md +++ b/tests/ext/linalg-block-kron.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: linalg block/kron smoke (L3) description: Lazy kron ascii; block*block collapse. import: @@ -43,7 +44,7 @@ import: > print text=`ct` **`ping` = > la.ping** -**`ok` = [ok](ping)** +**`ok` = [ok](access(ping, "ok"))** 1. `ok` > print text=ping-ok 2. * diff --git a/tests/ext/linalg-doc-smoke.mq.md b/tests/ext/linalg-doc-smoke.mq.md index b88c4e2..8526b6d 100644 --- a/tests/ext/linalg-doc-smoke.mq.md +++ b/tests/ext/linalg-doc-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: linalg formula-doc smoke (F1) description: Run-implies-correct — (AB)^T ascii without explicit simplify. import: @@ -29,8 +30,8 @@ Narration: \((AB)^\top = B^\top A^\top\). The identity is checked by running thi | 2 | Y | 2 | 2 | **`env` = > la.declare table=`shapes`** -**`X` = [X](env)** -**`Y` = [Y](env)** +**`X` = [X](access(env, "X"))** +**`Y` = [Y](access(env, "Y"))** **`S` = `X` + `Y`** **`st` = > la.ascii expr=`S`** 1. `st` == "X + Y" diff --git a/tests/ext/linalg-factor-smoke.mq.md b/tests/ext/linalg-factor-smoke.mq.md index 16a36a5..caff146 100644 --- a/tests/ext/linalg-factor-smoke.mq.md +++ b/tests/ext/linalg-factor-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: linalg factor smoke (L4) description: eig factorize, structure SVG, LU reuse solve. import: @@ -17,13 +18,13 @@ $$ **`eps` = > math.div a=1 b=1000** **`f` = > la.factorize matrix=`M` kind="eig"** -**`kind` = [kind](f)** +**`kind` = [kind](access(f, "kind"))** 1. `kind` == eig > print text=eig-kind-ok 2. * > print text=eig-kind-fail -**`evals` = [eigenvalues](f)** +**`evals` = [eigenvalues](access(f, "eigenvalues"))** **`ev0` = > at value=`evals` index=0** **`e0` = > math.sub a=`ev0` b=3** **`e0` = > math.abs value=`e0`** @@ -33,13 +34,13 @@ $$ > print text=eig-val-fail **`img` = > la.draw factor=`f` kind="eig" path="linalg-factor-eig.svg"** -**`ik` = [kind](img)** +**`ik` = [kind](access(img, "kind"))** 1. `ik` == eig > print text=draw-kind-ok 2. * > print text=draw-kind-fail -**`svg` = [svg](img)** +**`svg` = [svg](access(img, "svg"))** **`parts` = > split value=`svg` sep="data-linalg=\"eig\""** **`pn` = > len value=`parts`** 1. `pn` > 1 @@ -61,8 +62,8 @@ $$ **`b` = > la.from_formula formula=`b`** **`lu` = > la.factorize matrix=`A` kind="lu"** **`sol` = > la.solve factor=`lu` b=`b`** -**`x` = [x](sol)** -**`data` = [data](x)** +**`x` = [x](access(sol, "x"))** +**`data` = [data](access(x, "data"))** **`row0` = > at value=`data` index=0** **`x0` = > at value=`row0` index=0** **`xe` = > math.sub a=`x0` b=2** @@ -73,7 +74,7 @@ $$ > print text=lu-solve-fail **`svd` = > la.factorize matrix=`M` kind="svd"** -**`sk` = [ascii](svd)** +**`sk` = [ascii](access(svd, "ascii"))** 1. `sk` == SVD > print text=svd-ok 2. * diff --git a/tests/ext/linalg-formula-smoke.mq.md b/tests/ext/linalg-formula-smoke.mq.md index 576b6b3..06d7b6b 100644 --- a/tests/ext/linalg-formula-smoke.mq.md +++ b/tests/ext/linalg-formula-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: linalg formula smoke description: (AB)^T simplifies to B^T*A^T; ping ok. import: @@ -16,7 +17,7 @@ import: > print text=`txt` **`ping` = > la.ping** -**`ok` = [ok](ping)** +**`ok` = [ok](access(ping, "ok"))** 1. `ok` > print text=ping-ok 2. * diff --git a/tests/ext/linalg-infix-smoke.mq.md b/tests/ext/linalg-infix-smoke.mq.md index 3965855..d62dbd4 100644 --- a/tests/ext/linalg-infix-smoke.mq.md +++ b/tests/ext/linalg-infix-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: linalg infix and matrix methods description: A+B / A*B dispatch; `A`.T method chain; display auto-simplify. import: @@ -18,7 +19,7 @@ import: **`st` = > `Pt`.ascii** > print text=`st` -**`ty` = [_type](C)** +**`ty` = [_type](access(C, "_type"))** 1. `ty` == matrix > print text=type-ok 2. * @@ -36,7 +37,7 @@ $$ **`S` = `M` + `N`** **`Se` = > la.explicit expr=`S`** -**`d` = [data](Se)** +**`d` = [data](access(Se, "data"))** **`r0` = > at value=`d` index=0** **`x00` = > at value=`r0` index=0** **`xs` = > str value=`x00`** diff --git a/tests/ext/linalg-metrics-smoke.mq.md b/tests/ext/linalg-metrics-smoke.mq.md index 167c038..ab2ee5f 100644 --- a/tests/ext/linalg-metrics-smoke.mq.md +++ b/tests/ext/linalg-metrics-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: linalg metrics smoke (L6) description: lstsq, norm, cond, rank, complex fro, themed draw. import: @@ -24,8 +25,8 @@ $$ **`eps` = > math.div a=1 b=1000** **`ls` = > la.lstsq a=`A` b=`b`** -**`x` = [x](ls)** -**`xd` = [data](x)** +**`x` = [x](access(ls, "x"))** +**`xd` = [data](access(x, "data"))** **`r0` = > at value=`xd` index=0** **`x0` = > at value=`r0` index=0** **`e0` = > math.sub a=`x0` b=1.1666666667** @@ -50,7 +51,7 @@ $$ **`D` = > la.from_formula formula=`D`** **`c` = > la.cond expr=`D`** -**`cv` = [value](c)** +**`cv` = [value](access(c, "value"))** **`ce` = > math.sub a=`cv` b=2** **`ce` = > math.abs value=`ce`** 1. `ce` < `eps` @@ -66,7 +67,7 @@ $$ **`raw` = > json.parse text="[[[0,1],[1,0]],[[1,0],[0,-1]]]"** **`Z` = > la.from_list data=`raw`** -**`dt` = [dtype](Z)** +**`dt` = [dtype](access(Z, "dtype"))** 1. `dt` == complex > print text=complex-dtype-ok 2. * @@ -81,13 +82,13 @@ $$ > print text=complex-norm-fail **`img` = > la.draw factor=`D` kind="heatmap" theme="dark" path="linalg-metrics-heat.svg"** -**`th` = [theme](img)** +**`th` = [theme](access(img, "theme"))** 1. `th` == dark > print text=theme-ok 2. * > print text=theme-fail -**`svg` = [svg](img)** +**`svg` = [svg](access(img, "svg"))** **`parts` = > split value=`svg` sep="data-theme=\"dark\""** **`pn` = > len value=`parts`** 1. `pn` > 1 diff --git a/tests/ext/linalg-zh-smoke.mq.md b/tests/ext/linalg-zh-smoke.mq.md index e3e112f..f09f257 100644 --- a/tests/ext/linalg-zh-smoke.mq.md +++ b/tests/ext/linalg-zh-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 线性代数公式冒烟 description: (AB)^T 化简为 B^T*A^T;探测 ok。 import: @@ -16,7 +17,7 @@ import: > 打印 内容=`txt` **`ping` = > la.探测** -**`ok` = [ok](ping)** +**`ok` = [ok](access(ping, "ok"))** 1. `ok` > 打印 内容=探测-ok 2. * diff --git a/tests/ext/llm-ask-offline.mq.md b/tests/ext/llm-ask-offline.mq.md index 69ea736..17fd39d 100644 --- a/tests/ext/llm-ask-offline.mq.md +++ b/tests/ext/llm-ask-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: llm create + collect offline description: Factory create + collect alias; no network. import: @@ -9,8 +10,8 @@ import: # main **model = > llm.create** -> print text=[model](`model`) -> print text=[backend](`model`) +> print text=[model](access(`model`, "model")) +> print text=[backend](access(`model`, "backend")) **fixture = "data: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"!\"}}]}\n\ndata: [DONE]\n"** **events = > net.openai_sse_parse text=`fixture`** diff --git a/tests/ext/llm-complete.mq.md b/tests/ext/llm-complete.mq.md index 6c5a9e6..ae82b2f 100644 --- a/tests/ext/llm-complete.mq.md +++ b/tests/ext/llm-complete.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext llm DeepSeek complete description: OpenAI-compatible chat via DeepSeek. Credentials from tests/ext/.env. import: diff --git a/tests/ext/llm-ctor-offline.mq.md b/tests/ext/llm-ctor-offline.mq.md index ea7fa2f..bc4b581 100644 --- a/tests/ext/llm-ctor-offline.mq.md +++ b/tests/ext/llm-ctor-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: llm constructor offline description: Build llm handle from env + defaults; no network. import: @@ -8,5 +9,5 @@ import: # main **model = > llm.llm** -> print text=[model](`model`) -> print text=[suffix](`model`) +> print text=[model](access(`model`, "model")) +> print text=[suffix](access(`model`, "suffix")) diff --git a/tests/ext/llm-entry-prompt-offline.mq.md b/tests/ext/llm-entry-prompt-offline.mq.md index 99b5377..19afb7e 100644 --- a/tests/ext/llm-entry-prompt-offline.mq.md +++ b/tests/ext/llm-entry-prompt-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: prompt title: entry prompt offline import: diff --git a/tests/ext/llm-import.mq.md b/tests/ext/llm-import.mq.md index 3522c36..5108916 100644 --- a/tests/ext/llm-import.mq.md +++ b/tests/ext/llm-import.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext llm import import: llm: ext/ai/llm.mq.md diff --git a/tests/ext/llm-meta-offline.mq.md b/tests/ext/llm-meta-offline.mq.md index 84c065f..b8c3b65 100644 --- a/tests/ext/llm-meta-offline.mq.md +++ b/tests/ext/llm-meta-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: llm meta binding offline description: Create handle from Artifact Metadata (model / api_key); no network. type: llm @@ -11,5 +12,5 @@ import: # main **h = > llm.llm** -> print text=[model](`h`) -> print text=[api_key](`h`) +> print text=[model](access(`h`, "model")) +> print text=[api_key](access(`h`, "api_key")) diff --git a/tests/ext/llm-named-offline.mq.md b/tests/ext/llm-named-offline.mq.md index 7076d6c..2947f09 100644 --- a/tests/ext/llm-named-offline.mq.md +++ b/tests/ext/llm-named-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: llm named handles + prompt_load offline description: fast/reasoning names, ollama backend tag, and type:prompt body load; no network. import: @@ -9,16 +10,16 @@ import: # main **fast = > llm.fast model="qwen-fast-test"** -> print text=[name](`fast`) -> print text=[model](`fast`) +> print text=[name](access(`fast`, "name")) +> print text=[model](access(`fast`, "model")) **reason = > llm.reasoning model="gpt-reason-test"** -> print text=[name](`reason`) -> print text=[model](`reason`) +> print text=[name](access(`reason`, "name")) +> print text=[model](access(`reason`, "model")) **ollama = > llm.create backend="ollama" model="llama3.2"** -> print text=[backend](`ollama`) -> print text=[model](`ollama`) +> print text=[backend](access(`ollama`, "backend")) +> print text=[model](access(`ollama`, "model")) **prompt = > llm.prompt_load path="fixtures/prompt-marqdo.md"** **has = > text.contains text=`prompt` sub="Explain Marqdo"** diff --git a/tests/ext/llm-stream-live.mq.md b/tests/ext/llm-stream-live.mq.md index e8a44f6..4aeb47d 100644 --- a/tests/ext/llm-stream-live.mq.md +++ b/tests/ext/llm-stream-live.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext llm DeepSeek stream live description: Live SSE complete with echo; credentials from tests/ext/.env. import: diff --git a/tests/ext/llm-stream-offline.mq.md b/tests/ext/llm-stream-offline.mq.md index b3badad..ab5269b 100644 --- a/tests/ext/llm-stream-offline.mq.md +++ b/tests/ext/llm-stream-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: llm stream_result offline description: No network — SSE fixture via net.openai_sse_parse + llm.stream_result import: diff --git a/tests/ext/llm-tool-calls-offline.mq.md b/tests/ext/llm-tool-calls-offline.mq.md index a5f8308..5e16591 100644 --- a/tests/ext/llm-tool-calls-offline.mq.md +++ b/tests/ext/llm-tool-calls-offline.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: llm tool_calls offline description: Parse OpenAI-shaped tool_calls into a list; no network. import: @@ -13,11 +14,11 @@ import: **tc = > openai.tool_calls_from data=`data`** **n = > len value=`tc`** > print text=`n` -**first = [1](tc)** -> print text=[id](`first`) -> print text=[type](`first`) -**fn = [function](first)** -> print text=[name](`fn`) +**first = [1](access(tc, "1"))** +> print text=[id](access(`first`, "id")) +> print text=[type](access(`first`, "type")) +**fn = [function](access(first, "function"))** +> print text=[name](access(`fn`, "name")) **empty_data = > json.parse text={"choices":[{"message":{"role":"assistant","content":"hi"}}]}** **empty = > openai.tool_calls_from data=`empty_data`** diff --git a/tests/ext/quantum-amp-damp-smoke.mq.md b/tests/ext/quantum-amp-damp-smoke.mq.md index 810128c..0af9620 100644 --- a/tests/ext/quantum-amp-damp-smoke.mq.md +++ b/tests/ext/quantum-amp-damp-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum amplitude damping smoke description: X then amplitude_damping p=1 returns all shots to |0>. import: @@ -11,7 +12,7 @@ import: **qc = > `qc`.x qubit=0** **qc = > `qc`.noise kind="amplitude_damping" p=1** **r = > `qc`.run shots=32 seed=7** -**c0 = [0]([counts](r))** +**c0 = [0](access([counts](access(r, "counts")), "0"))** 1. `c0` == 32 > print text=amp-ok diff --git a/tests/ext/quantum-amp-damp-zh-smoke.mq.md b/tests/ext/quantum-amp-damp-zh-smoke.mq.md index 1e6e376..18edc4f 100644 --- a/tests/ext/quantum-amp-damp-zh-smoke.mq.md +++ b/tests/ext/quantum-amp-damp-zh-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum amplitude damping zh smoke description: 泡利X 后 振幅阻尼 p=1 全部落回 |0⟩. 导入: @@ -11,7 +12,7 @@ description: 泡利X 后 振幅阻尼 p=1 全部落回 |0⟩. **qc = > `qc`.泡利X 比特=0** **qc = > `qc`.噪声 种类="振幅阻尼" 概率=1** **r = > `qc`.运行 次数=32 种子=7** -**c0 = [0]([counts](r))** +**c0 = [0](access([counts](access(r, "counts")), "0"))** 1. `c0` == 32 > print text=amp-ok diff --git a/tests/ext/quantum-author-api-smoke.mq.md b/tests/ext/quantum-author-api-smoke.mq.md index f0238e5..7bc5f78 100644 --- a/tests/ext/quantum-author-api-smoke.mq.md +++ b/tests/ext/quantum-author-api-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum author API smoke description: barrier, measure, append, state, draw meters. import: @@ -14,14 +15,14 @@ import: **qc = > `qc`.measure** **st = > `qc`.state** -**dim = [dim](st)** +**dim = [dim](access(st, "dim"))** 1. `dim` == 4 > print text=state-ok 2. * > print text=state-fail **img = > `qc`.draw path="quantum-author-draw.svg"** -**kind = [kind](img)** +**kind = [kind](access(img, "kind"))** 1. `kind` == circuit > print text=draw-ok 2. * @@ -30,7 +31,7 @@ import: **other = > quantum.circuit qubits=2** **other = > `other`.x qubit=1** **qc2 = > `qc`.append op=`other`** -**ops = [ops](qc2)** +**ops = [ops](access(qc2, "ops"))** **n = > len `ops`** 1. `n` == 5 > print text=append-ok diff --git a/tests/ext/quantum-author-api-zh-smoke.mq.md b/tests/ext/quantum-author-api-zh-smoke.mq.md index 9e34ac0..49d0958 100644 --- a/tests/ext/quantum-author-api-zh-smoke.mq.md +++ b/tests/ext/quantum-author-api-zh-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum author API zh smoke description: 屏障 / 测量 / 追加 / 态 / 绘图. 导入: @@ -14,14 +15,14 @@ description: 屏障 / 测量 / 追加 / 态 / 绘图. **qc = > `qc`.测量** **st = > `qc`.态** -**dim = [dim](st)** +**dim = [dim](access(st, "dim"))** 1. `dim` == 4 > print text=state-ok 2. * > print text=state-fail **img = > `qc`.绘图 路径="quantum-author-zh-draw.svg"** -**kind = [kind](img)** +**kind = [kind](access(img, "kind"))** 1. `kind` == circuit > print text=draw-ok 2. * @@ -30,7 +31,7 @@ description: 屏障 / 测量 / 追加 / 态 / 绘图. **other = > 量子.电路 比特数=2** **other = > `other`.泡利X 比特=1** **qc2 = > `qc`.追加 操作=`other`** -**ops = [ops](qc2)** +**ops = [ops](access(qc2, "ops"))** **n = > len `ops`** 1. `n` == 5 > print text=append-ok diff --git a/tests/ext/quantum-bell-smoke.mq.md b/tests/ext/quantum-bell-smoke.mq.md index 751509b..95da8ed 100644 --- a/tests/ext/quantum-bell-smoke.mq.md +++ b/tests/ext/quantum-bell-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum bell smoke description: H+CX Bell state probabilities ≈ 1/2 each. import: @@ -13,8 +14,8 @@ import: **qc = > `qc`.cx control=0 target=1** **p = > `qc`.probabilities** -**p00 = [00](p)** -**p11 = [11](p)** +**p00 = [00](access(p, "00"))** +**p11 = [11](access(p, "11"))** **lo = > math.div a=2 b=5** **hi = > math.div a=3 b=5** @@ -35,7 +36,7 @@ import: > print text=p11-fail **ping = > quantum_ping** -**ok = [ok](ping)** +**ok = [ok](access(ping, "ok"))** 1. `ok` > print text=ping-ok 2. * diff --git a/tests/ext/quantum-custom-gate-smoke.mq.md b/tests/ext/quantum-custom-gate-smoke.mq.md index e6862eb..c707b16 100644 --- a/tests/ext/quantum-custom-gate-smoke.mq.md +++ b/tests/ext/quantum-custom-gate-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum custom gate from formula matrix description: $$ H matrix $$ → gate matrix= → apply → probs match built-in H. import: @@ -17,7 +18,7 @@ $$ **qc = > quantum.circuit qubits=1** **qc = > `qc`.apply gate=`U` qubits=0** **p = > `qc`.probabilities** -**p0 = [0](p)** +**p0 = [0](access(p, "0"))** **lo = > math.div a=4 b=10** **hi = > math.div a=6 b=10** diff --git a/tests/ext/quantum-custom-gate-zh-smoke.mq.md b/tests/ext/quantum-custom-gate-zh-smoke.mq.md index 33d56c8..711e483 100644 --- a/tests/ext/quantum-custom-gate-zh-smoke.mq.md +++ b/tests/ext/quantum-custom-gate-zh-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum custom gate zh from formula description: $$ 矩阵 $$ → 门 矩阵= → 施加. 导入: @@ -17,7 +18,7 @@ $$ **qc = > 量子.电路 比特数=1** **qc = > `qc`.施加 门=`U` 比特=0** **p = > `qc`.概率** -**p0 = [0](p)** +**p0 = [0](access(p, "0"))** **lo = > math.div a=4 b=10** **hi = > math.div a=6 b=10** diff --git a/tests/ext/quantum-draw-smoke.mq.md b/tests/ext/quantum-draw-smoke.mq.md index efd2cfa..939d16c 100644 --- a/tests/ext/quantum-draw-smoke.mq.md +++ b/tests/ext/quantum-draw-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum draw probs/bloch smoke description: draw kind=probs and kind=bloch return matching kind tags. import: @@ -16,7 +17,7 @@ import: **qc = > quantum.circuit qubits=2 steps=`steps`** **img = > `qc`.draw kind="probs" path="quantum-draw-probs.svg"** -**kind = [kind](img)** +**kind = [kind](access(img, "kind"))** 1. `kind` == probs > print text=probs-ok @@ -26,7 +27,7 @@ import: **qc1 = > quantum.circuit qubits=1** **qc1 = > `qc1`.h qubit=0** **bloch = > `qc1`.draw kind="bloch" path="quantum-draw-bloch.svg"** -**bk = [kind](bloch)** +**bk = [kind](access(bloch, "kind"))** 1. `bk` == bloch > print text=bloch-ok diff --git a/tests/ext/quantum-gate-heatmap-smoke.mq.md b/tests/ext/quantum-gate-heatmap-smoke.mq.md index efbfcf9..794223d 100644 --- a/tests/ext/quantum-gate-heatmap-smoke.mq.md +++ b/tests/ext/quantum-gate-heatmap-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum gate matrix heatmap smoke description: gate.draw kind=matrix writes SVG heatmap. import: @@ -9,7 +10,7 @@ import: **H = > quantum.gate name="H"** **img = > `H`.draw kind="matrix" path="quantum-gate-heatmap.svg"** -**kind = [kind](img)** +**kind = [kind](access(img, "kind"))** 1. `kind` == matrix > print text=heatmap-ok diff --git a/tests/ext/quantum-gate-matrix-smoke.mq.md b/tests/ext/quantum-gate-matrix-smoke.mq.md index 1724356..6750dae 100644 --- a/tests/ext/quantum-gate-matrix-smoke.mq.md +++ b/tests/ext/quantum-gate-matrix-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum gate matches_matrix smoke description: Named H matches an explicit 2x2 nested list. import: diff --git a/tests/ext/quantum-gates-smoke.mq.md b/tests/ext/quantum-gates-smoke.mq.md index d220eb8..caea173 100644 --- a/tests/ext/quantum-gates-smoke.mq.md +++ b/tests/ext/quantum-gates-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum gates + run smoke description: Z sandwich, Ry(pi), seeded Bell run counts. import: @@ -15,7 +16,7 @@ H-Z-H on |0⟩ → |1⟩. **qc = > `qc`.z qubit=0** **qc = > `qc`.h qubit=0** **p = > `qc`.probabilities** -**p1 = [1](p)** +**p1 = [1](access(p, "1"))** **lo = > math.div a=9 b=10** 1. `p1` > `lo` @@ -29,7 +30,7 @@ Ry(π) on |0⟩ → |1⟩. **ry = > quantum.circuit qubits=1** **ry = > `ry`.ry qubit=0 theta=`pi`** **rp = > `ry`.probabilities** -**rp1 = [1](rp)** +**rp1 = [1](access(rp, "1"))** 1. `rp1` > `lo` > print text=ry-ok @@ -42,10 +43,10 @@ Bell run with fixed seed: both 00 and 11 appear; shots sum. **bell = > `bell`.h qubit=0** **bell = > `bell`.cx control=0 target=1** **res = > `bell`.run shots=200 seed=42** -**counts = [counts](res)** -**c00 = [00](counts)** -**c11 = [11](counts)** -**shots = [shots](res)** +**counts = [counts](access(res, "counts"))** +**c00 = [00](access(counts, "00"))** +**c11 = [11](access(counts, "11"))** +**shots = [shots](access(res, "shots"))** 1. `c00` 1. `c11` diff --git a/tests/ext/quantum-linalg-smoke.mq.md b/tests/ext/quantum-linalg-smoke.mq.md index 696afcd..979a9ec 100644 --- a/tests/ext/quantum-linalg-smoke.mq.md +++ b/tests/ext/quantum-linalg-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum linalg smoke description: Q7a density / partial_trace / expect / schmidt / purity import: @@ -41,7 +42,7 @@ import: > print text=expect-fail **sch = > `qc`.schmidt cut=1** -**ent = [entropy](sch)** +**ent = [entropy](access(sch, "entropy"))** **elo = > math.div a=1 b=2** 1. `ent` > `elo` > print text=schmidt-ok diff --git a/tests/ext/quantum-noise-smoke.mq.md b/tests/ext/quantum-noise-smoke.mq.md index 675e107..c92f618 100644 --- a/tests/ext/quantum-noise-smoke.mq.md +++ b/tests/ext/quantum-noise-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum noise smoke description: bitflip p=1 after I flips |0> to |1| for all shots. import: @@ -11,7 +12,7 @@ import: **qc = > `qc`.i qubit=0** **qc = > `qc`.noise kind="bitflip" p=1** **r = > `qc`.run shots=32 seed=3** -**c1 = [1]([counts](r))** +**c1 = [1](access([counts](access(r, "counts")), "1"))** 1. `c1` == 32 > print text=noise-ok diff --git a/tests/ext/quantum-noise-zh-smoke.mq.md b/tests/ext/quantum-noise-zh-smoke.mq.md index 5bc399c..ed728fb 100644 --- a/tests/ext/quantum-noise-zh-smoke.mq.md +++ b/tests/ext/quantum-noise-zh-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum noise zh smoke description: 噪声 bitflip p=1 后 I 使全部射中 |1⟩. 导入: @@ -11,7 +12,7 @@ description: 噪声 bitflip p=1 后 I 使全部射中 |1⟩. **qc = > `qc`.单位 比特=0** **qc = > `qc`.噪声 种类="bitflip" 概率=1** **r = > `qc`.运行 次数=32 种子=3** -**c1 = [1]([counts](r))** +**c1 = [1](access([counts](access(r, "counts")), "1"))** 1. `c1` == 32 > print text=noise-ok diff --git a/tests/ext/quantum-steps-smoke.mq.md b/tests/ext/quantum-steps-smoke.mq.md index 69d1b93..0957cc6 100644 --- a/tests/ext/quantum-steps-smoke.mq.md +++ b/tests/ext/quantum-steps-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum steps + draw smoke description: steps= Bell table + draw SVG via record_plot. import: @@ -17,7 +18,7 @@ import: **qc = > quantum.circuit qubits=2 steps=`steps`** **p = > `qc`.probabilities** -**p00 = [00](p)** +**p00 = [00](access(p, "00"))** **lo = > math.div a=2 b=5** **hi = > math.div a=3 b=5** @@ -30,7 +31,7 @@ import: > print text=steps-fail **img = > `qc`.draw path="quantum-steps-draw.svg"** -**kind = [kind](img)** +**kind = [kind](access(img, "kind"))** 1. `kind` == circuit > print text=draw-ok diff --git a/tests/ext/quantum-viz-advanced-smoke.mq.md b/tests/ext/quantum-viz-advanced-smoke.mq.md index 37b0d39..1aa9078 100644 --- a/tests/ext/quantum-viz-advanced-smoke.mq.md +++ b/tests/ext/quantum-viz-advanced-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum viz advanced smoke description: Q7b hinton / qsphere / multibloch SVG markers import: diff --git a/tests/ext/quantum-zh-smoke.mq.md b/tests/ext/quantum-zh-smoke.mq.md index 6a93036..b4adc1a 100644 --- a/tests/ext/quantum-zh-smoke.mq.md +++ b/tests/ext/quantum-zh-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quantum zh API smoke description: Chinese 量子.电路 泡利Z sandwich. 导入: @@ -13,7 +14,7 @@ description: Chinese 量子.电路 泡利Z sandwich. **电路 = > `电路`.泡利Z 比特=0** **电路 = > `电路`.哈达玛 比特=0** **概率 = > `电路`.概率** -**p1 = [1](概率)** +**p1 = [1](access(概率, "1"))** **lo = > math.div a=9 b=10** 1. `p1` > `lo` diff --git a/tests/ext/sandbox-cow.mq.md b/tests/ext/sandbox-cow.mq.md index bc71421..17e7954 100644 --- a/tests/ext/sandbox-cow.mq.md +++ b/tests/ext/sandbox-cow.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: sandbox CoW — write stays upper until commit description: > Readable trial: seed on disk, mutate in session, host tree unchanged, @@ -22,7 +23,7 @@ Prepare a tiny workspace under this test directory (reset leftovers from prior r > fs.write_text path="_sbx_cow/seed.txt" text=seed-lower **sb = sandbox.open root="_sbx_cow"** -**id = [id](sb)** +**id = [id](access(sb, "id"))** Session edits (upper / whiteout only). @@ -53,7 +54,7 @@ Commit applies upper + whiteout. Discard must not touch the host. **sb2 = sandbox.open root="_sbx_cow"** -**id2 = [id](sb2)** +**id2 = [id](access(sb2, "id"))** > sandbox.write id=`id2` path="new.txt" text=should-discard > sandbox.discard id=`id2` diff --git a/tests/ext/sandbox-deny.mq.md b/tests/ext/sandbox-deny.mq.md index 60004b1..b5d0150 100644 --- a/tests/ext/sandbox-deny.mq.md +++ b/tests/ext/sandbox-deny.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: sandbox.run — plugin.load denied; inspect lists notes description: > Guest that loads a native plugin must fail with unavailable in sandbox. @@ -10,11 +11,11 @@ import: # main **sb = sandbox.open root="sandbox-fixtures"** -**id = [id](sb)** +**id = [id](access(sb, "id"))** **ret = sandbox.run id=`id` path="guest-plugin.mq.md"** -**ok = [ok](ret)** -**err = [error](ret)** +**ok = [ok](access(ret, "ok"))** +**err = [error](access(ret, "error"))** > print text=`ok` **parts = split value=`err` sep="unavailable in sandbox"** @@ -25,7 +26,7 @@ import: > print text=`err` **info = sandbox.inspect id=`id`** -**notes = [notes](info)** +**notes = [notes](access(info, "notes"))** **nn = len value=`notes`** 1. `nn` > 0 > print text=inspect-ok diff --git a/tests/ext/sandbox-fixtures/guest-json.mq.md b/tests/ext/sandbox-fixtures/guest-json.mq.md index 4a7de3f..2ea96fe 100644 --- a/tests/ext/sandbox-fixtures/guest-json.mq.md +++ b/tests/ext/sandbox-fixtures/guest-json.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion import: json: lib/json.mq.md --- diff --git a/tests/ext/sandbox-fixtures/guest-plugin.mq.md b/tests/ext/sandbox-fixtures/guest-plugin.mq.md index d5fc25d..0909cbd 100644 --- a/tests/ext/sandbox-fixtures/guest-plugin.mq.md +++ b/tests/ext/sandbox-fixtures/guest-plugin.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion import: plugin: lib/plugin.mq.md --- diff --git a/tests/ext/sandbox-fixtures/promote-bad.mq.md b/tests/ext/sandbox-fixtures/promote-bad.mq.md index 772a4df..d398dab 100644 --- a/tests/ext/sandbox-fixtures/promote-bad.mq.md +++ b/tests/ext/sandbox-fixtures/promote-bad.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: promote-bad proof: promote-bad.mq.md --- diff --git a/tests/ext/sandbox-fixtures/promote-good.mq.md b/tests/ext/sandbox-fixtures/promote-good.mq.md index 885bb9e..2769630 100644 --- a/tests/ext/sandbox-fixtures/promote-good.mq.md +++ b/tests/ext/sandbox-fixtures/promote-good.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: promote-ok type: skill applies_when: demo diff --git a/tests/ext/sandbox-run-lib.mq.md b/tests/ext/sandbox-run-lib.mq.md index a8496cc..7ce4aeb 100644 --- a/tests/ext/sandbox-run-lib.mq.md +++ b/tests/ext/sandbox-run-lib.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: sandbox.run — core lib/json inside the trial description: Guest fixture imports lib/json; print ok and guest stdout via link index. import: @@ -10,13 +11,13 @@ import: Open a session on the fixture directory (guest programs live here). **sb = sandbox.open root="sandbox-fixtures"** -**id = [id](sb)** +**id = [id](access(sb, "id"))** Run the guest that imports `lib/json` and prints `1`. **ret = sandbox.run id=`id` path="guest-json.mq.md"** -**ok = [ok](ret)** -**out = [stdout](ret)** +**ok = [ok](access(ret, "ok"))** +**out = [stdout](access(ret, "stdout"))** > print text=`ok` > print text=`out` diff --git a/tests/ext/web-artifact-doc.mq.md b/tests/ext/web-artifact-doc.mq.md index 24541af..0ab3fe8 100644 --- a/tests/ext/web-artifact-doc.mq.md +++ b/tests/ext/web-artifact-doc.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: web title: artifact document gold route: / diff --git a/tests/ext/web-artifact-endpoint.mq.md b/tests/ext/web-artifact-endpoint.mq.md index 5f420c4..7c8d1f6 100644 --- a/tests/ext/web-artifact-endpoint.mq.md +++ b/tests/ext/web-artifact-endpoint.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: endpoint method: POST path: /api/ping diff --git a/tests/ext/web-artifact-render-smoke.mq.md b/tests/ext/web-artifact-render-smoke.mq.md index 1f25ffc..f369f6b 100644 --- a/tests/ext/web-artifact-render-smoke.mq.md +++ b/tests/ext/web-artifact-render-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web artifact render smoke description: Unified View nodes + document render (ADR 0007); offline, no listen. import: diff --git a/tests/ext/web-artifact-site/api/ping.mq.md b/tests/ext/web-artifact-site/api/ping.mq.md index 3f3bba1..cc883a2 100644 --- a/tests/ext/web-artifact-site/api/ping.mq.md +++ b/tests/ext/web-artifact-site/api/ping.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: endpoint method: GET path: /api/ping diff --git a/tests/ext/web-artifact-site/index.mq.md b/tests/ext/web-artifact-site/index.mq.md index b70cc45..9c8bcfc 100644 --- a/tests/ext/web-artifact-site/index.mq.md +++ b/tests/ext/web-artifact-site/index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: web title: Artifact site route: / diff --git a/tests/ext/web-artifact-site/pages/about.mq.md b/tests/ext/web-artifact-site/pages/about.mq.md index e6fb065..c3a6d9b 100644 --- a/tests/ext/web-artifact-site/pages/about.mq.md +++ b/tests/ext/web-artifact-site/pages/about.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion type: web title: About route: /about diff --git a/tests/ext/web-artifact-site/serve.mq.md b/tests/ext/web-artifact-site/serve.mq.md index 59b59ef..ee535ce 100644 --- a/tests/ext/web-artifact-site/serve.mq.md +++ b/tests/ext/web-artifact-site/serve.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: artifact site serve import: web: ext/web/web.mq.md diff --git a/tests/ext/web-artifact-zh.mq.md b/tests/ext/web-artifact-zh.mq.md index 0671835..990983e 100644 --- a/tests/ext/web-artifact-zh.mq.md +++ b/tests/ext/web-artifact-zh.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion 类型: 网页 路由: /zh 方法: GET diff --git a/tests/ext/web-cache-artifact-smoke.mq.md b/tests/ext/web-cache-artifact-smoke.mq.md index 9339498..5b8c36e 100644 --- a/tests/ext/web-cache-artifact-smoke.mq.md +++ b/tests/ext/web-cache-artifact-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/data cache smoke import: cache: ext/data/cache.mq.md @@ -9,7 +10,7 @@ import: **c = > cache.cache url="memory:"** > `c`.set key="k" value="v" ttl=60 **got = > `c`.get key="k"** -**val = [value](got)** +**val = [value](access(got, "value"))** 1. `val` == "v" > print text=cache-ok 2. * diff --git a/tests/ext/web-data-db-smoke.mq.md b/tests/ext/web-data-db-smoke.mq.md index 25e9f30..25bb271 100644 --- a/tests/ext/web-data-db-smoke.mq.md +++ b/tests/ext/web-data-db-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/data db smoke description: DB Resource lives in ext/data (ADR 0007). import: diff --git a/tests/ext/web-fixtures/components/foot.mq.md b/tests/ext/web-fixtures/components/foot.mq.md index 6059589..3eddeb8 100644 --- a/tests/ext/web-fixtures/components/foot.mq.md +++ b/tests/ext/web-fixtures/components/foot.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## foot `foot` = diff --git a/tests/ext/web-fixtures/components/nav.mq.md b/tests/ext/web-fixtures/components/nav.mq.md index b4ac2a2..f242758 100644 --- a/tests/ext/web-fixtures/components/nav.mq.md +++ b/tests/ext/web-fixtures/components/nav.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## nav `nav` = diff --git a/tests/ext/web-fixtures/components/side.mq.md b/tests/ext/web-fixtures/components/side.mq.md index df5e559..08f49bc 100644 --- a/tests/ext/web-fixtures/components/side.mq.md +++ b/tests/ext/web-fixtures/components/side.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## side `side` = diff --git a/tests/ext/web-fixtures/db/articles.mq.md b/tests/ext/web-fixtures/db/articles.mq.md index 68993be..747171c 100644 --- a/tests/ext/web-fixtures/db/articles.mq.md +++ b/tests/ext/web-fixtures/db/articles.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## schema `fields` = diff --git a/tests/ext/web-fixtures/styles/shell.mq.md b/tests/ext/web-fixtures/styles/shell.mq.md index 38b3eed..085a776 100644 --- a/tests/ext/web-fixtures/styles/shell.mq.md +++ b/tests/ext/web-fixtures/styles/shell.mq.md @@ -1,3 +1,7 @@ +--- +markup: occlusion +--- + ## topnav `topnav` = diff --git a/tests/ext/web-rbac-artifact-smoke.mq.md b/tests/ext/web-rbac-artifact-smoke.mq.md index 0078517..4ffde17 100644 --- a/tests/ext/web-rbac-artifact-smoke.mq.md +++ b/tests/ext/web-rbac-artifact-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: ext/security rbac smoke import: rbac: ext/security/rbac.mq.md @@ -8,8 +9,8 @@ import: **gate = > rbac.rbac** **r = > `gate`.can permissions="desk:access,posts:read" needed="desk:access"** -**ok = [ok](r)** -**allowed = [allowed](r)** +**ok = [ok](access(r, "ok"))** +**allowed = [allowed](access(r, "allowed"))** 1. `ok` 1. `allowed` > print text=rbac-ok diff --git a/tests/ext/web-static-artifact-smoke.mq.md b/tests/ext/web-static-artifact-smoke.mq.md index 843156b..a811b20 100644 --- a/tests/ext/web-static-artifact-smoke.mq.md +++ b/tests/ext/web-static-artifact-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web static artifact smoke import: web: ext/web/web.mq.md @@ -9,8 +10,8 @@ import: **pg = > web.page title="static"** **app = > web.app page=`pg`** **app = > `app`.static dir="web-fixtures/public" mount="/static"** -**d = [static_dir](app)** -**m = [static_mount](app)** +**d = [static_dir](access(app, "static_dir"))** +**m = [static_mount](access(app, "static_mount"))** 1. `d` > print text=dir-ok 2. * diff --git a/tests/ext/web-use-smoke.mq.md b/tests/ext/web-use-smoke.mq.md index 7a9271d..1d27bc1 100644 --- a/tests/ext/web-use-smoke.mq.md +++ b/tests/ext/web-use-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: web.use middleware smoke description: First-class middleware via web.use (replaces configure junk drawer). import: @@ -17,8 +18,8 @@ import: **pg = > web.page title="use-smoke"** **app = > web.app page=`pg`** **app = > web.use app=`app` middleware=`headers`** -**mw = [middleware](app)** -**sec = [security](mw)** +**mw = [middleware](access(app, "middleware"))** +**sec = [security](access(mw, "security"))** 1. `sec` > print text=use-ok 2. * diff --git a/tests/gold.rs b/tests/gold.rs index a9af761..d138f43 100644 --- a/tests/gold.rs +++ b/tests/gold.rs @@ -558,7 +558,7 @@ fn knowledge_resolve_rejects_instance_path() { fn error_ns_instance_method() { assert_err( "tests/errors/ns-instance-method.mq.md", - "9:1", + "10:1", "instance method", ); } @@ -804,7 +804,7 @@ a", fn error_undefined_var() { assert_err( "tests/errors/undefined-var.mq.md", - "7:1", + "8:1", "undefined variable `missing`", ); } @@ -813,7 +813,7 @@ fn error_undefined_var() { fn error_unknown_fn() { assert_err( "tests/errors/unknown-fn.mq.md", - "7:1", + "8:1", "unknown function `no_such_fn`", ); } @@ -822,7 +822,7 @@ fn error_unknown_fn() { fn error_bad_arity() { assert_err( "tests/errors/bad-arity.mq.md", - "7:1", + "8:1", "missing argument for parameter `x`", ); } @@ -851,14 +851,14 @@ fn error_lone_asterisk_line() { #[test] fn error_div_zero() { - assert_err("tests/errors/div-zero.mq.md", "7:1", "division by zero"); + assert_err("tests/errors/div-zero.mq.md", "8:1", "division by zero"); } #[test] fn error_footnote_zero() { assert_err( "tests/errors/footnote-zero.mq.md", - "13:1", + "14:1", "`[^0]` is invalid", ); } @@ -867,7 +867,7 @@ fn error_footnote_zero() { fn error_footnote_oob() { assert_err( "tests/errors/footnote-oob.mq.md", - "13:1", + "14:1", "out of range", ); } @@ -876,7 +876,7 @@ fn error_footnote_oob() { fn error_footnote_missing_key() { assert_err( "tests/errors/footnote-missing-key.mq.md", - "13:1", + "14:1", "missing map key", ); } @@ -903,7 +903,7 @@ fn error_table_row_marker_only() { fn error_inherit_cycle() { assert_err( "tests/errors/inherit-cycle.mq.md", - "5:1", + "6:1", "cyclic inheritance", ); } @@ -912,7 +912,7 @@ fn error_inherit_cycle() { fn error_inherit_unknown_base() { assert_err( "tests/errors/inherit-unknown-base.mq.md", - "5:1", + "6:1", "unknown base type", ); } @@ -930,7 +930,7 @@ fn error_inherit_bad_rhs() { fn error_bad_int() { assert_err( "tests/errors/bad-int.mq.md", - "7:1", + "8:1", "cannot convert to int", ); } @@ -939,7 +939,7 @@ fn error_bad_int() { fn error_bad_split_sep() { assert_err( "tests/errors/bad-split-sep.mq.md", - "7:1", + "8:1", "split sep must not be empty", ); } diff --git a/tests/keywords/bool-logic.mq.md b/tests/keywords/bool-logic.mq.md index 87d509d..5665011 100644 --- a/tests/keywords/bool-logic.mq.md +++ b/tests/keywords/bool-logic.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 布尔与逻辑关键字 --- diff --git a/tests/keywords/input-escape.mq.md b/tests/keywords/input-escape.mq.md index ecea27c..5b40681 100644 --- a/tests/keywords/input-escape.mq.md +++ b/tests/keywords/input-escape.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: input quoted prompt stdin: Ada --- diff --git a/tests/keywords/input.mq.md b/tests/keywords/input.mq.md index e64fcc4..e9380ad 100644 --- a/tests/keywords/input.mq.md +++ b/tests/keywords/input.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: input description: Read one stdin line (optional prompt) --- diff --git a/tests/keywords/print.mq.md b/tests/keywords/print.mq.md index 978ffa7..c60fabd 100644 --- a/tests/keywords/print.mq.md +++ b/tests/keywords/print.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 内置 print --- diff --git a/tests/keywords/quoted-string.mq.md b/tests/keywords/quoted-string.mq.md index a018e66..96ff6cc 100644 --- a/tests/keywords/quoted-string.mq.md +++ b/tests/keywords/quoted-string.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quoted string literal --- diff --git a/tests/keywords/stdlib-more.mq.md b/tests/keywords/stdlib-more.mq.md index 8208d67..59be09f 100644 --- a/tests/keywords/stdlib-more.mq.md +++ b/tests/keywords/stdlib-more.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: stdlib text and table description: trim split join at type + lib imports --- diff --git a/tests/keywords/stdlib.mq.md b/tests/keywords/stdlib.mq.md index fb4af8f..ede71b3 100644 --- a/tests/keywords/stdlib.mq.md +++ b/tests/keywords/stdlib.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: len str int description: Built-in conversions and length --- diff --git a/tests/keywords/zh-bool.mq.md b/tests/keywords/zh-bool.mq.md index ea8c0fe..305a046 100644 --- a/tests/keywords/zh-bool.mq.md +++ b/tests/keywords/zh-bool.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中文布尔与逻辑 --- diff --git a/tests/keywords/zh-builtins.mq.md b/tests/keywords/zh-builtins.mq.md index 0947a67..d782aad 100644 --- a/tests/keywords/zh-builtins.mq.md +++ b/tests/keywords/zh-builtins.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中文内置函数 description: 打印 / 长度 / 文本 / 整数(与英文别名等价) --- diff --git a/tests/lib/encoding-smoke.mq.md b/tests/lib/encoding-smoke.mq.md index 6258183..11a84d2 100644 --- a/tests/lib/encoding-smoke.mq.md +++ b/tests/lib/encoding-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/encoding smoke import: enc: lib/encoding.mq.md diff --git a/tests/lib/foreign-call.mq.md b/tests/lib/foreign-call.mq.md index 6068ed3..886953f 100644 --- a/tests/lib/foreign-call.mq.md +++ b/tests/lib/foreign-call.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: foreign call and call_many import: foreign: lib/foreign.mq.md diff --git a/tests/lib/foreign-python.mq.md b/tests/lib/foreign-python.mq.md index 709c7c1..0e0fa40 100644 --- a/tests/lib/foreign-python.mq.md +++ b/tests/lib/foreign-python.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: foreign python hello import: foreign: lib/foreign.mq.md diff --git a/tests/lib/foreign-run-lang.mq.md b/tests/lib/foreign-run-lang.mq.md index b305c51..635f165 100644 --- a/tests/lib/foreign-run-lang.mq.md +++ b/tests/lib/foreign-run-lang.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: foreign run_lang import: foreign: lib/foreign.mq.md diff --git a/tests/lib/fs-copy-move.mq.md b/tests/lib/fs-copy-move.mq.md index 7ea0654..b90e5eb 100644 --- a/tests/lib/fs-copy-move.mq.md +++ b/tests/lib/fs-copy-move.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: fs copy/move/temp import: fs: lib/fs.mq.md diff --git a/tests/lib/fs-read.mq.md b/tests/lib/fs-read.mq.md index 6aa5e2e..c6415e3 100644 --- a/tests/lib/fs-read.mq.md +++ b/tests/lib/fs-read.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: fs read/exists import: fs: lib/fs.mq.md diff --git a/tests/lib/hash-smoke.mq.md b/tests/lib/hash-smoke.mq.md index 34a8b11..688c5a0 100644 --- a/tests/lib/hash-smoke.mq.md +++ b/tests/lib/hash-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/hash smoke import: hash: lib/hash.mq.md diff --git a/tests/lib/json-quote.mq.md b/tests/lib/json-quote.mq.md index 24e8755..aa6a208 100644 --- a/tests/lib/json-quote.mq.md +++ b/tests/lib/json-quote.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: json quote import: json: lib/json.mq.md diff --git a/tests/lib/json-roundtrip.mq.md b/tests/lib/json-roundtrip.mq.md index 4559893..97a0fcc 100644 --- a/tests/lib/json-roundtrip.mq.md +++ b/tests/lib/json-roundtrip.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: json roundtrip import: fs: lib/fs.mq.md diff --git a/tests/lib/log-uuid-smoke.mq.md b/tests/lib/log-uuid-smoke.mq.md index d1c7efc..d2de14d 100644 --- a/tests/lib/log-uuid-smoke.mq.md +++ b/tests/lib/log-uuid-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/log + uuid smoke import: log: lib/log.mq.md diff --git a/tests/lib/math-formula-chain.mq.md b/tests/lib/math-formula-chain.mq.md index c9b2fe8..deb9dc2 100644 --- a/tests/lib/math-formula-chain.mq.md +++ b/tests/lib/math-formula-chain.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: math formula chain import: math: lib/math.mq.md diff --git a/tests/lib/math-formula.mq.md b/tests/lib/math-formula.mq.md index ec46942..c1bdc5c 100644 --- a/tests/lib/math-formula.mq.md +++ b/tests/lib/math-formula.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: math formula pipeline import: math: lib/math.mq.md diff --git a/tests/lib/math-plot.mq.md b/tests/lib/math-plot.mq.md index 97d99a2..8d860b3 100644 --- a/tests/lib/math-plot.mq.md +++ b/tests/lib/math-plot.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: math plot svg import: math: lib/math.mq.md diff --git a/tests/lib/math-random.mq.md b/tests/lib/math-random.mq.md index 0b1060e..12d622e 100644 --- a/tests/lib/math-random.mq.md +++ b/tests/lib/math-random.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: math random seed import: math: lib/math.mq.md diff --git a/tests/lib/net-encode.mq.md b/tests/lib/net-encode.mq.md index 6fb32d7..1c5af16 100644 --- a/tests/lib/net-encode.mq.md +++ b/tests/lib/net-encode.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: net url_encode import: net: lib/net.mq.md diff --git a/tests/lib/net-markdown.mq.md b/tests/lib/net-markdown.mq.md index 721deef..e2707d9 100644 --- a/tests/lib/net-markdown.mq.md +++ b/tests/lib/net-markdown.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/net markdown_parse smoke import: net: lib/net.mq.md diff --git a/tests/lib/net-openai-sse-reasoning.mq.md b/tests/lib/net-openai-sse-reasoning.mq.md index c2a9e30..8b69f6a 100644 --- a/tests/lib/net-openai-sse-reasoning.mq.md +++ b/tests/lib/net-openai-sse-reasoning.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: openai SSE reasoning_content offline description: DeepSeek-style thinking streams as type=reasoning; answer stays delta/done.result. import: diff --git a/tests/lib/path-smoke.mq.md b/tests/lib/path-smoke.mq.md index 3429f7d..c091581 100644 --- a/tests/lib/path-smoke.mq.md +++ b/tests/lib/path-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/path smoke import: path: lib/path.mq.md diff --git a/tests/lib/plugin-demo.mq.md b/tests/lib/plugin-demo.mq.md index 59a965c..19b7691 100644 --- a/tests/lib/plugin-demo.mq.md +++ b/tests/lib/plugin-demo.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: plugin demo ABI description: Loads demo cdylib; path from MARQDO_TEST_PLUGIN (set by gold harness). import: diff --git a/tests/lib/re-smoke.mq.md b/tests/lib/re-smoke.mq.md index dc3659c..7d7f525 100644 --- a/tests/lib/re-smoke.mq.md +++ b/tests/lib/re-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/re smoke import: re: lib/re.mq.md diff --git a/tests/lib/secrets-smoke.mq.md b/tests/lib/secrets-smoke.mq.md index 4216b35..a240c69 100644 --- a/tests/lib/secrets-smoke.mq.md +++ b/tests/lib/secrets-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/secrets smoke import: sec: lib/secrets.mq.md diff --git a/tests/lib/stats-log-smoke.mq.md b/tests/lib/stats-log-smoke.mq.md index 7e5e91e..e986715 100644 --- a/tests/lib/stats-log-smoke.mq.md +++ b/tests/lib/stats-log-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/stats + log fields M10 smoke import: stats: lib/stats.mq.md diff --git a/tests/lib/subtask-child-print.mq.md b/tests/lib/subtask-child-print.mq.md index 6c4b03d..e798cbf 100644 --- a/tests/lib/subtask-child-print.mq.md +++ b/tests/lib/subtask-child-print.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: subtask child that prints --- diff --git a/tests/lib/subtask-child.mq.md b/tests/lib/subtask-child.mq.md index f25d4c0..5033a3d 100644 --- a/tests/lib/subtask-child.mq.md +++ b/tests/lib/subtask-child.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: subtask child --- diff --git a/tests/lib/subtask-fn.mq.md b/tests/lib/subtask-fn.mq.md index ff25ec3..581a1cd 100644 --- a/tests/lib/subtask-fn.mq.md +++ b/tests/lib/subtask-fn.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: subtask spawn fn import: subtask: lib/subtask.mq.md diff --git a/tests/lib/subtask-foreign.mq.md b/tests/lib/subtask-foreign.mq.md index c85c84b..6410dd9 100644 --- a/tests/lib/subtask-foreign.mq.md +++ b/tests/lib/subtask-foreign.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: subtask foreign spawn import: subtask: lib/subtask.mq.md diff --git a/tests/lib/subtask-quiet-io.mq.md b/tests/lib/subtask-quiet-io.mq.md index 83bf199..a66aed9 100644 --- a/tests/lib/subtask-quiet-io.mq.md +++ b/tests/lib/subtask-quiet-io.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: quiet file subtask captures stdout/stderr import: subtask: lib/subtask.mq.md diff --git a/tests/lib/subtask-spawn.mq.md b/tests/lib/subtask-spawn.mq.md index e89a593..5f71ddc 100644 --- a/tests/lib/subtask-spawn.mq.md +++ b/tests/lib/subtask-spawn.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: subtask spawn join import: subtask: lib/subtask.mq.md diff --git a/tests/lib/sys-cwd.mq.md b/tests/lib/sys-cwd.mq.md index 691a7ac..56f854c 100644 --- a/tests/lib/sys-cwd.mq.md +++ b/tests/lib/sys-cwd.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: sys cwd import: sys: lib/sys.mq.md diff --git a/tests/lib/sys-dotenv.mq.md b/tests/lib/sys-dotenv.mq.md index e659eb6..2ddf839 100644 --- a/tests/lib/sys-dotenv.mq.md +++ b/tests/lib/sys-dotenv.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: sys dotenv import: sys: lib/sys.mq.md diff --git a/tests/lib/table-list-mid.mq.md b/tests/lib/table-list-mid.mq.md index 46cd29c..d3ba700 100644 --- a/tests/lib/table-list-mid.mq.md +++ b/tests/lib/table-list-mid.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: table list mid smoke import: table: lib/table.mq.md diff --git a/tests/lib/text-mid-smoke.mq.md b/tests/lib/text-mid-smoke.mq.md index cc60561..6afa8c8 100644 --- a/tests/lib/text-mid-smoke.mq.md +++ b/tests/lib/text-mid-smoke.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/text mid smoke import: text: lib/text.mq.md diff --git a/tests/lib/time-format.mq.md b/tests/lib/time-format.mq.md index edd86e5..68352ba 100644 --- a/tests/lib/time-format.mq.md +++ b/tests/lib/time-format.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: time format/parse import: time: lib/time.mq.md diff --git a/tests/lib/writeback-async.mq.md b/tests/lib/writeback-async.mq.md index ed773e7..d68669a 100644 --- a/tests/lib/writeback-async.mq.md +++ b/tests/lib/writeback-async.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: async writeback via subtask description: Fire-and-forget persist_slot with explicit line=; join on exit. import: diff --git a/tests/lib/writeback-get.mq.md b/tests/lib/writeback-get.mq.md index db772a6..8876b5e 100644 --- a/tests/lib/writeback-get.mq.md +++ b/tests/lib/writeback-get.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: writeback get import: writeback: lib/writeback.mq.md diff --git a/tests/lib/哈希-烟测.mq.md b/tests/lib/哈希-烟测.mq.md index 785541b..b246f90 100644 --- a/tests/lib/哈希-烟测.mq.md +++ b/tests/lib/哈希-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/哈希 烟测 导入: 哈希: lib/哈希.mq.md diff --git a/tests/lib/外联-python.mq.md b/tests/lib/外联-python.mq.md index f7653f6..8187e50 100644 --- a/tests/lib/外联-python.mq.md +++ b/tests/lib/外联-python.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: foreign zh 导入: 外联: lib/外联.mq.md diff --git a/tests/lib/数学-数值.mq.md b/tests/lib/数学-数值.mq.md index a2cdc09..9d5a253 100644 --- a/tests/lib/数学-数值.mq.md +++ b/tests/lib/数学-数值.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: math num + zh 导入: 数学: lib/数学.mq.md diff --git a/tests/lib/文件-复制.mq.md b/tests/lib/文件-复制.mq.md index c2f505e..17f30d9 100644 --- a/tests/lib/文件-复制.mq.md +++ b/tests/lib/文件-复制.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 文件 复制移动 导入: 文件: lib/文件.mq.md diff --git a/tests/lib/文件-读.mq.md b/tests/lib/文件-读.mq.md index de2aeb8..4543f0b 100644 --- a/tests/lib/文件-读.mq.md +++ b/tests/lib/文件-读.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 中文文件库 导入: 文件: lib/文件.mq.md diff --git a/tests/lib/文本-加厚-烟测.mq.md b/tests/lib/文本-加厚-烟测.mq.md index 55ad3ef..8ad6cba 100644 --- a/tests/lib/文本-加厚-烟测.mq.md +++ b/tests/lib/文本-加厚-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/文本 加厚烟测 导入: 文本: lib/文本.mq.md diff --git a/tests/lib/日志-标识-烟测.mq.md b/tests/lib/日志-标识-烟测.mq.md index 413caf4..3c371ef 100644 --- a/tests/lib/日志-标识-烟测.mq.md +++ b/tests/lib/日志-标识-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/日志与标识 烟测 导入: 日志: lib/日志.mq.md diff --git a/tests/lib/机密-烟测.mq.md b/tests/lib/机密-烟测.mq.md index 294be8d..066a467 100644 --- a/tests/lib/机密-烟测.mq.md +++ b/tests/lib/机密-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/机密 烟测 导入: 机密: lib/机密.mq.md diff --git a/tests/lib/正则-烟测.mq.md b/tests/lib/正则-烟测.mq.md index 278e7db..f90ae15 100644 --- a/tests/lib/正则-烟测.mq.md +++ b/tests/lib/正则-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/正则 烟测 导入: 正则: lib/正则.mq.md diff --git a/tests/lib/统计-日志-烟测.mq.md b/tests/lib/统计-日志-烟测.mq.md index 4fdc9cc..2ceba56 100644 --- a/tests/lib/统计-日志-烟测.mq.md +++ b/tests/lib/统计-日志-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/统计 日志 M10 烟测 导入: 统计: lib/统计.mq.md diff --git a/tests/lib/编码-烟测.mq.md b/tests/lib/编码-烟测.mq.md index 275a484..8ab7f51 100644 --- a/tests/lib/编码-烟测.mq.md +++ b/tests/lib/编码-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/编码 烟测 导入: 编码: lib/编码.mq.md diff --git a/tests/lib/路径-烟测.mq.md b/tests/lib/路径-烟测.mq.md index 772d5d8..5471418 100644 --- a/tests/lib/路径-烟测.mq.md +++ b/tests/lib/路径-烟测.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: lib/路径 烟测 导入: 路径: lib/路径.mq.md diff --git a/tests/markup-v03/bold-call.mq.md b/tests/markup-v03/bold-call.mq.md index 67dac6e..405ed3f 100644 --- a/tests/markup-v03/bold-call.mq.md +++ b/tests/markup-v03/bold-call.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 粗体内调用(无 `>`) description: `**结果 = 加一函数 37**` 粗体调用(callee 无 `>`) -markup: v0.3 +markup: occlusion --- ## 加一函数 diff --git a/tests/markup-v03/bold-expr.mq.md b/tests/markup-v03/bold-expr.mq.md index def328d..e0e5c47 100644 --- a/tests/markup-v03/bold-expr.mq.md +++ b/tests/markup-v03/bold-expr.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: bold expression statement description: >- `` **n + 1** `` is an expression statement (discarded), not a call to `n` diff --git a/tests/markup-v03/branch-arm-prose.mq.md b/tests/markup-v03/branch-arm-prose.mq.md index 43232e1..dc055a2 100644 --- a/tests/markup-v03/branch-arm-prose.mq.md +++ b/tests/markup-v03/branch-arm-prose.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: v0.3 分支臂内叙述 description: 臂内 prose 不得逃逸;n>0 时仅 then --- diff --git a/tests/markup-v03/branch-cond-narrative.mq.md b/tests/markup-v03/branch-cond-narrative.mq.md index 18cb8f5..67e2eaf 100644 --- a/tests/markup-v03/branch-cond-narrative.mq.md +++ b/tests/markup-v03/branch-cond-narrative.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: v0.3 条件行夹叙述 description: 当`n`大于 0 时 / 否则 * --- diff --git a/tests/markup-v03/dead-bind.mq.md b/tests/markup-v03/dead-bind.mq.md index 78e3ea5..2a3a73a 100644 --- a/tests/markup-v03/dead-bind.mq.md +++ b/tests/markup-v03/dead-bind.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 死绑定不升参 description: 叙述提到`Markdown`/`GFM`但不读写;仅`题干`为形参 -markup: v0.3 +markup: occlusion --- ## 回声 diff --git a/tests/markup-v03/decl-ident-only.mq.md b/tests/markup-v03/decl-ident-only.mq.md index 8b2c3ea..e19d192 100644 --- a/tests/markup-v03/decl-ident-only.mq.md +++ b/tests/markup-v03/decl-ident-only.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: `` `n+1` `` is not a Decl name description: Only identifier Decl names elevate; `` `n+1` `` stays narrative --- diff --git a/tests/markup-v03/dual-call.mq.md b/tests/markup-v03/dual-call.mq.md index d824739..11e976c 100644 --- a/tests/markup-v03/dual-call.mq.md +++ b/tests/markup-v03/dual-call.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 双调用面 description: 同函数一次 `>`、一次粗体调用 -markup: v0.3 +markup: occlusion --- ## 加一函数 diff --git a/tests/markup-v03/dynamic-footnote.mq.md b/tests/markup-v03/dynamic-footnote.mq.md index 0dd9501..921ac96 100644 --- a/tests/markup-v03/dynamic-footnote.mq.md +++ b/tests/markup-v03/dynamic-footnote.mq.md @@ -1,7 +1,7 @@ --- title: G4 动态脚注键 description: 菜单[^`名`] 用变量值取 map 键 -markup: v0.3 +markup: occlusion --- # main diff --git a/tests/markup-v03/empty-return-compat.mq.md b/tests/markup-v03/empty-return-compat.mq.md index 8d1b68a..2716a59 100644 --- a/tests/markup-v03/empty-return-compat.mq.md +++ b/tests/markup-v03/empty-return-compat.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 空返回(`****` 兼容) description: v0.2 空粗体在 v0.3 仍识别为空返回 -markup: v0.3 +markup: occlusion --- ## 只打印 diff --git a/tests/markup-v03/empty-return-hr.mq.md b/tests/markup-v03/empty-return-hr.mq.md index 9f97b18..ae84383 100644 --- a/tests/markup-v03/empty-return-hr.mq.md +++ b/tests/markup-v03/empty-return-hr.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 副作用函数 + 体内 --- description: 分割线为叙述;函数在下一标题处结束(空返回见 empty-return-none) -markup: v0.3 +markup: occlusion --- ## 只打印 diff --git a/tests/markup-v03/empty-return-none.mq.md b/tests/markup-v03/empty-return-none.mq.md index 45f6442..39146a5 100644 --- a/tests/markup-v03/empty-return-none.mq.md +++ b/tests/markup-v03/empty-return-none.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 空返回(`*None*`) description: 显式空值,对齐 Python return None -markup: v0.3 +markup: occlusion --- ## 只打印 diff --git a/tests/markup-v03/empty-return-stars.mq.md b/tests/markup-v03/empty-return-stars.mq.md index bb60893..ac632a5 100644 --- a/tests/markup-v03/empty-return-stars.mq.md +++ b/tests/markup-v03/empty-return-stars.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 空返回(整行 `**`) description: 空斜体标记;词法须与粗体区分 -markup: v0.3 +markup: occlusion --- ## 只打印 diff --git a/tests/markup-v03/float-discount.mq.md b/tests/markup-v03/float-discount.mq.md index 7dc6b79..952272f 100644 --- a/tests/markup-v03/float-discount.mq.md +++ b/tests/markup-v03/float-discount.mq.md @@ -1,7 +1,7 @@ --- title: G3 浮点面量与折扣 description: 0.85 可解析;Int * Num 得 Num -markup: v0.3 +markup: occlusion --- # main diff --git a/tests/markup-v03/foreach-narrative.mq.md b/tests/markup-v03/foreach-narrative.mq.md index 8ebc947..70674a9 100644 --- a/tests/markup-v03/foreach-narrative.mq.md +++ b/tests/markup-v03/foreach-narrative.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: v0.3 循环头叙述糖 description: 对`xs`的每一项`项` / for each `item` in `ys` --- diff --git a/tests/markup-v03/formula-meta-var.mq.md b/tests/markup-v03/formula-meta-var.mq.md index 6586d9f..1733d72 100644 --- a/tests/markup-v03/formula-meta-var.mq.md +++ b/tests/markup-v03/formula-meta-var.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: v0.3 块公式 % marqdo: var= description: 无空 RHS;块内 TeX 注释绑定 formula import: diff --git a/tests/markup-v03/greet-default.mq.md b/tests/markup-v03/greet-default.mq.md index 79398e5..0fee33b 100644 --- a/tests/markup-v03/greet-default.mq.md +++ b/tests/markup-v03/greet-default.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 默认形参(叙述 `` `名`=值 ``) description: 必选`谁` + 可选`礼貌`=False;分支打印 -markup: v0.3 +markup: occlusion --- ## 问候 diff --git a/tests/markup-v03/inc-prose.mq.md b/tests/markup-v03/inc-prose.mq.md index 1234684..73d538b 100644 --- a/tests/markup-v03/inc-prose.mq.md +++ b/tests/markup-v03/inc-prose.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 加一(叙述统一动机例) description: 叙述声明 `n`;粗体赋值;斜体返回;`>` 调用后打印返回值 -markup: v0.3 +markup: occlusion --- ## 加一函数 diff --git a/tests/markup-v03/inline-dollar-formula.mq.md b/tests/markup-v03/inline-dollar-formula.mq.md index 98ddbaf..bd32bac 100644 --- a/tests/markup-v03/inline-dollar-formula.mq.md +++ b/tests/markup-v03/inline-dollar-formula.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: v0.3 行内 $ 传统绑定 description: `g` = $x+1$ → formula(无 % marqdo) --- diff --git a/tests/markup-v03/leading-backtick-decl.mq.md b/tests/markup-v03/leading-backtick-decl.mq.md index 0d46dc6..7ea74d4 100644 --- a/tests/markup-v03/leading-backtick-decl.mq.md +++ b/tests/markup-v03/leading-backtick-decl.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: leading backtick decl is narrative description: >- `` `名`… `` / `` `捕获=True` 时… `` / `` `礼貌`=False 时… `` are Decl prose, diff --git a/tests/markup-v03/module-hr.mq.md b/tests/markup-v03/module-hr.mq.md index 398eda2..504e0e7 100644 --- a/tests/markup-v03/module-hr.mq.md +++ b/tests/markup-v03/module-hr.mq.md @@ -1,7 +1,7 @@ --- title: G1 模块级 --- 为叙述分隔线 description: 顶层与函数体内 --- 均为叙述分隔(不再收束) -markup: v0.3 +markup: occlusion --- 本段在 frontmatter 之后、入口之前。 diff --git a/tests/markup-v03/multi-bold.mq.md b/tests/markup-v03/multi-bold.mq.md index a058d70..840714f 100644 --- a/tests/markup-v03/multi-bold.mq.md +++ b/tests/markup-v03/multi-bold.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 一行多粗体 description: 同一叙述行内多个 `**…**` 按出现序执行 -markup: v0.3 +markup: occlusion --- # main diff --git a/tests/markup-v03/print-bold.mq.md b/tests/markup-v03/print-bold.mq.md index b99e46b..75b5086 100644 --- a/tests/markup-v03/print-bold.mq.md +++ b/tests/markup-v03/print-bold.mq.md @@ -1,7 +1,7 @@ --- title: v0.3 粗体内 print description: 输出是调用不是返回;粗体包裹 print -markup: v0.3 +markup: occlusion --- # main diff --git a/tests/markup-v03/soft-emphasis.mq.md b/tests/markup-v03/soft-emphasis.mq.md index a4516d9..f9b5f33 100644 --- a/tests/markup-v03/soft-emphasis.mq.md +++ b/tests/markup-v03/soft-emphasis.mq.md @@ -1,7 +1,7 @@ --- title: G2 叙述强调不执行 description: 句中 **说明** / *only* / *very important* 为装饰;像代码的粗体与整行斜体仍执行 -markup: v0.3 +markup: occlusion --- # main diff --git a/tests/notebook/no-foreign.mq.md b/tests/notebook/no-foreign.mq.md index 18e31e2..0b4f9b6 100644 --- a/tests/notebook/no-foreign.mq.md +++ b/tests/notebook/no-foreign.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: View without foreign description: A pure Marqdo document — formula, table, plot and prose, no external kernel import: diff --git a/tests/notebook/python-insights.mq.md b/tests/notebook/python-insights.mq.md index 7ee95a8..7157eb0 100644 --- a/tests/notebook/python-insights.mq.md +++ b/tests/notebook/python-insights.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Python 经营洞察 · View Cells description: 多 cell 共享 Python 内核,做订单生成、区域/产品指标、异常检测、报告输出与独立复核。 import: diff --git a/tests/notebook/shared.mq.md b/tests/notebook/shared.mq.md index 999a3ae..1ec1d8e 100644 --- a/tests/notebook/shared.mq.md +++ b/tests/notebook/shared.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: notebook shared state import: foreign: lib/foreign.mq.md diff --git a/tests/occlusion.rs b/tests/occlusion.rs index b3904dd..55a473a 100644 --- a/tests/occlusion.rs +++ b/tests/occlusion.rs @@ -38,6 +38,45 @@ fn declared_occlusion_ignores_legacy_environment_switches() { assert_eq!(stdout.trim_end(), "值"); } +fn temporary_source(tag: &str, source: &str) -> std::path::PathBuf { + let path = + std::env::temp_dir().join(format!("marqdo-markup-{tag}-{}.mq.md", std::process::id())); + std::fs::write(&path, source).expect("write temporary source"); + path +} + +#[test] +fn unmarked_source_uses_occlusion_by_default() { + let path = temporary_source( + "default", + "# main\n\n**answer = [one plus one](1 + 1)**\n> print text=`answer`\n", + ); + let (code, stdout, stderr) = run(path.to_str().unwrap(), None); + let _ = std::fs::remove_file(&path); + assert_eq!(code, 0, "stderr={stderr}"); + assert_eq!(stdout.trim_end(), "2"); +} + +#[test] +fn legacy_markup_flag_is_an_explicit_transition_path() { + let path = temporary_source( + "legacy", + "---\nimport:\n json: lib/json.mq.md\n---\n\n# main\n\n**table = > json.parse text={\"key\":\"value\"}**\n**answer = [key](`table`)**\n> print text=`answer`\n", + ); + let out = Command::new(env!("CARGO_BIN_EXE_marqdo")) + .args(["run", path.to_str().unwrap(), "--legacy-markup"]) + .output() + .expect("run legacy source"); + let _ = std::fs::remove_file(&path); + assert_eq!( + out.status.code(), + Some(0), + "stderr={}", + String::from_utf8_lossy(&out.stderr) + ); + assert_eq!(String::from_utf8_lossy(&out.stdout).trim_end(), "value"); +} + // ---- M2.5: label diagnostics (`label.missing` / `label.empty_payload`) ---- fn check(path: &str, markup: &str) -> (i32, String) { @@ -210,12 +249,12 @@ fn t1_flags_payload_change_only() { #[test] fn t1_silent_when_label_also_changes() { let src = "# main\n\n**a = [按税率算总价](100 * 0.1)**\n> print text=`a`\n"; - let out = mlsp_session(&[&repair_req( - src, - "**a = [改成按两倍税率算](100 * 0.2)**", - )]); + let out = mlsp_session(&[&repair_req(src, "**a = [改成按两倍税率算](100 * 0.2)**")]); let line = out.join("\n"); - assert!(line.contains("\"stale\":[]"), "label edit = author reviewed: {line}"); + assert!( + line.contains("\"stale\":[]"), + "label edit = author reviewed: {line}" + ); } #[test] diff --git a/tests/structure/bare-id-italic-bold.mq.md b/tests/structure/bare-id-italic-bold.mq.md index d1fb510..6189cee 100644 --- a/tests/structure/bare-id-italic-bold.mq.md +++ b/tests/structure/bare-id-italic-bold.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: bare id in italic and bold description: Inside **…** / *…*, bare ids are variables; strings need quotes. --- diff --git a/tests/structure/branch-consecutive.mq.md b/tests/structure/branch-consecutive.mq.md index dfe22f4..0d84bb8 100644 --- a/tests/structure/branch-consecutive.mq.md +++ b/tests/structure/branch-consecutive.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: consecutive branches restart at 1. description: Same-indent `1.` after a completed list is a new Branch, not more arms. --- diff --git a/tests/structure/branch.mq.md b/tests/structure/branch.mq.md index fb4ce2a..16cbbc0 100644 --- a/tests/structure/branch.mq.md +++ b/tests/structure/branch.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 分支示例 --- diff --git a/tests/structure/fn-end-empty-return.mq.md b/tests/structure/fn-end-empty-return.mq.md index f2c36ca..b2f559d 100644 --- a/tests/structure/fn-end-empty-return.mq.md +++ b/tests/structure/fn-end-empty-return.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 函数结束 — 空返回 description: **** 空返回并结束函数体 --- diff --git a/tests/structure/fn-end-hr.mq.md b/tests/structure/fn-end-hr.mq.md index ebc9865..f1d8654 100644 --- a/tests/structure/fn-end-hr.mq.md +++ b/tests/structure/fn-end-hr.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 函数体内 --- 为叙述分隔 description: 分割线不再收束函数;嵌套 ## 在下一标题或空返回处结束 --- diff --git a/tests/structure/footnote-index.mq.md b/tests/structure/footnote-index.mq.md index 04d2383..150ec50 100644 --- a/tests/structure/footnote-index.mq.md +++ b/tests/structure/footnote-index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 脚注取元(列表下标) --- diff --git a/tests/structure/footnote-map-digits.mq.md b/tests/structure/footnote-map-digits.mq.md index e081137..c64b021 100644 --- a/tests/structure/footnote-map-digits.mq.md +++ b/tests/structure/footnote-map-digits.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: map footnote digit keys description: Pure-digit labels are map keys (text), not list indices. Bare base ok. --- diff --git a/tests/structure/gap-star-json-body.mq.md b/tests/structure/gap-star-json-body.mq.md index 600bb77..3c4beaa 100644 --- a/tests/structure/gap-star-json-body.mq.md +++ b/tests/structure/gap-star-json-body.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: GAP-06/07 star + JSON array body keep following stmts description: Nested args=`args` and text=["…"] must not truncate the ## body. import: diff --git a/tests/structure/import-lib.mq.md b/tests/structure/import-lib.mq.md index 8d19616..35e1fcf 100644 --- a/tests/structure/import-lib.mq.md +++ b/tests/structure/import-lib.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: import official lib (Chinese) 导入: 文本: lib/文本.mq.md diff --git a/tests/structure/import/main.mq.md b/tests/structure/import/main.mq.md index b9f63a7..d28c512 100644 --- a/tests/structure/import/main.mq.md +++ b/tests/structure/import/main.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 跨文件导入示例 import: utils: utils.mq.md diff --git a/tests/structure/import/utils.mq.md b/tests/structure/import/utils.mq.md index 622551d..1d7bf17 100644 --- a/tests/structure/import/utils.mq.md +++ b/tests/structure/import/utils.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 工具函数 description: 供 frontmatter > 导入;返回用粗体;副作用用输出函数 --- diff --git a/tests/structure/inherit-explicit-super.mq.md b/tests/structure/inherit-explicit-super.mq.md index b51a6f5..2b43ccd 100644 --- a/tests/structure/inherit-explicit-super.mq.md +++ b/tests/structure/inherit-explicit-super.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: inherit explicit parent constructor import: json: lib/json.mq.md diff --git a/tests/structure/inherit-override.mq.md b/tests/structure/inherit-override.mq.md index 34447a7..d70339f 100644 --- a/tests/structure/inherit-override.mq.md +++ b/tests/structure/inherit-override.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: inherit method override --- diff --git a/tests/structure/inherit-parent-method.mq.md b/tests/structure/inherit-parent-method.mq.md index 3c34349..77ee70c 100644 --- a/tests/structure/inherit-parent-method.mq.md +++ b/tests/structure/inherit-parent-method.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: inherit parent method import: json: lib/json.mq.md diff --git a/tests/structure/interp-footnote-index.mq.md b/tests/structure/interp-footnote-index.mq.md index e50e24c..536bf1e 100644 --- a/tests/structure/interp-footnote-index.mq.md +++ b/tests/structure/interp-footnote-index.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 插值中脚注取元(前缀 + `var`[^key]) description: 独立 > 调用实参与引号字符串内,`前缀`var`[^key]` 的取元应生效。 --- diff --git a/tests/structure/meta-binding.mq.md b/tests/structure/meta-binding.mq.md index ef3803e..78d0f11 100644 --- a/tests/structure/meta-binding.mq.md +++ b/tests/structure/meta-binding.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: meta-binding model: ${env.MARQDO_META_MODEL ?? "default-model"} greeting: "Hello ${env.MARQDO_META_USER ?? "World"}" diff --git a/tests/structure/meta-lift.mq.md b/tests/structure/meta-lift.mq.md index 7dc7789..0ab8c7a 100644 --- a/tests/structure/meta-lift.mq.md +++ b/tests/structure/meta-lift.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: meta-lift model: ${env.MARQDO_LIFT_MODEL ?? "lifted-model"} api_key: ${secret.MARQDO_LIFT_SECRET ?? "sk-lift"} diff --git a/tests/structure/narrative-bold.mq.md b/tests/structure/narrative-bold.mq.md index bec1a4f..d5fb014 100644 --- a/tests/structure/narrative-bold.mq.md +++ b/tests/structure/narrative-bold.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: narrative without star emphasis description: v0.3 — do not use * /** for Markdown emphasis; plain prose stays non-executable --- diff --git a/tests/structure/nested-call.mq.md b/tests/structure/nested-call.mq.md index 00ef44e..2ae03f6 100644 --- a/tests/structure/nested-call.mq.md +++ b/tests/structure/nested-call.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Hello World description: Nested fn; print builtin; v0.3 italic = return (unused here) --- diff --git a/tests/structure/new-path-stdlib.mq.md b/tests/structure/new-path-stdlib.mq.md index 3af1754..a505597 100644 --- a/tests/structure/new-path-stdlib.mq.md +++ b/tests/structure/new-path-stdlib.mq.md @@ -1,6 +1,8 @@ --- +markup: occlusion title: zero-argument standard-library knowledge in a value position -import math:lib/math.mq.md +import: + math: lib/math.mq.md --- # main diff --git a/tests/structure/ns/associated.mq.md b/tests/structure/ns/associated.mq.md index 10a5f57..f8446f8 100644 --- a/tests/structure/ns/associated.mq.md +++ b/tests/structure/ns/associated.mq.md @@ -1,6 +1,8 @@ --- +markup: occlusion title: receiver-free object children are associated executable knowledge -import helpers:helpers.mq.md +import: + helpers: helpers.mq.md --- # main diff --git a/tests/structure/ns/helpers.mq.md b/tests/structure/ns/helpers.mq.md index be6c259..f6ff5ba 100644 --- a/tests/structure/ns/helpers.mq.md +++ b/tests/structure/ns/helpers.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: namespace path helpers --- diff --git a/tests/structure/ns/path3.mq.md b/tests/structure/ns/path3.mq.md index 66cf0dd..523cde5 100644 --- a/tests/structure/ns/path3.mq.md +++ b/tests/structure/ns/path3.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: three-segment library path import: helpers: helpers.mq.md diff --git a/tests/structure/ns/use.mq.md b/tests/structure/ns/use.mq.md index c3b319d..8fda424 100644 --- a/tests/structure/ns/use.mq.md +++ b/tests/structure/ns/use.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: frontmatter use short name import: text: lib/text.mq.md diff --git a/tests/structure/object-handle.mq.md b/tests/structure/object-handle.mq.md index 1928b76..fbc82fc 100644 --- a/tests/structure/object-handle.mq.md +++ b/tests/structure/object-handle.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: object handle smoke import: json: lib/json.mq.md diff --git a/tests/structure/optional-param.mq.md b/tests/structure/optional-param.mq.md index 19d611d..26e0d82 100644 --- a/tests/structure/optional-param.mq.md +++ b/tests/structure/optional-param.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: optional param default --- diff --git a/tests/structure/paragraph-comment.mq.md b/tests/structure/paragraph-comment.mq.md index 8e70b8f..b25fde2 100644 --- a/tests/structure/paragraph-comment.mq.md +++ b/tests/structure/paragraph-comment.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 成段注释 description: 空行分段;段内以 ` 开头的续行仍是注释 --- diff --git a/tests/structure/positional-call.mq.md b/tests/structure/positional-call.mq.md index 99f9b17..def5d4d 100644 --- a/tests/structure/positional-call.mq.md +++ b/tests/structure/positional-call.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: 位置实参 description: `> fn value` binds by parameter order; named form still works --- diff --git a/tests/structure/unbound-table.mq.md b/tests/structure/unbound-table.mq.md index 1b30228..d35218c 100644 --- a/tests/structure/unbound-table.mq.md +++ b/tests/structure/unbound-table.mq.md @@ -1,4 +1,5 @@ --- +markup: occlusion title: Unbound GFM table is a discarded value --- diff --git a/tests/view/document-annot-demo.mq.md b/tests/view/document-annot-demo.mq.md index 1c6f539..2bbead0 100644 --- a/tests/view/document-annot-demo.mq.md +++ b/tests/view/document-annot-demo.mq.md @@ -1,7 +1,7 @@ --- title: View 文档面演示(叙述 · 分支 · 循环) description: 给 marqdo view Browse 用的稍长样例:散文保真、变量高亮、分支命中与循环次数标注 -markup: v0.3 +markup: occlusion --- # main @@ -24,7 +24,7 @@ markup: v0.3 **总分 = 0** **人数 = 0** -- [分](分数表) +- [分](遍历 分数表 为 分) **总分 = 总分 + 分** **人数 = 人数 + 1** > print text=录入分数 `分`