Skip to content

Validate candidate condition identity - #1313

Draft
danielporterda wants to merge 1 commit into
snippet-map-condition-contextfrom
snippet-validate-candidate-condition
Draft

Validate candidate condition identity#1313
danielporterda wants to merge 1 commit into
snippet-map-condition-contextfrom
snippet-validate-candidate-condition

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Validates the relationship between a resolved pull-request snippet source and its mapped <IfVersion> context.

A candidate must be inside a condition, and both repository and PR number must match exactly. Immutable and local sources are unaffected.

Why

Candidate/condition identity is its own cross-directive rule, separate from parsing either directive and from determining nesting context.

Validation

  • python -m pytest tests/test_candidate_snippet_condition_validation.py tests/test_snippet_condition_context.py (7 passed)
  • python -m ruff check scripts/snippets/model.py scripts/snippets/semantics.py tests/test_candidate_snippet_condition_validation.py
  • python -m mypy scripts/snippets/model.py scripts/snippets/semantics.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