ultimate-brain 0.3.1 → 0.4.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.
Files changed (38) hide show
  1. package/.agents/skills/brain-apply/SKILL.md +10 -6
  2. package/.agents/skills/brain-catch-up/SKILL.md +27 -14
  3. package/.agents/skills/brain-connect-notion/SKILL.md +2 -2
  4. package/.agents/skills/brain-howto/references/guide.md +44 -11
  5. package/.agents/skills/brain-ingest/SKILL.md +14 -8
  6. package/.agents/skills/brain-ingest/references/cli-inputs.md +19 -2
  7. package/.agents/skills/brain-ingest/references/extraction.md +11 -7
  8. package/.agents/skills/brain-ingest/references/notion.md +25 -11
  9. package/.agents/skills/brain-ingest/references/sources.md +24 -1
  10. package/.agents/skills/brain-notion-change/SKILL.md +16 -2
  11. package/.agents/skills/brain-query/SKILL.md +22 -2
  12. package/.agents/skills/brain-sync/SKILL.md +6 -4
  13. package/.agents/skills/brain-sync/references/formats.md +1 -1
  14. package/README.md +1 -1
  15. package/dist/cli.js +5 -2
  16. package/dist/commands/proposal.js +21 -1
  17. package/dist/commands/repo.js +110 -0
  18. package/dist/commands/report.js +115 -0
  19. package/dist/commands/source.js +56 -0
  20. package/dist/commands/status.js +4 -1
  21. package/dist/commands/views.js +30 -15
  22. package/dist/lib/apply.js +83 -10
  23. package/dist/lib/errors.js +3 -0
  24. package/dist/lib/frontmatter.js +9 -4
  25. package/dist/lib/lint.js +34 -5
  26. package/dist/lib/note-new.js +44 -0
  27. package/dist/lib/notes.js +1 -0
  28. package/dist/lib/parts.js +82 -0
  29. package/dist/lib/proposals.js +183 -8
  30. package/dist/lib/repos.js +129 -0
  31. package/dist/lib/sync.js +167 -28
  32. package/dist/lib/views.js +53 -15
  33. package/package.json +1 -1
  34. package/spec/schemas/brain.schema.json +46 -0
  35. package/spec/schemas/note.schema.json +343 -3
  36. package/spec/schemas/proposal.schema.json +393 -10
  37. package/templates/brain/AGENTS.md +4 -4
  38. package/templates/brain/brain.json +2 -1
@@ -42,7 +42,9 @@
42
42
  "supersede",
43
43
  "contradiction",
44
44
  "merge",
45
- "new_item"
45
+ "new_item",
46
+ "review_notes",
47
+ "answer"
46
48
  ]
47
49
  },
48
50
  "target": {
@@ -114,12 +116,14 @@
114
116
  "uniqueItems": true,
115
117
  "items": {
116
118
  "type": "object",
117
- "required": [
118
- "field",
119
- "value"
120
- ],
121
119
  "additionalProperties": false,
122
120
  "properties": {
121
+ "note": {
122
+ "$ref": "note.schema.json#/$defs/id"
123
+ },
124
+ "target": {
125
+ "$ref": "note.schema.json#/$defs/id"
126
+ },
123
127
  "field": {
124
128
  "type": "string"
125
129
  },
@@ -127,7 +131,44 @@
127
131
  "type": "string",
128
132
  "minLength": 1
129
133
  }
130
- }
134
+ },
135
+ "oneOf": [
136
+ {
137
+ "required": [
138
+ "note"
139
+ ],
140
+ "not": {
141
+ "anyOf": [
142
+ {
143
+ "required": [
144
+ "field"
145
+ ]
146
+ },
147
+ {
148
+ "required": [
149
+ "value"
150
+ ]
151
+ },
152
+ {
153
+ "required": [
154
+ "target"
155
+ ]
156
+ }
157
+ ]
158
+ }
159
+ },
160
+ {
161
+ "required": [
162
+ "field",
163
+ "value"
164
+ ],
165
+ "not": {
166
+ "required": [
167
+ "note"
168
+ ]
169
+ }
170
+ }
171
+ ]
131
172
  }
