@cleocode/core 2026.3.57 → 2026.3.59

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 (136) hide show
  1. package/dist/agents/agent-registry.d.ts +206 -0
  2. package/dist/agents/agent-registry.d.ts.map +1 -0
  3. package/dist/agents/agent-schema.d.ts.map +1 -1
  4. package/dist/agents/execution-learning.d.ts +223 -0
  5. package/dist/agents/execution-learning.d.ts.map +1 -0
  6. package/dist/agents/health-monitor.d.ts +161 -0
  7. package/dist/agents/health-monitor.d.ts.map +1 -0
  8. package/dist/agents/index.d.ts +4 -1
  9. package/dist/agents/index.d.ts.map +1 -1
  10. package/dist/agents/retry.d.ts +57 -4
  11. package/dist/agents/retry.d.ts.map +1 -1
  12. package/dist/backfill/index.d.ts +83 -0
  13. package/dist/backfill/index.d.ts.map +1 -0
  14. package/dist/bootstrap.d.ts +1 -1
  15. package/dist/config.d.ts +47 -0
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/index.d.ts +2 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +6985 -5068
  20. package/dist/index.js.map +4 -4
  21. package/dist/intelligence/adaptive-validation.d.ts +151 -0
  22. package/dist/intelligence/adaptive-validation.d.ts.map +1 -0
  23. package/dist/intelligence/impact.d.ts +34 -1
  24. package/dist/intelligence/impact.d.ts.map +1 -1
  25. package/dist/intelligence/index.d.ts +7 -2
  26. package/dist/intelligence/index.d.ts.map +1 -1
  27. package/dist/intelligence/types.d.ts +60 -0
  28. package/dist/intelligence/types.d.ts.map +1 -1
  29. package/dist/internal.d.ts +8 -4
  30. package/dist/internal.d.ts.map +1 -1
  31. package/dist/lib/index.d.ts +10 -0
  32. package/dist/lib/index.d.ts.map +1 -0
  33. package/dist/lib/retry.d.ts +128 -0
  34. package/dist/lib/retry.d.ts.map +1 -0
  35. package/dist/nexus/sharing/index.d.ts +48 -2
  36. package/dist/nexus/sharing/index.d.ts.map +1 -1
  37. package/dist/sessions/session-enforcement.d.ts.map +1 -1
  38. package/dist/stats/index.d.ts +1 -0
  39. package/dist/stats/index.d.ts.map +1 -1
  40. package/dist/stats/workflow-telemetry.d.ts +89 -0
  41. package/dist/stats/workflow-telemetry.d.ts.map +1 -0
  42. package/dist/store/brain-schema.d.ts.map +1 -1
  43. package/dist/store/converters.d.ts.map +1 -1
  44. package/dist/store/cross-db-cleanup.d.ts +93 -0
  45. package/dist/store/cross-db-cleanup.d.ts.map +1 -0
  46. package/dist/store/db-helpers.d.ts.map +1 -1
  47. package/dist/store/migration-sqlite.d.ts.map +1 -1
  48. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  49. package/dist/store/sqlite.d.ts.map +1 -1
  50. package/dist/store/task-store.d.ts.map +1 -1
  51. package/dist/store/tasks-schema.d.ts +18 -3
  52. package/dist/store/tasks-schema.d.ts.map +1 -1
  53. package/dist/store/validation-schemas.d.ts +32 -0
  54. package/dist/store/validation-schemas.d.ts.map +1 -1
  55. package/dist/tasks/add.d.ts +10 -1
  56. package/dist/tasks/add.d.ts.map +1 -1
  57. package/dist/tasks/complete.d.ts.map +1 -1
  58. package/dist/tasks/enforcement.d.ts +22 -0
  59. package/dist/tasks/enforcement.d.ts.map +1 -0
  60. package/dist/tasks/epic-enforcement.d.ts +199 -0
  61. package/dist/tasks/epic-enforcement.d.ts.map +1 -0
  62. package/dist/tasks/index.d.ts +1 -1
  63. package/dist/tasks/index.d.ts.map +1 -1
  64. package/dist/tasks/pipeline-stage.d.ts +181 -0
  65. package/dist/tasks/pipeline-stage.d.ts.map +1 -0
  66. package/dist/tasks/update.d.ts +2 -0
  67. package/dist/tasks/update.d.ts.map +1 -1
  68. package/migrations/drizzle-brain/20260321000001_t033-brain-indexes/migration.sql +12 -0
  69. package/migrations/drizzle-brain/20260321000001_t033-brain-indexes/snapshot.json +1232 -0
  70. package/migrations/drizzle-tasks/20260321000000_t033-connection-health/migration.sql +518 -0
  71. package/migrations/drizzle-tasks/20260321000000_t033-connection-health/snapshot.json +4312 -0
  72. package/migrations/drizzle-tasks/20260321000002_t060-pipeline-stage-binding/migration.sql +82 -0
  73. package/migrations/drizzle-tasks/20260321000002_t060-pipeline-stage-binding/snapshot.json +9 -0
  74. package/package.json +5 -5
  75. package/schemas/config.schema.json +37 -1547
  76. package/src/__tests__/sharing.test.ts +24 -0
  77. package/src/agents/__tests__/agent-registry.test.ts +351 -0
  78. package/src/agents/__tests__/execution-learning.test.ts +684 -0
  79. package/src/agents/__tests__/health-monitor.test.ts +332 -0
  80. package/src/agents/__tests__/registry.test.ts +30 -2
  81. package/src/agents/agent-registry.ts +394 -0
  82. package/src/agents/agent-schema.ts +5 -0
  83. package/src/agents/execution-learning.ts +675 -0
  84. package/src/agents/health-monitor.ts +279 -0
  85. package/src/agents/index.ts +37 -1
  86. package/src/agents/retry.ts +57 -4
  87. package/src/backfill/index.ts +309 -0
  88. package/src/bootstrap.ts +1 -1
  89. package/src/config.ts +126 -0
  90. package/src/index.ts +8 -1
  91. package/src/intelligence/__tests__/adaptive-validation.test.ts +694 -0
  92. package/src/intelligence/__tests__/impact.test.ts +165 -1
  93. package/src/intelligence/adaptive-validation.ts +764 -0
  94. package/src/intelligence/impact.ts +203 -0
  95. package/src/intelligence/index.ts +19 -0
  96. package/src/intelligence/types.ts +76 -0
  97. package/src/internal.ts +39 -0
  98. package/src/lib/__tests__/retry.test.ts +321 -0
  99. package/src/lib/index.ts +16 -0
  100. package/src/lib/retry.ts +224 -0
  101. package/src/lifecycle/__tests__/chain-store.test.ts +7 -0
  102. package/src/lifecycle/__tests__/tessera-engine.test.ts +52 -0
  103. package/src/nexus/sharing/index.ts +142 -2
  104. package/src/sessions/__tests__/session-edge-cases.test.ts +24 -1
  105. package/src/sessions/session-enforcement.ts +13 -2
  106. package/src/stats/index.ts +7 -0
  107. package/src/stats/workflow-telemetry.ts +502 -0
  108. package/src/store/__tests__/migration-safety.test.ts +3 -0
  109. package/src/store/__tests__/session-store.test.ts +132 -1
  110. package/src/store/__tests__/task-store.test.ts +22 -1
  111. package/src/store/__tests__/test-db-helper.ts +29 -2
  112. package/src/store/brain-schema.ts +4 -1
  113. package/src/store/converters.ts +2 -0
  114. package/src/store/cross-db-cleanup.ts +192 -0
  115. package/src/store/db-helpers.ts +2 -0
  116. package/src/store/migration-sqlite.ts +6 -0
  117. package/src/store/sqlite-data-accessor.ts +20 -28
  118. package/src/store/sqlite.ts +14 -2
  119. package/src/store/task-store.ts +6 -0
  120. package/src/store/tasks-schema.ts +59 -20
  121. package/src/tasks/__tests__/add.test.ts +16 -0
  122. package/src/tasks/__tests__/complete-unblocks.test.ts +10 -1
  123. package/src/tasks/__tests__/complete.test.ts +11 -2
  124. package/src/tasks/__tests__/epic-enforcement.test.ts +909 -0
  125. package/src/tasks/__tests__/minimal-test.test.ts +28 -0
  126. package/src/tasks/__tests__/pipeline-stage.test.ts +403 -0
  127. package/src/tasks/__tests__/update.test.ts +40 -6
  128. package/src/tasks/add.ts +128 -2
  129. package/src/tasks/complete.ts +29 -17
  130. package/src/tasks/enforcement.ts +127 -0
  131. package/src/tasks/epic-enforcement.ts +364 -0
  132. package/src/tasks/index.ts +1 -0
  133. package/src/tasks/pipeline-stage.ts +293 -0
  134. package/src/tasks/update.ts +62 -0
  135. package/templates/config.template.json +34 -111
  136. package/templates/global-config.template.json +24 -40
