marqdo-cli 的 issue #10 已关闭公共静态分析边界,marqdo.analysis revision 3 在 ADR-0069 下原地替换。revision 号仍是 3,但旧字段集合不再被当前 schema/consumer 接受;check --emit 现在直接带完整 Markdown AST、精确 source、完整标题作用域、anchors、状态化 references 和项目上下文。
marqdo-cli
marqdo.analysis
check --emit
目标:让 marqdo-view 只依赖当前 CLI + Analysis v3 + Tool v1,不再为渲染语义单独运行 inspect --ast,并正确使用新的 section 范围和 reference 状态。
marqdo-view
inspect --ast
契约与迁移文档:
tests/consumers/view_consumer.py
lint_consumer.py
knowledge_consumer.py
v3.0.0-rc.4
当前实现中的相关位置:
src/core_client.rs
src/protocol/analysis_v2.rs
RawProject
RawModule
RawUnit
RawReference
src/reader/*
heading_span
span
src/execution/*
source.analysis_digest
inspect --ast --json
modules[].document
inspect
inspect --ir
modules[].source
source_digest
relative_path
entry_module_id
manifest_digest
extensions
source
document
anchors
requires.analysis: 3
path
parent_id
mode
mode_origin
mode_source_unit_id
[{anchor, unit_id}]
resolved
state
target_kind
module
file
not_loaded
missing
invalid
outside_scope
ambiguous
candidates
external
source_unit
calls[]
state/target_kind/target_owner/reason
unresolved(dynamic|unbound)
display
content_digest
diagnostics[]
run/call --output json/jsonl --observation-file
--refs
Raw*
marqdo-cli v3.0.0-rc.4
MARQDO_BIN
marqdo check entry.mq.md --emit analysis.json python3 tests/consumers/validate_protocols.py analysis.json observation.json tool.json python3 tests/consumers/view_consumer.py analysis.json marqdo inspect entry.mq.md --refs --json # 仅人工诊断
完成后请在本 issue 记录下游 commit、CI、CLI 版本与联调证据;上游欠账或无法访问的消费者需要明确标注,不能冒充已完成。
No dependencies set.
The note is not visible to the blocked user.
背景
marqdo-cli的 issue #10 已关闭公共静态分析边界,marqdo.analysisrevision 3 在 ADR-0069 下原地替换。revision 号仍是 3,但旧字段集合不再被当前 schema/consumer 接受;check --emit现在直接带完整 Markdown AST、精确 source、完整标题作用域、anchors、状态化 references 和项目上下文。目标:让
marqdo-view只依赖当前 CLI + Analysis v3 + Tool v1,不再为渲染语义单独运行inspect --ast,并正确使用新的 section 范围和 reference 状态。契约与迁移文档:
tests/consumers/view_consumer.py、lint_consumer.py、knowledge_consumer.pymarqdo-cliv3.0.0-rc.4(Linux x86_64,prerelease)对 marqdo-view 的直接影响
当前实现中的相关位置:
src/core_client.rs:check --emit是静态事实来源;不要再把inspect --ast作为渲染语义来源;src/protocol/analysis_v2.rs:RawProject/RawModule/RawUnit/RawReference需要新字段与严格校验;src/reader/*:渲染/标注使用heading_span放置标题 UI、使用完整span高亮 section 内容;src/execution/*:Observationsource.analysis_digest仍绑定普通check --emit的 exact bytes。必须完成的对接
check --emitinspect --ast --json机器读取移除;modules[].document与inspect --ast现在是同一投影,但前者与 source/units/references 在同一 artifact 内,避免跨进程和跨快照错配。inspect仅保留人工调试;不得用inspect --ir倒推语义。modules[].source和source_digest;所有 span 是 half-open UTF-8 字节区间。relative_path重读文件来重建 span;需要磁盘实时性时重新跑 check 并比较 digest。RawProject增加/要求entry_module_id、manifest_digest、extensions;RawModule增加/要求source、document、anchors。requires.analysis: 3不变,但同 revision 旧制品无兼容承诺;需要重装/重建消费者。heading_span:标题 AST 节点范围,用于标题定位/目录/锚点 UI。span:完整 section 范围(到下一个同级/更高层标题或 EOF,包含子标题),用于内容高亮、切片、注释归属。path是结构化数组;parent_id、mode、mode_origin、mode_source_unit_id直接使用;不要 split display id。anchors是[{anchor, unit_id}];anchor 是导航名称,不是身份。resolved已移除;按state渲染:resolved:可跳转,target_kind为module/file;not_loaded:当前 catalog 未加载/未核验,展示“未核验”而不是断链;missing/invalid/outside_scope:可行动错误;ambiguous:列出candidates,绝不静默选第一个;external:外链,不联网、不是错误。source_unit定位引用所属 section,使用span高亮原文。calls[]的state/target_kind/target_owner/reason用于执行标记;unresolved(dynamic|unbound)不应显示为编译错误。display:公式 bool、代码 null;content_digest对应 AST literal。diagnostics[]已包含文件内 mq 诊断;不要再用inspect或私有 IR 生成第二套。run/call --output json/jsonl --observation-file的source.analysis_digest必须等于普通check --emit精确 bytes 的 SHA-256 表达。--refs的诊断会改变 artifact bytes;不要把--refs检查的 artifact 当成运行绑定。source_digest;过期页面必须刷新/重跑。验收标准
inspect --ast调用;静态事实全部来自一次check --emit。Raw*模型要求新字段,旧 revision-3 artifact 明确拒绝;无 v2/旧形状 fallback。heading_span,section 高亮/切分使用完整span;无兄弟交叉/内容截断。not_loaded不误报断链。marqdo-cli v3.0.0-rc.4归档与MARQDO_BIN跑通阅读/运行/导出全链路,记录 CLI SHA、schema 摘要和通过数量。参考命令
完成后请在本 issue 记录下游 commit、CI、CLI 版本与联调证据;上游欠账或无法访问的消费者需要明确标注,不能冒充已完成。