132
173
  },
133
174
  "decided_at": {
@@ -199,7 +240,6 @@
199
240
  },
200
241
  "links": {
201
242
  "type": "array",
202
- "minItems": 1,
203
243
  "uniqueItems": true,
204
244
  "items": {
205
245
  "type": "object",
@@ -209,6 +249,9 @@
209
249
  ],
210
250
  "additionalProperties": false,
211
251
  "properties": {
252
+ "target": {
253
+ "$ref": "note.schema.json#/$defs/id"
254
+ },
212
255
  "field": {
213
256
  "enum": [
214
257
  "aliases",
@@ -225,6 +268,20 @@
225
268
  }
226
269
  }
227
270
  }
271
+ },
272
+ "notes": {
273
+ "type": "array",
274
+ "uniqueItems": true,
275
+ "items": {
276
+ "$ref": "note.schema.json#/$defs/id"
277
+ }
278
+ },
279
+ "answer": {
280
+ "type": "string",
281
+ "minLength": 1
282
+ },
283
+ "answer_note": {
284
+ "$ref": "note.schema.json#/$defs/id"
228
285
  }
229
286
  },
230
287
  "additionalProperties": false,
@@ -326,6 +383,21 @@
326
383
  "required": [
327
384
  "before"
328
385
  ]
386
+ },
387
+ {
388
+ "required": [
389
+ "notes"
390
+ ]
391
+ },
392
+ {
393
+ "required": [
394
+ "answer"
395
+ ]
396
+ },
397
+ {
398
+ "required": [
399
+ "answer_note"
400
+ ]
329
401
  }
330
402
  ]
331
403
  },
@@ -347,6 +419,18 @@
347
419
  ]
348
420
  }
349
421
  ]
422
+ },
423
+ "properties": {
424
+ "links": {
425
+ "minItems": 1,
426
+ "items": {
427
+ "not": {
428
+ "required": [
429
+ "target"
430
+ ]
431
+ }
432
+ }
433
+ }
350
434
  }
351
435
  },
352
436
  {
@@ -620,7 +704,8 @@
620
704
  "enum": [
621
705
  "update_fact",
622
706
  "contradiction",
623
- "add_to_note"
707
+ "add_to_note",
708
+ "answer"
624
709
  ]
625
710
  }
626
711
  }
@@ -649,7 +734,10 @@
649
734
  "then": {
650
735
  "properties": {
651
736
  "kind": {
652
- "const": "add_link"
737
+ "enum": [
738
+ "add_link",
739
+ "review_notes"
740
+ ]
653
741
  }
654
742
  }
655
743
  }
