@gavin-hu/my-pi-agent 0.18.0 → 0.19.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 (249) hide show
  1. package/README.md +52 -44
  2. package/README.zh-CN.md +46 -41
  3. package/docs/extensions/README.md +34 -0
  4. package/docs/extensions/board.md +344 -0
  5. package/{extensions/bytefly/README.md → docs/extensions/bytefly.md} +446 -404
  6. package/{extensions/check/README.md → docs/extensions/check.md} +83 -68
  7. package/{extensions/context/README.md → docs/extensions/context.md} +40 -23
  8. package/docs/extensions/file-browse.md +554 -0
  9. package/{extensions/file-open/README.md → docs/extensions/file-open.md} +31 -23
  10. package/{extensions/file-read/README.md → docs/extensions/file-read.md} +47 -55
  11. package/{extensions/goal/README.md → docs/extensions/goal.md} +115 -131
  12. package/{extensions/job/README.md → docs/extensions/job.md} +61 -50
  13. package/{extensions/memory/README.md → docs/extensions/memory.md} +71 -60
  14. package/{extensions/plan/README.md → docs/extensions/plan.md} +390 -317
  15. package/{extensions/question/README.md → docs/extensions/question.md} +54 -31
  16. package/{extensions/rewind/README.md → docs/extensions/rewind.md} +115 -122
  17. package/docs/extensions/session-bus.md +285 -0
  18. package/{extensions/subagent/README.md → docs/extensions/subagent.md} +165 -118
  19. package/docs/extensions/team.md +226 -0
  20. package/{extensions/todo/README.md → docs/extensions/todo.md} +85 -88
  21. package/{extensions/watch/README.md → docs/extensions/watch.md} +54 -36
  22. package/{extensions/web-access/README.md → docs/extensions/web-access.md} +93 -50
  23. package/{extensions/wechat/README.md → docs/extensions/wechat.md} +258 -162
  24. package/{extensions/worktree/README.md → docs/extensions/worktree.md} +115 -72
  25. package/extensions/board/commands.ts +87 -0
  26. package/extensions/board/config.ts +36 -0
  27. package/extensions/board/format.ts +72 -0
  28. package/extensions/board/index.ts +40 -0
  29. package/extensions/board/input.ts +54 -0
  30. package/extensions/board/join.ts +42 -0
  31. package/extensions/board/page.ts +312 -0
  32. package/extensions/board/result.ts +99 -0
  33. package/extensions/board/rows.ts +48 -0
  34. package/extensions/board/schema.ts +75 -0
  35. package/extensions/board/seat.ts +29 -0
  36. package/extensions/board/snapshot.ts +41 -0
  37. package/extensions/board/tools.ts +279 -0
  38. package/extensions/board/transport/router.ts +172 -0
  39. package/extensions/board/transport/server.ts +149 -0
  40. package/extensions/board/types.ts +54 -0
  41. package/extensions/board/view/actions.ts +306 -0
  42. package/extensions/board/view/client.ts +41 -0
  43. package/extensions/board/view/keys.ts +121 -0
  44. package/extensions/board/view/live.ts +397 -0
  45. package/extensions/board/view/page.ts +158 -0
  46. package/extensions/board/view/render.ts +496 -0
  47. package/extensions/board/view/styles.ts +211 -0
  48. package/extensions/board/view/team.ts +305 -0
  49. package/extensions/board/writes.ts +99 -0
  50. package/extensions/bytefly/panel/commands.ts +40 -7
  51. package/extensions/bytefly/panel/settings-runtime.ts +0 -6
  52. package/extensions/bytefly/panel/settings.ts +3 -20
  53. package/extensions/bytefly/panel/tui/settings-view.ts +1 -1
  54. package/extensions/bytefly/picker/discovery.ts +0 -2
  55. package/extensions/bytefly/picker/types.ts +0 -2
  56. package/extensions/bytefly/update/check.ts +39 -0
  57. package/extensions/bytefly/update/format.ts +15 -0
  58. package/extensions/bytefly/update/register.ts +73 -34
  59. package/extensions/bytefly/update/state.ts +6 -3
  60. package/extensions/context/tui.ts +1 -1
  61. package/extensions/file-browse/{config.ts → config/config.ts} +1 -1
  62. package/extensions/file-browse/{files.ts → files/files.ts} +1 -14
  63. package/extensions/file-browse/{paths.ts → files/paths.ts} +1 -1
  64. package/extensions/file-browse/{git.ts → git/git.ts} +10 -3
  65. package/extensions/file-browse/index.ts +4 -4
  66. package/extensions/file-browse/{live.ts → live/live.ts} +20 -69
  67. package/extensions/file-browse/{router.ts → transport/router.ts} +21 -15
  68. package/extensions/file-browse/transport/server.ts +110 -0
  69. package/extensions/file-browse/{chrome.ts → view/chrome.ts} +4 -4
  70. package/extensions/file-browse/{client.ts → view/client.ts} +1 -1
  71. package/extensions/file-browse/{diff-html.ts → view/diff-html.ts} +3 -3
  72. package/extensions/file-browse/{html.ts → view/html.ts} +14 -12
  73. package/extensions/file-browse/{icons.ts → view/icons.ts} +1 -1
  74. package/extensions/file-browse/{markdown.ts → view/markdown.ts} +7 -7
  75. package/extensions/file-browse/{raw-html.ts → view/raw-html.ts} +1 -1
  76. package/extensions/file-browse/{styles.ts → view/styles.ts} +29 -5
  77. package/extensions/file-browse/{tree.ts → view/tree.ts} +1 -1
  78. package/extensions/file-browse/{urls.ts → view/urls.ts} +1 -1
  79. package/extensions/file-read/schema.ts +2 -1
  80. package/extensions/memory/store.ts +12 -5
  81. package/extensions/plan/blocks.ts +23 -2
  82. package/extensions/plan/commands.ts +21 -16
  83. package/extensions/plan/feedback.ts +147 -38
  84. package/extensions/plan/index.ts +6 -4
  85. package/extensions/plan/plan-index.ts +43 -9
  86. package/extensions/plan/plan-text.ts +33 -23
  87. package/extensions/plan/plans.ts +8 -11
  88. package/extensions/plan/policy.ts +20 -12
  89. package/extensions/plan/review.ts +3 -27
  90. package/extensions/plan/runtime.ts +21 -9
  91. package/extensions/plan/sections.ts +112 -0
  92. package/extensions/plan/steps.ts +3 -22
  93. package/extensions/plan/tools/exit.ts +11 -95
  94. package/extensions/plan/tui.ts +5 -34
  95. package/extensions/plan/types.ts +0 -8
  96. package/extensions/plan/web-client.ts +1 -1
  97. package/extensions/plan/web-page.ts +0 -7
  98. package/extensions/plan/web-router.ts +3 -57
  99. package/extensions/plan/web-share-session.ts +24 -30
  100. package/extensions/plan/web-streams.ts +14 -14
  101. package/extensions/plan/web-tokens.ts +2 -2
  102. package/extensions/plan/web.ts +66 -120
  103. package/extensions/rewind/{commands.ts → commands/commands.ts} +5 -5
  104. package/extensions/rewind/{review.ts → commands/review.ts} +13 -13
  105. package/extensions/rewind/{rewind.ts → commands/rewind.ts} +6 -6
  106. package/extensions/rewind/{config.ts → config/config.ts} +1 -1
  107. package/extensions/rewind/index.ts +3 -3
  108. package/extensions/rewind/{policy.ts → state/policy.ts} +4 -4
  109. package/extensions/rewind/{runtime.ts → state/runtime.ts} +11 -11
  110. package/extensions/rewind/{snapshot-run.ts → state/snapshot-run.ts} +1 -1
  111. package/extensions/rewind/{timeline.ts → state/timeline.ts} +2 -2
  112. package/extensions/rewind/{format.ts → text/format.ts} +3 -3
  113. package/extensions/rewind/{git.ts → transport/git.ts} +2 -2
  114. package/extensions/rewind/{restore.ts → transport/restore.ts} +2 -2
  115. package/extensions/rewind/{snapshot.ts → transport/snapshot.ts} +1 -1
  116. package/extensions/rewind/{store.ts → transport/store.ts} +1 -1
  117. package/extensions/rewind/{checklist.ts → view/checklist.ts} +6 -6
  118. package/extensions/rewind/{hunk-picker.ts → view/hunk-picker.ts} +8 -8
  119. package/extensions/rewind/{path-picker.ts → view/path-picker.ts} +7 -7
  120. package/extensions/rewind/{review-tui.ts → view/review-tui.ts} +11 -11
  121. package/extensions/rewind/{rewind-tui.ts → view/rewind-tui.ts} +17 -11
  122. package/extensions/rewind/{status.ts → view/status.ts} +4 -4
  123. package/extensions/session-bus/commands.ts +17 -69
  124. package/extensions/session-bus/format.ts +22 -45
  125. package/extensions/session-bus/index.ts +13 -7
  126. package/extensions/session-bus/join-request.ts +40 -0
  127. package/extensions/session-bus/mail-watch.ts +134 -0
  128. package/extensions/session-bus/notice.ts +32 -4
  129. package/{lib/claims → extensions/session-bus}/overlap.ts +11 -18
  130. package/extensions/session-bus/protocol.ts +19 -49
  131. package/extensions/session-bus/resolve.ts +67 -0
  132. package/extensions/session-bus/result.ts +16 -51
  133. package/extensions/session-bus/rows.ts +4 -2
  134. package/extensions/session-bus/runtime.ts +129 -238
  135. package/extensions/session-bus/store.ts +42 -6
  136. package/extensions/session-bus/tools.ts +31 -66
  137. package/extensions/session-bus/tui.ts +4 -4
  138. package/extensions/session-bus/types.ts +13 -13
  139. package/extensions/subagent/agents.ts +9 -8
  140. package/extensions/subagent/invocation.ts +4 -2
  141. package/extensions/team/commands.ts +112 -0
  142. package/extensions/team/dispatch.ts +133 -0
  143. package/extensions/team/format.ts +105 -0
  144. package/extensions/team/index.ts +33 -0
  145. package/extensions/team/schema.ts +29 -0
  146. package/extensions/team/tools.ts +246 -0
  147. package/extensions/team/types.ts +48 -0
  148. package/extensions/web-access/fetch/page.ts +4 -1
  149. package/extensions/web-access/fetch/structured.ts +447 -0
  150. package/extensions/web-access/fetch/tool.ts +2 -1
  151. package/extensions/web-access/search/tool.ts +2 -1
  152. package/extensions/wechat/bridge.ts +76 -92
  153. package/extensions/wechat/{commands.ts → commands/commands.ts} +26 -18
  154. package/extensions/wechat/{doctor.ts → commands/doctor.ts} +5 -5
  155. package/extensions/wechat/{history.ts → commands/history.ts} +1 -1
  156. package/extensions/wechat/{login.ts → commands/login.ts} +3 -3
  157. package/extensions/wechat/{slash.ts → commands/slash.ts} +38 -2
  158. package/extensions/wechat/dialog/channels.ts +136 -0
  159. package/extensions/wechat/{interaction.ts → dialog/interaction.ts} +37 -37
  160. package/extensions/wechat/{prompt.ts → dialog/prompt.ts} +2 -2
  161. package/extensions/wechat/{remote-ui.ts → dialog/remote-ui.ts} +1 -1
  162. package/extensions/wechat/index.ts +10 -10
  163. package/extensions/wechat/{admission.ts → peer/admission.ts} +2 -2
  164. package/extensions/wechat/{peer-session.ts → peer/peer-session.ts} +2 -2
  165. package/extensions/wechat/{peer-worker.ts → peer/peer-worker.ts} +100 -22
  166. package/extensions/wechat/{presence.ts → peer/presence.ts} +8 -7
  167. package/extensions/wechat/{reply-pipeline.ts → peer/reply-pipeline.ts} +1 -1
  168. package/extensions/wechat/{credentials.ts → state/credentials.ts} +2 -2
  169. package/extensions/wechat/{state.ts → state/state.ts} +14 -2
  170. package/extensions/wechat/{format.ts → text/format.ts} +3 -3
  171. package/extensions/wechat/{notices.ts → text/notices.ts} +8 -0
  172. package/extensions/wechat/tools.ts +29 -12
  173. package/extensions/wechat/{client.ts → transport/client.ts} +26 -2
  174. package/extensions/wechat/{deliver.ts → transport/deliver.ts} +72 -28
  175. package/extensions/wechat/{inbound.ts → transport/inbound.ts} +5 -5
  176. package/extensions/wechat/{media.ts → transport/media.ts} +11 -5
  177. package/extensions/wechat/transport/outbound.ts +142 -0
  178. package/extensions/wechat/{poll.ts → transport/poll.ts} +3 -3
  179. package/extensions/wechat/types.ts +10 -1
  180. package/extensions/wechat/{login-screen.ts → view/login-screen.ts} +4 -4
  181. package/extensions/wechat/{status-screen.ts → view/status-screen.ts} +31 -26
  182. package/extensions/worktree/guard.ts +3 -5
  183. package/lib/README.md +8 -6
  184. package/lib/board/card.ts +290 -0
  185. package/lib/board/links.ts +117 -0
  186. package/lib/board/page-pointer.ts +256 -0
  187. package/lib/board/round-text.ts +72 -0
  188. package/lib/board/round.ts +89 -0
  189. package/lib/board/rules.ts +304 -0
  190. package/lib/board/session.ts +105 -0
  191. package/lib/board/store.ts +310 -0
  192. package/lib/board/view.ts +150 -0
  193. package/lib/errors.ts +12 -4
  194. package/lib/format.ts +13 -0
  195. package/lib/http/guard.ts +112 -0
  196. package/lib/http/index.ts +16 -5
  197. package/lib/http/serve.ts +234 -0
  198. package/lib/http/server.ts +12 -10
  199. package/lib/http/sink.ts +110 -0
  200. package/lib/http/token.ts +38 -0
  201. package/lib/policy.ts +12 -2
  202. package/lib/requirements.ts +6 -7
  203. package/lib/session-label.ts +64 -0
  204. package/lib/session-roster.ts +130 -0
  205. package/lib/session-tool.ts +184 -0
  206. package/lib/tool-names.ts +25 -2
  207. package/lib/tui/glyphs.ts +2 -0
  208. package/lib/web/README.md +5 -2
  209. package/lib/web/components.ts +5 -0
  210. package/lib/web/runtime.ts +7 -1
  211. package/lib/web/tokens.ts +25 -2
  212. package/package.json +26 -14
  213. package/skills/next/SKILL.md +4 -3
  214. package/skills/project-docs/SKILL.md +133 -0
  215. package/skills/project-docs/references/audit.md +131 -0
  216. package/skills/project-docs/references/changelog.md +105 -0
  217. package/skills/project-docs/references/discovery.md +127 -0
  218. package/skills/project-docs/references/readme.md +80 -0
  219. package/skills/project-docs/references/release.md +84 -0
  220. package/skills/project-docs/references/roadmap.md +93 -0
  221. package/skills/project-docs/scripts/state.ts +316 -0
  222. package/skills/refactor/SKILL.md +100 -125
  223. package/skills/refactor/references/handoff.md +35 -0
  224. package/skills/refactor/references/signals.md +54 -0
  225. package/skills/refactor/scripts/inventory.ts +587 -0
  226. package/extensions/file-browse/README.md +0 -506
  227. package/extensions/file-browse/server.ts +0 -141
  228. package/extensions/plan/split.ts +0 -87
  229. package/extensions/session-bus/README.md +0 -247
  230. package/extensions/session-bus/team.ts +0 -102
  231. package/extensions/wechat/outbound.ts +0 -100
  232. package/lib/plans/sections.ts +0 -172
  233. package/lib/plans/setting.ts +0 -52
  234. package/lib/plans/split.ts +0 -215
  235. package/lib/plans/store.ts +0 -19
  236. package/lib/plans/team.ts +0 -151
  237. package/skills/changelog/SKILL.md +0 -148
  238. package/skills/parallel-dev/SKILL.md +0 -150
  239. /package/extensions/file-browse/{rev.ts → live/rev.ts} +0 -0
  240. /package/extensions/file-browse/{diff.ts → text/diff.ts} +0 -0
  241. /package/extensions/file-browse/{fuzzy.ts → text/fuzzy.ts} +0 -0
  242. /package/extensions/file-browse/{live-client.ts → view/live-client.ts} +0 -0
  243. /package/extensions/file-browse/{palette.ts → view/palette.ts} +0 -0
  244. /package/extensions/rewind/{patch.ts → text/patch.ts} +0 -0
  245. /package/extensions/rewind/{paths.ts → text/paths.ts} +0 -0
  246. /package/extensions/rewind/{queue.ts → transport/queue.ts} +0 -0
  247. /package/extensions/rewind/{temp-index.ts → transport/temp-index.ts} +0 -0
  248. /package/extensions/wechat/{lock.ts → state/lock.ts} +0 -0
  249. /package/extensions/wechat/{channel.ts → text/channel.ts} +0 -0
