@salesforce/afv-skills 1.66.0 → 1.68.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 (165) hide show
  1. package/README.md +55 -5
  2. package/package.json +2 -4
  3. package/skills/agentforce-offline-experimentation-run/SKILL.md +26 -49
  4. package/skills/agentforce-offline-experimentation-run/scripts/bt_compare.py +81 -0
  5. package/skills/agentforce-offline-experimentation-run/scripts/bt_fetch.py +358 -0
  6. package/skills/agentforce-offline-experimentation-run/scripts/bt_patch_agent.py +110 -0
  7. package/skills/agentforce-offline-experimentation-run/scripts/btlib/__init__.py +34 -0
  8. package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentpatch.py +483 -0
  9. package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentsrc.py +565 -0
  10. package/skills/agentforce-offline-experimentation-run/scripts/btlib/cache.py +95 -0
  11. package/skills/agentforce-offline-experimentation-run/scripts/btlib/compare.py +617 -0
  12. package/skills/agentforce-offline-experimentation-run/scripts/btlib/fetch.py +1012 -0
  13. package/skills/agentforce-offline-experimentation-run/scripts/btlib/judge.py +148 -0
  14. package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +92 -0
  15. package/skills/agentforce-offline-experimentation-run/scripts/btlib/patch.py +327 -0
  16. package/skills/agentforce-offline-experimentation-run/scripts/btlib/redact.py +40 -0
  17. package/skills/agentforce-offline-experimentation-run/scripts/btlib/results.py +288 -0
  18. package/skills/agentforce-offline-experimentation-run/scripts/btlib/scoring.py +340 -0
  19. package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +238 -0
  20. package/skills/agentforce-offline-experimentation-run/scripts/btlib/splits.py +136 -0
  21. package/skills/agentforce-offline-experimentation-run/scripts/btlib/stdm.py +98 -0
  22. package/skills/agentforce-offline-experimentation-run/scripts/btlib/tokens.py +173 -0
  23. package/skills/agentforce-offline-experimentation-run/scripts/btlib/units.py +199 -0
  24. package/skills/agentforce-offline-experimentation-run/scripts/btlib/versions.py +194 -0
  25. package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +366 -378
  26. package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +14 -4
  27. package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +472 -796
  28. package/skills/commerce-react-storefront-create/SKILL.md +350 -0
  29. package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +2 -2
  30. package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +28 -16
  31. package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +18 -1
  32. package/skills/dx-lifecycle-center/SKILL.md +5 -2
  33. package/skills/dx-lifecycle-center/assets/widgets/connect-connected/connect-connected.json +65 -0
  34. package/skills/dx-lifecycle-center/assets/widgets/connect-connected/schema.json +32 -0
  35. package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/connect-sign-in.json +57 -0
  36. package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/schema.json +21 -0
  37. package/skills/dx-lifecycle-center/examples/workflows.md +20 -6
  38. package/skills/dx-lifecycle-center/references/connect-org.md +21 -2
  39. package/skills/dx-lifecycle-center/references/deploy.md +2 -2
  40. package/skills/dx-lifecycle-center/references/list-orgs.md +1 -1
  41. package/skills/dx-lifecycle-center/scripts/card-policy.jq +71 -0
  42. package/skills/dx-lifecycle-center/scripts/fill-widget.jq +29 -0
  43. package/skills/dx-lifecycle-center/scripts/widget.sh +28 -0
  44. package/skills/dx-org-devhub-configure/SKILL.md +85 -84
  45. package/skills/dx-org-devhub-configure/examples/status-output.md +25 -2
  46. package/skills/dx-org-devhub-configure/scripts/devhub.sh +265 -140
  47. package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +100 -15
  48. package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +89 -0
  49. package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +164 -0
  50. package/skills/dx-scratch-def-configure/SKILL.md +163 -0
  51. package/skills/dx-scratch-def-configure/examples/confirm-card.md +53 -0
  52. package/skills/dx-scratch-def-configure/examples/report-recipes.md +100 -0
  53. package/skills/dx-scratch-def-configure/references/features.json +3270 -0
  54. package/skills/dx-scratch-def-configure/references/project-scratch-def.schema.json +1841 -0
  55. package/skills/dx-scratch-def-configure/references/settings-map.json +682 -0
  56. package/skills/dx-scratch-def-configure/scripts/lib_scratch_def.py +1306 -0
  57. package/skills/dx-scratch-def-configure/scripts/requirements.txt +3 -0
  58. package/skills/dx-scratch-def-configure/scripts/scrape_config_values.py +848 -0
  59. package/skills/education-cloud-domain-configure/SKILL.md +22 -24
  60. package/skills/education-cloud-domain-configure/references/dependent-features.md +9 -0
  61. package/skills/education-cloud-domain-configure/references/domain-features.md +15 -0
  62. package/skills/education-cloud-domain-configure/references/gotchas-extended.md +8 -0
  63. package/skills/education-cloud-domain-configure/references/setup-widgets.md +123 -0
  64. package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -1
  65. package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +1 -1
  66. package/skills/experience-design-validate/SKILL.md +1 -1
  67. package/skills/experience-search-coordinate/SKILL.md +19 -13
  68. package/skills/experience-search-coordinate/references/content-route.md +79 -1
  69. package/skills/experience-search-coordinate/references/media-route.md +30 -4
  70. package/skills/experience-ui-bundle-features-generate/SKILL.md +1 -1
  71. package/skills/experience-ui-bundle-mfa-configure/SKILL.md +1 -1
  72. package/skills/field-service-data-capture-migrate/SKILL.md +1 -1
  73. package/skills/platform-apex-generate/SKILL.md +14 -11
  74. package/skills/platform-apex-test-generate/SKILL.md +2 -1
  75. package/skills/platform-datamask-run/SKILL.md +52 -71
  76. package/skills/platform-datamask-run/references/api-surface.md +10 -4
  77. package/skills/platform-datamask-run/references/policy-authoring.md +56 -7
  78. package/skills/platform-datamask-run/references/run-and-abort.md +17 -10
  79. package/skills/platform-datamask-run/scripts/poll-job.sh +15 -25
  80. package/skills/platform-dataspace-access-configure/SKILL.md +19 -1
  81. package/skills/platform-metadata-deploy/README.md +1 -1
  82. package/skills/platform-metadata-deploy/SKILL.md +114 -15
  83. package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +3 -4
  84. package/skills/platform-metadata-deploy/references/orchestration.md +2 -3
  85. package/skills/platform-metadata-discovery-get/SKILL.md +185 -0
  86. package/skills/platform-metadata-discovery-get/references/api-map.md +25 -0
  87. package/skills/platform-metadata-discovery-get/references/h360-routes.md +30 -0
  88. package/skills/platform-metadata-discovery-get/references/scoped-soql.md +52 -0
  89. package/skills/platform-metadata-grounding-get/SKILL.md +170 -0
  90. package/skills/platform-policy-rule-generate/SKILL.md +84 -232
  91. package/skills/platform-policy-rule-generate/references/condition-model.md +47 -0
  92. package/skills/platform-policy-rule-generate/references/condition-templates.md +89 -0
  93. package/skills/platform-policy-rule-generate/references/conjunction-compiler.md +25 -0
  94. package/skills/platform-policy-rule-generate/references/conjunction-expression.md +22 -0
  95. package/skills/platform-policy-rule-generate/references/consumer-all.md +9 -0
  96. package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +91 -0
  97. package/skills/platform-policy-rule-generate/references/deploy-errors.md +24 -36
  98. package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/package.xml +12 -0
  99. package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +6 -0
  100. package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitions/ExistsJoinRLS_Rule_1.policyRuleDefinition +91 -0
  101. package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/package.xml +12 -0
  102. package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +6 -0
  103. package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitions/FieldReadDeny_Rule_1.policyRuleDefinition +72 -0
  104. package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/package.xml +12 -0
  105. package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +6 -0
  106. package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitions/LastCharactersFieldMasking_Rule_1.policyRuleDefinition +77 -0
  107. package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/package.xml +12 -0
  108. package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +6 -0
  109. package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitions/PrincipalFieldMatchRLS_Rule_1.policyRuleDefinition +77 -0
  110. package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/package.xml +12 -0
  111. package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +4 -0
  112. package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitions/TaggedObjectAccess_Rule_1.policyRuleDefinition +65 -0
  113. package/skills/platform-policy-rule-generate/references/headless-transport.md +87 -0
  114. package/skills/platform-policy-rule-generate/references/policy-schema-full.md +17 -10
  115. package/skills/platform-policy-rule-generate/references/policy-shapes.md +74 -0
  116. package/skills/platform-policy-rule-generate/references/principal-expression.md +31 -0
  117. package/skills/platform-policy-rule-generate/references/reference-resolution.md +51 -0
  118. package/skills/platform-policy-rule-generate/references/resource-expression.md +48 -0
  119. package/skills/platform-policy-rule-generate/references/runtime-context.md +9 -0
  120. package/skills/platform-policy-rule-generate/references/templates-access.md +11 -9
  121. package/skills/platform-policy-rule-generate/references/templates-advanced.md +4 -2
  122. package/skills/platform-policy-rule-generate/references/templates-record.md +37 -22
  123. package/skills/platform-policy-rule-generate/references/templates-transform.md +10 -8
  124. package/skills/platform-policy-rule-generate/references/templates.md +2 -2
  125. package/skills/platform-policy-rule-generate/references/ui-compatibility.md +35 -17
  126. package/skills/platform-report-generate/SKILL.md +9 -4
  127. package/skills/platform-report-generate/references/chart-types.md +26 -2
  128. package/skills/platform-report-generate/references/column-names.md +43 -0
  129. package/skills/platform-report-generate/references/errors-and-troubleshooting.md +1 -1
  130. package/skills/platform-report-generate/references/verification-checklist.md +10 -2
  131. package/skills/platform-value-set-generate/SKILL.md +19 -19
  132. package/skills/platform-widget-generate/SKILL.md +25 -51
  133. package/skills/platform-widget-generate/examples/formulas.json +19 -2
  134. package/skills/platform-widget-generate/examples/localized-labels.json +57 -0
  135. package/skills/platform-widget-generate/references/widget-actions.md +29 -0
  136. package/skills/platform-widget-generate/references/widget-bundle-validation.md +1 -0
  137. package/skills/platform-widget-generate/references/widget-formulas.md +24 -7
  138. package/skills/platform-widget-generate/references/widget-gotchas.md +10 -0
  139. package/skills/platform-widget-generate/references/widget-labels.md +78 -0
  140. package/skills/platform-widget-generate/references/widget-styling.md +12 -0
  141. package/skills/sales-call-scoring-configure/SKILL.md +17 -10
  142. package/skills/sales-call-scoring-configure/scripts/enable-call-scoring.sh +55 -33
  143. package/skills/service-digital-engagement-channel-configure/SKILL.md +11 -7
  144. package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +33 -0
  145. package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +123 -16
  146. package/skills/service-digital-engagement-deployment-configure/SKILL.md +37 -100
  147. package/skills/service-digital-engagement-deployment-configure/assets/esd_web_update_template.xml +83 -8
  148. package/skills/service-digital-engagement-deployment-configure/examples/esd_web_prechat_fields.xml +74 -0
  149. package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +13 -3
  150. package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +13 -78
  151. package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +5 -6
  152. package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +245 -0
  153. package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +164 -120
  154. package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +61 -37
  155. package/skills/service-itsm-agentic-setup-incident-management/references/audit-tracking.md +42 -0
  156. package/skills/service-itsm-agentic-setup-incident-management/references/broadcast-communications.md +23 -0
  157. package/skills/service-itsm-agentic-setup-incident-management/references/email-to-incident.md +23 -0
  158. package/skills/service-itsm-agentic-setup-incident-management/references/incident-dashboards.md +25 -0
  159. package/skills/service-itsm-agentic-setup-incident-management/references/incident-persona-psg.md +30 -146
  160. package/skills/service-itsm-agentic-setup-incident-management/references/incident-preferences.md +32 -136
  161. package/skills/service-itsm-agentic-setup-incident-management/references/major-incident-management.md +32 -155
  162. package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +45 -0
  163. package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +32 -0
  164. package/skills/service-itsm-agentic-setup-incident-management/references/service-mgmt-privilege.md +30 -140
  165. package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +110 -0
