Skip to content

feat!: name the node of each validation diagnostic, and add Block::children - #28

Merged
plimeor merged 1 commit into
mainfrom
claude/project-thread-w7j705
Oct 18, 2026
Merged

plimeor merged 1 commit into
mainfrom
claude/project-thread-w7j705

Conversation

@plimeor

@plimeor plimeor commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Requested by Plimeor · project thread

Before: a validation diagnostic carried only an optional span, so an editor that writes a hand-built tree (no spans) could not tell which node was refused; Settle retries the write with each tight list made loose until fewer diagnostics come back. Every caller walking blocks wrote its own match over container kinds.

After: every validation diagnostic (and so every to_markdown / to_html refusal) carries path: Option<NodePath>, the node its shape belongs to in the document validated; parser diagnostics leave it None. The wasm binding passes it as path: number[] | null. Block::children() returns the blocks directly inside a block container.

How: the validator keeps the current path while descending and attaches it to each diagnostic it pushes. Plan archived at docs/archive/2026-10-18-node-paths/; specs public-api, validation, wasm-binding updated (Shortcode glyph merged into "Each written fact is stored once" to keep public-api at 20 requirements).

Breaking: Diagnostic gains a public field, so its struct literal no longer compiles.

Validation run locally: cargo fmt --check, cargo build, cargo test --no-run, cargo test --profile ci --features html (all pass), RUSTDOCFLAGS='-D warnings' cargo doc --no-deps, cargo test -p markdown-syntax-wasm, the wasm32 build, and node --test 'wasm/js/test/*.test.mjs' (27 pass).


Generated by Claude Code

…ildren

A validation diagnostic now carries the NodePath of the node its shape
belongs to, in the document validated, so a caller can fix a refused
span-less tree without guessing; parser diagnostics leave it None. The
wasm binding passes the path through. Block::children() gives the blocks
directly inside a block container.

BREAKING CHANGE: `Diagnostic` gains the public field `path`, so a struct
literal of it no longer compiles.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JoGTgQ8jovSb2J6bwSz4NT
@plimeor plimeor self-assigned this Oct 18, 2026
@plimeor
plimeor merged commit c137b57 into main Oct 18, 2026
2 checks passed
@plimeor
plimeor deleted the claude/project-thread-w7j705 branch October 18, 2026 03:24
@github-actions github-actions Bot mentioned this pull request Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants