codeassembly-agent-logic 0.0.0 → 0.1.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/.meta/changelog.json +77 -0
- package/CHANGELOG.md +28 -0
- package/LICENSE +7 -0
- package/README.md +86 -1
- package/bin/agent-logic.js +26 -0
- package/dist/esm/cli/check-coverage-command.d.ts +3 -0
- package/dist/esm/cli/check-coverage-command.js +99 -0
- package/dist/esm/cli/convert-command.d.ts +3 -0
- package/dist/esm/cli/convert-command.js +116 -0
- package/dist/esm/cli/find-package-root.d.ts +7 -0
- package/dist/esm/cli/find-package-root.js +31 -0
- package/dist/esm/cli/index.d.ts +1 -0
- package/dist/esm/cli/index.js +11 -0
- package/dist/esm/cli/run.d.ts +8 -0
- package/dist/esm/cli/run.js +62 -0
- package/dist/esm/contract/built-in-harnesses.d.ts +22 -0
- package/dist/esm/contract/built-in-harnesses.js +30 -0
- package/dist/esm/contract/conversion-job.d.ts +36 -0
- package/dist/esm/contract/conversion-job.js +17 -0
- package/dist/esm/contract/index.d.ts +4 -0
- package/dist/esm/contract/index.js +3 -0
- package/dist/esm/contract/viewer-contract.d.ts +804 -0
- package/dist/esm/contract/viewer-contract.js +38 -0
- package/dist/esm/convert/convert-prompt.d.ts +21 -0
- package/dist/esm/convert/convert-prompt.js +60 -0
- package/dist/esm/convert/draft-schema.d.ts +308 -0
- package/dist/esm/convert/draft-schema.js +57 -0
- package/dist/esm/convert/find-gate-spans.d.ts +6 -0
- package/dist/esm/convert/find-gate-spans.js +18 -0
- package/dist/esm/convert/format-state-name.d.ts +6 -0
- package/dist/esm/convert/format-state-name.js +6 -0
- package/dist/esm/convert/normalize-config.d.ts +11 -0
- package/dist/esm/convert/normalize-config.js +164 -0
- package/dist/esm/convert/resolve-quotes.d.ts +18 -0
- package/dist/esm/convert/resolve-quotes.js +169 -0
- package/dist/esm/convert/sanitize-name.d.ts +5 -0
- package/dist/esm/convert/sanitize-name.js +8 -0
- package/dist/esm/coverage-map/check-coverage.d.ts +20 -0
- package/dist/esm/coverage-map/check-coverage.js +21 -0
- package/dist/esm/coverage-map/coverage-map-schema.d.ts +11 -0
- package/dist/esm/coverage-map/coverage-map-schema.js +2 -0
- package/dist/esm/coverage-map/find-prompt-blocks.d.ts +15 -0
- package/dist/esm/coverage-map/find-prompt-blocks.js +140 -0
- package/dist/esm/examples/change-approval.d.ts +2 -0
- package/dist/esm/examples/change-approval.js +438 -0
- package/dist/esm/examples/examples.d.ts +9 -0
- package/dist/esm/examples/examples.js +8 -0
- package/dist/esm/examples/password-reset.d.ts +2 -0
- package/dist/esm/examples/password-reset.js +235 -0
- package/dist/esm/examples/refund-request.d.ts +2 -0
- package/dist/esm/examples/refund-request.js +233 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/layout/build-elk-graph.d.ts +18 -0
- package/dist/esm/layout/build-elk-graph.js +96 -0
- package/dist/esm/layout/card-limits.d.ts +8 -0
- package/dist/esm/layout/card-limits.js +4 -0
- package/dist/esm/layout/describe-config.d.ts +118 -0
- package/dist/esm/layout/describe-config.js +199 -0
- package/dist/esm/layout/layout-config.d.ts +5 -0
- package/dist/esm/layout/layout-config.js +73 -0
- package/dist/esm/layout/layout-metrics.d.ts +6 -0
- package/dist/esm/layout/layout-metrics.js +6 -0
- package/dist/esm/layout/pack-preamble.d.ts +20 -0
- package/dist/esm/layout/pack-preamble.js +66 -0
- package/dist/esm/layout/to-flow-elements.d.ts +46 -0
- package/dist/esm/layout/to-flow-elements.js +83 -0
- package/dist/esm/react/canvas/AmbientSelectionContext.d.ts +7 -0
- package/dist/esm/react/canvas/AmbientSelectionContext.js +5 -0
- package/dist/esm/react/canvas/DetailLevelContext.d.ts +3 -0
- package/dist/esm/react/canvas/DetailLevelContext.js +2 -0
- package/dist/esm/react/canvas/FocusNavigation.d.ts +8 -0
- package/dist/esm/react/canvas/FocusNavigation.js +92 -0
- package/dist/esm/react/canvas/StateNode.d.ts +5 -0
- package/dist/esm/react/canvas/StateNode.js +91 -0
- package/dist/esm/react/canvas/StatechartCanvas.d.ts +16 -0
- package/dist/esm/react/canvas/StatechartCanvas.js +184 -0
- package/dist/esm/react/canvas/TransitionEdge.d.ts +5 -0
- package/dist/esm/react/canvas/TransitionEdge.js +22 -0
- package/dist/esm/react/canvas/canvas-key-entries.d.ts +14 -0
- package/dist/esm/react/canvas/canvas-key-entries.js +51 -0
- package/dist/esm/react/canvas/find-element-box.d.ts +8 -0
- package/dist/esm/react/canvas/find-element-box.js +25 -0
- package/dist/esm/react/canvas/find-view-centre.d.ts +15 -0
- package/dist/esm/react/canvas/find-view-centre.js +16 -0
- package/dist/esm/react/canvas/list-chart-marks.d.ts +5 -0
- package/dist/esm/react/canvas/list-chart-marks.js +37 -0
- package/dist/esm/react/canvas/marks.d.ts +19 -0
- package/dist/esm/react/canvas/marks.js +24 -0
- package/dist/esm/react/canvas/useNewLayout.d.ts +17 -0
- package/dist/esm/react/canvas/useNewLayout.js +44 -0
- package/dist/esm/react/canvas/zoom-levels.d.ts +28 -0
- package/dist/esm/react/canvas/zoom-levels.js +54 -0
- package/dist/esm/react/hooks/conversion-client.d.ts +77 -0
- package/dist/esm/react/hooks/conversion-client.js +132 -0
- package/dist/esm/react/hooks/describe-agent-selection.d.ts +6 -0
- package/dist/esm/react/hooks/describe-agent-selection.js +18 -0
- package/dist/esm/react/hooks/describe-load-outcome.d.ts +13 -0
- package/dist/esm/react/hooks/describe-load-outcome.js +30 -0
- package/dist/esm/react/hooks/download-config.d.ts +6 -0
- package/dist/esm/react/hooks/download-config.js +11 -0
- package/dist/esm/react/hooks/example-location.d.ts +7 -0
- package/dist/esm/react/hooks/example-location.js +14 -0
- package/dist/esm/react/hooks/label-source.d.ts +21 -0
- package/dist/esm/react/hooks/label-source.js +19 -0
- package/dist/esm/react/hooks/parse-config-text.d.ts +16 -0
- package/dist/esm/react/hooks/parse-config-text.js +38 -0
- package/dist/esm/react/hooks/useAgentBridge.d.ts +28 -0
- package/dist/esm/react/hooks/useAgentBridge.js +52 -0
- package/dist/esm/react/hooks/useAgentSync.d.ts +29 -0
- package/dist/esm/react/hooks/useAgentSync.js +75 -0
- package/dist/esm/react/hooks/useChartLayout.d.ts +25 -0
- package/dist/esm/react/hooks/useChartLayout.js +29 -0
- package/dist/esm/react/hooks/useConversion.d.ts +31 -0
- package/dist/esm/react/hooks/useConversion.js +177 -0
- package/dist/esm/react/hooks/useConvertDraft.d.ts +18 -0
- package/dist/esm/react/hooks/useConvertDraft.js +11 -0
- package/dist/esm/react/hooks/useDocumentTitle.d.ts +2 -0
- package/dist/esm/react/hooks/useDocumentTitle.js +7 -0
- package/dist/esm/react/hooks/useEscapeToClear.d.ts +2 -0
- package/dist/esm/react/hooks/useEscapeToClear.js +16 -0
- package/dist/esm/react/hooks/useHarnessList.d.ts +26 -0
- package/dist/esm/react/hooks/useHarnessList.js +24 -0
- package/dist/esm/react/hooks/usePromptDirectory.d.ts +27 -0
- package/dist/esm/react/hooks/usePromptDirectory.js +34 -0
- package/dist/esm/react/hooks/useSelection.d.ts +17 -0
- package/dist/esm/react/hooks/useSelection.js +21 -0
- package/dist/esm/react/hooks/useShowAmbient.d.ts +7 -0
- package/dist/esm/react/hooks/useShowAmbient.js +22 -0
- package/dist/esm/react/hooks/useUnknownExample.d.ts +7 -0
- package/dist/esm/react/hooks/useUnknownExample.js +26 -0
- package/dist/esm/react/index.d.ts +24 -0
- package/dist/esm/react/index.js +23 -0
- package/dist/esm/react/styles.css +482 -0
- package/dist/esm/schema/agent-logic-schema.d.ts +439 -0
- package/dist/esm/schema/agent-logic-schema.js +100 -0
- package/dist/esm/schema/config-traversal.d.ts +19 -0
- package/dist/esm/schema/config-traversal.js +32 -0
- package/dist/esm/schema/validate-config.d.ts +17 -0
- package/dist/esm/schema/validate-config.js +205 -0
- package/dist/esm/schema/write-json-schema.d.ts +4 -0
- package/dist/esm/schema/write-json-schema.js +12 -0
- package/dist/esm/server/conversion-job-implementation.d.ts +11 -0
- package/dist/esm/server/conversion-job-implementation.js +84 -0
- package/dist/esm/server/create-prompts-app.d.ts +26 -0
- package/dist/esm/server/create-prompts-app.js +41 -0
- package/dist/esm/server/create-viewer-server-plugins.d.ts +15 -0
- package/dist/esm/server/create-viewer-server-plugins.js +76 -0
- package/dist/esm/server/index.d.ts +7 -0
- package/dist/esm/server/index.js +6 -0
- package/dist/esm/server/prompt-directory-schemas.d.ts +30 -0
- package/dist/esm/server/prompt-directory-schemas.js +11 -0
- package/dist/esm/server/prompt-directory.d.ts +40 -0
- package/dist/esm/server/prompt-directory.js +86 -0
- package/dist/esm/server/viewer-contract-implementation.d.ts +12 -0
- package/dist/esm/server/viewer-contract-implementation.js +85 -0
- package/dist/esm/source/fence.d.ts +16 -0
- package/dist/esm/source/fence.js +15 -0
- package/dist/esm/source/find-comment-spans.d.ts +6 -0
- package/dist/esm/source/find-comment-spans.js +60 -0
- package/dist/esm/source/find-occurrences.d.ts +2 -0
- package/dist/esm/source/find-occurrences.js +7 -0
- package/dist/esm/source/prompt-segments.d.ts +21 -0
- package/dist/esm/source/prompt-segments.js +65 -0
- package/docs/conversion-agreement.md +37 -0
- package/docs/extraction-rules.md +123 -0
- package/package.json +106 -2
- package/schema/agent-logic.schema.json +475 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
export const changeApproval = {
|
|
2
|
+
id: 'change_approval',
|
|
3
|
+
initial: 'at_any_point_if',
|
|
4
|
+
states: {
|
|
5
|
+
at_any_point_if: {
|
|
6
|
+
id: 'at_any_point_if',
|
|
7
|
+
on: {
|
|
8
|
+
'user.asks_to_cancel': {
|
|
9
|
+
target: '#confirm_the_cancellation_and',
|
|
10
|
+
meta: {
|
|
11
|
+
source: {
|
|
12
|
+
start: 981,
|
|
13
|
+
end: 1004,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
initial: 'read_the_change_request',
|
|
19
|
+
meta: {
|
|
20
|
+
source: {
|
|
21
|
+
start: 964,
|
|
22
|
+
end: 1004,
|
|
23
|
+
},
|
|
24
|
+
name: 'Review the change request',
|
|
25
|
+
},
|
|
26
|
+
states: {
|
|
27
|
+
read_the_change_request: {
|
|
28
|
+
id: 'read_the_change_request',
|
|
29
|
+
always: {
|
|
30
|
+
target: '#fetch_the_list_of',
|
|
31
|
+
meta: {
|
|
32
|
+
source: {
|
|
33
|
+
start: 367,
|
|
34
|
+
end: 405,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
entry: [
|
|
39
|
+
{
|
|
40
|
+
type: 'nl',
|
|
41
|
+
params: {
|
|
42
|
+
text: 'read the change request that the user links',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: 'nl',
|
|
47
|
+
params: {
|
|
48
|
+
text: "note the change request's change type, service, and planned window",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
meta: {
|
|
53
|
+
source: {
|
|
54
|
+
start: 260,
|
|
55
|
+
end: 303,
|
|
56
|
+
},
|
|
57
|
+
name: 'Read the change request',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
fetch_the_list_of: {
|
|
61
|
+
id: 'fetch_the_list_of',
|
|
62
|
+
always: {
|
|
63
|
+
target: '#find_the_confluence_page',
|
|
64
|
+
meta: {
|
|
65
|
+
source: {
|
|
66
|
+
start: 441,
|
|
67
|
+
end: 502,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
entry: [
|
|
72
|
+
{
|
|
73
|
+
type: 'nl',
|
|
74
|
+
params: {
|
|
75
|
+
text: 'fetch the list of pre-approved changes from the Standard Changes page',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
meta: {
|
|
80
|
+
source: {
|
|
81
|
+
start: 367,
|
|
82
|
+
end: 436,
|
|
83
|
+
},
|
|
84
|
+
findings: [
|
|
85
|
+
{
|
|
86
|
+
kind: 'unused-input',
|
|
87
|
+
sources: [
|
|
88
|
+
{
|
|
89
|
+
start: 373,
|
|
90
|
+
end: 405,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
reason: 'The agent fetches the list of pre-approved changes, but no later step checks the change against it; step 4 decides on the change type alone.',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
name: 'Fetch the pre approved changes',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
find_the_confluence_page: {
|
|
100
|
+
id: 'find_the_confluence_page',
|
|
101
|
+
always: [
|
|
102
|
+
{
|
|
103
|
+
target: '#tell_the_requester_to',
|
|
104
|
+
guard: {
|
|
105
|
+
type: 'nl',
|
|
106
|
+
params: {
|
|
107
|
+
text: 'the planned window falls in a freeze',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
meta: {
|
|
111
|
+
source: {
|
|
112
|
+
start: 875,
|
|
113
|
+
end: 911,
|
|
114
|
+
},
|
|
115
|
+
inferred: true,
|
|
116
|
+
findings: [
|
|
117
|
+
{
|
|
118
|
+
kind: 'inferred-resolution',
|
|
119
|
+
sources: [
|
|
120
|
+
{
|
|
121
|
+
start: 872,
|
|
122
|
+
end: 962,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
reason: 'Step 6 can be read as a check after the verdict is posted, as its position suggests, or as a check before any verdict; the chart checks the freeze before the verdict, because approving a change and then asking for a new window would leave a posted approval for a window that cannot be used.',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
target: '#approve_the_change_and',
|
|
132
|
+
guard: {
|
|
133
|
+
type: 'nl',
|
|
134
|
+
params: {
|
|
135
|
+
text: 'the change type is Standard',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
meta: {
|
|
139
|
+
source: {
|
|
140
|
+
start: 546,
|
|
141
|
+
end: 573,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
target: '#ask_the_service_owner',
|
|
147
|
+
guard: {
|
|
148
|
+
type: 'nl',
|
|
149
|
+
params: {
|
|
150
|
+
text: 'the change type is Normal',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
meta: {
|
|
154
|
+
source: {
|
|
155
|
+
start: 641,
|
|
156
|
+
end: 666,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
entry: [
|
|
162
|
+
{
|
|
163
|
+
type: 'nl',
|
|
164
|
+
params: {
|
|
165
|
+
text: 'find the Confluence page whose title matches the service name',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'nl',
|
|
170
|
+
params: {
|
|
171
|
+
text: "read the service owner from the service's page",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
meta: {
|
|
176
|
+
source: {
|
|
177
|
+
start: 441,
|
|
178
|
+
end: 538,
|
|
179
|
+
},
|
|
180
|
+
findings: [
|
|
181
|
+
{
|
|
182
|
+
kind: 'unhandled-case',
|
|
183
|
+
sources: [
|
|
184
|
+
{
|
|
185
|
+
start: 441,
|
|
186
|
+
end: 502,
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
reason: 'The prompt does not say what to do when no page, or more than one page, has a title that matches the service name, or when the page names no owner.',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
kind: 'unhandled-case',
|
|
193
|
+
sources: [
|
|
194
|
+
{
|
|
195
|
+
start: 543,
|
|
196
|
+
end: 573,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
start: 638,
|
|
200
|
+
end: 666,
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
reason: 'The prompt branches only on Standard and Normal, and does not say what to do when the change type is another value, such as Emergency, or is empty.',
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
name: 'Read the service owner',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
approve_the_change_and: {
|
|
210
|
+
id: 'approve_the_change_and',
|
|
211
|
+
entry: [
|
|
212
|
+
{
|
|
213
|
+
type: 'nl',
|
|
214
|
+
params: {
|
|
215
|
+
text: 'approve the change',
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: 'nl',
|
|
220
|
+
params: {
|
|
221
|
+
text: 'post the verdict on the change request',
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
type: 'final',
|
|
226
|
+
meta: {
|
|
227
|
+
source: {
|
|
228
|
+
start: 575,
|
|
229
|
+
end: 636,
|
|
230
|
+
},
|
|
231
|
+
name: 'Approve the standard change',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
ask_the_service_owner: {
|
|
235
|
+
id: 'ask_the_service_owner',
|
|
236
|
+
on: {
|
|
237
|
+
'owner.replies': [
|
|
238
|
+
{
|
|
239
|
+
target: '#approve_the_change_if',
|
|
240
|
+
guard: {
|
|
241
|
+
type: 'nl',
|
|
242
|
+
params: {
|
|
243
|
+
text: "the change's risk is low",
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
meta: {
|
|
247
|
+
source: {
|
|
248
|
+
start: 787,
|
|
249
|
+
end: 802,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
target: '#reject_it_otherwise',
|
|
255
|
+
meta: {
|
|
256
|
+
source: {
|
|
257
|
+
start: 818,
|
|
258
|
+
end: 827,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
entry: [
|
|
265
|
+
{
|
|
266
|
+
type: 'nl',
|
|
267
|
+
params: {
|
|
268
|
+
text: 'ask the service owner to review the change',
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
type: 'nl',
|
|
273
|
+
params: {
|
|
274
|
+
text: "wait for the service owner's reply",
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
meta: {
|
|
279
|
+
source: {
|
|
280
|
+
start: 668,
|
|
281
|
+
end: 710,
|
|
282
|
+
},
|
|
283
|
+
findings: [
|
|
284
|
+
{
|
|
285
|
+
kind: 'unhandled-case',
|
|
286
|
+
sources: [
|
|
287
|
+
{
|
|
288
|
+
start: 716,
|
|
289
|
+
end: 736,
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
reason: 'The prompt does not say what to do when the service owner never replies, or how long to wait.',
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
kind: 'unused-input',
|
|
296
|
+
sources: [
|
|
297
|
+
{
|
|
298
|
+
start: 741,
|
|
299
|
+
end: 763,
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
reason: "The agent waits for the owner's reply, but the verdict depends on the change's risk rather than on what the owner says, and the prompt does not say where the risk comes from.",
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
name: 'Ask the owner to review',
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
approve_the_change_if: {
|
|
309
|
+
id: 'approve_the_change_if',
|
|
310
|
+
entry: [
|
|
311
|
+
{
|
|
312
|
+
type: 'nl',
|
|
313
|
+
params: {
|
|
314
|
+
text: 'approve the change',
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
type: 'nl',
|
|
319
|
+
params: {
|
|
320
|
+
text: 'post the verdict on the change request',
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
type: 'final',
|
|
325
|
+
meta: {
|
|
326
|
+
source: {
|
|
327
|
+
start: 765,
|
|
328
|
+
end: 802,
|
|
329
|
+
},
|
|
330
|
+
name: 'Approve the reviewed change',
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
reject_it_otherwise: {
|
|
334
|
+
id: 'reject_it_otherwise',
|
|
335
|
+
entry: [
|
|
336
|
+
{
|
|
337
|
+
type: 'nl',
|
|
338
|
+
params: {
|
|
339
|
+
text: 'reject the change',
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
type: 'nl',
|
|
344
|
+
params: {
|
|
345
|
+
text: 'post the verdict on the change request',
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
type: 'final',
|
|
350
|
+
meta: {
|
|
351
|
+
source: {
|
|
352
|
+
start: 808,
|
|
353
|
+
end: 827,
|
|
354
|
+
},
|
|
355
|
+
name: 'Reject the change',
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
tell_the_requester_to: {
|
|
359
|
+
id: 'tell_the_requester_to',
|
|
360
|
+
entry: [
|
|
361
|
+
{
|
|
362
|
+
type: 'nl',
|
|
363
|
+
params: {
|
|
364
|
+
text: 'tell the requester to pick a new window',
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
],
|
|
368
|
+
type: 'final',
|
|
369
|
+
meta: {
|
|
370
|
+
source: {
|
|
371
|
+
start: 913,
|
|
372
|
+
end: 961,
|
|
373
|
+
},
|
|
374
|
+
name: 'Ask for a new window',
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
confirm_the_cancellation_and: {
|
|
380
|
+
id: 'confirm_the_cancellation_and',
|
|
381
|
+
entry: [
|
|
382
|
+
{
|
|
383
|
+
type: 'nl',
|
|
384
|
+
params: {
|
|
385
|
+
text: 'confirm the cancellation',
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
type: 'final',
|
|
390
|
+
meta: {
|
|
391
|
+
source: {
|
|
392
|
+
start: 1006,
|
|
393
|
+
end: 1039,
|
|
394
|
+
},
|
|
395
|
+
name: 'Confirm the cancellation',
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
meta: {
|
|
400
|
+
name: 'Change approval',
|
|
401
|
+
prompt: '# Change approval agent\n\nYou review change requests for the platform team and post a verdict on each one.\n\nThe Change Policy page in Confluence is the only source of the approval rules and the verdict rule. Do not apply rules from anywhere else.\n\n## Steps\n\n1. Read the change request that the user links. Note its change type, its service, and its planned window.\n2. Fetch the list of pre-approved changes from the Standard Changes page.\n3. Find the Confluence page whose title matches the service name, and read the service owner from it.\n4. If the change type is Standard, approve the change and post the verdict on the change request. If the change type is Normal, ask the service owner to review the change, and wait for their reply.\n5. When the owner replies, approve the change if its risk is low, and reject it otherwise. Post the verdict on the change request.\n6. If the planned window falls in a freeze, tell the requester to pick a new window and stop.\n\nAt any point, if the user asks to cancel, confirm the cancellation and stop.\n',
|
|
402
|
+
source: {
|
|
403
|
+
start: 0,
|
|
404
|
+
end: 1041,
|
|
405
|
+
},
|
|
406
|
+
unconverted: [],
|
|
407
|
+
ambient: [
|
|
408
|
+
{
|
|
409
|
+
start: 25,
|
|
410
|
+
end: 105,
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
start: 107,
|
|
414
|
+
end: 206,
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
start: 207,
|
|
418
|
+
end: 245,
|
|
419
|
+
},
|
|
420
|
+
],
|
|
421
|
+
findings: [
|
|
422
|
+
{
|
|
423
|
+
kind: 'contradiction',
|
|
424
|
+
sources: [
|
|
425
|
+
{
|
|
426
|
+
start: 107,
|
|
427
|
+
end: 205,
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
start: 765,
|
|
431
|
+
end: 827,
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
reason: 'The prompt names the Change Policy page as the only source of the approval and verdict rules, yet states its own approval and verdict rules in steps 4 and 5 and never tells the agent to read that page.',
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
},
|
|
438
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface Example {
|
|
2
|
+
name: string;
|
|
3
|
+
/** The value of the page's `example` URL parameter that names this example. */
|
|
4
|
+
slug: string;
|
|
5
|
+
/** The example's config, unvalidated, so that it loads through the same path as a file. */
|
|
6
|
+
value: unknown;
|
|
7
|
+
}
|
|
8
|
+
/** Configs bundled with the viewer. */
|
|
9
|
+
export declare const examples: Example[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { changeApproval } from "./change-approval.js";
|
|
2
|
+
import { passwordReset } from "./password-reset.js";
|
|
3
|
+
import { refundRequest } from "./refund-request.js";
|
|
4
|
+
export const examples = [
|
|
5
|
+
{ name: 'Change approval', slug: 'change-approval', value: changeApproval },
|
|
6
|
+
{ name: 'Password reset', slug: 'password-reset', value: passwordReset },
|
|
7
|
+
{ name: 'Refund request', slug: 'refund-request', value: refundRequest },
|
|
8
|
+
];
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
export const passwordReset = {
|
|
2
|
+
id: 'reset_agent',
|
|
3
|
+
initial: 'asking_for_email',
|
|
4
|
+
states: {
|
|
5
|
+
asking_for_email: {
|
|
6
|
+
id: 'asking_for_email',
|
|
7
|
+
entry: [
|
|
8
|
+
{
|
|
9
|
+
type: 'nl',
|
|
10
|
+
params: {
|
|
11
|
+
text: 'ask the employee for their work email',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
on: {
|
|
16
|
+
'user.gives_email': {
|
|
17
|
+
target: '#sending_code',
|
|
18
|
+
meta: {
|
|
19
|
+
source: {
|
|
20
|
+
start: 74,
|
|
21
|
+
end: 109,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
meta: {
|
|
27
|
+
name: 'Ask for the work email',
|
|
28
|
+
source: {
|
|
29
|
+
start: 35,
|
|
30
|
+
end: 72,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
sending_code: {
|
|
35
|
+
id: 'sending_code',
|
|
36
|
+
entry: [
|
|
37
|
+
{
|
|
38
|
+
type: 'nl',
|
|
39
|
+
params: {
|
|
40
|
+
text: 'send a verification code to the email',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
always: {
|
|
45
|
+
target: '#awaiting_code',
|
|
46
|
+
meta: {
|
|
47
|
+
source: {
|
|
48
|
+
start: 111,
|
|
49
|
+
end: 128,
|
|
50
|
+
},
|
|
51
|
+
inferred: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
meta: {
|
|
55
|
+
name: 'Send the code',
|
|
56
|
+
source: {
|
|
57
|
+
start: 79,
|
|
58
|
+
end: 110,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
awaiting_code: {
|
|
63
|
+
id: 'awaiting_code',
|
|
64
|
+
entry: [
|
|
65
|
+
{
|
|
66
|
+
type: 'nl',
|
|
67
|
+
params: {
|
|
68
|
+
text: 'ask for the code',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
on: {
|
|
73
|
+
'user.gives_code': [
|
|
74
|
+
{
|
|
75
|
+
target: '#resetting',
|
|
76
|
+
guard: {
|
|
77
|
+
type: 'nl',
|
|
78
|
+
params: {
|
|
79
|
+
text: 'the code is correct',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
meta: {
|
|
83
|
+
source: {
|
|
84
|
+
start: 129,
|
|
85
|
+
end: 151,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
target: '#counting_attempt',
|
|
91
|
+
guard: {
|
|
92
|
+
type: 'nl',
|
|
93
|
+
params: {
|
|
94
|
+
text: 'the code is wrong',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
meta: {
|
|
98
|
+
source: {
|
|
99
|
+
start: 211,
|
|
100
|
+
end: 225,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
'user.asks_to_resend': {
|
|
106
|
+
actions: [
|
|
107
|
+
{
|
|
108
|
+
type: 'nl',
|
|
109
|
+
params: {
|
|
110
|
+
text: 'send the code again',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
meta: {
|
|
115
|
+
source: {
|
|
116
|
+
start: 339,
|
|
117
|
+
end: 394,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
meta: {
|
|
123
|
+
name: 'Ask for the code',
|
|
124
|
+
source: {
|
|
125
|
+
start: 111,
|
|
126
|
+
end: 128,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
counting_attempt: {
|
|
131
|
+
id: 'counting_attempt',
|
|
132
|
+
entry: [
|
|
133
|
+
{
|
|
134
|
+
type: 'nl',
|
|
135
|
+
params: {
|
|
136
|
+
text: 'count the wrong code',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
always: [
|
|
141
|
+
{
|
|
142
|
+
target: '#locked',
|
|
143
|
+
guard: {
|
|
144
|
+
type: 'nl',
|
|
145
|
+
params: {
|
|
146
|
+
text: 'this is the third wrong code',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
meta: {
|
|
150
|
+
source: {
|
|
151
|
+
start: 257,
|
|
152
|
+
end: 283,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
target: '#awaiting_code',
|
|
158
|
+
meta: {
|
|
159
|
+
source: {
|
|
160
|
+
start: 227,
|
|
161
|
+
end: 255,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
meta: {
|
|
167
|
+
name: 'Count the wrong code',
|
|
168
|
+
source: {
|
|
169
|
+
start: 238,
|
|
170
|
+
end: 255,
|
|
171
|
+
},
|
|
172
|
+
inferred: true,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
resetting: {
|
|
176
|
+
id: 'resetting',
|
|
177
|
+
type: 'final',
|
|
178
|
+
entry: [
|
|
179
|
+
{
|
|
180
|
+
type: 'nl',
|
|
181
|
+
params: {
|
|
182
|
+
text: 'reset the password',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: 'nl',
|
|
187
|
+
params: {
|
|
188
|
+
text: 'tell the employee that it is done',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
meta: {
|
|
193
|
+
name: 'Reset the password',
|
|
194
|
+
source: {
|
|
195
|
+
start: 153,
|
|
196
|
+
end: 209,
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
locked: {
|
|
201
|
+
id: 'locked',
|
|
202
|
+
type: 'final',
|
|
203
|
+
entry: [
|
|
204
|
+
{
|
|
205
|
+
type: 'nl',
|
|
206
|
+
params: {
|
|
207
|
+
text: 'lock the account',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: 'nl',
|
|
212
|
+
params: {
|
|
213
|
+
text: 'tell the employee to contact IT',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
meta: {
|
|
218
|
+
name: 'Lock the account',
|
|
219
|
+
source: {
|
|
220
|
+
start: 285,
|
|
221
|
+
end: 337,
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
meta: {
|
|
227
|
+
name: 'Reset agent',
|
|
228
|
+
prompt: 'You reset passwords for employees.\nAsk the employee for their work email, then send a verification code to it. Ask for the code. If the code is correct, reset the password and tell the employee that it is done. If it is wrong, ask again, up to three times; after the third wrong code, lock the account and tell the employee to contact IT.\nIf the employee asks to resend the code, send it again.',
|
|
229
|
+
source: {
|
|
230
|
+
start: 0,
|
|
231
|
+
end: 394,
|
|
232
|
+
},
|
|
233
|
+
unconverted: [],
|
|
234
|
+
},
|
|
235
|
+
};
|