feat(docx-markdoc): validate structural insertions - #970
Open
stevenobiajulu wants to merge 2 commits into
Open
Conversation
Safe DOCX already preserves formatting when callers choose the right peer, but structurally valid edits can still split parents from descendants, import the wrong list topology, or collapse a two-paragraph run-in provision into one formatted paragraph. Add one deterministic validator registry at the document-view boundary so Markdoc preflight and MCP insertion responses share stable, actionable diagnostics before output is written.\n\nThe bonded-pair rule relies on repeated adjacent style and indent transitions, not legal-text heuristics, so the NVCA Heading2/HeadingPara2 pattern remains two paragraphs with distinct formatting sources. Junior Harness retry state and product-specific classifiers remain intentionally outside this package.\n\nRef: add-markdoc-structural-validation
Dynamic peer review identified that positional matching could reuse one body operation, silently choose among multiple follower styles, and leave BEFORE ordering unspecified. Make pairing one-to-one, direction-aware, and explicitly fail ambiguous source patterns.\n\nAllow batch_edit to express the validated two-paragraph construction atomically through an explicit bonded_pair_id. The collision exception applies only to exactly two source-proven, correctly ordered steps with distinct style peers; unrelated and three-step same-slot insertions remain hard conflicts.\n\nRef: add-markdoc-structural-validation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
LLM gate (advisory)1 finding to review (advisory, does not block) - 7 pass, 1 warn, 0 error, 9 skipped, 17 total Findings (1)
All 17 rules (8 evaluated, 9 skipped)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Notes
This PR is stacked on
add-brownfield-markdoc-authoring-20260812because the validation preflight integrates with that new Markdoc compilation surface.