Conversation
按 A(本机实跑)/B(厂商随包文件)/C(官方源码定义)/D(运行时真实配置)四级取证 编写 MiniMax Code 手册,每条主张可追溯到 VERIFICATION.md;经核实不存在的能力 明确标注为不存在并给出替代路径,而非省略或推测。取证基线版本 0.5.8。 - skills/mcode-docs/: SKILL.md + 9 篇 reference,覆盖安装形态、CLI 与无头 执行全量参数、ACP 接入、52 条 TUI slash 命令全表、配置结构与开关、内置 Agent 与 Skill、插件与 MiniApp 编写契约、Hook 系统完整契约(事件、stdin 契约、进程环境白名单、权限更新、时间预算与诊断码)、MCP 与内置工具、权限 模式与 Plan Mode、会话管理 - site/: 中英双语纯静态 HTML,零构建步骤、零网络请求、可离线阅读;三张架构图 (Runtime 与 client 分工 / Plugin 生命周期 / MiniApp 拓扑与存储二分)走既有 语义令牌,深色主题自动生效 - verify/: 49 条 claim 分 cli/config/hooks/permissions/architecture 五域,三类 检查(doc/source/exec),集合级断言双向比对并配可 review 的豁免表 - test/: 呈现纪律与 harness 逻辑回归,不依赖 mcode,随 npm run check 执行 无 MCP 服务、无凭据、无安装器、无原生二进制、无符号链接、无网络行为。
PR 模板 checklist 要求 README 给出真实的示例 prompt 与预期结果, CONTRIBUTING「Open the pull request」同样要求可复制的示例 prompt。 原 README 的 Usage 段只说明加载时机,没有可复制的示例。 示例取「mcode 是否有文件系统快照回滚」——一个真实会被误判的问题: /history、/fork、/rewind 名称相近但作用于会话历史,不能当替代; 受支持路径是 git。预期结果同时要求给出台账条目与手册小节出处。 中英两份同步补齐。
上游 CodeQL(js/bad-html-filtering-regexp) 报 1 个 high: 「该正则匹配不到 `</script >` 这类闭合标签」。 `<\/script>` 要求 `>` 紧跟标签名,而 HTML 允许闭合标签的 `>` 前带空白, 浏览器同样在 `</script >` 处终止脚本。漏掉这一类的直接后果是:站点若 出现这种写法,script/style 源码会整段漏进「可见文本」,让 doc 类断言 可能锚在 JS 代码上——而 doc 检查的前提正是「读可见文本,不读源码标记」。 改为 `<\/script\s*>` / `<\/style\s*>`,非贪婪语义不变(仍在第一个闭合 标签处终止,不会过度吞并后续正文)。 补回归测试并做反向验证:把正则改回旧写法,该测试报红(leak 泄漏); 恢复修复后转绿。测试钉住的是「源码不泄漏」,不是某个具体字符串。
上一版改成 `<\/script\s*>` 仍不够。CodeQL 换样本再报一次: `</script\t\n bar>` —— `>` 前不只是空白,还能夹任意属性。 浏览器在 `</script` 后遇到空白、`/` 或 `>` 就终止脚本,后续直到 `>` 的内容按结束标签的属性解析。所以闭合形态是「`</script` + 至多一个 空白/`/` + 任意非 `>` 字符 + `>`」,写死任一具体形态都覆盖不全。 改为 `<\/script[^>]*>` / `<\/style[^>]*>`。对文本抽取器而言这还更稳: `</scriptX>` 也会一并剥掉。非贪婪前缀不变,仍在第一个闭合标签处终止。 回归测试扩到三种闭合写法(紧贴 / 带空白 / 带属性),并新增一条钉住 「不吞并后续正文」。三个版本都做过反向验证: - `<\/script>` -> 报红 - `<\/script\s*>` -> 报红 - `<\/script[^>]*>` -> 全绿
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Adds a new Plugin,
plugins/weekbin/mcode-docs— an evidence-graded factual baseline for MiniMax Code (mcode). 38 files, all new; nothing outside the Plugin directory is touched.The problem it solves. Material describing
mcodeis scattered across the packaged README, the official open-source repository, runtime configuration files, and minified build artifacts. Retrieval difficulty is low; the real risk is adopting a plausible but incorrect assertion. Three failure modes recur, and this Plugin corrects all three:mcode mcp add,mcode skill listand similar subcommands existPreToolUsein minified artifacts means no hook system existsWhat it ships.
skills/mcode-docs/— a reusable Skill plus nine reference documents: the complete TUI slash command table, the CLI / headless / ACP surface, configuration structure and per-OS data directories, agents and skills, the Plugin and MiniApp authoring contracts, the full Hook contract (events, registration document, stdin contract, process environment allow-list, control output fields, permission updates, time budgets, diagnostic codes), MCP and built-in tools, permission modes and Plan Mode, sessions, and a capability-boundary crosswalk.site/— a bilingual (zh default, en) purely static HTML site. No build step, no package manager, no CDN, no network request of any kind; it runs underfile://. Full-text search, per-block copy, scroll-tracking outline, mobile drawer, opt-in dark theme, and three architecture diagrams.VERIFICATION.md— the evidence ledger. Every claim is graded A (live run on a local install) / B (first-party files shipped in the package) / C (authoritative definitions in the official source) / D (real runtime configuration), and carries its counter-examples and correction records. Baseline version 0.5.8.verify/— a documentation-proof harness: 49 claims across five domains, three check kinds (doc/source/exec), bidirectional set assertions with a reviewable exemption table.test/— presentation-discipline and harness-logic regression tests.Note on symbol names. Minified build artifacts retain string literals, not symbol names, so a claim that cites a symbol name cannot be re-verified against the shipped bundle. The harness therefore asserts against literals. An earlier revision of the manual cited a symbol that no longer exists after minification; that correction is recorded in
VERIFICATION.mdand is now permanently re-checked by thecli.side-session-commandsclaim.User value
An mcode user or Plugin author can ask "does mcode support X?" and get a verdict plus a citation instead of a plausible guess. Capabilities that were checked and found absent are stated as absent together with a supported substitute, rather than being omitted or guessed.
Example prompt
Expected result
The agent answers that
mcodehas no global filesystem snapshot facility, and does not stop at the denial. It states that/history,/forkand/rewindact on sessions and conversation history rather than on the filesystem, so they are not a substitute; it gives git as the supported alternative; and it cites both the ledger entry inVERIFICATION.mdand the manual section that settles the question.Dependencies and platforms
verify/harness that maintains the manual needs Node.js ≥ 22 andmcode0.5.8; it is run by the maintainer, not by end users.package.jsondeclares no dependency.Network and data behavior
file://; the clipboard fallback path was verified explicitly.verify/reads the localmcodeinstallation and the local source tree, writes a report underverify/evidence/(git-ignored), and sends nothing anywhere.Plugin submission checklist
plugins/<github-owner>/<plugin-name>—plugins/weekbin/mcode-docsplugin.jsonname matches the Plugin directory —mcode-docsREADME.mdincludes a real example prompt and expected resultLICENSEandplugin.jsondeclare an open-source license — Apache-2.0 in bothTODOhas been replaced — 0 matches forTODO|FIXME|XXX|PLACEHOLDERnpm run checkpassesEvidence
Automated — repository gate
npm run checkwas re-run in an environment wheremcodeis not onPATH, to demonstrate the Plugin adds no hidden dependency on the author's machine. The single skipped test (workspace-lock Git operations disable repository transaction hooks) is a pre-existing skip in another Plugin and is unrelated to this change.Automated — documentation proof harness
This harness is deliberately not part of
npm run check: it needsmcodeand its packaged source, so it runs when the maintainer re-verifies against a new version. Thetest/suite that is part ofnpm run checkcovers presentation discipline and harness logic, and requires nomcode.Manual — site, both themes
Measured with headless Chrome via
getBoundingClientRect(layout read from the live DOM, not inferred from the CSS):index.html(zh)scrollWidth756 =innerWidth756)index.html(zh)index.en.html(en)index.en.html(en)Each figure measures 720px, equal to the prose column width. Diagram styling goes entirely through
dg-*classes bound to the existing semantic tokens, so dark mode follows the token override; there is no per-theme diagram rule, and the suite asserts that so a future hard-codedhtml[data-theme="dark"] .dg-*override fails the build. No figure contains a hex orrgb()fill or stroke — the only inline values arefill="none"and onecurrentColorarrowhead per figure.Also checked by hand: light theme is the default on first visit (the system
prefers-color-schemequery is deliberately not consulted), dark mode persists across reloads, andindex.htmlis always Chinese whileindex.en.htmlis always English.Security scan
Upstream CodeQL (
js/bad-html-filtering-regexp) flagged one high-severity issue inverify/lib/doc.mjs: thevisibleTexthelper stripped<script>and<style>blocks with a regex that required>to follow the tag name immediately, so it did not match</script >— a form a browser also treats as closing the block. A second round with a stricter sample (</script\t\n bar>, i.e. attributes before the>) confirmed that no single fixed suffix is sufficient.The consequence is confined to the verification harness, but it was a real defect: had the site used such a form, script source would have leaked into the extracted visible text, and a
docclaim could have anchored on JavaScript — which breaks the premise thatdocchecks read visible text rather than source markup. The pattern now accepts any run of non->characters before the closing bracket, matching how the HTML tokenizer actually ends a script element, while staying non-greedy so it still stops at the first closing tag.Regression tests cover all three closing forms and pin the non-greedy termination. They were validated in both directions and discriminate between the three implementations:
visibleTextscript-close pattern</script></script\s*></script[^>]*>Disclosure review before opening this PR
All 38 files were scanned for API keys and tokens, absolute home-directory paths, e-mail addresses, and the author's real local proxy port: no hits. The single
127.0.0.1:7890in the manual is a generic loopback proxy example in the network-proxy section, not the author's configuration.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.