Skip to content

add document pruning to remove non-conforming blocks#7

Merged
hugowetterberg merged 2 commits into
mainfrom
feature/prune
Feb 24, 2026
Merged

add document pruning to remove non-conforming blocks#7
hugowetterberg merged 2 commits into
mainfrom
feature/prune

Conversation

@hugowetterberg
Copy link
Copy Markdown
Contributor

Implement Validator.Prune() which modifies a document in-place to strip blocks that fail validation when their count constraints allow removal. Errors cascade up to the nearest removable ancestor or are reported at the document root when removal isn't possible.

Includes helper methods on BlockConstraint and DocumentConstraint for checking minimum count requirements, a comprehensive test suite, and test fixture constraint/document files for planning documents.

hugowetterberg and others added 2 commits February 22, 2026 17:43
Implement Validator.Prune() which modifies a document in-place to strip
blocks that fail validation when their count constraints allow removal.
Errors cascade up to the nearest removable ancestor or are reported at
the document root when removal isn't possible.

Includes helper methods on BlockConstraint and DocumentConstraint for
checking minimum count requirements, a comprehensive test suite, and
test fixture constraint/document files for planning documents.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hugowetterberg hugowetterberg merged commit 6a6c8a7 into main Feb 24, 2026
2 checks passed
@hugowetterberg hugowetterberg deleted the feature/prune branch February 24, 2026 17:39
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