@hraness/kb 0.18.0 → 0.18.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.
package/README.md CHANGED
@@ -14,34 +14,67 @@ system.
14
14
  Bun 1.3.14 or newer is required.
15
15
 
16
16
  ```sh
17
- bun add --global @hraness/kb@0.18.0
17
+ bun add --global @hraness/kb@0.18.1
18
+ kb --help
18
19
  ```
19
20
 
20
- ## Why kb
21
-
22
- - **Inspect what agents recover.** Markdown and Git stay authoritative,
23
- retrieval signals stay distinct, and indexes, embeddings, and graph views
24
- remain replaceable.
25
- - **Keep the application independent.** Application code imports neither the
26
- vault nor a hosted knowledge service. Capture and semantic adapters declare
27
- their network, browser, native-tool, and model-download effects.
28
-
29
- ## Create one durable note
21
+ ## Keep one decision available to the next session
30
22
 
31
- From a directory without an existing `kb/` path, this local task creates a
32
- vault, writes one typed note, and finds it without a network request or
33
- embedding model:
23
+ Suppose a parser must stop retrying after three attempts. Record that constraint
24
+ in a note, then link the plan that will implement it:
34
25
 
35
- ```sh
26
+ ```shell
36
27
  kb init kb
37
28
  kb note create notes/parser-contract \
