notesoup 0.61.0 → 0.62.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 (200) hide show
  1. package/.agents/plugins/marketplace.json +15 -0
  2. package/README.md +14 -11
  3. package/dist/plugins/antigravity/src/cli.d.ts +1 -0
  4. package/dist/plugins/antigravity/src/cli.js +23 -0
  5. package/dist/plugins/antigravity/src/hooks.d.ts +18 -0
  6. package/dist/plugins/antigravity/src/hooks.js +53 -0
  7. package/dist/plugins/antigravity/src/identity.d.ts +26 -0
  8. package/dist/plugins/antigravity/src/identity.js +129 -0
  9. package/dist/plugins/claude/src/helper.js +2 -1
  10. package/dist/plugins/codex/src/hooks.js +1 -0
  11. package/dist/plugins/codex/src/identity.d.ts +6 -1
  12. package/dist/plugins/codex/src/identity.js +13 -1
  13. package/dist/plugins/codex/src/mcp.d.ts +35 -7
  14. package/dist/plugins/codex/src/mcp.js +26 -88
  15. package/dist/plugins/codex/src/text.js +3 -3
  16. package/dist/plugins/dsh/tools.js +8 -4
  17. package/dist/plugins/mcp/operations.d.ts +15 -0
  18. package/dist/plugins/mcp/operations.js +43 -0
  19. package/dist/plugins/mcp/server.d.ts +14 -0
  20. package/dist/plugins/mcp/server.js +13 -0
  21. package/dist/plugins/pi/budget.d.ts +1 -1
  22. package/dist/plugins/pi/budget.js +3 -2
  23. package/dist/plugins/pi/entries.d.ts +1 -0
  24. package/dist/plugins/pi/entries.js +1 -0
  25. package/dist/plugins/pi/history-tools.js +2 -1
  26. package/dist/plugins/pi/history.js +18 -1
  27. package/dist/plugins/pi/notes/tools.js +7 -3
  28. package/dist/plugins/pi/render.d.ts +7 -1
  29. package/dist/plugins/pi/render.js +2 -2
  30. package/dist/plugins/pi/reset/lifecycle.d.ts +1 -1
  31. package/dist/plugins/pi/reset/lifecycle.js +8 -9
  32. package/dist/plugins/pi/runtime.js +102 -61
  33. package/dist/plugins/pi/tool-result.js +7 -7
  34. package/dist/plugins/pi/window.d.ts +33 -3
  35. package/dist/plugins/pi/window.js +209 -9
  36. package/dist/src/boot/render.js +18 -15
  37. package/dist/src/boot/text.d.ts +3 -1
  38. package/dist/src/boot/text.js +22 -20
  39. package/dist/src/budget/text.d.ts +2 -2
  40. package/dist/src/budget/text.js +13 -13
  41. package/dist/src/history/claude.d.ts +2 -0
  42. package/dist/src/history/claude.js +46 -0
  43. package/dist/src/history/codex-transcript.js +7 -5
  44. package/dist/src/history/codex.js +3 -0
  45. package/dist/src/history/corpus.d.ts +28 -1
  46. package/dist/src/history/corpus.js +40 -0
  47. package/dist/src/history/history.d.ts +37 -46
  48. package/dist/src/history/history.js +21 -40
  49. package/dist/src/history/local.js +67 -32
  50. package/dist/src/history/pi.d.ts +2 -1
  51. package/dist/src/history/pi.js +122 -48
  52. package/dist/src/history/prefilter.js +76 -19
  53. package/dist/src/history/query.d.ts +28 -49
  54. package/dist/src/history/query.js +83 -68
  55. package/dist/src/history/summary-cache.d.ts +8 -1
  56. package/dist/src/history/summary-cache.js +138 -12
  57. package/dist/src/index.d.ts +1 -1
  58. package/dist/src/index.js +1 -1
  59. package/dist/src/notes/errors.d.ts +1 -1
  60. package/dist/src/notes/frontmatter.d.ts +0 -2
  61. package/dist/src/notes/frontmatter.js +0 -2
  62. package/dist/src/notes/index.d.ts +1 -1
  63. package/dist/src/notes/index.js +1 -1
  64. package/dist/src/notes/policy.d.ts +15 -1
  65. package/dist/src/notes/policy.js +46 -5
  66. package/dist/src/notes/store.d.ts +12 -0
  67. package/dist/src/notes/store.js +16 -20
  68. package/dist/src/text-match.d.ts +10 -1
  69. package/dist/src/text-match.js +42 -3
  70. package/dist/src/tools/dream.d.ts +22 -93
  71. package/dist/src/tools/dream.js +30 -27
  72. package/dist/src/tools/history.d.ts +33 -26
  73. package/dist/src/tools/history.js +257 -163
  74. package/dist/src/tools/notes.d.ts +51 -163
  75. package/dist/src/tools/notes.js +146 -100
  76. package/dist/src/tools/output.d.ts +2 -1
  77. package/dist/src/tools/output.js +2 -1
  78. package/dist/src/tools/result.d.ts +4 -7
  79. package/dist/src/tools/result.js +8 -9
  80. package/dist/src/tools/schema.d.ts +4 -1
  81. package/dist/src/tools/schema.js +25 -1
  82. package/dist/test/agent-loop.test.js +198 -16
  83. package/dist/test/antigravity-live.test.d.ts +1 -0
  84. package/dist/test/antigravity-live.test.js +142 -0
  85. package/dist/test/antigravity-plugin.test.d.ts +1 -0
  86. package/dist/test/antigravity-plugin.test.js +101 -0
  87. package/dist/test/boot.integration.test.js +133 -14
  88. package/dist/test/claude-history.test.js +14 -13
  89. package/dist/test/claude-mod.test.js +9 -6
  90. package/dist/test/codex-history.test.js +15 -3
  91. package/dist/test/codex-plugin.test.js +76 -38
  92. package/dist/test/dependencies.test.js +7 -3
  93. package/dist/test/dream-skill.test.js +3 -3
  94. package/dist/test/dream-tools.test.js +101 -56
  95. package/dist/test/dsh.test.js +34 -19
  96. package/dist/test/helpers/dependency-graph.js +2 -2
  97. package/dist/test/helpers/extension.d.ts +65 -2
  98. package/dist/test/helpers/extension.js +72 -3
  99. package/dist/test/history-corpus.test.js +79 -77
  100. package/dist/test/history-summary-cache.test.js +97 -9
  101. package/dist/test/history.integration.test.js +234 -168
  102. package/dist/test/host-neutral.test.js +69 -19
  103. package/dist/test/marker.test.js +1 -1
  104. package/dist/test/note-policy.test.js +96 -77
  105. package/dist/test/notes.integration.test.js +212 -94
  106. package/dist/test/notes.test.js +184 -113
  107. package/dist/test/pi-render.test.js +20 -12
  108. package/dist/test/project-namespace.test.js +3 -2
  109. package/dist/test/reset-lifecycle.test.js +2 -2
  110. package/docs/antigravity.md +44 -0
  111. package/docs/architecture.md +6 -4
  112. package/docs/claude-code-mod.md +2 -2
  113. package/docs/codex.md +36 -38
  114. package/docs/dsh.md +3 -3
  115. package/docs/history-sessions.md +28 -50
  116. package/docs/notes-library.md +4 -4
  117. package/docs/skills.md +3 -3
  118. package/docs/tool-results.md +47 -28
  119. package/package.json +3 -2
  120. package/playbook.md +1 -1
  121. package/plugins/antigravity/dist/antigravity/notesoup.js +26886 -0
  122. package/plugins/antigravity/hooks.json +7 -0
  123. package/plugins/antigravity/mcp_config.json +8 -0
  124. package/plugins/antigravity/plugin.json +6 -0
  125. package/plugins/antigravity/src/cli.ts +22 -0
  126. package/plugins/antigravity/src/hooks.ts +51 -0
  127. package/plugins/antigravity/src/identity.ts +127 -0
  128. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  129. package/plugins/claude/dist/claude/helper.js +1059 -534
  130. package/plugins/claude/hooks/register.ts +2 -2
  131. package/plugins/claude/playbook.md +1 -1
  132. package/plugins/claude/skills/dream/SKILL.md +1 -1
  133. package/plugins/claude/skills/notesoup/SKILL.md +92 -0
  134. package/plugins/claude/src/helper.ts +2 -1
  135. package/plugins/codex/.codex-plugin/plugin.json +8 -0
  136. package/plugins/codex/.mcp.json +11 -0
  137. package/plugins/codex/README.md +5 -21
  138. package/plugins/codex/dist/codex/notesoup.js +18480 -17946
  139. package/plugins/codex/src/hooks.ts +1 -0
  140. package/plugins/codex/src/identity.ts +14 -1
  141. package/plugins/codex/src/mcp.ts +28 -98
  142. package/plugins/codex/src/text.ts +3 -3
  143. package/plugins/dsh/tools.ts +8 -4
  144. package/plugins/mcp/operations.ts +50 -0
  145. package/plugins/mcp/server.ts +23 -0
  146. package/plugins/paseo/README.md +5 -10
  147. package/plugins/paseo/client/brain-empty-card.tsx +3 -3
  148. package/plugins/paseo/client/markdown.tsx +50 -38
  149. package/plugins/paseo/client/notes-op-card.tsx +12 -9
  150. package/plugins/paseo/client/paper-card.tsx +6 -5
  151. package/plugins/paseo/client/paper-palette.ts +2 -9
  152. package/plugins/paseo/client/sticky-card.tsx +2 -2
  153. package/plugins/paseo/client/tool-result.ts +7 -14
  154. package/plugins/paseo/package-lock.json +3406 -0
  155. package/plugins/paseo/package.json +1 -0
  156. package/plugins/paseo/test/markdown-core.test.ts +73 -66
  157. package/plugins/pi/budget.ts +3 -3
  158. package/plugins/pi/entries.ts +1 -0
  159. package/plugins/pi/history-tools.ts +2 -1
  160. package/plugins/pi/history.ts +30 -1
  161. package/plugins/pi/notes/tools.ts +7 -3
  162. package/plugins/pi/render.ts +6 -6
  163. package/plugins/pi/reset/lifecycle.ts +9 -10
  164. package/plugins/pi/runtime.ts +96 -60
  165. package/plugins/pi/tool-result.ts +8 -8
  166. package/plugins/pi/window.ts +198 -9
  167. package/skills/dream/SKILL.md +1 -1
  168. package/skills/notesoup/SKILL.md +92 -0
  169. package/src/boot/render.ts +18 -15
  170. package/src/boot/text.ts +23 -19
  171. package/src/budget/text.ts +13 -13
  172. package/src/history/claude.ts +41 -0
  173. package/src/history/codex-transcript.ts +6 -4
  174. package/src/history/codex.ts +2 -0
  175. package/src/history/corpus.ts +51 -2
  176. package/src/history/history.ts +35 -44
  177. package/src/history/local.ts +67 -27
  178. package/src/history/pi.ts +113 -35
  179. package/src/history/prefilter.ts +73 -15
  180. package/src/history/query.ts +93 -73
  181. package/src/history/summary-cache.ts +142 -17
  182. package/src/index.ts +1 -1
  183. package/src/notes/errors.ts +1 -1
  184. package/src/notes/frontmatter.ts +0 -3
  185. package/src/notes/index.ts +1 -1
  186. package/src/notes/policy.ts +44 -5
  187. package/src/notes/store.ts +17 -20
  188. package/src/text-match.ts +46 -4
  189. package/src/tools/dream.ts +29 -31
  190. package/src/tools/history.ts +249 -142
  191. package/src/tools/notes.ts +145 -113
  192. package/src/tools/output.ts +2 -1
  193. package/src/tools/result.ts +12 -11
  194. package/src/tools/schema.ts +24 -1
  195. package/plugins/claude/skills/memory/SKILL.md +0 -69
  196. package/plugins/codex/mcp.json +0 -10
  197. package/plugins/codex/plugin.json +0 -6
  198. package/plugins/paseo/client/markdown-core.tsx +0 -189
  199. package/plugins/paseo/client/typography.ts +0 -24
  200. package/skills/memory/SKILL.md +0 -69
