@radicaltools/mcp 0.0.0-stage → 0.1.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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +140 -2
  3. package/dist/chunk-KI4NVSTU.js +1763 -0
  4. package/dist/elkLayout-WC6AXWOG.js +185 -0
  5. package/dist/hub-catalogue/adr/adr-api-versioning.radical +53 -0
  6. package/dist/hub-catalogue/adr/adr-auth-strategy.radical +53 -0
  7. package/dist/hub-catalogue/adr/adr-caching-strategy.radical +59 -0
  8. package/dist/hub-catalogue/adr/adr-data-consistency-model.radical +40 -0
  9. package/dist/hub-catalogue/adr/adr-data-store.radical +47 -0
  10. package/dist/hub-catalogue/adr/adr-deployment-strategy.radical +53 -0
  11. package/dist/hub-catalogue/adr/adr-event-schema-evolution.radical +53 -0
  12. package/dist/hub-catalogue/adr/adr-integration-style.radical +50 -0
  13. package/dist/hub-catalogue/adr/adr-ledger-reconciliation-strategy.radical +38 -0
  14. package/dist/hub-catalogue/adr/adr-llm-provider-strategy.radical +40 -0
  15. package/dist/hub-catalogue/adr/adr-marketplace-payments-model.radical +39 -0
  16. package/dist/hub-catalogue/adr/adr-multi-region.radical +60 -0
  17. package/dist/hub-catalogue/adr/adr-multi-tenancy-strategy.radical +41 -0
  18. package/dist/hub-catalogue/adr/adr-observability.radical +59 -0
  19. package/dist/hub-catalogue/adr/adr-realtime-transport.radical +38 -0
  20. package/dist/hub-catalogue/adr/adr-tech-stack.radical +45 -0
  21. package/dist/hub-catalogue/adr/adr-zero-trust-network.radical +40 -0
  22. package/dist/hub-catalogue/blueprint/bp-ai-assistant-platform.radical +1641 -0
  23. package/dist/hub-catalogue/blueprint/bp-analytical-data-platform.radical +1428 -0
  24. package/dist/hub-catalogue/blueprint/bp-ecommerce-platform.radical +1989 -0
  25. package/dist/hub-catalogue/blueprint/bp-fintech-ledger-platform.radical +1701 -0
  26. package/dist/hub-catalogue/blueprint/bp-marketplace-platform.radical +1792 -0
  27. package/dist/hub-catalogue/blueprint/bp-realtime-collaboration.radical +1421 -0
  28. package/dist/hub-catalogue/blueprint/bp-saas-b2b-platform.radical +1713 -0
  29. package/dist/hub-catalogue/fitness-function/ff-accessibility-scan.radical +34 -0
  30. package/dist/hub-catalogue/fitness-function/ff-ai-eval-gate.radical +52 -0
  31. package/dist/hub-catalogue/fitness-function/ff-api-contract.radical +36 -0
  32. package/dist/hub-catalogue/fitness-function/ff-capacity-load-test.radical +67 -0
  33. package/dist/hub-catalogue/fitness-function/ff-carbon-footprint-guard.radical +62 -0
  34. package/dist/hub-catalogue/fitness-function/ff-change-failure-rate.radical +45 -0
  35. package/dist/hub-catalogue/fitness-function/ff-chaos-resilience-test.radical +53 -0
  36. package/dist/hub-catalogue/fitness-function/ff-cost-efficiency-guard.radical +64 -0
  37. package/dist/hub-catalogue/fitness-function/ff-coupling-guard.radical +45 -0
  38. package/dist/hub-catalogue/fitness-function/ff-data-integrity-check.radical +51 -0
  39. package/dist/hub-catalogue/fitness-function/ff-data-residency.radical +43 -0
  40. package/dist/hub-catalogue/fitness-function/ff-dependency-rules.radical +37 -0
  41. package/dist/hub-catalogue/fitness-function/ff-deploy-frequency.radical +46 -0
  42. package/dist/hub-catalogue/fitness-function/ff-dr-drill-success.radical +52 -0
  43. package/dist/hub-catalogue/fitness-function/ff-duplication-guard.radical +53 -0
  44. package/dist/hub-catalogue/fitness-function/ff-error-budget.radical +59 -0
  45. package/dist/hub-catalogue/fitness-function/ff-fail-safe-verification.radical +34 -0
  46. package/dist/hub-catalogue/fitness-function/ff-infra-drift.radical +34 -0
  47. package/dist/hub-catalogue/fitness-function/ff-latency-slo.radical +59 -0
  48. package/dist/hub-catalogue/fitness-function/ff-lead-time.radical +44 -0
  49. package/dist/hub-catalogue/fitness-function/ff-ledger-balance-integrity.radical +45 -0
  50. package/dist/hub-catalogue/fitness-function/ff-license-compliance.radical +43 -0
  51. package/dist/hub-catalogue/fitness-function/ff-mttr.radical +45 -0
  52. package/dist/hub-catalogue/fitness-function/ff-noisy-neighbor-guard.radical +66 -0
  53. package/dist/hub-catalogue/fitness-function/ff-sast-scan.radical +35 -0
  54. package/dist/hub-catalogue/fitness-function/ff-scale-out-verification.radical +66 -0
  55. package/dist/hub-catalogue/fitness-function/ff-security-scan.radical +45 -0
  56. package/dist/hub-catalogue/fitness-function/ff-startup-shutdown-check.radical +66 -0
  57. package/dist/hub-catalogue/fitness-function/ff-sync-convergence-test.radical +45 -0
  58. package/dist/hub-catalogue/fitness-function/ff-test-coverage.radical +43 -0
  59. package/dist/hub-catalogue/fitness-function/ff-web-vitals.radical +57 -0
  60. package/dist/hub-catalogue/pattern/pattern-anti-corruption-layer.radical +88 -0
  61. package/dist/hub-catalogue/pattern/pattern-api-gateway.radical +168 -0
  62. package/dist/hub-catalogue/pattern/pattern-bff.radical +179 -0
  63. package/dist/hub-catalogue/pattern/pattern-bulkhead.radical +114 -0
  64. package/dist/hub-catalogue/pattern/pattern-circuit-breaker.radical +219 -0
  65. package/dist/hub-catalogue/pattern/pattern-cqrs.radical +195 -0
  66. package/dist/hub-catalogue/pattern/pattern-crdt-sync.radical +200 -0
  67. package/dist/hub-catalogue/pattern/pattern-event-driven.radical +210 -0
  68. package/dist/hub-catalogue/pattern/pattern-event-sourced-ledger.radical +211 -0
  69. package/dist/hub-catalogue/pattern/pattern-hexagonal.radical +196 -0
  70. package/dist/hub-catalogue/pattern/pattern-microservices.radical +262 -0
  71. package/dist/hub-catalogue/pattern/pattern-rag-pipeline.radical +213 -0
  72. package/dist/hub-catalogue/pattern/pattern-rate-limiter.radical +114 -0
  73. package/dist/hub-catalogue/pattern/pattern-saga.radical +208 -0
  74. package/dist/hub-catalogue/pattern/pattern-sidecar.radical +123 -0
  75. package/dist/hub-catalogue/pattern/pattern-strangler-fig.radical +227 -0
  76. package/dist/hub-catalogue/pattern/pattern-transactional-outbox.radical +209 -0
  77. package/dist/hub-catalogue/requirement/req-accessibility.radical +48 -0
  78. package/dist/hub-catalogue/requirement/req-ai-autonomous-resolution.radical +51 -0
  79. package/dist/hub-catalogue/requirement/req-ai-groundedness.radical +45 -0
  80. package/dist/hub-catalogue/requirement/req-ai-human-handoff.radical +46 -0
  81. package/dist/hub-catalogue/requirement/req-alerting.radical +52 -0
  82. package/dist/hub-catalogue/requirement/req-api-response-time.radical +51 -0
  83. package/dist/hub-catalogue/requirement/req-api-standard.radical +45 -0
  84. package/dist/hub-catalogue/requirement/req-audit-logging.radical +43 -0
  85. package/dist/hub-catalogue/requirement/req-auth-response-time.radical +45 -0
  86. package/dist/hub-catalogue/requirement/req-auth.radical +43 -0
  87. package/dist/hub-catalogue/requirement/req-autoscaling.radical +62 -0
  88. package/dist/hub-catalogue/requirement/req-availability.radical +50 -0
  89. package/dist/hub-catalogue/requirement/req-backward-compatibility.radical +46 -0
  90. package/dist/hub-catalogue/requirement/req-batch-job-completion.radical +50 -0
  91. package/dist/hub-catalogue/requirement/req-carbon-efficiency.radical +64 -0
  92. package/dist/hub-catalogue/requirement/req-centralised-logging.radical +45 -0
  93. package/dist/hub-catalogue/requirement/req-ci-pipeline-time.radical +43 -0
  94. package/dist/hub-catalogue/requirement/req-code-complexity.radical +43 -0
  95. package/dist/hub-catalogue/requirement/req-config-propagation.radical +45 -0
  96. package/dist/hub-catalogue/requirement/req-data-integrity.radical +35 -0
  97. package/dist/hub-catalogue/requirement/req-data-retention.radical +44 -0
  98. package/dist/hub-catalogue/requirement/req-db-query-response.radical +44 -0
  99. package/dist/hub-catalogue/requirement/req-disaster-recovery.radical +59 -0
  100. package/dist/hub-catalogue/requirement/req-distributed-tracing.radical +45 -0
  101. package/dist/hub-catalogue/requirement/req-encryption.radical +49 -0
  102. package/dist/hub-catalogue/requirement/req-error-rate.radical +45 -0
  103. package/dist/hub-catalogue/requirement/req-error-recovery.radical +34 -0
  104. package/dist/hub-catalogue/requirement/req-event-schema-compatibility.radical +37 -0
  105. package/dist/hub-catalogue/requirement/req-fail-safe-default.radical +55 -0
  106. package/dist/hub-catalogue/requirement/req-fast-startup-graceful-shutdown.radical +69 -0
  107. package/dist/hub-catalogue/requirement/req-gdpr-erasure.radical +44 -0
  108. package/dist/hub-catalogue/requirement/req-graceful-degradation.radical +39 -0
  109. package/dist/hub-catalogue/requirement/req-health-checks.radical +43 -0
  110. package/dist/hub-catalogue/requirement/req-iac.radical +36 -0
  111. package/dist/hub-catalogue/requirement/req-idempotency.radical +47 -0
  112. package/dist/hub-catalogue/requirement/req-input-validation.radical +37 -0
  113. package/dist/hub-catalogue/requirement/req-least-privilege.radical +47 -0
  114. package/dist/hub-catalogue/requirement/req-ledger-immutability.radical +38 -0
  115. package/dist/hub-catalogue/requirement/req-mfa.radical +36 -0
  116. package/dist/hub-catalogue/requirement/req-ml-extraction-accuracy.radical +42 -0
  117. package/dist/hub-catalogue/requirement/req-onboarding-time.radical +42 -0
  118. package/dist/hub-catalogue/requirement/req-page-load-time.radical +59 -0
  119. package/dist/hub-catalogue/requirement/req-payout-latency.radical +46 -0
  120. package/dist/hub-catalogue/requirement/req-presence-latency.radical +46 -0
  121. package/dist/hub-catalogue/requirement/req-rate-limiting.radical +45 -0
  122. package/dist/hub-catalogue/requirement/req-report-generation.radical +44 -0
  123. package/dist/hub-catalogue/requirement/req-resource-efficiency.radical +64 -0
  124. package/dist/hub-catalogue/requirement/req-resource-headroom.radical +53 -0
  125. package/dist/hub-catalogue/requirement/req-resource-isolation.radical +37 -0
  126. package/dist/hub-catalogue/requirement/req-search-response-time.radical +44 -0
  127. package/dist/hub-catalogue/requirement/req-secrets-management.radical +45 -0
  128. package/dist/hub-catalogue/requirement/req-task-success-rate.radical +42 -0
  129. package/dist/hub-catalogue/requirement/req-test-coverage.radical +42 -0
  130. package/dist/hub-catalogue/requirement/req-throughput.radical +55 -0
  131. package/dist/hub-catalogue/requirement/req-vulnerability-scanning.radical +52 -0
  132. package/dist/hub-catalogue/requirement/req-zero-downtime-deploy.radical +39 -0
  133. package/dist/index.js +8382 -0
  134. package/package.json +48 -4
