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,625 @@
1
+ # Organizations → Groups Migration Plan
2
+
3
+ **Version:** 2.0.0
4
+ **Status:** Architecture Planning
5
+ **Impact:** Breaking change to Dimension 1 of the 6-dimension ontology
6
+
7
+ ---
8
+
9
+ ## Executive Summary
10
+
11
+ We are evolving **Dimension 1** from `organizations` to `groups` to enable:
12
+
13
+ 1. **Universal scope** – Friends, businesses, communities, DAOs, governments (not just "organizations")
14
+ 2. **Hierarchical nesting** – Groups can contain groups (teams within companies, sub-DAOs, committees)
15
+ 3. **URL-based creation** – `one.ie/group/slug` creates or joins a group
16
+ 4. **Same multi-tenancy guarantees** – Perfect data isolation preserved
17
+
18
+ ---
19
+
20
+ ## The New 6-Dimension Ontology
21
+
22
+ **Before:**
23
+ 1. Organizations → People → Things → Connections → Events → Knowledge
24
+
25
+ **After:**
26
+ 1. **Groups** → People → Things → Connections → Events → Knowledge
27
+
28
+ **Key Insight:** "Organizations" was too limiting. Groups are the universal container:
29
+ - Your friend circle is a group
30
+ - Your company is a group
31
+ - Your DAO is a group
32
+ - Your community is a group
33
+ - Your government is a group
34
+
35
+ ---
36
+
37
+ ## Architecture Changes
38
+
39
+ ### Schema Evolution
40
+
41
+ ```typescript
42
+ // BEFORE: organizations table
43
+ organizations: defineTable({
44
+ name: v.string(),
45
+ plan: v.union(v.literal("starter"), v.literal("pro"), v.literal("enterprise")),
46
+ limits: v.object({
47
+ users: v.number(),
48
+ storage: v.number(),
49
+ apiCalls: v.number()
50
+ }),
51
+ status: v.union(v.literal("active"), v.literal("trial"), v.literal("suspended")),
52
+ createdAt: v.number(),
53
+ updatedAt: v.number()
54
+ })
55
+ .index("by_status", ["status"])
56
+
57
+ // AFTER: groups table
58
+ groups: defineTable({
59
+ slug: v.string(), // NEW: URL-friendly identifier
60
+ name: v.string(),
61
+ type: v.union( // NEW: Group types
62
+ v.literal("friend_circle"),
63
+ v.literal("business"),
64
+ v.literal("community"),
65
+ v.literal("dao"),
66
+ v.literal("government"),
67
+ v.literal("organization") // Legacy support
68
+ ),
69
+ parentGroupId: v.optional(v.id("groups")), // NEW: Enables nesting!
70
+ description: v.optional(v.string()), // NEW: Rich description
71
+ metadata: v.any(), // NEW: Flexible properties
72
+ settings: v.object({ // NEW: Group settings
73
+ visibility: v.union(v.literal("public"), v.literal("private")),
74
+ joinPolicy: v.union(
75
+ v.literal("open"),
76
+ v.literal("invite_only"),
77
+ v.literal("approval_required")
78
+ ),
79
+ plan: v.optional(v.union(v.literal("starter"), v.literal("pro"), v.literal("enterprise"))),
80
+ limits: v.optional(v.object({
81
+ users: v.number(),
82
+ storage: v.number(),
83
+ apiCalls: v.number()
84
+ }))
85
+ }),
86
+ status: v.union(v.literal("active"), v.literal("archived")),
87
+ createdAt: v.number(),
88
+ updatedAt: v.number()
89
+ })
90
+ .index("by_slug", ["slug"]) // NEW: URL routing
91
+ .index("by_type", ["type"]) // NEW: Group type queries
92
+ .index("by_parent", ["parentGroupId"]) // NEW: Hierarchy queries
93
+ .index("by_status", ["status"])
94
+ ```
95
+
96
+ ### Multi-Tenancy Preserved
97
+
98
+ **Critical:** Groups maintain the same multi-tenant isolation guarantees as organizations.
99
+
100
+ **Before:**
101
+ ```typescript
102
+ // All data scoped to organizationId
103
+ const myData = await ctx.db
104
+ .query("entities")
105
+ .withIndex("by_org", (q) => q.eq("organizationId", orgId))
106
+ .collect();
107
+ ```
108
+
109
+ **After:**
110
+ ```typescript
111
+ // All data scoped to groupId (same isolation!)
112
+ const myData = await ctx.db
113
+ .query("entities")
114
+ .withIndex("by_group", (q) => q.eq("groupId", groupId))
115
+ .collect();
116
+ ```
117
+
118
+ **Hierarchical Queries (NEW):**
119
+ ```typescript
120
+ // Get all subgroups of a parent group
121
+ const subgroups = await ctx.db
122
+ .query("groups")
123
+ .withIndex("by_parent", (q) => q.eq("parentGroupId", parentGroupId))
124
+ .collect();
125
+
126
+ // Get all entities across group hierarchy (recursive)
127
+ async function getEntitiesInHierarchy(ctx, rootGroupId) {
128
+ const groups = await getAllSubgroups(ctx, rootGroupId); // Recursive
129
+ const groupIds = [rootGroupId, ...groups.map(g => g._id)];
130
+
131
+ return await ctx.db
132
+ .query("entities")
133
+ .filter((q) => groupIds.some(id => q.eq(q.field("groupId"), id)))
134
+ .collect();
135
+ }
136
+ ```
137
+
138
+ ---
139
+
140
+ ## URL-Based Group Creation
141
+
142
+ ### URL Patterns
143
+
144
+ | URL | Creates | Type |
145
+ |-----|---------|------|
146
+ | `one.ie/group/friends` | Friends group | friend_circle |
147
+ | `one.ie/group/acme-corp` | Acme Corp | business |
148
+ | `one.ie/group/mycommunity` | My Community | community |
149
+ | `one.ie/group/cooldao` | Cool DAO | dao |
150
+ | `one.ie/group/dublin-city` | Dublin City | government |
151
+ | `one.ie/@username` | Personal group | organization |
152
+
153
+ ### URL Flow
154
+
155
+ ```typescript
156
+ // 1. User visits one.ie/group/my-cool-dao
157
+ // 2. Frontend checks if group exists
158
+ const group = await ctx.db
159
+ .query("groups")
160
+ .withIndex("by_slug", (q) => q.eq("slug", "my-cool-dao"))
161
+ .first();
162
+
163
+ // 3a. If exists → Show group page
164
+ if (group) {
165
+ return <GroupPage group={group} />;
166
+ }
167
+
168
+ // 3b. If not exists → Show creation flow
169
+ return <CreateGroupFlow slug="my-cool-dao" />;
170
+ ```
171
+
172
+ ### Creation Flow
173
+
174
+ ```typescript
175
+ // When user creates from URL
176
+ const newGroup = await ctx.db.insert("groups", {
177
+ slug: "my-cool-dao",
178
+ name: "My Cool DAO", // User provides
179
+ type: "dao", // User selects
180
+ description: "A DAO for cool people doing cool things",
181
+ metadata: {},
182
+ settings: {
183
+ visibility: "public",
184
+ joinPolicy: "approval_required",
185
+ plan: "starter"
186
+ },
187
+ status: "active",
188
+ createdAt: Date.now(),
189
+ updatedAt: Date.now()
190
+ });
191
+
192
+ // Creator automatically becomes org_owner
193
+ const creator = await ctx.db.insert("entities", {
194
+ type: "creator",
195
+ name: user.name,
196
+ groupId: newGroup,
197
+ properties: {
198
+ role: "org_owner",
199
+ userId: user._id
200
+ },
201
+ status: "active",
202
+ createdAt: Date.now(),
203
+ updatedAt: Date.now()
204
+ });
205
+
206
+ // Log creation event
207
+ await ctx.db.insert("events", {
208
+ type: "group_created",
209
+ actorId: creator,
210
+ targetId: newGroup,
211
+ groupId: newGroup,
212
+ timestamp: Date.now(),
213
+ metadata: {
214
+ source: "url",
215
+ slug: "my-cool-dao"
216
+ }
217
+ });
218
+ ```
219
+
220
+ ---
221
+
222
+ ## Hierarchical Groups (Nested)
223
+
224
+ ### Example: Company with Teams
225
+
226
+ ```typescript
227
+ // 1. Create parent company
228
+ const acmeCorp = await createGroup({
229
+ slug: "acme-corp",
230
+ name: "Acme Corporation",
231
+ type: "business",
232
+ settings: {
233
+ visibility: "public",
234
+ joinPolicy: "invite_only",
235
+ plan: "enterprise"
236
+ }
237
+ });
238
+
239
+ // 2. Create subgroup: Engineering team
240
+ const engineering = await createGroup({
241
+ slug: "acme-corp-engineering",
242
+ name: "Engineering",
243
+ type: "business",
244
+ parentGroupId: acmeCorp._id, // Nested!
245
+ settings: {
246
+ visibility: "private",
247
+ joinPolicy: "invite_only"
248
+ }
249
+ });
250
+
251
+ // 3. Create subgroup: Backend team (nested within Engineering)
252
+ const backend = await createGroup({
253
+ slug: "acme-corp-engineering-backend",
254
+ name: "Backend Team",
255
+ type: "business",
256
+ parentGroupId: engineering._id, // Deeply nested!
257
+ settings: {
258
+ visibility: "private",
259
+ joinPolicy: "invite_only"
260
+ }
261
+ });
262
+ ```
263
+
264
+ ### Example: DAO with Committees
265
+
266
+ ```typescript
267
+ // 1. Main DAO
268
+ const dao = await createGroup({
269
+ slug: "cooldao",
270
+ name: "Cool DAO",
271
+ type: "dao",
272
+ settings: { visibility: "public", joinPolicy: "open" }
273
+ });
274
+
275
+ // 2. Treasury multisig (subgroup)
276
+ const treasury = await createGroup({
277
+ slug: "cooldao-treasury",
278
+ name: "Treasury Multisig",
279
+ type: "dao",
280
+ parentGroupId: dao._id,
281
+ settings: { visibility: "private", joinPolicy: "invite_only" }
282
+ });
283
+
284
+ // 3. Governance committee (subgroup)
285
+ const governance = await createGroup({
286
+ slug: "cooldao-governance",
287
+ name: "Governance Committee",
288
+ type: "dao",
289
+ parentGroupId: dao._id,
290
+ settings: { visibility: "public", joinPolicy: "approval_required" }
291
+ });
292
+ ```
293
+
294
+ ---
295
+
296
+ ## Migration Path
297
+
298
+ ### Phase 1: Schema Changes (Backend)
299
+
300
+ **Files to update:**
301
+ - `backend/convex/schema.ts` – Rename table, add fields
302
+ - All mutations in `backend/convex/mutations/` – Change `organizationId` → `groupId`
303
+ - All queries in `backend/convex/queries/` – Change `organizationId` → `groupId`
304
+ - `backend/convex/auth.ts` – Update org references
305
+
306
+ **Field mapping:**
307
+ ```typescript
308
+ // Direct renames
309
+ organizationId → groupId
310
+ orgId → groupId
311
+
312
+ // New fields (with defaults for existing data)
313
+ slug: slugify(name) // Generate from name
314
+ type: "organization" // Legacy type
315
+ parentGroupId: undefined // Top-level groups
316
+ description: undefined // Optional
317
+ metadata: {} // Empty object
318
+ settings: { // Migrate from existing fields
319
+ visibility: "private",
320
+ joinPolicy: "invite_only",
321
+ plan: plan, // Existing plan field
322
+ limits: limits // Existing limits field
323
+ }
324
+ ```
325
+
326
+ ### Phase 2: Documentation Updates
327
+
328
+ **41 files in `one/` directory:**
329
+ - Global search/replace: "organizations" → "groups"
330
+ - Update `one/knowledge/ontology.md` to Version 2.0.0
331
+ - Update `CLAUDE.md` with new architecture
332
+ - Update `README.md` with groups examples
333
+
334
+ ### Phase 3: Frontend Updates
335
+
336
+ **Files to update:**
337
+ - All components using `organizationId`
338
+ - URL routing: Add `/group/:slug` routes
339
+ - Group creation flow
340
+ - Group discovery/join UI
341
+
342
+ ### Phase 4: Data Migration Script
343
+
344
+ ```typescript
345
+ // migration.ts
346
+ import { mutation } from "./_generated/server";
347
+
348
+ export const migrateOrgsToGroups = mutation({
349
+ handler: async (ctx) => {
350
+ // 1. Get all organizations
351
+ const orgs = await ctx.db.query("organizations").collect();
352
+
353
+ // 2. For each org, create a group
354
+ for (const org of orgs) {
355
+ const groupId = await ctx.db.insert("groups", {
356
+ slug: slugify(org.name),
357
+ name: org.name,
358
+ type: "organization", // Legacy type
359
+ description: undefined,
360
+ metadata: {},
361
+ settings: {
362
+ visibility: "private",
363
+ joinPolicy: "invite_only",
364
+ plan: org.plan,
365
+ limits: org.limits
366
+ },
367
+ status: org.status === "active" ? "active" : "archived",
368
+ createdAt: org.createdAt,
369
+ updatedAt: org.updatedAt
370
+ });
371
+
372
+ // 3. Update all entities pointing to this org
373
+ const entities = await ctx.db
374
+ .query("entities")
375
+ .withIndex("by_org", (q) => q.eq("organizationId", org._id))
376
+ .collect();
377
+
378
+ for (const entity of entities) {
379
+ await ctx.db.patch(entity._id, { groupId });
380
+ }
381
+
382
+ // 4. Update connections, events, knowledge similarly
383
+ // ... (repeat for other tables)
384
+ }
385
+
386
+ // 5. Delete old organizations table (after verification)
387
+ // await ctx.db.system.deleteTable("organizations");
388
+
389
+ return { migrated: orgs.length };
390
+ }
391
+ });
392
+ ```
393
+
394
+ ---
395
+
396
+ ## Examples with New Groups Architecture
397
+
398
+ ### Example 1: Friend Circle
399
+
400
+ ```typescript
401
+ // Emma creates a friend circle from URL
402
+ // Visits: one.ie/group/emmas-friends
403
+
404
+ const friendCircle = await createGroup({
405
+ slug: "emmas-friends",
406
+ name: "Emma's Friends",
407
+ type: "friend_circle",
408
+ description: "My close friends from school",
409
+ settings: {
410
+ visibility: "private",
411
+ joinPolicy: "invite_only"
412
+ }
413
+ });
414
+
415
+ // Emma plans a birthday party (subgroup)
416
+ const birthdayParty = await createGroup({
417
+ slug: "emmas-friends-birthday-2025",
418
+ name: "Emma's Birthday Party 2025",
419
+ type: "friend_circle",
420
+ parentGroupId: friendCircle._id,
421
+ settings: {
422
+ visibility: "private",
423
+ joinPolicy: "invite_only"
424
+ }
425
+ });
426
+
427
+ // Create party details (thing)
428
+ const party = await createThing({
429
+ type: "event",
430
+ name: "Emma's 25th Birthday",
431
+ groupId: birthdayParty._id, // Scoped to subgroup
432
+ properties: {
433
+ date: "2025-06-15",
434
+ location: "The Cool Venue",
435
+ attendees: 30
436
+ }
437
+ });
438
+ ```
439
+
440
+ ### Example 2: Lemonade Stand (Unchanged!)
441
+
442
+ ```typescript
443
+ // Emma's Lemonade Stand still works!
444
+ const myStand = await createGroup({
445
+ slug: "emmas-lemonade",
446
+ name: "Emma's Lemonade Stand",
447
+ type: "business",
448
+ settings: {
449
+ visibility: "public",
450
+ joinPolicy: "open"
451
+ }
452
+ });
453
+
454
+ // Everything else stays the same
455
+ const me = await createPerson({ role: "org_owner", groupId: myStand._id });
456
+ const lemonade = await createThing({ type: "product", groupId: myStand._id });
457
+ // ... etc
458
+ ```
459
+
460
+ ### Example 3: Enterprise (Enhanced with Hierarchy!)
461
+
462
+ ```typescript
463
+ // Acme Corporation with departments
464
+ const acmeCorp = await createGroup({
465
+ slug: "acme-corp",
466
+ name: "Acme Corporation",
467
+ type: "business",
468
+ settings: {
469
+ visibility: "public",
470
+ joinPolicy: "invite_only",
471
+ plan: "enterprise",
472
+ limits: { users: 100, storage: 1000, apiCalls: 1000000 }
473
+ }
474
+ });
475
+
476
+ // Engineering department (subgroup)
477
+ const engineering = await createGroup({
478
+ slug: "acme-corp-engineering",
479
+ name: "Engineering",
480
+ type: "business",
481
+ parentGroupId: acmeCorp._id,
482
+ settings: { visibility: "private", joinPolicy: "invite_only" }
483
+ });
484
+
485
+ // Backend team within Engineering (deeply nested!)
486
+ const backend = await createGroup({
487
+ slug: "acme-corp-engineering-backend",
488
+ name: "Backend Team",
489
+ type: "business",
490
+ parentGroupId: engineering._id,
491
+ settings: { visibility: "private", joinPolicy: "invite_only" }
492
+ });
493
+
494
+ // All data is scoped correctly
495
+ const backendProject = await createThing({
496
+ type: "project",
497
+ name: "API Rewrite",
498
+ groupId: backend._id, // Scoped to Backend team
499
+ properties: { status: "in_progress", deadline: "2025-12-31" }
500
+ });
501
+
502
+ // Can query across hierarchy
503
+ const allAcmeProjects = await getEntitiesInHierarchy(acmeCorp._id);
504
+ // Returns projects from all subgroups
505
+ ```
506
+
507
+ ---
508
+
509
+ ## Impact Analysis
510
+
511
+ ### Breaking Changes
512
+
513
+ 1. **Database schema**: `organizations` table → `groups` table
514
+ 2. **Field names**: `organizationId` → `groupId` everywhere
515
+ 3. **API endpoints**: `/api/organizations/*` → `/api/groups/*`
516
+ 4. **Documentation**: 41 files need terminology updates
517
+
518
+ ### Non-Breaking Changes
519
+
520
+ 1. **Multi-tenancy guarantees**: Identical isolation (no behavior change)
521
+ 2. **Existing patterns**: Same CRUD operations, just renamed
522
+ 3. **API structure**: Same mutation/query patterns
523
+
524
+ ### New Capabilities
525
+
526
+ 1. **Hierarchical groups**: Groups within groups (recursively)
527
+ 2. **URL-based creation**: `one.ie/group/slug` instantly creates or joins
528
+ 3. **Universal types**: Friend circles, DAOs, communities (not just "organizations")
529
+ 4. **Flexible settings**: Per-group visibility and join policies
530
+
531
+ ---
532
+
533
+ ## Timeline (Inference-Based)
534
+
535
+ **Infer 1-10: Foundation & Planning**
536
+ - ✅ Infer 1: Map ontology changes (organizations → groups)
537
+ - ✅ Infer 2: Design nested groups schema
538
+ - ✅ Infer 3: Design URL → group creation flow
539
+ - Current: Complete architecture document
540
+
541
+ **Infer 11-30: Backend Migration**
542
+ - Infer 11: Update `backend/convex/schema.ts`
543
+ - Infer 12: Add hierarchical group queries
544
+ - Infer 13-20: Update all mutations (orgId → groupId)
545
+ - Infer 21-28: Update all queries (orgId → groupId)
546
+ - Infer 29: Create data migration script
547
+ - Infer 30: Test migration on dev data
548
+
549
+ **Infer 31-50: Frontend Updates**
550
+ - Infer 31-35: Update components (organizationId → groupId)
551
+ - Infer 36-40: Implement `/group/:slug` routing
552
+ - Infer 41-45: Build group creation flow UI
553
+ - Infer 46-50: Build group hierarchy navigation
554
+
555
+ **Infer 51-70: Documentation**
556
+ - Infer 51-65: Update 41 files in `one/` directory
557
+ - Infer 66: Update `CLAUDE.md`
558
+ - Infer 67: Update `README.md`
559
+ - Infer 68: Update `AGENTS.md`
560
+ - Infer 69-70: Create migration guide
561
+
562
+ **Infer 71-90: Testing & Quality**
563
+ - Infer 71-80: Write tests for nested groups
564
+ - Infer 81-85: Test URL-based creation
565
+ - Infer 86-90: Integration tests
566
+
567
+ **Infer 91-100: Deployment**
568
+ - Infer 91-95: Run migration on staging
569
+ - Infer 96-98: Deploy backend
570
+ - Infer 99: Deploy frontend
571
+ - Infer 100: Verify production migration
572
+
573
+ ---
574
+
575
+ ## Vision → Reality Mapping
576
+
577
+ **Vision:** "Groups can be started from a URL"
578
+
579
+ **Reality:**
580
+ 1. User visits `one.ie/group/my-cool-dao`
581
+ 2. Backend checks if `slug === "my-cool-dao"` exists
582
+ 3. If not, show creation flow with slug pre-filled
583
+ 4. User fills name, type, description, settings
584
+ 5. Click "Create" → Group created, user becomes `org_owner`
585
+ 6. Redirect to `one.ie/group/my-cool-dao` (now live!)
586
+ 7. User can invite others via URL: "Just visit one.ie/group/my-cool-dao"
587
+
588
+ **Vision:** "Groups can have groups"
589
+
590
+ **Reality:**
591
+ 1. Parent group exists: `acme-corp`
592
+ 2. Create subgroup with `parentGroupId: acme-corp._id`
593
+ 3. Subgroup inherits permissions (can override)
594
+ 4. Data scoped to subgroup: `groupId: engineering._id`
595
+ 5. Hierarchical queries: "Get all things in Acme Corp and subgroups"
596
+ 6. Visual hierarchy in UI: Acme Corp > Engineering > Backend Team
597
+
598
+ **Vision:** "Friends, businesses, communities, DAOs, governments"
599
+
600
+ **Reality:**
601
+ 1. `type` field: `"friend_circle" | "business" | "community" | "dao" | "government"`
602
+ 2. Each type has default settings (friend_circle → private, dao → public)
603
+ 3. UI shows appropriate icons and terminology per type
604
+ 4. Discoverability: Filter groups by type (`/explore/daos`, `/explore/communities`)
605
+ 5. Different join flows per type (DAOs might use token-gating)
606
+
607
+ ---
608
+
609
+ ## Next Steps
610
+
611
+ 1. **Complete this architecture document** ✅
612
+ 2. **Update `backend/convex/schema.ts`** (Infer 4)
613
+ 3. **Create hierarchical query patterns** (Infer 5)
614
+ 4. **Update first mutation as example** (Infer 6)
615
+ 5. **Create migration script** (Infer 7)
616
+
617
+ ---
618
+
619
+ **This migration unlocks:**
620
+ - Universal applicability (beyond just "organizations")
621
+ - Hierarchical structures (teams, committees, subgroups)
622
+ - URL-based viral growth (share a link, create a group)
623
+ - Clearer mental model (groups > organizations)
624
+
625
+ **Multi-tenancy preserved. Clarity enhanced. Scale infinite.**