@@ -7,7 +7,28 @@ live as human-editable markdown, not in the session branch, so they survive
7
7
  `AGENTS.md`; `memory` is for the one-liners the model should not have to be
8
8
  reminded of twice.
9
9
 
10
- <img src="../../assets/memory.png" alt="The /memory picker: a Memory title rule, an `All · 3 project, 2 global` summary, five notes tagged by scope with the focused one marked, and the key hints" width="100%">
10
+ <img src="../../assets/screens/memory.png" alt="The /memory picker: a Memory title rule, an `All · 3 project, 2 global` summary, five notes tagged by scope with the focused one marked, and the key hints" width="100%">
11
+
12
+ ## Capabilities
13
+
14
+ Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
15
+
16
+ | Capability | How | What you get | Status |
17
+ |---|---|---|---|
18
+ | Automatic recall | the `[MEMORY]` context message | Stored notes arrive before each run, bounded by a byte cap, without the user asking. | Shipped |
19
+ | Durable notes | `memory` | The model adds, updates, forgets, or lists short facts that outlive the session branch. | Shipped |
20
+ | Two scopes | the `scope` parameter, `/memory path` | Notes are global or per-project, each a plain markdown file you can edit by hand. | Shipped |
21
+ | Repo-root anchor | the `project` store | The project store is anchored at the repository root, so a subdirectory and every worktree read the same file. | Shipped |
22
+ | Note picker | `/memory` | Add, edit, forget, merge, or move a note in the TUI, with a scope filter and a reload. | Shipped |
23
+ | Whole-file editing | `/memory edit`, `/memory clear` | The file in the multi-line editor, or a scope cleared behind a confirm. | Shipped |
24
+ | Duplicate guard | `memory` `add` | Re-stating a stored fact in new words is a no-op that names the existing note. | Shipped |
25
+ | Store health | `/memory doctor` | Counts, file bytes, the injection budget with its omissions, and near-duplicate pairs. | Shipped |
26
+ | Store freshness | `memory`, `/memory reload` | A hand edit is picked up on the next read, and `reload` forces it. | Shipped |
27
+ | Recall off switch | `memory.inject` | Injection can be turned off without deleting the notes, for a session that must not receive them. | Shipped |
28
+ | Trust-gated project store | the `project` scope | The project file is read and written only when the project is trusted. | Shipped |
29
+ | Headless coverage | `list`, `path`, `reload`, `doctor` outside `tui` | Read-only verbs notify everywhere; picker, edit, and clear require an interactive session. | Shipped |
30
+
31
+ ## Quickstart
11
32
 
