ultimate-brain 0.0.0-stage → 0.1.1

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 (80) hide show
  1. package/.agents/skills/README.md +3 -0
  2. package/.agents/skills/brain-apply/SKILL.md +80 -0
  3. package/.agents/skills/brain-connect-notion/SKILL.md +55 -0
  4. package/.agents/skills/brain-ingest/SKILL.md +104 -0
  5. package/.agents/skills/brain-ingest/references/cli-inputs.md +106 -0
  6. package/.agents/skills/brain-ingest/references/example-batch.json +165 -0
  7. package/.agents/skills/brain-ingest/references/extraction.md +103 -0
  8. package/.agents/skills/brain-ingest/references/notion.md +61 -0
  9. package/.agents/skills/brain-notion-change/SKILL.md +57 -0
  10. package/.agents/skills/brain-query/SKILL.md +62 -0
  11. package/.agents/skills/brain-sync/SKILL.md +64 -0
  12. package/.agents/skills/brain-sync/references/formats.md +53 -0
  13. package/LICENSE +21 -0
  14. package/README.md +40 -2
  15. package/bin/brain.js +5 -0
  16. package/dist/cli.js +83 -0
  17. package/dist/commands/apply.js +34 -0
  18. package/dist/commands/config.js +96 -0
  19. package/dist/commands/id.js +32 -0
  20. package/dist/commands/index.js +58 -0
  21. package/dist/commands/init.js +233 -0
  22. package/dist/commands/link.js +285 -0
  23. package/dist/commands/lint.js +47 -0
  24. package/dist/commands/log.js +48 -0
  25. package/dist/commands/note.js +36 -0
  26. package/dist/commands/proposal.js +57 -0
  27. package/dist/commands/query.js +38 -0
  28. package/dist/commands/status.js +98 -0
  29. package/dist/commands/sync.js +53 -0
  30. package/dist/commands/upgrade.js +143 -0
  31. package/dist/commands/views.js +111 -0
  32. package/dist/lib/apply.js +524 -0
  33. package/dist/lib/args.js +63 -0
  34. package/dist/lib/brain-path.js +91 -0
  35. package/dist/lib/brain.js +36 -0
  36. package/dist/lib/command.js +61 -0
  37. package/dist/lib/errors.js +33 -0
  38. package/dist/lib/frontmatter.js +171 -0
  39. package/dist/lib/fs-safe.js +140 -0
  40. package/dist/lib/ids.js +51 -0
  41. package/dist/lib/index-builder.js +216 -0
  42. package/dist/lib/input.js +45 -0
  43. package/dist/lib/lint.js +336 -0
  44. package/dist/lib/log.js +44 -0
  45. package/dist/lib/note-new.js +119 -0
  46. package/dist/lib/notes.js +95 -0
  47. package/dist/lib/paths.js +49 -0
  48. package/dist/lib/proposals.js +229 -0
  49. package/dist/lib/query.js +163 -0
  50. package/dist/lib/schemas.js +51 -0
  51. package/dist/lib/skills.js +60 -0
  52. package/dist/lib/sync.js +714 -0
  53. package/dist/lib/time.js +21 -0
  54. package/dist/lib/views.js +139 -0
  55. package/dist/lib/warnings.js +9 -0
  56. package/dist/lib/workspace.js +183 -0
  57. package/package.json +45 -4
  58. package/spec/schemas/brain.schema.json +200 -0
  59. package/spec/schemas/note.schema.json +1059 -0
  60. package/spec/schemas/proposal.schema.json +559 -0
  61. package/templates/README.md +44 -0
  62. package/templates/brain/AGENTS.md +54 -0
  63. package/templates/brain/CLAUDE.md +1 -0
  64. package/templates/brain/_proposals/.gitkeep +0 -0
  65. package/templates/brain/archive/goals/.gitkeep +0 -0
  66. package/templates/brain/archive/projects/.gitkeep +0 -0
  67. package/templates/brain/areas/.gitkeep +0 -0
  68. package/templates/brain/brain.json +35 -0
  69. package/templates/brain/gitignore +6 -0
  70. package/templates/brain/goals/.gitkeep +0 -0
  71. package/templates/brain/index.md +3 -0
  72. package/templates/brain/knowledge/concepts/.gitkeep +0 -0
  73. package/templates/brain/knowledge/decisions/.gitkeep +0 -0
  74. package/templates/brain/knowledge/meetings/.gitkeep +0 -0
  75. package/templates/brain/knowledge/orgs/.gitkeep +0 -0
  76. package/templates/brain/knowledge/people/.gitkeep +0 -0
  77. package/templates/brain/knowledge/questions/.gitkeep +0 -0
  78. package/templates/brain/memories/.gitkeep +0 -0
  79. package/templates/brain/projects/.gitkeep +0 -0
  80. package/templates/brain/sources/notion/.gitkeep +0 -0