@@ -1,7 +1,7 @@
1
1
  import { notesIdentityFromPi } from "../plugins/pi/notes/adapter.js";
2
2
  import { DEFAULT_BOOT_TOOL_NAMES, renderProtocolBlock } from "../src/boot/text.js";
3
3
  import assert from "node:assert/strict";
4
- import { mkdirSync, rmSync, writeFileSync } from "node:fs";
4
+ import { mkdirSync, realpathSync, rmSync, writeFileSync } from "node:fs";
5
5
  import fs from "node:fs/promises";
6
6
  import { syncBuiltinESMExports } from "node:module";
7
7
  import { dirname, join } from "node:path";
@@ -9,12 +9,12 @@ import test from "node:test";
9
9
  import { loadNotesSnapshot } from "../src/boot/snapshot.js";
10
10
  import { renderBootBlock } from "../src/boot/render.js";
11
11
  import { localIso } from "../src/notes/frontmatter.js";
12
- import { createNotesStore } from "../src/notes/index.js";
12
+ import { createNotesStore, projectKey } from "../src/notes/index.js";
13
13
  import { listNotes, physicalPath, scopeDir } from "./helpers/notes.js";
14
14
  import { MAX_READ_WINDOW_CHARS, TOOL_OUTPUT_MAX_BYTES } from "../src/tools/output.js";
