@hraness/wordcell 0.22.5 → 0.24.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 (78) hide show
  1. package/README.md +67 -18
  2. package/dist/authoring.js +2 -2
  3. package/dist/{authority-3ga47syb.js → authority-35cbvp1x.js} +2 -2
  4. package/dist/benchmark.js +3 -3
  5. package/dist/capture.js +6 -6
  6. package/dist/cli.js +26 -24
  7. package/dist/clip/acquire.js +3 -3
  8. package/dist/clip/args.js +1 -1
  9. package/dist/clip/cli.js +6 -6
  10. package/dist/clip/doctor.js +4 -4
  11. package/dist/evaluation-builder.js +10 -10
  12. package/dist/evaluation-kb.js +10 -10
  13. package/dist/graph-authority.js +4 -4
  14. package/dist/graph-percolation.js +6 -6
  15. package/dist/graph.js +3 -1
  16. package/dist/{index-bcknqxrq.js → index-0eacgvpv.js} +9 -1
  17. package/dist/{index-f75zmmdr.js → index-1er88ckw.js} +4 -4
  18. package/dist/{index-8v6k9h4r.js → index-1s8mc4hz.js} +1 -1
  19. package/dist/{index-n9kwenpt.js → index-1w0sp1q7.js} +1 -1
  20. package/dist/{index-de2w8crk.js → index-2fmnttca.js} +82 -15
  21. package/dist/{index-8bgnhjgq.js → index-44kw9tr8.js} +3867 -162
  22. package/dist/{index-42tb8qqp.js → index-5d1rd5v9.js} +444 -9
  23. package/dist/{index-aer0jdrq.js → index-ahyhryb8.js} +1 -1
  24. package/dist/{index-f7fnww7a.js → index-b0khj0h5.js} +164 -9
  25. package/dist/{index-qdb8f8va.js → index-bdwcjvr4.js} +1 -1
  26. package/dist/{index-dfag79p7.js → index-byz4kzww.js} +3 -0
  27. package/dist/{index-hgve9rh2.js → index-cd75vky9.js} +96 -1
  28. package/dist/{index-h2qn3y3f.js → index-f184qyh1.js} +4 -4
  29. package/dist/{index-n57tewfr.js → index-fp732bgg.js} +2 -2
  30. package/dist/{index-zy7an84p.js → index-jvb7w0gg.js} +5 -2
  31. package/dist/{index-f984hw45.js → index-k86wepd8.js} +1 -1
  32. package/dist/{index-1r5rnkfr.js → index-mvs6f7ne.js} +2 -2
  33. package/dist/{index-p96kb6t2.js → index-nn67kzwa.js} +1 -1
  34. package/dist/{index-fc4dr114.js → index-nwrehke7.js} +1 -1
  35. package/dist/{index-pz2b2x0y.js → index-pgtm2nhf.js} +1 -1
  36. package/dist/{index-054mb7d3.js → index-qfqjfxaa.js} +10 -9
  37. package/dist/{index-xzvcw9ga.js → index-r0m5taz2.js} +2 -2
  38. package/dist/{index-gtwqye5a.js → index-tcaq1c7f.js} +4 -4
  39. package/dist/{index-g5vsqmdy.js → index-xwxy71ew.js} +190 -4
  40. package/dist/index.js +15 -13
  41. package/dist/pdf.js +3 -3
  42. package/dist/percolate.js +2 -2
  43. package/dist/portfolio.js +10 -10
  44. package/dist/publish.js +3 -3
  45. package/dist/sdk.js +9 -9
  46. package/dist/search.js +2 -2
  47. package/dist/semantic.js +4 -4
  48. package/dist/{support-jf9v10j7.js → support-1yhv6vm6.js} +25 -23
  49. package/dist/url-intelligence.js +1 -1
  50. package/dist/workflows/decision-context.js +10 -10
  51. package/dist/workflows/index.js +10 -10
  52. package/package.json +12 -4
  53. package/skills/wordcell/AGENTS.md +1 -0
  54. package/skills/wordcell/SKILL.md +5 -3
  55. package/skills/wordcell/references/query.md +52 -4
  56. package/skills/wordcell/references/session-memory.md +207 -0
  57. package/src/authoring-import.ts +32 -0
  58. package/src/authoring-model.ts +185 -2
  59. package/src/authoring-program.ts +19 -7
  60. package/src/cli-help.ts +894 -0
  61. package/src/cli-intro.ts +1 -1
  62. package/src/cli-program.ts +612 -83
  63. package/src/cli-style.ts +132 -0
  64. package/src/clip/acquire.ts +20 -0
  65. package/src/clip/args.ts +3 -0
  66. package/src/clip/cli.ts +82 -5
  67. package/src/clip/cookie-permission.ts +241 -0
  68. package/src/clip/url-metadata-cli.ts +6 -5
  69. package/src/clip/url-metadata.ts +14 -0
  70. package/src/graph.ts +9 -4
  71. package/src/import-supermemory.ts +1629 -0
  72. package/src/mcp-server.ts +415 -0
  73. package/src/mcp-tools.ts +1138 -0
  74. package/src/pdf/cli.ts +5 -4
  75. package/src/sdk.ts +149 -1
  76. package/src/selected-passage.ts +409 -0
  77. package/src/support-profile.ts +1 -1
  78. package/src/support.ts +3 -0
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  decisionContextWorkflow
4
- } from "../index-n9kwenpt.js";
4
+ } from "../index-1w0sp1q7.js";
5
5
  import {
6
6
  explainChangeWorkflow
7
7
  } from "../index-e4fagfjz.js";
