deepseek-harness/scripts
Tianyi Cui 63425a2b87 refactor: detect md hard-wraps via mdast AST, not regex
Per review feedback (use a real markdown parser with an AST linked to
source positions), rewrite verify-md-wrap to parse each file with
mdast-util-from-markdown (the CommonMark parser behind remark) + the GFM
extension, then flag any `paragraph` node whose source span covers more
than one line.

Why a parser over the hand-rolled line scanner:
- It is a checker, not a formatter — it reports and never rewrites, so
  zero cosmetic churn (no emphasis-marker or table-delimiter
  normalization, which is why Prettier was rejected for this).
- The AST owns every structural exemption (fenced code of any fence
  length, tables, lists, blockquotes, HTML, headings, reference defs),
  fixing both bugs the regex version had: it now catches wrapped
  list-item / blockquote prose (a `paragraph` inside those nodes) and no
  longer false-positives on a longer ```` fence wrapping an inner ```.

Also unwrap two pre-existing hard-wrapped blockquotes (architecture.md,
adding-a-tool.md) that the stricter AST check correctly surfaced.
2026-06-16 23:35:33 +08:00
..
check-vendor-manifest.sh Add lefthook git hooks with a vendor-manifest guard 2026-06-11 15:07:55 +08:00
check-workspace-constraints.ts feat: migrate to pnpm 2026-06-16 14:55:37 +08:00
doc-typecheck.ts feat: migrate to pnpm 2026-06-16 14:55:37 +08:00
gen-module-graph.ts docs: document module-graph gate; unwrap generated prose 2026-06-16 21:21:21 +08:00
publint-all.ts feat(invariants): dev-mode event-contract assertions + session-log freeze (RFC 005 pt 3, RFC 008) 2026-06-13 23:25:12 +08:00
verify-event-taxonomy.ts fix(scripts): harden event-taxonomy brace walk against JSDoc braces (PR 4) 2026-06-14 00:54:47 +08:00
verify-md-wrap.ts refactor: detect md hard-wraps via mdast AST, not regex 2026-06-16 23:35:33 +08:00