dsh-knowhub 0.9.0 → 0.10.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 (195) hide show
  1. package/README.md +11 -2
  2. package/cordis.patch.yml +10 -0
  3. package/lib/host/model.js +1 -1
  4. package/lib/host/pipeline/incremental.js +3 -3
  5. package/lib/host/pipeline/initialize.js +144 -27
  6. package/lib/host/pipeline/model-output.js +2 -2
  7. package/package.json +3 -2
  8. package/skills/archify/LICENSE +202 -0
  9. package/skills/archify/LICENSE-MIT +22 -0
  10. package/skills/archify/NOTICE +26 -0
  11. package/skills/archify/SKILL.md +137 -0
  12. package/skills/archify/THIRD_PARTY_NOTICES.md +78 -0
  13. package/skills/archify/assets/JetBrainsMono-OFL.txt +93 -0
  14. package/skills/archify/assets/template.html +14768 -0
  15. package/skills/archify/bin/archify.mjs +7289 -0
  16. package/skills/archify/bin/delivery-update.mjs +92 -0
  17. package/skills/archify/bin/finalize.mjs +1055 -0
  18. package/skills/archify/bin/open-artifact.mjs +146 -0
  19. package/skills/archify/bin/preview.mjs +970 -0
  20. package/skills/archify/bin/recover-output.mjs +41 -0
  21. package/skills/archify/bin/visual-check.mjs +2780 -0
  22. package/skills/archify/brand-marks/README.md +31 -0
  23. package/skills/archify/brand-marks/catalog.json +131 -0
  24. package/skills/archify/delta/architecture-delta.mjs +1318 -0
  25. package/skills/archify/examples/agent-run.lifecycle.json +55 -0
  26. package/skills/archify/examples/agent-tool-call.workflow.json +74 -0
  27. package/skills/archify/examples/archify-dev-activity.timeline.json +176 -0
  28. package/skills/archify/examples/archify-repository.tree.json +197 -0
  29. package/skills/archify/examples/async-job-roundtrip.sequence.json +56 -0
  30. package/skills/archify/examples/brand-aware-delivery.architecture.json +34 -0
  31. package/skills/archify/examples/cache-miss-request.sequence.json +77 -0
  32. package/skills/archify/examples/checkout-platform.base.architecture.json +32 -0
  33. package/skills/archify/examples/checkout-platform.head.architecture.json +32 -0
  34. package/skills/archify/examples/checkout-request.waterfall.json +20 -0
  35. package/skills/archify/examples/delivery.explainer.json +155 -0
  36. package/skills/archify/examples/deployment-release.lifecycle.json +72 -0
  37. package/skills/archify/examples/event-stream.dataflow.json +52 -0
  38. package/skills/archify/examples/example-rebuild.waterfall.json +212 -0
  39. package/skills/archify/examples/holiday-planning.workflow.json +143 -0
  40. package/skills/archify/examples/incident-response.workflow.json +59 -0
  41. package/skills/archify/examples/locales/de.json +463 -0
  42. package/skills/archify/examples/locales/fr.json +463 -0
  43. package/skills/archify/examples/locales/fr.partial.json +22 -0
  44. package/skills/archify/examples/locales/it.json +463 -0
  45. package/skills/archify/examples/locales/ja.json +463 -0
  46. package/skills/archify/examples/locales/pt.json +463 -0
  47. package/skills/archify/examples/locales/ru.json +463 -0
  48. package/skills/archify/examples/orders.erd.json +337 -0
  49. package/skills/archify/examples/payment-incident.timeline.json +24 -0
  50. package/skills/archify/examples/payment-platform.tree.json +22 -0
  51. package/skills/archify/examples/payment-processors.class.json +177 -0
  52. package/skills/archify/examples/payments.class.json +85 -0
  53. package/skills/archify/examples/product-analytics.dataflow.json +71 -0
  54. package/skills/archify/examples/production-deployment.architecture.json +51 -0
  55. package/skills/archify/examples/release-delivery.workflow.json +57 -0
  56. package/skills/archify/examples/subscription-billing.erd.json +548 -0
  57. package/skills/archify/examples/web-app.architecture.json +41 -0
  58. package/skills/archify/explainer/browser-check.mjs +208 -0
  59. package/skills/archify/explainer/charts.mjs +70 -0
  60. package/skills/archify/explainer/check.mjs +167 -0
  61. package/skills/archify/explainer/diagrams.mjs +517 -0
  62. package/skills/archify/explainer/diff.mjs +124 -0
  63. package/skills/archify/explainer/inline.mjs +155 -0
  64. package/skills/archify/explainer/layout.mjs +35 -0
  65. package/skills/archify/explainer/page-bundle.mjs +16 -0
  66. package/skills/archify/explainer/parse.mjs +300 -0
  67. package/skills/archify/explainer/patch.mjs +117 -0
  68. package/skills/archify/explainer/prepare.mjs +131 -0
  69. package/skills/archify/explainer/reader.css +472 -0
  70. package/skills/archify/explainer/reader.js +666 -0
  71. package/skills/archify/explainer/render.mjs +224 -0
  72. package/skills/archify/explainer/revision.mjs +20 -0
  73. package/skills/archify/explainer/sources.mjs +318 -0
  74. package/skills/archify/explainer/validate.mjs +138 -0
  75. package/skills/archify/explainer/vendor/pele/LICENSE +40 -0
  76. package/skills/archify/explainer/vendor/pele/README.md +5 -0
  77. package/skills/archify/explainer/vendor/pele/chunks/3DKXF73K.js +4 -0
  78. package/skills/archify/explainer/vendor/pele/chunks/42UTT654.js +3 -0
  79. package/skills/archify/explainer/vendor/pele/chunks/DKTLEL5E.js +1 -0
  80. package/skills/archify/explainer/vendor/pele/chunks/EEIX5ZYH.js +2 -0
  81. package/skills/archify/explainer/vendor/pele/chunks/EJ5KOXYD.js +25 -0
  82. package/skills/archify/explainer/vendor/pele/chunks/GUJTEFZK.js +1 -0
  83. package/skills/archify/explainer/vendor/pele/chunks/IZOKQ2GT.js +4 -0
  84. package/skills/archify/explainer/vendor/pele/chunks/L4LY553T.js +3 -0
  85. package/skills/archify/explainer/vendor/pele/chunks/MSKIJHB2.js +2 -0
  86. package/skills/archify/explainer/vendor/pele/chunks/RVARI57O.js +1 -0
  87. package/skills/archify/explainer/vendor/pele/chunks/UKSIWDDN.js +2 -0
  88. package/skills/archify/explainer/vendor/pele/chunks/UPTXNAXN.js +2 -0
  89. package/skills/archify/explainer/vendor/pele/chunks/XTDUIGUI.js +9 -0
  90. package/skills/archify/explainer/vendor/pele/chunks/YAYTP6L5.js +9 -0
  91. package/skills/archify/explainer/vendor/pele/core.js +1 -0
  92. package/skills/archify/explainer/vendor/pele/diagrams/pie.js +1 -0
  93. package/skills/archify/explainer/vendor/pele/diagrams/quadrantChart.js +1 -0
  94. package/skills/archify/explainer/vendor/pele/diagrams/radar.js +1 -0
  95. package/skills/archify/explainer/vendor/pele/diagrams/sankey.js +1 -0
  96. package/skills/archify/explainer/vendor/pele/diagrams/venn.js +1 -0
  97. package/skills/archify/explainer/vendor/pele/diagrams/xychart.js +1 -0
  98. package/skills/archify/explainer/writing.mjs +139 -0
  99. package/skills/archify/locales/README.md +40 -0
  100. package/skills/archify/locales/ar.json +488 -0
  101. package/skills/archify/locales/en.json +488 -0
  102. package/skills/archify/locales/es.json +488 -0
  103. package/skills/archify/locales/ko.json +488 -0
  104. package/skills/archify/locales/manifest.json +10 -0
  105. package/skills/archify/locales/zh-CN.json +488 -0
  106. package/skills/archify/locales/zh-TW.json +488 -0
  107. package/skills/archify/migrations/workflow-v2.mjs +280 -0
  108. package/skills/archify/package.json +17 -0
  109. package/skills/archify/recipes/scenarios.mjs +455 -0
  110. package/skills/archify/references/architecture-layout-repair.md +18 -0
  111. package/skills/archify/references/authoring-contract.md +645 -0
  112. package/skills/archify/references/authoring-defaults.md +57 -0
  113. package/skills/archify/references/brand-marks.md +119 -0
  114. package/skills/archify/references/delivery-contract.md +665 -0
  115. package/skills/archify/references/explainer-authoring.md +274 -0
  116. package/skills/archify/references/repository-authoring.md +126 -0
  117. package/skills/archify/references/update-awareness.md +13 -0
  118. package/skills/archify/references/viewer-runtime.md +52 -0
  119. package/skills/archify/renderers/architecture/grid.mjs +62 -0
  120. package/skills/archify/renderers/architecture/labels.mjs +2 -0
  121. package/skills/archify/renderers/architecture/render-architecture.mjs +1204 -0
  122. package/skills/archify/renderers/architecture/routing.mjs +1469 -0
  123. package/skills/archify/renderers/class/README.md +130 -0
  124. package/skills/archify/renderers/class/render-class.mjs +1095 -0
  125. package/skills/archify/renderers/dataflow/README.md +176 -0
  126. package/skills/archify/renderers/dataflow/dataflow-compiler.mjs +1605 -0
  127. package/skills/archify/renderers/dataflow/joint-label-routing.mjs +165 -0
  128. package/skills/archify/renderers/dataflow/label-capacity.mjs +81 -0
  129. package/skills/archify/renderers/dataflow/render-dataflow.mjs +23 -0
  130. package/skills/archify/renderers/erd/README.md +246 -0
  131. package/skills/archify/renderers/erd/grid.mjs +150 -0
  132. package/skills/archify/renderers/erd/render-erd.mjs +1588 -0
  133. package/skills/archify/renderers/explainer/render-explainer.mjs +42 -0
  134. package/skills/archify/renderers/lifecycle/README.md +104 -0
  135. package/skills/archify/renderers/lifecycle/render-lifecycle.mjs +1134 -0
  136. package/skills/archify/renderers/sequence/README.md +146 -0
  137. package/skills/archify/renderers/sequence/render-sequence.mjs +1105 -0
  138. package/skills/archify/renderers/shared/atomic-output.mjs +1982 -0
  139. package/skills/archify/renderers/shared/automatic-labels.mjs +290 -0
  140. package/skills/archify/renderers/shared/brand-marks.mjs +706 -0
  141. package/skills/archify/renderers/shared/cli.mjs +430 -0
  142. package/skills/archify/renderers/shared/desktop-readability.mjs +132 -0
  143. package/skills/archify/renderers/shared/diagnostics.mjs +0 -0
  144. package/skills/archify/renderers/shared/engineering-profiles.mjs +157 -0
  145. package/skills/archify/renderers/shared/generated-brand-marks.mjs +2003 -0
  146. package/skills/archify/renderers/shared/generated-validators.mjs +279 -0
  147. package/skills/archify/renderers/shared/geometry.mjs +2073 -0
  148. package/skills/archify/renderers/shared/i18n.mjs +328 -0
  149. package/skills/archify/renderers/shared/layout-report.mjs +57 -0
  150. package/skills/archify/renderers/shared/legend.mjs +227 -0
  151. package/skills/archify/renderers/shared/node-card-style.mjs +32 -0
  152. package/skills/archify/renderers/shared/output-path.mjs +440 -0
  153. package/skills/archify/renderers/shared/owned-temp-directory.mjs +82 -0
  154. package/skills/archify/renderers/shared/path-semantics.mjs +1017 -0
  155. package/skills/archify/renderers/shared/portable-path.mjs +408 -0
  156. package/skills/archify/renderers/shared/repository-evidence.mjs +394 -0
  157. package/skills/archify/renderers/shared/repository-location.mjs +71 -0
  158. package/skills/archify/renderers/shared/route-quality.mjs +670 -0
  159. package/skills/archify/renderers/shared/sidecar-path.mjs +38 -0
  160. package/skills/archify/renderers/shared/software-notices.mjs +6 -0
  161. package/skills/archify/renderers/shared/spatial-grid.mjs +66 -0
  162. package/skills/archify/renderers/shared/svg-path-analysis.mjs +135 -0
  163. package/skills/archify/renderers/shared/text-fit.mjs +105 -0
  164. package/skills/archify/renderers/shared/utils.mjs +260 -0
  165. package/skills/archify/renderers/shared/validator.mjs +83 -0
  166. package/skills/archify/renderers/timeline/README.md +76 -0
  167. package/skills/archify/renderers/timeline/render-timeline.mjs +576 -0
  168. package/skills/archify/renderers/tree/README.md +96 -0
  169. package/skills/archify/renderers/tree/render-tree.mjs +573 -0
  170. package/skills/archify/renderers/waterfall/README.md +73 -0
  171. package/skills/archify/renderers/waterfall/render-waterfall.mjs +413 -0
  172. package/skills/archify/renderers/workflow/README.md +337 -0
  173. package/skills/archify/renderers/workflow/render-workflow.mjs +47 -0
  174. package/skills/archify/renderers/workflow/workflow-compiler.mjs +5920 -0
  175. package/skills/archify/renderers/workflow/workflow-migration-geometry.mjs +161 -0
  176. package/skills/archify/renderers/workflow/workflow-placement-repair.mjs +94 -0
  177. package/skills/archify/schemas/README.md +258 -0
  178. package/skills/archify/schemas/architecture.schema.json +152 -0
  179. package/skills/archify/schemas/class.schema.json +345 -0
  180. package/skills/archify/schemas/common.schema.json +181 -0
  181. package/skills/archify/schemas/dataflow.schema.json +254 -0
  182. package/skills/archify/schemas/erd.schema.json +381 -0
  183. package/skills/archify/schemas/explainer.schema.json +927 -0
  184. package/skills/archify/schemas/lifecycle.schema.json +179 -0
  185. package/skills/archify/schemas/sequence.schema.json +234 -0
  186. package/skills/archify/schemas/timeline.schema.json +160 -0
  187. package/skills/archify/schemas/tree.schema.json +141 -0
  188. package/skills/archify/schemas/waterfall.schema.json +147 -0
  189. package/skills/archify/schemas/workflow.schema.json +439 -0
  190. package/skills/archify/scripts/check-render-output.mjs +1469 -0
  191. package/skills/archify/scripts/check-update.mjs +1717 -0
  192. package/skills/archify/scripts/delivery-update-child.mjs +26 -0
  193. package/skills/archify/scripts/render-examples.mjs +36 -0
  194. package/skills/archify/scripts/update-contract.mjs +187 -0
  195. package/skills/archify/skill-release.json +10 -0