12
33
  ```bash
13
34
  pi --extension ./extensions/memory # load just this extension
@@ -15,61 +36,42 @@ pi -e . # load the whole @gavin-hu/my-pi-agent pac
15
36
  pi install ./ # install the package
16
37
  ```
17
38
 
18
- ## Tool rendering
39
+ ```text
40
+ /memory # open the picker (a listing elsewhere)
41
+ /memory doctor # check the stores and the injection budget
42
+ ```
43
+
44
+ ## Tool
19
45
 
20
46
  How the `memory` call and its result look in the transcript — the call line as a headline and the body indented under it:
21
47
 
22
48
  <img src="../../assets/tools/memory.png" alt="The memory tool's result: the call line and an indented body confirming the write and the new project and global counts" width="100%">
23
49
 
24
- ## What it does
25
-
26
- - Registers one model-callable tool, `memory`, with four actions: `add` a note,
27
- `update` an exact note, `forget` an exact note, or `list` what is stored.
28
- `add` is a no-op when the note already exists, ignoring case and trailing
29
- punctuation, so re-stating a fact in new words does not grow the store.
30
- - Keeps two stores, both plain markdown with one bullet per note:
31
-
32
- | Scope | File |
33
- |---|---|
34
- | `global` | `<agent-dir>/memory.md` |
35
- | `project` | `<repo-root>/.pi/memory.md` |
36
-
37
- The project store is anchored at the **repository root**, so it is stable when
38
- Pi runs from a subdirectory and shared across git worktrees.
39
- - Injects the stored notes as a hidden `[MEMORY]` context message before each
40
- run, bounded by a byte cap, so the model recalls them without being asked.
41
- - Re-reads each store when its file changes on disk (compared by mtime and size),
42
- so an external edit lands in the same session without a restart.
43
- - Exposes `/memory`: in the TUI it opens a picker to add, edit, or forget a
44
- single note, merge two notes into one, move a note to the other scope, filter
45
- by scope, and reload; elsewhere it lists the store. `/memory path`, `edit`, and `clear` print the file paths,
46
- open the multi-line editor, and clear a scope; `/memory doctor` reports store
47
- health.
48
- - Reports store health with `/memory doctor`: note counts and file bytes per
49
- scope, how much of the `maxInjectBytes` budget the injection uses and which
50
- scope overflowed it, and the near-duplicate pairs the conservative key already
51
- considers one fact. It is read-only — the report names the pair and the picker
52
- merges it.
53
- - Loads and writes the project store only when the project is trusted, sanitizes
54
- every note to one terminal-safe line, and writes atomically.
50
+ `memory` — direct exposure (the default), `executionMode: "sequential"`,
51
+ annotations `readOnlyHint: false`, `destructiveHint: true` (forget deletes),
52
+ `idempotentHint: true`, `openWorldHint: false`. It is a singleton tool with an
53
+ action switch (like `job`); `list` reads both stores, and the other three
54
+ mutate one.
55
55
 
