oneie 2.0.2 → 2.0.3

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 (405) hide show
  1. package/AGENTS.md +245 -0
  2. package/CLAUDE.md +534 -0
  3. package/one/.obsidian/app.json +1 -0
  4. package/one/.obsidian/appearance.json +1 -0
  5. package/one/.obsidian/core-plugins.json +33 -0
  6. package/one/.obsidian/workspace.json +211 -0
  7. package/one/connections/a2a.md +551 -0
  8. package/one/connections/acp.md +761 -0
  9. package/one/connections/acps.md +731 -0
  10. package/one/connections/agui.md +767 -0
  11. package/one/connections/any-backend.md +1702 -0
  12. package/one/connections/ap2.md +998 -0
  13. package/one/connections/api-docs.md +1891 -0
  14. package/one/connections/api.md +2190 -0
  15. package/one/connections/architecture-diagram.md +94 -0
  16. package/one/connections/communications.md +449 -0
  17. package/one/connections/connections.md +339 -0
  18. package/one/connections/cryptonetworks.md +781 -0
  19. package/one/connections/documentation.md +1120 -0
  20. package/one/connections/effect.md +279 -0
  21. package/one/connections/elizaos.md +1290 -0
  22. package/one/connections/inference.md +58 -0
  23. package/one/connections/kyc.md +632 -0
  24. package/one/connections/mcp.md +842 -0
  25. package/one/connections/membership.md +1152 -0
  26. package/one/connections/middleware.md +1067 -0
  27. package/one/connections/multitenant.md +1341 -0
  28. package/one/connections/n8n.md +1015 -0
  29. package/one/connections/patterns.md +89 -0
  30. package/one/connections/protocols.md +279 -0
  31. package/one/connections/relationships.md +107 -0
  32. package/one/connections/schema.md +587 -0
  33. package/one/connections/service-layer.md +550 -0
  34. package/one/connections/structure.md +0 -0
  35. package/one/connections/vectors.md +207 -0
  36. package/one/connections/wordpress.md +1302 -0
  37. package/one/connections/workflow-copy.md +905 -0
  38. package/one/connections/workflow-examples.md +741 -0
  39. package/one/connections/workflow.md +905 -0
  40. package/one/connections/workflows/delegation.md +885 -0
  41. package/one/connections/workflows/frontend.md +1037 -0
  42. package/one/connections/workflows/strategy.md +903 -0
  43. package/one/connections/workflows/tasks.md +698 -0
  44. package/one/connections/x402.md +1249 -0
  45. package/one/events/events.md +545 -0
  46. package/one/knowledge/ai-platform.md +305 -0
  47. package/one/knowledge/architecture-diagram.md +94 -0
  48. package/one/knowledge/architecture-frontend.md +930 -0
  49. package/one/knowledge/architecture.md +2077 -0
  50. package/one/knowledge/crypto.md +960 -0
  51. package/one/knowledge/dsl.md +1660 -0
  52. package/one/knowledge/files.md +2471 -0
  53. package/one/knowledge/frontend.md +1038 -0
  54. package/one/knowledge/hono.md +2109 -0
  55. package/one/knowledge/implementation-examples.md +2536 -0
  56. package/one/knowledge/inference-score.md +159 -0
  57. package/one/knowledge/knowledge.md +642 -0
  58. package/one/knowledge/language.md +980 -0
  59. package/one/knowledge/lessons-learned.md +70 -0
  60. package/one/knowledge/ontology-6-dimensions.md +0 -0
  61. package/one/knowledge/ontology-documentation.md +356 -0
  62. package/one/knowledge/ontology-engineering-specification.md +1292 -0
  63. package/one/knowledge/ontology-engineering.md +1652 -0
  64. package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
  65. package/one/knowledge/ontology-frontend-copy.md +753 -0
  66. package/one/knowledge/ontology-frontend-specifications.md +2188 -0
  67. package/one/knowledge/ontology-frontend.md +2427 -0
  68. package/one/knowledge/ontology-minimal.yaml +299 -0
  69. package/one/knowledge/ontology.md +2819 -0
  70. package/one/knowledge/ontology.yaml +1165 -0
  71. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
  72. package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
  73. package/one/knowledge/patterns/backend/mutation-template.md +231 -0
  74. package/one/knowledge/patterns/backend/query-template.md +267 -0
  75. package/one/knowledge/patterns/backend/service-template.md +237 -0
  76. package/one/knowledge/patterns/design/component-architecture.md +399 -0
  77. package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
  78. package/one/knowledge/patterns/design/wireframe-template.md +216 -0
  79. package/one/knowledge/patterns/frontend/component-template.md +195 -0
  80. package/one/knowledge/patterns/frontend/form-template.md +276 -0
  81. package/one/knowledge/patterns/frontend/page-template.md +178 -0
  82. package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
  83. package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
  84. package/one/knowledge/patterns/test/technical-test-template.md +544 -0
  85. package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
  86. package/one/knowledge/patterns/test/user-flow-template.md +254 -0
  87. package/one/knowledge/quality-loop.md +401 -0
  88. package/one/knowledge/readme.md +131 -0
  89. package/one/knowledge/rules.md +626 -0
  90. package/one/knowledge/score.md +67 -0
  91. package/one/knowledge/specifications.md +855 -0
  92. package/one/knowledge/tags.md +130 -0
  93. package/one/organisation/one.md +599 -0
  94. package/one/organisation/organisation.md +438 -0
  95. package/one/organisation/revenue.md +673 -0
  96. package/one/organisation/strategy.md +869 -0
  97. package/one/organisation/vision.md +98 -0
  98. package/one/people/anthony-o-connell.md +440 -0
  99. package/one/people/people.md +567 -0
  100. package/one/repomix-output.md +92634 -0
  101. package/one/things/agentkit.md +349 -0
  102. package/one/things/agents/agent-backend.md +1401 -0
  103. package/one/things/agents/agent-builder.md +955 -0
  104. package/one/things/agents/agent-clean.md +709 -0
  105. package/one/things/agents/agent-clone.md +1341 -0
  106. package/one/things/agents/agent-designer.md +2177 -0
  107. package/one/things/agents/agent-director.md +1508 -0
  108. package/one/things/agents/agent-documenter.md +1049 -0
  109. package/one/things/agents/agent-frontend.md +1119 -0
  110. package/one/things/agents/agent-integrator.md +1192 -0
  111. package/one/things/agents/agent-problem-solver.md +1379 -0
  112. package/one/things/agents/agent-quality.md +1353 -0
  113. package/one/things/agents/agent-sales.md +986 -0
  114. package/one/things/cascade/cascade.yaml +464 -0
  115. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
  116. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
  117. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
  118. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
  119. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
  120. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
  121. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
  122. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
  123. package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
  124. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
  125. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
  126. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
  127. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
  128. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
  129. package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
  130. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
  131. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
  132. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
  133. package/one/things/cascade/docs/examples/readme.md +222 -0
  134. package/one/things/cascade/docs/getting-started.md +515 -0
  135. package/one/things/cascade/docs/workflow.md +1372 -0
  136. package/one/things/cascade/readme.md +336 -0
  137. package/one/things/cascade/templates/feature-template.md +267 -0
  138. package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
  139. package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
  140. package/one/things/claude/agents/analyst.md +483 -0
  141. package/one/things/claude/agents/architect.md +480 -0
  142. package/one/things/claude/agents/brand-identity-specialist.md +513 -0
  143. package/one/things/claude/agents/bstp-token-strategist.md +667 -0
  144. package/one/things/claude/agents/builder-repo.md +489 -0
  145. package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
  146. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
  147. package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
  148. package/one/things/claude/agents/company-bullstamp-character.md +587 -0
  149. package/one/things/claude/agents/company-bullstamp-community.md +292 -0
  150. package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
  151. package/one/things/claude/agents/company-bullstamp-token.md +292 -0
  152. package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
  153. package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
  154. package/one/things/claude/agents/content-calendar-planner.md +448 -0
  155. package/one/things/claude/agents/content-chapter-formatter.md +488 -0
  156. package/one/things/claude/agents/content-formatter.md +546 -0
  157. package/one/things/claude/agents/content-hook-specialist.md +462 -0
  158. package/one/things/claude/agents/content-image-formatter.md +535 -0
  159. package/one/things/claude/agents/content-introduction-formatter.md +485 -0
  160. package/one/things/claude/agents/content-multiplication-engine.md +556 -0
  161. package/one/things/claude/agents/content-playbook-writer.md +448 -0
  162. package/one/things/claude/agents/content-team-manager.md +622 -0
  163. package/one/things/claude/agents/content-toc-formatter.md +522 -0
  164. package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
  165. package/one/things/claude/agents/core-manager.md +582 -0
  166. package/one/things/claude/agents/core-master.md +403 -0
  167. package/one/things/claude/agents/cross-functional-manager.md +471 -0
  168. package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
  169. package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
  170. package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
  171. package/one/things/claude/agents/crypto-community-analyst.md +298 -0
  172. package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
  173. package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
  174. package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
  175. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
  176. package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
  177. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
  178. package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
  179. package/one/things/claude/agents/crypto-market-researcher.md +292 -0
  180. package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
  181. package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
  182. package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
  183. package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
  184. package/one/things/claude/agents/crypto-team-manager.md +387 -0
  185. package/one/things/claude/agents/crypto-token-analyst.md +278 -0
  186. package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
  187. package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
  188. package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
  189. package/one/things/claude/agents/customer-journey-designer.md +481 -0
  190. package/one/things/claude/agents/customer-success-manager.md +581 -0
  191. package/one/things/claude/agents/dev.md +413 -0
  192. package/one/things/claude/agents/documenter.md +546 -0
  193. package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
  194. package/one/things/claude/agents/engagement-specialist.md +509 -0
  195. package/one/things/claude/agents/engineering-architect.md +387 -0
  196. package/one/things/claude/agents/engineering-business-analyst.md +537 -0
  197. package/one/things/claude/agents/engineering-developer.md +387 -0
  198. package/one/things/claude/agents/engineering-director.md +282 -0
  199. package/one/things/claude/agents/engineering-ingestor.md +649 -0
  200. package/one/things/claude/agents/engineering-product-manager.md +537 -0
  201. package/one/things/claude/agents/engineering-product-owner.md +537 -0
  202. package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
  203. package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
  204. package/one/things/claude/agents/engineering-team-manager.md +512 -0
  205. package/one/things/claude/agents/engineering-user-experience.md +387 -0
  206. package/one/things/claude/agents/framework-elevate-manager.md +294 -0
  207. package/one/things/claude/agents/improver.md +763 -0
  208. package/one/things/claude/agents/intelligence-team-manager.md +385 -0
  209. package/one/things/claude/agents/lead-capture-expert.md +466 -0
  210. package/one/things/claude/agents/lead-magnet-creator.md +453 -0
  211. package/one/things/claude/agents/market-research-analyst.md +412 -0
  212. package/one/things/claude/agents/marketing-brand-identity.md +314 -0
  213. package/one/things/claude/agents/marketing-content-hooks.md +450 -0
  214. package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
  215. package/one/things/claude/agents/marketing-content-poster.md +361 -0
  216. package/one/things/claude/agents/marketing-customer-journey.md +326 -0
  217. package/one/things/claude/agents/marketing-director.md +397 -0
  218. package/one/things/claude/agents/marketing-engagement.md +326 -0
  219. package/one/things/claude/agents/marketing-lead-capture.md +326 -0
  220. package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
  221. package/one/things/claude/agents/marketing-network-effects.md +326 -0
  222. package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
  223. package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
  224. package/one/things/claude/agents/marketing-team-manager.md +446 -0
  225. package/one/things/claude/agents/marketing-viral-growth.md +201 -0
  226. package/one/things/claude/agents/mission-commander.md +373 -0
  227. package/one/things/claude/agents/network-effect-analyst.md +587 -0
  228. package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
  229. package/one/things/claude/agents/npx.md +890 -0
  230. package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
  231. package/one/things/claude/agents/one-master.md +355 -0
  232. package/one/things/claude/agents/one-orchestrator.md +315 -0
  233. package/one/things/claude/agents/one.md +601 -0
  234. package/one/things/claude/agents/playbook-generator.md +503 -0
  235. package/one/things/claude/agents/pm.md +326 -0
  236. package/one/things/claude/agents/po.md +345 -0
  237. package/one/things/claude/agents/qa.md +336 -0
  238. package/one/things/claude/agents/research-foundation-analyst.md +307 -0
  239. package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
  240. package/one/things/claude/agents/research-market-analyst.md +307 -0
  241. package/one/things/claude/agents/research-team-manager.md +482 -0
  242. package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
  243. package/one/things/claude/agents/sales-team-manager.md +400 -0
  244. package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
  245. package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
  246. package/one/things/claude/agents/service-advocacy-manager.md +307 -0
  247. package/one/things/claude/agents/service-success-manager.md +307 -0
  248. package/one/things/claude/agents/service-team-manager.md +400 -0
  249. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
  250. package/one/things/claude/agents/share-optimization-specialist.md +551 -0
  251. package/one/things/claude/agents/sm.md +327 -0
  252. package/one/things/claude/agents/story-teller.md +473 -0
  253. package/one/things/claude/agents/task-master.md +596 -0
  254. package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
  255. package/one/things/claude/agents/tester.md +556 -0
  256. package/one/things/claude/agents/the-bull-character-manager.md +580 -0
  257. package/one/things/claude/agents/tools-playbook-generator.md +489 -0
  258. package/one/things/claude/agents/turbo-repo-builder.md +316 -0
  259. package/one/things/claude/agents/upsell-strategist.md +480 -0
  260. package/one/things/claude/agents/ux-expert.md +335 -0
  261. package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
  262. package/one/things/claude/claude-code-hooks-development.json +21 -0
  263. package/one/things/claude/claude-code-hooks-production.json +21 -0
  264. package/one/things/claude/claude-code-hooks.json +25 -0
  265. package/one/things/claude/commands/agent.md +104 -0
  266. package/one/things/claude/commands/cascade-status.md +128 -0
  267. package/one/things/claude/commands/ingest.md +290 -0
  268. package/one/things/claude/commands/ingestor.md +136 -0
  269. package/one/things/claude/commands/mission.md +83 -0
  270. package/one/things/claude/commands/npx.md +133 -0
  271. package/one/things/claude/commands/one.md +440 -0
  272. package/one/things/claude/commands/quality-check.md +204 -0
  273. package/one/things/claude/commands/smart-route.md +220 -0
  274. package/one/things/claude/commands/start.md +121 -0
  275. package/one/things/claude/commands/story.md +83 -0
  276. package/one/things/claude/commands/task.md +173 -0
  277. package/one/things/claude/hook-bypass.json +32 -0
  278. package/one/things/claude/hooks/agent-hook-config.json +427 -0
  279. package/one/things/claude/hooks/agent-hook-manager.js +525 -0
  280. package/one/things/claude/hooks/agent-load-balancer.js +271 -0
  281. package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
  282. package/one/things/claude/hooks/build-hook.sh +156 -0
  283. package/one/things/claude/hooks/cascade-feedback.js +297 -0
  284. package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
  285. package/one/things/claude/hooks/cleanup-hook.sh +201 -0
  286. package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
  287. package/one/things/claude/hooks/file-organization-engine.js +427 -0
  288. package/one/things/claude/hooks/file-organization-hook.sh +80 -0
  289. package/one/things/claude/hooks/file-organization-monitor.js +269 -0
  290. package/one/things/claude/hooks/format-hook.sh +43 -0
  291. package/one/things/claude/hooks/hook-bypass.sh +293 -0
  292. package/one/things/claude/hooks/hook-config-manager.js +202 -0
  293. package/one/things/claude/hooks/hook-debouncer.sh +62 -0
  294. package/one/things/claude/hooks/hook-logger.sh +89 -0
  295. package/one/things/claude/hooks/hook-orchestrator.js +662 -0
  296. package/one/things/claude/hooks/hook-performance-report.js +120 -0
  297. package/one/things/claude/hooks/lint-hook.sh +140 -0
  298. package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
  299. package/one/things/claude/hooks/memory-optimizer.js +510 -0
  300. package/one/things/claude/hooks/notification-hook.sh +204 -0
  301. package/one/things/claude/hooks/ontology-compliance.js +394 -0
  302. package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
  303. package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
  304. package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
  305. package/one/things/claude/hooks/performance-metrics.json +25 -0
  306. package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
  307. package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
  308. package/one/things/claude/hooks/security-hook.sh +256 -0
  309. package/one/things/claude/hooks/simple-load-balancer.js +238 -0
  310. package/one/things/claude/hooks/startup-optimizer.js +625 -0
  311. package/one/things/claude/hooks/story-scoring-system.js +445 -0
  312. package/one/things/claude/hooks/story-validation-engine.js +473 -0
  313. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
  314. package/one/things/claude/hooks/story-validation-hook.sh +145 -0
  315. package/one/things/claude/hooks/structure-synchronizer.js +194 -0
  316. package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
  317. package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
  318. package/one/things/claude/hooks/test-hook.sh +145 -0
  319. package/one/things/claude/hooks/test-story-validation.sh +170 -0
  320. package/one/things/claude/hooks/trinity-validation-system.js +392 -0
  321. package/one/things/claude/settings-local.json +86 -0
  322. package/one/things/cli-code.md +652 -0
  323. package/one/things/cli-compiler-code.md +652 -0
  324. package/one/things/cli.md +1045 -0
  325. package/one/things/components/card-shadcn.md +929 -0
  326. package/one/things/components/card.md +1050 -0
  327. package/one/things/components.md +1669 -0
  328. package/one/things/componets.md +4 -0
  329. package/one/things/copilotkit.md +1559 -0
  330. package/one/things/creator-diagram.md +166 -0
  331. package/one/things/examples/children/lemonade-stand.md +366 -0
  332. package/one/things/examples/enterprise/crm-saas.md +1429 -0
  333. package/one/things/features/1-1-agent-prompts/design.md +470 -0
  334. package/one/things/features/1-1-agent-prompts/tests.md +264 -0
  335. package/one/things/features/1-1-agent-prompts.md +486 -0
  336. package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
  337. package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
  338. package/one/things/features/1-2-yaml-orchestrator.md +516 -0
  339. package/one/things/features/1-3-event-coordination/design.md +544 -0
  340. package/one/things/features/1-3-event-coordination/tests.md +223 -0
  341. package/one/things/features/1-3-event-coordination.md +508 -0
  342. package/one/things/features/1-4-knowledge-management/design.md +609 -0
  343. package/one/things/features/1-4-knowledge-management/tests.md +195 -0
  344. package/one/things/features/1-4-knowledge-management.md +577 -0
  345. package/one/things/features/1-5-quality-loops/design.md +797 -0
  346. package/one/things/features/1-5-quality-loops/tests.md +212 -0
  347. package/one/things/features/1-5-quality-loops.md +641 -0
  348. package/one/things/features/1-6-numbering-structure/design.md +610 -0
  349. package/one/things/features/1-6-numbering-structure/tests.md +213 -0
  350. package/one/things/features/1-6-numbering-structure.md +575 -0
  351. package/one/things/features/2-cli.md +1235 -0
  352. package/one/things/features/use-one-backend.md +1180 -0
  353. package/one/things/ideas/1-create-workflow.md +189 -0
  354. package/one/things/plans/1-create-workflow-status.md +555 -0
  355. package/one/things/plans/1-create-workflow.md +713 -0
  356. package/one/things/plans/app.md +761 -0
  357. package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
  358. package/one/things/plans/better-auth-any-backend.md +1852 -0
  359. package/one/things/plans/better-auth-available-features.md +235 -0
  360. package/one/things/plans/big-plan.md +38 -0
  361. package/one/things/plans/convex-better-auth.md +1109 -0
  362. package/one/things/plans/convex-on-off.md +389 -0
  363. package/one/things/plans/desktop.md +1121 -0
  364. package/one/things/plans/effect-components.md +1669 -0
  365. package/one/things/plans/effect.md +973 -0
  366. package/one/things/plans/email.md +953 -0
  367. package/one/things/plans/enhance-auth.md +1669 -0
  368. package/one/things/plans/install-components.md +198 -0
  369. package/one/things/plans/landing.md +728 -0
  370. package/one/things/plans/layout.md +205 -0
  371. package/one/things/plans/mail-backend.md +1308 -0
  372. package/one/things/plans/mail.md +2624 -0
  373. package/one/things/plans/next-features.md +83 -0
  374. package/one/things/plans/one.md +658 -0
  375. package/one/things/plans/ontology-6-dimensions.md +2216 -0
  376. package/one/things/plans/ontology-driven-strategy.md +866 -0
  377. package/one/things/plans/ontology-ui-approach.md +357 -0
  378. package/one/things/plans/open-agent.md +785 -0
  379. package/one/things/plans/performace.md +90 -0
  380. package/one/things/plans/releases.md +809 -0
  381. package/one/things/plans/repos.md +76 -0
  382. package/one/things/plans/separate-copy-2.md +1293 -0
  383. package/one/things/plans/separate-copy-3.md +2458 -0
  384. package/one/things/plans/separate-copy.md +1293 -0
  385. package/one/things/plans/separate.md +1983 -0
  386. package/one/things/plans/shadcn-integration-summary.md +450 -0
  387. package/one/things/plans/sidebar.md +172 -0
  388. package/one/things/plans/small-fixes.md +5 -0
  389. package/one/things/plans/test-backend-connection.md +476 -0
  390. package/one/things/plans/workflow-files.md +1196 -0
  391. package/one/things/plans/workflow.md +1372 -0
  392. package/one/things/products/cascade-landing-page.md +737 -0
  393. package/one/things/products/cascade.md +1518 -0
  394. package/one/things/products/context-engineering.md +1427 -0
  395. package/one/things/products/onthology.md +0 -0
  396. package/one/things/products/ontology-ui-shadcn.md +1280 -0
  397. package/one/things/products/ontology-ui.md +1387 -0
  398. package/one/things/products/ontology.md +717 -0
  399. package/one/things/products/sdk.md +557 -0
  400. package/one/things/promptkit.md +903 -0
  401. package/one/things/service-providers-new.md +982 -0
  402. package/one/things/service-providers.md +1092 -0
  403. package/one/things/things.md +349 -0
  404. package/one/things/todo.md +1248 -0
  405. package/package.json +5 -2
