Skip to content

Gate local snippet source refs - #1310

Draft
danielporterda wants to merge 1 commit into
snippet-validate-source-safetyfrom
snippet-gate-local-source-refs
Draft

Gate local snippet source refs#1310
danielporterda wants to merge 1 commit into
snippet-validate-source-safetyfrom
snippet-gate-local-source-refs

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Adds the explicit policy gate for preview-only local snippet references.

Local refs are rejected in committed-page mode and accepted only when the caller opts into local preview. Immutable and pull-request refs are unaffected. This PR returns a span-anchored issue but intentionally does not add remediation text or a CLI gate yet.

Why

Whether local refs are allowed is runtime policy, distinct from parsing their URI syntax and from source safety.

Validation

  • python -m pytest tests/test_local_snippet_source_policy.py tests/test_local_snippet_source_parser.py (9 passed)
  • python -m ruff check scripts/snippets/model.py scripts/snippets/validation.py tests/test_local_snippet_source_policy.py
  • python -m mypy scripts/snippets/model.py scripts/snippets/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