@imunitic/synapse 0.4.7 → 0.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imunitic/synapse",
3
- "version": "0.4.7",
3
+ "version": "0.6.0",
4
4
  "description": "Memory for Claude Code, Codex CLI, and OpenCode: a durable markdown vault plus a per-repo code graph.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,9 +23,9 @@
23
23
  "*.conf.template"
24
24
  ],
25
25
  "optionalDependencies": {
26
- "@imunitic/synapse-darwin-arm64": "0.4.7",
27
- "@imunitic/synapse-linux-x64": "0.4.7",
28
- "@imunitic/synapse-linux-arm64": "0.4.7"
26
+ "@imunitic/synapse-darwin-arm64": "0.6.0",
27
+ "@imunitic/synapse-linux-x64": "0.6.0",
28
+ "@imunitic/synapse-linux-arm64": "0.6.0"
29
29
  },
30
30
  "license": "SEE LICENSE IN LICENSE"
31
31
  }
@@ -0,0 +1,96 @@
1
+ # Declared keys are the full v1 spec; enforcement is a deliberate subset -- unknown note fields are ignored, never an error.
2
+ # `sources` is declared last on purpose: `field_order: relative` requires every other declared
3
+ # field to sit ahead of it in the actual file, so a small, frequently-looked-up scalar is never
4
+ # behind a `sources:` block that can run to hundreds of `path`/`hash` pairs on a large repo.
5
+ schema: synapse-note-schema/v1
6
+ id: graph-node/v1
7
+
8
+ frontmatter:
9
+ field_order: relative
10
+ fields:
11
+ schema:
12
+ type: string
13
+ required: true
14
+ const: graph-node/v1
15
+ title:
16
+ type: string
17
+ required: true
18
+ min_length: 1
19
+ summary:
20
+ type: string
21
+ required: true
22
+ min_length: 1
23
+ node_type:
24
+ type: string
25
+ required: true
26
+ const: synapse-node
27
+ project:
28
+ type: string
29
+ required: true
30
+ min_length: 1
31
+ branch:
32
+ type: string
33
+ required: true
34
+ min_length: 1
35
+ sources_digest:
36
+ type: string
37
+ required: true
38
+ pattern: '^[0-9a-f]{64}$'
39
+ stale:
40
+ type: boolean
41
+ required: true
42
+ built_at:
43
+ type: string
44
+ required: true
45
+ pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$'
46
+ commit:
47
+ type: string
48
+ required: false
49
+ crux_path:
50
+ type: string
51
+ required: false
52
+ crux_lines:
53
+ type: string
54
+ required: false
55
+ grounded_in:
56
+ type: any
57
+ required: false
58
+ sources:
59
+ type: any
60
+ required: true
61
+
62
+ body:
63
+ h1:
64
+ required: true
65
+ count: 1
66
+ equals: frontmatter.title
67
+ # Crux and Links are `synapse-node-format`'s documented convention for every
68
+ # authored node, but nothing has ever structurally required either heading
69
+ # to exist -- `write-node`'s own crux/grounded_in extraction is scoped to
70
+ # `## Crux` only when present, never required. Required here would be a new
71
+ # constraint this schema doesn't need to introduce to do its actual job
72
+ # (field order, schema identity); Summary/Sources/Notes are required because
73
+ # `write-node` always emits all three unconditionally today, so requiring
74
+ # them adds no new constraint at all.
75
+ sections:
76
+ - title: Summary
77
+ level: 2
78
+ required: true
79
+ non_empty: true
80
+ - title: Crux
81
+ level: 2
82
+ required: false
83
+ non_empty: true
84
+ - title: Links
85
+ level: 2
86
+ required: false
87
+ - title: Sources
88
+ level: 2
89
+ required: true
90
+ non_empty: true
91
+ - title: Notes
92
+ level: 2
93
+ required: true
94
+ section_order: relative
95
+
96
+ checks: []
@@ -93,3 +93,11 @@ checks:
93
93
  - equals:
94
94
  values: [frontmatter.created, frontmatter.updated]
95
95
  when: create
96
+
97
+ lints:
98
+ - no_hard_wrap: body.prose
99
+ severity: warn
100
+ - no_id_prefix_in_title:
101
+ title: frontmatter.title
102
+ id: frontmatter.note_id
103
+ severity: warn
@@ -65,3 +65,7 @@ checks:
65
65
  - equals:
66
66
  values: [frontmatter.created, frontmatter.updated]
67
67
  when: create
68
+
69
+ lints:
70
+ - no_hard_wrap: body.prose
71
+ severity: warn
@@ -91,3 +91,11 @@ checks:
91
91
  field: frontmatter.status
92
92
  value: TODO
93
93
  when: create
94
+
95
+ lints:
96
+ - no_hard_wrap: body.prose
97
+ severity: warn
98
+ - no_id_prefix_in_title:
99
+ title: frontmatter.title
100
+ id: frontmatter.task_id
101
+ severity: warn
@@ -55,7 +55,11 @@ to orient someone already inside. A node without one is an error, not a default.
55
55
  finds its node via this list). Do **not** trim it to a handful of "representative" files —
56
56
  doing so silently destroys that lookup, leaves the node unable to answer "which files am I
57
57
  about", and reduces hash verification to whatever survived the trim. Readability pressure
58
- belongs on `## Sources` below, never here.
58
+ belongs on `## Sources` below, never here. Always the *last* frontmatter field — on a large
59
+ project it can run to hundreds of `path`/`hash` pairs, and every other field stays ahead of it so
60
+ a single-key lookup never has to scan past it. `graph-node/v1`'s schema enforces this order
61
+ directly (`field_order: relative`); this document and `synapse write-node`'s own emission order
62
+ agree with it, not the other way around.
59
63
  - **`sources_digest`:** `sha256` over the sorted `path:hash` lines of `sources` (see "Computing
60
64
  `sources_digest`" below). Lets a staleness check answer "has this node changed" by reading one
61
65
  field instead of every hash.
@@ -149,18 +153,19 @@ to orient someone already inside. A node without one is an error, not a default.
149
153
 
150
154
  ```yaml
151
155
  ---
156
+ schema: graph-node/v1
152
157
  title: "World — entity/component/resource core"
153
158
  node_type: synapse-node
154
159
  project: acme
160
+ sources_digest: <sha256 over the sorted "path:hash" lines>
161
+ stale: false
162
+ built_at: "<now>"
155
163
  sources:
156
164
  - path: acme_ecs/world.ml
157
165
  hash: <git hash-object output>
158
166
  - path: acme_ecs/world.mli
159
167
  hash: <git hash-object output>
160
168
  # ... every file the node covers, not a selection
161
- sources_digest: <sha256 over the sorted "path:hash" lines>
162
- stale: false
163
- built_at: "<now>"
164
169
  ---
165
170
 
166
171
  # World — entity/component/resource core