@salesforce/afv-skills 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/README.md +2 -0
  2. package/package.json +1 -1
  3. package/skills/agentforce-architecture-analyze/README.md +2 -8
  4. package/skills/agentforce-architecture-analyze/SKILL.md +2 -2
  5. package/skills/agentforce-architecture-analyze/references/contract.json +4 -4
  6. package/skills/agentforce-architecture-analyze/references/soql_fields.md +1 -1
  7. package/skills/data360-activate/README.md +0 -1
  8. package/skills/data360-activate/SKILL.md +0 -2
  9. package/skills/data360-connect/README.md +0 -2
  10. package/skills/data360-connect/SKILL.md +0 -2
  11. package/skills/data360-harmonize/SKILL.md +0 -1
  12. package/skills/data360-orchestrate/README.md +0 -7
  13. package/skills/data360-orchestrate/SKILL.md +0 -2
  14. package/skills/data360-prepare/README.md +0 -1
  15. package/skills/data360-prepare/SKILL.md +0 -1
  16. package/skills/data360-query/README.md +0 -1
  17. package/skills/data360-query/SKILL.md +0 -1
  18. package/skills/data360-segment/README.md +0 -1
  19. package/skills/data360-segment/SKILL.md +0 -2
  20. package/skills/experience-cms-brand-apply/SKILL.md +47 -16
  21. package/skills/experience-lwc-generate/README.md +3 -2
  22. package/skills/experience-lwc-generate/references/async-notification-patterns.md +1 -1
  23. package/skills/experience-lwc-generate/references/component-patterns.md +3 -3
  24. package/skills/experience-lwc-generate/references/flow-integration-guide.md +1 -1
  25. package/skills/experience-lwc-generate/references/lwc-best-practices.md +4 -4
  26. package/skills/experience-lwc-generate/references/scoring-and-testing.md +1 -1
  27. package/skills/experience-lwc-generate/references/state-management.md +2 -2
  28. package/skills/experience-lwc-generate/references/triangle-pattern.md +3 -3
  29. package/skills/experience-lwc-generate/scripts/post-tool-validate.py +2 -2
  30. package/skills/experience-lwc-generate/scripts/template_validator.py +1 -1
  31. package/skills/external-diagram-mermaid-generate/README.md +2 -2
  32. package/skills/external-diagram-mermaid-generate/SKILL.md +1 -3
  33. package/skills/external-diagram-mermaid-generate/assets/agentforce/agent-flow.md +4 -4
  34. package/skills/external-diagram-mermaid-generate/assets/architecture/system-landscape.md +1 -1
  35. package/skills/external-diagram-mermaid-generate/assets/datamodel/b2b-commerce-erd.md +3 -3
  36. package/skills/external-diagram-mermaid-generate/assets/datamodel/campaigns-erd.md +1 -1
  37. package/skills/external-diagram-mermaid-generate/assets/datamodel/consent-erd.md +2 -2
  38. package/skills/external-diagram-mermaid-generate/assets/datamodel/files-erd.md +2 -2
  39. package/skills/external-diagram-mermaid-generate/assets/datamodel/forecasting-erd.md +2 -2
  40. package/skills/external-diagram-mermaid-generate/assets/datamodel/fsl-erd.md +2 -2
  41. package/skills/external-diagram-mermaid-generate/assets/datamodel/party-model-erd.md +1 -1
  42. package/skills/external-diagram-mermaid-generate/assets/datamodel/quote-order-erd.md +3 -3
  43. package/skills/external-diagram-mermaid-generate/assets/datamodel/revenue-cloud-erd.md +2 -2
  44. package/skills/external-diagram-mermaid-generate/assets/datamodel/sales-cloud-erd.md +1 -1
  45. package/skills/external-diagram-mermaid-generate/assets/datamodel/salesforce-erd.md +1 -1
  46. package/skills/external-diagram-mermaid-generate/assets/datamodel/scheduler-erd.md +2 -2
  47. package/skills/external-diagram-mermaid-generate/assets/datamodel/service-cloud-erd.md +3 -3
  48. package/skills/external-diagram-mermaid-generate/assets/datamodel/territory-management-erd.md +1 -1
  49. package/skills/external-diagram-mermaid-generate/assets/integration/api-sequence.md +1 -1
  50. package/skills/external-diagram-mermaid-generate/assets/oauth/authorization-code-pkce.md +1 -1
  51. package/skills/external-diagram-mermaid-generate/assets/oauth/authorization-code.md +1 -1
  52. package/skills/external-diagram-mermaid-generate/assets/oauth/client-credentials.md +1 -1
  53. package/skills/external-diagram-mermaid-generate/assets/oauth/device-authorization.md +2 -2
  54. package/skills/external-diagram-mermaid-generate/assets/oauth/jwt-bearer.md +2 -2
  55. package/skills/external-diagram-mermaid-generate/assets/oauth/refresh-token.md +1 -1
  56. package/skills/external-diagram-mermaid-generate/assets/oauth/user-agent-social-sign-on.md +2 -2
  57. package/skills/external-diagram-mermaid-generate/assets/role-hierarchy/user-hierarchy.md +1 -1
  58. package/skills/external-diagram-mermaid-generate/references/color-palette.md +13 -13
  59. package/skills/external-diagram-mermaid-generate/references/diagram-conventions.md +5 -5
  60. package/skills/external-diagram-mermaid-generate/references/erd-conventions.md +1 -1
  61. package/skills/external-diagram-mermaid-generate/references/mermaid-styling.md +2 -2
  62. package/skills/external-diagram-mermaid-generate/references/preview-guide.md +1 -1
  63. package/skills/external-diagram-mermaid-generate/references/usage-examples.md +9 -9
  64. package/skills/external-diagram-mermaid-generate/scripts/README.md +1 -1
  65. package/skills/integration-connectivity-connected-app-configure/README.md +4 -5
  66. package/skills/integration-connectivity-connected-app-configure/SKILL.md +2 -2
  67. package/skills/integration-connectivity-connected-app-configure/references/example-usage.md +7 -7
  68. package/skills/integration-connectivity-connected-app-configure/references/migration-guide.md +1 -1
  69. package/skills/integration-connectivity-connected-app-configure/references/oauth-flows-reference.md +1 -1
  70. package/skills/integration-connectivity-connected-app-configure/references/testing-validation-guide.md +3 -3
  71. package/skills/integration-connectivity-generate/README.md +1 -1
  72. package/skills/integration-connectivity-generate/SKILL.md +6 -0
  73. package/skills/integration-connectivity-generate/assets/callouts/rest-queueable-callout.cls +1 -1
  74. package/skills/integration-connectivity-generate/assets/external-services/external-service-operations.md +1 -1
  75. package/skills/integration-connectivity-generate/assets/soap/wsdl2apex-guide.md +1 -1
  76. package/skills/integration-connectivity-generate/references/callout-patterns.md +4 -0
  77. package/skills/integration-connectivity-generate/references/cdc-guide.md +2 -2
  78. package/skills/integration-connectivity-generate/references/event-driven-architecture-guide.md +5 -5
  79. package/skills/integration-connectivity-generate/references/event-patterns.md +3 -2
  80. package/skills/integration-connectivity-generate/references/external-services-guide.md +4 -1
  81. package/skills/integration-connectivity-generate/references/messaging-api-v2.md +2 -2
  82. package/skills/integration-connectivity-generate/references/named-credentials-automation.md +1 -1
  83. package/skills/integration-connectivity-generate/references/named-credentials-guide.md +12 -2
  84. package/skills/integration-connectivity-generate/references/platform-events-guide.md +3 -3
  85. package/skills/integration-connectivity-generate/references/rest-callout-patterns.md +1 -1
  86. package/skills/integration-connectivity-generate/references/scoring-rubric.md +1 -1
  87. package/skills/integration-connectivity-generate/references/security-best-practices.md +5 -2
  88. package/skills/integration-connectivity-generate/scripts/configure-named-credential.sh +16 -5
  89. package/skills/integration-connectivity-generate/scripts/set-api-credential.sh +11 -2
  90. package/skills/integration-connectivity-generate/scripts/suggest_credential_setup.py +4 -3
  91. package/skills/integration-connectivity-generate/scripts/validate_integration.py +1 -1
  92. package/skills/omnistudio-callable-apex-generate/README.md +1 -5
  93. package/skills/omnistudio-callable-apex-generate/SKILL.md +14 -4
  94. package/skills/omnistudio-callable-apex-generate/assets/pattern_callable_vanilla.cls +8 -1
  95. package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterface2Conversion/TRANSCRIPT.md +1 -1
  96. package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterfaceConversion/TRANSCRIPT.md +1 -1
  97. package/skills/omnistudio-datamapper-generate/SKILL.md +1 -1
  98. package/skills/omnistudio-datamapper-generate/assets/completion-summary-template.md +2 -2
  99. package/skills/omnistudio-datamapper-generate/references/best-practices.md +9 -9
  100. package/skills/omnistudio-datamapper-generate/references/naming-conventions.md +6 -6
  101. package/skills/omnistudio-datapacks-deploy/README.md +1 -1
  102. package/skills/omnistudio-datapacks-deploy/examples/business-internet-plus-bundle/deploy-business-internet-plus-bundle.yaml +1 -1
  103. package/skills/omnistudio-dependencies-analyze/SKILL.md +12 -5
  104. package/skills/omnistudio-dependencies-analyze/references/dependency-patterns.md +9 -9
  105. package/skills/omnistudio-dependencies-analyze/references/namespace-guide.md +1 -1
  106. package/skills/omnistudio-epc-catalog-generate/README.md +1 -1
  107. package/skills/omnistudio-flexcard-generate/SKILL.md +11 -4
  108. package/skills/omnistudio-flexcard-generate/references/best-practices.md +6 -6
  109. package/skills/omnistudio-flexcard-generate/references/data-binding-guide.md +9 -9
  110. package/skills/omnistudio-integration-procedure-generate/SKILL.md +9 -1
  111. package/skills/omnistudio-integration-procedure-generate/references/element-types.md +3 -3
  112. package/skills/omnistudio-omniscript-generate/SKILL.md +2 -2
  113. package/skills/omnistudio-omniscript-generate/references/best-practices.md +1 -1
  114. package/skills/omnistudio-omniscript-generate/scripts/check-duplicate-omniscript.sh +8 -0
  115. package/skills/omnistudio-omniscript-generate/scripts/deploy-omniscript.sh +8 -0
  116. package/skills/platform-apex-logs-debug/README.md +2 -2
  117. package/skills/platform-apex-logs-debug/references/cli-commands.md +2 -2
  118. package/skills/platform-apex-logs-debug/references/debug-log-reference.md +16 -16
  119. package/skills/platform-apex-logs-debug/references/log-analysis-tools.md +2 -2
  120. package/skills/platform-apex-test-run/README.md +1 -1
  121. package/skills/platform-apex-test-run/references/test-fix-loop.md +2 -2
  122. package/skills/platform-apex-test-run/references/testing-best-practices.md +3 -3
  123. package/skills/platform-data-manage/README.md +4 -4
  124. package/skills/platform-data-manage/references/bulk-testing-example.md +1 -1
  125. package/skills/platform-data-manage/references/crud-workflow-example.md +2 -2
  126. package/skills/platform-data-manage/references/orchestration.md +6 -6
  127. package/skills/platform-flexipage-generate/SKILL.md +281 -346
  128. package/skills/platform-flexipage-generate/references/cli_commands.md +39 -0
  129. package/skills/platform-flexipage-generate/references/flexipage_fieldSection.md +162 -0
  130. package/skills/platform-flexipage-generate/references/flexipage_richText.md +84 -0
  131. package/skills/platform-flexipage-generate/references/identifiers_and_regions.md +167 -0
  132. package/skills/platform-flexipage-generate/references/mcp_action_examples.md +104 -0
  133. package/skills/platform-flexipage-generate/references/record_flexipage_dynamicHighlights.md +119 -0
  134. package/skills/platform-flexipage-generate/references/xml_rules.md +335 -0
  135. package/skills/platform-flexipage-generate/scripts/resolve-component-instructions.sh +42 -0
  136. package/skills/platform-flexipage-generate/scripts/scan-lwc-components.sh +113 -0
  137. package/skills/platform-metadata-deploy/README.md +2 -2
  138. package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +2 -2
  139. package/skills/platform-metadata-deploy/references/deployment-workflows.md +16 -16
  140. package/skills/platform-metadata-deploy/references/orchestration.md +3 -3
  141. package/skills/platform-metadata-deploy/references/trigger-deployment-safety.md +2 -2
  142. package/skills/platform-models-api-configure/SKILL.md +140 -0
  143. package/skills/platform-models-api-configure/scripts/get-orgjwt.sh +48 -0
  144. package/skills/platform-policy-rule-generate/SKILL.md +260 -0
  145. package/skills/platform-policy-rule-generate/references/deploy-errors.md +54 -0
  146. package/skills/platform-policy-rule-generate/references/fixtures-index.md +29 -0
  147. package/skills/platform-policy-rule-generate/references/policy-schema-full.md +250 -0
  148. package/skills/platform-policy-rule-generate/references/templates-access.md +132 -0
  149. package/skills/platform-policy-rule-generate/references/templates-advanced.md +58 -0
  150. package/skills/platform-policy-rule-generate/references/templates-record.md +75 -0
  151. package/skills/platform-policy-rule-generate/references/templates-transform.md +70 -0
  152. package/skills/platform-policy-rule-generate/references/templates.md +10 -0
  153. package/skills/platform-policy-rule-generate/references/ui-compatibility.md +142 -0
  154. package/skills/platform-soql-query/README.md +1 -1
  155. package/skills/platform-soql-query/SKILL.md +1 -1
  156. package/skills/platform-soql-query/references/anti-patterns.md +1 -1
  157. package/skills/platform-soql-query/references/field-coverage-rules.md +1 -1
  158. package/skills/platform-soql-query/references/query-optimization.md +1 -1
  159. package/skills/platform-soql-query/scripts/post-tool-validate.py +3 -3
  160. package/skills/data360-activate/CREDITS.md +0 -5
  161. package/skills/data360-connect/CREDITS.md +0 -5
  162. package/skills/data360-harmonize/CREDITS.md +0 -3
  163. package/skills/data360-orchestrate/CREDITS.md +0 -15
  164. package/skills/data360-orchestrate/UPSTREAM.md +0 -45
  165. package/skills/data360-prepare/CREDITS.md +0 -7
  166. package/skills/data360-query/CREDITS.md +0 -7
  167. package/skills/data360-segment/CREDITS.md +0 -3
  168. package/skills/experience-lwc-generate/CREDITS.md +0 -5
  169. package/skills/external-diagram-mermaid-generate/CREDITS.md +0 -46
  170. package/skills/external-diagram-visual-generate/CREDITS.md +0 -80
  171. package/skills/external-diagram-visual-generate/README.md +0 -83
  172. package/skills/external-diagram-visual-generate/SKILL.md +0 -207
  173. package/skills/external-diagram-visual-generate/assets/architecture/integration-flow.md +0 -55
  174. package/skills/external-diagram-visual-generate/assets/erd/core-objects.md +0 -131
  175. package/skills/external-diagram-visual-generate/assets/erd/custom-objects.md +0 -60
  176. package/skills/external-diagram-visual-generate/assets/lwc/dashboard-card.md +0 -45
  177. package/skills/external-diagram-visual-generate/assets/lwc/data-table.md +0 -57
  178. package/skills/external-diagram-visual-generate/assets/lwc/record-form.md +0 -60
  179. package/skills/external-diagram-visual-generate/assets/review/apex-review.md +0 -57
  180. package/skills/external-diagram-visual-generate/assets/review/lwc-review.md +0 -48
  181. package/skills/external-diagram-visual-generate/references/architect-aesthetic-guide.md +0 -257
  182. package/skills/external-diagram-visual-generate/references/examples-index.md +0 -35
  183. package/skills/external-diagram-visual-generate/references/gemini-cli-setup.md +0 -65
  184. package/skills/external-diagram-visual-generate/references/interview-questions.md +0 -529
  185. package/skills/external-diagram-visual-generate/references/iteration-workflow.md +0 -173
  186. package/skills/external-diagram-visual-generate/scripts/check-prerequisites.sh +0 -101
  187. package/skills/external-diagram-visual-generate/scripts/generate_image.py +0 -243
  188. package/skills/integration-connectivity-connected-app-configure/CREDITS.md +0 -3
  189. package/skills/integration-connectivity-generate/CREDITS.md +0 -5
  190. package/skills/omnistudio-callable-apex-generate/CREDITS.md +0 -9
  191. package/skills/omnistudio-datamapper-generate/CREDITS.md +0 -5
  192. package/skills/omnistudio-datapacks-deploy/CREDITS.md +0 -5
  193. package/skills/omnistudio-dependencies-analyze/CREDITS.md +0 -5
  194. package/skills/omnistudio-epc-catalog-generate/CREDITS.md +0 -14
  195. package/skills/omnistudio-flexcard-generate/CREDITS.md +0 -5
  196. package/skills/omnistudio-integration-procedure-generate/CREDITS.md +0 -5
  197. package/skills/omnistudio-omniscript-generate/CREDITS.md +0 -5
  198. package/skills/platform-apex-generate/CREDITS.md +0 -5
  199. package/skills/platform-apex-logs-debug/CREDITS.md +0 -22
  200. package/skills/platform-apex-test-generate/CREDITS.md +0 -5
  201. package/skills/platform-apex-test-run/CREDITS.md +0 -22
  202. package/skills/platform-data-manage/CREDITS.md +0 -5
  203. package/skills/platform-metadata-deploy/CREDITS.md +0 -25
  204. package/skills/platform-soql-query/CREDITS.md +0 -21
  205. /package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterfaceConversion/{MyCustomVlocityOpenInterface2.cls → MyCustomClass.cls} +0 -0