@@ -0,0 +1,1421 @@
1
+ {
2
+ "hub": {
3
+ "id": "bp-realtime-collaboration",
4
+ "category": "blueprint",
5
+ "name": "Real-Time Collaboration Platform",
6
+ "description": "A multiplayer document or whiteboard editor: each client holds a local CRDT replica for instant, offline-capable edits, a stateless gateway fleet relays operations and presence between clients over a shared broadcast bus, and periodic snapshots keep reconnects fast — so any number of concurrent collaborators converge without locking or conflicts.",
7
+ "tags": [
8
+ "real-time",
9
+ "collaboration",
10
+ "crdt",
11
+ "offline-first",
12
+ "websocket"
13
+ ],
14
+ "requiredMetamodel": "c4-ddd-governance-builtin",
15
+ "templateParams": [
16
+ {
17
+ "key": "OFFLINE_GRACE_HOURS",
18
+ "label": "Offline edit merge window (hours)",
19
+ "hint": "72",
20
+ "type": "number",
21
+ "defaultValue": "72"
22
+ },
23
+ {
24
+ "key": "MAX_DOC_COLLABORATORS",
25
+ "label": "Concurrent collaborators per document",
26
+ "hint": "50",
27
+ "type": "number",
28
+ "defaultValue": "50"
29
+ },
30
+ {
31
+ "key": "SNAPSHOT_INTERVAL_OPS",
32
+ "label": "Operations between snapshots",
33
+ "hint": "500",
34
+ "type": "number",
35
+ "defaultValue": "500"
36
+ },
37
+ {
38
+ "key": "PROPAGATION_MS",
39
+ "label": "Presence / op fan-out (ms, p95)",
40
+ "hint": "150",
41
+ "type": "number",
42
+ "defaultValue": "150"
43
+ }
44
+ ],
45
+ "hubRefs": [
46
+ "pattern-crdt-sync",
47
+ "adr-realtime-transport",
48
+ "req-presence-latency",
49
+ "ff-sync-convergence-test",
50
+ "pattern-event-driven",
51
+ "req-availability",
52
+ "req-mfa",
53
+ "adr-tech-stack"
54
+ ]
55
+ },
56
+ "nodes": [
57
+ {
58
+ "id": "collaborator",
59
+ "type": "person",
60
+ "label": "Collaborator",
61
+ "description": "Any of the users concurrently editing the same document, online or offline.",
62
+ "width": 150,
63
+ "height": 170,
64
+ "collapsed": false,
65
+ "x": 0,
66
+ "y": 0
67
+ },
68
+ {
69
+ "id": "workspace-admin",
70
+ "type": "person",
71
+ "label": "Workspace Admin",
72
+ "description": "Manages who can access which documents and revokes access when someone leaves.",
73
+ "width": 150,
74
+ "height": 170,
75
+ "collapsed": false,
76
+ "x": 210,
77
+ "y": 0
78
+ },
79
+ {
80
+ "id": "platform",
81
+ "type": "system",
82
+ "label": "Collaboration Service",
83
+ "description": "Everything behind the editor client — sync, storage, access control and presence — that a workspace's collaborators share.",
84
+ "width": 960,
85
+ "height": 750,
86
+ "collapsed": false,
87
+ "x": 0,
88
+ "y": 290
89
+ },
90
+ {
91
+ "id": "editor-client",
92
+ "type": "webapp",
93
+ "label": "Editor Client",
94
+ "description": "Holds the local CRDT replica; edits apply instantly and work offline until reconnect.",
95
+ "technology": "TypeScript",
96
+ "parentId": "platform",
97
+ "width": 210,
98
+ "height": 140,
99
+ "collapsed": false,
100
+ "x": 30,
101
+ "y": 110
102
+ },
103
+ {
104
+ "id": "sync-gateway",
105
+ "type": "container",
106
+ "label": "Sync Gateway",
107
+ "description": "Authenticates the client, admits it to the document's room, and relays its operations. Holds no document state itself.",
108
+ "technology": "Node.js / WebSocket",
109
+ "parentId": "platform",
110
+ "width": 300,
111
+ "height": 200,
112
+ "collapsed": false,
113
+ "x": 370,
114
+ "y": 110
115
+ },
116
+ {
117
+ "id": "op-broadcast-bus",
118
+ "type": "queue",
119
+ "label": "Op Broadcast Bus",
120
+ "description": "The reason which gateway instance a collaborator happens to be connected to doesn't matter.",
121
+ "technology": "Redis Pub/Sub",
122
+ "parentId": "platform",
123
+ "width": 220,
124
+ "height": 95,
125
+ "collapsed": false,
126
+ "x": 710,
127
+ "y": 110
128
+ },
129
+ {
130
+ "id": "snapshot-worker",
131
+ "type": "container",
132
+ "label": "Snapshot Worker",
133
+ "description": "Periodically compacts each document's operation log into a snapshot.",
134
+ "technology": "Node.js",
135
+ "parentId": "platform",
136
+ "width": 300,
137
+ "height": 200,
138
+ "collapsed": false,
139
+ "x": 30,
140
+ "y": 350
141
+ },
142
+ {
143
+ "id": "permission-service",
144
+ "type": "container",
145
+ "label": "Permission Service",
146
+ "description": "Checks document share and access rules before admitting a client to a room, and revokes active sessions when access changes.",
147
+ "technology": "Node.js",
148
+ "parentId": "platform",
149
+ "width": 300,
150
+ "height": 200,
151
+ "collapsed": false,
152
+ "x": 370,
153
+ "y": 350
154
+ },
155
+ {
156
+ "id": "op-log-store",
157
+ "type": "database",
158
+ "label": "Op Log Store",
159
+ "description": "Holds the actual edit history per document; the offline-merge and recovery-point requirements below are both really requirements on this store.",
160
+ "technology": "PostgreSQL",
161
+ "parentId": "platform",
162
+ "width": 190,
163
+ "height": 130,
164
+ "collapsed": false,
165
+ "x": 30,
166
+ "y": 590
167
+ },
168
+ {
169
+ "id": "snapshot-store",
170
+ "type": "database",
171
+ "label": "Snapshot Store",
172
+ "description": "A performance shortcut for joining a busy document quickly — never what recovery correctness actually relies on.",
173
+ "technology": "S3",
174
+ "parentId": "platform",
175
+ "width": 190,
176
+ "height": 130,
177
+ "collapsed": false,
178
+ "x": 370,
179
+ "y": 590
180
+ },
181
+ {
182
+ "id": "identity-provider",
183
+ "type": "system",
184
+ "label": "Identity Provider",
185
+ "description": "Authenticates the collaborator and issues the session the gateway verifies.",
186
+ "width": 360,
187
+ "height": 260,
188
+ "collapsed": false,
189
+ "x": 0,
190
+ "y": 1160
191
+ },
192
+ {
193
+ "id": "req-offline-merge",
194
+ "type": "requirement",
195
+ "label": "Offline Edit Merge Window",
196
+ "x": 0,
197
+ "y": 1540,
198
+ "width": 260,
199
+ "height": 80,
200
+ "collapsed": false,
201
+ "ears_type": "event-driven",
202
+ "status": "draft",
203
+ "priority": "must",
204
+ "trigger": "a client reconnects after being offline",
205
+ "action": "replay its local operation log against the server and merge without data loss or manual conflict resolution, even after up to {{OFFLINE_GRACE_HOURS}} hours offline",
206
+ "rationale": "Local-first only pays off if reconnecting after a real gap — a flight, a dead laptop battery — is as unremarkable as reconnecting after a second's blip.",
207
+ "templateParams": [
208
+ {
209
+ "key": "OFFLINE_GRACE_HOURS",
210
+ "label": "Offline edit merge window (hours)",
211
+ "hint": "72",
212
+ "type": "number",
213
+ "defaultValue": "72"
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ "id": "req-room-capacity",
219
+ "type": "requirement",
220
+ "label": "Concurrent Collaborator Capacity",
221
+ "x": 320,
222
+ "y": 1540,
223
+ "width": 260,
224
+ "height": 80,
225
+ "collapsed": false,
226
+ "ears_type": "ubiquitous",
227
+ "status": "draft",
228
+ "priority": "should",
229
+ "action": "support at least {{MAX_DOC_COLLABORATORS}} concurrent collaborators per document without a perceptible increase in edit propagation latency",
230
+ "rationale": "A collaboration feature that visibly slows down exactly when a lot of people show up fails at the moment it matters most.",
231
+ "templateParams": [
232
+ {
233
+ "key": "MAX_DOC_COLLABORATORS",
234
+ "label": "Concurrent collaborators per document",
235
+ "hint": "50",
236
+ "type": "number",
237
+ "defaultValue": "50"
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ "id": "req-access-revocation",
243
+ "type": "requirement",
244
+ "label": "Access Revocation Propagation",
245
+ "x": 640,
246
+ "y": 1540,
247
+ "width": 260,
248
+ "height": 80,
249
+ "collapsed": false,
250
+ "ears_type": "event-driven",
251
+ "status": "draft",
252
+ "priority": "must",
253
+ "trigger": "a workspace admin revokes a collaborator's access to a document",
254
+ "action": "disconnect that collaborator's active session and reject any further operations from them within seconds, not only on their next reconnect",
255
+ "rationale": "A local-first replica keeps a full copy of the document; revocation has to end the live session immediately, or removing access is theatre."
256
+ },
257
+ {
258
+ "id": "req-snapshot-recovery",
259
+ "type": "requirement",
260
+ "label": "Snapshot-Free Recovery Point",
261
+ "x": 960,
262
+ "y": 1540,
263
+ "width": 260,
264
+ "height": 80,
265
+ "collapsed": false,
266
+ "ears_type": "ubiquitous",
267
+ "status": "draft",
268
+ "priority": "should",
269
+ "action": "be able to reconstruct any document's state as of any point in the last {{SNAPSHOT_INTERVAL_OPS}}-operation window from the op log alone, without the snapshot store",
270
+ "rationale": "The op log, not the snapshot, is the actual system of record; the snapshot store is only ever a performance optimisation and must stay one, not a hidden second source of truth.",
271
+ "templateParams": [
272
+ {
273
+ "key": "SNAPSHOT_INTERVAL_OPS",
274
+ "label": "Operations between snapshots",
275
+ "hint": "500",
276
+ "type": "number",
277
+ "defaultValue": "500"
278
+ }
279
+ ]
280
+ },
281
+ {
282
+ "id": "ff-presence-fanout-guard",
283
+ "type": "fitness-fn",
284
+ "label": "Presence Fan-out Latency Guard",
285
+ "description": "Measures the time from an accepted operation to it being delivered to every other connected replica of the same document.",
286
+ "x": 0,
287
+ "y": 1740,
288
+ "width": 260,
289
+ "height": 52,
290
+ "collapsed": false,
291
+ "category": "operational",
292
+ "automated": true,
293
+ "trigger": "continuous",
294
+ "threshold": "p95 presence / operation fan-out to all connected replicas stays under {{PROPAGATION_MS}} ms",
295
+ "status": "proposed"
296
+ },
297
+ {
298
+ "id": "ff-snapshot-compaction-lag",
299
+ "type": "fitness-fn",
300
+ "label": "Snapshot Compaction Lag",
301
+ "description": "Checks how far behind the snapshot worker is on any actively-edited document.",
302
+ "x": 320,
303
+ "y": 1740,
304
+ "width": 260,
305
+ "height": 52,
306
+ "collapsed": false,
307
+ "category": "operational",
308
+ "automated": true,
309
+ "trigger": "periodic",
310
+ "threshold": "Op log for any active document never exceeds {{SNAPSHOT_INTERVAL_OPS}} unsnapshotted operations",
311
+ "status": "proposed"
312
+ },
313
+ {
314
+ "id": "ff-reconnect-success-rate",
315
+ "type": "fitness-fn",
316
+ "label": "Reconnect Success Rate",
317
+ "description": "Tracks whether a client reconnecting after a network blip resumes syncing or falls back to a full document re-download.",
318
+ "x": 640,
319
+ "y": 1740,
320
+ "width": 260,
321
+ "height": 52,
322
+ "collapsed": false,
323
+ "category": "operational",
324
+ "automated": true,
325
+ "trigger": "continuous",
326
+ "threshold": "At least 99.9% of reconnect attempts resume syncing without a full document re-download",
327
+ "status": "proposed"
328
+ },
329
+ {
330
+ "id": "adr-crdt-over-ot",
331
+ "type": "adr",
332
+ "label": "ADR: CRDT over Operational Transformation",
333
+ "x": 0,
334
+ "y": 1912,
335
+ "width": 260,
336
+ "height": 52,
337
+ "collapsed": false,
338
+ "status": "accepted",
339
+ "date": "",
340
+ "context": "Concurrent edits from many clients need to merge without a central lock and, ideally, without a live connection to a sequencing server.",
341
+ "decision": "Use CRDTs for the document's data structure rather than Operational Transformation.",
342
+ "consequences": "No central transform server is required and offline editing works without special-casing; CRDT metadata overhead grows with edit history and needs periodic compaction and tombstone pruning.",
343
+ "alternatives": "1. Operational Transformation — proven at large scale, but requires a central sequencing server and is notoriously hard to implement correctly for rich documents. 2. Lock-based pessimistic editing — simplest to reason about, but kills the \"everyone edits at once\" experience. 3. Last-write-wins on the whole document — trivial, but silently discards concurrent edits. 4. CRDT (chosen)."
344
+ },
345
+ {
346
+ "id": "adr-stateless-gateway-fleet",
347
+ "type": "adr",
348
+ "label": "ADR: Stateless gateway fleet with a shared broadcast bus",
349
+ "x": 320,
350
+ "y": 1912,
351
+ "width": 260,
352
+ "height": 52,
353
+ "collapsed": false,
354
+ "status": "accepted",
355
+ "date": "",
356
+ "context": "WebSocket connections need to scale horizontally while every replica of a document stays in sync regardless of which gateway instance a client lands on.",
357
+ "decision": "Gateways hold no document state themselves; they publish and subscribe to operations through a shared broadcast bus, so any instance can serve any client.",
358
+ "consequences": "Gateway instances scale and restart freely with no handoff logic, but every operation takes an extra hop through the bus, adding a small amount of latency to the common case.",
359
+ "alternatives": "1. Sticky sessions routing all of a document's clients to one gateway instance — lower latency per operation, but that instance becomes a single point of failure and a hot-spot for popular documents. 2. Shared broadcast bus (chosen). 3. Peer-to-peer mesh between clients — no server bottleneck, but NAT traversal and offline persistence become much harder to get right."
360
+ },
361
+ {
362
+ "id": "flow-collaborator",
363
+ "type": "group",
364
+ "label": "Collaborator journey",
365
+ "description": "Editing together, offline and back, and going back in time.",
366
+ "x": 0,
367
+ "y": 2084,
368
+ "width": 1560,
369
+ "height": 330,
370
+ "collapsed": false
371
+ },
372
+ {
373
+ "id": "mockup-doc-list",
374
+ "type": "mockup",
375
+ "label": "Documents",
376
+ "description": "Workspace documents with who is editing them right now.",
377
+ "parentId": "flow-collaborator",
378
+ "x": 30,
379
+ "y": 110,
380
+ "width": 220,
381
+ "height": 190,
382
+ "collapsed": false,
383
+ "screen": "/docs",
384
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"30\" fill=\"#f3f4f6\" stroke=\"#333\"/>\n <rect x=\"10\" y=\"8\" width=\"14\" height=\"14\" rx=\"3\" fill=\"#ccc\"/>\n <text x=\"30\" y=\"20\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Workspace</text>\n <text x=\"388\" y=\"19\" font-size=\"9\" fill=\"#666\" text-anchor=\"end\">Settings</text>\n <text x=\"332\" y=\"19\" font-size=\"9\" fill=\"#666\" text-anchor=\"end\">Members</text>\n <text x=\"281\" y=\"19\" font-size=\"9\" fill=\"#666\" text-anchor=\"end\">Docs</text>\n <text x=\"16\" y=\"54\" font-size=\"12\" fill=\"#333\" font-weight=\"bold\">Documents</text>\n <rect x=\"290\" y=\"40\" width=\"94\" height=\"20\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"337.0\" y=\"53.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">+ New doc</text>\n <rect x=\"16\" y=\"64\" width=\"250\" height=\"18\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"22\" y=\"76.0\" font-size=\"8\" fill=\"#999\">Search documents</text>\n <rect x=\"16\" y=\"92\" width=\"368\" height=\"26\" fill=\"#f3f4f6\"/>\n <text x=\"22\" y=\"108.0\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Name</text>\n <text x=\"192\" y=\"108.0\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Editing now</text>\n <text x=\"292\" y=\"108.0\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Updated</text>\n <rect x=\"16\" y=\"118\" width=\"368\" height=\"26\" fill=\"#eef2ff\"/>\n <line x1=\"16\" y1=\"144\" x2=\"384\" y2=\"144\" stroke=\"#e5e7eb\"/>\n <text x=\"22\" y=\"134.0\" font-size=\"8\" fill=\"#333\">Q3 Planning</text>\n <text x=\"192\" y=\"134.0\" font-size=\"8\" fill=\"#333\"></text>\n <text x=\"292\" y=\"134.0\" font-size=\"8\" fill=\"#333\">2 min ago</text>\n <line x1=\"16\" y1=\"170\" x2=\"384\" y2=\"170\" stroke=\"#e5e7eb\"/>\n <text x=\"22\" y=\"160.0\" font-size=\"8\" fill=\"#333\">Launch checklist</text>\n <text x=\"192\" y=\"160.0\" font-size=\"8\" fill=\"#333\"></text>\n <text x=\"292\" y=\"160.0\" font-size=\"8\" fill=\"#333\">1 h ago</text>\n <line x1=\"16\" y1=\"196\" x2=\"384\" y2=\"196\" stroke=\"#e5e7eb\"/>\n <rect x=\"22\" y=\"180.5\" width=\"110\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"192\" y=\"186.0\" font-size=\"8\" fill=\"#333\"></text>\n <text x=\"292\" y=\"186.0\" font-size=\"8\" fill=\"#333\">yesterday</text>\n <line x1=\"16\" y1=\"222\" x2=\"384\" y2=\"222\" stroke=\"#e5e7eb\"/>\n <rect x=\"22\" y=\"206.5\" width=\"90\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"192\" y=\"212.0\" font-size=\"8\" fill=\"#333\"></text>\n <text x=\"292\" y=\"212.0\" font-size=\"8\" fill=\"#333\">last week</text>\n <line x1=\"16\" y1=\"248\" x2=\"384\" y2=\"248\" stroke=\"#e5e7eb\"/>\n <rect x=\"22\" y=\"232.5\" width=\"120\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"192\" y=\"238.0\" font-size=\"8\" fill=\"#333\"></text>\n <text x=\"292\" y=\"238.0\" font-size=\"8\" fill=\"#333\">last week</text>\n <circle cx=\"198\" cy=\"131\" r=\"6\" fill=\"#bbb\" stroke=\"#fff\"/>\n <circle cx=\"208\" cy=\"131\" r=\"6\" fill=\"#999\" stroke=\"#fff\"/>\n <circle cx=\"218\" cy=\"131\" r=\"6\" fill=\"#ccc\" stroke=\"#fff\"/>\n <circle cx=\"228\" cy=\"131\" r=\"6\" fill=\"#aaa\" stroke=\"#fff\"/>\n <circle cx=\"198\" cy=\"157\" r=\"6\" fill=\"#bbb\" stroke=\"#fff\"/>\n</svg>"
385
+ },
386
+ {
387
+ "id": "mockup-document-editor",
388
+ "type": "mockup",
389
+ "label": "Document Editor",
390
+ "description": "Everyone edits a local replica: changes apply instantly, keep working offline (up to {{OFFLINE_GRACE_HOURS}} h) and merge on reconnect; presence shows up to {{MAX_DOC_COLLABORATORS}} collaborators.",
391
+ "parentId": "flow-collaborator",
392
+ "x": 350,
393
+ "y": 110,
394
+ "width": 220,
395
+ "height": 190,
396
+ "collapsed": false,
397
+ "screen": "/d/:docId",
398
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"30\" fill=\"#f3f4f6\" stroke=\"#333\"/>\n <rect x=\"10\" y=\"8\" width=\"14\" height=\"14\" rx=\"3\" fill=\"#ccc\"/>\n <text x=\"30\" y=\"20\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Q3 Planning</text>\n <circle cx=\"272\" cy=\"15\" r=\"8\" fill=\"#bbb\" stroke=\"#fff\"/>\n <circle cx=\"284\" cy=\"15\" r=\"8\" fill=\"#999\" stroke=\"#fff\"/>\n <circle cx=\"296\" cy=\"15\" r=\"8\" fill=\"#ccc\" stroke=\"#fff\"/>\n <circle cx=\"308\" cy=\"15\" r=\"8\" fill=\"#aaa\" stroke=\"#fff\"/>\n <text x=\"324\" y=\"19\" font-size=\"8\" fill=\"#666\">+3</text>\n <rect x=\"342\" y=\"6\" width=\"50\" height=\"18\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"367.0\" y=\"18.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">Share</text>\n <rect x=\"0\" y=\"30\" width=\"400\" height=\"22\" rx=\"0\" fill=\"#fafafa\" stroke=\"#ccc\"/>\n <rect x=\"10\" y=\"35\" width=\"16\" height=\"12\" rx=\"2\" fill=\"#eee\" stroke=\"#eee\"/>\n <rect x=\"32\" y=\"35\" width=\"16\" height=\"12\" rx=\"2\" fill=\"#eee\" stroke=\"#eee\"/>\n <rect x=\"54\" y=\"35\" width=\"16\" height=\"12\" rx=\"2\" fill=\"#eee\" stroke=\"#eee\"/>\n <rect x=\"76\" y=\"35\" width=\"16\" height=\"12\" rx=\"2\" fill=\"#eee\" stroke=\"#eee\"/>\n <rect x=\"98\" y=\"35\" width=\"16\" height=\"12\" rx=\"2\" fill=\"#eee\" stroke=\"#eee\"/>\n <rect x=\"120\" y=\"35\" width=\"16\" height=\"12\" rx=\"2\" fill=\"#eee\" stroke=\"#eee\"/>\n <rect x=\"142\" y=\"35\" width=\"16\" height=\"12\" rx=\"2\" fill=\"#eee\" stroke=\"#eee\"/>\n <rect x=\"254\" y=\"34\" width=\"145\" height=\"14\" rx=\"7\" fill=\"#333\"/>\n <text x=\"326.5\" y=\"44\" font-size=\"8\" fill=\"#fff\" text-anchor=\"middle\">Offline — edits saved locally</text>\n <text x=\"40\" y=\"84\" font-size=\"16\" fill=\"#333\" font-weight=\"bold\">Q3 Planning</text>\n <rect x=\"40\" y=\"100\" width=\"320\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"111\" width=\"320\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"122\" width=\"192\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"40\" y=\"150\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Goals</text>\n <rect x=\"40\" y=\"160\" width=\"300\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"171\" width=\"180\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <line x1=\"206\" y1=\"158\" x2=\"206\" y2=\"172\" stroke=\"#2563eb\" stroke-width=\"1.5\"/>\n <rect x=\"206\" y=\"148\" width=\"22\" height=\"10\" fill=\"#2563eb\"/>\n <text x=\"217\" y=\"156\" font-size=\"7\" fill=\"#fff\" text-anchor=\"middle\">Ana</text>\n <text x=\"40\" y=\"206\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Risks</text>\n <rect x=\"40\" y=\"216\" width=\"290\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"227\" width=\"290\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"238\" width=\"174\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"40\" y=\"280\" font-size=\"8\" fill=\"#2563eb\">History</text>\n</svg>"
399
+ },
400
+ {
401
+ "id": "mockup-reconnect-merge",
402
+ "type": "mockup",
403
+ "label": "Back Online — Merged",
404
+ "description": "On reconnect the offline operation log is replayed and merged automatically — no conflict dialogs, no lost edits.",
405
+ "parentId": "flow-collaborator",
406
+ "x": 670,
407
+ "y": 110,
408
+ "width": 220,
409
+ "height": 190,
410
+ "collapsed": false,
411
+ "screen": "/d/:docId",
412
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"30\" fill=\"#f3f4f6\" stroke=\"#333\"/>\n <rect x=\"10\" y=\"8\" width=\"14\" height=\"14\" rx=\"3\" fill=\"#ccc\"/>\n <text x=\"30\" y=\"20\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Q3 Planning</text>\n <circle cx=\"272\" cy=\"15\" r=\"8\" fill=\"#bbb\" stroke=\"#fff\"/>\n <circle cx=\"284\" cy=\"15\" r=\"8\" fill=\"#999\" stroke=\"#fff\"/>\n <circle cx=\"296\" cy=\"15\" r=\"8\" fill=\"#ccc\" stroke=\"#fff\"/>\n <circle cx=\"308\" cy=\"15\" r=\"8\" fill=\"#aaa\" stroke=\"#fff\"/>\n <rect x=\"342\" y=\"6\" width=\"50\" height=\"18\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"367.0\" y=\"18.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">Share</text>\n <rect x=\"16\" y=\"40\" width=\"368\" height=\"24\" rx=\"3\" fill=\"#eef2ff\" stroke=\"#c7d2fe\"/>\n <text x=\"26\" y=\"55.0\" font-size=\"8\" fill=\"#333\">Back online — 37 offline edits merged with 12 from others. Nothing was lost.</text>\n <text x=\"40\" y=\"94\" font-size=\"16\" fill=\"#333\" font-weight=\"bold\">Q3 Planning</text>\n <rect x=\"40\" y=\"110\" width=\"320\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"121\" width=\"192\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"36\" y=\"134\" width=\"300\" height=\"30\" rx=\"3\" fill=\"#dbeafe\" stroke=\"#dbeafe\"/>\n <rect x=\"40\" y=\"140\" width=\"290\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"150\" width=\"174\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"340\" y=\"152\" font-size=\"7.5\" fill=\"#2563eb\">yours</text>\n <rect x=\"36\" y=\"170\" width=\"300\" height=\"20\" rx=\"3\" fill=\"#f3f4f6\" stroke=\"#f3f4f6\"/>\n <rect x=\"40\" y=\"177\" width=\"260\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"340\" y=\"184\" font-size=\"7.5\" fill=\"#666\">Ben</text>\n <rect x=\"40\" y=\"206\" width=\"300\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"217\" width=\"300\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"40\" y=\"228\" width=\"180\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"40\" y=\"280\" font-size=\"8\" fill=\"#2563eb\">Show what changed while I was offline</text>\n</svg>"
413
+ },
414
+ {
415
+ "id": "mockup-version-history",
416
+ "type": "mockup",
417
+ "label": "Version History",
418
+ "description": "Browse and restore any earlier state of the document, reconstructed from snapshots plus the operation log.",
419
+ "parentId": "flow-collaborator",
420
+ "x": 990,
421
+ "y": 110,
422
+ "width": 220,
423
+ "height": 190,
424
+ "collapsed": false,
425
+ "screen": "/d/:docId/history",
426
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"30\" fill=\"#f3f4f6\" stroke=\"#333\"/>\n <rect x=\"10\" y=\"8\" width=\"14\" height=\"14\" rx=\"3\" fill=\"#ccc\"/>\n <text x=\"30\" y=\"20\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Q3 Planning — Version history</text>\n <text x=\"388\" y=\"19\" font-size=\"9\" fill=\"#666\" text-anchor=\"end\">Close</text>\n <text x=\"24\" y=\"60\" font-size=\"14\" fill=\"#333\" font-weight=\"bold\">Q3 Planning</text>\n <rect x=\"24\" y=\"74\" width=\"230\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"24\" y=\"85\" width=\"230\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"24\" y=\"96\" width=\"138\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"20\" y=\"108\" width=\"238\" height=\"40\" rx=\"3\" fill=\"#dbeafe\" stroke=\"#2563eb\"/>\n <rect x=\"28\" y=\"116\" width=\"210\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"28\" y=\"126\" width=\"210\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"28\" y=\"136\" width=\"126\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"24\" y=\"164\" width=\"220\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"24\" y=\"175\" width=\"220\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"24\" y=\"186\" width=\"220\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"24\" y=\"197\" width=\"132\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"270\" y=\"30\" width=\"130\" height=\"270\" rx=\"0\" fill=\"#fafafa\" stroke=\"#ccc\"/>\n <text x=\"282\" y=\"50\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Today 14:02</text>\n <text x=\"282\" y=\"62\" font-size=\"8\" fill=\"#666\">Ana, Ben</text>\n <rect x=\"274\" y=\"74\" width=\"122\" height=\"34\" rx=\"3\" fill=\"#eef2ff\" stroke=\"#eef2ff\"/>\n <text x=\"282\" y=\"88\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Today 11:40</text>\n <text x=\"282\" y=\"100\" font-size=\"8\" fill=\"#666\">Ben</text>\n <text x=\"282\" y=\"126\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Yesterday 17:15</text>\n <text x=\"282\" y=\"138\" font-size=\"8\" fill=\"#666\">Ana, Chris, +2</text>\n <text x=\"282\" y=\"164\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Yesterday 09:03</text>\n <text x=\"282\" y=\"176\" font-size=\"8\" fill=\"#666\">Chris</text>\n <text x=\"282\" y=\"202\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">2 Apr 16:48</text>\n <text x=\"282\" y=\"214\" font-size=\"8\" fill=\"#666\">Ana</text>\n <rect x=\"280\" y=\"262\" width=\"110\" height=\"20\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"335.0\" y=\"275.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">Restore this version</text>\n</svg>"
427
+ },
428
+ {
429
+ "id": "mockup-restore-version",
430
+ "type": "mockup",
431
+ "label": "Restore Version",
432
+ "description": "Restoring an older state is itself a new version, reconstructed from snapshot plus operation log.",
433
+ "parentId": "flow-collaborator",
434
+ "x": 1310,
435
+ "y": 110,
436
+ "width": 220,
437
+ "height": 190,
438
+ "collapsed": false,
439
+ "screen": "/d/:docId/history/:version",
440
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"300\" rx=\"0\" fill=\"#e5e7eb\" stroke=\"#e5e7eb\"/>\n <rect x=\"60.0\" y=\"60.0\" width=\"280\" height=\"180\" rx=\"6\" fill=\"#fff\" stroke=\"#333\"/>\n <text x=\"76.0\" y=\"86.0\" font-size=\"12\" fill=\"#333\" font-weight=\"bold\">Restore this version?</text>\n <text x=\"76.0\" y=\"106.0\" font-size=\"9\" fill=\"#333\">Today 11:40 — edited by Ben</text>\n <text x=\"76.0\" y=\"126.0\" font-size=\"8\" fill=\"#666\">The current document is kept as a new version,</text>\n <text x=\"76.0\" y=\"140.0\" font-size=\"8\" fill=\"#666\">so restoring can itself be undone.</text>\n <rect x=\"76.0\" y=\"158.0\" width=\"9\" height=\"9\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"91.0\" y=\"166.0\" font-size=\"8\" fill=\"#333\">Notify the 6 people editing now</text>\n <rect x=\"76.0\" y=\"198.0\" width=\"110\" height=\"20\" rx=\"3\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"131.0\" y=\"211.0\" font-size=\"9\" fill=\"#333\" font-weight=\"bold\" text-anchor=\"middle\">Cancel</text>\n <rect x=\"214.0\" y=\"198.0\" width=\"110\" height=\"20\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"269.0\" y=\"211.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">Restore</text>\n</svg>"
441
+ },
442
+ {
443
+ "id": "flow-workspace-admin",
444
+ "type": "group",
445
+ "label": "Workspace admin journey",
446
+ "description": "Sharing documents and removing people who leave.",
447
+ "x": 0,
448
+ "y": 2494,
449
+ "width": 1240,
450
+ "height": 330,
451
+ "collapsed": false
452
+ },
453
+ {
454
+ "id": "mockup-share-dialog",
455
+ "type": "mockup",
456
+ "label": "Share & Access",
457
+ "description": "Workspace admins manage who can open the document; removing someone disconnects their live session instead of waiting for it to expire.",
458
+ "parentId": "flow-workspace-admin",
459
+ "x": 30,
460
+ "y": 110,
461
+ "width": 220,
462
+ "height": 190,
463
+ "collapsed": false,
464
+ "screen": "/d/:docId/share",
465
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"300\" rx=\"0\" fill=\"#e5e7eb\" stroke=\"#e5e7eb\"/>\n <rect x=\"60\" y=\"30\" width=\"280\" height=\"244\" rx=\"6\" fill=\"#fff\" stroke=\"#333\"/>\n <text x=\"76\" y=\"56\" font-size=\"12\" fill=\"#333\" font-weight=\"bold\">Share “Q3 Planning”</text>\n <rect x=\"76\" y=\"68\" width=\"184\" height=\"18\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"82\" y=\"80.0\" font-size=\"8\" fill=\"#999\">Add people or groups</text>\n <rect x=\"268\" y=\"68\" width=\"56\" height=\"18\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"296.0\" y=\"80.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">Invite</text>\n <circle cx=\"88\" cy=\"110\" r=\"9\" fill=\"#bbb\" stroke=\"#fff\"/>\n <rect x=\"104\" y=\"104\" width=\"90\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"104\" y=\"113\" width=\"54\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"324\" y=\"114\" font-size=\"8\" fill=\"#666\" text-anchor=\"end\">Owner</text>\n <circle cx=\"88\" cy=\"140\" r=\"9\" fill=\"#999\" stroke=\"#fff\"/>\n <rect x=\"104\" y=\"134\" width=\"90\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"104\" y=\"143\" width=\"54\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"214\" y=\"132\" width=\"70\" height=\"18\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"220\" y=\"144.0\" font-size=\"8\" fill=\"#999\">Can edit</text>\n <path d=\"M272 139 l4 4 l4 -4\" fill=\"none\" stroke=\"#666\"/>\n <text x=\"324\" y=\"144\" font-size=\"8\" fill=\"#2563eb\" text-anchor=\"end\">Remove</text>\n <circle cx=\"88\" cy=\"170\" r=\"9\" fill=\"#ccc\" stroke=\"#fff\"/>\n <rect x=\"104\" y=\"164\" width=\"90\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"104\" y=\"173\" width=\"54\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"214\" y=\"162\" width=\"70\" height=\"18\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"220\" y=\"174.0\" font-size=\"8\" fill=\"#999\">Can edit</text>\n <path d=\"M272 169 l4 4 l4 -4\" fill=\"none\" stroke=\"#666\"/>\n <text x=\"324\" y=\"174\" font-size=\"8\" fill=\"#2563eb\" text-anchor=\"end\">Remove</text>\n <circle cx=\"88\" cy=\"200\" r=\"9\" fill=\"#aaa\" stroke=\"#fff\"/>\n <rect x=\"104\" y=\"194\" width=\"90\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"104\" y=\"203\" width=\"54\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <rect x=\"214\" y=\"192\" width=\"70\" height=\"18\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"220\" y=\"204.0\" font-size=\"8\" fill=\"#999\">Can view</text>\n <path d=\"M272 199 l4 4 l4 -4\" fill=\"none\" stroke=\"#666\"/>\n <text x=\"324\" y=\"204\" font-size=\"8\" fill=\"#2563eb\" text-anchor=\"end\">Remove</text>\n <text x=\"76\" y=\"228\" font-size=\"8\" fill=\"#666\">Link access</text>\n <rect x=\"76\" y=\"232\" width=\"248\" height=\"18\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"82\" y=\"244.0\" font-size=\"8\" fill=\"#999\">Only people in the workspace</text>\n <path d=\"M312 239 l4 4 l4 -4\" fill=\"none\" stroke=\"#666\"/>\n <text x=\"76\" y=\"264\" font-size=\"7.5\" fill=\"#666\">Removing someone disconnects their open session immediately.</text>\n</svg>"
466
+ },
467
+ {
468
+ "id": "mockup-workspace-members",
469
+ "type": "mockup",
470
+ "label": "Workspace Members",
471
+ "description": "Everyone with access to the workspace and their role.",
472
+ "parentId": "flow-workspace-admin",
473
+ "x": 350,
474
+ "y": 110,
475
+ "width": 220,
476
+ "height": 190,
477
+ "collapsed": false,
478
+ "screen": "/settings/members",
479
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"30\" fill=\"#f3f4f6\" stroke=\"#333\"/>\n <rect x=\"10\" y=\"8\" width=\"14\" height=\"14\" rx=\"3\" fill=\"#ccc\"/>\n <text x=\"30\" y=\"20\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Workspace</text>\n <text x=\"388\" y=\"19\" font-size=\"9\" fill=\"#666\" text-anchor=\"end\">Settings</text>\n <text x=\"332\" y=\"19\" font-size=\"9\" fill=\"#666\" text-anchor=\"end\">Members</text>\n <text x=\"281\" y=\"19\" font-size=\"9\" fill=\"#666\" text-anchor=\"end\">Docs</text>\n <text x=\"16\" y=\"54\" font-size=\"12\" fill=\"#333\" font-weight=\"bold\">Members</text>\n <rect x=\"290\" y=\"40\" width=\"94\" height=\"20\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"337.0\" y=\"53.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">Invite</text>\n <rect x=\"16\" y=\"66\" width=\"368\" height=\"26\" fill=\"#f3f4f6\"/>\n <text x=\"22\" y=\"82.0\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Member</text>\n <text x=\"192\" y=\"82.0\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Role</text>\n <text x=\"282\" y=\"82.0\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\">Last active</text>\n <text x=\"352\" y=\"82.0\" font-size=\"8\" fill=\"#333\" font-weight=\"bold\"></text>\n <line x1=\"16\" y1=\"118\" x2=\"384\" y2=\"118\" stroke=\"#e5e7eb\"/>\n <text x=\"22\" y=\"108.0\" font-size=\"8\" fill=\"#333\">Ana Ruiz</text>\n <text x=\"192\" y=\"108.0\" font-size=\"8\" fill=\"#333\">Admin</text>\n <text x=\"282\" y=\"108.0\" font-size=\"8\" fill=\"#333\">now</text>\n <text x=\"352\" y=\"108.0\" font-size=\"8\" fill=\"#333\"></text>\n <line x1=\"16\" y1=\"144\" x2=\"384\" y2=\"144\" stroke=\"#e5e7eb\"/>\n <text x=\"22\" y=\"134.0\" font-size=\"8\" fill=\"#333\">Ben Okafor</text>\n <text x=\"192\" y=\"134.0\" font-size=\"8\" fill=\"#333\">Member</text>\n <text x=\"282\" y=\"134.0\" font-size=\"8\" fill=\"#333\">now</text>\n <text x=\"352\" y=\"134.0\" font-size=\"8\" fill=\"#2563eb\">⋯</text>\n <rect x=\"16\" y=\"144\" width=\"368\" height=\"26\" fill=\"#eef2ff\"/>\n <line x1=\"16\" y1=\"170\" x2=\"384\" y2=\"170\" stroke=\"#e5e7eb\"/>\n <text x=\"22\" y=\"160.0\" font-size=\"8\" fill=\"#333\">Chris Lee</text>\n <text x=\"192\" y=\"160.0\" font-size=\"8\" fill=\"#333\">Member</text>\n <text x=\"282\" y=\"160.0\" font-size=\"8\" fill=\"#333\">2 d ago</text>\n <text x=\"352\" y=\"160.0\" font-size=\"8\" fill=\"#2563eb\">⋯</text>\n <line x1=\"16\" y1=\"196\" x2=\"384\" y2=\"196\" stroke=\"#e5e7eb\"/>\n <text x=\"22\" y=\"186.0\" font-size=\"8\" fill=\"#333\">Dana Kim</text>\n <text x=\"192\" y=\"186.0\" font-size=\"8\" fill=\"#333\">Guest</text>\n <text x=\"282\" y=\"186.0\" font-size=\"8\" fill=\"#333\">1 h ago</text>\n <text x=\"352\" y=\"186.0\" font-size=\"8\" fill=\"#2563eb\">⋯</text>\n <line x1=\"16\" y1=\"222\" x2=\"384\" y2=\"222\" stroke=\"#e5e7eb\"/>\n <rect x=\"22\" y=\"206.5\" width=\"90\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"192\" y=\"212.0\" font-size=\"8\" fill=\"#333\">Member</text>\n <rect x=\"282\" y=\"206.5\" width=\"30\" height=\"5\" rx=\"2\" fill=\"#e5e7eb\"/>\n <text x=\"352\" y=\"212.0\" font-size=\"8\" fill=\"#2563eb\">⋯</text>\n <text x=\"16\" y=\"244\" font-size=\"8\" fill=\"#666\">Removing a member ends their open sessions right away.</text>\n</svg>"
480
+ },
481
+ {
482
+ "id": "mockup-remove-member",
483
+ "type": "mockup",
484
+ "label": "Remove Member",
485
+ "description": "Removal disconnects live sessions immediately instead of waiting for tokens to expire.",
486
+ "parentId": "flow-workspace-admin",
487
+ "x": 670,
488
+ "y": 110,
489
+ "width": 220,
490
+ "height": 190,
491
+ "collapsed": false,
492
+ "screen": "/settings/members/:id/remove",
493
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"300\" rx=\"0\" fill=\"#e5e7eb\" stroke=\"#e5e7eb\"/>\n <rect x=\"60.0\" y=\"55.0\" width=\"280\" height=\"190\" rx=\"6\" fill=\"#fff\" stroke=\"#333\"/>\n <text x=\"76.0\" y=\"81.0\" font-size=\"12\" fill=\"#333\" font-weight=\"bold\">Remove Chris Lee?</text>\n <text x=\"76.0\" y=\"101.0\" font-size=\"9\" fill=\"#333\">Chris is editing 2 documents right now.</text>\n <rect x=\"76.0\" y=\"117.0\" width=\"9\" height=\"9\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <path d=\"M78.0 121.5 l2 2 l3.5 -4\" fill=\"none\" stroke=\"#2563eb\" stroke-width=\"1.5\"/>\n <text x=\"91.0\" y=\"125.0\" font-size=\"8\" fill=\"#333\">Disconnect open sessions immediately</text>\n <rect x=\"76.0\" y=\"135.0\" width=\"9\" height=\"9\" rx=\"2\" fill=\"#fff\" stroke=\"#999\"/>\n <path d=\"M78.0 139.5 l2 2 l3.5 -4\" fill=\"none\" stroke=\"#2563eb\" stroke-width=\"1.5\"/>\n <text x=\"91.0\" y=\"143.0\" font-size=\"8\" fill=\"#333\">Transfer ownership of 5 documents to me</text>\n <text x=\"76.0\" y=\"167.0\" font-size=\"8\" fill=\"#666\">Further edits from Chris are rejected from now on.</text>\n <rect x=\"76.0\" y=\"203.0\" width=\"110\" height=\"20\" rx=\"3\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"131.0\" y=\"216.0\" font-size=\"9\" fill=\"#333\" font-weight=\"bold\" text-anchor=\"middle\">Cancel</text>\n <rect x=\"214.0\" y=\"203.0\" width=\"110\" height=\"20\" rx=\"3\" fill=\"#2563eb\" stroke=\"#2563eb\"/>\n <text x=\"269.0\" y=\"216.0\" font-size=\"9\" fill=\"#fff\" font-weight=\"bold\" text-anchor=\"middle\">Remove</text>\n</svg>"
494
+ },
495
+ {
496
+ "id": "mockup-access-revoked",
497
+ "type": "mockup",
498
+ "label": "Access Removed",
499
+ "description": "What the removed collaborator sees: the session is closed and further operations are rejected.",
500
+ "parentId": "flow-workspace-admin",
501
+ "x": 990,
502
+ "y": 110,
503
+ "width": 220,
504
+ "height": 190,
505
+ "collapsed": false,
506
+ "screen": "/d/:docId",
507
+ "wireframe": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 300\" font-family=\"sans-serif\">\n <rect width=\"400\" height=\"300\" fill=\"#fff\"/>\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"30\" fill=\"#f3f4f6\" stroke=\"#333\"/>\n <rect x=\"10\" y=\"8\" width=\"14\" height=\"14\" rx=\"3\" fill=\"#ccc\"/>\n <text x=\"30\" y=\"20\" font-size=\"11\" fill=\"#333\" font-weight=\"bold\">Q3 Planning</text>\n <rect x=\"0\" y=\"30\" width=\"400\" height=\"270\" rx=\"0\" fill=\"#e5e7eb\" stroke=\"#e5e7eb\"/>\n <rect x=\"80\" y=\"80\" width=\"240\" height=\"140\" rx=\"6\" fill=\"#fff\" stroke=\"#333\"/>\n <text x=\"200\" y=\"116\" font-size=\"12\" fill=\"#333\" font-weight=\"bold\" text-anchor=\"middle\">You no longer have access</text>\n <text x=\"200\" y=\"136\" font-size=\"8\" fill=\"#666\" text-anchor=\"middle\">An admin removed you from this document.</text>\n <text x=\"200\" y=\"150\" font-size=\"8\" fill=\"#666\" text-anchor=\"middle\">Unsent changes were not saved to it.</text>\n <rect x=\"120\" y=\"172\" width=\"160\" height=\"20\" rx=\"3\" fill=\"#fff\" stroke=\"#999\"/>\n <text x=\"200.0\" y=\"185.0\" font-size=\"9\" fill=\"#333\" font-weight=\"bold\" text-anchor=\"middle\">Back to workspace</text>\n</svg>"
508
+ }
509
+ ],
510
+ "relations": [
511
+ {
512
+ "id": "collaborator--editor-client",
513
+ "sourceId": "collaborator",
514
+ "targetId": "editor-client",
515
+ "label": "Edits the document",
516
+ "technology": "local-first UI"
517
+ },
518
+ {
519
+ "id": "editor-client--sync-gateway",
520
+ "sourceId": "editor-client",
521
+ "targetId": "sync-gateway",
522
+ "label": "Sends & receives operations",
523
+ "technology": "WebSocket"
524
+ },
525
+ {
526
+ "id": "sync-gateway--identity-provider",
527
+ "sourceId": "sync-gateway",
528
+ "targetId": "identity-provider",
529
+ "label": "Verifies session",
530
+ "technology": "OIDC"
531
+ },
532
+ {
533
+ "id": "sync-gateway--permission-service",
534
+ "sourceId": "sync-gateway",
535
+ "targetId": "permission-service",
536
+ "label": "Checks document access before admitting the client",
537
+ "technology": "gRPC"
538
+ },
539
+ {
540
+ "id": "sync-gateway--op-broadcast-bus",
541
+ "sourceId": "sync-gateway",
542
+ "targetId": "op-broadcast-bus",
543
+ "label": "Publishes accepted operation",
544
+ "technology": "pub/sub"
545
+ },
546
+ {
547
+ "id": "op-broadcast-bus--sync-gateway",
548
+ "sourceId": "op-broadcast-bus",
549
+ "targetId": "sync-gateway",
550
+ "label": "Delivers operations accepted by other instances",
551
+ "technology": "pub/sub"
552
+ },
553
+ {
554
+ "id": "sync-gateway--op-log-store",
555
+ "sourceId": "sync-gateway",
556
+ "targetId": "op-log-store",
557
+ "label": "Appends accepted operation",
558
+ "technology": "SQL"
559
+ },
560
+ {
561
+ "id": "snapshot-worker--op-log-store",
562
+ "sourceId": "snapshot-worker",
563
+ "targetId": "op-log-store",
564
+ "label": "Reads operations since the last snapshot",
565
+ "technology": "SQL"
566
+ },
567
+ {
568
+ "id": "snapshot-worker--snapshot-store",
569
+ "sourceId": "snapshot-worker",
570
+ "targetId": "snapshot-store",
571
+ "label": "Writes compacted snapshot",
572
+ "technology": "S3 API"
573
+ },
574
+ {
575
+ "id": "sync-gateway--snapshot-store",
576
+ "sourceId": "sync-gateway",
577
+ "targetId": "snapshot-store",
578
+ "label": "Loads snapshot when a client (re)joins",
579
+ "technology": "S3 API"
580
+ },
581
+ {
582
+ "id": "workspace-admin--permission-service",
583
+ "sourceId": "workspace-admin",
584
+ "targetId": "permission-service",
585
+ "label": "Manages sharing & access, revokes collaborators",
586
+ "technology": "HTTPS"
587
+ },
588
+ {
589
+ "id": "req-offline-merge--sync-gateway",
590
+ "sourceId": "req-offline-merge",
591
+ "targetId": "sync-gateway",
592
+ "relationType": "constrains"
593
+ },
594
+ {
595
+ "id": "req-room-capacity--sync-gateway",
596
+ "sourceId": "req-room-capacity",
597
+ "targetId": "sync-gateway",
598
+ "relationType": "constrains"
599
+ },
600
+ {
601
+ "id": "req-access-revocation--permission-service",
602
+ "sourceId": "req-access-revocation",
603
+ "targetId": "permission-service",
604
+ "relationType": "constrains"
605
+ },
606
+ {
607
+ "id": "req-snapshot-recovery--op-log-store",
608
+ "sourceId": "req-snapshot-recovery",
609
+ "targetId": "op-log-store",
610
+ "relationType": "constrains"
611
+ },
612
+ {
613
+ "id": "req-offline-merge--ff-reconnect-success-rate",
614
+ "sourceId": "req-offline-merge",
615
+ "targetId": "ff-reconnect-success-rate",
616
+ "relationType": "traces-to"
617
+ },
618
+ {
619
+ "id": "req-room-capacity--ff-presence-fanout-guard",
620
+ "sourceId": "req-room-capacity",
621
+ "targetId": "ff-presence-fanout-guard",
622
+ "relationType": "traces-to"
623
+ },
624
+ {
625
+ "id": "ff-snapshot-compaction-lag--snapshot-worker",
626
+ "sourceId": "ff-snapshot-compaction-lag",
627
+ "targetId": "snapshot-worker",
628
+ "relationType": "constrains"
629
+ },
630
+ {
631
+ "id": "adr-crdt-over-ot--editor-client",
632
+ "sourceId": "adr-crdt-over-ot",
633
+ "targetId": "editor-client",
634
+ "relationType": "constrains"
635
+ },
636
+ {
637
+ "id": "adr-stateless-gateway-fleet--sync-gateway",
638
+ "sourceId": "adr-stateless-gateway-fleet",
639
+ "targetId": "sync-gateway",
640
+ "relationType": "constrains"
641
+ },
642
+ {
643
+ "id": "req-room-capacity--adr-stateless-gateway-fleet",
644
+ "sourceId": "req-room-capacity",
645
+ "targetId": "adr-stateless-gateway-fleet",
646
+ "relationType": "traces-to"
647
+ },
648
+ {
649
+ "id": "mockup-doc-list--editor-client",
650
+ "sourceId": "mockup-doc-list",
651
+ "targetId": "editor-client",
652
+ "relationType": "presented-by"
653
+ },
654
+ {
655
+ "id": "mockup-doc-list--mockup-document-editor",
656
+ "sourceId": "mockup-doc-list",
657
+ "targetId": "mockup-document-editor",
658
+ "relationType": "navigates-to",
659
+ "label": "Open"
660
+ },
661
+ {
662
+ "id": "mockup-document-editor--req-offline-merge",
663
+ "sourceId": "mockup-document-editor",
664
+ "targetId": "req-offline-merge",
665
+ "relationType": "illustrates"
666
+ },
667
+ {
668
+ "id": "mockup-document-editor--req-room-capacity",
669
+ "sourceId": "mockup-document-editor",
670
+ "targetId": "req-room-capacity",
671
+ "relationType": "illustrates"
672
+ },
673
+ {
674
+ "id": "mockup-document-editor--editor-client",
675
+ "sourceId": "mockup-document-editor",
676
+ "targetId": "editor-client",
677
+ "relationType": "presented-by"
678
+ },
679
+ {
680
+ "id": "mockup-document-editor--mockup-reconnect-merge",
681
+ "sourceId": "mockup-document-editor",
682
+ "targetId": "mockup-reconnect-merge",
683
+ "relationType": "navigates-to",
684
+ "label": "Reconnect"
685
+ },
686
+ {
687
+ "id": "mockup-document-editor--mockup-share-dialog",
688
+ "sourceId": "mockup-document-editor",
689
+ "targetId": "mockup-share-dialog",
690
+ "relationType": "navigates-to",
691
+ "label": "Share"
692
+ },
693
+ {
694
+ "id": "mockup-document-editor--mockup-version-history",
695
+ "sourceId": "mockup-document-editor",
696
+ "targetId": "mockup-version-history",
697
+ "relationType": "navigates-to",
698
+ "label": "History"
699
+ },
700
+ {
701
+ "id": "mockup-reconnect-merge--req-offline-merge",
702
+ "sourceId": "mockup-reconnect-merge",
703
+ "targetId": "req-offline-merge",
704
+ "relationType": "illustrates"
705
+ },
706
+ {
707
+ "id": "mockup-reconnect-merge--editor-client",
708
+ "sourceId": "mockup-reconnect-merge",
709
+ "targetId": "editor-client",
710
+ "relationType": "presented-by"
711
+ },
712
+ {
713
+ "id": "mockup-version-history--req-snapshot-recovery",
714
+ "sourceId": "mockup-version-history",
715
+ "targetId": "req-snapshot-recovery",
716
+ "relationType": "illustrates"
717
+ },
718
+ {
719
+ "id": "mockup-version-history--editor-client",
720
+ "sourceId": "mockup-version-history",
721
+ "targetId": "editor-client",
722
+ "relationType": "presented-by"
723
+ },
724
+ {
725
+ "id": "mockup-version-history--mockup-restore-version",
726
+ "sourceId": "mockup-version-history",
727
+ "targetId": "mockup-restore-version",
728
+ "relationType": "navigates-to",
729
+ "label": "Restore this version"
730
+ },
731
+ {
732
+ "id": "mockup-restore-version--req-snapshot-recovery",
733
+ "sourceId": "mockup-restore-version",
734
+ "targetId": "req-snapshot-recovery",
735
+ "relationType": "illustrates"
736
+ },
737
+ {
738
+ "id": "mockup-restore-version--editor-client",
739
+ "sourceId": "mockup-restore-version",
740
+ "targetId": "editor-client",
741
+ "relationType": "presented-by"
742
+ },
743
+ {
744
+ "id": "mockup-restore-version--mockup-document-editor",
745
+ "sourceId": "mockup-restore-version",
746
+ "targetId": "mockup-document-editor",
747
+ "relationType": "navigates-to",
748
+ "label": "Restore"
749
+ },
750
+ {
751
+ "id": "mockup-share-dialog--req-access-revocation",
752
+ "sourceId": "mockup-share-dialog",
753
+ "targetId": "req-access-revocation",
754
+ "relationType": "illustrates"
755
+ },
756
+ {
757
+ "id": "mockup-share-dialog--editor-client",
758
+ "sourceId": "mockup-share-dialog",
759
+ "targetId": "editor-client",
760
+ "relationType": "presented-by"
761
+ },
762
+ {
763
+ "id": "mockup-share-dialog--mockup-workspace-members",
764
+ "sourceId": "mockup-share-dialog",
765
+ "targetId": "mockup-workspace-members",
766
+ "relationType": "navigates-to",
767
+ "label": "Manage members"
768
+ },
769
+ {
770
+ "id": "mockup-workspace-members--req-access-revocation",
771
+ "sourceId": "mockup-workspace-members",
772
+ "targetId": "req-access-revocation",
773
+ "relationType": "illustrates"
774
+ },
775
+ {
776
+ "id": "mockup-workspace-members--editor-client",
777
+ "sourceId": "mockup-workspace-members",
778
+ "targetId": "editor-client",
779
+ "relationType": "presented-by"
780
+ },
781
+ {
782
+ "id": "mockup-workspace-members--mockup-remove-member",
783
+ "sourceId": "mockup-workspace-members",
784
+ "targetId": "mockup-remove-member",
785
+ "relationType": "navigates-to",
786
+ "label": "Remove"
787
+ },
788
+ {
789
+ "id": "mockup-remove-member--req-access-revocation",
790
+ "sourceId": "mockup-remove-member",
791
+ "targetId": "req-access-revocation",
792
+ "relationType": "illustrates"
793
+ },
794
+ {
795
+ "id": "mockup-remove-member--editor-client",
796
+ "sourceId": "mockup-remove-member",
797
+ "targetId": "editor-client",
798
+ "relationType": "presented-by"
799
+ },
800
+ {
801
+ "id": "mockup-remove-member--mockup-access-revoked",
802
+ "sourceId": "mockup-remove-member",
803
+ "targetId": "mockup-access-revoked",
804
+ "relationType": "navigates-to",
805
+ "label": "Remove"
806
+ },
807
+ {
808
+ "id": "mockup-access-revoked--req-access-revocation",
809
+ "sourceId": "mockup-access-revoked",
810
+ "targetId": "req-access-revocation",
811
+ "relationType": "illustrates"
812
+ },
813
+ {
814
+ "id": "mockup-access-revoked--editor-client",
815
+ "sourceId": "mockup-access-revoked",
816
+ "targetId": "editor-client",
817
+ "relationType": "presented-by"
818
+ },
819
+ {
820
+ "id": "mockup-access-revoked--mockup-doc-list",
821
+ "sourceId": "mockup-access-revoked",
822
+ "targetId": "mockup-doc-list",
823
+ "relationType": "navigates-to",
824
+ "label": "Back to workspace"
825
+ }
826
+ ],
827
+ "sequences": [
828
+ {
829
+ "id": "bp-realtime-collaboration-seq",
830
+ "name": "An edit is accepted, broadcast, and persisted",
831
+ "relationIds": [
832
+ "editor-client--sync-gateway",
833
+ "sync-gateway--permission-service",
834
+ "sync-gateway--op-broadcast-bus",
835
+ "op-broadcast-bus--sync-gateway",
836
+ "sync-gateway--op-log-store"
837
+ ],
838
+ "stepDescriptions": [
839
+ "Collaborator edits; the local CRDT applies the change instantly and sends the resulting operation to the gateway.",
840
+ "Gateway checks the operation is still within the collaborator's current access before accepting it.",
841
+ "Gateway publishes the accepted operation onto the broadcast bus.",
842
+ "Every other gateway instance receives it and relays it to its own connected replicas — merge order doesn't matter, so this can happen in any order relative to other concurrent edits.",
843
+ "The originating gateway durably appends the operation to the op log."
844
+ ]
845
+ },
846
+ {
847
+ "id": "seq-flow-collaborator",
848
+ "name": "Collaborator journey",
849
+ "relationIds": [
850
+ "mockup-doc-list--mockup-document-editor",
851
+ "mockup-document-editor--mockup-reconnect-merge",
852
+ "mockup-document-editor--mockup-version-history",
853
+ "mockup-version-history--mockup-restore-version",
854
+ "mockup-restore-version--mockup-document-editor"
855
+ ],
856
+ "stepDescriptions": [
857
+ "Open → Document Editor. Everyone edits a local replica: changes apply instantly, keep working offline (up to {{OFFLINE_GRACE_HOURS}} h) and merge on reconnect; presence shows up to {{MAX_DOC_COLLABORATORS}} collaborators.",
858
+ "Reconnect → Back Online — Merged. On reconnect the offline operation log is replayed and merged automatically — no conflict dialogs, no lost edits.",
859
+ "History → Version History. Browse and restore any earlier state of the document, reconstructed from snapshots plus the operation log.",
860
+ "Restore this version → Restore Version. Restoring an older state is itself a new version, reconstructed from snapshot plus operation log.",
861
+ "Restore → Document Editor. Everyone edits a local replica: changes apply instantly, keep working offline (up to {{OFFLINE_GRACE_HOURS}} h) and merge on reconnect; presence shows up to {{MAX_DOC_COLLABORATORS}} collaborators."
862
+ ]
863
+ },
864
+ {
865
+ "id": "seq-flow-workspace-admin",
866
+ "name": "Workspace admin journey",
867
+ "relationIds": [
868
+ "mockup-share-dialog--mockup-workspace-members",
869
+ "mockup-workspace-members--mockup-remove-member",
870
+ "mockup-remove-member--mockup-access-revoked"
871
+ ],
872
+ "stepDescriptions": [
873
+ "Manage members → Workspace Members. Everyone with access to the workspace and their role.",
874
+ "Remove → Remove Member. Removal disconnects live sessions immediately instead of waiting for tokens to expire.",
875
+ "Remove → Access Removed. What the removed collaborator sees: the session is closed and further operations are rejected."
876
+ ]
877
+ }
878
+ ],
879
+ "views": [
880
+ {
881
+ "id": "view-context",
882
+ "name": "System context",
883
+ "kind": "static",
884
+ "nodeIds": [
885
+ "collaborator",
886
+ "workspace-admin",
887
+ "platform",
888
+ "identity-provider"
889
+ ],
890
+ "collapsedNodeIds": [
891
+ "platform"
892
+ ],
893
+ "positions": {
894
+ "collaborator": {
895
+ "x": 0,
896
+ "y": 0,
897
+ "width": 150,
898
+ "height": 170
899
+ },
900
+ "platform": {
901
+ "x": 0,
902
+ "y": 290,
903
+ "width": 280,
904
+ "height": 180
905
+ },
906
+ "workspace-admin": {
907
+ "x": 210,
908
+ "y": 0,
909
+ "width": 150,
910
+ "height": 170
911
+ },
912
+ "identity-provider": {
913
+ "x": 400,
914
+ "y": 290,
915
+ "width": 360,
916
+ "height": 260
917
+ }
918
+ }
919
+ },
920
+ {
921
+ "id": "view-containers",
922
+ "name": "Containers",
923
+ "kind": "static",
924
+ "nodeIds": [
925
+ "collaborator",
926
+ "workspace-admin",
927
+ "platform",
928
+ "editor-client",
929
+ "sync-gateway",
930
+ "op-broadcast-bus",
931
+ "snapshot-worker",
932
+ "permission-service",
933
+ "op-log-store",
934
+ "snapshot-store",
935
+ "identity-provider"
936
+ ],
937
+ "positions": {
938
+ "collaborator": {
939
+ "x": 0,
940
+ "y": 0,
941
+ "width": 150,
942
+ "height": 170
943
+ },
944
+ "editor-client": {
945
+ "x": 30,
946
+ "y": 110,
947
+ "width": 210,
948
+ "height": 140
949
+ },
950
+ "identity-provider": {
951
+ "x": 0,
952
+ "y": 1160,
953
+ "width": 360,
954
+ "height": 260
955
+ },
956
+ "op-broadcast-bus": {
957
+ "x": 710,
958
+ "y": 110,
959
+ "width": 220,
960
+ "height": 95
961
+ },
962
+ "op-log-store": {
963
+ "x": 30,
964
+ "y": 590,
965
+ "width": 190,
966
+ "height": 130
967
+ },
968
+ "permission-service": {
969
+ "x": 370,
970
+ "y": 350,
971
+ "width": 300,
972
+ "height": 200
973
+ },
974
+ "platform": {
975
+ "x": 0,
976
+ "y": 290,
977
+ "width": 960,
978
+ "height": 750
979
+ },
980
+ "snapshot-store": {
981
+ "x": 370,
982
+ "y": 590,
983
+ "width": 190,
984
+ "height": 130
985
+ },
986
+ "snapshot-worker": {
987
+ "x": 30,
988
+ "y": 350,
989
+ "width": 300,
990
+ "height": 200
991
+ },
992
+ "sync-gateway": {
993
+ "x": 370,
994
+ "y": 110,
995
+ "width": 300,
996
+ "height": 200
997
+ },
998
+ "workspace-admin": {
999
+ "x": 210,
1000
+ "y": 0,
1001
+ "width": 150,
1002
+ "height": 170
1003
+ }
1004
+ }
1005
+ },
1006
+ {
1007
+ "id": "bp-realtime-collaboration-flow",
1008
+ "name": "An edit is accepted, broadcast, and persisted",
1009
+ "kind": "dynamic",
1010
+ "sequenceId": "bp-realtime-collaboration-seq",
1011
+ "nodeIds": [
1012
+ "collaborator",
1013
+ "workspace-admin",
1014
+ "platform",
1015
+ "editor-client",
1016
+ "sync-gateway",
1017
+ "op-broadcast-bus",
1018
+ "snapshot-worker",
1019
+ "permission-service",
1020
+ "op-log-store",
1021
+ "snapshot-store",
1022
+ "identity-provider"
1023
+ ],
1024
+ "positions": {
1025
+ "collaborator": {
1026
+ "x": 0,
1027
+ "y": 0,
1028
+ "width": 150,
1029
+ "height": 170
1030
+ },
1031
+ "editor-client": {
1032
+ "x": 30,
1033
+ "y": 110,
1034
+ "width": 210,
1035
+ "height": 140
1036
+ },
1037
+ "identity-provider": {
1038
+ "x": 0,
1039
+ "y": 1160,
1040
+ "width": 360,
1041
+ "height": 260
1042
+ },
1043
+ "op-broadcast-bus": {
1044
+ "x": 710,
1045
+ "y": 110,
1046
+ "width": 220,
1047
+ "height": 95
1048
+ },
1049
+ "op-log-store": {
1050
+ "x": 30,
1051
+ "y": 590,
1052
+ "width": 190,
1053
+ "height": 130
1054
+ },
1055
+ "permission-service": {
1056
+ "x": 370,
1057
+ "y": 350,
1058
+ "width": 300,
1059
+ "height": 200
1060
+ },
1061
+ "platform": {
1062
+ "x": 0,
1063
+ "y": 290,
1064
+ "width": 960,
1065
+ "height": 750
1066
+ },
1067
+ "snapshot-store": {
1068
+ "x": 370,
1069
+ "y": 590,
1070
+ "width": 190,
1071
+ "height": 130
1072
+ },
1073
+ "snapshot-worker": {
1074
+ "x": 30,
1075
+ "y": 350,
1076
+ "width": 300,
1077
+ "height": 200
1078
+ },
1079
+ "sync-gateway": {
1080
+ "x": 370,
1081
+ "y": 110,
1082
+ "width": 300,
1083
+ "height": 200
1084
+ },
1085
+ "workspace-admin": {
1086
+ "x": 210,
1087
+ "y": 0,
1088
+ "width": 150,
1089
+ "height": 170
1090
+ }
1091
+ }
1092
+ },
1093
+ {
1094
+ "id": "view-governance",
1095
+ "name": "Governance map",
1096
+ "kind": "static",
1097
+ "nodeIds": [
1098
+ "req-offline-merge",
1099
+ "req-room-capacity",
1100
+ "req-access-revocation",
1101
+ "req-snapshot-recovery",
1102
+ "ff-presence-fanout-guard",
1103
+ "ff-snapshot-compaction-lag",
1104
+ "ff-reconnect-success-rate",
1105
+ "adr-crdt-over-ot",
1106
+ "adr-stateless-gateway-fleet",
1107
+ "sync-gateway",
1108
+ "permission-service",
1109
+ "op-log-store",
1110
+ "snapshot-worker",
1111
+ "editor-client"
1112
+ ],
1113
+ "positions": {
1114
+ "adr-crdt-over-ot": {
1115
+ "x": 0,
1116
+ "y": 1912,
1117
+ "width": 260,
1118
+ "height": 52
1119
+ },
1120
+ "adr-stateless-gateway-fleet": {
1121
+ "x": 320,
1122
+ "y": 1912,
1123
+ "width": 260,
1124
+ "height": 52
1125
+ },
1126
+ "editor-client": {
1127
+ "x": 30,
1128
+ "y": 110,
1129
+ "width": 210,
1130
+ "height": 140
1131
+ },
1132
+ "ff-presence-fanout-guard": {
1133
+ "x": 0,
1134
+ "y": 1740,
1135
+ "width": 260,
1136
+ "height": 52
1137
+ },
1138
+ "ff-reconnect-success-rate": {
1139
+ "x": 640,
1140
+ "y": 1740,
1141
+ "width": 260,
1142
+ "height": 52
1143
+ },
1144
+ "ff-snapshot-compaction-lag": {
1145
+ "x": 320,
1146
+ "y": 1740,
1147
+ "width": 260,
1148
+ "height": 52
1149
+ },
1150
+ "op-log-store": {
1151
+ "x": 30,
1152
+ "y": 590,
1153
+ "width": 190,
1154
+ "height": 130
1155
+ },
1156
+ "permission-service": {
1157
+ "x": 370,
1158
+ "y": 350,
1159
+ "width": 300,
1160
+ "height": 200
1161
+ },
1162
+ "platform": {
1163
+ "x": 0,
1164
+ "y": 290,
1165
+ "width": 960,
1166
+ "height": 750
1167
+ },
1168
+ "req-access-revocation": {
1169
+ "x": 640,
1170
+ "y": 1540,
1171
+ "width": 260,
1172
+ "height": 80
1173
+ },
1174
+ "req-offline-merge": {
1175
+ "x": 0,
1176
+ "y": 1540,
1177
+ "width": 260,
1178
+ "height": 80
1179
+ },
1180
+ "req-room-capacity": {
1181
+ "x": 320,
1182
+ "y": 1540,
1183
+ "width": 260,
1184
+ "height": 80
1185
+ },
1186
+ "req-snapshot-recovery": {
1187
+ "x": 960,
1188
+ "y": 1540,
1189
+ "width": 260,
1190
+ "height": 80
1191
+ },
1192
+ "snapshot-worker": {
1193
+ "x": 30,
1194
+ "y": 350,
1195
+ "width": 300,
1196
+ "height": 200
1197
+ },
1198
+ "sync-gateway": {
1199
+ "x": 370,
1200
+ "y": 110,
1201
+ "width": 300,
1202
+ "height": 200
1203
+ }
1204
+ }
1205
+ },
1206
+ {
1207
+ "id": "view-mockups",
1208
+ "name": "Mockups",
1209
+ "kind": "static",
1210
+ "nodeIds": [
1211
+ "flow-collaborator",
1212
+ "flow-workspace-admin",
1213
+ "mockup-doc-list",
1214
+ "mockup-document-editor",
1215
+ "mockup-reconnect-merge",
1216
+ "mockup-version-history",
1217
+ "mockup-restore-version",
1218
+ "mockup-share-dialog",
1219
+ "mockup-workspace-members",
1220
+ "mockup-remove-member",
1221
+ "mockup-access-revoked"
1222
+ ],
1223
+ "positions": {
1224
+ "flow-collaborator": {
1225
+ "x": 0,
1226
+ "y": 2084,
1227
+ "width": 1560,
1228
+ "height": 330
1229
+ },
1230
+ "flow-workspace-admin": {
1231
+ "x": 0,
1232
+ "y": 2494,
1233
+ "width": 1240,
1234
+ "height": 330
1235
+ },
1236
+ "mockup-access-revoked": {
1237
+ "x": 990,
1238
+ "y": 110,
1239
+ "width": 220,
1240
+ "height": 190
1241
+ },
1242
+ "mockup-doc-list": {
1243
+ "x": 30,
1244
+ "y": 110,
1245
+ "width": 220,
1246
+ "height": 190
1247
+ },
1248
+ "mockup-document-editor": {
1249
+ "x": 350,
1250
+ "y": 110,
1251
+ "width": 220,
1252
+ "height": 190
1253
+ },
1254
+ "mockup-reconnect-merge": {
1255
+ "x": 670,
1256
+ "y": 110,
1257
+ "width": 220,
1258
+ "height": 190
1259
+ },
1260
+ "mockup-remove-member": {
1261
+ "x": 670,
1262
+ "y": 110,
1263
+ "width": 220,
1264
+ "height": 190
1265
+ },
1266
+ "mockup-restore-version": {
1267
+ "x": 1310,
1268
+ "y": 110,
1269
+ "width": 220,
1270
+ "height": 190
1271
+ },
1272
+ "mockup-share-dialog": {
1273
+ "x": 30,
1274
+ "y": 110,
1275
+ "width": 220,
1276
+ "height": 190
1277
+ },
1278
+ "mockup-version-history": {
1279
+ "x": 990,
1280
+ "y": 110,
1281
+ "width": 220,
1282
+ "height": 190
1283
+ },
1284
+ "mockup-workspace-members": {
1285
+ "x": 350,
1286
+ "y": 110,
1287
+ "width": 220,
1288
+ "height": 190
1289
+ }
1290
+ }
1291
+ },
1292
+ {
1293
+ "id": "view-flow-collaborator",
1294
+ "name": "Collaborator journey",
1295
+ "kind": "dynamic",
1296
+ "sequenceId": "seq-flow-collaborator",
1297
+ "nodeIds": [
1298
+ "flow-collaborator",
1299
+ "mockup-doc-list",
1300
+ "mockup-document-editor",
1301
+ "mockup-reconnect-merge",
1302
+ "mockup-version-history",
1303
+ "mockup-restore-version"
1304
+ ],
1305
+ "positions": {
1306
+ "flow-collaborator": {
1307
+ "x": 0,
1308
+ "y": 2084,
1309
+ "width": 1560,
1310
+ "height": 330
1311
+ },
1312
+ "mockup-doc-list": {
1313
+ "x": 30,
1314
+ "y": 110,
1315
+ "width": 220,
1316
+ "height": 190
1317
+ },
1318
+ "mockup-document-editor": {
1319
+ "x": 350,
1320
+ "y": 110,
1321
+ "width": 220,
1322
+ "height": 190
1323
+ },
1324
+ "mockup-reconnect-merge": {
1325
+ "x": 670,
1326
+ "y": 110,
1327
+ "width": 220,
1328
+ "height": 190
1329
+ },
1330
+ "mockup-restore-version": {
1331
+ "x": 1310,
1332
+ "y": 110,
1333
+ "width": 220,
1334
+ "height": 190
1335
+ },
1336
+ "mockup-version-history": {
1337
+ "x": 990,
1338
+ "y": 110,
1339
+ "width": 220,
1340
+ "height": 190
1341
+ }
1342
+ }
1343
+ },
1344
+ {
1345
+ "id": "view-flow-workspace-admin",
1346
+ "name": "Workspace admin journey",
1347
+ "kind": "dynamic",
1348
+ "sequenceId": "seq-flow-workspace-admin",
1349
+ "nodeIds": [
1350
+ "flow-workspace-admin",
1351
+ "mockup-share-dialog",
1352
+ "mockup-workspace-members",
1353
+ "mockup-remove-member",
1354
+ "mockup-access-revoked"
1355
+ ],
1356
+ "positions": {
1357
+ "flow-workspace-admin": {
1358
+ "x": 0,
1359
+ "y": 2494,
1360
+ "width": 1240,
1361
+ "height": 330
1362
+ },
1363
+ "mockup-access-revoked": {
1364
+ "x": 990,
1365
+ "y": 110,
1366
+ "width": 220,
1367
+ "height": 190
1368
+ },
1369
+ "mockup-remove-member": {
1370
+ "x": 670,
1371
+ "y": 110,
1372
+ "width": 220,
1373
+ "height": 190
1374
+ },
1375
+ "mockup-share-dialog": {
1376
+ "x": 30,
1377
+ "y": 110,
1378
+ "width": 220,
1379
+ "height": 190
1380
+ },
1381
+ "mockup-workspace-members": {
1382
+ "x": 350,
1383
+ "y": 110,
1384
+ "width": 220,
1385
+ "height": 190
1386
+ }
1387
+ }
1388
+ },
1389
+ {
1390
+ "id": "view-wiki-governance",
1391
+ "name": "Governance",
1392
+ "kind": "wiki",
1393
+ "nodeIds": [
1394
+ "req-offline-merge",
1395
+ "req-room-capacity",
1396
+ "req-access-revocation",
1397
+ "req-snapshot-recovery",
1398
+ "ff-presence-fanout-guard",
1399
+ "ff-snapshot-compaction-lag",
1400
+ "ff-reconnect-success-rate",
1401
+ "adr-crdt-over-ot",
1402
+ "adr-stateless-gateway-fleet"
1403
+ ],
1404
+ "positions": {},
1405
+ "wikiFocusId": null
1406
+ },
1407
+ {
1408
+ "id": "view-wiki-requirements",
1409
+ "name": "Requirements",
1410
+ "kind": "wiki",
1411
+ "nodeIds": [
1412
+ "req-offline-merge",
1413
+ "req-room-capacity",
1414
+ "req-access-revocation",
1415
+ "req-snapshot-recovery"
1416
+ ],
1417
+ "positions": {},
1418
+ "wikiFocusId": null
1419
+ }
1420
+ ]
1421
+ }