@@ -0,0 +1,1059 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultimate-brain.dev/schemas/v1/note.schema.json",
4
+ "title": "Brain note frontmatter (v1)",
5
+ "description": "Frontmatter of every Markdown note in a user's brain, except proposals (proposal.schema.json). See spec/schema.md.",
6
+ "type": "object",
7
+ "required": [
8
+ "id",
9
+ "type",
10
+ "title",
11
+ "created",
12
+ "updated"
13
+ ],
14
+ "properties": {
15
+ "id": {
16
+ "$ref": "#/$defs/id"
17
+ },
18
+ "type": {
19
+ "enum": [
20
+ "area",
21
+ "goal",
22
+ "project",
23
+ "person",
24
+ "org",
25
+ "meeting",
26
+ "decision",
27
+ "question",
28
+ "concept",
29
+ "source",
30
+ "view",
31
+ "memory"
32
+ ]
33
+ },
34
+ "title": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 120
38
+ },
39
+ "created": {
40
+ "$ref": "#/$defs/date"
41
+ },
42
+ "updated": {
43
+ "$ref": "#/$defs/date"
44
+ }
45
+ },
46
+ "allOf": [
47
+ {
48
+ "if": {
49
+ "properties": {
50
+ "type": {
51
+ "const": "area"
52
+ }
53
+ }
54
+ },
55
+ "then": {
56
+ "$ref": "#/$defs/area"
57
+ }
58
+ },
59
+ {
60
+ "if": {
61
+ "properties": {
62
+ "type": {
63
+ "const": "goal"
64
+ }
65
+ }
66
+ },
67
+ "then": {
68
+ "$ref": "#/$defs/goal"
69
+ }
70
+ },
71
+ {
72
+ "if": {
73
+ "properties": {
74
+ "type": {
75
+ "const": "project"
76
+ }
77
+ }
78
+ },
79
+ "then": {
80
+ "$ref": "#/$defs/project"
81
+ }
82
+ },
83
+ {
84
+ "if": {
85
+ "properties": {
86
+ "type": {
87
+ "const": "person"
88
+ }
89
+ }
90
+ },
91
+ "then": {
92
+ "$ref": "#/$defs/person"
93
+ }
94
+ },
95
+ {
96
+ "if": {
97
+ "properties": {
98
+ "type": {
99
+ "const": "org"
100
+ }
101
+ }
102
+ },
103
+ "then": {
104
+ "$ref": "#/$defs/org"
105
+ }
106
+ },
107
+ {
108
+ "if": {
109
+ "properties": {
110
+ "type": {
111
+ "const": "meeting"
112
+ }
113
+ }
114
+ },
115
+ "then": {
116
+ "$ref": "#/$defs/meeting"
117
+ }
118
+ },
119
+ {
120
+ "if": {
121
+ "properties": {
122
+ "type": {
123
+ "const": "decision"
124
+ }
125
+ }
126
+ },
127
+ "then": {
128
+ "$ref": "#/$defs/decision"
129
+ }
130
+ },
131
+ {
132
+ "if": {
133
+ "properties": {
134
+ "type": {
135
+ "const": "question"
136
+ }
137
+ }
138
+ },
139
+ "then": {
140
+ "$ref": "#/$defs/question"
141
+ }
142
+ },
143
+ {
144
+ "if": {
145
+ "properties": {
146
+ "type": {
147
+ "const": "concept"
148
+ }
149
+ }
150
+ },
151
+ "then": {
152
+ "$ref": "#/$defs/concept"
153
+ }
154
+ },
155
+ {
156
+ "if": {
157
+ "properties": {
158
+ "type": {
159
+ "const": "source"
160
+ }
161
+ }
162
+ },
163
+ "then": {
164
+ "$ref": "#/$defs/source"
165
+ }
166
+ },
167
+ {
168
+ "if": {
169
+ "properties": {
170
+ "type": {
171
+ "const": "view"
172
+ }
173
+ }
174
+ },
175
+ "then": {
176
+ "$ref": "#/$defs/view"
177
+ }
178
+ },
179
+ {
180
+ "if": {
181
+ "properties": {
182
+ "type": {
183
+ "const": "memory"
184
+ }
185
+ }
186
+ },
187
+ "then": {
188
+ "$ref": "#/$defs/memory"
189
+ }
190
+ }
191
+ ],
192
+ "$defs": {
193
+ "idChars": {
194
+ "type": "string",
195
+ "pattern": "^[0-9abcdefghjkmnpqrstvwxyz]{8}$"
196
+ },
197
+ "id": {
198
+ "type": "string",
199
+ "pattern": "^(area|gol|prj|per|org|mtg|dec|que|con|src|mem|prp|vw)-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
200
+ },
201
+ "areaId": {
202
+ "type": "string",
203
+ "pattern": "^area-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
204
+ },
205
+ "goalId": {
206
+ "type": "string",
207
+ "pattern": "^gol-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
208
+ },
209
+ "projectId": {
210
+ "type": "string",
211
+ "pattern": "^prj-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
212
+ },
213
+ "personId": {
214
+ "type": "string",
215
+ "pattern": "^per-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
216
+ },
217
+ "orgId": {
218
+ "type": "string",
219
+ "pattern": "^org-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
220
+ },
221
+ "meetingId": {
222
+ "type": "string",
223
+ "pattern": "^mtg-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
224
+ },
225
+ "decisionId": {
226
+ "type": "string",
227
+ "pattern": "^dec-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
228
+ },
229
+ "questionId": {
230
+ "type": "string",
231
+ "pattern": "^que-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
232
+ },
233
+ "sourceId": {
234
+ "type": "string",
235
+ "pattern": "^src-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
236
+ },
237
+ "date": {
238
+ "type": "string",
239
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
240
+ },
241
+ "month": {
242
+ "type": "string",
243
+ "pattern": "^\\d{4}-\\d{2}$"
244
+ },
245
+ "dateOrMonth": {
246
+ "type": "string",
247
+ "pattern": "^\\d{4}-\\d{2}(-\\d{2})?$"
248
+ },
249
+ "timestamp": {
250
+ "type": "string",
251
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
252
+ },
253
+ "sourceKey": {
254
+ "type": "string",
255
+ "anyOf": [
256
+ {
257
+ "pattern": "^notion:[0-9a-f-]{32,36}$"
258
+ },
259
+ {
260
+ "pattern": "^url:https://\\S+$"
261
+ },
262
+ {
263
+ "pattern": "^agent:[a-z0-9-]+/\\S+$"
264
+ },
265
+ {
266
+ "pattern": "^notion-edit$"
267
+ },
268
+ {
269
+ "pattern": "^(area|gol|prj|per|org|mtg|dec|que|con|src|mem)-[0-9abcdefghjkmnpqrstvwxyz]{8}$"
270
+ }
271
+ ]
272
+ },
273
+ "lifecycle": {
274
+ "enum": [
275
+ "draft",
276
+ "reviewed",
277
+ "disputed",
278
+ "archived"
279
+ ]
280
+ },
281
+ "assessment": {
282
+ "enum": [
283
+ "accepted",
284
+ "provisional",
285
+ "contested",
286
+ "superseded"
287
+ ]
288
+ },
289
+ "notionPageId": {
290
+ "type": "string",
291
+ "pattern": "^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$"
292
+ },
293
+ "factValue": {
294
+ "type": [
295
+ "string",
296
+ "number"
297
+ ]
298
+ },
299
+ "relation": {
300
+ "type": "object",
301
+ "required": [
302
+ "type",
303
+ "target"
304
+ ],
305
+ "additionalProperties": false,
306
+ "properties": {
307
+ "type": {
308
+ "enum": [
309
+ "supersedes",
310
+ "superseded_by",
311
+ "about",
312
+ "depends_on",
313
+ "contradicts",
314
+ "derived_from",
315
+ "related_to"
316
+ ]
317
+ },
318
+ "target": {
319
+ "$ref": "#/$defs/id"
320
+ }
321
+ }
322
+ },
323
+ "timelineEntry": {
324
+ "type": "object",
325
+ "required": [
326
+ "field",
327
+ "value",
328
+ "from",
329
+ "learned",
330
+ "source",
331
+ "assessment"
332
+ ],
333
+ "additionalProperties": false,
334
+ "properties": {
335
+ "field": {
336
+ "type": "string",
337
+ "pattern": "^[a-z][a-z0-9_]*$"
338
+ },
339
+ "value": {
340
+ "$ref": "#/$defs/factValue"
341
+ },
342
+ "from": {
343
+ "$ref": "#/$defs/dateOrMonth"
344
+ },
345
+ "until": {
346
+ "$ref": "#/$defs/dateOrMonth"
347
+ },
348
+ "learned": {
349
+ "$ref": "#/$defs/date"
350
+ },
351
+ "source": {
352
+ "$ref": "#/$defs/sourceKey"
353
+ },
354
+ "assessment": {
355
+ "$ref": "#/$defs/assessment"
356
+ },
357
+ "note": {
358
+ "type": "string"
359
+ }
360
+ }
361
+ },
362
+ "notionFieldsBase": {
363
+ "type": "object",
364
+ "required": [
365
+ "as_of"
366
+ ],
367
+ "properties": {
368
+ "as_of": {
369
+ "$ref": "#/$defs/timestamp"
370
+ }
371
+ }
372
+ },
373
+ "knowledge": {
374
+ "type": "object",
375
+ "required": [
376
+ "summary",
377
+ "lifecycle"
378
+ ],
379
+ "properties": {
380
+ "summary": {
381
+ "type": "string",
382
+ "minLength": 1,
383
+ "maxLength": 400
384
+ },
385
+ "lifecycle": {
386
+ "$ref": "#/$defs/lifecycle"
387
+ },
388
+ "aliases": {
389
+ "type": "array",
390
+ "items": {
391
+ "type": "string",
392
+ "minLength": 1
393
+ }
394
+ },
395
+ "tags": {
396
+ "type": "array",
397
+ "items": {
398
+ "type": "string",
399
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
400
+ }
401
+ },
402
+ "area": {
403
+ "$ref": "#/$defs/areaId"
404
+ },
405
+ "projects": {
406
+ "type": "array",
407
+ "items": {
408
+ "$ref": "#/$defs/projectId"
409
+ }
410
+ },
411
+ "sources": {
412
+ "type": "array",
413
+ "items": {
414
+ "$ref": "#/$defs/sourceKey"
415
+ }
416
+ },
417
+ "relations": {
418
+ "type": "array",
419
+ "items": {
420
+ "$ref": "#/$defs/relation"
421
+ }
422
+ },
423
+ "facts": {
424
+ "type": "object",
425
+ "propertyNames": {
426
+ "pattern": "^[a-z][a-z0-9_]*$"
427
+ },
428
+ "additionalProperties": {
429
+ "$ref": "#/$defs/factValue"
430
+ }
431
+ },
432
+ "timeline": {
433
+ "type": "array",
434
+ "items": {
435
+ "$ref": "#/$defs/timelineEntry"
436
+ }
437
+ },
438
+ "notion": {
439
+ "$ref": "#/$defs/notionPageId"
440
+ },
441
+ "last_synced": {
442
+ "$ref": "#/$defs/timestamp"
443
+ },
444
+ "notion_fields": {
445
+ "$ref": "#/$defs/notionFieldsBase"
446
+ },
447
+ "notion_published": {
448
+ "description": "Notion property name → value last published or imported (spec/cli.md §5.14).",
449
+ "type": "object"
450
+ }
451
+ }
452
+ },
453
+ "area": {
454
+ "allOf": [
455
+ {
456
+ "$ref": "#/$defs/knowledge"
457
+ }
458
+ ],
459
+ "properties": {
460
+ "notion_fields": {
461
+ "properties": {
462
+ "type": {
463
+ "enum": [
464
+ "Business",
465
+ "Personal"
466
+ ]
467
+ },
468
+ "archived": {
469
+ "type": "boolean"
470
+ }
471
+ }
472
+ }
473
+ }
474
+ },
475
+ "goal": {
476
+ "allOf": [
477
+ {
478
+ "$ref": "#/$defs/knowledge"
479
+ }
480
+ ],
481
+ "required": [
482
+ "why",
483
+ "area"
484
+ ],
485
+ "properties": {
486
+ "why": {
487
+ "type": "string",
488
+ "minLength": 1,
489
+ "maxLength": 300
490
+ },
491
+ "facts": {
492
+ "properties": {
493
+ "deadline": {
494
+ "$ref": "#/$defs/dateOrMonth"
495
+ }
496
+ }
497
+ },
498
+ "notion_fields": {
499
+ "properties": {
500
+ "status": {
501
+ "enum": [
502
+ "Not Started",
503
+ "Active",
504
+ "Achieved",
505
+ "Dropped"
506
+ ]
507
+ },
508
+ "progress": {
509
+ "type": "number",
510
+ "minimum": 0,
511
+ "maximum": 1
512
+ },
513
+ "archived": {
514
+ "type": "boolean"
515
+ },
516
+ "key_results": {
517
+ "type": "array",
518
+ "items": {
519
+ "type": "object",
520
+ "required": [
521
+ "name",
522
+ "kind"
523
+ ],
524
+ "properties": {
525
+ "name": {
526
+ "type": "string"
527
+ },
528
+ "kind": {
529
+ "enum": [
530
+ "Number",
531
+ "Milestone"
532
+ ]
533
+ },
534
+ "start": {
535
+ "type": "number"
536
+ },
537
+ "current": {
538
+ "type": "number"
539
+ },
540
+ "target": {
541
+ "type": "number"
542
+ },
543
+ "unit": {
544
+ "type": "string"
545
+ },
546
+ "done": {
547
+ "type": "boolean"
548
+ },
549
+ "due": {
550
+ "$ref": "#/$defs/date"
551
+ }
552
+ }
553
+ }
554
+ }
555
+ }
556
+ }
557
+ }
558
+ },
559
+ "project": {
560
+ "allOf": [
561
+ {
562
+ "$ref": "#/$defs/knowledge"
563
+ }
564
+ ],
565
+ "required": [
566
+ "area"
567
+ ],
568
+ "properties": {
569
+ "goal": {
570
+ "$ref": "#/$defs/goalId"
571
+ },
572
+ "client": {
573
+ "$ref": "#/$defs/orgId"
574
+ },
575
+ "people": {
576
+ "type": "array",
577
+ "items": {
578
+ "$ref": "#/$defs/personId"
579
+ }
580
+ },
581
+ "notion_fields": {
582
+ "properties": {
583
+ "status": {
584
+ "enum": [
585
+ "Planned",
586
+ "Active",
587
+ "On Hold",
588
+ "Done"
589
+ ]
590
+ },
591
+ "priority": {
592
+ "enum": [
593
+ "High",
594
+ "Medium",
595
+ "Low"
596
+ ]
597
+ },
598
+ "dates": {
599
+ "type": "object",
600
+ "properties": {
601
+ "start": {
602
+ "$ref": "#/$defs/date"
603
+ },
604
+ "end": {
605
+ "$ref": "#/$defs/date"
606
+ }
607
+ }
608
+ },
609
+ "archived": {
610
+ "type": "boolean"
611
+ }
612
+ }
613
+ }
614
+ }
615
+ },
616
+ "person": {
617
+ "allOf": [
618
+ {
619
+ "$ref": "#/$defs/knowledge"
620
+ }
621
+ ],
622
+ "properties": {
623
+ "org": {
624
+ "$ref": "#/$defs/orgId"
625
+ },
626
+ "notion_fields": {
627
+ "properties": {
628
+ "email": {
629
+ "type": "string"
630
+ }
631
+ }
632
+ }
633
+ }
634
+ },
635
+ "org": {
636
+ "allOf": [
637
+ {
638
+ "$ref": "#/$defs/knowledge"
639
+ }
640
+ ],
641
+ "properties": {
642
+ "notion_fields": {
643
+ "properties": {
644
+ "relationship": {
645
+ "enum": [
646
+ "Client",
647
+ "Prospect",
648
+ "Partner",
649
+ "Supplier",
650
+ "Other"
651
+ ]
652
+ },
653
+ "website": {
654
+ "type": "string"
655
+ }
656
+ }
657
+ }
658
+ }
659
+ },
660
+ "meeting": {
661
+ "allOf": [
662
+ {
663
+ "$ref": "#/$defs/knowledge"
664
+ }
665
+ ],
666
+ "required": [
667
+ "date",
668
+ "attendees",
669
+ "source"
670
+ ],
671
+ "properties": {
672
+ "date": {
673
+ "$ref": "#/$defs/date"
674
+ },
675
+ "attendees": {
676
+ "type": "array",
677
+ "items": {
678
+ "$ref": "#/$defs/personId"
679
+ }
680
+ },
681
+ "source": {
682
+ "$ref": "#/$defs/sourceId"
683
+ },
684
+ "decisions": {
685
+ "type": "array",
686
+ "items": {
687
+ "$ref": "#/$defs/decisionId"
688
+ }
689
+ },
690
+ "questions": {
691
+ "type": "array",
692
+ "items": {
693
+ "$ref": "#/$defs/questionId"
694
+ }
695
+ },
696
+ "tasks": {
697
+ "type": "array",
698
+ "items": {
699
+ "$ref": "#/$defs/notionPageId"
700
+ }
701
+ }
702
+ }
703
+ },
704
+ "decision": {
705
+ "allOf": [
706
+ {
707
+ "$ref": "#/$defs/knowledge"
708
+ }
709
+ ],
710
+ "required": [
711
+ "date",
712
+ "assessment"
713
+ ],
714
+ "properties": {
715
+ "date": {
716
+ "$ref": "#/$defs/date"
717
+ },
718
+ "assessment": {
719
+ "$ref": "#/$defs/assessment"
720
+ },
721
+ "decided_in": {
722
+ "$ref": "#/$defs/meetingId"
723
+ },
724
+ "deciders": {
725
+ "type": "array",
726
+ "items": {
727
+ "$ref": "#/$defs/personId"
728
+ }
729
+ },
730
+ "valid_from": {
731
+ "$ref": "#/$defs/date"
732
+ },
733
+ "valid_until": {
734
+ "$ref": "#/$defs/date"
735
+ }
736
+ },
737
+ "if": {
738
+ "properties": {
739
+ "assessment": {
740
+ "const": "superseded"
741
+ }
742
+ },
743
+ "required": [
744
+ "assessment"
745
+ ]
746
+ },
747
+ "then": {
748
+ "required": [
749
+ "valid_until"
750
+ ]
751
+ }
752
+ },
753
+ "question": {
754
+ "allOf": [
755
+ {
756
+ "$ref": "#/$defs/knowledge"
757
+ }
758
+ ],
759
+ "required": [
760
+ "kind"
761
+ ],
762
+ "properties": {
763
+ "kind": {
764
+ "enum": [
765
+ "question",
766
+ "risk"
767
+ ]
768
+ },
769
+ "raised_in": {
770
+ "$ref": "#/$defs/meetingId"
771
+ },
772
+ "answer": {
773
+ "type": "string"
774
+ },
775
+ "notion_fields": {
776
+ "properties": {
777
+ "status": {
778
+ "enum": [
779
+ "Open",
780
+ "Answered",
781
+ "Dropped"
782
+ ]
783
+ }
784
+ }
785
+ }
786
+ }
787
+ },
788
+ "concept": {
789
+ "allOf": [
790
+ {
791
+ "$ref": "#/$defs/knowledge"
792
+ }
793
+ ]
794
+ },
795
+ "source": {
796
+ "required": [
797
+ "source_key",
798
+ "content_hash",
799
+ "captured"
800
+ ],
801
+ "properties": {
802
+ "source_key": {
803
+ "$ref": "#/$defs/sourceKey"
804
+ },
805
+ "content_hash": {
806
+ "type": "string",
807
+ "pattern": "^sha256:[0-9a-f]{64}$"
808
+ },
809
+ "captured": {
810
+ "$ref": "#/$defs/timestamp"
811
+ },
812
+ "origin_edited": {
813
+ "$ref": "#/$defs/timestamp"
814
+ }
815
+ },
816
+ "not": {
817
+ "anyOf": [
818
+ {
819
+ "required": [
820
+ "lifecycle"
821
+ ]
822
+ },
823
+ {
824
+ "required": [
825
+ "facts"
826
+ ]
827
+ },
828
+ {
829
+ "required": [
830
+ "timeline"
831
+ ]
832
+ }
833
+ ]
834
+ }
835
+ },
836
+ "view": {
837
+ "required": [
838
+ "view_kind",
839
+ "project",
840
+ "generated_from",
841
+ "generated_at"
842
+ ],
843
+ "properties": {
844
+ "view_kind": {
845
+ "enum": [
846
+ "brief",
847
+ "decision_log"
848
+ ]
849
+ },
850
+ "project": {
851
+ "$ref": "#/$defs/projectId"
852
+ },
853
+ "generated_from": {
854
+ "type": "array",
855
+ "items": {
856
+ "$ref": "#/$defs/id"
857
+ }
858
+ },
859
+ "generated_at": {
860
+ "$ref": "#/$defs/timestamp"
861
+ }
862
+ },
863
+ "not": {
864
+ "anyOf": [
865
+ {
866
+ "required": [
867
+ "lifecycle"
868
+ ]
869
+ },
870
+ {
871
+ "required": [
872
+ "facts"
873
+ ]
874
+ },
875
+ {
876
+ "required": [
877
+ "timeline"
878
+ ]
879
+ }
880
+ ]
881
+ }
882
+ },
883
+ "memory": {
884
+ "required": [
885
+ "scope",
886
+ "confidence",
887
+ "origin"
888
+ ],
889
+ "properties": {
890
+ "scope": {
891
+ "enum": [
892
+ "general",
893
+ "area",
894
+ "project",
895
+ "stack"
896
+ ]
897
+ },
898
+ "areas": {
899
+ "type": "array",
900
+ "items": {
901
+ "$ref": "#/$defs/areaId"
902
+ }
903
+ },
904
+ "stacks": {
905
+ "type": "array",
906
+ "items": {
907
+ "type": "string",
908
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
909
+ }
910
+ },
911
+ "confidence": {
912
+ "enum": [
913
+ "verified",
914
+ "inferred",
915
+ "unverified"
916
+ ]
917
+ },
918
+ "origin": {
919
+ "type": "string",
920
+ "minLength": 1
921
+ }
922
+ },
923
+ "allOf": [
924
+ {
925
+ "$ref": "#/$defs/knowledge"
926
+ },
927
+ {
928
+ "if": {
929
+ "properties": {
930
+ "scope": {
931
+ "const": "general"
932
+ }
933
+ }
934
+ },
935
+ "then": {
936
+ "not": {
937
+ "anyOf": [
938
+ {
939
+ "required": [
940
+ "areas"
941
+ ]
942
+ },
943
+ {
944
+ "required": [
945
+ "projects"
946
+ ]
947
+ },
948
+ {
949
+ "required": [
950
+ "stacks"
951
+ ]
952
+ }
953
+ ]
954
+ }
955
+ }
956
+ },
957
+ {
958
+ "if": {
959
+ "properties": {
960
+ "scope": {
961
+ "const": "area"
962
+ }
963
+ }
964
+ },
965
+ "then": {
966
+ "required": [
967
+ "areas"
968
+ ],
969
+ "properties": {
970
+ "areas": {
971
+ "minItems": 1
972
+ }
973
+ },
974
+ "not": {
975
+ "anyOf": [
976
+ {
977
+ "required": [
978
+ "projects"
979
+ ]
980
+ },
981
+ {
982
+ "required": [
983
+ "stacks"
984
+ ]
985
+ }
986
+ ]
987
+ }
988
+ }
989
+ },
990
+ {
991
+ "if": {
992
+ "properties": {
993
+ "scope": {
994
+ "const": "project"
995
+ }
996
+ }
997
+ },
998
+ "then": {
999
+ "required": [
1000
+ "projects"
1001
+ ],
1002
+ "properties": {
1003
+ "projects": {
1004
+ "minItems": 1
1005
+ }
1006
+ },
1007
+ "not": {
1008
+ "anyOf": [
1009
+ {
1010
+ "required": [
1011
+ "areas"
1012
+ ]
1013
+ },
1014
+ {
1015
+ "required": [
1016
+ "stacks"
1017
+ ]
1018
+ }
1019
+ ]
1020
+ }
1021
+ }
1022
+ },
1023
+ {
1024
+ "if": {
1025
+ "properties": {
1026
+ "scope": {
1027
+ "const": "stack"
1028
+ }
1029
+ }
1030
+ },
1031
+ "then": {
1032
+ "required": [
1033
+ "stacks"
1034
+ ],
1035
+ "properties": {
1036
+ "stacks": {
1037
+ "minItems": 1
1038
+ }
1039
+ },
1040
+ "not": {
1041
+ "anyOf": [
1042
+ {
1043
+ "required": [
1044
+ "areas"
1045
+ ]
1046
+ },
1047
+ {
1048
+ "required": [
1049
+ "projects"
1050
+ ]
1051
+ }
1052
+ ]
1053
+ }
1054
+ }
1055
+ }
1056
+ ]
1057
+ }
1058
+ }
1059
+ }