oneie 3.6.40 → 3.7.0

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 (559) hide show
  1. package/CLAUDE.md +128 -319
  2. package/README.md +19 -0
  3. package/dist/admin/build.d.ts +15 -0
  4. package/dist/admin/build.d.ts.map +1 -0
  5. package/dist/admin/build.js +295 -0
  6. package/dist/admin/build.js.map +1 -0
  7. package/dist/admin/index.d.ts +24 -0
  8. package/dist/admin/index.d.ts.map +1 -0
  9. package/dist/admin/index.js +98 -0
  10. package/dist/admin/index.js.map +1 -0
  11. package/dist/admin/list.d.ts +14 -0
  12. package/dist/admin/list.d.ts.map +1 -0
  13. package/dist/admin/list.js +90 -0
  14. package/dist/admin/list.js.map +1 -0
  15. package/dist/admin/manifest.d.ts +86 -0
  16. package/dist/admin/manifest.d.ts.map +1 -0
  17. package/dist/admin/manifest.js +183 -0
  18. package/dist/admin/manifest.js.map +1 -0
  19. package/dist/admin/monorepo.d.ts +25 -0
  20. package/dist/admin/monorepo.d.ts.map +1 -0
  21. package/dist/admin/monorepo.js +59 -0
  22. package/dist/admin/monorepo.js.map +1 -0
  23. package/dist/admin/release.d.ts +17 -0
  24. package/dist/admin/release.d.ts.map +1 -0
  25. package/dist/admin/release.js +144 -0
  26. package/dist/admin/release.js.map +1 -0
  27. package/dist/admin/sync.d.ts +14 -0
  28. package/dist/admin/sync.d.ts.map +1 -0
  29. package/dist/admin/sync.js +104 -0
  30. package/dist/admin/sync.js.map +1 -0
  31. package/dist/admin/validate.d.ts +15 -0
  32. package/dist/admin/validate.d.ts.map +1 -0
  33. package/dist/admin/validate.js +169 -0
  34. package/dist/admin/validate.js.map +1 -0
  35. package/dist/commands/ask.d.ts +4 -0
  36. package/dist/commands/ask.d.ts.map +1 -0
  37. package/dist/commands/ask.js +8 -0
  38. package/dist/commands/ask.js.map +1 -0
  39. package/dist/commands/claw.d.ts +4 -0
  40. package/dist/commands/claw.d.ts.map +1 -0
  41. package/dist/commands/claw.js +14 -0
  42. package/dist/commands/claw.js.map +1 -0
  43. package/dist/commands/deploy.d.ts +4 -0
  44. package/dist/commands/deploy.d.ts.map +1 -0
  45. package/dist/commands/deploy.js +10 -0
  46. package/dist/commands/deploy.js.map +1 -0
  47. package/dist/commands/fade.d.ts +4 -0
  48. package/dist/commands/fade.d.ts.map +1 -0
  49. package/dist/commands/fade.js +11 -0
  50. package/dist/commands/fade.js.map +1 -0
  51. package/dist/commands/forget.d.ts +4 -0
  52. package/dist/commands/forget.d.ts.map +1 -0
  53. package/dist/commands/forget.js +16 -0
  54. package/dist/commands/forget.js.map +1 -0
  55. package/dist/commands/frontier.d.ts +4 -0
  56. package/dist/commands/frontier.d.ts.map +1 -0
  57. package/dist/commands/frontier.js +11 -0
  58. package/dist/commands/frontier.js.map +1 -0
  59. package/dist/commands/highways.d.ts +4 -0
  60. package/dist/commands/highways.d.ts.map +1 -0
  61. package/dist/commands/highways.js +11 -0
  62. package/dist/commands/highways.js.map +1 -0
  63. package/dist/commands/know.d.ts +4 -0
  64. package/dist/commands/know.d.ts.map +1 -0
  65. package/dist/commands/know.js +8 -0
  66. package/dist/commands/know.js.map +1 -0
  67. package/dist/commands/launch.d.ts +4 -0
  68. package/dist/commands/launch.d.ts.map +1 -0
  69. package/dist/commands/launch.js +16 -0
  70. package/dist/commands/launch.js.map +1 -0
  71. package/dist/commands/mark.d.ts +4 -0
  72. package/dist/commands/mark.d.ts.map +1 -0
  73. package/dist/commands/mark.js +15 -0
  74. package/dist/commands/mark.js.map +1 -0
  75. package/dist/commands/recall.d.ts +4 -0
  76. package/dist/commands/recall.d.ts.map +1 -0
  77. package/dist/commands/recall.js +12 -0
  78. package/dist/commands/recall.js.map +1 -0
  79. package/dist/commands/reveal.d.ts +4 -0
  80. package/dist/commands/reveal.d.ts.map +1 -0
  81. package/dist/commands/reveal.js +11 -0
  82. package/dist/commands/reveal.js.map +1 -0
  83. package/dist/commands/select.d.ts +4 -0
  84. package/dist/commands/select.d.ts.map +1 -0
  85. package/dist/commands/select.js +19 -0
  86. package/dist/commands/select.js.map +1 -0
  87. package/dist/commands/signal.d.ts +4 -0
  88. package/dist/commands/signal.d.ts.map +1 -0
  89. package/dist/commands/signal.js +8 -0
  90. package/dist/commands/signal.js.map +1 -0
  91. package/dist/commands/sync.d.ts +4 -0
  92. package/dist/commands/sync.d.ts.map +1 -0
  93. package/dist/commands/sync.js +20 -0
  94. package/dist/commands/sync.js.map +1 -0
  95. package/dist/commands/warn.d.ts +4 -0
  96. package/dist/commands/warn.d.ts.map +1 -0
  97. package/dist/commands/warn.js +15 -0
  98. package/dist/commands/warn.js.map +1 -0
  99. package/dist/create-org-profile.js +2 -2
  100. package/dist/create-user-profile.js +2 -2
  101. package/dist/index.js +75 -7
  102. package/dist/index.js.map +1 -1
  103. package/dist/lib/args.d.ts +10 -0
  104. package/dist/lib/args.d.ts.map +1 -0
  105. package/dist/lib/args.js +54 -0
  106. package/dist/lib/args.js.map +1 -0
  107. package/dist/lib/config.d.ts +12 -0
  108. package/dist/lib/config.d.ts.map +1 -0
  109. package/dist/lib/config.js +38 -0
  110. package/dist/lib/config.js.map +1 -0
  111. package/dist/lib/http.d.ts +9 -0
  112. package/dist/lib/http.d.ts.map +1 -0
  113. package/dist/lib/http.js +25 -0
  114. package/dist/lib/http.js.map +1 -0
  115. package/dist/lib/telemetry.d.ts +4 -0
  116. package/dist/lib/telemetry.d.ts.map +1 -0
  117. package/dist/lib/telemetry.js +61 -0
  118. package/dist/lib/telemetry.js.map +1 -0
  119. package/dist/utils/file-resolver.js +1 -3
  120. package/dist/utils/file-resolver.js.map +1 -1
  121. package/dist/utils/installation-setup.js +8 -8
  122. package/dist/utils/installation-setup.js.map +1 -1
  123. package/one/events/0-changes.md +2764 -0
  124. package/one/events/1-PROJECTS-START-HERE.md +384 -0
  125. package/one/events/1-projects-developer-quickstart.md +620 -0
  126. package/one/events/1-projects-feature.md +2047 -0
  127. package/one/events/1-projects-team-briefing.md +583 -0
  128. package/one/events/2024-10-14-deployment-plan.md +330 -0
  129. package/one/events/2024-10-14-deployment-success.md +447 -0
  130. package/one/events/2024-10-14-final-sync-complete.md +250 -0
  131. package/one/events/2024-10-14-release-v2.0.6.md +414 -0
  132. package/one/events/2024-10-15-agent-clean-v2-summary.md +495 -0
  133. package/one/events/2024-10-15-handoff-to-clean.md +347 -0
  134. package/one/events/2024-10-15-package-manager-tests.md +442 -0
  135. package/one/events/2024-10-15-release-command-complete.md +416 -0
  136. package/one/events/2025-10-15-private-files-secured.md +359 -0
  137. package/one/events/2025-10-15-unignore-public-group-docs.md +298 -0
  138. package/one/events/2025-11-08-backend-claude-refactor.md +242 -0
  139. package/one/events/2025-11-08-parallel-agent-implementation.md +620 -0
  140. package/one/events/2025-11-10-ai-integration-status-report.md +241 -0
  141. package/one/events/ACCESSIBILITY_CHECKLIST.md +275 -0
  142. package/one/events/ACCESSIBILITY_FIXES_SUMMARY.md +293 -0
  143. package/one/events/ALIGNMENT_REPORT_PROBLEM_SOLVER.md +335 -0
  144. package/one/events/ALIGNMENT_SUMMARY.md +280 -0
  145. package/one/events/API_ROUTES_FIXES_SUMMARY.md +280 -0
  146. package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +654 -0
  147. package/one/events/AUDIT-ONTOLOGY-ALIGNMENT.md +598 -0
  148. package/one/events/AUDIT_PLAN_COMPLETION-20251108-125555.md +262 -0
  149. package/one/events/BEFORE_AFTER_COMPARISON.md +978 -0
  150. package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +372 -0
  151. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +430 -0
  152. package/one/events/CHARTS-READY-TO-USE-20251106-080939.md +184 -0
  153. package/one/events/CHARTS-SUMMARY-20251106-080938.md +196 -0
  154. package/one/events/CLAUDE copy.md +897 -0
  155. package/one/events/CLEANUP-RELEASE-V2.0.8.md +308 -0
  156. package/one/events/CLOUDFLARE-FS-FIX-20251106-100516.md +75 -0
  157. package/one/events/COMPONENT_SHOWCASE-20251106-080938.md +629 -0
  158. package/one/events/CONNECTIONS_DEMO.md +519 -0
  159. package/one/events/CREATE-WEBSITE.md +460 -0
  160. package/one/events/CRITICAL-FIXES-COMPLETE.md +571 -0
  161. package/one/events/CUSTOM-DOMAIN.md +375 -0
  162. package/one/events/DELIVERABLES.md +450 -0
  163. package/one/events/DELIVERABLES.txt +273 -0
  164. package/one/events/DEMO-GROUPS-PAGE.md +410 -0
  165. package/one/events/DEMO-TESTING-SUMMARY.md +536 -0
  166. package/one/events/DEMO_COMPONENTS.md +505 -0
  167. package/one/events/DEMO_HOOKS_INDEX.md +352 -0
  168. package/one/events/DEMO_INFRASTRUCTURE.md +923 -0
  169. package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +588 -0
  170. package/one/events/DEMO_INTEGRATION_CHECKLIST.md +449 -0
  171. package/one/events/DEMO_QUICK_REFERENCE.md +459 -0
  172. package/one/events/DEMO_SETUP.md +494 -0
  173. package/one/events/DEPLOYMENT copy.md +444 -0
  174. package/one/events/DEPLOYMENT.md +196 -0
  175. package/one/events/DESIGN-DELIVERABLES-20251106-080938.md +557 -0
  176. package/one/events/DESIGN-EXECUTIVE-SUMMARY-20251106-080938.md +484 -0
  177. package/one/events/DOCS-SYSTEM-GUIDE-20251105-142103.md +458 -0
  178. package/one/events/DOCUMENTER-DELIVERY-SUMMARY.md +481 -0
  179. package/one/events/DOCUMENTER-EXECUTION-GUIDE.md +394 -0
  180. package/one/events/DOCUMENTER-TASK-BREAKDOWN.md +783 -0
  181. package/one/events/ECOMMERCE-BEFORE-AFTER.md +267 -0
  182. package/one/events/ECOMMERCE-DEMO-PLAN.md +243 -0
  183. package/one/events/ECOMMERCE-ENHANCEMENTS.md +594 -0
  184. package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +439 -0
  185. package/one/events/ECOMMERCE-LIVE-DEMO.md +381 -0
  186. package/one/events/ECOMMERCE-QUICKSTART.md +376 -0
  187. package/one/events/ECOMMERCE-README.md +354 -0
  188. package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +214 -0
  189. package/one/events/ECOMMERCE-SETUP-SUMMARY.md +414 -0
  190. package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +753 -0
  191. package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +941 -0
  192. package/one/events/EFFECT_TS_API_PATTERN.md +496 -0
  193. package/one/events/EXECUTION-READY.md +359 -0
  194. package/one/events/EXECUTION-SUMMARY.md +478 -0
  195. package/one/events/FEATURE-2-4-COMPLETE.md +320 -0
  196. package/one/events/FEATURE_2_3_COMPLETE.md +593 -0
  197. package/one/events/FILE-REFERENCE-20251105-142103.md +325 -0
  198. package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +241 -0
  199. package/one/events/GROUPS-MIGRATION.md +643 -0
  200. package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +432 -0
  201. package/one/events/HANDOFF.md +331 -0
  202. package/one/events/HOOKS-DEMO.md +459 -0
  203. package/one/events/IMPLEMENTATION-CHECKLIST-20251105-142103.md +274 -0
  204. package/one/events/IMPLEMENTATION-REPORT-DOCS-20251105-142102.md +394 -0
  205. package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +568 -0
  206. package/one/events/IMPLEMENTATION_SUMMARY-20251106-080938.md +571 -0
  207. package/one/events/IMPLEMENTATION_SUMMARY.md +547 -0
  208. package/one/events/INDEX-ALL-AGENTS.md +190 -0
  209. package/one/events/INDEX-FRONTEND-TESTING.md +524 -0
  210. package/one/events/INDEX-PROBLEM-SOLVER.md +488 -0
  211. package/one/events/INDEX-QUALITY-AGENT-INFER65.md +455 -0
  212. package/one/events/INDEX.md +295 -0
  213. package/one/events/INDEX_QUICK_START_REDESIGN-20251106-080939.md +342 -0
  214. package/one/events/INSTALL-TESTS.md +311 -0
  215. package/one/events/INSTALLATION_FOLDERS.md +534 -0
  216. package/one/events/INSTALLATION_FOLDERS_FILES.md +223 -0
  217. package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +437 -0
  218. package/one/events/INTEGRATION-ARCHITECTURE.md +579 -0
  219. package/one/events/INTEGRATION-CHECKLIST.md +1252 -0
  220. package/one/events/INTEGRATION-ORCHESTRATION.md +2641 -0
  221. package/one/events/INTEGRATION-SUMMARY.md +671 -0
  222. package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +684 -0
  223. package/one/events/LANDING-PAGE-IMPLEMENTATION.md +660 -0
  224. package/one/events/LANDING-PAGE-QUICKSTART.md +425 -0
  225. package/one/events/LICENSE.md +107 -0
  226. package/one/events/MASTER-COORDINATION-PLAN.md +613 -0
  227. package/one/events/MASTER-ORCHESTRATION-INFER65.md +441 -0
  228. package/one/events/MASTER-PLAN-SUMMARY.md +309 -0
  229. package/one/events/MCP-CONFIGURATION.md +354 -0
  230. package/one/events/MCP-SETUP-COMPLETE.md +223 -0
  231. package/one/events/MIGRATION-REPORT.md +453 -0
  232. package/one/events/MIGRATION.md +87 -0
  233. package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1663 -0
  234. package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +643 -0
  235. package/one/events/NEWS-COMMANDS.md +506 -0
  236. package/one/events/NEWS-SYSTEM-SUMMARY.md +480 -0
  237. package/one/events/NODE-UPGRADE.md +129 -0
  238. package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +416 -0
  239. package/one/events/ONTOLOGY-HOOKS-README.md +718 -0
  240. package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +383 -0
  241. package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +569 -0
  242. package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +491 -0
  243. package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +504 -0
  244. package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +221 -0
  245. package/one/events/PACKAGE-STRUCTURE.md +328 -0
  246. package/one/events/PLAN-COMPLETE.md +429 -0
  247. package/one/events/PLAYBOOK-SETUP-SUMMARY.md +349 -0
  248. package/one/events/PROBLEM-SOLVER-EXECUTIVE-SUMMARY.md +484 -0
  249. package/one/events/PROBLEM-SOLVER-QUICKSTART.md +420 -0
  250. package/one/events/PROJECTS-PLAN-SUMMARY.md +480 -0
  251. package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +585 -0
  252. package/one/events/QA-CHECKLIST.md +692 -0
  253. package/one/events/QUALITY-AGENT-SUMMARY.md +334 -0
  254. package/one/events/QUALITY-EXECUTION-CHECKLIST.md +593 -0
  255. package/one/events/QUICK-REFERENCE-FRONTEND-TESTING.md +475 -0
  256. package/one/events/QUICK-START-ONTOLOGY.md +426 -0
  257. package/one/events/QUICK_START_REDESIGN-20251106-080938.md +400 -0
  258. package/one/events/README-PROBLEM-SOLVER.md +394 -0
  259. package/one/events/README-archived.md +537 -0
  260. package/one/events/README_QUICK_START_REDESIGN-20251106-080938.md +484 -0
  261. package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +657 -0
  262. package/one/events/SEARCH_DEMO_DELIVERY.md +433 -0
  263. package/one/events/SEARCH_DEMO_SUMMARY.md +321 -0
  264. package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +399 -0
  265. package/one/events/SECURITY-AUDIT-FIXES.md +394 -0
  266. package/one/events/SECURITY-SCAN-COMPLETE.md +299 -0
  267. package/one/events/SHOP-BUILD-STATUS.md +132 -0
  268. package/one/events/SHOP-PREMIUM-UPDATE.md +165 -0
  269. package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +280 -0
  270. package/one/events/SITE-WIDE-GRADIENT-FIX.md +317 -0
  271. package/one/events/SPECIALIST-QUICK-REFERENCE.md +678 -0
  272. package/one/events/STORE-PRODUCTION-READY-STATUS.md +377 -0
  273. package/one/events/STRIPE-INTEGRATION.md +432 -0
  274. package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +447 -0
  275. package/one/events/STRIPE-SETUP-GUIDE.md +480 -0
  276. package/one/events/TEST-PLAN-INDEX.md +364 -0
  277. package/one/events/TEST-PLAN.md +1435 -0
  278. package/one/events/TEST-SUMMARY.md +411 -0
  279. package/one/events/TESTING-DELIVERY.txt +372 -0
  280. package/one/events/TESTS-QUICK-REF.md +280 -0
  281. package/one/events/TRANSITIONS-QUICK-START.md +159 -0
  282. package/one/events/TRANSPARENCY-FIXES.md +293 -0
  283. package/one/events/TYPESCRIPT_FIXES.md +170 -0
  284. package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +412 -0
  285. package/one/events/TYPESCRIPT_FIXES_INDEX.md +359 -0
  286. package/one/events/VERIFICATION_CHECKLIST-20251106-080938.md +326 -0
  287. package/one/events/VIEW-TRANSITIONS.md +446 -0
  288. package/one/events/agent-command-implementation.md +305 -0
  289. package/one/events/agent-director-enhancement-summary.md +404 -0
  290. package/one/events/agent-director-routing-update.md +214 -0
  291. package/one/events/agent-onboard-implementation-summary.md +475 -0
  292. package/one/events/agent-ontology-alignment-completion.md +263 -0
  293. package/one/events/ai-integration-complete.md +294 -0
  294. package/one/events/ai-integration-lessons-learned.md +511 -0
  295. package/one/events/backend-integration-tests.md +624 -0
  296. package/one/events/backend-structure-diagram.txt +393 -0
  297. package/one/events/backend-structure-summary.txt +269 -0
  298. package/one/events/bullfm-video-podcast-analysis.md +319 -0
  299. package/one/events/clean-agent-ontology-cleanup-report.md +371 -0
  300. package/one/events/clean-agent-todo-analysis-summary.md +336 -0
  301. package/one/events/cloudflare-automation-complete.md +350 -0
  302. package/one/events/cloudflare-pages-infrastructure-setup.md +282 -0
  303. package/one/events/contact-page-complete.md +316 -0
  304. package/one/events/convex-analysis-index.md +322 -0
  305. package/one/events/convex-structure-analysis.md +718 -0
  306. package/one/events/creation-instructions-9-todos.md +906 -0
  307. package/one/events/cycle-3-video-player-port-20251108.md +368 -0
  308. package/one/events/cycle-3-video-player-port-complete-20251108.md +334 -0
  309. package/one/events/deployment-installation-folders.md +178 -0
  310. package/one/events/deployment-ops-summary.md +386 -0
  311. package/one/events/deployment-verification.md +366 -0
  312. package/one/events/design-spec-complete.md +226 -0
  313. package/one/events/documentation-audit-index.md +473 -0
  314. package/one/events/documentation-audit-summary.md +417 -0
  315. package/one/events/documentation-improvement-roadmap.md +906 -0
  316. package/one/events/documentation-standards-compliance-report.md +538 -0
  317. package/one/events/documentation-updates.md +370 -0
  318. package/one/events/events.md +563 -0
  319. package/one/events/fix-product-hydration-20251106.md +211 -0
  320. package/one/events/frontend-effects-complete.md +584 -0
  321. package/one/events/frontend-effects-orchestration.md +1356 -0
  322. package/one/events/frontend-effects-risk-register.md +1055 -0
  323. package/one/events/frontend-effects-week1-assignments.md +1594 -0
  324. package/one/events/hook-ontology-alignment-summary.md +528 -0
  325. package/one/events/installation-folders-workflow-integration.md +458 -0
  326. package/one/events/landing-page-generator.md +476 -0
  327. package/one/events/legal-assessment-2025-10-16.md +1917 -0
  328. package/one/events/master-coordination-plan.json +1078 -0
  329. package/one/events/master-plan-9-todos.md +900 -0
  330. package/one/events/mobile-performance-optimization.md +179 -0
  331. package/one/events/onboarding-implementation-complete.md +523 -0
  332. package/one/events/ontology-audit-agent-clone.md +323 -0
  333. package/one/events/ontology-test-examples.md +580 -0
  334. package/one/events/phase1-backend-implementation-complete.md +536 -0
  335. package/one/events/plan-completion-audit.md +707 -0
  336. package/one/events/plan-files-updated.md +273 -0
  337. package/one/events/production-readiness-plan.md +389 -0
  338. package/one/events/readme.md +100 -0
  339. package/one/events/release.md +272 -0
  340. package/one/events/root-cleanup-alignment-report.md +265 -0
  341. package/one/events/security-fixes-2025-01-15.md +226 -0
  342. package/one/events/separate-implementation-status.md +555 -0
  343. package/one/events/server-command-optimization-20251108.md +150 -0
  344. package/one/events/session-summary-2025-10-18.md +366 -0
  345. package/one/events/skills-complete.md +351 -0
  346. package/one/events/skills-infer-6-10-summary.md +70 -0
  347. package/one/events/skills-phase1-complete.md +281 -0
  348. package/one/events/specialist-assignments.md +766 -0
  349. package/one/events/structural-analysis-architecture-vs-plans.md +600 -0
  350. package/one/events/test-dashboard.md +363 -0
  351. package/one/events/test-index.md +421 -0
  352. package/one/events/test-report-ontology.md +611 -0
  353. package/one/events/testing-summary.md +388 -0
  354. package/one/events/todo-agent-builder.md +1180 -0
  355. package/one/events/todo-agent-director.md +164 -0
  356. package/one/events/todo-agent-documenter.md +1815 -0
  357. package/one/events/todo-agent-frontend.md +1542 -0
  358. package/one/events/todo-agent-problem-solver.md +1682 -0
  359. package/one/events/todo-agent-quality.md +1647 -0
  360. package/one/events/todo-refactoring-complete.md +408 -0
  361. package/one/events/wave1-backend-implementation-complete.md +698 -0
  362. package/one/events/web-AI_INTEGRATION_PHASE2_SUMMARY-20251111-152540.md +529 -0
  363. package/one/events/web-BUY-IN-CHATGPT-README-20251116-235241.md +491 -0
  364. package/one/events/web-CHARTS-IMPLEMENTATION-20251106-080939.md +576 -0
  365. package/one/events/web-CHARTS-QUICKSTART-20251106-080939.md +416 -0
  366. package/one/events/web-CODE-HIGHLIGHTING-SUMMARY-20251111-152540.md +442 -0
  367. package/one/events/web-DEPLOYMENT_SUMMARY-20251116-005428.md +290 -0
  368. package/one/events/web-DESIGN-SUMMARY-20251106-080939.md +514 -0
  369. package/one/events/web-README-AI-INTEGRATION-20251111-152540.md +196 -0
  370. package/one/events/web-RECHARTS-INTEGRATION-20251111-152540.md +265 -0
  371. package/one/events/web-RELEASE_OPTIMIZATION_PLAN-20251116-005428.md +447 -0
  372. package/one/events/web-TEST-CLEANUP-20251105-143205.md +3 -0
  373. package/one/events/web-USING-ANY-COMPONENT-IN-CHAT-20251111-152540.md +561 -0
  374. package/one/events/web-test-code-highlighting-20251111-152540.md +231 -0
  375. package/one/{knowledge → learning}/crypto.md +2 -2
  376. package/one/{connections → paths}/cryptonetworks.md +2 -2
  377. package/one/things/contracts/sdk.ts +4 -3
  378. package/one/things/products/Blockchain Products.md +8 -8
  379. package/package.json +7 -8
  380. package/dist/commands/create-website.d.ts +0 -19
  381. package/dist/commands/create-website.d.ts.map +0 -1
  382. package/dist/commands/create-website.js +0 -231
  383. package/dist/commands/create-website.js.map +0 -1
  384. /package/one/{people → actors}/anthony-o-connell.md +0 -0
  385. /package/one/{people → actors}/people.md +0 -0
  386. /package/one/{knowledge → learning}/.obsidian/app.json +0 -0
  387. /package/one/{knowledge → learning}/.obsidian/appearance.json +0 -0
  388. /package/one/{knowledge → learning}/.obsidian/core-plugins.json +0 -0
  389. /package/one/{knowledge → learning}/.obsidian/ecommerce-ontology.md +0 -0
  390. /package/one/{knowledge → learning}/.obsidian/workspace.json +0 -0
  391. /package/one/{knowledge → learning}/100-inference-quick-reference.md +0 -0
  392. /package/one/{knowledge → learning}/ag-ui-protocol.md +0 -0
  393. /package/one/{knowledge → learning}/agent-onboard-usage.md +0 -0
  394. /package/one/{knowledge → learning}/agentic-commerce.md +0 -0
  395. /package/one/{knowledge → learning}/ai-agents-vs-memecoins-thesis.md +0 -0
  396. /package/one/{knowledge → learning}/ai-api-reference.md +0 -0
  397. /package/one/{knowledge → learning}/ai-platform.md +0 -0
  398. /package/one/{knowledge → learning}/ai-quickstart.md +0 -0
  399. /package/one/{knowledge → learning}/ai-sdk-implementation.md +0 -0
  400. /package/one/{knowledge → learning}/ai-token-crypto-analysis-framework.md +0 -0
  401. /package/one/{knowledge → learning}/ai-token-paradigm-shift-2025.md +0 -0
  402. /package/one/{knowledge → learning}/altcoin-cycle-prediction-ontology.md +0 -0
  403. /package/one/{knowledge → learning}/altcoin-cycle-trading-strategy.md +0 -0
  404. /package/one/{knowledge → learning}/architecture-any-backend.md +0 -0
  405. /package/one/{knowledge → learning}/architecture-diagram.md +0 -0
  406. /package/one/{knowledge → learning}/architecture-frontend.md +0 -0
  407. /package/one/{knowledge → learning}/architecture.md +0 -0
  408. /package/one/{knowledge → learning}/archived/ontology.old.md +0 -0
  409. /package/one/{knowledge → learning}/astro-effect-complete-vision.md +0 -0
  410. /package/one/{knowledge → learning}/astro-effect-simple-architecture.md +0 -0
  411. /package/one/{knowledge → learning}/audit-agent-onboard-alignment.md +0 -0
  412. /package/one/{knowledge → learning}/audit-agent-sales-alignment.md +0 -0
  413. /package/one/{knowledge → learning}/backend-api-reference.md +0 -0
  414. /package/one/{knowledge → learning}/cascading-context-specification.md +0 -0
  415. /package/one/{knowledge → learning}/claude-code-integration.md +0 -0
  416. /package/one/{knowledge → learning}/cli-claude-handoff.md +0 -0
  417. /package/one/{knowledge → learning}/context-engineering.md +0 -0
  418. /package/one/{knowledge → learning}/crypto-analysis-strategy.md +0 -0
  419. /package/one/{knowledge → learning}/crypto-cycle-2024-2025-analysis.md +0 -0
  420. /package/one/{knowledge → learning}/develop/design.md +0 -0
  421. /package/one/{knowledge → learning}/develop/index.md +0 -0
  422. /package/one/{knowledge → learning}/development-commands.md +0 -0
  423. /package/one/{knowledge → learning}/docs.md +0 -0
  424. /package/one/{knowledge → learning}/dsl.md +0 -0
  425. /package/one/{knowledge → learning}/event-driven-documentation.md +0 -0
  426. /package/one/{knowledge → learning}/files.md +0 -0
  427. /package/one/{knowledge → learning}/frontend.md +0 -0
  428. /package/one/{knowledge → learning}/games-english.md +0 -0
  429. /package/one/{knowledge → learning}/games.md +0 -0
  430. /package/one/{knowledge → learning}/generative-ui-patterns.md +0 -0
  431. /package/one/{knowledge → learning}/guidelines.md +0 -0
  432. /package/one/{knowledge → learning}/hono.md +0 -0
  433. /package/one/{knowledge → learning}/implementation-examples.md +0 -0
  434. /package/one/{knowledge → learning}/installation-folders.md +0 -0
  435. /package/one/{knowledge → learning}/institutional-cycle-paradigm-2025.md +0 -0
  436. /package/one/{knowledge → learning}/knowledge.md +0 -0
  437. /package/one/{knowledge → learning}/language.md +0 -0
  438. /package/one/{knowledge → learning}/lessons-learned.md +0 -0
  439. /package/one/{knowledge → learning}/lessons-website-building-focus.md +0 -0
  440. /package/one/{knowledge → learning}/merge-report.md +0 -0
  441. /package/one/{knowledge → learning}/metadata-system.md +0 -0
  442. /package/one/{knowledge → learning}/nine-padel-playbook.md +0 -0
  443. /package/one/{knowledge → learning}/one-protocol-ai-agents.md +0 -0
  444. /package/one/{knowledge → learning}/one-protocol-executive-report.md +0 -0
  445. /package/one/{knowledge → learning}/one-protocol-standard.md +0 -0
  446. /package/one/{knowledge → learning}/one-protocol-whitepaper.md +0 -0
  447. /package/one/{knowledge → learning}/ontology-blog.yaml +0 -0
  448. /package/one/{knowledge → learning}/ontology-cheatsheet.md +0 -0
  449. /package/one/{knowledge → learning}/ontology-community.yaml +0 -0
  450. /package/one/{knowledge → learning}/ontology-core-universal.md +0 -0
  451. /package/one/{knowledge → learning}/ontology-core.yaml +0 -0
  452. /package/one/{knowledge → learning}/ontology-courses.yaml +0 -0
  453. /package/one/{knowledge → learning}/ontology-creator.md +0 -0
  454. /package/one/{knowledge → learning}/ontology-crypto.md +0 -0
  455. /package/one/{knowledge → learning}/ontology-developer-guide.md +0 -0
  456. /package/one/{knowledge → learning}/ontology-documentation.md +0 -0
  457. /package/one/{knowledge → learning}/ontology-ecommerce.md +0 -0
  458. /package/one/{knowledge → learning}/ontology-education-game.md +0 -0
  459. /package/one/{knowledge → learning}/ontology-education.md +0 -0
  460. /package/one/{knowledge → learning}/ontology-engineering-specification.md +0 -0
  461. /package/one/{knowledge → learning}/ontology-engineering.md +0 -0
  462. /package/one/{knowledge → learning}/ontology-files.yaml +0 -0
  463. /package/one/{knowledge → learning}/ontology-frontend-master.md +0 -0
  464. /package/one/{knowledge → learning}/ontology-frontend-specifications.md +0 -0
  465. /package/one/{knowledge → learning}/ontology-frontend.md +0 -0
  466. /package/one/{knowledge → learning}/ontology-index.md +0 -0
  467. /package/one/{knowledge → learning}/ontology-minimal.yaml +0 -0
  468. /package/one/{knowledge → learning}/ontology-portfolio.yaml +0 -0
  469. /package/one/{knowledge → learning}/ontology-quickstart.md +0 -0
  470. /package/one/{knowledge → learning}/ontology-release.md +0 -0
  471. /package/one/{knowledge → learning}/ontology-shop.yaml +0 -0
  472. /package/one/{knowledge → learning}/ontology-tokens.yaml +0 -0
  473. /package/one/{knowledge → learning}/ontology-tutorial.md +0 -0
  474. /package/one/{knowledge → learning}/ontology-v2.md +0 -0
  475. /package/one/{knowledge → learning}/ontology-video-script.md +0 -0
  476. /package/one/{knowledge → learning}/ontology-visual-guide.md +0 -0
  477. /package/one/{knowledge → learning}/ontology.md +0 -0
  478. /package/one/{knowledge → learning}/ontology.yaml +0 -0
  479. /package/one/{knowledge → learning}/parallel-agents.md +0 -0
  480. /package/one/{knowledge → learning}/patterns/backend/convex-mutation-pattern.md +0 -0
  481. /package/one/{knowledge → learning}/patterns/backend/convex-query-pattern.md +0 -0
  482. /package/one/{knowledge → learning}/patterns/backend/mutation-template.md +0 -0
  483. /package/one/{knowledge → learning}/patterns/backend/query-template.md +0 -0
  484. /package/one/{knowledge → learning}/patterns/backend/service-template.md +0 -0
  485. /package/one/{knowledge → learning}/patterns/design/component-architecture.md +0 -0
  486. /package/one/{knowledge → learning}/patterns/design/index.md +0 -0
  487. /package/one/{knowledge → learning}/patterns/design/test-driven-design-pattern.md +0 -0
  488. /package/one/{knowledge → learning}/patterns/design/wireframe-template.md +0 -0
  489. /package/one/{knowledge → learning}/patterns/frontend/component-template.md +0 -0
  490. /package/one/{knowledge → learning}/patterns/frontend/form-template.md +0 -0
  491. /package/one/{knowledge → learning}/patterns/frontend/page-template.md +0 -0
  492. /package/one/{knowledge → learning}/patterns/frontend/react-component-pattern.md +0 -0
  493. /package/one/{knowledge → learning}/patterns/test/acceptance-criteria-template.md +0 -0
  494. /package/one/{knowledge → learning}/patterns/test/technical-test-template.md +0 -0
  495. /package/one/{knowledge → learning}/patterns/test/test-driven-pattern.md +0 -0
  496. /package/one/{knowledge → learning}/patterns/test/user-flow-template.md +0 -0
  497. /package/one/{knowledge → learning}/performance.md +0 -0
  498. /package/one/{knowledge → learning}/provider-agnostic-content.md +0 -0
  499. /package/one/{knowledge → learning}/provider-creation-guide.md +0 -0
  500. /package/one/{knowledge → learning}/quality-loop.md +0 -0
  501. /package/one/{knowledge → learning}/quick-start-ontology-mapping.md +0 -0
  502. /package/one/{knowledge → learning}/readme-architecture.md +0 -0
  503. /package/one/{knowledge → learning}/readme.md +0 -0
  504. /package/one/{knowledge → learning}/rules.md +0 -0
  505. /package/one/{knowledge → learning}/score.md +0 -0
  506. /package/one/{knowledge → learning}/specifications.md +0 -0
  507. /package/one/{knowledge → learning}/tags.md +0 -0
  508. /package/one/{knowledge → learning}/todo-template.md +0 -0
  509. /package/one/{knowledge → learning}/todo.md +0 -0
  510. /package/one/{knowledge → learning}/troubleshooting.md +0 -0
  511. /package/one/{knowledge → learning}/typescript-patterns.md +0 -0
  512. /package/one/{knowledge → learning}/universal-generation-language.md +0 -0
  513. /package/one/{knowledge → learning}/x402-research.md +0 -0
  514. /package/one/{connections → paths}/a2a.md +0 -0
  515. /package/one/{connections → paths}/acp.md +0 -0
  516. /package/one/{connections → paths}/acps.md +0 -0
  517. /package/one/{connections → paths}/agentkit.md +0 -0
  518. /package/one/{connections → paths}/agui.md +0 -0
  519. /package/one/{connections → paths}/any-backend.md +0 -0
  520. /package/one/{connections → paths}/ap2.md +0 -0
  521. /package/one/{connections → paths}/api/queries-reference.md +0 -0
  522. /package/one/{connections → paths}/api-docs.md +0 -0
  523. /package/one/{connections → paths}/api-reference.md +0 -0
  524. /package/one/{connections → paths}/api.md +0 -0
  525. /package/one/{connections → paths}/architecture-diagram.md +0 -0
  526. /package/one/{connections → paths}/communications.md +0 -0
  527. /package/one/{connections → paths}/connections.md +0 -0
  528. /package/one/{connections → paths}/copilotkit.md +0 -0
  529. /package/one/{connections → paths}/documentation.md +0 -0
  530. /package/one/{connections → paths}/effect.md +0 -0
  531. /package/one/{connections → paths}/elizaos.md +0 -0
  532. /package/one/{connections → paths}/groups.md +0 -0
  533. /package/one/{connections → paths}/inference.md +0 -0
  534. /package/one/{connections → paths}/integration-examples.md +0 -0
  535. /package/one/{connections → paths}/integration-guide.md +0 -0
  536. /package/one/{connections → paths}/integration-phase2.md +0 -0
  537. /package/one/{connections → paths}/kyc.md +0 -0
  538. /package/one/{connections → paths}/mcp.md +0 -0
  539. /package/one/{connections → paths}/membership.md +0 -0
  540. /package/one/{connections → paths}/middleware.md +0 -0
  541. /package/one/{connections → paths}/multitenant.md +0 -0
  542. /package/one/{connections → paths}/n8n.md +0 -0
  543. /package/one/{connections → paths}/patterns.md +0 -0
  544. /package/one/{connections → paths}/protocols.md +0 -0
  545. /package/one/{connections → paths}/relationships.md +0 -0
  546. /package/one/{connections → paths}/schema.md +0 -0
  547. /package/one/{connections → paths}/service-layer.md +0 -0
  548. /package/one/{connections → paths}/vectors.md +0 -0
  549. /package/one/{connections → paths}/wordpress.md +0 -0
  550. /package/one/{connections → paths}/workflow-copy.md +0 -0
  551. /package/one/{connections → paths}/workflow-examples.md +0 -0
  552. /package/one/{connections → paths}/workflow-onboarding.md +0 -0
  553. /package/one/{connections → paths}/workflow.md +0 -0
  554. /package/one/{connections → paths}/workflows/delegation.md +0 -0
  555. /package/one/{connections → paths}/workflows/frontend.md +0 -0
  556. /package/one/{connections → paths}/workflows/strategy.md +0 -0
  557. /package/one/{connections → paths}/workflows/tasks.md +0 -0
  558. /package/one/{connections → paths}/x402-baazar.md +0 -0
  559. /package/one/{connections → paths}/x402.md +0 -0