56
- ## Tool
56
+ | Parameter | Type | Meaning |
57
+ |---|---|---|
58
+ | `action` | `add` \| `update` \| `forget` \| `list` | What to do with the store. |
59
+ | `text` | string | The note to add, or the exact note to update or forget. Required for `add`/`update`/`forget`. |
60
+ | `to` | string | The replacement note for `update`. Required for `update`. |
61
+ | `scope` | `project` (default) \| `global` | Which store `add`/`update`/`forget` changes. |
57
62
 
58
- `memory` is a singleton tool with an action switch (like `job`). It declares an
59
- `outputSchema` and returns matching `structuredContent`
60
- (`{ action, scope, project, global, changed, entry?, to?, existing?, error? }`).
63
+ Result (`details` / `structuredContent`, `MemoryResult`): `{ action, scope,
64
+ project, global, changed, entry?, to?, existing?, error? }`.
61
65
 
62
- | Field | Value |
66
+ The two stores are plain markdown with one bullet per note:
67
+
68
+ | Scope | File |
63
69
  |---|---|
64
- | `name` | `memory` |
65
- | `action` | `add` \| `update` \| `forget` \| `list` |
66
- | `text` | The note to add, or the exact note to update or forget. Required for `add`/`update`/`forget`. |
67
- | `to` | The replacement note for `update`. Required for `update`. |
68
- | `scope` | `project` (default) or `global`. Used by `add`/`update`/`forget`. |
69
- | `exposure` | `direct` (default). |
70
- | `executionMode` | `sequential` — calls share the cached stores. |
71
- | `annotations` | `readOnlyHint: false`, `destructiveHint: true` (forget deletes), `idempotentHint: true`, `openWorldHint: false`. |
72
- | `outputSchema` | `MemoryResult` — also returned as `structuredContent`. |
70
+ | `global` | `<agent-dir>/memory.md` |
71
+ | `project` | `<repo-root>/.pi/memory.md` |
72
+
73
+ The project store is anchored at the **repository root**, so it is stable when
74
+ Pi runs from a subdirectory and shared across git worktrees.
73
75
 
