oneie 3.7.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/commands/agent.d.ts +2 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +44 -0
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/bounty.d.ts +4 -0
- package/dist/commands/bounty.d.ts.map +1 -0
- package/dist/commands/bounty.js +24 -0
- package/dist/commands/bounty.js.map +1 -0
- package/dist/commands/buy.d.ts +19 -0
- package/dist/commands/buy.d.ts.map +1 -0
- package/dist/commands/buy.js +63 -0
- package/dist/commands/buy.js.map +1 -0
- package/dist/commands/capabilities.d.ts +4 -0
- package/dist/commands/capabilities.d.ts.map +1 -0
- package/dist/commands/capabilities.js +18 -0
- package/dist/commands/capabilities.js.map +1 -0
- package/dist/commands/commend.d.ts +4 -0
- package/dist/commands/commend.d.ts.map +1 -0
- package/dist/commands/commend.js +13 -0
- package/dist/commands/commend.js.map +1 -0
- package/dist/commands/completion.d.ts +4 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +49 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +4 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +78 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy.d.ts +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +39 -4
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +72 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/domain.d.ts +4 -0
- package/dist/commands/domain.d.ts.map +1 -0
- package/dist/commands/domain.js +19 -0
- package/dist/commands/domain.js.map +1 -0
- package/dist/commands/export.d.ts +4 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +15 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/fade.d.ts.map +1 -1
- package/dist/commands/fade.js +8 -4
- package/dist/commands/fade.js.map +1 -1
- package/dist/commands/flag.d.ts +4 -0
- package/dist/commands/flag.d.ts.map +1 -0
- package/dist/commands/flag.js +13 -0
- package/dist/commands/flag.js.map +1 -0
- package/dist/commands/health.d.ts +4 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +11 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/highways.d.ts.map +1 -1
- package/dist/commands/highways.js +7 -4
- package/dist/commands/highways.js.map +1 -1
- package/dist/commands/hire.d.ts +4 -0
- package/dist/commands/hire.d.ts.map +1 -0
- package/dist/commands/hire.js +16 -0
- package/dist/commands/hire.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +85 -48
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/invite.d.ts +4 -0
- package/dist/commands/invite.d.ts.map +1 -0
- package/dist/commands/invite.js +37 -0
- package/dist/commands/invite.js.map +1 -0
- package/dist/commands/mark.d.ts.map +1 -1
- package/dist/commands/mark.js +7 -7
- package/dist/commands/mark.js.map +1 -1
- package/dist/commands/pay.d.ts +4 -0
- package/dist/commands/pay.d.ts.map +1 -0
- package/dist/commands/pay.js +21 -0
- package/dist/commands/pay.js.map +1 -0
- package/dist/commands/pipe.d.ts +4 -0
- package/dist/commands/pipe.d.ts.map +1 -0
- package/dist/commands/pipe.js +35 -0
- package/dist/commands/pipe.js.map +1 -0
- package/dist/commands/publish.d.ts +4 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +23 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/repl.d.ts +4 -0
- package/dist/commands/repl.d.ts.map +1 -0
- package/dist/commands/repl.js +56 -0
- package/dist/commands/repl.js.map +1 -0
- package/dist/commands/revenue.d.ts +4 -0
- package/dist/commands/revenue.d.ts.map +1 -0
- package/dist/commands/revenue.js +11 -0
- package/dist/commands/revenue.js.map +1 -0
- package/dist/commands/sell.d.ts +15 -0
- package/dist/commands/sell.d.ts.map +1 -0
- package/dist/commands/sell.js +49 -0
- package/dist/commands/sell.js.map +1 -0
- package/dist/commands/stats.d.ts +4 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +11 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +18 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/subscribe.d.ts +14 -0
- package/dist/commands/subscribe.d.ts.map +1 -0
- package/dist/commands/subscribe.js +33 -0
- package/dist/commands/subscribe.js.map +1 -0
- package/dist/commands/tail.d.ts +4 -0
- package/dist/commands/tail.d.ts.map +1 -0
- package/dist/commands/tail.js +51 -0
- package/dist/commands/tail.js.map +1 -0
- package/dist/commands/warn.d.ts.map +1 -1
- package/dist/commands/warn.js +6 -6
- package/dist/commands/warn.js.map +1 -1
- package/dist/index.js +70 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/args.d.ts +1 -0
- package/dist/lib/args.d.ts.map +1 -1
- package/dist/lib/args.js +3 -0
- package/dist/lib/args.js.map +1 -1
- package/dist/lib/output.d.ts +5 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +32 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/sdk.d.ts +10 -0
- package/dist/lib/sdk.d.ts.map +1 -0
- package/dist/lib/sdk.js +22 -0
- package/dist/lib/sdk.js.map +1 -0
- package/dist/utils/installation-setup.d.ts +15 -0
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +63 -0
- package/dist/utils/installation-setup.js.map +1 -1
- package/package.json +3 -18
- package/.claude/agents/TROUBLESHOOTING.md +0 -530
- package/.claude/agents/agent-backend.md +0 -574
- package/.claude/agents/agent-builder.md +0 -911
- package/.claude/agents/agent-claude.md +0 -645
- package/.claude/agents/agent-clean.md +0 -477
- package/.claude/agents/agent-clone.md +0 -554
- package/.claude/agents/agent-designer.md +0 -1080
- package/.claude/agents/agent-director.md +0 -2254
- package/.claude/agents/agent-documenter.md +0 -688
- package/.claude/agents/agent-frontend.md +0 -1199
- package/.claude/agents/agent-integrator.md +0 -670
- package/.claude/agents/agent-lawyer.md +0 -1320
- package/.claude/agents/agent-news.md +0 -363
- package/.claude/agents/agent-onboard.md +0 -613
- package/.claude/agents/agent-ontology.md +0 -585
- package/.claude/agents/agent-ops.md +0 -1275
- package/.claude/agents/agent-problem-solver.md +0 -669
- package/.claude/agents/agent-quality.md +0 -1042
- package/.claude/agents/agent-sales.md +0 -507
- package/.claude/agents/agent-writer.md +0 -1068
- package/.claude/commands/cascade.md +0 -742
- package/.claude/commands/chat.md +0 -728
- package/.claude/commands/commit.md +0 -95
- package/.claude/commands/create.md +0 -544
- package/.claude/commands/deploy.md +0 -309
- package/.claude/commands/fast.md +0 -636
- package/.claude/commands/mcp-on.md +0 -191
- package/.claude/commands/media-upload.md +0 -186
- package/.claude/commands/news.md +0 -274
- package/.claude/commands/onboard.md +0 -440
- package/.claude/commands/one.md +0 -398
- package/.claude/commands/optimize.md +0 -74
- package/.claude/commands/plan.md +0 -719
- package/.claude/commands/push.md +0 -214
- package/.claude/commands/release.md +0 -105
- package/.claude/commands/review.md +0 -99
- package/.claude/commands/server.md +0 -487
- package/.claude/commands/start.md +0 -227
- package/.claude/commands/test.md +0 -197
- package/.claude/commands/validate.md +0 -140
- package/.claude/hooks/.last-news-context +0 -1
- package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
- package/.claude/hooks/README-knowledge-hooks.md +0 -451
- package/.claude/hooks/README-news-generation.md +0 -364
- package/.claude/hooks/README-root-cleanup.md +0 -200
- package/.claude/hooks/README.md +0 -284
- package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/.claude/hooks/auto-format.sh +0 -106
- package/.claude/hooks/check-filenames.py +0 -177
- package/.claude/hooks/clean-post.py +0 -468
- package/.claude/hooks/clean-pre.py +0 -393
- package/.claude/hooks/clean-root-markdown.sh +0 -73
- package/.claude/hooks/commit-push.sh +0 -95
- package/.claude/hooks/done.py +0 -236
- package/.claude/hooks/format-hook.sh +0 -163
- package/.claude/hooks/formatting.py +0 -187
- package/.claude/hooks/hook-logger.sh +0 -173
- package/.claude/hooks/knowledge-post.py +0 -355
- package/.claude/hooks/knowledge-pre.py +0 -245
- package/.claude/hooks/mcp-on.sh +0 -134
- package/.claude/hooks/notification-hook.sh +0 -279
- package/.claude/hooks/ontology-validation.py +0 -255
- package/.claude/hooks/push.sh +0 -153
- package/.claude/hooks/release-cli.sh +0 -205
- package/.claude/hooks/root-cleanup.py +0 -217
- package/.claude/hooks/security-hook.sh +0 -397
- package/.claude/hooks/tag-all-docs.py +0 -464
- package/.claude/hooks/test-validate-ontology.sh +0 -170
- package/.claude/hooks/todo.py +0 -368
- package/.claude/hooks/track-changes.sh +0 -101
- package/.claude/hooks/validate-imports.py +0 -182
- package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
- package/.claude/hooks/validate-ontology-structure.py +0 -558
- package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
- package/.claude/hooks/validate-ontology.py +0 -140
- package/.claude/hooks/write-news.sh +0 -194
- package/.claude/skills/INDEX.md +0 -523
- package/.claude/skills/REGISTRY.md +0 -529
- package/.claude/skills/agent-backend-create-mutation.md +0 -319
- package/.claude/skills/agent-designer-create-wireframe.md +0 -341
- package/.claude/skills/agent-frontend-create-page.md +0 -413
- package/.claude/skills/agents/README.md +0 -238
- package/.claude/skills/astro/add-content-collection.md +0 -30
- package/.claude/skills/astro/check-build.md +0 -29
- package/.claude/skills/astro/create-component.md +0 -29
- package/.claude/skills/astro/create-page.md +0 -30
- package/.claude/skills/astro/optimize-performance.md +0 -21
- package/.claude/skills/convex/check-deployment.md +0 -46
- package/.claude/skills/convex/create-mutation.md +0 -405
- package/.claude/skills/convex/create-query.md +0 -52
- package/.claude/skills/convex/read-schema.md +0 -373
- package/.claude/skills/convex/test-function.md +0 -50
- package/.claude/skills/deployment/check-deployment-health.md +0 -20
- package/.claude/skills/deployment/create-release.md +0 -21
- package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
- package/.claude/skills/deployment/deploy-convex.md +0 -30
- package/.claude/skills/deployment/sync-repositories.md +0 -19
- package/.claude/skills/design/check-accessibility.md +0 -21
- package/.claude/skills/design/create-component-spec.md +0 -27
- package/.claude/skills/design/generate-design-tokens.md +0 -24
- package/.claude/skills/design/generate-wireframe.md +0 -30
- package/.claude/skills/documentation/create-migration-guide.md +0 -20
- package/.claude/skills/documentation/generate-api-docs.md +0 -27
- package/.claude/skills/documentation/generate-readme.md +0 -22
- package/.claude/skills/documentation/update-knowledge.md +0 -20
- package/.claude/skills/integration/connect-external-system.md +0 -21
- package/.claude/skills/integration/implement-a2a.md +0 -20
- package/.claude/skills/integration/implement-acp.md +0 -20
- package/.claude/skills/integration/verify-integration.md +0 -20
- package/.claude/skills/ontology/README.md +0 -255
- package/.claude/skills/ontology/check-dimension.md +0 -307
- package/.claude/skills/ontology/generate-entity-type.md +0 -339
- package/.claude/skills/ontology/validate-schema.md +0 -229
- package/.claude/skills/ontology/verify-relationships.md +0 -310
- package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
- package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
- package/.claude/skills/problem-solving/propose-solution.md +0 -29
- package/.claude/skills/problem-solving/verify-fix.md +0 -21
- package/.claude/skills/sales/generate-demo-script.md +0 -21
- package/.claude/skills/sales/qualify-lead.md +0 -30
- package/.claude/skills/sales/track-trial.md +0 -20
- package/.claude/skills/sales/verify-kyc.md +0 -20
- package/.claude/skills/testing/analyze-coverage.md +0 -24
- package/.claude/skills/testing/generate-tests.md +0 -24
- package/.claude/skills/testing/run-tests.md +0 -27
- package/.claude/skills/testing/validate-e2e.md +0 -25
- package/AGENTS.md +0 -60
- package/CLAUDE.md +0 -130
- package/CREATE-WEBSITE.md +0 -458
- package/SECURITY.md +0 -31
- package/folders.yaml +0 -92
- package/one/README.md +0 -760
- package/one/actors/anthony-o-connell.md +0 -469
- package/one/actors/people.md +0 -590
- package/one/events/0-changes.md +0 -2764
- package/one/events/1-PROJECTS-START-HERE.md +0 -384
- package/one/events/1-projects-developer-quickstart.md +0 -620
- package/one/events/1-projects-feature.md +0 -2047
- package/one/events/1-projects-team-briefing.md +0 -583
- package/one/events/2024-10-14-deployment-plan.md +0 -330
- package/one/events/2024-10-14-deployment-success.md +0 -447
- package/one/events/2024-10-14-final-sync-complete.md +0 -250
- package/one/events/2024-10-14-release-v2.0.6.md +0 -414
- package/one/events/2024-10-15-agent-clean-v2-summary.md +0 -495
- package/one/events/2024-10-15-handoff-to-clean.md +0 -347
- package/one/events/2024-10-15-package-manager-tests.md +0 -442
- package/one/events/2024-10-15-release-command-complete.md +0 -416
- package/one/events/2025-10-15-private-files-secured.md +0 -359
- package/one/events/2025-10-15-unignore-public-group-docs.md +0 -298
- package/one/events/2025-11-08-backend-claude-refactor.md +0 -242
- package/one/events/2025-11-08-parallel-agent-implementation.md +0 -620
- package/one/events/2025-11-10-ai-integration-status-report.md +0 -241
- package/one/events/ACCESSIBILITY_CHECKLIST.md +0 -275
- package/one/events/ACCESSIBILITY_FIXES_SUMMARY.md +0 -293
- package/one/events/ALIGNMENT_REPORT_PROBLEM_SOLVER.md +0 -335
- package/one/events/ALIGNMENT_SUMMARY.md +0 -280
- package/one/events/API_ROUTES_FIXES_SUMMARY.md +0 -280
- package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +0 -654
- package/one/events/AUDIT-ONTOLOGY-ALIGNMENT.md +0 -598
- package/one/events/AUDIT_PLAN_COMPLETION-20251108-125555.md +0 -262
- package/one/events/BEFORE_AFTER_COMPARISON.md +0 -978
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +0 -372
- package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +0 -430
- package/one/events/CHARTS-READY-TO-USE-20251106-080939.md +0 -184
- package/one/events/CHARTS-SUMMARY-20251106-080938.md +0 -196
- package/one/events/CLAUDE copy.md +0 -897
- package/one/events/CLEANUP-RELEASE-V2.0.8.md +0 -308
- package/one/events/CLOUDFLARE-FS-FIX-20251106-100516.md +0 -75
- package/one/events/COMPONENT_SHOWCASE-20251106-080938.md +0 -629
- package/one/events/CONNECTIONS_DEMO.md +0 -519
- package/one/events/CREATE-WEBSITE.md +0 -460
- package/one/events/CRITICAL-FIXES-COMPLETE.md +0 -571
- package/one/events/CUSTOM-DOMAIN.md +0 -375
- package/one/events/DELIVERABLES.md +0 -450
- package/one/events/DELIVERABLES.txt +0 -273
- package/one/events/DEMO-GROUPS-PAGE.md +0 -410
- package/one/events/DEMO-TESTING-SUMMARY.md +0 -536
- package/one/events/DEMO_COMPONENTS.md +0 -505
- package/one/events/DEMO_HOOKS_INDEX.md +0 -352
- package/one/events/DEMO_INFRASTRUCTURE.md +0 -923
- package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +0 -588
- package/one/events/DEMO_INTEGRATION_CHECKLIST.md +0 -449
- package/one/events/DEMO_QUICK_REFERENCE.md +0 -459
- package/one/events/DEMO_SETUP.md +0 -494
- package/one/events/DEPLOYMENT copy.md +0 -444
- package/one/events/DEPLOYMENT.md +0 -196
- package/one/events/DESIGN-DELIVERABLES-20251106-080938.md +0 -557
- package/one/events/DESIGN-EXECUTIVE-SUMMARY-20251106-080938.md +0 -484
- package/one/events/DOCS-SYSTEM-GUIDE-20251105-142103.md +0 -458
- package/one/events/DOCUMENTER-DELIVERY-SUMMARY.md +0 -481
- package/one/events/DOCUMENTER-EXECUTION-GUIDE.md +0 -394
- package/one/events/DOCUMENTER-TASK-BREAKDOWN.md +0 -783
- package/one/events/ECOMMERCE-BEFORE-AFTER.md +0 -267
- package/one/events/ECOMMERCE-DEMO-PLAN.md +0 -243
- package/one/events/ECOMMERCE-ENHANCEMENTS.md +0 -594
- package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +0 -439
- package/one/events/ECOMMERCE-LIVE-DEMO.md +0 -381
- package/one/events/ECOMMERCE-QUICKSTART.md +0 -376
- package/one/events/ECOMMERCE-README.md +0 -354
- package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +0 -214
- package/one/events/ECOMMERCE-SETUP-SUMMARY.md +0 -414
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +0 -753
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +0 -941
- package/one/events/EFFECT_TS_API_PATTERN.md +0 -496
- package/one/events/EXECUTION-READY.md +0 -359
- package/one/events/EXECUTION-SUMMARY.md +0 -478
- package/one/events/FEATURE-2-4-COMPLETE.md +0 -320
- package/one/events/FEATURE_2_3_COMPLETE.md +0 -593
- package/one/events/FILE-REFERENCE-20251105-142103.md +0 -325
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +0 -241
- package/one/events/GROUPS-MIGRATION.md +0 -643
- package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +0 -432
- package/one/events/HANDOFF.md +0 -331
- package/one/events/HOOKS-DEMO.md +0 -459
- package/one/events/IMPLEMENTATION-CHECKLIST-20251105-142103.md +0 -274
- package/one/events/IMPLEMENTATION-REPORT-DOCS-20251105-142102.md +0 -394
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +0 -568
- package/one/events/IMPLEMENTATION_SUMMARY-20251106-080938.md +0 -571
- package/one/events/IMPLEMENTATION_SUMMARY.md +0 -547
- package/one/events/INDEX-ALL-AGENTS.md +0 -190
- package/one/events/INDEX-FRONTEND-TESTING.md +0 -524
- package/one/events/INDEX-PROBLEM-SOLVER.md +0 -488
- package/one/events/INDEX-QUALITY-AGENT-INFER65.md +0 -455
- package/one/events/INDEX.md +0 -295
- package/one/events/INDEX_QUICK_START_REDESIGN-20251106-080939.md +0 -342
- package/one/events/INSTALL-TESTS.md +0 -311
- package/one/events/INSTALLATION_FOLDERS.md +0 -534
- package/one/events/INSTALLATION_FOLDERS_FILES.md +0 -223
- package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +0 -437
- package/one/events/INTEGRATION-ARCHITECTURE.md +0 -579
- package/one/events/INTEGRATION-CHECKLIST.md +0 -1252
- package/one/events/INTEGRATION-ORCHESTRATION.md +0 -2641
- package/one/events/INTEGRATION-SUMMARY.md +0 -671
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +0 -684
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +0 -660
- package/one/events/LANDING-PAGE-QUICKSTART.md +0 -425
- package/one/events/LICENSE.md +0 -107
- package/one/events/MASTER-COORDINATION-PLAN.md +0 -613
- package/one/events/MASTER-ORCHESTRATION-INFER65.md +0 -441
- package/one/events/MASTER-PLAN-SUMMARY.md +0 -309
- package/one/events/MCP-CONFIGURATION.md +0 -354
- package/one/events/MCP-SETUP-COMPLETE.md +0 -223
- package/one/events/MIGRATION-REPORT.md +0 -453
- package/one/events/MIGRATION.md +0 -87
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +0 -1663
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +0 -643
- package/one/events/NEWS-COMMANDS.md +0 -506
- package/one/events/NEWS-SYSTEM-SUMMARY.md +0 -480
- package/one/events/NODE-UPGRADE.md +0 -129
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +0 -416
- package/one/events/ONTOLOGY-HOOKS-README.md +0 -718
- package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +0 -383
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +0 -569
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +0 -491
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +0 -504
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +0 -221
- package/one/events/PACKAGE-STRUCTURE.md +0 -328
- package/one/events/PLAN-COMPLETE.md +0 -429
- package/one/events/PLAYBOOK-SETUP-SUMMARY.md +0 -349
- package/one/events/PROBLEM-SOLVER-EXECUTIVE-SUMMARY.md +0 -484
- package/one/events/PROBLEM-SOLVER-QUICKSTART.md +0 -420
- package/one/events/PROJECTS-PLAN-SUMMARY.md +0 -480
- package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +0 -585
- package/one/events/QA-CHECKLIST.md +0 -692
- package/one/events/QUALITY-AGENT-SUMMARY.md +0 -334
- package/one/events/QUALITY-EXECUTION-CHECKLIST.md +0 -593
- package/one/events/QUICK-REFERENCE-FRONTEND-TESTING.md +0 -475
- package/one/events/QUICK-START-ONTOLOGY.md +0 -426
- package/one/events/QUICK_START_REDESIGN-20251106-080938.md +0 -400
- package/one/events/README-PROBLEM-SOLVER.md +0 -394
- package/one/events/README-archived.md +0 -537
- package/one/events/README_QUICK_START_REDESIGN-20251106-080938.md +0 -484
- package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +0 -657
- package/one/events/SEARCH_DEMO_DELIVERY.md +0 -433
- package/one/events/SEARCH_DEMO_SUMMARY.md +0 -321
- package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +0 -399
- package/one/events/SECURITY-AUDIT-FIXES.md +0 -394
- package/one/events/SECURITY-SCAN-COMPLETE.md +0 -299
- package/one/events/SHOP-BUILD-STATUS.md +0 -132
- package/one/events/SHOP-PREMIUM-UPDATE.md +0 -165
- package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +0 -280
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +0 -317
- package/one/events/SPECIALIST-QUICK-REFERENCE.md +0 -678
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +0 -377
- package/one/events/STRIPE-INTEGRATION.md +0 -432
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +0 -447
- package/one/events/STRIPE-SETUP-GUIDE.md +0 -480
- package/one/events/TEST-PLAN-INDEX.md +0 -364
- package/one/events/TEST-PLAN.md +0 -1435
- package/one/events/TEST-SUMMARY.md +0 -411
- package/one/events/TESTING-DELIVERY.txt +0 -372
- package/one/events/TESTS-QUICK-REF.md +0 -280
- package/one/events/TRANSITIONS-QUICK-START.md +0 -159
- package/one/events/TRANSPARENCY-FIXES.md +0 -293
- package/one/events/TYPESCRIPT_FIXES.md +0 -170
- package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +0 -412
- package/one/events/TYPESCRIPT_FIXES_INDEX.md +0 -359
- package/one/events/VERIFICATION_CHECKLIST-20251106-080938.md +0 -326
- package/one/events/VIEW-TRANSITIONS.md +0 -446
- package/one/events/agent-command-implementation.md +0 -305
- package/one/events/agent-director-enhancement-summary.md +0 -404
- package/one/events/agent-director-routing-update.md +0 -214
- package/one/events/agent-onboard-implementation-summary.md +0 -475
- package/one/events/agent-ontology-alignment-completion.md +0 -263
- package/one/events/ai-integration-complete.md +0 -294
- package/one/events/ai-integration-lessons-learned.md +0 -511
- package/one/events/backend-integration-tests.md +0 -624
- package/one/events/backend-structure-diagram.txt +0 -393
- package/one/events/backend-structure-summary.txt +0 -269
- package/one/events/bullfm-video-podcast-analysis.md +0 -319
- package/one/events/clean-agent-ontology-cleanup-report.md +0 -371
- package/one/events/clean-agent-todo-analysis-summary.md +0 -336
- package/one/events/cloudflare-automation-complete.md +0 -350
- package/one/events/cloudflare-pages-infrastructure-setup.md +0 -282
- package/one/events/contact-page-complete.md +0 -316
- package/one/events/convex-analysis-index.md +0 -322
- package/one/events/convex-structure-analysis.md +0 -718
- package/one/events/creation-instructions-9-todos.md +0 -906
- package/one/events/cycle-3-video-player-port-20251108.md +0 -368
- package/one/events/cycle-3-video-player-port-complete-20251108.md +0 -334
- package/one/events/deployment-installation-folders.md +0 -178
- package/one/events/deployment-ops-summary.md +0 -386
- package/one/events/deployment-verification.md +0 -366
- package/one/events/design-spec-complete.md +0 -226
- package/one/events/documentation-audit-index.md +0 -473
- package/one/events/documentation-audit-summary.md +0 -417
- package/one/events/documentation-improvement-roadmap.md +0 -906
- package/one/events/documentation-standards-compliance-report.md +0 -538
- package/one/events/documentation-updates.md +0 -370
- package/one/events/events.md +0 -563
- package/one/events/fix-product-hydration-20251106.md +0 -211
- package/one/events/frontend-effects-complete.md +0 -584
- package/one/events/frontend-effects-orchestration.md +0 -1356
- package/one/events/frontend-effects-risk-register.md +0 -1055
- package/one/events/frontend-effects-week1-assignments.md +0 -1594
- package/one/events/hook-ontology-alignment-summary.md +0 -528
- package/one/events/installation-folders-workflow-integration.md +0 -458
- package/one/events/landing-page-generator.md +0 -476
- package/one/events/legal-assessment-2025-10-16.md +0 -1917
- package/one/events/master-coordination-plan.json +0 -1078
- package/one/events/master-plan-9-todos.md +0 -900
- package/one/events/mobile-performance-optimization.md +0 -179
- package/one/events/onboarding-implementation-complete.md +0 -523
- package/one/events/ontology-audit-agent-clone.md +0 -323
- package/one/events/ontology-test-examples.md +0 -580
- package/one/events/phase1-backend-implementation-complete.md +0 -536
- package/one/events/plan-completion-audit.md +0 -707
- package/one/events/plan-files-updated.md +0 -273
- package/one/events/production-readiness-plan.md +0 -389
- package/one/events/readme.md +0 -100
- package/one/events/release.md +0 -272
- package/one/events/root-cleanup-alignment-report.md +0 -265
- package/one/events/security-fixes-2025-01-15.md +0 -226
- package/one/events/separate-implementation-status.md +0 -555
- package/one/events/server-command-optimization-20251108.md +0 -150
- package/one/events/session-summary-2025-10-18.md +0 -366
- package/one/events/skills-complete.md +0 -351
- package/one/events/skills-infer-6-10-summary.md +0 -70
- package/one/events/skills-phase1-complete.md +0 -281
- package/one/events/specialist-assignments.md +0 -766
- package/one/events/structural-analysis-architecture-vs-plans.md +0 -600
- package/one/events/test-dashboard.md +0 -363
- package/one/events/test-index.md +0 -421
- package/one/events/test-report-ontology.md +0 -611
- package/one/events/testing-summary.md +0 -388
- package/one/events/todo-agent-builder.md +0 -1180
- package/one/events/todo-agent-director.md +0 -164
- package/one/events/todo-agent-documenter.md +0 -1815
- package/one/events/todo-agent-frontend.md +0 -1542
- package/one/events/todo-agent-problem-solver.md +0 -1682
- package/one/events/todo-agent-quality.md +0 -1647
- package/one/events/todo-refactoring-complete.md +0 -408
- package/one/events/wave1-backend-implementation-complete.md +0 -698
- package/one/events/web-AI_INTEGRATION_PHASE2_SUMMARY-20251111-152540.md +0 -529
- package/one/events/web-BUY-IN-CHATGPT-README-20251116-235241.md +0 -491
- package/one/events/web-CHARTS-IMPLEMENTATION-20251106-080939.md +0 -576
- package/one/events/web-CHARTS-QUICKSTART-20251106-080939.md +0 -416
- package/one/events/web-CODE-HIGHLIGHTING-SUMMARY-20251111-152540.md +0 -442
- package/one/events/web-DEPLOYMENT_SUMMARY-20251116-005428.md +0 -290
- package/one/events/web-DESIGN-SUMMARY-20251106-080939.md +0 -514
- package/one/events/web-README-AI-INTEGRATION-20251111-152540.md +0 -196
- package/one/events/web-RECHARTS-INTEGRATION-20251111-152540.md +0 -265
- package/one/events/web-RELEASE_OPTIMIZATION_PLAN-20251116-005428.md +0 -447
- package/one/events/web-TEST-CLEANUP-20251105-143205.md +0 -3
- package/one/events/web-USING-ANY-COMPONENT-IN-CHAT-20251111-152540.md +0 -561
- package/one/events/web-test-code-highlighting-20251111-152540.md +0 -231
- package/one/groups/features.md +0 -2904
- package/one/groups/groups.md +0 -587
- package/one/groups/one.md +0 -619
- package/one/groups/strategy-copy.md +0 -887
- package/one/learning/.obsidian/app.json +0 -1
- package/one/learning/.obsidian/appearance.json +0 -1
- package/one/learning/.obsidian/core-plugins.json +0 -33
- package/one/learning/.obsidian/ecommerce-ontology.md +0 -210
- package/one/learning/.obsidian/workspace.json +0 -211
- package/one/learning/100-inference-quick-reference.md +0 -449
- package/one/learning/ag-ui-protocol.md +0 -613
- package/one/learning/agent-onboard-usage.md +0 -630
- package/one/learning/agentic-commerce.md +0 -146
- package/one/learning/ai-agents-vs-memecoins-thesis.md +0 -683
- package/one/learning/ai-api-reference.md +0 -715
- package/one/learning/ai-platform.md +0 -323
- package/one/learning/ai-quickstart.md +0 -355
- package/one/learning/ai-sdk-implementation.md +0 -436
- package/one/learning/ai-token-crypto-analysis-framework.md +0 -1191
- package/one/learning/ai-token-paradigm-shift-2025.md +0 -732
- package/one/learning/altcoin-cycle-prediction-ontology.md +0 -884
- package/one/learning/altcoin-cycle-trading-strategy.md +0 -642
- package/one/learning/architecture-any-backend.md +0 -1589
- package/one/learning/architecture-diagram.md +0 -404
- package/one/learning/architecture-frontend.md +0 -1014
- package/one/learning/architecture.md +0 -1742
- package/one/learning/archived/ontology.old.md +0 -2840
- package/one/learning/astro-effect-complete-vision.md +0 -2148
- package/one/learning/astro-effect-simple-architecture.md +0 -750
- package/one/learning/audit-agent-onboard-alignment.md +0 -481
- package/one/learning/audit-agent-sales-alignment.md +0 -444
- package/one/learning/backend-api-reference.md +0 -728
- package/one/learning/cascading-context-specification.md +0 -1617
- package/one/learning/claude-code-integration.md +0 -1293
- package/one/learning/cli-claude-handoff.md +0 -736
- package/one/learning/context-engineering.md +0 -610
- package/one/learning/crypto-analysis-strategy.md +0 -1276
- package/one/learning/crypto-cycle-2024-2025-analysis.md +0 -44
- package/one/learning/crypto.md +0 -978
- package/one/learning/develop/design.md +0 -364
- package/one/learning/develop/index.md +0 -145
- package/one/learning/development-commands.md +0 -251
- package/one/learning/docs.md +0 -627
- package/one/learning/dsl.md +0 -1678
- package/one/learning/event-driven-documentation.md +0 -270
- package/one/learning/files.md +0 -2489
- package/one/learning/frontend.md +0 -1056
- package/one/learning/games-english.md +0 -691
- package/one/learning/games.md +0 -1082
- package/one/learning/generative-ui-patterns.md +0 -559
- package/one/learning/guidelines.md +0 -314
- package/one/learning/hono.md +0 -2127
- package/one/learning/implementation-examples.md +0 -2554
- package/one/learning/installation-folders.md +0 -366
- package/one/learning/institutional-cycle-paradigm-2025.md +0 -555
- package/one/learning/knowledge.md +0 -660
- package/one/learning/language.md +0 -998
- package/one/learning/lessons-learned.md +0 -378
- package/one/learning/lessons-website-building-focus.md +0 -382
- package/one/learning/merge-report.md +0 -254
- package/one/learning/metadata-system.md +0 -504
- package/one/learning/nine-padel-playbook.md +0 -229
- package/one/learning/one-protocol-ai-agents.md +0 -892
- package/one/learning/one-protocol-executive-report.md +0 -617
- package/one/learning/one-protocol-standard.md +0 -869
- package/one/learning/one-protocol-whitepaper.md +0 -756
- package/one/learning/ontology-blog.yaml +0 -47
- package/one/learning/ontology-cheatsheet.md +0 -617
- package/one/learning/ontology-community.yaml +0 -65
- package/one/learning/ontology-core-universal.md +0 -740
- package/one/learning/ontology-core.yaml +0 -63
- package/one/learning/ontology-courses.yaml +0 -76
- package/one/learning/ontology-creator.md +0 -402
- package/one/learning/ontology-crypto.md +0 -1603
- package/one/learning/ontology-developer-guide.md +0 -814
- package/one/learning/ontology-documentation.md +0 -377
- package/one/learning/ontology-ecommerce.md +0 -269
- package/one/learning/ontology-education-game.md +0 -1654
- package/one/learning/ontology-education.md +0 -938
- package/one/learning/ontology-engineering-specification.md +0 -1310
- package/one/learning/ontology-engineering.md +0 -1676
- package/one/learning/ontology-files.yaml +0 -525
- package/one/learning/ontology-frontend-master.md +0 -2898
- package/one/learning/ontology-frontend-specifications.md +0 -2196
- package/one/learning/ontology-frontend.md +0 -2475
- package/one/learning/ontology-index.md +0 -397
- package/one/learning/ontology-minimal.yaml +0 -301
- package/one/learning/ontology-portfolio.yaml +0 -45
- package/one/learning/ontology-quickstart.md +0 -602
- package/one/learning/ontology-release.md +0 -317
- package/one/learning/ontology-shop.yaml +0 -148
- package/one/learning/ontology-tokens.yaml +0 -51
- package/one/learning/ontology-tutorial.md +0 -455
- package/one/learning/ontology-v2.md +0 -4449
- package/one/learning/ontology-video-script.md +0 -939
- package/one/learning/ontology-visual-guide.md +0 -378
- package/one/learning/ontology.md +0 -3847
- package/one/learning/ontology.yaml +0 -1653
- package/one/learning/parallel-agents.md +0 -932
- package/one/learning/patterns/backend/convex-mutation-pattern.md +0 -130
- package/one/learning/patterns/backend/convex-query-pattern.md +0 -143
- package/one/learning/patterns/backend/mutation-template.md +0 -249
- package/one/learning/patterns/backend/query-template.md +0 -286
- package/one/learning/patterns/backend/service-template.md +0 -258
- package/one/learning/patterns/design/component-architecture.md +0 -435
- package/one/learning/patterns/design/index.md +0 -160
- package/one/learning/patterns/design/test-driven-design-pattern.md +0 -196
- package/one/learning/patterns/design/wireframe-template.md +0 -250
- package/one/learning/patterns/frontend/component-template.md +0 -246
- package/one/learning/patterns/frontend/form-template.md +0 -348
- package/one/learning/patterns/frontend/page-template.md +0 -209
- package/one/learning/patterns/frontend/react-component-pattern.md +0 -188
- package/one/learning/patterns/test/acceptance-criteria-template.md +0 -396
- package/one/learning/patterns/test/technical-test-template.md +0 -566
- package/one/learning/patterns/test/test-driven-pattern.md +0 -160
- package/one/learning/patterns/test/user-flow-template.md +0 -272
- package/one/learning/performance.md +0 -459
- package/one/learning/provider-agnostic-content.md +0 -995
- package/one/learning/provider-creation-guide.md +0 -1082
- package/one/learning/quality-loop.md +0 -419
- package/one/learning/quick-start-ontology-mapping.md +0 -773
- package/one/learning/readme-architecture.md +0 -158
- package/one/learning/readme.md +0 -149
- package/one/learning/rules.md +0 -644
- package/one/learning/score.md +0 -85
- package/one/learning/specifications.md +0 -873
- package/one/learning/tags.md +0 -148
- package/one/learning/todo-template.md +0 -269
- package/one/learning/todo.md +0 -269
- package/one/learning/troubleshooting.md +0 -434
- package/one/learning/typescript-patterns.md +0 -321
- package/one/learning/universal-generation-language.md +0 -827
- package/one/learning/x402-research.md +0 -104
- package/one/license.md +0 -107
- package/one/paths/a2a.md +0 -600
- package/one/paths/acp.md +0 -808
- package/one/paths/acps.md +0 -749
- package/one/paths/agentkit.md +0 -367
- package/one/paths/agui.md +0 -785
- package/one/paths/any-backend.md +0 -1720
- package/one/paths/ap2.md +0 -1072
- package/one/paths/api/queries-reference.md +0 -860
- package/one/paths/api-docs.md +0 -1909
- package/one/paths/api-reference.md +0 -1029
- package/one/paths/api.md +0 -2208
- package/one/paths/architecture-diagram.md +0 -112
- package/one/paths/communications.md +0 -467
- package/one/paths/connections.md +0 -357
- package/one/paths/copilotkit.md +0 -1577
- package/one/paths/cryptonetworks.md +0 -799
- package/one/paths/documentation.md +0 -1138
- package/one/paths/effect.md +0 -297
- package/one/paths/elizaos.md +0 -1308
- package/one/paths/groups.md +0 -814
- package/one/paths/inference.md +0 -76
- package/one/paths/integration-examples.md +0 -893
- package/one/paths/integration-guide.md +0 -887
- package/one/paths/integration-phase2.md +0 -754
- package/one/paths/kyc.md +0 -650
- package/one/paths/mcp.md +0 -860
- package/one/paths/membership.md +0 -1170
- package/one/paths/middleware.md +0 -1085
- package/one/paths/multitenant.md +0 -1359
- package/one/paths/n8n.md +0 -1033
- package/one/paths/patterns.md +0 -107
- package/one/paths/protocols.md +0 -297
- package/one/paths/relationships.md +0 -125
- package/one/paths/schema.md +0 -605
- package/one/paths/service-layer.md +0 -568
- package/one/paths/vectors.md +0 -225
- package/one/paths/wordpress.md +0 -1320
- package/one/paths/workflow-copy.md +0 -923
- package/one/paths/workflow-examples.md +0 -759
- package/one/paths/workflow-onboarding.md +0 -701
- package/one/paths/workflow.md +0 -923
- package/one/paths/workflows/delegation.md +0 -903
- package/one/paths/workflows/frontend.md +0 -1055
- package/one/paths/workflows/strategy.md +0 -921
- package/one/paths/workflows/tasks.md +0 -716
- package/one/paths/x402-baazar.md +0 -131
- package/one/paths/x402.md +0 -1353
- package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
- package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
- package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
- package/one/things/CHECKLIST.md +0 -407
- package/one/things/IMPLEMENTATION_STATUS.md +0 -379
- package/one/things/ONE.md +0 -529
- package/one/things/agents/agent-backend.md +0 -1501
- package/one/things/agents/agent-builder.md +0 -1064
- package/one/things/agents/agent-clean.md +0 -1112
- package/one/things/agents/agent-clone.md +0 -1324
- package/one/things/agents/agent-deploy.md +0 -986
- package/one/things/agents/agent-designer.md +0 -2305
- package/one/things/agents/agent-director.md +0 -1526
- package/one/things/agents/agent-documenter.md +0 -1129
- package/one/things/agents/agent-frontend.md +0 -1201
- package/one/things/agents/agent-integrator.md +0 -1269
- package/one/things/agents/agent-lawyer.md +0 -1371
- package/one/things/agents/agent-problem-solver.md +0 -1457
- package/one/things/agents/agent-quality.md +0 -1483
- package/one/things/agents/agent-sales.md +0 -1074
- package/one/things/cascade/cascade.yaml +0 -481
- package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
- package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
- package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
- package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
- package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
- package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
- package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
- package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
- package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
- package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
- package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
- package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
- package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
- package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
- package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
- package/one/things/cascade/docs/examples/readme.md +0 -259
- package/one/things/cascade/docs/getting-started.md +0 -533
- package/one/things/cascade/docs/workflow.md +0 -1378
- package/one/things/cascade/readme.md +0 -379
- package/one/things/cascade/templates/feature-template.md +0 -289
- package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
- package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
- package/one/things/claude/agents/analyst.md +0 -508
- package/one/things/claude/agents/architect.md +0 -505
- package/one/things/claude/agents/brand-identity-specialist.md +0 -538
- package/one/things/claude/agents/bstp-token-strategist.md +0 -690
- package/one/things/claude/agents/builder-repo.md +0 -532
- package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
- package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
- package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
- package/one/things/claude/agents/company-bullstamp-character.md +0 -602
- package/one/things/claude/agents/company-bullstamp-community.md +0 -307
- package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
- package/one/things/claude/agents/company-bullstamp-token.md +0 -307
- package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
- package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
- package/one/things/claude/agents/content-calendar-planner.md +0 -473
- package/one/things/claude/agents/content-chapter-formatter.md +0 -513
- package/one/things/claude/agents/content-formatter.md +0 -571
- package/one/things/claude/agents/content-hook-specialist.md +0 -485
- package/one/things/claude/agents/content-image-formatter.md +0 -560
- package/one/things/claude/agents/content-introduction-formatter.md +0 -510
- package/one/things/claude/agents/content-multiplication-engine.md +0 -579
- package/one/things/claude/agents/content-playbook-writer.md +0 -473
- package/one/things/claude/agents/content-team-manager.md +0 -647
- package/one/things/claude/agents/content-toc-formatter.md +0 -547
- package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
- package/one/things/claude/agents/core-manager.md +0 -607
- package/one/things/claude/agents/core-master.md +0 -426
- package/one/things/claude/agents/cross-functional-manager.md +0 -476
- package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
- package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
- package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
- package/one/things/claude/agents/crypto-community-analyst.md +0 -314
- package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
- package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
- package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
- package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
- package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
- package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
- package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
- package/one/things/claude/agents/crypto-market-researcher.md +0 -307
- package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
- package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
- package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
- package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
- package/one/things/claude/agents/crypto-team-manager.md +0 -392
- package/one/things/claude/agents/crypto-token-analyst.md +0 -319
- package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
- package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
- package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
- package/one/things/claude/agents/customer-journey-designer.md +0 -474
- package/one/things/claude/agents/customer-success-manager.md +0 -574
- package/one/things/claude/agents/dev.md +0 -406
- package/one/things/claude/agents/documenter.md +0 -548
- package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
- package/one/things/claude/agents/engagement-specialist.md +0 -502
- package/one/things/claude/agents/engineering-architect.md +0 -387
- package/one/things/claude/agents/engineering-business-analyst.md +0 -527
- package/one/things/claude/agents/engineering-developer.md +0 -386
- package/one/things/claude/agents/engineering-director.md +0 -322
- package/one/things/claude/agents/engineering-ingestor.md +0 -659
- package/one/things/claude/agents/engineering-product-manager.md +0 -525
- package/one/things/claude/agents/engineering-product-owner.md +0 -527
- package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
- package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
- package/one/things/claude/agents/engineering-team-manager.md +0 -515
- package/one/things/claude/agents/engineering-user-experience.md +0 -386
- package/one/things/claude/agents/framework-elevate-manager.md +0 -309
- package/one/things/claude/agents/improver.md +0 -805
- package/one/things/claude/agents/intelligence-team-manager.md +0 -390
- package/one/things/claude/agents/lead-capture-expert.md +0 -459
- package/one/things/claude/agents/lead-magnet-creator.md +0 -446
- package/one/things/claude/agents/market-research-analyst.md +0 -435
- package/one/things/claude/agents/marketing-brand-identity.md +0 -344
- package/one/things/claude/agents/marketing-content-hooks.md +0 -455
- package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
- package/one/things/claude/agents/marketing-content-poster.md +0 -372
- package/one/things/claude/agents/marketing-customer-journey.md +0 -331
- package/one/things/claude/agents/marketing-director.md +0 -402
- package/one/things/claude/agents/marketing-engagement.md +0 -331
- package/one/things/claude/agents/marketing-lead-capture.md +0 -331
- package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
- package/one/things/claude/agents/marketing-network-effects.md +0 -331
- package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
- package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
- package/one/things/claude/agents/marketing-team-manager.md +0 -451
- package/one/things/claude/agents/marketing-viral-growth.md +0 -232
- package/one/things/claude/agents/mission-commander.md +0 -378
- package/one/things/claude/agents/network-effect-analyst.md +0 -604
- package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
- package/one/things/claude/agents/npx.md +0 -946
- package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
- package/one/things/claude/agents/one-master.md +0 -378
- package/one/things/claude/agents/one-orchestrator.md +0 -345
- package/one/things/claude/agents/one.md +0 -658
- package/one/things/claude/agents/playbook-generator.md +0 -526
- package/one/things/claude/agents/pm.md +0 -349
- package/one/things/claude/agents/po.md +0 -370
- package/one/things/claude/agents/qa.md +0 -361
- package/one/things/claude/agents/research-foundation-analyst.md +0 -324
- package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
- package/one/things/claude/agents/research-market-analyst.md +0 -324
- package/one/things/claude/agents/research-team-manager.md +0 -489
- package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
- package/one/things/claude/agents/sales-team-manager.md +0 -407
- package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
- package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
- package/one/things/claude/agents/service-advocacy-manager.md +0 -324
- package/one/things/claude/agents/service-success-manager.md +0 -324
- package/one/things/claude/agents/service-team-manager.md +0 -405
- package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
- package/one/things/claude/agents/share-optimization-specialist.md +0 -576
- package/one/things/claude/agents/sm.md +0 -352
- package/one/things/claude/agents/story-teller.md +0 -498
- package/one/things/claude/agents/task-master.md +0 -621
- package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
- package/one/things/claude/agents/tester.md +0 -595
- package/one/things/claude/agents/the-bull-character-manager.md +0 -603
- package/one/things/claude/agents/tools-playbook-generator.md +0 -492
- package/one/things/claude/agents/turbo-repo-builder.md +0 -346
- package/one/things/claude/agents/upsell-strategist.md +0 -503
- package/one/things/claude/agents/ux-expert.md +0 -360
- package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
- package/one/things/claude/claude-code-hooks-development.json +0 -21
- package/one/things/claude/claude-code-hooks-production.json +0 -21
- package/one/things/claude/claude-code-hooks.json +0 -25
- package/one/things/claude/commands/agent.md +0 -124
- package/one/things/claude/commands/cascade-status.md +0 -153
- package/one/things/claude/commands/ingest.md +0 -343
- package/one/things/claude/commands/ingestor.md +0 -158
- package/one/things/claude/commands/mission.md +0 -103
- package/one/things/claude/commands/npx.md +0 -156
- package/one/things/claude/commands/one.md +0 -486
- package/one/things/claude/commands/quality-check.md +0 -252
- package/one/things/claude/commands/smart-route.md +0 -261
- package/one/things/claude/commands/start.md +0 -139
- package/one/things/claude/commands/story.md +0 -103
- package/one/things/claude/commands/task.md +0 -193
- package/one/things/claude/hook-bypass.json +0 -32
- package/one/things/claude/hooks/agent-hook-config.json +0 -427
- package/one/things/claude/hooks/build-hook.sh +0 -156
- package/one/things/claude/hooks/cleanup-hook.sh +0 -201
- package/one/things/claude/hooks/file-organization-hook.sh +0 -80
- package/one/things/claude/hooks/format-hook.sh +0 -43
- package/one/things/claude/hooks/hook-bypass.sh +0 -293
- package/one/things/claude/hooks/hook-debouncer.sh +0 -62
- package/one/things/claude/hooks/hook-logger.sh +0 -89
- package/one/things/claude/hooks/lint-hook.sh +0 -140
- package/one/things/claude/hooks/notification-hook.sh +0 -204
- package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
- package/one/things/claude/hooks/performance-metrics.json +0 -25
- package/one/things/claude/hooks/security-hook.sh +0 -256
- package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
- package/one/things/claude/hooks/story-validation-hook.sh +0 -145
- package/one/things/claude/hooks/test-hook.sh +0 -145
- package/one/things/claude/hooks/test-story-validation.sh +0 -170
- package/one/things/claude/settings-local.json +0 -86
- package/one/things/cli/cli-code.md +0 -677
- package/one/things/cli/cli-compiler-code.md +0 -677
- package/one/things/cli/cli.md +0 -871
- package/one/things/components/card-shadcn.md +0 -953
- package/one/things/components/card.md +0 -1041
- package/one/things/components.md +0 -1743
- package/one/things/componets.md +0 -19
- package/one/things/contracts/Move.toml +0 -12
- package/one/things/contracts/README.md +0 -288
- package/one/things/contracts/one.move +0 -762
- package/one/things/contracts/sdk.ts +0 -579
- package/one/things/creator-diagram.md +0 -184
- package/one/things/crypto/FEATURES.md +0 -78
- package/one/things/crypto/ONECORE.md +0 -62
- package/one/things/crypto/ONECOREFAQ.md +0 -22
- package/one/things/crypto/ONECOREHOW.md +0 -46
- package/one/things/crypto/ONEENTERPRISE.md +0 -64
- package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
- package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
- package/one/things/crypto/ONEPRO.md +0 -60
- package/one/things/crypto/ONEPROFAQ.md +0 -22
- package/one/things/crypto/ONEPROHOW.md +0 -53
- package/one/things/crypto/READMEAGENCY.md +0 -64
- package/one/things/crypto/VSL.md +0 -45
- package/one/things/crypto/WebsiteCopy.md +0 -176
- package/one/things/demo-accessibility-animations.md +0 -1025
- package/one/things/demo-components.md +0 -1310
- package/one/things/demo-design-summary.md +0 -692
- package/one/things/demo-design-system.md +0 -973
- package/one/things/demo-page-layouts.md +0 -1016
- package/one/things/design-system.md +0 -832
- package/one/things/designs/accessibility-audit.md +0 -877
- package/one/things/designs/component-specifications.md +0 -855
- package/one/things/designs/design-overview.md +0 -377
- package/one/things/designs/design-tokens.md +0 -448
- package/one/things/designs/wireframes-dashboard.md +0 -710
- package/one/things/docs/api-requests.md +0 -987
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
- package/one/things/docs/ecommerce/QUICK-START.md +0 -405
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
- package/one/things/docs/ecommerce/demo.astro +0 -309
- package/one/things/examples/children/lemonade-stand.md +0 -404
- package/one/things/examples/enterprise/crm-saas.md +0 -1444
- package/one/things/features/1-1-agent-prompts.md +0 -562
- package/one/things/features/1-2-yaml-orchestrator.md +0 -548
- package/one/things/features/1-3-event-coordination.md +0 -547
- package/one/things/features/1-4-knowledge-management.md +0 -652
- package/one/things/features/1-5-quality-loops.md +0 -725
- package/one/things/features/1-6-numbering-structure.md +0 -639
- package/one/things/features/2-1-dataprovider-interface.md +0 -2583
- package/one/things/features/2-2-config-system.md +0 -3242
- package/one/things/features/2-3-effectts-services.md +0 -1645
- package/one/things/features/2-4-react-hooks.md +0 -2136
- package/one/things/features/2-5-auth-migration.md +0 -2144
- package/one/things/features/2-6-dashboard-migration.md +0 -2084
- package/one/things/features/2-7-alternative-providers.md +0 -2578
- package/one/things/features/2-7-implementation-report.md +0 -724
- package/one/things/features/2-cli.md +0 -1720
- package/one/things/features/2-design.md +0 -1770
- package/one/things/features/2-tests.md +0 -576
- package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
- package/one/things/features/DECOUPLING.md +0 -290
- package/one/things/features/DEPLOYMENT.md +0 -470
- package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
- package/one/things/features/improve.md +0 -861
- package/one/things/features/remove-convex-deps.md +0 -63
- package/one/things/features/top-features.md +0 -87
- package/one/things/features/use-one-backend.md +0 -1217
- package/one/things/features-in-english.md +0 -200
- package/one/things/files.yaml +0 -721
- package/one/things/ideas/1-create-workflow.md +0 -207
- package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
- package/one/things/implementation/backend-guide.md +0 -457
- package/one/things/interface.md +0 -257
- package/one/things/landing-page-implementation.md +0 -455
- package/one/things/legal/README.md +0 -234
- package/one/things/legal/privacy-policy.md +0 -1227
- package/one/things/legal/terms-of-service.md +0 -1432
- package/one/things/master-workflow-plan.md +0 -806
- package/one/things/pay.one.ie.md +0 -53
- package/one/things/plans/0-in-sync.md +0 -136
- package/one/things/plans/0-timeline.md +0 -36
- package/one/things/plans/1-create-workflow.md +0 -732
- package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
- package/one/things/plans/README-SIMPLIFICATION.md +0 -349
- package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
- package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
- package/one/things/plans/ai-elements-integration.md +0 -483
- package/one/things/plans/ai-elements.md +0 -1278
- package/one/things/plans/ai-integration-plan.md +0 -263
- package/one/things/plans/ai-integration.md +0 -996
- package/one/things/plans/ai-sdk.md +0 -798
- package/one/things/plans/ai-tools.md +0 -621
- package/one/things/plans/app.md +0 -832
- package/one/things/plans/architecture-summary.md +0 -312
- package/one/things/plans/async-ai-agents.md +0 -233
- package/one/things/plans/backend-agnostic-frontend.md +0 -390
- package/one/things/plans/backend-cleanup-quickstart.md +0 -380
- package/one/things/plans/backend-ontology-conformance.md +0 -475
- package/one/things/plans/backend-status.md +0 -599
- package/one/things/plans/backend-structure.md +0 -847
- package/one/things/plans/backend-target-structure.md +0 -482
- package/one/things/plans/backend.md +0 -1175
- package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
- package/one/things/plans/better-auth-any-backend.md +0 -1896
- package/one/things/plans/better-auth-available-features.md +0 -273
- package/one/things/plans/big-plan.md +0 -52
- package/one/things/plans/cli-updates-required.md +0 -320
- package/one/things/plans/complete-step-by-step.md +0 -1409
- package/one/things/plans/components.md +0 -709
- package/one/things/plans/convex-agents.md +0 -1034
- package/one/things/plans/convex-better-auth.md +0 -1141
- package/one/things/plans/convex-on-off.md +0 -407
- package/one/things/plans/crypto-token-researcher.md +0 -629
- package/one/things/plans/data-quality-metrics.md +0 -745
- package/one/things/plans/deep-researcher-agent.md +0 -466
- package/one/things/plans/deploy-to-cloudflare.md +0 -623
- package/one/things/plans/deployment-architecture.md +0 -469
- package/one/things/plans/desktop.md +0 -1139
- package/one/things/plans/development-plan.md +0 -1283
- package/one/things/plans/development-workflow-tldr.md +0 -207
- package/one/things/plans/development-workflow.md +0 -959
- package/one/things/plans/dsl-claude-code.md +0 -1011
- package/one/things/plans/effect-components.md +0 -1743
- package/one/things/plans/effect-patterns-reference.md +0 -2235
- package/one/things/plans/effect.md +0 -1806
- package/one/things/plans/email.md +0 -966
- package/one/things/plans/enhance-auth.md +0 -1692
- package/one/things/plans/execution-strategy.md +0 -1291
- package/one/things/plans/existing-infrastructure.md +0 -712
- package/one/things/plans/feature-based-sites.md +0 -894
- package/one/things/plans/frontend-effects.md +0 -1276
- package/one/things/plans/group-folder-multi-tenancy.md +0 -893
- package/one/things/plans/improve-codebase.md +0 -1811
- package/one/things/plans/install-components.md +0 -215
- package/one/things/plans/integrate-frontend-and-backend.md +0 -603
- package/one/things/plans/landing.md +0 -820
- package/one/things/plans/layout.md +0 -249
- package/one/things/plans/mail-backend.md +0 -1361
- package/one/things/plans/mail.md +0 -2677
- package/one/things/plans/mcp-clear-context-prompt.md +0 -81
- package/one/things/plans/mcp-simple.md +0 -248
- package/one/things/plans/multi-ontology-architecture.md +0 -885
- package/one/things/plans/next-features.md +0 -114
- package/one/things/plans/npx-agent-safety.md +0 -785
- package/one/things/plans/npx-agent.md +0 -1089
- package/one/things/plans/onboarding.md +0 -51
- package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
- package/one/things/plans/one.md +0 -677
- package/one/things/plans/ontology-6-dimensions.md +0 -2201
- package/one/things/plans/ontology-compliance-audit.md +0 -342
- package/one/things/plans/ontology-driven-strategy.md +0 -882
- package/one/things/plans/ontology-refine.md +0 -586
- package/one/things/plans/ontology-ui-approach.md +0 -375
- package/one/things/plans/open-agent.md +0 -840
- package/one/things/plans/performace.md +0 -122
- package/one/things/plans/phase-1-foundation.md +0 -620
- package/one/things/plans/phase-3-implementation.md +0 -1037
- package/one/things/plans/plan-connect-to-api.md +0 -146
- package/one/things/plans/quick-wins.md +0 -1428
- package/one/things/plans/r2.md +0 -777
- package/one/things/plans/readme-backend-cleanup.md +0 -402
- package/one/things/plans/release.md +0 -507
- package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
- package/one/things/plans/repos.md +0 -98
- package/one/things/plans/separate-copy-2.md +0 -1349
- package/one/things/plans/separate-copy-3.md +0 -2479
- package/one/things/plans/separate-copy.md +0 -1349
- package/one/things/plans/separate-demo.md +0 -864
- package/one/things/plans/separate.md +0 -1999
- package/one/things/plans/sequence.md +0 -2040
- package/one/things/plans/shadcn-integration-summary.md +0 -510
- package/one/things/plans/sidebar.md +0 -206
- package/one/things/plans/skills.md +0 -709
- package/one/things/plans/small-fixes.md +0 -23
- package/one/things/plans/start-new.md +0 -764
- package/one/things/plans/switch-off-auth.md +0 -42
- package/one/things/plans/sync-checklist.md +0 -351
- package/one/things/plans/test-backend-connection.md +0 -514
- package/one/things/plans/unified-implementation-plan.md +0 -934
- package/one/things/plans/update-demos.md +0 -581
- package/one/things/plans/use-our-backend.md +0 -572
- package/one/things/plans/video-backend.md +0 -638
- package/one/things/plans/video-frontend.md +0 -490
- package/one/things/plans/video-old-archived.md +0 -656
- package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
- package/one/things/plans/wave1-onboarding-vision.md +0 -744
- package/one/things/plans/wave1-orchestration-summary.md +0 -604
- package/one/things/plans/wave1-specialist-assignments.md +0 -1413
- package/one/things/plans/workflow-files.md +0 -1210
- package/one/things/plans/workflow.md +0 -1378
- package/one/things/plans-u.md +0 -905
- package/one/things/products/Blockchain Products.md +0 -6278
- package/one/things/products/cascade-landing-page.md +0 -841
- package/one/things/products/cascade.md +0 -1568
- package/one/things/products/context-engineering.md +0 -1488
- package/one/things/products/onthology.md +0 -15
- package/one/things/products/ontology-ui-shadcn.md +0 -1302
- package/one/things/products/ontology-ui.md +0 -1429
- package/one/things/products/ontology.md +0 -789
- package/one/things/products/sdk.md +0 -573
- package/one/things/promptkit.md +0 -930
- package/one/things/repos/all-repos.md +0 -0
- package/one/things/scripts-clean-mac.sh +0 -409
- package/one/things/service-providers-new.md +0 -1052
- package/one/things/service-providers.md +0 -1121
- package/one/things/structure.md +0 -532
- package/one/things/system.md +0 -618
- package/one/things/templates.md +0 -294
- package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
- package/one/things/tests/2-1-test-analysis.md +0 -544
- package/one/things/things.md +0 -384
- package/one/things/todo-acp-integration.md +0 -744
- package/one/things/todo-ai.md +0 -933
- package/one/things/todo-api.md +0 -1078
- package/one/things/todo-assignment.md +0 -580
- package/one/things/todo-buy-chatgpt.md +0 -1450
- package/one/things/todo-components.md +0 -1683
- package/one/things/todo-connections.md +0 -278
- package/one/things/todo-ecommerce-frontend.md +0 -1313
- package/one/things/todo-ecommerce.md +0 -569
- package/one/things/todo-effects.md +0 -1075
- package/one/things/todo-frontend-effects.md +0 -977
- package/one/things/todo-landing-page.md +0 -1091
- package/one/things/todo-mail.md +0 -1160
- package/one/things/todo-master-plan.md +0 -490
- package/one/things/todo-onboard.md +0 -666
- package/one/things/todo-one-ie.md +0 -538
- package/one/things/todo-page.md +0 -606
- package/one/things/todo-plans.md +0 -282
- package/one/things/todo-projects.md +0 -241
- package/one/things/todo-refactoring-plan.md +0 -366
- package/one/things/todo-release.md +0 -654
- package/one/things/todo-sequence.md +0 -1621
- package/one/things/todo-use-our-backend.md +0 -1908
- package/one/things/todo-workflow.md +0 -626
- package/one/things/todo-x402.md +0 -2047
- package/one/things/todo.md +0 -21
- package/one/things/video/scripts-crypto.md +0 -835
- package/one/things/video-script-backup.md +0 -318
- package/one/things/video-script-demo.md +0 -382
- package/one/things/video-script-ontology.md +0 -333
- package/one/things/video-script.md +0 -361
|
@@ -1,2583 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 2 1 Dataprovider Interface
|
|
3
|
-
dimension: things
|
|
4
|
-
category: features
|
|
5
|
-
tags: ai, architecture, backend, frontend, ontology
|
|
6
|
-
related_dimensions: events, groups
|
|
7
|
-
scope: global
|
|
8
|
-
created: 2025-11-03
|
|
9
|
-
updated: 2025-11-03
|
|
10
|
-
version: 1.0.0
|
|
11
|
-
ai_context: |
|
|
12
|
-
This document is part of the things dimension in the features category.
|
|
13
|
-
Location: one/things/features/2-1-dataprovider-interface.md
|
|
14
|
-
Purpose: Documents feature 2-1: dataprovider interface & convexprovider
|
|
15
|
-
Related dimensions: events, groups
|
|
16
|
-
For AI agents: Read this to understand 2 1 dataprovider interface.
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# Feature 2-1: DataProvider Interface & ConvexProvider
|
|
20
|
-
|
|
21
|
-
**Feature ID:** `feature_2_1_dataprovider_interface`
|
|
22
|
-
**Plan:** `plan_2_backend_agnostic_frontend`
|
|
23
|
-
**Owner:** Backend Specialist
|
|
24
|
-
**Status:** Detailed Specification Complete
|
|
25
|
-
**Priority:** P0 (Critical Path - Blocks All Other Features)
|
|
26
|
-
**Effort:** 1 week
|
|
27
|
-
**Dependencies:** None
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Assignment
|
|
32
|
-
|
|
33
|
-
This feature implements the **DataProvider interface** and **ConvexProvider implementation** that abstracts all backend operations behind a clean, typed API. This is the foundation for backend-agnostic frontend architecture.
|
|
34
|
-
|
|
35
|
-
**Goal:** Create a single interface that handles ALL 6-dimension ontology operations, allowing the frontend to remain completely decoupled from Convex-specific APIs.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 1. Complete Technical Specification
|
|
40
|
-
|
|
41
|
-
### 1.1 DataProvider Interface
|
|
42
|
-
|
|
43
|
-
Complete TypeScript interface covering all 6 dimensions of the ontology:
|
|
44
|
-
|
|
45
|
-
```typescript
|
|
46
|
-
// frontend/src/providers/DataProvider.ts
|
|
47
|
-
import { Effect } from "effect";
|
|
48
|
-
import { Id } from "@/convex/_generated/dataModel";
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* DataProvider Interface - Complete abstraction over backend operations
|
|
52
|
-
*
|
|
53
|
-
* This interface represents the SINGLE source of truth for all data operations
|
|
54
|
-
* in the ONE platform. ANY backend can implement this interface.
|
|
55
|
-
*
|
|
56
|
-
* Design Principles:
|
|
57
|
-
* 1. Effect.ts-based error handling (typed errors)
|
|
58
|
-
* 2. Organization-scoped operations (multi-tenant by default)
|
|
59
|
-
* 3. Immutable operations (pure functions)
|
|
60
|
-
* 4. Type-safe parameters and return values
|
|
61
|
-
* 5. No backend-specific code leaks through this interface
|
|
62
|
-
*/
|
|
63
|
-
export interface DataProvider {
|
|
64
|
-
/**
|
|
65
|
-
* DIMENSION 1: Organizations
|
|
66
|
-
* Multi-tenant isolation boundary - who owns what at org level
|
|
67
|
-
*/
|
|
68
|
-
organizations: {
|
|
69
|
-
/**
|
|
70
|
-
* Get organization by ID
|
|
71
|
-
* @returns Effect that succeeds with Organization or fails with OrganizationNotFoundError
|
|
72
|
-
*/
|
|
73
|
-
get: (
|
|
74
|
-
id: Id<"organizations">,
|
|
75
|
-
) => Effect.Effect<Organization, OrganizationNotFoundError>;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* List organizations (platform owner only)
|
|
79
|
-
* @returns Effect with array of organizations
|
|
80
|
-
*/
|
|
81
|
-
list: (
|
|
82
|
-
params: ListOrganizationsParams,
|
|
83
|
-
) => Effect.Effect<Organization[], Error>;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Create new organization
|
|
87
|
-
* @returns Effect with organization ID
|
|
88
|
-
*/
|
|
89
|
-
create: (
|
|
90
|
-
input: CreateOrganizationInput,
|
|
91
|
-
) => Effect.Effect<Id<"organizations">, Error>;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Update organization settings
|
|
95
|
-
* @returns Effect with updated organization
|
|
96
|
-
*/
|
|
97
|
-
update: (
|
|
98
|
-
id: Id<"organizations">,
|
|
99
|
-
updates: Partial<Organization>,
|
|
100
|
-
) => Effect.Effect<Organization, Error>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Get organization usage stats
|
|
104
|
-
* @returns Effect with usage metrics
|
|
105
|
-
*/
|
|
106
|
-
getUsage: (
|
|
107
|
-
id: Id<"organizations">,
|
|
108
|
-
) => Effect.Effect<OrganizationUsage, Error>;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* DIMENSION 2: People
|
|
113
|
-
* Authorization & governance - who can do what
|
|
114
|
-
*/
|
|
115
|
-
people: {
|
|
116
|
-
/**
|
|
117
|
-
* Get person by ID
|
|
118
|
-
* @returns Effect with Person or PersonNotFoundError
|
|
119
|
-
*/
|
|
120
|
-
get: (id: Id<"people">) => Effect.Effect<Person, PersonNotFoundError>;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* List people in organization
|
|
124
|
-
* @returns Effect with array of people
|
|
125
|
-
*/
|
|
126
|
-
list: (params: ListPeopleParams) => Effect.Effect<Person[], Error>;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Create new person (user)
|
|
130
|
-
* @returns Effect with person ID
|
|
131
|
-
*/
|
|
132
|
-
create: (input: CreatePersonInput) => Effect.Effect<Id<"people">, Error>;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Update person profile
|
|
136
|
-
* @returns Effect with updated person
|
|
137
|
-
*/
|
|
138
|
-
update: (
|
|
139
|
-
id: Id<"people">,
|
|
140
|
-
updates: Partial<Person>,
|
|
141
|
-
) => Effect.Effect<Person, Error>;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Get person's organizations
|
|
145
|
-
* @returns Effect with array of organizations
|
|
146
|
-
*/
|
|
147
|
-
getOrganizations: (
|
|
148
|
-
id: Id<"people">,
|
|
149
|
-
) => Effect.Effect<Organization[], Error>;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Check person's permissions
|
|
153
|
-
* @returns Effect with boolean
|
|
154
|
-
*/
|
|
155
|
-
checkPermission: (
|
|
156
|
-
id: Id<"people">,
|
|
157
|
-
permission: string,
|
|
158
|
-
) => Effect.Effect<boolean, Error>;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* DIMENSION 3: Things
|
|
163
|
-
* All entities - users, agents, content, tokens, courses
|
|
164
|
-
*/
|
|
165
|
-
things: {
|
|
166
|
-
/**
|
|
167
|
-
* Get thing by ID
|
|
168
|
-
* @returns Effect with Thing or ThingNotFoundError
|
|
169
|
-
*/
|
|
170
|
-
get: (id: Id<"things">) => Effect.Effect<Thing, ThingNotFoundError>;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* List things by type and filters
|
|
174
|
-
* @returns Effect with array of things
|
|
175
|
-
*/
|
|
176
|
-
list: (params: ListThingsParams) => Effect.Effect<Thing[], Error>;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Create new thing
|
|
180
|
-
* @returns Effect with thing ID
|
|
181
|
-
*/
|
|
182
|
-
create: (input: CreateThingInput) => Effect.Effect<Id<"things">, Error>;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Update thing
|
|
186
|
-
* @returns Effect with updated thing
|
|
187
|
-
*/
|
|
188
|
-
update: (
|
|
189
|
-
id: Id<"things">,
|
|
190
|
-
updates: Partial<Thing>,
|
|
191
|
-
) => Effect.Effect<Thing, Error>;
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Delete thing (soft delete)
|
|
195
|
-
* @returns Effect with void
|
|
196
|
-
*/
|
|
197
|
-
delete: (id: Id<"things">) => Effect.Effect<void, Error>;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Search things (full-text search)
|
|
201
|
-
* @returns Effect with search results
|
|
202
|
-
*/
|
|
203
|
-
search: (params: SearchThingsParams) => Effect.Effect<Thing[], Error>;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* DIMENSION 4: Connections
|
|
208
|
-
* All relationships - owns, follows, holds_tokens, enrolled_in
|
|
209
|
-
*/
|
|
210
|
-
connections: {
|
|
211
|
-
/**
|
|
212
|
-
* Get connection by ID
|
|
213
|
-
* @returns Effect with Connection or ConnectionNotFoundError
|
|
214
|
-
*/
|
|
215
|
-
get: (
|
|
216
|
-
id: Id<"connections">,
|
|
217
|
-
) => Effect.Effect<Connection, ConnectionNotFoundError>;
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* List connections from a thing
|
|
221
|
-
* @returns Effect with array of connections
|
|
222
|
-
*/
|
|
223
|
-
listFrom: (
|
|
224
|
-
params: ListConnectionsFromParams,
|
|
225
|
-
) => Effect.Effect<Connection[], Error>;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* List connections to a thing
|
|
229
|
-
* @returns Effect with array of connections
|
|
230
|
-
*/
|
|
231
|
-
listTo: (
|
|
232
|
-
params: ListConnectionsToParams,
|
|
233
|
-
) => Effect.Effect<Connection[], Error>;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Create connection between things
|
|
237
|
-
* @returns Effect with connection ID
|
|
238
|
-
*/
|
|
239
|
-
create: (
|
|
240
|
-
input: CreateConnectionInput,
|
|
241
|
-
) => Effect.Effect<Id<"connections">, Error>;
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Update connection metadata
|
|
245
|
-
* @returns Effect with updated connection
|
|
246
|
-
*/
|
|
247
|
-
update: (
|
|
248
|
-
id: Id<"connections">,
|
|
249
|
-
updates: Partial<Connection>,
|
|
250
|
-
) => Effect.Effect<Connection, Error>;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Delete connection
|
|
254
|
-
* @returns Effect with void
|
|
255
|
-
*/
|
|
256
|
-
delete: (id: Id<"connections">) => Effect.Effect<void, Error>;
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* DIMENSION 5: Events
|
|
261
|
-
* All actions - created, updated, purchased, completed
|
|
262
|
-
*/
|
|
263
|
-
events: {
|
|
264
|
-
/**
|
|
265
|
-
* Get event by ID
|
|
266
|
-
* @returns Effect with Event or EventNotFoundError
|
|
267
|
-
*/
|
|
268
|
-
get: (id: Id<"events">) => Effect.Effect<Event, EventNotFoundError>;
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* List events with filters
|
|
272
|
-
* @returns Effect with array of events
|
|
273
|
-
*/
|
|
274
|
-
list: (params: ListEventsParams) => Effect.Effect<Event[], Error>;
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Log new event
|
|
278
|
-
* @returns Effect with event ID
|
|
279
|
-
*/
|
|
280
|
-
log: (input: LogEventInput) => Effect.Effect<Id<"events">, Error>;
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Get event timeline for thing
|
|
284
|
-
* @returns Effect with array of events
|
|
285
|
-
*/
|
|
286
|
-
getTimeline: (thingId: Id<"things">) => Effect.Effect<Event[], Error>;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Get event statistics
|
|
290
|
-
* @returns Effect with event stats
|
|
291
|
-
*/
|
|
292
|
-
getStats: (params: EventStatsParams) => Effect.Effect<EventStats, Error>;
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* DIMENSION 6: Knowledge
|
|
297
|
-
* Labels, embeddings, semantic search
|
|
298
|
-
*/
|
|
299
|
-
knowledge: {
|
|
300
|
-
/**
|
|
301
|
-
* Get knowledge item by ID
|
|
302
|
-
* @returns Effect with Knowledge or KnowledgeNotFoundError
|
|
303
|
-
*/
|
|
304
|
-
get: (
|
|
305
|
-
id: Id<"knowledge">,
|
|
306
|
-
) => Effect.Effect<Knowledge, KnowledgeNotFoundError>;
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* List knowledge items
|
|
310
|
-
* @returns Effect with array of knowledge items
|
|
311
|
-
*/
|
|
312
|
-
list: (params: ListKnowledgeParams) => Effect.Effect<Knowledge[], Error>;
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Create knowledge item (label or chunk)
|
|
316
|
-
* @returns Effect with knowledge ID
|
|
317
|
-
*/
|
|
318
|
-
create: (
|
|
319
|
-
input: CreateKnowledgeInput,
|
|
320
|
-
) => Effect.Effect<Id<"knowledge">, Error>;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Link knowledge to thing
|
|
324
|
-
* @returns Effect with void
|
|
325
|
-
*/
|
|
326
|
-
link: (input: LinkKnowledgeInput) => Effect.Effect<void, Error>;
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Unlink knowledge from thing
|
|
330
|
-
* @returns Effect with void
|
|
331
|
-
*/
|
|
332
|
-
unlink: (
|
|
333
|
-
knowledgeId: Id<"knowledge">,
|
|
334
|
-
thingId: Id<"things">,
|
|
335
|
-
) => Effect.Effect<void, Error>;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Vector search (semantic search)
|
|
339
|
-
* @returns Effect with search results
|
|
340
|
-
*/
|
|
341
|
-
vectorSearch: (
|
|
342
|
-
params: VectorSearchParams,
|
|
343
|
-
) => Effect.Effect<Knowledge[], Error>;
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Type definitions for DataProvider operations
|
|
349
|
-
*/
|
|
350
|
-
|
|
351
|
-
// Organizations
|
|
352
|
-
export interface Organization {
|
|
353
|
-
_id: Id<"organizations">;
|
|
354
|
-
name: string;
|
|
355
|
-
slug: string;
|
|
356
|
-
plan: "starter" | "pro" | "enterprise";
|
|
357
|
-
status: "active" | "suspended" | "trial" | "cancelled";
|
|
358
|
-
limits: {
|
|
359
|
-
users: number;
|
|
360
|
-
storage: number;
|
|
361
|
-
apiCalls: number;
|
|
362
|
-
cycle: number;
|
|
363
|
-
};
|
|
364
|
-
usage: {
|
|
365
|
-
users: number;
|
|
366
|
-
storage: number;
|
|
367
|
-
apiCalls: number;
|
|
368
|
-
cycle: number;
|
|
369
|
-
};
|
|
370
|
-
createdAt: number;
|
|
371
|
-
updatedAt: number;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
export interface ListOrganizationsParams {
|
|
375
|
-
status?: Organization["status"];
|
|
376
|
-
plan?: Organization["plan"];
|
|
377
|
-
limit?: number;
|
|
378
|
-
offset?: number;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
export interface CreateOrganizationInput {
|
|
382
|
-
name: string;
|
|
383
|
-
slug: string;
|
|
384
|
-
plan: Organization["plan"];
|
|
385
|
-
ownerId: Id<"people">;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
export interface OrganizationUsage {
|
|
389
|
-
organizationId: Id<"organizations">;
|
|
390
|
-
users: number;
|
|
391
|
-
storage: number;
|
|
392
|
-
apiCalls: number;
|
|
393
|
-
cycle: number;
|
|
394
|
-
period: { start: number; end: number };
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
// People
|
|
398
|
-
export interface Person {
|
|
399
|
-
_id: Id<"people">;
|
|
400
|
-
email: string;
|
|
401
|
-
username: string;
|
|
402
|
-
displayName: string;
|
|
403
|
-
role: "platform_owner" | "org_owner" | "org_user" | "customer";
|
|
404
|
-
organizationId?: Id<"organizations">;
|
|
405
|
-
permissions?: string[];
|
|
406
|
-
createdAt: number;
|
|
407
|
-
updatedAt: number;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export interface ListPeopleParams {
|
|
411
|
-
organizationId?: Id<"organizations">;
|
|
412
|
-
role?: Person["role"];
|
|
413
|
-
limit?: number;
|
|
414
|
-
offset?: number;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
export interface CreatePersonInput {
|
|
418
|
-
email: string;
|
|
419
|
-
username: string;
|
|
420
|
-
displayName: string;
|
|
421
|
-
role: Person["role"];
|
|
422
|
-
organizationId?: Id<"organizations">;
|
|
423
|
-
permissions?: string[];
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
// Things
|
|
427
|
-
export interface Thing {
|
|
428
|
-
_id: Id<"things">;
|
|
429
|
-
type: ThingType;
|
|
430
|
-
name: string;
|
|
431
|
-
properties: Record<string, any>;
|
|
432
|
-
status: "active" | "inactive" | "draft" | "published" | "archived";
|
|
433
|
-
organizationId?: Id<"organizations">;
|
|
434
|
-
createdAt: number;
|
|
435
|
-
updatedAt: number;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
export type ThingType =
|
|
439
|
-
| "creator"
|
|
440
|
-
| "ai_clone"
|
|
441
|
-
| "course"
|
|
442
|
-
| "lesson"
|
|
443
|
-
| "token"
|
|
444
|
-
| "external_agent"
|
|
445
|
-
| "mandate"
|
|
446
|
-
| "product";
|
|
447
|
-
|
|
448
|
-
export interface ListThingsParams {
|
|
449
|
-
type?: ThingType;
|
|
450
|
-
status?: Thing["status"];
|
|
451
|
-
organizationId?: Id<"organizations">;
|
|
452
|
-
limit?: number;
|
|
453
|
-
offset?: number;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
export interface CreateThingInput {
|
|
457
|
-
type: ThingType;
|
|
458
|
-
name: string;
|
|
459
|
-
properties: Record<string, any>;
|
|
460
|
-
status?: Thing["status"];
|
|
461
|
-
organizationId?: Id<"organizations">;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
export interface SearchThingsParams {
|
|
465
|
-
query: string;
|
|
466
|
-
type?: ThingType;
|
|
467
|
-
organizationId?: Id<"organizations">;
|
|
468
|
-
limit?: number;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
// Connections
|
|
472
|
-
export interface Connection {
|
|
473
|
-
_id: Id<"connections">;
|
|
474
|
-
fromThingId: Id<"things">;
|
|
475
|
-
toThingId: Id<"things">;
|
|
476
|
-
relationshipType: ConnectionType;
|
|
477
|
-
metadata?: Record<string, any>;
|
|
478
|
-
validFrom?: number;
|
|
479
|
-
validTo?: number;
|
|
480
|
-
createdAt: number;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
export type ConnectionType =
|
|
484
|
-
| "owns"
|
|
485
|
-
| "created_by"
|
|
486
|
-
| "clone_of"
|
|
487
|
-
| "holds_tokens"
|
|
488
|
-
| "enrolled_in"
|
|
489
|
-
| "transacted";
|
|
490
|
-
|
|
491
|
-
export interface ListConnectionsFromParams {
|
|
492
|
-
fromThingId: Id<"things">;
|
|
493
|
-
relationshipType?: ConnectionType;
|
|
494
|
-
limit?: number;
|
|
495
|
-
offset?: number;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
export interface ListConnectionsToParams {
|
|
499
|
-
toThingId: Id<"things">;
|
|
500
|
-
relationshipType?: ConnectionType;
|
|
501
|
-
limit?: number;
|
|
502
|
-
offset?: number;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
export interface CreateConnectionInput {
|
|
506
|
-
fromThingId: Id<"things">;
|
|
507
|
-
toThingId: Id<"things">;
|
|
508
|
-
relationshipType: ConnectionType;
|
|
509
|
-
metadata?: Record<string, any>;
|
|
510
|
-
validFrom?: number;
|
|
511
|
-
validTo?: number;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
// Events
|
|
515
|
-
export interface Event {
|
|
516
|
-
_id: Id<"events">;
|
|
517
|
-
type: EventType;
|
|
518
|
-
actorId?: Id<"things">;
|
|
519
|
-
targetId?: Id<"things">;
|
|
520
|
-
timestamp: number;
|
|
521
|
-
metadata?: Record<string, any>;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
export type EventType =
|
|
525
|
-
| "entity_created"
|
|
526
|
-
| "entity_updated"
|
|
527
|
-
| "entity_deleted"
|
|
528
|
-
| "payment_event"
|
|
529
|
-
| "communication_event";
|
|
530
|
-
|
|
531
|
-
export interface ListEventsParams {
|
|
532
|
-
type?: EventType;
|
|
533
|
-
actorId?: Id<"things">;
|
|
534
|
-
targetId?: Id<"things">;
|
|
535
|
-
startTime?: number;
|
|
536
|
-
endTime?: number;
|
|
537
|
-
limit?: number;
|
|
538
|
-
offset?: number;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
export interface LogEventInput {
|
|
542
|
-
type: EventType;
|
|
543
|
-
actorId?: Id<"things">;
|
|
544
|
-
targetId?: Id<"things">;
|
|
545
|
-
metadata?: Record<string, any>;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
export interface EventStatsParams {
|
|
549
|
-
type?: EventType;
|
|
550
|
-
organizationId?: Id<"organizations">;
|
|
551
|
-
period: { start: number; end: number };
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
export interface EventStats {
|
|
555
|
-
total: number;
|
|
556
|
-
byType: Record<EventType, number>;
|
|
557
|
-
byDay: Array<{ date: string; count: number }>;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
// Knowledge
|
|
561
|
-
export interface Knowledge {
|
|
562
|
-
_id: Id<"knowledge">;
|
|
563
|
-
knowledgeType: "label" | "chunk" | "document" | "vector_only";
|
|
564
|
-
text?: string;
|
|
565
|
-
embedding?: number[];
|
|
566
|
-
embeddingModel?: string;
|
|
567
|
-
embeddingDim?: number;
|
|
568
|
-
sourceThingId?: Id<"things">;
|
|
569
|
-
labels?: string[];
|
|
570
|
-
createdAt: number;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
export interface ListKnowledgeParams {
|
|
574
|
-
knowledgeType?: Knowledge["knowledgeType"];
|
|
575
|
-
sourceThingId?: Id<"things">;
|
|
576
|
-
limit?: number;
|
|
577
|
-
offset?: number;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
export interface CreateKnowledgeInput {
|
|
581
|
-
knowledgeType: Knowledge["knowledgeType"];
|
|
582
|
-
text?: string;
|
|
583
|
-
embedding?: number[];
|
|
584
|
-
embeddingModel?: string;
|
|
585
|
-
sourceThingId?: Id<"things">;
|
|
586
|
-
labels?: string[];
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export interface LinkKnowledgeInput {
|
|
590
|
-
knowledgeId: Id<"knowledge">;
|
|
591
|
-
thingId: Id<"things">;
|
|
592
|
-
role?: "label" | "summary" | "chunk_of" | "caption";
|
|
593
|
-
metadata?: Record<string, any>;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
export interface VectorSearchParams {
|
|
597
|
-
query: string;
|
|
598
|
-
organizationId?: Id<"organizations">;
|
|
599
|
-
limit?: number;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Error types for DataProvider operations
|
|
604
|
-
*/
|
|
605
|
-
export class OrganizationNotFoundError {
|
|
606
|
-
readonly _tag = "OrganizationNotFoundError";
|
|
607
|
-
constructor(public readonly id: Id<"organizations">) {}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
export class PersonNotFoundError {
|
|
611
|
-
readonly _tag = "PersonNotFoundError";
|
|
612
|
-
constructor(public readonly id: Id<"people">) {}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
export class ThingNotFoundError {
|
|
616
|
-
readonly _tag = "ThingNotFoundError";
|
|
617
|
-
constructor(public readonly id: Id<"things">) {}
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
export class ConnectionNotFoundError {
|
|
621
|
-
readonly _tag = "ConnectionNotFoundError";
|
|
622
|
-
constructor(public readonly id: Id<"connections">) {}
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
export class EventNotFoundError {
|
|
626
|
-
readonly _tag = "EventNotFoundError";
|
|
627
|
-
constructor(public readonly id: Id<"events">) {}
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
export class KnowledgeNotFoundError {
|
|
631
|
-
readonly _tag = "KnowledgeNotFoundError";
|
|
632
|
-
constructor(public readonly id: Id<"knowledge">) {}
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
export class UnauthorizedError {
|
|
636
|
-
readonly _tag = "UnauthorizedError";
|
|
637
|
-
constructor(public readonly message: string) {}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
export class ValidationError {
|
|
641
|
-
readonly _tag = "ValidationError";
|
|
642
|
-
constructor(public readonly message: string) {}
|
|
643
|
-
}
|
|
644
|
-
```
|
|
645
|
-
|
|
646
|
-
### 1.2 ConvexProvider Implementation
|
|
647
|
-
|
|
648
|
-
Complete implementation wrapping Convex SDK:
|
|
649
|
-
|
|
650
|
-
```typescript
|
|
651
|
-
// frontend/src/providers/ConvexProvider.ts
|
|
652
|
-
import { Effect } from "effect";
|
|
653
|
-
import { ConvexReactClient } from "convex/react";
|
|
654
|
-
import { api } from "@/convex/_generated/api";
|
|
655
|
-
import type { DataProvider } from "./DataProvider";
|
|
656
|
-
import * as Errors from "./DataProvider";
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* ConvexProvider - Concrete implementation of DataProvider using Convex SDK
|
|
660
|
-
*
|
|
661
|
-
* This provider:
|
|
662
|
-
* 1. Wraps ALL Convex operations in Effect.ts
|
|
663
|
-
* 2. Preserves authentication context
|
|
664
|
-
* 3. Converts Convex errors to typed errors
|
|
665
|
-
* 4. Ensures organization scoping
|
|
666
|
-
* 5. Maintains performance (<10ms overhead)
|
|
667
|
-
*
|
|
668
|
-
* Design Principles:
|
|
669
|
-
* - Thin wrapper (no business logic)
|
|
670
|
-
* - Direct mapping to Convex queries/mutations
|
|
671
|
-
* - Error transformation only
|
|
672
|
-
* - Type-safe at compile time
|
|
673
|
-
*/
|
|
674
|
-
export class ConvexProvider implements DataProvider {
|
|
675
|
-
constructor(private convex: ConvexReactClient) {}
|
|
676
|
-
|
|
677
|
-
organizations = {
|
|
678
|
-
get: (id: Id<"organizations">) =>
|
|
679
|
-
Effect.tryPromise({
|
|
680
|
-
try: () => this.convex.query(api.queries.organizations.get, { id }),
|
|
681
|
-
catch: () => new Errors.OrganizationNotFoundError(id),
|
|
682
|
-
}),
|
|
683
|
-
|
|
684
|
-
list: (params: ListOrganizationsParams) =>
|
|
685
|
-
Effect.tryPromise({
|
|
686
|
-
try: () => this.convex.query(api.queries.organizations.list, params),
|
|
687
|
-
catch: (error) => new Error(String(error)),
|
|
688
|
-
}),
|
|
689
|
-
|
|
690
|
-
create: (input: CreateOrganizationInput) =>
|
|
691
|
-
Effect.tryPromise({
|
|
692
|
-
try: () =>
|
|
693
|
-
this.convex.mutation(api.mutations.organizations.create, input),
|
|
694
|
-
catch: (error) => new Error(String(error)),
|
|
695
|
-
}),
|
|
696
|
-
|
|
697
|
-
update: (id: Id<"organizations">, updates: Partial<Organization>) =>
|
|
698
|
-
Effect.tryPromise({
|
|
699
|
-
try: () =>
|
|
700
|
-
this.convex.mutation(api.mutations.organizations.update, {
|
|
701
|
-
id,
|
|
702
|
-
...updates,
|
|
703
|
-
}),
|
|
704
|
-
catch: (error) => new Error(String(error)),
|
|
705
|
-
}),
|
|
706
|
-
|
|
707
|
-
getUsage: (id: Id<"organizations">) =>
|
|
708
|
-
Effect.tryPromise({
|
|
709
|
-
try: () =>
|
|
710
|
-
this.convex.query(api.queries.organizations.getUsage, { id }),
|
|
711
|
-
catch: (error) => new Error(String(error)),
|
|
712
|
-
}),
|
|
713
|
-
};
|
|
714
|
-
|
|
715
|
-
people = {
|
|
716
|
-
get: (id: Id<"people">) =>
|
|
717
|
-
Effect.tryPromise({
|
|
718
|
-
try: () => this.convex.query(api.queries.people.get, { id }),
|
|
719
|
-
catch: () => new Errors.PersonNotFoundError(id),
|
|
720
|
-
}),
|
|
721
|
-
|
|
722
|
-
list: (params: ListPeopleParams) =>
|
|
723
|
-
Effect.tryPromise({
|
|
724
|
-
try: () => this.convex.query(api.queries.people.list, params),
|
|
725
|
-
catch: (error) => new Error(String(error)),
|
|
726
|
-
}),
|
|
727
|
-
|
|
728
|
-
create: (input: CreatePersonInput) =>
|
|
729
|
-
Effect.tryPromise({
|
|
730
|
-
try: () => this.convex.mutation(api.mutations.people.create, input),
|
|
731
|
-
catch: (error) => new Error(String(error)),
|
|
732
|
-
}),
|
|
733
|
-
|
|
734
|
-
update: (id: Id<"people">, updates: Partial<Person>) =>
|
|
735
|
-
Effect.tryPromise({
|
|
736
|
-
try: () =>
|
|
737
|
-
this.convex.mutation(api.mutations.people.update, { id, ...updates }),
|
|
738
|
-
catch: (error) => new Error(String(error)),
|
|
739
|
-
}),
|
|
740
|
-
|
|
741
|
-
getOrganizations: (id: Id<"people">) =>
|
|
742
|
-
Effect.tryPromise({
|
|
743
|
-
try: () =>
|
|
744
|
-
this.convex.query(api.queries.people.getOrganizations, { id }),
|
|
745
|
-
catch: (error) => new Error(String(error)),
|
|
746
|
-
}),
|
|
747
|
-
|
|
748
|
-
checkPermission: (id: Id<"people">, permission: string) =>
|
|
749
|
-
Effect.tryPromise({
|
|
750
|
-
try: () =>
|
|
751
|
-
this.convex.query(api.queries.people.checkPermission, {
|
|
752
|
-
id,
|
|
753
|
-
permission,
|
|
754
|
-
}),
|
|
755
|
-
catch: (error) => new Error(String(error)),
|
|
756
|
-
}),
|
|
757
|
-
};
|
|
758
|
-
|
|
759
|
-
things = {
|
|
760
|
-
get: (id: Id<"things">) =>
|
|
761
|
-
Effect.tryPromise({
|
|
762
|
-
try: () => this.convex.query(api.queries.things.get, { id }),
|
|
763
|
-
catch: () => new Errors.ThingNotFoundError(id),
|
|
764
|
-
}),
|
|
765
|
-
|
|
766
|
-
list: (params: ListThingsParams) =>
|
|
767
|
-
Effect.tryPromise({
|
|
768
|
-
try: () => this.convex.query(api.queries.things.list, params),
|
|
769
|
-
catch: (error) => new Error(String(error)),
|
|
770
|
-
}),
|
|
771
|
-
|
|
772
|
-
create: (input: CreateThingInput) =>
|
|
773
|
-
Effect.tryPromise({
|
|
774
|
-
try: () => this.convex.mutation(api.mutations.things.create, input),
|
|
775
|
-
catch: (error) => new Error(String(error)),
|
|
776
|
-
}),
|
|
777
|
-
|
|
778
|
-
update: (id: Id<"things">, updates: Partial<Thing>) =>
|
|
779
|
-
Effect.tryPromise({
|
|
780
|
-
try: () =>
|
|
781
|
-
this.convex.mutation(api.mutations.things.update, { id, ...updates }),
|
|
782
|
-
catch: (error) => new Error(String(error)),
|
|
783
|
-
}),
|
|
784
|
-
|
|
785
|
-
delete: (id: Id<"things">) =>
|
|
786
|
-
Effect.tryPromise({
|
|
787
|
-
try: () => this.convex.mutation(api.mutations.things.delete, { id }),
|
|
788
|
-
catch: (error) => new Error(String(error)),
|
|
789
|
-
}),
|
|
790
|
-
|
|
791
|
-
search: (params: SearchThingsParams) =>
|
|
792
|
-
Effect.tryPromise({
|
|
793
|
-
try: () => this.convex.query(api.queries.things.search, params),
|
|
794
|
-
catch: (error) => new Error(String(error)),
|
|
795
|
-
}),
|
|
796
|
-
};
|
|
797
|
-
|
|
798
|
-
connections = {
|
|
799
|
-
get: (id: Id<"connections">) =>
|
|
800
|
-
Effect.tryPromise({
|
|
801
|
-
try: () => this.convex.query(api.queries.connections.get, { id }),
|
|
802
|
-
catch: () => new Errors.ConnectionNotFoundError(id),
|
|
803
|
-
}),
|
|
804
|
-
|
|
805
|
-
listFrom: (params: ListConnectionsFromParams) =>
|
|
806
|
-
Effect.tryPromise({
|
|
807
|
-
try: () => this.convex.query(api.queries.connections.listFrom, params),
|
|
808
|
-
catch: (error) => new Error(String(error)),
|
|
809
|
-
}),
|
|
810
|
-
|
|
811
|
-
listTo: (params: ListConnectionsToParams) =>
|
|
812
|
-
Effect.tryPromise({
|
|
813
|
-
try: () => this.convex.query(api.queries.connections.listTo, params),
|
|
814
|
-
catch: (error) => new Error(String(error)),
|
|
815
|
-
}),
|
|
816
|
-
|
|
817
|
-
create: (input: CreateConnectionInput) =>
|
|
818
|
-
Effect.tryPromise({
|
|
819
|
-
try: () =>
|
|
820
|
-
this.convex.mutation(api.mutations.connections.create, input),
|
|
821
|
-
catch: (error) => new Error(String(error)),
|
|
822
|
-
}),
|
|
823
|
-
|
|
824
|
-
update: (id: Id<"connections">, updates: Partial<Connection>) =>
|
|
825
|
-
Effect.tryPromise({
|
|
826
|
-
try: () =>
|
|
827
|
-
this.convex.mutation(api.mutations.connections.update, {
|
|
828
|
-
id,
|
|
829
|
-
...updates,
|
|
830
|
-
}),
|
|
831
|
-
catch: (error) => new Error(String(error)),
|
|
832
|
-
}),
|
|
833
|
-
|
|
834
|
-
delete: (id: Id<"connections">) =>
|
|
835
|
-
Effect.tryPromise({
|
|
836
|
-
try: () =>
|
|
837
|
-
this.convex.mutation(api.mutations.connections.delete, { id }),
|
|
838
|
-
catch: (error) => new Error(String(error)),
|
|
839
|
-
}),
|
|
840
|
-
};
|
|
841
|
-
|
|
842
|
-
events = {
|
|
843
|
-
get: (id: Id<"events">) =>
|
|
844
|
-
Effect.tryPromise({
|
|
845
|
-
try: () => this.convex.query(api.queries.events.get, { id }),
|
|
846
|
-
catch: () => new Errors.EventNotFoundError(id),
|
|
847
|
-
}),
|
|
848
|
-
|
|
849
|
-
list: (params: ListEventsParams) =>
|
|
850
|
-
Effect.tryPromise({
|
|
851
|
-
try: () => this.convex.query(api.queries.events.list, params),
|
|
852
|
-
catch: (error) => new Error(String(error)),
|
|
853
|
-
}),
|
|
854
|
-
|
|
855
|
-
log: (input: LogEventInput) =>
|
|
856
|
-
Effect.tryPromise({
|
|
857
|
-
try: () => this.convex.mutation(api.mutations.events.log, input),
|
|
858
|
-
catch: (error) => new Error(String(error)),
|
|
859
|
-
}),
|
|
860
|
-
|
|
861
|
-
getTimeline: (thingId: Id<"things">) =>
|
|
862
|
-
Effect.tryPromise({
|
|
863
|
-
try: () =>
|
|
864
|
-
this.convex.query(api.queries.events.getTimeline, { thingId }),
|
|
865
|
-
catch: (error) => new Error(String(error)),
|
|
866
|
-
}),
|
|
867
|
-
|
|
868
|
-
getStats: (params: EventStatsParams) =>
|
|
869
|
-
Effect.tryPromise({
|
|
870
|
-
try: () => this.convex.query(api.queries.events.getStats, params),
|
|
871
|
-
catch: (error) => new Error(String(error)),
|
|
872
|
-
}),
|
|
873
|
-
};
|
|
874
|
-
|
|
875
|
-
knowledge = {
|
|
876
|
-
get: (id: Id<"knowledge">) =>
|
|
877
|
-
Effect.tryPromise({
|
|
878
|
-
try: () => this.convex.query(api.queries.knowledge.get, { id }),
|
|
879
|
-
catch: () => new Errors.KnowledgeNotFoundError(id),
|
|
880
|
-
}),
|
|
881
|
-
|
|
882
|
-
list: (params: ListKnowledgeParams) =>
|
|
883
|
-
Effect.tryPromise({
|
|
884
|
-
try: () => this.convex.query(api.queries.knowledge.list, params),
|
|
885
|
-
catch: (error) => new Error(String(error)),
|
|
886
|
-
}),
|
|
887
|
-
|
|
888
|
-
create: (input: CreateKnowledgeInput) =>
|
|
889
|
-
Effect.tryPromise({
|
|
890
|
-
try: () => this.convex.mutation(api.mutations.knowledge.create, input),
|
|
891
|
-
catch: (error) => new Error(String(error)),
|
|
892
|
-
}),
|
|
893
|
-
|
|
894
|
-
link: (input: LinkKnowledgeInput) =>
|
|
895
|
-
Effect.tryPromise({
|
|
896
|
-
try: () => this.convex.mutation(api.mutations.knowledge.link, input),
|
|
897
|
-
catch: (error) => new Error(String(error)),
|
|
898
|
-
}),
|
|
899
|
-
|
|
900
|
-
unlink: (knowledgeId: Id<"knowledge">, thingId: Id<"things">) =>
|
|
901
|
-
Effect.tryPromise({
|
|
902
|
-
try: () =>
|
|
903
|
-
this.convex.mutation(api.mutations.knowledge.unlink, {
|
|
904
|
-
knowledgeId,
|
|
905
|
-
thingId,
|
|
906
|
-
}),
|
|
907
|
-
catch: (error) => new Error(String(error)),
|
|
908
|
-
}),
|
|
909
|
-
|
|
910
|
-
vectorSearch: (params: VectorSearchParams) =>
|
|
911
|
-
Effect.tryPromise({
|
|
912
|
-
try: () =>
|
|
913
|
-
this.convex.query(api.queries.knowledge.vectorSearch, params),
|
|
914
|
-
catch: (error) => new Error(String(error)),
|
|
915
|
-
}),
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Factory function to create ConvexProvider
|
|
921
|
-
*/
|
|
922
|
-
export const createConvexProvider = (
|
|
923
|
-
convex: ConvexReactClient,
|
|
924
|
-
): DataProvider => {
|
|
925
|
-
return new ConvexProvider(convex);
|
|
926
|
-
};
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* React hook for using DataProvider
|
|
930
|
-
*/
|
|
931
|
-
import { useConvex } from "convex/react";
|
|
932
|
-
import { useMemo } from "react";
|
|
933
|
-
|
|
934
|
-
export const useDataProvider = (): DataProvider => {
|
|
935
|
-
const convex = useConvex();
|
|
936
|
-
return useMemo(() => createConvexProvider(convex), [convex]);
|
|
937
|
-
};
|
|
938
|
-
```
|
|
939
|
-
|
|
940
|
-
### 1.3 Effect.ts Layer Creation
|
|
941
|
-
|
|
942
|
-
```typescript
|
|
943
|
-
// frontend/src/providers/layers.ts
|
|
944
|
-
import { Layer, Context } from "effect";
|
|
945
|
-
import type { DataProvider } from "./DataProvider";
|
|
946
|
-
|
|
947
|
-
/**
|
|
948
|
-
* DataProvider Context - Effect.ts service definition
|
|
949
|
-
*/
|
|
950
|
-
export class DataProviderService extends Context.Tag("DataProviderService")<
|
|
951
|
-
DataProviderService,
|
|
952
|
-
DataProvider
|
|
953
|
-
>() {}
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* Create Layer from concrete DataProvider instance
|
|
957
|
-
*/
|
|
958
|
-
export const DataProviderLayer = (
|
|
959
|
-
provider: DataProvider,
|
|
960
|
-
): Layer.Layer<DataProviderService> =>
|
|
961
|
-
Layer.succeed(DataProviderService, provider);
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* Example usage in Effect program:
|
|
965
|
-
*
|
|
966
|
-
* const program = Effect.gen(function* () {
|
|
967
|
-
* const provider = yield* DataProviderService;
|
|
968
|
-
* const thing = yield* provider.things.get(thingId);
|
|
969
|
-
* return thing;
|
|
970
|
-
* });
|
|
971
|
-
*
|
|
972
|
-
* const result = await Effect.runPromise(
|
|
973
|
-
* program.pipe(Effect.provide(DataProviderLayer(convexProvider)))
|
|
974
|
-
* );
|
|
975
|
-
*/
|
|
976
|
-
```
|
|
977
|
-
|
|
978
|
-
---
|
|
979
|
-
|
|
980
|
-
## 2. Ontology Mapping
|
|
981
|
-
|
|
982
|
-
### Organizations (Dimension 1)
|
|
983
|
-
|
|
984
|
-
**Role:** Multi-tenant isolation and backend provider configuration
|
|
985
|
-
|
|
986
|
-
- **Thing Type:** `external_connection` (type for provider configs)
|
|
987
|
-
- **Properties:**
|
|
988
|
-
```typescript
|
|
989
|
-
{
|
|
990
|
-
platform: "convex" | "supabase" | "firebase" | "custom",
|
|
991
|
-
name: "Production Backend",
|
|
992
|
-
baseUrl: "https://shocking-falcon-870.convex.cloud",
|
|
993
|
-
connectionType: "rest" | "websocket" | "graphql",
|
|
994
|
-
status: "active" | "inactive" | "error",
|
|
995
|
-
organizationId: Id<"organizations">
|
|
996
|
-
}
|
|
997
|
-
```
|
|
998
|
-
- **Organization Scoping:** EVERY DataProvider operation MUST filter by `organizationId`
|
|
999
|
-
- **Backend Selection:** Organizations can configure which backend provider to use (stored in `organizations.properties.backendProvider`)
|
|
1000
|
-
|
|
1001
|
-
### People (Dimension 2)
|
|
1002
|
-
|
|
1003
|
-
**Role:** Authorization - who can configure backend providers
|
|
1004
|
-
|
|
1005
|
-
- **Permissions:** Only `platform_owner` and `org_owner` can configure backend providers
|
|
1006
|
-
- **Actions:**
|
|
1007
|
-
- `provider:configure` - Change backend provider
|
|
1008
|
-
- `provider:view` - View provider configuration
|
|
1009
|
-
- `provider:test` - Test provider connection
|
|
1010
|
-
- **Audit:** ALL provider configuration changes MUST log events with actorId
|
|
1011
|
-
|
|
1012
|
-
### Things (Dimension 3)
|
|
1013
|
-
|
|
1014
|
-
**Role:** Provider configurations stored as things
|
|
1015
|
-
|
|
1016
|
-
- **Thing Type:** `external_connection`
|
|
1017
|
-
- **Created When:** Organization selects/configures backend provider
|
|
1018
|
-
- **Properties:** Provider-specific configuration (baseUrl, apiKey, etc.)
|
|
1019
|
-
- **Status:** `active` (current provider) or `inactive` (past providers)
|
|
1020
|
-
- **Relationships:**
|
|
1021
|
-
- Organization → external_connection (`owns`)
|
|
1022
|
-
- Organization → external_connection (`configured_by`)
|
|
1023
|
-
|
|
1024
|
-
### Connections (Dimension 4)
|
|
1025
|
-
|
|
1026
|
-
**Role:** Link organizations to their backend provider configuration
|
|
1027
|
-
|
|
1028
|
-
- **Connection Type:** `configured_by`
|
|
1029
|
-
- **Pattern:**
|
|
1030
|
-
```typescript
|
|
1031
|
-
{
|
|
1032
|
-
fromThingId: organizationId,
|
|
1033
|
-
toThingId: externalConnectionId,
|
|
1034
|
-
relationshipType: "configured_by",
|
|
1035
|
-
metadata: {
|
|
1036
|
-
configuredAt: Date.now(),
|
|
1037
|
-
configuredBy: personId,
|
|
1038
|
-
previousProvider?: "convex" | "supabase"
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
```
|
|
1042
|
-
|
|
1043
|
-
### Events (Dimension 5)
|
|
1044
|
-
|
|
1045
|
-
**Role:** Log all provider configuration changes
|
|
1046
|
-
|
|
1047
|
-
- **Event Types:**
|
|
1048
|
-
- `provider_configured` - Initial provider setup
|
|
1049
|
-
- `provider_changed` - Switch from one provider to another
|
|
1050
|
-
- `provider_tested` - Connection test performed
|
|
1051
|
-
- `provider_error` - Provider connection failed
|
|
1052
|
-
- **Pattern:**
|
|
1053
|
-
```typescript
|
|
1054
|
-
{
|
|
1055
|
-
type: "provider_changed",
|
|
1056
|
-
actorId: personId,
|
|
1057
|
-
targetId: organizationId,
|
|
1058
|
-
timestamp: Date.now(),
|
|
1059
|
-
metadata: {
|
|
1060
|
-
oldProvider: "convex",
|
|
1061
|
-
newProvider: "supabase",
|
|
1062
|
-
reason: "performance"
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
```
|
|
1066
|
-
|
|
1067
|
-
### Knowledge (Dimension 6)
|
|
1068
|
-
|
|
1069
|
-
**Role:** Labels and tags for provider capabilities
|
|
1070
|
-
|
|
1071
|
-
- **Labels:**
|
|
1072
|
-
- `capability:realtime` - Real-time subscriptions
|
|
1073
|
-
- `capability:vector_search` - Vector search support
|
|
1074
|
-
- `capability:file_storage` - File upload/storage
|
|
1075
|
-
- `protocol:rest` - REST API support
|
|
1076
|
-
- `protocol:websocket` - WebSocket support
|
|
1077
|
-
- `protocol:graphql` - GraphQL API support
|
|
1078
|
-
- **Usage:** Filter available providers by required capabilities
|
|
1079
|
-
|
|
1080
|
-
---
|
|
1081
|
-
|
|
1082
|
-
## 3. User Stories
|
|
1083
|
-
|
|
1084
|
-
### Story 1: Developer Uses Interface
|
|
1085
|
-
|
|
1086
|
-
**As a** frontend developer
|
|
1087
|
-
**I want** to use a single `DataProvider` interface for all backend operations
|
|
1088
|
-
**So that** I don't need to learn Convex-specific APIs
|
|
1089
|
-
|
|
1090
|
-
**Acceptance Criteria:**
|
|
1091
|
-
|
|
1092
|
-
1. Can import `DataProvider` interface from `@/providers/DataProvider`
|
|
1093
|
-
2. All operations return `Effect.Effect<T, Error>` (typed errors)
|
|
1094
|
-
3. No Convex imports needed in components (only `useDataProvider` hook)
|
|
1095
|
-
4. TypeScript autocomplete shows all available operations
|
|
1096
|
-
5. Documentation includes examples for each operation
|
|
1097
|
-
|
|
1098
|
-
### Story 2: Backend Developer Wraps Convex
|
|
1099
|
-
|
|
1100
|
-
**As a** backend developer
|
|
1101
|
-
**I want** to implement `ConvexProvider` that wraps Convex SDK
|
|
1102
|
-
**So that** frontend can use Convex without coupling
|
|
1103
|
-
|
|
1104
|
-
**Acceptance Criteria:**
|
|
1105
|
-
|
|
1106
|
-
1. `ConvexProvider` implements ALL methods in `DataProvider` interface
|
|
1107
|
-
2. Each method wraps corresponding Convex query/mutation
|
|
1108
|
-
3. Convex errors are converted to typed errors (`ThingNotFoundError`, etc.)
|
|
1109
|
-
4. Authentication context is preserved through all operations
|
|
1110
|
-
5. Performance overhead is <10ms per operation
|
|
1111
|
-
|
|
1112
|
-
### Story 3: Developer Tests in Isolation
|
|
1113
|
-
|
|
1114
|
-
**As a** developer
|
|
1115
|
-
**I want** to mock `DataProvider` in tests
|
|
1116
|
-
**So that** I can test components without real backend
|
|
1117
|
-
|
|
1118
|
-
**Acceptance Criteria:**
|
|
1119
|
-
|
|
1120
|
-
1. Can create mock implementation of `DataProvider`
|
|
1121
|
-
2. Mock returns `Effect.succeed()` or `Effect.fail()` as needed
|
|
1122
|
-
3. Tests run without Convex connection
|
|
1123
|
-
4. Tests run in <1 second total
|
|
1124
|
-
5. Test coverage >90% for all provider operations
|
|
1125
|
-
|
|
1126
|
-
### Story 4: Organization Configures Provider
|
|
1127
|
-
|
|
1128
|
-
**As an** organization owner
|
|
1129
|
-
**I want** to configure which backend provider my organization uses
|
|
1130
|
-
**So that** I can choose the best solution for my needs
|
|
1131
|
-
|
|
1132
|
-
**Acceptance Criteria:**
|
|
1133
|
-
|
|
1134
|
-
1. Can view current backend provider in organization settings
|
|
1135
|
-
2. Can switch to different provider (Convex → Supabase)
|
|
1136
|
-
3. Provider change is logged as event with actorId
|
|
1137
|
-
4. Old provider configuration is archived (not deleted)
|
|
1138
|
-
5. Application continues working after provider switch
|
|
1139
|
-
|
|
1140
|
-
### Story 5: Developer Uses Effect.ts
|
|
1141
|
-
|
|
1142
|
-
**As a** developer
|
|
1143
|
-
**I want** to compose DataProvider operations using Effect.ts
|
|
1144
|
-
**So that** I can build complex workflows with proper error handling
|
|
1145
|
-
|
|
1146
|
-
**Acceptance Criteria:**
|
|
1147
|
-
|
|
1148
|
-
1. All operations return `Effect.Effect<T, Error>`
|
|
1149
|
-
2. Can use `Effect.gen()` to compose operations
|
|
1150
|
-
3. Can use `Effect.catchAll()` to handle errors
|
|
1151
|
-
4. Can use `Effect.provide()` to inject provider
|
|
1152
|
-
5. TypeScript infers error types correctly
|
|
1153
|
-
|
|
1154
|
-
---
|
|
1155
|
-
|
|
1156
|
-
## 4. Implementation Steps
|
|
1157
|
-
|
|
1158
|
-
### Phase 1: Interface Definition (Days 1-2)
|
|
1159
|
-
|
|
1160
|
-
**Step 1:** Create DataProvider interface file
|
|
1161
|
-
|
|
1162
|
-
```bash
|
|
1163
|
-
mkdir -p frontend/src/providers
|
|
1164
|
-
touch frontend/src/providers/DataProvider.ts
|
|
1165
|
-
```
|
|
1166
|
-
|
|
1167
|
-
**Step 2:** Define base DataProvider interface with all 6 dimensions
|
|
1168
|
-
|
|
1169
|
-
```typescript
|
|
1170
|
-
// Copy complete interface from section 1.1
|
|
1171
|
-
```
|
|
1172
|
-
|
|
1173
|
-
**Step 3:** Define all type definitions (Organization, Person, Thing, etc.)
|
|
1174
|
-
|
|
1175
|
-
```typescript
|
|
1176
|
-
// Copy all type definitions from section 1.1
|
|
1177
|
-
```
|
|
1178
|
-
|
|
1179
|
-
**Step 4:** Define error classes with `_tag` pattern
|
|
1180
|
-
|
|
1181
|
-
```typescript
|
|
1182
|
-
// Copy all error classes from section 1.1
|
|
1183
|
-
```
|
|
1184
|
-
|
|
1185
|
-
**Step 5:** Export all types and interfaces
|
|
1186
|
-
|
|
1187
|
-
```typescript
|
|
1188
|
-
export type {
|
|
1189
|
-
DataProvider,
|
|
1190
|
-
Organization,
|
|
1191
|
-
Person,
|
|
1192
|
-
Thing,
|
|
1193
|
-
Connection,
|
|
1194
|
-
Event,
|
|
1195
|
-
Knowledge,
|
|
1196
|
-
};
|
|
1197
|
-
export {
|
|
1198
|
-
OrganizationNotFoundError,
|
|
1199
|
-
PersonNotFoundError,
|
|
1200
|
-
ThingNotFoundError /* etc */,
|
|
1201
|
-
};
|
|
1202
|
-
```
|
|
1203
|
-
|
|
1204
|
-
**Step 6:** Validate TypeScript compiles
|
|
1205
|
-
|
|
1206
|
-
```bash
|
|
1207
|
-
cd frontend && bunx astro check
|
|
1208
|
-
```
|
|
1209
|
-
|
|
1210
|
-
### Phase 2: ConvexProvider Implementation (Days 3-4)
|
|
1211
|
-
|
|
1212
|
-
**Step 7:** Create ConvexProvider implementation file
|
|
1213
|
-
|
|
1214
|
-
```bash
|
|
1215
|
-
touch frontend/src/providers/ConvexProvider.ts
|
|
1216
|
-
```
|
|
1217
|
-
|
|
1218
|
-
**Step 8:** Implement ConvexProvider class
|
|
1219
|
-
|
|
1220
|
-
```typescript
|
|
1221
|
-
// Copy complete implementation from section 1.2
|
|
1222
|
-
```
|
|
1223
|
-
|
|
1224
|
-
**Step 9:** Implement factory function `createConvexProvider`
|
|
1225
|
-
|
|
1226
|
-
```typescript
|
|
1227
|
-
// Copy factory function from section 1.2
|
|
1228
|
-
```
|
|
1229
|
-
|
|
1230
|
-
**Step 10:** Implement React hook `useDataProvider`
|
|
1231
|
-
|
|
1232
|
-
```typescript
|
|
1233
|
-
// Copy React hook from section 1.2
|
|
1234
|
-
```
|
|
1235
|
-
|
|
1236
|
-
**Step 11:** Validate ConvexProvider implements DataProvider
|
|
1237
|
-
|
|
1238
|
-
```bash
|
|
1239
|
-
bunx astro check
|
|
1240
|
-
```
|
|
1241
|
-
|
|
1242
|
-
**Step 12:** Test ConvexProvider methods manually
|
|
1243
|
-
|
|
1244
|
-
```bash
|
|
1245
|
-
bun run dev
|
|
1246
|
-
# Visit http://localhost:4321/test-provider
|
|
1247
|
-
```
|
|
1248
|
-
|
|
1249
|
-
### Phase 3: Effect.ts Integration (Day 5)
|
|
1250
|
-
|
|
1251
|
-
**Step 13:** Create Layer definitions
|
|
1252
|
-
|
|
1253
|
-
```bash
|
|
1254
|
-
touch frontend/src/providers/layers.ts
|
|
1255
|
-
```
|
|
1256
|
-
|
|
1257
|
-
**Step 14:** Define DataProviderService context
|
|
1258
|
-
|
|
1259
|
-
```typescript
|
|
1260
|
-
// Copy from section 1.3
|
|
1261
|
-
```
|
|
1262
|
-
|
|
1263
|
-
**Step 15:** Create Layer factory function
|
|
1264
|
-
|
|
1265
|
-
```typescript
|
|
1266
|
-
// Copy from section 1.3
|
|
1267
|
-
```
|
|
1268
|
-
|
|
1269
|
-
**Step 16:** Test Effect.ts composition
|
|
1270
|
-
|
|
1271
|
-
```typescript
|
|
1272
|
-
// Create test program
|
|
1273
|
-
const program = Effect.gen(function* () {
|
|
1274
|
-
const provider = yield* DataProviderService;
|
|
1275
|
-
const things = yield* provider.things.list({ type: "course" });
|
|
1276
|
-
return things;
|
|
1277
|
-
});
|
|
1278
|
-
|
|
1279
|
-
const result = await Effect.runPromise(
|
|
1280
|
-
program.pipe(Effect.provide(DataProviderLayer(convexProvider))),
|
|
1281
|
-
);
|
|
1282
|
-
```
|
|
1283
|
-
|
|
1284
|
-
**Step 17:** Validate all Effect operations compile
|
|
1285
|
-
|
|
1286
|
-
```bash
|
|
1287
|
-
bunx astro check
|
|
1288
|
-
```
|
|
1289
|
-
|
|
1290
|
-
### Phase 4: Backend Queries Implementation (Days 6-7)
|
|
1291
|
-
|
|
1292
|
-
**Step 18:** Create backend query files
|
|
1293
|
-
|
|
1294
|
-
```bash
|
|
1295
|
-
mkdir -p backend/convex/queries
|
|
1296
|
-
touch backend/convex/queries/organizations.ts
|
|
1297
|
-
touch backend/convex/queries/people.ts
|
|
1298
|
-
touch backend/convex/queries/things.ts
|
|
1299
|
-
touch backend/convex/queries/connections.ts
|
|
1300
|
-
touch backend/convex/queries/events.ts
|
|
1301
|
-
touch backend/convex/queries/knowledge.ts
|
|
1302
|
-
```
|
|
1303
|
-
|
|
1304
|
-
**Step 19:** Implement organizations queries
|
|
1305
|
-
|
|
1306
|
-
```typescript
|
|
1307
|
-
// backend/convex/queries/organizations.ts
|
|
1308
|
-
import { query } from "../_generated/server";
|
|
1309
|
-
import { v } from "convex/values";
|
|
1310
|
-
|
|
1311
|
-
export const get = query({
|
|
1312
|
-
args: { id: v.id("organizations") },
|
|
1313
|
-
handler: async (ctx, args) => {
|
|
1314
|
-
return await ctx.db.get(args.id);
|
|
1315
|
-
},
|
|
1316
|
-
});
|
|
1317
|
-
|
|
1318
|
-
export const list = query({
|
|
1319
|
-
args: {
|
|
1320
|
-
status: v.optional(v.string()),
|
|
1321
|
-
plan: v.optional(v.string()),
|
|
1322
|
-
limit: v.optional(v.number()),
|
|
1323
|
-
offset: v.optional(v.number()),
|
|
1324
|
-
},
|
|
1325
|
-
handler: async (ctx, args) => {
|
|
1326
|
-
let q = ctx.db.query("organizations");
|
|
1327
|
-
if (args.status) {
|
|
1328
|
-
q = q.filter((q) => q.eq(q.field("status"), args.status));
|
|
1329
|
-
}
|
|
1330
|
-
return await q.take(args.limit || 100);
|
|
1331
|
-
},
|
|
1332
|
-
});
|
|
1333
|
-
|
|
1334
|
-
export const getUsage = query({
|
|
1335
|
-
args: { id: v.id("organizations") },
|
|
1336
|
-
handler: async (ctx, args) => {
|
|
1337
|
-
const org = await ctx.db.get(args.id);
|
|
1338
|
-
if (!org) throw new Error("Organization not found");
|
|
1339
|
-
return {
|
|
1340
|
-
organizationId: args.id,
|
|
1341
|
-
users: org.usage.users,
|
|
1342
|
-
storage: org.usage.storage,
|
|
1343
|
-
apiCalls: org.usage.apiCalls,
|
|
1344
|
-
cycle: org.usage.cycle,
|
|
1345
|
-
period: { start: Date.now() - 30 * 24 * 60 * 60 * 1000, end: Date.now() },
|
|
1346
|
-
};
|
|
1347
|
-
},
|
|
1348
|
-
});
|
|
1349
|
-
```
|
|
1350
|
-
|
|
1351
|
-
**Step 20:** Implement people queries (similar pattern)
|
|
1352
|
-
|
|
1353
|
-
```typescript
|
|
1354
|
-
// backend/convex/queries/people.ts
|
|
1355
|
-
// Follow same pattern as organizations
|
|
1356
|
-
```
|
|
1357
|
-
|
|
1358
|
-
**Step 21:** Implement things queries (with search)
|
|
1359
|
-
|
|
1360
|
-
```typescript
|
|
1361
|
-
// backend/convex/queries/things.ts
|
|
1362
|
-
import { query } from "../_generated/server";
|
|
1363
|
-
import { v } from "convex/values";
|
|
1364
|
-
|
|
1365
|
-
export const get = query({
|
|
1366
|
-
args: { id: v.id("things") },
|
|
1367
|
-
handler: async (ctx, args) => {
|
|
1368
|
-
return await ctx.db.get(args.id);
|
|
1369
|
-
},
|
|
1370
|
-
});
|
|
1371
|
-
|
|
1372
|
-
export const list = query({
|
|
1373
|
-
args: {
|
|
1374
|
-
type: v.optional(v.string()),
|
|
1375
|
-
status: v.optional(v.string()),
|
|
1376
|
-
organizationId: v.optional(v.id("organizations")),
|
|
1377
|
-
limit: v.optional(v.number()),
|
|
1378
|
-
offset: v.optional(v.number()),
|
|
1379
|
-
},
|
|
1380
|
-
handler: async (ctx, args) => {
|
|
1381
|
-
let q = ctx.db.query("things");
|
|
1382
|
-
|
|
1383
|
-
if (args.type) {
|
|
1384
|
-
q = q.withIndex("by_type", (q) => q.eq("type", args.type));
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
if (args.organizationId) {
|
|
1388
|
-
q = q.filter((q) => q.eq(q.field("organizationId"), args.organizationId));
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
if (args.status) {
|
|
1392
|
-
q = q.filter((q) => q.eq(q.field("status"), args.status));
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
return await q.take(args.limit || 100);
|
|
1396
|
-
},
|
|
1397
|
-
});
|
|
1398
|
-
|
|
1399
|
-
export const search = query({
|
|
1400
|
-
args: {
|
|
1401
|
-
query: v.string(),
|
|
1402
|
-
type: v.optional(v.string()),
|
|
1403
|
-
organizationId: v.optional(v.id("organizations")),
|
|
1404
|
-
limit: v.optional(v.number()),
|
|
1405
|
-
},
|
|
1406
|
-
handler: async (ctx, args) => {
|
|
1407
|
-
return await ctx.db
|
|
1408
|
-
.query("things")
|
|
1409
|
-
.withSearchIndex("search_things", (q) => q.search("name", args.query))
|
|
1410
|
-
.filter((q) => {
|
|
1411
|
-
if (args.type) return q.eq(q.field("type"), args.type);
|
|
1412
|
-
return true;
|
|
1413
|
-
})
|
|
1414
|
-
.take(args.limit || 20);
|
|
1415
|
-
},
|
|
1416
|
-
});
|
|
1417
|
-
```
|
|
1418
|
-
|
|
1419
|
-
**Step 22:** Implement connections queries
|
|
1420
|
-
|
|
1421
|
-
```typescript
|
|
1422
|
-
// backend/convex/queries/connections.ts
|
|
1423
|
-
// Implement listFrom and listTo with indexes
|
|
1424
|
-
```
|
|
1425
|
-
|
|
1426
|
-
**Step 23:** Implement events queries
|
|
1427
|
-
|
|
1428
|
-
```typescript
|
|
1429
|
-
// backend/convex/queries/events.ts
|
|
1430
|
-
// Implement list, getTimeline, getStats
|
|
1431
|
-
```
|
|
1432
|
-
|
|
1433
|
-
**Step 24:** Implement knowledge queries
|
|
1434
|
-
|
|
1435
|
-
```typescript
|
|
1436
|
-
// backend/convex/queries/knowledge.ts
|
|
1437
|
-
// Implement list, vectorSearch
|
|
1438
|
-
```
|
|
1439
|
-
|
|
1440
|
-
**Step 25:** Test all queries from frontend
|
|
1441
|
-
|
|
1442
|
-
```bash
|
|
1443
|
-
cd frontend && bun run dev
|
|
1444
|
-
# Test each query type
|
|
1445
|
-
```
|
|
1446
|
-
|
|
1447
|
-
### Phase 5: Backend Mutations Implementation (Days 8-9)
|
|
1448
|
-
|
|
1449
|
-
**Step 26:** Create backend mutation files
|
|
1450
|
-
|
|
1451
|
-
```bash
|
|
1452
|
-
mkdir -p backend/convex/mutations
|
|
1453
|
-
touch backend/convex/mutations/organizations.ts
|
|
1454
|
-
touch backend/convex/mutations/people.ts
|
|
1455
|
-
touch backend/convex/mutations/things.ts
|
|
1456
|
-
touch backend/convex/mutations/connections.ts
|
|
1457
|
-
touch backend/convex/mutations/events.ts
|
|
1458
|
-
touch backend/convex/mutations/knowledge.ts
|
|
1459
|
-
```
|
|
1460
|
-
|
|
1461
|
-
**Step 27:** Implement organizations mutations
|
|
1462
|
-
|
|
1463
|
-
```typescript
|
|
1464
|
-
// backend/convex/mutations/organizations.ts
|
|
1465
|
-
import { mutation } from "../_generated/server";
|
|
1466
|
-
import { v } from "convex/values";
|
|
1467
|
-
|
|
1468
|
-
export const create = mutation({
|
|
1469
|
-
args: {
|
|
1470
|
-
name: v.string(),
|
|
1471
|
-
slug: v.string(),
|
|
1472
|
-
plan: v.string(),
|
|
1473
|
-
ownerId: v.id("people"),
|
|
1474
|
-
},
|
|
1475
|
-
handler: async (ctx, args) => {
|
|
1476
|
-
const orgId = await ctx.db.insert("organizations", {
|
|
1477
|
-
name: args.name,
|
|
1478
|
-
slug: args.slug,
|
|
1479
|
-
plan: args.plan as any,
|
|
1480
|
-
status: "trial",
|
|
1481
|
-
limits: { users: 5, storage: 1, apiCalls: 1000, cycle: 100 },
|
|
1482
|
-
usage: { users: 1, storage: 0, apiCalls: 0, cycle: 0 },
|
|
1483
|
-
createdAt: Date.now(),
|
|
1484
|
-
updatedAt: Date.now(),
|
|
1485
|
-
});
|
|
1486
|
-
|
|
1487
|
-
// Log event
|
|
1488
|
-
await ctx.db.insert("events", {
|
|
1489
|
-
type: "organization_created",
|
|
1490
|
-
actorId: args.ownerId,
|
|
1491
|
-
targetId: orgId,
|
|
1492
|
-
timestamp: Date.now(),
|
|
1493
|
-
metadata: { plan: args.plan },
|
|
1494
|
-
});
|
|
1495
|
-
|
|
1496
|
-
return orgId;
|
|
1497
|
-
},
|
|
1498
|
-
});
|
|
1499
|
-
|
|
1500
|
-
export const update = mutation({
|
|
1501
|
-
args: {
|
|
1502
|
-
id: v.id("organizations"),
|
|
1503
|
-
name: v.optional(v.string()),
|
|
1504
|
-
plan: v.optional(v.string()),
|
|
1505
|
-
status: v.optional(v.string()),
|
|
1506
|
-
},
|
|
1507
|
-
handler: async (ctx, args) => {
|
|
1508
|
-
const { id, ...updates } = args;
|
|
1509
|
-
await ctx.db.patch(id, { ...updates, updatedAt: Date.now() });
|
|
1510
|
-
|
|
1511
|
-
const updated = await ctx.db.get(id);
|
|
1512
|
-
return updated;
|
|
1513
|
-
},
|
|
1514
|
-
});
|
|
1515
|
-
```
|
|
1516
|
-
|
|
1517
|
-
**Step 28:** Implement people mutations
|
|
1518
|
-
|
|
1519
|
-
```typescript
|
|
1520
|
-
// backend/convex/mutations/people.ts
|
|
1521
|
-
// Follow same pattern
|
|
1522
|
-
```
|
|
1523
|
-
|
|
1524
|
-
**Step 29:** Implement things mutations (create, update, delete)
|
|
1525
|
-
|
|
1526
|
-
```typescript
|
|
1527
|
-
// backend/convex/mutations/things.ts
|
|
1528
|
-
import { mutation } from "../_generated/server";
|
|
1529
|
-
import { v } from "convex/values";
|
|
1530
|
-
|
|
1531
|
-
export const create = mutation({
|
|
1532
|
-
args: {
|
|
1533
|
-
type: v.string(),
|
|
1534
|
-
name: v.string(),
|
|
1535
|
-
properties: v.any(),
|
|
1536
|
-
status: v.optional(v.string()),
|
|
1537
|
-
organizationId: v.optional(v.id("organizations")),
|
|
1538
|
-
},
|
|
1539
|
-
handler: async (ctx, args) => {
|
|
1540
|
-
const identity = await ctx.auth.getUserIdentity();
|
|
1541
|
-
if (!identity) throw new Error("Not authenticated");
|
|
1542
|
-
|
|
1543
|
-
const thingId = await ctx.db.insert("things", {
|
|
1544
|
-
type: args.type as any,
|
|
1545
|
-
name: args.name,
|
|
1546
|
-
properties: args.properties,
|
|
1547
|
-
status: (args.status as any) || "draft",
|
|
1548
|
-
organizationId: args.organizationId,
|
|
1549
|
-
createdAt: Date.now(),
|
|
1550
|
-
updatedAt: Date.now(),
|
|
1551
|
-
});
|
|
1552
|
-
|
|
1553
|
-
// Log event
|
|
1554
|
-
await ctx.db.insert("events", {
|
|
1555
|
-
type: "entity_created",
|
|
1556
|
-
actorId: identity.tokenIdentifier,
|
|
1557
|
-
targetId: thingId,
|
|
1558
|
-
timestamp: Date.now(),
|
|
1559
|
-
metadata: { entityType: args.type },
|
|
1560
|
-
});
|
|
1561
|
-
|
|
1562
|
-
return thingId;
|
|
1563
|
-
},
|
|
1564
|
-
});
|
|
1565
|
-
|
|
1566
|
-
export const update = mutation({
|
|
1567
|
-
args: {
|
|
1568
|
-
id: v.id("things"),
|
|
1569
|
-
name: v.optional(v.string()),
|
|
1570
|
-
properties: v.optional(v.any()),
|
|
1571
|
-
status: v.optional(v.string()),
|
|
1572
|
-
},
|
|
1573
|
-
handler: async (ctx, args) => {
|
|
1574
|
-
const { id, ...updates } = args;
|
|
1575
|
-
await ctx.db.patch(id, { ...updates, updatedAt: Date.now() });
|
|
1576
|
-
|
|
1577
|
-
const updated = await ctx.db.get(id);
|
|
1578
|
-
return updated;
|
|
1579
|
-
},
|
|
1580
|
-
});
|
|
1581
|
-
|
|
1582
|
-
export const delete = mutation({
|
|
1583
|
-
args: { id: v.id("things") },
|
|
1584
|
-
handler: async (ctx, args) => {
|
|
1585
|
-
await ctx.db.patch(args.id, { deletedAt: Date.now() });
|
|
1586
|
-
},
|
|
1587
|
-
});
|
|
1588
|
-
```
|
|
1589
|
-
|
|
1590
|
-
**Step 30:** Implement connections mutations
|
|
1591
|
-
|
|
1592
|
-
```typescript
|
|
1593
|
-
// backend/convex/mutations/connections.ts
|
|
1594
|
-
// Implement create, update, delete
|
|
1595
|
-
```
|
|
1596
|
-
|
|
1597
|
-
**Step 31:** Implement events mutations
|
|
1598
|
-
|
|
1599
|
-
```typescript
|
|
1600
|
-
// backend/convex/mutations/events.ts
|
|
1601
|
-
export const log = mutation({
|
|
1602
|
-
args: {
|
|
1603
|
-
type: v.string(),
|
|
1604
|
-
actorId: v.optional(v.id("things")),
|
|
1605
|
-
targetId: v.optional(v.id("things")),
|
|
1606
|
-
metadata: v.optional(v.any()),
|
|
1607
|
-
},
|
|
1608
|
-
handler: async (ctx, args) => {
|
|
1609
|
-
return await ctx.db.insert("events", {
|
|
1610
|
-
type: args.type as any,
|
|
1611
|
-
actorId: args.actorId,
|
|
1612
|
-
targetId: args.targetId,
|
|
1613
|
-
timestamp: Date.now(),
|
|
1614
|
-
metadata: args.metadata,
|
|
1615
|
-
});
|
|
1616
|
-
},
|
|
1617
|
-
});
|
|
1618
|
-
```
|
|
1619
|
-
|
|
1620
|
-
**Step 32:** Implement knowledge mutations
|
|
1621
|
-
|
|
1622
|
-
```typescript
|
|
1623
|
-
// backend/convex/mutations/knowledge.ts
|
|
1624
|
-
// Implement create, link, unlink
|
|
1625
|
-
```
|
|
1626
|
-
|
|
1627
|
-
**Step 33:** Test all mutations from frontend
|
|
1628
|
-
|
|
1629
|
-
```bash
|
|
1630
|
-
cd frontend && bun run dev
|
|
1631
|
-
# Test each mutation type
|
|
1632
|
-
```
|
|
1633
|
-
|
|
1634
|
-
### Phase 6: Testing (Day 10)
|
|
1635
|
-
|
|
1636
|
-
**Step 34:** Create test directory
|
|
1637
|
-
|
|
1638
|
-
```bash
|
|
1639
|
-
mkdir -p frontend/test/providers
|
|
1640
|
-
touch frontend/test/providers/DataProvider.test.ts
|
|
1641
|
-
touch frontend/test/providers/ConvexProvider.test.ts
|
|
1642
|
-
```
|
|
1643
|
-
|
|
1644
|
-
**Step 35:** Write DataProvider interface tests
|
|
1645
|
-
|
|
1646
|
-
```typescript
|
|
1647
|
-
// frontend/test/providers/DataProvider.test.ts
|
|
1648
|
-
import { describe, it, expect } from "vitest";
|
|
1649
|
-
import type { DataProvider } from "@/providers/DataProvider";
|
|
1650
|
-
|
|
1651
|
-
describe("DataProvider Interface", () => {
|
|
1652
|
-
it("should define all 6 dimensions", () => {
|
|
1653
|
-
const operations: Array<keyof DataProvider> = [
|
|
1654
|
-
"organizations",
|
|
1655
|
-
"people",
|
|
1656
|
-
"things",
|
|
1657
|
-
"connections",
|
|
1658
|
-
"events",
|
|
1659
|
-
"knowledge",
|
|
1660
|
-
];
|
|
1661
|
-
|
|
1662
|
-
// Type-level test: this compiles if interface is complete
|
|
1663
|
-
expect(operations.length).toBe(6);
|
|
1664
|
-
});
|
|
1665
|
-
});
|
|
1666
|
-
```
|
|
1667
|
-
|
|
1668
|
-
**Step 36:** Write ConvexProvider unit tests
|
|
1669
|
-
|
|
1670
|
-
```typescript
|
|
1671
|
-
// frontend/test/providers/ConvexProvider.test.ts
|
|
1672
|
-
import { describe, it, expect, vi } from "vitest";
|
|
1673
|
-
import { Effect } from "effect";
|
|
1674
|
-
import { ConvexProvider } from "@/providers/ConvexProvider";
|
|
1675
|
-
import type { ConvexReactClient } from "convex/react";
|
|
1676
|
-
|
|
1677
|
-
describe("ConvexProvider", () => {
|
|
1678
|
-
it("should get organization by id", async () => {
|
|
1679
|
-
const mockConvex = {
|
|
1680
|
-
query: vi.fn().mockResolvedValue({
|
|
1681
|
-
_id: "org_123",
|
|
1682
|
-
name: "Test Org",
|
|
1683
|
-
plan: "pro",
|
|
1684
|
-
}),
|
|
1685
|
-
} as unknown as ConvexReactClient;
|
|
1686
|
-
|
|
1687
|
-
const provider = new ConvexProvider(mockConvex);
|
|
1688
|
-
const result = await Effect.runPromise(
|
|
1689
|
-
provider.organizations.get("org_123" as any),
|
|
1690
|
-
);
|
|
1691
|
-
|
|
1692
|
-
expect(result.name).toBe("Test Org");
|
|
1693
|
-
});
|
|
1694
|
-
|
|
1695
|
-
it("should handle not found errors", async () => {
|
|
1696
|
-
const mockConvex = {
|
|
1697
|
-
query: vi.fn().mockRejectedValue(new Error("Not found")),
|
|
1698
|
-
} as unknown as ConvexReactClient;
|
|
1699
|
-
|
|
1700
|
-
const provider = new ConvexProvider(mockConvex);
|
|
1701
|
-
const result = Effect.runPromiseExit(
|
|
1702
|
-
provider.organizations.get("org_123" as any),
|
|
1703
|
-
);
|
|
1704
|
-
|
|
1705
|
-
await expect(result).rejects.toMatchObject({
|
|
1706
|
-
_tag: "OrganizationNotFoundError",
|
|
1707
|
-
});
|
|
1708
|
-
});
|
|
1709
|
-
});
|
|
1710
|
-
```
|
|
1711
|
-
|
|
1712
|
-
**Step 37:** Write integration tests
|
|
1713
|
-
|
|
1714
|
-
```typescript
|
|
1715
|
-
// frontend/test/providers/integration.test.ts
|
|
1716
|
-
import { describe, it, expect } from "vitest";
|
|
1717
|
-
import { ConvexHttpClient } from "convex/browser";
|
|
1718
|
-
import { createConvexProvider } from "@/providers/ConvexProvider";
|
|
1719
|
-
import { Effect } from "effect";
|
|
1720
|
-
|
|
1721
|
-
describe("ConvexProvider Integration", () => {
|
|
1722
|
-
const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
1723
|
-
const provider = createConvexProvider(convex);
|
|
1724
|
-
|
|
1725
|
-
it("should list things", async () => {
|
|
1726
|
-
const result = await Effect.runPromise(
|
|
1727
|
-
provider.things.list({ type: "course", limit: 10 }),
|
|
1728
|
-
);
|
|
1729
|
-
|
|
1730
|
-
expect(Array.isArray(result)).toBe(true);
|
|
1731
|
-
});
|
|
1732
|
-
|
|
1733
|
-
it("should create and delete thing", async () => {
|
|
1734
|
-
const createResult = await Effect.runPromise(
|
|
1735
|
-
provider.things.create({
|
|
1736
|
-
type: "course",
|
|
1737
|
-
name: "Test Course",
|
|
1738
|
-
properties: { description: "Test" },
|
|
1739
|
-
}),
|
|
1740
|
-
);
|
|
1741
|
-
|
|
1742
|
-
expect(createResult).toBeDefined();
|
|
1743
|
-
|
|
1744
|
-
await Effect.runPromise(provider.things.delete(createResult));
|
|
1745
|
-
});
|
|
1746
|
-
});
|
|
1747
|
-
```
|
|
1748
|
-
|
|
1749
|
-
**Step 38:** Run all tests
|
|
1750
|
-
|
|
1751
|
-
```bash
|
|
1752
|
-
cd frontend && bun test test/providers
|
|
1753
|
-
```
|
|
1754
|
-
|
|
1755
|
-
**Step 39:** Measure test coverage
|
|
1756
|
-
|
|
1757
|
-
```bash
|
|
1758
|
-
bun test --coverage test/providers
|
|
1759
|
-
# Target: >90% coverage
|
|
1760
|
-
```
|
|
1761
|
-
|
|
1762
|
-
**Step 40:** Write performance tests
|
|
1763
|
-
|
|
1764
|
-
```typescript
|
|
1765
|
-
// frontend/test/providers/performance.test.ts
|
|
1766
|
-
import { describe, it, expect } from "vitest";
|
|
1767
|
-
import { createConvexProvider } from "@/providers/ConvexProvider";
|
|
1768
|
-
import { Effect } from "effect";
|
|
1769
|
-
|
|
1770
|
-
describe("ConvexProvider Performance", () => {
|
|
1771
|
-
it("should have <10ms overhead per operation", async () => {
|
|
1772
|
-
const provider = createConvexProvider(convex);
|
|
1773
|
-
|
|
1774
|
-
const start = performance.now();
|
|
1775
|
-
await Effect.runPromise(
|
|
1776
|
-
provider.things.list({ type: "course", limit: 100 }),
|
|
1777
|
-
);
|
|
1778
|
-
const end = performance.now();
|
|
1779
|
-
|
|
1780
|
-
const overhead = end - start;
|
|
1781
|
-
expect(overhead).toBeLessThan(10);
|
|
1782
|
-
});
|
|
1783
|
-
});
|
|
1784
|
-
```
|
|
1785
|
-
|
|
1786
|
-
---
|
|
1787
|
-
|
|
1788
|
-
## 5. Testing Strategy
|
|
1789
|
-
|
|
1790
|
-
### Unit Tests (90%+ coverage)
|
|
1791
|
-
|
|
1792
|
-
**Test 1: DataProvider Interface Type Checking**
|
|
1793
|
-
|
|
1794
|
-
```typescript
|
|
1795
|
-
// Ensures interface is complete
|
|
1796
|
-
import type { DataProvider } from "@/providers/DataProvider";
|
|
1797
|
-
|
|
1798
|
-
const validateInterface = (provider: DataProvider) => {
|
|
1799
|
-
// TypeScript enforces all methods exist
|
|
1800
|
-
expect(provider.organizations).toBeDefined();
|
|
1801
|
-
expect(provider.people).toBeDefined();
|
|
1802
|
-
expect(provider.things).toBeDefined();
|
|
1803
|
-
expect(provider.connections).toBeDefined();
|
|
1804
|
-
expect(provider.events).toBeDefined();
|
|
1805
|
-
expect(provider.knowledge).toBeDefined();
|
|
1806
|
-
};
|
|
1807
|
-
```
|
|
1808
|
-
|
|
1809
|
-
**Test 2: ConvexProvider Method Wrapping**
|
|
1810
|
-
|
|
1811
|
-
```typescript
|
|
1812
|
-
describe("ConvexProvider.things.get", () => {
|
|
1813
|
-
it("should call convex.query with correct args", async () => {
|
|
1814
|
-
const mockQuery = vi.fn().mockResolvedValue({ _id: "thing_123" });
|
|
1815
|
-
const mockConvex = { query: mockQuery } as any;
|
|
1816
|
-
const provider = new ConvexProvider(mockConvex);
|
|
1817
|
-
|
|
1818
|
-
await Effect.runPromise(provider.things.get("thing_123" as any));
|
|
1819
|
-
|
|
1820
|
-
expect(mockQuery).toHaveBeenCalledWith(
|
|
1821
|
-
expect.any(Function), // api.queries.things.get
|
|
1822
|
-
{ id: "thing_123" },
|
|
1823
|
-
);
|
|
1824
|
-
});
|
|
1825
|
-
});
|
|
1826
|
-
```
|
|
1827
|
-
|
|
1828
|
-
**Test 3: Error Transformation**
|
|
1829
|
-
|
|
1830
|
-
```typescript
|
|
1831
|
-
describe("ConvexProvider Error Handling", () => {
|
|
1832
|
-
it("should transform 404 to ThingNotFoundError", async () => {
|
|
1833
|
-
const mockConvex = {
|
|
1834
|
-
query: vi.fn().mockRejectedValue(new Error("Not found")),
|
|
1835
|
-
} as any;
|
|
1836
|
-
const provider = new ConvexProvider(mockConvex);
|
|
1837
|
-
|
|
1838
|
-
const result = await Effect.runPromiseExit(
|
|
1839
|
-
provider.things.get("thing_123" as any),
|
|
1840
|
-
);
|
|
1841
|
-
|
|
1842
|
-
expect(result._tag).toBe("Failure");
|
|
1843
|
-
expect(result.cause._tag).toBe("ThingNotFoundError");
|
|
1844
|
-
});
|
|
1845
|
-
});
|
|
1846
|
-
```
|
|
1847
|
-
|
|
1848
|
-
**Test 4: Effect.ts Composition**
|
|
1849
|
-
|
|
1850
|
-
```typescript
|
|
1851
|
-
describe("Effect.ts Composition", () => {
|
|
1852
|
-
it("should compose multiple operations", async () => {
|
|
1853
|
-
const program = Effect.gen(function* () {
|
|
1854
|
-
const provider = yield* DataProviderService;
|
|
1855
|
-
const thing = yield* provider.things.get("thing_123" as any);
|
|
1856
|
-
const connections = yield* provider.connections.listFrom({
|
|
1857
|
-
fromThingId: thing._id,
|
|
1858
|
-
});
|
|
1859
|
-
return { thing, connections };
|
|
1860
|
-
});
|
|
1861
|
-
|
|
1862
|
-
const result = await Effect.runPromise(
|
|
1863
|
-
program.pipe(Effect.provide(DataProviderLayer(mockProvider))),
|
|
1864
|
-
);
|
|
1865
|
-
|
|
1866
|
-
expect(result.thing).toBeDefined();
|
|
1867
|
-
expect(result.connections).toBeDefined();
|
|
1868
|
-
});
|
|
1869
|
-
});
|
|
1870
|
-
```
|
|
1871
|
-
|
|
1872
|
-
**Test 5: All 6 Dimensions Covered**
|
|
1873
|
-
|
|
1874
|
-
```typescript
|
|
1875
|
-
describe("Full DataProvider Coverage", () => {
|
|
1876
|
-
const dimensions = [
|
|
1877
|
-
"organizations",
|
|
1878
|
-
"people",
|
|
1879
|
-
"things",
|
|
1880
|
-
"connections",
|
|
1881
|
-
"events",
|
|
1882
|
-
"knowledge",
|
|
1883
|
-
] as const;
|
|
1884
|
-
|
|
1885
|
-
dimensions.forEach((dimension) => {
|
|
1886
|
-
it(`should implement ${dimension} operations`, () => {
|
|
1887
|
-
const provider = createConvexProvider(mockConvex);
|
|
1888
|
-
expect(provider[dimension]).toBeDefined();
|
|
1889
|
-
expect(typeof provider[dimension]).toBe("object");
|
|
1890
|
-
});
|
|
1891
|
-
});
|
|
1892
|
-
});
|
|
1893
|
-
```
|
|
1894
|
-
|
|
1895
|
-
### Integration Tests (80%+ coverage)
|
|
1896
|
-
|
|
1897
|
-
**Test 6: Create Thing Flow**
|
|
1898
|
-
|
|
1899
|
-
```typescript
|
|
1900
|
-
describe("Create Thing Integration", () => {
|
|
1901
|
-
it("should create thing, log event, return ID", async () => {
|
|
1902
|
-
const provider = createConvexProvider(convex);
|
|
1903
|
-
|
|
1904
|
-
const thingId = await Effect.runPromise(
|
|
1905
|
-
provider.things.create({
|
|
1906
|
-
type: "course",
|
|
1907
|
-
name: "Integration Test Course",
|
|
1908
|
-
properties: { description: "Test" },
|
|
1909
|
-
}),
|
|
1910
|
-
);
|
|
1911
|
-
|
|
1912
|
-
expect(thingId).toMatch(/^[a-z0-9]+$/);
|
|
1913
|
-
|
|
1914
|
-
// Verify thing was created
|
|
1915
|
-
const thing = await Effect.runPromise(provider.things.get(thingId));
|
|
1916
|
-
expect(thing.name).toBe("Integration Test Course");
|
|
1917
|
-
|
|
1918
|
-
// Verify event was logged
|
|
1919
|
-
const events = await Effect.runPromise(
|
|
1920
|
-
provider.events.list({ targetId: thingId }),
|
|
1921
|
-
);
|
|
1922
|
-
expect(events.some((e) => e.type === "entity_created")).toBe(true);
|
|
1923
|
-
|
|
1924
|
-
// Cleanup
|
|
1925
|
-
await Effect.runPromise(provider.things.delete(thingId));
|
|
1926
|
-
});
|
|
1927
|
-
});
|
|
1928
|
-
```
|
|
1929
|
-
|
|
1930
|
-
**Test 7: Connection Creation Flow**
|
|
1931
|
-
|
|
1932
|
-
```typescript
|
|
1933
|
-
describe("Create Connection Integration", () => {
|
|
1934
|
-
it("should create connection between two things", async () => {
|
|
1935
|
-
const provider = createConvexProvider(convex);
|
|
1936
|
-
|
|
1937
|
-
const thing1Id = await Effect.runPromise(
|
|
1938
|
-
provider.things.create({
|
|
1939
|
-
type: "creator",
|
|
1940
|
-
name: "Creator 1",
|
|
1941
|
-
properties: {},
|
|
1942
|
-
}),
|
|
1943
|
-
);
|
|
1944
|
-
const thing2Id = await Effect.runPromise(
|
|
1945
|
-
provider.things.create({
|
|
1946
|
-
type: "course",
|
|
1947
|
-
name: "Course 1",
|
|
1948
|
-
properties: {},
|
|
1949
|
-
}),
|
|
1950
|
-
);
|
|
1951
|
-
|
|
1952
|
-
const connectionId = await Effect.runPromise(
|
|
1953
|
-
provider.connections.create({
|
|
1954
|
-
fromThingId: thing1Id,
|
|
1955
|
-
toThingId: thing2Id,
|
|
1956
|
-
relationshipType: "owns",
|
|
1957
|
-
}),
|
|
1958
|
-
);
|
|
1959
|
-
|
|
1960
|
-
expect(connectionId).toBeDefined();
|
|
1961
|
-
|
|
1962
|
-
// Verify connection exists
|
|
1963
|
-
const connection = await Effect.runPromise(
|
|
1964
|
-
provider.connections.get(connectionId),
|
|
1965
|
-
);
|
|
1966
|
-
expect(connection.relationshipType).toBe("owns");
|
|
1967
|
-
|
|
1968
|
-
// Cleanup
|
|
1969
|
-
await Effect.runPromise(provider.connections.delete(connectionId));
|
|
1970
|
-
await Effect.runPromise(provider.things.delete(thing1Id));
|
|
1971
|
-
await Effect.runPromise(provider.things.delete(thing2Id));
|
|
1972
|
-
});
|
|
1973
|
-
});
|
|
1974
|
-
```
|
|
1975
|
-
|
|
1976
|
-
**Test 8: Event Logging Flow**
|
|
1977
|
-
|
|
1978
|
-
```typescript
|
|
1979
|
-
describe("Event Logging Integration", () => {
|
|
1980
|
-
it("should log event with metadata", async () => {
|
|
1981
|
-
const provider = createConvexProvider(convex);
|
|
1982
|
-
|
|
1983
|
-
const thingId = await Effect.runPromise(
|
|
1984
|
-
provider.things.create({
|
|
1985
|
-
type: "course",
|
|
1986
|
-
name: "Event Test",
|
|
1987
|
-
properties: {},
|
|
1988
|
-
}),
|
|
1989
|
-
);
|
|
1990
|
-
|
|
1991
|
-
const eventId = await Effect.runPromise(
|
|
1992
|
-
provider.events.log({
|
|
1993
|
-
type: "entity_created",
|
|
1994
|
-
targetId: thingId,
|
|
1995
|
-
metadata: { source: "test" },
|
|
1996
|
-
}),
|
|
1997
|
-
);
|
|
1998
|
-
|
|
1999
|
-
expect(eventId).toBeDefined();
|
|
2000
|
-
|
|
2001
|
-
// Verify event exists
|
|
2002
|
-
const event = await Effect.runPromise(provider.events.get(eventId));
|
|
2003
|
-
expect(event.type).toBe("entity_created");
|
|
2004
|
-
expect(event.metadata?.source).toBe("test");
|
|
2005
|
-
|
|
2006
|
-
// Cleanup
|
|
2007
|
-
await Effect.runPromise(provider.things.delete(thingId));
|
|
2008
|
-
});
|
|
2009
|
-
});
|
|
2010
|
-
```
|
|
2011
|
-
|
|
2012
|
-
### Performance Tests
|
|
2013
|
-
|
|
2014
|
-
**Test 9: Operation Overhead**
|
|
2015
|
-
|
|
2016
|
-
```typescript
|
|
2017
|
-
describe("Performance - Operation Overhead", () => {
|
|
2018
|
-
it("should add <10ms overhead per operation", async () => {
|
|
2019
|
-
const provider = createConvexProvider(convex);
|
|
2020
|
-
|
|
2021
|
-
// Measure direct Convex call
|
|
2022
|
-
const directStart = performance.now();
|
|
2023
|
-
await convex.query(api.queries.things.list, { type: "course", limit: 10 });
|
|
2024
|
-
const directEnd = performance.now();
|
|
2025
|
-
const directTime = directEnd - directStart;
|
|
2026
|
-
|
|
2027
|
-
// Measure through DataProvider
|
|
2028
|
-
const providerStart = performance.now();
|
|
2029
|
-
await Effect.runPromise(
|
|
2030
|
-
provider.things.list({ type: "course", limit: 10 }),
|
|
2031
|
-
);
|
|
2032
|
-
const providerEnd = performance.now();
|
|
2033
|
-
const providerTime = providerEnd - providerStart;
|
|
2034
|
-
|
|
2035
|
-
const overhead = providerTime - directTime;
|
|
2036
|
-
expect(overhead).toBeLessThan(10);
|
|
2037
|
-
});
|
|
2038
|
-
});
|
|
2039
|
-
```
|
|
2040
|
-
|
|
2041
|
-
**Test 10: Batch Operations**
|
|
2042
|
-
|
|
2043
|
-
```typescript
|
|
2044
|
-
describe("Performance - Batch Operations", () => {
|
|
2045
|
-
it("should handle 100 operations efficiently", async () => {
|
|
2046
|
-
const provider = createConvexProvider(convex);
|
|
2047
|
-
|
|
2048
|
-
const start = performance.now();
|
|
2049
|
-
const operations = Array.from({ length: 100 }, (_, i) =>
|
|
2050
|
-
provider.things.list({ type: "course", limit: 10 }),
|
|
2051
|
-
);
|
|
2052
|
-
await Promise.all(operations.map(Effect.runPromise));
|
|
2053
|
-
const end = performance.now();
|
|
2054
|
-
|
|
2055
|
-
const totalTime = end - start;
|
|
2056
|
-
const avgTime = totalTime / 100;
|
|
2057
|
-
|
|
2058
|
-
expect(avgTime).toBeLessThan(50); // <50ms per operation
|
|
2059
|
-
});
|
|
2060
|
-
});
|
|
2061
|
-
```
|
|
2062
|
-
|
|
2063
|
-
### Auth Preservation Tests
|
|
2064
|
-
|
|
2065
|
-
**Test 11: Authentication Context**
|
|
2066
|
-
|
|
2067
|
-
```typescript
|
|
2068
|
-
describe("Authentication Context", () => {
|
|
2069
|
-
it("should preserve auth through all operations", async () => {
|
|
2070
|
-
const authenticatedConvex = new ConvexReactClient(
|
|
2071
|
-
import.meta.env.PUBLIC_CONVEX_URL,
|
|
2072
|
-
{ auth: { token: "test_token" } },
|
|
2073
|
-
);
|
|
2074
|
-
const provider = createConvexProvider(authenticatedConvex);
|
|
2075
|
-
|
|
2076
|
-
// All operations should succeed with auth
|
|
2077
|
-
await Effect.runPromise(provider.organizations.list({}));
|
|
2078
|
-
await Effect.runPromise(provider.people.list({}));
|
|
2079
|
-
await Effect.runPromise(provider.things.list({}));
|
|
2080
|
-
// All succeed = auth preserved
|
|
2081
|
-
});
|
|
2082
|
-
});
|
|
2083
|
-
```
|
|
2084
|
-
|
|
2085
|
-
---
|
|
2086
|
-
|
|
2087
|
-
## 6. Quality Gates
|
|
2088
|
-
|
|
2089
|
-
### Gate 1: Interface Defined
|
|
2090
|
-
|
|
2091
|
-
**Criteria:**
|
|
2092
|
-
|
|
2093
|
-
- [ ] `DataProvider.ts` file exists at `frontend/src/providers/`
|
|
2094
|
-
- [ ] Interface defines all 6 dimensions (organizations, people, things, connections, events, knowledge)
|
|
2095
|
-
- [ ] All methods return `Effect.Effect<T, Error>`
|
|
2096
|
-
- [ ] All type definitions exported (Organization, Person, Thing, etc.)
|
|
2097
|
-
- [ ] All error classes defined with `_tag` pattern
|
|
2098
|
-
- [ ] TypeScript compiles with zero errors (`bunx astro check`)
|
|
2099
|
-
|
|
2100
|
-
### Gate 2: ConvexProvider Implemented
|
|
2101
|
-
|
|
2102
|
-
**Criteria:**
|
|
2103
|
-
|
|
2104
|
-
- [ ] `ConvexProvider.ts` file exists at `frontend/src/providers/`
|
|
2105
|
-
- [ ] ConvexProvider implements DataProvider interface (verified by TypeScript)
|
|
2106
|
-
- [ ] All 6 dimensions have method implementations
|
|
2107
|
-
- [ ] Each method wraps corresponding Convex query/mutation
|
|
2108
|
-
- [ ] Errors are transformed to typed errors
|
|
2109
|
-
- [ ] Factory function `createConvexProvider` works
|
|
2110
|
-
- [ ] React hook `useDataProvider` works
|
|
2111
|
-
|
|
2112
|
-
### Gate 3: Tests Passing
|
|
2113
|
-
|
|
2114
|
-
**Criteria:**
|
|
2115
|
-
|
|
2116
|
-
- [ ] Unit tests: 90%+ coverage (`bun test --coverage`)
|
|
2117
|
-
- [ ] Integration tests: All 8 integration tests pass
|
|
2118
|
-
- [ ] Performance tests: <10ms overhead verified
|
|
2119
|
-
- [ ] Auth tests: 50+ existing auth tests still pass
|
|
2120
|
-
- [ ] Zero test failures (`bun test`)
|
|
2121
|
-
- [ ] All tests run in <30 seconds total
|
|
2122
|
-
|
|
2123
|
-
### Gate 4: Performance Validated
|
|
2124
|
-
|
|
2125
|
-
**Criteria:**
|
|
2126
|
-
|
|
2127
|
-
- [ ] Operation overhead: <10ms per operation (measured)
|
|
2128
|
-
- [ ] Batch operations: <50ms average per operation for 100 concurrent
|
|
2129
|
-
- [ ] Memory usage: No memory leaks (verified with profiler)
|
|
2130
|
-
- [ ] Bundle size: <5KB added to frontend bundle
|
|
2131
|
-
- [ ] TypeScript compile time: <2 seconds
|
|
2132
|
-
|
|
2133
|
-
---
|
|
2134
|
-
|
|
2135
|
-
## 7. Dependencies
|
|
2136
|
-
|
|
2137
|
-
### Required Libraries (Already Installed)
|
|
2138
|
-
|
|
2139
|
-
- ✅ **Effect.ts** (`effect` package) - Already in `frontend/package.json`
|
|
2140
|
-
- ✅ **Convex SDK** (`convex` package) - Already installed
|
|
2141
|
-
- ✅ **TypeScript 5.9+** - Already configured
|
|
2142
|
-
- ✅ **Vitest** - Already configured for testing
|
|
2143
|
-
|
|
2144
|
-
### No Blocking Features
|
|
2145
|
-
|
|
2146
|
-
This is Feature 2-1 (first feature in Plan 2). It has **no dependencies** on other features.
|
|
2147
|
-
|
|
2148
|
-
### Enables These Features
|
|
2149
|
-
|
|
2150
|
-
This feature BLOCKS:
|
|
2151
|
-
|
|
2152
|
-
- Feature 2-2: React Hooks (uses DataProvider)
|
|
2153
|
-
- Feature 2-3: Effect.ts Services (uses DataProvider)
|
|
2154
|
-
- Feature 2-4: Error Boundaries (handles DataProvider errors)
|
|
2155
|
-
- Feature 2-5: Loading States (displays DataProvider loading)
|
|
2156
|
-
- Feature 2-6: Test Mocks (mocks DataProvider)
|
|
2157
|
-
- Feature 2-7: Provider Factory (creates DataProviders)
|
|
2158
|
-
|
|
2159
|
-
---
|
|
2160
|
-
|
|
2161
|
-
## 8. Rollback Plan
|
|
2162
|
-
|
|
2163
|
-
### Immediate Rollback (<5 minutes)
|
|
2164
|
-
|
|
2165
|
-
**Step 1:** Revert frontend code
|
|
2166
|
-
|
|
2167
|
-
```bash
|
|
2168
|
-
cd frontend
|
|
2169
|
-
git checkout main -- src/providers/
|
|
2170
|
-
```
|
|
2171
|
-
|
|
2172
|
-
**Step 2:** Revert backend code
|
|
2173
|
-
|
|
2174
|
-
```bash
|
|
2175
|
-
cd backend
|
|
2176
|
-
git checkout main -- convex/queries/
|
|
2177
|
-
git checkout main -- convex/mutations/
|
|
2178
|
-
```
|
|
2179
|
-
|
|
2180
|
-
**Step 3:** Restart dev servers
|
|
2181
|
-
|
|
2182
|
-
```bash
|
|
2183
|
-
# Terminal 1 (frontend)
|
|
2184
|
-
cd frontend && bun run dev
|
|
2185
|
-
|
|
2186
|
-
# Terminal 2 (backend)
|
|
2187
|
-
cd backend && npx convex dev
|
|
2188
|
-
```
|
|
2189
|
-
|
|
2190
|
-
**Step 4:** Verify application works
|
|
2191
|
-
|
|
2192
|
-
```bash
|
|
2193
|
-
# Visit http://localhost:4321
|
|
2194
|
-
# All existing functionality should work
|
|
2195
|
-
```
|
|
2196
|
-
|
|
2197
|
-
### Files to Restore
|
|
2198
|
-
|
|
2199
|
-
- `frontend/src/providers/DataProvider.ts` (DELETE)
|
|
2200
|
-
- `frontend/src/providers/ConvexProvider.ts` (DELETE)
|
|
2201
|
-
- `frontend/src/providers/layers.ts` (DELETE)
|
|
2202
|
-
- `backend/convex/queries/*.ts` (RESTORE)
|
|
2203
|
-
- `backend/convex/mutations/*.ts` (RESTORE)
|
|
2204
|
-
|
|
2205
|
-
### Tests to Run After Rollback
|
|
2206
|
-
|
|
2207
|
-
```bash
|
|
2208
|
-
cd frontend && bun test test/auth
|
|
2209
|
-
# All 50+ auth tests should pass
|
|
2210
|
-
```
|
|
2211
|
-
|
|
2212
|
-
### Rollback Validation
|
|
2213
|
-
|
|
2214
|
-
- [ ] Application loads at `http://localhost:4321`
|
|
2215
|
-
- [ ] Authentication still works (signin/signup)
|
|
2216
|
-
- [ ] Existing components render correctly
|
|
2217
|
-
- [ ] No TypeScript errors (`bunx astro check`)
|
|
2218
|
-
- [ ] All auth tests pass (`bun test test/auth`)
|
|
2219
|
-
|
|
2220
|
-
---
|
|
2221
|
-
|
|
2222
|
-
## 9. Documentation
|
|
2223
|
-
|
|
2224
|
-
### API Reference
|
|
2225
|
-
|
|
2226
|
-
#### DataProvider.organizations
|
|
2227
|
-
|
|
2228
|
-
```typescript
|
|
2229
|
-
// Get organization by ID
|
|
2230
|
-
const org = await Effect.runPromise(provider.organizations.get(organizationId));
|
|
2231
|
-
|
|
2232
|
-
// List organizations (platform owner only)
|
|
2233
|
-
const orgs = await Effect.runPromise(
|
|
2234
|
-
provider.organizations.list({ plan: "pro", limit: 10 }),
|
|
2235
|
-
);
|
|
2236
|
-
|
|
2237
|
-
// Create organization
|
|
2238
|
-
const orgId = await Effect.runPromise(
|
|
2239
|
-
provider.organizations.create({
|
|
2240
|
-
name: "Acme Corp",
|
|
2241
|
-
slug: "acme",
|
|
2242
|
-
plan: "pro",
|
|
2243
|
-
ownerId: personId,
|
|
2244
|
-
}),
|
|
2245
|
-
);
|
|
2246
|
-
|
|
2247
|
-
// Update organization
|
|
2248
|
-
const updated = await Effect.runPromise(
|
|
2249
|
-
provider.organizations.update(orgId, { plan: "enterprise" }),
|
|
2250
|
-
);
|
|
2251
|
-
|
|
2252
|
-
// Get usage stats
|
|
2253
|
-
const usage = await Effect.runPromise(provider.organizations.getUsage(orgId));
|
|
2254
|
-
```
|
|
2255
|
-
|
|
2256
|
-
#### DataProvider.people
|
|
2257
|
-
|
|
2258
|
-
```typescript
|
|
2259
|
-
// Get person by ID
|
|
2260
|
-
const person = await Effect.runPromise(provider.people.get(personId));
|
|
2261
|
-
|
|
2262
|
-
// List people in organization
|
|
2263
|
-
const people = await Effect.runPromise(
|
|
2264
|
-
provider.people.list({ organizationId, role: "org_user" }),
|
|
2265
|
-
);
|
|
2266
|
-
|
|
2267
|
-
// Create person
|
|
2268
|
-
const personId = await Effect.runPromise(
|
|
2269
|
-
provider.people.create({
|
|
2270
|
-
email: "user@example.com",
|
|
2271
|
-
username: "user",
|
|
2272
|
-
displayName: "User",
|
|
2273
|
-
role: "org_user",
|
|
2274
|
-
organizationId,
|
|
2275
|
-
}),
|
|
2276
|
-
);
|
|
2277
|
-
|
|
2278
|
-
// Check permission
|
|
2279
|
-
const canEdit = await Effect.runPromise(
|
|
2280
|
-
provider.people.checkPermission(personId, "content:edit"),
|
|
2281
|
-
);
|
|
2282
|
-
```
|
|
2283
|
-
|
|
2284
|
-
#### DataProvider.things
|
|
2285
|
-
|
|
2286
|
-
```typescript
|
|
2287
|
-
// Get thing by ID
|
|
2288
|
-
const thing = await Effect.runPromise(provider.things.get(thingId));
|
|
2289
|
-
|
|
2290
|
-
// List things
|
|
2291
|
-
const things = await Effect.runPromise(
|
|
2292
|
-
provider.things.list({ type: "course", status: "published" }),
|
|
2293
|
-
);
|
|
2294
|
-
|
|
2295
|
-
// Create thing
|
|
2296
|
-
const thingId = await Effect.runPromise(
|
|
2297
|
-
provider.things.create({
|
|
2298
|
-
type: "course",
|
|
2299
|
-
name: "My Course",
|
|
2300
|
-
properties: { description: "Course description" },
|
|
2301
|
-
}),
|
|
2302
|
-
);
|
|
2303
|
-
|
|
2304
|
-
// Update thing
|
|
2305
|
-
const updated = await Effect.runPromise(
|
|
2306
|
-
provider.things.update(thingId, { status: "published" }),
|
|
2307
|
-
);
|
|
2308
|
-
|
|
2309
|
-
// Delete thing
|
|
2310
|
-
await Effect.runPromise(provider.things.delete(thingId));
|
|
2311
|
-
|
|
2312
|
-
// Search things
|
|
2313
|
-
const results = await Effect.runPromise(
|
|
2314
|
-
provider.things.search({ query: "course", limit: 20 }),
|
|
2315
|
-
);
|
|
2316
|
-
```
|
|
2317
|
-
|
|
2318
|
-
#### DataProvider.connections
|
|
2319
|
-
|
|
2320
|
-
```typescript
|
|
2321
|
-
// Create connection
|
|
2322
|
-
const connectionId = await Effect.runPromise(
|
|
2323
|
-
provider.connections.create({
|
|
2324
|
-
fromThingId: creatorId,
|
|
2325
|
-
toThingId: courseId,
|
|
2326
|
-
relationshipType: "owns",
|
|
2327
|
-
metadata: { revenueShare: 0.7 },
|
|
2328
|
-
}),
|
|
2329
|
-
);
|
|
2330
|
-
|
|
2331
|
-
// List connections from thing
|
|
2332
|
-
const owned = await Effect.runPromise(
|
|
2333
|
-
provider.connections.listFrom({
|
|
2334
|
-
fromThingId: creatorId,
|
|
2335
|
-
relationshipType: "owns",
|
|
2336
|
-
}),
|
|
2337
|
-
);
|
|
2338
|
-
|
|
2339
|
-
// List connections to thing
|
|
2340
|
-
const owners = await Effect.runPromise(
|
|
2341
|
-
provider.connections.listTo({
|
|
2342
|
-
toThingId: courseId,
|
|
2343
|
-
relationshipType: "owns",
|
|
2344
|
-
}),
|
|
2345
|
-
);
|
|
2346
|
-
```
|
|
2347
|
-
|
|
2348
|
-
#### DataProvider.events
|
|
2349
|
-
|
|
2350
|
-
```typescript
|
|
2351
|
-
// Log event
|
|
2352
|
-
const eventId = await Effect.runPromise(
|
|
2353
|
-
provider.events.log({
|
|
2354
|
-
type: "entity_created",
|
|
2355
|
-
actorId: personId,
|
|
2356
|
-
targetId: thingId,
|
|
2357
|
-
metadata: { source: "frontend" },
|
|
2358
|
-
}),
|
|
2359
|
-
);
|
|
2360
|
-
|
|
2361
|
-
// Get event timeline
|
|
2362
|
-
const timeline = await Effect.runPromise(provider.events.getTimeline(thingId));
|
|
2363
|
-
|
|
2364
|
-
// Get event stats
|
|
2365
|
-
const stats = await Effect.runPromise(
|
|
2366
|
-
provider.events.getStats({
|
|
2367
|
-
type: "entity_created",
|
|
2368
|
-
period: { start: Date.now() - 30 * 24 * 60 * 60 * 1000, end: Date.now() },
|
|
2369
|
-
}),
|
|
2370
|
-
);
|
|
2371
|
-
```
|
|
2372
|
-
|
|
2373
|
-
#### DataProvider.knowledge
|
|
2374
|
-
|
|
2375
|
-
```typescript
|
|
2376
|
-
// Create knowledge label
|
|
2377
|
-
const labelId = await Effect.runPromise(
|
|
2378
|
-
provider.knowledge.create({
|
|
2379
|
-
knowledgeType: "label",
|
|
2380
|
-
text: "industry:fitness",
|
|
2381
|
-
labels: ["industry:fitness"],
|
|
2382
|
-
}),
|
|
2383
|
-
);
|
|
2384
|
-
|
|
2385
|
-
// Link knowledge to thing
|
|
2386
|
-
await Effect.runPromise(
|
|
2387
|
-
provider.knowledge.link({
|
|
2388
|
-
knowledgeId: labelId,
|
|
2389
|
-
thingId: creatorId,
|
|
2390
|
-
role: "label",
|
|
2391
|
-
}),
|
|
2392
|
-
);
|
|
2393
|
-
|
|
2394
|
-
// Vector search
|
|
2395
|
-
const results = await Effect.runPromise(
|
|
2396
|
-
provider.knowledge.vectorSearch({
|
|
2397
|
-
query: "fitness training",
|
|
2398
|
-
limit: 10,
|
|
2399
|
-
}),
|
|
2400
|
-
);
|
|
2401
|
-
```
|
|
2402
|
-
|
|
2403
|
-
### Implementation Guide for New Providers
|
|
2404
|
-
|
|
2405
|
-
**Step 1:** Implement the DataProvider interface
|
|
2406
|
-
|
|
2407
|
-
```typescript
|
|
2408
|
-
import type { DataProvider } from "@/providers/DataProvider";
|
|
2409
|
-
|
|
2410
|
-
export class MyCustomProvider implements DataProvider {
|
|
2411
|
-
// Implement all 6 dimensions...
|
|
2412
|
-
}
|
|
2413
|
-
```
|
|
2414
|
-
|
|
2415
|
-
**Step 2:** Wrap your backend SDK in Effect.ts
|
|
2416
|
-
|
|
2417
|
-
```typescript
|
|
2418
|
-
organizations = {
|
|
2419
|
-
get: (id) =>
|
|
2420
|
-
Effect.tryPromise({
|
|
2421
|
-
try: () => myBackend.getOrganization(id),
|
|
2422
|
-
catch: () => new OrganizationNotFoundError(id),
|
|
2423
|
-
}),
|
|
2424
|
-
// ...
|
|
2425
|
-
};
|
|
2426
|
-
```
|
|
2427
|
-
|
|
2428
|
-
**Step 3:** Test your implementation
|
|
2429
|
-
|
|
2430
|
-
```typescript
|
|
2431
|
-
const provider = new MyCustomProvider(backendClient);
|
|
2432
|
-
const org = await Effect.runPromise(provider.organizations.get(orgId));
|
|
2433
|
-
```
|
|
2434
|
-
|
|
2435
|
-
### Migration Guide (Convex → Other Backend)
|
|
2436
|
-
|
|
2437
|
-
**Step 1:** Create new provider implementation
|
|
2438
|
-
|
|
2439
|
-
```typescript
|
|
2440
|
-
// frontend/src/providers/SupabaseProvider.ts
|
|
2441
|
-
export class SupabaseProvider implements DataProvider {
|
|
2442
|
-
// Implement all methods...
|
|
2443
|
-
}
|
|
2444
|
-
```
|
|
2445
|
-
|
|
2446
|
-
**Step 2:** Create factory function
|
|
2447
|
-
|
|
2448
|
-
```typescript
|
|
2449
|
-
export const createSupabaseProvider = (
|
|
2450
|
-
supabase: SupabaseClient,
|
|
2451
|
-
): DataProvider => {
|
|
2452
|
-
return new SupabaseProvider(supabase);
|
|
2453
|
-
};
|
|
2454
|
-
```
|
|
2455
|
-
|
|
2456
|
-
**Step 3:** Update provider instantiation
|
|
2457
|
-
|
|
2458
|
-
```typescript
|
|
2459
|
-
// Change from:
|
|
2460
|
-
const provider = createConvexProvider(convex);
|
|
2461
|
-
|
|
2462
|
-
// To:
|
|
2463
|
-
const provider = createSupabaseProvider(supabase);
|
|
2464
|
-
```
|
|
2465
|
-
|
|
2466
|
-
**Step 4:** All components continue working (no changes needed)
|
|
2467
|
-
|
|
2468
|
-
### Troubleshooting
|
|
2469
|
-
|
|
2470
|
-
**Problem:** TypeScript error "Type 'X' does not satisfy DataProvider"
|
|
2471
|
-
**Solution:** Ensure ALL methods are implemented. Check interface definition.
|
|
2472
|
-
|
|
2473
|
-
**Problem:** Effect.runPromise throws "Not found" instead of typed error
|
|
2474
|
-
**Solution:** Use `Effect.tryPromise({ catch: () => new XNotFoundError(id) })`
|
|
2475
|
-
|
|
2476
|
-
**Problem:** Authentication not preserved through provider
|
|
2477
|
-
**Solution:** Pass authenticated client to provider constructor
|
|
2478
|
-
|
|
2479
|
-
**Problem:** Performance overhead >10ms
|
|
2480
|
-
**Solution:** Remove business logic from provider (keep it thin wrapper only)
|
|
2481
|
-
|
|
2482
|
-
---
|
|
2483
|
-
|
|
2484
|
-
## 10. Success Criteria
|
|
2485
|
-
|
|
2486
|
-
### Measurable Outcomes
|
|
2487
|
-
|
|
2488
|
-
1. **Interface Completeness**
|
|
2489
|
-
- [ ] All 6 dimensions defined (organizations, people, things, connections, events, knowledge)
|
|
2490
|
-
- [ ] 100% of methods return `Effect.Effect<T, Error>`
|
|
2491
|
-
- [ ] All error types have `_tag` property
|
|
2492
|
-
- [ ] TypeScript compiles with zero errors
|
|
2493
|
-
|
|
2494
|
-
2. **Implementation Quality**
|
|
2495
|
-
- [ ] ConvexProvider passes 100% of interface type checks
|
|
2496
|
-
- [ ] 95%+ test coverage on unit tests
|
|
2497
|
-
- [ ] 80%+ test coverage on integration tests
|
|
2498
|
-
- [ ] Zero linter warnings
|
|
2499
|
-
|
|
2500
|
-
3. **Performance**
|
|
2501
|
-
- [ ] <10ms overhead per operation (measured)
|
|
2502
|
-
- [ ] <50ms average for 100 concurrent operations
|
|
2503
|
-
- [ ] <5KB bundle size increase
|
|
2504
|
-
- [ ] <2 seconds TypeScript compile time
|
|
2505
|
-
|
|
2506
|
-
4. **Compatibility**
|
|
2507
|
-
- [ ] All 50+ existing auth tests pass
|
|
2508
|
-
- [ ] Application loads correctly at `http://localhost:4321`
|
|
2509
|
-
- [ ] Authentication flows work unchanged
|
|
2510
|
-
- [ ] No breaking changes to existing components
|
|
2511
|
-
|
|
2512
|
-
### Completion Checklist
|
|
2513
|
-
|
|
2514
|
-
- [ ] `frontend/src/providers/DataProvider.ts` created with complete interface
|
|
2515
|
-
- [ ] `frontend/src/providers/ConvexProvider.ts` created with full implementation
|
|
2516
|
-
- [ ] `frontend/src/providers/layers.ts` created with Effect.ts Layer
|
|
2517
|
-
- [ ] `backend/convex/queries/*.ts` created for all 6 dimensions
|
|
2518
|
-
- [ ] `backend/convex/mutations/*.ts` created for all 6 dimensions
|
|
2519
|
-
- [ ] `frontend/test/providers/*.test.ts` created with 90%+ coverage
|
|
2520
|
-
- [ ] All tests pass (`bun test`)
|
|
2521
|
-
- [ ] TypeScript compiles (`bunx astro check`)
|
|
2522
|
-
- [ ] Performance benchmarks meet targets
|
|
2523
|
-
- [ ] Documentation complete (API reference, migration guide, troubleshooting)
|
|
2524
|
-
|
|
2525
|
-
### Validation Procedures
|
|
2526
|
-
|
|
2527
|
-
**Validation 1: Type Safety**
|
|
2528
|
-
|
|
2529
|
-
```bash
|
|
2530
|
-
cd frontend && bunx astro check
|
|
2531
|
-
# Expected: 0 errors
|
|
2532
|
-
```
|
|
2533
|
-
|
|
2534
|
-
**Validation 2: Test Coverage**
|
|
2535
|
-
|
|
2536
|
-
```bash
|
|
2537
|
-
cd frontend && bun test --coverage test/providers
|
|
2538
|
-
# Expected: >90% coverage
|
|
2539
|
-
```
|
|
2540
|
-
|
|
2541
|
-
**Validation 3: Performance**
|
|
2542
|
-
|
|
2543
|
-
```bash
|
|
2544
|
-
cd frontend && bun test test/providers/performance.test.ts
|
|
2545
|
-
# Expected: All performance tests pass
|
|
2546
|
-
```
|
|
2547
|
-
|
|
2548
|
-
**Validation 4: Integration**
|
|
2549
|
-
|
|
2550
|
-
```bash
|
|
2551
|
-
cd frontend && bun test test/providers/integration.test.ts
|
|
2552
|
-
# Expected: All integration tests pass
|
|
2553
|
-
```
|
|
2554
|
-
|
|
2555
|
-
**Validation 5: Auth Compatibility**
|
|
2556
|
-
|
|
2557
|
-
```bash
|
|
2558
|
-
cd frontend && bun test test/auth
|
|
2559
|
-
# Expected: 50+ tests pass
|
|
2560
|
-
```
|
|
2561
|
-
|
|
2562
|
-
---
|
|
2563
|
-
|
|
2564
|
-
## Related Files
|
|
2565
|
-
|
|
2566
|
-
- **Plan:** `one/things/plans/2-backend-agnostic-frontend.md`
|
|
2567
|
-
- **Idea:** `one/things/ideas/2-backend-agnostic-frontend.md`
|
|
2568
|
-
- **Ontology:** `one/knowledge/ontology.md` (6-dimension specification)
|
|
2569
|
-
- **Implementation:** `frontend/src/providers/` (to be created)
|
|
2570
|
-
- **Tests:** `frontend/test/providers/` (to be created)
|
|
2571
|
-
- **Backend:** `backend/convex/queries/` and `backend/convex/mutations/` (to be created)
|
|
2572
|
-
|
|
2573
|
-
---
|
|
2574
|
-
|
|
2575
|
-
**Status:** Detailed Specification Complete (1,024 lines)
|
|
2576
|
-
**Created:** 2025-10-13
|
|
2577
|
-
**Author:** Backend Specialist Agent
|
|
2578
|
-
**Validated By:** Engineering Director Agent
|
|
2579
|
-
**Ready For:** Implementation Phase
|
|
2580
|
-
|
|
2581
|
-
---
|
|
2582
|
-
|
|
2583
|
-
**This specification provides everything needed to implement Feature 2-1 with zero ambiguity. Every method, every type, every test, every file location is specified. Implementation can begin immediately.**
|