feat: document-structure rules + release/platform contract (#13/#14/#12) #15

Merged
cflmy merged 2 commits from codex/issue-13-14-doc-rules-and-release into main 2026-11-30 12:00:48 +08:00
Owner

概述

实现 marqdo#55 §13 / marqdo#56 §4·§7 在 Lint 责任仓的子工单,不新增文档语言、不复制解析器、不新增跨仓依赖。

交付

1. 文档结构规则(#13 / #12)

新增 3 条严格基于一次公开 check --emit Analysis 3 的规则(目录共 25 条),全部 info,不影响默认 --fail-on warning:

  • MQD-ENTRY-001:manifest 项目或多模块项目的入口不是 index.mq.md(单文件文稿不提示)。
  • MQD-STRUCT-001:同名标题出现在多个作用域(合法但裸锚点会编号),给出 units[].path 与新建议。
  • MQD-REL-001:链接目标已加载但未被 import(链接是静态引用,不加载/不执行)。

配套:src/rules/structure.rs(规则+单测)、docs/RULES.md、catalog 计数与 CLI 测试更新。规则只读 units[]/anchors[]/references[]/imports[]/project 稳定字段,引用 CLI 候选 spec/document-structure.md。

2. 发行/平台合同(#9 / #14)

docs/RELEASE.md:Linux x86_64 为唯一 supported(v0.2.0 真实资产 + 本地门禁),macOS/Windows UNVERIFIED/unsupported;冻结资产名/SHA256/release-manifest.json/同 SHA CI/不可变发布与人工批准;明确 .woodpecker/release.yml 仅通知根对账、仓库 CI 不持有发布密钥。
docs/PROTOCOL_BASELINE.md 记录 rc.6 候选(源码 63776735…、归档 8dc0b006…),同时保留 rc.4–rc.6 同一 Analysis 3 的兼容门槛(CI 镜像仍 rc.5,由 #11 跟踪)。

验证(真实,Linux x86_64 / glibc 2.43)

./scripts/check-no-legacy.sh                                  PASS
cargo fmt --all -- --check                                    PASS
cargo clippy --all-targets --locked -- -D warnings             PASS
cargo test --locked                                           64 passed, 0 failed
sh scripts/package-tool.sh <out>                              PASS
  binary sha256 d6443802… ; tool.json sha256 e68f2242…
真实 Tool 安装/运行/卸载(CLI 3.0.0-rc.6 candidate 0f87f856 + pinned Bundle 0.2.0)
  tool install → lint examples/nested/inventory.mq.md --format json → exit 0
  tool remove lint → PASS
  • 证据:docs/evidence/2026-11-30-doc-structure-rules.md。
  • 未验证并如实记录:macOS/Windows 原生、正式 rc.6 归档消费(#11)、新规则的正式 v0.3.0 发布(需维护者批准);本次不创建 tag/release。

边界

  • 无新 parser/第二套文档规范;未改 Analysis/Observation/CLI Tool 协议;未改父仓/兄弟仓;未新增 catalog/manifest/发布流程。
  • Tool manifest 仍为 {api_revision: 1, analysis: 3},CI 入口不变。

refs #13 #14 #12 #11 #9

## 概述 实现 `marqdo#55` §13 / `marqdo#56` §4·§7 在 Lint 责任仓的子工单,不新增文档语言、不复制解析器、不新增跨仓依赖。 ## 交付 ### 1. 文档结构规则(#13 / #12) 新增 3 条严格基于一次公开 `check --emit` Analysis 3 的规则(目录共 25 条),全部 `info`,不影响默认 `--fail-on warning`: - `MQD-ENTRY-001`:manifest 项目或多模块项目的入口不是 `index.mq.md`(单文件文稿不提示)。 - `MQD-STRUCT-001`:同名标题出现在多个作用域(合法但裸锚点会编号),给出 `units[].path` 与新建议。 - `MQD-REL-001`:链接目标已加载但未被 import(链接是静态引用,不加载/不执行)。 配套:`src/rules/structure.rs`(规则+单测)、`docs/RULES.md`、catalog 计数与 CLI 测试更新。规则只读 `units[]/anchors[]/references[]/imports[]/project` 稳定字段,引用 CLI 候选 `spec/document-structure.md`。 ### 2. 发行/平台合同(#9 / #14) `docs/RELEASE.md`:Linux x86_64 为唯一 supported(v0.2.0 真实资产 + 本地门禁),macOS/Windows UNVERIFIED/unsupported;冻结资产名/SHA256/`release-manifest.json`/同 SHA CI/不可变发布与人工批准;明确 `.woodpecker/release.yml` 仅通知根对账、仓库 CI 不持有发布密钥。 `docs/PROTOCOL_BASELINE.md` 记录 rc.6 候选(源码 `63776735…`、归档 `8dc0b006…`),同时保留 rc.4–rc.6 同一 Analysis 3 的兼容门槛(CI 镜像仍 rc.5,由 #11 跟踪)。 ## 验证(真实,Linux x86_64 / glibc 2.43) ```text ./scripts/check-no-legacy.sh PASS cargo fmt --all -- --check PASS cargo clippy --all-targets --locked -- -D warnings PASS cargo test --locked 64 passed, 0 failed sh scripts/package-tool.sh <out> PASS binary sha256 d6443802… ; tool.json sha256 e68f2242… 真实 Tool 安装/运行/卸载(CLI 3.0.0-rc.6 candidate 0f87f856 + pinned Bundle 0.2.0) tool install → lint examples/nested/inventory.mq.md --format json → exit 0 tool remove lint → PASS ``` - 证据:`docs/evidence/2026-11-30-doc-structure-rules.md`。 - 未验证并如实记录:macOS/Windows 原生、正式 rc.6 归档消费(#11)、新规则的正式 `v0.3.0` 发布(需维护者批准);本次不创建 tag/release。 ## 边界 - 无新 parser/第二套文档规范;未改 Analysis/Observation/CLI Tool 协议;未改父仓/兄弟仓;未新增 catalog/manifest/发布流程。 - Tool manifest 仍为 `{api_revision: 1, analysis: 3}`,CI 入口不变。 refs #13 #14 #12 #11 #9
cflmy added 2 commits 2026-11-30 11:53:48 +08:00
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.
cflmy merged commit cd01607fea into main 2026-11-30 12:00:48 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cflmy/marqdo-lint#15