38
- --title "Parser contract" --type concept --tag architecture --root kb
39
- kb search "parser contract" --root kb --mode exact
29
+ --title "Parser contract" --type concept --tag architecture \
30
+ --body "Parser retries stop after three attempts." --root kb
31
+ kb note create plans/parser-v2 \
32
+ --title "Parser v2" --type plan \
33
+ --body "The plan implements [[notes/parser-contract|the parser contract]]." \
34
+ --root kb
35
+ ```
36
+
37
+ The first `kb note create` command stores ordinary Markdown at
38
+ `kb/notes/parser-contract.md` and assigns its stable `document_id`. Add the
39
+ exact code boundary to that note's frontmatter so path lookup can recover it:
40
+
41
+ ```yaml
42
+ repository_scopes:
43
+ - packages/parser
40
44
  ```
41
45
 
42
- The note is stored at `kb/notes/parser-contract.md`. Exact search reads the
43
- current Markdown and returns that record. Commit the vault when it should
44
- travel with the repository.
46
+ Commit the vault with the repository. The Markdown and its Git history are the
47
+ durable record.
48
+
49
+ ## Recover the stopped session
50
+
51
+ In a later session, start from the code path and inspect each independent
52
+ signal:
53
+
54
+ ```shell
55
+ kb context packages/parser/src/index.ts --root kb --repo .
56
+ kb search "why parser retries stop" --root kb --mode exact \
57
+ --history --repo .
58
+ kb backlinks notes/parser-contract --root kb
59
+ kb history notes/parser-contract --root kb --repo .
60
+ ```
61
+
62
+ | Signal | What it recovers |
63
+ | --- | --- |
64
+ | Markdown | The current parser constraint in the file you can review and edit. |
65
+ | Backlinks | The plan that explicitly links to the constraint. |
66
+ | Exact search | The current note matched from its words, without a network request or embedding model. |
67
+ | Repository context | Inherited `AGENTS.md` guides and records scoped to `packages/parser`. |
68
+ | Git history | The commits and bounded co-change evidence associated with the note. |
69
+
70
+ Together, those views recover the persisted decision, related plan, applicable
71
+ rules, and provenance needed to resume the work. They do not reconstruct
72
+ private chat or prove that the note is still correct. Open the returned
73
+ Markdown and guides before acting on them.
74
+
75
+ The boundaries stay visible: Markdown and Git are authoritative, backlinks and
76
+ indexes are replaceable views, and Git work is opt-in. Application code imports
77
+ neither the vault nor a hosted knowledge service.
45
78
 
46
79
  <!-- hraness:kb-landing:end -->
47
80
 
@@ -51,22 +84,6 @@ travel with the repository.
51
84
  [KB source on GitHub](https://github.com/hraness/kb) ·
52
85
  [KB overview](https://hraness.com/kb)
53
86
 
54
- ## Use
55
-
56
- ```sh
57
- kb init kb
58
- kb clip https://example.com/article --output articles
59
- kb pdf ./report.pdf --output articles
60
- kb percolate notes/topic --root .
61
- kb context packages/parser/src/index.ts --root kb --repo .
62
- kb list --where type=plan --scope packages/parser --root .
63
- kb links notes/topic --root . --direction both
64
- kb search "parser-v2" --root . --mode exact
65
- kb portfolio search "parser-v2" --registry kb-portfolio.json \
66
- --workspace .. --shared
67
- kb history search packages/parser --root . --repo .. --json
68
- ```
69
-
70
87
  ## A knowledge base for your coding agents
71
88
 
72
89
  > Give coding agents durable, searchable memory beside the repository with plain Markdown, Git history, and replaceable local search.
@@ -193,63 +210,6 @@ Start with a short inherited `AGENTS.md` path for rules whose omission would mak
193
210
 
194
211
  Treat the knowledge base as repository-adjacent durable memory. Authored Markdown and Git are the record; catalogs, indexes, embeddings, and graph views are replaceable ways to find and inspect it. Checks can validate structure, captures can preserve a selected surface, and similarity can suggest candidates. None of those mechanisms proves that a source is trustworthy or an explanation is still true. People and agents must revise the knowledge as the repository changes.
195
212
 
196
- ## Upgrade to v0.18.0
197
-
198
- Version 0.18.0 adds a review-only adoption seam for exact dependency closures
199
- from an Oh working authority. Trusted host code creates a
200
- `createOhAdoptionPreparerV1` facade with the expected binding and head,
201
- destination, rights clearance, review route, and conflict policy. The narrow
202
- `prepare` call accepts only a capsule plus transformation and redaction
203
- disclosures, returns deeply immutable deterministic Markdown and manifest
204
- bytes with status `prepared`, and has no vault, Git, Oh-store, or promotion
205
- capability. KB pins `@hraness/oh` v0.2.0 and delegates closure integrity to its
206
- official store verifier.
207
-
208
- ## Upgrade to v0.17.3
209
-
210
- Version 0.17.3 restructures the README around an inspectable first task,
211
- explicit operating boundaries, and a shorter path from installation to useful
212
- output. Runtime APIs and package behavior are unchanged.
213
-
214
- ## Upgrade to v0.17.2
215
-
216
- Version 0.17.2 improves package discovery through focused npm keywords, a more
217
- specific README opening, and direct links between npm, GitHub, and the project
218
- overview. Runtime APIs and package behavior are unchanged.
219
-
220
- ## Upgrade to v0.17.1
221
-
222
- Version 0.17.1 adds the public `@hraness/kb` npm installation path without
223
- changing the runtime API introduced in 0.17.0. Bun `1.3.14` or newer is now an
224
- explicit package requirement. Consumers should review the package's declared
225
- dual-use capture boundary and the lifecycle scripts used by optional browser
226
- and native search adapters before enabling those scripts.
227
-
228
- ## Upgrade to v0.17.0
229
-
230
- Version 0.17 adds selected portfolio federation, stable note identities,
231
- qualified external relations, search rules, capture inspection, and untrusted
232
- context packing. Consumers with typed fixtures or custom capture writers should
233
- make these migrations before upgrading:
234
-
235
- - Capture writers now emit manifest schema v4 and must provide the stored
236
- document `path`, exact UTF-8 `bytes`, and lowercase SHA-256 digest. The reader
237
- can inspect schema v1-v3, but verification reports their document integrity as
238
- unavailable instead of success.
239
- - `DecisionContextOutput.search` has been removed. Consume the bounded untrusted
240
- `context` projection and its `truncated` flag instead of transporting the raw
241
- search result into an agent prompt.
242
- - `VaultAnalysis` fixtures must include `externalAuthoredRelations`, even when
243
- the value is an empty array. This keeps qualified authored edges distinct
244
- from locally resolved graph edges.
245
- - `createNote` and `kb note create` now assign `document_id` to new ordinary
246
- notes. Preserve that ID across renames and update snapshots that intentionally
247
- assert the generated frontmatter.
248
-
249
- Existing Markdown is not rewritten automatically. Add IDs to maintained legacy
250
- notes only through reviewed edits, and keep every QMD, graph, portfolio, and
251
- audit projection disposable.
252
-
253
213
  ## Installation reference
254
214
 
255
215
  [Bun](https://bun.sh/docs/installation) is the required runtime.
@@ -259,9 +219,9 @@ audit projection disposable.
259
219
  Copy this prompt into Codex, Claude Code, or another coding agent:
260
220
 
261
221
  ```text
