notesoup 0.60.1 → 0.61.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 (40) hide show
  1. package/README.md +5 -4
  2. package/dist/src/boot/render.d.ts +5 -0
  3. package/dist/src/boot/render.js +48 -19
  4. package/dist/src/boot/text.d.ts +1 -3
  5. package/dist/src/boot/text.js +10 -11
  6. package/dist/src/budget/text.d.ts +1 -1
  7. package/dist/src/budget/text.js +1 -1
  8. package/dist/src/notes/errors.d.ts +1 -1
  9. package/dist/src/notes/frontmatter.d.ts +6 -0
  10. package/dist/src/notes/frontmatter.js +17 -1
  11. package/dist/src/notes/policy.js +1 -1
  12. package/dist/src/notes/store.d.ts +2 -0
  13. package/dist/src/notes/store.js +30 -5
  14. package/dist/src/tools/dream.d.ts +2 -0
  15. package/dist/src/tools/notes.d.ts +10 -0
  16. package/dist/src/tools/notes.js +14 -8
  17. package/dist/test/host-neutral.test.js +1 -1
  18. package/dist/test/note-policy.test.js +122 -8
  19. package/docs/dsh.md +2 -2
  20. package/docs/notes-library.md +4 -4
  21. package/docs/reset-lifecycle.md +1 -1
  22. package/docs/tool-results.md +1 -1
  23. package/package.json +1 -1
  24. package/playbook.md +3 -3
  25. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  26. package/plugins/claude/dist/claude/helper.js +100 -45
  27. package/plugins/claude/playbook.md +3 -3
  28. package/plugins/claude/skills/dream/SKILL.md +2 -2
  29. package/plugins/claude/skills/memory/SKILL.md +1 -1
  30. package/plugins/codex/dist/codex/notesoup.js +99 -44
  31. package/skills/dream/SKILL.md +2 -2
  32. package/skills/memory/SKILL.md +1 -1
  33. package/src/boot/render.ts +48 -17
  34. package/src/boot/text.ts +10 -11
  35. package/src/budget/text.ts +1 -1
  36. package/src/notes/errors.ts +1 -1
  37. package/src/notes/frontmatter.ts +19 -1
  38. package/src/notes/policy.ts +1 -1
  39. package/src/notes/store.ts +25 -7
  40. package/src/tools/notes.ts +14 -8
