oneie 3.6.6 → 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 (166) 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/onboard.md +179 -0
  13. package/.claude/commands/one.md +236 -516
  14. package/.claude/commands/plan.md +394 -80
  15. package/.claude/commands/release.md +41 -19
  16. package/.claude/commands/server.md +335 -0
  17. package/.claude/hooks/root-cleanup.py +75 -0
  18. package/.claude/skills/INDEX.md +523 -0
  19. package/.claude/skills/REGISTRY.md +529 -0
  20. package/.claude/skills/agent-backend-create-mutation.md +319 -0
  21. package/.claude/skills/agent-designer-create-wireframe.md +341 -0
  22. package/.claude/skills/agent-frontend-create-page.md +413 -0
  23. package/.claude/skills/agents/README.md +238 -0
  24. package/dist/clone-web.js +1 -1
  25. package/dist/clone-web.js.map +1 -1
  26. package/folders.yaml +1 -1
  27. package/one/.obsidian/workspace.json +38 -38
  28. package/one/connections/api/queries-reference.md +842 -0
  29. package/one/connections/api-reference.md +1011 -0
  30. package/one/connections/integration-examples.md +875 -0
  31. package/one/connections/integration-guide.md +869 -0
  32. package/one/connections/integration-phase2.md +736 -0
  33. package/one/events/API_ROUTES_FIXES_SUMMARY.md +262 -0
  34. package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +636 -0
  35. package/one/events/BEFORE_AFTER_COMPARISON.md +960 -0
  36. package/one/events/CONNECTIONS_DEMO.md +501 -0
  37. package/one/events/DELIVERABLES.md +432 -0
  38. package/one/events/DEMO-GROUPS-PAGE.md +392 -0
  39. package/one/events/DEMO-TESTING-SUMMARY.md +518 -0
  40. package/one/events/DEMO_COMPONENTS.md +487 -0
  41. package/one/events/DEMO_HOOKS_INDEX.md +334 -0
  42. package/one/events/DEMO_INFRASTRUCTURE.md +905 -0
  43. package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +570 -0
  44. package/one/events/DEMO_INTEGRATION_CHECKLIST.md +431 -0
  45. package/one/events/DEMO_QUICK_REFERENCE.md +441 -0
  46. package/one/events/DEMO_SETUP.md +476 -0
  47. package/one/events/EFFECT_TS_API_PATTERN.md +478 -0
  48. package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +414 -0
  49. package/one/events/HOOKS-DEMO.md +441 -0
  50. package/one/events/ONTOLOGY-HOOKS-README.md +700 -0
  51. package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +365 -0
  52. package/one/events/QA-CHECKLIST.md +674 -0
  53. package/one/events/QUICK-START-ONTOLOGY.md +408 -0
  54. package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +639 -0
  55. package/one/events/SEARCH_DEMO_DELIVERY.md +415 -0
  56. package/one/events/SEARCH_DEMO_SUMMARY.md +303 -0
  57. package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +381 -0
  58. package/one/events/TEST-PLAN-INDEX.md +346 -0
  59. package/one/events/TEST-PLAN.md +1417 -0
  60. package/one/events/TESTING-DELIVERY.txt +372 -0
  61. package/one/events/TRANSITIONS-QUICK-START.md +141 -0
  62. package/one/events/TYPESCRIPT_FIXES.md +152 -0
  63. package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +412 -0
  64. package/one/events/TYPESCRIPT_FIXES_INDEX.md +341 -0
  65. package/one/events/VIEW-TRANSITIONS.md +428 -0
  66. package/one/events/backend-integration-tests.md +606 -0
  67. package/one/events/backend-structure-diagram.txt +393 -0
  68. package/one/events/backend-structure-summary.txt +269 -0
  69. package/one/events/cloudflare-pages-infrastructure-setup.md +264 -0
  70. package/one/events/convex-analysis-index.md +304 -0
  71. package/one/events/convex-structure-analysis.md +700 -0
  72. package/one/events/design-spec-complete.md +208 -0
  73. package/one/events/ontology-test-examples.md +562 -0
  74. package/one/events/phase1-backend-implementation-complete.md +518 -0
  75. package/one/events/test-dashboard.md +345 -0
  76. package/one/events/test-index.md +361 -0
  77. package/one/events/test-report-ontology.md +582 -0
  78. package/one/events/testing-summary.md +344 -0
  79. package/one/groups/features.md +2878 -0
  80. package/one/groups/strategy copy.md +869 -0
  81. package/one/knowledge/backend-api-reference.md +710 -0
  82. package/one/knowledge/documentation-summary.md +285 -0
  83. package/one/knowledge/lessons-learned.md +294 -4
  84. package/one/knowledge/ontology-visual-guide.md +360 -0
  85. package/one/knowledge/ontology.md +9 -17
  86. package/one/things/demo-accessibility-animations.md +999 -0
  87. package/one/things/demo-components.md +1304 -0
  88. package/one/things/demo-design-summary.md +629 -0
  89. package/one/things/demo-design-system.md +919 -0
  90. package/one/things/demo-page-layouts.md +989 -0
  91. package/one/things/designs/accessibility-audit.md +790 -0
  92. package/one/things/designs/component-specifications.md +757 -0
  93. package/one/things/designs/design-overview.md +318 -0
  94. package/one/things/designs/design-tokens.md +414 -0
  95. package/one/things/designs/wireframes-dashboard.md +653 -0
  96. package/one/things/docs/api-requests.md +923 -0
  97. package/one/things/features/0 All Features.md +2 -0
  98. package/one/things/implementation/backend-guide.md +412 -0
  99. package/one/things/plans/2-backend-agnostic-frontend.md +11 -8
  100. package/one/things/plans/ai-elements.md +1259 -0
  101. package/one/things/plans/ai-integration.md +947 -0
  102. package/one/things/plans/ai-sdk.md +761 -0
  103. package/one/things/plans/app.md +1 -1
  104. package/one/things/plans/architecture-summary.md +283 -0
  105. package/one/things/plans/async-ai-agents.md +215 -0
  106. package/one/things/plans/backend-agnostic-frontend.md +11 -6
  107. package/one/things/plans/backend-cleanup-quickstart.md +346 -0
  108. package/one/things/plans/backend-ontology-conformance.md +416 -0
  109. package/one/things/plans/backend-status.md +541 -0
  110. package/one/things/plans/backend-structure.md +799 -0
  111. package/one/things/plans/backend-target-structure.md +438 -0
  112. package/one/things/plans/backend.md +1133 -0
  113. package/one/things/plans/better-auth-any-backend.md +11 -11
  114. package/one/things/plans/cli-updates-required.md +280 -0
  115. package/one/things/plans/complete-step-by-step.md +1302 -0
  116. package/one/things/plans/convex-agents.md +1005 -0
  117. package/one/things/plans/deployment-architecture.md +426 -0
  118. package/one/things/plans/development-plan.md +1220 -0
  119. package/one/things/plans/effect.md +808 -48
  120. package/one/things/plans/integrate-frontend-and-backend.md +579 -0
  121. package/one/things/plans/mcp-clear-context-prompt.md +60 -0
  122. package/one/things/plans/mcp-simple.md +228 -0
  123. package/one/things/plans/one.md +8 -7
  124. package/one/things/plans/ontology-6-dimensions.md +20 -14
  125. package/one/things/plans/quick-wins.md +1273 -0
  126. package/one/things/plans/readme-backend-cleanup.md +361 -0
  127. package/one/things/plans/separate-demo.md +830 -0
  128. package/one/things/plans/separate.md +3 -3
  129. package/one/things/plans/sequence.md +1897 -0
  130. package/one/things/plans/sync-checklist.md +321 -0
  131. package/one/things/plans/unified-implementation-plan.md +3 -3
  132. package/one/things/plans/update-demos.md +513 -0
  133. package/package.json +1 -1
  134. package/.claude/agents/backend-specialist.md +0 -169
  135. package/.claude/agents/designer.md +0 -216
  136. package/.claude/agents/frontend-specialist.md +0 -236
  137. package/.claude/commands/done.md +0 -35
  138. package/.claude/commands/infer.md +0 -138
  139. package/.claude/commands/next.md +0 -53
  140. package/.claude/commands/one copy.md +0 -565
  141. package/.claude/commands/one-template.md +0 -106
  142. package/.claude/commands/one-v1.md +0 -609
  143. package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
  144. package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
  145. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  146. package/one/groups/nine-padel-customers.md +0 -138
  147. package/one/groups/nine-padel-data-structure.md +0 -167
  148. package/one/groups/nine-padel-ontology-specification.md +0 -359
  149. package/one/groups/nine-padel-ontology.md +0 -143
  150. package/one/groups/nine-padel-strategy.md +0 -234
  151. package/one/groups/nine-padel.md +0 -211
  152. package/one/groups/nine-padle-contents.baked.md +0 -1252
  153. package/one/groups/nine-padle-contents.md +0 -6
  154. package/one/things/features/1-1-agent-prompts/design.md +0 -470
  155. package/one/things/features/1-1-agent-prompts/tests.md +0 -264
  156. package/one/things/features/1-2-yaml-orchestrator/design.md +0 -497
  157. package/one/things/features/1-2-yaml-orchestrator/tests.md +0 -227
  158. package/one/things/features/1-3-event-coordination/design.md +0 -544
  159. package/one/things/features/1-3-event-coordination/tests.md +0 -223
  160. package/one/things/features/1-4-knowledge-management/design.md +0 -609
  161. package/one/things/features/1-4-knowledge-management/tests.md +0 -195
  162. package/one/things/features/1-5-quality-loops/design.md +0 -797
  163. package/one/things/features/1-5-quality-loops/tests.md +0 -212
  164. package/one/things/features/1-6-numbering-structure/design.md +0 -610
  165. package/one/things/features/1-6-numbering-structure/tests.md +0 -213
  166. package/one/things/features/dataprovider-interface/1-tests.md +0 -1522
