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.
- package/CLAUDE.md +220 -29
- package/LICENSE.md +84 -0
- package/README.md +489 -931
- package/folders.yaml +78 -17
- package/one/.obsidian/workspace.json +6 -6
- package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +412 -0
- package/one/events/FEATURE-2-4-COMPLETE.md +302 -0
- package/one/events/FEATURE_2_3_COMPLETE.md +575 -0
- package/one/events/GROUPS-MIGRATION.md +625 -0
- package/one/events/INSTALL-TESTS.md +293 -0
- package/one/events/INTEGRATION-ARCHITECTURE.md +561 -0
- package/one/events/INTEGRATION-CHECKLIST.md +1234 -0
- package/one/events/INTEGRATION-ORCHESTRATION.md +2623 -0
- package/one/events/INTEGRATION-SUMMARY.md +653 -0
- package/one/events/MIGRATION-REPORT.md +435 -0
- package/one/events/MIGRATION.md +69 -0
- package/one/events/README-archived.md +519 -0
- package/one/events/TEST-SUMMARY.md +393 -0
- package/one/events/TESTS-QUICK-REF.md +262 -0
- package/one/groups/groups.md +543 -0
- package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +49 -0
- package/one/knowledge/architecture-any-backend.md +1366 -0
- package/one/knowledge/docs/flow.md +0 -0
- package/one/knowledge/ontology-documentation.md +18 -18
- package/one/knowledge/ontology.md +154 -143
- package/one/knowledge/ontology.md.backup +2822 -0
- package/one/knowledge/ontology.yaml +87 -87
- package/one/knowledge/provider-creation-guide.md +1064 -0
- package/one/knowledge/todo.md +251 -0
- package/one/license.md +84 -0
- package/one/things/CHECKLIST.md +356 -0
- package/one/things/ONE.md +510 -0
- package/one/things/{cli.md → cli/cli.md} +27 -4
- package/one/things/features/2-1-dataprovider-interface.md +2358 -0
- package/one/things/features/2-2-config-system.md +3075 -0
- package/one/things/features/2-3-effectts-services.md +1498 -0
- package/one/things/features/2-4-react-hooks.md +2120 -0
- package/one/things/features/2-5-auth-migration.md +2046 -0
- package/one/things/features/2-6-dashboard-migration.md +1985 -0
- package/one/things/features/2-7-alternative-providers.md +2505 -0
- package/one/things/features/2-7-implementation-report.md +680 -0
- package/one/things/features/2-cli.md +39 -39
- package/one/things/features/2-design.md +1738 -0
- package/one/things/features/2-tests.md +520 -0
- package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +521 -0
- package/one/things/features/DECOUPLING.md +272 -0
- package/one/things/features/DEPLOYMENT.md +452 -0
- package/one/things/features/IMPLEMENTATION_SUMMARY.md +316 -0
- package/one/things/features/dataprovider-interface/1-tests.md +1522 -0
- package/one/things/features/improve.md +843 -0
- package/one/things/features/remove-convex-deps.md +45 -0
- package/one/things/features/top-features.md +79 -0
- package/one/things/ideas/2-backend-agnostic-frontend.md +384 -0
- package/one/things/plans/2-backend-agnostic-frontend.md +543 -0
- package/one/things/plans/3-groups.md +502 -0
- package/one/things/plans/backend-agnostic-frontend.md +323 -0
- package/one/things/plans/deploy-to-cloudflare.md +581 -0
- package/one/things/plans/organizations-to-groups.md +705 -0
- package/one/things/plans/release.md +432 -0
- package/one/things/products/ontology.md +1 -1
- package/one/things/system.md +600 -0
- package/one/things/tests/2-1-dataprovider-interface.md +1144 -0
- package/one/things/tests/2-1-test-analysis.md +496 -0
- package/one/things/vision/elegant-interface.md +214 -0
- package/package.json +1 -1
- package/one/organisation/organisation.md +0 -438
- package/one/repomix-output.md +0 -92634
- /package/one/{things → connections}/agentkit.md +0 -0
- /package/one/{things → connections}/copilotkit.md +0 -0
- /package/one/{organisation → groups}/one.md +0 -0
- /package/one/{organisation → groups}/revenue.md +0 -0
- /package/one/{organisation → groups}/strategy.md +0 -0
- /package/one/{organisation → groups}/vision.md +0 -0
- /package/one/things/{cli-code.md → cli/cli-code.md} +0 -0
- /package/one/things/{cli-compiler-code.md → cli/cli-compiler-code.md} +0 -0
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
# Integration Orchestration - Executive Summary
|
|
2
|
+
|
|
3
|
+
**Integration Specialist Deliverable**
|
|
4
|
+
**Date:** 2025-10-13
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## The Big Picture
|
|
9
|
+
|
|
10
|
+
Transform ONE Platform from **monolithic frontend+backend** to **layered Frontend → DataProvider → Backend** architecture while maintaining **100% backward compatibility** and **zero downtime**.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Architecture Transformation
|
|
15
|
+
|
|
16
|
+
### Before (Monolithic)
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
┌─────────────────────────────────────────────┐
|
|
20
|
+
│ FRONTEND (Astro + React) │
|
|
21
|
+
│ │
|
|
22
|
+
│ useQuery(api.queries.*) ← Direct Convex │
|
|
23
|
+
│ useMutation(api.mutations.*) │
|
|
24
|
+
│ │
|
|
25
|
+
└─────────────────┬───────────────────────────┘
|
|
26
|
+
│
|
|
27
|
+
↓ Tight Coupling
|
|
28
|
+
┌─────────────────────────────────────────────┐
|
|
29
|
+
│ BACKEND (Convex) │
|
|
30
|
+
│ - Real-time database │
|
|
31
|
+
│ - Typed functions (queries, mutations) │
|
|
32
|
+
│ - Better Auth │
|
|
33
|
+
└─────────────────────────────────────────────┘
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Problems:**
|
|
37
|
+
|
|
38
|
+
- ❌ Tight coupling to Convex
|
|
39
|
+
- ❌ Can't switch backends
|
|
40
|
+
- ❌ Can't integrate multiple backends
|
|
41
|
+
- ❌ Hard to test
|
|
42
|
+
- ❌ No provider abstraction
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### After (Layered)
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
50
|
+
│ FRONTEND LAYER │
|
|
51
|
+
│ Astro 5 SSR + React 19 Islands + shadcn/ui │
|
|
52
|
+
│ │
|
|
53
|
+
│ useDataProvider() → Provider-agnostic hooks │
|
|
54
|
+
│ │
|
|
55
|
+
└────────────────────┬────────────────────────────────────────┘
|
|
56
|
+
│
|
|
57
|
+
↓ (IDataProvider interface)
|
|
58
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
59
|
+
│ DATA PROVIDER LAYER │
|
|
60
|
+
│ Protocol-agnostic interface for 6 dimensions: │
|
|
61
|
+
│ - Organizations, People, Things, Connections │
|
|
62
|
+
│ - Events, Knowledge │
|
|
63
|
+
│ │
|
|
64
|
+
│ Implementations: │
|
|
65
|
+
│ - ConvexProvider (primary, real-time) │
|
|
66
|
+
│ - SupabaseProvider (alternative, pgvector) │
|
|
67
|
+
│ - WordPressProvider (CMS, read-only) │
|
|
68
|
+
│ - ShopifyProvider (e-commerce) │
|
|
69
|
+
│ - NotionProvider (docs, bidirectional) │
|
|
70
|
+
│ - CompositeProvider (multi-backend federation) │
|
|
71
|
+
│ │
|
|
72
|
+
└────────────────────┬────────────────────────────────────────┘
|
|
73
|
+
│
|
|
74
|
+
↓ (API calls, WebSocket, REST)
|
|
75
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
76
|
+
│ BACKEND LAYER │
|
|
77
|
+
│ Convex: Real-time database + typed functions │
|
|
78
|
+
│ WordPress: CMS for blog posts │
|
|
79
|
+
│ Shopify: E-commerce for products │
|
|
80
|
+
│ Notion: Collaborative documents │
|
|
81
|
+
│ Supabase: Alternative with pgvector │
|
|
82
|
+
└─────────────────────────────────────────────────────────────┘
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Benefits:**
|
|
86
|
+
|
|
87
|
+
- ✅ Provider-agnostic frontend
|
|
88
|
+
- ✅ Multi-backend support (Convex, Supabase, WordPress, Shopify, Notion)
|
|
89
|
+
- ✅ Easy to test (mock providers)
|
|
90
|
+
- ✅ Zero-downtime migration (feature flags)
|
|
91
|
+
- ✅ Real-time coordination across backends
|
|
92
|
+
- ✅ Ontology-driven (6 dimensions always respected)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 6-Dimension Data Flows
|
|
97
|
+
|
|
98
|
+
Every data flow respects the **6-dimension ontology**:
|
|
99
|
+
|
|
100
|
+
### 1. Organizations (Multi-Tenant Isolation)
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
// Frontend
|
|
104
|
+
const orgs = useOrganizations();
|
|
105
|
+
|
|
106
|
+
// Provider Layer
|
|
107
|
+
interface IDataProvider {
|
|
108
|
+
organizations: {
|
|
109
|
+
list(userId: Id<"entities">): Promise<Organization[]>;
|
|
110
|
+
get(orgId: Id<"entities">): Promise<Organization>;
|
|
111
|
+
create(args: CreateOrgArgs): Promise<Id<"entities">>;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Backend (Convex)
|
|
116
|
+
export const list = query({
|
|
117
|
+
handler: async (ctx, args) => {
|
|
118
|
+
// Query entities table with type: "organization"
|
|
119
|
+
// Enforce org boundaries
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Validation:**
|
|
125
|
+
|
|
126
|
+
- ✅ No cross-org data leakage
|
|
127
|
+
- ✅ Multi-tenant isolation at backend
|
|
128
|
+
- ✅ Provider-agnostic frontend
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### 2. People (Authorization & Governance)
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// Frontend
|
|
136
|
+
const { user, session } = useAuth();
|
|
137
|
+
|
|
138
|
+
// Provider Layer
|
|
139
|
+
interface IDataProvider {
|
|
140
|
+
auth: {
|
|
141
|
+
signIn(email: string, password: string): Promise<Session>;
|
|
142
|
+
getCurrentUser(): Promise<Person | null>;
|
|
143
|
+
verifyPermissions(userId, orgId, action): Promise<boolean>;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Backend
|
|
148
|
+
export const verifyPermissions = query({
|
|
149
|
+
handler: async (ctx, args) => {
|
|
150
|
+
// Check role (org_owner, org_user, customer)
|
|
151
|
+
// Verify permissions array
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Validation:**
|
|
157
|
+
|
|
158
|
+
- ✅ Role-based authorization (platform_owner, org_owner, org_user, customer)
|
|
159
|
+
- ✅ Permissions enforced at backend
|
|
160
|
+
- ✅ Auth tests pass (50+ test cases)
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### 3. Things (Entity Integration)
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
// Frontend
|
|
168
|
+
const things = useThings({ type: "blog_post" });
|
|
169
|
+
|
|
170
|
+
// Provider Layer (routes to appropriate backend)
|
|
171
|
+
class CompositeProvider {
|
|
172
|
+
things = {
|
|
173
|
+
list: async (args) => {
|
|
174
|
+
switch (args.type) {
|
|
175
|
+
case "blog_post": return wordpress.things.list(args);
|
|
176
|
+
case "product": return shopify.things.list(args);
|
|
177
|
+
case "document": return notion.things.list(args);
|
|
178
|
+
default: return convex.things.list(args);
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Backend: Generic ThingService (handles all 66 types)
|
|
185
|
+
export class ThingService {
|
|
186
|
+
create(args) {
|
|
187
|
+
// Create entity
|
|
188
|
+
// Create ownership connection
|
|
189
|
+
// Log creation event
|
|
190
|
+
// Return thingId
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Validation:**
|
|
196
|
+
|
|
197
|
+
- ✅ Generic ThingService handles all 66 types
|
|
198
|
+
- ✅ Status lifecycle: draft → active → published → archived
|
|
199
|
+
- ✅ External providers transform to ontology
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### 4. Connections (Relationships)
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
// Frontend
|
|
207
|
+
const connections = useConnections({ thingId });
|
|
208
|
+
|
|
209
|
+
// Provider Layer
|
|
210
|
+
interface IDataProvider {
|
|
211
|
+
connections: {
|
|
212
|
+
list(thingId): Promise<Connection[]>;
|
|
213
|
+
create(from, to, type): Promise<Id<"connections">>;
|
|
214
|
+
count(thingId, type): Promise<number>;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Backend: Bidirectional relationships
|
|
219
|
+
export const list = query({
|
|
220
|
+
handler: async (ctx, args) => {
|
|
221
|
+
// Get outgoing connections
|
|
222
|
+
// Get incoming connections
|
|
223
|
+
// Get connected things
|
|
224
|
+
// Return graph
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Validation:**
|
|
230
|
+
|
|
231
|
+
- ✅ Bidirectional relationships
|
|
232
|
+
- ✅ Temporal validity (validFrom/validTo)
|
|
233
|
+
- ✅ Cross-backend connections (Convex ↔ WordPress)
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
### 5. Events (Action Tracking)
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
// Frontend
|
|
241
|
+
const events = useEvents({ thingId });
|
|
242
|
+
|
|
243
|
+
// Provider Layer
|
|
244
|
+
interface IDataProvider {
|
|
245
|
+
events: {
|
|
246
|
+
listForThing(thingId): Promise<Event[]>;
|
|
247
|
+
listForActor(actorId): Promise<Event[]>;
|
|
248
|
+
create(args): Promise<Id<"events">>;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Backend: Complete audit trail
|
|
253
|
+
export const logProtocolEvent = mutation({
|
|
254
|
+
handler: async (ctx, args) => {
|
|
255
|
+
await ctx.db.insert("events", {
|
|
256
|
+
type: args.type,
|
|
257
|
+
actorId: args.actorId,
|
|
258
|
+
timestamp: Date.now(),
|
|
259
|
+
metadata: {
|
|
260
|
+
protocol: args.protocol, // A2A, ACP, AP2, X402, AG-UI
|
|
261
|
+
...args.metadata,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**Validation:**
|
|
269
|
+
|
|
270
|
+
- ✅ Complete audit trail
|
|
271
|
+
- ✅ Event logging spans provider boundaries
|
|
272
|
+
- ✅ Protocol metadata tracked (metadata.protocol)
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### 6. Knowledge (Semantic Understanding)
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
// Frontend
|
|
280
|
+
const results = useSemanticSearch({ query, orgId });
|
|
281
|
+
|
|
282
|
+
// Provider Layer (unified search across backends)
|
|
283
|
+
class CompositeProvider {
|
|
284
|
+
knowledge = {
|
|
285
|
+
search: async (args) => {
|
|
286
|
+
// Search Convex (native vectors)
|
|
287
|
+
// Search Supabase (pgvector)
|
|
288
|
+
// Search Notion (API)
|
|
289
|
+
// Merge and rank results
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Backend: Vector search
|
|
295
|
+
export const vectorSearch = query({
|
|
296
|
+
handler: async (ctx, args) => {
|
|
297
|
+
// Generate query embedding
|
|
298
|
+
// Vector search with Convex/Supabase
|
|
299
|
+
// Return ranked results
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Validation:**
|
|
305
|
+
|
|
306
|
+
- ✅ Backend-specific implementations (Convex vectors, Supabase pgvector)
|
|
307
|
+
- ✅ Unified search across providers
|
|
308
|
+
- ✅ RAG pipeline integration
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 7-Phase Migration Plan
|
|
313
|
+
|
|
314
|
+
### Phase 1: Interface Definition (Week 1)
|
|
315
|
+
|
|
316
|
+
**Deliverable:** `IDataProvider` interface
|
|
317
|
+
|
|
318
|
+
```typescript
|
|
319
|
+
export interface IDataProvider {
|
|
320
|
+
organizations: OrganizationOperations;
|
|
321
|
+
people: PeopleOperations;
|
|
322
|
+
things: ThingOperations;
|
|
323
|
+
connections: ConnectionOperations;
|
|
324
|
+
events: EventOperations;
|
|
325
|
+
knowledge: KnowledgeOperations;
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**Tests:** ✅ Interface compiles
|
|
330
|
+
|
|
331
|
+
**Coordination:** Backend Specialist reviews
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
### Phase 2: ConvexProvider (Week 2)
|
|
336
|
+
|
|
337
|
+
**Deliverable:** ConvexProvider implements IDataProvider
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
export class ConvexProvider implements IDataProvider {
|
|
341
|
+
organizations = {
|
|
342
|
+
list: async (args) => {
|
|
343
|
+
return await this.client.query(api.queries.organizations.list, args);
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Tests:** ✅ Unit tests, ✅ Integration tests, ✅ Auth tests
|
|
350
|
+
|
|
351
|
+
**Coordination:** Frontend + Backend + Quality
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
### Phase 3: Service Layer (Week 3)
|
|
356
|
+
|
|
357
|
+
**Deliverable:** Effect.ts services (pure business logic)
|
|
358
|
+
|
|
359
|
+
```typescript
|
|
360
|
+
export class OrganizationService extends Effect.Service<OrganizationService>() {
|
|
361
|
+
create: (args) => Effect.gen(function* () {
|
|
362
|
+
// Create entity
|
|
363
|
+
// Create connection
|
|
364
|
+
// Log event
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
**Tests:** ✅ Unit tests with mocked dependencies
|
|
370
|
+
|
|
371
|
+
**Coordination:** Backend + Integration + Quality
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
### Phase 4: Configuration (Week 4)
|
|
376
|
+
|
|
377
|
+
**Deliverable:** Provider configuration + React Context
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
export function createProvider(config: ProviderConfig): IDataProvider {
|
|
381
|
+
switch (config.default) {
|
|
382
|
+
case "convex": return new ConvexProvider(...);
|
|
383
|
+
case "supabase": return new SupabaseProvider(...);
|
|
384
|
+
case "composite": return new CompositeProvider(...);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Tests:** ✅ Provider switching validated
|
|
390
|
+
|
|
391
|
+
**Coordination:** Frontend + Integration
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
### Phase 5: Component Migration (Weeks 5-6)
|
|
396
|
+
|
|
397
|
+
**Week 5: Non-critical pages**
|
|
398
|
+
|
|
399
|
+
- `/about`, `/docs`, `/blog`
|
|
400
|
+
- `/account/settings`
|
|
401
|
+
- `/tokens/[id]`
|
|
402
|
+
|
|
403
|
+
**Week 6: Critical pages**
|
|
404
|
+
|
|
405
|
+
- `/dashboard`
|
|
406
|
+
- `/account` (auth flows)
|
|
407
|
+
- `/admin`
|
|
408
|
+
|
|
409
|
+
**Strategy:** Gradual page-by-page migration
|
|
410
|
+
|
|
411
|
+
```typescript
|
|
412
|
+
// Before
|
|
413
|
+
const orgs = useQuery(api.queries.organizations.list);
|
|
414
|
+
|
|
415
|
+
// After
|
|
416
|
+
const provider = useDataProvider();
|
|
417
|
+
const orgs = useRealtimeData(provider, { type: "organizations" });
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
**Tests:** ✅ E2E tests per page, ✅ Auth tests after each migration
|
|
421
|
+
|
|
422
|
+
**Coordination:** Frontend + Integration + Quality
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
### Phase 6: Cleanup (Week 7)
|
|
427
|
+
|
|
428
|
+
**Deliverable:** Remove old dependencies
|
|
429
|
+
|
|
430
|
+
- Remove direct Convex imports from components
|
|
431
|
+
- Update package.json
|
|
432
|
+
- Consolidate provider exports
|
|
433
|
+
|
|
434
|
+
**Tests:** ✅ All tests pass (unit, integration, E2E, auth)
|
|
435
|
+
|
|
436
|
+
**Coordination:** Frontend + Quality
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
### Phase 7: Alternative Providers (Week 8+)
|
|
441
|
+
|
|
442
|
+
**Deliverables:**
|
|
443
|
+
|
|
444
|
+
- SupabaseProvider (alternative backend)
|
|
445
|
+
- WordPressProvider (CMS integration)
|
|
446
|
+
- ShopifyProvider (e-commerce)
|
|
447
|
+
- NotionProvider (docs)
|
|
448
|
+
- CompositeProvider (multi-backend federation)
|
|
449
|
+
|
|
450
|
+
**Tests:** ✅ Provider-specific tests, ✅ Cross-provider integration
|
|
451
|
+
|
|
452
|
+
**Coordination:** Integration + Backend + Quality
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## Testing Strategy
|
|
457
|
+
|
|
458
|
+
### Test Hierarchy
|
|
459
|
+
|
|
460
|
+
```
|
|
461
|
+
Unit Tests (services/) 90%+ coverage
|
|
462
|
+
↓
|
|
463
|
+
Integration Tests (providers/) All 6 dimensions
|
|
464
|
+
↓
|
|
465
|
+
E2E Tests (user journeys) Critical flows
|
|
466
|
+
↓
|
|
467
|
+
Performance Tests Context < 1.5KB, Latency < 100ms
|
|
468
|
+
↓
|
|
469
|
+
Auth Tests (50+ cases) 100% pass rate
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Auth Test Preservation
|
|
473
|
+
|
|
474
|
+
**CRITICAL:** Run auth tests after EVERY migration step
|
|
475
|
+
|
|
476
|
+
```bash
|
|
477
|
+
bun test test/auth
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
**6 Methods Tested:**
|
|
481
|
+
|
|
482
|
+
1. ✅ Email & Password
|
|
483
|
+
2. ✅ OAuth (GitHub, Google)
|
|
484
|
+
3. ✅ Magic Links
|
|
485
|
+
4. ✅ Password Reset
|
|
486
|
+
5. ✅ Email Verification
|
|
487
|
+
6. ✅ 2FA/TOTP
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
## Error Propagation
|
|
492
|
+
|
|
493
|
+
```
|
|
494
|
+
Backend Error → Provider Error → Frontend Display
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### Backend Errors (Effect.ts)
|
|
498
|
+
|
|
499
|
+
```typescript
|
|
500
|
+
export class ServiceError extends Data.TaggedError("ServiceError")<{
|
|
501
|
+
message: string;
|
|
502
|
+
code: string;
|
|
503
|
+
protocol?: string;
|
|
504
|
+
}> {}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### Provider Errors
|
|
508
|
+
|
|
509
|
+
```typescript
|
|
510
|
+
export class ProviderError extends Error {
|
|
511
|
+
constructor(
|
|
512
|
+
message: string,
|
|
513
|
+
code: string,
|
|
514
|
+
provider: string,
|
|
515
|
+
retryable: boolean
|
|
516
|
+
) {}
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### Frontend Display
|
|
521
|
+
|
|
522
|
+
```typescript
|
|
523
|
+
<Alert variant="destructive">
|
|
524
|
+
<AlertTitle>Error</AlertTitle>
|
|
525
|
+
<AlertDescription>
|
|
526
|
+
{error.message}
|
|
527
|
+
{error.retryable && <Button onClick={retry}>Retry</Button>}
|
|
528
|
+
</AlertDescription>
|
|
529
|
+
</Alert>
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Retry Strategies
|
|
533
|
+
|
|
534
|
+
- Exponential backoff: 1s, 2s, 4s
|
|
535
|
+
- Max retries: 3
|
|
536
|
+
- Don't retry non-retryable errors
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## Deployment Strategy
|
|
541
|
+
|
|
542
|
+
### Independent Deployments
|
|
543
|
+
|
|
544
|
+
**Backend (Convex):**
|
|
545
|
+
|
|
546
|
+
```bash
|
|
547
|
+
cd /backend
|
|
548
|
+
npx convex deploy --prod
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
**Frontend (Cloudflare Pages):**
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
cd /frontend
|
|
555
|
+
bun run build
|
|
556
|
+
wrangler pages deploy dist
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
**Validation:**
|
|
560
|
+
|
|
561
|
+
- ✅ Backend deployments independent
|
|
562
|
+
- ✅ Frontend deployments independent
|
|
563
|
+
- ✅ No coordinated releases
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
### Zero-Downtime Migration
|
|
568
|
+
|
|
569
|
+
**Strategy:** Gradual rollout with feature flags
|
|
570
|
+
|
|
571
|
+
```typescript
|
|
572
|
+
export function shouldUseDataProvider(): boolean {
|
|
573
|
+
if (!featureFlags.useDataProvider) return false;
|
|
574
|
+
const rolloutPercentage = getRolloutPercentage();
|
|
575
|
+
return userHash % 100 < rolloutPercentage;
|
|
576
|
+
}
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
**Rollout Plan:**
|
|
580
|
+
|
|
581
|
+
- Week 1: 0% (deploy code, flag off)
|
|
582
|
+
- Week 2: 5% (internal testing)
|
|
583
|
+
- Week 3: 10% (early adopters)
|
|
584
|
+
- Week 4: 25% (monitoring)
|
|
585
|
+
- Week 5: 50% (half of users)
|
|
586
|
+
- Week 6: 75% (most users)
|
|
587
|
+
- Week 7: 100% (full rollout)
|
|
588
|
+
|
|
589
|
+
**Rollback:** Instant via feature flag
|
|
590
|
+
|
|
591
|
+
---
|
|
592
|
+
|
|
593
|
+
## Key Achievements
|
|
594
|
+
|
|
595
|
+
1. **Data Flow Orchestration:** All 6 dimensions respect ontology
|
|
596
|
+
2. **Multi-Backend Federation:** Seamless integration across Convex, WordPress, Shopify, Notion
|
|
597
|
+
3. **Real-Time Coordination:** Native WebSocket (Convex), PostgreSQL real-time (Supabase), polling fallback (WordPress/Notion)
|
|
598
|
+
4. **Zero-Downtime Migration:** 7-phase gradual rollout with feature flags
|
|
599
|
+
5. **Comprehensive Testing:** Unit, integration, E2E, performance, auth tests
|
|
600
|
+
6. **Robust Error Handling:** Backend → Provider → Frontend with retries and fallbacks
|
|
601
|
+
7. **Independent Deployments:** Frontend and backend deploy separately
|
|
602
|
+
|
|
603
|
+
---
|
|
604
|
+
|
|
605
|
+
## Success Metrics
|
|
606
|
+
|
|
607
|
+
### Ontology Alignment
|
|
608
|
+
|
|
609
|
+
- ✅ Every integration mapped to all 6 dimensions
|
|
610
|
+
- ✅ Organization boundaries respected (no cross-org data leaks)
|
|
611
|
+
- ✅ Actor permissions verified for all external calls
|
|
612
|
+
- ✅ All integration actions logged as events with protocol metadata
|
|
613
|
+
|
|
614
|
+
### Protocol Integration
|
|
615
|
+
|
|
616
|
+
- ✅ Protocol identified and documented (A2A, ACP, AP2, X402, AG-UI)
|
|
617
|
+
- ✅ metadata.protocol set on all relevant connections and events
|
|
618
|
+
- ✅ Protocol specifications followed exactly
|
|
619
|
+
- ✅ Protocol compliance validated
|
|
620
|
+
|
|
621
|
+
### Technical Quality
|
|
622
|
+
|
|
623
|
+
- ✅ All systems connect correctly
|
|
624
|
+
- ✅ Data flows work end-to-end
|
|
625
|
+
- ✅ Errors handled gracefully with retries
|
|
626
|
+
- ✅ User journeys tested completely
|
|
627
|
+
- ✅ No data inconsistencies
|
|
628
|
+
- ✅ Auth tests pass (50+ test cases, 100% pass rate)
|
|
629
|
+
|
|
630
|
+
### Coordination
|
|
631
|
+
|
|
632
|
+
- ✅ Backend and frontend specialists aligned
|
|
633
|
+
- ✅ Quality agent validates end-to-end flows
|
|
634
|
+
- ✅ Events used for agent communication
|
|
635
|
+
- ✅ No manual handoffs
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
## Next Steps
|
|
640
|
+
|
|
641
|
+
1. **Review** this orchestration plan with team
|
|
642
|
+
2. **Begin Phase 1** (Interface Definition) - Week 1
|
|
643
|
+
3. **Execute 7-phase migration** - Weeks 1-8+
|
|
644
|
+
4. **Monitor metrics** throughout migration
|
|
645
|
+
5. **Document lessons learned** as knowledge items
|
|
646
|
+
|
|
647
|
+
---
|
|
648
|
+
|
|
649
|
+
**Integration Specialist: Connect systems. Map protocols. Respect the ontology. Make integrations seamless.**
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
653
|
+
**End of Integration Orchestration Summary**
|