262
- Install the `kb` Agent Skill from `hraness/kb#v0.18.0` with the standard skills
222
+ Install the `kb` Agent Skill from `hraness/kb#v0.18.1` with the standard skills
263
223
  CLI. Use the skill's runtime instructions to install the exact
264
- `@hraness/kb@0.18.0` registry release only when the command is missing. Verify it
224
+ `@hraness/kb@0.18.1` registry release only when the command is missing. Verify it
265
225
  with `kb doctor` and `kb --help`, but do not initialize or modify a vault until
266
226
  I ask.
267
227
  ```
@@ -269,25 +229,25 @@ I ask.
269
229
  Install the single public skill with either runner:
270
230
 
271
231
  ```sh
272
- npx skills add hraness/kb#v0.18.0
273
- bunx skills add hraness/kb#v0.18.0
232
+ npx skills add hraness/kb#v0.18.1
233
+ bunx skills add hraness/kb#v0.18.1
274
234
  ```
275
235
 
276
236
  Both commands discover the same `kb` skill and install it into the selected
277
237
  agent runner. Skill installation is inert: it does not initialize a vault,
278
238
  refresh a catalog, or edit Markdown. When invoked, the skill uses an existing
279
239
  `kb` command or, when the command is missing, checks for Bun and installs the
280
- CLI from the immutable `@hraness/kb@0.18.0` npm version.
240
+ CLI from the immutable `@hraness/kb@0.18.1` npm version.
281
241
 
282
242
  The public skills CLI reads `skills/kb/` from the repository. The immutable
283
- `0.18.0` npm package includes the same tree under
243
+ `0.18.1` npm package includes the same tree under
284
244
  `node_modules/@hraness/kb/skills/kb/`, and the package check verifies that the
285
245
  installed skill is byte-identical to the repository source.
286
246
 
287
247
  Install the two global commands with Bun:
288
248
 
289
249
  ```sh
290
- bun add --global @hraness/kb@0.18.0
250
+ bun add --global @hraness/kb@0.18.1
291
251
  kb --help
292
252
  kb-evaluation-builder --help
293
253
  ```
@@ -295,7 +255,7 @@ kb-evaluation-builder --help
295
255
  The same registry package can be installed with npm:
296
256
 
297
257
  ```sh
298
- npm install --global --ignore-scripts @hraness/kb@0.18.0
258
+ npm install --global --ignore-scripts @hraness/kb@0.18.1
299
259
  kb --help
300
260
  ```
301
261
 
@@ -308,7 +268,7 @@ reviewed and enabled; run `kb doctor` to inspect the resulting capabilities.
308
268
  For programmatic use, add the exact npm version to a Bun project:
309
269
 
310
270
  ```sh
311
- bun add --exact @hraness/kb@0.18.0
271
+ bun add --exact @hraness/kb@0.18.1
312
272
  ```
313
273
 
314
274
  The resulting dependency should remain exact:
@@ -316,12 +276,12 @@ The resulting dependency should remain exact:
316
276
  ```json
317
277
  {
318
278
  "dependencies": {
319
- "@hraness/kb": "0.18.0"
279
+ "@hraness/kb": "0.18.1"
320
280
  }
321
281
  }
322
282
  ```
323
283
 
324
- Version 0.18.0 retains three public GitHub dependencies: `@hraness/oh` at
284
+ Version 0.18.1 retains three public GitHub dependencies: `@hraness/oh` at
325
285
  immutable release `v0.2.0` for closure verification,
326
286
  `@steipete/sweet-cookie` at Hraness release `v0.4.2` for the cookie-scope safety
327
287
  fork, and `@tobilu/qmd` at commit
@@ -585,9 +545,9 @@ a vault. The package smoke test keeps future tagged packages byte-identical to
585
545
  that source tree.
586
546
 
587
547
  ```sh
588
- npx skills add hraness/kb#v0.18.0
548
+ npx skills add hraness/kb#v0.18.1
589
549
  # or