@@ -1,162 +1,39 @@
1
- # Feature: Major Incident Management (inline execution)
2
-
3
- How the orchestrator executes the **Major Incident Management (MIM)** feature. MIM setup is **two surfaces**
4
- layered on top of base Incident Management: (1) the **major-incident approval group**, and (2) **two MIM org
5
- preferences**. This runs **inline** through the Salesforce-hosted
6
- **`headless-360`** MCP server (server key `headless-360`) via its four meta-tools (`discover`, `describe`,
7
- `dispatch_readonly`, `dispatch`). The org comes from the OAuth JWT on the MCP session — never handle an org
8
- id, alias, or credentials. Minimum API version **67.0**.
9
-
10
- ## Delegate every operation to the MIM Setup Operation Recipe
11
-
12
- The **Major Incident Management Setup Operation Recipe (SOR)** is the single source of truth for **how**
13
- each step is done — the route, method, request/response shape, field names, per-step `status`, and
14
- `depends_on` ordering. It is **actively evolving**, so **never hardcode a route or request body**. Carry
15
- only the **goal, scope, ordering, and invariants**, and at runtime:
16
-
17
- 1. `discover` the operation by intent (e.g. `"set major incident approval group"`, `"validate major
18
- incident approval group users"`, `"toggle major incident org preference"`).
19
- 2. `describe` the returned SOR / operation for its **current** route, method, argument schema, and `status`.
20
- 3. `dispatch_readonly` (reads) / `dispatch` (writes) the route the SOR names.
21
-
22
- **Use what `describe` returns — not any shape written here. If `describe` and this file disagree, `describe`
23
- wins.** A `discover` miss does not prove a route is absent — generic `/query` and `/sobjects/...` REST
24
- routes are not always ranked first; only a `404` from the dispatch itself means a route is unavailable.
25
- Read each step's `status` from `describe`: `implemented` = live; `proposed` = not served on every org yet.
26
-
27
- > **MIM is configured by the two surfaces below.** The only feature that must be *on* first is **base**
28
- > Incident Management (the master-feature steps of the `IncidentMgmt` SOR) — see Preconditions.
29
-
30
- ### Transports MIM uses (all via the same `dispatch*` tools)
31
-
32
- | Transport | Shape of the `url` | Used by |
33
- |-----------|--------------------|---------|
34
- | **Aura controller** | `/headless/invoke/platform/mim/<method>` | approval-group + org-preference + group-user-validation routes |
35
- | **sObject REST** | `/services/data/v67.0/sobjects/...` and `/services/data/v67.0/query` | license / public-group / member records used as **preconditions** |
36
-
37
- `dispatch` takes **raw HTTP** — a full `url`, `method`, and optional `body`/`queryParams`, not
38
- `{operation_id, arguments}`.
39
-
40
- ## Scope
41
-
42
- - **In scope**: designating / clearing / reassigning the **major-incident approval group** (a User or a
43
- public Group); **group-user validation**; reading and toggling the **two** MIM org preferences; and, as a
44
- precondition, licensing approvers with the **Major Incident Manager permission-set license** and standing
45
- up the approvers **public group**. Verify every write by read-back.
46
- - **Out of scope**: base Incident Management enablement
47
- (the `IncidentMgmt` SOR's master-feature steps — a prerequisite); the Incident Fulfiller / Incident Manager
48
- **persona** PSG (the orchestrator's **Persona** feature — see `references/incident-persona-psg.md`);
49
- Problem / Change / Case Management; the Priority Matrix; SLA / entitlement setup; any MIM org preference
50
- **other than** the two allowlisted.
51
-
52
- ## Preconditions
53
-
54
- The acting user needs **ITSM setup access** (the SOR gates every MIM route on it), and:
55
-
56
- 1. **Base Incident Management must be enabled** — MIM layers on it. The orchestrator first follows the
57
- `IncidentMgmt` SOR's read/confirm/enable/verify prerequisite; stop if it cannot confirm ENABLED.
58
- 2. **Approvers must hold the Major Incident Manager permission-set license.** This is a **LICENSE** —
59
- granted via `PermissionSetLicenseAssign` (`{AssigneeId, PermissionSetLicenseId}`), **never** a
60
- `PermissionSetAssignment`. Group-user validation requires every direct and transitive user of a group
61
- approver to hold it. If a designated user lacks it (or the approvers group does not exist yet), prepare
62
- that first — this is **precondition prep, not MIM activation**. A **Regular** public group; add each
63
- **licensed** user; **license before membership**.
64
-
65
- If a `dispatch*` returns `401` / `403` / `404`, do **not** fabricate state — surface the raw error and
66
- stop. `403` usually means the acting user lacks ITSM setup access.
67
-
68
- ## The two surfaces — SOR step map (targets for `describe`)
69
-
70
- Describe each before calling; the ids are stable handles, the shapes come from `describe`.
71
-
72
- ### Surface 1 — approval group
73
-
74
- | Step id | Transport | Purpose |
75
- |---------|-----------|---------|
76
- | `validate-group-users` | Aura `PATCH .../validate-group-users` | Returns **true** only if every direct + transitive `005…` member of the group holds the Major Incident Manager license — **call before designating a Group** |
77
- | `create-major-incident-approval-group` | Aura `PATCH .../create-major-incident-approval-group` | Designate the approver — a **User (005…)** or **public Group (00G…)** — stored as `SrvcMgmntApprovalAssignment` with `OperationType=MAJOR_INCIDENT_APPROVAL`. **Idempotent** (silent no-op if one exists) |
78
- | `verify-approval-group` | Aura `GET .../get-major-incident-approval-group` | Read the designated approver back; expect it to equal the Id you set (null when none) |
79
- | `remove-major-incident-approval-group` | Aura `DELETE .../remove-major-incident-approval-group` | Clear the designation — **run first to reassign** |
80
-
81
- For a **Group** approver, run **group-user validation first**: it must return **true**. If false, fix
82
- licensing / membership and re-validate; do not designate a group that fails. Designation is **idempotent** —
83
- a create when one already exists is a **silent no-op**, so a "success" does not prove your approver is the
84
- one set — **verify by read-back**, and **remove-first to reassign**.
85
-
86
- ### Surface 2 — org preferences
87
-
88
- | Step id | Transport | Purpose |
89
- |---------|-----------|---------|
90
- | `get-mim-setup-page-org-preference` | Aura `GET .../get-mimsetup-page-org-preference` | Read one MIM preference's current boolean value |
91
- | `toggle-mim-setup-page-org-preference` | Aura `PATCH .../toggle-mimsetup-page-org-preference` | Set one MIM preference on / off |
92
-
93
- **Preference allowlist — exactly two names:** **`AutoCreationOfProblem`** and **`AutoClosureChildIncidents`**.
94
- **Any other `prefName` raises a `ServiceException` without writing** — never pass a name outside this set.
95
- Require an explicit on/off direction from the user (do not infer it).
96
-
97
- ## Ordering (follow the SOR's `depends_on`)
98
-
99
- 1. **License before membership** — a user holds the Major Incident Manager license before being added to
100
- the approvers group.
101
- 2. **Validate before designating a group** — `validate-group-users` must return **true** before
102
- `create-major-incident-approval-group` with a Group.
103
- 3. **Remove before reassign** — `remove-major-incident-approval-group` before a second create.
104
-
105
- ## Workflow
106
-
107
- Always **read before you write**, **confirm before every write**, and **verify every write by read-back**.
108
-
109
- 1. **Preflight** — for each in-scope surface, `discover` and `describe` for the current route, schema, and
110
- `status`. On `401` / `403` / `404`, surface and stop.
111
- 2. **Prerequisites** — confirm base Incident Management is on (else hand off), and that the approver(s) hold
112
- the Major Incident Manager license (prepare it, and the public group, if needed).
113
- 3. **Read current state** — the current approval-group designation and each preference value.
114
- 4. **Confirm** — present the exact plan (org, approver, preference + direction) via `AskUserQuestion`;
115
- require an explicit yes. On no, stop with no writes.
116
- 5. **Apply** — validate-before-designate (for a group), remove-before-reassign; toggle only allowlisted
117
- preferences. Treat a duplicate / already-set as success.
118
- 6. **Verify** — re-read the designation and each preference; report only what read-back confirms.
119
-
120
- ## Clarifying questions
121
-
122
- Ask only what you cannot infer: **which surface** (approval group, preferences, or both); **who** the
123
- approver is (resolve to exactly one active User `005…` or a public Group `00G…`); **which preference and
124
- on/off**; and **which org** — state plainly this org will be **modified** (designation, license assignment
125
- which consumes a seat, group changes, preference writes). For production, get explicit confirmation.
126
-
127
- ## Output expectations
1
+ # Feature: Major Incident Management (delegated to the `MIM` SOR)
2
+
3
+ How the orchestrator runs the **Major Incident Management** feature: the major-incident approval group and
4
+ the two MIM preferences, on top of base Incident Management. The `MIM` SOR's own steps and guidance decide
5
+ *how* — the approver license, the approvers group, group validation, the designation, and the two valid
6
+ preference names; the orchestrator runs them itself under its **SOR hand-off protocol** and owns every
7
+ user-facing gate. This file adds what is specific to MIM.
8
+
9
+ 1. `discover` the SOR by intent (e.g. "set up the major incident management approval group") and
10
+ `describe` the id `discover` returns (`MIM`). Its IT Service Enablement and Incident Management gates
11
+ fall under protocol step 2.
12
+ 2. **MIM must already be active.** Run the SOR's probe (`get-mim-setup-page-org-preference`) first. If it
13
+ doesn't return a boolean, stop and say Salesforce provisions MIM — nothing here can turn it on.
14
+ 3. Ask only what's missing (`AskUserQuestion`): the approval group, the preferences, or both; which public
15
+ group approves (the `MajorIncidentApprovers` group or an existing public group the user names — if they
16
+ name a person, offer to put them in a public group); and, for a preference, which one and on or off
17
+ (never infer the direction).
18
+ 4. **Approval group.** Read the current designation (`verify-approval-group`). Query for the
19
+ `MajorIncidentApprovers` group (`verify-approvers-public-group`) and reuse it if it exists; create it
20
+ only when none does. License and add only the members who still need it. Then run `validate-group-users`
21
+ on that exact group — it changes nothing, so it needs no confirmation of its own — and designate only
22
+ when it returns true. If it returns false, say the group isn't valid yet (every member needs the Major
23
+ Incident Manager license, and the group can't be empty) and offer to license the members or pick another
24
+ group.
25
+ 5. Confirm the full plan before any write — the licenses to assign (each uses a seat), the group changes,
26
+ the designation or reassignment, and each preference with its direction — and that this org is modified
27
+ (explicit confirmation for production). Read every write back through its verify step.
28
+ 6. Report with the block below, only what read-back confirmed, omitting the parts the user didn't choose.
29
+ In plain language: no Major Incident Manager license on the org means it lacks the MIM add-on; a full
30
+ license means a seat must free up first; a `403` means an admin with ITSM setup access must do it.
128
31
 
129
32
  ```text
130
33
  Major Incident Management
131
34
 
132
35
  Approvers licensed (N) ............ Licensed N | M already held
133
- Approval group designated ......... <user/group> | Already designated | Reassigned
36
+ Approvers group ................... Created | Reused · N members added
37
+ Approval group designated ......... <group> | Already designated | Reassigned
134
38
  Preferences ....................... Auto-create problem: on/off · Auto-close child incidents: on/off
135
39
  ```
136
-
137
- Report only what read-back confirmed; omit lines for surfaces out of the requested scope. If base Incident
138
- Management cannot be confirmed on, say so and stop without configuring MIM.
139
-
140
- ## Common failures (surface in plain language)
141
-
142
- | Symptom | Likely cause | What to tell the user |
143
- |---------|--------------|-----------------------|
144
- | Group validation returns false | A direct / nested member lacks the Major Incident Manager license | License every member first, then re-validate before designating the group |
145
- | Approval group "designated" but unchanged | A designation already existed — it is idempotent | To change the approver, the old designation is removed first, then the new one set |
146
- | Preference change rejected (`ServiceException`) | A preference name outside the allowlist was sent | Only auto-create problem and auto-close child incidents are configurable here |
147
- | Seat / limit error on the license | No free Major Incident Manager seats | A seat must free up (or more licenses added) before that user can be an approver |
148
- | `400 DUPLICATE_VALUE` on a license / group / member write | The record already exists | Idempotent success — report as already-done |
149
- | `403` on a MIM route | Acting user lacks ITSM setup access | An admin with ITSM setup access must perform this |
150
- | `dispatch*` auth error | headless-360 session not authenticated / expired | Re-authenticate the connection and confirm it points at the intended org |
151
-
152
- ## Dead ends — do NOT do these
153
-
154
- - Hardcode any route / body — `describe` at runtime; the SOR is evolving.
155
- - Grant the Major Incident Manager license with a `PermissionSetAssignment` — it is a **license**
156
- (`PermissionSetLicenseAssign`).
157
- - Add a user to the approvers group before licensing them.
158
- - Designate a **group** approver without `validate-group-users` returning **true** first.
159
- - Reassign without removing the existing designation first (create is a silent no-op).
160
- - Send any preference name other than `AutoCreationOfProblem` / `AutoClosureChildIncidents`.
161
- - Attempt MIM setup when base Incident Management is off — first complete the `IncidentMgmt` master-feature prerequisite.
162
- - Pass `dispatch` the `{operation_id, arguments}` shape — it takes raw HTTP.
@@ -0,0 +1,45 @@
1
+ # Feature: Manage Incidents with AI (delegated to the `service-itsm-manage-incidents-with-ai-configure` SOR)
2
+
3
+ How the orchestrator runs the **Manage Incidents with AI** feature: the three switches in the *Manage
4
+ Incidents with AI* section of Salesforce Go's IT Service Incident Management page — *Automatically Triage
5
+ Incidents*, *Let Einstein Assign Incidents* and *Report Incidents from Chat or Voice Using AI*. The SOR's own
6
+ steps and guidance decide *how*; the orchestrator runs them itself under its **SOR hand-off protocol** and
7
+ owns every user-facing gate. This file adds what is specific to this feature.
8
+
9
+ 1. `discover` the SOR by intent (e.g. "manage incidents with AI") and `describe` the id `discover` returns.
10
+ Its own prerequisite checks fall under protocol step 2.
11
+ 2. If the request already says what to change, follow the SOR's rule: setting up the whole section turns
12
+ on all three switches, and a request about one switch changes only that one and leaves the other two as
13
+ they are. Otherwise read all three, show them with the block below, and ask which to change and in which
14
+ direction (`AskUserQuestion`) — never infer the direction from the current state. Read each switch before
15
+ changing it, and skip any already in the requested state.
16
+ 3. Confirm the exact change, write each chosen switch and read each back; mark the feature `Done` only
17
+ when every read-back matches.
18
+ 4. If triage or Einstein assignment can't be read or changed, the org lacks that switch's license (*IT
19
+ Services: Agentforce Features for Employees* for triage, *IT Services: Einstein Features* for Einstein
20
+ assignment): say so, skip it, and carry on with the others.
21
+ 5. When turning on the chat and voice switch, ask whether the org already captures transcripts (an active
22
+ messaging channel for chat, call transcription for voice); set one up only if the user asks, through the
23
+ SOR's channel hand-offs. Offer the SOR's smoke test only after that switch reads on — it drafts from one
24
+ conversation the user names and creates nothing.
25
+ 6. Triage and Einstein assignment are the same org preferences as the *Automatically Triage Incidents* and
26
+ *Assign Incidents with Einstein* toggles of **Incident Preferences**, so a switch set in either feature
27
+ reads as already set in the other.
28
+
29
+ ```text
30
+ Automatically Triage Incidents ................. On | Off
31
+ Let Einstein Assign Incidents .................. On | Off
32
+ Report Incidents from Chat or Voice Using AI ... On | Off
33
+
34
+ Changed: <label> Off → On (SUCCEEDED | ALREADY-ON | FAILED)
35
+ ```
36
+
37
+ ## Rules
38
+
39
+ - ALWAYS change only the switches the user chose, confirm before the write, and verify by read-back before
40
+ marking it `Done` (or verify the already-set state by live read with no write)
41
+
42
+ ## Before marking it `Done`
43
+
44
+ - [ ] Only the chosen switches changed; any write was confirmed before it ran and verified by read-back,
45
+ and a no-write `Done` came from a live read
@@ -0,0 +1,32 @@
1
+ # Feature: Priority Matrix (delegated to the `IncidentPriorityMatrix` SOR)
2
+
3
+ How the orchestrator runs the **Priority Matrix** feature, which maps each Impact × Urgency combination on
4
+ Incident to a Priority. The `IncidentPriorityMatrix` SOR's own steps and guidance decide *how*; the
5
+ orchestrator runs them itself under its **SOR hand-off protocol** and owns every user-facing gate. This file
6
+ adds what is specific to the Priority Matrix.
7
+
8
+ 1. `discover` the SOR by intent (e.g. "incident priority matrix impact urgency") and `describe` the id
9
+ `discover` returns (`IncidentPriorityMatrix`). Its own prerequisite checks fall under protocol step 2.
10
+ 2. Read first: the org's **active** Incident `Priority` values (`describe-incident-priority-picklist` —
11
+ never hardcode or invent them), the current rows (`fetch-priority-matrix`), both preferences
12
+ (`read-priority-matrix-prefs`, one call each: `IncPriorityMatrixEnabled`, the *Turn on Automatic
13
+ Priority Assignment for IT Service* toggle, and `IncPriorityOverrideEnabled`, the *Set priority
14
+ manually* checkbox), and the default priority (`get-default-priority`).
15
+ 3. Ask only for what's missing: which cells change, the default priority, and whether manual override
16
+ changes. Offer only active values, and flag a saved row whose Priority is no longer active rather than
17
+ dropping it. If the matrix is off, include turning it on in the plan — with it off, Incidents don't get
18
+ a priority from the matrix.
19
+ 4. **The save is a full replacement**: `save-priority-matrix` deletes every row it isn't sent. Build the
20
+ complete set from the fetched rows, change only the cells the user asked to change, and keep the
21
+ override as read unless asked. Show which cells are added, changed, or removed, the resulting default,
22
+ and the override state, and get an explicit yes. Re-run `describe-incident-priority-picklist` right
23
+ before the save and send only its active values. A change to only the matrix toggle or only the
24
+ override uses `update-priority-matrix-enablement` instead, one preference per call, confirmed the same
25
+ way.
26
+ 5. Read back with `verify-priority-matrix` (rows), `verify-default-priority`, and `verify-manual-override`
27
+ (or `verify-priority-matrix-enablement` after a toggle-only change). Mark it `Done` only when every part
28
+ matches.
29
+ 6. Only after a real write landed this run — never on a view or a no-op — mark the Salesforce Go *Define
30
+ Priority Matrix* step complete (`mark-priority-matrix-step-complete`, then
31
+ `verify-priority-matrix-step-complete`). A `404` there doesn't fail the feature: tell the user to tick
32
+ that step manually on the Salesforce Go page.
@@ -1,120 +1,31 @@
1
- # Feature: Service Management Privilege (inline execution)
2
-
3
- How the orchestrator executes the **Service Management Privilege** feature — ITSM **privilege escalation**
4
- setup: the org-wide **escalation level**, the **Service Management Privilege** definitions (each with a
5
- name, description, tag, access level, and function type), and **bulk employee ↔ privilege assignments**, all
6
- behind the **Enable Privilege Assignment** master toggle. This runs **inline** through the Salesforce-hosted
7
- **`headless-360`** MCP server (server key `headless-360`) via its four meta-tools (`discover`, `describe`,
8
- `dispatch_readonly`, `dispatch`). The org comes from the OAuth JWT on the MCP session — never handle an org
9
- id, alias, or credentials. Minimum API version **67.0**.
10
-
11
- ## Delegate every operation to the Setup Operation Recipe
12
-
13
- The **Service Management Privilege Setup Operation Recipe (SOR)** is the single source of truth for **how**
14
- each step is done — the route, method, request/response shape, field names, per-step `status`, and
15
- `depends_on`. It is **draft and actively evolving**, so **never hardcode a route or request body**. Carry
16
- only the **goal, scope, ordering, and invariants**, and at runtime:
17
-
18
- 1. `discover` the operation by intent (e.g. `"enable privilege assignment toggle"`, `"set ITSM escalation
19
- level"`, `"create a service management privilege"`, `"assign employees to a service privilege"`).
20
- 2. `describe` the returned SOR / operation for its **current** route, method, argument schema, and `status`.
21
- 3. `dispatch_readonly` (reads) / `dispatch` (writes) the route the SOR names.
22
-
23
- **Use what `describe` returns — not any shape written here. If `describe` and this file disagree, `describe`
24
- wins.** Read each step's `status` from `describe`: `implemented` = live; `proposed` = not served on every org
25
- yet. **There is no public Connect / Tooling / Metadata / sObject substitute for this feature** — the setup
26
- controller is the only surface. So if `discover`/`describe` does not surface a step or a `dispatch` returns
27
- `404`, the surface is **not available on this org yet** — surface that plainly and stop; **never fabricate a
28
- fallback route.**
29
-
30
- ## The four surfaces — SOR step map (targets for `describe`)
31
-
32
- Describe each before calling; the step ids are stable handles, the shapes come from `describe`.
33
-
34
- ### Surface 1 — the Enable Privilege Assignment master toggle (`implemented`)
35
-
36
- Backed by the generic **SetupMetadata** org-preference batch operations (not the privilege controller),
37
- keyed on the org preference **`PrivilegeAssignmentEnabled`**.
38
-
39
- | Step id | Purpose |
40
- |---------|---------|
41
- | `check-privilege-assignment-enabled` | Read whether `PrivilegeAssignmentEnabled` is on |
42
- | `set-privilege-assignment-enabled` | Turn the feature on / off — **reversible** |
43
- | `verify-set-privilege-assignment-enabled` | Read `PrivilegeAssignmentEnabled` back to confirm the write |
44
-
45
- ### Surface 2 — escalation level
46
-
47
- | Step id | Purpose |
48
- |---------|---------|
49
- | `fetch-escalation-level` | Read the org-wide ITSM escalation level |
50
- | `save-escalation-level` | Set the escalation level (`escalationLevel`) |
51
- | `verify-save-escalation-level` | Read the level back to confirm |
52
-
53
- ### Surface 3 — Service Management Privilege definitions
54
-
55
- | Step id | Purpose |
56
- |---------|---------|
57
- | `get-service-privileges` | List every privilege (id, name, description, tag, access level, function type) — **drives verify** |
58
- | `create-service-privilege` | Add a privilege from a field map |
59
- | `update-service-privilege` | Edit a privilege (field map keyed by its id) |
60
- | `delete-service-privilege` | Remove a privilege by id — **destructive, no rollback** |
61
-
62
- ### Surface 4 — employee assignments
63
-
64
- | Step id | Purpose |
65
- |---------|---------|
66
- | `save-privilege-assignments` | Bulk add / remove employees for one privilege (add-list + remove-list, both in one call) — **no read-back** |
67
-
68
- ## Scope
69
-
70
- - **In scope**: read / set the **Enable Privilege Assignment** master toggle; read / set the org-wide
71
- **escalation level**; list / create / update / delete **Service Management Privilege** definitions; bulk
72
- **add / remove employee assignments** for a privilege; verify by read-back where one exists.
73
- - **Out of scope**: base Incident Management enablement (the `IncidentMgmt` SOR's master-feature steps); the
74
- Incident Fulfiller / Incident Manager **persona** PSG (the orchestrator's **Persona** feature); the Major
75
- Incident Manager approver licensing (the **Major Incident Management** feature); Problem / Change / Case
76
- Management; the Priority Matrix; SLA setup.
77
-
78
- ## Preconditions
79
-
80
- - **ITSM setup access** — the SOR gates every route on it (`IncidentMgmt.userHasITSMSetupAccess`). A `403`
81
- means the acting user lacks it; an admin with ITSM setup access must perform this.
82
- - **The Enable Privilege Assignment master toggle is the UI entry gate**, not a server precondition. The
83
- privilege controller does **not** re-check it, so turning it on is **workflow ordering** — enable it first
84
- so the escalation and privilege-management surfaces are coherent, but it does not hard-block the other
85
- writes. It is **reversible** (it can be turned back off — unlike the one-way incident preferences).
86
-
87
- ## Ordering (follow the SOR's `depends_on`)
88
-
89
- 1. **Toggle first** — if `PrivilegeAssignmentEnabled` is off and the user wants to configure the feature,
90
- enable it before touching escalation level or privileges (workflow ordering, not a hard gate).
91
- 2. **Read before every write** — the current toggle state, escalation level, or privilege list.
92
- 3. **Verify definition writes** — re-read via `get-service-privileges` after each create / update / delete.
93
- 4. **Assignments have no read-back** — you cannot confirm them by re-read; report them as **applied**, never
94
- as verified.
95
-
96
- ## Workflow
97
-
98
- Always **read before you write**, **confirm before every write**, and **verify every write by read-back**
99
- where a read-back exists.
100
-
101
- 1. **Preflight** — for each in-scope surface, `discover` and `describe` for the current route, schema, and
102
- `status`. On `401` / `403` / `404`, surface and stop.
103
- 2. **Read current state** — the toggle, the escalation level, and/or the current privileges.
104
- 3. **Confirm** — present the exact plan (org, toggle direction, escalation value, privilege change, or the
105
- employees to add/remove) via `AskUserQuestion`; require an explicit yes. On no, stop with no writes.
106
- 4. **Apply** — toggle first if needed; then the requested write. Treat a duplicate / already-set as success.
107
- 5. **Verify** — re-read the toggle, the escalation level, and the privilege list; for assignments, state
108
- plainly they were applied but cannot be read back.
109
-
110
- ## Clarifying questions
111
-
112
- Ask only what you cannot infer: **which surface** (master toggle, escalation level, privilege definitions,
113
- or employee assignments); for a **privilege**, its fields (name, description, tag, access level, function
114
- type); for **assignments**, the target privilege and exactly which employees to add / remove; and **which
115
- org** — state plainly this org will be **modified**. For production, get explicit confirmation.
116
-
117
- ## Output expectations
1
+ # Feature: Service Management Privilege (delegated to the `ServiceMgmtPrivilegeSetup` SOR)
2
+
3
+ How the orchestrator runs the **Service Management Privilege** feature — ITSM privilege escalation: the
4
+ *Enable Privilege Assignment* toggle, the org-wide escalation level, the privilege definitions, and bulk
5
+ employee assignments. The `ServiceMgmtPrivilegeSetup` SOR's own steps and guidance decide *how* — the
6
+ toggle's place in the order, the privilege fields, Tag-first handling, and which writes can be read back;
7
+ the orchestrator runs them itself under its **SOR hand-off protocol** and owns every user-facing gate. This
8
+ file adds what is specific to this feature.
9
+
10
+ 1. `discover` the SOR by intent (e.g. "set up ITSM service management privilege escalation") and `describe`
11
+ the id `discover` returns (`ServiceMgmtPrivilegeSetup`). Its IT Service Enablement check falls under
12
+ protocol step 2. No other public API covers this feature: a `404` or a `discover` miss means it isn't
13
+ served on this org — say so and stop; never look for another route.
14
+ 2. Ask which part the user wants (`AskUserQuestion`): the escalation level, the privileges, or employee
15
+ assignments. Read the toggle (`check-privilege-assignment-enabled`) first. If it reads off, turn it on —
16
+ it's reversible — with the user's yes, before any escalation-level or privilege step, as the SOR orders
17
+ it; if they decline, stop.
18
+ 3. For a new privilege, ask its tag, access level, and description (the SOR sets the rest). If the tag isn't
19
+ on the Tag field yet (the SOR's `new-tag-needed` choice), the user adds it in Object Manager after their
20
+ explicit OK — never dispatch `add-privilege-tag-value`. For assignments, ask the privilege and exactly
21
+ which employees to add or remove.
22
+ 4. Confirm the full plan before any write — the toggle, the escalation value, each privilege change, and the
23
+ employees to add and remove — and that this org is modified (explicit confirmation for production). A
24
+ privilege delete is **irreversible**: confirm it on its own, and never delete to test.
25
+ 5. Read every write back: the toggle and the escalation level through their verify steps, and each
26
+ privilege create, update, or delete by re-listing the privileges (`get-service-privileges`). Employee
27
+ assignments have no read-back: report them as applied, never as verified. A `403` means an admin with
28
+ ITSM setup access (and, from API 68.0, Customize Application) must make the change.
118
29
 
119
30
  ```text
120
31
  Service Management Privilege
@@ -124,26 +35,5 @@ Service Management Privilege
124
35
  Employee assignments .............. Applied: +N / -M (not read-back verifiable)
125
36
  ```
126
37
 
127
- Report only what read-back confirmed; for assignments, report them as applied and say they cannot be
128
- verified by re-read. Omit lines for surfaces out of the requested scope.
129
-
130
- ## Common failures (surface in plain language)
131
-
132
- | Symptom | Likely cause | What to tell the user |
133
- |---------|--------------|-----------------------|
134
- | `403` on any route | Acting user lacks ITSM setup access | An admin with ITSM setup access must perform this |
135
- | `404` / step not discoverable | The surface is `proposed`, not served on this org yet | This feature isn't available on this org yet — there is no alternative API path |
136
- | Delete rejected or unexpected | Wrong privilege id, or it no longer exists | Re-list privileges and confirm the exact one to remove |
137
- | Assignment "done" but can't confirm | Assignments have no read-back | The change was applied; it cannot be confirmed by re-reading — check in Setup if needed |
138
- | `dispatch*` auth error | headless-360 session not authenticated / expired | Re-authenticate the connection and confirm it points at the intended org |
139
-
140
- ## Dead ends — do NOT do these
141
-
142
- - Hardcode any route / body — `discover` + `describe` at runtime; the SOR is draft and evolving.
143
- - Fabricate a Connect / Tooling / Metadata / sObject fallback — **none exists**; a `404` means the surface
144
- isn't served on this org yet, so surface and stop.
145
- - Delete a Service Management Privilege to test, or without an explicit confirmation — it is **irreversible**.
146
- - Claim an employee assignment is **verified** — `save-privilege-assignments` has **no read-back**.
147
- - Treat the Enable Privilege Assignment toggle as a hard server gate — it is the UI entry gate (reversible)
148
- and the controller does not re-check it; enabling it is workflow ordering.
149
- - Pass `dispatch` the `{operation_id, arguments}` shape — it takes raw HTTP.
38
+ Report only what read-back confirmed, and omit the lines the user didn't choose. The persona PSGs, the
39
+ Major Incident Manager license, and Problem / Change Management are outside this feature.
@@ -0,0 +1,110 @@
1
+ # Feature: SLA & Milestones (delegated to the `SLASettings` and `sla-management-setup` SORs)
2
+
3
+ How the orchestrator runs the **SLA & Milestones** feature: completing the **SLA Management for IT Service**
4
+ setup item, then giving Incidents an SLA — Salesforce's **predefined** *Standard Support for Incidents*
5
+ policy, or a **custom** Incident policy with its milestones, optional milestone actions (warn / escalate),
6
+ and the activation that provisions its Entitlement. `SLASettings` owns the gate and the predefined seed;
7
+ `sla-management-setup` and the write leaves its steps delegate to own the custom policy. Their own steps and
8
+ guidance decide *how* — the bodies, the order, and the read-backs; the orchestrator runs them itself under
9
+ its **SOR hand-off protocol** and owns every user-facing gate. This file adds what is specific to Incident
10
+ SLAs.
11
+
12
+ > **Casing override — load-bearing.** `SLASettings` lists the seed values and the existence-map keys as
13
+ > `Incident` / `Problem` / `ChangeRequest`. The server uses **lowercase**: the map comes back keyed
14
+ > `incident` / `problem` / `changeRequest`, and the seed must send `{"selectedOptions": ["incident"]}` —
15
+ > the capitalized `Incident` fails with a server error. This is the one place this file overrides
16
+ > `describe`.
17
+
18
+ 1. `discover` the SORs by intent (e.g. "turn on SLA management and SLA versioning, predefined incident SLA
19
+ policy"; "create an incident SLA policy with milestones") and `describe` the ids `discover` returns
20
+ (`SLASettings`, `sla-management-setup`, and each leaf a step delegates to). Their IT Service Enablement
21
+ checks fall under protocol step 2. Incident only: never seed or build a Case, Problem, or Change Request
22
+ policy.
23
+ 2. **The gate.** *SLA Management for IT Service* is set up only when both `get-sla-management-permission`
24
+ and `get-sla-versioning-permission` read `true` — then it passes with no question. Otherwise ask once
25
+ (`AskUserQuestion`): completing it turns on **SLA Management** (it can be turned off again later) and, as
26
+ a separate step, **SLA Versioning**, which **can't be turned off once enabled** — turning SLA Management
27
+ off later won't turn Versioning off. Options: **Enable** / **Stop — make no changes**. There is no
28
+ "without Versioning" option, and a bare or repeated "enable SLA" is not consent to the permanent switch.
29
+ On Enable, set only the switches that read `false` — SLA Management first, then Versioning — and require
30
+ each verify step to read `true` before the next write. *"Entitlements permission not enabled…"* means
31
+ Entitlement Management is off: point the user to **Setup → Entitlement Settings** and stop. Stop on
32
+ Stop, a failed write, or a re-read that isn't `true`; an SLA Management enable that already landed may
33
+ stand — say what is on.
34
+ 3. **Detect the predefined policy** (`get-existing-checkbox-states`). `incident: true` means *Standard
35
+ Support for Incidents* already exists: say so, **never re-seed** (the seed isn't idempotent — a second
36
+ run duplicates every artifact), and stop unless the user explicitly asks for a custom policy. Don't
37
+ upsell one.
38
+ 4. **Read what the choice needs** — from `IncidentPriorityMatrix`, only these two reads: the active Incident
39
+ `Priority` values (`describe-incident-priority-picklist`) and the matrix flag
40
+ (`read-priority-matrix-prefs`, `IncPriorityMatrixEnabled`). With the matrix off, every Incident gets the
41
+ default priority, so only that tier's milestones fire: warn plainly and point to the **Priority Matrix**
42
+ feature. A warning, never a gate — never turn the matrix on from here.
43
+ 5. **Predefined or custom.** Ask (`AskUserQuestion`): **Predefined — *Standard Support for Incidents*
44
+ (Recommended)** or **Custom**. The seed builds an **active** policy and its Entitlement in one step, with
45
+ no un-seed (a manual delete only): two milestone types (*Acknowledge Within*, *Resolve Within*) and six
46
+ milestones (Critical 30 / 120 min, High 60 / 240, Moderate or Low 240 / 960). Recommend Custom instead
47
+ when the org has active `Priority` values beyond those four (they'd get no milestone), or the user wants
48
+ specific Business Hours (the seed takes none) or milestone actions — this feature never edits an existing
49
+ policy. **Predefined:** confirm, run `save-selected-options` with the lowercase `incident`, then
50
+ `verify-save-selected-options` (expect `incident: true`), and stop.
51
+ 6. **Custom — plan.** The policy type is Incident (never ask), and there is no Account — an Incident engages
52
+ its SLA through its Entitlement. Skip the SOR's update, delete, and version steps: editing or versioning
53
+ an existing policy is outside this feature.
54
+ - **Name and hours.** The default name is *Incident SLA Policy*; if `get-sla-policies` shows it taken,
55
+ ask for another. No hours named → leave Business Hours empty (24×7), as `create-sla-policy` says.
56
+ Named hours → resolve them as that leaf's Business Hours input describes; if no active record
57
+ matches, offer 24×7 or stop so the user can create them in **Setup → Business Hours** — this feature
58
+ never creates them.
59
+ - **Milestones.** Skip the question when the request already gives a concrete shape ("60-minute first
60
+ response", "per-priority tiers"); otherwise ask (`AskUserQuestion`):
61
+
62
+ | # | Option | Milestones (minutes) |
63
+ |---|--------|----------------------|
64
+ | 1 | Single | *Incident First Response* 60 |
65
+ | 2 | Response + Resolution | *Incident First Response* 30, *Incident Resolution* 480 |
66
+ | 3 | Priority-tiered | Critical 15, High 60, Moderate 240, Low 1440 — one per active `Priority` value, all *Incident First Response* |
67
+ | 4 | Escalation ladder | *Incident First Response* 30, *Incident Manager Escalation* 120, *Incident Executive Escalation* 480 (concurrent timers) |
68
+ | 5 | Custom | Per milestone: its name, minutes, and condition |
69
+
70
+ Every milestone's criteria start from `Incident.Status` not equal to `Closed`, ANDed with its own
71
+ condition. For options 3 and 5, reconcile with the live `Priority` values both ways: rename a renamed
72
+ tier, drop an inactive one, and add a milestone for an extra active one (confirm its minutes).
73
+ - **Milestone actions, only if asked.** The default is a Field Update on Incident — `Urgency` to `High`
74
+ at the warning and `Impact` to `High` at the breach — never `Priority`, which the Priority Matrix
75
+ derives from Impact × Urgency. "Warn at X%" is an offset of round(target × (1 − X/100)) before the
76
+ target (120 min at 75% → 30); "escalate on breach" is a Violation at 0. Apply the checkpoints to every
77
+ milestone the user named, and give each action a unique name per milestone (suffix `_FR`, `_RES`, …).
78
+ - **Confirm the plan** before the first write: the policy name, the Business Hours by name (or 24×7),
79
+ the **full** milestone list (never "N milestones"), every action, the matrix-off note if it applies,
80
+ and that the policy engages per Incident through its Entitlement.
81
+ 7. **Custom — build** in `sla-management-setup`'s order, through its steps and the leaves they delegate to:
82
+ the milestone types, the policy, each milestone, the actions (each confirmed as the
83
+ `create-milestone-action` leaf describes, including its `verify-milestone-action` read-back), then
84
+ activation.
85
+ - Check Entitlement Management once, with `sla-management-setup`'s `check-entitlements-enabled`, and
86
+ follow that step if it reads `false` — never a leaf's own check (some turn it on unasked).
87
+ - **Halt on the first failed milestone** — nothing after it is created; say which one failed.
88
+ - **Org-wide auto-apply** (`create-entitlement-criteria`) runs only on an explicit request that every
89
+ Incident match, after a warning that it collides with any existing broad Incident policy. Otherwise
90
+ say the policy engages per Incident and no criterion was created.
91
+ - **Another active Incident policy** stays untouched — never offer to deactivate, reorder, broaden, or
92
+ rank it. Narrate: "your existing *<name>* policy stays active; this custom policy is applied per
93
+ Incident by setting the Incident's Entitlement to it."
94
+
95
+ ```text
96
+ SLA & Milestones
97
+ SLA Management for IT Service ... On | Turned on now
98
+ SLA Versioning .................. On | Turned on now (permanent)
99
+ Policy .......................... Standard Support for Incidents (predefined — seeded now | already present)
100
+ | <name> (custom — created)
101
+ Business Hours .................. <name> | 24×7
102
+ Milestones ...................... <type name> — <minutes> min — <criteria> (one line each)
103
+ Entitlement ..................... Provisioned on activation (no Account)
104
+ Actions ......................... <tier or type> — <Warning | Violation> — <offset> (one line each)
105
+ Scope ........................... Incident SLA only
106
+ ```
107
+
108
+ Report only what read-back confirmed, name every artifact (never a record Id, even masked), and omit the
109
+ lines that don't apply. Case SLAs, Problem and Change Request policies, editing an existing policy,
110
+ assignment and escalation rules, and SLA reporting are outside this feature.