@@ -22,7 +22,7 @@ function data(outcome) {
22
22
  const refused = (code) => (error) => error instanceof NoteError && error.code === code;
23
23
  async function fillPins(notes, prefix = "") {
24
24
  for (const name of ["CHEATSHEET.md", "MAP.md", "one.md", "two.md", "three.md"]) {
25
- await notes.write(`${prefix}${name}`, `body ${name}`, ["CHEATSHEET.md", "MAP.md"].includes(name) ? {} : { pinned: true });
25
+ await notes.write(`${prefix}${name}`, `body ${name}`, { pinned: true });
26
26
  }
27
27
  }
28
28
  async function boot(identity) {
@@ -37,7 +37,8 @@ test("frontmatter policy round-trips without materializing defaults; arbitrary e
37
37
  await notes.write("MAP", "index");
38
38
  const defaults = (await notes.read("MAP")).meta;
39
39
  assert.equal(defaults.pinned, undefined);
40
- assert.deepEqual(effectiveNotePolicy(defaults, "MAP.md"), { pinned: true, budget: 2048, readonly: false });
40
+ assert.deepEqual(effectiveNotePolicy(defaults, "MAP.md"), { pinned: false, budget: 4096, readonly: false });
41
+ assert.deepEqual(effectiveNotePolicy(defaults, "CHEATSHEET.md"), { pinned: true, budget: 2048, readonly: false });
41
42
  assert.equal(effectiveNotePolicy(defaults, "nested/MAP.md").pinned, false);
42
43
  writeFileSync(file("MAP.md"), readFileSync(file("MAP.md"), "utf8").replace("\n---\n\n", "\npinned: false\nbudget: 3000\nreadonly: true\ncustom: {\"nested\":[1,\"two\"]}\n---\n\n"));
43
44
  const meta = (await notes.read("MAP")).meta;
@@ -53,7 +54,7 @@ test("frontmatter policy round-trips without materializing defaults; arbitrary e
53
54
  test("default budgets distinguish root index pages from ordinary notes, independently of pinning", async (t) => {
54
55
  const { context, notes } = fixture(t);
55
56
  for (const [address, budget, pinned] of [
56
- ["MAP", 2048, false],
57
+ ["MAP", 4096, undefined],
57
58
  ["CHEATSHEET", 2048, undefined],
58
59
  ["ordinary", 4096, undefined],
59
60
  ["custom-pin", 4096, true],
@@ -206,8 +207,8 @@ test("pin admission serializes across store instances without blocking reads or
206
207
  });
207
208
  test("moves resolve absent policy at the new path, preserving explicit false/true", async (t) => {
208
209
  const { notes, file } = fixture(t);
209
- await notes.write("MAP", "default");
210
- await notes.rename("MAP", "ordinary");
210
+ await notes.write("CHEATSHEET", "default");
211
+ await notes.rename("CHEATSHEET", "ordinary");
211
212
  assert.deepEqual(effectiveNotePolicy((await notes.read("ordinary")).meta, "ordinary.md"), { pinned: false, budget: 4096, readonly: false });
212
213
  await notes.rename("ordinary", "CHEATSHEET");
213
214
  assert.equal(effectiveNotePolicy((await notes.read("CHEATSHEET")).meta, "CHEATSHEET.md").pinned, true);
@@ -219,10 +220,10 @@ test("moves resolve absent policy at the new path, preserving explicit false/tru
219
220
  for (let n = 0; n < 4; n++)
220
221
  await notes.write(`extra-${n}`, "pin", { pinned: true });
221
222
  await notes.write("candidate", "candidate");
222
- await assert.rejects(() => notes.rename("candidate", "MAP"), refused("pin_limit"));
223
+ await assert.rejects(() => notes.rename("candidate", "CHEATSHEET"), refused("pin_limit"));
223
224
  assert.equal((await notes.read("candidate")).body, "candidate");
224
- await notes.update("candidate", undefined, { renameTo: "MAP", pinned: false });
225
- assert.equal(effectiveNotePolicy((await notes.read("MAP")).meta, "MAP.md").pinned, false);
225
+ await notes.update("candidate", undefined, { renameTo: "CHEATSHEET", pinned: false });
226
+ assert.equal(effectiveNotePolicy((await notes.read("CHEATSHEET")).meta, "CHEATSHEET.md").pinned, false);
226
227
  });
227
228
  test("boot uses metadata pins, full bodies, explicit false and visible legacy over-cap omissions", async (t) => {
228
229
  const { identity, notes, file } = fixture(t);
@@ -248,3 +249,116 @@ test("boot uses metadata pins, full bodies, explicit false and visible legacy ov
248
249
  assert.equal(rendered.includes("OMITTED_PIN_BODY"), false);
249
250
  assert.ok(rendered.includes("TAIL_IS_HERE"));
250
251
  });
252
+ test("MAP.md is an ordinary note by default while CHEATSHEET.md stays the one default pin", async (t) => {
253
+ const { notes, context } = fixture(t);
254
+ await notes.write("MAP", "legacy hand-written index");
255
+ await notes.write("CHEATSHEET", "rules");
256
+ const map = (await notes.read("MAP")).meta;
257
+ const cheatsheet = (await notes.read("CHEATSHEET")).meta;
258
+ assert.deepEqual(effectiveNotePolicy(map, "MAP.md"), { pinned: false, budget: 4096, readonly: false });
259
+ assert.deepEqual(effectiveNotePolicy(cheatsheet, "CHEATSHEET.md"), { pinned: true, budget: 2048, readonly: false });
260
+ await notes.rename("MAP", "moved-map");
261
+ assert.deepEqual(effectiveNotePolicy((await notes.read("moved-map")).meta, "moved-map.md"), { pinned: false, budget: 4096, readonly: false });
262
+ const listed = data(await notesList.execute({}, context));
263
+ assert.equal(listed.files.find(file => file.address === "CHEATSHEET.md")?.pinned, true);
264
+ assert.equal(listed.files.find(file => file.address === "moved-map.md")?.pinned, false, "MAP.md keeps no special role after a move");
265
+ });
266
+ test("description normalizes to one line, persists, renders in read and list, and clears on empty", async (t) => {
267
+ const { notes, file, context } = fixture(t);
268
+ const written = await notesWrite.execute({ address: "described", content: "body", description: " first\n\tsecond third " }, context);
269
+ assert.equal(written.ok, true);
270
+ assert.equal((await notes.read("described")).meta.description, "first second third");
271
+ assert.match(readFileSync(file("described.md"), "utf8"), /^description: "first second third"$/m);
272
+ const read = data(await notesRead.execute({ address: "described" }, context));
273
+ assert.equal(read.metadata.description, "first second third");
274
+ assert.equal("description" in read.metadata.extra, false, "description is normalized metadata, not an extra");
275
+ assert.match(notesRead.render(await notesRead.execute({ address: "described" }, context)), /description first second third/);
276
+ const listed = data(await notesList.execute({}, context));
277
+ assert.equal(listed.files.find(file => file.address === "described.md")?.description, "first second third");
278
+ assert.match(notesList.render(await notesList.execute({}, context)), /described\.md — first second third/);
279
+ // Omitting description on an edit keeps it; providing the same one is a valid no-op.
280
+ await notes.update("described", [{ oldText: "body", newText: "body two" }]);
281
+ assert.equal((await notes.read("described")).meta.description, "first second third");
282
+ const unchanged = data(await notesUpdate.execute({ address: "described", description: "first second third" }, context));
283
+ assert.equal(unchanged.change_kind, "none");
284
+ const changed = data(await notesUpdate.execute({ address: "described", description: "now this" }, context));
285
+ assert.equal(changed.change_kind, "metadata", "description alone is an operation");
286
+ assert.equal((await notes.read("described")).meta.description, "now this");
287
+ // An empty value clears the key; a whitespace-only value is empty too.
288
+ await notesUpdate.execute({ address: "described", description: " \n\t " }, context);
289
+ assert.equal((await notes.read("described")).meta.description, undefined);
290
+ assert.equal(/^description:/m.test(readFileSync(file("described.md"), "utf8")), false);
291
+ // Exactly 160 code points is accepted; 161 is refused naming the count and the limit.
292
+ await notes.write("max", "body", { description: "😀".repeat(160) });
293
+ assert.equal((await notes.read("max")).meta.description, "😀".repeat(160), "160 astral code points fit");
294
+ const tooLong = "😀".repeat(161);
295
+ for (const attempt of [
296
+ () => notesWrite.execute({ address: "too-long", content: "body", description: tooLong }, context),
297
+ () => notesUpdate.execute({ address: "described", description: tooLong }, context),
298
+ ]) {
299
+ const refusal = await attempt();
300
+ assert.equal(refusal.ok, false);
301
+ if (!refusal.ok) {
302
+ assert.equal(refusal.error.code, "invalid_description");
303
+ assert.match(refusal.error.message, /161 characters; limit is 160/);
304
+ }
305
+ }
306
+ assert.equal((await notes.read("too-long")), undefined, "a refused write saves nothing");
307
+ assert.equal((await notes.read("described")).meta.description, undefined, "a refused update leaves the note alone");
308
+ });
309
+ test("boot auto-indexes unpinned notes newest first with description, fallback title, and pinned/crumpled omissions", async (t) => {
310
+ const { identity, notes } = fixture(t);
311
+ await notes.write("CHEATSHEET", "rules");
312
+ await notes.write("described", "body", { description: "when to open this" });
313
+ await notes.write("heading", "# Heading title\nbody");
314
+ await notes.write("plain", "first line only\nsecond line");
315
+ await notes.write("hidden", "PINNED_BODY", { pinned: true });
316
+ await notes.write("gone", "CRUMPLED_BODY");
317
+ await notes.update("gone", undefined, { crumpled: true });
318
+ const rendered = await boot(identity);
319
+ assert.equal(rendered.includes("recent"), false, "the old recent label is gone");
320
+ assert.match(rendered, /^notes$/m, "the index follows pinned pages under one subheader");
321
+ assert.match(rendered, / {2}plain\.md · just now — first line only/);
322
+ assert.match(rendered, / {2}heading\.md · just now — Heading title/);
323
+ assert.match(rendered, / {2}described\.md · just now — when to open this/);
324
+ assert.ok(rendered.indexOf("plain.md ·") < rendered.indexOf("heading.md ·"), "newest unpinned note leads");
325
+ assert.ok(rendered.indexOf("heading.md ·") < rendered.indexOf("described.md ·"));
326
+ assert.equal(rendered.includes("hidden.md ·"), false, "pinned pages do not repeat in the index");
327
+ assert.equal(rendered.includes("gone.md ·"), false, "crumpled pages do not index");
328
+ assert.equal(rendered.includes("PINNED_BODY"), true, "pinned pages still load whole");
329
+ assert.equal(rendered.includes("CRUMPLED_BODY"), false);
330
+ // A shelf with no pinned pages drops the redundant subheader and still indexes.
331
+ await notes.update("CHEATSHEET", undefined, { pinned: false, crumpled: true });
332
+ await notes.update("hidden", undefined, { crumpled: true });
333
+ const bare = await boot(identity);
334
+ assert.equal(/^notes$/m.test(bare), false);
335
+ assert.match(bare, / {2}plain\.md · just now — first line only/);
336
+ });
337
+ test("boot shelf index enforces entry and character caps with an explicit omission marker", async (t) => {
338
+ const { identity, notes } = fixture(t);
339
+ for (let index = 0; index < 26; index++)
340
+ await notes.write(`bulk-${index}`, "body", { description: "d" });
341
+ const entries = await boot(identity);
342
+ assert.equal(entries.split(" · just now — d").length - 1, 25, "only 25 entries fit");
343
+ assert.match(entries, / {2}… and 1 more \(use notes_list\)/);
344
+ assert.equal(entries.includes("bulk-0.md ·"), false, "the oldest entry is the one left out");
345
+ const wide = fixture(t);
346
+ for (let index = 0; index < 25; index++)
347
+ await wide.notes.write(`big-${index}`, "body", { description: `${index}`.padStart(2, "0") + "x".repeat(158) });
348
+ const capped = await boot(wide.identity);
349
+ const shown = capped.split("big-").length - 1;
350
+ assert.ok(shown > 0 && shown < 25, `the character cap cuts the list (${shown} shown)`);
351
+ assert.match(capped, /… and \d+ more \(use notes_list\)/);
352
+ assert.equal(capped.includes("big-00.md ·"), false, "the oldest page falls past the character cap");
353
+ });
354
+ test("a hand-edited oversized description never breaks boot and is cut for display", async (t) => {
355
+ const { identity, notes, file } = fixture(t);
356
+ await notes.write("long", "body");
357
+ const oversized = "z".repeat(200);
358
+ writeFileSync(file("long.md"), readFileSync(file("long.md"), "utf8").replace("\n---\n\n", `\ndescription: ${oversized}\n---\n\n`));
359
+ const snapshot = await loadNotesSnapshot(identity, Date.now());
360
+ assert.equal(snapshot.namespaces.get("session")?.find(row => row.path === "long.md")?.meta.description, oversized, "reads tolerate a hand-edited oversize value");
361
+ const rendered = await boot(identity);
362
+ assert.ok(rendered.includes(`${"z".repeat(160)}…`), "display truncates at 160 code points");
363
+ assert.equal(rendered.includes(oversized), false);
364
+ });
package/docs/dsh.md CHANGED
@@ -10,7 +10,7 @@ On load and before requests, preflight probes `systemPrompt.section`, `tools.reg
10
10
 
11
11
  ## Notes, boot and history
12
12
 
13
- `notesHome` defaults to `~/.agents/notes`; `agentName` defaults to `dsh`. The filesystem layout and addressing match Pi and Claude: bare paths are session notes, with `@project`, `@human`, `@self`, and `@model` durable notebooks. Project identity uses the shared `resolveProjectNamespace(cwd, notesHome)` resolver: readable slug notebooks with a `.project` marker, including repository/worktree and origin identity. Other marked projects are readable through `@projects/<name>/`; named-notebook reads do not update access metadata and named-notebook writes are refused. Receipts, boot protocol (including separate CHEATSHEET.md and MAP.md pages), and bounds come from the shared modules, not dsh copies. A model change changes subsequent tools' `@model` identity; the boot remains frozen until reset.
13
+ `notesHome` defaults to `~/.agents/notes`; `agentName` defaults to `dsh`. The filesystem layout and addressing match Pi and Claude: bare paths are session notes, with `@project`, `@human`, `@self`, and `@model` durable notebooks. Project identity uses the shared `resolveProjectNamespace(cwd, notesHome)` resolver: readable slug notebooks with a `.project` marker, including repository/worktree and origin identity. Other marked projects are readable through `@projects/<name>/`; named-notebook reads do not update access metadata and named-notebook writes are refused. Receipts, boot protocol (including root CHEATSHEET.md and the auto-generated per-shelf index), and bounds come from the shared modules, not dsh copies. A model change changes subsequent tools' `@model` identity; the boot remains frozen until reset.
14
14
 
15
15
  The boot is a `systemPrompt.section` at order **2450**, with `interpolate: false`. Shared snapshot/render functions read the five notebooks once, using a captured timestamp. Rendering is deterministic for those inputs. A `plugin:notesoup/window` record stores the ordinal, id, timestamp, digest and exact boot text. `agent/created` adopts it before the first assembly. Notes written later appear in the next window's boot. Missing records reconstruct from the notesoup compact checkpoint, or from the marked root system section. Neither path rereads notes or regenerates a summary. Records are informational; checkpoints control the model surface.
16
16
 
@@ -47,7 +47,7 @@ The reminder and close-out warning go through `agent.steer`. Close-out remains a
47
47
  | dsh versions | Tested against **0.2.1-alpha.2**. Capability checks do not establish wire or persistence compatibility with every newer preview. Run the scripted tests before upgrading. |
48
48
  | Model calls per reset | **0** auxiliary model calls. The agent's note-writing turns and fresh-window continuation still make ordinary calls. |
49
49
  | Retention | Surface node **0**, one boot/continuation checkpoint, and subsequent messages. An unfinished tool batch postpones reset; no partial tool pairs are discarded. |
50
- | Boot bounds | Up to **5 live pins** and **3 recent notes per notebook**, from the shared policy/renderer. Root CHEATSHEET/MAP default pinned; explicit `pinned:false` overrides. Ordinary pages default to a **4096-code-point advisory budget**; root CHEATSHEET/MAP default to **2048**, adjustable per note. Pinned bodies arrive **whole**, with over-budget warnings instead of truncation; manually over-cap pins are omitted with a visible address list. |
50
+ | Boot bounds | Up to **5 live pins** and a **bounded auto-generated per-shelf index** (up to 25 unpinned notes / 4096 chars per notebook), from the shared policy/renderer. Root `CHEATSHEET.md` defaults pinned; explicit `pinned:false` overrides. Ordinary pages default to a **4096-code-point advisory budget**; root `CHEATSHEET.md` defaults to **2048**, adjustable per note. Pinned bodies arrive **whole**, with over-budget warnings instead of truncation; manually over-cap pins are omitted with a visible address list. |
51
51
  | Tool output | Shared **32 KiB** bounds; use `next_offset_chars`, history cursors, or narrower filters. There is no unbounded hidden result. |
52
52
  | Warning timing | Steering enters the next step; a large current response/tool batch can spend the runway. The hard reserve protects the next balanced boundary, not an in-flight provider call. |
53
53
  | Unknown capacity | Countdown is **null** and automatic reserve checks skip. Add `models[].contextWindow` to `llm-deepseek`; explicit resets still work. |
@@ -55,12 +55,12 @@ A new notebook is staged under the notes home and renamed into `project/` with i
55
55
 
56
56
  ## Per-note policy
57
57
 
58
- `NoteMeta` has optional `pinned?: boolean`, `budget?: number`, and `readonly?: boolean` fields. Set these in on-disk frontmatter or in write/update options. Values are validated on parse and mutation: booleans must be actual booleans; budget must be a positive safe integer. Invalid values raise `NoteError("invalid_policy", ...)` without saving. Unknown frontmatter remains intact across rewrites. As before, a leading frontmatter block in `write`'s **content** is stripped, not used to set metadata; use the options or edit the on-disk frontmatter instead.
58
+ `NoteMeta` has optional `pinned?: boolean`, `budget?: number`, `readonly?: boolean`, and `description?: string` fields. Set these in on-disk frontmatter or in write/update options. Policy values are validated on parse and mutation: booleans must be actual booleans; budget must be a positive safe integer. Invalid policy values raise `NoteError("invalid_policy", ...)` without saving. `description` collapses whitespace to a single line, clears on empty string, and refuses over 160 Unicode code points with `NoteError("invalid_description", ...)` on write/update. Unknown frontmatter remains intact across rewrites. As before, a leading frontmatter block in `write`'s **content** is stripped, not used to set metadata; use the options or edit the on-disk frontmatter instead.
59
59
 
60
- `effectiveNotePolicy(meta, path)` returns `{ pinned, budget, readonly }` for a notebook-relative Markdown path (`MAP.md`, not an `@` address). This is the shared default resolver used by storage, tools and boot:
60
+ `effectiveNotePolicy(meta, path)` returns `{ pinned, budget, readonly }` for a notebook-relative Markdown path (`CHEATSHEET.md`, not an `@` address). This is the shared default resolver used by storage, tools and boot:
61
61
 
62
- - Ordinary pages have a default budget of **4096 Unicode code points**; root `CHEATSHEET.md` and `MAP.md` default to **2048**, adjustable to any positive safe integer. `warnings` on write/update/rename results report body overflow but do not reject it. Astral characters count once. The separate serialized-file byte limit still applies.
63
- - Only root `CHEATSHEET.md` and `MAP.md` default to pinned; all other paths, including nested files with those names, default false. Explicit false overrides the default. Raw `meta` keeps absent policy fields absent, so implicit defaults are re-evaluated at a move's destination; explicitly set values travel with the note.
62
+ - Ordinary pages have a default budget of **4096 Unicode code points**; root `CHEATSHEET.md` defaults to **2048**, adjustable to any positive safe integer. `warnings` on write/update/rename results report body overflow but do not reject it. Astral characters count once. The separate serialized-file byte limit still applies.
63
+ - Only root `CHEATSHEET.md` defaults to pinned; all other paths, including nested files with that name, default false. Explicit false overrides the default. Raw `meta` keeps absent policy fields absent, so implicit defaults are re-evaluated at a move's destination; explicitly set values travel with the note.
64
64
  - Every physical notebook allows **5 live pins**, including existing default pages. Crumpled pins don't count. New pinning, writes that restore notes, explicit restores, and moves/renames all check admission and refuse with `pin_limit` before mutation if they would add a sixth pin. Same-notebook moves of an already-live pin don't consume another slot. Existing over-cap notes can still be edited, unpinned or crumpled. Boot defensively selects at most five pins, default-page-first then path order, visibly naming omitted pins in a manually over-cap notebook. Pinned bodies are injected whole, with budget warnings rather than truncation.
65
65
  - `readonly: true` is a **soft lock**, not an authorization/security boundary. Existing locked notes refuse changes, overwrite, crumple/restore, rename/move, and dream deletion with `readonly`. Explicit `readonly: false` permits a metadata-only unlock or unlock plus the requested mutation in one call. A new/unlocked note may be written and locked together. Replacing a locked crumpled move target also requires explicit false. Reads/access counters still write, and filesystem edits can bypass the lock.
66
66
 
@@ -64,7 +64,7 @@ After a manual safety reset, `context_with_system` checks the committed boundary
64
64
 
65
65
  Budget reminders are staged once per window at reserve plus reminder margin, then reserve plus warning runway. Hard reserve remains independent. Budget and command warnings use different types. The final budget warning notifies at first provider injection, not durability; early guidance stays UI-silent. Budget drafts are instance-local and discarded on abort, failed turn, transition or window mismatch. Active-window usage and the exact public `SettingsManager` authority determine thresholds.
66
66
 
67
- Pi and Claude use the same budget warning: budget timing, the handoff checklist, note maintenance (including updating and trimming pinned pages, CHEATSHEET.md and MAP.md by default), a warning against large tool outputs, then `empty_brain` and the countdown. Pi's manual warnings replace the budget opening with the `/empty` notice inside `<notesoup:budget_notice>`. Optional command text sits after the closing tag as plain text for the closing model's notes; separate human input during close-out is intercepted and carried, never steered. The first-tier reminder reports the remaining room, explains that notes survive the wipe, asks for updated notes and offers an optional `empty_brain`, warning that it also clears what the model says to the human right before emptying. Pi's fixed system protocol retains its existing pre-reset hints; warnings no longer repeat those or the tool's `last_word` description.
67
+ Pi and Claude use the same budget warning: budget timing, the handoff checklist, note maintenance (including updating and trimming pinned pages, `CHEATSHEET.md` by default, and keeping note descriptions accurate), a warning against large tool outputs, then `empty_brain` and the countdown. Pi's manual warnings replace the budget opening with the `/empty` notice inside `<notesoup:budget_notice>`. Optional command text sits after the closing tag as plain text for the closing model's notes; separate human input during close-out is intercepted and carried, never steered. The first-tier reminder reports the remaining room, explains that notes survive the wipe, asks for updated notes and offers an optional `empty_brain`, warning that it also clears what the model says to the human right before emptying. Pi's fixed system protocol retains its existing pre-reset hints; warnings no longer repeat those or the tool's `last_word` description.
68
68
 
69
69
  `before_agent_start` supplies fixed protocol/maps teaching through the public named system sections, without promoting any note body. The hidden user boot remains the closed per-window identity/notes snapshot. `context_with_system` selects that boot by durable window identity, using Pi's canonical checkpoint projection or legacy slicing, and removes only recognized top-level teaching from older combined boots in the request projection; raw history and note quotations remain unchanged. Missing boot aborts safely instead of exposing raw history. Usage estimates use the same projection decision, and pre-send checks include the complete system/tool state. `/tree` summaries are suppressed when crossing reset branches because native branch summarization bypasses this projection.
70
70
 
@@ -75,7 +75,7 @@ With a non-empty `query`, `context: N` includes up to N events on each side of e
75
75
 
76
76
  A history read can stop anywhere in the event document, including inside serialized arguments; concatenate its verbatim text slices before parsing any arguments.
77
77
 
78
- `notes_write` and `notes_update` accept optional `pinned`, `budget`, and `readonly` policy fields. Their receipts, list/search rows, and read `metadata` expose the effective `pinned`, `budget`, and `readonly` values as structured fields **and visible text**. Successes also carry a `warnings` array (per file for list/search), rendered visibly when a body exceeds its budget: the default is 4096 Unicode code points for ordinary pages and 2048 for root `CHEATSHEET.md` and `MAP.md`, adjustable per note. Overflow saves successfully; boot injects full pinned bodies instead of cutting them. Pi's custom write/update/read renderers show policy and warnings even when collapsed, outside the expandable body/diff and clipped summary. A readonly note refuses mutations with `readonly` until explicitly unlocked with `readonly:false`; this is a soft lock, not security. Pin admission refuses a sixth live pin per notebook with `pin_limit`, including restore/move/rename. Invalid policy fields refuse with `invalid_policy`.
78
+ `notes_write` and `notes_update` accept optional `pinned`, `budget`, `readonly`, and `description` fields. Their receipts, list/search rows, and read `metadata` expose the effective `pinned`, `budget`, and `readonly` values as structured fields **and visible text** (with `description` included on read metadata and list/search rows when present). Successes also carry a `warnings` array (per file for list/search), rendered visibly when a body exceeds its budget: the default is 4096 Unicode code points for ordinary pages and 2048 for root `CHEATSHEET.md`, adjustable per note. Overflow saves successfully; boot injects full pinned bodies instead of cutting them. Pi's custom write/update/read renderers show policy and warnings even when collapsed, outside the expandable body/diff and clipped summary. A readonly note refuses mutations with `readonly` until explicitly unlocked with `readonly:false`; this is a soft lock, not security. Pin admission refuses a sixth live pin per notebook with `pin_limit`, including restore/move/rename. Invalid policy fields refuse with `invalid_policy`; a `description` over 160 Unicode code points refuses with `invalid_description`.
79
79
 
80
80
  A note read reports unrecognized frontmatter under `metadata.extra`; a value too large to carry, or past the verbatim budget, is named in place as `[omitted: too large]` under its key rather than delivered in part, and the value itself stays in the note file. A rename receipt uses `address` for the destination and `rename_from` for the source; it has no duplicate `rename_to` field.
81
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notesoup",
3
- "version": "0.60.1",
3
+ "version": "0.61.0",
4
4
  "type": "module",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
package/playbook.md CHANGED
@@ -22,12 +22,12 @@ Durable notes hold decisions, constraints, and lessons that stay true after the
22
22
 
23
23
  1. **Leave stable notes alone.** Change a note to incorporate new evidence, fix a verified error, retire a stale claim, merge a genuine duplicate, trim diary content, or split an oversized file, not merely to shorten or rephrase it. No change is a valid outcome.
24
24
  2. **Verify only what the proposed change depends on.** Before correcting, retiring, or promoting a conclusion, check the relevant evidence as needed. Do not revalidate every stable note or turn dream into a source-code audit. An unavailable referent is unverified, not proof that it is dead.
25
- 3. **Retire what is no longer true.** When evidence shows a durable note is stale, correct it in place; if nothing true remains, crumple it. Remove or fix its MAP line either way. A note's last access is a hint, not evidence: long-unread notes are candidates to check, not to crumple on sight. `dream_begin` lists each note's last access; reads during a dream leave no stamp, so reviewing a note does not make it look fresh.
25
+ 3. **Retire what is no longer true.** When evidence shows a durable note is stale, correct it in place; if nothing true remains, crumple it. Fix its `description` either way. A note's last access is a hint, not evidence: long-unread notes are candidates to check, not to crumple on sight. `dream_begin` lists each note's last access; reads during a dream leave no stamp, so reviewing a note does not make it look fresh.
26
26
  4. **Merge only genuine duplicates.** Merge two notes only when they share a topic and kind (checkpoint, design, log). First carry every fact, condition, and exception unique to the absorbed note into the survivor, then crumple the absorbed note. Otherwise keep both and record any unresolved conflict.
27
- 5. **Relocate misfiled notes.** When a standing ruling or the note's own MAP already names its proper notebook, move it there, preserving its metadata, and update both notebooks' maps. Do it, don't propose it. Propose only when the destination notebook itself is unclear.
27
+ 5. **Relocate misfiled notes.** When a standing ruling or the note's own `description` already names its proper notebook, move it there, preserving its metadata, and keep its `description` true. Do it, don't propose it. Propose only when the destination notebook itself is unclear.
28
28
  6. **Preserve meaning and provenance.** Keep facts, conditions, exceptions, uncertainty, authorship, and sources. When promoting a finding, cite its source. Do not relabel agent-authored material as human-authored. If its destination or authority is unclear, propose the promotion instead.
29
29
  7. **Keep notes manageable.** Aim below about 200 lines / 8KB per note. Split oversized notes by topic with one-line cross-links.
30
- 8. **Keep wake-up pages useful.** Each writable notebook's `CHEATSHEET.md` holds standing reminders, kept to five lines. Its `MAP.md` holds only the note index: durable notes' addresses and short gists. Both default to pinned and load every window when live unless explicitly unpinned; do not create empty pages. Each notebook allows five live pins. Ordinary pages default to a 4096-code-point advisory budget (2048 for root `CHEATSHEET.md` and `MAP.md`), adjustable per note; overflow warns without truncating a pinned body. Preserve standing rules, add promoted notes to the map, and drop entries that no longer hold.
30
+ 8. **Keep wake-up pages useful.** Each writable notebook's `CHEATSHEET.md` holds standing reminders, kept to five lines; it is the one default-pinned page and loads every window when live unless explicitly unpinned. Every durable note gets a one-line `description` (max 160 characters) saying what it holds and when to open it — boot lists each notebook's unpinned notes newest first from these, so a missing, stale, or vague description hides the page. A hand-written `MAP.md` is an ordinary note now; once its lines live in `description`s, crumple it. Do not create empty pages. Each notebook allows five live pins. Ordinary pages default to a 4096-code-point advisory budget (2048 for root `CHEATSHEET.md`), adjustable per note; overflow warns without truncating a pinned body. Preserve standing rules and keep descriptions true as notes are promoted or retired.
31
31
 
32
32
  ## Deleting
33
33
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notesoup",
3
- "version": "0.60.1",
3
+ "version": "0.61.0",
4
4
  "description": "Durable notes and a host-scoped notes boot section for Claude Code.",
5
5
  "author": {
6
6
  "name": "AstroSheep"