590
- bunx skills add hraness/kb#v0.18.0
550
+ bunx skills add hraness/kb#v0.18.1
591
551
  ```
592
552
 
593
553
  The skill invokes the installed `kb` command without depending on a repository
@@ -597,3 +557,69 @@ effect. The repository's phase-orchestration skill remains available to local
597
557
  repository agents but is marked internal, so public skill discovery omits it.
598
558
 
599
559
  See [Design](docs/design.md), [Portfolio federation](docs/portfolio.md), [Agent workflow](docs/agent-workflow.md), [PDF capture](docs/pdf.md), and [Contributing](CONTRIBUTING.md) for the durable contracts and development gate. hraness/kb is available under the [MIT License](LICENSE).
560
+
561
+ ## Release notes
562
+
563
+ ### Upgrade to v0.18.1
564
+
565
+ Version 0.18.1 restructures the public README and hosted projection around one
566
+ durable note, the exact recovery workflow, inspectable retrieval signals, and
567
+ explicit authority boundaries. Runtime APIs and package behavior are
568
+ unchanged.
569
+
570
+ ### Upgrade to v0.18.0
571
+
572
+ Version 0.18.0 adds a review-only adoption seam for exact dependency closures
573
+ from an Oh working authority. Trusted host code creates a
574
+ `createOhAdoptionPreparerV1` facade with the expected binding and head,
575
+ destination, rights clearance, review route, and conflict policy. The narrow
576
+ `prepare` call accepts only a capsule plus transformation and redaction
577
+ disclosures, returns deeply immutable deterministic Markdown and manifest
578
+ bytes with status `prepared`, and has no vault, Git, Oh-store, or promotion
579
+ capability. KB pins `@hraness/oh` v0.2.0 and delegates closure integrity to its
580
+ official store verifier.
581
+
582
+ ### Upgrade to v0.17.3
583
+
584
+ Version 0.17.3 restructures the README around an inspectable first task,
585
+ explicit operating boundaries, and a shorter path from installation to useful
586
+ output. Runtime APIs and package behavior are unchanged.
587
+
588
+ ### Upgrade to v0.17.2
589
+
590
+ Version 0.17.2 improves package discovery through focused npm keywords, a more
591
+ specific README opening, and direct links between npm, GitHub, and the project
592
+ overview. Runtime APIs and package behavior are unchanged.
593
+
594
+ ### Upgrade to v0.17.1
595
+
596
+ Version 0.17.1 adds the public `@hraness/kb` npm installation path without
597
+ changing the runtime API introduced in 0.17.0. Bun `1.3.14` or newer is now an
598
+ explicit package requirement. Consumers should review the package's declared
599
+ dual-use capture boundary and the lifecycle scripts used by optional browser
600
+ and native search adapters before enabling those scripts.
601
+
602
+ ### Upgrade to v0.17.0
603
+
604
+ Version 0.17 adds selected portfolio federation, stable note identities,
605
+ qualified external relations, search rules, capture inspection, and untrusted
606
+ context packing. Consumers with typed fixtures or custom capture writers should
607
+ make these migrations before upgrading:
608
+
609
+ - Capture writers now emit manifest schema v4 and must provide the stored
610
+ document `path`, exact UTF-8 `bytes`, and lowercase SHA-256 digest. The reader
611
+ can inspect schema v1-v3, but verification reports their document integrity as
612
+ unavailable instead of success.
613
+ - `DecisionContextOutput.search` has been removed. Consume the bounded untrusted
614
+ `context` projection and its `truncated` flag instead of transporting the raw
615
+ search result into an agent prompt.
616
+ - `VaultAnalysis` fixtures must include `externalAuthoredRelations`, even when
617
+ the value is an empty array. This keeps qualified authored edges distinct
618
+ from locally resolved graph edges.
619
+ - `createNote` and `kb note create` now assign `document_id` to new ordinary
620
+ notes. Preserve that ID across renames and update snapshots that intentionally
621
+ assert the generated frontmatter.
622
+
623
+ Existing Markdown is not rewritten automatically. Add IDs to maintained legacy
624
+ notes only through reviewed edits, and keep every QMD, graph, portfolio, and
625
+ audit projection disposable.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hraness/kb",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "A knowledge base for coding agents, built from Markdown, backlinks, semantic search, and Git context.",
5
5
  "license": "MIT",
6
6
  "contentPolicy": {
@@ -3,12 +3,13 @@ name: kb
3
3
  description: >-
4
4
  Operate a hraness/kb local-first Markdown knowledge base for coding-agent
5
5
  memory. Use when a user asks to search or query a KB or Obsidian vault; load
6
- repository context, plans, decisions, concepts, backlinks, semantic search,
7
- or Git provenance; save, clip, scrape, or archive a URL, article, social
8
- thread, signed-in browser page, or PDF as auditable Markdown; create or
9
- update a durable plan in the vault; or refresh, check, percolate, and
10
- maintain its knowledge graph. Do not use for generic web research, generic
11
- PDF reading, or ordinary planning that will not use a hraness/kb vault.
6
+ or recover repository context, plans, decisions, concepts, backlinks,
7
+ semantic search, or Git provenance from an earlier coding session; save,
8
+ clip, scrape, or archive a URL, article, social thread, signed-in browser
9
+ page, or PDF as auditable Markdown; create or update a durable plan in the
10
+ vault; or refresh, check, percolate, and maintain its knowledge graph. Do not
11
+ use for generic web research, generic PDF reading, or ordinary planning that
12
+ will not use a hraness/kb vault.
12
13
  ---
13
14
 
14
15
  # Work with KB
@@ -31,7 +32,7 @@ missing:
31
32
  ```sh