@@ -9,25 +9,25 @@ import {
9
9
  planRadarWorkflow
10
10
  } from "../index-rdd5f7jj.js";
11
11
  import"../index-h170byqw.js";
12
- import"../index-42tb8qqp.js";
12
+ import"../index-5d1rd5v9.js";
13
13
  import"../index-adx6khj5.js";
14
- import"../index-n57tewfr.js";
14
+ import"../index-fp732bgg.js";
15
15
  import"../index-4j3tt0c3.js";
16
16
  import"../index-j70m75wd.js";
17
- import"../index-gtwqye5a.js";
18
- import"../index-qdb8f8va.js";
19
- import"../index-f75zmmdr.js";
20
- import"../index-pz2b2x0y.js";
17
+ import"../index-tcaq1c7f.js";
18
+ import"../index-bdwcjvr4.js";
19
+ import"../index-1er88ckw.js";
20
+ import"../index-pgtm2nhf.js";
21
21
  import"../index-1gwbassd.js";
22
- import"../index-aer0jdrq.js";
22
+ import"../index-ahyhryb8.js";
23
23
  import"../index-1xxnjn0d.js";
24
- import"../index-8v6k9h4r.js";
24
+ import"../index-1s8mc4hz.js";
25
25
  import"../index-d13v9ckt.js";
26
26
  import"../index-48pz4jpc.js";
27
27
  import"../index-06c9ctr6.js";
28
28
  import"../index-5vwpzb5a.js";
29
29
  import"../index-3rm7cz6h.js";
30
- import"../index-zy7an84p.js";
30
+ import"../index-jvb7w0gg.js";
31
31
  import"../index-z1w83f81.js";