@@ -0,0 +1,1180 @@
1
+ # Backend Testing TODO List (Cycle 65/100)
2
+
3
+ **Mission**: Create comprehensive e2e tests for critical backend paths in AI-powered recommendations feature.
4
+
5
+ **Status**: Cycle 65/100 - Write e2e tests for critical paths
6
+ **Feature**: AI-powered recommendations system
7
+ **Progress**: 64/100 cycles complete
8
+
9
+ **Updated**: 2025-10-30
10
+ **Scope**: Complete service layer, Convex queries/mutations, database integrity, error handling, and performance validation
11
+
12
+ ---
13
+
14
+ ## Overview
15
+
16
+ This TODO list covers all backend testing requirements for validating the AI-powered recommendations feature. The testing strategy follows a 4-phase pyramid:
17
+
18
+ ```
19
+ Phase 4: Performance & Integration (Cycle 68-70)
20
+ └─ Load testing, query optimization, cross-function flows
21
+ Phase 3: Database & Schema Integrity (Cycle 66-67)
22
+ └─ Schema validation, constraints, indexing, data consistency
23
+ Phase 2: Queries, Mutations & Validation (Cycle 65-66)
24
+ └─ Unit tests for Convex functions, input validation, error handling
25
+ Phase 1: Service Layer Unit Tests (Cycle 64-65)
26
+ └─ Effect.ts services, business logic, error composition
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Phase 1: Service Layer Unit Tests (Cycle 64-65)
32
+
33
+ Service layer tests validate business logic in isolation using Effect.ts patterns.
34
+
35
+ ### 1.1 Feature Recommender Service Tests
36
+
37
+ - [ ] **Test 1.1.1**: `recommendFeatures()` returns foundation features (landing-page, authentication, multi-tenant)
38
+ - Input: `DetectedFeatures` with empty arrays
39
+ - Expected: Array with 3 high-priority foundation features
40
+ - Error: None
41
+ - Mock: None required
42
+
43
+ - [ ] **Test 1.1.2**: `recommendFeatures()` returns blog recommendation when blog detected
44
+ - Input: `DetectedFeatures { contentTypes: ['blog'] }`
45
+ - Expected: Array includes blog-cms feature with high priority
46
+ - Error: None
47
+ - Mock: None required
48
+
49
+ - [ ] **Test 1.1.3**: `recommendFeatures()` returns video recommendation when video detected
50
+ - Input: `DetectedFeatures { contentTypes: ['video'] }`
51
+ - Expected: Array includes video-library feature with high priority
52
+ - Error: None
53
+ - Mock: None required
54
+
55
+ - [ ] **Test 1.1.4**: `recommendFeatures()` returns course recommendation when courses detected
56
+ - Input: `DetectedFeatures { contentTypes: ['courses'] }`
57
+ - Expected: Array includes course-platform feature with high priority
58
+ - Error: None
59
+ - Mock: None required
60
+
61
+ - [ ] **Test 1.1.5**: `recommendFeatures()` returns subscription recommendation with subscription detected
62
+ - Input: `DetectedFeatures { monetization: ['subscriptions'] }`
63
+ - Expected: Array includes membership-tiers feature with medium priority
64
+ - Error: None
65
+ - Mock: None required
66
+
67
+ - [ ] **Test 1.1.6**: `recommendFeatures()` returns product store recommendation with one-time-sales detected
68
+ - Input: `DetectedFeatures { monetization: ['one-time-sales'] }`
69
+ - Expected: Array includes product-store feature with medium priority
70
+ - Error: None
71
+ - Mock: None required
72
+
73
+ - [ ] **Test 1.1.7**: `recommendFeatures()` returns discord integration when discord community detected
74
+ - Input: `DetectedFeatures { community: ['discord'] }`
75
+ - Expected: Array includes discord-integration feature with medium priority
76
+ - Error: None
77
+ - Mock: None required
78
+
79
+ - [ ] **Test 1.1.8**: `recommendFeatures()` returns real-time-sync for Convex backend
80
+ - Input: `DetectedFeatures { techStack: { backend: 'Convex' } }`
81
+ - Expected: Array includes real-time-sync feature with medium priority
82
+ - Error: None
83
+ - Mock: None required
84
+
85
+ - [ ] **Test 1.1.9**: `recommendFeatures()` returns AI recommendations (agents and RAG)
86
+ - Input: `DetectedFeatures` with any valid input
87
+ - Expected: Array includes ai-agents and rag-knowledge features with low priority
88
+ - Error: None
89
+ - Mock: None required
90
+
91
+ - [ ] **Test 1.1.10**: `calculateTotalTime()` sums estimated minutes correctly
92
+ - Input: Array of 5 features with various estimatedMinutes
93
+ - Expected: Sum equals 65 minutes
94
+ - Error: None
95
+ - Mock: None required
96
+
97
+ ### 1.2 Entity Service Business Logic Tests
98
+
99
+ - [ ] **Test 1.2.1**: `validateEntityName()` succeeds with valid 2-char name
100
+ - Input: "ab"
101
+ - Expected: Success, returns "ab"
102
+ - Error: None
103
+ - Mock: None required
104
+
105
+ - [ ] **Test 1.2.2**: `validateEntityName()` fails with single character
106
+ - Input: "a"
107
+ - Expected: Fails with ValidationError
108
+ - Error: ValidationError { field: "name", message: "..." }
109
+ - Mock: None required
110
+
111
+ - [ ] **Test 1.2.3**: `validateEntityName()` fails with empty string
112
+ - Input: ""
113
+ - Expected: Fails with ValidationError
114
+ - Error: ValidationError { field: "name", message: "..." }
115
+ - Mock: None required
116
+
117
+ - [ ] **Test 1.2.4**: `validateEntityName()` fails with >200 characters
118
+ - Input: "a".repeat(201)
119
+ - Expected: Fails with ValidationError
120
+ - Error: ValidationError { field: "name", message: "..." }
121
+ - Mock: None required
122
+
123
+ - [ ] **Test 1.2.5**: `validateEntityName()` trims whitespace
124
+ - Input: " valid name "
125
+ - Expected: Success, returns "valid name"
126
+ - Error: None
127
+ - Mock: None required
128
+
129
+ - [ ] **Test 1.2.6**: `validateEntityType()` succeeds with valid type
130
+ - Input: type="blog_post", validTypes=["blog_post", "course"]
131
+ - Expected: Success, returns "blog_post"
132
+ - Error: None
133
+ - Mock: None required
134
+
135
+ - [ ] **Test 1.2.7**: `validateEntityType()` fails with invalid type
136
+ - Input: type="invalid_type", validTypes=["blog_post", "course"]
137
+ - Expected: Fails with ValidationError
138
+ - Error: ValidationError { field: "type", message: "..." }
139
+ - Mock: None required
140
+
141
+ - [ ] **Test 1.2.8**: `validateGroup()` succeeds when group exists and active
142
+ - Input: groupId="xyz123"
143
+ - Expected: Success, returns void
144
+ - Error: None
145
+ - Mock: getGroup returns { status: "active" }
146
+
147
+ - [ ] **Test 1.2.9**: `validateGroup()` fails when group not found
148
+ - Input: groupId="nonexistent"
149
+ - Expected: Fails with ValidationError
150
+ - Error: ValidationError { field: "groupId", message: "Group not found" }
151
+ - Mock: getGroup returns null
152
+
153
+ - [ ] **Test 1.2.10**: `validateGroup()` fails when group not active
154
+ - Input: groupId="archived_group"
155
+ - Expected: Fails with ValidationError
156
+ - Error: ValidationError { field: "groupId", message: "Group is not active" }
157
+ - Mock: getGroup returns { status: "archived" }
158
+
159
+ ### 1.3 Entity Service Creation Tests
160
+
161
+ - [ ] **Test 1.3.1**: `createEntity()` succeeds with valid inputs
162
+ - Input: CreateEntityInput { groupId, type: "blog_post", name: "My Post", properties: {...} }
163
+ - Expected: Success, returns entityId
164
+ - Error: None
165
+ - Mock: All context functions mocked to succeed
166
+
167
+ - [ ] **Test 1.3.2**: `createEntity()` fails with invalid name
168
+ - Input: CreateEntityInput { name: "a" } (too short)
169
+ - Expected: Fails with ValidationError
170
+ - Error: ValidationError
171
+ - Mock: None required (validation fails before database calls)
172
+
173
+ - [ ] **Test 1.3.3**: `createEntity()` fails with invalid type
174
+ - Input: CreateEntityInput { type: "invalid_type" }
175
+ - Expected: Fails with ValidationError
176
+ - Error: ValidationError
177
+ - Mock: None required
178
+
179
+ - [ ] **Test 1.3.4**: `createEntity()` fails when group not found
180
+ - Input: CreateEntityInput { groupId: "missing" }
181
+ - Expected: Fails with ValidationError
182
+ - Error: ValidationError { field: "groupId" }
183
+ - Mock: getGroup returns null
184
+
185
+ - [ ] **Test 1.3.5**: `createEntity()` calls insertEntity with correct structure
186
+ - Input: CreateEntityInput { groupId, type, name, properties, status }
187
+ - Expected: insertEntity called once with correct entity object
188
+ - Error: None
189
+ - Mock: insertEntity mocked to capture calls
190
+
191
+ - [ ] **Test 1.3.6**: `createEntity()` logs event with correct metadata
192
+ - Input: CreateEntityInput { groupId, type: "blog_post", name: "Post" }
193
+ - Expected: logEvent called with event type "thing_created" and metadata
194
+ - Error: None
195
+ - Mock: logEvent mocked to capture calls
196
+
197
+ - [ ] **Test 1.3.7**: `createEntity()` indexes RAG for blog_post type
198
+ - Input: CreateEntityInput { type: "blog_post", properties: { content: "..." } }
199
+ - Expected: RAG addDocument called
200
+ - Error: None
201
+ - Mock: RAG service mocked
202
+
203
+ - [ ] **Test 1.3.8**: `createEntity()` skips RAG for non-indexable types
204
+ - Input: CreateEntityInput { type: "user", properties: {} }
205
+ - Expected: RAG addDocument NOT called
206
+ - Error: None
207
+ - Mock: RAG service mocked
208
+
209
+ - [ ] **Test 1.3.9**: `createEntity()` sets default status to "draft"
210
+ - Input: CreateEntityInput { status: undefined }
211
+ - Expected: Entity created with status="draft"
212
+ - Error: None
213
+ - Mock: insertEntity mocked to capture entity
214
+
215
+ - [ ] **Test 1.3.10**: `createEntity()` preserves provided status
216
+ - Input: CreateEntityInput { status: "published" }
217
+ - Expected: Entity created with status="published"
218
+ - Error: None
219
+ - Mock: insertEntity mocked to capture entity
220
+
221
+ ### 1.4 Entity Service Update Tests
222
+
223
+ - [ ] **Test 1.4.1**: `updateEntity()` succeeds with valid name update
224
+ - Input: UpdateEntityInput { entityId, name: "New Name" }
225
+ - Expected: Success, updateEntity called with new name
226
+ - Error: None
227
+ - Mock: getEntity returns valid entity, updateEntity succeeds
228
+
229
+ - [ ] **Test 1.4.2**: `updateEntity()` fails when entity not found
230
+ - Input: UpdateEntityInput { entityId: "missing" }
231
+ - Expected: Fails with ValidationError
232
+ - Error: ValidationError { field: "entityId" }
233
+ - Mock: getEntity returns null
234
+
235
+ - [ ] **Test 1.4.3**: `updateEntity()` fails with invalid name
236
+ - Input: UpdateEntityInput { name: "a" } (too short)
237
+ - Expected: Fails with ValidationError
238
+ - Error: ValidationError
239
+ - Mock: getEntity returns valid entity
240
+
241
+ - [ ] **Test 1.4.4**: `updateEntity()` updates properties
242
+ - Input: UpdateEntityInput { entityId, properties: { views: 100 } }
243
+ - Expected: updateEntity called with properties
244
+ - Error: None
245
+ - Mock: getEntity returns valid entity, updateEntity succeeds
246
+
247
+ - [ ] **Test 1.4.5**: `updateEntity()` updates status
248
+ - Input: UpdateEntityInput { entityId, status: "published" }
249
+ - Expected: updateEntity called with status="published"
250
+ - Error: None
251
+ - Mock: getEntity returns valid entity, updateEntity succeeds
252
+
253
+ - [ ] **Test 1.4.6**: `updateEntity()` logs event with changes metadata
254
+ - Input: UpdateEntityInput { entityId, name, properties, status }
255
+ - Expected: logEvent called with metadata.changes array containing modified fields
256
+ - Error: None
257
+ - Mock: getEntity and updateEntity mocked
258
+
259
+ - [ ] **Test 1.4.7**: `updateEntity()` updates RAG index when properties change
260
+ - Input: UpdateEntityInput { entityId, properties: { content: "new content" } }
261
+ - Expected: RAG deleteDocument and addDocument called
262
+ - Error: None
263
+ - Mock: getEntity returns blog_post entity, RAG service mocked
264
+
265
+ - [ ] **Test 1.4.8**: `updateEntity()` skips RAG when no searchable content
266
+ - Input: UpdateEntityInput { entityId, properties: { views: 100 } }
267
+ - Expected: RAG operations NOT called
268
+ - Error: None
269
+ - Mock: getEntity returns blog_post with no content field
270
+
271
+ - [ ] **Test 1.4.9**: `updateEntity()` sets updatedAt timestamp
272
+ - Input: UpdateEntityInput { entityId, name: "New" }
273
+ - Expected: updateEntity called with updatedAt as current timestamp
274
+ - Error: None
275
+ - Mock: updateEntity mocked to capture calls
276
+
277
+ - [ ] **Test 1.4.10**: `updateEntity()` handles no changes gracefully
278
+ - Input: UpdateEntityInput { entityId } (no updates provided)
279
+ - Expected: Success, updatedAt is set but no other changes
280
+ - Error: None
281
+ - Mock: getEntity returns valid entity
282
+
283
+ ### 1.5 Entity Service Archive Tests
284
+
285
+ - [ ] **Test 1.5.1**: `archiveEntity()` sets status to "archived"
286
+ - Input: entityId="xyz"
287
+ - Expected: updateEntity called with status="archived"
288
+ - Error: None
289
+ - Mock: getEntity returns valid entity, updateEntity succeeds
290
+
291
+ - [ ] **Test 1.5.2**: `archiveEntity()` fails when entity not found
292
+ - Input: entityId="missing"
293
+ - Expected: Fails with ValidationError
294
+ - Error: ValidationError { field: "entityId" }
295
+ - Mock: getEntity returns null
296
+
297
+ - [ ] **Test 1.5.3**: `archiveEntity()` removes from RAG index
298
+ - Input: entityId of blog_post
299
+ - Expected: RAG deleteDocument called
300
+ - Error: None
301
+ - Mock: getEntity returns blog_post, RAG service mocked
302
+
303
+ - [ ] **Test 1.5.4**: `archiveEntity()` logs event with action metadata
304
+ - Input: entityId
305
+ - Expected: logEvent called with type="thing_deleted" and metadata.action="archived"
306
+ - Error: None
307
+ - Mock: getEntity and logEvent mocked
308
+
309
+ - [ ] **Test 1.5.5**: `archiveEntity()` sets deletedAt timestamp
310
+ - Input: entityId
311
+ - Expected: updateEntity called with deletedAt timestamp
312
+ - Error: None
313
+ - Mock: updateEntity mocked to capture calls
314
+
315
+ ---
316
+
317
+ ## Phase 2: Convex Queries, Mutations & Validation (Cycle 65-66)
318
+
319
+ Convex function tests validate the integration between HTTP layer and business logic.
320
+
321
+ ### 2.1 Thing Mutation Tests
322
+
323
+ - [ ] **Test 2.1.1**: `things/create` mutation succeeds with valid args
324
+ - Args: { groupId, type: "blog_post", name: "Test", properties: {} }
325
+ - Expected: Returns entityId
326
+ - Error: None
327
+ - Auth: Mocked as authenticated
328
+
329
+ - [ ] **Test 2.1.2**: `things/create` mutation fails without authentication
330
+ - Args: { groupId, type: "blog_post", name: "Test" }
331
+ - Expected: Fails with error
332
+ - Error: "Unauthenticated"
333
+ - Auth: Mocked as null (no auth)
334
+
335
+ - [ ] **Test 2.1.3**: `things/create` mutation fails with invalid group
336
+ - Args: { groupId: "invalid", type: "blog_post", name: "Test" }
337
+ - Expected: Fails with error
338
+ - Error: "Group not found"
339
+ - Auth: Mocked as authenticated
340
+ - Mock: ctx.db.get returns null
341
+
342
+ - [ ] **Test 2.1.4**: `things/create` mutation fails with inactive group
343
+ - Args: { groupId, type: "blog_post", name: "Test" }
344
+ - Expected: Fails with error
345
+ - Error: "Group is not active"
346
+ - Auth: Mocked as authenticated
347
+ - Mock: ctx.db.get returns { status: "archived" }
348
+
349
+ - [ ] **Test 2.1.5**: `things/create` mutation validates type against ontology
350
+ - Args: { groupId, type: "invalid_type", name: "Test" }
351
+ - Expected: Fails with validation error
352
+ - Error: Type not in THING_TYPES
353
+ - Auth: Mocked as authenticated
354
+ - Mock: THING_TYPES mocked with specific types
355
+
356
+ - [ ] **Test 2.1.6**: `things/create` mutation inserts into entities table
357
+ - Args: Valid create args
358
+ - Expected: ctx.db.insert called for entities table
359
+ - Error: None
360
+ - Auth: Mocked
361
+ - Mock: ctx.db.insert mocked to capture calls
362
+
363
+ - [ ] **Test 2.1.7**: `things/create` mutation inserts event
364
+ - Args: Valid create args
365
+ - Expected: ctx.db.insert called for events table with type="thing_created"
366
+ - Error: None
367
+ - Auth: Mocked
368
+ - Mock: ctx.db.insert mocked to track calls
369
+
370
+ - [ ] **Test 2.1.8**: `things/create` mutation captures actor ID in event
371
+ - Args: Valid create args
372
+ - Expected: Event contains actorId from auth identity
373
+ - Error: None
374
+ - Auth: Mocked with userId
375
+ - Mock: ctx.db.insert mocked to capture event
376
+
377
+ - [ ] **Test 2.1.9**: `things/create` mutation handles missing properties gracefully
378
+ - Args: { groupId, type, name } (no properties)
379
+ - Expected: Success, entity created with empty properties
380
+ - Error: None
381
+ - Auth: Mocked
382
+
383
+ - [ ] **Test 2.1.10**: `things/create` mutation handles optional status
384
+ - Args: { groupId, type, name, status: undefined }
385
+ - Expected: Entity created with default status
386
+ - Error: None
387
+ - Auth: Mocked
388
+
389
+ ### 2.2 Thing Query Tests
390
+
391
+ - [ ] **Test 2.2.1**: `things/list` query returns entities by type
392
+ - Args: { groupId, type: "blog_post" }
393
+ - Expected: Array of blog_post entities
394
+ - Error: None
395
+ - Auth: Mocked as authenticated
396
+
397
+ - [ ] **Test 2.2.2**: `things/list` query filters by groupId
398
+ - Args: { groupId: "group1", type: "blog_post" }
399
+ - Expected: Only entities with matching groupId returned
400
+ - Error: None
401
+ - Auth: Mocked
402
+ - Mock: Query index "by_type" with filter
403
+
404
+ - [ ] **Test 2.2.3**: `things/list` query returns empty array when no matches
405
+ - Args: { groupId, type: "nonexistent_type" }
406
+ - Expected: Empty array
407
+ - Error: None
408
+ - Auth: Mocked
409
+
410
+ - [ ] **Test 2.2.4**: `things/get` query returns entity by ID
411
+ - Args: { entityId: "xyz" }
412
+ - Expected: Entity object with all fields
413
+ - Error: None
414
+ - Auth: Mocked
415
+ - Mock: ctx.db.get mocked to return entity
416
+
417
+ - [ ] **Test 2.2.5**: `things/get` query returns null for missing entity
418
+ - Args: { entityId: "missing" }
419
+ - Expected: null
420
+ - Error: None
421
+ - Auth: Mocked
422
+ - Mock: ctx.db.get returns null
423
+
424
+ - [ ] **Test 2.2.6**: `things/search` query returns results matching text
425
+ - Args: { groupId, query: "blog", type: "blog_post" }
426
+ - Expected: Array of matching entities
427
+ - Error: None
428
+ - Auth: Mocked
429
+ - Mock: Query filters by groupId and type, searches name/description
430
+
431
+ - [ ] **Test 2.2.7**: `things/search` query is case-insensitive
432
+ - Args: { groupId, query: "BLOG", type: "blog_post" }
433
+ - Expected: Results match "blog" in name/description
434
+ - Error: None
435
+ - Auth: Mocked
436
+
437
+ - [ ] **Test 2.2.8**: `things/listByStatus` query returns entities by status
438
+ - Args: { groupId, status: "published" }
439
+ - Expected: Only published entities returned
440
+ - Error: None
441
+ - Auth: Mocked
442
+
443
+ - [ ] **Test 2.2.9**: `things/count` query returns count by type
444
+ - Args: { groupId, type: "blog_post" }
445
+ - Expected: Number of blog_post entities
446
+ - Error: None
447
+ - Auth: Mocked
448
+
449
+ - [ ] **Test 2.2.10**: `things/recent` query returns recent entities
450
+ - Args: { groupId, limit: 10 }
451
+ - Expected: Latest 10 entities ordered by createdAt desc
452
+ - Error: None
453
+ - Auth: Mocked
454
+
455
+ ### 2.3 Input Validation Tests
456
+
457
+ - [ ] **Test 2.3.1**: Validation rejects empty name
458
+ - Args: { name: "" }
459
+ - Expected: Validation error
460
+ - Error: Field "name" required
461
+
462
+ - [ ] **Test 2.3.2**: Validation rejects name <2 chars
463
+ - Args: { name: "a" }
464
+ - Expected: Validation error
465
+ - Error: Minimum length 2
466
+
467
+ - [ ] **Test 2.3.3**: Validation rejects name >200 chars
468
+ - Args: { name: "a".repeat(201) }
469
+ - Expected: Validation error
470
+ - Error: Maximum length 200
471
+
472
+ - [ ] **Test 2.3.4**: Validation accepts valid groupId format
473
+ - Args: { groupId: v.id("groups") }
474
+ - Expected: Passes validation
475
+ - Error: None
476
+
477
+ - [ ] **Test 2.3.5**: Validation rejects invalid groupId format
478
+ - Args: { groupId: "not-an-id" }
479
+ - Expected: Validation error
480
+ - Error: Invalid ID format
481
+
482
+ - [ ] **Test 2.3.6**: Validation accepts valid type
483
+ - Args: { type: "blog_post" } (when in THING_TYPES)
484
+ - Expected: Passes validation
485
+ - Error: None
486
+
487
+ - [ ] **Test 2.3.7**: Validation rejects invalid type
488
+ - Args: { type: "invalid_type" }
489
+ - Expected: Validation error
490
+ - Error: Invalid type
491
+
492
+ - [ ] **Test 2.3.8**: Validation accepts any properties object
493
+ - Args: { properties: { custom: true, nested: { data: "value" } } }
494
+ - Expected: Passes validation
495
+ - Error: None
496
+
497
+ - [ ] **Test 2.3.9**: Validation accepts valid status values
498
+ - Args: { status: "draft" | "active" | "published" | "archived" | "inactive" }
499
+ - Expected: Each passes validation
500
+ - Error: None
501
+
502
+ - [ ] **Test 2.3.10**: Validation rejects invalid status
503
+ - Args: { status: "invalid_status" }
504
+ - Expected: Validation error
505
+ - Error: Invalid status
506
+
507
+ ### 2.4 Error Handling Tests
508
+
509
+ - [ ] **Test 2.4.1**: Database errors are caught and transformed
510
+ - Setup: Simulate database error
511
+ - Expected: Mutation returns error response
512
+ - Error: DatabaseError caught
513
+
514
+ - [ ] **Test 2.4.2**: Validation errors include field name and message
515
+ - Input: Invalid data
516
+ - Expected: Error response includes field, message, value
517
+ - Error: ValidationError with context
518
+
519
+ - [ ] **Test 2.4.3**: Unauthenticated requests are rejected
520
+ - Auth: No identity
521
+ - Expected: Error response "Unauthenticated"
522
+ - Error: Clear error message
523
+
524
+ - [ ] **Test 2.4.4**: Unauthorized group access is rejected
525
+ - Setup: User not in group
526
+ - Expected: Error response
527
+ - Error: Authorization check
528
+
529
+ - [ ] **Test 2.4.5**: Effect.ts errors are properly caught
530
+ - Setup: Service layer returns error
531
+ - Expected: Error propagated to mutation response
532
+ - Error: Original error context preserved
533
+
534
+ ---
535
+
536
+ ## Phase 3: Database & Schema Integrity (Cycle 66-67)
537
+
538
+ Database tests validate schema, constraints, and data integrity.
539
+
540
+ ### 3.1 Schema Definition Tests
541
+
542
+ - [ ] **Test 3.1.1**: `groups` table has required fields
543
+ - Expected: slug, name, type, status, createdAt, updatedAt
544
+ - Validation: Schema inspection
545
+
546
+ - [ ] **Test 3.1.2**: `groups` table has indexes for queries
547
+ - Expected: Indexes on slug, type, parentGroupId, status, createdAt
548
+ - Validation: Schema has index definitions
549
+
550
+ - [ ] **Test 3.1.3**: `entities` table has required fields
551
+ - Expected: groupId, type, name, properties, status, createdAt, updatedAt
552
+ - Validation: Schema inspection
553
+
554
+ - [ ] **Test 3.1.4**: `entities` table has groupId index
555
+ - Expected: Index by groupId for query performance
556
+ - Validation: Schema has groupId index
557
+
558
+ - [ ] **Test 3.1.5**: `entities` table has type index
559
+ - Expected: Index by type for efficient filtering
560
+ - Validation: Schema has type index
561
+
562
+ - [ ] **Test 3.1.6**: `connections` table has required fields
563
+ - Expected: fromThingId, toThingId, relationshipType, metadata, createdAt
564
+ - Validation: Schema inspection
565
+
566
+ - [ ] **Test 3.1.7**: `events` table has required fields
567
+ - Expected: type, actorId, targetId, timestamp, metadata, groupId
568
+ - Validation: Schema inspection
569
+
570
+ - [ ] **Test 3.1.8**: `knowledge` table has required fields
571
+ - Expected: knowledgeType, text, labels, metadata, createdAt
572
+ - Validation: Schema inspection
573
+
574
+ - [ ] **Test 3.1.9**: `thingKnowledge` junction table structure
575
+ - Expected: thingId, knowledgeId, role, metadata
576
+ - Validation: Schema inspection
577
+
578
+ - [ ] **Test 3.1.10**: Dynamic type unions from ontology composition
579
+ - Expected: THING_TYPES used in createTypeUnion
580
+ - Validation: Schema generation includes THING_TYPES
581
+
582
+ ### 3.2 Data Integrity Tests
583
+
584
+ - [ ] **Test 3.2.1**: Creating entity requires groupId reference
585
+ - Input: Entity without groupId
586
+ - Expected: Database constraint failure
587
+ - Error: Foreign key violation
588
+
589
+ - [ ] **Test 3.2.2**: Entity groupId must reference existing group
590
+ - Input: Entity with invalid groupId
591
+ - Expected: Database constraint failure
592
+ - Error: Reference constraint violation
593
+
594
+ - [ ] **Test 3.2.3**: Entity requires valid type from THING_TYPES
595
+ - Input: Entity with invalid type
596
+ - Expected: Type constraint violation
597
+ - Error: Enum constraint or validation error
598
+
599
+ - [ ] **Test 3.2.4**: Entity status must be valid enum value
600
+ - Input: Entity with status="invalid"
601
+ - Expected: Constraint violation
602
+ - Error: Status constraint
603
+
604
+ - [ ] **Test 3.2.5**: Event targetId can reference any entity
605
+ - Input: Event with targetId pointing to existing entity
606
+ - Expected: Success
607
+ - Error: None
608
+
609
+ - [ ] **Test 3.2.6**: Event actorId tracks person who performed action
610
+ - Input: Event with valid actorId
611
+ - Expected: Success, event logged
612
+ - Error: None
613
+
614
+ - [ ] **Test 3.2.7**: Timestamps are set automatically on creation
615
+ - Input: Entity creation (no createdAt/updatedAt provided)
616
+ - Expected: Database sets both timestamps
617
+ - Error: None
618
+
619
+ - [ ] **Test 3.2.8**: updatedAt is updated on mutation
620
+ - Input: Update entity
621
+ - Expected: updatedAt timestamp updated to current time
622
+ - Error: None
623
+
624
+ - [ ] **Test 3.2.9**: createdAt never changes after creation
625
+ - Input: Update entity multiple times
626
+ - Expected: createdAt always same as first creation
627
+ - Error: None
628
+
629
+ - [ ] **Test 3.2.10**: Soft delete via status="archived" preserves data
630
+ - Input: Archive entity
631
+ - Expected: Entity still exists with status="archived"
632
+ - Error: None
633
+
634
+ ### 3.3 Index Performance Tests
635
+
636
+ - [ ] **Test 3.3.1**: Query by_type index exists
637
+ - Expected: entities.by_type index defined
638
+ - Validation: Schema inspection
639
+
640
+ - [ ] **Test 3.3.2**: Query by_status index exists
641
+ - Expected: entities.by_status index (or similar)
642
+ - Validation: Schema inspection
643
+
644
+ - [ ] **Test 3.3.3**: Query by_groupId index exists
645
+ - Expected: Index for filtering by groupId
646
+ - Validation: Schema inspection
647
+
648
+ - [ ] **Test 3.3.4**: Query by_created index exists
649
+ - Expected: entities.by_created index for ordering
650
+ - Validation: Schema inspection
651
+
652
+ - [ ] **Test 3.3.5**: Event query uses index for targetId
653
+ - Expected: events has index for targetId lookups
654
+ - Validation: Schema inspection
655
+
656
+ - [ ] **Test 3.3.6**: Connection query uses index for fromThingId
657
+ - Expected: connections.from_type index
658
+ - Validation: Schema inspection
659
+
660
+ - [ ] **Test 3.3.7**: Group query uses index by_slug
661
+ - Expected: groups.by_slug index defined
662
+ - Validation: Schema inspection
663
+
664
+ - [ ] **Test 3.3.8**: Knowledge query uses index by_text
665
+ - Expected: knowledge table has text search index (if applicable)
666
+ - Validation: Schema inspection
667
+
668
+ - [ ] **Test 3.3.9**: Multi-column index for groupId + type
669
+ - Expected: Combined index improves grouped queries
670
+ - Validation: Query plan analysis
671
+
672
+ - [ ] **Test 3.3.10**: Index coverage for common filter patterns
673
+ - Expected: All common WHERE patterns use indexes
674
+ - Validation: Query analysis
675
+
676
+ ### 3.4 Multi-Tenancy Isolation Tests
677
+
678
+ - [ ] **Test 3.4.1**: Query scoped to groupId returns only that group's data
679
+ - Setup: Create entities in group A and group B
680
+ - Input: Query for group A entities
681
+ - Expected: Only group A entities returned
682
+ - Error: None
683
+
684
+ - [ ] **Test 3.4.2**: Entities isolated by groupId
685
+ - Setup: 2 groups with same entity name
686
+ - Input: Query group 1
687
+ - Expected: Only group 1 entity returned
688
+ - Error: None
689
+
690
+ - [ ] **Test 3.4.3**: Events isolated by groupId
691
+ - Setup: 2 groups with events
692
+ - Input: Query group 1 events
693
+ - Expected: Only group 1 events returned
694
+ - Error: None
695
+
696
+ - [ ] **Test 3.4.4**: Connections isolated by groupId
697
+ - Setup: 2 groups with connections
698
+ - Input: Query group 1 connections
699
+ - Expected: Only group 1 connections returned
700
+ - Error: None
701
+
702
+ - [ ] **Test 3.4.5**: Knowledge isolated by groupId
703
+ - Setup: 2 groups with knowledge items
704
+ - Input: Query group 1 knowledge
705
+ - Expected: Only group 1 knowledge returned
706
+ - Error: None
707
+
708
+ - [ ] **Test 3.4.6**: Hierarchical groups share parent's context
709
+ - Setup: Parent group with child group
710
+ - Input: Query parent group entities
711
+ - Expected: Returns parent entities (child isolation configurable)
712
+ - Error: None
713
+
714
+ - [ ] **Test 3.4.7**: Cross-group queries are prevented
715
+ - Setup: Try to access group B from group A context
716
+ - Expected: Query includes groupId filter preventing access
717
+ - Error: None
718
+
719
+ - [ ] **Test 3.4.8**: Group archive doesn't affect other groups
720
+ - Setup: Archive group A
721
+ - Input: Query group B
722
+ - Expected: Group B data unaffected
723
+ - Error: None
724
+
725
+ - [ ] **Test 3.4.9**: Quota limits per group
726
+ - Setup: Check group limits in settings
727
+ - Expected: Each group has independent limits (users, storage, apiCalls)
728
+ - Error: None
729
+
730
+ - [ ] **Test 3.4.10**: Billing isolation per group
731
+ - Setup: 2 organizations with billing
732
+ - Expected: Each org has independent billing, no cross-charging
733
+ - Error: None
734
+
735
+ ---
736
+
737
+ ## Phase 4: Integration & Performance Testing (Cycle 68-70)
738
+
739
+ Integration tests validate complete workflows and performance characteristics.
740
+
741
+ ### 4.1 End-to-End Workflow Tests
742
+
743
+ - [ ] **Test 4.1.1**: Create entity → Query → Update → Archive flow
744
+ - Steps:
745
+ 1. Create blog_post entity
746
+ 2. Query by ID to verify creation
747
+ 3. Update name and properties
748
+ 4. Query to verify update
749
+ 5. Archive entity
750
+ 6. Query should return archived status
751
+ - Expected: All steps succeed, data consistent
752
+ - Error: None
753
+
754
+ - [ ] **Test 4.1.2**: Create entity → Create connection → Query connection
755
+ - Steps:
756
+ 1. Create 2 entities (blog_post, course)
757
+ 2. Create connection between them (relates_to)
758
+ 3. Query connections from blog_post
759
+ - Expected: Connection created and queryable
760
+ - Error: None
761
+
762
+ - [ ] **Test 4.1.3**: Create entity → Log event → Query event history
763
+ - Steps:
764
+ 1. Create entity
765
+ 2. Update entity (triggers event)
766
+ 3. Query events for entity
767
+ - Expected: Event logged correctly with metadata
768
+ - Error: None
769
+
770
+ - [ ] **Test 4.1.4**: Create entity → Add to RAG → Search RAG → Update → Re-index
771
+ - Steps:
772
+ 1. Create blog_post with content
773
+ 2. Verify RAG indexed
774
+ 3. Search RAG returns result
775
+ 4. Update entity content
776
+ 5. Search RAG returns updated result
777
+ - Expected: RAG always current
778
+ - Error: None
779
+
780
+ - [ ] **Test 4.1.5**: Bulk create multiple entities → Query all
781
+ - Steps:
782
+ 1. Create 10 blog_post entities
783
+ 2. Query by type and groupId
784
+ - Expected: All 10 returned
785
+ - Error: None
786
+
787
+ - [ ] **Test 4.1.6**: Create entity with complex nested properties
788
+ - Input: Entity with properties = { nested: { deep: { data: [...] } } }
789
+ - Expected: Stored and retrieved correctly
790
+ - Error: None
791
+
792
+ - [ ] **Test 4.1.7**: Feature recommendation → Create recommended entities
793
+ - Steps:
794
+ 1. Detect features (blog, video, courses)
795
+ 2. Get recommendations
796
+ 3. Create entities for each recommendation
797
+ - Expected: All entities created with correct types
798
+ - Error: None
799
+
800
+ - [ ] **Test 4.1.8**: Search entities → Filter by status → Filter by type
801
+ - Steps:
802
+ 1. Create mix of draft/published entities
803
+ 2. Search for text match
804
+ 3. Filter results by status="published"
805
+ 4. Filter results by type="blog_post"
806
+ - Expected: Each filter reduces result set correctly
807
+ - Error: None
808
+
809
+ - [ ] **Test 4.1.9**: Concurrent entity creation
810
+ - Steps:
811
+ 1. Create 5 entities simultaneously
812
+ 2. Query all
813
+ - Expected: All 5 created, no conflicts
814
+ - Error: None (or expected conflict resolution)
815
+
816
+ - [ ] **Test 4.1.10**: Full group lifecycle with entities
817
+ - Steps:
818
+ 1. Create group
819
+ 2. Create 5 entities in group
820
+ 3. Update group settings
821
+ 4. Query entities (still accessible)
822
+ 5. Archive group
823
+ 6. Query entities (soft-deleted or marked)
824
+ - Expected: Full lifecycle succeeds
825
+ - Error: None
826
+
827
+ ### 4.2 Multi-Feature Workflow Tests
828
+
829
+ - [ ] **Test 4.2.1**: Create course → Create lessons → Create connections
830
+ - Steps:
831
+ 1. Create course entity
832
+ 2. Create 3 lesson entities
833
+ 3. Create "contains" connections from course to lessons
834
+ - Expected: Hierarchy established
835
+ - Error: None
836
+
837
+ - [ ] **Test 4.2.2**: Create blog post → Tag with knowledge → Search by knowledge
838
+ - Steps:
839
+ 1. Create blog_post
840
+ 2. Add knowledge labels (skill:react, platform:web)
841
+ 3. Search by knowledge
842
+ - Expected: Blog post findable by knowledge labels
843
+ - Error: None
844
+
845
+ - [ ] **Test 4.2.3**: Create event → Emit to agent → Log result
846
+ - Steps:
847
+ 1. Create entity (triggers event)
848
+ 2. Agent processes event
849
+ 3. Result logged
850
+ - Expected: Full event-driven flow works
851
+ - Error: None
852
+
853
+ - [ ] **Test 4.2.4**: Recommendation → Create entities → Track in events
854
+ - Steps:
855
+ 1. Get feature recommendations
856
+ 2. Create recommended entities
857
+ 3. Query events to see creation history
858
+ - Expected: Full audit trail present
859
+ - Error: None
860
+
861
+ - [ ] **Test 4.2.5**: Multi-group isolation in shared database
862
+ - Steps:
863
+ 1. Create 2 groups
864
+ 2. Create entities in each
865
+ 3. Query group 1 entities
866
+ - Expected: Only group 1 entities visible
867
+ - Error: None
868
+
869
+ ### 4.3 Error Recovery Tests
870
+
871
+ - [ ] **Test 4.3.1**: Partial write failure rolls back cleanly
872
+ - Setup: Simulate failure after entity creation but before event logging
873
+ - Expected: Entity creation rolled back or event logged anyway
874
+ - Error: Consistent state maintained
875
+
876
+ - [ ] **Test 4.3.2**: Validation error prevents database write
877
+ - Input: Invalid entity
878
+ - Expected: No entity created, no event logged
879
+ - Error: ValidationError
880
+
881
+ - [ ] **Test 4.3.3**: Database error retries automatically
882
+ - Setup: Simulate transient DB error
883
+ - Expected: Convex retries, eventually succeeds
884
+ - Error: None (after retry succeeds)
885
+
886
+ - [ ] **Test 4.3.4**: Concurrent update conflict handling
887
+ - Steps:
888
+ 1. Update entity field A
889
+ 2. Simultaneously update field B
890
+ - Expected: Both updates applied or last-write-wins
891
+ - Error: None (clear conflict resolution)
892
+
893
+ - [ ] **Test 4.3.5**: Out-of-order event processing
894
+ - Setup: Create event → Update → Query events
895
+ - Expected: Events ordered by timestamp
896
+ - Error: None
897
+
898
+ ### 4.4 Performance & Load Tests
899
+
900
+ - [ ] **Test 4.4.1**: Query 1000 entities by type completes <500ms
901
+ - Setup: Create 1000 blog_post entities in group
902
+ - Query: entities by_type index
903
+ - Expected: Query completes in <500ms
904
+ - Error: None, performance baseline
905
+
906
+ - [ ] **Test 4.4.2**: Search 10000 entities by text completes <1000ms
907
+ - Setup: Create 10000 entities with varied names
908
+ - Query: Full-text search
909
+ - Expected: Query completes in <1000ms
910
+ - Error: None, performance baseline
911
+
912
+ - [ ] **Test 4.4.3**: RAG search 1000 documents completes <200ms
913
+ - Setup: Index 1000 documents in RAG
914
+ - Query: Semantic search
915
+ - Expected: Query completes in <200ms
916
+ - Error: None, performance baseline
917
+
918
+ - [ ] **Test 4.4.4**: Event query for entity with 1000 events completes <300ms
919
+ - Setup: Create entity with 1000 events
920
+ - Query: All events for entity
921
+ - Expected: Query completes in <300ms
922
+ - Error: None, performance baseline
923
+
924
+ - [ ] **Test 4.4.5**: Concurrent mutations don't degrade performance
925
+ - Setup: 10 concurrent entity creations
926
+ - Expected: All complete in <1000ms total
927
+ - Error: None, performance baseline
928
+
929
+ - [ ] **Test 4.4.6**: Query response time under load
930
+ - Setup: 100 concurrent queries
931
+ - Expected: p99 <500ms, p95 <300ms
932
+ - Error: None, performance baseline
933
+
934
+ - [ ] **Test 4.4.7**: Memory usage doesn't grow with entity count
935
+ - Setup: Create 10000 entities
936
+ - Expected: Memory stable, no leaks
937
+ - Error: None
938
+
939
+ - [ ] **Test 4.4.8**: Database size appropriate for data volume
940
+ - Setup: Create 10000 entities with 1MB properties each
941
+ - Expected: Database size ~10GB (appropriate overhead)
942
+ - Error: None
943
+
944
+ - [ ] **Test 4.4.9**: Index build time <100ms for 10000 entities
945
+ - Setup: Create 10000 entities with indexes
946
+ - Expected: Index build <100ms
947
+ - Error: None
948
+
949
+ - [ ] **Test 4.4.10**: RAG index scaling
950
+ - Setup: Add 10000 documents to RAG
951
+ - Expected: Search performance remains <200ms
952
+ - Error: None
953
+
954
+ ---
955
+
956
+ ## Critical Path Diagram
957
+
958
+ ```
959
+ START
960
+ │
961
+ ├─→ Phase 1: Service Unit Tests (Tests 1.1 - 1.5)
962
+ │ │ Parallel: 1.1, 1.2, 1.3, 1.4, 1.5
963
+ │ └─→ All pass: ValidationError, DatabaseError, RAGError working
964
+ │
965
+ ├─→ Phase 2: Convex Tests (Tests 2.1 - 2.4) [depends on 1]
966
+ │ │ Sequential: 2.1 → 2.2 → 2.3 → 2.4
967
+ │ └─→ All pass: mutations/queries validated, auth working
968
+ │
969
+ ├─→ Phase 3: Database Tests (Tests 3.1 - 3.4) [depends on 1,2]
970
+ │ │ Parallel: 3.1, 3.2, 3.3, 3.4
971
+ │ └─→ All pass: schema valid, indexes present, isolation working
972
+ │
973
+ └─→ Phase 4: Integration Tests (Tests 4.1 - 4.4) [depends on 2,3]
974
+ │ Sequential: 4.1 → 4.2 → 4.3 → 4.4
975
+ └─→ All pass: e2e workflows, error handling, performance baselines
976
+
977
+ END (Backend ready for frontend integration)
978
+ ```
979
+
980
+ ---
981
+
982
+ ## Success Criteria
983
+
984
+ ### Coverage Requirements
985
+ - [ ] Unit tests: 85%+ coverage of service layer functions
986
+ - [ ] Integration tests: All critical paths tested (create → query → update → archive)
987
+ - [ ] Error tests: All error types tested with proper error responses
988
+ - [ ] Database tests: All schema constraints validated
989
+
990
+ ### Performance Baselines
991
+ - [ ] Single entity query: <50ms
992
+ - [ ] List query (100 entities): <200ms
993
+ - [ ] Search query (1000 entities): <500ms
994
+ - [ ] RAG search: <200ms
995
+ - [ ] Event query (1000 events): <300ms
996
+
997
+ ### Quality Gates
998
+ - [ ] All tests pass (100% pass rate)
999
+ - [ ] No TypeScript errors (`bun run generate-types` succeeds)
1000
+ - [ ] No console errors in test output
1001
+ - [ ] Code coverage >85%
1002
+ - [ ] Zero test warnings
1003
+
1004
+ ### Deliverables
1005
+ - [ ] `/backend/test/services/*.test.ts` - Service unit tests (50+ tests)
1006
+ - [ ] `/backend/test/convex/*.test.ts` - Convex function tests (30+ tests)
1007
+ - [ ] `/backend/test/database/*.test.ts` - Database integrity tests (30+ tests)
1008
+ - [ ] `/backend/test/integration/*.test.ts` - E2E tests (20+ tests)
1009
+ - [ ] Test configuration: `vitest.config.ts`, `test/setup.ts`
1010
+ - [ ] Mock utilities: `test/mocks/`, `test/fixtures/`
1011
+ - [ ] Coverage report: `coverage/` directory
1012
+
1013
+ ---
1014
+
1015
+ ## Test Database Setup Requirements
1016
+
1017
+ ### Development Test Database
1018
+ ```typescript
1019
+ // test/setup.ts
1020
+ import { vi } from 'vitest';
1021
+
1022
+ // Mock Convex context
1023
+ export const mockConvexContext = {
1024
+ db: {
1025
+ get: vi.fn(),
1026
+ insert: vi.fn(),
1027
+ patch: vi.fn(),
1028
+ replace: vi.fn(),
1029
+ delete: vi.fn(),
1030
+ query: vi.fn(),
1031
+ },
1032
+ auth: {
1033
+ getUserIdentity: vi.fn(),
1034
+ },
1035
+ };
1036
+
1037
+ // Mock Effect.ts services
1038
+ export const mockRAGService = {
1039
+ addDocument: vi.fn(),
1040
+ deleteDocument: vi.fn(),
1041
+ search: vi.fn(),
1042
+ addChunks: vi.fn(),
1043
+ };
1044
+
1045
+ export const mockAgentService = {
1046
+ createThread: vi.fn(),
1047
+ sendMessage: vi.fn(),
1048
+ streamResponse: vi.fn(),
1049
+ listThreads: vi.fn(),
1050
+ };
1051
+
1052
+ // Helper to reset mocks between tests
1053
+ export function resetMocks() {
1054
+ Object.values(mockConvexContext).forEach(mock =>
1055
+ Object.values(mock).forEach(fn => fn && fn.mockReset?.())
1056
+ );
1057
+ Object.values(mockRAGService).forEach(fn => fn.mockReset?.());
1058
+ Object.values(mockAgentService).forEach(fn => fn.mockReset?.());
1059
+ }
1060
+ ```
1061
+
1062
+ ### Test Data Fixtures
1063
+ ```typescript
1064
+ // test/fixtures/entities.ts
1065
+ export const mockEntity = {
1066
+ _id: "test-entity-1",
1067
+ groupId: "test-group-1",
1068
+ type: "blog_post",
1069
+ name: "Test Blog Post",
1070
+ properties: {
1071
+ content: "Test content",
1072
+ description: "Test description"
1073
+ },
1074
+ status: "published",
1075
+ createdAt: 1699000000000,
1076
+ updatedAt: 1699000000000
1077
+ };
1078
+
1079
+ export const mockGroup = {
1080
+ _id: "test-group-1",
1081
+ slug: "test-group",
1082
+ name: "Test Group",
1083
+ type: "organization",
1084
+ status: "active",
1085
+ settings: {
1086
+ visibility: "private",
1087
+ joinPolicy: "invite_only",
1088
+ plan: "pro"
1089
+ },
1090
+ createdAt: 1699000000000,
1091
+ updatedAt: 1699000000000
1092
+ };
1093
+ ```
1094
+
1095
+ ---
1096
+
1097
+ ## Test Execution
1098
+
1099
+ ### Run All Tests
1100
+ ```bash
1101
+ cd backend
1102
+ bun run test
1103
+ ```
1104
+
1105
+ ### Run Specific Phase
1106
+ ```bash
1107
+ # Phase 1: Service unit tests
1108
+ bun run test test/services/**/*.test.ts
1109
+
1110
+ # Phase 2: Convex tests
1111
+ bun run test test/convex/**/*.test.ts
1112
+
1113
+ # Phase 3: Database tests
1114
+ bun run test test/database/**/*.test.ts
1115
+
1116
+ # Phase 4: Integration tests
1117
+ bun run test test/integration/**/*.test.ts
1118
+ ```
1119
+
1120
+ ### Watch Mode
1121
+ ```bash
1122
+ bun run test:watch
1123
+ ```
1124
+
1125
+ ### Coverage Report
1126
+ ```bash
1127
+ bun run test:coverage
1128
+ ```
1129
+
1130
+ ---
1131
+
1132
+ ## Notes & Blockers
1133
+
1134
+ ### Known Issues
1135
+ - [ ] Mock Convex context may need adjustment based on actual SDK
1136
+ - [ ] RAG service mocking depends on @convex-dev/rag API
1137
+ - [ ] Agent service mocking depends on @convex-dev/agent API
1138
+
1139
+ ### Dependencies
1140
+ - Vitest v3.2.4 (already in package.json)
1141
+ - Effect v3.13.6 (already in package.json)
1142
+ - @types/node for Node APIs
1143
+ - Mock library (use Vitest's built-in `vi`)
1144
+
1145
+ ### Next Steps After Testing
1146
+ 1. Run full test suite
1147
+ 2. Fix any failing tests
1148
+ 3. Achieve 85%+ coverage
1149
+ 4. Run performance baseline tests
1150
+ 5. Document performance characteristics
1151
+ 6. Move to Phase 5 (Frontend integration)
1152
+
1153
+ ---
1154
+
1155
+ ## Timeline Estimation
1156
+
1157
+ - **Phase 1 (Service tests)**: 2-3 cycles
1158
+ - **Phase 2 (Convex tests)**: 2-3 cycles
1159
+ - **Phase 3 (Database tests)**: 2-3 cycles
1160
+ - **Phase 4 (Integration tests)**: 2-3 cycles
1161
+ - **Total**: 8-12 cycles (Cycle 65-76)
1162
+
1163
+ Current progress: Cycle 65/100 (ready to start Phase 1)
1164
+
1165
+ ---
1166
+
1167
+ ## References
1168
+
1169
+ - Backend schema: `/Users/toc/Server/ONE/backend/convex/schema.ts`
1170
+ - Effect.ts services: `/Users/toc/Server/ONE/backend/convex/services/layers.ts`
1171
+ - Entity service: `/Users/toc/Server/ONE/backend/convex/services/entityService.ts`
1172
+ - Feature recommender: `/Users/toc/Server/ONE/backend/convex/services/featureRecommender.ts`
1173
+ - Things mutations: `/Users/toc/Server/ONE/backend/convex/mutations/things.ts`
1174
+ - Vitest config: To be created in `/Users/toc/Server/ONE/backend/vitest.config.ts`
1175
+ - CLAUDE.md: Development guidelines and patterns
1176
+
1177
+ ---
1178
+
1179
+ **Status**: Ready for backend engineer to begin Phase 1 (service unit tests)
1180
+ **Estimated Completion**: Cycle 76/100 with full backend coverage