32
33
  command -v kb >/dev/null 2>&1 || {
33
34
  command -v bun >/dev/null 2>&1 || exit 1
34
- bun add --global @hraness/kb@0.18.0
35
+ bun add --global @hraness/kb@0.18.1
35
36
  }
36
37
  kb --help
37
38
  ```
@@ -50,7 +51,7 @@ Initialize or mutate a vault only when the user's request requires that change.
50
51
 
51
52
  | User intent | Read |
52
53
  | --- | --- |
53
- | Find notes, search one vault or an authorized portfolio, load repository-path context, inspect plans or decisions, follow backlinks or relationships, audit vault organization, or retrieve Git provenance | [Query the knowledge base](references/query.md) |
54
+ | Recover work from an earlier session, find notes, search one vault or an authorized portfolio, load repository-path context, inspect plans or decisions, follow backlinks or relationships, audit vault organization, or retrieve Git provenance | [Query the knowledge base](references/query.md) |
54
55
  | Save, clip, scrape, or archive a URL, article, social post or thread, GitHub or Discourse discussion, signed-in page, feed, inbox, private document, WhatsApp conversation, or YouTube page | [Capture web content](references/save-url.md); add [browser authentication](references/url-authentication.md) for signed-in sources and [platform routing](references/url-platforms.md) when route choice or completeness matters |
55
56
  | Import, extract, archive, OCR, or convert a local or public PDF into Markdown | [Save a PDF](references/save-pdf.md); add [PDF image review](references/pdf-review.md) for scans, screenshots, conversations, charts, or mixed media |
56
57
  | Create or update an implementation plan, proposal, RFC, migration plan, execution audit, or phased checklist in the vault | [Write a durable plan](references/plan.md) and [use its structure](references/plan-structure.md) |
@@ -14,6 +14,27 @@ authority; search scores, metadata rows, and graph results are derived views.
14
14
  - Pass the resolved path to every `--root`; do not scan a repository root merely
15
15
  because that is where the agent session started.
16
16
 
17
+ ## Recover a stopped session
18
+
19
+ When the user asks to resume earlier work, begin with the path being changed.
20
+ Keep each retrieval signal separate so the agent can inspect why a record was
21
+ returned:
22
+
23
+ ```sh
24
+ kb context packages/parser/src/index.ts --root "$KB_ROOT" --repo "$KB_REPO"
25
+ kb search "why parser retries stop" --root "$KB_ROOT" --mode exact \
26
+ --history --repo "$KB_REPO" --json
27
+ kb backlinks notes/parser-contract --root "$KB_ROOT" --json
28
+ kb history notes/parser-contract --root "$KB_ROOT" \
29
+ --repo "$KB_REPO" --json
30
+ ```
31
+
32
+ Replace the example path, query, and note ID with values from the current task.
33
+ Read the inherited guides and authoritative Markdown returned by these views.
34
+ Use the backlink to inspect related plans and use Git history as provenance,
35
+ not as proof that the note remains correct. This workflow recovers only context
36
+ that was persisted in files or Git; it does not reconstruct private chat.
37
+
17
38
  ## Choose the retrieval lane
18
39
 
19
40
  - Repository file or directory: run `kb context` first. Read its inherited