@@ -0,0 +1,2216 @@
1
+ # Migration Plan: 4-Table Ontology → 6-Dimension Ontology
2
+
3
+ **Version:** 1.0.0
4
+ **Created:** 2025-10-10
5
+ **Status:** Planning
6
+ **Goal:** Transform ONE Platform from a 4-table ontology to a complete 6-dimension architecture that scales from children learning to build AI apps to enterprise platforms serving millions.
7
+
8
+ ---
9
+
10
+ ## Executive Summary
11
+
12
+ The ONE Platform currently uses a "4-table ontology" (Things, Connections, Events, Knowledge). This plan expands it to a **6-dimension ontology** that explicitly includes Organizations and People as first-class dimensions, creating a complete reality-aware architecture.
13
+
14
+ **Why This Matters:**
15
+
16
+ - **For Children:** "I own a lemonade stand (Organization), I'm the owner (Person), I sell lemonade (Things), customers buy it (Connections), sales happen (Events), and I learn what works (Knowledge)"
17
+ - **For Enterprises:** Multi-tenant SaaS platforms with clear ownership, governance, data isolation, and intelligence
18
+
19
+ **Key Changes:**
20
+
21
+ - `4 tables` → `6 dimensions`
22
+ - Explicit Organizations (multi-tenant isolation boundary)
23
+ - Explicit People (authorization & governance)
24
+ - Enhanced documentation throughout `/one/*`
25
+
26
+ ---
27
+
28
+ ## The Transformation
29
+
30
+ ### From: 4-Table Ontology
31
+
32
+ ```
33
+ ┌──────────────────────────────────────────────┐
34
+ │ THINGS │
35
+ │ Every "thing" - entities, agents, content │
36
+ └──────────────────────────────────────────────┘
37
+ ↓
38
+ ┌──────────────────────────────────────────────┐
39
+ │ CONNECTIONS │
40
+ │ Every relationship - owns, follows, etc. │
41
+ └──────────────────────────────────────────────┘
42
+ ↓
43
+ ┌──────────────────────────────────────────────┐
44
+ │ EVENTS │
45
+ │ Every action - purchased, created, etc. │
46
+ └──────────────────────────────────────────────┘
47
+ ↓
48
+ ┌──────────────────────────────────────────────┐
49
+ │ KNOWLEDGE │
50
+ │ Labels + vectors powering RAG & search │
51
+ └──────────────────────────────────────────────┘
52
+ ```
53
+
54
+ ### To: 6-Dimension Ontology
55
+
56
+ ```
57
+ ┌──────────────────────────────────────────────┐
58
+ │ 1. ORGANIZATIONS │
59
+ │ THE isolation boundary for multi-tenancy │
60
+ │ Who owns what at the org level │
61
+ └──────────────────────────────────────────────┘
62
+ ↓
63
+ ┌──────────────────────────────────────────────┐
64
+ │ 2. PEOPLE │
65
+ │ Who can do what (authorization) │
66
+ │ Platform owner, org owners, users │
67
+ └──────────────────────────────────────────────┘
68
+ ↓
69
+ ┌──────────────────────────────────────────────┐
70
+ │ 3. THINGS │
71
+ │ What exists - entities, agents, content │
72
+ │ Created within org context │
73
+ └──────────────────────────────────────────────┘
74
+ ↓
75
+ ┌──────────────────────────────────────────────┐
76
+ │ 4. CONNECTIONS │
77
+ │ How things relate - ownership, membership │
78
+ │ Scoped to organizations │
79
+ └──────────────────────────────────────────────┘
80
+ ↓
81
+ ┌──────────────────────────────────────────────┐
82
+ │ 5. EVENTS │
83
+ │ What happened - actions, state changes │
84
+ │ Actor (person) + target (thing) + time │
85
+ └──────────────────────────────────────────────┘
86
+ ↓
87
+ ┌──────────────────────────────────────────────┐
88
+ │ 6. KNOWLEDGE │
89
+ │ What it means - vectors, embeddings, RAG │
90
+ │ Intelligence layer for all dimensions │
91
+ └──────────────────────────────────────────────┘
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Phase 1: Documentation Search & Analysis
97
+
98
+ ### Step 1.1: Search for All "4-Table" References
99
+
100
+ **Files to Update (152+ occurrences found):**
101
+
102
+ **High Priority - Core Documentation:**
103
+
104
+ - ✅ `one/knowledge/ontology.md` (19 occurrences) - **PRIMARY SOURCE**
105
+ - ✅ `one/knowledge/ontology-documentation.md` (already shows 6 dimensions!)
106
+ - ✅ `one/connections/documentation.md` (5 occurrences)
107
+ - ✅ `one/knowledge/architecture.md` (7 occurrences)
108
+ - ✅ `one/knowledge/rules.md` (4 occurrences)
109
+ - ✅ `one/things/frontend.md` (1 occurrence)
110
+ - ✅ `one/things/hono.md` (4 occurrences)
111
+
112
+ **Medium Priority - Feature Documentation:**
113
+
114
+ - `one/connections/workflow.md` (8 occurrences)
115
+ - `one/connections/api.md` (5 occurrences)
116
+ - `one/connections/api-docs.md` (2 occurrences)
117
+ - `one/connections/multitenant.md` (4 occurrences)
118
+ - `one/connections/mcp.md` (6 occurrences)
119
+ - `one/connections/middleware.md` (1 occurrence)
120
+ - `one/connections/membership.md` (2 occurrences)
121
+ - `one/connections/kyc.md` (2 occurrences)
122
+ - `one/connections/protocols.md` (2 occurrences)
123
+ - `one/connections/communications.md` (2 occurrences)
124
+ - `one/connections/agui.md` (1 occurrence)
125
+ - `one/connections/acp.md` (1 occurrence)
126
+ - `one/connections/ap2.md` (1 occurrence)
127
+ - `one/connections/a2a.md` (1 occurrence)
128
+ - `one/connections/cryptonetworks.md` (1 occurrence)
129
+
130
+ **Medium Priority - Things Documentation:**
131
+
132
+ - `one/things/implementation-examples.md` (12 occurrences)
133
+ - `one/things/sui.md` (4 occurrences)
134
+ - `one/things/agentsales.md` (2 occurrences)
135
+ - `one/things/todo.md` (6 occurrences)
136
+ - `one/things/revenue.md` (1 occurrence)
137
+ - `one/things/vision.md` (1 occurrence)
138
+ - `one/things/ai-platform.md` (1 occurrence)
139
+
140
+ **Medium Priority - Agents:**
141
+
142
+ - `one/things/agents/director.md` (13 occurrences)
143
+ - `one/things/agents/agent-clean.md` (4 occurrences)
144
+ - `one/things/agents/agent-clone.md` (4 occurrences)
145
+
146
+ **Medium Priority - Workflows:**
147
+
148
+ - `one/things/workflows/tasks.md` (3 occurrences)
149
+
150
+ **Low Priority (Generated):**
151
+
152
+ - `one/repomix-output.md` (129 occurrences) - **REGENERATE AFTER ALL UPDATES**
153
+
154
+ ### Step 1.2: Search for Pattern References
155
+
156
+ **Pattern:** `(entities|things), connections, events, (tags|knowledge)`
157
+
158
+ **Files Using This Pattern:**
159
+
160
+ - All files above use variations of this pattern
161
+ - Focus on consistent replacement: "6 dimensions" or "six dimensions"
162
+ - Maintain backward compatibility in code (table names stay as `entities`, `connections`, `events`, `knowledge`)
163
+
164
+ ---
165
+
166
+ ## Phase 2: Core Documentation Updates
167
+
168
+ ### Step 2.1: Update Primary Ontology Specification
169
+
170
+ **File:** `one/knowledge/ontology.md`
171
+
172
+ **Changes:**
173
+
174
+ 1. **Title Section:**
175
+
176
+ ```markdown
177
+ # ONE Platform - Ontology Specification
178
+
179
+ **Version:** 2.0.0 (6-Dimension Architecture)
180
+ **Status:** Complete - Reality-Aware Architecture
181
+ **Design Principle:** This ontology models reality in six dimensions. All protocols map TO this ontology via metadata.
182
+ ```
183
+
184
+ 2. **Structure Section (lines 6-16):**
185
+
186
+ ```markdown
187
+ ## Structure
188
+
189
+ This ontology is organized into 6 dimension files:
190
+
191
+ 1. **[organisation.md](./organisation.md)** - Multi-tenant isolation & ownership
192
+ 2. **[people.md](./people.md)** - Authorization, governance, & user customization
193
+ 3. **[things.md](./things.md)** - 66 entity types (what exists)
194
+ 4. **[connections.md](./connections.md)** - 25 relationship types (how they relate)
195
+ 5. **[events.md](./events.md)** - 67 event types (what happened)
196
+ 6. **[knowledge.md](./knowledge.md)** - Vectors, embeddings, RAG (what it means)
197
+ ```
198
+
199
+ 3. **Replace "4-Table Universe" (lines 19-49) with "6-Dimension Reality Model":**
200
+
201
+ ```markdown
202
+ ## The 6-Dimension Reality Model
203
+
204
+ Every single thing in ONE platform exists within one of these 6 dimensions:
205
+ ```
206
+
207
+ ┌──────────────────────────────────────────────────────────────┐
208
+ │ 1. ORGANIZATIONS │
209
+ │ Multi-tenant isolation boundary - who owns what at org level │
210
+ └──────────────────────────────────────────────────────────────┘
211
+ ↓
212
+ ┌──────────────────────────────────────────────────────────────┐
213
+ │ 2. PEOPLE │
214
+ │ Authorization & governance - platform owner, org owners │
215
+ └──────────────────────────────────────────────────────────────┘
216
+ ↓
217
+ ┌──────────────────────────────────────────────────────────────┐
218
+ │ 3. THINGS │
219
+ │ Every "thing" - users, agents, content, tokens, courses │
220
+ └──────────────────────────────────────────────────────────────┘
221
+ ↓
222
+ ┌──────────────────────────────────────────────────────────────┐
223
+ │ 4. CONNECTIONS │
224
+ │ Every relationship - owns, follows, taught_by, powers │
225
+ └──────────────────────────────────────────────────────────────┘
226
+ ↓
227
+ ┌──────────────────────────────────────────────────────────────┐
228
+ │ 5. EVENTS │
229
+ │ Every action - purchased, created, viewed, completed │
230
+ └──────────────────────────────────────────────────────────────┘
231
+ ↓
232
+ ┌──────────────────────────────────────────────────────────────┐
233
+ │ 6. KNOWLEDGE │
234
+ │ Labels + chunks + vectors powering RAG & search │
235
+ └──────────────────────────────────────────────────────────────┘
236
+
237
+ ```
238
+
239
+ **Golden Rule:** If you can't map your feature to these 6 dimensions, you're thinking about it wrong.
240
+
241
+ **Simplicity:** ONE is six dimensions — organizations partition, people authorize, things exist, connections relate, events record, and knowledge understands. Everything composes from these building blocks.
242
+ ```
243
+
244
+ 4. **Update "Simplicity" statement (line 47):**
245
+
246
+ ```markdown
247
+ Simplicity: ONE is six dimensions — organizations partition, people authorize, things exist, connections relate, events record, and knowledge understands. Everything composes from these building blocks.
248
+ ```
249
+
250
+ 5. **Add Organizations & People Sections** (after line 49, before KNOWLEDGE section):
251
+
252
+ ````markdown
253
+ ---
254
+
255
+ ## ORGANIZATIONS: The Isolation Boundary
256
+
257
+ Purpose: Partition the system for multi-tenant scale. Every organization owns its own graph of things, connections, events, and knowledge.
258
+
259
+ ### Organization Structure
260
+
261
+ ```typescript
262
+ {
263
+ _id: Id<'organizations'>,
264
+ name: string,
265
+ slug: string, // URL-friendly identifier
266
+ domain?: string, // Custom domain
267
+ status: 'active' | 'suspended' | 'trial' | 'cancelled',
268
+ plan: 'starter' | 'pro' | 'enterprise',
269
+
270
+ limits: {
271
+ users: number,
272
+ storage: number, // GB
273
+ apiCalls: number,
274
+ inference: number, // Monthly LLM calls
275
+ },
276
+
277
+ usage: {
278
+ users: number,
279
+ storage: number,
280
+ apiCalls: number,
281
+ inference: number,
282
+ },
283
+
284
+ billing: {
285
+ customerId?: string, // Stripe customer
286
+ subscriptionId?: string,
287
+ },
288
+
289
+ settings: {
290
+ allowSignups: boolean,
291
+ requireEmailVerification: boolean,
292
+ enableTwoFactor: boolean,
293
+ },
294
+
295
+ createdAt: number,
296
+ updatedAt: number,
297
+ trialEndsAt?: number,
298
+ }
299
+ ```
300
+ ````
301
+
302
+ ### Why Organizations Matter
303
+
304
+ 1. **Multi-Tenant Isolation:** Each org's data is completely separate
305
+ 2. **Resource Quotas:** Control costs and usage per organization
306
+ 3. **Custom Branding:** Each org can have unique frontend/domain
307
+ 4. **Billing Flexibility:** Per-org subscriptions and revenue sharing
308
+
309
+ ***
310
+
311
+ ## PEOPLE: Authorization & Governance
312
+
313
+ Purpose: Define who can do what. People direct organizations, customize AI agents, and govern access.
314
+
315
+ ### Person Structure
316
+
317
+ ```typescript
318
+ {
319
+ _id: Id<'people'>,
320
+ email: string,
321
+ username: string,
322
+ displayName: string,
323
+
324
+ // CRITICAL: Role determines access level
325
+ role: 'platform_owner' | 'org_owner' | 'org_user' | 'customer',
326
+
327
+ // Organization context
328
+ organizationId?: Id<'organizations'>, // Current/default org
329
+ permissions?: string[],
330
+
331
+ // Profile
332
+ bio?: string,
333
+ avatar?: string,
334
+
335
+ // Multi-tenant tracking
336
+ organizations: Id<'organizations'>[], // All orgs this person belongs to
337
+
338
+ createdAt: number,
339
+ updatedAt: number,
340
+ }
341
+ ```
342
+
343
+ ### Four Roles
344
+
345
+ 1. **Platform Owner** (Anthony)
346
+
347
+ - Owns the ONE Platform
348
+ - 100% revenue from platform-level services
349
+ - Can access all organizations (support/debugging)
350
+ - Creates new organizations
351
+
352
+ 2. **Org Owner**
353
+
354
+ - Owns/manages one or more organizations
355
+ - Controls users, permissions, billing within org
356
+ - Customizes AI agents and frontend
357
+ - Revenue sharing with platform
358
+
359
+ 3. **Org User**
360
+
361
+ - Works within an organization
362
+ - Limited permissions (defined by org owner)
363
+ - Can create content, run agents (within quotas)
364
+
365
+ 4. **Customer**
366
+ - External user consuming content
367
+ - Purchases tokens, enrolls in courses
368
+ - No admin access
369
+
370
+ ### Why People Matter
371
+
372
+ 1. **Authorization:** Every action must have an actor (person)
373
+ 2. **Governance:** Org owners control who can do what
374
+ 3. **Audit Trail:** Events log who did what when
375
+ 4. **Customization:** People teach AI agents their preferences
376
+
377
+ ***
378
+
379
+ ```
380
+
381
+ ```
382
+
383
+ 6. **Update all remaining "4 tables" references throughout the file to "6 dimensions"**
384
+
385
+ 7. **Update Philosophy Section (lines 2150-2193):**
386
+
387
+ ```markdown
388
+ ## The Philosophy
389
+
390
+ **Simplicity is the ultimate sophistication.**
391
+
392
+ This ontology proves that you don't need hundreds of tables or complex schemas to build a complete AI-native platform. You need:
393
+
394
+ 1. **6 dimensions** (organizations, people, things, connections, events, knowledge)
395
+ 2. **66 thing types** (every "thing")
396
+ 3. **25 connection types** (every relationship)
397
+ 4. **67 event types** (every action)
398
+ 5. **Metadata** (for protocol identity via metadata.protocol)
399
+
400
+ That's it. Everything else is just data.
401
+
402
+ ### Why This Works
403
+
404
+ **Other systems:**
405
+
406
+ - Create new tables for every feature
407
+ - Add protocol-specific columns
408
+ - Pollute schema with temporary concepts
409
+ - End up with 50+ tables, 200+ columns
410
+ - Become unmaintainable nightmares
411
+
412
+ **ONE's approach:**
413
+
414
+ - Map every feature to 6 dimensions
415
+ - Organizations partition the space
416
+ - People authorize and govern
417
+ - Things, connections, events flow from there
418
+ - Knowledge understands it all
419
+ - Scale infinitely without schema changes
420
+ - Stay simple, clean, beautiful
421
+
422
+ ### The Result
423
+
424
+ A database schema that:
425
+
426
+ - Scales from lemonade stands to global enterprises
427
+ - Children can understand: "I own (org), I'm the boss (person), I sell lemonade (things)"
428
+ - Enterprises can rely on: Multi-tenant isolation, clear governance, infinite scale
429
+ - AI agents can reason about completely
430
+ - Never needs breaking changes
431
+ - Grows more powerful as it grows larger
432
+
433
+ **This is what happens when you design for clarity first.**
434
+ ```
435
+
436
+ 8. **Update Summary Statistics (lines 2091-2145):**
437
+
438
+ ```markdown
439
+ ## Summary Statistics
440
+
441
+ **Dimensions:** 6 total (organizations, people, things, connections, events, knowledge)
442
+
443
+ **Thing Types:** 66 total
444
+
445
+ - Core: 4 (creator, ai_clone, audience_member, organization)
446
+ - Business Agents: 10
447
+ - Content: 7
448
+ - Products: 4
449
+ - Community: 3
450
+ - Token: 2
451
+ - Knowledge: 2
452
+ - Platform: 6
453
+ - Business: 7
454
+ - Authentication & Session: 5
455
+ - Marketing: 6
456
+ - External: 3
457
+ - Protocol: 2
458
+
459
+ **Connection Types:** 25 total (Hybrid approach)
460
+
461
+ - 18 specific semantic types
462
+ - 7 consolidated types with metadata variants
463
+ - Protocol-agnostic via metadata.protocol
464
+ - Includes organization membership with role-based metadata
465
+
466
+ **Event Types:** 67 total (Hybrid approach)
467
+
468
+ - 4 Thing lifecycle
469
+ - 5 User events
470
+ - 6 Authentication events
471
+ - 5 Organization events
472
+ - 4 Dashboard & UI events
473
+ - 4 AI/Clone events
474
+ - 4 Agent events
475
+ - 7 Token events
476
+ - 5 Course events
477
+ - 5 Analytics events
478
+ - 7 Inference events
479
+ - 5 Blockchain events
480
+ - 11 consolidated types with metadata variants
481
+
482
+ **Design Benefits:**
483
+
484
+ - ✅ Six-dimension reality model
485
+ - ✅ Multi-tenant by design
486
+ - ✅ Clear ownership & governance
487
+ - ✅ Protocol-agnostic core
488
+ - ✅ Infinite protocol extensibility
489
+ - ✅ Cross-protocol analytics
490
+ - ✅ Type-safe
491
+ - ✅ Future-proof
492
+ - ✅ Scales from children to enterprise
493
+ ```
494
+
495
+ ### Step 2.2: Update Ontology Documentation Index
496
+
497
+ **File:** `one/knowledge/ontology-documentation.md`
498
+
499
+ **Changes:**
500
+
501
+ 1. Line 3: Update version
502
+
503
+ ```markdown
504
+ **Version 1.0 - 6-Dimension Architecture**
505
+ ```
506
+
507
+ 2. Lines 115-122: Update from "Four Primitives" to "Six Dimensions"
508
+
509
+ ```markdown
510
+ ### 1. Six Dimensions
511
+
512
+ Everything in ONE exists in one of 6 dimensions:
513
+
514
+ - **organizations** - multi-tenant isolation (ownership partitioning)
515
+ - **people** - authorization & governance (who can do what)
516
+ - **things** - entities (66 types)
517
+ - **connections** - relationships (25 types)
518
+ - **events** - actions (67 types)
519
+ - **knowledge** - vectors + labels (4 types)
520
+ ```
521
+
522
+ 3. Line 161: Update the loop description
523
+
524
+ ```markdown
525
+ ## The Loop
526
+ ```
527
+
528
+ ┌─────────────────────────────────────────────────┐
529
+ │ 1. Organization Scope │
530
+ │ Define the context for all operations │
531
+ └──────────────────┬──────────────────────────────┘
532
+ ↓
533
+ ┌─────────────────────────────────────────────────┐
534
+ │ 2. Person Authorization │
535
+ │ Check permissions & role │
536
+ └──────────────────┬──────────────────────────────┘
537
+ ↓
538
+ ┌─────────────────────────────────────────────────┐
539
+ │ 3. User Request │
540
+ │ "Create a fitness course" │
541
+ └──────────────────┬──────────────────────────────┘
542
+ ↓
543
+ ┌─────────────────────────────────────────────────┐
544
+ │ 4. Vector Search (Knowledge) │
545
+ │ Find relevant chunks + labels │
546
+ └──────────────────┬──────────────────────────────┘
547
+ ↓
548
+ ┌─────────────────────────────────────────────────┐
549
+ │ 5. RAG Context Assembly │
550
+ │ Crawls using vectors and ontology → Context │
551
+ └──────────────────┬──────────────────────────────┘
552
+ ↓
553
+ ┌─────────────────────────────────────────────────┐
554
+ │ 6. LLM Generation │
555
+ │ Context + Prompt → Generated content │
556
+ └──────────────────┬──────────────────────────────┘
557
+ ↓
558
+ ┌─────────────────────────────────────────────────┐
559
+ │ 7. Create Thing + Connections + Events │
560
+ │ Course entity + ownership + logs │
561
+ └──────────────────┬──────────────────────────────┘
562
+ ↓
563
+ ┌─────────────────────────────────────────────────┐
564
+ │ 8. Embed New Content (Knowledge) │
565
+ │ Course → chunks → embeddings │
566
+ └─────────────────────────────────────────────────┘
567
+
568
+ ```
569
+
570
+ Knowledge makes generation **context-aware**, organizations make it **multi-tenant**, and people make it **governed**.
571
+ ```
572
+
573
+ 4. Lines 198-207: Update design philosophy
574
+
575
+ ```markdown
576
+ ## Design Philosophy
577
+
578
+ **Simplicity is the ultimate sophistication.**
579
+
580
+ - **6 dimensions** (not 50+ tables)
581
+ - **Organizations** partition the space
582
+ - **People** authorize and govern
583
+ - **66 thing types** (covers everything)
584
+ - **25 connection types** (all relationships)
585
+ - **67 event types** (complete tracking)
586
+ - **Metadata for variance** (not enum explosion)
587
+ - **Protocol-agnostic core** (infinite extensibility)
588
+
589
+ This ontology proves you don't need complexity to build a complete AI-native platform that scales from children's lemonade stands to global enterprises.
590
+ ```
591
+
592
+ ### Step 2.3: Update Architecture Documentation
593
+
594
+ **File:** `one/knowledge/architecture.md`
595
+
596
+ **Changes:**
597
+
598
+ 1. Lines 58-66: Update ontology reference in Layer 3
599
+
600
+ ```markdown
601
+ │ LAYER 3: BACKEND (Hono + Convex) │
602
+ │ Documentation: docs/Hono.md │
603
+ ├─────────────────────────────────────────────────────────────────────┤
604
+ │ ✅ Hono: REST API routes (Cloudflare Workers) │
605
+ │ ✅ Convex: Real-time database + typed functions │
606
+ │ ✅ Better Auth: Authentication with Convex adapter │
607
+ │ ✅ 6-Dimension Ontology: Reality-aware data model │
608
+ │ │
609
+ │ Hono API Routes Convex Functions 6-Dimension Ontology │
610
+ │ ├─ /api/auth/_ ├─ Queries (reads) ├─ organizations │
611
+ │ ├─ /api/tokens/_ ├─ Mutations (writes) ├─ people │
612
+ │ ├─ /api/agents/_ ├─ Actions (external) ├─ things (entities) │
613
+ │ └─ /api/content/_ └─ Real-time subs ├─ connections │
614
+ │ ├─ events │
615
+ │ └─ knowledge │
616
+ └─────────────────────────────────────────────────────────────────────┘
617
+ ```
618
+
619
+ 2. Lines 519-583: Update Layer 5 section
620
+
621
+ ````markdown
622
+ ### Layer 5: Data Layer (6-Dimension Ontology - Plain Convex)
623
+
624
+ All data maps to 6 dimensions using **plain Convex schema** (no Convex Ents):
625
+
626
+ **Core Tables:**
627
+
628
+ - **organizations** - Multi-tenant partitioning
629
+ - **people** - Authorization & governance (maps to creator/owner/user things)
630
+ - **things (entities)** - All entities (66 types)
631
+ - **connections** - All relationships (25 types)
632
+ - **events** - All actions (67 types)
633
+ - **knowledge** - All labels + vectors
634
+
635
+ **Schema Implementation:**
636
+
637
+ ```typescript
638
+ // Plain Convex schema - NO Convex Ents
639
+ import { defineSchema, defineTable } from "convex/server";
640
+ import { v } from "convex/values";
641
+
642
+ export default defineSchema({
643
+ organizations: defineTable({
644
+ name: v.string(),
645
+ slug: v.string(),
646
+ status: v.string(),
647
+ plan: v.string(),
648
+ limits: v.any(),
649
+ usage: v.any(),
650
+ billing: v.any(),
651
+ settings: v.any(),
652
+ createdAt: v.number(),
653
+ updatedAt: v.number(),
654
+ })
655
+ .index("by_slug", ["slug"])
656
+ .index("by_status", ["status"]),
657
+
658
+ // People are represented as 'creator' things with role metadata
659
+ // See things table for implementation
660
+
661
+ things: defineTable({
662
+ // Formerly "entities"
663
+ thingType: v.string(),
664
+ name: v.string(),
665
+ organizationId: v.id("organizations"), // NEW: Every thing belongs to an org
666
+ description: v.optional(v.string()),
667
+ properties: v.any(),
668
+ status: v.string(),
669
+ createdAt: v.number(),
670
+ updatedAt: v.number(),
671
+ })
672
+ .index("by_type", ["thingType"])
673
+ .index("by_org", ["organizationId"]) // NEW: Query things by org
674
+ .index("by_org_type", ["organizationId", "thingType"])
675
+ .searchIndex("search_things", {
676
+ searchField: "name",
677
+ filterFields: ["thingType", "organizationId"],
678
+ }),
679
+
680
+ connections: defineTable({
681
+ fromThingId: v.id("things"),
682
+ toThingId: v.id("things"),
683
+ relationshipType: v.string(),
684
+ organizationId: v.id("organizations"), // NEW: Connections scoped to org
685
+ metadata: v.any(),
686
+ createdAt: v.number(),
687
+ })
688
+ .index("by_from", ["fromThingId"])
689
+ .index("by_to", ["toThingId"])
690
+ .index("by_org", ["organizationId"]) // NEW: Query connections by org
691
+ .index("by_relationship", ["relationshipType"]),
692
+
693
+ events: defineTable({
694
+ thingId: v.optional(v.id("things")),
695
+ eventType: v.string(),
696
+ actorId: v.id("things"), // REQUIRED: Actor is always a person (thing with role)
697
+ organizationId: v.id("organizations"), // NEW: Events scoped to org
698
+ metadata: v.any(),
699
+ timestamp: v.number(),
700
+ })
701
+ .index("by_thing", ["thingId"])
702
+ .index("by_actor", ["actorId"]) // NEW: Query by who did it
703
+ .index("by_org", ["organizationId"]) // NEW: Query events by org
704
+ .index("by_type", ["eventType"])
705
+ .index("by_timestamp", ["timestamp"]),
706
+
707
+ knowledge: defineTable({
708
+ knowledgeType: v.string(),
709
+ text: v.optional(v.string()),
710
+ embedding: v.optional(v.array(v.number())),
711
+ embeddingModel: v.optional(v.string()),
712
+ embeddingDim: v.optional(v.number()),
713
+ sourceThingId: v.optional(v.id("things")),
714
+ sourceField: v.optional(v.string()),
715
+ organizationId: v.id("organizations"), // NEW: Knowledge scoped to org
716
+ chunk: v.optional(v.any()),
717
+ labels: v.optional(v.array(v.string())),
718
+ metadata: v.optional(v.any()),
719
+ createdAt: v.number(),
720
+ updatedAt: v.number(),
721
+ })
722
+ .index("by_type", ["knowledgeType"])
723
+ .index("by_source", ["sourceThingId"])
724
+ .index("by_org", ["organizationId"]) // NEW: Query knowledge by org
725
+ .index("by_created", ["createdAt"]),
726
+ });
727
+ ```
728
+ ````
729
+
730
+ **Key Design Principles:**
731
+
732
+ - Organizations partition ALL data (perfect multi-tenant isolation)
733
+ - People are represented as things with `role` property (platform_owner, org_owner, org_user, customer)
734
+ - Every thing, connection, event, and knowledge item is scoped to an organization
735
+ - No ORM layer (Convex Ents) - direct database access
736
+ - Flexible metadata fields for type-specific data
737
+ - Comprehensive indexing for query performance (including org-scoped indexes)
738
+
739
+ ```
740
+
741
+ ```
742
+
743
+ 3. Lines 1501-1563: Update "Key Architectural Decisions Summary"
744
+
745
+ ```markdown
746
+ ## Key Architectural Decisions Summary
747
+
748
+ ### 1. Plain Convex Schema with 6-Dimension Ontology
749
+
750
+ **Decision:** Use plain Convex `defineSchema` with 6 dimensions (organizations, people, things, connections, events, knowledge)
751
+ **Rationale:**
752
+
753
+ - Simpler mental model for AI agents
754
+ - Organizations provide perfect multi-tenant isolation
755
+ - People represented as things with role metadata (no duplicate tables)
756
+ - No ORM abstraction layer to learn
757
+ - Direct control over indexes and queries
758
+ - Every dimension scoped to organization
759
+ - Scales from children's apps to enterprise SaaS
760
+
761
+ ### 2. Organizations as First-Class Dimension
762
+
763
+ **Decision:** Every resource (thing, connection, event, knowledge) belongs to an organization
764
+ **Rationale:**
765
+
766
+ - Perfect data isolation for multi-tenancy
767
+ - Clear ownership boundaries
768
+ - Independent billing and quotas per org
769
+ - Custom frontends per org
770
+ - Platform-level services (shared infrastructure)
771
+
772
+ ### 3. People as Authorization Layer
773
+
774
+ **Decision:** People are things with role property (platform_owner, org_owner, org_user, customer)
775
+ **Rationale:**
776
+
777
+ - Every action has an actor (person)
778
+ - Clear permission hierarchy
779
+ - Roles define what actions are allowed
780
+ - Org owners control their users
781
+ - Platform owner can access everything (support/debugging)
782
+
783
+ ### 4. Multi-Chain Blockchain Architecture
784
+
785
+ **Decision:** Separate Effect.ts provider per blockchain (Sui, Base, Solana)
786
+ **Rationale:**
787
+
788
+ - Each chain has unique APIs and transaction models
789
+ - Type safety per chain (unique error types)
790
+ - Easy to add new chains without modifying existing code
791
+ - Users can choose preferred blockchain per token/NFT
792
+ - Chain-specific retry strategies and error handling
793
+
794
+ ### 5. Stripe for FIAT Only
795
+
796
+ **Decision:** Stripe handles USD/EUR/etc payments only, NOT crypto
797
+ **Rationale:**
798
+
799
+ - Clear separation of concerns (fiat vs crypto)
800
+ - Blockchain providers handle all crypto transactions
801
+ - Prevents confusion about payment routing
802
+ - Simpler error handling (payment method determines provider)
803
+
804
+ ### 6. Effect.ts 100% Coverage
805
+
806
+ **Decision:** ALL business logic uses Effect.ts (no raw async/await)
807
+ **Rationale:**
808
+
809
+ - Consistent patterns across entire codebase
810
+ - Typed errors everywhere (no try/catch)
811
+ - Automatic dependency injection
812
+ - Built-in retry, timeout, resource management
813
+ - AI generates consistent code every time
814
+
815
+ ### 7. 6-Dimension Ontology (Organizations + People + 4 Core Dimensions)
816
+
817
+ **Decision:** Expand from 4 tables to 6 dimensions
818
+ **Rationale:**
819
+
820
+ - Organizations: Multi-tenant isolation boundary
821
+ - People: Authorization and governance
822
+ - Things: 66 entity types (what exists)
823
+ - Connections: 25 relationship types (how they relate)
824
+ - Events: 67 event types (what happened)
825
+ - Knowledge: Vectors + labels (what it means)
826
+ - Simple enough for children, powerful enough for enterprises
827
+ - AI agents can reason about complete reality model
828
+ ```
829
+
830
+ 4. Line 1688: Update key reminders
831
+
832
+ ```markdown
833
+ **Key Reminders:**
834
+
835
+ - **Frontend Layer:** Astro + React, content collections, Convex hooks + Hono API client
836
+ - **Glue Layer:** Effect.ts services (100% coverage), typed errors, DI
837
+ - **Backend Layer:** Hono API routes, Convex database (6-dimension ontology), Better Auth
838
+ - **6 Dimensions:** Organizations partition, People authorize, Things exist, Connections relate, Events record, Knowledge understands
839
+ - Stripe = fiat only (NOT crypto)
840
+ - Cloudflare = livestreaming only (NOT web hosting)
841
+ - Plain Convex schema (NO Convex Ents)
842
+ - Multi-chain providers (separate services per blockchain)
843
+ - 25 connection types + 67 event types (optimized, generic)
844
+ ```
845
+
846
+ ---
847
+
848
+ ## Phase 3: Systematic Documentation Updates
849
+
850
+ ### Step 3.1: Workflow & Process Documentation
851
+
852
+ **Files to Update:**
853
+
854
+ 1. `one/connections/workflow.md`
855
+
856
+ - Line 12: Update golden rule from "4 tables" to "6 dimensions"
857
+ - Line 42: Update reference to "6-dimension universe"
858
+ - Line 84: Map features to 6 dimensions
859
+ - Line 190: Checklist item "fits in 6 dimensions"
860
+ - Line 751: Understanding the 6-dimension model
861
+
862
+ 2. `one/connections/api.md`
863
+
864
+ - Line 1244: Section header "6-Dimension Ontology"
865
+ - Line 1246: Description of 6 dimensions
866
+ - Line 1270: Golden rule update
867
+ - Line 1774: Feature mapping to 6 dimensions
868
+ - Line 2049: Migration guide title
869
+
870
+ 3. `one/connections/api-docs.md`
871
+ - Line 39: Database description
872
+ - Line 1889: Ontology specification reference
873
+
874
+ ### Step 3.2: Integration Documentation
875
+
876
+ **Files to Update:**
877
+
878
+ 1. `one/connections/mcp.md`
879
+
880
+ - Title line 4: "6-dimension ontology"
881
+ - Line 12: Description
882
+ - Line 22: MCP server exposure
883
+ - Line 31: Section "The 6-Dimension Universe"
884
+ - Line 663: Description in JSON
885
+ - Line 778: Access list
886
+
887
+ 2. `one/connections/multitenant.md`
888
+
889
+ - Line 5: Architecture leverages 6-dimension ontology
890
+ - Line 49: Section header
891
+ - Line 1341: Result description
892
+
893
+ 3. `one/connections/middleware.md`
894
+
895
+ - Line 32: Database comment
896
+
897
+ 4. `one/connections/membership.md`
898
+
899
+ - Line 132: Section header
900
+ - Line 1149: Reference link
901
+
902
+ 5. `one/connections/kyc.md`
903
+
904
+ - Line 5: Purpose statement
905
+ - Line 632: Reference link
906
+
907
+ 6. `one/connections/protocols.md`
908
+
909
+ - Line 37: "Our 6-dimension ontology"
910
+ - Line 230: Implementation checklist
911
+
912
+ 7. `one/connections/communications.md`
913
+ - Line 338: Storage reference
914
+ - Line 444: Ontology-driven design
915
+
916
+ ### Step 3.3: Protocol Documentation
917
+
918
+ **Files to Update (all protocol docs):**
919
+
920
+ 1. `one/connections/agui.md` - Line 432
921
+ 2. `one/connections/acp.md` - Line 450
922
+ 3. `one/connections/ap2.md` - Line 243
923
+ 4. `one/connections/a2a.md` - Line 317
924
+ 5. `one/connections/cryptonetworks.md` - Line 766
925
+
926
+ **Pattern:** Replace "4-table ontology" → "6-dimension ontology" in all mapping sections
927
+
928
+ ### Step 3.4: Things Documentation
929
+
930
+ **Files to Update:**
931
+
932
+ 1. `one/things/implementation-examples.md`
933
+
934
+ - Lines 10, 18, 35, 62, 63, 86, 92, 116, 522, 1113: All "4 table" → "6 dimension"
935
+
936
+ 2. `one/things/sui.md`
937
+
938
+ - Line 5, 17, 958: SUI Move mapping to 6 dimensions
939
+
940
+ 3. `one/things/agentsales.md`
941
+
942
+ - Line 13, 967: Sales agents with 6-dimension ontology
943
+
944
+ 4. `one/things/frontend.md`
945
+
946
+ - Line 829: Integration section
947
+
948
+ 5. `one/things/hono.md`
949
+
950
+ - Lines 73, 97, 406, 1923, 2098: Hono + 6-dimension integration
951
+
952
+ 6. `one/things/todo.md`
953
+
954
+ - Lines 100, 174, 481, 898, 1031: Todo list updates
955
+
956
+ 7. `one/things/revenue.md`
957
+
958
+ - Line 520: Design composition
959
+
960
+ 8. `one/knowledge/rules.md`
961
+
962
+ - Lines 22, 380, 575: Platform rules
963
+
964
+ 9. `one/things/vision.md`
965
+
966
+ - Line 15: Vision statement
967
+
968
+ 10. `one/things/ai-platform.md`
969
+ - Line 3: AI modeling follows ontology
970
+
971
+ ### Step 3.5: Agent Documentation
972
+
973
+ **Files to Update:**
974
+
975
+ 1. `one/things/agents/director.md`
976
+
977
+ - Lines 69, 82, 91, 105, 200, 379, 440, 648, 722, 1092, 1108: Director agent understanding
978
+
979
+ 2. `one/things/agents/agent-clean.md`
980
+
981
+ - Lines 14, 47, 65: Cleanup agent ontology checks
982
+
983
+ 3. `one/things/agents/agent-clone.md`
984
+ - Lines 16, 68, 840, 858: Clone agent migration
985
+
986
+ ### Step 3.6: Workflow Documentation
987
+
988
+ **Files to Update:**
989
+
990
+ 1. `one/things/workflows/tasks.md`
991
+ - Lines 4, 12: Task management with 6-dimension ontology
992
+
993
+ ---
994
+
995
+ ## Phase 4: Implementation & Testing
996
+
997
+ ### Step 4.1: Database Migration (CRITICAL - No Breaking Changes)
998
+
999
+ **IMPORTANT:** The database schema does NOT change. We only add organization scoping and people representation.
1000
+
1001
+ **Migration Steps:**
1002
+
1003
+ 1. **Add `organizations` table:**
1004
+
1005
+ ```typescript
1006
+ // Already exists in schema - just verify indexes
1007
+ organizations: defineTable({
1008
+ name: v.string(),
1009
+ slug: v.string(),
1010
+ status: v.string(),
1011
+ plan: v.string(),
1012
+ limits: v.any(),
1013
+ usage: v.any(),
1014
+ billing: v.any(),
1015
+ settings: v.any(),
1016
+ createdAt: v.number(),
1017
+ updatedAt: v.number(),
1018
+ })
1019
+ .index("by_slug", ["slug"])
1020
+ .index("by_status", ["status"]);
1021
+ ```
1022
+
1023
+ 2. **Add `organizationId` to `things` table:**
1024
+
1025
+ ```typescript
1026
+ // Migration: Add organizationId to all existing things
1027
+ // Default: Create a "default" organization for existing data
1028
+
1029
+ const defaultOrg = await ctx.db.insert("organizations", {
1030
+ name: "Default Organization",
1031
+ slug: "default",
1032
+ status: "active",
1033
+ plan: "enterprise",
1034
+ limits: {
1035
+ users: 1000,
1036
+ storage: 1000,
1037
+ apiCalls: 1000000,
1038
+ inference: 1000000,
1039
+ },
1040
+ usage: { users: 0, storage: 0, apiCalls: 0, inference: 0 },
1041
+ billing: {},
1042
+ settings: {
1043
+ allowSignups: true,
1044
+ requireEmailVerification: false,
1045
+ enableTwoFactor: false,
1046
+ },
1047
+ createdAt: Date.now(),
1048
+ updatedAt: Date.now(),
1049
+ });
1050
+
1051
+ // Update all existing things
1052
+ const allThings = await ctx.db.query("things").collect();
1053
+ for (const thing of allThings) {
1054
+ await ctx.db.patch(thing._id, {
1055
+ organizationId: defaultOrg,
1056
+ });
1057
+ }
1058
+ ```
1059
+
1060
+ 3. **Add `organizationId` to `connections`, `events`, `knowledge` tables:**
1061
+
1062
+ ```typescript
1063
+ // Same migration pattern as things
1064
+ // All existing data goes to "default" organization
1065
+ ```
1066
+
1067
+ 4. **Verify indexes:**
1068
+
1069
+ ```typescript
1070
+ // Add new indexes for org-scoped queries
1071
+ things:
1072
+ .index("by_org", ["organizationId"])
1073
+ .index("by_org_type", ["organizationId", "thingType"])
1074
+
1075
+ connections:
1076
+ .index("by_org", ["organizationId"])
1077
+
1078
+ events:
1079
+ .index("by_org", ["organizationId"])
1080
+ .index("by_actor", ["actorId"])
1081
+
1082
+ knowledge:
1083
+ .index("by_org", ["organizationId"])
1084
+ ```
1085
+
1086
+ 5. **People representation:**
1087
+
1088
+ ```typescript
1089
+ // People are things with type 'creator' and role property
1090
+ // No separate table needed
1091
+
1092
+ interface PersonThing {
1093
+ thingType: "creator";
1094
+ properties: {
1095
+ email: string;
1096
+ username: string;
1097
+ role: "platform_owner" | "org_owner" | "org_user" | "customer";
1098
+ organizationId?: Id<"organizations">;
1099
+ permissions?: string[];
1100
+ // ... other creator properties
1101
+ };
1102
+ }
1103
+ ```
1104
+
1105
+ ### Step 4.2: Query Pattern Updates
1106
+
1107
+ **Old Pattern (4-table):**
1108
+
1109
+ ```typescript
1110
+ // Get all blog posts
1111
+ const posts = await ctx.db
1112
+ .query("things")
1113
+ .withIndex("by_type", (q) => q.eq("thingType", "blog_post"))
1114
+ .collect();
1115
+ ```
1116
+
1117
+ **New Pattern (6-dimension):**
1118
+
1119
+ ```typescript
1120
+ // Get all blog posts in organization
1121
+ const posts = await ctx.db
1122
+ .query("things")
1123
+ .withIndex("by_org_type", (q) =>
1124
+ q.eq("organizationId", orgId).eq("thingType", "blog_post")
1125
+ )
1126
+ .collect();
1127
+ ```
1128
+
1129
+ **Update All Queries:**
1130
+
1131
+ 1. Search for `.query("things")` → Add org filter
1132
+ 2. Search for `.query("connections")` → Add org filter
1133
+ 3. Search for `.query("events")` → Add org filter
1134
+ 4. Search for `.query("knowledge")` → Add org filter
1135
+
1136
+ ### Step 4.3: Authorization Middleware
1137
+
1138
+ **Add Organization & People Checks:**
1139
+
1140
+ ```typescript
1141
+ // src/middleware/auth.ts
1142
+
1143
+ export async function requireOrgAccess(
1144
+ ctx: ConvexContext,
1145
+ orgId: Id<"organizations">,
1146
+ requiredRole: "org_owner" | "org_user"
1147
+ ) {
1148
+ const userId = await getUserId(ctx);
1149
+
1150
+ // Get user's thing (person)
1151
+ const user = await ctx.db.get(userId);
1152
+ if (!user) {
1153
+ throw new Error("User not found");
1154
+ }
1155
+
1156
+ // Check if platform owner (can access everything)
1157
+ if (user.properties.role === "platform_owner") {
1158
+ return true;
1159
+ }
1160
+
1161
+ // Check if user belongs to organization
1162
+ const membership = await ctx.db
1163
+ .query("connections")
1164
+ .withIndex("from_type", (q) =>
1165
+ q
1166
+ .eq("fromThingId", userId)
1167
+ .eq("toThingId", orgId)
1168
+ .eq("relationshipType", "member_of")
1169
+ )
1170
+ .first();
1171
+
1172
+ if (!membership) {
1173
+ throw new Error("User not member of organization");
1174
+ }
1175
+
1176
+ // Check role
1177
+ const userRole = membership.metadata.role;
1178
+ if (requiredRole === "org_owner" && userRole !== "org_owner") {
1179
+ throw new Error("Org owner access required");
1180
+ }
1181
+
1182
+ return true;
1183
+ }
1184
+
1185
+ // Usage in mutations
1186
+ export const createBlogPost = mutation({
1187
+ args: {
1188
+ orgId: v.id("organizations"),
1189
+ title: v.string(),
1190
+ content: v.string(),
1191
+ },
1192
+ handler: async (ctx, args) => {
1193
+ // Check authorization
1194
+ await requireOrgAccess(ctx, args.orgId, "org_user");
1195
+
1196
+ // Create blog post scoped to org
1197
+ const postId = await ctx.db.insert("things", {
1198
+ thingType: "blog_post",
1199
+ name: args.title,
1200
+ organizationId: args.orgId,
1201
+ properties: { content: args.content },
1202
+ status: "draft",
1203
+ createdAt: Date.now(),
1204
+ updatedAt: Date.now(),
1205
+ });
1206
+
1207
+ // Log event
1208
+ const userId = await getUserId(ctx);
1209
+ await ctx.db.insert("events", {
1210
+ eventType: "content_created",
1211
+ actorId: userId,
1212
+ thingId: postId,
1213
+ organizationId: args.orgId,
1214
+ metadata: { contentType: "blog_post" },
1215
+ timestamp: Date.now(),
1216
+ });
1217
+
1218
+ return postId;
1219
+ },
1220
+ });
1221
+ ```
1222
+
1223
+ ### Step 4.4: Frontend Updates
1224
+
1225
+ **Update All Frontend Components:**
1226
+
1227
+ ```typescript
1228
+ // Old: Get posts (no org context)
1229
+ const posts = useQuery(api.queries.posts.list);
1230
+
1231
+ // New: Get posts for user's organization
1232
+ const user = useQuery(api.queries.users.current);
1233
+ const orgId = user?.properties.organizationId;
1234
+ const posts = useQuery(api.queries.posts.list, { orgId });
1235
+ ```
1236
+
1237
+ **Organization Selector Component:**
1238
+
1239
+ ```tsx
1240
+ // src/components/admin/OrganizationSelector.tsx
1241
+ export function OrganizationSelector() {
1242
+ const user = useQuery(api.queries.users.current);
1243
+ const orgs = useQuery(api.queries.orgs.listForUser, {
1244
+ userId: user?._id,
1245
+ });
1246
+ const [currentOrg, setCurrentOrg] = useState(user?.properties.organizationId);
1247
+
1248
+ return (
1249
+ <Select value={currentOrg} onValueChange={setCurrentOrg}>
1250
+ {orgs?.map((org) => (
1251
+ <SelectItem key={org._id} value={org._id}>
1252
+ {org.name} ({org.properties.plan})
1253
+ </SelectItem>
1254
+ ))}
1255
+ </Select>
1256
+ );
1257
+ }
1258
+ ```
1259
+
1260
+ ### Step 4.5: Testing
1261
+
1262
+ **Test Cases:**
1263
+
1264
+ 1. **Multi-Tenant Isolation:**
1265
+
1266
+ ```typescript
1267
+ // Test: User in Org A cannot see Org B's data
1268
+ test("organization data isolation", async () => {
1269
+ const orgA = await createOrg("Org A");
1270
+ const orgB = await createOrg("Org B");
1271
+
1272
+ const userA = await createUser(orgA, "org_user");
1273
+ const postB = await createPost(orgB, "Secret Post");
1274
+
1275
+ // Query from Org A context
1276
+ const posts = await queryPosts(orgA);
1277
+
1278
+ expect(posts).not.toContainEqual(postB);
1279
+ });
1280
+ ```
1281
+
1282
+ 2. **Authorization:**
1283
+
1284
+ ```typescript
1285
+ // Test: Org user cannot create org owner resources
1286
+ test("role-based authorization", async () => {
1287
+ const org = await createOrg("Test Org");
1288
+ const user = await createUser(org, "org_user");
1289
+
1290
+ await expect(
1291
+ createOrgSettings(org, user, { allowSignups: false })
1292
+ ).rejects.toThrow("Org owner access required");
1293
+ });
1294
+ ```
1295
+
1296
+ 3. **Platform Owner Access:**
1297
+
1298
+ ```typescript
1299
+ // Test: Platform owner can access all orgs
1300
+ test("platform owner can access all organizations", async () => {
1301
+ const orgA = await createOrg("Org A");
1302
+ const orgB = await createOrg("Org B");
1303
+
1304
+ const platformOwner = await getPlatformOwner();
1305
+
1306
+ const postsA = await queryPosts(orgA, platformOwner);
1307
+ const postsB = await queryPosts(orgB, platformOwner);
1308
+
1309
+ expect(postsA).toBeDefined();
1310
+ expect(postsB).toBeDefined();
1311
+ });
1312
+ ```
1313
+
1314
+ ---
1315
+
1316
+ ## Phase 5: Communication & Education
1317
+
1318
+ ### Step 5.1: Create Simple Examples
1319
+
1320
+ **For Children (Lemonade Stand):**
1321
+
1322
+ ````markdown
1323
+ # Building a Lemonade Stand with ONE Platform
1324
+
1325
+ ## The 6 Dimensions (Easy Version)
1326
+
1327
+ 1. **Organization** = Your Lemonade Stand Business
1328
+
1329
+ - You own the stand
1330
+ - You decide the rules
1331
+
1332
+ 2. **People** = You, the Boss!
1333
+
1334
+ - You're the owner
1335
+ - You can hire friends to help (users)
1336
+ - Customers buy lemonade
1337
+
1338
+ 3. **Things** = What You Have
1339
+
1340
+ - Lemonade (product)
1341
+ - Cups (inventory)
1342
+ - Money (tokens)
1343
+
1344
+ 4. **Connections** = How Things Work Together
1345
+
1346
+ - Customers buy lemonade
1347
+ - You own the stand
1348
+ - Lemonade is in a cup
1349
+
1350
+ 5. **Events** = What Happens
1351
+
1352
+ - Customer buys lemonade
1353
+ - You make more lemonade
1354
+ - You count money at end of day
1355
+
1356
+ 6. **Knowledge** = What You Learn
1357
+ - Sunny days = more sales
1358
+ - Sweet lemonade = happy customers
1359
+ - AI learns: "make more on sunny days!"
1360
+
1361
+ ## Building Your First AI Lemonade Stand
1362
+
1363
+ ```typescript
1364
+ // 1. Create your organization (lemonade stand)
1365
+ const myStand = await createOrganization({
1366
+ name: "Emma's Lemonade Stand",
1367
+ owner: "Emma",
1368
+ });
1369
+
1370
+ // 2. You are a person (the owner!)
1371
+ const me = await createPerson({
1372
+ name: "Emma",
1373
+ role: "org_owner",
1374
+ organizationId: myStand._id,
1375
+ });
1376
+
1377
+ // 3. Create lemonade (a thing!)
1378
+ const lemonade = await createThing({
1379
+ type: "product",
1380
+ name: "Fresh Lemonade",
1381
+ organizationId: myStand._id,
1382
+ properties: {
1383
+ price: 1.0, // $1 per cup
1384
+ inventory: 20, // 20 cups ready
1385
+ },
1386
+ });
1387
+
1388
+ // 4. Customer buys lemonade (connection!)
1389
+ const customer = await createPerson({
1390
+ name: "Alex",
1391
+ role: "customer",
1392
+ });
1393
+
1394
+ await createConnection({
1395
+ from: customer._id,
1396
+ to: lemonade._id,
1397
+ type: "purchased",
1398
+ organizationId: myStand._id,
1399
+ });
1400
+
1401
+ // 5. Log the sale (event!)
1402
+ await createEvent({
1403
+ type: "tokens_purchased",
1404
+ actor: customer._id,
1405
+ target: lemonade._id,
1406
+ organizationId: myStand._id,
1407
+ metadata: {
1408
+ amount: 1.0,
1409
+ weather: "sunny",
1410
+ },
1411
+ });
1412
+
1413
+ // 6. AI learns (knowledge!)
1414
+ // The AI notices: sunny days = more sales
1415
+ // Next sunny day, AI suggests: "Make more lemonade today!"
1416
+ ```
1417
+ ````
1418
+
1419
+ **What the AI Learned:**
1420
+
1421
+ - Sunny days → more customers
1422
+ - Sweet lemonade → happier customers (higher ratings)
1423
+ - After school time (3pm-5pm) → busiest time
1424
+
1425
+ **Your AI can now help:**
1426
+
1427
+ - "It's going to be sunny tomorrow - prepare 30 cups instead of 20!"
1428
+ - "Customer reviews say lemonade is too sour - add more sugar"
1429
+ - "You're running low on lemons - order more before the weekend rush"
1430
+
1431
+ This is how the 6 dimensions work together to make your lemonade stand smart! 🍋
1432
+
1433
+ ````
1434
+
1435
+ **For Enterprises (SaaS Platform):**
1436
+
1437
+ ```markdown
1438
+ # Building Enterprise SaaS with the 6-Dimension Ontology
1439
+
1440
+ ## The 6 Dimensions (Enterprise Version)
1441
+
1442
+ 1. **Organizations** = Multi-Tenant Isolation
1443
+ - Each customer company is an organization
1444
+ - Perfect data isolation (no cross-org leaks)
1445
+ - Independent billing, quotas, customization
1446
+
1447
+ 2. **People** = Authorization & Governance
1448
+ - Platform owner (you) manages infrastructure
1449
+ - Org owners manage their companies
1450
+ - Org users work within their company
1451
+ - Customers consume services
1452
+
1453
+ 3. **Things** = Domain Entities
1454
+ - Users, agents, content, products
1455
+ - All scoped to organizations
1456
+ - 66 pre-defined types + extensibility
1457
+
1458
+ 4. **Connections** = Relationships
1459
+ - Ownership, membership, permissions
1460
+ - Cross-entity relationships
1461
+ - Revenue sharing, referrals
1462
+
1463
+ 5. **Events** = Audit Trail
1464
+ - Complete history of who did what when
1465
+ - Analytics, compliance, debugging
1466
+ - Real-time event streams
1467
+
1468
+ 6. **Knowledge** = Intelligence Layer
1469
+ - RAG for context-aware AI
1470
+ - Vector search across all dimensions
1471
+ - Per-org knowledge graphs
1472
+
1473
+ ## Example: Building a CRM SaaS
1474
+
1475
+ ```typescript
1476
+ // 1. Customer signs up (creates organization)
1477
+ const acmeCorp = await createOrganization({
1478
+ name: "Acme Corporation",
1479
+ plan: "enterprise",
1480
+ limits: {
1481
+ users: 100,
1482
+ storage: 1000, // GB
1483
+ apiCalls: 1000000, // per month
1484
+ inference: 500000, // LLM calls per month
1485
+ },
1486
+ });
1487
+
1488
+ // 2. Org owner gets admin access
1489
+ const ceo = await createPerson({
1490
+ name: "Jane CEO",
1491
+ email: "jane@acme.com",
1492
+ role: "org_owner",
1493
+ organizationId: acmeCorp._id,
1494
+ });
1495
+
1496
+ // 3. Create CRM entities (things)
1497
+ const salesAgent = await createThing({
1498
+ type: "sales_agent",
1499
+ name: "Acme Sales AI",
1500
+ organizationId: acmeCorp._id,
1501
+ properties: {
1502
+ systemPrompt: "You are a friendly sales assistant...",
1503
+ temperature: 0.7,
1504
+ },
1505
+ });
1506
+
1507
+ const lead = await createThing({
1508
+ type: "lead",
1509
+ name: "John Smith - Enterprise Lead",
1510
+ organizationId: acmeCorp._id,
1511
+ properties: {
1512
+ email: "john@enterprise.com",
1513
+ company: "Enterprise Inc",
1514
+ budget: 100000,
1515
+ status: "qualified",
1516
+ },
1517
+ });
1518
+
1519
+ // 4. AI agent follows up with lead (connection)
1520
+ await createConnection({
1521
+ from: salesAgent._id,
1522
+ to: lead._id,
1523
+ type: "communicated",
1524
+ organizationId: acmeCorp._id,
1525
+ metadata: {
1526
+ protocol: "email",
1527
+ subject: "Following up on our conversation",
1528
+ },
1529
+ });
1530
+
1531
+ // 5. Log all interactions (events)
1532
+ await createEvent({
1533
+ type: "communication_event",
1534
+ actor: salesAgent._id,
1535
+ target: lead._id,
1536
+ organizationId: acmeCorp._id,
1537
+ metadata: {
1538
+ protocol: "email",
1539
+ messageType: "follow_up",
1540
+ sentiment: "positive",
1541
+ },
1542
+ timestamp: Date.now(),
1543
+ });
1544
+
1545
+ // 6. AI learns from all sales interactions (knowledge)
1546
+ // RAG system:
1547
+ // - Chunks all sales emails, call transcripts, notes
1548
+ // - Creates embeddings for semantic search
1549
+ // - AI agent queries: "What objections did similar leads have?"
1550
+ // - Knowledge layer returns relevant context
1551
+ // - AI crafts personalized response based on historical data
1552
+
1553
+ const relevantContext = await queryKnowledge({
1554
+ organizationId: acmeCorp._id,
1555
+ query: "enterprise software objections pricing",
1556
+ k: 10, // top 10 results
1557
+ });
1558
+
1559
+ const aiResponse = await generateResponse({
1560
+ context: relevantContext,
1561
+ prompt: "Craft a response addressing pricing concerns",
1562
+ });
1563
+ ````
1564
+
1565
+ ## Multi-Tenancy Benefits
1566
+
1567
+ 1. **Data Isolation:**
1568
+
1569
+ - Acme Corp cannot see Enterprise Inc's data
1570
+ - All queries automatically scoped to organizationId
1571
+ - Zero chance of cross-org data leaks
1572
+
1573
+ 2. **Independent Scaling:**
1574
+
1575
+ - Each org has separate quotas and limits
1576
+ - Per-org billing and usage tracking
1577
+ - Can upgrade/downgrade plans independently
1578
+
1579
+ 3. **Customization:**
1580
+
1581
+ - Each org can customize their AI agents
1582
+ - Different branding, features, workflows
1583
+ - Frontend customization per org
1584
+
1585
+ 4. **Platform Revenue:**
1586
+ - Org A pays $1000/month → $800 to org owner, $200 to platform
1587
+ - Inference costs shared: org pays token costs + platform markup
1588
+ - Clear revenue attribution via events
1589
+
1590
+ ## Security & Compliance
1591
+
1592
+ - **GDPR:** Delete all org data with single `organizationId` filter
1593
+ - **Audit:** Events table provides complete audit trail per org
1594
+ - **Access Control:** Role-based permissions via people dimension
1595
+ - **Encryption:** Org-scoped encryption keys for sensitive data
1596
+
1597
+ ````
1598
+
1599
+ ### Step 5.2: Update README Files
1600
+
1601
+ **Main README Updates:**
1602
+
1603
+ ```markdown
1604
+ # ONE Platform - The 6-Dimension Reality-Aware Architecture
1605
+
1606
+ Build AI-powered applications that scale from children's lemonade stands to enterprise SaaS platforms serving millions.
1607
+
1608
+ ## What Makes ONE Different
1609
+
1610
+ **6 Dimensions = Complete Reality Model:**
1611
+
1612
+ 1. **Organizations** - Multi-tenant isolation (who owns what at org level)
1613
+ 2. **People** - Authorization & governance (who can do what)
1614
+ 3. **Things** - Entities (what exists)
1615
+ 4. **Connections** - Relationships (how they relate)
1616
+ 5. **Events** - Actions (what happened)
1617
+ 6. **Knowledge** - Intelligence (what it means)
1618
+
1619
+ **Why 6 Dimensions?**
1620
+
1621
+ Other platforms create tables for features, pollute schemas with temporary concepts, and end up with hundreds of entities nobody understands.
1622
+
1623
+ ONE models reality in six dimensions, and maps everything to them.
1624
+
1625
+ Simple enough for children. Powerful enough for enterprises.
1626
+
1627
+ ## For Children
1628
+
1629
+ ```typescript
1630
+ // Your lemonade stand = organization
1631
+ // You = person (owner)
1632
+ // Lemonade = thing
1633
+ // Customer buys it = connection
1634
+ // Sale happens = event
1635
+ // AI learns = knowledge
1636
+ ````
1637
+
1638
+ ## For Enterprises
1639
+
1640
+ ```typescript
1641
+ // Multi-tenant SaaS = organizations (perfect isolation)
1642
+ // Users & roles = people (authorization & governance)
1643
+ // Domain entities = things (customers, products, agents)
1644
+ // Business relationships = connections (ownership, permissions)
1645
+ // Audit trail = events (who did what when)
1646
+ // AI intelligence = knowledge (RAG, vectors, learning)
1647
+ ```
1648
+
1649
+ ## Documentation
1650
+
1651
+ **Start Here:**
1652
+
1653
+ - [6-Dimension Ontology](one/knowledge/ontology.md) - Complete specification
1654
+ - [Architecture](one/knowledge/architecture.md) - How everything fits together
1655
+ - [Frontend Guide](one/things/frontend.md) - Building user interfaces
1656
+ - [Backend Guide](one/things/hono.md) - API and business logic
1657
+
1658
+ **Learn by Example:**
1659
+
1660
+ - [Children's Examples](one/examples/children/) - Lemonade stands, toy stores
1661
+ - [Enterprise Examples](one/examples/enterprise/) - CRM, SaaS, marketplaces
1662
+
1663
+ **Deep Dives:**
1664
+
1665
+ - [Organizations](one/connections/organisation.md) - Multi-tenant architecture
1666
+ - [People](one/people/people.md) - Authorization & roles
1667
+ - [Things](one/things/things.md) - 66 entity types
1668
+ - [Connections](one/connections/connections.md) - 25 relationship types
1669
+ - [Events](one/events/events.md) - 67 event types
1670
+ - [Knowledge](one/knowledge/knowledge.md) - RAG & intelligence
1671
+
1672
+ ## Quick Start
1673
+
1674
+ ```bash
1675
+ # 1. Clone the repository
1676
+ git clone https://github.com/one-platform/one
1677
+ cd one
1678
+
1679
+ # 2. Install dependencies
1680
+ bun install
1681
+
1682
+ # 3. Set up environment
1683
+ cp .env.example .env
1684
+ # Add your Convex URL and other keys
1685
+
1686
+ # 4. Run development server
1687
+ bun run dev
1688
+
1689
+ # 5. Build your first app!
1690
+ # See examples in one/examples/
1691
+ ```
1692
+
1693
+ ## The Philosophy
1694
+
1695
+ **Simplicity is the ultimate sophistication.**
1696
+
1697
+ - **6 dimensions** (not 50+ tables)
1698
+ - Organizations partition the space
1699
+ - People authorize and govern
1700
+ - Things, connections, events flow from there
1701
+ - Knowledge understands it all
1702
+ - Infinite extensibility without schema changes
1703
+
1704
+ **This architecture proves you don't need complexity to build complete AI-native platforms that scale infinitely.**
1705
+
1706
+ ````
1707
+
1708
+ ### Step 5.3: Create Migration Guide
1709
+
1710
+ **File:** `one/connections/MIGRATION-GUIDE.md`
1711
+
1712
+ ```markdown
1713
+ # Migration Guide: 4-Table → 6-Dimension Ontology
1714
+
1715
+ ## Overview
1716
+
1717
+ This guide helps you migrate from the old "4-table ontology" terminology to the new "6-dimension ontology" architecture.
1718
+
1719
+ **IMPORTANT:** The database schema has NOT changed. This is primarily a documentation and conceptual upgrade.
1720
+
1721
+ ## What Changed
1722
+
1723
+ ### Terminology
1724
+
1725
+ **Old:** "4-table ontology" (things, connections, events, tags/knowledge)
1726
+ **New:** "6-dimension ontology" (organizations, people, things, connections, events, knowledge)
1727
+
1728
+ ### Conceptual Model
1729
+
1730
+ **Old:**
1731
+ ````
1732
+
1733
+ Things → Connections → Events → Knowledge
1734
+
1735
+ ```
1736
+
1737
+ **New:**
1738
+ ```
1739
+
1740
+ Organizations → People → Things → Connections → Events → Knowledge
1741
+
1742
+ ````
1743
+
1744
+ ### Database Schema
1745
+
1746
+ **Added:**
1747
+ - `organizations` table (already existed, now explicit first-class dimension)
1748
+ - `organizationId` field on all tables (for multi-tenant scoping)
1749
+ - `actorId` required on events (always references a person/thing)
1750
+
1751
+ **People Representation:**
1752
+ - People are `things` with `type: 'creator'` and `properties.role`
1753
+ - No separate `people` table needed
1754
+ - Roles: `platform_owner`, `org_owner`, `org_user`, `customer`
1755
+
1756
+ ## Migration Checklist
1757
+
1758
+ ### For Developers
1759
+
1760
+ - [ ] Read updated [ontology.md](./ontology.md)
1761
+ - [ ] Update all queries to include `organizationId` filter
1762
+ - [ ] Add authorization checks using `requireOrgAccess()`
1763
+ - [ ] Update frontend components to use org context
1764
+ - [ ] Test multi-tenant data isolation
1765
+ - [ ] Update API routes with org scoping
1766
+
1767
+ ### For AI Agents
1768
+
1769
+ - [ ] Update system prompts to reference "6 dimensions" instead of "4 tables"
1770
+ - [ ] Include organizations and people in feature mapping
1771
+ - [ ] Generate org-scoped queries by default
1772
+ - [ ] Include authorization checks in mutations
1773
+ - [ ] Log events with `actorId` (who did it)
1774
+
1775
+ ### For Documentation
1776
+
1777
+ - [ ] Search and replace "4-table" → "6-dimension" in all docs
1778
+ - [ ] Update diagrams to show all 6 dimensions
1779
+ - [ ] Add examples showing org and people dimensions
1780
+ - [ ] Update README with new architecture
1781
+
1782
+ ## Code Changes
1783
+
1784
+ ### Old Query Pattern
1785
+
1786
+ ```typescript
1787
+ // Get all blog posts
1788
+ const posts = await ctx.db
1789
+ .query("things")
1790
+ .withIndex("by_type", (q) => q.eq("thingType", "blog_post"))
1791
+ .collect();
1792
+ ````
1793
+
1794
+ ### New Query Pattern
1795
+
1796
+ ```typescript
1797
+ // Get all blog posts in organization
1798
+ const posts = await ctx.db
1799
+ .query("things")
1800
+ .withIndex("by_org_type", (q) =>
1801
+ q.eq("organizationId", orgId).eq("thingType", "blog_post")
1802
+ )
1803
+ .collect();
1804
+ ```
1805
+
1806
+ ### Authorization Pattern
1807
+
1808
+ ```typescript
1809
+ export const createBlogPost = mutation({
1810
+ args: {
1811
+ orgId: v.id("organizations"),
1812
+ title: v.string(),
1813
+ },
1814
+ handler: async (ctx, args) => {
1815
+ // NEW: Check authorization
1816
+ await requireOrgAccess(ctx, args.orgId, "org_user");
1817
+
1818
+ const userId = await getUserId(ctx);
1819
+
1820
+ // NEW: Scope to organization
1821
+ const postId = await ctx.db.insert("things", {
1822
+ thingType: "blog_post",
1823
+ name: args.title,
1824
+ organizationId: args.orgId, // NEW
1825
+ properties: {},
1826
+ status: "draft",
1827
+ createdAt: Date.now(),
1828
+ updatedAt: Date.now(),
1829
+ });
1830
+
1831
+ // NEW: Log event with actor
1832
+ await ctx.db.insert("events", {
1833
+ eventType: "content_created",
1834
+ actorId: userId, // NEW: Who did it
1835
+ thingId: postId,
1836
+ organizationId: args.orgId, // NEW
1837
+ timestamp: Date.now(),
1838
+ metadata: {},
1839
+ });
1840
+
1841
+ return postId;
1842
+ },
1843
+ });
1844
+ ```
1845
+
1846
+ ## Testing
1847
+
1848
+ ### Data Isolation Test
1849
+
1850
+ ```typescript
1851
+ test("organizations have isolated data", async () => {
1852
+ const orgA = await createOrg("Org A");
1853
+ const orgB = await createOrg("Org B");
1854
+
1855
+ const postA = await createPost(orgA, "Post A");
1856
+ const postB = await createPost(orgB, "Post B");
1857
+
1858
+ const postsInA = await queryPosts(orgA);
1859
+
1860
+ expect(postsInA).toContain(postA);
1861
+ expect(postsInA).not.toContain(postB);
1862
+ });
1863
+ ```
1864
+
1865
+ ### Authorization Test
1866
+
1867
+ ```typescript
1868
+ test("org users cannot access other orgs", async () => {
1869
+ const orgA = await createOrg("Org A");
1870
+ const orgB = await createOrg("Org B");
1871
+
1872
+ const userA = await createUser(orgA, "org_user");
1873
+
1874
+ await expect(queryPosts(orgB, userA)).rejects.toThrow(
1875
+ "User not member of organization"
1876
+ );
1877
+ });
1878
+ ```
1879
+
1880
+ ## Rollback Plan
1881
+
1882
+ If issues arise:
1883
+
1884
+ 1. **Schema:** No changes needed (already compatible)
1885
+ 2. **Queries:** Remove `organizationId` filters temporarily
1886
+ 3. **Authorization:** Disable `requireOrgAccess()` checks temporarily
1887
+ 4. **Revert:** All data intact, just remove org scoping
1888
+
1889
+ ## Support
1890
+
1891
+ Questions? Issues?
1892
+
1893
+ - **Docs:** [one/knowledge/ontology.md](./ontology.md)
1894
+ - **Examples:** [one/examples/](../examples/)
1895
+ - **Architecture:** [one/knowledge/architecture.md](../knowledge/architecture.md)
1896
+
1897
+ ````
1898
+
1899
+ ---
1900
+
1901
+ ## Phase 6: Validation & Quality Assurance
1902
+
1903
+ ### Step 6.1: Automated Validation
1904
+
1905
+ **Create Validation Script:**
1906
+
1907
+ ```typescript
1908
+ // scripts/validate-6-dimension-migration.ts
1909
+
1910
+ import fs from 'fs';
1911
+ import path from 'path';
1912
+
1913
+ interface ValidationResult {
1914
+ file: string;
1915
+ line: number;
1916
+ issue: string;
1917
+ suggestion: string;
1918
+ }
1919
+
1920
+ const results: ValidationResult[] = [];
1921
+
1922
+ // Check for outdated "4-table" references
1923
+ function checkFile(filePath: string) {
1924
+ const content = fs.readFileSync(filePath, 'utf-8');
1925
+ const lines = content.split('\n');
1926
+
1927
+ lines.forEach((line, index) => {
1928
+ // Check for "4-table" or "4 table"
1929
+ if (line.match(/4[-\s]table/i)) {
1930
+ results.push({
1931
+ file: filePath,
1932
+ line: index + 1,
1933
+ issue: 'Found "4-table" reference',
1934
+ suggestion: 'Replace with "6-dimension" or "6 dimension"',
1935
+ });
1936
+ }
1937
+
1938
+ // Check for old pattern without org context
1939
+ if (line.match(/query\("things"\)/) && !line.includes('organizationId')) {
1940
+ results.push({
1941
+ file: filePath,
1942
+ line: index + 1,
1943
+ issue: 'Query without organization scope',
1944
+ suggestion: 'Add .withIndex("by_org_type", ...) for multi-tenant safety',
1945
+ });
1946
+ }
1947
+
1948
+ // Check for events without actor
1949
+ if (line.match(/insert\("events"/) && !line.includes('actorId')) {
1950
+ results.push({
1951
+ file: filePath,
1952
+ line: index + 1,
1953
+ issue: 'Event without actorId',
1954
+ suggestion: 'Add actorId field (who performed this action)',
1955
+ });
1956
+ }
1957
+ });
1958
+ }
1959
+
1960
+ // Scan all documentation
1961
+ const docsPath = path.join(__dirname, '../one');
1962
+ function scanDirectory(dir: string) {
1963
+ const files = fs.readdirSync(dir);
1964
+
1965
+ files.forEach(file => {
1966
+ const fullPath = path.join(dir, file);
1967
+ const stat = fs.statSync(fullPath);
1968
+
1969
+ if (stat.isDirectory() && !file.startsWith('.')) {
1970
+ scanDirectory(fullPath);
1971
+ } else if (file.endsWith('.md') || file.endsWith('.ts') || file.endsWith('.tsx')) {
1972
+ checkFile(fullPath);
1973
+ }
1974
+ });
1975
+ }
1976
+
1977
+ // Run validation
1978
+ console.log('🔍 Validating 6-dimension migration...\n');
1979
+ scanDirectory(docsPath);
1980
+
1981
+ // Report results
1982
+ if (results.length === 0) {
1983
+ console.log('✅ No issues found! Migration complete.');
1984
+ } else {
1985
+ console.log(`⚠️ Found ${results.length} issues:\n`);
1986
+ results.forEach(result => {
1987
+ console.log(`${result.file}:${result.line}`);
1988
+ console.log(` Issue: ${result.issue}`);
1989
+ console.log(` Suggestion: ${result.suggestion}\n`);
1990
+ });
1991
+ }
1992
+
1993
+ // Exit with error if issues found
1994
+ process.exit(results.length === 0 ? 0 : 1);
1995
+ ````
1996
+
1997
+ **Run validation:**
1998
+
1999
+ ```bash
2000
+ bun run scripts/validate-6-dimension-migration.ts
2001
+ ```
2002
+
2003
+ ### Step 6.2: Manual Review Checklist
2004
+
2005
+ **Documentation Review:**
2006
+
2007
+ - [ ] All "4-table" references replaced with "6-dimension"
2008
+ - [ ] Diagrams updated to show all 6 dimensions
2009
+ - [ ] Examples include organizations and people
2010
+ - [ ] README files updated with new terminology
2011
+ - [ ] Migration guide created and reviewed
2012
+
2013
+ **Code Review:**
2014
+
2015
+ - [ ] All queries include organization scoping
2016
+ - [ ] Authorization middleware in place
2017
+ - [ ] Events include `actorId` field
2018
+ - [ ] Frontend components use org context
2019
+ - [ ] Tests cover multi-tenant scenarios
2020
+
2021
+ **Quality Checks:**
2022
+
2023
+ - [ ] No broken internal links
2024
+ - [ ] All code examples compile
2025
+ - [ ] Documentation is consistent across files
2026
+ - [ ] Examples work for both children and enterprises
2027
+
2028
+ ---
2029
+
2030
+ ## Phase 7: Deployment & Rollout
2031
+
2032
+ ### Step 7.1: Staged Rollout
2033
+
2034
+ **Week 1: Documentation**
2035
+
2036
+ - Update all documentation files
2037
+ - Create migration guide
2038
+ - Update README files
2039
+ - Run validation script
2040
+
2041
+ **Week 2: Examples**
2042
+
2043
+ - Create children's examples (lemonade stand)
2044
+ - Create enterprise examples (CRM SaaS)
2045
+ - Test all examples
2046
+ - Record demo videos
2047
+
2048
+ **Week 3: Code Migration**
2049
+
2050
+ - Add organization scoping to schema
2051
+ - Update all queries with org context
2052
+ - Implement authorization middleware
2053
+ - Add migration script for existing data
2054
+
2055
+ **Week 4: Testing**
2056
+
2057
+ - Run full test suite
2058
+ - Test multi-tenant isolation
2059
+ - Test authorization rules
2060
+ - Performance testing
2061
+
2062
+ **Week 5: Deployment**
2063
+
2064
+ - Deploy to staging
2065
+ - Test with real data
2066
+ - Deploy to production
2067
+ - Monitor for issues
2068
+
2069
+ ### Step 7.2: Communication Plan
2070
+
2071
+ **Internal Team:**
2072
+
2073
+ - Share migration plan
2074
+ - Conduct training session
2075
+ - Update development guidelines
2076
+ - Create troubleshooting guide
2077
+
2078
+ **External Users:**
2079
+
2080
+ - Blog post announcing 6-dimension architecture
2081
+ - Update getting started guides
2082
+ - Create video tutorials
2083
+ - Host Q&A session
2084
+
2085
+ **AI Agents:**
2086
+
2087
+ - Update system prompts
2088
+ - Retrain on new documentation
2089
+ - Test code generation quality
2090
+ - Monitor for errors
2091
+
2092
+ ---
2093
+
2094
+ ## Success Metrics
2095
+
2096
+ ### Quantitative Metrics
2097
+
2098
+ 1. **Documentation Coverage:**
2099
+
2100
+ - Target: 100% of files updated
2101
+ - Measure: Validation script reports 0 issues
2102
+
2103
+ 2. **Code Quality:**
2104
+
2105
+ - Target: All queries include org scoping
2106
+ - Measure: 100% of mutations have authorization checks
2107
+ - Measure: 100% of events include actorId
2108
+
2109
+ 3. **Test Coverage:**
2110
+
2111
+ - Target: Multi-tenant scenarios covered
2112
+ - Measure: Data isolation tests pass
2113
+ - Measure: Authorization tests pass
2114
+
2115
+ 4. **Performance:**
2116
+ - Target: No performance regression
2117
+ - Measure: Query times similar or better
2118
+ - Measure: Multi-tenant queries optimized with indexes
2119
+
2120
+ ### Qualitative Metrics
2121
+
2122
+ 1. **Clarity:**
2123
+
2124
+ - Developers understand 6 dimensions immediately
2125
+ - Children can explain the model
2126
+ - AI agents generate correct code
2127
+
2128
+ 2. **Completeness:**
2129
+
2130
+ - All features map to 6 dimensions
2131
+ - No "special cases" or workarounds needed
2132
+ - Documentation is comprehensive
2133
+
2134
+ 3. **Maintainability:**
2135
+ - Consistent patterns across all code
2136
+ - Easy to add new features
2137
+ - AI-friendly architecture
2138
+
2139
+ ---
2140
+
2141
+ ## Rollback Plan
2142
+
2143
+ If critical issues arise:
2144
+
2145
+ ### Stage 1: Documentation Rollback
2146
+
2147
+ - Revert documentation to "4-table" terminology
2148
+ - Keep schema changes (they're backward compatible)
2149
+ - Update: 1 hour
2150
+
2151
+ ### Stage 2: Query Rollback
2152
+
2153
+ - Remove organizationId filters temporarily
2154
+ - Disable authorization checks
2155
+ - Add monitoring to detect cross-org queries
2156
+ - Update: 4 hours
2157
+
2158
+ ### Stage 3: Full Rollback
2159
+
2160
+ - Revert all code changes
2161
+ - Keep organizations table (data intact)
2162
+ - Remove org scoping indexes
2163
+ - Update: 1 day
2164
+
2165
+ **Backup Strategy:**
2166
+
2167
+ - Full database backup before migration
2168
+ - Documentation backup in git
2169
+ - Rollback script tested in staging
2170
+
2171
+ ---
2172
+
2173
+ ## Timeline Summary
2174
+
2175
+ - **Phase 1:** Search & Analysis - 1 day
2176
+ - **Phase 2:** Core Documentation Updates - 2 days
2177
+ - **Phase 3:** Systematic Updates - 3 days
2178
+ - **Phase 4:** Implementation & Testing - 1 week
2179
+ - **Phase 5:** Communication & Education - 3 days
2180
+ - **Phase 6:** Validation & QA - 2 days
2181
+ - **Phase 7:** Deployment & Rollout - 1 week
2182
+
2183
+ **Total Estimated Time:** 3-4 weeks
2184
+
2185
+ ---
2186
+
2187
+ ## Next Steps
2188
+
2189
+ 1. **Review this plan** with team
2190
+ 2. **Get approval** from stakeholders
2191
+ 3. **Create tracking board** with all tasks
2192
+ 4. **Start Phase 1** (search & analysis)
2193
+ 5. **Update this plan** based on findings
2194
+
2195
+ ---
2196
+
2197
+ ## Conclusion
2198
+
2199
+ This migration transforms ONE Platform from a "4-table ontology" to a complete "6-dimension reality-aware architecture" that:
2200
+
2201
+ ✅ **Scales from children to enterprises**
2202
+ ✅ **Perfect multi-tenant isolation**
2203
+ ✅ **Clear ownership and governance**
2204
+ ✅ **AI-friendly and future-proof**
2205
+ ✅ **Simple, beautiful, complete**
2206
+
2207
+ The 6 dimensions—Organizations, People, Things, Connections, Events, Knowledge—create a complete model of reality that both humans and AI can understand, reason about, and build upon infinitely.
2208
+
2209
+ **Let's build the future of AI platforms together.** 🚀
2210
+
2211
+ ---
2212
+
2213
+ **Plan Version:** 1.0.0
2214
+ **Last Updated:** 2025-10-10
2215
+ **Next Review:** After Phase 1 completion
2216
+ **Owner:** Platform Architecture Team