@@ -0,0 +1,416 @@
1
+ # Backend Ontology Conformance Plan
2
+
3
+ **Status**: Draft
4
+ **Created**: 2025-10-25
5
+ **Purpose**: Audit every `/backend/*` file and organize according to 6-dimension ontology
6
+ **Goal**: Beautiful, neat backend structure that maps 100% to groups, people, things, connections, events, knowledge
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ The backend has accumulated 200+ files with 50+ markdown documentation files scattered in the root. These need to be:
13
+ 1. **Assessed** - Confirm what each file does
14
+ 2. **Classified** - Map to 6-dimension ontology
15
+ 3. **Reorganized** - Move to appropriate `/one/*` directory
16
+ 4. **Consolidated** - Merge duplicates
17
+ 5. **Cleaned** - Delete obsolete files
18
+
19
+ ### Current State
20
+
21
+ **Files to organize:**
22
+ ```
23
+ /backend/ (root files scattered everywhere)
24
+ ├── BACKEND-STRUCTURE.md
25
+ ├── CONVEX-ANALYSIS-INDEX.md
26
+ ├── CONVEX-QUICK-REFERENCE.md
27
+ ├── CONVEX-STRUCTURE-ANALYSIS.md
28
+ ├── CONVEX-STRUCTURE-DIAGRAM.txt
29
+ ├── IMPLEMENTATION-GUIDE.md
30
+ ├── ONTOLOGY-FILE-STRUCTURE.md
31
+ ├── ONTOLOGY-INTEGRATION-TEST-REPORT.md
32
+ ├── ONTOLOGY-INTEGRATION-TEST-SUMMARY.md
33
+ ├── ONTOLOGY-TEST-EXAMPLES.md
34
+ ├── ONTOLOGY_QUERIES_EXAMPLE.md
35
+ ├── ONTOLOGY_VISUAL_GUIDE.md
36
+ ├── PERFECT-ONTOLOGY-STRUCTURE.md
37
+ ├── QUERIES_ONTOLOGY_COMPLETE.md
38
+ ├── QUERY_ONTOLOGY.md
39
+ ├── STRUCTURE-SUMMARY.txt
40
+ ├── TEST-DASHBOARD.md
41
+ ├── TEST-INDEX.md
42
+ ├── TEST-REPORT-ONTOLOGY.md
43
+ ├── TESTING-SUMMARY.md
44
+ ├── (+ 30+ more markdown files)
45
+ ├── lib/ (utilities, validation, ontology tools)
46
+ ├── test/ (test suites)
47
+ ├── _tests_disabled/ (disabled tests - cleanup candidate)
48
+ └── convex/ (main source)
49
+ ├── ontologies/ (feature ontology definitions)
50
+ ├── services/ (business logic services)
51
+ ├── types/ (type definitions)
52
+ └── (queries, mutations, actions, auth)
53
+ ```
54
+
55
+ ---
56
+
57
+ ## File Classification Matrix
58
+
59
+ ### 1. DOCUMENTATION FILES → `/one/things/`
60
+
61
+ These belong in the `/one` platform documentation:
62
+
63
+ | File | Type | Destination | Action |
64
+ |------|------|-------------|--------|
65
+ | `README.md` | Overview | Keep (root) | REVIEW - update to 6-dimension |
66
+ | `BACKEND-STRUCTURE.md` | Architecture | `/one/things/plans/backend-structure.md` | MOVE |
67
+ | `CONVEX-QUICK-REFERENCE.md` | Reference | `/one/things/convex-quick-reference.md` | MOVE |
68
+ | `IMPLEMENTATION-GUIDE.md` | Guide | `/one/things/implementation/backend-guide.md` | MOVE |
69
+ | `ONTOLOGY-FILE-STRUCTURE.md` | Structure | DUPLICATE (consolidate) | DELETE |
70
+ | `PERFECT-ONTOLOGY-STRUCTURE.md` | Reference | DUPLICATE (consolidate) | DELETE |
71
+ | `CONVEX-STRUCTURE-ANALYSIS.md` | Analysis | `/one/events/backend-structure-analysis.md` | MOVE |
72
+ | `CONVEX-STRUCTURE-DIAGRAM.txt` | Diagram | `/one/events/backend-structure-diagram.txt` | MOVE |
73
+ | `ONTOLOGY_VISUAL_GUIDE.md` | Guide | `/one/knowledge/ontology-visual-guide.md` | MOVE |
74
+
75
+ ### 2. TEST DOCUMENTATION → `/one/events/`
76
+
77
+ | File | Type | Destination | Action |
78
+ |------|------|-------------|--------|
79
+ | `TEST-DASHBOARD.md` | Test tracking | `/one/events/test-dashboard.md` | MOVE |
80
+ | `TEST-INDEX.md` | Test index | `/one/events/test-index.md` | MOVE |
81
+ | `TEST-REPORT-ONTOLOGY.md` | Test report | `/one/events/test-report-ontology.md` | MOVE |
82
+ | `TESTING-SUMMARY.md` | Summary | `/one/events/testing-summary.md` | MOVE |
83
+ | `ONTOLOGY-INTEGRATION-TEST-REPORT.md` | Test report | DUPLICATE | CONSOLIDATE |
84
+ | `ONTOLOGY-INTEGRATION-TEST-SUMMARY.md` | Test summary | DUPLICATE | CONSOLIDATE |
85
+ | `ONTOLOGY-TEST-EXAMPLES.md` | Examples | `/one/events/ontology-test-examples.md` | MOVE |
86
+ | `RUN_TESTS.md` (in test/) | Test guide | KEEP (in `/backend/test/`) | REVIEW |
87
+
88
+ ### 3. QUERY/API DOCUMENTATION → `/one/connections/`
89
+
90
+ | File | Type | Destination | Action |
91
+ |------|------|-------------|--------|
92
+ | `ONTOLOGY_QUERIES_EXAMPLE.md` | API examples | `/one/connections/api/ontology-queries.md` | MOVE |
93
+ | `QUERIES_ONTOLOGY_COMPLETE.md` | Query spec | `/one/connections/api/queries-complete.md` | MOVE |
94
+ | `QUERY_ONTOLOGY.md` | Query reference | DUPLICATE | CONSOLIDATE |
95
+ | `convex/queries/README.md` | Query guide | Keep in `/backend/convex/` | REVIEW |
96
+
97
+ ### 4. IMPLEMENTATION SPECIFICS → Keep in `/backend/`
98
+
99
+ These stay in backend (source code adjacent):
100
+
101
+ | File/Folder | Type | Action |
102
+ |-------------|------|--------|
103
+ | `convex/` | Source | **KEEP** - Main backend |
104
+ | `convex/schema.ts` | Core | **KEEP** - 6-dimension schema |
105
+ | `convex/auth.ts` | Core | **KEEP** - Authentication |
106
+ | `convex/http.ts` | Core | **KEEP** - HTTP endpoints |
107
+ | `convex/services/` | Code | **KEEP** - Business logic |
108
+ | `convex/ontologies/` | Config | **KEEP** - Feature definitions |
109
+ | `lib/` | Utilities | **KEEP** - Validation, loaders |
110
+ | `test/` | Tests | **KEEP** - Test suites |
111
+ | `_tests_disabled/` | Archived | **DELETE** - Obsolete |
112
+ | `examples/` | Examples | MOVE to `/one/knowledge/examples/` |
113
+ | `scripts/` | Scripts | KEEP in `/backend/` |
114
+ | `.env.local` | Config | KEEP (secret) |
115
+
116
+ ### 5. ANALYSIS FILES → `/one/events/` (Analysis & Insights)
117
+
118
+ | File | Type | Destination | Action |
119
+ |------|------|-------------|--------|
120
+ | `CONVEX-ANALYSIS-INDEX.md` | Analysis | `/one/events/convex-analysis-index.md` | MOVE |
121
+ | `STRUCTURE-SUMMARY.txt` | Summary | `/one/events/backend-structure-summary.txt` | MOVE |
122
+
123
+ ---
124
+
125
+ ## Ontology Mapping
126
+
127
+ ### Groups Dimension
128
+ - **Belongs**: Multi-tenant isolation configuration
129
+ - **Files affected**: `convex/schema.ts` (groups table)
130
+ - **Action**: REVIEW schema - ensure hierarchical nesting pattern documented
131
+
132
+ ### People Dimension
133
+ - **Belongs**: Authorization, roles, access control
134
+ - **Files affected**: `convex/auth.ts`, `convex/auth.config.ts`, `convex/mutations/people.ts`
135
+ - **Action**: KEEP all - core to platform
136
+
137
+ ### Things Dimension
138
+ - **Belongs**: Entity definitions, thing types, properties
139
+ - **Files affected**: `convex/schema.ts` (things table), `convex/ontologies/*.json`, `convex/types/ontology.ts`
140
+ - **Action**: KEEP all - core ontology definition
141
+
142
+ ### Connections Dimension
143
+ - **Belongs**: Relationship types, connection logic
144
+ - **Files affected**: `convex/schema.ts` (connections table), `convex/mutations/connections.ts`, `convex/queries/connections.ts`
145
+ - **Action**: KEEP all - core ontology definition
146
+
147
+ ### Events Dimension
148
+ - **Belongs**: Event logging, audit trail, action tracking
149
+ - **Files affected**: `convex/schema.ts` (events table), `convex/mutations/init.ts`, `convex/internalActions/events.ts`
150
+ - **Action**: KEEP all - core ontology definition
151
+
152
+ ### Knowledge Dimension
153
+ - **Belongs**: Embeddings, vectors, RAG, labels
154
+ - **Files affected**: `convex/schema.ts` (knowledge table), `convex/mutations/knowledge.ts`, `convex/queries/knowledge.ts`
155
+ - **Action**: KEEP all - core ontology definition
156
+
157
+ ---
158
+
159
+ ## Execution Plan (100-Inference Sequence)
160
+
161
+ ### Phase 1: AUDIT (Infer 1-10)
162
+
163
+ **Infer 1**: Review all 200+ root files
164
+ - Categorize by type (documentation, test, config, source)
165
+ - List in classification matrix above
166
+
167
+ **Infer 2**: Identify duplicates
168
+ - `ONTOLOGY-FILE-STRUCTURE.md` ≈ `PERFECT-ONTOLOGY-STRUCTURE.md`
169
+ - `ONTOLOGY-INTEGRATION-TEST-REPORT.md` ≈ `ONTOLOGY-INTEGRATION-TEST-SUMMARY.md`
170
+ - `QUERY_ONTOLOGY.md` ≈ `QUERIES_ONTOLOGY_COMPLETE.md` ≈ `ONTOLOGY_QUERIES_EXAMPLE.md`
171
+
172
+ **Infer 3**: Validate schema compliance
173
+ - Check `convex/schema.ts` maps to 6 dimensions
174
+ - Verify all tables present: groups, people (if separate), things, connections, events, knowledge
175
+ - Check indexes, relationships, constraints
176
+
177
+ **Infer 4**: Review test coverage
178
+ - Assess test files: `/backend/test/`, `_tests_disabled/`
179
+ - Determine if disabled tests should be deleted or re-enabled
180
+
181
+ **Infer 5**: Audit documentation quality
182
+ - Check for outdated information (e.g., "4-table" vs actual 6-dimension)
183
+ - Identify contradictions between files
184
+ - List accuracy issues
185
+
186
+ **Infer 6-10**: Plan-specific audits
187
+ - Services audit
188
+ - Types audit
189
+ - Examples audit
190
+ - Ontology definitions audit
191
+ - Library utilities audit
192
+
193
+ ### Phase 2: CONSOLIDATION (Infer 11-20)
194
+
195
+ **Infer 11**: Merge duplicate test reports
196
+ - Consolidate `ONTOLOGY-INTEGRATION-TEST-*.md` into single `/one/events/backend-integration-tests.md`
197
+
198
+ **Infer 12**: Merge query documentation
199
+ - Consolidate `QUERY_ONTOLOGY.md`, `QUERIES_ONTOLOGY_COMPLETE.md`, `ONTOLOGY_QUERIES_EXAMPLE.md`
200
+ - Create single `/one/connections/api/queries-guide.md`
201
+
202
+ **Infer 13**: Consolidate structure documentation
203
+ - Merge `ONTOLOGY-FILE-STRUCTURE.md`, `PERFECT-ONTOLOGY-STRUCTURE.md`, `BACKEND-STRUCTURE.md`
204
+ - Create single `/one/things/plans/backend-structure.md`
205
+
206
+ **Infer 14**: Audit ontology definitions
207
+ - Review all files in `convex/ontologies/*.json`
208
+ - Verify they're correctly referenced
209
+ - Move or keep based on usage
210
+
211
+ **Infer 15**: Review service layer
212
+ - Audit each file in `convex/services/`
213
+ - Ensure 100% ontology-aligned
214
+ - Document patterns
215
+
216
+ **Infer 16**: Audit types
217
+ - Review `convex/types/ontology.ts`
218
+ - Verify auto-generation works
219
+ - Document type generation process
220
+
221
+ **Infer 17**: Assess examples
222
+ - Review `backend/examples/`
223
+ - Move to `/one/knowledge/examples/`
224
+
225
+ **Infer 18**: Evaluate disabled tests
226
+ - Decide: re-enable, delete, or archive
227
+ - Update `_tests_disabled/README.md` with decisions
228
+
229
+ **Infer 19**: Review lib utilities
230
+ - Document each utility
231
+ - Determine if needed or obsolete
232
+
233
+ **Infer 20**: Plan deletion candidates
234
+ - List all files to delete
235
+ - Verify no dependencies
236
+
237
+ ### Phase 3: REORGANIZATION (Infer 21-40)
238
+
239
+ **Infer 21-25**: Move documentation to `/one/`
240
+ - Create target directories in `/one/things/`, `/one/events/`, `/one/connections/`
241
+ - Move files per classification matrix
242
+
243
+ **Infer 26-30**: Move examples to `/one/knowledge/`
244
+ - Transfer `backend/examples/` content
245
+ - Create index
246
+
247
+ **Infer 31-35**: Clean up backend root
248
+ - Delete moved files from `/backend/`
249
+ - Verify no broken references
250
+
251
+ **Infer 36-40**: Update all references
252
+ - Update links in remaining files
253
+ - Verify docs build correctly
254
+ - Test all cross-references
255
+
256
+ ### Phase 4: CLEANUP (Infer 41-50)
257
+
258
+ **Infer 41**: Delete disabled tests
259
+ - Remove `backend/_tests_disabled/` directory
260
+ - Verify no other references
261
+
262
+ **Infer 42**: Remove duplicate files
263
+ - Delete consolidated files
264
+ - Create deprecation notices in `/one/events/`
265
+
266
+ **Infer 43**: Update backend README
267
+ - Reflect new documentation structure
268
+ - Point to `/one/` for detailed guides
269
+
270
+ **Infer 44**: Create index in `/one/things/`
271
+ - List all backend-related documentation
272
+ - Organize by dimension
273
+
274
+ **Infer 45**: Validate 6-dimension compliance
275
+ - Run ontology validator
276
+ - Confirm all tables present and properly indexed
277
+ - Verify schema matches specification
278
+
279
+ ### Phase 5: VERIFICATION (Infer 51-60)
280
+
281
+ **Infer 51**: Test all imports
282
+ - Verify no broken imports in backend code
283
+ - Check TypeScript compilation
284
+
285
+ **Infer 52**: Validate documentation links
286
+ - Test all markdown links work
287
+ - Verify `/one/` references valid
288
+
289
+ **Infer 53**: Review convex/schema.ts
290
+ - Ensure all 6 dimensions present
291
+ - Check indexes match specification
292
+ - Verify type unions correct
293
+
294
+ **Infer 54**: Test convex operations
295
+ - Run sample queries
296
+ - Run sample mutations
297
+ - Verify auth flows
298
+
299
+ **Infer 55**: Audit file permissions
300
+ - Ensure secrets properly excluded (`.env.local` in `.gitignore`)
301
+ - Check all source files readable
302
+
303
+ **Infer 56-60**: Final QA
304
+ - Full build test
305
+ - Type checking
306
+ - Documentation completeness check
307
+ - Manual review of organized structure
308
+
309
+ ---
310
+
311
+ ## Expected Outcome
312
+
313
+ ### Before
314
+ ```
315
+ /backend/
316
+ ├── 50+ markdown files (scattered, duplicated)
317
+ ├── README.md (outdated - says "4-table" instead of 6-dimension)
318
+ ├── convex/
319
+ ├── lib/
320
+ ├── test/
321
+ ├── _tests_disabled/
322
+ └── examples/
323
+ ```
324
+
325
+ ### After
326
+ ```
327
+ /backend/
328
+ ├── README.md (updated - points to /one/)
329
+ ├── convex/ (clean, well-organized)
330
+ ├── lib/ (focused utilities only)
331
+ ├── test/ (active tests only)
332
+ ├── scripts/
333
+ └── package.json
334
+
335
+ /one/
336
+ ├── things/plans/
337
+ │ ├── backend-ontology-conformance.md (this file)
338
+ │ ├── backend-structure.md (merged docs)
339
+ │ └── implementation/
340
+ │ └── backend-guide.md
341
+ ├── connections/api/
342
+ │ ├── queries-guide.md (consolidated)
343
+ │ └── mutations-guide.md
344
+ ├── events/
345
+ │ ├── backend-integration-tests.md
346
+ │ ├── backend-structure-analysis.md
347
+ │ ├── testing-summary.md
348
+ │ └── backend-structure-summary.txt
349
+ ├── knowledge/
350
+ │ └── examples/
351
+ │ ├── complete-newsletter-example/
352
+ │ └── ontology-types-usage.ts
353
+ └── people/
354
+ └── backend-roles.md (auth/people dimension)
355
+ ```
356
+
357
+ ---
358
+
359
+ ## Success Criteria
360
+
361
+ ✅ **Every backend file mapped** to 6-dimension ontology
362
+ ✅ **Zero duplicates** - consolidated or deleted
363
+ ✅ **No scattered documentation** - all in `/one/`
364
+ ✅ **TypeScript compilation** - zero errors
365
+ ✅ **All tests passing** - or archived
366
+ ✅ **Schema validation** - 6 dimensions present + indexed
367
+ ✅ **Documentation links** - all working
368
+ ✅ **Backend README** - updated to reflect new structure
369
+
370
+ ---
371
+
372
+ ## Risk Mitigation
373
+
374
+ | Risk | Mitigation |
375
+ |------|-----------|
376
+ | Broken imports | Run TypeScript check after each move |
377
+ | Lost documentation | Keep originals until verified in new location |
378
+ | Schema changes | Don't touch schema.ts - only organize docs |
379
+ | Test failures | Archive disabled tests before deleting |
380
+ | Link breaks | Use grep to find all references before moving |
381
+
382
+ ---
383
+
384
+ ## Commands to Execute
385
+
386
+ ```bash
387
+ # Phase 1: Audit
388
+ grep -r "THINGS\|CONNECTIONS\|EVENTS\|GROUPS\|PEOPLE\|KNOWLEDGE" /backend --include="*.md"
389
+
390
+ # Phase 3: Move documentation
391
+ mkdir -p /one/things/plans/
392
+ mkdir -p /one/connections/api/
393
+ mkdir -p /one/events/
394
+ mv /backend/BACKEND-STRUCTURE.md /one/things/plans/
395
+
396
+ # Phase 4: Delete duplicates
397
+ rm /backend/PERFECT-ONTOLOGY-STRUCTURE.md
398
+ rm /backend/ONTOLOGY-FILE-STRUCTURE.md
399
+
400
+ # Phase 5: Verify
401
+ cd /backend && npx tsc --noEmit
402
+ ```
403
+
404
+ ---
405
+
406
+ ## Next Steps
407
+
408
+ 1. Review this plan
409
+ 2. Approve high-level approach
410
+ 3. Execute Phase 1 (Audit) - Infer 1-10
411
+ 4. Generate detailed file manifest
412
+ 5. Begin consolidation (Infer 11-20)
413
+
414
+ **Status**: Ready for execution
415
+ **Owner**: Agent-clean / Agent-backend
416
+ **Timeline**: 100 inferences (estimated 5-10 hours of focused work)