oneie 3.6.7 → 3.6.11

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 (165) hide show
  1. package/.claude/agents/agent-backend.md +83 -0
  2. package/.claude/agents/agent-designer.md +97 -0
  3. package/.claude/agents/agent-director.md +118 -7
  4. package/.claude/agents/agent-documenter.md +93 -0
  5. package/.claude/agents/agent-frontend.md +96 -0
  6. package/.claude/agents/agent-ops.md +182 -25
  7. package/.claude/agents/agent-problem-solver.md +166 -0
  8. package/.claude/agents/agent-quality.md +127 -0
  9. package/.claude/commands/build.md +293 -0
  10. package/.claude/commands/cascade.md +231 -127
  11. package/.claude/commands/mcp-toggle.md +93 -0
  12. package/.claude/commands/one.md +198 -116
  13. package/.claude/commands/plan.md +394 -80
  14. package/.claude/commands/release.md +41 -19
  15. package/.claude/commands/server.md +2 -0
  16. package/.claude/hooks/root-cleanup.py +75 -0
  17. package/.claude/skills/INDEX.md +523 -0
  18. package/.claude/skills/REGISTRY.md +529 -0
  19. package/.claude/skills/agent-backend-create-mutation.md +319 -0
  20. package/.claude/skills/agent-designer-create-wireframe.md +341 -0
  21. package/.claude/skills/agent-frontend-create-page.md +413 -0
  22. package/.claude/skills/agents/README.md +238 -0
  23. package/dist/clone-web.js +1 -1
  24. package/dist/clone-web.js.map +1 -1
  25. package/folders.yaml +1 -1
  26. package/one/.obsidian/workspace.json +38 -38
  27. package/one/connections/api/queries-reference.md +842 -0
  28. package/one/connections/api-reference.md +1011 -0
  29. package/one/connections/integration-examples.md +875 -0
  30. package/one/connections/integration-guide.md +869 -0
  31. package/one/connections/integration-phase2.md +736 -0
  32. package/one/events/API_ROUTES_FIXES_SUMMARY.md +262 -0
  33. package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +636 -0
  34. package/one/events/BEFORE_AFTER_COMPARISON.md +960 -0
  35. package/one/events/CONNECTIONS_DEMO.md +501 -0
  36. package/one/events/DELIVERABLES.md +432 -0
  37. package/one/events/DEMO-GROUPS-PAGE.md +392 -0
  38. package/one/events/DEMO-TESTING-SUMMARY.md +518 -0
  39. package/one/events/DEMO_COMPONENTS.md +487 -0
  40. package/one/events/DEMO_HOOKS_INDEX.md +334 -0
  41. package/one/events/DEMO_INFRASTRUCTURE.md +905 -0
  42. package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +570 -0
  43. package/one/events/DEMO_INTEGRATION_CHECKLIST.md +431 -0
  44. package/one/events/DEMO_QUICK_REFERENCE.md +441 -0
  45. package/one/events/DEMO_SETUP.md +476 -0
  46. package/one/events/EFFECT_TS_API_PATTERN.md +478 -0
  47. package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +414 -0
  48. package/one/events/HOOKS-DEMO.md +441 -0
  49. package/one/events/ONTOLOGY-HOOKS-README.md +700 -0
  50. package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +365 -0
  51. package/one/events/QA-CHECKLIST.md +674 -0
  52. package/one/events/QUICK-START-ONTOLOGY.md +408 -0
  53. package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +639 -0
  54. package/one/events/SEARCH_DEMO_DELIVERY.md +415 -0
  55. package/one/events/SEARCH_DEMO_SUMMARY.md +303 -0
  56. package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +381 -0
  57. package/one/events/TEST-PLAN-INDEX.md +346 -0
  58. package/one/events/TEST-PLAN.md +1417 -0
  59. package/one/events/TESTING-DELIVERY.txt +372 -0
  60. package/one/events/TRANSITIONS-QUICK-START.md +141 -0
  61. package/one/events/TYPESCRIPT_FIXES.md +152 -0
  62. package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +412 -0
  63. package/one/events/TYPESCRIPT_FIXES_INDEX.md +341 -0
  64. package/one/events/VIEW-TRANSITIONS.md +428 -0
  65. package/one/events/backend-integration-tests.md +606 -0
  66. package/one/events/backend-structure-diagram.txt +393 -0
  67. package/one/events/backend-structure-summary.txt +269 -0
  68. package/one/events/cloudflare-pages-infrastructure-setup.md +264 -0
  69. package/one/events/convex-analysis-index.md +304 -0
  70. package/one/events/convex-structure-analysis.md +700 -0
  71. package/one/events/design-spec-complete.md +208 -0
  72. package/one/events/ontology-test-examples.md +562 -0
  73. package/one/events/phase1-backend-implementation-complete.md +518 -0
  74. package/one/events/test-dashboard.md +345 -0
  75. package/one/events/test-index.md +361 -0
  76. package/one/events/test-report-ontology.md +582 -0
  77. package/one/events/testing-summary.md +344 -0
  78. package/one/groups/features.md +2878 -0
  79. package/one/groups/strategy copy.md +869 -0
  80. package/one/knowledge/backend-api-reference.md +710 -0
  81. package/one/knowledge/documentation-summary.md +285 -0
  82. package/one/knowledge/lessons-learned.md +294 -4
  83. package/one/knowledge/ontology-visual-guide.md +360 -0
  84. package/one/knowledge/ontology.md +9 -17
  85. package/one/things/demo-accessibility-animations.md +999 -0
  86. package/one/things/demo-components.md +1304 -0
  87. package/one/things/demo-design-summary.md +629 -0
  88. package/one/things/demo-design-system.md +919 -0
  89. package/one/things/demo-page-layouts.md +989 -0
  90. package/one/things/designs/accessibility-audit.md +790 -0
  91. package/one/things/designs/component-specifications.md +757 -0
  92. package/one/things/designs/design-overview.md +318 -0
  93. package/one/things/designs/design-tokens.md +414 -0
  94. package/one/things/designs/wireframes-dashboard.md +653 -0
  95. package/one/things/docs/api-requests.md +923 -0
  96. package/one/things/features/0 All Features.md +2 -0
  97. package/one/things/implementation/backend-guide.md +412 -0
  98. package/one/things/plans/2-backend-agnostic-frontend.md +11 -8
  99. package/one/things/plans/ai-elements.md +1259 -0
  100. package/one/things/plans/ai-integration.md +947 -0
  101. package/one/things/plans/ai-sdk.md +761 -0
  102. package/one/things/plans/app.md +1 -1
  103. package/one/things/plans/architecture-summary.md +283 -0
  104. package/one/things/plans/async-ai-agents.md +215 -0
  105. package/one/things/plans/backend-agnostic-frontend.md +11 -6
  106. package/one/things/plans/backend-cleanup-quickstart.md +346 -0
  107. package/one/things/plans/backend-ontology-conformance.md +416 -0
  108. package/one/things/plans/backend-status.md +541 -0
  109. package/one/things/plans/backend-structure.md +799 -0
  110. package/one/things/plans/backend-target-structure.md +438 -0
  111. package/one/things/plans/backend.md +1133 -0
  112. package/one/things/plans/better-auth-any-backend.md +11 -11
  113. package/one/things/plans/cli-updates-required.md +280 -0
  114. package/one/things/plans/complete-step-by-step.md +1302 -0
  115. package/one/things/plans/convex-agents.md +1005 -0
  116. package/one/things/plans/deployment-architecture.md +426 -0
  117. package/one/things/plans/development-plan.md +1220 -0
  118. package/one/things/plans/effect.md +808 -48
  119. package/one/things/plans/integrate-frontend-and-backend.md +579 -0
  120. package/one/things/plans/mcp-clear-context-prompt.md +60 -0
  121. package/one/things/plans/mcp-simple.md +228 -0
  122. package/one/things/plans/one.md +8 -7
  123. package/one/things/plans/ontology-6-dimensions.md +20 -14
  124. package/one/things/plans/quick-wins.md +1273 -0
  125. package/one/things/plans/readme-backend-cleanup.md +361 -0
  126. package/one/things/plans/separate-demo.md +830 -0
  127. package/one/things/plans/separate.md +3 -3
  128. package/one/things/plans/sequence.md +1897 -0
  129. package/one/things/plans/sync-checklist.md +321 -0
  130. package/one/things/plans/unified-implementation-plan.md +3 -3
  131. package/one/things/plans/update-demos.md +513 -0
  132. package/package.json +1 -1
  133. package/.claude/agents/backend-specialist.md +0 -169
  134. package/.claude/agents/designer.md +0 -216
  135. package/.claude/agents/frontend-specialist.md +0 -236
  136. package/.claude/commands/done.md +0 -35
  137. package/.claude/commands/infer.md +0 -138
  138. package/.claude/commands/next.md +0 -53
  139. package/.claude/commands/one copy.md +0 -565
  140. package/.claude/commands/one-template.md +0 -106
  141. package/.claude/commands/one-v1.md +0 -609
  142. package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
  143. package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
  144. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  145. package/one/groups/nine-padel-customers.md +0 -138
  146. package/one/groups/nine-padel-data-structure.md +0 -167
  147. package/one/groups/nine-padel-ontology-specification.md +0 -359
  148. package/one/groups/nine-padel-ontology.md +0 -143
  149. package/one/groups/nine-padel-strategy.md +0 -234
  150. package/one/groups/nine-padel.md +0 -211
  151. package/one/groups/nine-padle-contents.baked.md +0 -1252
  152. package/one/groups/nine-padle-contents.md +0 -6
  153. package/one/things/features/1-1-agent-prompts/design.md +0 -470
  154. package/one/things/features/1-1-agent-prompts/tests.md +0 -264
  155. package/one/things/features/1-2-yaml-orchestrator/design.md +0 -497
  156. package/one/things/features/1-2-yaml-orchestrator/tests.md +0 -227
  157. package/one/things/features/1-3-event-coordination/design.md +0 -544
  158. package/one/things/features/1-3-event-coordination/tests.md +0 -223
  159. package/one/things/features/1-4-knowledge-management/design.md +0 -609
  160. package/one/things/features/1-4-knowledge-management/tests.md +0 -195
  161. package/one/things/features/1-5-quality-loops/design.md +0 -797
  162. package/one/things/features/1-5-quality-loops/tests.md +0 -212
  163. package/one/things/features/1-6-numbering-structure/design.md +0 -610
  164. package/one/things/features/1-6-numbering-structure/tests.md +0 -213
  165. package/one/things/features/dataprovider-interface/1-tests.md +0 -1522