@@ -670,7 +758,10 @@
670
758
  "then": {
671
759
  "properties": {
672
760
  "kind": {
673
- "const": "add_link"
761
+ "enum": [
762
+ "add_link",
763
+ "review_notes"
764
+ ]
674
765
  },
675
766
  "decision": {
676
767
  "properties": {
@@ -681,6 +772,298 @@
681
772
  }
682
773
  }
683
774
  }
775
+ },
776
+ {
777
+ "if": {
778
+ "properties": {
779
+ "kind": {
780
+ "const": "review_notes"
781
+ }
782
+ }
783
+ },
784
+ "then": {
785
+ "required": [
786
+ "notes",
787
+ "links"
788
+ ],
789
+ "properties": {
790
+ "links": {
791
+ "items": {
792
+ "required": [
793
+ "target"
794
+ ]
795
+ }
796
+ }
797
+ },
798
+ "anyOf": [
799
+ {
800
+ "properties": {
801
+ "notes": {
802
+ "minItems": 1
803
+ }
804
+ }
805
+ },
806
+ {
807
+ "properties": {
808
+ "links": {
809
+ "minItems": 1
810
+ }
811
+ }
812
+ }
813
+ ],
814
+ "not": {
815
+ "anyOf": [
816
+ {
817
+ "required": [
818
+ "target"
819
+ ]
820
+ },
821
+ {
822
+ "required": [
823
+ "field"
824
+ ]
825
+ },
826
+ {
827
+ "required": [
828
+ "before"
829
+ ]
830
+ },
831
+ {
832
+ "required": [
833
+ "after"
834
+ ]
835
+ },
836
+ {
837
+ "required": [
838
+ "content"
839
+ ]
840
+ },
841
+ {
842
+ "required": [
843
+ "note"
844
+ ]
845
+ },
846
+ {
847
+ "required": [
848
+ "supersedes"
849
+ ]
850
+ },
851
+ {
852
+ "required": [
853
+ "merge_into"
854
+ ]
855
+ },
856
+ {
857
+ "required": [
858
+ "answer"
859
+ ]
860
+ },
861
+ {
862
+ "required": [
863
+ "answer_note"
864
+ ]
865
+ }
866
+ ]
867
+ }
868
+ }
869
+ },
870
+ {
871
+ "if": {
872
+ "properties": {
873
+ "kind": {
874
+ "const": "answer"
875
+ }
876
+ }
877
+ },
878
+ "then": {
879
+ "required": [
880
+ "target",
881
+ "answer"
882
+ ],
883
+ "not": {
884
+ "anyOf": [
885
+ {
886
+ "required": [
887
+ "field"
888
+ ]
889
+ },
890
+ {
891
+ "required": [
892
+ "before"
893
+ ]
894
+ },
895
+ {
896
+ "required": [
897
+ "after"
898
+ ]
899
+ },
900
+ {
901
+ "required": [
902
+ "content"
903
+ ]
904
+ },
905
+ {
906
+ "required": [
907
+ "note"
908
+ ]
909
+ },
910
+ {
911
+ "required": [
912
+ "links"
913
+ ]
914
+ },
915
+ {
916
+ "required": [
917
+ "notes"
918
+ ]
919
+ },
920
+ {
921
+ "required": [
922
+ "supersedes"
923
+ ]
924
+ },
925
+ {
926
+ "required": [
927
+ "merge_into"
928
+ ]
929
+ }
930
+ ]
931
+ }
932
+ }
933
+ },
934
+ {
935
+ "if": {
936
+ "anyOf": [
937
+ {
938
+ "required": [
939
+ "notes"
940
+ ]
941
+ }
942
+ ]
943
+ },
944
+ "then": {
945
+ "properties": {
946
+ "kind": {
947
+ "const": "review_notes"
948
+ }
949
+ }
950
+ }
951
+ },
952
+ {
953
+ "if": {
954
+ "anyOf": [
955
+ {
956
+ "required": [
957
+ "answer"
958
+ ]
959
+ },
960
+ {
961
+ "required": [
962
+ "answer_note"
963
+ ]
964
+ }
965
+ ]
966
+ },
967
+ "then": {
968
+ "properties": {
969
+ "kind": {
970
+ "const": "answer"
971
+ }
972
+ }
973
+ }
974
+ },
975
+ {
976
+ "description": "exclude entries fit the kind: {field, value} on add_link, {note} or {target, field, value} on review_notes.",
977
+ "if": {
978
+ "required": [
979
+ "kind",
980
+ "decision"
981
+ ],
982
+ "properties": {
983
+ "kind": {
984
+ "const": "add_link"
985
+ },
986
+ "decision": {
987
+ "required": [
988
+ "exclude"
989
+ ]
990
+ }
991
+ }
992
+ },
993
+ "then": {
994
+ "properties": {
995
+ "decision": {
996
+ "properties": {
997
+ "exclude": {
998
+ "items": {
999
+ "required": [
1000
+ "field",
1001
+ "value"
1002
+ ],
1003
+ "not": {
1004
+ "anyOf": [
1005
+ {
1006
+ "required": [
1007
+ "target"
1008
+ ]
1009
+ },
1010
+ {
1011
+ "required": [
1012
+ "note"
1013
+ ]
1014
+ }
1015
+ ]
1016
+ }
1017
+ }
1018
+ }
1019
+ }
1020
+ }
1021
+ }
1022
+ }
1023
+ },
1024
+ {
1025
+ "if": {
1026
+ "required": [
1027
+ "kind",
1028
+ "decision"
1029
+ ],
1030
+ "properties": {
1031
+ "kind": {
1032
+ "const": "review_notes"
1033
+ },
1034
+ "decision": {
1035
+ "required": [
1036
+ "exclude"
1037
+ ]
1038
+ }
1039
+ }
1040
+ },
1041
+ "then": {
1042
+ "properties": {
1043
+ "decision": {
1044
+ "properties": {
1045
+ "exclude": {
1046
+ "items": {
1047
+ "anyOf": [
1048
+ {
1049
+ "required": [
1050
+ "note"
1051
+ ]
1052
+ },
1053
+ {
1054
+ "required": [
1055
+ "target",
1056
+ "field",
1057
+ "value"
1058
+ ]
1059
+ }
1060
+ ]
1061
+ }
1062
+ }
1063
+ }
1064
+ }
1065
+ }
1066
+ }
684
1067
  }