@@ -0,0 +1,250 @@
1
+ # Policy Schema — Full Element Reference
2
+
3
+ Source: `enforce-o-matic-impl/java/src/enforce/o/matic/metadata/`
4
+
5
+ ---
6
+
7
+ ## Path Enums
8
+
9
+ > **Surface principle.** The MDAPI surface is the narrower `*Type` enum in `enforce-o-matic-impl/java/src/enforce/o/matic/metadata/`. The wider runtime enums (`RulePrincipalPath`, `RuleResourcePath`, `RuleContextPath` in `enforce-o-matic-api/.../enums/`) drive Cedar evaluation and DAO behavior; values absent from the `*Type` enums are **not authorable via MDAPI**.
10
+
11
+ ### `<principalPath>` / `<valuePrincipalPath>` — `RulePrincipalPathType` (6 values)
12
+
13
+ | Value | Meaning |
14
+ |-------|---------|
15
+ | `IS_AUTHENTICATED_USER_PATH` | Boolean "is principal an authenticated user" |
16
+ | `ASSIGNED_PERMISSIONS_PATH` | Principal's assigned permissions (pair with `valueReferenceType=CUSTOM_PERMISSION`) |
17
+ | `USER_ID` | Principal user ID |
18
+ | `ORGANIZATION_ID` | Principal org ID |
19
+ | `USER_ROLE_ID` | Principal role ID |
20
+ | `RBAC_TAGS` | Principal RBAC tags |
21
+
22
+ Outside contract (not in `RulePrincipalPathType`): `IS_INTERNAL`, `CONTACT_ID`, `SCALAR_ATTRIBUTE`, `PLURAL_ATTRIBUTE`, `PLACEHOLDER`. Use a runtime RuleProvider for these.
23
+
24
+ ### `<resourcePath>` / `<valueResourcePath>` — `RuleResourcePathType` (16 values)
25
+
26
+ | Value | Meaning |
27
+ |-------|---------|
28
+ | `NAMESPACE` | Resource namespace |
29
+ | `ENTITY` | Entity (object) reference |
30
+ | `FIELD` | Field reference |
31
+ | `ENTITYTYPE` | Entity type — pair with `IS` operator and `{"t":"Text","v":"FIELD"}` literal |
32
+ | `ENTITYKIND` | Entity kind bits |
33
+ | `FIELDKIND` | Field kind bits |
34
+ | `DATASPACE` | Resource dataspace |
35
+ | `TAG` | Custom or standard tag |
36
+ | `OBJECT_TAG` | Object-level tag |
37
+ | `CLASSIFICATION` | Custom or standard classification |
38
+ | `IMPLICITTAG` | Implicit tag |
39
+ | `RECORDFIELD` | Field of the record being evaluated (RLS) — pair with `<valueDomain>Schema:field</valueDomain>` |
40
+ | `OBJECT_CLASSIFICATION` | Object-level classification |
41
+ | `EXPRESSION` | Compound expression — pair with `<resourceExpression>` PROJECTION |
42
+ | `OBJECT_DATASPACE` | Object-level dataspace |
43
+ | `RECORDFIELDTYPE` | Type of a record field |
44
+
45
+ ### `<contextPath>` / `<valueContextPath>` — `RuleContextPathType` (1 value)
46
+
47
+ | Value | Cedar attribute | Use case |
48
+ |-------|-----------------|----------|
49
+ | `SESSION_DATASPACE` | `context.sessionDataspace` | Session-scoped dataspace check |
50
+
51
+ Outside contract: `SESSION_CONSUMER_ID`, `CONTEXT_AGENT_ID`, `CONTEXT_AGENT_VERSION_ID` (IDENTIFIED_RECORD / agentic — runtime RuleProvider only).
52
+
53
+ > Some steelthread fixtures use `SCALAR_ATTRIBUTE` / `PLURAL_ATTRIBUTE` in `<valuePrincipalPath>` (`conditionScalarAttributeValidSteelThread`). They deploy in the ftest harness because the entity object is type-tolerant, but these values are outside `RulePrincipalPathType` — not sanctioned for new work.
54
+
55
+ ---
56
+
57
+ ## `<operator>` — `RuleDefinitionOperatorType`
58
+
59
+ | Operator | Use with |
60
+ |----------|----------|
61
+ | `EQUALS` / `NOT_EQUALS` | Scalar equality |
62
+ | `GREATER_THAN`, `LESS_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN_OR_EQUALS` | Numeric / date |
63
+ | `IN` | Scalar IN set |
64
+ | `LIKE` | String pattern |
65
+ | `CONTAINS_ANY` | Set has at least one of |
66
+ | `CONTAINS_ALL` | Set has all of |
67
+ | `CONTAINS_NONE` | Set has none of |
68
+ | `IS` | Type / kind check (pair with `ENTITYTYPE` + `{"t":"Text","v":"FIELD"}` literal) |
69
+ | `EXISTS` | RLS join exists (pair with `resourcePath=EXPRESSION` + PROJECTION) |
70
+ | `HIERARCHICALLY_ABOVE` / `HIERARCHICALLY_BELOW` | Hierarchy traversal — pair with `valueReferenceType=HIERARCHY` |
71
+
72
+ ---
73
+
74
+ ## `<conditions>` — Full Schema (`PolicyRuleDefinitionCondition.java`)
75
+
76
+ | Element | Notes |
77
+ |---------|-------|
78
+ | `<clause>` | `WHEN` or `UNLESS` — match the wrapper |
79
+ | `<operator>` | Always required |
80
+ | `<resourcePath>` | What about the resource to inspect |
81
+ | `<principalPath>` | What about the principal to inspect |
82
+ | `<contextPath>` | Context attribute (SESSION_DATASPACE only) |
83
+ | `<valueDomain>` | `Schema:field` — for RECORDFIELD comparisons |
84
+ | `<resourceAlias>` | Used in PROJECTION join expressions |
85
+ | `<valueBit>` | Entity/field-kind bits |
86
+ | `<valuePrincipalPath>` | Path the value comes from |
87
+ | `<valueResourcePath>` | Path the value comes from |
88
+ | `<valueContextPath>` | Path the value comes from |
89
+ | `<policyRuleValueSet>` | Literal or named-reference values (see below) |
90
+ | `<resourceExpression>` | `PolicyJsonExpression` type=PROJECTION (RLS join) |
91
+ | `<principalExpression>` | `PolicyJsonExpression` type=SOQLTARGETLISTEXPR (SOQL principal) |
92
+ | `<whereClauseConjunction>` | Sub-expression for nested conditions |
93
+ | `<policyRuleDefinitionCondition>` | Nested children — used with `whereClauseConjunction` |
94
+
95
+ ---
96
+
97
+ ## `<policyRuleValueSet>` — `PolicyRuleValueSet.java`
98
+
99
+ Three fields (all optional at schema level, but a non-empty value set needs at least one):
100
+
101
+ ### Literal values — `<valueString>`
102
+
103
+ For typed literals, embed JSON (escape `"` to `&quot;`):
104
+ ```xml
105
+ <valueString>{&quot;t&quot;:&quot;Text&quot;,&quot;v&quot;:&quot;FIELD&quot;}</valueString>
106
+ <valueString>{&quot;t&quot;:&quot;Boolean&quot;,&quot;v&quot;:true}</valueString>
107
+ <valueString>{&quot;t&quot;:&quot;Number&quot;,&quot;v&quot;:42}</valueString>
108
+ ```
109
+
110
+ For plain string equality:
111
+ ```xml
112
+ <valueString>Toxico</valueString>
113
+ ```
114
+
115
+ ### Named references — `<valueReference>` + `<valueReferenceType>`
116
+
117
+ | `valueReferenceType` | Refers to | Typical path pairing |
118
+ |----------------------|-----------|----------------------|
119
+ | `CUSTOM_TAG` | Custom tag by devName | `resourcePath=TAG` |
120
+ | `STANDARD_TAG` | Standard tag — **fully qualified** (e.g. `DataGovernanceTags.ExternalData.Visibility.Public`) | `resourcePath=TAG` |
121
+ | `CUSTOM_CLASSIFICATION` | Custom classification | `resourcePath=CLASSIFICATION` |
122
+ | `STANDARD_CLASSIFICATION` | Standard classification — **fully qualified** (e.g. `DataGovernanceClassifications.DataCategorization.FieldUsage.Active`) | `resourcePath=CLASSIFICATION` |
123
+ | `HIERARCHY` | Hierarchy definition | `operator=HIERARCHICALLY_BELOW/ABOVE`, `resourcePath=RECORDFIELD` |
124
+ | `CUSTOM_PERMISSION` | Custom permission | `principalPath=ASSIGNED_PERMISSIONS_PATH` |
125
+ | `DATASPACE` | Dataspace | `resourcePath=DATASPACE` or `contextPath=SESSION_DATASPACE` |
126
+
127
+ > **Tag/classification dev names are NOT free-form.** The deploy-time validator checks `<valueReference>` against the org's taxonomy. To find the exact string: `sf project retrieve start --target-org <alias> --metadata "PolicyRuleDefinition:<existing-rule-name>"` and copy `<valueReference>` verbatim.
128
+
129
+ Multiple `<policyRuleValueSet>` siblings inside one condition are OR-combined.
130
+
131
+ ---
132
+
133
+ ## JSON Expressions — `PolicyJsonExpression.java` (min API 66.0)
134
+
135
+ `<type>` must match the location:
136
+
137
+ | Location | Required `type` |
138
+ |----------|-----------------|
139
+ | Top-level `<resourceExpression>` (TRANSFORM rule arg list) | `ARGLIST` |
140
+ | `<conditions>` `<resourceExpression>` (RLS join) | `PROJECTION` |
141
+ | `<conditions>` `<principalExpression>` (SOQL principal) | `SOQLTARGETLISTEXPR` |
142
+
143
+ ### ARGLIST — Transform argument list
144
+
145
+ ```xml
146
+ <resourceExpression>
147
+ <type>ARGLIST</type>
148
+ <version>1</version>
149
+ <transformExpression>
150
+ <argument>
151
+ <type>NUMBER</type>
152
+ <value>4</value>
153
+ </argument>
154
+ </transformExpression>
155
+ </resourceExpression>
156
+ ```
157
+
158
+ `TransformExpressionArgumentType` = `STRING` or `NUMBER`. Use when `<resourceTransform>` takes parameters (e.g. `LAST_N_CHARS_RESOURCE_TRANSFORM` needs N).
159
+
160
+ ### PROJECTION — RLS join
161
+
162
+ Used inside `<conditions>` with `resourcePath=EXPRESSION` and `operator=EXISTS`:
163
+
164
+ ```xml
165
+ <resourceExpression>
166
+ <type>PROJECTION</type>
167
+ <version>1</version>
168
+ <projection>
169
+ <join>
170
+ <schema>testDMO__dlm</schema>
171
+ <alias>test 1</alias>
172
+ <predicate>
173
+ <comparator>EQUALS</comparator>
174
+ <attribute>testDMO__dlm:name__c</attribute>
175
+ <on>
176
+ <resourceAlias>resource</resourceAlias>
177
+ <schema>testDMO__dlm</schema>
178
+ <field>age__c</field>
179
+ </on>
180
+ </predicate>
181
+ </join>
182
+ </projection>
183
+ </resourceExpression>
184
+ ```
185
+
186
+ ### SOQLTARGETLISTEXPR — Principal SOQL target
187
+
188
+ Scalar:
189
+ ```xml
190
+ <principalExpression>
191
+ <type>SOQLTARGETLISTEXPR</type>
192
+ <version>1</version>
193
+ <soqlTarget>
194
+ <select>age__c</select>
195
+ </soqlTarget>
196
+ </principalExpression>
197
+ ```
198
+
199
+ Plural (use a set operator: `CONTAINS_ANY` / `CONTAINS_NONE` / `CONTAINS_ALL`):
200
+ ```xml
201
+ <principalExpression>
202
+ <type>SOQLTARGETLISTEXPR</type>
203
+ <version>1</version>
204
+ <soqlTarget>
205
+ <plural>true</plural>
206
+ <relationship>pluralAttributes__r</relationship>
207
+ <select>name__c</select>
208
+ </soqlTarget>
209
+ </principalExpression>
210
+ ```
211
+
212
+ > `SCALAR_ATTRIBUTE` / `PLURAL_ATTRIBUTE` principal expressions are outside MDAPI contract. Fixture-only.
213
+
214
+ ---
215
+
216
+ ## `<resourceTransform>` Enum (TRANSFORM rules only)
217
+
218
+ | Value | Effect |
219
+ |-------|--------|
220
+ | `NULL_RESOURCE_TRANSFORM` | Replace with NULL |
221
+ | `EMPTY_STRING_RESOURCE_TRANSFORM` | Replace with `""` |
222
+ | `LAST_N_CHARS_RESOURCE_TRANSFORM` | Keep last N chars (N via ARGLIST) |
223
+ | `FIRST_N_CHARS_RESOURCE_TRANSFORM` | Keep first N chars (N via ARGLIST) |
224
+ | `ALL_BUT_LAST_N_CHARS_RESOURCE_TRANSFORM` | Mask last N |
225
+ | `ALL_BUT_FIRST_N_CHARS_RESOURCE_TRANSFORM` | Mask first N |
226
+ | `CLOSEST_ORDER_OF_MAGNITUDE_RESOURCE_TRANSFORM` | Round to nearest power of 10 |
227
+ | `TRUNCATE_DATE_RESOURCE_TRANSFORM` | Truncate date precision |
228
+ | `ROUND_RESOURCE_TRANSFORM` | Round number |
229
+ | `REPLACE_ALL_CHARS_RESOURCE_TRANSFORM` | Replace each char |
230
+
231
+ Pure transforms (NULL, EMPTY_STRING) need no `<resourceExpression>`. Parameterized transforms (FIRST_N, LAST_N, ROUND, REPLACE_ALL_CHARS, TRUNCATE_DATE) take args via ARGLIST.
232
+
233
+ ---
234
+
235
+ ## File Cross-References
236
+
237
+ | Concern | File |
238
+ |---------|------|
239
+ | Rule wrapper | `enforce-o-matic-impl/java/src/enforce/o/matic/metadata/PolicyRuleDefinition.java` |
240
+ | Set wrapper | `…/PolicyRuleDefinitionSet.java` |
241
+ | Conditions | `…/PolicyRuleDefinitionClauseConjunction.java`, `…/PolicyRuleDefinitionCondition.java` |
242
+ | Value set | `…/PolicyRuleValueSet.java` + `…/PolicyRuleValueSetReferenceType.java` |
243
+ | JSON expression | `…/PolicyJsonExpression.java` + `…/PolicyJsonExpressionType.java` |
244
+ | ARGLIST | `…/TransformExpression.java` + `…/TransformExpressionArgument.java` |
245
+ | PROJECTION | `…/ProjectionExpression.java` + `…/ProjectionJoin.java` + `…/PolicyJoinPredicate.java` |
246
+ | SOQLTARGETLISTEXPR | `…/PrincipalExpression.java` |
247
+ | Resource domain | `…/PolicyRuleResourceDomain.java` |
248
+ | Enums | `Category.java`, `Effect.java`, `RuleConsumer.java`, `PrincipalAuthenticationLevel.java`, `RulePrincipalScopeType.java`, `RuleResourceScopeType.java`, `RulePrincipalPathType.java`, `RuleResourcePathType.java`, `RuleContextPathType.java`, `RuleDefinitionClauseType.java`, `RuleDefinitionOperatorType.java`, `ResourceTransform.java` |
249
+ | IDENTIFIED_RECORD condition validator | `PolicyRuleDefinitionCondObject.java:332-339` |
250
+ | Agentic RuleProvider canonical builder | `AgenticPolicyRuleProviderService.java:130-260` |
@@ -0,0 +1,132 @@
1
+ # ACCESS / GOVERNANCE Templates
2
+
3
+ Each template is a verified shape from a passing test fixture. Copy, then change names/values.
4
+
5
+ ---
6
+
7
+ ## ACCESS — Simple Permit (no conditions)
8
+
9
+ Source: `baseSteelthread`
10
+
11
+ ```xml
12
+ <?xml version="1.0" encoding="UTF-8"?>
13
+ <PolicyRuleDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
14
+ <action>Read</action>
15
+ <category>ACCESS_POLICY_RULE_DEFINITION</category>
16
+ <effect>Permit</effect>
17
+ <label>Rule0</label>
18
+ <policyRuleDefinitionSetName>Set1</policyRuleDefinitionSetName>
19
+ <principalAuthenticationLevel>INTERNAL</principalAuthenticationLevel>
20
+ <principalScopeType>ANY</principalScopeType>
21
+ <resourceScopeType>ANY</resourceScopeType>
22
+ <ruleConsumer>DATACLOUD</ruleConsumer>
23
+ <transformPrecedence>0</transformPrecedence>
24
+ </PolicyRuleDefinition>
25
+ ```
26
+
27
+ ---
28
+
29
+ ## ACCESS / GOVERNANCE — "Objects AND all their fields" via TupleRead (UI-compatible)
30
+
31
+ Source: see §8.2.1 of policy.md
32
+
33
+ Three required pieces:
34
+ 1. `<action>TupleRead</action>` — cascades object-level condition to fields
35
+ 2. **OR-of-ENTITYTYPE clause** — required for UI editability (without it the builder crashes)
36
+ 3. The actual semantic gate (tag / classification / permission)
37
+
38
+ ```xml
39
+ <?xml version="1.0" encoding="UTF-8"?>
40
+ <PolicyRuleDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
41
+ <action>TupleRead</action>
42
+ <category>GOVERNANCE_POLICY_RULE_DEFINITION</category>
43
+ <effect>Permit</effect>
44
+ <label>GrantPublicAccess</label>
45
+ <policyRuleDefinitionSetName>PublicAccessSet</policyRuleDefinitionSetName>
46
+ <principalAuthenticationLevel>INTERNAL</principalAuthenticationLevel>
47
+ <principalScopeType>ANY</principalScopeType>
48
+ <resourceScopeType>ANY</resourceScopeType>
49
+ <ruleConsumer>DATACLOUD</ruleConsumer>
50
+ <transformPrecedence>0</transformPrecedence>
51
+ <whenPolicyRuleDefinitionClauseConjunction>
52
+ <!-- (1) and (2): OR-of-ENTITYTYPE clause — required for UI rendering -->
53
+ <conditions>
54
+ <clause>WHEN</clause>
55
+ <operator>IS</operator>
56
+ <policyRuleValueSet>
57
+ <valueString>{&quot;t&quot;:&quot;Text&quot;,&quot;v&quot;:&quot;OBJECT&quot;}</valueString>
58
+ </policyRuleValueSet>
59
+ <resourcePath>ENTITYTYPE</resourcePath>
60
+ </conditions>
61
+ <conditions>
62
+ <clause>WHEN</clause>
63
+ <operator>IS</operator>
64
+ <policyRuleValueSet>
65
+ <valueString>{&quot;t&quot;:&quot;Text&quot;,&quot;v&quot;:&quot;FIELD&quot;}</valueString>
66
+ </policyRuleValueSet>
67
+ <resourcePath>ENTITYTYPE</resourcePath>
68
+ </conditions>
69
+ <!-- (3): actual semantic gate -->
70
+ <conditions>
71
+ <clause>WHEN</clause>
72
+ <operator>CONTAINS_ANY</operator>
73
+ <resourcePath>TAG</resourcePath>
74
+ <policyRuleValueSet>
75
+ <valueReference>DataGovernanceTags.ExternalData.Visibility.Public</valueReference>
76
+ <valueReferenceType>STANDARD_TAG</valueReferenceType>
77
+ </policyRuleValueSet>
78
+ </conditions>
79
+ <!-- MUST use (AND N) not bare N for every top-level param — bare index crashes UI -->
80
+ <conjunctionExpression>(AND (OR 1 2) (AND 3))</conjunctionExpression>
81
+ </whenPolicyRuleDefinitionClauseConjunction>
82
+ </PolicyRuleDefinition>
83
+ ```
84
+
85
+ For **deny semantics**: `<effect>Forbid</effect>`. To add "deny unless permission Y", insert a 4th condition with `ASSIGNED_PERMISSIONS_PATH CONTAINS_NONE Y` and use `(AND (OR 1 2) (AND 3) (AND 4))`.
86
+
87
+ ---
88
+
89
+ ## ACCESS — Gated by Tag / Classification / Permission
90
+
91
+ Source: `conditionTagValidSteelthread`, `conditionClassificationValidClauseSteelthread`, `conditionAssignedPermPathValidSteelthread`
92
+
93
+ ```xml
94
+ <?xml version="1.0" encoding="UTF-8"?>
95
+ <PolicyRuleDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
96
+ <action>Read</action>
97
+ <category>ACCESS_POLICY_RULE_DEFINITION</category>
98
+ <effect>Permit</effect>
99
+ <label>Rule0</label>
100
+ <policyRuleDefinitionSetName>TagSet1</policyRuleDefinitionSetName>
101
+ <principalAuthenticationLevel>INTERNAL</principalAuthenticationLevel>
102
+ <principalScopeType>ANY</principalScopeType>
103
+ <resourceScopeType>ANY</resourceScopeType>
104
+ <ruleConsumer>DATACLOUD</ruleConsumer>
105
+ <transformPrecedence>0</transformPrecedence>
106
+ <whenPolicyRuleDefinitionClauseConjunction>
107
+ <conditions>
108
+ <clause>WHEN</clause>
109
+ <operator>CONTAINS_ANY</operator>
110
+ <resourcePath>TAG</resourcePath>
111
+ <policyRuleValueSet>
112
+ <valueReference>CustomTagRef</valueReference>
113
+ <valueReferenceType>CUSTOM_TAG</valueReferenceType>
114
+ </policyRuleValueSet>
115
+ </conditions>
116
+ <conjunctionExpression>1</conjunctionExpression>
117
+ </whenPolicyRuleDefinitionClauseConjunction>
118
+ </PolicyRuleDefinition>
119
+ ```
120
+
121
+ Swap the inner condition for permission gating:
122
+ ```xml
123
+ <conditions>
124
+ <clause>WHEN</clause>
125
+ <operator>CONTAINS_ANY</operator>
126
+ <principalPath>ASSIGNED_PERMISSIONS_PATH</principalPath>
127
+ <policyRuleValueSet>
128
+ <valueReference>testCustomPermission1</valueReference>
129
+ <valueReferenceType>CUSTOM_PERMISSION</valueReferenceType>
130
+ </policyRuleValueSet>
131
+ </conditions>
132
+ ```
@@ -0,0 +1,58 @@
1
+ # Advanced Templates — Multi-Condition, Hierarchy, Unauthorable
2
+
3
+ Each template is a verified shape from a passing test fixture. Copy, then change names/values.
4
+
5
+ ---
6
+
7
+ ## Multi-Condition with Custom Conjunction (AND/OR mix)
8
+
9
+ Source: `conjunctionExpressionSteelthread`
10
+
11
+ ```xml
12
+ <unlessPolicyRuleDefinitionClauseConjunction>
13
+ <conditions>
14
+ <clause>UNLESS</clause>
15
+ <operator>CONTAINS_ANY</operator>
16
+ <resourcePath>TAG</resourcePath>
17
+ </conditions>
18
+ <conditions>
19
+ <clause>UNLESS</clause>
20
+ <operator>CONTAINS_NONE</operator>
21
+ <resourcePath>TAG</resourcePath>
22
+ </conditions>
23
+ <conjunctionExpression>(AND 1 2)</conjunctionExpression>
24
+ </unlessPolicyRuleDefinitionClauseConjunction>
25
+ ```
26
+
27
+ > Note: `<unlessPolicyRuleDefinitionClauseConjunction>` blocks are **not UI-editable** — silently dropped on first save. Prefer WHEN + negated operator for UI-compatible policies.
28
+
29
+ ---
30
+
31
+ ## Hierarchy Traversal
32
+
33
+ Source: `conditionWithHierarchy`
34
+
35
+ ```xml
36
+ <conditions>
37
+ <clause>WHEN</clause>
38
+ <operator>HIERARCHICALLY_BELOW</operator>
39
+ <resourcePath>RECORDFIELD</resourcePath>
40
+ <valueDomain>testDMO__dlm:name__c</valueDomain>
41
+ <policyRuleValueSet>
42
+ <valueReference>testHierarchyRLS</valueReference>
43
+ <valueReferenceType>HIERARCHY</valueReferenceType>
44
+ </policyRuleValueSet>
45
+ </conditions>
46
+ ```
47
+
48
+ > Not UI-editable (`HIERARCHICALLY_BELOW` and `valueReferenceType=HIERARCHY` are not in the UI dropdowns).
49
+
50
+ ---
51
+
52
+ ## IDENTIFIED_RECORD — Not Authorable via MDAPI
53
+
54
+ `IDENTIFIED_RECORD` policies cannot be authored as XML. The required `RuleContextPath.SESSION_CONSUMER_ID` is not in `RuleContextPathType`.
55
+
56
+ To author one: write a runtime `RuleProvider` using `AgenticPolicyRuleProviderService.java:130-260` as the canonical builder.
57
+
58
+ **Do not** synthesize a placeholder XML using `<contextPath>SESSION_CONSUMER_ID</contextPath>` — the value is not in `RuleContextPathType` and the deploy will fail.
@@ -0,0 +1,75 @@
1
+ # RECORD Templates
2
+
3
+ Each template is a verified shape from a passing test fixture. Copy, then change names/values.
4
+
5
+ ---
6
+
7
+ ## RECORD — Basic RLS (record field = user attribute)
8
+
9
+ Source: `conditionRLSValidSteelthread` (first condition), `conditionStandardIdRLSValidSteelthread`
10
+
11
+ > **RLS MDAPI round-trip is fragile in real orgs.** Deploy/retrieve can fail with opaque gacks if a DMO field in `<valueDomain>` is not mapped in the org's data streams. Build the rule in the UI first; use MDAPI templates as verification shapes, not first-try authoring. See §8.3 of policy.md.
12
+
13
+ ```xml
14
+ <?xml version="1.0" encoding="UTF-8"?>
15
+ <PolicyRuleDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
16
+ <action>Read</action>
17
+ <category>RECORD_POLICY_RULE_DEFINITION</category>
18
+ <effect>Permit</effect>
19
+ <label>Rule1</label>
20
+ <policyRuleDefinitionSetName>StandardFieldSet3</policyRuleDefinitionSetName>
21
+ <policyRuleResourceDomains>
22
+ <resourceDomain>testDMO__dlm</resourceDomain>
23
+ </policyRuleResourceDomains>
24
+ <principalAuthenticationLevel>INTERNAL</principalAuthenticationLevel>
25
+ <principalScopeType>ANY</principalScopeType>
26
+ <resourceScopeType>RECORD</resourceScopeType>
27
+ <ruleConsumer>DATACLOUD</ruleConsumer>
28
+ <transformPrecedence>0</transformPrecedence>
29
+ <whenPolicyRuleDefinitionClauseConjunction>
30
+ <conditions>
31
+ <clause>WHEN</clause>
32
+ <operator>EQUALS</operator>
33
+ <resourcePath>RECORDFIELD</resourcePath>
34
+ <valueDomain>testDMO__dlm:name__c</valueDomain>
35
+ <valuePrincipalPath>USER_ID</valuePrincipalPath>
36
+ </conditions>
37
+ <conjunctionExpression>1</conjunctionExpression>
38
+ </whenPolicyRuleDefinitionClauseConjunction>
39
+ </PolicyRuleDefinition>
40
+ ```
41
+
42
+ For literal-value RLS (e.g. `record.field == 'X'`), use `<policyRuleValueSet><valueString>X</valueString></policyRuleValueSet>` instead of `<valuePrincipalPath>`.
43
+
44
+ ---
45
+
46
+ ## RECORD — RLS via PROJECTION Join
47
+
48
+ Source: `conditionRLSValidSteelthread` (second condition)
49
+
50
+ ```xml
51
+ <conditions>
52
+ <clause>WHEN</clause>
53
+ <operator>EXISTS</operator>
54
+ <resourcePath>EXPRESSION</resourcePath>
55
+ <resourceExpression>
56
+ <type>PROJECTION</type>
57
+ <version>1</version>
58
+ <projection>
59
+ <join>
60
+ <schema>testDMO__dlm</schema>
61
+ <alias>test 1</alias>
62
+ <predicate>
63
+ <comparator>EQUALS</comparator>
64
+ <attribute>testDMO__dlm:name__c</attribute>
65
+ <on>
66
+ <resourceAlias>resource</resourceAlias>
67
+ <schema>testDMO__dlm</schema>
68
+ <field>age__c</field>
69
+ </on>
70
+ </predicate>
71
+ </join>
72
+ </projection>
73
+ </resourceExpression>
74
+ </conditions>
75
+ ```
@@ -0,0 +1,70 @@
1
+ # TRANSFORM Templates
2
+
3
+ Each template is a verified shape from a passing test fixture. Copy, then change names/values.
4
+
5
+ ---
6
+
7
+ ## TRANSFORM — Field Masking with Permission + Classification Gates
8
+
9
+ Source: `conditionClassificationValidDataMaskingSteelthread`
10
+
11
+ ```xml
12
+ <?xml version="1.0" encoding="UTF-8"?>
13
+ <PolicyRuleDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
14
+ <action>Read</action>
15
+ <category>TRANSFORM_POLICY_RULE_DEFINITION</category>
16
+ <effect>Transform</effect>
17
+ <label>Rule0</label>
18
+ <policyRuleDefinitionSetName>DataMasking1</policyRuleDefinitionSetName>
19
+ <principalAuthenticationLevel>INTERNAL</principalAuthenticationLevel>
20
+ <principalScopeType>ANY</principalScopeType>
21
+ <resourceScopeType>FIELD</resourceScopeType>
22
+ <resourceTransform>NULL_RESOURCE_TRANSFORM</resourceTransform>
23
+ <ruleConsumer>DATACLOUD</ruleConsumer>
24
+ <transformPrecedence>0</transformPrecedence>
25
+ <whenPolicyRuleDefinitionClauseConjunction>
26
+ <conditions>
27
+ <clause>WHEN</clause>
28
+ <operator>IS</operator>
29
+ <resourcePath>ENTITYTYPE</resourcePath>
30
+ <policyRuleValueSet>
31
+ <valueString>{&quot;t&quot;:&quot;Text&quot;,&quot;v&quot;:&quot;FIELD&quot;}</valueString>
32
+ </policyRuleValueSet>
33
+ </conditions>
34
+ <conditions>
35
+ <clause>WHEN</clause>
36
+ <operator>CONTAINS_NONE</operator>
37
+ <principalPath>ASSIGNED_PERMISSIONS_PATH</principalPath>
38
+ <policyRuleValueSet>
39
+ <valueReference>testCustomPermissionMasking</valueReference>
40
+ <valueReferenceType>CUSTOM_PERMISSION</valueReferenceType>
41
+ </policyRuleValueSet>
42
+ </conditions>
43
+ <conditions>
44
+ <clause>WHEN</clause>
45
+ <operator>CONTAINS_ANY</operator>
46
+ <resourcePath>CLASSIFICATION</resourcePath>
47
+ <policyRuleValueSet>
48
+ <valueReference>DataGovernanceClassifications.DataCategorization.FieldUsage.Active</valueReference>
49
+ <valueReferenceType>STANDARD_CLASSIFICATION</valueReferenceType>
50
+ </policyRuleValueSet>
51
+ </conditions>
52
+ <conjunctionExpression>(AND 1 2 3)</conjunctionExpression>
53
+ </whenPolicyRuleDefinitionClauseConjunction>
54
+ </PolicyRuleDefinition>
55
+ ```
56
+
57
+ For parameterized masking (e.g. mask all but first 4 chars):
58
+ ```xml
59
+ <resourceTransform>ALL_BUT_FIRST_N_CHARS_RESOURCE_TRANSFORM</resourceTransform>
60
+ <resourceExpression>
61
+ <type>ARGLIST</type>
62
+ <version>1</version>
63
+ <transformExpression>
64
+ <argument>
65
+ <type>NUMBER</type>
66
+ <value>4</value>
67
+ </argument>
68
+ </transformExpression>
69
+ </resourceExpression>
70
+ ```
@@ -0,0 +1,10 @@
1
+ # Policy Templates — Index
2
+
3
+ Each template is a verified shape from a passing test fixture. Pick the file matching the category you need.
4
+
5
+ | File | What's inside |
6
+ |------|---------------|
7
+ | [`templates-access.md`](templates-access.md) | ACCESS and GOVERNANCE: simple Permit, TupleRead "objects + all fields", tag/classification/permission gates |
8
+ | [`templates-record.md`](templates-record.md) | RECORD: basic RLS (record field = user attribute), RLS via PROJECTION join |
9
+ | [`templates-transform.md`](templates-transform.md) | TRANSFORM: field masking with permission + classification gates, parameterized masking (ARGLIST) |
10
+ | [`templates-advanced.md`](templates-advanced.md) | Multi-condition with custom conjunction (AND/OR mix), hierarchy traversal, IDENTIFIED_RECORD (not authorable via MDAPI) |