15
15
  import { notesUpdate } from "../src/tools/notes.js";
16
16
  import { notesToolContext } from "../src/tools/notes-context.js";
17
- import { assertWithinBudget, call, context, makeExtension, manager, resultData, resultError, resultRead, runHandlers, } from "./helpers/extension.js";
17
+ import { assertWithinBudget, call, context, makeExtension, manager, resultData, resultError, resultRead, resultText, resultTextError, runHandlers, } from "./helpers/extension.js";
18
18
  import { installExtensionTestHooks } from "./helpers/extension-test-environment.js";
19
19
  const testEnvironment = installExtensionTestHooks("notesoup-integration");
20
20
  /** The model-facing text of one tool result. */
@@ -22,6 +22,15 @@ function textOf(result) {
22
22
  const first = result.content[0];
23
23
  return first && first.type === "text" ? first.text : "";
24
24
  }
25
+ /** Addresses as rendered at the start of each list row. */
26
+ function listedAddresses(text) {
27
+ return [...text.matchAll(/^- (\S+)/gm)].map(match => match[1]);
28
+ }
29
+ /** The parsed `→ older` recipe, when a list has another page. */
30
+ function olderPage(text) {
31
+ const match = /→ older: (\{.*\})$/.exec(text.split("\n").at(-1) ?? "");
32
+ return match ? JSON.parse(match[1]) : undefined;
33
+ }
25
34
  for (const scanFails of [false, true]) {
26
35
  test(`Pi shutdown cancels a pending dream after its gated scan ${scanFails ? "fails" : "resumes"}`, async (t) => {
27
36
  const session = manager();
@@ -51,19 +60,44 @@ for (const scanFails of [false, true]) {
51
60
  t.after(() => { release(); t.mock.restoreAll(); syncBuiltinESMExports(); });
52
61
  const opening = call(captured, "dream_begin", {}, ctx);
53
62
  await entered;
54
- assert.equal(resultError(await call(captured, "dream_begin", {}, otherCtx)).code, "already_dreaming");
55
- assert.equal(resultError(await call(captured, "dream_begin", {}, ctx)).code, "already_dreaming");
63
+ assert.equal(resultTextError(await call(captured, "dream_begin", {}, otherCtx)).code, "already_dreaming");
64
+ assert.equal(resultTextError(await call(captured, "dream_begin", {}, ctx)).code, "already_dreaming");
56
65
  await runHandlers(captured, "session_shutdown", { type: "session_shutdown" }, ctx);
57
- assert.equal(resultError(await call(captured, "dream_end", {}, ctx)).code, "not_dreaming");
58
- const newer = resultData(await call(captured, "dream_begin", {}, otherCtx));
59
- assert.equal(newer.project, other.projectKey, "another project can immediately begin after shutdown");
66
+ assert.equal(resultTextError(await call(captured, "dream_end", {}, ctx)).code, "not_dreaming");
67
+ const newer = resultText(await call(captured, "dream_begin", {}, otherCtx));
68
+ assert.ok(newer.includes(other.projectKey), "another project can immediately begin after shutdown");
60
69
  release();
61
- assert.equal(resultError(await opening).code, "cancelled", "the stale opener cannot return success or resurrect state");
62
- assert.equal(resultError(await call(captured, "dream_begin", {}, ctx)).code, "already_dreaming", "stale cleanup cannot unlock the newer dream");
63
- assert.equal(resultError(await call(captured, "dream_end", {}, ctx)).code, "not_dreaming");
64
- resultData(await call(captured, "dream_end", {}, otherCtx));
70
+ assert.equal(resultTextError(await opening).code, "cancelled", "the stale opener cannot return success or resurrect state");
71
+ assert.equal(resultTextError(await call(captured, "dream_begin", {}, ctx)).code, "already_dreaming", "stale cleanup cannot unlock the newer dream");
72
+ assert.equal(resultTextError(await call(captured, "dream_end", {}, ctx)).code, "not_dreaming");
73
+ resultText(await call(captured, "dream_end", {}, otherCtx));
65
74
  });
66
75
  }
76
+ test("dream_begin selects a child repository by relative or absolute cwd", async () => {
77
+ const session = manager();
78
+ const captured = makeExtension(session);
79
+ const ctx = context(session);
80
+ const child = join(ctx.cwd, "dream-child");
81
+ mkdirSync(join(child, ".git"), { recursive: true });
82
+ const home = process.env.NOTESOUP_HOME;
83
+ const slug = projectKey(child, home);
84
+ const childIdentity = { ...notesIdentityFromPi(ctx), projectKey: slug, sessionId: "dream-child-session" };
85
+ const store = createNotesStore(childIdentity);
86
+ await store.write("@project/rule", "before");
87
+ await store.write("checkpoint", "session note");
88
+ const address = `@projects/${slug}/rule`;
89
+ assert.equal(resultTextError(await call(captured, "notes_write", { address, content: "blocked" }, ctx)).code, "invalid_scope");
90
+ for (const cwd of ["dream-child", child]) {
91
+ const begun = resultText(await call(captured, "dream_begin", { cwd }, ctx));
92
+ assert.ok(begun.includes(`dreaming over ${slug} (baseline `));
93
+ assert.ok(begun.includes(`project_root ${realpathSync(child)}`));
94
+ assert.ok(begun.includes(`${address}.md`));
95
+ assert.ok(begun.includes("@sessions/dream-child-session/checkpoint.md"));
96
+ resultText(await call(captured, "notes_write", { address, content: `changed ${cwd}` }, ctx));
97
+ resultText(await call(captured, "dream_end", {}, ctx));
98
+ assert.equal(resultTextError(await call(captured, "notes_write", { address, content: "blocked" }, ctx)).code, "invalid_scope");
99
+ }
100
+ });
67
101
  test("notes_list browses and searches recent-first snapshots", async () => {
68
102
  const session = manager();
69
103
  const captured = makeExtension(session);
@@ -79,18 +113,96 @@ test("notes_list browses and searches recent-first snapshots", async () => {
79
113
  put("new.md", base + 3);
80
114
  put("@project/design.md", base + 2, "design\nThe NEEDLE");
81
115
  put("unrelated.md", base + 4, "not a hit");
82
- const listed = resultData(await call(captured, "notes_list", { limit: 2 }, ctx));
83
- assert.deepEqual(listed.files.map((file) => file.address), ["unrelated.md", "new.md"]);
84
- assert.equal(listed.more, 2);
85
- const searched = resultData(await call(captured, "notes_list", { query: "needle", limit: 2 }, ctx));
86
- assert.deepEqual(searched.files.map((file) => [file.address, file.matches]), [
87
- ["new.md", [{ line: 1, text: "needle", offset_chars: 0 }]],
88
- ["@project/design.md", [{ line: 2, text: "The NEEDLE", offset_chars: 11 }]],
89
- ]);
90
- assert.equal(searched.more, 1);
91
- const narrowed = resultData(await call(captured, "notes_list", { glob: "@project/**" }, ctx));
92
- assert.deepEqual(narrowed.files.map((file) => file.address), ["@project/design.md"]);
93
- assert.equal(narrowed.more, 0);
116
+ const listed = resultText(await call(captured, "notes_list", { limit: 2 }, ctx));
117
+ assert.match(listed, /2 notes\n- unrelated\.md[^\n]*\n- new\.md/);
118
+ assert.match(listed, /2 more matching notes \| → older: /);
119
+ const searched = resultText(await call(captured, "notes_list", { query: "needle", limit: 2 }, ctx));
120
+ assert.match(searched, /- new\.md[^\n]*\n line 1 at offset_chars 0: needle\n- @project\/design\.md/);
121
+ assert.match(searched, /line 2 at offset_chars 11: The NEEDLE/);
122
+ assert.match(searched, /1 more matching note \| → older: /);
123
+ const narrowed = resultText(await call(captured, "notes_list", { glob: "@project/**" }, ctx));
124
+ assert.match(narrowed, /^1 note\n- @project\/design\.md/);
125
+ assert.doesNotMatch(narrowed, /more matching notes/);
126
+ });
127
+ test("notes_list follows older pages without repeating or skipping notes", async () => {
128
+ const session = manager();
129
+ const captured = makeExtension(session);
130
+ const ctx = context(session);
131
+ const base = 1_700_000_000_000;
132
+ const put = (address, updated) => {
133
+ const path = physicalPath("session", address, ctx);
134
+ mkdirSync(dirname(path), { recursive: true });
135
+ writeFileSync(path, `---\nscope: session\norigin: self\ncreatedAt: ${localIso(updated - 1000)}\nupdatedAt: ${localIso(updated)}\nlastAccessed: ${localIso(updated)}\naccessCount: 0\n---\n\nneedle`);
136
+ };
137
+ put("a.md", base + 10);
138
+ put("b.md", base + 10);
139
+ put("c.md", base + 4);
140
+ put("d.md", base + 2);
141
+ for (const filters of [{}, { query: "needle" }]) {
142
+ const seen = [];
143
+ let page = { ...filters, limit: 2 };
144
+ while (page) {
145
+ const text = resultText(await call(captured, "notes_list", page, ctx));
146
+ seen.push(...listedAddresses(text));
147
+ page = olderPage(text);
148
+ }
149
+ assert.deepEqual(seen, ["a.md", "b.md", "c.md", "d.md"], `${filters.query ? "search" : "browse"} pages stay newest-first with no duplicates`);
150
+ }
151
+ const complete = resultText(await call(captured, "notes_list", {}, ctx));
152
+ assert.deepEqual(listedAddresses(complete), ["a.md", "b.md", "c.md", "d.md"]);
153
+ assert.equal(olderPage(complete), undefined, "a single complete page carries no older footer");
154
+ const recipe = olderPage(resultText(await call(captured, "notes_list", { query: "needle", max_matches_per_note: 1, crumpled: false, limit: 2 }, ctx)));
155
+ assert.equal(recipe.query, "needle");
156
+ assert.equal(recipe.max_matches_per_note, 1);
157
+ assert.equal(recipe.crumpled, false);
158
+ assert.equal(recipe.limit, 2);
159
+ assert.match(String(recipe.cursor), /^\d{4}-\d{2}-\d{2}T[^ ]+ b\.md$/);
160
+ });
161
+ test("notes_list pages named-project addresses that round-trip through cursor", async () => {
162
+ const session = manager();
163
+ const captured = makeExtension(session);
164
+ const ctx = context(session);
165
+ const home = process.env.NOTESOUP_HOME;
166
+ const base = 1_700_000_000_000;
167
+ const named = async (name, updated) => {
168
+ const repo = join(testEnvironment.cwd, name);
169
+ mkdirSync(join(repo, ".git"), { recursive: true });
170
+ const key = projectKey(repo, home);
171
+ await createNotesStore({ home, projectKey: key, sessionId: "session", agent: "test", model: "test" }).write("@project/decision", "needle");
172
+ writeFileSync(join(home, "project", key, "decision.md"), `---\nscope: project\norigin: self\ncreatedAt: ${localIso(updated - 1000)}\nupdatedAt: ${localIso(updated)}\nlastAccessed: ${localIso(updated)}\naccessCount: 0\n---\n\nneedle`);
173
+ return `@projects/${key}/decision.md`;
174
+ };
175
+ const newer = await named("paging-newer", base + 20);
176
+ const older = await named("paging-older", base + 10);
177
+ const seen = [];
178
+ let page = { glob: "@projects/*/**", limit: 1 };
179
+ while (page) {
180
+ const text = resultText(await call(captured, "notes_list", page, ctx));
181
+ assert.match(text, /^1 note\n/);
182
+ seen.push(...listedAddresses(text));
183
+ page = olderPage(text);
184
+ }
185
+ assert.deepEqual(seen, [newer, older], "canonical named-project addresses are reused as the cursor");
186
+ });
187
+ test("notes_list does not repeat a note edited between older pages", async () => {
188
+ const session = manager();
189
+ const captured = makeExtension(session);
190
+ const ctx = context(session);
191
+ const base = 1_700_000_000_000;
192
+ const put = (address, updated) => {
193
+ const path = physicalPath("session", address, ctx);
194
+ mkdirSync(dirname(path), { recursive: true });
195
+ writeFileSync(path, `---\nscope: session\norigin: self\ncreatedAt: ${localIso(updated - 1000)}\nupdatedAt: ${localIso(updated)}\nlastAccessed: ${localIso(updated)}\naccessCount: 0\n---\n\nneedle`);
196
+ };
197
+ put("newest.md", base + 40);
198
+ put("second.md", base + 30);
199
+ put("third.md", base + 20);
200
+ put("fourth.md", base + 10);
201
+ const first = resultText(await call(captured, "notes_list", { limit: 2 }, ctx));
202
+ const next = olderPage(first);
203
+ assert.deepEqual(listedAddresses(first), ["newest.md", "second.md"]);
204
+ await call(captured, "notes_update", { address: "newest.md", edits: [{ oldText: "needle", newText: "changed" }] }, ctx);
205
+ assert.deepEqual(listedAddresses(resultText(await call(captured, "notes_list", next, ctx))), ["third.md", "fourth.md"]);
94
206
  });
95
207
  test("empty notes queries list scoped notes without fabricated matches", async () => {
96
208
  const session = manager();
@@ -103,10 +215,10 @@ test("empty notes queries list scoped notes without fabricated matches", async (
103
215
  await call(captured, "notes_update", { address: "empty-query/hidden.md", crumpled: true }, ctx);
104
216
  for (const crumpled of [false, true]) {
105
217
  const filters = { glob: "empty-query/**", crumpled, limit: 1 };
106
- const listed = resultData(await call(captured, "notes_list", filters, ctx));
107
- assert.deepEqual(resultData(await call(captured, "notes_list", { ...filters, query: [] }, ctx)), listed);
218
+ const listed = resultText(await call(captured, "notes_list", filters, ctx));
219
+ assert.equal(resultText(await call(captured, "notes_list", { ...filters, query: [] }, ctx)), listed);
108
220
  }
109
- assert.match(resultError(await call(captured, "notes_list", { max_matches_per_file: 1 }, ctx)).message, /requires a non-empty `query`/);
221
+ assert.match(resultTextError(await call(captured, "notes_list", { max_matches_per_note: 1 }, ctx)).message, /`max_matches_per_note` requires a non-empty `query`/);
110
222
  });
111
223
  test("notes_list reports omitted files when the wire budget truncates the snapshot", async () => {
112
224
  const session = manager();
@@ -122,10 +234,11 @@ test("notes_list reports omitted files when the wire budget truncates the snapsh
122
234
  }
123
235
  const result = await call(captured, "notes_list", {}, ctx);
124
236
  assertWithinBudget(result, "oversized listing");
125
- const listed = resultData(result);
126
- assert.ok(listed.files.length > 0 && listed.files.length < total, "the snapshot is cut short instead of overflowing either surface");
127
- assert.equal(listed.more, total - listed.files.length, "omitted rows are named, not silently dropped");
128
- assert.equal(listed.files[0]?.address, `bulk/note-${String(total - 1).padStart(4, "0")}.md`, "the snapshot retains the newest rows first");
237
+ const listed = resultText(result);
238
+ const rows = listed.match(/^- bulk\/note-\d{4}\.md/gm) ?? [];
239
+ assert.ok(rows.length > 0 && rows.length < total, "the snapshot is cut short instead of overflowing the wire budget");
240
+ assert.ok(listed.includes(`${total - rows.length} more matching notes | → older: `), "omitted rows are named, not silently dropped");
241
+ assert.equal(rows[0], `- bulk/note-${String(total - 1).padStart(4, "0")}.md`, "the snapshot retains the newest rows first");
129
242
  });
130
243
  test("notes_list is most-recently-updated first across merged scopes", async () => {
131
244
  const session = manager();
@@ -141,12 +254,12 @@ test("notes_list is most-recently-updated first across merged scopes", async ()
141
254
  put("session", "a.md", base + 10);
142
255
  put("project", "c.md", base + 5);
143
256
  put("human", "e.md", base + 20);
144
- const files = async (params) => resultData(await call(captured, "notes_list", params, ctx)).files;
145
- assert.deepEqual((await files({})).map((file) => file.address), ["@human/e.md", "a.md", "b.md", "@project/c.md"], "updated_at descending with address ascending as the tiebreak");
257
+ const listing = async (params) => resultText(await call(captured, "notes_list", params, ctx));
258
+ assert.match(await listing({}), /- @human\/e\.md[^\n]*\n- a\.md[^\n]*\n- b\.md[^\n]*\n- @project\/c\.md/, "updated_at descending with address ascending as the tiebreak");
146
259
  // A same-path pair in two scopes keeps both rows; equal timestamps tie-break by scope name.
147
260
  put("human", "a.md", base + 10);
148
- assert.deepEqual((await files({})).filter((file) => file.address.endsWith("a.md")).map((file) => file.address), ["@human/a.md", "a.md"], "equal timestamps tie-break by full address");
149
- assert.deepEqual((await files({ glob: "*.md" })).map((file) => file.address), ["@human/e.md", "@human/a.md", "a.md", "b.md", "@project/c.md"], "a slashless glob matches filenames across notebooks");
261
+ assert.match(await listing({}), /- @human\/a\.md[^\n]*\n- a\.md/, "equal timestamps tie-break by full address");
262
+ assert.match(await listing({ glob: "*.md" }), /- @human\/e\.md[^\n]*\n- @human\/a\.md[^\n]*\n- a\.md[^\n]*\n- b\.md[^\n]*\n- @project\/c\.md/, "a slashless glob matches filenames across notebooks");
150
263
  });
151
264
  test("notes are real files that persist across sessions and round-trip Unicode", async () => {
152
265
  const original = manager();
@@ -162,16 +275,14 @@ test("notes are real files that persist across sessions and round-trip Unicode",
162
275
  const read = resultRead(rawRead);
163
276
  assert.equal(read.address, "@human/checkpoint/进度.md");
164
277
  assert.equal(read.content, "Café", "a negative offset reads the body tail in one call");
165
- const searched = resultData(await call(restoredCaptured, "notes_list", { glob: "@human/**", query: "Café" }, restoredCtx));
166
- assert.equal(searched.files[0]?.matches?.[0]?.line, 2);
167
- const listedFiles = resultData(await call(restoredCaptured, "notes_list", { glob: "@human/checkpoint/**" }, restoredCtx));
168
- assert.equal(listedFiles.files.length, 1, "glob ** crosses into the checkpoint directory");
169
- assert.equal(listedFiles.files[0]?.address, "@human/checkpoint/进度.md");
278
+ const searched = resultText(await call(restoredCaptured, "notes_list", { glob: "@human/**", query: "Café" }, restoredCtx));
279
+ assert.match(searched, /line 2 at offset_chars \d+: needle Café/);
280
+ const listedFiles = resultText(await call(restoredCaptured, "notes_list", { glob: "@human/checkpoint/**" }, restoredCtx));
281
+ assert.match(listedFiles, /^1 note\n- @human\/checkpoint\/进度\.md/, "glob ** crosses into the checkpoint directory");
170
282
  // A single-segment * never crosses `/`, so a nested-only store matches nothing at the root.
171
- const rootOnly = resultData(await call(restoredCaptured, "notes_list", { glob: "@human/*" }, restoredCtx));
172
- assert.equal(rootOnly.files.length, 0, "glob * stays within one segment");
173
- assert.equal(searched.files[0]?.updated_at, listedFiles.files[0]?.updated_at);
174
- assert.equal(resultError(await call(captured, "notes_write", { address: "../escape", content: "x" }, ctx)).code, "invalid_address");
283
+ const rootOnly = resultText(await call(restoredCaptured, "notes_list", { glob: "@human/*" }, restoredCtx));
284
+ assert.equal(rootOnly, "0 notes", "glob * stays within one segment");
285
+ assert.equal(resultTextError(await call(captured, "notes_write", { address: "../escape", content: "x" }, ctx)).code, "invalid_address");
175
286
  });
176
287
  test("crumple lifecycle: metadata-only edits close and smooth a note without touching updatedAt", async () => {
177
288
  const sm = manager();
@@ -181,8 +292,7 @@ test("crumple lifecycle: metadata-only edits close and smooth a note without tou
181
292
  const updatedBefore = (await listNotes(ctx))[0].meta.updatedAt;
182
293
  // metadata-only: content unchanged, and the recorded time is the original one
183
294
  const markOnlyRaw = await call(captured, "notes_update", { address: "journal.md", crumpled: true }, ctx);
184
- const markOnly = resultData(markOnlyRaw);
185
- assert.equal(markOnly.change_kind, "metadata");
295
+ assert.match(resultText(markOnlyRaw), /^updated journal\.md\b/);
186
296
  assert.match(markOnlyRaw.details?.diff ?? "", /^\+\s*\d+\s+crumpledAt: \d{4}-\d{2}-\d{2}T/m);
187
297
  assert.deepEqual(await listNotes(ctx), [], "a crumpled note leaves the live list");
188
298
  const basket = (await listNotes(ctx, { crumpled: true }))[0];
@@ -200,7 +310,7 @@ test("crumple lifecycle: metadata-only edits close and smooth a note without tou
200
310
  await call(captured, "notes_write", { address: "journal.md", content: "reopened" }, ctx);
201
311
  assert.equal((await listNotes(ctx))[0]?.meta.crumpledAt, undefined, "writing always produces an uncrumpled note");
202
312
  // metadata-only on a missing path is the typed not-found arm
203
- const missing = resultError(await call(captured, "notes_update", { address: "missing.md", crumpled: true }, ctx));
313
+ const missing = resultTextError(await call(captured, "notes_update", { address: "missing.md", crumpled: true }, ctx));
204
314
  assert.equal(missing.code, "not_found");
205
315
  });
206
316
  test("the filesystem notes loader treats an absent notebook as empty but surfaces a real directory read failure", async () => {
@@ -253,13 +363,13 @@ test("an over-budget note is delivered as a bounded prefix and resumed by next_o
253
363
  assert.equal(first.content.length, 12000, "the default window is the full requested count");
254
364
  assert.deepEqual(Object.keys(resultData(rawFirst)).sort(), ["address", "metadata", "next_offset_chars", "text", "total_chars", "warnings"], "read fields are flat");
255
365
  assert.equal("access_count" in resultData(rawFirst).metadata, false, "access bookkeeping stays in storage");
256
- assert.equal(textOf(rawFirst).endsWith(`\n\n[truncated; continue at offset_chars=${first.next_offset_chars}]`), true, "the footer names the resume cursor");
366
+ assert.equal(textOf(rawFirst).endsWith(`\n\n[truncated at ${first.next_offset_chars}/${resultData(rawFirst).total_chars} chars; continue at offset_chars=${first.next_offset_chars}]`), true, "the footer states the delivered position and the resume cursor");
257
367
  // Asking for the largest legal window still cannot exceed the byte budget.
258
368
  const rawWide = await call(captured, "notes_read", { address: "huge.md", max_chars: MAX_READ_WINDOW_CHARS }, ctx);
259
369
  assertWithinBudget(rawWide, "widest requested window");
260
370
  const wide = resultRead(rawWide);
261
371
  assert.ok(Array.from(wide.content).length < MAX_READ_WINDOW_CHARS, "the widest request is cut short");
262
- assert.match(textOf(rawWide), /\[truncated; continue at offset_chars=\d+\]$/, "a byte-stopped window still says where to continue");
372
+ assert.match(textOf(rawWide), /\[truncated at \d+\/\d+ chars; continue at offset_chars=\d+\]$/, "a byte-stopped window still says where to continue");
263
373
  // Following the cursor reconstructs the body by plain concatenation.
264
374
  const parts = [first.content];
265
375
  let offset = first.next_offset_chars;
@@ -291,6 +401,25 @@ test("an over-budget note is delivered as a bounded prefix and resumed by next_o
291
401
  assert.equal(missing.code, "not_found");
292
402
  assert.equal(missing.code, "not_found");
293
403
  });
404
+ test("plain-text search spends only rendered bytes while notes_read also bounds JSON", async () => {
405
+ const session = manager();
406
+ const captured = makeExtension(session);
407
+ const ctx = context(session);
408
+ const body = `needle${"\\".repeat(24_000)}`;
409
+ assert.ok(Buffer.byteLength(JSON.stringify({ text: body }), "utf8") > TOOL_OUTPUT_MAX_BYTES);
410
+ resultText(await call(captured, "notes_write", { address: "escaped.md", content: body }, ctx));
411
+ const listResult = await call(captured, "notes_list", { query: "needle", glob: "escaped.md" }, ctx);
412
+ const listing = resultText(listResult);
413
+ assertWithinBudget(listResult, "escaped search preview");
414
+ assert.ok(listing.includes(body), "all escaped characters fit as rendered text");
415
+ assert.doesNotMatch(listing, /\[truncated\]/);
416
+ const readResult = await call(captured, "notes_read", { address: "escaped.md", max_chars: 24_006 }, ctx);
417
+ const read = resultRead(readResult);
418
+ assertWithinBudget(readResult, "structured escaped note read");
419
+ assert.ok(read.text.length < body.length, "JSON escaping forces notes_read to shorten the window");
420
+ assert.equal(read.next_offset_chars, read.text.length);
421
+ assert.ok(body.startsWith(read.text));
422
+ });
294
423
  test("an over-budget note search match is a marked prefix with an honest line address", async () => {
295
424
  const session = manager();
296
425
  const captured = makeExtension(session);
@@ -300,19 +429,14 @@ test("an over-budget note search match is a marked prefix with an honest line ad
300
429
  await call(captured, "notes_write", { address: "a.md", content: "needle small" }, ctx);
301
430
  await call(captured, "notes_write", { address: "search.md", content: hugeLine }, ctx);
302
431
  const rawFound = await call(captured, "notes_list", { query: "needle", limit: 10 }, ctx);
303
- const found = resultData(rawFound);
304
- assert.ok(Buffer.byteLength(JSON.stringify(found), "utf8") <= TOOL_OUTPUT_MAX_BYTES, "the structured match result stays within budget");
305
- assert.match(textOf(rawFound), /\[truncated\]/, "the model-facing match line carries the same marker");
306
- assert.equal(found.more, 1, "the oversized result names the omitted matching file");
307
- assert.deepEqual(found.files.map((file) => file.address), ["search.md"], "the snapshot keeps the most recently updated match");
308
- const matches = found.files[0].matches;
309
- assert.equal(matches.length, 1);
310
- const match = matches[0];
311
- assert.ok(match.text.endsWith(" [truncated]"), "a shortened match line ends with the ellipsis marker");
312
- assert.ok(hugeLine.startsWith(match.text.slice(0, -" [truncated]".length)), "the match text is a plain prefix of the line plus its marker");
313
- assert.equal(match.line, 1, "the informational line number survives");
314
- assert.equal(match.offset_chars, 500, "the offset addresses the body directly, so the query's real position survives");
315
- const atMatch = resultRead(await call(captured, "notes_read", { address: "search.md", offset_chars: match.offset_chars }, ctx));
432
+ const found = resultText(rawFound);
433
+ assertWithinBudget(rawFound, "oversized search result");
434
+ assert.match(found, /^1 note\n- search\.md/);
435
+ assert.match(found, /1 more matching note \| → older: /);
436
+ const match = /line 1 at offset_chars 500: ([^\n]*) \[truncated\]/.exec(found);
437
+ assert.ok(match, "the shortened line retains its line and body offset");
438
+ assert.ok(hugeLine.startsWith(match[1]), "the match preview is a prefix of the original line");
439
+ const atMatch = resultRead(await call(captured, "notes_read", { address: "search.md", offset_chars: 500 }, ctx));
316
440
  assert.ok(atMatch.content.startsWith("needle"), "the search offset starts a read at the matched substring");
317
441
  // The body is reconstructible by following notes_read's cursor from the start of the file.
318
442
  const parts = [];
@@ -337,20 +461,18 @@ for (const [label, padding, cap] of [
337
461
  const captured = makeExtension(session);
338
462
  const ctx = context(session);
339
463
  const lines = Array.from({ length: padding > TOOL_OUTPUT_MAX_BYTES ? 3 : 8 }, (_, index) => `needle ${index}${"y".repeat(padding)}`);
340
- resultData(await call(captured, "notes_write", { address: "matches.md", content: lines.join("\n") }, ctx));
341
- const raw = await call(captured, "notes_list", { query: "needle", max_matches_per_file: cap }, ctx);
464
+ resultText(await call(captured, "notes_write", { address: "matches.md", content: lines.join("\n") }, ctx));
465
+ const raw = await call(captured, "notes_list", { query: "needle", max_matches_per_note: cap }, ctx);
342
466
  assertWithinBudget(raw, label);
343
- const found = resultData(raw);
344
- assert.equal(found.more, 0, "line omissions are separate from omitted pages");
345
- const [file] = found.files;
346
- assert.ok(file?.matches);
347
- assert.ok(file.matches.length > 0 && file.matches.length < lines.length);
467
+ const found = resultText(raw);
468
+ assert.doesNotMatch(found, /more matching notes/, "line omissions are separate from omitted pages");
469
+ const visible = (found.match(/^ line \d+ at offset_chars /gm) ?? []).length;
470
+ assert.ok(visible > 0 && visible < lines.length);
348
471
  if (cap !== undefined)
349
- assert.ok(file.matches.length <= cap);
472
+ assert.ok(visible <= cap);
350
473
  if (padding > 0)
351
- assert.ok(file.matches.length < (cap ?? lines.length), "the output budget also drops lines");
352
- assert.equal(file.more_matches, lines.length - file.matches.length);
353
- assert.ok(textOf(raw).includes(`${file.more_matches} more lines`));
474
+ assert.ok(visible < (cap ?? lines.length), "the output budget also drops lines");
475
+ assert.ok(found.includes(`${lines.length - visible} more lines`));
354
476
  });
355
477
  }
356
478
  test("notes_list treats queries literally and preserves original Unicode offsets", async () => {
@@ -358,14 +480,13 @@ test("notes_list treats queries literally and preserves original Unicode offsets
358
480
  const captured = makeExtension(session);
359
481
  const ctx = context(session);
360
482
  await call(captured, "notes_write", { address: "case-match.md", content: "😀İ NeEdLe.* tail" }, ctx);
361
- const found = resultData(await call(captured, "notes_list", { query: ["missing", "needle.*"], glob: "case-match.md" }, ctx));
362
- assert.equal(found.files.length, 1);
363
- const hit = found.files[0];
364
- assert.equal(hit.matches?.length, 1);
365
- const read = resultRead(await call(captured, "notes_read", { address: hit.address, offset_chars: hit.matches[0].offset_chars }, ctx));
483
+ const found = resultText(await call(captured, "notes_list", { query: ["missing", "needle.*"], glob: "case-match.md" }, ctx));
484
+ assert.match(found, /^1 note\n- case-match\.md/);
485
+ assert.match(found, /line 1 at offset_chars 3: 😀İ NeEdLe\.\* tail/);
486
+ const read = resultRead(await call(captured, "notes_read", { address: "case-match.md", offset_chars: 3 }, ctx));
366
487
  assert.equal(read.content, "NeEdLe.* tail");
367
- const absent = resultData(await call(captured, "notes_list", { query: "needle.+", glob: "case-match.md" }, ctx));
368
- assert.deepEqual(absent.files, []);
488
+ const absent = resultText(await call(captured, "notes_list", { query: "needle.+", glob: "case-match.md" }, ctx));
489
+ assert.equal(absent, "0 notes");
369
490
  });
370
491
  test("notes_list scopes queries by glob", async () => {
371
492
  const session = manager();
@@ -373,10 +494,10 @@ test("notes_list scopes queries by glob", async () => {
373
494
  const ctx = context(session);
374
495
  await call(captured, "notes_write", { address: "deep/nested/a.md", content: "needle here" }, ctx);
375
496
  await call(captured, "notes_write", { address: "top.md", content: "needle there" }, ctx);
376
- const scoped = resultData(await call(captured, "notes_list", { query: "needle", glob: "deep/**" }, ctx));
377
- assert.deepEqual(scoped.files.map((file) => file.address), ["deep/nested/a.md"], "a glob scopes the search to the subtree");
378
- const none = resultData(await call(captured, "notes_list", { query: "needle", glob: "absent/**" }, ctx));
379
- assert.deepEqual(none.files, [], "a non-matching glob is an empty page, not a refusal");
497
+ const scoped = resultText(await call(captured, "notes_list", { query: "needle", glob: "deep/**" }, ctx));
498
+ assert.match(scoped, /^1 note\n- deep\/nested\/a\.md/, "a glob scopes the search to the subtree");
499
+ const none = resultText(await call(captured, "notes_list", { query: "needle", glob: "absent/**" }, ctx));
500
+ assert.equal(none, "0 notes", "a non-matching glob is an empty page, not a refusal");
380
501
  });
381
502
  test("a large mutation keeps a receipt and budget warning while details.diff carries the UI diff", async () => {
382
503
  const session = manager();
@@ -386,12 +507,9 @@ test("a large mutation keeps a receipt and budget warning while details.diff car
386
507
  await call(captured, "notes_write", { address: "bulk-edit.md", content: line.repeat(1500) }, ctx);
387
508
  const raw = await call(captured, "notes_update", { address: "bulk-edit.md", edits: [{ oldText: "a".repeat(300), newText: "b".repeat(300) }], replace_all: true }, ctx);
388
509
  assertWithinBudget(raw, "bulk edit receipt");
389
- const update = resultData(raw);
390
- assert.equal(update.change_kind, "body");
391
- assert.match(textOf(raw), /^updated bulk-edit\.md\b/);
392
- assert.ok(update.warnings.length > 0);
393
- for (const warning of update.warnings)
394
- assert.ok(textOf(raw).includes(warning), "budget warnings remain visible");
510
+ const update = resultText(raw);
511
+ assert.match(update, /^updated bulk-edit\.md\b/);
512
+ assert.match(update, /budget/i, "budget warnings remain visible");
395
513
  assert.match(raw.details?.diff ?? "", new RegExp(`\\+.*?${"b".repeat(300)}`), "details.diff carries the UI diff");
396
514
  const body = resultRead(await call(captured, "notes_read", { address: "bulk-edit.md", max_chars: 300 }, ctx)).content;
397
515
  assert.equal(body, "b".repeat(300), "every one of the 1500 replacements was applied");
@@ -467,7 +585,7 @@ test("an unexpected notes defect propagates with its own identity while real fil
467
585
  // A genuine filesystem refusal is still an expected outcome, and still says nothing about paths.
468
586
  rmSync(scopeDir("session", ctx), { recursive: true, force: true });
469
587
  writeFileSync(scopeDir("session", ctx), "not a directory");
470
- const refusal = resultError(await call(captured, "notes_write", { address: "blocked.md", content: "x" }, ctx));
588
+ const refusal = resultTextError(await call(captured, "notes_write", { address: "blocked.md", content: "x" }, ctx));
471
589
  assert.equal(refusal.code, "io_error");
472
590
  assert.equal(refusal.message, "notes operation failed");
473
591
  });
@@ -479,13 +597,13 @@ test("a body that repeats one anchor thousands of times refuses with bounded, co
479
597
  await call(captured, "notes_write", { address: "many.md", content: `${"beta\n".repeat(repeats)}end` }, ctx);
480
598
  const raw = await call(captured, "notes_update", { address: "many.md", edits: [{ oldText: "beta", newText: "B" }] }, ctx);
481
599
  assertWithinBudget(raw, "refusal with thousands of match lines");
482
- const refusal = resultError(raw);
600
+ const refusal = resultTextError(raw);
483
601
  assert.equal(refusal.code, "ambiguous_edit");
484
602
  assert.match(refusal.message, /edits\[0\]/, "the message names the failing edit index");
485
603
  assert.match(refusal.message, /5000 times/, "the message names the exact total");
486
604
  assert.ok(refusal.message.length < repeats, "the message summarizes rather than enumerating every line");
487
605
  assert.equal(resultRead(await call(captured, "notes_read", { address: "many.md", max_chars: 15 }, ctx)).content, "beta\n".repeat(3), "the refused edit changed nothing");
488
- const replaced = resultData(await call(captured, "notes_update", { address: "many.md", edits: [{ oldText: "beta", newText: "B" }], replace_all: true }, ctx));
606
+ const replaced = resultText(await call(captured, "notes_update", { address: "many.md", edits: [{ oldText: "beta", newText: "B" }], replace_all: true }, ctx));
489
607
  assertWithinBudget(await call(captured, "notes_read", { address: "many.md" }, ctx), "read after replace_all");
490
- assert.equal(replaced.change_kind, "body");
608
+ assert.match(replaced, /^updated many\.md\b/);
491
609
  });