feat: policy dictionary - #479
Merged
Merged
Conversation
ivanmiletic
approved these changes
Jul 8, 2026
Merged
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.
Dictionaries for policies
This PR adds dictionaries to policies: named sets of allowed string values with human-readable labels. A dictionary is declared once as a block and drives typing, input validation and the natural-language projection, while rules keep using plain string literals. A dictionary is not a value: it cannot be referenced from expressions, and it never appears in inputs or results.
What it delivers
A dictionary block declares canonical values and their labels. DataModel property then references it the same way it references an entity, and the field becomes a string constrained to the dictionary:
customer.tiertargetingcustomerTiercustomer.tier == 'VIP'in a rule{ "tier": "GOLD" }customerTier.Xmember syntax. An expression referencing the dictionary by name is an unknown-property diagnostic like any other.dictionaries()API exposes values with their labels, and the natural-language projection uses them: a'VIP'literal compared against a dictionary-typed field projects with a select hint whose options are labeled ("Very important", "Standard") and carry ready-to-insert literals; list membership (in,contains,all(...)) gets multi-select hints; an empty decision-table cell offers the labeled values as subject options. Exposed in the Node.js binding asworkspace.dictionaries(...).How it helps