oneie 3.6.12 → 3.6.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (775) hide show
  1. package/.claude/agents/AUDIT-agent-ops-alignment.md +379 -0
  2. package/.claude/agents/NEWS-QUICKSTART.md +321 -0
  3. package/.claude/agents/NEWS-README.md +353 -0
  4. package/.claude/agents/agent-backend.md +1 -1
  5. package/.claude/agents/agent-builder.md +220 -151
  6. package/.claude/agents/agent-clean.md +39 -31
  7. package/.claude/agents/agent-clone.md +107 -54
  8. package/.claude/agents/agent-designer.md +76 -71
  9. package/.claude/agents/agent-director.md +164 -1
  10. package/.claude/agents/agent-documenter.md +169 -132
  11. package/.claude/agents/agent-frontend.md +442 -446
  12. package/.claude/agents/agent-integrator.md +30 -23
  13. package/.claude/agents/agent-lawyer.md +145 -98
  14. package/.claude/agents/agent-news.md +363 -0
  15. package/.claude/agents/agent-onboard.md +99 -69
  16. package/.claude/agents/agent-ontology.md +585 -0
  17. package/.claude/agents/agent-ops.md +178 -171
  18. package/.claude/agents/agent-problem-solver.md +132 -115
  19. package/.claude/agents/agent-quality.md +94 -77
  20. package/.claude/agents/agent-sales.md +89 -67
  21. package/.claude/commands/release.md +3 -1
  22. package/.claude/commands/server.md +64 -5
  23. package/.claude/hooks/README-knowledge-hooks.md +266 -80
  24. package/.claude/hooks/README-root-cleanup.md +200 -0
  25. package/.claude/hooks/README.md +284 -0
  26. package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
  27. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  28. package/.claude/hooks/check-filenames.py +169 -32
  29. package/.claude/hooks/clean-post.py +195 -28
  30. package/.claude/hooks/clean-pre.py +96 -11
  31. package/.claude/hooks/done.py +74 -13
  32. package/.claude/hooks/format-hook.sh +105 -17
  33. package/.claude/hooks/hook-logger.sh +121 -7
  34. package/.claude/hooks/knowledge-post.py +136 -32
  35. package/.claude/hooks/knowledge-pre.py +129 -34
  36. package/.claude/hooks/notification-hook.sh +184 -17
  37. package/.claude/hooks/root-cleanup.py +181 -39
  38. package/.claude/hooks/security-hook.sh +248 -8
  39. package/.claude/hooks/tag-all-docs.py +175 -49
  40. package/.claude/hooks/test-validate-ontology.sh +170 -0
  41. package/.claude/hooks/todo.py +92 -22
  42. package/.claude/hooks/validate-ontology-structure-summary.md +243 -0
  43. package/.claude/hooks/validate-ontology-structure.py +83 -20
  44. package/AGENTS.md +60 -245
  45. package/CLAUDE.md +70 -1
  46. package/README.md +25 -0
  47. package/folders.yaml +1 -1
  48. package/one/.claude/settings.local.json +11 -0
  49. package/one/.obsidian/community-plugins.json +3 -1
  50. package/one/.obsidian/plugins/editing-toolbar/data.json +328 -0
  51. package/one/.obsidian/plugins/editing-toolbar/main.js +12 -0
  52. package/one/.obsidian/plugins/editing-toolbar/manifest.json +10 -0
  53. package/one/.obsidian/plugins/editing-toolbar/styles.css +1338 -0
  54. package/one/.obsidian/plugins/terminal/data.json +154 -0
  55. package/one/.obsidian/plugins/terminal/main.js +197 -0
  56. package/one/.obsidian/plugins/terminal/manifest.json +14 -0
  57. package/one/.obsidian/plugins/terminal/styles.css +32 -0
  58. package/one/.obsidian/workspace.json +71 -45
  59. package/one/README.md +18 -0
  60. package/one/connections/a2a.md +49 -0
  61. package/one/connections/acp.md +47 -0
  62. package/one/connections/acps.md +18 -0
  63. package/one/connections/agentkit.md +18 -0
  64. package/one/connections/agui.md +18 -0
  65. package/one/connections/any-backend.md +39 -21
  66. package/one/connections/ap2.md +74 -0
  67. package/one/connections/api/queries-reference.md +18 -0
  68. package/one/connections/api-docs.md +18 -0
  69. package/one/connections/api-reference.md +18 -0
  70. package/one/connections/api.md +18 -0
  71. package/one/connections/architecture-diagram.md +18 -0
  72. package/one/connections/communications.md +18 -0
  73. package/one/connections/connections.md +18 -0
  74. package/one/connections/copilotkit.md +18 -0
  75. package/one/connections/cryptonetworks.md +18 -0
  76. package/one/connections/documentation.md +18 -0
  77. package/one/connections/effect.md +18 -0
  78. package/one/connections/elizaos.md +18 -0
  79. package/one/connections/groups.md +814 -0
  80. package/one/connections/inference.md +18 -0
  81. package/one/connections/integration-examples.md +18 -0
  82. package/one/connections/integration-guide.md +18 -0
  83. package/one/connections/integration-phase2.md +32 -14
  84. package/one/connections/kyc.md +18 -0
  85. package/one/connections/mcp.md +18 -0
  86. package/one/connections/membership.md +18 -0
  87. package/one/connections/middleware.md +18 -0
  88. package/one/connections/multitenant.md +18 -0
  89. package/one/connections/n8n.md +18 -0
  90. package/one/connections/patterns.md +18 -0
  91. package/one/connections/protocols.md +20 -2
  92. package/one/connections/relationships.md +18 -0
  93. package/one/connections/schema.md +18 -0
  94. package/one/connections/service-layer.md +18 -0
  95. package/one/connections/vectors.md +18 -0
  96. package/one/connections/wordpress.md +18 -0
  97. package/one/connections/workflow-copy.md +18 -0
  98. package/one/connections/workflow-examples.md +18 -0
  99. package/one/connections/workflow-onboarding.md +18 -0
  100. package/one/connections/workflow.md +18 -0
  101. package/one/connections/workflows/delegation.md +18 -0
  102. package/one/connections/workflows/frontend.md +18 -0
  103. package/one/connections/workflows/strategy.md +18 -0
  104. package/one/connections/workflows/tasks.md +18 -0
  105. package/one/connections/x402-baazar.md +131 -0
  106. package/one/connections/x402.md +268 -164
  107. package/one/events/2024-10-14-deployment-plan.md +15 -16
  108. package/one/events/2024-10-14-deployment-success.md +15 -16
  109. package/one/events/2024-10-14-final-sync-complete.md +15 -16
  110. package/one/events/2024-10-14-release-v2.0.6.md +15 -16
  111. package/one/events/2024-10-15-agent-clean-v2-summary.md +15 -16
  112. package/one/events/2024-10-15-handoff-to-clean.md +15 -16
  113. package/one/events/2024-10-15-package-manager-tests.md +15 -16
  114. package/one/events/2024-10-15-release-command-complete.md +15 -16
  115. package/one/events/2025-10-15-private-files-secured.md +18 -0
  116. package/one/events/2025-10-15-unignore-public-group-docs.md +18 -0
  117. package/one/events/ALIGNMENT_REPORT_PROBLEM_SOLVER.md +335 -0
  118. package/one/events/ALIGNMENT_SUMMARY.md +280 -0
  119. package/one/events/API_ROUTES_FIXES_SUMMARY.md +18 -0
  120. package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +18 -0
  121. package/one/events/AUDIT-ONTOLOGY-ALIGNMENT.md +598 -0
  122. package/one/events/BEFORE_AFTER_COMPARISON.md +18 -0
  123. package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +18 -0
  124. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +18 -0
  125. package/one/events/CLAUDE copy.md +897 -0
  126. package/one/events/CLEANUP-RELEASE-V2.0.8.md +18 -0
  127. package/one/events/CONNECTIONS_DEMO.md +18 -0
  128. package/one/events/CREATE-WEBSITE.md +18 -0
  129. package/one/events/CRITICAL-FIXES-COMPLETE.md +18 -0
  130. package/one/events/CUSTOM-DOMAIN.md +18 -0
  131. package/one/events/DELIVERABLES.md +18 -0
  132. package/one/events/DEMO-GROUPS-PAGE.md +18 -0
  133. package/one/events/DEMO-TESTING-SUMMARY.md +18 -0
  134. package/one/events/DEMO_COMPONENTS.md +18 -0
  135. package/one/events/DEMO_HOOKS_INDEX.md +18 -0
  136. package/one/events/DEMO_INFRASTRUCTURE.md +18 -0
  137. package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +18 -0
  138. package/one/events/DEMO_INTEGRATION_CHECKLIST.md +18 -0
  139. package/one/events/DEMO_QUICK_REFERENCE.md +18 -0
  140. package/one/events/DEMO_SETUP.md +18 -0
  141. package/one/events/DEPLOYMENT copy.md +18 -0
  142. package/one/events/DEPLOYMENT.md +18 -0
  143. package/one/events/ECOMMERCE-BEFORE-AFTER.md +16 -0
  144. package/one/events/ECOMMERCE-DEMO-PLAN.md +18 -0
  145. package/one/events/ECOMMERCE-ENHANCEMENTS.md +18 -0
  146. package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +18 -0
  147. package/one/events/ECOMMERCE-LIVE-DEMO.md +18 -0
  148. package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +18 -0
  149. package/one/events/ECOMMERCE-SETUP-SUMMARY.md +18 -0
  150. package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +18 -0
  151. package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +18 -0
  152. package/one/events/EFFECT_TS_API_PATTERN.md +18 -0
  153. package/one/events/FEATURE-2-4-COMPLETE.md +18 -0
  154. package/one/events/FEATURE_2_3_COMPLETE.md +18 -0
  155. package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +18 -0
  156. package/one/events/GROUPS-MIGRATION.md +18 -0
  157. package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +18 -0
  158. package/one/events/HANDOFF.md +18 -0
  159. package/one/events/HOOKS-DEMO.md +18 -0
  160. package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +18 -0
  161. package/one/events/IMPLEMENTATION_SUMMARY.md +18 -0
  162. package/one/events/INSTALL-TESTS.md +18 -0
  163. package/one/events/INSTALLATION_FOLDERS.md +18 -0
  164. package/one/events/INSTALLATION_FOLDERS_FILES.md +18 -0
  165. package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +18 -0
  166. package/one/events/INTEGRATION-ARCHITECTURE.md +18 -0
  167. package/one/events/INTEGRATION-CHECKLIST.md +18 -0
  168. package/one/events/INTEGRATION-ORCHESTRATION.md +18 -0
  169. package/one/events/INTEGRATION-SUMMARY.md +18 -0
  170. package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +18 -0
  171. package/one/events/LANDING-PAGE-IMPLEMENTATION.md +18 -0
  172. package/one/events/LANDING-PAGE-QUICKSTART.md +18 -0
  173. package/one/events/LICENSE.md +18 -0
  174. package/one/events/MCP-CONFIGURATION.md +18 -0
  175. package/one/events/MCP-SETUP-COMPLETE.md +18 -0
  176. package/one/events/MIGRATION-REPORT.md +18 -0
  177. package/one/events/MIGRATION.md +18 -0
  178. package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +18 -0
  179. package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +18 -0
  180. package/one/events/NODE-UPGRADE.md +18 -0
  181. package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +18 -0
  182. package/one/events/ONTOLOGY-HOOKS-README.md +18 -0
  183. package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +18 -0
  184. package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +18 -0
  185. package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +18 -0
  186. package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +18 -0
  187. package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +18 -0
  188. package/one/events/PACKAGE-STRUCTURE.md +18 -0
  189. package/one/events/PLAYBOOK-SETUP-SUMMARY.md +18 -0
  190. package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +18 -0
  191. package/one/events/QA-CHECKLIST.md +18 -0
  192. package/one/events/QUICK-START-ONTOLOGY.md +18 -0
  193. package/one/events/README-archived.md +18 -0
  194. package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +18 -0
  195. package/one/events/SEARCH_DEMO_DELIVERY.md +18 -0
  196. package/one/events/SEARCH_DEMO_SUMMARY.md +18 -0
  197. package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +18 -0
  198. package/one/events/SECURITY-AUDIT-FIXES.md +18 -0
  199. package/one/events/SECURITY-SCAN-COMPLETE.md +18 -0
  200. package/one/events/SHOP-BUILD-STATUS.md +18 -0
  201. package/one/events/SHOP-PREMIUM-UPDATE.md +16 -0
  202. package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +18 -0
  203. package/one/events/SITE-WIDE-GRADIENT-FIX.md +18 -0
  204. package/one/events/STORE-PRODUCTION-READY-STATUS.md +18 -0
  205. package/one/events/STRIPE-INTEGRATION.md +18 -0
  206. package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +18 -0
  207. package/one/events/STRIPE-SETUP-GUIDE.md +18 -0
  208. package/one/events/TEST-PLAN-INDEX.md +18 -0
  209. package/one/events/TEST-PLAN.md +18 -0
  210. package/one/events/TEST-SUMMARY.md +18 -0
  211. package/one/events/TESTS-QUICK-REF.md +18 -0
  212. package/one/events/TRANSITIONS-QUICK-START.md +18 -0
  213. package/one/events/TRANSPARENCY-FIXES.md +18 -0
  214. package/one/events/TYPESCRIPT_FIXES.md +18 -0
  215. package/one/events/TYPESCRIPT_FIXES_INDEX.md +18 -0
  216. package/one/events/VIEW-TRANSITIONS.md +18 -0
  217. package/one/events/agent-director-enhancement-summary.md +18 -0
  218. package/one/events/agent-onboard-implementation-summary.md +18 -0
  219. package/one/events/agent-ontology-alignment-completion.md +263 -0
  220. package/one/events/backend-integration-tests.md +18 -0
  221. package/one/events/clean-agent-ontology-cleanup-report.md +18 -0
  222. package/one/events/clean-agent-todo-analysis-summary.md +336 -0
  223. package/one/events/cloudflare-automation-complete.md +18 -0
  224. package/one/events/cloudflare-pages-infrastructure-setup.md +18 -0
  225. package/one/events/contact-page-complete.md +18 -0
  226. package/one/events/convex-analysis-index.md +18 -0
  227. package/one/events/convex-structure-analysis.md +18 -0
  228. package/one/events/deployment-installation-folders.md +18 -0
  229. package/one/events/deployment-ops-summary.md +18 -0
  230. package/one/events/deployment-verification.md +18 -0
  231. package/one/events/design-spec-complete.md +18 -0
  232. package/one/events/documentation-audit-index.md +473 -0
  233. package/one/events/documentation-audit-summary.md +417 -0
  234. package/one/events/documentation-improvement-roadmap.md +906 -0
  235. package/one/events/documentation-standards-compliance-report.md +538 -0
  236. package/one/events/events.md +18 -0
  237. package/one/events/frontend-effects-complete.md +584 -0
  238. package/one/events/frontend-effects-orchestration.md +1356 -0
  239. package/one/events/frontend-effects-risk-register.md +1055 -0
  240. package/one/events/frontend-effects-week1-assignments.md +1594 -0
  241. package/one/events/hook-ontology-alignment-summary.md +528 -0
  242. package/one/events/installation-folders-workflow-integration.md +18 -0
  243. package/one/events/landing-page-generator.md +18 -0
  244. package/one/events/legal-assessment-2025-10-16.md +18 -0
  245. package/one/events/onboarding-implementation-complete.md +18 -0
  246. package/one/events/ontology-test-examples.md +18 -0
  247. package/one/events/phase1-backend-implementation-complete.md +18 -0
  248. package/one/events/release.md +18 -0
  249. package/one/events/root-cleanup-alignment-report.md +265 -0
  250. package/one/events/separate-implementation-status.md +18 -0
  251. package/one/events/session-summary-2025-10-18.md +18 -0
  252. package/one/events/skills-complete.md +18 -0
  253. package/one/events/skills-infer-6-10-summary.md +18 -0
  254. package/one/events/skills-phase1-complete.md +18 -0
  255. package/one/events/structural-analysis-architecture-vs-plans.md +559 -0
  256. package/one/events/test-dashboard.md +18 -0
  257. package/one/events/test-index.md +18 -0
  258. package/one/events/test-report-ontology.md +18 -0
  259. package/one/events/testing-summary.md +18 -0
  260. package/one/events/todo-refactoring-complete.md +408 -0
  261. package/one/events/wave1-backend-implementation-complete.md +698 -0
  262. package/one/groups/features.md +26 -0
  263. package/one/groups/groups.md +83 -39
  264. package/one/groups/one.md +47 -27
  265. package/one/groups/{strategy copy.md → strategy-copy.md} +23 -5
  266. package/one/knowledge/.obsidian/ecommerce-ontology.md +18 -0
  267. package/one/knowledge/100-inference-quick-reference.md +18 -0
  268. package/one/knowledge/agent-onboard-usage.md +18 -0
  269. package/one/knowledge/agentic-commerce.md +146 -0
  270. package/one/knowledge/ai-agents-vs-memecoins-thesis.md +683 -0
  271. package/one/knowledge/ai-platform.md +18 -0
  272. package/one/knowledge/ai-token-crypto-analysis-framework.md +1191 -0
  273. package/one/knowledge/ai-token-paradigm-shift-2025.md +732 -0
  274. package/one/knowledge/altcoin-cycle-prediction-ontology.md +884 -0
  275. package/one/knowledge/altcoin-cycle-trading-strategy.md +642 -0
  276. package/one/knowledge/architecture-any-backend.md +265 -42
  277. package/one/knowledge/architecture-diagram.md +404 -94
  278. package/one/knowledge/architecture-frontend.md +130 -51
  279. package/one/knowledge/architecture.md +1496 -1831
  280. package/one/knowledge/{ontology.md.backup → archived/ontology.old.md} +18 -0
  281. package/one/knowledge/astro-effect-complete-vision.md +2148 -0
  282. package/one/knowledge/astro-effect-simple-architecture.md +717 -0
  283. package/one/knowledge/audit-agent-onboard-alignment.md +481 -0
  284. package/one/knowledge/audit-agent-sales-alignment.md +444 -0
  285. package/one/knowledge/backend-api-reference.md +18 -0
  286. package/one/knowledge/cli-claude-handoff.md +18 -0
  287. package/one/knowledge/context-engineering.md +610 -0
  288. package/one/knowledge/crypto-analysis-strategy.md +1276 -0
  289. package/one/knowledge/crypto-cycle-2024-2025-analysis.md +44 -0
  290. package/one/knowledge/crypto.md +18 -0
  291. package/one/knowledge/docs.md +627 -0
  292. package/one/knowledge/dsl.md +18 -0
  293. package/one/knowledge/files.md +18 -0
  294. package/one/knowledge/frontend.md +18 -0
  295. package/one/knowledge/hono.md +18 -0
  296. package/one/knowledge/implementation-examples.md +18 -0
  297. package/one/knowledge/installation-folders.md +18 -0
  298. package/one/knowledge/institutional-cycle-paradigm-2025.md +555 -0
  299. package/one/knowledge/knowledge.md +18 -0
  300. package/one/knowledge/language.md +18 -0
  301. package/one/knowledge/lessons-learned.md +18 -0
  302. package/one/knowledge/lessons-website-building-focus.md +18 -0
  303. package/one/knowledge/merge-report.md +254 -0
  304. package/one/knowledge/nine-padel-playbook.md +18 -0
  305. package/one/knowledge/ontology-blog.yaml +42 -26
  306. package/one/knowledge/ontology-cheatsheet.md +18 -0
  307. package/one/knowledge/ontology-community.yaml +60 -37
  308. package/one/knowledge/ontology-core-universal.md +19 -1
  309. package/one/knowledge/ontology-core.yaml +58 -45
  310. package/one/knowledge/ontology-courses.yaml +71 -48
  311. package/one/knowledge/ontology-creator.md +30 -4
  312. package/one/knowledge/ontology-crypto.md +1603 -0
  313. package/one/knowledge/ontology-developer-guide.md +18 -0
  314. package/one/knowledge/ontology-documentation.md +46 -25
  315. package/one/knowledge/ontology-ecommerce.md +24 -6
  316. package/one/knowledge/ontology-education.md +18 -0
  317. package/one/knowledge/ontology-engineering-specification.md +22 -4
  318. package/one/knowledge/ontology-engineering.md +67 -43
  319. package/one/knowledge/ontology-files.yaml +525 -0
  320. package/one/knowledge/ontology-frontend-master.md +2898 -0
  321. package/one/knowledge/ontology-frontend-specifications.md +57 -49
  322. package/one/knowledge/ontology-frontend.md +40 -22
  323. package/one/knowledge/ontology-index.md +18 -0
  324. package/one/knowledge/ontology-minimal.yaml +18 -16
  325. package/one/knowledge/ontology-portfolio.yaml +40 -26
  326. package/one/knowledge/ontology-quickstart.md +18 -0
  327. package/one/knowledge/ontology-release.md +317 -0
  328. package/one/knowledge/ontology-shop.yaml +146 -119
  329. package/one/knowledge/ontology-tokens.yaml +46 -27
  330. package/one/knowledge/ontology-tutorial.md +18 -0
  331. package/one/knowledge/ontology-video-script.md +18 -0
  332. package/one/knowledge/ontology-visual-guide.md +20 -2
  333. package/one/knowledge/ontology.md +1329 -304
  334. package/one/knowledge/ontology.yaml +763 -275
  335. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +48 -18
  336. package/one/knowledge/patterns/backend/convex-query-pattern.md +78 -23
  337. package/one/knowledge/patterns/backend/mutation-template.md +28 -10
  338. package/one/knowledge/patterns/backend/query-template.md +44 -25
  339. package/one/knowledge/patterns/backend/service-template.md +35 -14
  340. package/one/knowledge/patterns/design/component-architecture.md +45 -9
  341. package/one/knowledge/patterns/design/test-driven-design-pattern.md +37 -3
  342. package/one/knowledge/patterns/design/wireframe-template.md +36 -2
  343. package/one/knowledge/patterns/frontend/component-template.md +91 -40
  344. package/one/knowledge/patterns/frontend/form-template.md +131 -59
  345. package/one/knowledge/patterns/frontend/page-template.md +59 -28
  346. package/one/knowledge/patterns/frontend/react-component-pattern.md +87 -27
  347. package/one/knowledge/patterns/test/acceptance-criteria-template.md +28 -10
  348. package/one/knowledge/patterns/test/technical-test-template.md +48 -26
  349. package/one/knowledge/patterns/test/test-driven-pattern.md +25 -5
  350. package/one/knowledge/patterns/test/user-flow-template.md +18 -0
  351. package/one/knowledge/provider-agnostic-content.md +995 -0
  352. package/one/knowledge/provider-creation-guide.md +18 -0
  353. package/one/knowledge/quality-loop.md +18 -0
  354. package/one/knowledge/readme-architecture.md +158 -0
  355. package/one/knowledge/readme.md +18 -0
  356. package/one/knowledge/rules.md +18 -0
  357. package/one/knowledge/score.md +18 -0
  358. package/one/knowledge/specifications.md +18 -0
  359. package/one/knowledge/tags.md +18 -0
  360. package/one/knowledge/todo-template.md +18 -0
  361. package/one/knowledge/todo.md +18 -0
  362. package/one/knowledge/typescript-patterns.md +18 -0
  363. package/one/knowledge/universal-generation-language.md +827 -0
  364. package/one/knowledge/x402-research.md +104 -0
  365. package/one/license.md +18 -0
  366. package/one/people/anthony-o-connell.md +48 -19
  367. package/one/people/people.md +54 -31
  368. package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +401 -0
  369. package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +588 -0
  370. package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +461 -0
  371. package/one/things/CHECKLIST.md +51 -0
  372. package/one/things/IMPLEMENTATION_STATUS.md +379 -0
  373. package/one/things/ONE.md +19 -1
  374. package/one/things/agents/agent-backend.md +198 -98
  375. package/one/things/agents/agent-builder.md +267 -158
  376. package/one/things/agents/agent-clean.md +40 -15
  377. package/one/things/agents/agent-clone.md +33 -50
  378. package/one/things/agents/agent-deploy.md +59 -11
  379. package/one/things/agents/agent-designer.md +274 -146
  380. package/one/things/agents/agent-director.md +20 -2
  381. package/one/things/agents/agent-documenter.md +126 -46
  382. package/one/things/agents/agent-frontend.md +104 -22
  383. package/one/things/agents/agent-integrator.md +153 -76
  384. package/one/things/agents/agent-lawyer.md +197 -92
  385. package/one/things/agents/agent-problem-solver.md +302 -224
  386. package/one/things/agents/agent-quality.md +149 -19
  387. package/one/things/agents/agent-sales.md +95 -7
  388. package/one/things/cascade/cascade.yaml +20 -3
  389. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +53 -0
  390. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +50 -0
  391. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +76 -0
  392. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +49 -3
  393. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +45 -0
  394. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +32 -0
  395. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +45 -3
  396. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +44 -0
  397. package/one/things/cascade/docs/examples/1-3-event-coordination.md +40 -1
  398. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +81 -25
  399. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +41 -0
  400. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +91 -16
  401. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +136 -73
  402. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +43 -0
  403. package/one/things/cascade/docs/examples/1-5-quality-loops.md +88 -4
  404. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +52 -3
  405. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +44 -1
  406. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +78 -14
  407. package/one/things/cascade/docs/examples/readme.md +37 -0
  408. package/one/things/cascade/docs/getting-started.md +18 -0
  409. package/one/things/cascade/docs/workflow.md +18 -12
  410. package/one/things/cascade/readme.md +43 -0
  411. package/one/things/cascade/templates/feature-template.md +28 -6
  412. package/one/things/claude/agents/advocacy-activation-manager.md +64 -39
  413. package/one/things/claude/agents/advocacy-campaign-designer.md +64 -39
  414. package/one/things/claude/agents/analyst.md +64 -39
  415. package/one/things/claude/agents/architect.md +64 -39
  416. package/one/things/claude/agents/brand-identity-specialist.md +64 -39
  417. package/one/things/claude/agents/bstp-token-strategist.md +48 -25
  418. package/one/things/claude/agents/builder-repo.md +69 -26
  419. package/one/things/claude/agents/bullstamp-community-builder.md +48 -25
  420. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +48 -25
  421. package/one/things/claude/agents/bulltilt-platform-growth.md +48 -25
  422. package/one/things/claude/agents/company-bullstamp-character.md +45 -30
  423. package/one/things/claude/agents/company-bullstamp-community.md +45 -30
  424. package/one/things/claude/agents/company-bullstamp-marketing.md +45 -30
  425. package/one/things/claude/agents/company-bullstamp-token.md +45 -30
  426. package/one/things/claude/agents/company-bulltilt-growth.md +45 -30
  427. package/one/things/claude/agents/content-bibliography-formatter.md +48 -25
  428. package/one/things/claude/agents/content-calendar-planner.md +59 -34
  429. package/one/things/claude/agents/content-chapter-formatter.md +60 -35
  430. package/one/things/claude/agents/content-formatter.md +59 -34
  431. package/one/things/claude/agents/content-hook-specialist.md +54 -31
  432. package/one/things/claude/agents/content-image-formatter.md +59 -34
  433. package/one/things/claude/agents/content-introduction-formatter.md +59 -34
  434. package/one/things/claude/agents/content-multiplication-engine.md +54 -31
  435. package/one/things/claude/agents/content-playbook-writer.md +60 -35
  436. package/one/things/claude/agents/content-team-manager.md +59 -34
  437. package/one/things/claude/agents/content-toc-formatter.md +60 -35
  438. package/one/things/claude/agents/convex-backend-specialist.md +380 -216
  439. package/one/things/claude/agents/core-manager.md +59 -34
  440. package/one/things/claude/agents/core-master.md +55 -32
  441. package/one/things/claude/agents/cross-functional-manager.md +46 -41
  442. package/one/things/claude/agents/crypto-airdrop-strategist.md +74 -54
  443. package/one/things/claude/agents/crypto-analytics-educator.md +73 -30
  444. package/one/things/claude/agents/crypto-architecture-specialist.md +70 -39
  445. package/one/things/claude/agents/crypto-community-analyst.md +47 -31
  446. package/one/things/claude/agents/crypto-community-psychologist.md +68 -31
  447. package/one/things/claude/agents/crypto-dex-optimization-expert.md +72 -31
  448. package/one/things/claude/agents/crypto-dex-optimizer.md +45 -30
  449. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +69 -30
  450. package/one/things/claude/agents/crypto-diamond-hands.md +45 -30
  451. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +73 -30
  452. package/one/things/claude/agents/crypto-engagement-specialist.md +71 -30
  453. package/one/things/claude/agents/crypto-market-researcher.md +45 -30
  454. package/one/things/claude/agents/crypto-marketing-orchestrator.md +74 -34
  455. package/one/things/claude/agents/crypto-network-effect-amplifier.md +75 -30
  456. package/one/things/claude/agents/crypto-optimization-analyst.md +73 -30
  457. package/one/things/claude/agents/crypto-strategic-synthesizer.md +69 -30
  458. package/one/things/claude/agents/crypto-team-manager.md +45 -40
  459. package/one/things/claude/agents/crypto-token-analyst.md +66 -25
  460. package/one/things/claude/agents/crypto-viral-content-creator.md +64 -61
  461. package/one/things/claude/agents/crypto-wallet-identification-expert.md +61 -51
  462. package/one/things/claude/agents/crypto-wallet-identifier.md +45 -30
  463. package/one/things/claude/agents/customer-journey-designer.md +51 -58
  464. package/one/things/claude/agents/customer-success-manager.md +51 -58
  465. package/one/things/claude/agents/dev.md +51 -58
  466. package/one/things/claude/agents/documenter.md +71 -69
  467. package/one/things/claude/agents/elevate-marketing-orchestrator.md +45 -52
  468. package/one/things/claude/agents/engagement-specialist.md +45 -52
  469. package/one/things/claude/agents/engineering-architect.md +54 -54
  470. package/one/things/claude/agents/engineering-business-analyst.md +46 -56
  471. package/one/things/claude/agents/engineering-developer.md +51 -52
  472. package/one/things/claude/agents/engineering-director.md +65 -25
  473. package/one/things/claude/agents/engineering-ingestor.md +110 -100
  474. package/one/things/claude/agents/engineering-product-manager.md +43 -55
  475. package/one/things/claude/agents/engineering-product-owner.md +46 -56
  476. package/one/things/claude/agents/engineering-project-coordinator.md +44 -56
  477. package/one/things/claude/agents/engineering-quality-assurance.md +53 -54
  478. package/one/things/claude/agents/engineering-team-manager.md +46 -43
  479. package/one/things/claude/agents/engineering-user-experience.md +51 -52
  480. package/one/things/claude/agents/framework-elevate-manager.md +45 -30
  481. package/one/things/claude/agents/improver.md +120 -78
  482. package/one/things/claude/agents/intelligence-team-manager.md +45 -40
  483. package/one/things/claude/agents/lead-capture-expert.md +45 -52
  484. package/one/things/claude/agents/lead-magnet-creator.md +45 -52
  485. package/one/things/claude/agents/market-research-analyst.md +48 -25
  486. package/one/things/claude/agents/marketing-brand-identity.md +57 -27
  487. package/one/things/claude/agents/marketing-content-hooks.md +45 -40
  488. package/one/things/claude/agents/marketing-content-multiplier.md +45 -40
  489. package/one/things/claude/agents/marketing-content-poster.md +71 -60
  490. package/one/things/claude/agents/marketing-customer-journey.md +45 -40
  491. package/one/things/claude/agents/marketing-director.md +46 -41
  492. package/one/things/claude/agents/marketing-engagement.md +45 -40
  493. package/one/things/claude/agents/marketing-lead-capture.md +45 -40
  494. package/one/things/claude/agents/marketing-lead-magnet.md +45 -40
  495. package/one/things/claude/agents/marketing-network-effects.md +45 -40
  496. package/one/things/claude/agents/marketing-nurture-campaigns.md +45 -40
  497. package/one/things/claude/agents/marketing-share-optimizer.md +45 -40
  498. package/one/things/claude/agents/marketing-team-manager.md +45 -40
  499. package/one/things/claude/agents/marketing-viral-growth.md +49 -18
  500. package/one/things/claude/agents/mission-commander.md +45 -40
  501. package/one/things/claude/agents/network-effect-analyst.md +48 -31
  502. package/one/things/claude/agents/nextjs-15-specialist.md +209 -122
  503. package/one/things/claude/agents/npx.md +126 -70
  504. package/one/things/claude/agents/nurture-campaign-manager.md +48 -25
  505. package/one/things/claude/agents/one-master.md +48 -25
  506. package/one/things/claude/agents/one-orchestrator.md +57 -27
  507. package/one/things/claude/agents/one.md +88 -31
  508. package/one/things/claude/agents/playbook-generator.md +48 -25
  509. package/one/things/claude/agents/pm.md +48 -25
  510. package/one/things/claude/agents/po.md +51 -26
  511. package/one/things/claude/agents/qa.md +50 -25
  512. package/one/things/claude/agents/research-foundation-analyst.md +48 -31
  513. package/one/things/claude/agents/research-intelligence-gatherer.md +59 -32
  514. package/one/things/claude/agents/research-market-analyst.md +47 -30
  515. package/one/things/claude/agents/research-team-manager.md +47 -40
  516. package/one/things/claude/agents/sales-environment-optimizer.md +50 -25
  517. package/one/things/claude/agents/sales-team-manager.md +47 -40
  518. package/one/things/claude/agents/sales-upsell-strategist.md +47 -30
  519. package/one/things/claude/agents/service-advocacy-campaigns.md +47 -30
  520. package/one/things/claude/agents/service-advocacy-manager.md +47 -30
  521. package/one/things/claude/agents/service-success-manager.md +47 -30
  522. package/one/things/claude/agents/service-team-manager.md +45 -40
  523. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +85 -30
  524. package/one/things/claude/agents/share-optimization-specialist.md +50 -25
  525. package/one/things/claude/agents/sm.md +50 -25
  526. package/one/things/claude/agents/story-teller.md +51 -26
  527. package/one/things/claude/agents/task-master.md +52 -27
  528. package/one/things/claude/agents/tauri-cross-platform-specialist.md +201 -116
  529. package/one/things/claude/agents/tester.md +85 -46
  530. package/one/things/claude/agents/the-bull-character-manager.md +48 -25
  531. package/one/things/claude/agents/tools-playbook-generator.md +43 -40
  532. package/one/things/claude/agents/turbo-repo-builder.md +57 -27
  533. package/one/things/claude/agents/upsell-strategist.md +48 -25
  534. package/one/things/claude/agents/ux-expert.md +50 -25
  535. package/one/things/claude/agents/viral-growth-orchestrator.md +50 -27
  536. package/one/things/claude/commands/agent.md +25 -5
  537. package/one/things/claude/commands/cascade-status.md +33 -8
  538. package/one/things/claude/commands/ingest.md +64 -11
  539. package/one/things/claude/commands/ingestor.md +29 -7
  540. package/one/things/claude/commands/mission.md +24 -4
  541. package/one/things/claude/commands/npx.md +30 -7
  542. package/one/things/claude/commands/one.md +114 -68
  543. package/one/things/claude/commands/quality-check.md +72 -24
  544. package/one/things/claude/commands/smart-route.md +45 -4
  545. package/one/things/claude/commands/start.md +22 -4
  546. package/one/things/claude/commands/story.md +25 -5
  547. package/one/things/claude/commands/task.md +21 -1
  548. package/one/things/cli/cli-code.md +244 -219
  549. package/one/things/cli/cli-compiler-code.md +244 -219
  550. package/one/things/cli/cli.md +30 -6
  551. package/one/things/components/card-shadcn.md +252 -228
  552. package/one/things/components/card.md +315 -324
  553. package/one/things/components.md +667 -593
  554. package/one/things/componets.md +16 -1
  555. package/one/things/creator-diagram.md +23 -5
  556. package/one/things/demo-accessibility-animations.md +73 -47
  557. package/one/things/demo-components.md +225 -219
  558. package/one/things/demo-design-summary.md +89 -26
  559. package/one/things/demo-design-system.md +184 -130
  560. package/one/things/demo-page-layouts.md +52 -25
  561. package/one/things/designs/accessibility-audit.md +153 -66
  562. package/one/things/designs/component-specifications.md +163 -65
  563. package/one/things/designs/design-overview.md +81 -22
  564. package/one/things/designs/design-tokens.md +127 -93
  565. package/one/things/designs/wireframes-dashboard.md +64 -7
  566. package/one/things/docs/api-requests.md +75 -11
  567. package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +18 -0
  568. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +57 -0
  569. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +62 -6
  570. package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +60 -5
  571. package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +95 -27
  572. package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +130 -62
  573. package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +43 -19
  574. package/one/things/docs/ecommerce/QUICK-START.md +41 -4
  575. package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +75 -6
  576. package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +58 -24
  577. package/one/things/examples/children/lemonade-stand.md +52 -14
  578. package/one/things/examples/enterprise/crm-saas.md +43 -28
  579. package/one/things/features/1-1-agent-prompts.md +76 -0
  580. package/one/things/features/1-2-yaml-orchestrator.md +32 -0
  581. package/one/things/features/1-3-event-coordination.md +40 -1
  582. package/one/things/features/1-4-knowledge-management.md +91 -16
  583. package/one/things/features/1-5-quality-loops.md +88 -4
  584. package/one/things/features/1-6-numbering-structure.md +78 -14
  585. package/one/things/features/2-1-dataprovider-interface.md +311 -86
  586. package/one/things/features/2-2-config-system.md +307 -140
  587. package/one/things/features/2-3-effectts-services.md +263 -116
  588. package/one/things/features/2-4-react-hooks.md +217 -201
  589. package/one/things/features/2-5-auth-migration.md +406 -308
  590. package/one/things/features/2-6-dashboard-migration.md +112 -13
  591. package/one/things/features/2-7-alternative-providers.md +138 -65
  592. package/one/things/features/2-7-implementation-report.md +68 -24
  593. package/one/things/features/2-cli.md +88 -76
  594. package/one/things/features/2-design.md +112 -80
  595. package/one/things/features/2-tests.md +56 -0
  596. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +91 -36
  597. package/one/things/features/DECOUPLING.md +36 -18
  598. package/one/things/features/DEPLOYMENT.md +22 -4
  599. package/one/things/features/IMPLEMENTATION_SUMMARY.md +48 -2
  600. package/one/things/features/improve.md +47 -29
  601. package/one/things/features/remove-convex-deps.md +18 -0
  602. package/one/things/features/top-features.md +28 -20
  603. package/one/things/features/use-one-backend.md +210 -173
  604. package/one/things/features-in-english.md +19 -6
  605. package/one/things/files.yaml +721 -0
  606. package/one/things/ideas/1-create-workflow.md +18 -0
  607. package/one/things/ideas/2-backend-agnostic-frontend.md +57 -2
  608. package/one/things/implementation/backend-guide.md +64 -19
  609. package/one/things/interface.md +43 -0
  610. package/one/things/landing-page-implementation.md +455 -0
  611. package/one/things/legal/README.md +44 -0
  612. package/one/things/legal/privacy-policy.md +186 -23
  613. package/one/things/legal/terms-of-service.md +164 -3
  614. package/one/things/master-workflow-plan.md +806 -0
  615. package/one/things/plans/0-timeline.md +36 -0
  616. package/one/things/plans/1-create-workflow.md +19 -0
  617. package/one/things/plans/QUICK-START-SIMPLIFICATION.md +333 -0
  618. package/one/things/plans/README-SIMPLIFICATION.md +349 -0
  619. package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +16 -0
  620. package/one/things/plans/SIMPLIFICATION-SUMMARY.md +455 -0
  621. package/one/things/plans/ai-elements.md +21 -2
  622. package/one/things/plans/ai-integration.md +108 -59
  623. package/one/things/plans/ai-sdk.md +85 -48
  624. package/one/things/plans/ai-tools.md +621 -0
  625. package/one/things/plans/app.md +142 -71
  626. package/one/things/plans/architecture-summary.md +34 -5
  627. package/one/things/plans/async-ai-agents.md +19 -1
  628. package/one/things/plans/backend-agnostic-frontend.md +70 -8
  629. package/one/things/plans/backend-cleanup-quickstart.md +52 -18
  630. package/one/things/plans/backend-ontology-conformance.md +110 -51
  631. package/one/things/plans/backend-status.md +58 -0
  632. package/one/things/plans/backend-structure.md +103 -55
  633. package/one/things/plans/backend-target-structure.md +61 -17
  634. package/one/things/plans/backend.md +60 -18
  635. package/one/things/plans/better-auth-any-backend-revised.md +325 -287
  636. package/one/things/plans/better-auth-any-backend.md +575 -531
  637. package/one/things/plans/better-auth-available-features.md +43 -5
  638. package/one/things/plans/big-plan.md +20 -6
  639. package/one/things/plans/cli-updates-required.md +44 -4
  640. package/one/things/plans/complete-step-by-step.md +223 -116
  641. package/one/things/plans/components.md +709 -0
  642. package/one/things/plans/convex-agents.md +79 -50
  643. package/one/things/plans/convex-better-auth.md +186 -154
  644. package/one/things/plans/convex-on-off.md +47 -29
  645. package/one/things/plans/crypto-token-researcher.md +629 -0
  646. package/one/things/plans/data-quality-metrics.md +745 -0
  647. package/one/things/plans/deep-researcher-agent.md +466 -0
  648. package/one/things/plans/deploy-to-cloudflare.md +55 -13
  649. package/one/things/plans/deployment-architecture.md +54 -11
  650. package/one/things/plans/desktop.md +21 -3
  651. package/one/things/plans/development-plan.md +184 -121
  652. package/one/things/plans/development-workflow-tldr.md +207 -0
  653. package/one/things/plans/development-workflow.md +959 -0
  654. package/one/things/plans/effect-components.md +667 -593
  655. package/one/things/plans/effect-patterns-reference.md +2235 -0
  656. package/one/things/plans/effect.md +204 -131
  657. package/one/things/plans/email.md +21 -8
  658. package/one/things/plans/enhance-auth.md +64 -41
  659. package/one/things/plans/execution-strategy.md +1291 -0
  660. package/one/things/plans/existing-infrastructure.md +712 -0
  661. package/one/things/plans/feature-based-sites.md +124 -51
  662. package/one/things/plans/frontend-effects.md +1276 -0
  663. package/one/things/plans/group-folder-multi-tenancy.md +92 -29
  664. package/one/things/plans/improve-codebase.md +498 -421
  665. package/one/things/plans/install-components.md +18 -1
  666. package/one/things/plans/integrate-frontend-and-backend.md +68 -44
  667. package/one/things/plans/landing.md +92 -0
  668. package/one/things/plans/layout.md +45 -1
  669. package/one/things/plans/mail-backend.md +546 -493
  670. package/one/things/plans/mail.md +379 -326
  671. package/one/things/plans/mcp-clear-context-prompt.md +21 -0
  672. package/one/things/plans/mcp-simple.md +20 -0
  673. package/one/things/plans/multi-ontology-architecture.md +115 -66
  674. package/one/things/plans/next-features.md +31 -0
  675. package/one/things/plans/onboarding.md +20 -1
  676. package/one/things/plans/one.md +18 -0
  677. package/one/things/plans/ontology-6-dimensions.md +24 -45
  678. package/one/things/plans/ontology-compliance-audit.md +315 -0
  679. package/one/things/plans/ontology-driven-strategy.md +19 -3
  680. package/one/things/plans/ontology-refine.md +586 -0
  681. package/one/things/plans/ontology-ui-approach.md +18 -0
  682. package/one/things/plans/open-agent.md +152 -97
  683. package/one/things/plans/performace.md +32 -0
  684. package/one/things/plans/phase-1-foundation.md +620 -0
  685. package/one/things/plans/phase-3-implementation.md +1037 -0
  686. package/one/things/plans/quick-wins.md +342 -187
  687. package/one/things/plans/readme-backend-cleanup.md +54 -13
  688. package/one/things/plans/release.md +55 -2
  689. package/one/things/plans/repos.md +22 -0
  690. package/one/things/plans/separate-copy-2.md +127 -71
  691. package/one/things/plans/separate-copy-3.md +35 -14
  692. package/one/things/plans/separate-copy.md +127 -71
  693. package/one/things/plans/separate-demo.md +37 -3
  694. package/one/things/plans/separate.md +24 -6
  695. package/one/things/plans/sequence.md +155 -12
  696. package/one/things/plans/shadcn-integration-summary.md +104 -44
  697. package/one/things/plans/sidebar.md +44 -10
  698. package/one/things/plans/skills.md +103 -0
  699. package/one/things/plans/small-fixes.md +19 -1
  700. package/one/things/plans/start-new.md +34 -8
  701. package/one/things/plans/switch-off-auth.md +22 -0
  702. package/one/things/plans/sync-checklist.md +30 -0
  703. package/one/things/plans/test-backend-connection.md +38 -0
  704. package/one/things/plans/unified-implementation-plan.md +144 -62
  705. package/one/things/plans/update-demos.md +103 -35
  706. package/one/things/plans/use-our-backend.md +572 -0
  707. package/one/things/plans/wave1-onboarding-100-inferences.md +1686 -0
  708. package/one/things/plans/wave1-onboarding-vision.md +744 -0
  709. package/one/things/plans/wave1-orchestration-summary.md +604 -0
  710. package/one/things/plans/wave1-specialist-assignments.md +1413 -0
  711. package/one/things/plans/workflow-files.md +28 -14
  712. package/one/things/plans/workflow.md +18 -12
  713. package/one/things/products/cascade-landing-page.md +150 -46
  714. package/one/things/products/cascade.md +185 -135
  715. package/one/things/products/context-engineering.md +411 -350
  716. package/one/things/products/onthology.md +15 -0
  717. package/one/things/products/ontology-ui-shadcn.md +375 -353
  718. package/one/things/products/ontology-ui.md +101 -59
  719. package/one/things/products/ontology.md +90 -18
  720. package/one/things/products/sdk.md +181 -165
  721. package/one/things/promptkit.md +70 -43
  722. package/one/things/repos/all-repos.md +0 -0
  723. package/one/things/service-providers-new.md +95 -25
  724. package/one/things/service-providers.md +231 -202
  725. package/one/things/structure.md +532 -0
  726. package/one/things/system.md +18 -0
  727. package/one/things/templates.md +40 -0
  728. package/one/things/tests/2-1-dataprovider-interface.md +103 -31
  729. package/one/things/tests/2-1-test-analysis.md +65 -17
  730. package/one/things/things.md +48 -13
  731. package/one/things/todo-acp-integration.md +744 -0
  732. package/one/things/todo-ai.md +933 -0
  733. package/one/things/todo-api.md +1078 -0
  734. package/one/things/todo-assignment.md +580 -0
  735. package/one/things/todo-buy-chatgpt.md +1450 -0
  736. package/one/things/todo-components.md +1683 -0
  737. package/one/things/todo-connections.md +278 -0
  738. package/one/things/todo-ecommerce-frontend.md +1313 -0
  739. package/one/things/todo-ecommerce.md +569 -0
  740. package/one/things/todo-effects.md +1075 -0
  741. package/one/things/todo-frontend-effects.md +977 -0
  742. package/one/things/todo-landing-page.md +1091 -0
  743. package/one/things/todo-mail.md +1160 -0
  744. package/one/things/todo-master-plan.md +490 -0
  745. package/one/things/todo-onboard.md +666 -0
  746. package/one/things/todo-one-ie.md +538 -0
  747. package/one/things/todo-page.md +606 -0
  748. package/one/things/todo-plans.md +282 -0
  749. package/one/things/todo-projects.md +241 -0
  750. package/one/things/todo-refactoring-plan.md +366 -0
  751. package/one/things/todo-sequence.md +1621 -0
  752. package/one/things/todo-use-our-backend.md +1908 -0
  753. package/one/things/todo-workflow.md +626 -0
  754. package/one/things/todo-x402.md +2047 -0
  755. package/one/things/todo.md +459 -1075
  756. package/one/things/video/scripts-crypto.md +835 -0
  757. package/one/things/video-script-ontology.md +334 -0
  758. package/package.json +1 -1
  759. package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +0 -49
  760. package/one/knowledge/docs/flow.md +0 -0
  761. package/one/knowledge/documentation-summary.md +0 -285
  762. package/one/knowledge/inference-score.md +0 -159
  763. package/one/knowledge/ontology-frontend-copy-2.md +0 -1492
  764. package/one/knowledge/ontology-frontend-copy.md +0 -753
  765. package/one/knowledge/ontology-migration-guide.md +0 -811
  766. package/one/things/features/0 All Features.md +0 -2
  767. package/one/things/plans/1-create-workflow-status.md +0 -555
  768. package/one/things/plans/2-backend-agnostic-frontend.md +0 -546
  769. package/one/things/plans/2-sites.md +0 -895
  770. package/one/things/plans/3-groups.md +0 -735
  771. package/one/things/plans/5-build-frontend.md +0 -0
  772. package/one/things/plans/5-complete.md +0 -17
  773. package/one/things/plans/agent-director-100-inference-plans.md +0 -410
  774. package/one/things/plans/dual-website-strategy.md +0 -612
  775. package/one/things/plans/releases.md +0 -809
