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,520 @@
1
+ # Feature 2: Backend-Agnostic Frontend - Test Specification
2
+
3
+ **Feature ID:** `feature_2_tests`
4
+ **Plan:** `plan_2_backend_agnostic_frontend`
5
+ **Owner:** Quality Agent
6
+ **Status:** Awaiting Detailed Specification
7
+ **Priority:** P0 (Critical - Quality Assurance)
8
+ **Effort:** Ongoing throughout all features
9
+ **Dependencies:** All features 2-1 through 2-7
10
+
11
+ ---
12
+
13
+ ## Assignment
14
+
15
+ This feature is assigned to **Quality Agent**.
16
+
17
+ ### Instructions
18
+
19
+ Please create a COMPREHENSIVE test specification covering:
20
+
21
+ 1. **Complete Test Strategy**
22
+ - Test categories (unit, integration, e2e, performance)
23
+ - Test coverage requirements (90%+ unit, 80%+ integration)
24
+ - Test execution schedule (after each feature)
25
+ - Test environments (dev, staging, production)
26
+
27
+ 2. **Test Cases for All Features**
28
+ - Feature 2-1: DataProvider Interface & ConvexProvider (20+ test cases)
29
+ - Feature 2-2: Configuration System (15+ test cases)
30
+ - Feature 2-3: Effect.ts Services (30+ test cases)
31
+ - Feature 2-4: React Hooks (25+ test cases)
32
+ - Feature 2-5: Auth Migration (50+ test cases - CRITICAL)
33
+ - Feature 2-6: Dashboard Migration (40+ test cases)
34
+ - Feature 2-7: Alternative Providers (30+ test cases)
35
+
36
+ 3. **Acceptance Criteria (Per Feature)**
37
+ - Functional requirements checklist
38
+ - Non-functional requirements checklist
39
+ - Performance benchmarks
40
+ - Security requirements
41
+ - Accessibility requirements
42
+
43
+ 4. **Quality Gates**
44
+ - Gate 1: Interface Complete (End of Week 1)
45
+ - Gate 2: Services Complete (End of Week 2)
46
+ - Gate 3: Auth Migration Complete (End of Week 3)
47
+ - Gate 4: Full Migration Complete (End of Week 4)
48
+ - Gate 5: Alternative Providers Working (End of Week 6)
49
+
50
+ 5. **CI/CD Configuration**
51
+ - Automated test execution
52
+ - Pre-commit hooks
53
+ - Pull request checks
54
+ - Deployment gates
55
+
56
+ 6. **Performance Testing**
57
+ - Baseline performance metrics
58
+ - Performance targets (<10ms DataProvider overhead)
59
+ - Load testing scenarios
60
+ - Real-time update performance
61
+
62
+ 7. **Regression Testing**
63
+ - Auth regression suite (50+ tests MUST pass)
64
+ - Dashboard regression suite
65
+ - E2E regression suite
66
+ - Visual regression testing
67
+
68
+ ---
69
+
70
+ ## Test Categories
71
+
72
+ ### 1. Unit Tests (90%+ Coverage)
73
+
74
+ **DataProvider Interface (Feature 2-1):**
75
+ - [ ] Interface defines all 6-dimension operations
76
+ - [ ] ConvexProvider implements all operations
77
+ - [ ] ConvexProvider handles errors correctly
78
+ - [ ] ConvexProvider transforms data correctly
79
+ - [ ] Provider factory creates correct provider type
80
+ - [ ] Type safety enforced at compile time
81
+
82
+ **Configuration System (Feature 2-2):**
83
+ - [ ] Environment variables parsed correctly
84
+ - [ ] Provider registry manages multiple providers
85
+ - [ ] Provider switching works
86
+ - [ ] Multi-tenant isolation maintained
87
+ - [ ] Configuration validation catches errors
88
+ - [ ] Invalid configurations rejected
89
+
90
+ **Effect.ts Services (Feature 2-3):**
91
+ - [ ] ThingService creates things
92
+ - [ ] ThingService lists things with filters
93
+ - [ ] ThingService updates things
94
+ - [ ] ThingService deletes things
95
+ - [ ] ConnectionService creates connections
96
+ - [ ] EventService logs events
97
+ - [ ] Error handling works with Effect.ts
98
+ - [ ] Business rules enforced
99
+
100
+ **React Hooks (Feature 2-4):**
101
+ - [ ] useThings hook fetches entities
102
+ - [ ] useThing hook fetches single entity
103
+ - [ ] useCreateThing hook creates entities
104
+ - [ ] useConnections hook fetches relationships
105
+ - [ ] useEvents hook fetches events
106
+ - [ ] Loading states work correctly
107
+ - [ ] Error states work correctly
108
+ - [ ] Real-time updates work
109
+
110
+ ### 2. Integration Tests (80%+ Coverage)
111
+
112
+ **Auth Migration (Feature 2-5):**
113
+ - [ ] Email/password login works end-to-end
114
+ - [ ] Email/password signup works end-to-end
115
+ - [ ] OAuth (Google) login works
116
+ - [ ] OAuth (GitHub) login works
117
+ - [ ] OAuth (Apple) login works
118
+ - [ ] Magic link login works
119
+ - [ ] Password reset flow works
120
+ - [ ] Email verification works
121
+ - [ ] 2FA setup works
122
+ - [ ] 2FA verification works
123
+ - [ ] Session management works
124
+ - [ ] Logout works
125
+
126
+ **Dashboard Migration (Feature 2-6):**
127
+ - [ ] Dashboard loads with DataProvider
128
+ - [ ] CourseList displays courses
129
+ - [ ] CourseDetail shows course data
130
+ - [ ] LessonList displays lessons
131
+ - [ ] ActivityFeed shows recent events
132
+ - [ ] SearchBar searches entities
133
+ - [ ] CRUD operations work
134
+ - [ ] Real-time updates work
135
+ - [ ] Navigation works
136
+
137
+ **Alternative Providers (Feature 2-7):**
138
+ - [ ] WordPressProvider creates things
139
+ - [ ] WordPressProvider lists things
140
+ - [ ] WordPressProvider updates things
141
+ - [ ] NotionProvider creates things
142
+ - [ ] NotionProvider lists things
143
+ - [ ] NotionProvider updates things
144
+ - [ ] Multi-backend scenarios work
145
+ - [ ] Provider switching works
146
+ - [ ] Data integrity maintained
147
+
148
+ ### 3. End-to-End Tests
149
+
150
+ **Complete User Flows:**
151
+ - [ ] User signs up → creates course → adds lessons → publishes
152
+ - [ ] User logs in → views dashboard → edits course → logs out
153
+ - [ ] User resets password → receives email → sets new password → logs in
154
+ - [ ] Org owner switches backend provider → all data migrates correctly
155
+ - [ ] Student enrolls in course → completes lessons → receives certificate
156
+
157
+ ### 4. Performance Tests
158
+
159
+ **Baseline Metrics (Convex):**
160
+ - [ ] Login: <500ms (p95)
161
+ - [ ] Dashboard load: <1000ms (p95)
162
+ - [ ] Entity list: <300ms (p95)
163
+ - [ ] Entity detail: <200ms (p95)
164
+ - [ ] Search: <500ms (p95)
165
+
166
+ **Target Metrics (DataProvider):**
167
+ - [ ] DataProvider overhead: <10ms (p95)
168
+ - [ ] Login: <550ms (p95) - Within 10%
169
+ - [ ] Dashboard load: <1100ms (p95) - Within 10%
170
+ - [ ] Entity list: <330ms (p95) - Within 10%
171
+ - [ ] Entity detail: <220ms (p95) - Within 10%
172
+ - [ ] Search: <550ms (p95) - Within 10%
173
+
174
+ **Load Testing:**
175
+ - [ ] 100 concurrent users - response times acceptable
176
+ - [ ] 1000 concurrent users - response times acceptable
177
+ - [ ] 10,000 entities - query performance acceptable
178
+ - [ ] Real-time updates with 100 subscribers - no lag
179
+
180
+ ### 5. Security Tests
181
+
182
+ **Authentication & Authorization:**
183
+ - [ ] Unauthorized users cannot access protected routes
184
+ - [ ] Role-based permissions enforced
185
+ - [ ] SQL injection attempts blocked
186
+ - [ ] XSS attempts sanitized
187
+ - [ ] CSRF protection enabled
188
+ - [ ] API keys secured
189
+ - [ ] Sensitive data encrypted
190
+
191
+ **Multi-Tenant Isolation:**
192
+ - [ ] Org A cannot access Org B data
193
+ - [ ] Provider switching doesn't leak data
194
+ - [ ] Cross-org queries blocked
195
+ - [ ] Event logs respect org boundaries
196
+
197
+ ### 6. Accessibility Tests
198
+
199
+ **WCAG 2.1 AA Compliance:**
200
+ - [ ] Keyboard navigation works
201
+ - [ ] Screen reader compatible
202
+ - [ ] Color contrast meets standards
203
+ - [ ] Focus indicators visible
204
+ - [ ] ARIA labels correct
205
+ - [ ] Forms accessible
206
+
207
+ ---
208
+
209
+ ## Quality Gates
210
+
211
+ ### Gate 1: Interface Complete (End of Week 1)
212
+
213
+ **Checklist:**
214
+ - [ ] All unit tests pass (Feature 2-1, 2-2)
215
+ - [ ] TypeScript compiles with zero errors
216
+ - [ ] Performance baseline established
217
+ - [ ] Documentation complete
218
+ - [ ] Code review approved
219
+
220
+ **Approval Required From:**
221
+ - Backend Specialist (implementation complete)
222
+ - Quality Agent (tests pass)
223
+ - Engineering Director (gate approval)
224
+
225
+ ---
226
+
227
+ ### Gate 2: Services Complete (End of Week 2)
228
+
229
+ **Checklist:**
230
+ - [ ] All unit tests pass (Feature 2-3, 2-4)
231
+ - [ ] Integration tests pass
232
+ - [ ] Effect.ts error handling works
233
+ - [ ] React hooks work with DataProvider
234
+ - [ ] Documentation complete
235
+ - [ ] Code review approved
236
+
237
+ **Approval Required From:**
238
+ - Backend Specialist (services complete)
239
+ - Frontend Specialist (hooks complete)
240
+ - Quality Agent (tests pass)
241
+ - Engineering Director (gate approval)
242
+
243
+ ---
244
+
245
+ ### Gate 3: Auth Migration Complete (End of Week 3)
246
+
247
+ **Checklist:**
248
+ - [ ] **ALL 50+ auth tests pass** (NO EXCEPTIONS)
249
+ - [ ] Zero functionality regression
250
+ - [ ] Performance within 10% of baseline
251
+ - [ ] No TypeScript errors
252
+ - [ ] No direct Convex imports in auth
253
+ - [ ] Documentation updated
254
+ - [ ] Code review approved
255
+
256
+ **Approval Required From:**
257
+ - Frontend Specialist (migration complete)
258
+ - Quality Agent (ALL tests pass)
259
+ - Engineering Director (gate approval)
260
+
261
+ **CRITICAL:** This is the highest-risk gate. All 50+ auth tests MUST pass before proceeding.
262
+
263
+ ---
264
+
265
+ ### Gate 4: Full Migration Complete (End of Week 4)
266
+
267
+ **Checklist:**
268
+ - [ ] All dashboard components migrated
269
+ - [ ] All tests pass (unit, integration, e2e)
270
+ - [ ] Performance maintained
271
+ - [ ] Zero TypeScript errors
272
+ - [ ] No direct Convex imports in components
273
+ - [ ] Documentation updated
274
+ - [ ] Migration guide published
275
+ - [ ] Code review approved
276
+
277
+ **Approval Required From:**
278
+ - Frontend Specialist (dashboard complete)
279
+ - Quality Agent (all tests pass)
280
+ - Engineering Director (gate approval)
281
+
282
+ ---
283
+
284
+ ### Gate 5: Alternative Providers Working (End of Week 6)
285
+
286
+ **Checklist:**
287
+ - [ ] WordPress provider functional
288
+ - [ ] Notion provider functional
289
+ - [ ] Multi-backend tests pass
290
+ - [ ] Provider switching works
291
+ - [ ] Data integrity validated
292
+ - [ ] Performance acceptable
293
+ - [ ] Provider creation guide complete
294
+ - [ ] Documentation complete
295
+ - [ ] Code review approved
296
+
297
+ **Approval Required From:**
298
+ - Integration Specialist (providers complete)
299
+ - Quality Agent (all tests pass)
300
+ - Engineering Director (gate approval)
301
+
302
+ ---
303
+
304
+ ## CI/CD Configuration
305
+
306
+ ### Pre-Commit Hooks
307
+
308
+ ```bash
309
+ # .husky/pre-commit
310
+ #!/bin/bash
311
+
312
+ # 1. Run type checking
313
+ echo "Running TypeScript type checking..."
314
+ cd frontend && bunx astro check
315
+ if [ $? -ne 0 ]; then
316
+ echo "❌ Type checking failed"
317
+ exit 1
318
+ fi
319
+
320
+ # 2. Run linting
321
+ echo "Running ESLint..."
322
+ bun run lint
323
+ if [ $? -ne 0 ]; then
324
+ echo "❌ Linting failed"
325
+ exit 1
326
+ fi
327
+
328
+ # 3. Run unit tests
329
+ echo "Running unit tests..."
330
+ bun test --run
331
+ if [ $? -ne 0 ]; then
332
+ echo "❌ Unit tests failed"
333
+ exit 1
334
+ fi
335
+
336
+ echo "✅ Pre-commit checks passed"
337
+ ```
338
+
339
+ ### Pull Request Checks
340
+
341
+ ```yaml
342
+ # .github/workflows/pr-checks.yml
343
+ name: Pull Request Checks
344
+
345
+ on:
346
+ pull_request:
347
+ branches: [main, develop]
348
+
349
+ jobs:
350
+ test:
351
+ runs-on: ubuntu-latest
352
+ steps:
353
+ - uses: actions/checkout@v3
354
+ - uses: oven-sh/setup-bun@v1
355
+
356
+ - name: Install dependencies
357
+ run: cd frontend && bun install
358
+
359
+ - name: Type check
360
+ run: cd frontend && bunx astro check
361
+
362
+ - name: Lint
363
+ run: cd frontend && bun run lint
364
+
365
+ - name: Unit tests
366
+ run: cd frontend && bun test --run
367
+
368
+ - name: Integration tests
369
+ run: cd frontend && bun test:integration --run
370
+
371
+ - name: E2E tests
372
+ run: cd frontend && bun test:e2e --run
373
+
374
+ - name: Performance tests
375
+ run: cd frontend && bun test:performance --run
376
+ ```
377
+
378
+ ### Deployment Gates
379
+
380
+ ```yaml
381
+ # Deploy only if all tests pass
382
+ deploy:
383
+ needs: [test]
384
+ if: success()
385
+ runs-on: ubuntu-latest
386
+ steps:
387
+ - name: Deploy to Cloudflare Pages
388
+ run: wrangler pages deploy dist
389
+ ```
390
+
391
+ ---
392
+
393
+ ## Test Execution Schedule
394
+
395
+ ### Daily (During Development)
396
+ - Run unit tests after each code change
397
+ - Run integration tests for affected features
398
+ - Monitor test coverage (maintain 90%+ unit, 80%+ integration)
399
+
400
+ ### Per Feature Completion
401
+ - Run full test suite for completed feature
402
+ - Run regression tests for all previous features
403
+ - Performance benchmarks
404
+ - Security scans
405
+
406
+ ### Weekly
407
+ - Full regression test suite
408
+ - E2E test suite
409
+ - Load testing
410
+ - Visual regression testing
411
+ - Accessibility audit
412
+
413
+ ### Before Release
414
+ - Complete test suite (all categories)
415
+ - Performance validation
416
+ - Security audit
417
+ - Accessibility validation
418
+ - Documentation review
419
+
420
+ ---
421
+
422
+ ## Test Environments
423
+
424
+ ### Development
425
+ - Local Convex deployment
426
+ - Local frontend (localhost:4321)
427
+ - Mock external services
428
+ - Fast feedback loop
429
+
430
+ ### Staging
431
+ - Staging Convex deployment
432
+ - Staging frontend (staging.one-platform.com)
433
+ - Real WordPress instance (staging)
434
+ - Real Notion workspace (staging)
435
+ - Production-like environment
436
+
437
+ ### Production
438
+ - Production Convex deployment
439
+ - Production frontend (one-platform.com)
440
+ - Production external services
441
+ - Monitoring and alerting
442
+
443
+ ---
444
+
445
+ ## Regression Testing
446
+
447
+ ### Auth Regression Suite (50+ Tests)
448
+
449
+ **Must Run After:**
450
+ - Any auth component change
451
+ - Any DataProvider change
452
+ - Any hook change
453
+ - Feature 2-5 (Auth Migration)
454
+
455
+ **Test Categories:**
456
+ 1. Email/password authentication (10 tests)
457
+ 2. OAuth authentication (15 tests)
458
+ 3. Magic link authentication (5 tests)
459
+ 4. Password reset (5 tests)
460
+ 5. Email verification (5 tests)
461
+ 6. 2FA (10 tests)
462
+
463
+ **Success Criteria:**
464
+ - ALL 50+ tests MUST pass
465
+ - Zero functionality regression
466
+ - Performance within 10% of baseline
467
+
468
+ ### Dashboard Regression Suite (40+ Tests)
469
+
470
+ **Must Run After:**
471
+ - Any dashboard component change
472
+ - Any DataProvider change
473
+ - Any hook change
474
+ - Feature 2-6 (Dashboard Migration)
475
+
476
+ **Test Categories:**
477
+ 1. Entity lists (10 tests)
478
+ 2. Entity details (10 tests)
479
+ 3. Activity feed (5 tests)
480
+ 4. Search (10 tests)
481
+ 5. CRUD operations (5 tests)
482
+
483
+ ### E2E Regression Suite
484
+
485
+ **Must Run After:**
486
+ - Any major change
487
+ - Before release
488
+
489
+ **Test Scenarios:**
490
+ 1. Complete user signup → course creation → lesson addition → publish flow
491
+ 2. Complete login → dashboard → edit → logout flow
492
+ 3. Complete password reset flow
493
+ 4. Complete multi-backend switching flow
494
+
495
+ ---
496
+
497
+ ## Related Files
498
+
499
+ - **Plan:** `one/things/plans/2-backend-agnostic-frontend.md`
500
+ - **All Features:** `one/things/features/2-{1-7}-*.md`
501
+ - **Test Implementations:** `frontend/test/` (directory)
502
+ - **CI/CD Config:** `.github/workflows/` (directory)
503
+
504
+ ---
505
+
506
+ ## Next Steps
507
+
508
+ 1. **Quality Agent:** Create detailed test specifications for each feature
509
+ 2. **Quality Agent:** Set up test infrastructure
510
+ 3. **Quality Agent:** Define performance baselines
511
+ 4. **Quality Agent:** Configure CI/CD pipelines
512
+ 5. **Quality Agent:** Run tests after each feature completion
513
+ 6. **Quality Agent:** Report quality metrics to Director
514
+
515
+ ---
516
+
517
+ **Status:** Awaiting Quality Agent to populate detailed test specifications
518
+ **Created:** 2025-10-13
519
+ **Validated By:** Engineering Director Agent
520
+ **Critical:** Auth regression suite (50+ tests) MUST pass at Gate 3