32
32
  export {
33
33
  planRadarWorkflow,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hraness/wordcell",
3
- "version": "0.22.5",
4
- "description": "A local Markdown knowledge base with superpowers. Save decisions, sources, and plans as files you own, then find them by exact words or, with an optional local model, by meaning.",
3
+ "version": "0.24.0",
4
+ "description": "Wordcell keeps decisions, plans, and sources as Markdown beside your code, so coding agents can find them from the file they are about to change.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": [
@@ -321,6 +321,7 @@
321
321
  "src/agent-context.ts",
322
322
  "src/agent-guide-audit.ts",
323
323
  "src/authoring.ts",
324
+ "src/authoring-import.ts",
324
325
  "src/authoring-model.ts",
325
326
  "src/authoring-platform.ts",
326
327
  "src/authoring-program.ts",
@@ -331,6 +332,8 @@
331
332
  "src/url-intelligence.ts",
332
333
  "src/cli.ts",
333
334
  "src/cli-intro.ts",
335
+ "src/cli-help.ts",
336
+ "src/cli-style.ts",
334
337
  "src/cli-program.ts",
335
338
  "src/clip/acquire.ts",
336
339
  "src/clip/archive-today.ts",
@@ -341,6 +344,7 @@
341
344
  "src/clip/bundle-reader.ts",
342
345
  "src/clip/capture.ts",
343
346
  "src/clip/cli.ts",
347
+ "src/clip/cookie-permission.ts",
344
348
  "src/clip/cookies.ts",
345
349
  "src/clip/doctor.ts",
346
350
  "src/clip/jobs.ts",
@@ -381,7 +385,10 @@
381
385
  "src/evaluation-v2.ts",
382
386
  "src/evaluation.ts",
383
387
  "src/graph.ts",
388
+ "src/mcp-server.ts",
389
+ "src/mcp-tools.ts",
384
390
  "src/mention-index.ts",
391
+ "src/import-supermemory.ts",
385
392
  "src/index.ts",
386
393
  "src/init.ts",
387
394
  "src/navigation.ts",
@@ -430,6 +437,7 @@
430
437
  "src/semantic.ts",
431
438
  "src/serve.ts",
432
439
  "src/sdk.ts",
440
+ "src/selected-passage.ts",
433
441
  "src/source-inbox.ts",
434
442
  "src/untrusted-content.ts",
435
443
  "src/vault.ts",
@@ -480,8 +488,8 @@
480
488
  "check": "bun run check:worker && bun run check:effect && bun run check:workflows && bun run check:portfolio-inventory && bun run check:installed-command-docs && bun run typecheck && bun run build && bun run test:package && bun run test && bun run url-metadata:tool:check",
481
489
  "prepack": "bun run check",
482
490
  "check:effect": "bun run scripts/check-effect-policy.ts",
483
- "kb:search": "bunx --bun --package https://github.com/hraness/wordcell/releases/download/v0.22.5/hraness-wordcell-0.22.5.tgz wordcell search --root kb --mode exact --rerank typesafe --rerank-limit 25",
484
- "kb:search:local": "bunx --bun --package https://github.com/hraness/wordcell/releases/download/v0.22.5/hraness-wordcell-0.22.5.tgz wordcell search --root kb --mode exact",
491
+ "kb:search": "bunx --bun --package https://github.com/hraness/wordcell/releases/download/v0.24.0/hraness-wordcell-0.24.0.tgz wordcell search --root kb --mode exact --selected-passage --rerank typesafe --rerank-limit 25",
492
+ "kb:search:local": "bunx --bun --package https://github.com/hraness/wordcell/releases/download/v0.24.0/hraness-wordcell-0.24.0.tgz wordcell search --root kb --mode exact --selected-passage",
485
493
  "check:worker": "tsc -p worker/tsconfig.json --noEmit"
486
494
  },
487
495
  "dependencies": {
@@ -2,6 +2,7 @@
2
2
 
3
3
  - `SKILL.md` – public entrypoint, runtime contract, and intent router for all hraness/wordcell agent workflows.
4
4
  - `references/query.md` – scoped retrieval through exact metadata, hybrid search, graph structure, and Git provenance.
5
+ - `references/session-memory.md` – authored session notes, their relationships, and maintained profile notes with Stable and Recent sections.
5
6
  - `references/customize.md` and `companion-skills.md` – interview-first Wordcell setup, explicit approval boundaries, and contracts for optional recurring rituals.
6
7
  - `references/save-url.md`, `url-authentication.md`, and `url-platforms.md` – auditable web capture, signed-in source handling, and platform-specific completeness boundaries.
7
8
  - `references/save-pdf.md` and `pdf-review.md` – PDF ingestion, OCR, image evidence, and mixed-media review.
@@ -7,7 +7,8 @@ description: >-
7
7
  repository context, plans, decisions, concepts, backlinks, semantic search,
8
8
  or Git provenance from an earlier coding session; save, clip, scrape, or
9
9
  archive a URL, article, social thread, signed-in browser page, or PDF as
10
- auditable Markdown; create or update a durable plan in the vault; or refresh,
10
+ auditable Markdown; create or update a durable plan in the vault; save or
11
+ remember a conversation as a session note or keep a profile note; or refresh,
11
12
  check, percolate, and maintain its knowledge graph. Do not use for generic
12
13
  web research, generic PDF reading, or ordinary planning that will not use a
13
14
  hraness/wordcell vault.
@@ -29,7 +30,8 @@ selected.
29
30
  | User intent | Read |
30
31
  | --- | --- |
31
32
  | Design, set up, or evolve a Wordcell; choose its boundaries and conventions; or define a recurring Wordcell ritual | [Customize a Wordcell setup](references/customize.md); add [Companion skill contracts](references/companion-skills.md) only when the proposal includes a new or revised skill |
32
- | 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) |
33
+ | Recover work from an earlier session, read a profile or recall what you remember about the user, 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) |
34
+ | Save or remember this conversation, record a session summary at session end, or create or update a profile of the user or another person, team, or project | [Save session memory and profiles](references/session-memory.md) |
33
35
  | 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 |
