@salesforce/afv-skills 1.37.0 → 1.38.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.
- package/package.json +1 -1
- package/skills/agentforce-generate/README.md +20 -3
- package/skills/agentforce-generate/SKILL.md +253 -440
- package/skills/agentforce-generate/assets/agent-spec-template.md +6 -2
- package/skills/agentforce-generate/assets/agents/order-service.agent +16 -12
- package/skills/agentforce-generate/assets/agents/production-faq.agent +4 -4
- package/skills/agentforce-generate/assets/agents/router-first.agent +5 -5
- package/skills/agentforce-generate/assets/agents/template-single-subagent.agent +4 -4
- package/skills/agentforce-generate/assets/agents/verification-gate.agent +8 -6
- package/skills/agentforce-generate/assets/agents/voice-knowledge-grounded.agent +9 -9
- package/skills/agentforce-generate/assets/agents/voice-service-agent.agent +7 -7
- package/skills/agentforce-generate/assets/patterns/README.md +3 -3
- package/skills/agentforce-generate/assets/patterns/action-callbacks.agent +5 -5
- package/skills/agentforce-generate/assets/patterns/advanced-input-bindings.agent +6 -8
- package/skills/agentforce-generate/assets/patterns/bidirectional-routing.agent +11 -13
- package/skills/agentforce-generate/assets/patterns/critical-input-collection.agent +11 -16
- package/skills/agentforce-generate/assets/patterns/lifecycle-events.agent +2 -3
- package/skills/agentforce-generate/assets/patterns/llm-controlled-actions.agent +6 -7
- package/skills/agentforce-generate/assets/patterns/open-gate-routing.agent +3 -3
- package/skills/agentforce-generate/assets/patterns/prompt-template-action.agent +14 -19
- package/skills/agentforce-generate/assets/patterns/system-instruction-overrides.agent +11 -20
- package/skills/agentforce-generate/references/actions-reference.md +2 -2
- package/skills/agentforce-generate/references/agent-audit-and-repair.md +135 -0
- package/skills/agentforce-generate/references/agent-audit-candidate-verification.md +160 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostic-catalog.md +156 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-actions-state.md +176 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-architecture-evaluation.md +68 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-instructions-routing.md +283 -0
- package/skills/agentforce-generate/references/agent-audit-evaluation-loop.md +191 -0
- package/skills/agentforce-generate/references/agent-audit-repair-report.md +143 -0
- package/skills/agentforce-generate/references/agent-audit-scope-path-review.md +180 -0
- package/skills/agentforce-generate/references/agent-design-and-spec-creation.md +105 -59
- package/skills/agentforce-generate/references/agent-script-core-language.md +144 -61
- package/skills/agentforce-generate/references/agent-subagent-map-diagrams.md +33 -23
- package/skills/agentforce-generate/references/agent-validation-and-debugging.md +37 -11
- package/skills/agentforce-generate/references/agentscript-toolchain.md +112 -0
- package/skills/agentforce-generate/references/architecture-patterns.md +81 -18
- package/skills/agentforce-generate/references/common-control-flow-pitfalls.md +255 -0
- package/skills/agentforce-generate/references/control-flow-actions-sequencing.md +198 -0
- package/skills/agentforce-generate/references/control-flow-lifecycle-side-effects.md +87 -0
- package/skills/agentforce-generate/references/examples.md +22 -22
- package/skills/agentforce-generate/references/instruction-resolution.md +123 -83
- package/skills/agentforce-generate/references/known-issues.md +1 -2
- package/skills/agentforce-generate/references/optimization-pattern-1-data-flow.md +4 -0
- package/skills/agentforce-generate/references/optimization-pattern-2-deterministic-logic.md +33 -0
- package/skills/agentforce-generate/references/optimization-pattern-3-reference-syntax.md +32 -3
- package/skills/agentforce-generate/references/optimization-pattern-4-escalation.md +2 -2
- package/skills/agentforce-generate/references/patterns-by-requirement.md +3 -1
- package/skills/agentforce-generate/references/posture-and-determinism.md +103 -22
- package/skills/agentforce-generate/references/reference-map.md +19 -3
- package/skills/agentforce-generate/references/scoring-rubric.md +1 -1
- package/skills/agentforce-generate/references/voice-latency-heuristics.md +4 -0
- package/skills/agentforce-generate/references/voice-modality-reference.md +4 -4
- package/skills/agentforce-generate/references/zen-of-agentscript.md +139 -23
- package/skills/agentforce-generate/scripts/agentscript-sdk-loader.mjs +133 -0
- package/skills/agentforce-generate/scripts/index-agent.mjs +141 -0
- package/skills/agentforce-generate/scripts/setup-agentscript-sdk.mjs +337 -0
- package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +1 -1
- package/skills/automation-sandbox-post-copy-configure/SKILL.md +433 -0
- package/skills/automation-sandbox-post-copy-configure/assets/api_request_templates.json +89 -0
- package/skills/automation-sandbox-post-copy-configure/examples/sample_config_input.json +40 -0
- package/skills/automation-sandbox-post-copy-configure/examples/sample_execution_summary.md +79 -0
- package/skills/automation-sandbox-post-copy-configure/references/api_endpoints.md +273 -0
- package/skills/automation-sandbox-post-copy-configure/references/authentication.md +94 -0
- package/skills/automation-sandbox-post-copy-configure/references/execution_phasing.md +93 -0
- package/skills/automation-sandbox-post-copy-configure/references/rules_gotchas.md +35 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/classify-patch-result.mjs +88 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/map-metadata-key.mjs +98 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/plan-phases.mjs +98 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/resolve-target-org.mjs +56 -0
- package/skills/design-systems-slds-validate/SKILL.md +14 -13
- package/skills/dx-code-analyzer-custom-rule-create/examples/xpath-examples.md +1 -1
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-security.md +1 -1
- package/skills/dx-org-devhub-configure/SKILL.md +268 -0
- package/skills/dx-org-devhub-configure/examples/status-output.md +39 -0
- package/skills/dx-org-devhub-configure/scripts/devhub.sh +650 -0
- package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +116 -0
- package/skills/dx-org-manage/SKILL.md +135 -42
- package/skills/dx-org-manage/assets/derive-alias.sh +95 -0
- package/skills/dx-org-manage/assets/scratch-def.seed.json +6 -0
- package/skills/dx-org-manage/examples/README.md +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/delete_output.json +8 -0
- package/skills/dx-org-manage/examples/scratch-orgs/display_output.json +23 -0
- package/skills/dx-org-manage/examples/scratch-orgs/list_output.json +58 -0
- package/skills/dx-org-manage/examples/scratch-orgs/resume_output.json +38 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/success_shape.json +41 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +1 -1
- package/skills/dx-org-manage/examples/snapshots/error_output.json +3 -3
- package/skills/dx-org-manage/references/creating-scratch-org.md +2 -2
- package/skills/dx-org-manage/references/creating-snapshot.md +1 -2
- package/skills/dx-org-manage/references/definition_file_options.md +24 -0
- package/skills/dx-org-manage/references/edition_types.md +10 -8
- package/skills/dx-org-manage/references/opening-org.md +11 -12
- package/skills/dx-org-manage/references/scratch-org-create.md +303 -0
- package/skills/dx-org-manage/references/scratch-org-operations.md +135 -0
- package/skills/experience-aura-lwc-migrate/SKILL.md +120 -0
- package/skills/experience-aura-lwc-migrate/references/aura-api-expert.md +170 -0
- package/skills/experience-aura-lwc-migrate/references/aura-data-expert.md +172 -0
- package/skills/experience-aura-lwc-migrate/references/aura-migration-guidelines.md +299 -0
- package/skills/experience-aura-lwc-migrate/references/aura-prd-framework.md +79 -0
- package/skills/experience-aura-lwc-migrate/references/aura-redundant-code-expert.md +24 -0
- package/skills/experience-aura-lwc-migrate/references/aura-reference-expert.md +140 -0
- package/skills/experience-aura-lwc-migrate/references/aura-resolver-expert.md +115 -0
- package/skills/experience-aura-lwc-migrate/references/aura-slots-expert.md +67 -0
- package/skills/experience-aura-lwc-migrate/references/aura-style-expert.md +62 -0
- package/skills/experience-aura-lwc-migrate/references/aura-to-lwc-completeness-checklist.md +188 -0
- package/skills/experience-aura-lwc-migrate/references/aura-values-expert.md +67 -0
- package/skills/experience-content-media-search/SKILL.md +17 -12
- package/skills/experience-content-media-stock-image-search/SKILL.md +192 -0
- package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +102 -0
- package/skills/experience-lds-best-practices-apply/SKILL.md +245 -0
- package/skills/experience-lds-best-practices-apply/references/adapter-apis.md +1640 -0
- package/skills/experience-lds-best-practices-apply/references/lds-data-consistency.md +126 -0
- package/skills/experience-lds-best-practices-apply/references/lds-expert.md +429 -0
- package/skills/experience-lds-best-practices-apply/references/lds-referential-integrity.md +322 -0
- package/skills/experience-lds-best-practices-apply/references/wire-adapter-types.md +1511 -0
- package/skills/experience-lds-graphql-generate/SKILL.md +222 -0
- package/skills/experience-lds-graphql-generate/references/generation-guide.md +236 -0
- package/skills/experience-lds-graphql-generate/references/generation-mutation.md +277 -0
- package/skills/experience-lds-graphql-generate/references/generation-query.md +237 -0
- package/skills/experience-lds-graphql-generate/scripts/fetch-lds-graphql-schema.sh +230 -0
- package/skills/experience-lds-graphql-generate/scripts/test-lds-graphql-query.sh +128 -0
- package/skills/experience-lwc-accessibility-validate/SKILL.md +112 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-1-1-non-text-content.md +88 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-i-lists.md +52 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-ii-tables.md +106 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iii-form-labels.md +78 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iv-regions.md +26 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-v-groups.md +66 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-5-identify-input.md +70 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-4-3-contrast.md +115 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-1-1-keyboard.md +47 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-4-link-purpose.md +39 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-6-headings-labels.md +50 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-1-pointer-gestures.md +54 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-2-pointer-cancellation.md +49 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-3-label-in-name.md +77 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-7-dragging-movement.md +45 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-1-on-focus.md +55 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-2-on-input.md +51 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-1-error-identification.md +84 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-2-labels-instructions.md +50 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-3-error-suggestion.md +64 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-i-name.md +105 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-ii-role.md +99 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-iii-value.md +97 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-1-1-non-text-content.md +83 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-1-use-of-color.md +62 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-10-resize-reflow.md +18 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-11-non-text-contrast.md +43 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-3-contrast.md +25 -0
- package/skills/experience-lwc-accessibility-validate/scripts/contrast-ratio.py +153 -0
- package/skills/experience-lwc-design-generate/SKILL.md +261 -0
- package/skills/experience-lwc-design-generate/references/figma-to-prd-blueprint.md +66 -0
- package/skills/experience-lwc-design-generate/references/prd-analysis-template.md +17 -0
- package/skills/experience-lwc-design-generate/scripts/check-component-name.sh +75 -0
- package/skills/experience-lwc-design-generate/scripts/detect-project-tools.sh +97 -0
- package/skills/experience-lwc-runtime-observe/SKILL.md +244 -0
- package/skills/experience-lwc-runtime-observe/examples/component-preview-and-dom.md +41 -0
- package/skills/experience-lwc-runtime-observe/scripts/extract-dom.sh +79 -0
- package/skills/experience-lwc-runtime-observe/scripts/open-frontdoor.sh +46 -0
- package/skills/experience-lwc-runtime-observe/scripts/verify-toolchain.sh +48 -0
- package/skills/experience-lwc-security-validate/SKILL.md +151 -0
- package/skills/experience-lwc-security-validate/examples/review-report.md +6 -0
- package/skills/experience-lwc-security-validate/examples/score-report.sarif.json +32 -0
- package/skills/experience-lwc-security-validate/references/lws-security-expert.md +986 -0
- package/skills/experience-lwc-security-validate/references/security-analysis.md +611 -0
- package/skills/experience-lwc-security-validate/scripts/check-lwc-import.sh +166 -0
- package/skills/experience-lwc-security-validate/scripts/validate-sarif.sh +131 -0
- package/skills/experience-ui-bundle-2gp-deploy/SKILL.md +454 -0
- package/skills/experience-ui-bundle-2gp-deploy/assets/CustomApplication.app-meta.xml +12 -0
- package/skills/experience-ui-bundle-2gp-deploy/assets/PermissionSet.permissionset-meta.xml +9 -0
- package/skills/experience-ui-bundle-2gp-deploy/scripts/find-bundle-package-dir.sh +53 -0
- package/skills/experience-ui-bundle-agentforce-client-generate/SKILL.md +104 -26
- package/skills/experience-ui-bundle-agentforce-client-generate/references/constraints.md +35 -24
- package/skills/experience-ui-bundle-agentforce-client-generate/references/examples.md +92 -1
- package/skills/experience-ui-bundle-agentforce-client-generate/references/style-tokens.md +2 -0
- package/skills/experience-ui-bundle-agentforce-client-generate/references/troubleshooting.md +14 -1
- package/skills/experience-ui-bundle-agentforce-client-generate/scripts/detect-framework.sh +67 -0
- package/skills/experience-ui-bundle-deploy/SKILL.md +83 -14
- package/skills/experience-ui-bundle-deploy/assets/Communities.settings-meta.xml +19 -0
- package/skills/experience-ui-bundle-deploy/assets/org-setup.config.template.json +5 -0
- package/skills/experience-ui-bundle-deploy/assets/social-login-auth-providers.apex +158 -0
- package/skills/experience-ui-bundle-deploy/references/config-scaffold.md +13 -1
- package/skills/experience-ui-bundle-deploy/references/social-login.md +179 -0
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +14 -0
- package/skills/experience-ui-bundle-mfa-configure/SKILL.md +6 -5
- package/skills/experience-ui-bundle-mfa-configure/references/social-login.md +15 -7
- package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +41 -5
- package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +10 -22
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +4 -19
- package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +5 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +33 -150
- package/skills/mobile-platform-native-capabilities-integrate/references/nfc.md +35 -0
- package/skills/platform-apex-generate/SKILL.md +8 -7
- package/skills/platform-apex-test-generate/SKILL.md +3 -1
- package/skills/platform-apex-test-run/SKILL.md +9 -8
- package/skills/platform-lightning-type-widget-coordinate/SKILL.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +3 -3
- package/skills/platform-mcp-tool-widget-coordinate/SKILL.md +43 -67
- package/skills/platform-mcp-tool-widget-coordinate/examples/action-name-source-prompt.md +1 -2
- package/skills/platform-mcp-tool-widget-coordinate/examples/apex-invocable-source-prompt.md +2 -3
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-list-source-prompt.md +163 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-single-source-prompt.md +198 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/pasted-tool-output-prompt.md +0 -1
- package/skills/platform-mcp-tool-widget-coordinate/references/build-plan-format.md +17 -11
- package/skills/platform-mcp-tool-widget-coordinate/references/mcp-tool-output-discovery.md +48 -15
- package/skills/platform-mcp-tool-widget-coordinate/references/two-clt-modeling.md +73 -10
- package/skills/platform-mcp-tool-widget-coordinate/references/validation-gates.md +48 -8
- package/skills/platform-policy-rule-generate/SKILL.md +22 -12
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +1 -1
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +8 -29
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +1 -1
- package/skills/platform-sharing-owd-configure/SKILL.md +20 -8
- package/skills/platform-sharing-owd-configure/references/access_levels.md +14 -1
- package/skills/platform-sharing-rules-generate/SKILL.md +67 -35
- package/skills/platform-sharing-rules-generate/examples/create-cases.md +16 -17
- package/skills/platform-sharing-rules-generate/examples/delete-cases.md +34 -79
- package/skills/platform-sharing-rules-generate/examples/edit-cases.md +13 -26
- package/skills/platform-sharing-rules-generate/scripts/count-remaining-rules.sh +33 -0
- package/skills/platform-widget-generate/SKILL.md +3 -5
- package/skills/platform-widget-generate/examples/conditional.json +18 -13
- package/skills/platform-widget-generate/examples/list-with-foreach.json +2 -2
- package/skills/platform-widget-generate/examples/single-object.json +2 -2
- package/skills/platform-widget-generate/references/schema-from-lightning-type.md +27 -6
- package/skills/platform-widget-generate/references/widget-bundle-layout.md +4 -3
- package/skills/service-itsm-agentic-setup-cmdb-access-assign/SKILL.md +287 -0
- package/skills/service-itsm-agentic-setup-cmdb-access-assign/references/mcp-invocation.md +260 -0
- package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/SKILL.md +252 -0
- package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/references/mcp-invocation.md +204 -0
- package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +259 -0
- package/skills/service-itsm-agentic-setup-cmdb-configure/references/mcp-invocation.md +188 -0
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +197 -0
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/examples/output-templates.md +77 -0
- package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/SKILL.md +316 -0
- package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/references/mcp-invocation.md +221 -0
- package/skills/service-itsm-incident-priority-configure/SKILL.md +168 -0
- package/skills/service-itsm-incident-priority-configure/examples/matrix-operations.md +200 -0
- package/skills/service-itsm-incident-priority-configure/examples/render-matrix.md +54 -0
- package/skills/service-itsm-incident-priority-configure/examples/seed-full-matrix.md +52 -0
- package/skills/service-itsm-incident-priority-configure/references/sf-cli-invocation.md +264 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-source-prompt.md +0 -191
- package/skills/platform-policy-rule-generate/references/fixtures-index.md +0 -29
|
@@ -44,13 +44,28 @@ Confirms the envelope→response typing the renderer depends on.
|
|
|
44
44
|
|
|
45
45
|
Any output → `KEYWORDS: FAIL (<path>)`; empty → `KEYWORDS: ok`.
|
|
46
46
|
|
|
47
|
-
4. **Nested-object response fields (if any) use `@apexClassType`, never a bare object.** For every response CLT property that is not a primitive leaf, print its `lightning:type`:
|
|
47
|
+
4. **Nested-object response fields (if any) use `@apexClassType`, never a bare object or a CLT-level list.** For every response CLT property that is not a primitive leaf, print its `lightning:type`:
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
jq -r '.properties | to_entries[] | select(.value["lightning:type"] == null or (.value["lightning:type"] | test("^lightning__") | not)) | "\(.key): \(.value["lightning:type"])"' <pkgDir>/lightningTypes/<responseCLT>/schema.json
|
|
50
|
+
jq -r '.properties | to_entries[] | select(.value["lightning:type"] == null or (.value["lightning:type"] | test("^lightning__(text|integer|number|boolean|date|dateTime)Type$") | not)) | "\(.key): \(.value["lightning:type"])"' <pkgDir>/lightningTypes/<responseCLT>/schema.json
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
Every printed entry must
|
|
53
|
+
Every printed entry must be a single nested object typed `@apexClassType/<ns>__<OuterClass>$<InnerClass>`. Two FAILs:
|
|
54
|
+
- A bare `{"type":"object"}` (no `lightning:type`, or a `lightning:type` of `lightning__objectType` inlined on a *property* rather than the CLT root) → `NESTED_TYPE: FAIL (<key>: <actual>)`.
|
|
55
|
+
- A `lightning__listType` on a **response CLT** property → `NESTED_TYPE: FAIL (<key>: lists ride inside an @apexClassType object; the CLT must not carry a lightning__listType — see references/two-clt-modeling.md "List of nested objects")`. Lists surface in the widget schema, not the CLT.
|
|
56
|
+
|
|
57
|
+
All entries are `@apexClassType/...` or no such properties exist → `NESTED_TYPE: ok`.
|
|
58
|
+
|
|
59
|
+
5. **Response CLT property names trace to describe outputs (no invented wrapper).** The response CLT's top-level property names MUST equal the describe's `outputs[].name` set (for `apex`/`sample`, the response class's `@InvocableVariable` field names — the same set the describe surfaces). Print both:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
echo "OUTPUTS:"
|
|
63
|
+
sf api request rest '/services/data/v<APIVER>/actions/custom/apex/<ActionApiName>' -o <org> | jq -r '.outputs[].name' | sort -u
|
|
64
|
+
echo "RESPONSE_CLT_PROPS:"
|
|
65
|
+
jq -r '.properties | keys[]' <pkgDir>/lightningTypes/<responseCLT>/schema.json | sort -u
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
A describe with **N sibling outputs** must yield **N flat properties** with matching names; a describe with **one output** yields **one property named after it** (`shipmentDetailsResponse`, `flightInfo`). A single property whose name is **not** among the describe outputs (e.g. `leadsListResponse` against a `leadCount`/`leads`/`message`/`status` describe) is an **invented wrapper** — it collapses N siblings into one key the describe never returns and is unresolvable under `action`. Any response CLT property name absent from the describe outputs → `PROP_GROUNDING: FAIL (<prop> not a describe output — model each sibling output as its own flat property; never collapse into an invented wrapper)`. All property names present in the outputs set → `PROP_GROUNDING: ok`.
|
|
54
69
|
|
|
55
70
|
**Result:** all ok → `pass`. Otherwise `fail (<first failing check>)`.
|
|
56
71
|
|
|
@@ -109,6 +124,32 @@ Confirms the envelope CLT's default renderer assigns the widget and binds every
|
|
|
109
124
|
|
|
110
125
|
---
|
|
111
126
|
|
|
127
|
+
### 3. `nested-list-coverage`
|
|
128
|
+
|
|
129
|
+
Confirms every **nested-object** and **list** payload field discovered in Phase 2 is actually rendered — never dropped. The failure mode it guards against: a `List<...>` field declared "out of scope" and silently omitted, leaving the widget with only a scalar KPI. A nested-object or list field is **domain data** and MUST be rendered.
|
|
130
|
+
|
|
131
|
+
> **A top-level list output is directly renderable — never reshape the Apex.** When the describe surfaces the list itself as an output (`apexClass` set + `maxOccurs > 1`, e.g. `GetLeadsList` → `leads`), the response CLT types it directly as `@apexClassType/c__<Outer>$<ElementClass>` and the renderer binds it at **two segments** `{!$attrs.outputValues.<listField>}` — no wrapper class, no Apex change. A list *inside* a wrapper object (the describe returns one `maxOccurs: 1` `apexClass` output and the list is a field the describe does not surface) binds at **three segments** `{!$attrs.outputValues.<wrapperField>.<listField>}` after reading the inner class to find the list field. Covering the field means binding it at the depth its describe position dictates — the skill must **never** normalize the action to a wrapper or drop the field.
|
|
132
|
+
|
|
133
|
+
> **Key it off discovery, not the artifacts.** A field the skill silently dropped will be absent from BOTH the CLT and the widget — so this gate must compare against the Phase 2 discovery output (the Actions REST `outputs` with `apexClass`, or the response class's `@InvocableVariable` fields, or the sample's object/array values), NOT against what the generated files happen to contain. Recall from Phase 2: a list in a response CLT is always a plain `@apexClassType/...` reference — the CLT never carries a `lightning__listType` property (the list-ness lives in the *widget* schema). Do not look for a `lightning__listType` in the CLT.
|
|
134
|
+
|
|
135
|
+
1. **List the nested-object and list fields DISCOVERED in Phase 2** (from the source, not the generated CLT). For `action`, these are `outputs[]` entries with an `apexClass` key (`maxOccurs: 1` → single object; `maxOccurs > 1` → list of objects). For `apex`, they are top-level `@InvocableVariable` fields whose type is an Apex class or `List<ApexClass>`, plus fields on any nested/referenced class the payload references — those inner fields are enumerated by the class's **public / `@AuraEnabled`** members, not `@InvocableVariable` (an inner class's list/object fields are `@AuraEnabled`, never surfaced in the describe). For `sample`, they are properties whose value is an object or an array of objects. Print the list with each field's kind (single-object vs list) and, for lists, the inner class name.
|
|
136
|
+
|
|
137
|
+
Empty (payload is all primitives) → `COVERAGE: ok (no nested/list fields)`.
|
|
138
|
+
|
|
139
|
+
2. **For each single nested-object field** (`@apexClassType/...` in the CLT): confirm its inner class's leaf fields appear as widget schema properties (the flatten rule), and each is bound `{!$attrs.outputValues.<objectField>.<leaf>}` in the renderer. A nested-object field whose leaves are absent from the widget schema → `COVERAGE: FAIL (<objectField> flattened leaves missing from widget)`.
|
|
140
|
+
|
|
141
|
+
3. **For each list field.** The list is a plain `@apexClassType/...` reference in the CLT — either a top-level list output typed directly as `c__<Outer>$<ElementClass>`, or a field inside a wrapper `@apexClassType` object (verify the corresponding CLT property exists). Two cross-skill checks — how the widget schema/body surfaces and iterates the list is owned and validated by `platform-widget-generate`, not re-specified here:
|
|
142
|
+
- **Rendered by the delegate.** Confirm the list field is present as a property in the widget schema handed off to / produced by `platform-widget-generate` (a list property, not dropped). A discovered list field absent from the widget entirely → `COVERAGE: FAIL (<listField> is a List<ApexClass> but the widget does not render it — never declare a list "out of scope")`.
|
|
143
|
+
- **Bound in the renderer at the correct depth.** The envelope renderer binds the list at the depth its describe position dictates: **two segments** `{!$attrs.outputValues.<listField>}` for a top-level list output, or **three segments** `{!$attrs.outputValues.<wrapperField>.<listField>}` for a list inside a wrapper object (never `.<leaf>`). A missing or wrong-depth binding → `COVERAGE: FAIL (<listField> not bound at correct depth in renderer)`.
|
|
144
|
+
|
|
145
|
+
4. **No drop.** A discovered nested/list field is never absent. "Beta single-response flow" / "out of scope" / "list rendering not supported" are NOT valid rationales — the skill renders lists. If a discovered nested/list field is absent → **FAIL**.
|
|
146
|
+
|
|
147
|
+
**Result:** all discovered nested/list fields rendered → `pass`. Otherwise `fail (<first failing field + reason>)`.
|
|
148
|
+
|
|
149
|
+
**Failure → fix:** render the field per `references/two-clt-modeling.md` ("Nested-object and list payload fields") — do not drop it. If the list-element typing is uncertain, resolve it through `platform-custom-lightning-type-generate` and `platform-widget-generate`; do not fall back to omission.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
112
153
|
## Warn — advisory
|
|
113
154
|
|
|
114
155
|
### `field-trace`
|
|
@@ -139,7 +180,7 @@ Enforces: no invented widget fields (subset rule) and no silent omission of resp
|
|
|
139
180
|
|
|
140
181
|
If grep misses multi-line annotations, read the `.cls` with the Read tool and list fields manually. For the `sample` source, use the `outputValues` keys instead.
|
|
141
182
|
|
|
142
|
-
**Nested-object fields (per `references/mcp-tool-output-discovery.md` "Nested-object payload fields") expand before comparison.** A field resolved to `@apexClassType/<ns>__<OuterClass>$<InnerClass>` is not itself compared against `WIDGET_PROPS` — the widget flattens to that class's own leaf fields, never the object field. Replace that field name in `INVOCABLE_FIELDS` with its referenced class's leaf field names (
|
|
183
|
+
**Nested-object fields (per `references/mcp-tool-output-discovery.md` "Nested-object and list payload fields") expand before comparison.** A field resolved to `@apexClassType/<ns>__<OuterClass>$<InnerClass>` (single object) is not itself compared against `WIDGET_PROPS` — the widget flattens to that class's own leaf fields, never the object field. Replace that field name in `INVOCABLE_FIELDS` with its referenced class's leaf field names — enumerated by the inner class's **public / `@AuraEnabled`** members, not `@InvocableVariable` (SKILL.md Hard Rule 6; grepping an inner class for `@InvocableVariable` yields zero leaves, so the trace would spuriously pass against an empty widget) — before running the diff in step 3. Note the substitution in the printed output, e.g. `INVOCABLE_FIELDS (expanded): flightInfo → flightId, origin, destination, departureTime, arrivalTime, price`. A **list** field (`List<ApexClass>`), by contrast, is NOT flattened away — it remains a single `WIDGET_PROPS` key (the `lightning__listType` widget property), so keep the list field name in `INVOCABLE_FIELDS` as-is; its per-item leaves are `{!$item.<leaf>}` bindings inside the widget body, not top-level widget schema keys. (Whether a list is actually rendered is enforced by the hard `nested-list-coverage` gate, not here.)
|
|
143
184
|
|
|
144
185
|
2. **Extract widget schema property keys:**
|
|
145
186
|
|
|
@@ -159,8 +200,7 @@ Enforces: no invented widget fields (subset rule) and no silent omission of resp
|
|
|
159
200
|
|
|
160
201
|
4. **Result classification:**
|
|
161
202
|
- `INVENTED` non-empty → **fail** (subset rule violated). `fail (invented: <list>)`.
|
|
162
|
-
- `OMITTED` non-empty
|
|
163
|
-
- `OMITTED` non-empty AND any omitted field is NOT in `Properties omitted:` → **warn** (silent omission). `warn (silent omission: <list>)`, surface before the summary.
|
|
203
|
+
- `OMITTED` non-empty → **warn** (a response data field absent from the widget). `warn (omitted: <list>)`, surface before the summary.
|
|
164
204
|
- Both empty → **pass**.
|
|
165
205
|
|
|
166
206
|
**Reporting `pass` without printing the two lists is a hard violation — report `not run` instead.**
|
|
@@ -169,10 +209,10 @@ Enforces: no invented widget fields (subset rule) and no silent omission of resp
|
|
|
169
209
|
|
|
170
210
|
## Direction of the subset rule
|
|
171
211
|
|
|
172
|
-
The widget `schema.json` and the response CLT `properties` are a **subset** of the response `@InvocableVariable`
|
|
212
|
+
The widget `schema.json` and the response CLT `properties` are a **subset** of the fields the tool exposes — the top-level response class's `@InvocableVariable` outputs, plus (when a field resolves to `@apexClassType/...`) the referenced inner class's public/`@AuraEnabled` leaves.
|
|
173
213
|
|
|
174
214
|
- **No invented fields (hard via `field-trace`).** The widget must not introduce properties the response class does not expose.
|
|
175
|
-
- **
|
|
215
|
+
- **Omissions surface as a warning.** A response data field absent from the widget is reported by `field-trace` as a warning, not silently accepted.
|
|
176
216
|
|
|
177
217
|
---
|
|
178
218
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: platform-policy-rule-generate
|
|
3
|
-
description: "Use this skill when authoring PolicyRuleDefinition and PolicyRuleDefinitionSet metadata XML for
|
|
3
|
+
description: "Use this skill when authoring PolicyRuleDefinition and PolicyRuleDefinitionSet metadata XML for Salesforce Data Cloud governance policies, or when editing *.policyRuleDefinition / *.policyRuleDefinitionSet files. Covers the category decision tree, full schema for all policy variants (ACCESS, GOVERNANCE, RECORD, TRANSFORM), UI-compatibility rules for the Data Governance Policy Builder, output hygiene for user-facing agent responses, and validation guardrails. Do NOT use this skill for UserAccessPolicy, AccessPolicy, SharingRules, PermissionSet, or any other access-control metadata type — those have their own types and live outside the PolicyRuleDefinition schema."
|
|
4
4
|
metadata:
|
|
5
5
|
version: "1.0"
|
|
6
6
|
minApiVersion: "64.0"
|
|
@@ -13,12 +13,10 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
# Authoring Policy Rule Definitions
|
|
15
15
|
|
|
16
|
-
**Gating:**
|
|
17
|
-
**Min API version:** 64.0 (66.0 for conditions using `PolicyJsonExpression`)
|
|
16
|
+
**Gating:** requires the `EnforceOMatic` and `PolicyRuleMDAPI` org permissions.
|
|
17
|
+
**Min API version:** 64.0 (66.0 for conditions using `PolicyJsonExpression`).
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
This skill covers the **on-disk metadata XML format** for authoring policies. Use it whenever a task asks to write a `*.policyRuleDefinition` or `*.policyRuleDefinitionSet` file, add a fixture under `test/func/filemetadata/`, or ship a metadata package. The runtime side (RuleProvider, hooks) is out of scope.
|
|
19
|
+
This skill covers the **on-disk metadata XML format** for authoring policies. Use it whenever a task asks to write a `*.policyRuleDefinition` or `*.policyRuleDefinitionSet` file, or ship a metadata package containing them. The runtime side (RuleProvider, hooks) is out of scope.
|
|
22
20
|
|
|
23
21
|
---
|
|
24
22
|
|
|
@@ -100,13 +98,12 @@ A deployable package always contains:
|
|
|
100
98
|
|
|
101
99
|
**Category names a domain (where in the platform's enforcement layers the rule applies). Effect names the action (allow / deny / transform). They are independent except for TRANSFORM.**
|
|
102
100
|
|
|
103
|
-
The **only** Category × Effect rule the platform validates
|
|
104
|
-
(`enforce-o-matic-api/java/src/enforce/o/matic/api/module/api/RuleBuilder.java`):
|
|
101
|
+
The **only** Category × Effect rule the platform validates:
|
|
105
102
|
|
|
106
103
|
- `effect=Transform` ⇔ `category=TRANSFORM_POLICY_RULE_DEFINITION` (bidirectional; mismatched throws `INVALIDFORCATEGORY`).
|
|
107
104
|
- All other categories (`ACCESS`, `GOVERNANCE`, `RECORD`, `IDENTIFIED_RECORD`) accept either `Permit` or `Forbid`.
|
|
108
105
|
|
|
109
|
-
> **Note on the platform's auto-fill default:** When `<category>` is omitted from authored XML, the
|
|
106
|
+
> **Note on the platform's auto-fill default:** When `<category>` is omitted from authored XML, the server fills it in from `effect`: `Permit→ACCESS`, `Forbid→GOVERNANCE`, `Transform→TRANSFORM`. **This is a default-fill, not a validation.** If you author an explicit category that contradicts this default, it is accepted and persisted as-is.
|
|
110
107
|
|
|
111
108
|
### Picking the category
|
|
112
109
|
|
|
@@ -179,7 +176,7 @@ Every `<conditions>` block needs **all four**: `<clause>`, `<operator>`, one pat
|
|
|
179
176
|
| Record field = user attribute | `<resourcePath>RECORDFIELD</resourcePath>` + `<valueDomain>Schema:field</valueDomain>` | `EQUALS` | `<valuePrincipalPath>USER_ID` \| `ORGANIZATION_ID` \| `USER_ROLE_ID</valuePrincipalPath>` |
|
|
180
177
|
| Entity type check | `<resourcePath>ENTITYTYPE</resourcePath>` | `IS` | `<valueString>{"t":"Text","v":"FIELD"}</valueString>` |
|
|
181
178
|
|
|
182
|
-
`<conjunctionExpression>` is 1-indexed prefix notation: `1`, `(AND 1 2)`, `(OR 1 2)`, `(AND (OR 1 2) (AND 3))`. A bare top-level index like `1` is valid for **deploy**
|
|
179
|
+
`<conjunctionExpression>` is 1-indexed prefix notation: `1`, `(AND 1 2)`, `(OR 1 2)`, `(AND (OR 1 2) (AND 3))`. A bare top-level index like `1` is valid for **deploy** but **crashes the Data Governance Policy Builder UI** — see §7 if UI editability matters.
|
|
183
180
|
|
|
184
181
|
For full path enums (`RulePrincipalPathType`, `RuleResourcePathType`, `RuleContextPathType`), operators, and JSON expressions (PROJECTION / ARGLIST / SOQLTARGETLISTEXPR), see [`references/policy-schema-full.md`](references/policy-schema-full.md).
|
|
185
182
|
For copy-paste templates for all policy variants, see [`references/templates.md`](references/templates.md).
|
|
@@ -203,7 +200,7 @@ For copy-paste templates for all policy variants, see [`references/templates.md`
|
|
|
203
200
|
13. Standard tag/classification dev names are fully-qualified dotted paths (e.g. `DataGovernanceTags.ExternalData.Visibility.Public`). Retrieve an existing rule to get the exact string before authoring.
|
|
204
201
|
14. Min API versions: `PolicyRuleDefinition` = 64.0; `PolicyJsonExpression` conditions = 66.0; `<replicated>` = 260+; `<builderCompatible>` / `<builderValidated>` = 262+.
|
|
205
202
|
|
|
206
|
-
> **Note on `<conjunctionExpression>` shape:** A bare top-level index (e.g. `<conjunctionExpression>1</conjunctionExpression>`) deploys cleanly — the
|
|
203
|
+
> **Note on `<conjunctionExpression>` shape:** A bare top-level index (e.g. `<conjunctionExpression>1</conjunctionExpression>`) deploys cleanly — the server-side parser accepts bare tokens at the top level. It is **not** a deploy-time validation error. It does, however, crash the Data Governance Policy Builder UI on load — see §7.
|
|
207
204
|
|
|
208
205
|
---
|
|
209
206
|
|
|
@@ -247,12 +244,25 @@ For the full UI-compatibility checklist, round-trip rules, and operator support
|
|
|
247
244
|
10. **Validate with dry-run** before any non-dry deploy to a persistent org. Surface errors using the error reference in [`references/deploy-errors.md`](references/deploy-errors.md).
|
|
248
245
|
|
|
249
246
|
**Three-layer correctness check** before done:
|
|
250
|
-
- **Runtime
|
|
247
|
+
- **Runtime enforcement** — does the rule enforce what's intended? (action choice, condition shape)
|
|
251
248
|
- **MDAPI deploy validity** — does it deploy? (§6 guardrails, scope×category, tag dev names, org perms)
|
|
252
249
|
- **UI editability** — can the builder render and re-save it? (§7 checklist, OR-of-ENTITYTYPE requirement)
|
|
253
250
|
|
|
254
251
|
---
|
|
255
252
|
|
|
253
|
+
## 9. Output Hygiene — What the Agent Must NOT Say to the User
|
|
254
|
+
|
|
255
|
+
The agent's user-facing chat response accompanies every generated file. Customers should never see internal engine or implementation details.
|
|
256
|
+
|
|
257
|
+
- **Do NOT name the internal evaluation engine** in user-facing text — including but not limited to `Cedar`, `policy engine`, `AuthZ engine`, `evaluation engine`, `Rego`, `OPA`, or similar. The customer-facing surface is *Data Governance*, *Policy Builder*, *Data Cloud Governance* — use those terms only.
|
|
258
|
+
- **Do NOT emit trailing "How it works at runtime" narratives** that describe evaluation flow, principal-resource matching semantics, or engine-internal condition ordering. The generated file is the artifact; a one-line summary of what deployed is enough. If the user explicitly asks how enforcement works, describe it in product terms (e.g. "Data Governance denies the read when …"), never in engine terms.
|
|
259
|
+
- **Do NOT name internal packages, source directories, Java class names, method names, or line-number references** in user-facing text. Internal implementation identifiers are not customer-facing; refer to platform behavior in product terms only ("the server validates …", "Data Governance rejects …").
|
|
260
|
+
- **Do NOT explain auto-fill / default-fill / fallback semantics** unless the user asks. Ship the rule; surface constraints only when they affect what the user has to do next (e.g. "the DMO tag must exist before deploy").
|
|
261
|
+
|
|
262
|
+
If the user needs more context, they'll ask — respond then, in product language.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
256
266
|
## Reference Docs
|
|
257
267
|
|
|
258
268
|
| Detail | File |
|
|
@@ -51,4 +51,4 @@ sf project deploy start \
|
|
|
51
51
|
--wait 10
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
A `--dry-run` failure runs the full server-side validation
|
|
54
|
+
A `--dry-run` failure runs the full server-side validation (including the `IDENTIFIED_RECORD` constraint) without persisting. This catches all of the errors in the table above before they affect a real org.
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# Policy Schema — Full Element Reference
|
|
2
2
|
|
|
3
|
-
Source: `enforce-o-matic-impl/java/src/enforce/o/matic/metadata/`
|
|
4
|
-
|
|
5
3
|
---
|
|
6
4
|
|
|
7
5
|
## Path Enums
|
|
8
6
|
|
|
9
|
-
> **Surface principle.** The MDAPI surface is
|
|
7
|
+
> **Surface principle.** The MDAPI surface is a narrower set of `*Type` enums (`RulePrincipalPathType`, `RuleResourcePathType`, `RuleContextPathType`) than what the runtime honors at evaluation time. Values that appear at runtime but are not in the MDAPI `*Type` enums are **not authorable via MDAPI** — use a runtime RuleProvider for those.
|
|
10
8
|
|
|
11
9
|
### `<principalPath>` / `<valuePrincipalPath>` — `RulePrincipalPathType` (6 values)
|
|
12
10
|
|
|
@@ -44,13 +42,13 @@ Outside contract (not in `RulePrincipalPathType`): `IS_INTERNAL`, `CONTACT_ID`,
|
|
|
44
42
|
|
|
45
43
|
### `<contextPath>` / `<valueContextPath>` — `RuleContextPathType` (1 value)
|
|
46
44
|
|
|
47
|
-
| Value |
|
|
48
|
-
|
|
49
|
-
| `SESSION_DATASPACE` |
|
|
45
|
+
| Value | Use case |
|
|
46
|
+
|-------|----------|
|
|
47
|
+
| `SESSION_DATASPACE` | Session-scoped dataspace check |
|
|
50
48
|
|
|
51
49
|
Outside contract: `SESSION_CONSUMER_ID`, `CONTEXT_AGENT_ID`, `CONTEXT_AGENT_VERSION_ID` (IDENTIFIED_RECORD / agentic — runtime RuleProvider only).
|
|
52
50
|
|
|
53
|
-
>
|
|
51
|
+
> `SCALAR_ATTRIBUTE` / `PLURAL_ATTRIBUTE` in `<valuePrincipalPath>` are outside `RulePrincipalPathType` — not authorable via MDAPI for new work.
|
|
54
52
|
|
|
55
53
|
---
|
|
56
54
|
|
|
@@ -71,7 +69,7 @@ Outside contract: `SESSION_CONSUMER_ID`, `CONTEXT_AGENT_ID`, `CONTEXT_AGENT_VERS
|
|
|
71
69
|
|
|
72
70
|
---
|
|
73
71
|
|
|
74
|
-
## `<conditions>` — Full Schema
|
|
72
|
+
## `<conditions>` — Full Schema
|
|
75
73
|
|
|
76
74
|
| Element | Notes |
|
|
77
75
|
|---------|-------|
|
|
@@ -94,7 +92,7 @@ Outside contract: `SESSION_CONSUMER_ID`, `CONTEXT_AGENT_ID`, `CONTEXT_AGENT_VERS
|
|
|
94
92
|
|
|
95
93
|
---
|
|
96
94
|
|
|
97
|
-
## `<policyRuleValueSet>`
|
|
95
|
+
## `<policyRuleValueSet>`
|
|
98
96
|
|
|
99
97
|
Three fields (all optional at schema level, but a non-empty value set needs at least one):
|
|
100
98
|
|
|
@@ -130,7 +128,7 @@ Multiple `<policyRuleValueSet>` siblings inside one condition are OR-combined.
|
|
|
130
128
|
|
|
131
129
|
---
|
|
132
130
|
|
|
133
|
-
## JSON Expressions
|
|
131
|
+
## JSON Expressions (min API 66.0)
|
|
134
132
|
|
|
135
133
|
`<type>` must match the location:
|
|
136
134
|
|
|
@@ -229,22 +227,3 @@ Plural (use a set operator: `CONTAINS_ANY` / `CONTAINS_NONE` / `CONTAINS_ALL`):
|
|
|
229
227
|
| `REPLACE_ALL_CHARS_RESOURCE_TRANSFORM` | Replace each char |
|
|
230
228
|
|
|
231
229
|
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` |
|
|
@@ -53,6 +53,6 @@ Source: `conditionWithHierarchy`
|
|
|
53
53
|
|
|
54
54
|
`IDENTIFIED_RECORD` policies cannot be authored as XML. The required `RuleContextPath.SESSION_CONSUMER_ID` is not in `RuleContextPathType`.
|
|
55
55
|
|
|
56
|
-
To author one:
|
|
56
|
+
To author one: implement it as a runtime `RuleProvider` in the consuming service, not via MDAPI XML.
|
|
57
57
|
|
|
58
58
|
**Do not** synthesize a placeholder XML using `<contextPath>SESSION_CONSUMER_ID</contextPath>` — the value is not in `RuleContextPathType` and the deploy will fail.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: platform-sharing-owd-configure
|
|
3
3
|
description: "Use when the user wants to retrieve or update Organization-Wide Default (OWD) sharing settings for Salesforce objects. TRIGGER when: user asks to check current OWD settings, view sharing defaults, change default access levels (Private, Public Read Only, Public Read/Write, Controlled by Parent), configure internal or external access for standard or custom objects, mentions org-wide defaults, wants to make records private or restrict who can see records, wants to control default record visibility for an object, or references .settings-meta.xml sharing fields or sharingModel in .object-meta.xml files. DO NOT TRIGGER when: user asks about sharing rules, criteria-based sharing, role hierarchy, or manual sharing — delegate to platform-sharing-rules-generate."
|
|
4
4
|
metadata:
|
|
5
|
-
version: "1.
|
|
5
|
+
version: "1.2"
|
|
6
6
|
cliTools:
|
|
7
7
|
- tool: ["sf"]
|
|
8
8
|
semver: ">=2.0.0"
|
|
@@ -60,21 +60,30 @@ All steps are sequential. Do not skip or reorder.
|
|
|
60
60
|
|
|
61
61
|
### Phase 2 — Update Settings (if requested)
|
|
62
62
|
|
|
63
|
-
4. **
|
|
63
|
+
4. **Check for immutable/fixed OWD** — read `references/access_levels.md` "Immutable / Fixed OWD Objects" section. If the requested change targets a fixed value (e.g., Price Book external OWD), **stop immediately** and explain to the user that this value is platform-fixed and cannot be changed by any means. Do not attempt a deploy.
|
|
64
64
|
|
|
65
|
-
5. **
|
|
65
|
+
5. **Validate the requested access level** — read `references/access_levels.md` to confirm the value is valid for the target object. If the value is not in the allowed set for that object, explain what values are valid and ask the user to choose one. Do not guess alternative values.
|
|
66
66
|
|
|
67
|
-
6. **
|
|
67
|
+
6. **Retrieve the object metadata** using the Metadata API (same command for both standard and custom objects): `sf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org>`. This retrieves `<ObjectName>.object-meta.xml` containing `<sharingModel>` and `<externalSharingModel>`. See `references/metadata_api_approach.md` for the full procedure.
|
|
68
68
|
|
|
69
|
-
7. **
|
|
69
|
+
7. **Modify the sharing settings** — update the `<sharingModel>` (internal access) and/or `<externalSharingModel>` (external access) in the object's `.object-meta.xml`. Read `references/metadata_api_approach.md` for details.
|
|
70
|
+
|
|
71
|
+
8. **Pre-deploy verification** — before deploying, confirm:
|
|
70
72
|
- [ ] External access is not more permissive than internal access
|
|
71
73
|
- [ ] Objects with Master-Detail relationships use `ControlledByParent`
|
|
72
74
|
- [ ] The requested access level is valid for the target object (see `references/access_levels.md`)
|
|
73
75
|
- [ ] Cross-object constraints are satisfied (see "Cross-Object Constraints" in `references/access_levels.md`)
|
|
76
|
+
- [ ] The target field is not listed as immutable/fixed in `references/access_levels.md`
|
|
77
|
+
|
|
78
|
+
9. **Deploy the updated settings:** `sf project deploy start --metadata CustomObject:<ObjectName> --target-org <org>`.
|
|
74
79
|
|
|
75
|
-
|
|
80
|
+
10. **Handle deploy failure (max 2 attempts):** If the deploy fails:
|
|
81
|
+
- Read the error message and identify the root cause.
|
|
82
|
+
- If the error indicates the value is invalid or unsupported for the object, **stop** — report the failure to the user with the exact error message and explain what is and isn't possible. Do not try alternative values unless the user explicitly requests a different valid value.
|
|
83
|
+
- If the error is transient (network timeout, auth expired), retry **once**.
|
|
84
|
+
- **Never attempt more than 2 total deploys for the same change.** After 2 failures, report the error, discard local edits (`sf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org>`), and ask the user how to proceed.
|
|
76
85
|
|
|
77
|
-
|
|
86
|
+
11. **Verify the change** by re-running the query from Phase 1, Step 1.
|
|
78
87
|
|
|
79
88
|
---
|
|
80
89
|
|
|
@@ -84,11 +93,13 @@ All steps are sequential. Do not skip or reorder.
|
|
|
84
93
|
|-----------|-----------|
|
|
85
94
|
| Objects with Master-Detail relationships must use `ControlledByParent` | Platform enforces this — attempting other values fails |
|
|
86
95
|
| External access cannot be more permissive than internal access | Salesforce rejects configurations where external > internal |
|
|
87
|
-
| Some
|
|
96
|
+
| Some objects have immutable/fixed OWD (e.g., Price Book external, User, Activity external) | These are platform-enforced — explain impossibility upfront, never attempt a deploy |
|
|
97
|
+
| Price Book only accepts `Use` (`ReadSelect`) or `No Access` (`None`) for internal OWD; external is always `None` | Standard access levels (Private/Read/ReadWrite) are invalid for Price Book |
|
|
88
98
|
| Changing OWD to more restrictive triggers sharing recalculation | This can take significant time on large orgs — warn the user |
|
|
89
99
|
| Custom objects default to `Public Read/Write` when created | Users may not realize the default is permissive |
|
|
90
100
|
| For managed package custom objects, use the full API name including namespace prefix (e.g., `ns__Object__c`) | Namespace-prefixed objects require the prefix in both queries and metadata retrieval |
|
|
91
101
|
| Always verify the org connection before querying | Prevents confusing error messages |
|
|
102
|
+
| Maximum 2 deploy attempts per change | Prevents unbounded retry loops — after 2 failures, stop and report to the user |
|
|
92
103
|
|
|
93
104
|
---
|
|
94
105
|
|
|
@@ -102,6 +113,7 @@ All steps are sequential. Do not skip or reorder.
|
|
|
102
113
|
| `ControlledByParent` not available | Object has no Master-Detail relationship — use Private, Public Read Only, or Public Read/Write |
|
|
103
114
|
| External access field not showing | External sharing model only appears when external org-wide defaults are enabled |
|
|
104
115
|
| Query returns no results | Object may not be customizable or API name may be incorrect — verify spelling |
|
|
116
|
+
| Deploy fails with invalid value for Price Book | Price Book only accepts `Use`/`None` (internal) and external is fixed at `None` — do not retry with other values, explain to user |
|
|
105
117
|
|
|
106
118
|
---
|
|
107
119
|
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
| Case | Private, Read, ReadWrite, ReadWriteTransfer | Transfer is unique to Case |
|
|
22
22
|
| Lead | Private, Read, ReadWrite, ReadWriteTransfer | Transfer is unique to Lead |
|
|
23
23
|
| Campaign | Private, Read, ReadWrite, FullAccess | FullAccess is unique to Campaign |
|
|
24
|
+
| Pricebook2 (Price Book) | Internal: ReadSelect (Use), Read (View Only), None (No Access) | **External is fixed at `None` — immutable, cannot be changed** |
|
|
24
25
|
| Custom Objects | Private, Read, ReadWrite, ControlledByParent | ControlledByParent requires Master-Detail field |
|
|
25
26
|
|
|
26
27
|
## Cross-Object Constraints
|
|
@@ -29,9 +30,21 @@
|
|
|
29
30
|
|-----------|--------|
|
|
30
31
|
| Account = Private cascades | Setting Account to Private forces Contact, Case, and Opportunity to Private — all four recalculate together |
|
|
31
32
|
| Contract tied to Account | Contract OWD cannot be set independently; it follows Account's OWD |
|
|
32
|
-
| Pricebook | Only accepts `Use` or `No Access` (`ReadSelect` / `None` in API) — standard access levels do not apply |
|
|
33
|
+
| Pricebook (internal) | Only accepts `Use`, `View Only`, or `No Access` (`ReadSelect` / `Read` / `None` in API) — standard access levels do not apply |
|
|
34
|
+
| Pricebook (external) | **Fixed at `None` (No Access) — immutable, cannot be changed via Metadata API, Tooling API, or Setup UI** |
|
|
33
35
|
| ControlledByParent cascade | If a child object uses ControlledByParent, changing the parent's OWD implicitly changes the child's effective access |
|
|
34
36
|
|
|
37
|
+
## Immutable / Fixed OWD Objects
|
|
38
|
+
|
|
39
|
+
Some objects have OWD values that are platform-fixed and **cannot be changed by any means** (Metadata API, Tooling API, or Setup UI). Attempting to deploy a change will always fail. If the user requests a change to one of these, **explain upfront that it is not possible** — do not attempt a deploy.
|
|
40
|
+
|
|
41
|
+
| Object | Field | Fixed Value | Notes |
|
|
42
|
+
|--------|-------|-------------|-------|
|
|
43
|
+
| Pricebook2 (Price Book) | External OWD | `None` (No Access) | Platform-enforced; only internal OWD (`Use`/`View Only`/`No Access`) is configurable |
|
|
44
|
+
| User | Internal & External | Read | Cannot be changed |
|
|
45
|
+
| Activity (Task/Event) | External | Private | Only internal OWD is configurable via "Activity" settings |
|
|
46
|
+
| Knowledge Article | External | Controlled by separate channel visibility | Not configurable as a standard OWD |
|
|
47
|
+
|
|
35
48
|
## Internal vs External Access
|
|
36
49
|
|
|
37
50
|
- **Internal access**: Applies to users within the org (internal users)
|