@@ -0,0 +1,337 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "erd",
4
+ "meta": {
5
+ "title": "Order management schema",
6
+ "locale": "en",
7
+ "output": "examples/erd-orders-rendered.html",
8
+ "quality_profile": "showcase",
9
+ "views": [
10
+ {
11
+ "id": "identity",
12
+ "label": "Reference rows",
13
+ "focus": [
14
+ "customer",
15
+ "product"
16
+ ],
17
+ "note": "The rows everything else points at, with their unique keys."
18
+ },
19
+ {
20
+ "id": "checkout",
21
+ "label": "Checkout core",
22
+ "focus": [
23
+ "order",
24
+ "order_item",
25
+ "customer"
26
+ ],
27
+ "note": "order is the hub: order_item and payment both point back at it."
28
+ },
29
+ {
30
+ "id": "followups",
31
+ "label": "Payment and stock",
32
+ "focus": [
33
+ "payment",
34
+ "order",
35
+ "inventory",
36
+ "product"
37
+ ],
38
+ "note": "One optional dashed link and one mandatory stock link."
39
+ }
40
+ ]
41
+ },
42
+ "layout": {
43
+ "mode": "grid",
44
+ "gapY": 38,
45
+ "gapX": 72
46
+ },
47
+ "entities": [
48
+ {
49
+ "id": "customer",
50
+ "label": "customer",
51
+ "tag": "accounts",
52
+ "row": 0,
53
+ "col": 0,
54
+ "attributes": [
55
+ {
56
+ "name": "id",
57
+ "type": "bigint",
58
+ "key": "pk"
59
+ },
60
+ {
61
+ "name": "email",
62
+ "type": "varchar(255)",
63
+ "key": "uk"
64
+ },
65
+ {
66
+ "name": "display_name",
67
+ "type": "varchar(120)"
68
+ },
69
+ {
70
+ "name": "created_at",
71
+ "type": "timestamptz"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "id": "order",
77
+ "label": "order",
78
+ "tag": "checkout",
79
+ "row": 0,
80
+ "col": 1,
81
+ "width": 260,
82
+ "attributes": [
83
+ {
84
+ "name": "id",
85
+ "type": "bigint",
86
+ "key": "pk"
87
+ },
88
+ {
89
+ "name": "customer_id",
90
+ "type": "bigint",
91
+ "key": "fk",
92
+ "references": "customer.id"
93
+ },
94
+ {
95
+ "name": "status",
96
+ "type": "varchar(32)"
97
+ },
98
+ {
99
+ "name": "total_amount",
100
+ "type": "numeric(12,2)"
101
+ },
102
+ {
103
+ "name": "currency",
104
+ "type": "char(3)"
105
+ },
106
+ {
107
+ "name": "placed_at",
108
+ "type": "timestamptz"
109
+ },
110
+ {
111
+ "name": "updated_at",
112
+ "type": "timestamptz"
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ "id": "order_item",
118
+ "label": "order_item",
119
+ "tag": "line items",
120
+ "row": 1,
121
+ "col": 2,
122
+ "width": 254,
123
+ "attributes": [
124
+ {
125
+ "name": "id",
126
+ "type": "bigint",
127
+ "key": "pk"
128
+ },
129
+ {
130
+ "name": "order_id",
131
+ "type": "bigint",
132
+ "key": "fk",
133
+ "references": "order.id"
134
+ },
135
+ {
136
+ "name": "product_id",
137
+ "type": "bigint",
138
+ "key": "fk",
139
+ "references": "product.id"
140
+ },
141
+ {
142
+ "name": "quantity",
143
+ "type": "int"
144
+ },
145
+ {
146
+ "name": "unit_price",
147
+ "type": "numeric(12,2)"
148
+ },
149
+ {
150
+ "name": "discount_amount",
151
+ "type": "numeric(12,2)"
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "id": "product",
157
+ "label": "product",
158
+ "tag": "catalog",
159
+ "row": 1,
160
+ "col": 1,
161
+ "attributes": [
162
+ {
163
+ "name": "id",
164
+ "type": "bigint",
165
+ "key": "pk"
166
+ },
167
+ {
168
+ "name": "sku",
169
+ "type": "varchar(64)",
170
+ "key": "uk"
171
+ },
172
+ {
173
+ "name": "name",
174
+ "type": "varchar(160)"
175
+ },
176
+ {
177
+ "name": "price",
178
+ "type": "numeric(12,2)"
179
+ },
180
+ {
181
+ "name": "cost_amount",
182
+ "type": "numeric(12,2)"
183
+ },
184
+ {
185
+ "name": "active",
186
+ "type": "boolean"
187
+ },
188
+ {
189
+ "name": "created_at",
190
+ "type": "timestamptz"
191
+ }
192
+ ]
193
+ },
194
+ {
195
+ "id": "inventory",
196
+ "label": "inventory",
197
+ "tag": "catalog",
198
+ "row": 1,
199
+ "col": 0,
200
+ "attributes": [
201
+ {
202
+ "name": "id",
203
+ "type": "bigint",
204
+ "key": "pk"
205
+ },
206
+ {
207
+ "name": "product_id",
208
+ "type": "bigint",
209
+ "key": "fk",
210
+ "references": "product.id"
211
+ },
212
+ {
213
+ "name": "warehouse_code",
214
+ "type": "varchar(16)"
215
+ },
216
+ {
217
+ "name": "quantity",
218
+ "type": "int"
219
+ },
220
+ {
221
+ "name": "reserved_quantity",
222
+ "type": "int"
223
+ },
224
+ {
225
+ "name": "updated_at",
226
+ "type": "timestamptz"
227
+ }
228
+ ],
229
+ "width": 236
230
+ },
231
+ {
232
+ "id": "payment",
233
+ "label": "payment",
234
+ "tag": "checkout",
235
+ "row": 0,
236
+ "col": 2,
237
+ "attributes": [
238
+ {
239
+ "name": "id",
240
+ "type": "bigint",
241
+ "key": "pk"
242
+ },
243
+ {
244
+ "name": "order_id",
245
+ "type": "bigint",
246
+ "key": "fk",
247
+ "references": "order.id"
248
+ },
249
+ {
250
+ "name": "method",
251
+ "type": "varchar(32)"
252
+ },
253
+ {
254
+ "name": "amount",
255
+ "type": "numeric(12,2)"
256
+ },
257
+ {
258
+ "name": "paid_at",
259
+ "type": "timestamptz"
260
+ },
261
+ {
262
+ "name": "external_ref",
263
+ "type": "varchar(64)"
264
+ }
265
+ ]
266
+ }
267
+ ],
268
+ "relationships": [
269
+ {
270
+ "id": "order_customer",
271
+ "from": "order",
272
+ "to": "customer",
273
+ "label": "placed by",
274
+ "fromCardinality": "many",
275
+ "toCardinality": "one"
276
+ },
277
+ {
278
+ "id": "payment_order",
279
+ "from": "payment",
280
+ "to": "order",
281
+ "fromCardinality": "many",
282
+ "fromOptional": true,
283
+ "toCardinality": "one",
284
+ "identifying": false
285
+ },
286
+ {
287
+ "id": "order_item_order",
288
+ "from": "order_item",
289
+ "to": "order",
290
+ "fromCardinality": "many",
291
+ "toCardinality": "one"
292
+ },
293
+ {
294
+ "id": "order_item_product",
295
+ "from": "order_item",
296
+ "to": "product",
297
+ "fromCardinality": "many",
298
+ "toCardinality": "one"
299
+ },
300
+ {
301
+ "id": "inventory_product",
302
+ "from": "inventory",
303
+ "to": "product",
304
+ "fromCardinality": "many",
305
+ "toCardinality": "one"
306
+ }
307
+ ],
308
+ "cards": [
309
+ {
310
+ "dot": "cyan",
311
+ "title": "Keys",
312
+ "items": [
313
+ "Every child carries the parent id as a bigint foreign key.",
314
+ "order is the hub: order_item and payment each hold an order_id.",
315
+ "email and sku are unique, so they carry a secondary key marker."
316
+ ]
317
+ },
318
+ {
319
+ "dot": "amber",
320
+ "title": "Optionality",
321
+ "items": [
322
+ "An order may exist before any payment attempt, so the payment side is zero or many.",
323
+ "The payment relationship is non-identifying: it is drawn dashed.",
324
+ "customer, product, and order_item links are all mandatory."
325
+ ]
326
+ },
327
+ {
328
+ "dot": "emerald",
329
+ "title": "How the bands read",
330
+ "items": [
331
+ "The checkout band is the order and the payment that settles it.",
332
+ "The catalog band is what orders point at: one product, one stock record.",
333
+ "accounts and line items stand alone; a single-table domain keeps its tag in the table header."
334
+ ]
335
+ }
336
+ ]
337
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "timeline",
4
+ "meta": {
5
+ "title": "Payment failure incident",
6
+ "subtitle": "Illustrative incident: release, monitoring, and response events on one clock.",
7
+ "output": "payment-incident-timeline.html",
8
+ "evidence": "illustrative",
9
+ "timezone": "Asia/Shanghai",
10
+ "quality_profile": "showcase"
11
+ },
12
+ "lanes": [
13
+ { "id": "release", "label": "Release" },
14
+ { "id": "monitoring", "label": "Monitoring" },
15
+ { "id": "response", "label": "Response" }
16
+ ],
17
+ "events": [
18
+ { "id": "deploy", "at": "2026-10-01T10:00:00+08:00", "title": "Deploy v2.4", "detail": "New version starts serving payment requests.", "lane": "release", "kind": "change" },
19
+ { "id": "alert", "at": "2026-10-01T10:05:00+08:00", "title": "Payment failure alert", "detail": "Error rate on /pay rises above the paging threshold.", "lane": "monitoring", "kind": "alert" },
20
+ { "id": "rollback", "at": "2026-10-01T10:10:00+08:00", "title": "Start rollback", "detail": "On-call decides to return to v2.3.", "lane": "response", "kind": "action" },
21
+ { "id": "recovered", "at": "2026-10-01T10:15:00+08:00", "title": "Metrics recovered", "detail": "Payment success rate back to baseline.", "lane": "monitoring", "kind": "recovery" },
22
+ { "id": "closed", "at": "2026-10-01T10:20:00+08:00", "title": "Incident closed", "detail": "Stability confirmed; response ends.", "lane": "response", "kind": "action" }
23
+ ]
24
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "tree",
4
+ "meta": {
5
+ "title": "Payment platform capabilities",
6
+ "subtitle": "Illustrative decomposition: each capability belongs to exactly one parent. Links show containment, not calls.",
7
+ "output": "payment-platform-tree.html",
8
+ "quality_profile": "showcase"
9
+ },
10
+ "nodes": [
11
+ { "id": "platform", "label": "Payment platform", "sublabel": "Decomposed by capability" },
12
+ { "id": "orders", "label": "Orders", "parent": "platform", "sublabel": "Order lifecycle" },
13
+ { "id": "payments", "label": "Payments", "parent": "platform", "sublabel": "Money movement" },
14
+ { "id": "operations", "label": "Operations", "parent": "platform", "sublabel": "Back-office work" },
15
+ { "id": "create_order", "label": "Create order", "parent": "orders" },
16
+ { "id": "cancel_order", "label": "Cancel order", "parent": "orders" },
17
+ { "id": "card_payment", "label": "Card payment", "parent": "payments" },
18
+ { "id": "wallet_payment", "label": "Wallet payment", "parent": "payments" },
19
+ { "id": "refunds", "label": "Refund handling", "parent": "operations" },
20
+ { "id": "reconciliation", "label": "Transaction reconciliation", "parent": "operations" }
21
+ ]
22
+ }
@@ -0,0 +1,177 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "class",
4
+ "meta": {
5
+ "title": "Payment processor hierarchy",
6
+ "subtitle": "Illustrative module: one processor contract, a retrying base class, and five provider implementations.",
7
+ "output": "payment-processors-class.html",
8
+ "quality_profile": "showcase"
9
+ },
10
+ "layout": {
11
+ "mode": "grid"
12
+ },
13
+ "types": [
14
+ {
15
+ "id": "checkout_orchestrator",
16
+ "label": "CheckoutOrchestrator",
17
+ "kind": "class",
18
+ "sublabel": "Runs one checkout from order to receipt",
19
+ "row": 0,
20
+ "col": 0,
21
+ "attributes": [
22
+ { "name": "registry", "type": "ProcessorRegistry", "visibility": "private" },
23
+ { "name": "clock", "type": "Clock", "visibility": "private" }
24
+ ],
25
+ "methods": [
26
+ { "name": "checkout", "parameters": "order: Order, key: IdempotencyKey", "returns": "CheckoutResult", "visibility": "public" },
27
+ { "name": "cancelPendingAuthorization", "parameters": "orderId: OrderId", "returns": "void", "visibility": "public" }
28
+ ]
29
+ },
30
+ {
31
+ "id": "processor_registry",
32
+ "label": "ProcessorRegistry",
33
+ "kind": "class",
34
+ "sublabel": "Selects a processor for a payment method",
35
+ "row": 0,
36
+ "col": 1,
37
+ "attributes": [
38
+ { "name": "processors", "type": "Map<MethodType, PaymentProcessor>", "visibility": "private" }
39
+ ],
40
+ "methods": [
41
+ { "name": "processorFor", "parameters": "method: PaymentMethod", "returns": "PaymentProcessor", "visibility": "public" }
42
+ ]
43
+ },
44
+ {
45
+ "id": "payment_processor",
46
+ "label": "PaymentProcessor",
47
+ "kind": "interface",
48
+ "sublabel": "Authorize, capture, and refund contract",
49
+ "row": 0,
50
+ "col": 2.5,
51
+ "methods": [
52
+ { "name": "authorize", "parameters": "request: AuthorizationRequest", "returns": "AuthorizationResult", "visibility": "public", "abstract": true },
53
+ { "name": "capture", "parameters": "authorization: AuthorizationId, amount: Money", "returns": "CaptureResult", "visibility": "public", "abstract": true },
54
+ { "name": "refund", "parameters": "capture: CaptureId, amount: Money", "returns": "RefundResult", "visibility": "public", "abstract": true }
55
+ ]
56
+ },
57
+ {
58
+ "id": "order",
59
+ "label": "Order",
60
+ "kind": "class",
61
+ "sublabel": "Aggregate root for one purchase",
62
+ "row": 1,
63
+ "col": 0,
64
+ "attributes": [
65
+ { "name": "id", "type": "OrderId", "visibility": "public" },
66
+ { "name": "total", "type": "Money", "visibility": "public" },
67
+ { "name": "status", "type": "PaymentStatus", "visibility": "public" }
68
+ ],
69
+ "methods": [
70
+ { "name": "addLine", "parameters": "sku: Sku, quantity: int", "returns": "LineItem", "visibility": "public" },
71
+ { "name": "markAuthorized", "parameters": "authorization: AuthorizationId", "returns": "void", "visibility": "public" }
72
+ ]
73
+ },
74
+ {
75
+ "id": "payment_status",
76
+ "label": "PaymentStatus",
77
+ "kind": "enum",
78
+ "sublabel": "Lifecycle of the order's payment",
79
+ "row": 1,
80
+ "col": 1,
81
+ "attributes": [
82
+ { "name": "PENDING" },
83
+ { "name": "AUTHORIZED" },
84
+ { "name": "CAPTURED" },
85
+ { "name": "REFUNDED" },
86
+ { "name": "FAILED" }
87
+ ]
88
+ },
89
+ {
90
+ "id": "retrying_processor",
91
+ "label": "RetryingProcessorBase",
92
+ "kind": "abstract",
93
+ "sublabel": "Shared retry, timeout, and idempotency handling",
94
+ "row": 1,
95
+ "col": 2,
96
+ "attributes": [
97
+ { "name": "DEFAULT_TIMEOUT", "type": "Duration", "visibility": "public", "static": true },
98
+ { "name": "retryPolicy", "type": "RetryPolicy", "visibility": "protected" }
99
+ ],
100
+ "methods": [
101
+ { "name": "authorize", "parameters": "request: AuthorizationRequest", "returns": "AuthorizationResult", "visibility": "public" },
102
+ { "name": "sendToProvider", "parameters": "request: ProviderRequest", "returns": "ProviderResponse", "visibility": "protected", "abstract": true }
103
+ ]
104
+ },
105
+ {
106
+ "id": "bank_transfer",
107
+ "label": "BankTransferProcessor",
108
+ "kind": "class",
109
+ "sublabel": "Asynchronous transfer without provider retries",
110
+ "row": 1,
111
+ "col": 3,
112
+ "methods": [
113
+ { "name": "authorize", "parameters": "request: AuthorizationRequest", "returns": "AuthorizationResult", "visibility": "public" },
114
+ { "name": "awaitSettlement", "parameters": "transfer: TransferId", "returns": "SettlementResult", "visibility": "private" }
115
+ ]
116
+ },
117
+ {
118
+ "id": "line_item",
119
+ "label": "LineItem",
120
+ "kind": "record",
121
+ "sublabel": "Immutable priced order line",
122
+ "row": 2,
123
+ "col": 0,
124
+ "attributes": [
125
+ { "name": "sku", "type": "Sku", "visibility": "public" },
126
+ { "name": "quantity", "type": "int", "visibility": "public" },
127
+ { "name": "unitPrice", "type": "Money", "visibility": "public" }
128
+ ]
129
+ },
130
+ {
131
+ "id": "stripe_card",
132
+ "label": "StripeCardProcessor",
133
+ "kind": "class",
134
+ "sublabel": "Card payments through Stripe",
135
+ "row": 2,
136
+ "col": 1,
137
+ "methods": [
138
+ { "name": "sendToProvider", "parameters": "request: ProviderRequest", "returns": "ProviderResponse", "visibility": "protected" }
139
+ ]
140
+ },
141
+ {
142
+ "id": "adyen_card",
143
+ "label": "AdyenCardProcessor",
144
+ "kind": "class",
145
+ "sublabel": "Card payments through Adyen",
146
+ "row": 2,
147
+ "col": 2,
148
+ "methods": [
149
+ { "name": "sendToProvider", "parameters": "request: ProviderRequest", "returns": "ProviderResponse", "visibility": "protected" }
150
+ ]
151
+ },
152
+ {
153
+ "id": "paypal_wallet",
154
+ "label": "PayPalWalletProcessor",
155
+ "kind": "class",
156
+ "sublabel": "Wallet payments through PayPal",
157
+ "row": 2,
158
+ "col": 3,
159
+ "methods": [
160
+ { "name": "sendToProvider", "parameters": "request: ProviderRequest", "returns": "ProviderResponse", "visibility": "protected" },
161
+ { "name": "exchangeBillingAgreementToken", "parameters": "token: String", "returns": "AgreementId", "visibility": "private" }
162
+ ]
163
+ }
164
+ ],
165
+ "relationships": [
166
+ { "id": "orchestrator_registry", "from": "checkout_orchestrator", "to": "processor_registry", "kind": "association", "label": "selects via" },
167
+ { "id": "registry_processors", "from": "processor_registry", "to": "payment_processor", "kind": "aggregation", "label": "holds" },
168
+ { "id": "orchestrator_order", "from": "checkout_orchestrator", "to": "order", "kind": "dependency", "label": "updates" },
169
+ { "id": "order_lines", "from": "order", "to": "line_item", "kind": "composition", "label": "owns lines" },
170
+ { "id": "order_status", "from": "order", "to": "payment_status", "kind": "association" },
171
+ { "id": "retrying_implements", "from": "retrying_processor", "to": "payment_processor", "kind": "realization" },
172
+ { "id": "bank_implements", "from": "bank_transfer", "to": "payment_processor", "kind": "realization" },
173
+ { "id": "stripe_extends", "from": "stripe_card", "to": "retrying_processor", "kind": "inheritance" },
174
+ { "id": "adyen_extends", "from": "adyen_card", "to": "retrying_processor", "kind": "inheritance" },
175
+ { "id": "paypal_extends", "from": "paypal_wallet", "to": "retrying_processor", "kind": "inheritance" }
176
+ ]
177
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "class",
4
+ "meta": {
5
+ "title": "Payment module types",
6
+ "subtitle": "OrderService depends on the PaymentGateway contract; card and wallet gateways implement it.",
7
+ "output": "payments-class.html",
8
+ "quality_profile": "showcase"
9
+ },
10
+ "layout": {
11
+ "mode": "grid"
12
+ },
13
+ "types": [
14
+ {
15
+ "id": "order_service",
16
+ "label": "OrderService",
17
+ "kind": "class",
18
+ "sublabel": "Creates orders and starts payment",
19
+ "row": 0,
20
+ "col": 0,
21
+ "attributes": [
22
+ { "name": "gateway", "type": "PaymentGateway", "visibility": "private" }
23
+ ],
24
+ "methods": [
25
+ { "name": "createOrder", "parameters": "cart: Cart", "returns": "Order", "visibility": "public" },
26
+ { "name": "checkout", "parameters": "order: Order", "returns": "Receipt", "visibility": "public" }
27
+ ]
28
+ },
29
+ {
30
+ "id": "payment_gateway",
31
+ "label": "PaymentGateway",
32
+ "kind": "interface",
33
+ "sublabel": "Payment contract every channel fulfils",
34
+ "row": 0,
35
+ "col": 1.5,
36
+ "methods": [
37
+ { "name": "pay", "parameters": "amount: Money", "returns": "Result", "visibility": "public", "abstract": true }
38
+ ]
39
+ },
40
+ {
41
+ "id": "order",
42
+ "label": "Order",
43
+ "kind": "class",
44
+ "sublabel": "Order identity, amount, and status",
45
+ "row": 1,
46
+ "col": 0,
47
+ "attributes": [
48
+ { "name": "id", "type": "OrderId", "visibility": "public" },
49
+ { "name": "amount", "type": "Money", "visibility": "public" },
50
+ { "name": "status", "type": "OrderStatus", "visibility": "public" }
51
+ ],
52
+ "methods": [
53
+ { "name": "markPaid", "returns": "void", "visibility": "public" }
54
+ ]
55
+ },
56
+ {
57
+ "id": "card_gateway",
58
+ "label": "CardGateway",
59
+ "kind": "class",
60
+ "sublabel": "Charges a bank card",
61
+ "row": 1,
62
+ "col": 1,
63
+ "methods": [
64
+ { "name": "pay", "parameters": "amount: Money", "returns": "Result", "visibility": "public" }
65
+ ]
66
+ },
67
+ {
68
+ "id": "wallet_gateway",
69
+ "label": "WalletGateway",
70
+ "kind": "class",
71
+ "sublabel": "Debits a stored wallet balance",
72
+ "row": 1,
73
+ "col": 2,
74
+ "methods": [
75
+ { "name": "pay", "parameters": "amount: Money", "returns": "Result", "visibility": "public" }
76
+ ]
77
+ }
78
+ ],
79
+ "relationships": [
80
+ { "id": "uses_gateway", "from": "order_service", "to": "payment_gateway", "kind": "dependency", "label": "pays through" },
81
+ { "id": "creates_order", "from": "order_service", "to": "order", "kind": "dependency", "label": "creates" },
82
+ { "id": "card_implements", "from": "card_gateway", "to": "payment_gateway", "kind": "realization" },
83
+ { "id": "wallet_implements", "from": "wallet_gateway", "to": "payment_gateway", "kind": "realization" }
84
+ ]
85
+ }