oneie 2.0.3 → 2.0.5

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 (75) hide show
  1. package/CLAUDE.md +220 -29
  2. package/LICENSE.md +84 -0
  3. package/README.md +489 -931
  4. package/folders.yaml +78 -17
  5. package/one/.obsidian/workspace.json +6 -6
  6. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +412 -0
  7. package/one/events/FEATURE-2-4-COMPLETE.md +302 -0
  8. package/one/events/FEATURE_2_3_COMPLETE.md +575 -0
  9. package/one/events/GROUPS-MIGRATION.md +625 -0
  10. package/one/events/INSTALL-TESTS.md +293 -0
  11. package/one/events/INTEGRATION-ARCHITECTURE.md +561 -0
  12. package/one/events/INTEGRATION-CHECKLIST.md +1234 -0
  13. package/one/events/INTEGRATION-ORCHESTRATION.md +2623 -0
  14. package/one/events/INTEGRATION-SUMMARY.md +653 -0
  15. package/one/events/MIGRATION-REPORT.md +435 -0
  16. package/one/events/MIGRATION.md +69 -0
  17. package/one/events/README-archived.md +519 -0
  18. package/one/events/TEST-SUMMARY.md +393 -0
  19. package/one/events/TESTS-QUICK-REF.md +262 -0
  20. package/one/groups/groups.md +543 -0
  21. package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +49 -0
  22. package/one/knowledge/architecture-any-backend.md +1366 -0
  23. package/one/knowledge/docs/flow.md +0 -0
  24. package/one/knowledge/ontology-documentation.md +18 -18
  25. package/one/knowledge/ontology.md +154 -143
  26. package/one/knowledge/ontology.md.backup +2822 -0
  27. package/one/knowledge/ontology.yaml +87 -87
  28. package/one/knowledge/provider-creation-guide.md +1064 -0
  29. package/one/knowledge/todo.md +251 -0
  30. package/one/license.md +84 -0
  31. package/one/things/CHECKLIST.md +356 -0
  32. package/one/things/ONE.md +510 -0
  33. package/one/things/{cli.md → cli/cli.md} +27 -4
  34. package/one/things/features/2-1-dataprovider-interface.md +2358 -0
  35. package/one/things/features/2-2-config-system.md +3075 -0
  36. package/one/things/features/2-3-effectts-services.md +1498 -0
  37. package/one/things/features/2-4-react-hooks.md +2120 -0
  38. package/one/things/features/2-5-auth-migration.md +2046 -0
  39. package/one/things/features/2-6-dashboard-migration.md +1985 -0
  40. package/one/things/features/2-7-alternative-providers.md +2505 -0
  41. package/one/things/features/2-7-implementation-report.md +680 -0
  42. package/one/things/features/2-cli.md +39 -39
  43. package/one/things/features/2-design.md +1738 -0
  44. package/one/things/features/2-tests.md +520 -0
  45. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +521 -0
  46. package/one/things/features/DECOUPLING.md +272 -0
  47. package/one/things/features/DEPLOYMENT.md +452 -0
  48. package/one/things/features/IMPLEMENTATION_SUMMARY.md +316 -0
  49. package/one/things/features/dataprovider-interface/1-tests.md +1522 -0
  50. package/one/things/features/improve.md +843 -0
  51. package/one/things/features/remove-convex-deps.md +45 -0
  52. package/one/things/features/top-features.md +79 -0
  53. package/one/things/ideas/2-backend-agnostic-frontend.md +384 -0
  54. package/one/things/plans/2-backend-agnostic-frontend.md +543 -0
  55. package/one/things/plans/3-groups.md +502 -0
  56. package/one/things/plans/backend-agnostic-frontend.md +323 -0
  57. package/one/things/plans/deploy-to-cloudflare.md +581 -0
  58. package/one/things/plans/organizations-to-groups.md +705 -0
  59. package/one/things/plans/release.md +432 -0
  60. package/one/things/products/ontology.md +1 -1
  61. package/one/things/system.md +600 -0
  62. package/one/things/tests/2-1-dataprovider-interface.md +1144 -0
  63. package/one/things/tests/2-1-test-analysis.md +496 -0
  64. package/one/things/vision/elegant-interface.md +214 -0
  65. package/package.json +1 -1
  66. package/one/organisation/organisation.md +0 -438
  67. package/one/repomix-output.md +0 -92634
  68. /package/one/{things → connections}/agentkit.md +0 -0
  69. /package/one/{things → connections}/copilotkit.md +0 -0
  70. /package/one/{organisation → groups}/one.md +0 -0
  71. /package/one/{organisation → groups}/revenue.md +0 -0
  72. /package/one/{organisation → groups}/strategy.md +0 -0
  73. /package/one/{organisation → groups}/vision.md +0 -0
  74. /package/one/things/{cli-code.md → cli/cli-code.md} +0 -0
  75. /package/one/things/{cli-compiler-code.md → cli/cli-compiler-code.md} +0 -0
