@vinihcrosa/lumem-os 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2823 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "0c261755-99f3-4fb3-a229-05c59b2a77ba",
5
+ "prevId": "8567d3ff-55e3-4882-aa91-0f4cb908c6cd",
6
+ "tables": {
7
+ "action_signal": {
8
+ "name": "action_signal",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "kind": {
18
+ "name": "kind",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "target": {
25
+ "name": "target",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "workspace_id": {
32
+ "name": "workspace_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "project_id": {
39
+ "name": "project_id",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "worktree_id": {
46
+ "name": "worktree_id",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "session_id": {
53
+ "name": "session_id",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false
58
+ },
59
+ "detail": {
60
+ "name": "detail",
61
+ "type": "integer",
62
+ "primaryKey": false,
63
+ "notNull": false,
64
+ "autoincrement": false
65
+ },
66
+ "created_at": {
67
+ "name": "created_at",
68
+ "type": "integer",
69
+ "primaryKey": false,
70
+ "notNull": true,
71
+ "autoincrement": false,
72
+ "default": "(unixepoch('subsec') * 1000)"
73
+ },
74
+ "updated_at": {
75
+ "name": "updated_at",
76
+ "type": "integer",
77
+ "primaryKey": false,
78
+ "notNull": true,
79
+ "autoincrement": false,
80
+ "default": "(unixepoch('subsec') * 1000)"
81
+ }
82
+ },
83
+ "indexes": {},
84
+ "foreignKeys": {},
85
+ "compositePrimaryKeys": {},
86
+ "uniqueConstraints": {},
87
+ "checkConstraints": {
88
+ "action_signal_kind": {
89
+ "name": "action_signal_kind",
90
+ "value": "\"action_signal\".\"kind\" IN (\n 'user_edited_after_agent',\n 'user_reverted_agent_commit',\n 'worktree_discarded',\n 'session_killed_early'\n )"
91
+ },
92
+ "action_signal_detail_number": {
93
+ "name": "action_signal_detail_number",
94
+ "value": "\"action_signal\".\"detail\" IS NULL OR typeof(\"action_signal\".\"detail\") = 'integer'"
95
+ },
96
+ "action_signal_target_shape": {
97
+ "name": "action_signal_target_shape",
98
+ "value": "length(\"action_signal\".\"target\") BETWEEN 1 AND 1024\n AND instr(\"action_signal\".\"target\", char(10)) = 0"
99
+ }
100
+ }
101
+ },
102
+ "agent_account": {
103
+ "name": "agent_account",
104
+ "columns": {
105
+ "id": {
106
+ "name": "id",
107
+ "type": "text",
108
+ "primaryKey": true,
109
+ "notNull": true,
110
+ "autoincrement": false
111
+ },
112
+ "agent_config_id": {
113
+ "name": "agent_config_id",
114
+ "type": "text",
115
+ "primaryKey": false,
116
+ "notNull": true,
117
+ "autoincrement": false
118
+ },
119
+ "label": {
120
+ "name": "label",
121
+ "type": "text",
122
+ "primaryKey": false,
123
+ "notNull": true,
124
+ "autoincrement": false
125
+ },
126
+ "kind": {
127
+ "name": "kind",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true,
131
+ "autoincrement": false,
132
+ "default": "'subscription'"
133
+ },
134
+ "config_dir": {
135
+ "name": "config_dir",
136
+ "type": "text",
137
+ "primaryKey": false,
138
+ "notNull": false,
139
+ "autoincrement": false
140
+ },
141
+ "identity": {
142
+ "name": "identity",
143
+ "type": "text",
144
+ "primaryKey": false,
145
+ "notNull": false,
146
+ "autoincrement": false
147
+ },
148
+ "default_model": {
149
+ "name": "default_model",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": false,
153
+ "autoincrement": false
154
+ },
155
+ "default_effort": {
156
+ "name": "default_effort",
157
+ "type": "text",
158
+ "primaryKey": false,
159
+ "notNull": false,
160
+ "autoincrement": false
161
+ },
162
+ "state": {
163
+ "name": "state",
164
+ "type": "text",
165
+ "primaryKey": false,
166
+ "notNull": true,
167
+ "autoincrement": false,
168
+ "default": "'connected'"
169
+ },
170
+ "created_at": {
171
+ "name": "created_at",
172
+ "type": "integer",
173
+ "primaryKey": false,
174
+ "notNull": true,
175
+ "autoincrement": false,
176
+ "default": "(unixepoch('subsec') * 1000)"
177
+ },
178
+ "updated_at": {
179
+ "name": "updated_at",
180
+ "type": "integer",
181
+ "primaryKey": false,
182
+ "notNull": true,
183
+ "autoincrement": false,
184
+ "default": "(unixepoch('subsec') * 1000)"
185
+ }
186
+ },
187
+ "indexes": {
188
+ "agent_account_config_dir": {
189
+ "name": "agent_account_config_dir",
190
+ "columns": [
191
+ "config_dir"
192
+ ],
193
+ "isUnique": true
194
+ },
195
+ "agent_account_one_bare_per_agent": {
196
+ "name": "agent_account_one_bare_per_agent",
197
+ "columns": [
198
+ "agent_config_id"
199
+ ],
200
+ "isUnique": true,
201
+ "where": "config_dir IS NULL"
202
+ },
203
+ "agent_account_label_per_agent": {
204
+ "name": "agent_account_label_per_agent",
205
+ "columns": [
206
+ "agent_config_id",
207
+ "label"
208
+ ],
209
+ "isUnique": true
210
+ }
211
+ },
212
+ "foreignKeys": {
213
+ "agent_account_agent_config_id_agent_config_id_fk": {
214
+ "name": "agent_account_agent_config_id_agent_config_id_fk",
215
+ "tableFrom": "agent_account",
216
+ "tableTo": "agent_config",
217
+ "columnsFrom": [
218
+ "agent_config_id"
219
+ ],
220
+ "columnsTo": [
221
+ "id"
222
+ ],
223
+ "onDelete": "restrict",
224
+ "onUpdate": "no action"
225
+ }
226
+ },
227
+ "compositePrimaryKeys": {},
228
+ "uniqueConstraints": {},
229
+ "checkConstraints": {
230
+ "agent_account_kind": {
231
+ "name": "agent_account_kind",
232
+ "value": "\"agent_account\".\"kind\" IN ('subscription', 'api_key')"
233
+ },
234
+ "agent_account_state": {
235
+ "name": "agent_account_state",
236
+ "value": "\"agent_account\".\"state\" IN ('connected', 'disconnected')"
237
+ }
238
+ }
239
+ },
240
+ "agent_config": {
241
+ "name": "agent_config",
242
+ "columns": {
243
+ "id": {
244
+ "name": "id",
245
+ "type": "text",
246
+ "primaryKey": true,
247
+ "notNull": true,
248
+ "autoincrement": false
249
+ },
250
+ "name": {
251
+ "name": "name",
252
+ "type": "text",
253
+ "primaryKey": false,
254
+ "notNull": true,
255
+ "autoincrement": false
256
+ },
257
+ "command": {
258
+ "name": "command",
259
+ "type": "text",
260
+ "primaryKey": false,
261
+ "notNull": true,
262
+ "autoincrement": false
263
+ },
264
+ "args": {
265
+ "name": "args",
266
+ "type": "text",
267
+ "primaryKey": false,
268
+ "notNull": true,
269
+ "autoincrement": false,
270
+ "default": "'[]'"
271
+ },
272
+ "env": {
273
+ "name": "env",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false,
278
+ "default": "'{}'"
279
+ },
280
+ "adapter_version": {
281
+ "name": "adapter_version",
282
+ "type": "text",
283
+ "primaryKey": false,
284
+ "notNull": false,
285
+ "autoincrement": false
286
+ },
287
+ "retired_at": {
288
+ "name": "retired_at",
289
+ "type": "integer",
290
+ "primaryKey": false,
291
+ "notNull": false,
292
+ "autoincrement": false
293
+ },
294
+ "default_account_id": {
295
+ "name": "default_account_id",
296
+ "type": "text",
297
+ "primaryKey": false,
298
+ "notNull": false,
299
+ "autoincrement": false
300
+ },
301
+ "created_at": {
302
+ "name": "created_at",
303
+ "type": "integer",
304
+ "primaryKey": false,
305
+ "notNull": true,
306
+ "autoincrement": false,
307
+ "default": "(unixepoch('subsec') * 1000)"
308
+ },
309
+ "updated_at": {
310
+ "name": "updated_at",
311
+ "type": "integer",
312
+ "primaryKey": false,
313
+ "notNull": true,
314
+ "autoincrement": false,
315
+ "default": "(unixepoch('subsec') * 1000)"
316
+ }
317
+ },
318
+ "indexes": {
319
+ "agent_config_name_unique": {
320
+ "name": "agent_config_name_unique",
321
+ "columns": [
322
+ "name"
323
+ ],
324
+ "isUnique": true
325
+ }
326
+ },
327
+ "foreignKeys": {},
328
+ "compositePrimaryKeys": {},
329
+ "uniqueConstraints": {},
330
+ "checkConstraints": {
331
+ "agent_config_adapter_version": {
332
+ "name": "agent_config_adapter_version",
333
+ "value": "\"agent_config\".\"retired_at\" IS NOT NULL OR \"agent_config\".\"adapter_version\" IS NOT NULL"
334
+ }
335
+ }
336
+ },
337
+ "checkout_port": {
338
+ "name": "checkout_port",
339
+ "columns": {
340
+ "id": {
341
+ "name": "id",
342
+ "type": "text",
343
+ "primaryKey": true,
344
+ "notNull": true,
345
+ "autoincrement": false
346
+ },
347
+ "scope_type": {
348
+ "name": "scope_type",
349
+ "type": "text",
350
+ "primaryKey": false,
351
+ "notNull": true,
352
+ "autoincrement": false
353
+ },
354
+ "scope_id": {
355
+ "name": "scope_id",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": true,
359
+ "autoincrement": false
360
+ },
361
+ "port": {
362
+ "name": "port",
363
+ "type": "integer",
364
+ "primaryKey": false,
365
+ "notNull": true,
366
+ "autoincrement": false
367
+ },
368
+ "created_at": {
369
+ "name": "created_at",
370
+ "type": "integer",
371
+ "primaryKey": false,
372
+ "notNull": true,
373
+ "autoincrement": false,
374
+ "default": "(unixepoch('subsec') * 1000)"
375
+ },
376
+ "updated_at": {
377
+ "name": "updated_at",
378
+ "type": "integer",
379
+ "primaryKey": false,
380
+ "notNull": true,
381
+ "autoincrement": false,
382
+ "default": "(unixepoch('subsec') * 1000)"
383
+ }
384
+ },
385
+ "indexes": {
386
+ "checkout_port_scope": {
387
+ "name": "checkout_port_scope",
388
+ "columns": [
389
+ "scope_type",
390
+ "scope_id"
391
+ ],
392
+ "isUnique": true
393
+ },
394
+ "checkout_port_port": {
395
+ "name": "checkout_port_port",
396
+ "columns": [
397
+ "port"
398
+ ],
399
+ "isUnique": true
400
+ }
401
+ },
402
+ "foreignKeys": {},
403
+ "compositePrimaryKeys": {},
404
+ "uniqueConstraints": {},
405
+ "checkConstraints": {
406
+ "checkout_port_scope_type": {
407
+ "name": "checkout_port_scope_type",
408
+ "value": "\"checkout_port\".\"scope_type\" IN ('project', 'worktree')"
409
+ },
410
+ "checkout_port_range": {
411
+ "name": "checkout_port_range",
412
+ "value": "\"checkout_port\".\"port\" > 0 AND \"checkout_port\".\"port\" < 65536"
413
+ }
414
+ }
415
+ },
416
+ "memory_access": {
417
+ "name": "memory_access",
418
+ "columns": {
419
+ "id": {
420
+ "name": "id",
421
+ "type": "text",
422
+ "primaryKey": true,
423
+ "notNull": true,
424
+ "autoincrement": false
425
+ },
426
+ "workspace_id": {
427
+ "name": "workspace_id",
428
+ "type": "text",
429
+ "primaryKey": false,
430
+ "notNull": false,
431
+ "autoincrement": false
432
+ },
433
+ "from_project_id": {
434
+ "name": "from_project_id",
435
+ "type": "text",
436
+ "primaryKey": false,
437
+ "notNull": false,
438
+ "autoincrement": false
439
+ },
440
+ "target_project_id": {
441
+ "name": "target_project_id",
442
+ "type": "text",
443
+ "primaryKey": false,
444
+ "notNull": false,
445
+ "autoincrement": false
446
+ },
447
+ "kind": {
448
+ "name": "kind",
449
+ "type": "text",
450
+ "primaryKey": false,
451
+ "notNull": true,
452
+ "autoincrement": false
453
+ },
454
+ "target": {
455
+ "name": "target",
456
+ "type": "text",
457
+ "primaryKey": false,
458
+ "notNull": true,
459
+ "autoincrement": false
460
+ },
461
+ "decision": {
462
+ "name": "decision",
463
+ "type": "text",
464
+ "primaryKey": false,
465
+ "notNull": true,
466
+ "autoincrement": false
467
+ },
468
+ "reason": {
469
+ "name": "reason",
470
+ "type": "text",
471
+ "primaryKey": false,
472
+ "notNull": false,
473
+ "autoincrement": false
474
+ },
475
+ "actor": {
476
+ "name": "actor",
477
+ "type": "text",
478
+ "primaryKey": false,
479
+ "notNull": true,
480
+ "autoincrement": false
481
+ },
482
+ "created_at": {
483
+ "name": "created_at",
484
+ "type": "integer",
485
+ "primaryKey": false,
486
+ "notNull": true,
487
+ "autoincrement": false,
488
+ "default": "(unixepoch('subsec') * 1000)"
489
+ },
490
+ "updated_at": {
491
+ "name": "updated_at",
492
+ "type": "integer",
493
+ "primaryKey": false,
494
+ "notNull": true,
495
+ "autoincrement": false,
496
+ "default": "(unixepoch('subsec') * 1000)"
497
+ }
498
+ },
499
+ "indexes": {},
500
+ "foreignKeys": {},
501
+ "compositePrimaryKeys": {},
502
+ "uniqueConstraints": {},
503
+ "checkConstraints": {
504
+ "memory_access_kind": {
505
+ "name": "memory_access_kind",
506
+ "value": "\"memory_access\".\"kind\" IN ('memory', 'repository')"
507
+ },
508
+ "memory_access_decision": {
509
+ "name": "memory_access_decision",
510
+ "value": "\"memory_access\".\"decision\" IN ('allowed', 'denied')"
511
+ }
512
+ }
513
+ },
514
+ "memory_decision": {
515
+ "name": "memory_decision",
516
+ "columns": {
517
+ "id": {
518
+ "name": "id",
519
+ "type": "text",
520
+ "primaryKey": true,
521
+ "notNull": true,
522
+ "autoincrement": false
523
+ },
524
+ "idempotency_key": {
525
+ "name": "idempotency_key",
526
+ "type": "text",
527
+ "primaryKey": false,
528
+ "notNull": true,
529
+ "autoincrement": false
530
+ },
531
+ "path": {
532
+ "name": "path",
533
+ "type": "text",
534
+ "primaryKey": false,
535
+ "notNull": true,
536
+ "autoincrement": false
537
+ },
538
+ "operation": {
539
+ "name": "operation",
540
+ "type": "text",
541
+ "primaryKey": false,
542
+ "notNull": true,
543
+ "autoincrement": false
544
+ },
545
+ "outcome": {
546
+ "name": "outcome",
547
+ "type": "text",
548
+ "primaryKey": false,
549
+ "notNull": true,
550
+ "autoincrement": false
551
+ },
552
+ "actor": {
553
+ "name": "actor",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": true,
557
+ "autoincrement": false
558
+ },
559
+ "confidence": {
560
+ "name": "confidence",
561
+ "type": "text",
562
+ "primaryKey": false,
563
+ "notNull": true,
564
+ "autoincrement": false
565
+ },
566
+ "candidate_hash": {
567
+ "name": "candidate_hash",
568
+ "type": "text",
569
+ "primaryKey": false,
570
+ "notNull": true,
571
+ "autoincrement": false
572
+ },
573
+ "rule_trace": {
574
+ "name": "rule_trace",
575
+ "type": "text",
576
+ "primaryKey": false,
577
+ "notNull": true,
578
+ "autoincrement": false,
579
+ "default": "'[]'"
580
+ },
581
+ "source_sessions": {
582
+ "name": "source_sessions",
583
+ "type": "text",
584
+ "primaryKey": false,
585
+ "notNull": true,
586
+ "autoincrement": false,
587
+ "default": "'[]'"
588
+ },
589
+ "reason": {
590
+ "name": "reason",
591
+ "type": "text",
592
+ "primaryKey": false,
593
+ "notNull": false,
594
+ "autoincrement": false
595
+ },
596
+ "commit_sha": {
597
+ "name": "commit_sha",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": false,
601
+ "autoincrement": false
602
+ },
603
+ "created_at": {
604
+ "name": "created_at",
605
+ "type": "integer",
606
+ "primaryKey": false,
607
+ "notNull": true,
608
+ "autoincrement": false,
609
+ "default": "(unixepoch('subsec') * 1000)"
610
+ },
611
+ "updated_at": {
612
+ "name": "updated_at",
613
+ "type": "integer",
614
+ "primaryKey": false,
615
+ "notNull": true,
616
+ "autoincrement": false,
617
+ "default": "(unixepoch('subsec') * 1000)"
618
+ }
619
+ },
620
+ "indexes": {
621
+ "memory_decision_idempotency_key_unique": {
622
+ "name": "memory_decision_idempotency_key_unique",
623
+ "columns": [
624
+ "idempotency_key"
625
+ ],
626
+ "isUnique": true
627
+ }
628
+ },
629
+ "foreignKeys": {},
630
+ "compositePrimaryKeys": {},
631
+ "uniqueConstraints": {},
632
+ "checkConstraints": {
633
+ "memory_decision_operation": {
634
+ "name": "memory_decision_operation",
635
+ "value": "\"memory_decision\".\"operation\" IN ('add', 'update', 'delete')"
636
+ },
637
+ "memory_decision_outcome": {
638
+ "name": "memory_decision_outcome",
639
+ "value": "\"memory_decision\".\"outcome\" IN ('applied', 'noop', 'rejected')"
640
+ }
641
+ }
642
+ },
643
+ "memory_entry": {
644
+ "name": "memory_entry",
645
+ "columns": {
646
+ "id": {
647
+ "name": "id",
648
+ "type": "text",
649
+ "primaryKey": true,
650
+ "notNull": true,
651
+ "autoincrement": false
652
+ },
653
+ "path": {
654
+ "name": "path",
655
+ "type": "text",
656
+ "primaryKey": false,
657
+ "notNull": true,
658
+ "autoincrement": false
659
+ },
660
+ "type": {
661
+ "name": "type",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": true,
665
+ "autoincrement": false
666
+ },
667
+ "scope": {
668
+ "name": "scope",
669
+ "type": "text",
670
+ "primaryKey": false,
671
+ "notNull": true,
672
+ "autoincrement": false
673
+ },
674
+ "slug": {
675
+ "name": "slug",
676
+ "type": "text",
677
+ "primaryKey": false,
678
+ "notNull": true,
679
+ "autoincrement": false
680
+ },
681
+ "workspace_id": {
682
+ "name": "workspace_id",
683
+ "type": "text",
684
+ "primaryKey": false,
685
+ "notNull": true,
686
+ "autoincrement": false,
687
+ "default": "''"
688
+ },
689
+ "project_id": {
690
+ "name": "project_id",
691
+ "type": "text",
692
+ "primaryKey": false,
693
+ "notNull": true,
694
+ "autoincrement": false,
695
+ "default": "''"
696
+ },
697
+ "name": {
698
+ "name": "name",
699
+ "type": "text",
700
+ "primaryKey": false,
701
+ "notNull": true,
702
+ "autoincrement": false
703
+ },
704
+ "description": {
705
+ "name": "description",
706
+ "type": "text",
707
+ "primaryKey": false,
708
+ "notNull": true,
709
+ "autoincrement": false
710
+ },
711
+ "source_actor": {
712
+ "name": "source_actor",
713
+ "type": "text",
714
+ "primaryKey": false,
715
+ "notNull": true,
716
+ "autoincrement": false
717
+ },
718
+ "confidence": {
719
+ "name": "confidence",
720
+ "type": "text",
721
+ "primaryKey": false,
722
+ "notNull": true,
723
+ "autoincrement": false
724
+ },
725
+ "pinned": {
726
+ "name": "pinned",
727
+ "type": "integer",
728
+ "primaryKey": false,
729
+ "notNull": true,
730
+ "autoincrement": false,
731
+ "default": false
732
+ },
733
+ "content_hash": {
734
+ "name": "content_hash",
735
+ "type": "text",
736
+ "primaryKey": false,
737
+ "notNull": true,
738
+ "autoincrement": false
739
+ },
740
+ "created_at": {
741
+ "name": "created_at",
742
+ "type": "integer",
743
+ "primaryKey": false,
744
+ "notNull": true,
745
+ "autoincrement": false,
746
+ "default": "(unixepoch('subsec') * 1000)"
747
+ },
748
+ "updated_at": {
749
+ "name": "updated_at",
750
+ "type": "integer",
751
+ "primaryKey": false,
752
+ "notNull": true,
753
+ "autoincrement": false,
754
+ "default": "(unixepoch('subsec') * 1000)"
755
+ }
756
+ },
757
+ "indexes": {
758
+ "memory_entry_path_unique": {
759
+ "name": "memory_entry_path_unique",
760
+ "columns": [
761
+ "path"
762
+ ],
763
+ "isUnique": true
764
+ },
765
+ "memory_entry_identity": {
766
+ "name": "memory_entry_identity",
767
+ "columns": [
768
+ "scope",
769
+ "workspace_id",
770
+ "project_id",
771
+ "type",
772
+ "slug"
773
+ ],
774
+ "isUnique": true
775
+ }
776
+ },
777
+ "foreignKeys": {},
778
+ "compositePrimaryKeys": {},
779
+ "uniqueConstraints": {},
780
+ "checkConstraints": {
781
+ "memory_entry_type": {
782
+ "name": "memory_entry_type",
783
+ "value": "\"memory_entry\".\"type\" IN ('user', 'feedback', 'project', 'domain', 'process', 'contract', 'reference')"
784
+ },
785
+ "memory_entry_scope": {
786
+ "name": "memory_entry_scope",
787
+ "value": "\"memory_entry\".\"scope\" IN ('global', 'workspace', 'project')"
788
+ }
789
+ }
790
+ },
791
+ "memory_proposal": {
792
+ "name": "memory_proposal",
793
+ "columns": {
794
+ "id": {
795
+ "name": "id",
796
+ "type": "text",
797
+ "primaryKey": true,
798
+ "notNull": true,
799
+ "autoincrement": false
800
+ },
801
+ "path": {
802
+ "name": "path",
803
+ "type": "text",
804
+ "primaryKey": false,
805
+ "notNull": true,
806
+ "autoincrement": false
807
+ },
808
+ "type": {
809
+ "name": "type",
810
+ "type": "text",
811
+ "primaryKey": false,
812
+ "notNull": true,
813
+ "autoincrement": false
814
+ },
815
+ "scope": {
816
+ "name": "scope",
817
+ "type": "text",
818
+ "primaryKey": false,
819
+ "notNull": true,
820
+ "autoincrement": false
821
+ },
822
+ "slug": {
823
+ "name": "slug",
824
+ "type": "text",
825
+ "primaryKey": false,
826
+ "notNull": true,
827
+ "autoincrement": false
828
+ },
829
+ "workspace_id": {
830
+ "name": "workspace_id",
831
+ "type": "text",
832
+ "primaryKey": false,
833
+ "notNull": false,
834
+ "autoincrement": false
835
+ },
836
+ "project_id": {
837
+ "name": "project_id",
838
+ "type": "text",
839
+ "primaryKey": false,
840
+ "notNull": false,
841
+ "autoincrement": false
842
+ },
843
+ "name": {
844
+ "name": "name",
845
+ "type": "text",
846
+ "primaryKey": false,
847
+ "notNull": true,
848
+ "autoincrement": false
849
+ },
850
+ "description": {
851
+ "name": "description",
852
+ "type": "text",
853
+ "primaryKey": false,
854
+ "notNull": true,
855
+ "autoincrement": false
856
+ },
857
+ "body": {
858
+ "name": "body",
859
+ "type": "text",
860
+ "primaryKey": false,
861
+ "notNull": true,
862
+ "autoincrement": false,
863
+ "default": "''"
864
+ },
865
+ "actor": {
866
+ "name": "actor",
867
+ "type": "text",
868
+ "primaryKey": false,
869
+ "notNull": true,
870
+ "autoincrement": false
871
+ },
872
+ "from_project_id": {
873
+ "name": "from_project_id",
874
+ "type": "text",
875
+ "primaryKey": false,
876
+ "notNull": false,
877
+ "autoincrement": false
878
+ },
879
+ "session_id": {
880
+ "name": "session_id",
881
+ "type": "text",
882
+ "primaryKey": false,
883
+ "notNull": false,
884
+ "autoincrement": false
885
+ },
886
+ "confidence": {
887
+ "name": "confidence",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": true,
891
+ "autoincrement": false
892
+ },
893
+ "evidence": {
894
+ "name": "evidence",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": false,
898
+ "autoincrement": false
899
+ },
900
+ "status": {
901
+ "name": "status",
902
+ "type": "text",
903
+ "primaryKey": false,
904
+ "notNull": true,
905
+ "autoincrement": false,
906
+ "default": "'pending'"
907
+ },
908
+ "resolved_at": {
909
+ "name": "resolved_at",
910
+ "type": "integer",
911
+ "primaryKey": false,
912
+ "notNull": false,
913
+ "autoincrement": false
914
+ },
915
+ "resolution_note": {
916
+ "name": "resolution_note",
917
+ "type": "text",
918
+ "primaryKey": false,
919
+ "notNull": false,
920
+ "autoincrement": false
921
+ },
922
+ "created_at": {
923
+ "name": "created_at",
924
+ "type": "integer",
925
+ "primaryKey": false,
926
+ "notNull": true,
927
+ "autoincrement": false,
928
+ "default": "(unixepoch('subsec') * 1000)"
929
+ },
930
+ "updated_at": {
931
+ "name": "updated_at",
932
+ "type": "integer",
933
+ "primaryKey": false,
934
+ "notNull": true,
935
+ "autoincrement": false,
936
+ "default": "(unixepoch('subsec') * 1000)"
937
+ }
938
+ },
939
+ "indexes": {},
940
+ "foreignKeys": {},
941
+ "compositePrimaryKeys": {},
942
+ "uniqueConstraints": {},
943
+ "checkConstraints": {
944
+ "memory_proposal_status": {
945
+ "name": "memory_proposal_status",
946
+ "value": "\"memory_proposal\".\"status\" IN ('pending', 'approved', 'rejected')"
947
+ },
948
+ "memory_proposal_type": {
949
+ "name": "memory_proposal_type",
950
+ "value": "\"memory_proposal\".\"type\" IN ('user', 'feedback', 'project', 'domain', 'process', 'contract', 'reference')"
951
+ },
952
+ "memory_proposal_scope": {
953
+ "name": "memory_proposal_scope",
954
+ "value": "\"memory_proposal\".\"scope\" IN ('global', 'workspace', 'project')"
955
+ },
956
+ "memory_proposal_actor": {
957
+ "name": "memory_proposal_actor",
958
+ "value": "\"memory_proposal\".\"actor\" IN ('human', 'agent', 'distiller', 'auto_research', 'import')"
959
+ },
960
+ "memory_proposal_confidence": {
961
+ "name": "memory_proposal_confidence",
962
+ "value": "\"memory_proposal\".\"confidence\" IN ('low', 'medium', 'high')"
963
+ }
964
+ }
965
+ },
966
+ "memory_signal": {
967
+ "name": "memory_signal",
968
+ "columns": {
969
+ "path": {
970
+ "name": "path",
971
+ "type": "text",
972
+ "primaryKey": true,
973
+ "notNull": true,
974
+ "autoincrement": false
975
+ },
976
+ "recall_count": {
977
+ "name": "recall_count",
978
+ "type": "integer",
979
+ "primaryKey": false,
980
+ "notNull": true,
981
+ "autoincrement": false,
982
+ "default": 0
983
+ },
984
+ "last_recalled_at": {
985
+ "name": "last_recalled_at",
986
+ "type": "integer",
987
+ "primaryKey": false,
988
+ "notNull": false,
989
+ "autoincrement": false
990
+ },
991
+ "best_score": {
992
+ "name": "best_score",
993
+ "type": "real",
994
+ "primaryKey": false,
995
+ "notNull": true,
996
+ "autoincrement": false,
997
+ "default": 0
998
+ },
999
+ "created_at": {
1000
+ "name": "created_at",
1001
+ "type": "integer",
1002
+ "primaryKey": false,
1003
+ "notNull": true,
1004
+ "autoincrement": false,
1005
+ "default": "(unixepoch('subsec') * 1000)"
1006
+ },
1007
+ "updated_at": {
1008
+ "name": "updated_at",
1009
+ "type": "integer",
1010
+ "primaryKey": false,
1011
+ "notNull": true,
1012
+ "autoincrement": false,
1013
+ "default": "(unixepoch('subsec') * 1000)"
1014
+ }
1015
+ },
1016
+ "indexes": {},
1017
+ "foreignKeys": {},
1018
+ "compositePrimaryKeys": {},
1019
+ "uniqueConstraints": {},
1020
+ "checkConstraints": {}
1021
+ },
1022
+ "memory_usage": {
1023
+ "name": "memory_usage",
1024
+ "columns": {
1025
+ "id": {
1026
+ "name": "id",
1027
+ "type": "text",
1028
+ "primaryKey": true,
1029
+ "notNull": true,
1030
+ "autoincrement": false
1031
+ },
1032
+ "kind": {
1033
+ "name": "kind",
1034
+ "type": "text",
1035
+ "primaryKey": false,
1036
+ "notNull": true,
1037
+ "autoincrement": false
1038
+ },
1039
+ "session_id": {
1040
+ "name": "session_id",
1041
+ "type": "text",
1042
+ "primaryKey": false,
1043
+ "notNull": false,
1044
+ "autoincrement": false
1045
+ },
1046
+ "workspace_id": {
1047
+ "name": "workspace_id",
1048
+ "type": "text",
1049
+ "primaryKey": false,
1050
+ "notNull": false,
1051
+ "autoincrement": false
1052
+ },
1053
+ "project_id": {
1054
+ "name": "project_id",
1055
+ "type": "text",
1056
+ "primaryKey": false,
1057
+ "notNull": false,
1058
+ "autoincrement": false
1059
+ },
1060
+ "amount": {
1061
+ "name": "amount",
1062
+ "type": "integer",
1063
+ "primaryKey": false,
1064
+ "notNull": true,
1065
+ "autoincrement": false,
1066
+ "default": 0
1067
+ },
1068
+ "duration_ms": {
1069
+ "name": "duration_ms",
1070
+ "type": "integer",
1071
+ "primaryKey": false,
1072
+ "notNull": true,
1073
+ "autoincrement": false,
1074
+ "default": 0
1075
+ },
1076
+ "created_at": {
1077
+ "name": "created_at",
1078
+ "type": "integer",
1079
+ "primaryKey": false,
1080
+ "notNull": true,
1081
+ "autoincrement": false,
1082
+ "default": "(unixepoch('subsec') * 1000)"
1083
+ },
1084
+ "updated_at": {
1085
+ "name": "updated_at",
1086
+ "type": "integer",
1087
+ "primaryKey": false,
1088
+ "notNull": true,
1089
+ "autoincrement": false,
1090
+ "default": "(unixepoch('subsec') * 1000)"
1091
+ }
1092
+ },
1093
+ "indexes": {},
1094
+ "foreignKeys": {},
1095
+ "compositePrimaryKeys": {},
1096
+ "uniqueConstraints": {},
1097
+ "checkConstraints": {}
1098
+ },
1099
+ "named_agent": {
1100
+ "name": "named_agent",
1101
+ "columns": {
1102
+ "id": {
1103
+ "name": "id",
1104
+ "type": "text",
1105
+ "primaryKey": true,
1106
+ "notNull": true,
1107
+ "autoincrement": false
1108
+ },
1109
+ "workspace_id": {
1110
+ "name": "workspace_id",
1111
+ "type": "text",
1112
+ "primaryKey": false,
1113
+ "notNull": true,
1114
+ "autoincrement": false
1115
+ },
1116
+ "name": {
1117
+ "name": "name",
1118
+ "type": "text",
1119
+ "primaryKey": false,
1120
+ "notNull": true,
1121
+ "autoincrement": false
1122
+ },
1123
+ "adapter": {
1124
+ "name": "adapter",
1125
+ "type": "text",
1126
+ "primaryKey": false,
1127
+ "notNull": true,
1128
+ "autoincrement": false
1129
+ },
1130
+ "model": {
1131
+ "name": "model",
1132
+ "type": "text",
1133
+ "primaryKey": false,
1134
+ "notNull": false,
1135
+ "autoincrement": false
1136
+ },
1137
+ "instructions": {
1138
+ "name": "instructions",
1139
+ "type": "text",
1140
+ "primaryKey": false,
1141
+ "notNull": true,
1142
+ "autoincrement": false,
1143
+ "default": "''"
1144
+ },
1145
+ "created_at": {
1146
+ "name": "created_at",
1147
+ "type": "integer",
1148
+ "primaryKey": false,
1149
+ "notNull": true,
1150
+ "autoincrement": false,
1151
+ "default": "(unixepoch('subsec') * 1000)"
1152
+ },
1153
+ "updated_at": {
1154
+ "name": "updated_at",
1155
+ "type": "integer",
1156
+ "primaryKey": false,
1157
+ "notNull": true,
1158
+ "autoincrement": false,
1159
+ "default": "(unixepoch('subsec') * 1000)"
1160
+ }
1161
+ },
1162
+ "indexes": {
1163
+ "named_agent_name_in_workspace": {
1164
+ "name": "named_agent_name_in_workspace",
1165
+ "columns": [
1166
+ "workspace_id",
1167
+ "name"
1168
+ ],
1169
+ "isUnique": true
1170
+ }
1171
+ },
1172
+ "foreignKeys": {
1173
+ "named_agent_workspace_id_workspace_id_fk": {
1174
+ "name": "named_agent_workspace_id_workspace_id_fk",
1175
+ "tableFrom": "named_agent",
1176
+ "tableTo": "workspace",
1177
+ "columnsFrom": [
1178
+ "workspace_id"
1179
+ ],
1180
+ "columnsTo": [
1181
+ "id"
1182
+ ],
1183
+ "onDelete": "restrict",
1184
+ "onUpdate": "no action"
1185
+ }
1186
+ },
1187
+ "compositePrimaryKeys": {},
1188
+ "uniqueConstraints": {},
1189
+ "checkConstraints": {}
1190
+ },
1191
+ "playbook": {
1192
+ "name": "playbook",
1193
+ "columns": {
1194
+ "id": {
1195
+ "name": "id",
1196
+ "type": "text",
1197
+ "primaryKey": true,
1198
+ "notNull": true,
1199
+ "autoincrement": false
1200
+ },
1201
+ "path": {
1202
+ "name": "path",
1203
+ "type": "text",
1204
+ "primaryKey": false,
1205
+ "notNull": true,
1206
+ "autoincrement": false
1207
+ },
1208
+ "scope": {
1209
+ "name": "scope",
1210
+ "type": "text",
1211
+ "primaryKey": false,
1212
+ "notNull": true,
1213
+ "autoincrement": false
1214
+ },
1215
+ "slug": {
1216
+ "name": "slug",
1217
+ "type": "text",
1218
+ "primaryKey": false,
1219
+ "notNull": true,
1220
+ "autoincrement": false
1221
+ },
1222
+ "workspace_id": {
1223
+ "name": "workspace_id",
1224
+ "type": "text",
1225
+ "primaryKey": false,
1226
+ "notNull": true,
1227
+ "autoincrement": false,
1228
+ "default": "''"
1229
+ },
1230
+ "project_id": {
1231
+ "name": "project_id",
1232
+ "type": "text",
1233
+ "primaryKey": false,
1234
+ "notNull": true,
1235
+ "autoincrement": false,
1236
+ "default": "''"
1237
+ },
1238
+ "task_class": {
1239
+ "name": "task_class",
1240
+ "type": "text",
1241
+ "primaryKey": false,
1242
+ "notNull": true,
1243
+ "autoincrement": false
1244
+ },
1245
+ "description": {
1246
+ "name": "description",
1247
+ "type": "text",
1248
+ "primaryKey": false,
1249
+ "notNull": true,
1250
+ "autoincrement": false
1251
+ },
1252
+ "pinned": {
1253
+ "name": "pinned",
1254
+ "type": "integer",
1255
+ "primaryKey": false,
1256
+ "notNull": true,
1257
+ "autoincrement": false,
1258
+ "default": false
1259
+ },
1260
+ "archived": {
1261
+ "name": "archived",
1262
+ "type": "integer",
1263
+ "primaryKey": false,
1264
+ "notNull": true,
1265
+ "autoincrement": false,
1266
+ "default": false
1267
+ },
1268
+ "loads": {
1269
+ "name": "loads",
1270
+ "type": "integer",
1271
+ "primaryKey": false,
1272
+ "notNull": true,
1273
+ "autoincrement": false,
1274
+ "default": 0
1275
+ },
1276
+ "last_loaded_at": {
1277
+ "name": "last_loaded_at",
1278
+ "type": "integer",
1279
+ "primaryKey": false,
1280
+ "notNull": false,
1281
+ "autoincrement": false
1282
+ },
1283
+ "content_hash": {
1284
+ "name": "content_hash",
1285
+ "type": "text",
1286
+ "primaryKey": false,
1287
+ "notNull": true,
1288
+ "autoincrement": false
1289
+ },
1290
+ "created_at": {
1291
+ "name": "created_at",
1292
+ "type": "integer",
1293
+ "primaryKey": false,
1294
+ "notNull": true,
1295
+ "autoincrement": false,
1296
+ "default": "(unixepoch('subsec') * 1000)"
1297
+ },
1298
+ "updated_at": {
1299
+ "name": "updated_at",
1300
+ "type": "integer",
1301
+ "primaryKey": false,
1302
+ "notNull": true,
1303
+ "autoincrement": false,
1304
+ "default": "(unixepoch('subsec') * 1000)"
1305
+ }
1306
+ },
1307
+ "indexes": {
1308
+ "playbook_path_unique": {
1309
+ "name": "playbook_path_unique",
1310
+ "columns": [
1311
+ "path"
1312
+ ],
1313
+ "isUnique": true
1314
+ },
1315
+ "playbook_identity": {
1316
+ "name": "playbook_identity",
1317
+ "columns": [
1318
+ "scope",
1319
+ "workspace_id",
1320
+ "project_id",
1321
+ "slug"
1322
+ ],
1323
+ "isUnique": true
1324
+ }
1325
+ },
1326
+ "foreignKeys": {},
1327
+ "compositePrimaryKeys": {},
1328
+ "uniqueConstraints": {},
1329
+ "checkConstraints": {
1330
+ "playbook_scope": {
1331
+ "name": "playbook_scope",
1332
+ "value": "\"playbook\".\"scope\" IN ('workspace', 'project')"
1333
+ }
1334
+ }
1335
+ },
1336
+ "project": {
1337
+ "name": "project",
1338
+ "columns": {
1339
+ "id": {
1340
+ "name": "id",
1341
+ "type": "text",
1342
+ "primaryKey": true,
1343
+ "notNull": true,
1344
+ "autoincrement": false
1345
+ },
1346
+ "workspace_id": {
1347
+ "name": "workspace_id",
1348
+ "type": "text",
1349
+ "primaryKey": false,
1350
+ "notNull": true,
1351
+ "autoincrement": false
1352
+ },
1353
+ "name": {
1354
+ "name": "name",
1355
+ "type": "text",
1356
+ "primaryKey": false,
1357
+ "notNull": true,
1358
+ "autoincrement": false
1359
+ },
1360
+ "path": {
1361
+ "name": "path",
1362
+ "type": "text",
1363
+ "primaryKey": false,
1364
+ "notNull": true,
1365
+ "autoincrement": false
1366
+ },
1367
+ "default_branch": {
1368
+ "name": "default_branch",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": true,
1372
+ "autoincrement": false
1373
+ },
1374
+ "remote_url": {
1375
+ "name": "remote_url",
1376
+ "type": "text",
1377
+ "primaryKey": false,
1378
+ "notNull": false,
1379
+ "autoincrement": false
1380
+ },
1381
+ "managed": {
1382
+ "name": "managed",
1383
+ "type": "integer",
1384
+ "primaryKey": false,
1385
+ "notNull": true,
1386
+ "autoincrement": false,
1387
+ "default": false
1388
+ },
1389
+ "scripts_trusted_hash": {
1390
+ "name": "scripts_trusted_hash",
1391
+ "type": "text",
1392
+ "primaryKey": false,
1393
+ "notNull": false,
1394
+ "autoincrement": false
1395
+ },
1396
+ "created_at": {
1397
+ "name": "created_at",
1398
+ "type": "integer",
1399
+ "primaryKey": false,
1400
+ "notNull": true,
1401
+ "autoincrement": false,
1402
+ "default": "(unixepoch('subsec') * 1000)"
1403
+ },
1404
+ "updated_at": {
1405
+ "name": "updated_at",
1406
+ "type": "integer",
1407
+ "primaryKey": false,
1408
+ "notNull": true,
1409
+ "autoincrement": false,
1410
+ "default": "(unixepoch('subsec') * 1000)"
1411
+ }
1412
+ },
1413
+ "indexes": {
1414
+ "project_path_unique": {
1415
+ "name": "project_path_unique",
1416
+ "columns": [
1417
+ "path"
1418
+ ],
1419
+ "isUnique": true
1420
+ },
1421
+ "project_name_per_workspace": {
1422
+ "name": "project_name_per_workspace",
1423
+ "columns": [
1424
+ "workspace_id",
1425
+ "name"
1426
+ ],
1427
+ "isUnique": true
1428
+ }
1429
+ },
1430
+ "foreignKeys": {
1431
+ "project_workspace_id_workspace_id_fk": {
1432
+ "name": "project_workspace_id_workspace_id_fk",
1433
+ "tableFrom": "project",
1434
+ "tableTo": "workspace",
1435
+ "columnsFrom": [
1436
+ "workspace_id"
1437
+ ],
1438
+ "columnsTo": [
1439
+ "id"
1440
+ ],
1441
+ "onDelete": "restrict",
1442
+ "onUpdate": "no action"
1443
+ }
1444
+ },
1445
+ "compositePrimaryKeys": {},
1446
+ "uniqueConstraints": {},
1447
+ "checkConstraints": {}
1448
+ },
1449
+ "role_binding": {
1450
+ "name": "role_binding",
1451
+ "columns": {
1452
+ "id": {
1453
+ "name": "id",
1454
+ "type": "text",
1455
+ "primaryKey": true,
1456
+ "notNull": true,
1457
+ "autoincrement": false
1458
+ },
1459
+ "scope_type": {
1460
+ "name": "scope_type",
1461
+ "type": "text",
1462
+ "primaryKey": false,
1463
+ "notNull": true,
1464
+ "autoincrement": false
1465
+ },
1466
+ "scope_id": {
1467
+ "name": "scope_id",
1468
+ "type": "text",
1469
+ "primaryKey": false,
1470
+ "notNull": true,
1471
+ "autoincrement": false
1472
+ },
1473
+ "role": {
1474
+ "name": "role",
1475
+ "type": "text",
1476
+ "primaryKey": false,
1477
+ "notNull": true,
1478
+ "autoincrement": false
1479
+ },
1480
+ "agent_id": {
1481
+ "name": "agent_id",
1482
+ "type": "text",
1483
+ "primaryKey": false,
1484
+ "notNull": true,
1485
+ "autoincrement": false
1486
+ },
1487
+ "created_at": {
1488
+ "name": "created_at",
1489
+ "type": "integer",
1490
+ "primaryKey": false,
1491
+ "notNull": true,
1492
+ "autoincrement": false,
1493
+ "default": "(unixepoch('subsec') * 1000)"
1494
+ },
1495
+ "updated_at": {
1496
+ "name": "updated_at",
1497
+ "type": "integer",
1498
+ "primaryKey": false,
1499
+ "notNull": true,
1500
+ "autoincrement": false,
1501
+ "default": "(unixepoch('subsec') * 1000)"
1502
+ }
1503
+ },
1504
+ "indexes": {
1505
+ "role_binding_one_per_scope": {
1506
+ "name": "role_binding_one_per_scope",
1507
+ "columns": [
1508
+ "scope_type",
1509
+ "scope_id",
1510
+ "role"
1511
+ ],
1512
+ "isUnique": true
1513
+ }
1514
+ },
1515
+ "foreignKeys": {
1516
+ "role_binding_agent_id_named_agent_id_fk": {
1517
+ "name": "role_binding_agent_id_named_agent_id_fk",
1518
+ "tableFrom": "role_binding",
1519
+ "tableTo": "named_agent",
1520
+ "columnsFrom": [
1521
+ "agent_id"
1522
+ ],
1523
+ "columnsTo": [
1524
+ "id"
1525
+ ],
1526
+ "onDelete": "cascade",
1527
+ "onUpdate": "no action"
1528
+ }
1529
+ },
1530
+ "compositePrimaryKeys": {},
1531
+ "uniqueConstraints": {},
1532
+ "checkConstraints": {
1533
+ "role_binding_scope_type": {
1534
+ "name": "role_binding_scope_type",
1535
+ "value": "\"role_binding\".\"scope_type\" IN ('workspace', 'project', 'task')"
1536
+ },
1537
+ "role_binding_role": {
1538
+ "name": "role_binding_role",
1539
+ "value": "\"role_binding\".\"role\" IN ('implementador', 'revisor', 'testador')"
1540
+ }
1541
+ }
1542
+ },
1543
+ "session": {
1544
+ "name": "session",
1545
+ "columns": {
1546
+ "id": {
1547
+ "name": "id",
1548
+ "type": "text",
1549
+ "primaryKey": true,
1550
+ "notNull": true,
1551
+ "autoincrement": false
1552
+ },
1553
+ "kind": {
1554
+ "name": "kind",
1555
+ "type": "text",
1556
+ "primaryKey": false,
1557
+ "notNull": true,
1558
+ "autoincrement": false
1559
+ },
1560
+ "script_name": {
1561
+ "name": "script_name",
1562
+ "type": "text",
1563
+ "primaryKey": false,
1564
+ "notNull": false,
1565
+ "autoincrement": false
1566
+ },
1567
+ "agent_config_id": {
1568
+ "name": "agent_config_id",
1569
+ "type": "text",
1570
+ "primaryKey": false,
1571
+ "notNull": false,
1572
+ "autoincrement": false
1573
+ },
1574
+ "agent_account_id": {
1575
+ "name": "agent_account_id",
1576
+ "type": "text",
1577
+ "primaryKey": false,
1578
+ "notNull": false,
1579
+ "autoincrement": false
1580
+ },
1581
+ "scope_type": {
1582
+ "name": "scope_type",
1583
+ "type": "text",
1584
+ "primaryKey": false,
1585
+ "notNull": true,
1586
+ "autoincrement": false
1587
+ },
1588
+ "scope_id": {
1589
+ "name": "scope_id",
1590
+ "type": "text",
1591
+ "primaryKey": false,
1592
+ "notNull": true,
1593
+ "autoincrement": false
1594
+ },
1595
+ "cwd": {
1596
+ "name": "cwd",
1597
+ "type": "text",
1598
+ "primaryKey": false,
1599
+ "notNull": true,
1600
+ "autoincrement": false
1601
+ },
1602
+ "command": {
1603
+ "name": "command",
1604
+ "type": "text",
1605
+ "primaryKey": false,
1606
+ "notNull": true,
1607
+ "autoincrement": false
1608
+ },
1609
+ "state": {
1610
+ "name": "state",
1611
+ "type": "text",
1612
+ "primaryKey": false,
1613
+ "notNull": true,
1614
+ "autoincrement": false,
1615
+ "default": "'running'"
1616
+ },
1617
+ "exit_code": {
1618
+ "name": "exit_code",
1619
+ "type": "integer",
1620
+ "primaryKey": false,
1621
+ "notNull": false,
1622
+ "autoincrement": false
1623
+ },
1624
+ "transport": {
1625
+ "name": "transport",
1626
+ "type": "text",
1627
+ "primaryKey": false,
1628
+ "notNull": true,
1629
+ "autoincrement": false,
1630
+ "default": "'pty'"
1631
+ },
1632
+ "acp_session_id": {
1633
+ "name": "acp_session_id",
1634
+ "type": "text",
1635
+ "primaryKey": false,
1636
+ "notNull": false,
1637
+ "autoincrement": false
1638
+ },
1639
+ "mode": {
1640
+ "name": "mode",
1641
+ "type": "text",
1642
+ "primaryKey": false,
1643
+ "notNull": false,
1644
+ "autoincrement": false
1645
+ },
1646
+ "model": {
1647
+ "name": "model",
1648
+ "type": "text",
1649
+ "primaryKey": false,
1650
+ "notNull": false,
1651
+ "autoincrement": false
1652
+ },
1653
+ "lumem_mode": {
1654
+ "name": "lumem_mode",
1655
+ "type": "text",
1656
+ "primaryKey": false,
1657
+ "notNull": true,
1658
+ "autoincrement": false,
1659
+ "default": "'ask'"
1660
+ },
1661
+ "resumed_from_id": {
1662
+ "name": "resumed_from_id",
1663
+ "type": "text",
1664
+ "primaryKey": false,
1665
+ "notNull": false,
1666
+ "autoincrement": false
1667
+ },
1668
+ "task_id": {
1669
+ "name": "task_id",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": false,
1673
+ "autoincrement": false
1674
+ },
1675
+ "task_role": {
1676
+ "name": "task_role",
1677
+ "type": "text",
1678
+ "primaryKey": false,
1679
+ "notNull": false,
1680
+ "autoincrement": false
1681
+ },
1682
+ "pending_prompt": {
1683
+ "name": "pending_prompt",
1684
+ "type": "text",
1685
+ "primaryKey": false,
1686
+ "notNull": false,
1687
+ "autoincrement": false
1688
+ },
1689
+ "pending_reason": {
1690
+ "name": "pending_reason",
1691
+ "type": "text",
1692
+ "primaryKey": false,
1693
+ "notNull": false,
1694
+ "autoincrement": false
1695
+ },
1696
+ "pending_detail": {
1697
+ "name": "pending_detail",
1698
+ "type": "text",
1699
+ "primaryKey": false,
1700
+ "notNull": false,
1701
+ "autoincrement": false
1702
+ },
1703
+ "created_at": {
1704
+ "name": "created_at",
1705
+ "type": "integer",
1706
+ "primaryKey": false,
1707
+ "notNull": true,
1708
+ "autoincrement": false,
1709
+ "default": "(unixepoch('subsec') * 1000)"
1710
+ },
1711
+ "updated_at": {
1712
+ "name": "updated_at",
1713
+ "type": "integer",
1714
+ "primaryKey": false,
1715
+ "notNull": true,
1716
+ "autoincrement": false,
1717
+ "default": "(unixepoch('subsec') * 1000)"
1718
+ }
1719
+ },
1720
+ "indexes": {},
1721
+ "foreignKeys": {
1722
+ "session_agent_config_id_agent_config_id_fk": {
1723
+ "name": "session_agent_config_id_agent_config_id_fk",
1724
+ "tableFrom": "session",
1725
+ "tableTo": "agent_config",
1726
+ "columnsFrom": [
1727
+ "agent_config_id"
1728
+ ],
1729
+ "columnsTo": [
1730
+ "id"
1731
+ ],
1732
+ "onDelete": "restrict",
1733
+ "onUpdate": "no action"
1734
+ },
1735
+ "session_agent_account_id_agent_account_id_fk": {
1736
+ "name": "session_agent_account_id_agent_account_id_fk",
1737
+ "tableFrom": "session",
1738
+ "tableTo": "agent_account",
1739
+ "columnsFrom": [
1740
+ "agent_account_id"
1741
+ ],
1742
+ "columnsTo": [
1743
+ "id"
1744
+ ],
1745
+ "onDelete": "restrict",
1746
+ "onUpdate": "no action"
1747
+ },
1748
+ "session_task_id_task_id_fk": {
1749
+ "name": "session_task_id_task_id_fk",
1750
+ "tableFrom": "session",
1751
+ "tableTo": "task",
1752
+ "columnsFrom": [
1753
+ "task_id"
1754
+ ],
1755
+ "columnsTo": [
1756
+ "id"
1757
+ ],
1758
+ "onDelete": "set null",
1759
+ "onUpdate": "no action"
1760
+ }
1761
+ },
1762
+ "compositePrimaryKeys": {},
1763
+ "uniqueConstraints": {},
1764
+ "checkConstraints": {
1765
+ "session_kind": {
1766
+ "name": "session_kind",
1767
+ "value": "\"session\".\"kind\" IN ('shell', 'agent', 'script')"
1768
+ },
1769
+ "session_scope_type": {
1770
+ "name": "session_scope_type",
1771
+ "value": "\"session\".\"scope_type\" IN ('project', 'worktree')"
1772
+ },
1773
+ "session_state": {
1774
+ "name": "session_state",
1775
+ "value": "\"session\".\"state\" IN ('running', 'exited')"
1776
+ },
1777
+ "session_agent_config": {
1778
+ "name": "session_agent_config",
1779
+ "value": "(\"session\".\"kind\" = 'agent' AND \"session\".\"agent_config_id\" IS NOT NULL\n AND \"session\".\"agent_account_id\" IS NOT NULL)\n OR (\"session\".\"kind\" <> 'agent' AND \"session\".\"agent_config_id\" IS NULL\n AND \"session\".\"agent_account_id\" IS NULL)"
1780
+ },
1781
+ "session_script_name": {
1782
+ "name": "session_script_name",
1783
+ "value": "(\"session\".\"kind\" = 'script' AND \"session\".\"script_name\" IS NOT NULL\n AND \"session\".\"script_name\" IN ('setup', 'run', 'teardown', 'test'))\n OR (\"session\".\"kind\" <> 'script' AND \"session\".\"script_name\" IS NULL)"
1784
+ },
1785
+ "session_exit_code": {
1786
+ "name": "session_exit_code",
1787
+ "value": "(\"session\".\"state\" = 'running' AND \"session\".\"exit_code\" IS NULL)\n OR (\"session\".\"state\" = 'exited')"
1788
+ },
1789
+ "session_transport": {
1790
+ "name": "session_transport",
1791
+ "value": "\"session\".\"transport\" IN ('pty', 'acp')"
1792
+ },
1793
+ "session_shell_transport": {
1794
+ "name": "session_shell_transport",
1795
+ "value": "\"session\".\"kind\" = 'agent' OR \"session\".\"transport\" = 'pty'"
1796
+ },
1797
+ "session_acp_id": {
1798
+ "name": "session_acp_id",
1799
+ "value": "(\"session\".\"transport\" = 'acp' AND \"session\".\"acp_session_id\" IS NOT NULL)\n OR (\"session\".\"transport\" = 'pty' AND \"session\".\"acp_session_id\" IS NULL)"
1800
+ },
1801
+ "session_lumem_mode": {
1802
+ "name": "session_lumem_mode",
1803
+ "value": "\"session\".\"lumem_mode\" IN ('ask', 'auto', 'free')"
1804
+ },
1805
+ "session_pending_reason": {
1806
+ "name": "session_pending_reason",
1807
+ "value": "\"session\".\"pending_reason\" IS NULL OR \"session\".\"pending_reason\" IN ('setup_failed')"
1808
+ }
1809
+ }
1810
+ },
1811
+ "session_usage": {
1812
+ "name": "session_usage",
1813
+ "columns": {
1814
+ "id": {
1815
+ "name": "id",
1816
+ "type": "text",
1817
+ "primaryKey": true,
1818
+ "notNull": true,
1819
+ "autoincrement": false
1820
+ },
1821
+ "session_id": {
1822
+ "name": "session_id",
1823
+ "type": "text",
1824
+ "primaryKey": false,
1825
+ "notNull": true,
1826
+ "autoincrement": false
1827
+ },
1828
+ "project_id": {
1829
+ "name": "project_id",
1830
+ "type": "text",
1831
+ "primaryKey": false,
1832
+ "notNull": true,
1833
+ "autoincrement": false
1834
+ },
1835
+ "worktree_id": {
1836
+ "name": "worktree_id",
1837
+ "type": "text",
1838
+ "primaryKey": false,
1839
+ "notNull": true,
1840
+ "autoincrement": false,
1841
+ "default": "''"
1842
+ },
1843
+ "agent_config_id": {
1844
+ "name": "agent_config_id",
1845
+ "type": "text",
1846
+ "primaryKey": false,
1847
+ "notNull": false,
1848
+ "autoincrement": false
1849
+ },
1850
+ "agent_account_id": {
1851
+ "name": "agent_account_id",
1852
+ "type": "text",
1853
+ "primaryKey": false,
1854
+ "notNull": false,
1855
+ "autoincrement": false
1856
+ },
1857
+ "tokens": {
1858
+ "name": "tokens",
1859
+ "type": "integer",
1860
+ "primaryKey": false,
1861
+ "notNull": true,
1862
+ "autoincrement": false,
1863
+ "default": 0
1864
+ },
1865
+ "turn": {
1866
+ "name": "turn",
1867
+ "type": "integer",
1868
+ "primaryKey": false,
1869
+ "notNull": true,
1870
+ "autoincrement": false,
1871
+ "default": 0
1872
+ },
1873
+ "cost": {
1874
+ "name": "cost",
1875
+ "type": "real",
1876
+ "primaryKey": false,
1877
+ "notNull": false,
1878
+ "autoincrement": false
1879
+ },
1880
+ "currency": {
1881
+ "name": "currency",
1882
+ "type": "text",
1883
+ "primaryKey": false,
1884
+ "notNull": false,
1885
+ "autoincrement": false
1886
+ },
1887
+ "created_at": {
1888
+ "name": "created_at",
1889
+ "type": "integer",
1890
+ "primaryKey": false,
1891
+ "notNull": true,
1892
+ "autoincrement": false,
1893
+ "default": "(unixepoch('subsec') * 1000)"
1894
+ },
1895
+ "updated_at": {
1896
+ "name": "updated_at",
1897
+ "type": "integer",
1898
+ "primaryKey": false,
1899
+ "notNull": true,
1900
+ "autoincrement": false,
1901
+ "default": "(unixepoch('subsec') * 1000)"
1902
+ }
1903
+ },
1904
+ "indexes": {
1905
+ "session_usage_project_at": {
1906
+ "name": "session_usage_project_at",
1907
+ "columns": [
1908
+ "project_id",
1909
+ "created_at"
1910
+ ],
1911
+ "isUnique": false
1912
+ },
1913
+ "session_usage_worktree_at": {
1914
+ "name": "session_usage_worktree_at",
1915
+ "columns": [
1916
+ "worktree_id",
1917
+ "created_at"
1918
+ ],
1919
+ "isUnique": false
1920
+ }
1921
+ },
1922
+ "foreignKeys": {},
1923
+ "compositePrimaryKeys": {},
1924
+ "uniqueConstraints": {},
1925
+ "checkConstraints": {
1926
+ "session_usage_tokens": {
1927
+ "name": "session_usage_tokens",
1928
+ "value": "\"session_usage\".\"tokens\" >= 0"
1929
+ }
1930
+ }
1931
+ },
1932
+ "task": {
1933
+ "name": "task",
1934
+ "columns": {
1935
+ "id": {
1936
+ "name": "id",
1937
+ "type": "text",
1938
+ "primaryKey": true,
1939
+ "notNull": true,
1940
+ "autoincrement": false
1941
+ },
1942
+ "workspace_id": {
1943
+ "name": "workspace_id",
1944
+ "type": "text",
1945
+ "primaryKey": false,
1946
+ "notNull": true,
1947
+ "autoincrement": false
1948
+ },
1949
+ "project_id": {
1950
+ "name": "project_id",
1951
+ "type": "text",
1952
+ "primaryKey": false,
1953
+ "notNull": true,
1954
+ "autoincrement": false
1955
+ },
1956
+ "title": {
1957
+ "name": "title",
1958
+ "type": "text",
1959
+ "primaryKey": false,
1960
+ "notNull": true,
1961
+ "autoincrement": false
1962
+ },
1963
+ "body": {
1964
+ "name": "body",
1965
+ "type": "text",
1966
+ "primaryKey": false,
1967
+ "notNull": true,
1968
+ "autoincrement": false,
1969
+ "default": "''"
1970
+ },
1971
+ "status": {
1972
+ "name": "status",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": true,
1976
+ "autoincrement": false,
1977
+ "default": "'open'"
1978
+ },
1979
+ "created_by": {
1980
+ "name": "created_by",
1981
+ "type": "text",
1982
+ "primaryKey": false,
1983
+ "notNull": true,
1984
+ "autoincrement": false,
1985
+ "default": "'human'"
1986
+ },
1987
+ "created_by_session": {
1988
+ "name": "created_by_session",
1989
+ "type": "text",
1990
+ "primaryKey": false,
1991
+ "notNull": false,
1992
+ "autoincrement": false
1993
+ },
1994
+ "worktree_id": {
1995
+ "name": "worktree_id",
1996
+ "type": "text",
1997
+ "primaryKey": false,
1998
+ "notNull": false,
1999
+ "autoincrement": false
2000
+ },
2001
+ "position": {
2002
+ "name": "position",
2003
+ "type": "integer",
2004
+ "primaryKey": false,
2005
+ "notNull": true,
2006
+ "autoincrement": false,
2007
+ "default": 0
2008
+ },
2009
+ "links": {
2010
+ "name": "links",
2011
+ "type": "text",
2012
+ "primaryKey": false,
2013
+ "notNull": true,
2014
+ "autoincrement": false,
2015
+ "default": "'[]'"
2016
+ },
2017
+ "reason": {
2018
+ "name": "reason",
2019
+ "type": "text",
2020
+ "primaryKey": false,
2021
+ "notNull": false,
2022
+ "autoincrement": false
2023
+ },
2024
+ "attempts": {
2025
+ "name": "attempts",
2026
+ "type": "integer",
2027
+ "primaryKey": false,
2028
+ "notNull": true,
2029
+ "autoincrement": false,
2030
+ "default": 0
2031
+ },
2032
+ "bounces": {
2033
+ "name": "bounces",
2034
+ "type": "integer",
2035
+ "primaryKey": false,
2036
+ "notNull": true,
2037
+ "autoincrement": false,
2038
+ "default": 0
2039
+ },
2040
+ "autonomy": {
2041
+ "name": "autonomy",
2042
+ "type": "text",
2043
+ "primaryKey": false,
2044
+ "notNull": true,
2045
+ "autoincrement": false,
2046
+ "default": "'inherit'"
2047
+ },
2048
+ "prepared_prompt": {
2049
+ "name": "prepared_prompt",
2050
+ "type": "text",
2051
+ "primaryKey": false,
2052
+ "notNull": false,
2053
+ "autoincrement": false
2054
+ },
2055
+ "prepared_role": {
2056
+ "name": "prepared_role",
2057
+ "type": "text",
2058
+ "primaryKey": false,
2059
+ "notNull": false,
2060
+ "autoincrement": false
2061
+ },
2062
+ "blocked_reason": {
2063
+ "name": "blocked_reason",
2064
+ "type": "text",
2065
+ "primaryKey": false,
2066
+ "notNull": false,
2067
+ "autoincrement": false
2068
+ },
2069
+ "notified_at": {
2070
+ "name": "notified_at",
2071
+ "type": "integer",
2072
+ "primaryKey": false,
2073
+ "notNull": false,
2074
+ "autoincrement": false
2075
+ },
2076
+ "external_source": {
2077
+ "name": "external_source",
2078
+ "type": "text",
2079
+ "primaryKey": false,
2080
+ "notNull": false,
2081
+ "autoincrement": false
2082
+ },
2083
+ "external_id": {
2084
+ "name": "external_id",
2085
+ "type": "text",
2086
+ "primaryKey": false,
2087
+ "notNull": false,
2088
+ "autoincrement": false
2089
+ },
2090
+ "external_state": {
2091
+ "name": "external_state",
2092
+ "type": "text",
2093
+ "primaryKey": false,
2094
+ "notNull": false,
2095
+ "autoincrement": false
2096
+ },
2097
+ "external_assignee": {
2098
+ "name": "external_assignee",
2099
+ "type": "text",
2100
+ "primaryKey": false,
2101
+ "notNull": false,
2102
+ "autoincrement": false
2103
+ },
2104
+ "external_body_hash": {
2105
+ "name": "external_body_hash",
2106
+ "type": "text",
2107
+ "primaryKey": false,
2108
+ "notNull": false,
2109
+ "autoincrement": false
2110
+ },
2111
+ "external_marks": {
2112
+ "name": "external_marks",
2113
+ "type": "text",
2114
+ "primaryKey": false,
2115
+ "notNull": true,
2116
+ "autoincrement": false,
2117
+ "default": "'[]'"
2118
+ },
2119
+ "status_changed_at": {
2120
+ "name": "status_changed_at",
2121
+ "type": "integer",
2122
+ "primaryKey": false,
2123
+ "notNull": true,
2124
+ "autoincrement": false,
2125
+ "default": "0"
2126
+ },
2127
+ "closed_at": {
2128
+ "name": "closed_at",
2129
+ "type": "integer",
2130
+ "primaryKey": false,
2131
+ "notNull": false,
2132
+ "autoincrement": false
2133
+ },
2134
+ "created_at": {
2135
+ "name": "created_at",
2136
+ "type": "integer",
2137
+ "primaryKey": false,
2138
+ "notNull": true,
2139
+ "autoincrement": false,
2140
+ "default": "(unixepoch('subsec') * 1000)"
2141
+ },
2142
+ "updated_at": {
2143
+ "name": "updated_at",
2144
+ "type": "integer",
2145
+ "primaryKey": false,
2146
+ "notNull": true,
2147
+ "autoincrement": false,
2148
+ "default": "(unixepoch('subsec') * 1000)"
2149
+ }
2150
+ },
2151
+ "indexes": {
2152
+ "task_by_workspace": {
2153
+ "name": "task_by_workspace",
2154
+ "columns": [
2155
+ "workspace_id",
2156
+ "status"
2157
+ ],
2158
+ "isUnique": false
2159
+ },
2160
+ "task_by_position": {
2161
+ "name": "task_by_position",
2162
+ "columns": [
2163
+ "workspace_id",
2164
+ "status",
2165
+ "position"
2166
+ ],
2167
+ "isUnique": false
2168
+ },
2169
+ "task_by_project": {
2170
+ "name": "task_by_project",
2171
+ "columns": [
2172
+ "project_id"
2173
+ ],
2174
+ "isUnique": false
2175
+ },
2176
+ "task_external_in_workspace": {
2177
+ "name": "task_external_in_workspace",
2178
+ "columns": [
2179
+ "workspace_id",
2180
+ "external_source",
2181
+ "external_id"
2182
+ ],
2183
+ "isUnique": true
2184
+ }
2185
+ },
2186
+ "foreignKeys": {
2187
+ "task_workspace_id_workspace_id_fk": {
2188
+ "name": "task_workspace_id_workspace_id_fk",
2189
+ "tableFrom": "task",
2190
+ "tableTo": "workspace",
2191
+ "columnsFrom": [
2192
+ "workspace_id"
2193
+ ],
2194
+ "columnsTo": [
2195
+ "id"
2196
+ ],
2197
+ "onDelete": "restrict",
2198
+ "onUpdate": "no action"
2199
+ },
2200
+ "task_project_id_project_id_fk": {
2201
+ "name": "task_project_id_project_id_fk",
2202
+ "tableFrom": "task",
2203
+ "tableTo": "project",
2204
+ "columnsFrom": [
2205
+ "project_id"
2206
+ ],
2207
+ "columnsTo": [
2208
+ "id"
2209
+ ],
2210
+ "onDelete": "restrict",
2211
+ "onUpdate": "no action"
2212
+ },
2213
+ "task_worktree_id_worktree_id_fk": {
2214
+ "name": "task_worktree_id_worktree_id_fk",
2215
+ "tableFrom": "task",
2216
+ "tableTo": "worktree",
2217
+ "columnsFrom": [
2218
+ "worktree_id"
2219
+ ],
2220
+ "columnsTo": [
2221
+ "id"
2222
+ ],
2223
+ "onDelete": "set null",
2224
+ "onUpdate": "no action"
2225
+ }
2226
+ },
2227
+ "compositePrimaryKeys": {},
2228
+ "uniqueConstraints": {},
2229
+ "checkConstraints": {
2230
+ "task_status": {
2231
+ "name": "task_status",
2232
+ "value": "\"task\".\"status\" IN ('proposed', 'backlog', 'open', 'in_progress', 'review', 'testing', 'ready_to_merge', 'done', 'dropped')"
2233
+ },
2234
+ "task_created_by": {
2235
+ "name": "task_created_by",
2236
+ "value": "\"task\".\"created_by\" IN ('human', 'agent')"
2237
+ },
2238
+ "task_autonomy": {
2239
+ "name": "task_autonomy",
2240
+ "value": "\"task\".\"autonomy\" IN ('inherit', 'off')"
2241
+ },
2242
+ "task_attempts_not_negative": {
2243
+ "name": "task_attempts_not_negative",
2244
+ "value": "\"task\".\"attempts\" >= 0"
2245
+ },
2246
+ "task_bounces_not_negative": {
2247
+ "name": "task_bounces_not_negative",
2248
+ "value": "\"task\".\"bounces\" >= 0"
2249
+ },
2250
+ "task_prepared_pair": {
2251
+ "name": "task_prepared_pair",
2252
+ "value": "(\"task\".\"prepared_prompt\" IS NULL AND \"task\".\"prepared_role\" IS NULL)\n OR (\"task\".\"prepared_prompt\" IS NOT NULL AND \"task\".\"prepared_role\" IS NOT NULL)"
2253
+ },
2254
+ "task_agent_provenance": {
2255
+ "name": "task_agent_provenance",
2256
+ "value": "(\"task\".\"created_by\" = 'agent' AND \"task\".\"created_by_session\" IS NOT NULL)\n OR (\"task\".\"created_by\" = 'human' AND \"task\".\"created_by_session\" IS NULL)"
2257
+ },
2258
+ "task_closed_at": {
2259
+ "name": "task_closed_at",
2260
+ "value": "(\"task\".\"status\" IN ('done', 'dropped') AND \"task\".\"closed_at\" IS NOT NULL)\n OR (\"task\".\"status\" NOT IN ('done', 'dropped') AND \"task\".\"closed_at\" IS NULL)"
2261
+ }
2262
+ }
2263
+ },
2264
+ "task_comment": {
2265
+ "name": "task_comment",
2266
+ "columns": {
2267
+ "id": {
2268
+ "name": "id",
2269
+ "type": "text",
2270
+ "primaryKey": true,
2271
+ "notNull": true,
2272
+ "autoincrement": false
2273
+ },
2274
+ "task_id": {
2275
+ "name": "task_id",
2276
+ "type": "text",
2277
+ "primaryKey": false,
2278
+ "notNull": true,
2279
+ "autoincrement": false
2280
+ },
2281
+ "body": {
2282
+ "name": "body",
2283
+ "type": "text",
2284
+ "primaryKey": false,
2285
+ "notNull": true,
2286
+ "autoincrement": false
2287
+ },
2288
+ "created_by": {
2289
+ "name": "created_by",
2290
+ "type": "text",
2291
+ "primaryKey": false,
2292
+ "notNull": true,
2293
+ "autoincrement": false,
2294
+ "default": "'human'"
2295
+ },
2296
+ "created_by_session": {
2297
+ "name": "created_by_session",
2298
+ "type": "text",
2299
+ "primaryKey": false,
2300
+ "notNull": false,
2301
+ "autoincrement": false
2302
+ },
2303
+ "created_at": {
2304
+ "name": "created_at",
2305
+ "type": "integer",
2306
+ "primaryKey": false,
2307
+ "notNull": true,
2308
+ "autoincrement": false,
2309
+ "default": "(unixepoch('subsec') * 1000)"
2310
+ },
2311
+ "updated_at": {
2312
+ "name": "updated_at",
2313
+ "type": "integer",
2314
+ "primaryKey": false,
2315
+ "notNull": true,
2316
+ "autoincrement": false,
2317
+ "default": "(unixepoch('subsec') * 1000)"
2318
+ }
2319
+ },
2320
+ "indexes": {
2321
+ "task_comment_by_task": {
2322
+ "name": "task_comment_by_task",
2323
+ "columns": [
2324
+ "task_id",
2325
+ "created_at"
2326
+ ],
2327
+ "isUnique": false
2328
+ }
2329
+ },
2330
+ "foreignKeys": {
2331
+ "task_comment_task_id_task_id_fk": {
2332
+ "name": "task_comment_task_id_task_id_fk",
2333
+ "tableFrom": "task_comment",
2334
+ "tableTo": "task",
2335
+ "columnsFrom": [
2336
+ "task_id"
2337
+ ],
2338
+ "columnsTo": [
2339
+ "id"
2340
+ ],
2341
+ "onDelete": "cascade",
2342
+ "onUpdate": "no action"
2343
+ }
2344
+ },
2345
+ "compositePrimaryKeys": {},
2346
+ "uniqueConstraints": {},
2347
+ "checkConstraints": {
2348
+ "task_comment_created_by": {
2349
+ "name": "task_comment_created_by",
2350
+ "value": "\"task_comment\".\"created_by\" IN ('human', 'agent')"
2351
+ },
2352
+ "task_comment_provenance": {
2353
+ "name": "task_comment_provenance",
2354
+ "value": "(\"task_comment\".\"created_by\" = 'agent' AND \"task_comment\".\"created_by_session\" IS NOT NULL)\n OR (\"task_comment\".\"created_by\" = 'human' AND \"task_comment\".\"created_by_session\" IS NULL)"
2355
+ }
2356
+ }
2357
+ },
2358
+ "task_finding": {
2359
+ "name": "task_finding",
2360
+ "columns": {
2361
+ "id": {
2362
+ "name": "id",
2363
+ "type": "text",
2364
+ "primaryKey": true,
2365
+ "notNull": true,
2366
+ "autoincrement": false
2367
+ },
2368
+ "task_id": {
2369
+ "name": "task_id",
2370
+ "type": "text",
2371
+ "primaryKey": false,
2372
+ "notNull": true,
2373
+ "autoincrement": false
2374
+ },
2375
+ "found_by_session": {
2376
+ "name": "found_by_session",
2377
+ "type": "text",
2378
+ "primaryKey": false,
2379
+ "notNull": true,
2380
+ "autoincrement": false
2381
+ },
2382
+ "role": {
2383
+ "name": "role",
2384
+ "type": "text",
2385
+ "primaryKey": false,
2386
+ "notNull": true,
2387
+ "autoincrement": false
2388
+ },
2389
+ "bucket": {
2390
+ "name": "bucket",
2391
+ "type": "text",
2392
+ "primaryKey": false,
2393
+ "notNull": true,
2394
+ "autoincrement": false
2395
+ },
2396
+ "title": {
2397
+ "name": "title",
2398
+ "type": "text",
2399
+ "primaryKey": false,
2400
+ "notNull": true,
2401
+ "autoincrement": false
2402
+ },
2403
+ "detail": {
2404
+ "name": "detail",
2405
+ "type": "text",
2406
+ "primaryKey": false,
2407
+ "notNull": true,
2408
+ "autoincrement": false,
2409
+ "default": "''"
2410
+ },
2411
+ "command": {
2412
+ "name": "command",
2413
+ "type": "text",
2414
+ "primaryKey": false,
2415
+ "notNull": false,
2416
+ "autoincrement": false
2417
+ },
2418
+ "expected": {
2419
+ "name": "expected",
2420
+ "type": "text",
2421
+ "primaryKey": false,
2422
+ "notNull": false,
2423
+ "autoincrement": false
2424
+ },
2425
+ "verification": {
2426
+ "name": "verification",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true,
2430
+ "autoincrement": false,
2431
+ "default": "'pending'"
2432
+ },
2433
+ "output": {
2434
+ "name": "output",
2435
+ "type": "text",
2436
+ "primaryKey": false,
2437
+ "notNull": false,
2438
+ "autoincrement": false
2439
+ },
2440
+ "created_at": {
2441
+ "name": "created_at",
2442
+ "type": "integer",
2443
+ "primaryKey": false,
2444
+ "notNull": true,
2445
+ "autoincrement": false,
2446
+ "default": "(unixepoch('subsec') * 1000)"
2447
+ },
2448
+ "updated_at": {
2449
+ "name": "updated_at",
2450
+ "type": "integer",
2451
+ "primaryKey": false,
2452
+ "notNull": true,
2453
+ "autoincrement": false,
2454
+ "default": "(unixepoch('subsec') * 1000)"
2455
+ }
2456
+ },
2457
+ "indexes": {
2458
+ "task_finding_by_task": {
2459
+ "name": "task_finding_by_task",
2460
+ "columns": [
2461
+ "task_id",
2462
+ "created_at"
2463
+ ],
2464
+ "isUnique": false
2465
+ }
2466
+ },
2467
+ "foreignKeys": {
2468
+ "task_finding_task_id_task_id_fk": {
2469
+ "name": "task_finding_task_id_task_id_fk",
2470
+ "tableFrom": "task_finding",
2471
+ "tableTo": "task",
2472
+ "columnsFrom": [
2473
+ "task_id"
2474
+ ],
2475
+ "columnsTo": [
2476
+ "id"
2477
+ ],
2478
+ "onDelete": "cascade",
2479
+ "onUpdate": "no action"
2480
+ }
2481
+ },
2482
+ "compositePrimaryKeys": {},
2483
+ "uniqueConstraints": {},
2484
+ "checkConstraints": {
2485
+ "task_finding_bucket": {
2486
+ "name": "task_finding_bucket",
2487
+ "value": "\"task_finding\".\"bucket\" IN ('blocks', 'notes')"
2488
+ },
2489
+ "task_finding_verification": {
2490
+ "name": "task_finding_verification",
2491
+ "value": "\"task_finding\".\"verification\" IN ('pending', 'reproduced', 'refuted', 'skipped')"
2492
+ },
2493
+ "task_finding_reproduction": {
2494
+ "name": "task_finding_reproduction",
2495
+ "value": "(\"task_finding\".\"bucket\" = 'blocks' AND \"task_finding\".\"command\" IS NOT NULL)\n OR (\"task_finding\".\"bucket\" = 'notes' AND \"task_finding\".\"command\" IS NULL)"
2496
+ }
2497
+ }
2498
+ },
2499
+ "task_review": {
2500
+ "name": "task_review",
2501
+ "columns": {
2502
+ "id": {
2503
+ "name": "id",
2504
+ "type": "text",
2505
+ "primaryKey": true,
2506
+ "notNull": true,
2507
+ "autoincrement": false
2508
+ },
2509
+ "task_id": {
2510
+ "name": "task_id",
2511
+ "type": "text",
2512
+ "primaryKey": false,
2513
+ "notNull": true,
2514
+ "autoincrement": false
2515
+ },
2516
+ "by_session": {
2517
+ "name": "by_session",
2518
+ "type": "text",
2519
+ "primaryKey": false,
2520
+ "notNull": true,
2521
+ "autoincrement": false
2522
+ },
2523
+ "role": {
2524
+ "name": "role",
2525
+ "type": "text",
2526
+ "primaryKey": false,
2527
+ "notNull": true,
2528
+ "autoincrement": false
2529
+ },
2530
+ "blocks": {
2531
+ "name": "blocks",
2532
+ "type": "integer",
2533
+ "primaryKey": false,
2534
+ "notNull": true,
2535
+ "autoincrement": false,
2536
+ "default": 0
2537
+ },
2538
+ "notes": {
2539
+ "name": "notes",
2540
+ "type": "integer",
2541
+ "primaryKey": false,
2542
+ "notNull": true,
2543
+ "autoincrement": false,
2544
+ "default": 0
2545
+ },
2546
+ "created_at": {
2547
+ "name": "created_at",
2548
+ "type": "integer",
2549
+ "primaryKey": false,
2550
+ "notNull": true,
2551
+ "autoincrement": false,
2552
+ "default": "(unixepoch('subsec') * 1000)"
2553
+ },
2554
+ "updated_at": {
2555
+ "name": "updated_at",
2556
+ "type": "integer",
2557
+ "primaryKey": false,
2558
+ "notNull": true,
2559
+ "autoincrement": false,
2560
+ "default": "(unixepoch('subsec') * 1000)"
2561
+ }
2562
+ },
2563
+ "indexes": {
2564
+ "task_review_by_session": {
2565
+ "name": "task_review_by_session",
2566
+ "columns": [
2567
+ "by_session",
2568
+ "created_at"
2569
+ ],
2570
+ "isUnique": false
2571
+ }
2572
+ },
2573
+ "foreignKeys": {
2574
+ "task_review_task_id_task_id_fk": {
2575
+ "name": "task_review_task_id_task_id_fk",
2576
+ "tableFrom": "task_review",
2577
+ "tableTo": "task",
2578
+ "columnsFrom": [
2579
+ "task_id"
2580
+ ],
2581
+ "columnsTo": [
2582
+ "id"
2583
+ ],
2584
+ "onDelete": "cascade",
2585
+ "onUpdate": "no action"
2586
+ }
2587
+ },
2588
+ "compositePrimaryKeys": {},
2589
+ "uniqueConstraints": {},
2590
+ "checkConstraints": {
2591
+ "task_review_counts_not_negative": {
2592
+ "name": "task_review_counts_not_negative",
2593
+ "value": "\"task_review\".\"blocks\" >= 0 AND \"task_review\".\"notes\" >= 0"
2594
+ }
2595
+ }
2596
+ },
2597
+ "workspace": {
2598
+ "name": "workspace",
2599
+ "columns": {
2600
+ "id": {
2601
+ "name": "id",
2602
+ "type": "text",
2603
+ "primaryKey": true,
2604
+ "notNull": true,
2605
+ "autoincrement": false
2606
+ },
2607
+ "name": {
2608
+ "name": "name",
2609
+ "type": "text",
2610
+ "primaryKey": false,
2611
+ "notNull": true,
2612
+ "autoincrement": false
2613
+ },
2614
+ "default_lumem_mode": {
2615
+ "name": "default_lumem_mode",
2616
+ "type": "text",
2617
+ "primaryKey": false,
2618
+ "notNull": true,
2619
+ "autoincrement": false,
2620
+ "default": "'ask'"
2621
+ },
2622
+ "budget_cost_per_task": {
2623
+ "name": "budget_cost_per_task",
2624
+ "type": "real",
2625
+ "primaryKey": false,
2626
+ "notNull": false,
2627
+ "autoincrement": false
2628
+ },
2629
+ "budget_cost_per_day": {
2630
+ "name": "budget_cost_per_day",
2631
+ "type": "real",
2632
+ "primaryKey": false,
2633
+ "notNull": false,
2634
+ "autoincrement": false
2635
+ },
2636
+ "budget_turns_per_session": {
2637
+ "name": "budget_turns_per_session",
2638
+ "type": "integer",
2639
+ "primaryKey": false,
2640
+ "notNull": false,
2641
+ "autoincrement": false
2642
+ },
2643
+ "autonomy": {
2644
+ "name": "autonomy",
2645
+ "type": "text",
2646
+ "primaryKey": false,
2647
+ "notNull": true,
2648
+ "autoincrement": false,
2649
+ "default": "'manual'"
2650
+ },
2651
+ "autonomy_max_parallel": {
2652
+ "name": "autonomy_max_parallel",
2653
+ "type": "integer",
2654
+ "primaryKey": false,
2655
+ "notNull": true,
2656
+ "autoincrement": false,
2657
+ "default": 2
2658
+ },
2659
+ "merged_always_removes": {
2660
+ "name": "merged_always_removes",
2661
+ "type": "integer",
2662
+ "primaryKey": false,
2663
+ "notNull": true,
2664
+ "autoincrement": false,
2665
+ "default": false
2666
+ },
2667
+ "created_at": {
2668
+ "name": "created_at",
2669
+ "type": "integer",
2670
+ "primaryKey": false,
2671
+ "notNull": true,
2672
+ "autoincrement": false,
2673
+ "default": "(unixepoch('subsec') * 1000)"
2674
+ },
2675
+ "updated_at": {
2676
+ "name": "updated_at",
2677
+ "type": "integer",
2678
+ "primaryKey": false,
2679
+ "notNull": true,
2680
+ "autoincrement": false,
2681
+ "default": "(unixepoch('subsec') * 1000)"
2682
+ }
2683
+ },
2684
+ "indexes": {
2685
+ "workspace_name_unique": {
2686
+ "name": "workspace_name_unique",
2687
+ "columns": [
2688
+ "name"
2689
+ ],
2690
+ "isUnique": true
2691
+ }
2692
+ },
2693
+ "foreignKeys": {},
2694
+ "compositePrimaryKeys": {},
2695
+ "uniqueConstraints": {},
2696
+ "checkConstraints": {
2697
+ "workspace_default_lumem_mode": {
2698
+ "name": "workspace_default_lumem_mode",
2699
+ "value": "\"workspace\".\"default_lumem_mode\" IN ('ask', 'auto')"
2700
+ },
2701
+ "workspace_autonomy": {
2702
+ "name": "workspace_autonomy",
2703
+ "value": "\"workspace\".\"autonomy\" IN ('manual', 'assistido', 'autonomo')"
2704
+ },
2705
+ "workspace_autonomy_max_parallel": {
2706
+ "name": "workspace_autonomy_max_parallel",
2707
+ "value": "\"workspace\".\"autonomy_max_parallel\" >= 0"
2708
+ },
2709
+ "workspace_budget_not_negative": {
2710
+ "name": "workspace_budget_not_negative",
2711
+ "value": "(\"workspace\".\"budget_cost_per_task\" IS NULL OR \"workspace\".\"budget_cost_per_task\" >= 0)\n AND (\"workspace\".\"budget_cost_per_day\" IS NULL OR \"workspace\".\"budget_cost_per_day\" >= 0)\n AND (\"workspace\".\"budget_turns_per_session\" IS NULL OR \"workspace\".\"budget_turns_per_session\" >= 0)"
2712
+ }
2713
+ }
2714
+ },
2715
+ "worktree": {
2716
+ "name": "worktree",
2717
+ "columns": {
2718
+ "id": {
2719
+ "name": "id",
2720
+ "type": "text",
2721
+ "primaryKey": true,
2722
+ "notNull": true,
2723
+ "autoincrement": false
2724
+ },
2725
+ "project_id": {
2726
+ "name": "project_id",
2727
+ "type": "text",
2728
+ "primaryKey": false,
2729
+ "notNull": true,
2730
+ "autoincrement": false
2731
+ },
2732
+ "name": {
2733
+ "name": "name",
2734
+ "type": "text",
2735
+ "primaryKey": false,
2736
+ "notNull": true,
2737
+ "autoincrement": false
2738
+ },
2739
+ "branch": {
2740
+ "name": "branch",
2741
+ "type": "text",
2742
+ "primaryKey": false,
2743
+ "notNull": true,
2744
+ "autoincrement": false
2745
+ },
2746
+ "path": {
2747
+ "name": "path",
2748
+ "type": "text",
2749
+ "primaryKey": false,
2750
+ "notNull": true,
2751
+ "autoincrement": false
2752
+ },
2753
+ "state": {
2754
+ "name": "state",
2755
+ "type": "text",
2756
+ "primaryKey": false,
2757
+ "notNull": true,
2758
+ "autoincrement": false,
2759
+ "default": "'active'"
2760
+ },
2761
+ "created_at": {
2762
+ "name": "created_at",
2763
+ "type": "integer",
2764
+ "primaryKey": false,
2765
+ "notNull": true,
2766
+ "autoincrement": false,
2767
+ "default": "(unixepoch('subsec') * 1000)"
2768
+ },
2769
+ "updated_at": {
2770
+ "name": "updated_at",
2771
+ "type": "integer",
2772
+ "primaryKey": false,
2773
+ "notNull": true,
2774
+ "autoincrement": false,
2775
+ "default": "(unixepoch('subsec') * 1000)"
2776
+ }
2777
+ },
2778
+ "indexes": {
2779
+ "worktree_name_per_project": {
2780
+ "name": "worktree_name_per_project",
2781
+ "columns": [
2782
+ "project_id",
2783
+ "name"
2784
+ ],
2785
+ "isUnique": true
2786
+ }
2787
+ },
2788
+ "foreignKeys": {
2789
+ "worktree_project_id_project_id_fk": {
2790
+ "name": "worktree_project_id_project_id_fk",
2791
+ "tableFrom": "worktree",
2792
+ "tableTo": "project",
2793
+ "columnsFrom": [
2794
+ "project_id"
2795
+ ],
2796
+ "columnsTo": [
2797
+ "id"
2798
+ ],
2799
+ "onDelete": "restrict",
2800
+ "onUpdate": "no action"
2801
+ }
2802
+ },
2803
+ "compositePrimaryKeys": {},
2804
+ "uniqueConstraints": {},
2805
+ "checkConstraints": {
2806
+ "worktree_state": {
2807
+ "name": "worktree_state",
2808
+ "value": "\"worktree\".\"state\" IN ('active', 'missing')"
2809
+ }
2810
+ }
2811
+ }
2812
+ },
2813
+ "views": {},
2814
+ "enums": {},
2815
+ "_meta": {
2816
+ "schemas": {},
2817
+ "tables": {},
2818
+ "columns": {}
2819
+ },
2820
+ "internal": {
2821
+ "indexes": {}
2822
+ }
2823
+ }