sqlew 5.1.0 → 5.2.1

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 (83) hide show
  1. package/CHANGELOG.md +2140 -2081
  2. package/LICENSE +190 -190
  3. package/NOTICE +24 -24
  4. package/README.md +204 -190
  5. package/dist/adapters/mysql-adapter.js +3 -3
  6. package/dist/adapters/postgresql-adapter.js +3 -3
  7. package/dist/cli/db-export.js +32 -32
  8. package/dist/cli/db-import.js +30 -30
  9. package/dist/cli/hooks/codex-transcript.d.ts +23 -0
  10. package/dist/cli/hooks/codex-transcript.d.ts.map +1 -0
  11. package/dist/cli/hooks/codex-transcript.js +134 -0
  12. package/dist/cli/hooks/codex-transcript.js.map +1 -0
  13. package/dist/cli/hooks/on-exit-plan.d.ts.map +1 -1
  14. package/dist/cli/hooks/on-exit-plan.js +72 -4
  15. package/dist/cli/hooks/on-exit-plan.js.map +1 -1
  16. package/dist/cli/hooks/on-prompt.d.ts.map +1 -1
  17. package/dist/cli/hooks/on-prompt.js +38 -16
  18. package/dist/cli/hooks/on-prompt.js.map +1 -1
  19. package/dist/cli/hooks/plan-processor.d.ts.map +1 -1
  20. package/dist/cli/hooks/plan-processor.js +16 -2
  21. package/dist/cli/hooks/plan-processor.js.map +1 -1
  22. package/dist/cli/hooks/pr-adr.js +5 -5
  23. package/dist/cli/hooks/stdin-parser.d.ts +43 -0
  24. package/dist/cli/hooks/stdin-parser.d.ts.map +1 -1
  25. package/dist/cli/hooks/stdin-parser.js +212 -6
  26. package/dist/cli/hooks/stdin-parser.js.map +1 -1
  27. package/dist/cli/hooks/track-plan.d.ts +13 -0
  28. package/dist/cli/hooks/track-plan.d.ts.map +1 -1
  29. package/dist/cli/hooks/track-plan.js +73 -18
  30. package/dist/cli/hooks/track-plan.js.map +1 -1
  31. package/dist/cli.js +48 -48
  32. package/dist/config/global-config.d.ts +7 -1
  33. package/dist/config/global-config.d.ts.map +1 -1
  34. package/dist/config/global-config.js +5 -26
  35. package/dist/config/global-config.js.map +1 -1
  36. package/dist/database/migrations/v4/20251126000000_v4_bootstrap.js +32 -32
  37. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.d.ts.map +1 -1
  38. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js +2 -1
  39. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js.map +1 -1
  40. package/dist/database/migrations/v4/20260102204000_v4_fix_decision_set_example.js +3 -3
  41. package/dist/help-data/constraint.toml +259 -259
  42. package/dist/help-data/decision.toml +845 -845
  43. package/dist/help-data/queue.toml +134 -134
  44. package/dist/server/tool-schemas.js +30 -30
  45. package/dist/tests/docker/native/db-init.js +9 -9
  46. package/dist/tests/unit/hooks/codex-hook-normalization.test.d.ts +7 -0
  47. package/dist/tests/unit/hooks/codex-hook-normalization.test.d.ts.map +1 -0
  48. package/dist/tests/unit/hooks/codex-hook-normalization.test.js +112 -0
  49. package/dist/tests/unit/hooks/codex-hook-normalization.test.js.map +1 -0
  50. package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts +9 -0
  51. package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts.map +1 -0
  52. package/dist/tests/unit/hooks/grok-hook-normalization.test.js +136 -0
  53. package/dist/tests/unit/hooks/grok-hook-normalization.test.js.map +1 -0
  54. package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts +7 -0
  55. package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts.map +1 -0
  56. package/dist/tests/unit/hooks/grok-plan-template-injection.test.js +55 -0
  57. package/dist/tests/unit/hooks/grok-plan-template-injection.test.js.map +1 -0
  58. package/dist/tests/utils/db-schema.js +48 -48
  59. package/dist/tests/utils/test-helpers.js +48 -48
  60. package/dist/tools/constraints/actions/get.js +5 -5
  61. package/dist/utils/path-normalize.d.ts +23 -0
  62. package/dist/utils/path-normalize.d.ts.map +1 -0
  63. package/dist/utils/path-normalize.js +38 -0
  64. package/dist/utils/path-normalize.js.map +1 -0
  65. package/dist/utils/project-root.d.ts +7 -3
  66. package/dist/utils/project-root.d.ts.map +1 -1
  67. package/dist/utils/project-root.js +17 -3
  68. package/dist/utils/project-root.js.map +1 -1
  69. package/dist/watcher/base-watcher.d.ts +0 -4
  70. package/dist/watcher/base-watcher.d.ts.map +1 -1
  71. package/dist/watcher/base-watcher.js +11 -22
  72. package/dist/watcher/base-watcher.js.map +1 -1
  73. package/docs/ADR_CONCEPTS.md +152 -152
  74. package/docs/CLI_USAGE.md +392 -392
  75. package/docs/CONFIGURATION.md +157 -157
  76. package/docs/CROSS_DATABASE.md +66 -66
  77. package/docs/DATABASE_AUTH.md +135 -135
  78. package/docs/HOOKS_GUIDE.md +116 -67
  79. package/docs/MIGRATION_TO_SAAS.md +176 -176
  80. package/docs/SHARED_DATABASE.md +108 -108
  81. package/package.json +88 -88
  82. package/scripts/copy-help-data.js +19 -19
  83. package/scripts/filter-test-output.js +78 -78