@@ -0,0 +1,561 @@
1
+ # Integration Architecture - Visual Guide
2
+
3
+ **Integration Specialist Deliverable**
4
+ **Date:** 2025-10-13
5
+
6
+ ---
7
+
8
+ ## System Architecture Overview
9
+
10
+ ```
11
+ ┌─────────────────────────────────────────────────────────────────┐
12
+ │ FRONTEND LAYER │
13
+ │ ┌──────────────────────────────────────────────────────────┐ │
14
+ │ │ Astro 5 Pages (SSR) │ │
15
+ │ │ - /pages/dashboard.astro │ │
16
+ │ │ - /pages/admin/organizations.astro │ │
17
+ │ │ - /pages/account/*.astro │ │
18
+ │ └──────────────────────────────────────────────────────────┘ │
19
+ │ ┌──────────────────────────────────────────────────────────┐ │
20
+ │ │ React 19 Components (Islands) │ │
21
+ │ │ - OrganizationList.tsx │ │
22
+ │ │ - ThingCard.tsx │ │
23
+ │ │ - SemanticSearch.tsx │ │
24
+ │ │ (client:load for interactivity) │ │
25
+ │ └──────────────────────────────────────────────────────────┘ │
26
+ │ ┌──────────────────────────────────────────────────────────┐ │
27
+ │ │ Hooks (Provider-Agnostic) │ │
28
+ │ │ - useDataProvider() │ │
29
+ │ │ - useRealtimeData() │ │
30
+ │ │ - useOrganizations() │ │
31
+ │ │ - useThings() │ │
32
+ │ └──────────────────────────────────────────────────────────┘ │
33
+ └────────────────────┬────────────────────────────────────────────┘
34
+ │
35
+ │ IDataProvider Interface
36
+ │ (Protocol-Agnostic)
37
+ ↓
38
+ ┌─────────────────────────────────────────────────────────────────┐
39
+ │ DATA PROVIDER LAYER │
40
+ │ ┌──────────────────────────────────────────────────────────┐ │
41
+ │ │ IDataProvider Interface │ │
42
+ │ │ - organizations: OrganizationOperations │ │
43
+ │ │ - people: PeopleOperations │ │
44
+ │ │ - things: ThingOperations │ │
45
+ │ │ - connections: ConnectionOperations │ │
46
+ │ │ - events: EventOperations │ │
47
+ │ │ - knowledge: KnowledgeOperations │ │
48
+ │ └──────────────────────────────────────────────────────────┘ │
49
+ │ ┌──────────────────────────────────────────────────────────┐ │
50
+ │ │ Provider Implementations │ │
51
+ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
52
+ │ │ │ Convex │ │ Supabase │ │ Composite │ │ │
53
+ │ │ │ Provider │ │ Provider │ │ Provider │ │ │
54
+ │ │ │ │ │ │ │ │ │ │
55
+ │ │ │ Real-time │ │ pgvector │ │ Multi- │ │ │
56
+ │ │ │ WebSocket │ │ PostgreSQL │ │ backend │ │ │
57
+ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
58
+ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
59
+ │ │ │ WordPress │ │ Shopify │ │ Notion │ │ │
60
+ │ │ │ Provider │ │ Provider │ │ Provider │ │ │
61
+ │ │ │ │ │ │ │ │ │ │
62
+ │ │ │ CMS │ │ E-commerce │ │ Docs │ │ │
63
+ │ │ │ Polling │ │ REST API │ │ Webhooks │ │ │
64
+ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
65
+ │ └──────────────────────────────────────────────────────────┘ │
66
+ └────────────────────┬────────────────────────────────────────────┘
67
+ │
68
+ │ API Calls, WebSocket, REST, GraphQL
69
+ │
70
+ ↓
71
+ ┌─────────────────────────────────────────────────────────────────┐
72
+ │ BACKEND LAYER │
73
+ │ ┌──────────────────────────────────────────────────────────┐ │
74
+ │ │ Convex Backend (Primary) │ │
75
+ │ │ - Real-time database (WebSocket) │ │
76
+ │ │ - Typed functions (queries, mutations, actions) │ │
77
+ │ │ - Better Auth (session management) │ │
78
+ │ │ - Vector search (embeddings) │ │
79
+ │ │ - Rate limiting (@convex-dev/rate-limiter) │ │
80
+ │ │ - Email (Resend component) │ │
81
+ │ └──────────────────────────────────────────────────────────┘ │
82
+ │ ┌──────────────────────────────────────────────────────────┐ │
83
+ │ │ Alternative Backends │ │
84
+ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
85
+ │ │ │ Supabase │ │ WordPress │ │ Shopify │ │ │
86
+ │ │ │ PostgreSQL │ │ CMS │ │ E-commerce │ │ │
87
+ │ │ │ pgvector │ │ REST API │ │ REST API │ │ │
88
+ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
89
+ │ │ ┌─────────────┐ │ │
90
+ │ │ │ Notion │ │ │
91
+ │ │ │ Docs │ │ │
92
+ │ │ │ GraphQL │ │ │
93
+ │ │ └─────────────┘ │ │
94
+ │ └──────────────────────────────────────────────────────────┘ │
95
+ └─────────────────────────────────────────────────────────────────┘
96
+ ```
97
+
98
+ ---
99
+
100
+ ## 6-Dimension Data Flow
101
+
102
+ ```
103
+ ┌─────────────────────────────────────────────────────────────────┐
104
+ │ 1. ORGANIZATIONS │
105
+ │ Multi-tenant isolation boundary │
106
+ │ ┌─────────────────────────────────────────────────────────┐ │
107
+ │ │ Frontend: useOrganizations() │ │
108
+ │ │ ↓ │ │
109
+ │ │ Provider: organizations.list(userId) │ │
110
+ │ │ ↓ │ │
111
+ │ │ Backend: Query entities WHERE type="organization" │ │
112
+ │ │ + Filter by membership connections │ │
113
+ │ └─────────────────────────────────────────────────────────┘ │
114
+ └─────────────────────────────────────────────────────────────────┘
115
+ ↓
116
+ ┌─────────────────────────────────────────────────────────────────┐
117
+ │ 2. PEOPLE │
118
+ │ Authorization & governance │
119
+ │ ┌─────────────────────────────────────────────────────────┐ │
120
+ │ │ Frontend: useAuth() │ │
121
+ │ │ ↓ │ │
122
+ │ │ Provider: auth.getCurrentUser() │ │
123
+ │ │ ↓ │ │
124
+ │ │ Backend: Better Auth + role-based permissions │ │
125
+ │ │ Roles: platform_owner, org_owner, org_user │ │
126
+ │ └─────────────────────────────────────────────────────────┘ │
127
+ └─────────────────────────────────────────────────────────────────┘
128
+ ↓
129
+ ┌─────────────────────────────────────────────────────────────────┐
130
+ │ 3. THINGS │
131
+ │ All entities (66 types) │
132
+ │ ┌─────────────────────────────────────────────────────────┐ │
133
+ │ │ Frontend: useThings({ type: "blog_post" }) │ │
134
+ │ │ ↓ │ │
135
+ │ │ Provider: things.list(type) │ │
136
+ │ │ ↓ (Route to appropriate backend) │ │
137
+ │ │ CompositeProvider: │ │
138
+ │ │ - "blog_post" → WordPress │ │
139
+ │ │ - "product" → Shopify │ │
140
+ │ │ - "document" → Notion │ │
141
+ │ │ - default → Convex │ │
142
+ │ └─────────────────────────────────────────────────────────┘ │
143
+ └─────────────────────────────────────────────────────────────────┘
144
+ ↓
145
+ ┌─────────────────────────────────────────────────────────────────┐
146
+ │ 4. CONNECTIONS │
147
+ │ All relationships (25 types) │
148
+ │ ┌─────────────────────────────────────────────────────────┐ │
149
+ │ │ Frontend: useConnections({ thingId }) │ │
150
+ │ │ ↓ │ │
151
+ │ │ Provider: connections.list(thingId) │ │
152
+ │ │ ↓ │ │
153
+ │ │ Backend: Query connections (bidirectional) │ │
154
+ │ │ - Outgoing: from_entity index │ │
155
+ │ │ - Incoming: to_entity index │ │
156
+ │ │ - Cross-backend: Convex ↔ WordPress ↔ Notion │ │
157
+ │ └─────────────────────────────────────────────────────────┘ │
158
+ └─────────────────────────────────────────────────────────────────┘
159
+ ↓
160
+ ┌─────────────────────────────────────────────────────────────────┐
161
+ │ 5. EVENTS │
162
+ │ All actions (67 types) │
163
+ │ ┌─────────────────────────────────────────────────────────┐ │
164
+ │ │ Frontend: useEvents({ thingId }) │ │
165
+ │ │ ↓ │ │
166
+ │ │ Provider: events.listForThing(thingId) │ │
167
+ │ │ ↓ │ │
168
+ │ │ Backend: Complete audit trail │ │
169
+ │ │ - Actor tracking (who did what) │ │
170
+ │ │ - Protocol metadata (A2A, ACP, AP2, X402, AG-UI) │ │
171
+ │ │ - Spans provider boundaries │ │
172
+ │ └─────────────────────────────────────────────────────────┘ │
173
+ └─────────────────────────────────────────────────────────────────┘
174
+ ↓
175
+ ┌─────────────────────────────────────────────────────────────────┐
176
+ │ 6. KNOWLEDGE │
177
+ │ Labels, embeddings, semantic search │
178
+ │ ┌─────────────────────────────────────────────────────────┐ │
179
+ │ │ Frontend: useSemanticSearch({ query, orgId }) │ │
180
+ │ │ ↓ │ │
181
+ │ │ Provider: knowledge.search(query) │ │
182
+ │ │ ↓ (Unified search across backends) │ │
183
+ │ │ CompositeProvider: │ │
184
+ │ │ - Search Convex (native vectors) │ │
185
+ │ │ - Search Supabase (pgvector) │ │
186
+ │ │ - Search Notion (API) │ │
187
+ │ │ - Merge and rank results │ │
188
+ │ └─────────────────────────────────────────────────────────┘ │
189
+ └─────────────────────────────────────────────────────────────────┘
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Real-Time Coordination
195
+
196
+ ```
197
+ ┌─────────────────────────────────────────────────────────────────┐
198
+ │ REAL-TIME STRATEGY │
199
+ ├─────────────────────────────────────────────────────────────────┤
200
+ │ │
201
+ │ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
202
+ │ │ Convex │ │ Supabase │ │ WordPress │ │
203
+ │ │ │ │ │ │ │ │
204
+ │ │ Native │ │ PostgreSQL │ │ Polling │ │
205
+ │ │ WebSocket │ │ Real-time │ │ Fallback │ │
206
+ │ │ │ │ │ │ (30s) │ │
207
+ │ │ useQuery() │ │ .on() │ │ setInterval │ │
208
+ │ │ (automatic) │ │ subscribe() │ │ () │ │
209
+ │ └───────────────┘ └───────────────┘ └───────────────┘ │
210
+ │ ↓ ↓ ↓ │
211
+ │ └──────────────────┴───────────────────┘ │
212
+ │ ↓ │
213
+ │ ┌──────────────────────────┐ │
214
+ │ │ useRealtimeData() │ │
215
+ │ │ (Provider-agnostic) │ │
216
+ │ └──────────────────────────┘ │
217
+ │ ↓ │
218
+ │ ┌──────────────────────────┐ │
219
+ │ │ Frontend Component │ │
220
+ │ │ (Auto-updates) │ │
221
+ │ └──────────────────────────┘ │
222
+ └─────────────────────────────────────────────────────────────────┘
223
+ ```
224
+
225
+ **Real-Time Support:**
226
+
227
+ - ✅ **Convex:** Native WebSocket (preferred)
228
+ - ✅ **Supabase:** PostgreSQL real-time subscriptions
229
+ - ✅ **WordPress:** Polling fallback (no native real-time)
230
+ - ✅ **Notion:** Webhook-based updates
231
+
232
+ **Frontend receives updates regardless of backend!**
233
+
234
+ ---
235
+
236
+ ## Multi-Backend Federation
237
+
238
+ ```
239
+ ┌─────────────────────────────────────────────────────────────────┐
240
+ │ COMPOSITE PROVIDER ARCHITECTURE │
241
+ ├─────────────────────────────────────────────────────────────────┤
242
+ │ │
243
+ │ ┌──────────────────────────────────────────────────────────┐ │
244
+ │ │ Frontend │ │
245
+ │ │ const things = useThings({ type: "blog_post" }); │ │
246
+ │ └──────────────────────────────────────────────────────────┘ │
247
+ │ ↓ │
248
+ │ ┌──────────────────────────────────────────────────────────┐ │
249
+ │ │ CompositeProvider (Router) │ │
250
+ │ │ │ │
251
+ │ │ switch (type) { │ │
252
+ │ │ case "blog_post": → WordPress │ │
253
+ │ │ case "product": → Shopify │ │
254
+ │ │ case "document": → Notion │ │
255
+ │ │ default: → Convex │ │
256
+ │ │ } │ │
257
+ │ └──────────────────────────────────────────────────────────┘ │
258
+ │ │ │ │ │ │
259
+ │ ↓ ↓ ↓ ↓ │
260
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
261
+ │ │WordPress │ │ Shopify │ │ Notion │ │ Convex │ │
262
+ │ │ Provider │ │ Provider │ │ Provider │ │ Provider │ │
263
+ │ │ │ │ │ │ │ │ │ │
264
+ │ │ Blog │ │ Products │ │ Docs │ │ Users │ │
265
+ │ │ Posts │ │ Orders │ │ Pages │ │ Orgs │ │
266
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
267
+ │ │ │ │ │ │
268
+ │ ↓ ↓ ↓ ↓ │
269
+ │ ┌──────────────────────────────────────────────────────────┐ │
270
+ │ │ Central Event Log (Convex) │ │
271
+ │ │ - All sync events logged │ │
272
+ │ │ - Cross-backend consistency │ │
273
+ │ │ - Audit trail maintained │ │
274
+ │ └──────────────────────────────────────────────────────────┘ │
275
+ └─────────────────────────────────────────────────────────────────┘
276
+ ```
277
+
278
+ **Backend Routing Rules:**
279
+
280
+ | Thing Type | Primary Backend | Sync Strategy |
281
+ |------------|----------------|---------------|
282
+ | `creator`, `organization`, `agent`, `token` | Convex | Native |
283
+ | `blog_post`, `social_post` | WordPress | Read-only sync to Convex |
284
+ | `product`, `payment`, `subscription` | Shopify | Event-driven sync |
285
+ | `document`, `knowledge_item` | Notion | Bidirectional sync |
286
+
287
+ **Cross-Backend Consistency:**
288
+
289
+ - Event-driven sync (webhooks)
290
+ - Central event log in Convex
291
+ - Scheduled reconciliation jobs
292
+ - Conflict resolution strategies
293
+
294
+ ---
295
+
296
+ ## Migration Phases (Visual Timeline)
297
+
298
+ ```
299
+ ┌─────────────────────────────────────────────────────────────────┐
300
+ │ 7-PHASE MIGRATION │
301
+ ├─────────────────────────────────────────────────────────────────┤
302
+ │ │
303
+ │ Phase 1: Interface Definition (Week 1) │
304
+ │ ┌──────────────────────────────────────────────────────────┐ │
305
+ │ │ Define IDataProvider interface │ │
306
+ │ │ ✅ Type definitions for all 6 dimensions │ │
307
+ │ └──────────────────────────────────────────────────────────┘ │
308
+ │ ↓ │
309
+ │ Phase 2: ConvexProvider (Week 2) │
310
+ │ ┌──────────────────────────────────────────────────────────┐ │
311
+ │ │ Implement ConvexProvider │ │
312
+ │ │ ✅ 100% backward compatibility │ │
313
+ │ │ ✅ All 6 dimensions operational │ │
314
+ │ └──────────────────────────────────────────────────────────┘ │
315
+ │ ↓ │
316
+ │ Phase 3: Service Layer (Week 3) │
317
+ │ ┌──────────────────────────────────────────────────────────┐ │
318
+ │ │ Implement Effect.ts services │ │
319
+ │ │ ✅ Pure business logic │ │
320
+ │ │ ✅ Typed errors │ │
321
+ │ └──────────────────────────────────────────────────────────┘ │
322
+ │ ↓ │
323
+ │ Phase 4: Configuration (Week 4) │
324
+ │ ┌──────────────────────────────────────────────────────────┐ │
325
+ │ │ Add provider configuration │ │
326
+ │ │ ✅ Provider factory │ │
327
+ │ │ ✅ React Context │ │
328
+ │ └──────────────────────────────────────────────────────────┘ │
329
+ │ ↓ │
330
+ │ Phase 5: Component Migration (Weeks 5-6) │
331
+ │ ┌──────────────────────────────────────────────────────────┐ │
332
+ │ │ Week 5: Non-critical pages │ │
333
+ │ │ /about, /docs, /blog, /account/settings │ │
334
+ │ │ Week 6: Critical pages │ │
335
+ │ │ /dashboard, /account, /admin │ │
336
+ │ │ ✅ Auth tests after each migration │ │
337
+ │ └──────────────────────────────────────────────────────────┘ │
338
+ │ ↓ │
339
+ │ Phase 6: Cleanup (Week 7) │
340
+ │ ┌──────────────────────────────────────────────────────────┐ │
341
+ │ │ Remove old dependencies │ │
342
+ │ │ ✅ Direct Convex imports removed │ │
343
+ │ │ ✅ All tests pass │ │
344
+ │ └──────────────────────────────────────────────────────────┘ │
345
+ │ ↓ │
346
+ │ Phase 7: Alternative Providers (Week 8+) │
347
+ │ ┌──────────────────────────────────────────────────────────┐ │
348
+ │ │ Implement alternative providers │ │
349
+ │ │ ✅ SupabaseProvider │ │
350
+ │ │ ✅ WordPressProvider │ │
351
+ │ │ ✅ CompositeProvider │ │
352
+ │ └──────────────────────────────────────────────────────────┘ │
353
+ └─────────────────────────────────────────────────────────────────┘
354
+ ```
355
+
356
+ ---
357
+
358
+ ## Error Propagation Flow
359
+
360
+ ```
361
+ ┌─────────────────────────────────────────────────────────────────┐
362
+ │ ERROR FLOW │
363
+ ├─────────────────────────────────────────────────────────────────┤
364
+ │ │
365
+ │ Backend Error (Effect.ts) │
366
+ │ ┌──────────────────────────────────────────────────────────┐ │
367
+ │ │ class OrganizationNotFoundError │ │
368
+ │ │ extends Data.TaggedError("OrgNotFound") │ │
369
+ │ │ { orgId: string } │ │
370
+ │ └──────────────────────────────────────────────────────────┘ │
371
+ │ ↓ │
372
+ │ Provider Error │
373
+ │ ┌──────────────────────────────────────────────────────────┐ │
374
+ │ │ class ProviderError extends Error { │ │
375
+ │ │ message: "Organization not found" │ │
376
+ │ │ code: "ORGANIZATION_NOT_FOUND" │ │
377
+ │ │ provider: "convex" │ │
378
+ │ │ retryable: false │ │
379
+ │ │ } │ │
380
+ │ └──────────────────────────────────────────────────────────┘ │
381
+ │ ↓ │
382
+ │ Frontend Display │
383
+ │ ┌──────────────────────────────────────────────────────────┐ │
384
+ │ │ <Alert variant="destructive"> │ │
385
+ │ │ <AlertTitle>Error</AlertTitle> │ │
386
+ │ │ <AlertDescription> │ │
387
+ │ │ Organization not found │ │
388
+ │ │ Provider: convex | Code: ORGANIZATION_NOT_FOUND │ │
389
+ │ │ </AlertDescription> │ │
390
+ │ │ </Alert> │ │
391
+ │ └──────────────────────────────────────────────────────────┘ │
392
+ │ │
393
+ │ Retry Strategy (for retryable errors) │
394
+ │ ┌──────────────────────────────────────────────────────────┐ │
395
+ │ │ Attempt 1: Immediate │ │
396
+ │ │ Attempt 2: Wait 1s (exponential backoff) │ │
397
+ │ │ Attempt 3: Wait 2s │ │
398
+ │ │ Attempt 4: Wait 4s │ │
399
+ │ │ Max retries: 3 │ │
400
+ │ └──────────────────────────────────────────────────────────┘ │
401
+ └─────────────────────────────────────────────────────────────────┘
402
+ ```
403
+
404
+ ---
405
+
406
+ ## Deployment Architecture
407
+
408
+ ```
409
+ ┌─────────────────────────────────────────────────────────────────┐
410
+ │ DEPLOYMENT ARCHITECTURE │
411
+ ├─────────────────────────────────────────────────────────────────┤
412
+ │ │
413
+ │ Frontend (Cloudflare Pages) │
414
+ │ ┌──────────────────────────────────────────────────────────┐ │
415
+ │ │ Astro 5 + React 19 │ │
416
+ │ │ Runtime: Cloudflare Workers (edge) │ │
417
+ │ │ CDN: Global edge network │ │
418
+ │ │ │ │
419
+ │ │ Deploy: bun run build → wrangler pages deploy │ │
420
+ │ │ Rollback: wrangler pages rollback │ │
421
+ │ └──────────────────────────────────────────────────────────┘ │
422
+ │ ↓ API Calls │
423
+ │ Backend (Convex Cloud) │
424
+ │ ┌──────────────────────────────────────────────────────────┐ │
425
+ │ │ Real-time database │ │
426
+ │ │ Region: Auto (global replication) │ │
427
+ │ │ Typed functions (queries, mutations, actions) │ │
428
+ │ │ │ │
429
+ │ │ Deploy: npx convex deploy --prod │ │
430
+ │ │ Status: npx convex status │ │
431
+ │ └──────────────────────────────────────────────────────────┘ │
432
+ │ │
433
+ │ External Backends (Optional) │
434
+ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
435
+ │ │ WordPress │ │ Shopify │ │ Notion │ │
436
+ │ │ Self-hosted│ │ SaaS │ │ SaaS │ │
437
+ │ └────────────┘ └────────────┘ └────────────┘ │
438
+ └─────────────────────────────────────────────────────────────────┘
439
+
440
+ Zero-Downtime Migration (Feature Flags)
441
+ ┌──────────────────────────────────────────────────────────────┐
442
+ │ Rollout Plan: │
443
+ │ Week 1: 0% (deploy code, flag off) │
444
+ │ Week 2: 5% (internal testing) │
445
+ │ Week 3: 10% (early adopters) │
446
+ │ Week 4: 25% (monitoring for issues) │
447
+ │ Week 5: 50% (half of users) │
448
+ │ Week 6: 75% (most users) │
449
+ │ Week 7: 100% (full rollout) │
450
+ │ │
451
+ │ Rollback: Instant (set feature flag to 0%) │
452
+ └──────────────────────────────────────────────────────────────┘
453
+ ```
454
+
455
+ ---
456
+
457
+ ## Success Metrics Dashboard
458
+
459
+ ```
460
+ ┌─────────────────────────────────────────────────────────────────┐
461
+ │ SUCCESS METRICS │
462
+ ├─────────────────────────────────────────────────────────────────┤
463
+ │ │
464
+ │ Ontology Alignment │
465
+ │ ✅ Organizations: Multi-tenant isolation enforced │
466
+ │ ✅ People: Role-based authorization working │
467
+ │ ✅ Things: All 66 types supported │
468
+ │ ✅ Connections: Bidirectional relationships │
469
+ │ ✅ Events: Complete audit trail │
470
+ │ ✅ Knowledge: Vector search operational │
471
+ │ │
472
+ │ Protocol Integration │
473
+ │ ✅ A2A: Agent-to-agent communication │
474
+ │ ✅ ACP: Agentic commerce protocol │
475
+ │ ✅ AP2: Agent payments protocol │
476
+ │ ✅ X402: HTTP micropayments │
477
+ │ ✅ AG-UI: Generative UI (CopilotKit) │
478
+ │ │
479
+ │ Technical Quality │
480
+ │ ✅ Data flows work end-to-end │
481
+ │ ✅ Errors handled gracefully │
482
+ │ ✅ User journeys tested │
483
+ │ ✅ Auth tests pass (50+ cases, 100% pass rate) │
484
+ │ ✅ Performance: Context < 1.5KB, Latency < 100ms │
485
+ │ │
486
+ │ Coordination │
487
+ │ ✅ Frontend + Backend specialists aligned │
488
+ │ ✅ Quality agent validates flows │
489
+ │ ✅ Integration specialist coordinates │
490
+ │ ✅ No manual handoffs │
491
+ └─────────────────────────────────────────────────────────────────┘
492
+ ```
493
+
494
+ ---
495
+
496
+ ## Quick Reference
497
+
498
+ ### Provider Interface
499
+
500
+ ```typescript
501
+ interface IDataProvider {
502
+ // 6 Dimensions
503
+ organizations: OrganizationOperations;
504
+ people: PeopleOperations;
505
+ things: ThingOperations;
506
+ connections: ConnectionOperations;
507
+ events: EventOperations;
508
+ knowledge: KnowledgeOperations;
509
+
510
+ // Metadata
511
+ name: string;
512
+ supportsRealtime: boolean;
513
+ capabilities: string[];
514
+ }
515
+ ```
516
+
517
+ ### Frontend Usage
518
+
519
+ ```typescript
520
+ // Get provider from context
521
+ const provider = useDataProvider();
522
+
523
+ // Use provider methods
524
+ const orgs = await provider.organizations.list({ userId });
525
+ const things = await provider.things.list({ type: "blog_post" });
526
+ const events = await provider.events.listForThing({ thingId });
527
+
528
+ // Real-time updates
529
+ const data = useRealtimeData(provider, { type: "organizations" });
530
+ ```
531
+
532
+ ### Backend Implementation
533
+
534
+ ```typescript
535
+ // Effect.ts service
536
+ export class ThingService extends Effect.Service<ThingService>() {
537
+ create: (args) => Effect.gen(function* () {
538
+ // Create entity
539
+ const thingId = yield* Effect.tryPromise(() =>
540
+ db.insert("entities", { ... })
541
+ );
542
+ // Create connection
543
+ yield* Effect.tryPromise(() =>
544
+ db.insert("connections", { ... })
545
+ );
546
+ // Log event
547
+ yield* Effect.tryPromise(() =>
548
+ db.insert("events", { ... })
549
+ );
550
+ return thingId;
551
+ });
552
+ }
553
+ ```
554
+
555
+ ---
556
+
557
+ **Integration Specialist: Connect systems. Map protocols. Respect the ontology. Make integrations seamless.**
558
+
559
+ ---
560
+
561
+ **End of Integration Architecture Visual Guide**