Implement the lint-owned part of the AI-readable documentation architecture (marqdo-lint#13 / marqdo#55 §13) without adding document language or a second parser. All rules read one public `check --emit` Analysis 3 projection. New rules (25 total): - MQD-ENTRY-001 (info): a manifest-backed or multi-module project entry is not `index.mq.md`; standalone single-file documents are never warned. - MQD-STRUCT-001 (info): the same canonical heading name appears under several parents (valid, but bare anchors get numbered suffixes); points at units[].name/path/heading_span. - MQD-REL-001 (info): a link resolves to a loaded module that the document did not import; states that links are static references, not imports/execution. Also records the release/platform contract for marqdo-lint#9/#14: Linux x86_64 is the only supported platform (real v0.2.0 assets + local gates); macOS/Windows stay UNVERIFIED/unsupported. Release assets and same-SHA CI requirements are frozen in docs/RELEASE.md; publication remains a maintainer action (this repo's CI only notifies the root reconcile). PROTOCOL_BASELINE now records the rc.6 candidate while keeping the rc.4+ accepted protocol floor for the still-rc.5 CI image (tracked by #11). No cross-repo dependency, no parser copy, no document syntax change.
4.1 KiB
4.1 KiB
验收记录
当前门禁接受 Marqdo 3.0.0-rc.4–3.0.0-rc.6 的同一公开 Analysis 3 协议(当前候选 rc.6,CI 镜像仍为 rc.5;见 PROTOCOL_BASELINE)。每次运行
scripts/validate-control-flow.py 都会写入
docs/validation/<cli-source-sha>.json,记录 lint commit、lint 版本、
Tool bundle 摘要、核心二进制前后摘要、平台、UTC 时间与逐门禁结果。
冻结核心
| 项目 | 固定值 |
|---|---|
| 源码提交 | 452e9a32bd9e40dba427d4180691c58bab74449e |
| Linux x86_64 归档 SHA-256 | 9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8 |
| 归档内 CLI SHA-256 | a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e |
| Analysis schema SHA-256 | 03929300cec53bb29309a933f74c1aa807943bfd7dbecc80cf4f7f54d037eb30 |
核心二进制在门禁前后必须保持同一 SHA-256,证明 Lint 没有修改核心。
发布门禁
| 门禁 | 内容 | 判定 |
|---|---|---|
| G01 | scripts/check-no-legacy.sh |
src/、tool.json、scripts/ 无旧契约残留,0 命中 |
| G02 | cargo fmt --all --check、cargo clippy --all-targets -D warnings、cargo test --locked |
全部退出 0,记录通过数 |
| G03 | scripts/package-tool.sh + 隔离注册目录 + marqdo tool install/list/remove |
安装、分发、卸载成功,退出码 0/1/2 透传,卸载后分发失败 |
| G04 | 正向规则与安全修复 | inventory、多臂、嵌套循环、Knowledge 示例均为 complete;dry-run 不写;正式修复幂等 |
| G05 | JSON 报告契约 | 单文件报告通过 schemas/marqdo-lint-v1.schema.json 校验 |
| G06 | 负例 fail closed | 旧 revision 3 字段集合、错误 source_digest、错误 revision、旧 Tool manifest 均失败 |
| G07 | 单核心证据 | 本脚本生成 manifest,绑定核心源码/归档/二进制 SHA |
| G08 | 文档事实一致 | README、PROTOCOL_BASELINE、VALIDATION、ARCHITECTURE、CLI 只描述当前边界 |
| G09 | CI | .woodpecker/main.yml 运行 G01–G07,红即阻塞 |
| G10 | 独立应用试跑 | 当前标为 UNVERIFIED,不声明误报率 |
缺少任一 P0 门禁或任一负例未 fail closed,脚本非零退出,不得发布。
负例
scripts/validate-control-flow.py 的 G06 至少覆盖:
- 旧 revision 3 字段集合(缺少
source/document/anchors)→ 退出 2,提示 重新生成 Analysis、重装 Tool、重建 lint; schema_version不是 3 → 退出 2,不解码;sha256(source)与source_digest不符 → 退出 2,不运行规则;- 旧
tool.json带compatibility→ 安装失败,提示按 revision 1 重写。
单元/集成测试还覆盖非法模块身份、重复 unit/function、越界或非 UTF-8 边界
span、坏 statement/expression 形状、坏 reference state、resource
content_digest 与 AST literal 不符等 fail-closed 路径。
复现
export MARQDO_BIN=/abs/unpacked/marqdo-3.0.0-rc.4-x86_64-unknown-linux-gnu/marqdo
sha256sum "$MARQDO_BIN" # a7306962…
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test --locked
./scripts/check-no-legacy.sh
./scripts/package-tool.sh
export MARQDO_TOOL_HOME="$PWD/target/validation/registry"
"$MARQDO_BIN" tool install .cache/tool-bundle/tool.json
"$MARQDO_BIN" lint examples/nested/inventory.mq.md --format json
"$MARQDO_BIN" tool remove lint
python3 scripts/validate-control-flow.py "$MARQDO_BIN"
sha256sum "$MARQDO_BIN" # 前后一致
已知上游欠账(诚实记录)
UNVERIFIED:本仓库无法取得 qdagent/qdqc 的固定提交归档,未完成独立应用 试跑,不声明误报率。- rc.4 的 stdlib 模块里部分
signature.params[].span不落在对应 artifact source 的 UTF-8 字符边界上。该字段只用于展示,不参与规则对齐;Lint 仍然 严格校验 document、unit、function、statement、reference、call、resource span。此上游问题已记录,未冒充已完成。
历史
旧核心与旧制品验收记录保留为 docs/validation/historical-*.json,仅用于
审计追溯,不参与当前门禁;当前树没有对旧核心或旧字段集合的兼容路径。