Files
marqdo/skills/marqdo-dev/data.mq.md
cflmy 9331af78e2 release(2.8.0): 合入 CHANGELOG/README/发版说明/skills prove 任务;CI 链接指向 doc/releases
- CHANGELOG.md:v2.8.0 条目(中英双语);
- README.md:版本行 2.7.1→2.8.0 + 愿景第 6 条(知识可证明);
- doc/releases/v2.8.0.md:双语发版说明(亮点/用法/已知限制);
- skills/marqdo-dev/index.mq.md:新增 prove 任务(路径/目录模式/
  require_lean/json;参数用 + 行声明升参,check 与 narrative-ratio 通过);
- 设计文档 §12.5 标记已合入;发版链接统一指向 doc/releases/v2.8.0.md。
2026-11-18 10:29:26 +08:00

4.7 KiB
Executable File

markup, title, import
markup title import
occlusion Native verification for Markdown data refactors
document table result
lib/document.mq.md lib/table.mq.md lib/result.mq.md

Extract static literal tables into readable Markdown data leaves while callable sources explain their use. Compare actual old function values with the new native parser before applying source changes. These pure tasks do not execute the supplied data as a program or mutate files.

literal_tables

参数 类型 默认 说明
specifications list required Records with a unique key and literal Markdown table text
返回 类型 说明
result map Result containing ordered key/value records for all selected literal tables

Use specifications to inspect a planned Markdown data split before writing it. Each key identifies the original file and function, while text carries that table's exact source. The standard document parser preserves native literal types and shapes and refuses dynamic expressions. No file, import, process or code fence is executed. Duplicate identities are a failed Result rather than an overwritten observation, and parser diagnostics retain their actual failure. This task is pure; it supplies data evidence, not permission to replace source.

We rows = Start the ordered literal evidence and keys = Track exact source identities.

  • [Read every explicitly selected literal table](for specifications as specification) We key = Read its source identity) and source = Read its exact table source).

    1. [This identity was already observed](table.contains(list=keys, item=key)) Return [Keep duplicate source identity explicit](result.error(code="data.duplicate", message=key, operation="literal_tables")). We value = Use the native literal table parser and keys = [Retain this identity](table.append(list=keys, item=key)).

    row =

    key value
    key value

    We rows = [Keep the complete native value](table.append(list=rows, item=row)). Return Expose ordered immutable data evidence.

compare

参数 类型 默认 说明
expected list required Baseline key/value records obtained from actual original functions
actual list required Key/value records obtained from the proposed literal data
返回 类型 说明
result map Result with exact count and the source keys whose native values differ

Use expected and actual for a data-only refactor review. Identities and cardinality are checked before any source mutation, then values are compared through native equality. A boolean must remain a boolean, and row/column/list structure must remain the same. The failed Result keeps mismatched identities in value, allowing --require-ok to stop a migration without losing evidence. This task neither writes files nor declares a later behavioral change equivalent; deliberate content edits need their own review.

We mismatched = Start actual data differences and expected_keys = [Read baseline identities](table.pluck(list=expected, key="key")) and actual_keys = [Read proposed identities](table.pluck(list=actual, key="key")).

  1. len(expected) != len(actual) or len(table.unique(list=expected_keys)) != len(expected) or len(table.unique(list=actual_keys)) != len(actual) Return [Reject missing or repeated data identities](result.error(code="data.identities", message="baseline and actual must have equal counts and unique keys", operation="compare")).

evidence =

count mismatched
count mismatched
  1. len(mismatched) == 0 Return Retain the unchanged data evidence. We failed = [Keep the refactor incomplete](result.error(code="data.value_drift", message="inspect the mismatched source keys", operation="compare")). Return [Preserve differences on failure](table.put(in=failed, at="value", value=evidence)).