@andespindola/brainlink 0.1.0-alpha.3 → 0.1.0-alpha.5
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/AGENTS.md +5 -1
- package/README.md +11 -2
- package/docs/AGENT_USAGE.md +43 -0
- package/docs/RELEASE.md +7 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -27,12 +27,16 @@ By default, the installed Brainlink CLI uses `$HOME/.brainlink/vault` as its vau
|
|
|
27
27
|
Use this loop when using Brainlink as memory:
|
|
28
28
|
|
|
29
29
|
1. Write durable knowledge into Markdown notes.
|
|
30
|
-
2. Link related notes with `[[Note Title]]
|
|
30
|
+
2. Link related notes with explicit `[[Note Title]]` wiki links inside the note body.
|
|
31
31
|
3. Add explicit `#tags` for retrieval.
|
|
32
32
|
4. Run `index` after writes.
|
|
33
33
|
5. Run `context "<task or question>"` before answering.
|
|
34
34
|
6. Use the returned sources as grounded context.
|
|
35
35
|
|
|
36
|
+
`context` is read-only. It does not create notes, backlinks, graph edges or durable memory by itself. A relationship exists only when a Markdown note contains a `[[wiki link]]` to another note and the vault has been indexed after that write.
|
|
37
|
+
|
|
38
|
+
When an agent adds durable memory, it should connect the new note to at least one existing concept unless the note is intentionally a root concept. Prefer exact note titles in links, for example `[[Architecture]]`, and run `broken-links`, `orphans` or `validate` when the graph looks disconnected.
|
|
39
|
+
|
|
36
40
|
## Commands
|
|
37
41
|
|
|
38
42
|
```bash
|
package/README.md
CHANGED
|
@@ -185,6 +185,15 @@ blink add "Testing Policy" \
|
|
|
185
185
|
--content "Run npm run check before final delivery. Related: [[Release Checklist]]. #testing #process"
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
+
Brainlink does not infer durable graph relationships from generated context. A context result is only a read package for the model. To create a real link in the knowledge graph, the agent must write Markdown that contains an explicit `[[Note Title]]` wiki link and then rebuild the index.
|
|
189
|
+
|
|
190
|
+
When adding memory, follow this contract:
|
|
191
|
+
|
|
192
|
+
- Link the new note to at least one existing note when there is a related concept.
|
|
193
|
+
- Use the exact target note title inside `[[...]]`.
|
|
194
|
+
- Add retrieval tags such as `#architecture`, `#decision`, `#runbook` or `#preference`.
|
|
195
|
+
- Do not leave isolated notes unless they are intentionally root concepts.
|
|
196
|
+
|
|
188
197
|
Rebuild the index:
|
|
189
198
|
|
|
190
199
|
```bash
|
|
@@ -207,9 +216,9 @@ Use this loop during real work:
|
|
|
207
216
|
2. Run `blink context "<task>" --agent "$BLINK_AGENT" --json`.
|
|
208
217
|
3. Use returned sources as project memory.
|
|
209
218
|
4. Perform the task.
|
|
210
|
-
5. Save only durable learnings with `blink add
|
|
219
|
+
5. Save only durable learnings with `blink add`, including `[[wiki links]]` to related notes.
|
|
211
220
|
6. Run `blink index`.
|
|
212
|
-
7. Validate with `blink validate
|
|
221
|
+
7. Validate with `blink validate`, `blink broken-links` and `blink orphans` when graph links matter.
|
|
213
222
|
|
|
214
223
|
Do not store secrets, credentials, private keys, access tokens or transient chat noise.
|
|
215
224
|
|
package/docs/AGENT_USAGE.md
CHANGED
|
@@ -138,6 +138,41 @@ Rules:
|
|
|
138
138
|
- Prefer summaries over raw transcripts.
|
|
139
139
|
- Preserve dates when the timing matters.
|
|
140
140
|
|
|
141
|
+
## Linking Contract
|
|
142
|
+
|
|
143
|
+
Brainlink only builds graph edges from Markdown `[[wiki links]]`.
|
|
144
|
+
|
|
145
|
+
The `context` command is read-only. It retrieves indexed notes and returns a compact package for the model, but it does not write memory, create backlinks, infer relationships or modify the graph. If an agent reads context and then learns something durable, the agent must write a note with explicit links before that knowledge becomes connected memory.
|
|
146
|
+
|
|
147
|
+
Required write behavior:
|
|
148
|
+
|
|
149
|
+
1. Choose a clear title for the new note.
|
|
150
|
+
2. Look for an existing related concept with `search`, `links` or `backlinks`.
|
|
151
|
+
3. Add at least one `[[Existing Note Title]]` link unless the note is intentionally a root concept.
|
|
152
|
+
4. Add useful `#tags` for retrieval.
|
|
153
|
+
5. Run `index` after the write.
|
|
154
|
+
6. Run `validate`, `broken-links` or `orphans` when the graph should be connected.
|
|
155
|
+
|
|
156
|
+
Good linked note:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
blink add "SQLite Index Rebuild" \
|
|
160
|
+
--agent coding-agent \
|
|
161
|
+
--content "Legacy derived indexes without agent columns are rebuilt because SQLite is disposable. Related: [[Architecture]], [[Agent Namespaces]]. #sqlite #architecture #decision"
|
|
162
|
+
blink index
|
|
163
|
+
blink validate --agent coding-agent
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Poor disconnected note:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
blink add "SQLite Index Rebuild" \
|
|
170
|
+
--agent coding-agent \
|
|
171
|
+
--content "We rebuild old indexes now."
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The poor note may be searchable, but it will not create graph links, backlinks or useful traversal paths.
|
|
175
|
+
|
|
141
176
|
## Read Policy
|
|
142
177
|
|
|
143
178
|
Before answering a memory-dependent question, run:
|
|
@@ -453,6 +488,12 @@ Output:
|
|
|
453
488
|
|
|
454
489
|
Agents should include source paths in their reasoning or final answer when the user needs traceability.
|
|
455
490
|
|
|
491
|
+
Non-goals:
|
|
492
|
+
|
|
493
|
+
- `context` must not be treated as a write operation.
|
|
494
|
+
- Retrieved context must not be assumed to create graph edges.
|
|
495
|
+
- Backlinks are derived only from indexed `[[wiki links]]`.
|
|
496
|
+
|
|
456
497
|
## Operational Rules
|
|
457
498
|
|
|
458
499
|
- Re-run `index` after modifying notes.
|
|
@@ -461,6 +502,8 @@ Agents should include source paths in their reasoning or final answer when the u
|
|
|
461
502
|
- Do not manually edit the database.
|
|
462
503
|
- Keep generated context short enough for the target model.
|
|
463
504
|
- Prefer specific queries over broad queries.
|
|
505
|
+
- Write explicit `[[wiki links]]` when durable memory should be connected.
|
|
506
|
+
- Check `orphans` before assuming the graph is healthy.
|
|
464
507
|
|
|
465
508
|
## Failure Modes
|
|
466
509
|
|
package/docs/RELEASE.md
CHANGED
|
@@ -47,11 +47,18 @@ blink server --vault ./tmp-vault --host 0.0.0.0
|
|
|
47
47
|
|
|
48
48
|
The preferred path is the `Publish npm` GitHub Actions workflow:
|
|
49
49
|
|
|
50
|
+
- Push to `main`: runs checks, pack smoke, then publishes the package to npm with `latest` when `package.json` contains a version that is not already published.
|
|
50
51
|
- GitHub Release `published`: runs checks, pack smoke, then publishes to npm with provenance.
|
|
51
52
|
- Manual `workflow_dispatch`: runs a dry run by default. Disable `dry_run` only for an intentional manual publish.
|
|
52
53
|
- Manual `workflow_dispatch` accepts an optional `dist_tag` override. Use `latest` only when the default npm install command should resolve to that version.
|
|
53
54
|
- Prerelease versions publish under their prerelease dist-tag, for example `0.1.0-alpha.1` publishes with `--tag alpha`.
|
|
54
55
|
|
|
56
|
+
On `main`, the publish job checks npm before publishing. If the version already exists, it automatically bumps to the next available version before checks, packing and publishing. For example, `0.1.0-alpha.4` becomes `0.1.0-alpha.5`.
|
|
57
|
+
|
|
58
|
+
After a successful automatic bump publish, the workflow commits the updated `package.json` and `package-lock.json` back to `main` with `[skip publish]` to avoid a publish loop.
|
|
59
|
+
|
|
60
|
+
Manual and GitHub Release publishes do not auto-bump. If their version already exists, they skip `npm publish` because npm versions are immutable.
|
|
61
|
+
|
|
55
62
|
For emergency local publishing of scoped public packages:
|
|
56
63
|
|
|
57
64
|
```bash
|
package/package.json
CHANGED