74
76
  Validation happens before anything is written (a violation returns an error
75
77
  result carrying the unchanged notes, never a half-apply): a known action; a
@@ -97,6 +99,10 @@ or stem both survive.
97
99
 
98
100
  ## Commands
99
101
 
102
+ `/memory` opens the picker in the TUI and notifies the stored notes elsewhere.
103
+ `list`, `path`, `reload`, and `doctor` report through `notify` in every mode;
104
+ `edit` and `clear` need an interactive session.
105
+
100
106
  | Command | What it does |
101
107
  |---|---|
102
108
  | `/memory` | In the TUI, open the picker (add, edit, forget, merge, or move notes; `s`/Tab filters by scope; `r` reloads). Other modes notify the stored notes. |
@@ -145,9 +151,8 @@ not change it.
145
151
 
146
152
  ## Configuration
147
153
 
148
- The `memory` section of the shared `bytefly.json`, read from the global
149
- document then the project document (project values override global; missing or
150
- malformed documents are ignored):
154
+ The `memory` section of the shared `bytefly.json`; resolution rules are in
155
+ [`../configuration.md`](../configuration.md#memory--durable-notes):
151
156
 
152
157
  | Key | Default | Meaning |
153
158
  |---|---|---|
@@ -177,10 +182,13 @@ skill. Mitigations:
177
182
 
178
183
  - Notes are injected whole (bounded), so a very large store is truncated with a
179
184
  `(+N more; use the memory tool)` tail rather than summarized.
180
- - External edits to a store are picked up automatically by an mtime/size check
181
- before the next injection or tool call. A same-size edit within one filesystem
182
- mtime tick is only caught by `/memory reload`; a store that becomes unreadable
183
- (symlinked or over the size cap) keeps its last good view until fixed.
185
+ - External edits to a store are picked up automatically by an `(mtimeNs, size)`
186
+ check before the next injection or tool call, so a same-size edit inside one
187
+ millisecond is seen. The residual case is the filesystem's own resolution: where
188
+ the stamp is no finer than the last one read — a one-second mtime, or a write
189
+ the kernel coalesced — only `/memory reload` catches the edit. A store that
190
+ becomes unreadable (symlinked or over the size cap) keeps its last good view
191
+ until fixed.
184
192
  - Matching for `forget` is exact and case-sensitive.
185
193
  - The near-duplicate guard on `add` is deliberately conservative: it folds
186
194
  case, whitespace runs, and trailing sentence punctuation only, never word
@@ -188,8 +196,8 @@ skill. Mitigations:
188
196
  both be stored; `/memory doctor` reports the pairs the key does consider equal,
189
197
  and `m` in the picker merges them under wording you write.
190
198
  - `update` replaces every exact match of `text`; a replacement that already
191
- exists under a different note can leave a duplicate. Forget the old note first
192
- when consolidating, or merge the pair in the picker afterward.
199
+ exists under a different note can leave a duplicate. Forget the old note first
200
+ when consolidating, or merge the pair in the picker afterward.
193
201
  - Only one note per line; multi-line notes are collapsed to a single line.
194
202
 
195
203
  ## Non-goals
@@ -237,10 +245,13 @@ when consolidating, or merge the pair in the picker afterward.
237
245
  writers for the same file, and each write lands atomically via a temp file and
238
246
  rename; `executionMode: "sequential"` keeps in-process calls ordered as well.
239
247
  - **Stamped cache, not a watcher.** The session cache is validated against each
240
- file's `(mtimeMs, size)` stamp before every read, matching the worktree cache's
241
- freshness check rather than holding an `fs.watch` handle. A mutation adopts the
242
- fresh on-disk stamp, so a self-write is not mistaken for an external change, and
243
- a failed re-read keeps the last good view instead of breaking the run.
248
+ file's `(mtimeNs, size)` stamp before every read rather than holding an
249
+ `fs.watch` handle. The stamp is the nanosecond field a bigint `stat` returns, so
250
+ a same-size edit in the same millisecond is a distinct state; a millisecond
251
+ stamp would have to read the file on every run to tell them apart. A mutation
252
+ adopts the fresh on-disk stamp, so a self-write is not mistaken for an external
253
+ change, and a failed re-read keeps the last good view instead of breaking the
254
+ run.
244
255
 
245
256
  ## Files
246
257