Skip to content

Validate Snippet page declarations - #1325

Draft
danielporterda wants to merge 1 commit into
snippet-validate-condition-pagefrom
snippet-validate-snippet-page
Draft

Validate Snippet page declarations#1325
danielporterda wants to merge 1 commit into
snippet-validate-condition-pagefrom
snippet-validate-snippet-page

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Composes snippet-page validation against the separately validated condition page. It parses <Snippet>, validates basic attributes, resolves source/path attributes, applies repository/path safety and local-preview policy, maps condition context, checks candidate identity, and returns only fully validated snippets plus diagnostics.

It does not combine condition and snippet diagnostics into a whole-page entry point, add a CLI, resolve remote content, or compile MDX.

Why

Snippet declaration composition is independently reviewable from conditional composition and from the public validator command.

Validation

  • python -m pytest tests/test_snippet_page_validation.py tests/test_condition_page_validation.py tests/test_candidate_condition_diagnostics.py tests/test_local_snippet_source_remediation.py (12 passed)
  • python -m ruff check scripts/snippets/model.py scripts/snippets/page_validation.py tests/test_snippet_page_validation.py
  • python -m mypy scripts/snippets/model.py scripts/snippets/page_validation.py
  • git diff --check

Signed-off-by: danielporterda <daniel.porter@digitalasset.com>
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.

1 participant