@@ -0,0 +1,1683 @@
1
+ ---
2
+ title: Todo Components
3
+ dimension: things
4
+ primary_dimension: things
5
+ category: todo-components.md
6
+ tags: agent, ai, architecture, inference
7
+ related_dimensions: things, events, knowledge, groups, people, connections
8
+ scope: global
9
+ created: 2025-11-03
10
+ updated: 2025-11-03
11
+ version: 1.0.0
12
+ ai_context: |
13
+ This document is part of the things dimension in the todo-components.md category.
14
+ Location: one/things/todo-components.md
15
+ Purpose: Documents convex components + effect.ts integration - 100 inference todo list
16
+ Related dimensions: events, knowledge
17
+ For AI agents: Read this to understand todo components.
18
+ ---
19
+
20
+ # Convex Components + Effect.ts Integration - 100 Inference Todo List
21
+
22
+ **Feature:** Effect.ts Service Layer Architecture with Convex Components
23
+ **Status:** Planning Complete → Ready for Execution
24
+ **Created:** 2025-10-30
25
+
26
+ ## Overview
27
+
28
+ This document tracks all 100 inferences for implementing a production-ready service layer that combines Effect.ts functional programming patterns with Convex components (@convex-dev/agent, workflow, RAG, rate-limiter, etc.) to build sophisticated multi-agent AI systems.
29
+
30
+ **Key Principle:** Effect wraps components, not replaces. Components handle infrastructure, Effect handles business logic composition.
31
+
32
+ ---
33
+
34
+ ## Foundation Phase (Infer 1-10)
35
+
36
+ **Agent:** agent-director
37
+ **Goal:** Validate architecture, map components, create execution plan
38
+
39
+ ### ✅ Infer 1: Validate Effect + Convex Components Architecture
40
+
41
+ **Status:** ✅ Complete
42
+ **Task:** Ensure Effect.ts service layer pattern works with all Convex components
43
+ **Validation:**
44
+
45
+ - Effect.tryPromise wraps component Promise calls ✅
46
+ - Context/Layer pattern for dependency injection ✅
47
+ - Tagged errors for type-safe error handling ✅
48
+ - No performance regression vs direct component usage ✅
49
+ - All 8 components compatible with Effect wrapper pattern ✅
50
+
51
+ ### ✅ Infer 2: Map 8 Convex Components to Effect Services
52
+
53
+ **Status:** ✅ Complete
54
+ **Component Mapping:**
55
+
56
+ 1. **@convex-dev/agent** → AgentService
57
+ - Where Effect helps: Business logic orchestration, multi-agent composition, error handling
58
+ - Where component shines: Thread management, streaming, RAG, tool calling
59
+
60
+ 2. **@convex-dev/workflow** → WorkflowService
61
+ - Where Effect helps: Step business logic, service composition, error handling
62
+ - Where component shines: Durable execution, journaling, retry policies
63
+
64
+ 3. **@convex-dev/rag** → RAGService
65
+ - Where Effect helps: Composing RAG with other services, custom embeddings, error handling
66
+ - Where component shines: Vector storage, semantic search, chunking
67
+
68
+ 4. **@convex-dev/rate-limiter** → RateLimitService
69
+ - Where Effect helps: Composing rate limits with business logic, multi-level limits, smart retries
70
+ - Where component shines: Token bucket, fixed window, capacity reservation
71
+
72
+ 5. **@convex-dev/persistent-text-streaming** → StreamingService
73
+ - Where Effect helps: Error recovery during streaming, lifecycle management, backpressure
74
+ - Where component shines: WebSocket delivery, delta storage, client subscription
75
+
76
+ 6. **@convex-dev/workpool** → TaskQueueService
77
+ - Where Effect helps: Batch enqueuing, error handling, coordinating multiple pools
78
+ - Where component shines: Task queuing, parallelism control, completion callbacks
79
+
80
+ 7. **@convex-dev/retrier** → ResilientExecutionService
81
+ - Where Effect helps: Coordinating retries across operations, custom policies, composition
82
+ - Where component shines: Action retries with persistent state, status tracking
83
+
84
+ 8. **@convex-dev/crons** → CronService
85
+ - Where Effect helps: Scheduled job logic composition, error handling, service orchestration
86
+ - Where component shines: Dynamic cron registration, schedule management
87
+
88
+ ### ✅ Infer 3: Define Service Layer Structure
89
+
90
+ **Status:** ✅ Complete
91
+ **Directory Structure:**
92
+
93
+ ```
94
+ backend/convex/
95
+ ├── services/ # Effect service layers (8 services)
96
+ ├── domain/ # Business logic with Effect
97
+ │ ├── agents/ # Multi-agent orchestration
98
+ │ ├── workflows/ # Workflow definitions
99
+ │ └── users/ # User domain logic
100
+ ├── api/ # Public endpoints (use services)
101
+ └── lib/ # Effect utilities
102
+ ├── effect-utils.ts
103
+ ├── convex-effect.ts
104
+ └── monitoring.ts
105
+ ```
106
+
107
+ ### ✅ Infer 4: Identify Error Types and Patterns
108
+
109
+ **Status:** ✅ Complete
110
+ **Error Categories:**
111
+
112
+ **Domain Errors:**
113
+
114
+ - `UserNotFoundError` - User doesn't exist
115
+ - `ThreadNotFoundError` - Thread doesn't exist
116
+ - `InsufficientPermissionsError` - User lacks permissions
117
+
118
+ **Infrastructure Errors:**
119
+
120
+ - `AgentError` - Agent component failure
121
+ - `RAGError` - RAG component failure
122
+ - `DatabaseError` - Convex database error
123
+
124
+ **Rate Limiting Errors:**
125
+
126
+ - `RateLimitError` - Rate limit exceeded
127
+ - `QuotaExceededError` - Quota limit hit
128
+
129
+ **Pattern:** Tagged error classes with `Data.TaggedError`
130
+
131
+ ### ✅ Infer 5: Plan Dependency Injection Strategy
132
+
133
+ **Status:** ✅ Complete
134
+ **Strategy:**
135
+
136
+ - **Context.Tag:** Define service interfaces
137
+ - **Layer.effect:** Implement service layers
138
+ - **Layer.merge:** Compose multiple layers
139
+ - **Effect.provide:** Inject layers at runtime
140
+ - **Test Layers:** Swap real services for mocks
141
+
142
+ **Example:**
143
+
144
+ ```typescript
145
+ class AgentService extends Context.Tag("AgentService")<...>() {}
146
+ const AgentServiceLive = Layer.effect(AgentService, ...)
147
+ const TestAgentServiceLive = Layer.succeed(AgentService, mockImpl)
148
+ ```
149
+
150
+ ### ✅ Infer 6: Define Observability Requirements
151
+
152
+ **Status:** ✅ Complete
153
+ **Requirements:**
154
+
155
+ 1. **Service Call Tracking:** Log start, complete, fail for every service call
156
+ 2. **Token Usage:** Track AI model token consumption per request
157
+ 3. **Error Tracking:** Log all errors with Effect error chain
158
+ 4. **Performance Metrics:** Track latency per service operation
159
+ 5. **Dependency Graph:** Visualize service dependencies
160
+ 6. **Distributed Tracing:** Propagate trace IDs across service calls
161
+
162
+ **Implementation:** MonitoringService with Effect.tap
163
+
164
+ ### ✅ Infer 7: Create Integration Patterns Document
165
+
166
+ **Status:** ✅ Complete
167
+ **Patterns:**
168
+
169
+ 1. **Effect-Wrapped Component:** `Effect.tryPromise` for component calls
170
+ 2. **Service Layer:** Context.Tag + Layer for DI
171
+ 3. **Error Handling:** `Effect.catchTag` for specific errors, `Effect.catchAll` for fallback
172
+ 4. **Parallel Execution:** `Effect.all` with concurrency control
173
+ 5. **Resource Management:** `Effect.Scope` + `acquireRelease`
174
+ 6. **Retry Logic:** `Effect.retry` + `Schedule.exponential`
175
+ 7. **Service Composition:** `Effect.gen` for sequential, `Effect.all` for parallel
176
+
177
+ ### ✅ Infer 8: Break Down Into 100 Inferences
178
+
179
+ **Status:** ✅ Complete
180
+ **Breakdown:**
181
+
182
+ - Foundation: 1-10 (planning)
183
+ - Core Services: 11-30 (Agent, RAG, Rate Limit, Workflow)
184
+ - Supporting Services: 31-50 (Streaming, Workpool, Retrier, Crons)
185
+ - Domain Logic: 51-70 (Multi-agent, workflows, tools)
186
+ - Observability & Testing: 71-90 (Monitoring, tests, error handling)
187
+ - Advanced & Documentation: 91-100 (Confect, docs, optimization, launch)
188
+
189
+ ### ✅ Infer 9: Assign Agents to Phases
190
+
191
+ **Status:** ✅ Complete
192
+ **Agent Assignments:**
193
+
194
+ - **agent-director:** Infer 1-10, 99-100 (planning, coordination, launch)
195
+ - **agent-backend:** Infer 11-50, 91-93, 97-98 (service implementation, optimization)
196
+ - **agent-builder:** Infer 51-70 (domain logic, multi-agent orchestration)
197
+ - **agent-ops:** Infer 71-75, 81-85 (monitoring, resource management)
198
+ - **agent-quality:** Infer 76-80, 86-90 (testing, error handling)
199
+ - **agent-documenter:** Infer 94-96 (documentation, guides, examples)
200
+
201
+ ### ✅ Infer 10: Create Complete Implementation Plan
202
+
203
+ **Status:** ✅ Complete
204
+ **Deliverable:** `/one/things/plans/components.md`
205
+ **Content:** Executive summary, 6-dimension mapping, architecture, phases, success metrics, risks, timeline
206
+
207
+ ---
208
+
209
+ ## Core Service Layers Phase (Infer 11-30)
210
+
211
+ **Agent:** agent-backend
212
+ **Goal:** Implement Effect service layers for core components
213
+
214
+ ### ⏳ Infer 11: Wrap @convex-dev/agent with Effect (Part 1: Setup)
215
+
216
+ **Status:** Pending
217
+ **Dependencies:** Infer 1-10 (Foundation complete)
218
+ **Task:** Create AgentService interface and basic structure
219
+ **File:** `backend/convex/services/agent.service.ts`
220
+ **Acceptance Criteria:**
221
+
222
+ - [ ] Import Effect, Context, Layer, Data
223
+ - [ ] Import Agent from @convex-dev/agent
224
+ - [ ] Define error types: `AgentError`, `ThreadNotFoundError`, `ToolExecutionError`
225
+ - [ ] Create `AgentService` Context.Tag with interface:
226
+ - `generateResponse(ctx, threadId, prompt)`
227
+ - `createThread(ctx, userId)`
228
+ - `continueThread(ctx, threadId, message)`
229
+ - [ ] Stub implementation (returns Effect.succeed with placeholder)
230
+
231
+ ### ⏳ Infer 12: Implement AgentServiceLive Layer
232
+
233
+ **Status:** Pending
234
+ **Dependencies:** Infer 11
235
+ **Task:** Full implementation of AgentService
236
+ **File:** `backend/convex/services/agent.service.ts`
237
+ **Acceptance Criteria:**
238
+
239
+ - [ ] Initialize Agent component in Layer.effect
240
+ - [ ] Implement `generateResponse` with Effect.tryPromise wrapping agent.continueThread
241
+ - [ ] Implement `createThread` with proper error handling
242
+ - [ ] Inject RateLimitService dependency (yield\* RateLimitService)
243
+ - [ ] Check rate limit before agent calls
244
+ - [ ] Return typed errors (AgentError, RateLimitError)
245
+ - [ ] Add Effect.retry for transient failures
246
+
247
+ ### ⏳ Infer 13: Create Agent Tool Definitions with Effect
248
+
249
+ **Status:** Pending
250
+ **Dependencies:** Infer 12
251
+ **Task:** Define agent tools that use Effect services internally
252
+ **File:** `backend/convex/services/agent.service.ts`
253
+ **Acceptance Criteria:**
254
+
255
+ - [ ] Create `emailTool` using EmailService (Effect-based)
256
+ - [ ] Create `searchTool` using RAGService (Effect-based)
257
+ - [ ] Create `databaseQueryTool` using database operations (Effect-based)
258
+ - [ ] Convert Effect programs to Promises in tool handlers (Effect.runPromise)
259
+ - [ ] Handle errors gracefully (return error messages to agent)
260
+ - [ ] Register tools with Agent component
261
+
262
+ ### ⏳ Infer 14: Add Agent Service Error Types
263
+
264
+ **Status:** Pending
265
+ **Dependencies:** Infer 13
266
+ **Task:** Define comprehensive error types for AgentService
267
+ **File:** `backend/convex/domain/agents/errors.ts`
268
+ **Acceptance Criteria:**
269
+
270
+ - [ ] `AgentError` - General agent failure (includes agentName, cause)
271
+ - [ ] `ThreadNotFoundError` - Thread doesn't exist (includes threadId)
272
+ - [ ] `ToolExecutionError` - Tool failed (includes toolName, cause)
273
+ - [ ] `InvalidPromptError` - Prompt validation failed (includes reason)
274
+ - [ ] `ModelOverloadedError` - Model capacity exceeded (includes retryAfter)
275
+ - [ ] All errors extend `Data.TaggedError`
276
+ - [ ] All errors include helpful metadata
277
+
278
+ ### ⏳ Infer 15: Test AgentService with Effect
279
+
280
+ **Status:** Pending
281
+ **Dependencies:** Infer 14
282
+ **Task:** Create test layer for AgentService
283
+ **File:** `backend/convex/services/agent.service.test.ts`
284
+ **Acceptance Criteria:**
285
+
286
+ - [ ] Create `TestAgentServiceLive` layer with mock implementation
287
+ - [ ] Mock `generateResponse` returns fixed response
288
+ - [ ] Mock `createThread` returns deterministic threadId
289
+ - [ ] Test successful agent call (Effect.runPromise passes)
290
+ - [ ] Test error handling (Effect.runPromise rejects with AgentError)
291
+ - [ ] Test rate limit integration (mocked RateLimitService)
292
+ - [ ] Test retry logic (transient errors recover)
293
+
294
+ ### ⏳ Infer 16: Wrap @convex-dev/rag with Effect (Part 1: Setup)
295
+
296
+ **Status:** Pending
297
+ **Dependencies:** Infer 15
298
+ **Task:** Create RAGService interface and basic structure
299
+ **File:** `backend/convex/services/rag.service.ts`
300
+ **Acceptance Criteria:**
301
+
302
+ - [ ] Import Effect, Context, Layer, Data
303
+ - [ ] Import RAG from @convex-dev/rag
304
+ - [ ] Define error types: `RAGError`, `EmbeddingError`, `SearchError`
305
+ - [ ] Create `RAGService` Context.Tag with interface:
306
+ - `addDocument(ctx, namespace, content, metadata)`
307
+ - `search(ctx, namespace, query, limit)`
308
+ - `deleteDocument(ctx, namespace, entryId)`
309
+ - [ ] Stub implementation
310
+
311
+ ### ⏳ Infer 17: Implement RAGServiceLive Layer
312
+
313
+ **Status:** Pending
314
+ **Dependencies:** Infer 16
315
+ **Task:** Full implementation of RAGService
316
+ **File:** `backend/convex/services/rag.service.ts`
317
+ **Acceptance Criteria:**
318
+
319
+ - [ ] Initialize RAG component with openai.embedding("text-embedding-3-small")
320
+ - [ ] Implement `addDocument` with Effect.tryPromise wrapping rag.add
321
+ - [ ] Implement `search` with Effect.tryPromise wrapping rag.search
322
+ - [ ] Implement `deleteDocument` with proper error handling
323
+ - [ ] Pre-process content before adding (Effect pipeline)
324
+ - [ ] Handle embedding generation failures gracefully
325
+ - [ ] Add vector score threshold filtering
326
+
327
+ ### ⏳ Infer 18: Compose RAG with Agent Service
328
+
329
+ **Status:** Pending
330
+ **Dependencies:** Infer 17
331
+ **Task:** Use RAGService within AgentService for context retrieval
332
+ **File:** `backend/convex/domain/agents/orchestration.ts`
333
+ **Acceptance Criteria:**
334
+
335
+ - [ ] Create `contextualAnswerAgent` action
336
+ - [ ] Inject both AgentService and RAGService
337
+ - [ ] Search RAG for context (yield\* ragService.search)
338
+ - [ ] Generate agent response with context (yield\* agentService.generateResponse)
339
+ - [ ] Return answer + sources (with relevance scores)
340
+ - [ ] Handle errors (RAGError, AgentError) gracefully
341
+ - [ ] Add Effect.retry for robustness
342
+
343
+ ### ⏳ Infer 19: Add RAG Error Types
344
+
345
+ **Status:** Pending
346
+ **Dependencies:** Infer 18
347
+ **Task:** Define comprehensive error types for RAGService
348
+ **File:** `backend/convex/domain/agents/errors.ts`
349
+ **Acceptance Criteria:**
350
+
351
+ - [ ] `RAGError` - General RAG failure (includes cause)
352
+ - [ ] `EmbeddingError` - Embedding generation failed (includes text, modelName)
353
+ - [ ] `SearchError` - Search query failed (includes query, namespace)
354
+ - [ ] `ChunkingError` - Document chunking failed (includes documentId)
355
+ - [ ] `InvalidNamespaceError` - Namespace doesn't exist (includes namespace)
356
+ - [ ] All errors extend `Data.TaggedError`
357
+
358
+ ### ⏳ Infer 20: Test RAGService with Effect
359
+
360
+ **Status:** Pending
361
+ **Dependencies:** Infer 19
362
+ **Task:** Create test layer for RAGService
363
+ **File:** `backend/convex/services/rag.service.test.ts`
364
+ **Acceptance Criteria:**
365
+
366
+ - [ ] Create `TestRAGServiceLive` layer with mock implementation
367
+ - [ ] Mock `search` returns fixed results with scores
368
+ - [ ] Mock `addDocument` returns deterministic entryId
369
+ - [ ] Test successful search (Effect.runPromise passes)
370
+ - [ ] Test error handling (SearchError, EmbeddingError)
371
+ - [ ] Test composition with AgentService (integration)
372
+ - [ ] Test retry logic for transient failures
373
+
374
+ ### ⏳ Infer 21: Wrap @convex-dev/rate-limiter with Effect (Part 1: Setup)
375
+
376
+ **Status:** Pending
377
+ **Dependencies:** Infer 20
378
+ **Task:** Create RateLimitService interface and basic structure
379
+ **File:** `backend/convex/services/rate-limit.service.ts`
380
+ **Acceptance Criteria:**
381
+
382
+ - [ ] Import Effect, Context, Layer, Data
383
+ - [ ] Import RateLimiter from @convex-dev/rate-limiter
384
+ - [ ] Define error types: `RateLimitError`, `QuotaExceededError`
385
+ - [ ] Create `RateLimitService` Context.Tag with interface:
386
+ - `checkLimit(ctx, name, key, count?)`
387
+ - `checkUserLimit(ctx, userId)`
388
+ - `checkGlobalLimit(ctx)`
389
+ - [ ] Stub implementation
390
+
391
+ ### ⏳ Infer 22: Implement RateLimitServiceLive Layer
392
+
393
+ **Status:** Pending
394
+ **Dependencies:** Infer 21
395
+ **Task:** Full implementation of RateLimitService
396
+ **File:** `backend/convex/services/rate-limit.service.ts`
397
+ **Acceptance Criteria:**
398
+
399
+ - [ ] Initialize RateLimiter with config (token bucket, fixed window)
400
+ - [ ] Implement `checkLimit` with Effect.tryPromise wrapping rateLimiter.limit
401
+ - [ ] Return RateLimitError if limit exceeded (include retryAfter)
402
+ - [ ] Implement `checkUserLimit` (per-user rate limit)
403
+ - [ ] Implement `checkGlobalLimit` (system-wide rate limit)
404
+ - [ ] Add reserve parameter for capacity reservation
405
+ - [ ] Handle multiple rate limit tiers (starter, pro, enterprise)
406
+
407
+ ### ⏳ Infer 23: Multi-Level Rate Limiting with Effect
408
+
409
+ **Status:** Pending
410
+ **Dependencies:** Infer 22
411
+ **Task:** Coordinate user and global rate limits in parallel
412
+ **File:** `backend/convex/domain/agents/orchestration.ts`
413
+ **Acceptance Criteria:**
414
+
415
+ - [ ] Create `protectedAgentCall` action
416
+ - [ ] Check user and global limits in parallel (Effect.all)
417
+ - [ ] Fail fast if any limit exceeded
418
+ - [ ] Return specific error (UserRateLimitExceeded vs GlobalRateLimitExceeded)
419
+ - [ ] Include retryAfter in error response
420
+ - [ ] Execute agent call only if both limits OK
421
+ - [ ] Log rate limit events
422
+
423
+ ### ⏳ Infer 24: Add Rate Limit Error Types
424
+
425
+ **Status:** Pending
426
+ **Dependencies:** Infer 23
427
+ **Task:** Define comprehensive error types for rate limiting
428
+ **File:** `backend/convex/domain/agents/errors.ts`
429
+ **Acceptance Criteria:**
430
+
431
+ - [ ] `RateLimitError` - General rate limit (includes limitName, retryAfter)
432
+ - [ ] `UserRateLimitExceeded` - User-specific limit hit (includes userId, retryAfter)
433
+ - [ ] `GlobalRateLimitExceeded` - System-wide limit hit (includes retryAfter)
434
+ - [ ] `QuotaExceededError` - Monthly quota exceeded (includes quotaType, resetDate)
435
+ - [ ] `ReservationFailedError` - Capacity reservation failed (includes requested, available)
436
+ - [ ] All errors extend `Data.TaggedError`
437
+
438
+ ### ⏳ Infer 25: Test RateLimitService with Effect
439
+
440
+ **Status:** Pending
441
+ **Dependencies:** Infer 24
442
+ **Task:** Create test layer for RateLimitService
443
+ **File:** `backend/convex/services/rate-limit.service.test.ts`
444
+ **Acceptance Criteria:**
445
+
446
+ - [ ] Create `TestRateLimitServiceLive` layer
447
+ - [ ] Mock `checkLimit` returns OK for first N calls, then RateLimitError
448
+ - [ ] Test successful limit check (Effect.runPromise passes)
449
+ - [ ] Test rate limit exceeded (Effect.runPromise rejects with RateLimitError)
450
+ - [ ] Test parallel limit checks (user + global)
451
+ - [ ] Test retry logic (Effect.retry with exponential backoff)
452
+ - [ ] Test capacity reservation
453
+
454
+ ### ⏳ Infer 26: Wrap @convex-dev/workflow with Effect (Part 1: Setup)
455
+
456
+ **Status:** Pending
457
+ **Dependencies:** Infer 25
458
+ **Task:** Create WorkflowService interface and basic structure
459
+ **File:** `backend/convex/services/workflow.service.ts`
460
+ **Acceptance Criteria:**
461
+
462
+ - [ ] Import Effect, Context, Layer, Data
463
+ - [ ] Import WorkflowManager from @convex-dev/workflow
464
+ - [ ] Define error types: `WorkflowError`, `StepFailedError`
465
+ - [ ] Create `WorkflowService` Context.Tag with interface:
466
+ - `defineWorkflow(name, handler)`
467
+ - `startWorkflow(ctx, workflowId, args)`
468
+ - `getWorkflowStatus(ctx, workflowId)`
469
+ - [ ] Stub implementation
470
+
471
+ ### ⏳ Infer 27: Implement WorkflowServiceLive Layer
472
+
473
+ **Status:** Pending
474
+ **Dependencies:** Infer 26
475
+ **Task:** Full implementation of WorkflowService
476
+ **File:** `backend/convex/services/workflow.service.ts`
477
+ **Acceptance Criteria:**
478
+
479
+ - [ ] Initialize WorkflowManager with default retry behavior
480
+ - [ ] Implement `defineWorkflow` wrapping workflow.define
481
+ - [ ] Implement `startWorkflow` with Effect.tryPromise
482
+ - [ ] Implement `getWorkflowStatus` for monitoring
483
+ - [ ] Handle workflow step errors gracefully
484
+ - [ ] Add retry policies per step
485
+ - [ ] Support long-running workflows (hours/days)
486
+
487
+ ### ⏳ Infer 28: Create Effect Programs for Workflow Steps
488
+
489
+ **Status:** Pending
490
+ **Dependencies:** Infer 27
491
+ **Task:** Use Effect services within workflow steps
492
+ **File:** `backend/convex/domain/workflows/research.ts`
493
+ **Acceptance Criteria:**
494
+
495
+ - [ ] Define `researchWorkflow` using workflow.define
496
+ - [ ] Step 1: Classify query (Effect-based action)
497
+ - [ ] Step 2: Parallel research (web, academic, news agents)
498
+ - [ ] Step 3: Synthesize findings (Effect-based action using AgentService + RAGService)
499
+ - [ ] Step 4: Generate report (Effect-based action)
500
+ - [ ] Step 5: Save and notify (mutation)
501
+ - [ ] All actions use Effect.runPromise internally
502
+ - [ ] Error handling with Effect.catchAll
503
+
504
+ ### ⏳ Infer 29: Add Workflow Error Types
505
+
506
+ **Status:** Pending
507
+ **Dependencies:** Infer 28
508
+ **Task:** Define comprehensive error types for workflows
509
+ **File:** `backend/convex/domain/workflows/errors.ts`
510
+ **Acceptance Criteria:**
511
+
512
+ - [ ] `WorkflowError` - General workflow failure (includes workflowId, cause)
513
+ - [ ] `StepFailedError` - Specific step failed (includes stepName, cause)
514
+ - [ ] `WorkflowTimeoutError` - Workflow exceeded time limit (includes workflowId, duration)
515
+ - [ ] `WorkflowCanceledError` - Workflow manually canceled (includes reason)
516
+ - [ ] `InvalidWorkflowStateError` - Workflow in invalid state (includes currentState)
517
+ - [ ] All errors extend `Data.TaggedError`
518
+
519
+ ### ⏳ Infer 30: Test WorkflowService with Effect
520
+
521
+ **Status:** Pending
522
+ **Dependencies:** Infer 29
523
+ **Task:** Create test layer for WorkflowService
524
+ **File:** `backend/convex/services/workflow.service.test.ts`
525
+ **Acceptance Criteria:**
526
+
527
+ - [ ] Create `TestWorkflowServiceLive` layer
528
+ - [ ] Mock workflow steps return deterministic results
529
+ - [ ] Test successful workflow execution (all steps pass)
530
+ - [ ] Test step failure handling (StepFailedError propagates)
531
+ - [ ] Test retry logic (step retries 3 times before failing)
532
+ - [ ] Test long-running workflow (status polling)
533
+ - [ ] Test workflow cancellation
534
+
535
+ ---
536
+
537
+ ## Supporting Services Phase (Infer 31-50)
538
+
539
+ **Agent:** agent-backend
540
+ **Goal:** Implement remaining service layers
541
+
542
+ ### ⏳ Infer 31: Wrap @convex-dev/persistent-text-streaming with Effect
543
+
544
+ **Status:** Pending
545
+ **Dependencies:** Infer 30
546
+ **Task:** Create StreamingService interface and implementation
547
+ **File:** `backend/convex/services/streaming.service.ts`
548
+ **Acceptance Criteria:**
549
+
550
+ - [ ] Import Effect, Stream from effect
551
+ - [ ] Import PersistentTextStreaming from @convex-dev/persistent-text-streaming
552
+ - [ ] Define error types: `StreamingError`, `ChunkAppendError`
553
+ - [ ] Create `StreamingService` Context.Tag
554
+ - [ ] Implement `generateStream(ctx, prompt, streamId)`
555
+ - [ ] Use Effect.Stream for backpressure handling
556
+ - [ ] Wrap persistentTextStreaming.appendChunk with Effect.tryPromise
557
+ - [ ] Handle stream lifecycle (start, chunk, complete, error)
558
+
559
+ ### ⏳ Infer 32: Implement Streaming Error Recovery
560
+
561
+ **Status:** Pending
562
+ **Dependencies:** Infer 31
563
+ **Task:** Add retry logic for failed stream chunks
564
+ **File:** `backend/convex/services/streaming.service.ts`
565
+ **Acceptance Criteria:**
566
+
567
+ - [ ] Retry chunk append on transient errors (Effect.retry)
568
+ - [ ] Use exponential backoff (Schedule.exponential)
569
+ - [ ] Max 3 retries per chunk
570
+ - [ ] Mark stream as failed if chunk repeatedly fails
571
+ - [ ] Store failed chunks for manual recovery
572
+ - [ ] Log streaming errors as events
573
+
574
+ ### ⏳ Infer 33: Test StreamingService with Effect
575
+
576
+ **Status:** Pending
577
+ **Dependencies:** Infer 32
578
+ **Task:** Create test layer for StreamingService
579
+ **File:** `backend/convex/services/streaming.service.test.ts`
580
+ **Acceptance Criteria:**
581
+
582
+ - [ ] Create `TestStreamingServiceLive` layer
583
+ - [ ] Mock stream returns deterministic chunks
584
+ - [ ] Test successful streaming (all chunks delivered)
585
+ - [ ] Test chunk failure handling (retry + eventual success)
586
+ - [ ] Test stream cancellation (cleanup resources)
587
+ - [ ] Test backpressure (slow consumer)
588
+ - [ ] Test concurrent streams
589
+
590
+ ### ⏳ Infer 34: Add Streaming Error Types
591
+
592
+ **Status:** Pending
593
+ **Dependencies:** Infer 33
594
+ **Task:** Define comprehensive error types for streaming
595
+ **File:** `backend/convex/domain/agents/errors.ts`
596
+ **Acceptance Criteria:**
597
+
598
+ - [ ] `StreamingError` - General streaming failure (includes streamId, cause)
599
+ - [ ] `ChunkAppendError` - Chunk append failed (includes chunk, attempt)
600
+ - [ ] `StreamCompletionError` - Failed to mark stream complete (includes streamId)
601
+ - [ ] `StreamProcessingError` - Stream processing logic failed (includes cause)
602
+ - [ ] All errors extend `Data.TaggedError`
603
+
604
+ ### ⏳ Infer 35: Integrate Streaming with Agent Component
605
+
606
+ **Status:** Pending
607
+ **Dependencies:** Infer 34
608
+ **Task:** Use Agent component's built-in streaming instead of persistent-text-streaming
609
+ **File:** `backend/convex/services/agent.service.ts`
610
+ **Acceptance Criteria:**
611
+
612
+ - [ ] Enable `saveStreamDeltas: true` in Agent config
613
+ - [ ] Agent automatically handles streaming to Convex
614
+ - [ ] Client subscribes to stream deltas via useQuery
615
+ - [ ] StreamingService used only for custom HTTP streaming
616
+ - [ ] Document when to use each approach
617
+ - [ ] Update tests to use Agent streaming
618
+
619
+ ### ⏳ Infer 36: Wrap @convex-dev/workpool with Effect
620
+
621
+ **Status:** Pending
622
+ **Dependencies:** Infer 35
623
+ **Task:** Create TaskQueueService interface and implementation
624
+ **File:** `backend/convex/services/workpool.service.ts`
625
+ **Acceptance Criteria:**
626
+
627
+ - [ ] Import Effect, Queue from effect
628
+ - [ ] Import Workpool from @convex-dev/workpool
629
+ - [ ] Define error types: `EnqueueError`, `TaskStatusError`
630
+ - [ ] Create `TaskQueueService` Context.Tag
631
+ - [ ] Implement `enqueueTask(ctx, priority, action, args)`
632
+ - [ ] Implement `getTaskStatus(ctx, taskId)`
633
+ - [ ] Support multiple workpools (high priority, low priority)
634
+ - [ ] Handle task completion callbacks
635
+
636
+ ### ⏳ Infer 37: Batch Task Enqueuing with Effect
637
+
638
+ **Status:** Pending
639
+ **Dependencies:** Infer 36
640
+ **Task:** Enqueue multiple tasks in parallel
641
+ **File:** `backend/convex/domain/workflows/batch-processing.ts`
642
+ **Acceptance Criteria:**
643
+
644
+ - [ ] Create `processBatch` mutation
645
+ - [ ] Use Effect.all to enqueue tasks in parallel
646
+ - [ ] Control concurrency (max 10 concurrent enqueues)
647
+ - [ ] Return array of taskIds
648
+ - [ ] Handle partial failures gracefully
649
+ - [ ] Log batch processing metrics
650
+ - [ ] Add retry for failed enqueues
651
+
652
+ ### ⏳ Infer 38: Test TaskQueueService with Effect
653
+
654
+ **Status:** Pending
655
+ **Dependencies:** Infer 37
656
+ **Task:** Create test layer for TaskQueueService
657
+ **File:** `backend/convex/services/workpool.service.test.ts`
658
+ **Acceptance Criteria:**
659
+
660
+ - [ ] Create `TestTaskQueueServiceLive` layer
661
+ - [ ] Mock `enqueueTask` returns deterministic taskId
662
+ - [ ] Mock `getTaskStatus` returns task progress
663
+ - [ ] Test successful task enqueuing
664
+ - [ ] Test task status polling
665
+ - [ ] Test batch enqueuing (parallel)
666
+ - [ ] Test priority queuing (high vs low)
667
+ - [ ] Test completion callbacks
668
+
669
+ ### ⏳ Infer 39: Add Workpool Error Types
670
+
671
+ **Status:** Pending
672
+ **Dependencies:** Infer 38
673
+ **Task:** Define comprehensive error types for task queues
674
+ **File:** `backend/convex/domain/workflows/errors.ts`
675
+ **Acceptance Criteria:**
676
+
677
+ - [ ] `EnqueueError` - Task enqueue failed (includes action, cause)
678
+ - [ ] `TaskStatusError` - Failed to check task status (includes taskId)
679
+ - [ ] `TaskFailedError` - Task execution failed (includes taskId, error)
680
+ - [ ] `WorkpoolFullError` - Workpool at capacity (includes maxParallelism, current)
681
+ - [ ] All errors extend `Data.TaggedError`
682
+
683
+ ### ⏳ Infer 40: Integrate Workpool with Workflow
684
+
685
+ **Status:** Pending
686
+ **Dependencies:** Infer 39
687
+ **Task:** Use TaskQueueService within workflows for async operations
688
+ **File:** `backend/convex/domain/workflows/research.ts`
689
+ **Acceptance Criteria:**
690
+
691
+ - [ ] Enqueue background tasks from workflow steps
692
+ - [ ] Poll task status within workflow
693
+ - [ ] Handle task failures within workflow
694
+ - [ ] Use Effect.retry for task status polling
695
+ - [ ] Log task enqueue/complete events
696
+ - [ ] Update workflow state based on task results
697
+
698
+ ### ⏳ Infer 41: Wrap @convex-dev/retrier with Effect
699
+
700
+ **Status:** Pending
701
+ **Dependencies:** Infer 40
702
+ **Task:** Create ResilientExecutionService interface and implementation
703
+ **File:** `backend/convex/services/retrier.service.ts`
704
+ **Acceptance Criteria:**
705
+
706
+ - [ ] Import Effect, Schedule from effect
707
+ - [ ] Import ActionRetrier from @convex-dev/retrier
708
+ - [ ] Define error types: `RetrierStartError`, `ExecutionTimeout`
709
+ - [ ] Create `ResilientExecutionService` Context.Tag
710
+ - [ ] Implement `executeWithRetry(ctx, action, args)`
711
+ - [ ] Poll for completion with Effect.repeat
712
+ - [ ] Return result or throw ExecutionFailed
713
+ - [ ] Handle retrier-level and Effect-level retries
714
+
715
+ ### ⏳ Infer 42: Combine Retrier with Effect.retry
716
+
717
+ **Status:** Pending
718
+ **Dependencies:** Infer 41
719
+ **Task:** Hybrid retry strategy (component + Effect)
720
+ **File:** `backend/convex/domain/workflows/reliable-execution.ts`
721
+ **Acceptance Criteria:**
722
+
723
+ - [ ] Use retrier for infrastructure-level retries (actions with persistent state)
724
+ - [ ] Use Effect.retry for application-level retries (in-memory operations)
725
+ - [ ] Example: Validate data (Effect.retry) → Process data (retrier.run)
726
+ - [ ] Document when to use each approach
727
+ - [ ] Add integration test for hybrid retries
728
+ - [ ] Log retry attempts as events
729
+
730
+ ### ⏳ Infer 43: Test ResilientExecutionService with Effect
731
+
732
+ **Status:** Pending
733
+ **Dependencies:** Infer 42
734
+ **Task:** Create test layer for ResilientExecutionService
735
+ **File:** `backend/convex/services/retrier.service.test.ts`
736
+ **Acceptance Criteria:**
737
+
738
+ - [ ] Create `TestResilientExecutionServiceLive` layer
739
+ - [ ] Mock action execution with configurable success/failure
740
+ - [ ] Test successful execution (returns result)
741
+ - [ ] Test retries (fails 2 times, succeeds on 3rd)
742
+ - [ ] Test max retries exceeded (throws ExecutionFailed)
743
+ - [ ] Test timeout (throws ExecutionTimeout)
744
+ - [ ] Test status polling (Effect.repeat)
745
+
746
+ ### ⏳ Infer 44: Add Retrier Error Types
747
+
748
+ **Status:** Pending
749
+ **Dependencies:** Infer 43
750
+ **Task:** Define comprehensive error types for retries
751
+ **File:** `backend/convex/domain/workflows/errors.ts`
752
+ **Acceptance Criteria:**
753
+
754
+ - [ ] `RetrierStartError` - Failed to start retry execution (includes cause)
755
+ - [ ] `StatusCheckError` - Failed to check execution status (includes runId)
756
+ - [ ] `ExecutionTimeout` - Execution exceeded time limit (includes runId, duration)
757
+ - [ ] `ExecutionFailed` - Execution failed after all retries (includes error, attempts)
758
+ - [ ] `ExecutionCanceled` - Execution manually canceled (includes runId)
759
+ - [ ] All errors extend `Data.TaggedError`
760
+
761
+ ### ⏳ Infer 45: Integrate Retrier with Workflow
762
+
763
+ **Status:** Pending
764
+ **Dependencies:** Infer 44
765
+ **Task:** Use ResilientExecutionService for critical workflow steps
766
+ **File:** `backend/convex/domain/workflows/support.ts`
767
+ **Acceptance Criteria:**
768
+
769
+ - [ ] Define `supportTicketWorkflow` using workflow.define
770
+ - [ ] Use retrier for external API calls (email, Slack)
771
+ - [ ] Use Effect.retry for internal operations (validation, formatting)
772
+ - [ ] Handle ExecutionFailed gracefully (fallback actions)
773
+ - [ ] Log retry attempts and final outcomes
774
+ - [ ] Test workflow with simulated failures
775
+
776
+ ### ⏳ Infer 46: Wrap @convex-dev/crons with Effect
777
+
778
+ **Status:** Pending
779
+ **Dependencies:** Infer 45
780
+ **Task:** Create CronService interface and implementation
781
+ **File:** `backend/convex/services/crons.service.ts`
782
+ **Acceptance Criteria:**
783
+
784
+ - [ ] Import Effect from effect
785
+ - [ ] Import Crons from @convex-dev/crons
786
+ - [ ] Define error types: `CronRegisterError`, `CronExecutionError`
787
+ - [ ] Create `CronService` Context.Tag
788
+ - [ ] Implement `register(ctx, schedule, action, args, name)`
789
+ - [ ] Implement `unregister(ctx, name)`
790
+ - [ ] Implement `list(ctx)` for registered crons
791
+ - [ ] Support cron specs (e.g., "0 0 \* \* \*")
792
+
793
+ ### ⏳ Infer 47: Effect-Based Cron Job Logic
794
+
795
+ **Status:** Pending
796
+ **Dependencies:** Infer 46
797
+ **Task:** Use Effect in cron job handlers
798
+ **File:** `backend/convex/domain/crons/daily-maintenance.ts`
799
+ **Acceptance Criteria:**
800
+
801
+ - [ ] Create `dailyMaintenanceWithEffect` internalAction
802
+ - [ ] Use Effect.gen for job logic
803
+ - [ ] Inject services (RAGService, MonitoringService)
804
+ - [ ] Clean up old content (Effect-wrapped mutation)
805
+ - [ ] Generate daily report (Effect service call)
806
+ - [ ] Send report via email (Effect-wrapped action)
807
+ - [ ] Handle errors with Effect.catchAll (log + succeed)
808
+ - [ ] Run with Effect.runPromise
809
+
810
+ ### ⏳ Infer 48: Test CronService with Effect
811
+
812
+ **Status:** Pending
813
+ **Dependencies:** Infer 47
814
+ **Task:** Create test layer for CronService
815
+ **File:** `backend/convex/services/crons.service.test.ts`
816
+ **Acceptance Criteria:**
817
+
818
+ - [ ] Create `TestCronServiceLive` layer
819
+ - [ ] Mock `register` stores cron definition
820
+ - [ ] Mock `list` returns registered crons
821
+ - [ ] Test cron registration (succeeds)
822
+ - [ ] Test cron execution (job runs on schedule)
823
+ - [ ] Test cron unregistration (removes from list)
824
+ - [ ] Test job errors (logged, job continues)
825
+ - [ ] Test Effect-based job logic (services injected)
826
+
827
+ ### ⏳ Infer 49: Add Cron Error Types
828
+
829
+ **Status:** Pending
830
+ **Dependencies:** Infer 48
831
+ **Task:** Define comprehensive error types for crons
832
+ **File:** `backend/convex/domain/crons/errors.ts`
833
+ **Acceptance Criteria:**
834
+
835
+ - [ ] `CronRegisterError` - Failed to register cron (includes cronspec, cause)
836
+ - [ ] `CronExecutionError` - Cron job execution failed (includes jobName, cause)
837
+ - [ ] `InvalidCronspecError` - Cron schedule format invalid (includes cronspec)
838
+ - [ ] `CronNotFoundError` - Cron doesn't exist (includes cronName)
839
+ - [ ] All errors extend `Data.TaggedError`
840
+
841
+ ### ⏳ Infer 50: Integrate Crons with Monitoring
842
+
843
+ **Status:** Pending
844
+ **Dependencies:** Infer 49
845
+ **Task:** Track cron job executions via MonitoringService
846
+ **File:** `backend/convex/domain/crons/daily-maintenance.ts`
847
+ **Acceptance Criteria:**
848
+
849
+ - [ ] Inject MonitoringService in cron job
850
+ - [ ] Track job start (Effect.tap)
851
+ - [ ] Track job completion (Effect.tap)
852
+ - [ ] Track job errors (Effect.tapError)
853
+ - [ ] Log execution duration
854
+ - [ ] Alert if job fails repeatedly (3+ times)
855
+ - [ ] Store job metrics in database
856
+
857
+ ---
858
+
859
+ ## Domain Logic Phase (Infer 51-70)
860
+
861
+ **Agents:** agent-backend, agent-builder
862
+ **Goal:** Build complex business logic using Effect services
863
+
864
+ ### ⏳ Infer 51: Multi-Agent Orchestration with Effect
865
+
866
+ **Status:** Pending
867
+ **Dependencies:** Infer 50
868
+ **Task:** Compose multiple agents in parallel and sequential flows
869
+ **File:** `backend/convex/domain/agents/orchestration.ts`
870
+ **Acceptance Criteria:**
871
+
872
+ - [ ] Create `multiAgentPipeline` action
873
+ - [ ] Inject AgentService and RAGService
874
+ - [ ] Sequential: Fetch context → Classify intent → Route to agent
875
+ - [ ] Parallel: Quality checks (grammar + factuality)
876
+ - [ ] Use Effect.gen for sequential, Effect.all for parallel
877
+ - [ ] Handle errors from multiple agents gracefully
878
+ - [ ] Return combined result
879
+
880
+ ### ⏳ Infer 52: Parallel Agent Execution (Effect.all)
881
+
882
+ **Status:** Pending
883
+ **Dependencies:** Infer 51
884
+ **Task:** Run multiple agents concurrently with concurrency control
885
+ **File:** `backend/convex/domain/agents/orchestration.ts`
886
+ **Acceptance Criteria:**
887
+
888
+ - [ ] Use Effect.all with concurrency: 2 (limit parallel agents)
889
+ - [ ] Execute: [webSearchAgent, academicAgent, newsAgent]
890
+ - [ ] Collect results in array
891
+ - [ ] Handle partial failures (mode: "default" vs "either")
892
+ - [ ] Return all results or fail fast
893
+ - [ ] Log agent execution metrics
894
+
895
+ ### ⏳ Infer 53: Sequential Agent Pipelines (Effect.gen)
896
+
897
+ **Status:** Pending
898
+ **Dependencies:** Infer 52
899
+ **Task:** Chain agents where output of one feeds into next
900
+ **File:** `backend/convex/domain/agents/orchestration.ts`
901
+ **Acceptance Criteria:**
902
+
903
+ - [ ] Use Effect.gen for sequential composition
904
+ - [ ] Example: ClassifyAgent → (if technical) TechnicalAgent → QualityCheckAgent
905
+ - [ ] Pass results between steps (yield\* pattern)
906
+ - [ ] Short-circuit on errors (automatic with Effect)
907
+ - [ ] Add Effect.tap for logging intermediate results
908
+ - [ ] Return final result
909
+
910
+ ### ⏳ Infer 54: Conditional Agent Routing
911
+
912
+ **Status:** Pending
913
+ **Dependencies:** Infer 53
914
+ **Task:** Route to different agents based on classification
915
+ **File:** `backend/convex/domain/agents/orchestration.ts`
916
+ **Acceptance Criteria:**
917
+
918
+ - [ ] Classify query type (technical, sales, support)
919
+ - [ ] Route to appropriate agent based on classification
920
+ - [ ] Use Effect conditional logic (ternary or if/else in Effect.gen)
921
+ - [ ] Fall back to general agent if classification fails
922
+ - [ ] Log routing decisions as events
923
+ - [ ] Test all routing paths
924
+
925
+ ### ⏳ Infer 55: Error Propagation Across Agents
926
+
927
+ **Status:** Pending
928
+ **Dependencies:** Infer 54
929
+ **Task:** Handle errors from any agent in pipeline
930
+ **File:** `backend/convex/domain/agents/orchestration.ts`
931
+ **Acceptance Criteria:**
932
+
933
+ - [ ] Use Effect.catchTag for specific agent errors
934
+ - [ ] Example: Catch ClassificationError, use default route
935
+ - [ ] Example: Catch AgentError from any agent, return fallback response
936
+ - [ ] Use Effect.catchAll for unexpected errors
937
+ - [ ] Log all errors as events
938
+ - [ ] Graceful degradation (partial results)
939
+
940
+ ### ⏳ Infer 56: Research Workflow Implementation (Part 1: Structure)
941
+
942
+ **Status:** Pending
943
+ **Dependencies:** Infer 55
944
+ **Task:** Define research workflow structure
945
+ **File:** `backend/convex/domain/workflows/research.ts`
946
+ **Acceptance Criteria:**
947
+
948
+ - [ ] Import workflow from services/workflow.service
949
+ - [ ] Define `researchWorkflow` with workflow.define
950
+ - [ ] Args: { query: v.string(), userId: v.string() }
951
+ - [ ] Return type: ResearchResult
952
+ - [ ] Stub handler (async function with steps)
953
+ - [ ] Plan 5 steps: Classify, Parallel Research, Synthesize, Generate Report, Save
954
+
955
+ ### ⏳ Infer 57: Research Workflow (Part 2: Parallel Research)
956
+
957
+ **Status:** Pending
958
+ **Dependencies:** Infer 56
959
+ **Task:** Implement parallel research step
960
+ **File:** `backend/convex/domain/workflows/research.ts`
961
+ **Acceptance Criteria:**
962
+
963
+ - [ ] Step 2: Parallel research with Promise.all
964
+ - [ ] Run: webSearchAgent, academicAgent, newsAgent (all actions)
965
+ - [ ] Use step.runAction for each agent
966
+ - [ ] Collect results in array
967
+ - [ ] Handle failures (log but continue)
968
+ - [ ] Pass results to next step
969
+
970
+ ### ⏳ Infer 58: Research Workflow (Part 3: Synthesis with Effect)
971
+
972
+ **Status:** Pending
973
+ **Dependencies:** Infer 57
974
+ **Task:** Synthesize findings using Effect services
975
+ **File:** `backend/convex/domain/workflows/research.ts`
976
+ **Acceptance Criteria:**
977
+
978
+ - [ ] Create `synthesisAgentWithEffect` internalAction
979
+ - [ ] Use Effect.gen for composition
980
+ - [ ] Inject AgentService and RAGService
981
+ - [ ] Fetch background context (RAGService.search)
982
+ - [ ] Synthesize findings with agent
983
+ - [ ] Add Effect.retry for robustness
984
+ - [ ] Return synthesis result
985
+ - [ ] Call from workflow step
986
+
987
+ ### ⏳ Infer 59: Research Workflow (Part 4: Report Generation)
988
+
989
+ **Status:** Pending
990
+ **Dependencies:** Infer 58
991
+ **Task:** Generate final report
992
+ **File:** `backend/convex/domain/workflows/research.ts`
993
+ **Acceptance Criteria:**
994
+
995
+ - [ ] Step 4: Generate report (step.runAction)
996
+ - [ ] Create `reportGeneratorWithEffect` internalAction
997
+ - [ ] Use AgentService to format report
998
+ - [ ] Include: Summary, key findings, sources, recommendations
999
+ - [ ] Format as markdown
1000
+ - [ ] Add Effect error handling
1001
+ - [ ] Return formatted report
1002
+
1003
+ ### ⏳ Infer 60: Research Workflow (Part 5: Save and Notify)
1004
+
1005
+ **Status:** Pending
1006
+ **Dependencies:** Infer 59
1007
+ **Task:** Save report and notify user
1008
+ **File:** `backend/convex/domain/workflows/research.ts`
1009
+ **Acceptance Criteria:**
1010
+
1011
+ - [ ] Step 5: Save report (step.runMutation)
1012
+ - [ ] Create mutation to save to database
1013
+ - [ ] Send notification email (optional action)
1014
+ - [ ] Log workflow completion event
1015
+ - [ ] Return final report
1016
+ - [ ] Test complete workflow end-to-end
1017
+
1018
+ ### ⏳ Infer 61: Support Ticket Workflow (Part 1: Structure)
1019
+
1020
+ **Status:** Pending
1021
+ **Dependencies:** Infer 60
1022
+ **Task:** Define support ticket workflow
1023
+ **File:** `backend/convex/domain/workflows/support.ts`
1024
+ **Acceptance Criteria:**
1025
+
1026
+ - [ ] Define `supportTicketWorkflow` with workflow.define
1027
+ - [ ] Args: { userId: v.string(), issue: v.string() }
1028
+ - [ ] Return type: SupportResult
1029
+ - [ ] Plan 4 steps: Create thread, Generate response, Quality check, Save ticket
1030
+ - [ ] Stub handler
1031
+
1032
+ ### ⏳ Infer 62: Support Workflow (Part 2: Create Thread)
1033
+
1034
+ **Status:** Pending
1035
+ **Dependencies:** Infer 61
1036
+ **Task:** Create agent thread for support
1037
+ **File:** `backend/convex/domain/workflows/support.ts`
1038
+ **Acceptance Criteria:**
1039
+
1040
+ - [ ] Step 1: Fetch user context (step.runQuery)
1041
+ - [ ] Step 2: Create agent thread (step.runAction)
1042
+ - [ ] Use `createSupportThreadWithEffect` internalAction
1043
+ - [ ] Inject AgentService and RAGService
1044
+ - [ ] Fetch relevant KB articles (RAG)
1045
+ - [ ] Create thread with context
1046
+ - [ ] Return threadId and initial response
1047
+
1048
+ ### ⏳ Infer 63: Support Workflow (Part 3: Quality Check)
1049
+
1050
+ **Status:** Pending
1051
+ **Dependencies:** Infer 62
1052
+ **Task:** Check response quality in parallel
1053
+ **File:** `backend/convex/domain/workflows/support.ts`
1054
+ **Acceptance Criteria:**
1055
+
1056
+ - [ ] Step 3: Parallel quality checks (Promise.all)
1057
+ - [ ] Check grammar score (step.runAction)
1058
+ - [ ] Check factuality score (step.runAction)
1059
+ - [ ] Both use Effect services internally
1060
+ - [ ] Return scores
1061
+ - [ ] Refine response if scores < 0.8
1062
+
1063
+ ### ⏳ Infer 64: Support Workflow (Part 4: Refine Response)
1064
+
1065
+ **Status:** Pending
1066
+ **Dependencies:** Infer 63
1067
+ **Task:** Refine response if quality checks fail
1068
+ **File:** `backend/convex/domain/workflows/support.ts`
1069
+ **Acceptance Criteria:**
1070
+
1071
+ - [ ] Conditional: If grammarScore < 0.8 OR factualityScore < 0.8
1072
+ - [ ] Run: `refineResponseWithEffect` (step.runAction)
1073
+ - [ ] Use Effect.retry (max 2 attempts)
1074
+ - [ ] Re-run quality checks
1075
+ - [ ] Return refined response or original if retries fail
1076
+ - [ ] Log refinement attempts
1077
+
1078
+ ### ⏳ Infer 65: Support Workflow (Part 5: Save Ticket)
1079
+
1080
+ **Status:** Pending
1081
+ **Dependencies:** Infer 64
1082
+ **Task:** Save support ticket to database
1083
+ **File:** `backend/convex/domain/workflows/support.ts`
1084
+ **Acceptance Criteria:**
1085
+
1086
+ - [ ] Step 4: Save ticket (step.runMutation)
1087
+ - [ ] Store: userId, threadId, issue, response, qualityScores
1088
+ - [ ] Create ticket entity in database
1089
+ - [ ] Send notification to support team (optional)
1090
+ - [ ] Log ticket creation event
1091
+ - [ ] Return ticket result
1092
+
1093
+ ### ⏳ Infer 66: Tool Definition: Email Tool with Effect
1094
+
1095
+ **Status:** Pending
1096
+ **Dependencies:** Infer 65
1097
+ **Task:** Create email tool using Effect services
1098
+ **File:** `backend/convex/domain/agents/tools.ts`
1099
+ **Acceptance Criteria:**
1100
+
1101
+ - [ ] Define `EmailService` Context.Tag
1102
+ - [ ] Implement `EmailServiceLive` (uses SendGrid or Resend)
1103
+ - [ ] Create `emailTool` with createTool
1104
+ - [ ] Tool handler uses Effect.gen internally
1105
+ - [ ] Inject EmailService (yield\* EmailService)
1106
+ - [ ] Send email with service
1107
+ - [ ] Convert Effect to Promise (Effect.runPromise)
1108
+ - [ ] Return success/failure message
1109
+
1110
+ ### ⏳ Infer 67: Tool Definition: Database Query Tool with Effect
1111
+
1112
+ **Status:** Pending
1113
+ **Dependencies:** Infer 66
1114
+ **Task:** Create database query tool using Effect
1115
+ **File:** `backend/convex/domain/agents/tools.ts`
1116
+ **Acceptance Criteria:**
1117
+
1118
+ - [ ] Define `DatabaseService` Context.Tag
1119
+ - [ ] Implement `DatabaseServiceLive` (wraps ctx.db operations)
1120
+ - [ ] Create `databaseQueryTool` with createTool
1121
+ - [ ] Tool handler uses Effect.gen
1122
+ - [ ] Inject DatabaseService
1123
+ - [ ] Execute query (e.g., search users by email)
1124
+ - [ ] Return results as string (formatted)
1125
+ - [ ] Handle errors gracefully
1126
+
1127
+ ### ⏳ Infer 68: Tool Definition: External API Tool with Effect
1128
+
1129
+ **Status:** Pending
1130
+ **Dependencies:** Infer 67
1131
+ **Task:** Create external API tool using Effect
1132
+ **File:** `backend/convex/domain/agents/tools.ts`
1133
+ **Acceptance Criteria:**
1134
+
1135
+ - [ ] Define `ExternalAPIService` Context.Tag
1136
+ - [ ] Implement `ExternalAPIServiceLive` (uses fetch)
1137
+ - [ ] Create `externalAPITool` with createTool
1138
+ - [ ] Tool handler uses Effect.gen
1139
+ - [ ] Inject ExternalAPIService
1140
+ - [ ] Make API call with retry (Effect.retry)
1141
+ - [ ] Parse response
1142
+ - [ ] Return result to agent
1143
+
1144
+ ### ⏳ Infer 69: Error Handling in Agent Tools
1145
+
1146
+ **Status:** Pending
1147
+ **Dependencies:** Infer 68
1148
+ **Task:** Handle errors gracefully in all tools
1149
+ **File:** `backend/convex/domain/agents/tools.ts`
1150
+ **Acceptance Criteria:**
1151
+
1152
+ - [ ] Wrap all tool operations in Effect.tryPromise
1153
+ - [ ] Define tool-specific error types (EmailError, APIError, etc.)
1154
+ - [ ] Use Effect.catchAll to return error messages
1155
+ - [ ] Log tool errors as events
1156
+ - [ ] Return helpful error messages to agent (not exceptions)
1157
+ - [ ] Agent continues even if tool fails
1158
+
1159
+ ### ⏳ Infer 70: Register Tools with Agent
1160
+
1161
+ **Status:** Pending
1162
+ **Dependencies:** Infer 69
1163
+ **Task:** Add all tools to Agent component
1164
+ **File:** `backend/convex/services/agent.service.ts`
1165
+ **Acceptance Criteria:**
1166
+
1167
+ - [ ] Import all tools (emailTool, databaseQueryTool, externalAPITool)
1168
+ - [ ] Register in Agent config: `tools: { sendEmail: emailTool, queryDB: databaseQueryTool, callAPI: externalAPITool }`
1169
+ - [ ] Agent can now call tools
1170
+ - [ ] Test agent using tools (integration test)
1171
+ - [ ] Verify Effect services injected correctly in tools
1172
+ - [ ] Log tool usage metrics
1173
+
1174
+ ---
1175
+
1176
+ ## Observability & Testing Phase (Infer 71-90)
1177
+
1178
+ **Agents:** agent-quality, agent-ops
1179
+ **Goal:** Monitoring, testing, error handling, resource management
1180
+
1181
+ ### ⏳ Infer 71: Create MonitoringService with Effect
1182
+
1183
+ **Status:** Pending
1184
+ **Dependencies:** Infer 70
1185
+ **Task:** Implement observability service
1186
+ **File:** `backend/convex/services/monitoring.service.ts`
1187
+ **Acceptance Criteria:**
1188
+
1189
+ - [ ] Define `MonitoringService` Context.Tag
1190
+ - [ ] Interface: `trackServiceCall(name, duration, result)`, `trackError(error)`, `trackTokenUsage(tokens)`
1191
+ - [ ] Implement `MonitoringServiceLive` (logs to console + database)
1192
+ - [ ] Use Effect.tap to track service calls
1193
+ - [ ] Use Effect.tapError to track errors
1194
+ - [ ] Store metrics in database (events table)
1195
+ - [ ] Export metrics for external tools (Sentry, Datadog)
1196
+
1197
+ ### ⏳ Infer 72: Track Service Call Lifecycle
1198
+
1199
+ **Status:** Pending
1200
+ **Dependencies:** Infer 71
1201
+ **Task:** Log start, complete, fail for every service call
1202
+ **File:** `backend/convex/lib/monitoring.ts`
1203
+ **Acceptance Criteria:**
1204
+
1205
+ - [ ] Wrap service calls with Effect.tap
1206
+ - [ ] Log service_call_started event (service name, args)
1207
+ - [ ] Log service_call_completed event (service name, duration, result)
1208
+ - [ ] Log service_call_failed event (service name, error, duration)
1209
+ - [ ] Include trace ID for distributed tracing
1210
+ - [ ] Store in events table with metadata
1211
+
1212
+ ### ⏳ Infer 73: Track Token Usage for AI Services
1213
+
1214
+ **Status:** Pending
1215
+ **Dependencies:** Infer 72
1216
+ **Task:** Monitor AI model token consumption
1217
+ **File:** `backend/convex/services/agent.service.ts`
1218
+ **Acceptance Criteria:**
1219
+
1220
+ - [ ] Extract token usage from agent response (response.usage)
1221
+ - [ ] Call `MonitoringService.trackTokenUsage`
1222
+ - [ ] Store: promptTokens, completionTokens, totalTokens, model, timestamp
1223
+ - [ ] Aggregate usage per user, per organization
1224
+ - [ ] Alert if usage exceeds quota
1225
+ - [ ] Display in usage dashboard (frontend)
1226
+
1227
+ ### ⏳ Infer 74: Error Tracking with Sentry Integration
1228
+
1229
+ **Status:** Pending
1230
+ **Dependencies:** Infer 73
1231
+ **Task:** Send errors to Sentry for debugging
1232
+ **File:** `backend/convex/lib/monitoring.ts`
1233
+ **Acceptance Criteria:**
1234
+
1235
+ - [ ] Install `@sentry/node`
1236
+ - [ ] Initialize Sentry in MonitoringService
1237
+ - [ ] Capture Effect errors with Sentry.captureException
1238
+ - [ ] Include: Error type, stack trace, service context, user context
1239
+ - [ ] Group errors by error type (\_tag)
1240
+ - [ ] Link Sentry issues to Convex functions
1241
+ - [ ] Test error capture
1242
+
1243
+ ### ⏳ Infer 75: Performance Metrics Tracking
1244
+
1245
+ **Status:** Pending
1246
+ **Dependencies:** Infer 74
1247
+ **Task:** Track latency per service operation
1248
+ **File:** `backend/convex/lib/monitoring.ts`
1249
+ **Acceptance Criteria:**
1250
+
1251
+ - [ ] Measure duration for every service call (Date.now())
1252
+ - [ ] Store: service name, operation, duration, timestamp
1253
+ - [ ] Calculate: p50, p95, p99 latency (in database query)
1254
+ - [ ] Alert if latency exceeds threshold (p95 > 500ms)
1255
+ - [ ] Display in monitoring dashboard
1256
+ - [ ] Export to external APM (Application Performance Monitoring)
1257
+
1258
+ ### ⏳ Infer 76: Create Test Layers (Mock Implementations)
1259
+
1260
+ **Status:** Pending
1261
+ **Dependencies:** Infer 75
1262
+ **Task:** Build test implementations for all services
1263
+ **File:** `backend/convex/services/test-layers.ts`
1264
+ **Acceptance Criteria:**
1265
+
1266
+ - [ ] Create `TestAgentServiceLive` with mock generateResponse
1267
+ - [ ] Create `TestRAGServiceLive` with mock search
1268
+ - [ ] Create `TestRateLimitServiceLive` with mock checkLimit
1269
+ - [ ] Create `TestWorkflowServiceLive` with mock workflow steps
1270
+ - [ ] Create `TestMonitoringServiceLive` (no-op logging)
1271
+ - [ ] Export all test layers for use in tests
1272
+ - [ ] Document how to use test layers
1273
+
1274
+ ### ⏳ Infer 77: Test AgentService with Mock Layer
1275
+
1276
+ **Status:** Pending
1277
+ **Dependencies:** Infer 76
1278
+ **Task:** Write unit tests for AgentService using test layer
1279
+ **File:** `backend/convex/services/agent.service.test.ts`
1280
+ **Acceptance Criteria:**
1281
+
1282
+ - [ ] Test: `generateResponse` returns mock response
1283
+ - [ ] Test: `createThread` returns deterministic threadId
1284
+ - [ ] Test: Rate limit check (mocked RateLimitService)
1285
+ - [ ] Test: Error handling (AgentError thrown and caught)
1286
+ - [ ] Test: Retry logic (transient errors recover)
1287
+ - [ ] All tests use `TestAgentServiceLive` layer
1288
+ - [ ] All tests pass
1289
+
1290
+ ### ⏳ Infer 78: Test RAGService with Mock Layer
1291
+
1292
+ **Status:** Pending
1293
+ **Dependencies:** Infer 77
1294
+ **Task:** Write unit tests for RAGService
1295
+ **File:** `backend/convex/services/rag.service.test.ts`
1296
+ **Acceptance Criteria:**
1297
+
1298
+ - [ ] Test: `search` returns mock results with scores
1299
+ - [ ] Test: `addDocument` returns deterministic entryId
1300
+ - [ ] Test: Error handling (SearchError, EmbeddingError)
1301
+ - [ ] Test: Composition with AgentService (integration)
1302
+ - [ ] Use `TestRAGServiceLive` layer
1303
+ - [ ] All tests pass
1304
+
1305
+ ### ⏳ Infer 79: Test Effect Error Handling (Effect.catchTag)
1306
+
1307
+ **Status:** Pending
1308
+ **Dependencies:** Infer 78
1309
+ **Task:** Validate error handling patterns
1310
+ **File:** `backend/convex/domain/agents/orchestration.test.ts`
1311
+ **Acceptance Criteria:**
1312
+
1313
+ - [ ] Test: Catch specific error (Effect.catchTag("AgentError"))
1314
+ - [ ] Test: Catch all errors (Effect.catchAll)
1315
+ - [ ] Test: Error propagation (child service error bubbles up)
1316
+ - [ ] Test: Graceful degradation (return fallback on error)
1317
+ - [ ] Test: Retry on specific errors (Effect.retry with Schedule.whileInput)
1318
+ - [ ] All tests use test layers
1319
+ - [ ] All tests pass
1320
+
1321
+ ### ⏳ Infer 80: Integration Tests with Real Components
1322
+
1323
+ **Status:** Pending
1324
+ **Dependencies:** Infer 79
1325
+ **Task:** Test with actual Convex components (not mocks)
1326
+ **File:** `backend/convex/integration/services.test.ts`
1327
+ **Acceptance Criteria:**
1328
+
1329
+ - [ ] Test: AgentService with real @convex-dev/agent
1330
+ - [ ] Test: RAGService with real @convex-dev/rag
1331
+ - [ ] Test: RateLimitService with real @convex-dev/rate-limiter
1332
+ - [ ] Test: End-to-end flow (create thread → search RAG → generate response)
1333
+ - [ ] Test: Error handling with real components
1334
+ - [ ] Test: Performance (latency within acceptable range)
1335
+ - [ ] All integration tests pass
1336
+
1337
+ ### ⏳ Infer 81: Layered Error Handling Pattern
1338
+
1339
+ **Status:** Pending
1340
+ **Dependencies:** Infer 80
1341
+ **Task:** Implement layered error handling strategy
1342
+ **File:** `backend/convex/lib/error-handling.ts`
1343
+ **Acceptance Criteria:**
1344
+
1345
+ - [ ] Domain errors: Business logic failures (UserNotFoundError)
1346
+ - [ ] Infrastructure errors: Component failures (AgentError, RAGError)
1347
+ - [ ] Handle domain errors specifically (Effect.catchTag)
1348
+ - [ ] Handle infrastructure errors with retry (Effect.retry)
1349
+ - [ ] Catch-all for unexpected errors (Effect.catchAll)
1350
+ - [ ] Example implementation in orchestration.ts
1351
+ - [ ] Document pattern
1352
+
1353
+ ### ⏳ Infer 82: Retry Strategies (Schedule.exponential)
1354
+
1355
+ **Status:** Pending
1356
+ **Dependencies:** Infer 81
1357
+ **Task:** Implement smart retry policies
1358
+ **File:** `backend/convex/lib/retry-strategies.ts`
1359
+ **Acceptance Criteria:**
1360
+
1361
+ - [ ] Exponential backoff: Schedule.exponential("1 second").pipe(Schedule.recurs(3))
1362
+ - [ ] Retry only specific errors: Schedule.whileInput((error) => error.\_tag === "TransientError")
1363
+ - [ ] Max retries: Schedule.recurs(5)
1364
+ - [ ] Retry with jitter: Add randomness to backoff
1365
+ - [ ] Document when to use each strategy
1366
+ - [ ] Apply to agent, RAG, external API calls
1367
+
1368
+ ### ⏳ Infer 83: Circuit Breaker Pattern with Effect
1369
+
1370
+ **Status:** Pending
1371
+ **Dependencies:** Infer 82
1372
+ **Task:** Prevent cascading failures
1373
+ **File:** `backend/convex/lib/circuit-breaker.ts`
1374
+ **Acceptance Criteria:**
1375
+
1376
+ - [ ] Define circuit breaker states: Closed, Open, HalfOpen
1377
+ - [ ] Track failure rate (e.g., 5 failures in 10 seconds → Open)
1378
+ - [ ] Open state: Reject requests immediately (no calls to service)
1379
+ - [ ] HalfOpen state: Allow limited requests to test recovery
1380
+ - [ ] Closed state: Normal operation
1381
+ - [ ] Implement with Effect.Ref for state management
1382
+ - [ ] Apply to external API calls
1383
+
1384
+ ### ⏳ Infer 84: Graceful Degradation Pattern
1385
+
1386
+ **Status:** Pending
1387
+ **Dependencies:** Infer 83
1388
+ **Task:** Return partial results on failure
1389
+ **File:** `backend/convex/domain/agents/orchestration.ts`
1390
+ **Acceptance Criteria:**
1391
+
1392
+ - [ ] Example: Multi-agent pipeline fails for one agent
1393
+ - [ ] Return results from successful agents
1394
+ - [ ] Include error message for failed agent
1395
+ - [ ] User gets partial response, not complete failure
1396
+ - [ ] Log degradation event (service_degraded)
1397
+ - [ ] Test with mock failures
1398
+
1399
+ ### ⏳ Infer 85: Resource Management with Effect.Scope
1400
+
1401
+ **Status:** Pending
1402
+ **Dependencies:** Infer 84
1403
+ **Task:** Implement resource acquisition/release
1404
+ **File:** `backend/convex/lib/resource-management.ts`
1405
+ **Acceptance Criteria:**
1406
+
1407
+ - [ ] Use Effect.Scope for resource lifecycle
1408
+ - [ ] Pattern: Effect.acquireRelease(acquire, release)
1409
+ - [ ] Example: Acquire agent pool, release on completion/error
1410
+ - [ ] Ensure resources released even on failure
1411
+ - [ ] Test resource cleanup (no leaks)
1412
+ - [ ] Document pattern
1413
+
1414
+ ### ⏳ Infer 86: Connection Pooling for External APIs
1415
+
1416
+ **Status:** Pending
1417
+ **Dependencies:** Infer 85
1418
+ **Task:** Reuse connections for efficiency
1419
+ **File:** `backend/convex/lib/connection-pool.ts`
1420
+ **Acceptance Criteria:**
1421
+
1422
+ - [ ] Create connection pool for external APIs
1423
+ - [ ] Acquire connection from pool (Effect.acquireRelease)
1424
+ - [ ] Reuse connections across requests
1425
+ - [ ] Release connection back to pool
1426
+ - [ ] Close pool on shutdown (cleanup)
1427
+ - [ ] Test pool behavior (acquire, reuse, release)
1428
+
1429
+ ### ⏳ Infer 87: Agent Pool Lifecycle Management
1430
+
1431
+ **Status:** Pending
1432
+ **Dependencies:** Infer 86
1433
+ **Task:** Manage pool of agent instances
1434
+ **File:** `backend/convex/services/agent.service.ts`
1435
+ **Acceptance Criteria:**
1436
+
1437
+ - [ ] Create pool of agent instances (e.g., 10 agents)
1438
+ - [ ] Acquire agent from pool for request
1439
+ - [ ] Release agent back to pool
1440
+ - [ ] Handle pool exhaustion (queue requests)
1441
+ - [ ] Shutdown pool gracefully (finish in-flight requests)
1442
+ - [ ] Test pool under load
1443
+
1444
+ ### ⏳ Infer 88: Cleanup on Failure
1445
+
1446
+ **Status:** Pending
1447
+ **Dependencies:** Infer 87
1448
+ **Task:** Ensure resources released on errors
1449
+ **File:** `backend/convex/lib/resource-management.ts`
1450
+ **Acceptance Criteria:**
1451
+
1452
+ - [ ] Use Effect.acquireRelease (release always called)
1453
+ - [ ] Test: Throw error during operation, verify release called
1454
+ - [ ] Test: Multiple resources acquired, all released on error
1455
+ - [ ] Example: Acquire DB connection, agent, external API connection
1456
+ - [ ] All released if any operation fails
1457
+ - [ ] No resource leaks
1458
+
1459
+ ### ⏳ Infer 89: Resource Acquisition/Release Patterns
1460
+
1461
+ **Status:** Pending
1462
+ **Dependencies:** Infer 88
1463
+ **Task:** Document common resource management patterns
1464
+ **File:** `backend/convex/lib/resource-management.md`
1465
+ **Acceptance Criteria:**
1466
+
1467
+ - [ ] Pattern 1: Single resource (Effect.acquireRelease)
1468
+ - [ ] Pattern 2: Multiple resources (nested acquireRelease)
1469
+ - [ ] Pattern 3: Conditional resource acquisition
1470
+ - [ ] Pattern 4: Resource pooling
1471
+ - [ ] Pattern 5: Cleanup on shutdown
1472
+ - [ ] Code examples for each pattern
1473
+ - [ ] Best practices
1474
+
1475
+ ### ⏳ Infer 90: Resource Safety Tests
1476
+
1477
+ **Status:** Pending
1478
+ **Dependencies:** Infer 89
1479
+ **Task:** Validate zero resource leaks
1480
+ **File:** `backend/convex/lib/resource-management.test.ts`
1481
+ **Acceptance Criteria:**
1482
+
1483
+ - [ ] Test: Acquire and release resource (success path)
1484
+ - [ ] Test: Acquire and release resource (error path)
1485
+ - [ ] Test: Multiple resources acquired and released
1486
+ - [ ] Test: Resource pool behavior (acquire, reuse, release)
1487
+ - [ ] Test: Memory usage (no leaks after 1000 operations)
1488
+ - [ ] All tests pass
1489
+
1490
+ ---
1491
+
1492
+ ## Advanced Patterns & Documentation Phase (Infer 91-100)
1493
+
1494
+ **Agents:** agent-documenter, agent-ops, agent-backend
1495
+ **Goal:** Confect evaluation, documentation, optimization, launch
1496
+
1497
+ ### ⏳ Infer 91: Evaluate Confect for Full Effect Integration
1498
+
1499
+ **Status:** Pending
1500
+ **Dependencies:** Infer 90
1501
+ **Task:** Assess Confect vs manual integration
1502
+ **File:** `one/things/plans/confect-evaluation.md`
1503
+ **Acceptance Criteria:**
1504
+
1505
+ - [ ] Install @rjdellecese/confect
1506
+ - [ ] Create sample schema with Effect Schema
1507
+ - [ ] Define sample query/mutation with Confect
1508
+ - [ ] Compare: Manual integration vs Confect
1509
+ - [ ] Pros: Effect-native, Option<A> instead of A | null, Effect.Schema
1510
+ - [ ] Cons: Learning curve, team adoption, migration effort
1511
+ - [ ] Recommendation: Manual integration (gradual adoption) vs Confect (new projects)
1512
+
1513
+ ### ⏳ Infer 92: Confect + Convex Components Pattern
1514
+
1515
+ **Status:** Pending
1516
+ **Dependencies:** Infer 91
1517
+ **Task:** Test Confect compatibility with components
1518
+ **File:** `backend/convex/confect-test.ts`
1519
+ **Acceptance Criteria:**
1520
+
1521
+ - [ ] Define schema with Confect (defineSchema, defineTable)
1522
+ - [ ] Create Confect functions (query, mutation, action)
1523
+ - [ ] Use Convex components in Confect actions
1524
+ - [ ] Wrap component calls with Effect.tryPromise
1525
+ - [ ] Verify: Confect context compatible with component context
1526
+ - [ ] Document integration pattern
1527
+ - [ ] Test end-to-end
1528
+
1529
+ ### ⏳ Infer 93: Migration Guide (Promise → Effect, Manual → Confect)
1530
+
1531
+ **Status:** Pending
1532
+ **Dependencies:** Infer 92
1533
+ **Task:** Document migration strategies
1534
+ **File:** `one/things/plans/effect-migration-guide.md`
1535
+ **Acceptance Criteria:**
1536
+
1537
+ - [ ] Guide 1: Migrating Promise-based code to Effect
1538
+ - [ ] Guide 2: Migrating manual Effect integration to Confect
1539
+ - [ ] Step-by-step instructions
1540
+ - [ ] Code examples (before/after)
1541
+ - [ ] Common pitfalls and solutions
1542
+ - [ ] Timeline estimates (days per 1000 LOC)
1543
+ - [ ] Decision tree (when to migrate vs rewrite)
1544
+
1545
+ ### ⏳ Infer 94: Write Service Layer Guide
1546
+
1547
+ **Status:** Pending
1548
+ **Dependencies:** Infer 93
1549
+ **Task:** Comprehensive guide for Effect service layers
1550
+ **File:** `one/knowledge/effect-service-layer-guide.md`
1551
+ **Acceptance Criteria:**
1552
+
1553
+ - [ ] Overview: Effect wraps components, not replaces
1554
+ - [ ] Pattern 1: Effect-wrapped component
1555
+ - [ ] Pattern 2: Service layer (Context.Tag + Layer)
1556
+ - [ ] Pattern 3: Error handling (tagged errors)
1557
+ - [ ] Pattern 4: Parallel execution (Effect.all)
1558
+ - [ ] Pattern 5: Resource management (Scope, acquireRelease)
1559
+ - [ ] Code examples for all patterns
1560
+ - [ ] Best practices
1561
+
1562
+ ### ⏳ Infer 95: Document All Effect Patterns
1563
+
1564
+ **Status:** Pending
1565
+ **Dependencies:** Infer 94
1566
+ **Task:** Create pattern library
1567
+ **File:** `one/knowledge/effect-patterns.md`
1568
+ **Acceptance Criteria:**
1569
+
1570
+ - [ ] Pattern: Effect.tryPromise (Promise → Effect)
1571
+ - [ ] Pattern: Effect.gen (sequential composition)
1572
+ - [ ] Pattern: Effect.all (parallel composition)
1573
+ - [ ] Pattern: Effect.catchTag (specific error handling)
1574
+ - [ ] Pattern: Effect.catchAll (fallback error handling)
1575
+ - [ ] Pattern: Effect.retry + Schedule (retry policies)
1576
+ - [ ] Pattern: Effect.Scope + acquireRelease (resource management)
1577
+ - [ ] Pattern: Context.Tag + Layer (dependency injection)
1578
+ - [ ] Code examples for each
1579
+
1580
+ ### ⏳ Infer 96: Create Example Programs
1581
+
1582
+ **Status:** Pending
1583
+ **Dependencies:** Infer 95
1584
+ **Task:** End-to-end examples using Effect services
1585
+ **File:** `one/knowledge/effect-examples.md`
1586
+ **Acceptance Criteria:**
1587
+
1588
+ - [ ] Example 1: Multi-agent orchestration
1589
+ - [ ] Example 2: Research workflow
1590
+ - [ ] Example 3: Support ticket workflow
1591
+ - [ ] Example 4: Batch processing with workpool
1592
+ - [ ] Example 5: Scheduled cron job with Effect
1593
+ - [ ] All examples fully working (copy-paste ready)
1594
+ - [ ] Include test setup
1595
+
1596
+ ### ⏳ Infer 97: Troubleshooting Guide for Effect Errors
1597
+
1598
+ **Status:** Pending
1599
+ **Dependencies:** Infer 96
1600
+ **Task:** Common errors and solutions
1601
+ **File:** `one/knowledge/effect-troubleshooting.md`
1602
+ **Acceptance Criteria:**
1603
+
1604
+ - [ ] Error: "No service found for tag X" → Forgot Effect.provide
1605
+ - [ ] Error: "Effect stack too deep" → Use Effect.fork or Effect.cached
1606
+ - [ ] Error: "Unhandled error in Effect" → Add Effect.catchAll
1607
+ - [ ] Error: "Promise rejection" → Wrap with Effect.tryPromise
1608
+ - [ ] Error: "Type mismatch" → Check error channel types
1609
+ - [ ] Solutions for each error
1610
+ - [ ] Debugging tips
1611
+
1612
+ ### ⏳ Infer 98: Performance Optimization
1613
+
1614
+ **Status:** Pending
1615
+ **Dependencies:** Infer 97
1616
+ **Task:** Optimize Effect-based code for production
1617
+ **File:** `backend/convex/lib/optimization.ts`
1618
+ **Acceptance Criteria:**
1619
+
1620
+ - [ ] Parallel execution with concurrency control (Effect.all)
1621
+ - [ ] Caching layer for service calls (Effect.cached)
1622
+ - [ ] Connection reuse (connection pooling)
1623
+ - [ ] Batch operations (combine multiple calls)
1624
+ - [ ] Benchmark: Effect vs Promise-based (ensure no regression)
1625
+ - [ ] Optimize hot paths (< 5% overhead)
1626
+
1627
+ ### ⏳ Infer 99: Deploy to Convex Production
1628
+
1629
+ **Status:** Pending
1630
+ **Dependencies:** Infer 98
1631
+ **Task:** Deploy Effect service layer to production
1632
+ **File:** N/A
1633
+ **Acceptance Criteria:**
1634
+
1635
+ - [ ] Run full test suite (unit + integration) → All pass
1636
+ - [ ] Deploy to Convex: `npx convex deploy`
1637
+ - [ ] Monitor service performance (latency, errors)
1638
+ - [ ] Verify all components working (agent, RAG, rate-limiter, etc.)
1639
+ - [ ] Check error rates (< 1%)
1640
+ - [ ] Monitor resource usage (memory, CPU)
1641
+ - [ ] Rollback plan ready (if issues detected)
1642
+
1643
+ ### ⏳ Infer 100: Mark Feature Complete and Train Team
1644
+
1645
+ **Status:** Pending
1646
+ **Dependencies:** Infer 99
1647
+ **Task:** Launch and knowledge transfer
1648
+ **File:** `one/events/components-feature-complete.md`
1649
+ **Acceptance Criteria:**
1650
+
1651
+ - [ ] All 100 inferences complete ✅
1652
+ - [ ] All tests passing (unit, integration, resource safety) ✅
1653
+ - [ ] Documentation complete (guides, patterns, examples, troubleshooting) ✅
1654
+ - [ ] Performance optimized (no regression) ✅
1655
+ - [ ] Deployed to production ✅
1656
+ - [ ] Team trained: Pair programming sessions (3 sessions)
1657
+ - [ ] Team trained: Effect workshop (1 day)
1658
+ - [ ] Create runbook for Effect errors (operations)
1659
+ - [ ] Celebrate! 🎉
1660
+
1661
+ ---
1662
+
1663
+ ## Summary Statistics
1664
+
1665
+ **Total Inferences:** 100
1666
+ **Estimated Duration:** 45-60 days (with parallelization)
1667
+ **Agents Involved:** 6 (director, backend, builder, ops, quality, documenter)
1668
+ **New Service Layers:** 8 (Agent, RAG, RateLimit, Workflow, Streaming, Workpool, Retrier, Crons)
1669
+ **Domain Workflows:** 2 (Research, Support)
1670
+ **Agent Tools:** 3 (Email, Database, External API)
1671
+ **Test Coverage:** 90%+ (unit + integration + resource safety)
1672
+ **Performance:** No regression vs Promise-based approach
1673
+
1674
+ ---
1675
+
1676
+ ## Next Steps
1677
+
1678
+ 1. **Start Execution:** Run `/next` to begin Infer 11 (AgentService implementation)
1679
+ 2. **Review Plan:** Use `/plan` to see full breakdown
1680
+ 3. **Track Progress:** Use `/now` to see current inference, `/done` to mark complete
1681
+ 4. **Quality Checks:** agent-quality will continuously validate patterns
1682
+
1683
+ **Ready to begin? Type `/next` to start Infer 11!**