@@ -0,0 +1,1232 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "sqlite",
4
+ "id": "t033-brain-indexes-20260321",
5
+ "prevIds": [
6
+ "5c01d08d-3186-4dc7-a8f2-f936574c4456"
7
+ ],
8
+ "ddl": [
9
+ {
10
+ "name": "brain_decisions",
11
+ "entityType": "tables"
12
+ },
13
+ {
14
+ "name": "brain_learnings",
15
+ "entityType": "tables"
16
+ },
17
+ {
18
+ "name": "brain_memory_links",
19
+ "entityType": "tables"
20
+ },
21
+ {
22
+ "name": "brain_observations",
23
+ "entityType": "tables"
24
+ },
25
+ {
26
+ "name": "brain_page_edges",
27
+ "entityType": "tables"
28
+ },
29
+ {
30
+ "name": "brain_page_nodes",
31
+ "entityType": "tables"
32
+ },
33
+ {
34
+ "name": "brain_patterns",
35
+ "entityType": "tables"
36
+ },
37
+ {
38
+ "name": "brain_schema_meta",
39
+ "entityType": "tables"
40
+ },
41
+ {
42
+ "name": "brain_sticky_notes",
43
+ "entityType": "tables"
44
+ },
45
+ {
46
+ "type": "text",
47
+ "notNull": false,
48
+ "autoincrement": false,
49
+ "default": null,
50
+ "generated": null,
51
+ "name": "id",
52
+ "entityType": "columns",
53
+ "table": "brain_decisions"
54
+ },
55
+ {
56
+ "type": "text",
57
+ "notNull": true,
58
+ "autoincrement": false,
59
+ "default": null,
60
+ "generated": null,
61
+ "name": "type",
62
+ "entityType": "columns",
63
+ "table": "brain_decisions"
64
+ },
65
+ {
66
+ "type": "text",
67
+ "notNull": true,
68
+ "autoincrement": false,
69
+ "default": null,
70
+ "generated": null,
71
+ "name": "decision",
72
+ "entityType": "columns",
73
+ "table": "brain_decisions"
74
+ },
75
+ {
76
+ "type": "text",
77
+ "notNull": true,
78
+ "autoincrement": false,
79
+ "default": null,
80
+ "generated": null,
81
+ "name": "rationale",
82
+ "entityType": "columns",
83
+ "table": "brain_decisions"
84
+ },
85
+ {
86
+ "type": "text",
87
+ "notNull": true,
88
+ "autoincrement": false,
89
+ "default": null,
90
+ "generated": null,
91
+ "name": "confidence",
92
+ "entityType": "columns",
93
+ "table": "brain_decisions"
94
+ },
95
+ {
96
+ "type": "text",
97
+ "notNull": false,
98
+ "autoincrement": false,
99
+ "default": null,
100
+ "generated": null,
101
+ "name": "outcome",
102
+ "entityType": "columns",
103
+ "table": "brain_decisions"
104
+ },
105
+ {
106
+ "type": "text",
107
+ "notNull": false,
108
+ "autoincrement": false,
109
+ "default": null,
110
+ "generated": null,
111
+ "name": "alternatives_json",
112
+ "entityType": "columns",
113
+ "table": "brain_decisions"
114
+ },
115
+ {
116
+ "type": "text",
117
+ "notNull": false,
118
+ "autoincrement": false,
119
+ "default": null,
120
+ "generated": null,
121
+ "name": "context_epic_id",
122
+ "entityType": "columns",
123
+ "table": "brain_decisions"
124
+ },
125
+ {
126
+ "type": "text",
127
+ "notNull": false,
128
+ "autoincrement": false,
129
+ "default": null,
130
+ "generated": null,
131
+ "name": "context_task_id",
132
+ "entityType": "columns",
133
+ "table": "brain_decisions"
134
+ },
135
+ {
136
+ "type": "text",
137
+ "notNull": false,
138
+ "autoincrement": false,
139
+ "default": null,
140
+ "generated": null,
141
+ "name": "context_phase",
142
+ "entityType": "columns",
143
+ "table": "brain_decisions"
144
+ },
145
+ {
146
+ "type": "text",
147
+ "notNull": true,
148
+ "autoincrement": false,
149
+ "default": "(datetime('now'))",
150
+ "generated": null,
151
+ "name": "created_at",
152
+ "entityType": "columns",
153
+ "table": "brain_decisions"
154
+ },
155
+ {
156
+ "type": "text",
157
+ "notNull": false,
158
+ "autoincrement": false,
159
+ "default": null,
160
+ "generated": null,
161
+ "name": "updated_at",
162
+ "entityType": "columns",
163
+ "table": "brain_decisions"
164
+ },
165
+ {
166
+ "type": "text",
167
+ "notNull": false,
168
+ "autoincrement": false,
169
+ "default": null,
170
+ "generated": null,
171
+ "name": "id",
172
+ "entityType": "columns",
173
+ "table": "brain_learnings"
174
+ },
175
+ {
176
+ "type": "text",
177
+ "notNull": true,
178
+ "autoincrement": false,
179
+ "default": null,
180
+ "generated": null,
181
+ "name": "insight",
182
+ "entityType": "columns",
183
+ "table": "brain_learnings"
184
+ },
185
+ {
186
+ "type": "text",
187
+ "notNull": true,
188
+ "autoincrement": false,
189
+ "default": null,
190
+ "generated": null,
191
+ "name": "source",
192
+ "entityType": "columns",
193
+ "table": "brain_learnings"
194
+ },
195
+ {
196
+ "type": "real",
197
+ "notNull": true,
198
+ "autoincrement": false,
199
+ "default": null,
200
+ "generated": null,
201
+ "name": "confidence",
202
+ "entityType": "columns",
203
+ "table": "brain_learnings"
204
+ },
205
+ {
206
+ "type": "integer",
207
+ "notNull": true,
208
+ "autoincrement": false,
209
+ "default": "false",
210
+ "generated": null,
211
+ "name": "actionable",
212
+ "entityType": "columns",
213
+ "table": "brain_learnings"
214
+ },
215
+ {
216
+ "type": "text",
217
+ "notNull": false,
218
+ "autoincrement": false,
219
+ "default": null,
220
+ "generated": null,
221
+ "name": "application",
222
+ "entityType": "columns",
223
+ "table": "brain_learnings"
224
+ },
225
+ {
226
+ "type": "text",
227
+ "notNull": false,
228
+ "autoincrement": false,
229
+ "default": null,
230
+ "generated": null,
231
+ "name": "applicable_types_json",
232
+ "entityType": "columns",
233
+ "table": "brain_learnings"
234
+ },
235
+ {
236
+ "type": "text",
237
+ "notNull": true,
238
+ "autoincrement": false,
239
+ "default": "(datetime('now'))",
240
+ "generated": null,
241
+ "name": "created_at",
242
+ "entityType": "columns",
243
+ "table": "brain_learnings"
244
+ },
245
+ {
246
+ "type": "text",
247
+ "notNull": false,
248
+ "autoincrement": false,
249
+ "default": null,
250
+ "generated": null,
251
+ "name": "updated_at",
252
+ "entityType": "columns",
253
+ "table": "brain_learnings"
254
+ },
255
+ {
256
+ "type": "text",
257
+ "notNull": true,
258
+ "autoincrement": false,
259
+ "default": null,
260
+ "generated": null,
261
+ "name": "memory_type",
262
+ "entityType": "columns",
263
+ "table": "brain_memory_links"
264
+ },
265
+ {
266
+ "type": "text",
267
+ "notNull": true,
268
+ "autoincrement": false,
269
+ "default": null,
270
+ "generated": null,
271
+ "name": "memory_id",
272
+ "entityType": "columns",
273
+ "table": "brain_memory_links"
274
+ },
275
+ {
276
+ "type": "text",
277
+ "notNull": true,
278
+ "autoincrement": false,
279
+ "default": null,
280
+ "generated": null,
281
+ "name": "task_id",
282
+ "entityType": "columns",
283
+ "table": "brain_memory_links"
284
+ },
285
+ {
286
+ "type": "text",
287
+ "notNull": true,
288
+ "autoincrement": false,
289
+ "default": null,
290
+ "generated": null,
291
+ "name": "link_type",
292
+ "entityType": "columns",
293
+ "table": "brain_memory_links"
294
+ },
295
+ {
296
+ "type": "text",
297
+ "notNull": true,
298
+ "autoincrement": false,
299
+ "default": "(datetime('now'))",
300
+ "generated": null,
301
+ "name": "created_at",
302
+ "entityType": "columns",
303
+ "table": "brain_memory_links"
304
+ },
305
+ {
306
+ "type": "text",
307
+ "notNull": false,
308
+ "autoincrement": false,
309
+ "default": null,
310
+ "generated": null,
311
+ "name": "id",
312
+ "entityType": "columns",
313
+ "table": "brain_observations"
314
+ },
315
+ {
316
+ "type": "text",
317
+ "notNull": true,
318
+ "autoincrement": false,
319
+ "default": null,
320
+ "generated": null,
321
+ "name": "type",
322
+ "entityType": "columns",
323
+ "table": "brain_observations"
324
+ },
325
+ {
326
+ "type": "text",
327
+ "notNull": true,
328
+ "autoincrement": false,
329
+ "default": null,
330
+ "generated": null,
331
+ "name": "title",
332
+ "entityType": "columns",
333
+ "table": "brain_observations"
334
+ },
335
+ {
336
+ "type": "text",
337
+ "notNull": false,
338
+ "autoincrement": false,
339
+ "default": null,
340
+ "generated": null,
341
+ "name": "subtitle",
342
+ "entityType": "columns",
343
+ "table": "brain_observations"
344
+ },
345
+ {
346
+ "type": "text",
347
+ "notNull": false,
348
+ "autoincrement": false,
349
+ "default": null,
350
+ "generated": null,
351
+ "name": "narrative",
352
+ "entityType": "columns",
353
+ "table": "brain_observations"
354
+ },
355
+ {
356
+ "type": "text",
357
+ "notNull": false,
358
+ "autoincrement": false,
359
+ "default": null,
360
+ "generated": null,
361
+ "name": "facts_json",
362
+ "entityType": "columns",
363
+ "table": "brain_observations"
364
+ },
365
+ {
366
+ "type": "text",
367
+ "notNull": false,
368
+ "autoincrement": false,
369
+ "default": null,
370
+ "generated": null,
371
+ "name": "concepts_json",
372
+ "entityType": "columns",
373
+ "table": "brain_observations"
374
+ },
375
+ {
376
+ "type": "text",
377
+ "notNull": false,
378
+ "autoincrement": false,
379
+ "default": null,
380
+ "generated": null,
381
+ "name": "project",
382
+ "entityType": "columns",
383
+ "table": "brain_observations"
384
+ },
385
+ {
386
+ "type": "text",
387
+ "notNull": false,
388
+ "autoincrement": false,
389
+ "default": null,
390
+ "generated": null,
391
+ "name": "files_read_json",
392
+ "entityType": "columns",
393
+ "table": "brain_observations"
394
+ },
395
+ {
396
+ "type": "text",
397
+ "notNull": false,
398
+ "autoincrement": false,
399
+ "default": null,
400
+ "generated": null,
401
+ "name": "files_modified_json",
402
+ "entityType": "columns",
403
+ "table": "brain_observations"
404
+ },
405
+ {
406
+ "type": "text",
407
+ "notNull": false,
408
+ "autoincrement": false,
409
+ "default": null,
410
+ "generated": null,
411
+ "name": "source_session_id",
412
+ "entityType": "columns",
413
+ "table": "brain_observations"
414
+ },
415
+ {
416
+ "type": "text",
417
+ "notNull": true,
418
+ "autoincrement": false,
419
+ "default": "'agent'",
420
+ "generated": null,
421
+ "name": "source_type",
422
+ "entityType": "columns",
423
+ "table": "brain_observations"
424
+ },
425
+ {
426
+ "type": "text",
427
+ "notNull": false,
428
+ "autoincrement": false,
429
+ "default": null,
430
+ "generated": null,
431
+ "name": "content_hash",
432
+ "entityType": "columns",
433
+ "table": "brain_observations"
434
+ },
435
+ {
436
+ "type": "integer",
437
+ "notNull": false,
438
+ "autoincrement": false,
439
+ "default": null,
440
+ "generated": null,
441
+ "name": "discovery_tokens",
442
+ "entityType": "columns",
443
+ "table": "brain_observations"
444
+ },
445
+ {
446
+ "type": "text",
447
+ "notNull": true,
448
+ "autoincrement": false,
449
+ "default": "(datetime('now'))",
450
+ "generated": null,
451
+ "name": "created_at",
452
+ "entityType": "columns",
453
+ "table": "brain_observations"
454
+ },
455
+ {
456
+ "type": "text",
457
+ "notNull": false,
458
+ "autoincrement": false,
459
+ "default": null,
460
+ "generated": null,
461
+ "name": "updated_at",
462
+ "entityType": "columns",
463
+ "table": "brain_observations"
464
+ },
465
+ {
466
+ "type": "text",
467
+ "notNull": true,
468
+ "autoincrement": false,
469
+ "default": null,
470
+ "generated": null,
471
+ "name": "from_id",
472
+ "entityType": "columns",
473
+ "table": "brain_page_edges"
474
+ },
475
+ {
476
+ "type": "text",
477
+ "notNull": true,
478
+ "autoincrement": false,
479
+ "default": null,
480
+ "generated": null,
481
+ "name": "to_id",
482
+ "entityType": "columns",
483
+ "table": "brain_page_edges"
484
+ },
485
+ {
486
+ "type": "text",
487
+ "notNull": true,
488
+ "autoincrement": false,
489
+ "default": null,
490
+ "generated": null,
491
+ "name": "edge_type",
492
+ "entityType": "columns",
493
+ "table": "brain_page_edges"
494
+ },
495
+ {
496
+ "type": "real",
497
+ "notNull": false,
498
+ "autoincrement": false,
499
+ "default": "1",
500
+ "generated": null,
501
+ "name": "weight",
502
+ "entityType": "columns",
503
+ "table": "brain_page_edges"
504
+ },
505
+ {
506
+ "type": "text",
507
+ "notNull": true,
508
+ "autoincrement": false,
509
+ "default": "(datetime('now'))",
510
+ "generated": null,
511
+ "name": "created_at",
512
+ "entityType": "columns",
513
+ "table": "brain_page_edges"
514
+ },
515
+ {
516
+ "type": "text",
517
+ "notNull": false,
518
+ "autoincrement": false,
519
+ "default": null,
520
+ "generated": null,
521
+ "name": "id",
522
+ "entityType": "columns",
523
+ "table": "brain_page_nodes"
524
+ },
525
+ {
526
+ "type": "text",
527
+ "notNull": true,
528
+ "autoincrement": false,
529
+ "default": null,
530
+ "generated": null,
531
+ "name": "node_type",
532
+ "entityType": "columns",
533
+ "table": "brain_page_nodes"
534
+ },
535
+ {
536
+ "type": "text",
537
+ "notNull": true,
538
+ "autoincrement": false,
539
+ "default": null,
540
+ "generated": null,
541
+ "name": "label",
542
+ "entityType": "columns",
543
+ "table": "brain_page_nodes"
544
+ },
545
+ {
546
+ "type": "text",
547
+ "notNull": false,
548
+ "autoincrement": false,
549
+ "default": null,
550
+ "generated": null,
551
+ "name": "metadata_json",
552
+ "entityType": "columns",
553
+ "table": "brain_page_nodes"
554
+ },
555
+ {
556
+ "type": "text",
557
+ "notNull": true,
558
+ "autoincrement": false,
559
+ "default": "(datetime('now'))",
560
+ "generated": null,
561
+ "name": "created_at",
562
+ "entityType": "columns",
563
+ "table": "brain_page_nodes"
564
+ },
565
+ {
566
+ "type": "text",
567
+ "notNull": false,
568
+ "autoincrement": false,
569
+ "default": null,
570
+ "generated": null,
571
+ "name": "id",
572
+ "entityType": "columns",
573
+ "table": "brain_patterns"
574
+ },
575
+ {
576
+ "type": "text",
577
+ "notNull": true,
578
+ "autoincrement": false,
579
+ "default": null,
580
+ "generated": null,
581
+ "name": "type",
582
+ "entityType": "columns",
583
+ "table": "brain_patterns"
584
+ },
585
+ {
586
+ "type": "text",
587
+ "notNull": true,
588
+ "autoincrement": false,
589
+ "default": null,
590
+ "generated": null,
591
+ "name": "pattern",
592
+ "entityType": "columns",
593
+ "table": "brain_patterns"
594
+ },
595
+ {
596
+ "type": "text",
597
+ "notNull": true,
598
+ "autoincrement": false,
599
+ "default": null,
600
+ "generated": null,
601
+ "name": "context",
602
+ "entityType": "columns",
603
+ "table": "brain_patterns"
604
+ },
605
+ {
606
+ "type": "integer",
607
+ "notNull": true,
608
+ "autoincrement": false,
609
+ "default": "1",
610
+ "generated": null,
611
+ "name": "frequency",
612
+ "entityType": "columns",
613
+ "table": "brain_patterns"
614
+ },
615
+ {
616
+ "type": "real",
617
+ "notNull": false,
618
+ "autoincrement": false,
619
+ "default": null,
620
+ "generated": null,
621
+ "name": "success_rate",
622
+ "entityType": "columns",
623
+ "table": "brain_patterns"
624
+ },
625
+ {
626
+ "type": "text",
627
+ "notNull": false,
628
+ "autoincrement": false,
629
+ "default": null,
630
+ "generated": null,
631
+ "name": "impact",
632
+ "entityType": "columns",
633
+ "table": "brain_patterns"
634
+ },
635
+ {
636
+ "type": "text",
637
+ "notNull": false,
638
+ "autoincrement": false,
639
+ "default": null,
640
+ "generated": null,
641
+ "name": "anti_pattern",
642
+ "entityType": "columns",
643
+ "table": "brain_patterns"
644
+ },
645
+ {
646
+ "type": "text",
647
+ "notNull": false,
648
+ "autoincrement": false,
649
+ "default": null,
650
+ "generated": null,
651
+ "name": "mitigation",
652
+ "entityType": "columns",
653
+ "table": "brain_patterns"
654
+ },
655
+ {
656
+ "type": "text",
657
+ "notNull": false,
658
+ "autoincrement": false,
659
+ "default": "'[]'",
660
+ "generated": null,
661
+ "name": "examples_json",
662
+ "entityType": "columns",
663
+ "table": "brain_patterns"
664
+ },
665
+ {
666
+ "type": "text",
667
+ "notNull": true,
668
+ "autoincrement": false,
669
+ "default": "(datetime('now'))",
670
+ "generated": null,
671
+ "name": "extracted_at",
672
+ "entityType": "columns",
673
+ "table": "brain_patterns"
674
+ },
675
+ {
676
+ "type": "text",
677
+ "notNull": false,
678
+ "autoincrement": false,
679
+ "default": null,
680
+ "generated": null,
681
+ "name": "updated_at",
682
+ "entityType": "columns",
683
+ "table": "brain_patterns"
684
+ },
685
+ {
686
+ "type": "text",
687
+ "notNull": false,
688
+ "autoincrement": false,
689
+ "default": null,
690
+ "generated": null,
691
+ "name": "key",
692
+ "entityType": "columns",
693
+ "table": "brain_schema_meta"
694
+ },
695
+ {
696
+ "type": "text",
697
+ "notNull": true,
698
+ "autoincrement": false,
699
+ "default": null,
700
+ "generated": null,
701
+ "name": "value",
702
+ "entityType": "columns",
703
+ "table": "brain_schema_meta"
704
+ },
705
+ {
706
+ "type": "text",
707
+ "notNull": false,
708
+ "autoincrement": false,
709
+ "default": null,
710
+ "generated": null,
711
+ "name": "id",
712
+ "entityType": "columns",
713
+ "table": "brain_sticky_notes"
714
+ },
715
+ {
716
+ "type": "text",
717
+ "notNull": true,
718
+ "autoincrement": false,
719
+ "default": null,
720
+ "generated": null,
721
+ "name": "content",
722
+ "entityType": "columns",
723
+ "table": "brain_sticky_notes"
724
+ },
725
+ {
726
+ "type": "text",
727
+ "notNull": true,
728
+ "autoincrement": false,
729
+ "default": "(datetime('now'))",
730
+ "generated": null,
731
+ "name": "created_at",
732
+ "entityType": "columns",
733
+ "table": "brain_sticky_notes"
734
+ },
735
+ {
736
+ "type": "text",
737
+ "notNull": false,
738
+ "autoincrement": false,
739
+ "default": null,
740
+ "generated": null,
741
+ "name": "updated_at",
742
+ "entityType": "columns",
743
+ "table": "brain_sticky_notes"
744
+ },
745
+ {
746
+ "type": "text",
747
+ "notNull": false,
748
+ "autoincrement": false,
749
+ "default": null,
750
+ "generated": null,
751
+ "name": "tags_json",
752
+ "entityType": "columns",
753
+ "table": "brain_sticky_notes"
754
+ },
755
+ {
756
+ "type": "text",
757
+ "notNull": true,
758
+ "autoincrement": false,
759
+ "default": "'active'",
760
+ "generated": null,
761
+ "name": "status",
762
+ "entityType": "columns",
763
+ "table": "brain_sticky_notes"
764
+ },
765
+ {
766
+ "type": "text",
767
+ "notNull": false,
768
+ "autoincrement": false,
769
+ "default": null,
770
+ "generated": null,
771
+ "name": "converted_to_json",
772
+ "entityType": "columns",
773
+ "table": "brain_sticky_notes"
774
+ },
775
+ {
776
+ "type": "text",
777
+ "notNull": false,
778
+ "autoincrement": false,
779
+ "default": null,
780
+ "generated": null,
781
+ "name": "color",
782
+ "entityType": "columns",
783
+ "table": "brain_sticky_notes"
784
+ },
785
+ {
786
+ "type": "text",
787
+ "notNull": false,
788
+ "autoincrement": false,
789
+ "default": null,
790
+ "generated": null,
791
+ "name": "priority",
792
+ "entityType": "columns",
793
+ "table": "brain_sticky_notes"
794
+ },
795
+ {
796
+ "type": "text",
797
+ "notNull": false,
798
+ "autoincrement": false,
799
+ "default": "'sticky-note'",
800
+ "generated": null,
801
+ "name": "source_type",
802
+ "entityType": "columns",
803
+ "table": "brain_sticky_notes"
804
+ },
805
+ {
806
+ "columns": [
807
+ "memory_type",
808
+ "memory_id",
809
+ "task_id",
810
+ "link_type"
811
+ ],
812
+ "nameExplicit": false,
813
+ "name": "brain_memory_links_pk",
814
+ "entityType": "pks",
815
+ "table": "brain_memory_links"
816
+ },
817
+ {
818
+ "columns": [
819
+ "from_id",
820
+ "to_id",
821
+ "edge_type"
822
+ ],
823
+ "nameExplicit": false,
824
+ "name": "brain_page_edges_pk",
825
+ "entityType": "pks",
826
+ "table": "brain_page_edges"
827
+ },
828
+ {
829
+ "columns": [
830
+ "id"
831
+ ],
832
+ "nameExplicit": false,
833
+ "name": "brain_decisions_pk",
834
+ "table": "brain_decisions",
835
+ "entityType": "pks"
836
+ },
837
+ {
838
+ "columns": [
839
+ "id"
840
+ ],
841
+ "nameExplicit": false,
842
+ "name": "brain_learnings_pk",
843
+ "table": "brain_learnings",
844
+ "entityType": "pks"
845
+ },
846
+ {
847
+ "columns": [
848
+ "id"
849
+ ],
850
+ "nameExplicit": false,
851
+ "name": "brain_observations_pk",
852
+ "table": "brain_observations",
853
+ "entityType": "pks"
854
+ },
855
+ {
856
+ "columns": [
857
+ "id"
858
+ ],
859
+ "nameExplicit": false,
860
+ "name": "brain_page_nodes_pk",
861
+ "table": "brain_page_nodes",
862
+ "entityType": "pks"
863
+ },
864
+ {
865
+ "columns": [
866
+ "id"
867
+ ],
868
+ "nameExplicit": false,
869
+ "name": "brain_patterns_pk",
870
+ "table": "brain_patterns",
871
+ "entityType": "pks"
872
+ },
873
+ {
874
+ "columns": [
875
+ "key"
876
+ ],
877
+ "nameExplicit": false,
878
+ "name": "brain_schema_meta_pk",
879
+ "table": "brain_schema_meta",
880
+ "entityType": "pks"
881
+ },
882
+ {
883
+ "columns": [
884
+ "id"
885
+ ],
886
+ "nameExplicit": false,
887
+ "name": "brain_sticky_notes_pk",
888
+ "table": "brain_sticky_notes",
889
+ "entityType": "pks"
890
+ },
891
+ {
892
+ "columns": [
893
+ {
894
+ "value": "type",
895
+ "isExpression": false
896
+ }
897
+ ],
898
+ "isUnique": false,
899
+ "where": null,
900
+ "origin": "manual",
901
+ "name": "idx_brain_decisions_type",
902
+ "entityType": "indexes",
903
+ "table": "brain_decisions"
904
+ },
905
+ {
906
+ "columns": [
907
+ {
908
+ "value": "confidence",
909
+ "isExpression": false
910
+ }
911
+ ],
912
+ "isUnique": false,
913
+ "where": null,
914
+ "origin": "manual",
915
+ "name": "idx_brain_decisions_confidence",
916
+ "entityType": "indexes",
917
+ "table": "brain_decisions"
918
+ },
919
+ {
920
+ "columns": [
921
+ {
922
+ "value": "outcome",
923
+ "isExpression": false
924
+ }
925
+ ],
926
+ "isUnique": false,
927
+ "where": null,
928
+ "origin": "manual",
929
+ "name": "idx_brain_decisions_outcome",
930
+ "entityType": "indexes",
931
+ "table": "brain_decisions"
932
+ },
933
+ {
934
+ "columns": [
935
+ {
936
+ "value": "context_epic_id",
937
+ "isExpression": false
938
+ }
939
+ ],
940
+ "isUnique": false,
941
+ "where": null,
942
+ "origin": "manual",
943
+ "name": "idx_brain_decisions_context_epic",
944
+ "entityType": "indexes",
945
+ "table": "brain_decisions"
946
+ },
947
+ {
948
+ "columns": [
949
+ {
950
+ "value": "context_task_id",
951
+ "isExpression": false
952
+ }
953
+ ],
954
+ "isUnique": false,
955
+ "where": null,
956
+ "origin": "manual",
957
+ "name": "idx_brain_decisions_context_task",
958
+ "entityType": "indexes",
959
+ "table": "brain_decisions"
960
+ },
961
+ {
962
+ "columns": [
963
+ {
964
+ "value": "confidence",
965
+ "isExpression": false
966
+ }
967
+ ],
968
+ "isUnique": false,
969
+ "where": null,
970
+ "origin": "manual",
971
+ "name": "idx_brain_learnings_confidence",
972
+ "entityType": "indexes",
973
+ "table": "brain_learnings"
974
+ },
975
+ {
976
+ "columns": [
977
+ {
978
+ "value": "actionable",
979
+ "isExpression": false
980
+ }
981
+ ],
982
+ "isUnique": false,
983
+ "where": null,
984
+ "origin": "manual",
985
+ "name": "idx_brain_learnings_actionable",
986
+ "entityType": "indexes",
987
+ "table": "brain_learnings"
988
+ },
989
+ {
990
+ "columns": [
991
+ {
992
+ "value": "task_id",
993
+ "isExpression": false
994
+ }
995
+ ],
996
+ "isUnique": false,
997
+ "where": null,
998
+ "origin": "manual",
999
+ "name": "idx_brain_links_task",
1000
+ "entityType": "indexes",
1001
+ "table": "brain_memory_links"
1002
+ },
1003
+ {
1004
+ "columns": [
1005
+ {
1006
+ "value": "memory_type",
1007
+ "isExpression": false
1008
+ },
1009
+ {
1010
+ "value": "memory_id",
1011
+ "isExpression": false
1012
+ }
1013
+ ],
1014
+ "isUnique": false,
1015
+ "where": null,
1016
+ "origin": "manual",
1017
+ "name": "idx_brain_links_memory",
1018
+ "entityType": "indexes",
1019
+ "table": "brain_memory_links"
1020
+ },
1021
+ {
1022
+ "columns": [
1023
+ {
1024
+ "value": "type",
1025
+ "isExpression": false
1026
+ }
1027
+ ],
1028
+ "isUnique": false,
1029
+ "where": null,
1030
+ "origin": "manual",
1031
+ "name": "idx_brain_observations_type",
1032
+ "entityType": "indexes",
1033
+ "table": "brain_observations"
1034
+ },
1035
+ {
1036
+ "columns": [
1037
+ {
1038
+ "value": "project",
1039
+ "isExpression": false
1040
+ }
1041
+ ],
1042
+ "isUnique": false,
1043
+ "where": null,
1044
+ "origin": "manual",
1045
+ "name": "idx_brain_observations_project",
1046
+ "entityType": "indexes",
1047
+ "table": "brain_observations"
1048
+ },
1049
+ {
1050
+ "columns": [
1051
+ {
1052
+ "value": "created_at",
1053
+ "isExpression": false
1054
+ }
1055
+ ],
1056
+ "isUnique": false,
1057
+ "where": null,
1058
+ "origin": "manual",
1059
+ "name": "idx_brain_observations_created_at",
1060
+ "entityType": "indexes",
1061
+ "table": "brain_observations"
1062
+ },
1063
+ {
1064
+ "columns": [
1065
+ {
1066
+ "value": "source_type",
1067
+ "isExpression": false
1068
+ }
1069
+ ],
1070
+ "isUnique": false,
1071
+ "where": null,
1072
+ "origin": "manual",
1073
+ "name": "idx_brain_observations_source_type",
1074
+ "entityType": "indexes",
1075
+ "table": "brain_observations"
1076
+ },
1077
+ {
1078
+ "columns": [
1079
+ {
1080
+ "value": "source_session_id",
1081
+ "isExpression": false
1082
+ }
1083
+ ],
1084
+ "isUnique": false,
1085
+ "where": null,
1086
+ "origin": "manual",
1087
+ "name": "idx_brain_observations_source_session",
1088
+ "entityType": "indexes",
1089
+ "table": "brain_observations"
1090
+ },
1091
+ {
1092
+ "columns": [
1093
+ {
1094
+ "value": "content_hash",
1095
+ "isExpression": false
1096
+ }
1097
+ ],
1098
+ "isUnique": false,
1099
+ "where": null,
1100
+ "origin": "manual",
1101
+ "name": "idx_brain_observations_content_hash",
1102
+ "entityType": "indexes",
1103
+ "table": "brain_observations"
1104
+ },
1105
+ {
1106
+ "columns": [
1107
+ {
1108
+ "value": "from_id",
1109
+ "isExpression": false
1110
+ }
1111
+ ],
1112
+ "isUnique": false,
1113
+ "where": null,
1114
+ "origin": "manual",
1115
+ "name": "idx_brain_edges_from",
1116
+ "entityType": "indexes",
1117
+ "table": "brain_page_edges"
1118
+ },
1119
+ {
1120
+ "columns": [
1121
+ {
1122
+ "value": "to_id",
1123
+ "isExpression": false
1124
+ }
1125
+ ],
1126
+ "isUnique": false,
1127
+ "where": null,
1128
+ "origin": "manual",
1129
+ "name": "idx_brain_edges_to",
1130
+ "entityType": "indexes",
1131
+ "table": "brain_page_edges"
1132
+ },
1133
+ {
1134
+ "columns": [
1135
+ {
1136
+ "value": "node_type",
1137
+ "isExpression": false
1138
+ }
1139
+ ],
1140
+ "isUnique": false,
1141
+ "where": null,
1142
+ "origin": "manual",
1143
+ "name": "idx_brain_nodes_type",
1144
+ "entityType": "indexes",
1145
+ "table": "brain_page_nodes"
1146
+ },
1147
+ {
1148
+ "columns": [
1149
+ {
1150
+ "value": "type",
1151
+ "isExpression": false
1152
+ }
1153
+ ],
1154
+ "isUnique": false,
1155
+ "where": null,
1156
+ "origin": "manual",
1157
+ "name": "idx_brain_patterns_type",
1158
+ "entityType": "indexes",
1159
+ "table": "brain_patterns"
1160
+ },
1161
+ {
1162
+ "columns": [
1163
+ {
1164
+ "value": "impact",
1165
+ "isExpression": false
1166
+ }
1167
+ ],
1168
+ "isUnique": false,
1169
+ "where": null,
1170
+ "origin": "manual",
1171
+ "name": "idx_brain_patterns_impact",
1172
+ "entityType": "indexes",
1173
+ "table": "brain_patterns"
1174
+ },
1175
+ {
1176
+ "columns": [
1177
+ {
1178
+ "value": "frequency",
1179
+ "isExpression": false
1180
+ }
1181
+ ],
1182
+ "isUnique": false,
1183
+ "where": null,
1184
+ "origin": "manual",
1185
+ "name": "idx_brain_patterns_frequency",
1186
+ "entityType": "indexes",
1187
+ "table": "brain_patterns"
1188
+ },
1189
+ {
1190
+ "columns": [
1191
+ {
1192
+ "value": "status",
1193
+ "isExpression": false
1194
+ }
1195
+ ],
1196
+ "isUnique": false,
1197
+ "where": null,
1198
+ "origin": "manual",
1199
+ "name": "idx_brain_sticky_status",
1200
+ "entityType": "indexes",
1201
+ "table": "brain_sticky_notes"
1202
+ },
1203
+ {
1204
+ "columns": [
1205
+ {
1206
+ "value": "created_at",
1207
+ "isExpression": false
1208
+ }
1209
+ ],
1210
+ "isUnique": false,
1211
+ "where": null,
1212
+ "origin": "manual",
1213
+ "name": "idx_brain_sticky_created",
1214
+ "entityType": "indexes",
1215
+ "table": "brain_sticky_notes"
1216
+ },
1217
+ {
1218
+ "columns": [
1219
+ {
1220
+ "value": "tags_json",
1221
+ "isExpression": false
1222
+ }
1223
+ ],
1224
+ "isUnique": false,
1225
+ "where": null,
1226
+ "origin": "manual",
1227
+ "name": "idx_brain_sticky_tags",
1228
+ "entityType": "indexes",
1229
+ "table": "brain_sticky_notes"
1230
+ }
1231
+ ]
1232
+ }