@@ -0,0 +1,438 @@
1
+ # Backend Target Structure (After Conformance)
2
+
3
+ **Status**: Target Design
4
+ **Purpose**: Vision of beautifully organized backend that 100% maps to 6-dimension ontology
5
+
6
+ ---
7
+
8
+ ## Current State (BEFORE)
9
+
10
+ ```
11
+ backend/
12
+ ├── 20+ markdown files (scattered, some duplicate)
13
+ ├── _tests_disabled/ (obsolete)
14
+ ├── convex/ (good structure)
15
+ ├── lib/ (utilities with scattered docs)
16
+ ├── test/ (good structure)
17
+ ├── examples/ (should be in /one/)
18
+ ├── scripts/ (good structure)
19
+ ├── README.md (outdated - says "4-table")
20
+ └── BACKEND-AUDIT-MANIFEST.md (new - assessment guide)
21
+ ```
22
+
23
+ **Problems**:
24
+ - Documentation scattered across root
25
+ - Duplicate files (3 copies of query docs, 3 copies of structure docs)
26
+ - Outdated references ("4-table" instead of "6-dimension")
27
+ - No clear mapping to 6-dimension ontology
28
+ - Examples not discoverable (not in /one/)
29
+ - Disabled tests take up space
30
+
31
+ **Impact**:
32
+ - 33+ files to assess and organize
33
+ - Context switching between `/backend/` and `/one/`
34
+ - Unclear which files are current vs. archived
35
+ - Difficult for new developers to find relevant docs
36
+
37
+ ---
38
+
39
+ ## Target State (AFTER)
40
+
41
+ ### `/backend/` - Clean & Minimal
42
+
43
+ ```
44
+ backend/
45
+ ├── convex/
46
+ │ ├── schema.ts (6-dimension ontology ✅)
47
+ │ │ ├── groups table
48
+ │ │ ├── people table
49
+ │ │ ├── things table
50
+ │ │ ├── connections table
51
+ │ │ ├── events table
52
+ │ │ └── knowledge table
53
+ │ ├── auth.ts (People dimension)
54
+ │ ├── auth.config.ts
55
+ │ ├── queries/
56
+ │ │ ├── groups.ts
57
+ │ │ ├── people.ts
58
+ │ │ ├── things.ts
59
+ │ │ ├── connections.ts
60
+ │ │ ├── events.ts
61
+ │ │ ├── knowledge.ts
62
+ │ │ ├── ontology.ts (meta queries)
63
+ │ │ └── README.md
64
+ │ ├── mutations/
65
+ │ │ ├── groups.ts
66
+ │ │ ├── people.ts
67
+ │ │ ├── things.ts
68
+ │ │ ├── connections.ts
69
+ │ │ ├── knowledge.ts
70
+ │ │ ├── init.ts
71
+ │ │ ├── onboarding.ts
72
+ │ │ └── README.md
73
+ │ ├── actions/ (server-side actions)
74
+ │ ├── internalActions/
75
+ │ │ ├── events.ts (event logging)
76
+ │ │ ├── search.ts (RAG/embedding)
77
+ │ │ └── validation.ts
78
+ │ ├── services/
79
+ │ │ ├── entityService.ts (Things dimension)
80
+ │ │ ├── ontologyMapper.ts (Mapping logic)
81
+ │ │ ├── brandGuideGenerator.ts
82
+ │ │ ├── featureRecommender.ts
83
+ │ │ ├── websiteAnalyzer.ts
84
+ │ │ └── layers.ts
85
+ │ ├── ontologies/ (feature-specific definitions)
86
+ │ │ ├── base.json
87
+ │ │ ├── blog.json
88
+ │ │ ├── courses.json
89
+ │ │ ├── ecommerce.json
90
+ │ │ └── portfolio.json
91
+ │ ├── types/
92
+ │ │ ├── ontology.ts (auto-generated)
93
+ │ │ └── README.md
94
+ │ ├── http.ts (HTTP endpoints)
95
+ │ ├── convex.config.ts
96
+ │ └── INDEX.md (navigation)
97
+ │
98
+ ├── lib/
99
+ │ ├── ontology-loader.ts (load definitions)
100
+ │ ├── ontology-validator.ts (validate structure)
101
+ │ ├── ontology-errors.ts (error handling)
102
+ │ ├── type-generator.ts (type gen)
103
+ │ ├── jwt.ts (auth utils)
104
+ │ ├── validation.ts (validators)
105
+ │ └── __tests__/ (lib tests)
106
+ │
107
+ ├── test/
108
+ │ ├── groups.test.ts
109
+ │ ├── things.test.ts
110
+ │ ├── connections.test.ts (future)
111
+ │ ├── events.test.ts (future)
112
+ │ ├── knowledge.test.ts (future)
113
+ │ ├── auth.test.ts (future)
114
+ │ ├── README.md (testing guide)
115
+ │ └── RUN_TESTS.md (how to run)
116
+ │
117
+ ├── scripts/
118
+ │ ├── generate-ontology-types.ts
119
+ │ ├── generate-template-from-ontology.ts
120
+ │ └── README.md
121
+ │
122
+ ├── README.md (clean overview)
123
+ ├── LICENSE.md
124
+ ├── package.json
125
+ ├── tsconfig.json
126
+ ├── vitest.config.ts
127
+ ├── bun.lock
128
+ └── .env.local (secrets - .gitignored)
129
+
130
+ # NO subdirectories for:
131
+ # - _tests_disabled/ ❌ DELETED
132
+ # - 33 markdown files (moved to /one/)
133
+ # - examples/ (moved to /one/knowledge/)
134
+ ```
135
+
136
+ **Total files in /backend/**: ~60 (down from 200+)
137
+ **All source code present**: ✅
138
+ **Documentation clean**: ✅ (moved to /one/)
139
+ **Ontology-compliant**: ✅
140
+
141
+ ---
142
+
143
+ ### `/one/things/plans/` - Backend Architecture Docs
144
+
145
+ ```
146
+ one/things/plans/
147
+ ├── backend-ontology-conformance.md (THIS FILE - the plan)
148
+ ├── backend-target-structure.md (target vision)
149
+ └── backend-structure.md (merged from 3 originals)
150
+ ```
151
+
152
+ ### `/one/things/implementation/` - Backend Development Guides
153
+
154
+ ```
155
+ one/things/implementation/
156
+ ├── backend-guide.md (how to implement features)
157
+ ├── convex-patterns.md
158
+ ├── auth-patterns.md
159
+ └── ontology-mapping.md (how to map to 6 dimensions)
160
+ ```
161
+
162
+ ### `/one/connections/api/` - Query & Mutation Reference
163
+
164
+ ```
165
+ one/connections/api/
166
+ ├── queries-reference.md (consolidated from 3 files)
167
+ ├── mutations-reference.md
168
+ ├── http-endpoints.md
169
+ ├── ontology-queries.md (examples)
170
+ └── convex-quick-reference.md (quick ref)
171
+ ```
172
+
173
+ ### `/one/events/` - Analysis, Testing, & Insights
174
+
175
+ ```
176
+ one/events/
177
+ ├── backend-integration-tests.md (consolidated from 2 files)
178
+ ├── backend-structure-analysis.md
179
+ ├── backend-structure-diagram.txt
180
+ ├── backend-structure-summary.txt
181
+ ├── convex-analysis-index.md
182
+ ├── test-dashboard.md
183
+ ├── test-index.md
184
+ ├── test-report-ontology.md
185
+ ├── testing-summary.md
186
+ ├── ontology-test-examples.md
187
+ └── disabled-tests-archive.md (archive note from _tests_disabled/)
188
+ ```
189
+
190
+ ### `/one/knowledge/` - Learning Resources
191
+
192
+ ```
193
+ one/knowledge/
194
+ ├── ontology-visual-guide.md
195
+ └── examples/
196
+ ├── backend-examples/
197
+ │ ├── complete-newsletter-example/
198
+ │ ├── ontology-types-usage.ts
199
+ │ └── README.md
200
+ ├── frontend-examples/
201
+ └── full-stack-examples/
202
+ ```
203
+
204
+ ### `/one/people/` - Authorization & Roles
205
+
206
+ ```
207
+ one/people/
208
+ ├── backend-auth-roles.md
209
+ ├── better-auth-guide.md
210
+ └── permissions-model.md
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Organization by 6-Dimension
216
+
217
+ ### 1. GROUPS Dimension
218
+ **Files that document multi-tenant isolation**:
219
+ - `one/things/plans/backend-structure.md` (groups table section)
220
+ - `backend/convex/schema.ts` (groups table definition)
221
+ - `backend/convex/queries/groups.ts` (read operations)
222
+ - `backend/convex/mutations/groups.ts` (write operations)
223
+
224
+ ### 2. PEOPLE Dimension
225
+ **Files that document authorization & governance**:
226
+ - `one/people/backend-auth-roles.md`
227
+ - `one/people/better-auth-guide.md`
228
+ - `backend/convex/auth.ts` (auth config)
229
+ - `backend/convex/mutations/people.ts` (person operations)
230
+ - `backend/convex/queries/people.ts` (read people)
231
+
232
+ ### 3. THINGS Dimension
233
+ **Files that document entity definitions**:
234
+ - `one/things/plans/backend-structure.md` (things table section)
235
+ - `one/things/implementation/backend-guide.md`
236
+ - `backend/convex/schema.ts` (things table + 66+ types)
237
+ - `backend/convex/ontologies/*.json` (feature types)
238
+ - `backend/convex/mutations/things.ts` (create/update entities)
239
+ - `backend/convex/queries/things.ts` (read entities)
240
+ - `backend/convex/services/entityService.ts` (entity operations)
241
+ - `one/knowledge/examples/backend-examples/` (usage examples)
242
+
243
+ ### 4. CONNECTIONS Dimension
244
+ **Files that document relationships**:
245
+ - `one/connections/api/queries-reference.md`
246
+ - `one/connections/api/mutations-reference.md`
247
+ - `backend/convex/schema.ts` (connections table + 25+ types)
248
+ - `backend/convex/mutations/connections.ts` (create/update relations)
249
+ - `backend/convex/queries/connections.ts` (read relations)
250
+ - `one/connections/api/ontology-queries.md` (query examples)
251
+
252
+ ### 5. EVENTS Dimension
253
+ **Files that document actions & audit trail**:
254
+ - `one/events/backend-integration-tests.md`
255
+ - `one/events/testing-summary.md`
256
+ - `one/events/ontology-test-examples.md`
257
+ - `backend/convex/schema.ts` (events table + 67+ types)
258
+ - `backend/convex/internalActions/events.ts` (event logging)
259
+ - `backend/convex/queries/events.ts` (read events)
260
+
261
+ ### 6. KNOWLEDGE Dimension
262
+ **Files that document embeddings & RAG**:
263
+ - `one/knowledge/ontology-visual-guide.md`
264
+ - `one/knowledge/examples/backend-examples/`
265
+ - `backend/convex/schema.ts` (knowledge table)
266
+ - `backend/convex/mutations/knowledge.ts` (create/update knowledge)
267
+ - `backend/convex/queries/knowledge.ts` (search/retrieve)
268
+ - `backend/convex/internalActions/search.ts` (embedding + RAG)
269
+
270
+ ---
271
+
272
+ ## File Movement Summary
273
+
274
+ ### DELETE (4 files) ❌
275
+ ```
276
+ ONTOLOGY-FILE-STRUCTURE.md (duplicate)
277
+ ONTOLOGY-INTEGRATION-TEST-SUMMARY.md (consolidate with report)
278
+ PERFECT-ONTOLOGY-STRUCTURE.md (duplicate)
279
+ _tests_disabled/ (entire directory - obsolete)
280
+ ```
281
+
282
+ ### MOVE (12 files) 📋
283
+ ```
284
+ BACKEND-STRUCTURE.md → /one/things/plans/ (consolidate)
285
+ CONVEX-ANALYSIS-INDEX.md → /one/events/
286
+ CONVEX-STRUCTURE-ANALYSIS.md → /one/events/
287
+ CONVEX-STRUCTURE-DIAGRAM.txt → /one/events/
288
+ IMPLEMENTATION-GUIDE.md → /one/things/implementation/
289
+ ONTOLOGY-TEST-EXAMPLES.md → /one/events/
290
+ ONTOLOGY_VISUAL_GUIDE.md → /one/knowledge/
291
+ ONTOLOGY_QUERIES_EXAMPLE.md → /one/connections/api/ (consolidate)
292
+ QUERIES_ONTOLOGY_COMPLETE.md → /one/connections/api/ (consolidate)
293
+ QUERY_ONTOLOGY.md → /one/connections/api/ (consolidate)
294
+ TEST-DASHBOARD.md → /one/events/
295
+ TEST-INDEX.md → /one/events/
296
+ TEST-REPORT-ONTOLOGY.md → /one/events/
297
+ TESTING-SUMMARY.md → /one/events/
298
+ ```
299
+
300
+ ### CONSOLIDATE (3 groups) ⚠️
301
+ ```
302
+ Query docs: ONTOLOGY_QUERIES_EXAMPLE.md + QUERIES_ONTOLOGY_COMPLETE.md + QUERY_ONTOLOGY.md
303
+ → one/connections/api/queries-reference.md
304
+
305
+ Structure docs: BACKEND-STRUCTURE.md + ONTOLOGY-FILE-STRUCTURE.md + PERFECT-ONTOLOGY-STRUCTURE.md
306
+ → one/things/plans/backend-structure.md
307
+
308
+ Test reports: ONTOLOGY-INTEGRATION-TEST-REPORT.md + ONTOLOGY-INTEGRATION-TEST-SUMMARY.md
309
+ → one/events/backend-integration-tests.md
310
+ ```
311
+
312
+ ### KEEP in `/backend/` (10 items) ✅
313
+ ```
314
+ convex/ (all - source code)
315
+ lib/ (all - utilities)
316
+ test/ (all - active tests)
317
+ scripts/ (all - build tools)
318
+ README.md (update "4-table" → "6-dimension")
319
+ LICENSE.md
320
+ package.json
321
+ .env.local
322
+ vitest.config.ts
323
+ bun.lock
324
+ ```
325
+
326
+ ---
327
+
328
+ ## Quality Metrics
329
+
330
+ | Metric | Before | After | Target |
331
+ |--------|--------|-------|--------|
332
+ | Markdown files in `/backend/` | 20 | 2 | <5 |
333
+ | Duplicate documentation | 7 files (3+ copies) | 0 | 0 |
334
+ | Files mapped to 6 dimensions | ~50% | 100% | 100% |
335
+ | Discoverability (in /one/) | ~30% | ~95% | 100% |
336
+ | TypeScript errors | 0 | 0 | 0 |
337
+ | Broken links | Unknown | 0 | 0 |
338
+ | Schema compliance | 6-dim ✅ | 6-dim ✅ | 6-dim ✅ |
339
+
340
+ ---
341
+
342
+ ## Success Checklist
343
+
344
+ - [ ] All source code remains in `/backend/convex/`
345
+ - [ ] All documentation moved to `/one/` (except README.md)
346
+ - [ ] All duplicates consolidated (7 files → 3 consolidated files)
347
+ - [ ] All deleted files archived (only _tests_disabled/ truly deleted)
348
+ - [ ] Schema.ts verified - 6 dimensions intact
349
+ - [ ] TypeScript compilation successful
350
+ - [ ] All markdown links updated and valid
351
+ - [ ] README.md updated (4-table → 6-dimension)
352
+ - [ ] Examples moved to `/one/knowledge/examples/`
353
+ - [ ] Every file mapped to at least 1 ontology dimension
354
+
355
+ ---
356
+
357
+ ## Why This Matters
358
+
359
+ ### Before: Hard to Navigate
360
+ - Q: "Where's the query documentation?"
361
+ - A: "It's in QUERY_ONTOLOGY.md... or maybe QUERIES_ONTOLOGY_COMPLETE.md... or ONTOLOGY_QUERIES_EXAMPLE.md"
362
+ - Problem: 3 files, different content, unclear which to use
363
+
364
+ ### After: Crystal Clear
365
+ - Q: "Where's the query documentation?"
366
+ - A: "Read `/one/connections/api/queries-reference.md`"
367
+ - Problem solved: 1 file, consolidated, discoverable
368
+
369
+ ### Before: Scattered Context
370
+ - To understand backend: read `/backend/README.md`, then 20+ files, piecing it together
371
+ - Hard to see 6-dimension mapping
372
+
373
+ ### After: Organized by Dimension
374
+ - To understand backend: navigate `/one/` by dimension
375
+ - Groups → check `/one/things/plans/backend-structure.md` section 1
376
+ - People → check `/one/people/backend-auth-roles.md`
377
+ - Things → check `/one/things/implementation/` + `/one/knowledge/examples/`
378
+ - Connections → check `/one/connections/api/`
379
+ - Events → check `/one/events/`
380
+ - Knowledge → check `/one/knowledge/`
381
+
382
+ ---
383
+
384
+ ## Implementation Phases
385
+
386
+ ### Phase 1: Audit (✅ DONE)
387
+ - [x] Create BACKEND-AUDIT-MANIFEST.md (file-by-file assessment)
388
+ - [x] Create this document (target vision)
389
+ - [x] Create backend-ontology-conformance.md (100-inference plan)
390
+
391
+ ### Phase 2: Consolidation (Next)
392
+ - [ ] Merge 3 query docs into 1
393
+ - [ ] Merge 3 structure docs into 1
394
+ - [ ] Merge 2 test reports into 1
395
+ - [ ] Move consolidated files to `/one/`
396
+
397
+ ### Phase 3: Migration (Then)
398
+ - [ ] Move remaining documentation to `/one/`
399
+ - [ ] Move examples to `/one/knowledge/examples/`
400
+ - [ ] Delete _tests_disabled/
401
+ - [ ] Delete duplicate files
402
+
403
+ ### Phase 4: Cleanup (Finally)
404
+ - [ ] Update /backend/README.md
405
+ - [ ] Verify TypeScript compilation
406
+ - [ ] Test all markdown links
407
+ - [ ] Validate 6-dimension schema
408
+
409
+ ---
410
+
411
+ ## Risk Mitigation
412
+
413
+ | Risk | Mitigation |
414
+ |------|-----------|
415
+ | Breaking imports | Convex source code stays in `/backend/` - no import changes needed |
416
+ | Losing documentation | Keep backups during migration, verify everything copied |
417
+ | Broken links | Use grep to find all references before moving |
418
+ | Schema validation fails | Don't touch schema.ts - only organize documentation |
419
+
420
+ ---
421
+
422
+ ## Next Steps
423
+
424
+ 1. Review this target structure
425
+ 2. Approve the plan
426
+ 3. Execute Phase 2 (Consolidation)
427
+ 4. Execute Phase 3 (Migration)
428
+ 5. Execute Phase 4 (Cleanup)
429
+ 6. Celebrate! 🎉
430
+
431
+ **Estimated effort**: 4-6 hours total
432
+ **Payoff**: Infinitely better developer experience forever
433
+
434
+ ---
435
+
436
+ **Status**: Ready for execution
437
+ **Owner**: Agent-clean, Agent-backend
438
+ **Timeline**: 60-100 inferences in 100-inference sequence