34
36
  | 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 |
35
37
  | 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) |
@@ -56,7 +58,7 @@ missing:
56
58
  ```sh
57
59
  command -v wordcell >/dev/null 2>&1 || {
58
60
  command -v bun >/dev/null 2>&1 || exit 1
59
- bun add --global --ignore-scripts https://github.com/hraness/wordcell/releases/download/v0.22.5/hraness-wordcell-0.22.5.tgz
61
+ bun add --global --ignore-scripts https://github.com/hraness/wordcell/releases/download/v0.24.0/hraness-wordcell-0.24.0.tgz
60
62
  }
61
63
  wordcell --help
62
64
  ```
@@ -14,16 +14,47 @@ 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
+ ## Read the profile first
18
+
19
+ When the user asks what you remember about them, asks about their preferences,
20
+ or resumes earlier work, read the profile and the latest session notes before
21
+ searching:
22
+
23
+ ```sh
24
+ wordcell list --root "$KB_ROOT" --where type=profile --json
25
+ wordcell list --root "$KB_ROOT" --where type=session --sort date \
26
+ --order desc --limit 5 --json
27
+ wordcell list --root "$KB_ROOT" --where type=session \
28
+ --scope packages/parser/src/index.ts --json
29
+ ```
30
+
31
+ Read `$KB_ROOT/notes/profile.md` for the vault owner. Treat its Stable section
32
+ as standing context and its Recent section as dated context to confirm.
33
+ `--scope` matches the exact path a session note declares, not a parent
34
+ directory. `--sort date` lists a session note without a `date` field, such as
35
+ one saved over MCP alone, after every dated session, so a `--limit` can hide
36
+ it. When the vault may hold such notes, list sessions again without `--sort`
37
+ or `--limit`.
38
+
39
+ Over the local MCP server that `wordcell mcp --root "$KB_ROOT"` starts, call
40
+ `list_notes` with
41
+ `"where": [{"path": "type", "value": "profile"}]`, then `get_note`. For recent
42
+ sessions, pass `"where": [{"path": "type", "value": "session"}]`,
43
+ `"sort": "metadata.date"`, and `"order": "desc"`.
44
+ [The session-memory guide](session-memory.md) describes how these notes are
45
+ written.
46
+
17
47
  ## Recover a stopped session
18
48
 