685
1068
  ]
686
1069
  }
@@ -13,11 +13,11 @@ Each operation has a skill; follow it end to end:
13
13
  | The user wants to… | Skill |
14
14
  |---|---|
15
15
  | connect the brain to Notion (after building the space) | `brain-connect-notion` |
16
- | catch up: do everything that's waiting (decided reviews, reviewed meetings, the Inbox, the drop folder) | `brain-catch-up` |
17
- | ingest one input: reviewed minutes, a document, a web page, a pasted email or note, the Inbox, the drop folder | `brain-ingest` |
16
+ | catch up: do everything that's waiting (decided reviews, reviewed meetings, the Inbox and its attachments, the drop folder, linked repos, reports asked for) | `brain-catch-up` |
17
+ | ingest one input: reviewed minutes, a document, a web page, a pasted email or note, the Inbox, the drop folder, a linked repo; link a repo | `brain-ingest` |
18
18
  | apply decisions from the Notion Review queue | `brain-apply` |
19
19
  | pull Notion edits and new rows, republish notes | `brain-sync` |
20
- | answer a question from the brain | `brain-query` |
20
+ | answer a question from the brain, or write a report on a subject | `brain-query` |
21
21
  | learn how the system works ("how do I…", "why didn't…") | `brain-howto` |
22
22
  | change the Notion structure (databases, properties, views) | `brain-notion-change`; structure is changed in the product repo first, never edited directly in Notion (0022) |
23
23
 
@@ -47,7 +47,7 @@ Each operation has a skill; follow it end to end:
47
47
  6. **Decision gate.** A decision note is for a choice that is hard to reverse, surprising without context, or a real trade-off. Anything smaller becomes a dated line in the project, through a proposal.
48
48
  7. **Dated, not "current".** Write facts as timeless, dated ("as of 2026-12-03"), or as pointers ("status: see Notion"). Volatile status (task state, project status, priority) lives in Notion.
49
49
  8. **Cite canonical notes.** `index.md` and the views are navigation; cite the note or source they point to.
50
- 9. **Answering is read-only.** Answering the user's questions from the brain writes nothing; save an answer to the brain only when the user asks.
50
+ 9. **Answering is read-only.** Answering the user's questions from the brain writes nothing; save an answer to the brain only when the user asks. A report the user asks for is stored as a dated view in `reports/` and published, never as knowledge: it is never ingested or cited as a source (decision 0043).
51
51
  10. **Unattended runs add, never apply.** With no user present, an agent may add drafts and proposals; applying proposals waits for the user.
52
52
 
53
53
  ## Reading notes
@@ -32,7 +32,8 @@
32
32
  "source": "Source",
33
33
  "brain_id": "Brain ID"
34
34
  },
35
- "new_task_status": "To Do"
35
+ "new_task_status": "To Do",
36
+ "status_type": "status"
36
37
  }
37
38
  }
38
39
  }