@@ -1,845 +1,845 @@
1
- # Decision Tool - Context Management
2
- # Store decisions with metadata (tags, layers, versions, scopes)
3
-
4
- [tool]
5
- name = "decision"
6
- description = "Context Management - Store decisions with metadata (tags, layers, versions, scopes). Track architectural decisions, design choices, and shared context with full version history and rich decision context support."
7
-
8
- # =============================================================================
9
- # ACTIONS
10
- # =============================================================================
11
-
12
- [[actions]]
13
- name = "set"
14
- description = "Create or update a decision with full metadata support"
15
- note = "This action does NOT support rationale, alternatives, or tradeoffs parameters. To add decision context, use `add_decision_context` action as a separate call after setting the decision."
16
-
17
- [[actions.params]]
18
- name = "action"
19
- type = "string"
20
- required = true
21
- description = "Must be \"set\""
22
-
23
- [[actions.params]]
24
- name = "key"
25
- type = "string"
26
- required = true
27
- description = "Unique decision key (hierarchical path recommended, e.g., \"auth/method\")"
28
-
29
- [[actions.params]]
30
- name = "value"
31
- type = "string | number"
32
- required = true
33
- description = "Decision value"
34
-
35
- [[actions.params]]
36
- name = "tags"
37
- type = "string[]"
38
- required = false
39
- description = "Tags for categorization"
40
- default = "[]"
41
-
42
- [[actions.params]]
43
- name = "layer"
44
- type = "string"
45
- required = false
46
- description = "Architecture layer: presentation, business, data, infrastructure, cross-cutting, documentation, planning, coordination, review"
47
-
48
- [[actions.params]]
49
- name = "scope"
50
- type = "string"
51
- required = false
52
- description = "Module or component scope"
53
-
54
- [[actions.params]]
55
- name = "version"
56
- type = "string"
57
- required = false
58
- description = "Version identifier"
59
- default = "v1.0.0"
60
-
61
- [[actions.params]]
62
- name = "status"
63
- type = "string"
64
- required = false
65
- description = "Decision status: active, deprecated, draft"
66
- default = "active"
67
-
68
- [[actions.examples]]
69
- title = "Basic decision"
70
- code = '''
71
- {
72
- "action": "set",
73
- "key": "auth/method",
74
- "value": "JWT tokens with refresh",
75
- "tags": ["security", "auth"],
76
- "layer": "infrastructure"
77
- }
78
- '''
79
- explanation = "Store a simple architectural decision with tags and layer assignment"
80
-
81
- [[actions.examples]]
82
- title = "Decision with scope"
83
- code = '''
84
- {
85
- "action": "set",
86
- "key": "db/connection-pool-size",
87
- "value": 20,
88
- "tags": ["database", "performance"],
89
- "layer": "data",
90
- "scope": "api-service"
91
- }
92
- '''
93
- explanation = "Store a numeric decision scoped to a specific service"
94
-
95
- [[actions.examples]]
96
- title = "Decision with rationale (two-step workflow)"
97
- code = '''
98
- # Step 1: Set the decision
99
- {"action":"set","key":"auth/method","value":"JWT tokens","layer":"infrastructure","tags":["security"]}
100
-
101
- # Step 2: Add rationale (separate call required)
102
- {"action":"add_decision_context","key":"auth/method","rationale":"Stateless auth ideal for microservices"}
103
- '''
104
- explanation = "To include rationale, alternatives, or tradeoffs, you MUST use add_decision_context as a separate step. The set action does not accept these parameters."
105
-
106
- # -----------------------------------------------------------------------------
107
-
108
- [[actions]]
109
- name = "get"
110
- description = "Retrieve a specific decision by key"
111
-
112
- [[actions.params]]
113
- name = "action"
114
- type = "string"
115
- required = true
116
- description = "Must be \"get\""
117
-
118
- [[actions.params]]
119
- name = "key"
120
- type = "string"
121
- required = true
122
- description = "Decision key to retrieve"
123
-
124
- [[actions.params]]
125
- name = "include_context"
126
- type = "boolean"
127
- required = false
128
- description = "Include rationale/alternatives/tradeoffs"
129
- default = "false"
130
-
131
- [[actions.examples]]
132
- title = "Get decision"
133
- code = '''
134
- {
135
- "action": "get",
136
- "key": "auth/method"
137
- }
138
- '''
139
- explanation = "Retrieve a decision by its key"
140
-
141
- [[actions.examples]]
142
- title = "Get with context"
143
- code = '''
144
- {
145
- "action": "get",
146
- "key": "auth/method",
147
- "include_context": true
148
- }
149
- '''
150
- explanation = "Retrieve a decision with its full context (rationale, alternatives, tradeoffs)"
151
-
152
- # -----------------------------------------------------------------------------
153
-
154
- [[actions]]
155
- name = "list"
156
- description = "List decisions with filtering options"
157
-
158
- [[actions.params]]
159
- name = "action"
160
- type = "string"
161
- required = true
162
- description = "Must be \"list\""
163
-
164
- [[actions.params]]
165
- name = "status"
166
- type = "string"
167
- required = false
168
- description = "Filter by status: active, deprecated, draft"
169
-
170
- [[actions.params]]
171
- name = "layer"
172
- type = "string"
173
- required = false
174
- description = "Filter by layer"
175
-
176
- [[actions.params]]
177
- name = "limit"
178
- type = "number"
179
- required = false
180
- description = "Maximum results"
181
- default = "50"
182
-
183
- [[actions.examples]]
184
- title = "List all active decisions"
185
- code = '''
186
- {
187
- "action": "list",
188
- "status": "active"
189
- }
190
- '''
191
- explanation = "List all active decisions"
192
-
193
- [[actions.examples]]
194
- title = "List by layer"
195
- code = '''
196
- {
197
- "action": "list",
198
- "layer": "infrastructure",
199
- "limit": 20
200
- }
201
- '''
202
- explanation = "List decisions in a specific architecture layer"
203
-
204
- # -----------------------------------------------------------------------------
205
-
206
- [[actions]]
207
- name = "search_tags"
208
- description = "Search decisions by tags (AND/OR logic)"
209
-
210
- [[actions.params]]
211
- name = "action"
212
- type = "string"
213
- required = true
214
- description = "Must be \"search_tags\""
215
-
216
- [[actions.params]]
217
- name = "tags"
218
- type = "string[]"
219
- required = true
220
- description = "Tags to search for"
221
-
222
- [[actions.params]]
223
- name = "match_all"
224
- type = "boolean"
225
- required = false
226
- description = "If true, match ALL tags (AND); if false, match ANY (OR)"
227
- default = "false"
228
-
229
- [[actions.examples]]
230
- title = "Search by tags (OR)"
231
- code = '''
232
- {
233
- "action": "search_tags",
234
- "tags": ["security", "auth"]
235
- }
236
- '''
237
- explanation = "Find decisions with any of the specified tags"
238
-
239
- # -----------------------------------------------------------------------------
240
-
241
- [[actions]]
242
- name = "search_layer"
243
- description = "Search decisions by architecture layer"
244
-
245
- [[actions.params]]
246
- name = "action"
247
- type = "string"
248
- required = true
249
- description = "Must be \"search_layer\""
250
-
251
- [[actions.params]]
252
- name = "layer"
253
- type = "string"
254
- required = true
255
- description = "Layer to search"
256
-
257
- [[actions.examples]]
258
- title = "Search by layer"
259
- code = '''
260
- {
261
- "action": "search_layer",
262
- "layer": "infrastructure"
263
- }
264
- '''
265
- explanation = "Find all decisions in the infrastructure layer"
266
-
267
- # -----------------------------------------------------------------------------
268
-
269
- [[actions]]
270
- name = "versions"
271
- description = "Get version history for a decision"
272
-
273
- [[actions.params]]
274
- name = "action"
275
- type = "string"
276
- required = true
277
- description = "Must be \"versions\""
278
-
279
- [[actions.params]]
280
- name = "key"
281
- type = "string"
282
- required = true
283
- description = "Decision key"
284
-
285
- [[actions.examples]]
286
- title = "Get version history"
287
- code = '''
288
- {
289
- "action": "versions",
290
- "key": "auth/method"
291
- }
292
- '''
293
- explanation = "View all previous versions of a decision"
294
-
295
- # -----------------------------------------------------------------------------
296
-
297
- [[actions]]
298
- name = "quick_set"
299
- description = "Simplified decision setter with auto-inferred layer"
300
-
301
- [[actions.params]]
302
- name = "action"
303
- type = "string"
304
- required = true
305
- description = "Must be \"quick_set\""
306
-
307
- [[actions.params]]
308
- name = "key"
309
- type = "string"
310
- required = true
311
- description = "Decision key"
312
-
313
- [[actions.params]]
314
- name = "value"
315
- type = "string | number"
316
- required = true
317
- description = "Decision value"
318
-
319
- [[actions.examples]]
320
- title = "Quick set"
321
- code = '''
322
- {
323
- "action": "quick_set",
324
- "key": "api/rate-limit",
325
- "value": 1000
326
- }
327
- '''
328
- explanation = "Quickly set a decision with minimal parameters (layer auto-inferred from key)"
329
-
330
- # -----------------------------------------------------------------------------
331
-
332
- [[actions]]
333
- name = "search_advanced"
334
- description = "Advanced search with multiple criteria"
335
-
336
- [[actions.params]]
337
- name = "action"
338
- type = "string"
339
- required = true
340
- description = "Must be \"search_advanced\""
341
-
342
- [[actions.params]]
343
- name = "key_pattern"
344
- type = "string"
345
- required = false
346
- description = "Key pattern to match (supports wildcards)"
347
-
348
- [[actions.params]]
349
- name = "tags"
350
- type = "string[]"
351
- required = false
352
- description = "Tags to filter by"
353
-
354
- [[actions.params]]
355
- name = "layer"
356
- type = "string"
357
- required = false
358
- description = "Layer to filter by"
359
-
360
- [[actions.params]]
361
- name = "status"
362
- type = "string"
363
- required = false
364
- description = "Status to filter by"
365
-
366
- [[actions.examples]]
367
- title = "Advanced search"
368
- code = '''
369
- {
370
- "action": "search_advanced",
371
- "key_pattern": "auth/*",
372
- "tags": ["security"],
373
- "layer": "infrastructure"
374
- }
375
- '''
376
- explanation = "Search with multiple criteria combined"
377
-
378
- # -----------------------------------------------------------------------------
379
-
380
- [[actions]]
381
- name = "set_batch"
382
- description = "Batch set multiple decisions atomically"
383
-
384
- [[actions.params]]
385
- name = "action"
386
- type = "string"
387
- required = true
388
- description = "Must be \"set_batch\""
389
-
390
- [[actions.params]]
391
- name = "decisions"
392
- type = "object[]"
393
- required = true
394
- description = "Array of decision objects (each with key, value, and optional metadata)"
395
-
396
- [[actions.examples]]
397
- title = "Batch set"
398
- code = '''
399
- {
400
- "action": "set_batch",
401
- "decisions": [
402
- {"key": "api/version", "value": "v2", "layer": "presentation"},
403
- {"key": "api/format", "value": "JSON", "layer": "presentation"}
404
- ]
405
- }
406
- '''
407
- explanation = "Set multiple decisions in a single atomic operation"
408
-
409
- # -----------------------------------------------------------------------------
410
-
411
- [[actions]]
412
- name = "has_updates"
413
- description = "Check for new/updated decisions since timestamp"
414
-
415
- [[actions.params]]
416
- name = "action"
417
- type = "string"
418
- required = true
419
- description = "Must be \"has_updates\""
420
-
421
- [[actions.params]]
422
- name = "since"
423
- type = "number"
424
- required = true
425
- description = "Unix timestamp to check from"
426
-
427
- [[actions.examples]]
428
- title = "Check for updates"
429
- code = '''
430
- {
431
- "action": "has_updates",
432
- "since": 1704067200
433
- }
434
- '''
435
- explanation = "Check if any decisions have been added or modified since the given timestamp"
436
-
437
- # -----------------------------------------------------------------------------
438
-
439
- [[actions]]
440
- name = "set_from_template"
441
- description = "Create decision from predefined template"
442
-
443
- [[actions.params]]
444
- name = "action"
445
- type = "string"
446
- required = true
447
- description = "Must be \"set_from_template\""
448
-
449
- [[actions.params]]
450
- name = "template_name"
451
- type = "string"
452
- required = true
453
- description = "Name of the template to use"
454
-
455
- [[actions.params]]
456
- name = "key"
457
- type = "string"
458
- required = true
459
- description = "Decision key"
460
-
461
- [[actions.params]]
462
- name = "value"
463
- type = "string"
464
- required = true
465
- description = "Decision value"
466
-
467
- [[actions.examples]]
468
- title = "Create from template"
469
- code = '''
470
- {
471
- "action": "set_from_template",
472
- "template_name": "architecture_decision",
473
- "key": "db/engine",
474
- "value": "PostgreSQL 15"
475
- }
476
- '''
477
- explanation = "Create a decision using a predefined template for consistent metadata"
478
-
479
- # -----------------------------------------------------------------------------
480
-
481
- [[actions]]
482
- name = "create_template"
483
- description = "Create reusable decision template"
484
-
485
- [[actions.params]]
486
- name = "action"
487
- type = "string"
488
- required = true
489
- description = "Must be \"create_template\""
490
-
491
- [[actions.params]]
492
- name = "name"
493
- type = "string"
494
- required = true
495
- description = "Template name"
496
-
497
- [[actions.params]]
498
- name = "defaults"
499
- type = "object"
500
- required = true
501
- description = "Default values for decisions created from this template"
502
-
503
- [[actions.examples]]
504
- title = "Create template"
505
- code = '''
506
- {
507
- "action": "create_template",
508
- "name": "security_decision",
509
- "defaults": {
510
- "layer": "cross-cutting",
511
- "tags": ["security"],
512
- "status": "active"
513
- }
514
- }
515
- '''
516
- explanation = "Create a template for security-related decisions"
517
-
518
- # -----------------------------------------------------------------------------
519
-
520
- [[actions]]
521
- name = "list_templates"
522
- description = "List all available decision templates"
523
-
524
- [[actions.params]]
525
- name = "action"
526
- type = "string"
527
- required = true
528
- description = "Must be \"list_templates\""
529
-
530
- [[actions.examples]]
531
- title = "List templates"
532
- code = '''
533
- {
534
- "action": "list_templates"
535
- }
536
- '''
537
- explanation = "View all available decision templates"
538
-
539
- # -----------------------------------------------------------------------------
540
-
541
- [[actions]]
542
- name = "hard_delete"
543
- description = "Permanently delete decision (irreversible)"
544
-
545
- [[actions.params]]
546
- name = "action"
547
- type = "string"
548
- required = true
549
- description = "Must be \"hard_delete\""
550
-
551
- [[actions.params]]
552
- name = "key"
553
- type = "string"
554
- required = true
555
- description = "Decision key to delete"
556
-
557
- [[actions.examples]]
558
- title = "Hard delete"
559
- code = '''
560
- {
561
- "action": "hard_delete",
562
- "key": "deprecated/old-setting"
563
- }
564
- '''
565
- explanation = "Permanently remove a decision and all its history"
566
-
567
- # -----------------------------------------------------------------------------
568
-
569
- [[actions]]
570
- name = "add_decision_context"
571
- description = "Add rich context (rationale, alternatives, tradeoffs)"
572
-
573
- [[actions.params]]
574
- name = "action"
575
- type = "string"
576
- required = true
577
- description = "Must be \"add_decision_context\""
578
-
579
- [[actions.params]]
580
- name = "key"
581
- type = "string"
582
- required = true
583
- description = "Decision key"
584
-
585
- [[actions.params]]
586
- name = "rationale"
587
- type = "string"
588
- required = true
589
- description = "Why this decision was made"
590
-
591
- [[actions.params]]
592
- name = "alternatives"
593
- type = "string"
594
- required = false
595
- description = "Other options considered"
596
-
597
- [[actions.params]]
598
- name = "tradeoffs"
599
- type = "string"
600
- required = false
601
- description = "Tradeoffs of this decision"
602
-
603
- [[actions.examples]]
604
- title = "Add context"
605
- code = '''
606
- {
607
- "action": "add_decision_context",
608
- "key": "auth/method",
609
- "rationale": "JWT provides stateless authentication suitable for our microservices architecture",
610
- "alternatives": "Session-based auth, OAuth2 only",
611
- "tradeoffs": "Requires token refresh handling, larger payload than session cookies"
612
- }
613
- '''
614
- explanation = "Document the reasoning behind a decision for future reference"
615
-
616
- # -----------------------------------------------------------------------------
617
-
618
- [[actions]]
619
- name = "list_decision_contexts"
620
- description = "List decision contexts with filtering"
621
-
622
- [[actions.params]]
623
- name = "action"
624
- type = "string"
625
- required = true
626
- description = "Must be \"list_decision_contexts\""
627
-
628
- [[actions.params]]
629
- name = "key"
630
- type = "string"
631
- required = false
632
- description = "Filter by decision key"
633
-
634
- [[actions.examples]]
635
- title = "List contexts"
636
- code = '''
637
- {
638
- "action": "list_decision_contexts",
639
- "key": "auth/method"
640
- }
641
- '''
642
- explanation = "View all context entries for a decision"
643
-
644
- # -----------------------------------------------------------------------------
645
-
646
- [[actions]]
647
- name = "analytics"
648
- description = "Get decision analytics and statistics"
649
-
650
- [[actions.params]]
651
- name = "action"
652
- type = "string"
653
- required = true
654
- description = "Must be \"analytics\""
655
-
656
- [[actions.examples]]
657
- title = "Get analytics"
658
- code = '''
659
- {
660
- "action": "analytics"
661
- }
662
- '''
663
- explanation = "View statistics about decisions (count by layer, status, tags, etc.)"
664
-
665
- # -----------------------------------------------------------------------------
666
-
667
- [[actions]]
668
- name = "create_policy"
669
- description = "Create reusable decision policy with validation"
670
-
671
- [[actions.params]]
672
- name = "action"
673
- type = "string"
674
- required = true
675
- description = "Must be \"create_policy\""
676
-
677
- [[actions.params]]
678
- name = "name"
679
- type = "string"
680
- required = true
681
- description = "Policy name"
682
-
683
- [[actions.params]]
684
- name = "defaults"
685
- type = "object"
686
- required = false
687
- description = "Default values"
688
-
689
- [[actions.params]]
690
- name = "validation_rules"
691
- type = "object"
692
- required = false
693
- description = "Validation rules (regex patterns, etc.)"
694
-
695
- [[actions.params]]
696
- name = "quality_gates"
697
- type = "object"
698
- required = false
699
- description = "Required fields and quality checks"
700
-
701
- [[actions.examples]]
702
- title = "Create policy"
703
- code = '''
704
- {
705
- "action": "create_policy",
706
- "name": "cve_tracking",
707
- "defaults": {
708
- "layer": "cross-cutting",
709
- "tags": ["security", "vulnerability"]
710
- },
711
- "validation_rules": {
712
- "patterns": {"key": "^CVE-\\d{4}-\\d{4,7}$"}
713
- },
714
- "quality_gates": {
715
- "required_fields": ["rationale"]
716
- }
717
- }
718
- '''
719
- explanation = "Create a policy that enforces CVE key format and requires rationale"
720
-
721
- # -----------------------------------------------------------------------------
722
-
723
- [[actions]]
724
- name = "list_policies"
725
- description = "List all available decision policies"
726
-
727
- [[actions.params]]
728
- name = "action"
729
- type = "string"
730
- required = true
731
- description = "Must be \"list_policies\""
732
-
733
- [[actions.examples]]
734
- title = "List policies"
735
- code = '''
736
- {
737
- "action": "list_policies"
738
- }
739
- '''
740
- explanation = "View all available decision policies (built-in and custom)"
741
-
742
- # -----------------------------------------------------------------------------
743
-
744
- [[actions]]
745
- name = "set_from_policy"
746
- description = "Create decision from policy template"
747
-
748
- [[actions.params]]
749
- name = "action"
750
- type = "string"
751
- required = true
752
- description = "Must be \"set_from_policy\""
753
-
754
- [[actions.params]]
755
- name = "policy"
756
- type = "string"
757
- required = true
758
- description = "Policy name to use"
759
-
760
- [[actions.params]]
761
- name = "key"
762
- type = "string"
763
- required = true
764
- description = "Decision key"
765
-
766
- [[actions.params]]
767
- name = "value"
768
- type = "string"
769
- required = true
770
- description = "Decision value"
771
-
772
- [[actions.examples]]
773
- title = "Create from policy"
774
- code = '''
775
- {
776
- "action": "set_from_policy",
777
- "policy": "security_vulnerability",
778
- "key": "CVE-2024-12345",
779
- "value": "Patched in v2.3.1"
780
- }
781
- '''
782
- explanation = "Create a decision using policy defaults and validation"
783
-
784
- # -----------------------------------------------------------------------------
785
-
786
- [[actions]]
787
- name = "help"
788
- description = "Get decision tool documentation"
789
-
790
- [[actions.params]]
791
- name = "action"
792
- type = "string"
793
- required = true
794
- description = "Must be \"help\""
795
-
796
- [[actions.examples]]
797
- title = "Get help"
798
- code = '''
799
- {
800
- "action": "help"
801
- }
802
- '''
803
- explanation = "Display decision tool documentation"
804
-
805
- # -----------------------------------------------------------------------------
806
-
807
- [[actions]]
808
- name = "example"
809
- description = "Get decision tool examples"
810
-
811
- [[actions.params]]
812
- name = "action"
813
- type = "string"
814
- required = true
815
- description = "Must be \"example\""
816
-
817
- [[actions.examples]]
818
- title = "Get examples"
819
- code = '''
820
- {
821
- "action": "example"
822
- }
823
- '''
824
- explanation = "Display decision tool usage examples"
825
-
826
- # -----------------------------------------------------------------------------
827
-
828
- [[actions]]
829
- name = "use_case"
830
- description = "Get decision tool use cases"
831
-
832
- [[actions.params]]
833
- name = "action"
834
- type = "string"
835
- required = true
836
- description = "Must be \"use_case\""
837
-
838
- [[actions.examples]]
839
- title = "Get use cases"
840
- code = '''
841
- {
842
- "action": "use_case"
843
- }
844
- '''
845
- explanation = "Display decision tool use case workflows"
1
+ # Decision Tool - Context Management
2
+ # Store decisions with metadata (tags, layers, versions, scopes)
3
+
4
+ [tool]
5
+ name = "decision"
6
+ description = "Context Management - Store decisions with metadata (tags, layers, versions, scopes). Track architectural decisions, design choices, and shared context with full version history and rich decision context support."
7
+
8
+ # =============================================================================
9
+ # ACTIONS
10
+ # =============================================================================
11
+
12
+ [[actions]]
13
+ name = "set"
14
+ description = "Create or update a decision with full metadata support"
15
+ note = "This action does NOT support rationale, alternatives, or tradeoffs parameters. To add decision context, use `add_decision_context` action as a separate call after setting the decision."
16
+
17
+ [[actions.params]]
18
+ name = "action"
19
+ type = "string"
20
+ required = true
21
+ description = "Must be \"set\""
22
+
23
+ [[actions.params]]
24
+ name = "key"
25
+ type = "string"
26
+ required = true
27
+ description = "Unique decision key (hierarchical path recommended, e.g., \"auth/method\")"
28
+
29
+ [[actions.params]]
30
+ name = "value"
31
+ type = "string | number"
32
+ required = true
33
+ description = "Decision value"
34
+
35
+ [[actions.params]]
36
+ name = "tags"
37
+ type = "string[]"
38
+ required = false
39
+ description = "Tags for categorization"
40
+ default = "[]"
41
+
42
+ [[actions.params]]
43
+ name = "layer"
44
+ type = "string"
45
+ required = false
46
+ description = "Architecture layer: presentation, business, data, infrastructure, cross-cutting, documentation, planning, coordination, review"
47
+
48
+ [[actions.params]]
49
+ name = "scope"
50
+ type = "string"
51
+ required = false
52
+ description = "Module or component scope"
53
+
54
+ [[actions.params]]
55
+ name = "version"
56
+ type = "string"
57
+ required = false
58
+ description = "Version identifier"
59
+ default = "v1.0.0"
60
+
61
+ [[actions.params]]
62
+ name = "status"
63
+ type = "string"
64
+ required = false
65
+ description = "Decision status: active, deprecated, draft"
66
+ default = "active"
67
+
68
+ [[actions.examples]]
69
+ title = "Basic decision"
70
+ code = '''
71
+ {
72
+ "action": "set",
73
+ "key": "auth/method",
74
+ "value": "JWT tokens with refresh",
75
+ "tags": ["security", "auth"],
76
+ "layer": "infrastructure"
77
+ }
78
+ '''
79
+ explanation = "Store a simple architectural decision with tags and layer assignment"
80
+
81
+ [[actions.examples]]
82
+ title = "Decision with scope"
83
+ code = '''
84
+ {
85
+ "action": "set",
86
+ "key": "db/connection-pool-size",
87
+ "value": 20,
88
+ "tags": ["database", "performance"],
89
+ "layer": "data",
90
+ "scope": "api-service"
91
+ }
92
+ '''
93
+ explanation = "Store a numeric decision scoped to a specific service"
94
+
95
+ [[actions.examples]]
96
+ title = "Decision with rationale (two-step workflow)"
97
+ code = '''
98
+ # Step 1: Set the decision
99
+ {"action":"set","key":"auth/method","value":"JWT tokens","layer":"infrastructure","tags":["security"]}
100
+
101
+ # Step 2: Add rationale (separate call required)
102
+ {"action":"add_decision_context","key":"auth/method","rationale":"Stateless auth ideal for microservices"}
103
+ '''
104
+ explanation = "To include rationale, alternatives, or tradeoffs, you MUST use add_decision_context as a separate step. The set action does not accept these parameters."
105
+
106
+ # -----------------------------------------------------------------------------
107
+
108
+ [[actions]]
109
+ name = "get"
110
+ description = "Retrieve a specific decision by key"
111
+
112
+ [[actions.params]]
113
+ name = "action"
114
+ type = "string"
115
+ required = true
116
+ description = "Must be \"get\""
117
+
118
+ [[actions.params]]
119
+ name = "key"
120
+ type = "string"
121
+ required = true
122
+ description = "Decision key to retrieve"
123
+
124
+ [[actions.params]]
125
+ name = "include_context"
126
+ type = "boolean"
127
+ required = false
128
+ description = "Include rationale/alternatives/tradeoffs"
129
+ default = "false"
130
+
131
+ [[actions.examples]]
132
+ title = "Get decision"
133
+ code = '''
134
+ {
135
+ "action": "get",
136
+ "key": "auth/method"
137
+ }
138
+ '''
139
+ explanation = "Retrieve a decision by its key"
140
+
141
+ [[actions.examples]]
142
+ title = "Get with context"
143
+ code = '''
144
+ {
145
+ "action": "get",
146
+ "key": "auth/method",
147
+ "include_context": true
148
+ }
149
+ '''
150
+ explanation = "Retrieve a decision with its full context (rationale, alternatives, tradeoffs)"
151
+
152
+ # -----------------------------------------------------------------------------
153
+
154
+ [[actions]]
155
+ name = "list"
156
+ description = "List decisions with filtering options"
157
+
158
+ [[actions.params]]
159
+ name = "action"
160
+ type = "string"
161
+ required = true
162
+ description = "Must be \"list\""
163
+
164
+ [[actions.params]]
165
+ name = "status"
166
+ type = "string"
167
+ required = false
168
+ description = "Filter by status: active, deprecated, draft"
169
+
170
+ [[actions.params]]
171
+ name = "layer"
172
+ type = "string"
173
+ required = false
174
+ description = "Filter by layer"
175
+
176
+ [[actions.params]]
177
+ name = "limit"
178
+ type = "number"
179
+ required = false
180
+ description = "Maximum results"
181
+ default = "50"
182
+
183
+ [[actions.examples]]
184
+ title = "List all active decisions"
185
+ code = '''
186
+ {
187
+ "action": "list",
188
+ "status": "active"
189
+ }
190
+ '''
191
+ explanation = "List all active decisions"
192
+
193
+ [[actions.examples]]
194
+ title = "List by layer"
195
+ code = '''
196
+ {
197
+ "action": "list",
198
+ "layer": "infrastructure",
199
+ "limit": 20
200
+ }
201
+ '''
202
+ explanation = "List decisions in a specific architecture layer"
203
+
204
+ # -----------------------------------------------------------------------------
205
+
206
+ [[actions]]
207
+ name = "search_tags"
208
+ description = "Search decisions by tags (AND/OR logic)"
209
+
210
+ [[actions.params]]
211
+ name = "action"
212
+ type = "string"
213
+ required = true
214
+ description = "Must be \"search_tags\""
215
+
216
+ [[actions.params]]
217
+ name = "tags"
218
+ type = "string[]"
219
+ required = true
220
+ description = "Tags to search for"
221
+
222
+ [[actions.params]]
223
+ name = "match_all"
224
+ type = "boolean"
225
+ required = false
226
+ description = "If true, match ALL tags (AND); if false, match ANY (OR)"
227
+ default = "false"
228
+
229
+ [[actions.examples]]
230
+ title = "Search by tags (OR)"
231
+ code = '''
232
+ {
233
+ "action": "search_tags",
234
+ "tags": ["security", "auth"]
235
+ }
236
+ '''
237
+ explanation = "Find decisions with any of the specified tags"
238
+
239
+ # -----------------------------------------------------------------------------
240
+
241
+ [[actions]]
242
+ name = "search_layer"
243
+ description = "Search decisions by architecture layer"
244
+
245
+ [[actions.params]]
246
+ name = "action"
247
+ type = "string"
248
+ required = true
249
+ description = "Must be \"search_layer\""
250
+
251
+ [[actions.params]]
252
+ name = "layer"
253
+ type = "string"
254
+ required = true
255
+ description = "Layer to search"
256
+
257
+ [[actions.examples]]
258
+ title = "Search by layer"
259
+ code = '''
260
+ {
261
+ "action": "search_layer",
262
+ "layer": "infrastructure"
263
+ }
264
+ '''
265
+ explanation = "Find all decisions in the infrastructure layer"
266
+
267
+ # -----------------------------------------------------------------------------
268
+
269
+ [[actions]]
270
+ name = "versions"
271
+ description = "Get version history for a decision"
272
+
273
+ [[actions.params]]
274
+ name = "action"
275
+ type = "string"
276
+ required = true
277
+ description = "Must be \"versions\""
278
+
279
+ [[actions.params]]
280
+ name = "key"
281
+ type = "string"
282
+ required = true
283
+ description = "Decision key"
284
+
285
+ [[actions.examples]]
286
+ title = "Get version history"
287
+ code = '''
288
+ {
289
+ "action": "versions",
290
+ "key": "auth/method"
291
+ }
292
+ '''
293
+ explanation = "View all previous versions of a decision"
294
+
295
+ # -----------------------------------------------------------------------------
296
+
297
+ [[actions]]
298
+ name = "quick_set"
299
+ description = "Simplified decision setter with auto-inferred layer"
300
+
301
+ [[actions.params]]
302
+ name = "action"
303
+ type = "string"
304
+ required = true
305
+ description = "Must be \"quick_set\""
306
+
307
+ [[actions.params]]
308
+ name = "key"
309
+ type = "string"
310
+ required = true
311
+ description = "Decision key"
312
+
313
+ [[actions.params]]
314
+ name = "value"
315
+ type = "string | number"
316
+ required = true
317
+ description = "Decision value"
318
+
319
+ [[actions.examples]]
320
+ title = "Quick set"
321
+ code = '''
322
+ {
323
+ "action": "quick_set",
324
+ "key": "api/rate-limit",
325
+ "value": 1000
326
+ }
327
+ '''
328
+ explanation = "Quickly set a decision with minimal parameters (layer auto-inferred from key)"
329
+
330
+ # -----------------------------------------------------------------------------
331
+
332
+ [[actions]]
333
+ name = "search_advanced"
334
+ description = "Advanced search with multiple criteria"
335
+
336
+ [[actions.params]]
337
+ name = "action"
338
+ type = "string"
339
+ required = true
340
+ description = "Must be \"search_advanced\""
341
+
342
+ [[actions.params]]
343
+ name = "key_pattern"
344
+ type = "string"
345
+ required = false
346
+ description = "Key pattern to match (supports wildcards)"
347
+
348
+ [[actions.params]]
349
+ name = "tags"
350
+ type = "string[]"
351
+ required = false
352
+ description = "Tags to filter by"
353
+
354
+ [[actions.params]]
355
+ name = "layer"
356
+ type = "string"
357
+ required = false
358
+ description = "Layer to filter by"
359
+
360
+ [[actions.params]]
361
+ name = "status"
362
+ type = "string"
363
+ required = false
364
+ description = "Status to filter by"
365
+
366
+ [[actions.examples]]
367
+ title = "Advanced search"
368
+ code = '''
369
+ {
370
+ "action": "search_advanced",
371
+ "key_pattern": "auth/*",
372
+ "tags": ["security"],
373
+ "layer": "infrastructure"
374
+ }
375
+ '''
376
+ explanation = "Search with multiple criteria combined"
377
+
378
+ # -----------------------------------------------------------------------------
379
+
380
+ [[actions]]
381
+ name = "set_batch"
382
+ description = "Batch set multiple decisions atomically"
383
+
384
+ [[actions.params]]
385
+ name = "action"
386
+ type = "string"
387
+ required = true
388
+ description = "Must be \"set_batch\""
389
+
390
+ [[actions.params]]
391
+ name = "decisions"
392
+ type = "object[]"
393
+ required = true
394
+ description = "Array of decision objects (each with key, value, and optional metadata)"
395
+
396
+ [[actions.examples]]
397
+ title = "Batch set"
398
+ code = '''
399
+ {
400
+ "action": "set_batch",
401
+ "decisions": [
402
+ {"key": "api/version", "value": "v2", "layer": "presentation"},
403
+ {"key": "api/format", "value": "JSON", "layer": "presentation"}
404
+ ]
405
+ }
406
+ '''
407
+ explanation = "Set multiple decisions in a single atomic operation"
408
+
409
+ # -----------------------------------------------------------------------------
410
+
411
+ [[actions]]
412
+ name = "has_updates"
413
+ description = "Check for new/updated decisions since timestamp"
414
+
415
+ [[actions.params]]
416
+ name = "action"
417
+ type = "string"
418
+ required = true
419
+ description = "Must be \"has_updates\""
420
+
421
+ [[actions.params]]
422
+ name = "since"
423
+ type = "number"
424
+ required = true
425
+ description = "Unix timestamp to check from"
426
+
427
+ [[actions.examples]]
428
+ title = "Check for updates"
429
+ code = '''
430
+ {
431
+ "action": "has_updates",
432
+ "since": 1704067200
433
+ }
434
+ '''
435
+ explanation = "Check if any decisions have been added or modified since the given timestamp"
436
+
437
+ # -----------------------------------------------------------------------------
438
+
439
+ [[actions]]
440
+ name = "set_from_template"
441
+ description = "Create decision from predefined template"
442
+
443
+ [[actions.params]]
444
+ name = "action"
445
+ type = "string"
446
+ required = true
447
+ description = "Must be \"set_from_template\""
448
+
449
+ [[actions.params]]
450
+ name = "template_name"
451
+ type = "string"
452
+ required = true
453
+ description = "Name of the template to use"
454
+
455
+ [[actions.params]]
456
+ name = "key"
457
+ type = "string"
458
+ required = true
459
+ description = "Decision key"
460
+
461
+ [[actions.params]]
462
+ name = "value"
463
+ type = "string"
464
+ required = true
465
+ description = "Decision value"
466
+
467
+ [[actions.examples]]
468
+ title = "Create from template"
469
+ code = '''
470
+ {
471
+ "action": "set_from_template",
472
+ "template_name": "architecture_decision",
473
+ "key": "db/engine",
474
+ "value": "PostgreSQL 15"
475
+ }
476
+ '''
477
+ explanation = "Create a decision using a predefined template for consistent metadata"
478
+
479
+ # -----------------------------------------------------------------------------
480
+
481
+ [[actions]]
482
+ name = "create_template"
483
+ description = "Create reusable decision template"
484
+
485
+ [[actions.params]]
486
+ name = "action"
487
+ type = "string"
488
+ required = true
489
+ description = "Must be \"create_template\""
490
+
491
+ [[actions.params]]
492
+ name = "name"
493
+ type = "string"
494
+ required = true
495
+ description = "Template name"
496
+
497
+ [[actions.params]]
498
+ name = "defaults"
499
+ type = "object"
500
+ required = true
501
+ description = "Default values for decisions created from this template"
502
+
503
+ [[actions.examples]]
504
+ title = "Create template"
505
+ code = '''
506
+ {
507
+ "action": "create_template",
508
+ "name": "security_decision",
509
+ "defaults": {
510
+ "layer": "cross-cutting",
511
+ "tags": ["security"],
512
+ "status": "active"
513
+ }
514
+ }
515
+ '''
516
+ explanation = "Create a template for security-related decisions"
517
+
518
+ # -----------------------------------------------------------------------------
519
+
520
+ [[actions]]
521
+ name = "list_templates"
522
+ description = "List all available decision templates"
523
+
524
+ [[actions.params]]
525
+ name = "action"
526
+ type = "string"
527
+ required = true
528
+ description = "Must be \"list_templates\""
529
+
530
+ [[actions.examples]]
531
+ title = "List templates"
532
+ code = '''
533
+ {
534
+ "action": "list_templates"
535
+ }
536
+ '''
537
+ explanation = "View all available decision templates"
538
+
539
+ # -----------------------------------------------------------------------------
540
+
541
+ [[actions]]
542
+ name = "hard_delete"
543
+ description = "Permanently delete decision (irreversible)"
544
+
545
+ [[actions.params]]
546
+ name = "action"
547
+ type = "string"
548
+ required = true
549
+ description = "Must be \"hard_delete\""
550
+
551
+ [[actions.params]]
552
+ name = "key"
553
+ type = "string"
554
+ required = true
555
+ description = "Decision key to delete"
556
+
557
+ [[actions.examples]]
558
+ title = "Hard delete"
559
+ code = '''
560
+ {
561
+ "action": "hard_delete",
562
+ "key": "deprecated/old-setting"
563
+ }
564
+ '''
565
+ explanation = "Permanently remove a decision and all its history"
566
+
567
+ # -----------------------------------------------------------------------------
568
+
569
+ [[actions]]
570
+ name = "add_decision_context"
571
+ description = "Add rich context (rationale, alternatives, tradeoffs)"
572
+
573
+ [[actions.params]]
574
+ name = "action"
575
+ type = "string"
576
+ required = true
577
+ description = "Must be \"add_decision_context\""
578
+
579
+ [[actions.params]]
580
+ name = "key"
581
+ type = "string"
582
+ required = true
583
+ description = "Decision key"
584
+
585
+ [[actions.params]]
586
+ name = "rationale"
587
+ type = "string"
588
+ required = true
589
+ description = "Why this decision was made"
590
+
591
+ [[actions.params]]
592
+ name = "alternatives"
593
+ type = "string"
594
+ required = false
595
+ description = "Other options considered"
596
+
597
+ [[actions.params]]
598
+ name = "tradeoffs"
599
+ type = "string"
600
+ required = false
601
+ description = "Tradeoffs of this decision"
602
+
603
+ [[actions.examples]]
604
+ title = "Add context"
605
+ code = '''
606
+ {
607
+ "action": "add_decision_context",
608
+ "key": "auth/method",
609
+ "rationale": "JWT provides stateless authentication suitable for our microservices architecture",
610
+ "alternatives": "Session-based auth, OAuth2 only",
611
+ "tradeoffs": "Requires token refresh handling, larger payload than session cookies"
612
+ }
613
+ '''
614
+ explanation = "Document the reasoning behind a decision for future reference"
615
+
616
+ # -----------------------------------------------------------------------------
617
+
618
+ [[actions]]
619
+ name = "list_decision_contexts"
620
+ description = "List decision contexts with filtering"
621
+
622
+ [[actions.params]]
623
+ name = "action"
624
+ type = "string"
625
+ required = true
626
+ description = "Must be \"list_decision_contexts\""
627
+
628
+ [[actions.params]]
629
+ name = "key"
630
+ type = "string"
631
+ required = false
632
+ description = "Filter by decision key"
633
+
634
+ [[actions.examples]]
635
+ title = "List contexts"
636
+ code = '''
637
+ {
638
+ "action": "list_decision_contexts",
639
+ "key": "auth/method"
640
+ }
641
+ '''
642
+ explanation = "View all context entries for a decision"
643
+
644
+ # -----------------------------------------------------------------------------
645
+
646
+ [[actions]]
647
+ name = "analytics"
648
+ description = "Get decision analytics and statistics"
649
+
650
+ [[actions.params]]
651
+ name = "action"
652
+ type = "string"
653
+ required = true
654
+ description = "Must be \"analytics\""
655
+
656
+ [[actions.examples]]
657
+ title = "Get analytics"
658
+ code = '''
659
+ {
660
+ "action": "analytics"
661
+ }
662
+ '''
663
+ explanation = "View statistics about decisions (count by layer, status, tags, etc.)"
664
+
665
+ # -----------------------------------------------------------------------------
666
+
667
+ [[actions]]
668
+ name = "create_policy"
669
+ description = "Create reusable decision policy with validation"
670
+
671
+ [[actions.params]]
672
+ name = "action"
673
+ type = "string"
674
+ required = true
675
+ description = "Must be \"create_policy\""
676
+
677
+ [[actions.params]]
678
+ name = "name"
679
+ type = "string"
680
+ required = true
681
+ description = "Policy name"
682
+
683
+ [[actions.params]]
684
+ name = "defaults"
685
+ type = "object"
686
+ required = false
687
+ description = "Default values"
688
+
689
+ [[actions.params]]
690
+ name = "validation_rules"
691
+ type = "object"
692
+ required = false
693
+ description = "Validation rules (regex patterns, etc.)"
694
+
695
+ [[actions.params]]
696
+ name = "quality_gates"
697
+ type = "object"
698
+ required = false
699
+ description = "Required fields and quality checks"
700
+
701
+ [[actions.examples]]
702
+ title = "Create policy"
703
+ code = '''
704
+ {
705
+ "action": "create_policy",
706
+ "name": "cve_tracking",
707
+ "defaults": {
708
+ "layer": "cross-cutting",
709
+ "tags": ["security", "vulnerability"]
710
+ },
711
+ "validation_rules": {
712
+ "patterns": {"key": "^CVE-\\d{4}-\\d{4,7}$"}
713
+ },
714
+ "quality_gates": {
715
+ "required_fields": ["rationale"]
716
+ }
717
+ }
718
+ '''
719
+ explanation = "Create a policy that enforces CVE key format and requires rationale"
720
+
721
+ # -----------------------------------------------------------------------------
722
+
723
+ [[actions]]
724
+ name = "list_policies"
725
+ description = "List all available decision policies"
726
+
727
+ [[actions.params]]
728
+ name = "action"
729
+ type = "string"
730
+ required = true
731
+ description = "Must be \"list_policies\""
732
+
733
+ [[actions.examples]]
734
+ title = "List policies"
735
+ code = '''
736
+ {
737
+ "action": "list_policies"
738
+ }
739
+ '''
740
+ explanation = "View all available decision policies (built-in and custom)"
741
+
742
+ # -----------------------------------------------------------------------------
743
+
744
+ [[actions]]
745
+ name = "set_from_policy"
746
+ description = "Create decision from policy template"
747
+
748
+ [[actions.params]]
749
+ name = "action"
750
+ type = "string"
751
+ required = true
752
+ description = "Must be \"set_from_policy\""
753
+
754
+ [[actions.params]]
755
+ name = "policy"
756
+ type = "string"
757
+ required = true
758
+ description = "Policy name to use"
759
+
760
+ [[actions.params]]
761
+ name = "key"
762
+ type = "string"
763
+ required = true
764
+ description = "Decision key"
765
+
766
+ [[actions.params]]
767
+ name = "value"
768
+ type = "string"
769
+ required = true
770
+ description = "Decision value"
771
+
772
+ [[actions.examples]]
773
+ title = "Create from policy"
774
+ code = '''
775
+ {
776
+ "action": "set_from_policy",
777
+ "policy": "security_vulnerability",
778
+ "key": "CVE-2024-12345",
779
+ "value": "Patched in v2.3.1"
780
+ }
781
+ '''
782
+ explanation = "Create a decision using policy defaults and validation"
783
+
784
+ # -----------------------------------------------------------------------------
785
+
786
+ [[actions]]
787
+ name = "help"
788
+ description = "Get decision tool documentation"
789
+
790
+ [[actions.params]]
791
+ name = "action"
792
+ type = "string"
793
+ required = true
794
+ description = "Must be \"help\""
795
+
796
+ [[actions.examples]]
797
+ title = "Get help"
798
+ code = '''
799
+ {
800
+ "action": "help"
801
+ }
802
+ '''
803
+ explanation = "Display decision tool documentation"
804
+
805
+ # -----------------------------------------------------------------------------
806
+
807
+ [[actions]]
808
+ name = "example"
809
+ description = "Get decision tool examples"
810
+
811
+ [[actions.params]]
812
+ name = "action"
813
+ type = "string"
814
+ required = true
815
+ description = "Must be \"example\""
816
+
817
+ [[actions.examples]]
818
+ title = "Get examples"
819
+ code = '''
820
+ {
821
+ "action": "example"
822
+ }
823
+ '''
824
+ explanation = "Display decision tool usage examples"
825
+
826
+ # -----------------------------------------------------------------------------
827
+
828
+ [[actions]]
829
+ name = "use_case"
830
+ description = "Get decision tool use cases"
831
+
832
+ [[actions.params]]
833
+ name = "action"
834
+ type = "string"
835
+ required = true
836
+ description = "Must be \"use_case\""
837
+
838
+ [[actions.examples]]
839
+ title = "Get use cases"
840
+ code = '''
841
+ {
842
+ "action": "use_case"
843
+ }
844
+ '''
845
+ explanation = "Display decision tool use case workflows"