19
- When the user asks to resume earlier work, begin with the path being changed.
49
+ When the user asks to resume earlier work, read the profile and recent
50
+ sessions as described above, then continue with the path being changed.
20
51
  Keep each retrieval signal separate so the agent can inspect why a record was
21
52
  returned:
22
53
 
23
54
  ```sh
24
55
  wordcell context packages/parser/src/index.ts --root "$KB_ROOT" --repo "$KB_REPO"
25
56
  wordcell search "why parser retries stop" --root "$KB_ROOT" --mode exact \
26
- --history --repo "$KB_REPO" --json
57
+ --selected-passage --history --repo "$KB_REPO" --json
27
58
  wordcell backlinks notes/parser-contract --root "$KB_ROOT" --json
28
59
  wordcell history notes/parser-contract --root "$KB_ROOT" \
29
60
  --repo "$KB_REPO" --json
@@ -34,6 +65,9 @@ Read the inherited guides and authoritative Markdown returned by these views.
34
65
  Use the backlink to inspect related plans and use Git history as provenance,
35
66
  not as proof that the note remains correct. This workflow recovers only context
36
67
  that was persisted in files or Git; it does not reconstruct private chat.
68
+ `wordcell context` does not list `type: session` or `type: profile` notes, so
69
+ read them with the commands under
70
+ [Read the profile first](#read-the-profile-first).
37
71
 
38
72
  ## Choose the retrieval lane
39
73
 
@@ -46,7 +80,7 @@ that was persisted in files or Git; it does not reconstruct private chat.
46
80
  resolve note identities before returning authored relationships.
47
81
  - A whole-vault structural question or relationship audit: use `wordcell graph --json`,
48
82
  then inspect the smallest relevant portion of its canonical output.
49
- - A phrase, identity, or concept expressed with different vocabulary: use `wordcell search`, whose default hybrid result preserves exact and QMD evidence separately.
83
+ - A phrase, identity, or concept expressed with different vocabulary: use `wordcell search`, whose default hybrid result preserves exact and QMD evidence separately. Add `--selected-passage` when you will read, quote, or act on results: each hit then carries the note's best-matching excerpt with its line range and section headings.
50
84
  - Direct provenance for one note or repository path: use `wordcell history` or
51
85
  `wordcell history search` without changing authored metadata or links.
52
86
  - Recent captures awaiting maintained disposition: use the advisory `wordcell inbox` view.
@@ -62,7 +96,7 @@ wordcell backlinks "Plan title or path" --root "$KB_ROOT" --json
62
96
  wordcell links "Plan title or path" --root "$KB_ROOT" --direction both --depth 1 --limit 25 --json
63
97
  wordcell relation list "Plan title or path" --root "$KB_ROOT" --json
64
98
  wordcell graph --root "$KB_ROOT" --json
65
- wordcell search "why browser capture uses the current tab" --root "$KB_ROOT" --json
99
+ wordcell search "why browser capture uses the current tab" --root "$KB_ROOT" --selected-passage --json
66
100
  wordcell search "accepted ingestion plans" --root "$KB_ROOT" --where type=plan --where status=accepted --tag ingestion --json
67
101
  wordcell search "notes/write-path" --root "$KB_ROOT" --mode exact --no-history --json
68
102
  wordcell history "notes/write-path" --root "$KB_ROOT" --repo "$KB_REPO" --json
@@ -177,6 +211,20 @@ For a repository's ordinary KB searches, prefer its approved, pinned
177
211
  choice. Read returned notes before acting; model probabilities are ranking
178
212
  signals, not proof of truth. Explicit priority rules still run last.
179
213
 
214
+ Add `--selected-passage` to attach one source excerpt to each returned note.
215
+ Wordcell chooses it locally, without model calls: the paragraph, or window of
216
+ at most 512 UTF-8 bytes, that contains the most distinct query words, outside
217
+ frontmatter. The excerpt is unedited note text with its byte offsets, line
218
+ range, the SHA-256 of the note text, and the enclosing Markdown headings as
219
+ separate spans. Offsets count from the start of the note text, after any
220
+ byte-order mark. Ranking, scores, the `snippet` field, and reranker input do not
221
+ change. A note without matching body text reports `status: "none"`; a note
222
+ past a size limit reports `status: "unavailable"` with a reason. Both keep
223
+ their snippet. Terminal output shows CRLF as LF and tabs as four spaces, and
224
+ reports `display-sanitized` instead of an excerpt that credential redaction
225
+ would alter. An excerpt shows where query words appear; it is not a verified
226
+ answer. SDK and MCP `search` callers pass `selectedPassage: true`.
227
+
180
228
  `wordcell history <note>` returns the bounded commit history already associated with
181
229
  one resolved note. `wordcell history search <query-or-path>` searches the bounded Git
182
230
  projection directly and retains hashes, subjects, matched paths, co-change
@@ -0,0 +1,207 @@
1
+ # Save session memory and profiles
2
+
3
+ Save what a conversation settled as an ordinary `type: session` note, link it
4
+ to the notes it changed, and keep a maintained `type: profile` note. You write
5
+ every note and relationship, on request or at a session close that the user or
6
+ the vault's instructions ask for. Wordcell extracts no facts and writes no note
7
+ on its own.
8
+
9
+ ## Locate the vault
10
+
11
+ - Resolve `KB_ROOT` and `KB_REPO` as in [the query guide](query.md), then read
12
+ the vault's applicable agent instructions and note conventions.
13
+ - Pass the resolved path to every `--root`.
14
+ - `note create --body-file -` reads the body from standard input, and
15
+ `--body-file <path>` reads it from a file.
16
+ - Write each body file outside the vault, for example under `${TMPDIR:-/tmp}`,
17
+ and delete it after `note create`. A Markdown file left in the vault becomes
18
+ a note at the next refresh.
19
+
20
+ ## Decide what to keep
21
+
22
+ - Keep the outcome, each decision and who made it, open threads, the
23
+ repository paths touched, and the notes or plans the session changed.
24
+ - Leave out the raw transcript unless the user asks for it. Also leave out tool
25
+ logs, secrets, credentials, and guesses nobody confirmed.
26
+ - Quote the user only when the exact wording matters.
27
+ - Write one session note per working session. When the same session continues,
28
+ update its note as described under [Update a note](#update-a-note).
29
+
30
+ ## Write the session note
31
+
32
+ 1. List recent sessions, and update the note this session continues instead of
33
+ creating another:
34
+
35
+ ```sh
36
+ wordcell list --root "$KB_ROOT" --where type=session --sort date \
37
+ --order desc --limit 5 --json
38
+ ```
39
+
40
+ 2. Choose the ID `notes/sessions/<YYYY-MM-DD>-<topic>` and the title
41
+ `Session <YYYY-MM-DD>: <topic>`. When another session holds that ID, choose
42
+ a distinct topic or add a suffix such as `-2`, and link the earlier note with
43
+ `continues` when both belong to one thread. `note create` refuses an
44
+ existing ID whose body differs.
45
+ 3. Create the directory, because `note create` does not create directories:
46
+
47
+ ```sh
48
+ mkdir -p "$KB_ROOT/notes/sessions"
49
+ ```
50
+
51
+ 4. Write the body file with these sections, and link each note the session
52
+ changed:
53
+
54
+ ```md
55
+ # Session 2026-09-26: bound parser retries
56
+
57
+ ## Outcome
58
+
59
+ - `src/parser.ts` stops after three attempts.
60
+ - [[notes/parser-retries|Parser retries]] records the new bound.
61
+
62
+ ## Decisions
63
+
64
+ - Three attempts, confirmed by the user.
65
+
66
+ ## Open threads
67
+
68
+ - Whether the backoff needs jitter.
69
+ ```
70
+
71
+ 5. Create the note from the body file, or pipe the body with `--body-file -`:
72
+
73
+ ```sh
74
+ wordcell note create notes/sessions/2026-09-26-bound-parser-retries \
75
+ --root "$KB_ROOT" --title "Session 2026-09-26: bound parser retries" \
76
+ --type session --body-file "${TMPDIR:-/tmp}/session.md"
77
+ ```
78
+
79
+ 6. Edit the frontmatter. Directly after `type: session`, add the date and each
80
+ exact repository-relative file or directory path the session touched,
81
+ without globs:
82
+
83
+ ```yaml
84
+ type: session
85
+ date: 2026-09-26
86
+ repository_scopes:
87
+ - src/parser.ts
88
+ ```
89
+
90
+ Declare at most 16 paths, with no duplicates and no two paths that differ only
91
+ by case. A longer list gets only a check advisory, and `--scope` stops
92
+ returning the note. When the session touched more, keep the paths a later
93
+ reader will ask about, or declare a directory they share. `--scope` then
94
+ matches that directory's path, not the files in it. Omit `repository_scopes`
95
+ when the session touched no repository path.
96
+
97
+ `wordcell list --scope` matches a declared path exactly, and `wordcell context`
98
+ does not list session or profile notes, so recall them with `wordcell list` as
99
+ [the query guide](query.md#read-the-profile-first) describes. Do not tag every
100
+ session `session`. The type is the query surface, and a tag that every session
101
+ shares makes percolate propose a concept note for it.
102
+
103
+ Over MCP, `create_note` with `"type": "session"` takes the ID, title, and body.
104
+ It cannot set `date` or `repository_scopes`, and it does not create
105
+ directories. Without file access, keep the date in the title, list the paths
106
+ under Outcome, and use `notes/session-<YYYY-MM-DD>-<topic>` when
107
+ `notes/sessions/` is missing. Without those two fields, `--sort date` lists the
108
+ note after every dated session and `--scope` never returns it. Add both fields
109
+ the next time you have file access.
110
+
111
+ ## Update a note
112
+
113
+ Update a session or profile note in one of two ways:
114
+
115
+ - Edit the file, then refresh and check as described under [Finish](#finish).
116
+ - Over MCP, call `get_note`, then `update_note_body` with the `revision` it
117
+ returned as `expected_revision`. On a revision conflict, call `get_note`
118
+ again and merge your change into the current body. When `get_note` reports
119
+ `truncated: true`, edit the file instead. A server started with
120
+ `--read-only` has no write tools.
121
+
122
+ ## Link the session
123
+
124
+ Write each relationship from the session note. Never add the reverse edge to
125
+ the target.
126
+
127
+ ```sh
128
+ wordcell relation add notes/sessions/2026-09-26-bound-parser-retries \
129
+ updates notes/parser-retries --root "$KB_ROOT"
130
+ ```
131
+
132
+ - `updates`: the session changed that note or plan.
133
+ - `informed-by`: the session relied on that note without changing it.
134
+ - `continues`: the target is an earlier session on the same thread.
135
+
136
+ The MCP `add_relation` tool takes the same source, predicate, and target.
137
+
138
+ ## Review percolation before replacing a claim
139
+
140
+ ```sh
141
+ wordcell percolate notes/sessions/2026-09-26-bound-parser-retries \
142
+ --root "$KB_ROOT" --limit 25 --json
143
+ ```
144
+
145
+ Open the cited notes before acting on a candidate. Add `supersedes` or
146
+ `contradicts` only when the new note's prose establishes the replacement or
147
+ the conflict. When a maintained note is the current account, update it in place
148
+ instead of recording a replacement.
149
+
150
+ ## Keep a profile note
151
+
152
+ Look for existing profiles first, and read one as
153
+ [the query guide](query.md#read-the-profile-first) describes:
154
+
155
+ ```sh
156
+ wordcell list --root "$KB_ROOT" --where type=profile --json
157
+ ```
158
+
159
+ Update the profile that listing returns for the person, team, or project, as
160
+ described under [Update a note](#update-a-note). When none exists, create
161
+ `notes/profile` for the vault owner, or `notes/profile-<entity>` for anyone
162
+ else:
163
+
164
+ ```md
165
+ # Profile
166
+
167
+ ## Stable
168
+
169
+ - Uses Bun for tests.
170
+
171
+ ## Recent
172
+
173
+ - 2026-09-26: capped [[notes/parser-retries|parser retries]] at three attempts
174
+ ([[notes/sessions/2026-09-26-bound-parser-retries]]).
175
+ ```
176
+
177
+ - Put role, preferences, environment, and standing decisions under Stable.
178
+ Put dated items under Recent, each linking the session that established it.
179
+ - Move a Recent item to Stable once it keeps holding. Delete items that stop
180
+ applying; Git keeps the history.
181
+ - Record only what the person stated or confirmed. Ask before recording
182
+ sensitive personal details.
183
+
184
+ Create the profile the same way as a session note:
185
+
186
+ ```sh
187
+ wordcell note create notes/profile --root "$KB_ROOT" --title Profile \
188
+ --type profile --body-file "${TMPDIR:-/tmp}/profile.md"
189
+ ```
190
+
191
+ ## Finish
192
+
193
+ ```sh
194
+ wordcell refresh --root "$KB_ROOT"
195
+ wordcell check --root "$KB_ROOT" --repo "$KB_REPO"
196
+ ```
197
+
198
+ - Check names an absent repository path in an advisory only for current
199
+ records, such as maintained notes and active plans. For session notes it only
200
+ counts absent paths in its `Repository scopes:` summary line, so compare that
201
+ count with the paths you declared. Neither changes the exit code.
202
+ - In parallel edit lanes, run `wordcell check --root "$KB_ROOT" --no-catalog`
203
+ and leave the refresh to the integrating agent.
204
+ - The MCP tools cannot run percolate, refresh, or check. Over MCP alone, add no
205
+ `supersedes` or `contradicts` relation, and ask the user to run
206
+ `wordcell refresh` and then `wordcell check` from the CLI, because an MCP
207
+ write leaves a managed catalog stale.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Internal Promise facades for importers that own frontmatter fields.
3
+ *
4
+ * They match `createNote` and `updateNoteBody` in `authoring.ts`, plus the
5
+ * internal `fields` parameter, which the public facades do not expose. Each
6
+ * call enters one finite authoring runtime.
7
+ */
8
+ import type {
9
+ AuthoringOptions,
10
+ CreateNoteInput,
11
+ FrontmatterFields,
12
+ FrontmatterFieldUpdates,
13
+ NoteAuthoringResult,
14
+ UpdateNoteBodyOptions,
15
+ } from "./authoring-model.js";
16
+ import { nativeAuthoringPlatform } from "./authoring-platform.js";
17
+ import { createNoteProgram, updateNoteBodyProgram } from "./authoring-program.js";
18
+ import { runAuthoring } from "./authoring-runtime.js";
19
+
20
+ /** Create a note whose frontmatter also carries `fields` after `title` and `tags`. */
21
+ export async function createNoteWithFields(
22
+ root: string, input: CreateNoteInput, options: AuthoringOptions, fields: FrontmatterFields,
23
+ ): Promise<NoteAuthoringResult> {
24
+ return runAuthoring(createNoteProgram(nativeAuthoringPlatform, root, input, options, fields));
25
+ }
26
+
27
+ /** Replace a note body and set or delete top-level `fields` in the same revision-checked write. */
28
+ export async function updateNoteBodyWithFields(
29
+ root: string, id: string, body: string, options: UpdateNoteBodyOptions, fields: FrontmatterFieldUpdates,
30
+ ): Promise<NoteAuthoringResult> {
31
+ return runAuthoring(updateNoteBodyProgram(nativeAuthoringPlatform, root, id, body, options, fields));
32
+ }