pi-smart-compact 9.7.1 → 10.0.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 (208) hide show
  1. package/ARCHITECTURE.md +979 -372
  2. package/CHANGELOG.md +710 -0
  3. package/LICENSE +8 -0
  4. package/README.md +130 -640
  5. package/SECURITY.md +34 -12
  6. package/SUPPORT.md +26 -9
  7. package/assets/DejaVu-LICENSE.txt +187 -0
  8. package/assets/DejaVuSansMono.ttf +0 -0
  9. package/assets/README.md +26 -0
  10. package/assets/skills/context-management/SKILL.md +34 -0
  11. package/dist/app/anchor-cache.d.ts +36 -0
  12. package/dist/app/anchor-cache.d.ts.map +1 -0
  13. package/dist/app/artifact-storage.d.ts +47 -0
  14. package/dist/app/artifact-storage.d.ts.map +1 -0
  15. package/dist/app/background-preparation.d.ts +39 -0
  16. package/dist/app/background-preparation.d.ts.map +1 -0
  17. package/dist/app/compaction-commit-store.d.ts +5 -1
  18. package/dist/app/compaction-commit-store.d.ts.map +1 -1
  19. package/dist/app/context-evidence.d.ts +57 -0
  20. package/dist/app/context-evidence.d.ts.map +1 -0
  21. package/dist/app/context-guide.d.ts +3 -0
  22. package/dist/app/context-guide.d.ts.map +1 -0
  23. package/dist/app/context-operations.d.ts +106 -0
  24. package/dist/app/context-operations.d.ts.map +1 -0
  25. package/dist/app/effective-state.d.ts +23 -0
  26. package/dist/app/effective-state.d.ts.map +1 -0
  27. package/dist/app/extension-conflicts.d.ts +15 -0
  28. package/dist/app/extension-conflicts.d.ts.map +1 -0
  29. package/dist/app/global-settings-runtime.d.ts +3 -3
  30. package/dist/app/global-settings-runtime.d.ts.map +1 -1
  31. package/dist/app/hindsight-memory.d.ts +100 -0
  32. package/dist/app/hindsight-memory.d.ts.map +1 -0
  33. package/dist/app/host-cache-ledger.d.ts +68 -0
  34. package/dist/app/host-cache-ledger.d.ts.map +1 -0
  35. package/dist/app/lazy-tools.d.ts +36 -0
  36. package/dist/app/lazy-tools.d.ts.map +1 -0
  37. package/dist/app/memory-backend.d.ts +58 -0
  38. package/dist/app/memory-backend.d.ts.map +1 -0
  39. package/dist/app/mnemopi-memory.d.ts +13 -0
  40. package/dist/app/mnemopi-memory.d.ts.map +1 -0
  41. package/dist/app/mnemopi-protocol.d.ts +78 -0
  42. package/dist/app/mnemopi-protocol.d.ts.map +1 -0
  43. package/dist/app/mnemopi-worker.d.ts +2 -0
  44. package/dist/app/mnemopi-worker.d.ts.map +1 -0
  45. package/dist/app/model-feasibility.d.ts +20 -0
  46. package/dist/app/model-feasibility.d.ts.map +1 -0
  47. package/dist/app/native-compaction.d.ts +88 -0
  48. package/dist/app/native-compaction.d.ts.map +1 -0
  49. package/dist/app/native-continuity-bridge.d.ts.map +1 -1
  50. package/dist/app/navigation-data.d.ts +28 -0
  51. package/dist/app/navigation-data.d.ts.map +1 -0
  52. package/dist/app/navigation-types.d.ts +60 -0
  53. package/dist/app/navigation-types.d.ts.map +1 -0
  54. package/dist/app/pending-slot.d.ts +11 -1
  55. package/dist/app/pending-slot.d.ts.map +1 -1
  56. package/dist/app/preflight.d.ts.map +1 -1
  57. package/dist/app/register-context-tools.d.ts +16 -3
  58. package/dist/app/register-context-tools.d.ts.map +1 -1
  59. package/dist/app/register-navigation.d.ts +20 -0
  60. package/dist/app/register-navigation.d.ts.map +1 -0
  61. package/dist/app/register-smart-compact-command.d.ts +17 -2
  62. package/dist/app/register-smart-compact-command.d.ts.map +1 -1
  63. package/dist/app/register-smart-compact-tool.d.ts.map +1 -1
  64. package/dist/app/register-smart-context-tool.d.ts +55 -0
  65. package/dist/app/register-smart-context-tool.d.ts.map +1 -0
  66. package/dist/app/run-context.d.ts +1 -0
  67. package/dist/app/run-context.d.ts.map +1 -1
  68. package/dist/app/run-smart-compact.d.ts +3 -3
  69. package/dist/app/run-smart-compact.d.ts.map +1 -1
  70. package/dist/app/session-handoff.d.ts +64 -0
  71. package/dist/app/session-handoff.d.ts.map +1 -0
  72. package/dist/app/session-lineage.d.ts +17 -0
  73. package/dist/app/session-lineage.d.ts.map +1 -0
  74. package/dist/app/session-run-lock.d.ts +0 -2
  75. package/dist/app/session-run-lock.d.ts.map +1 -1
  76. package/dist/app/settled-auto-trigger.d.ts +2 -0
  77. package/dist/app/settled-auto-trigger.d.ts.map +1 -1
  78. package/dist/app/smart-compact-input.d.ts +1 -1
  79. package/dist/app/smart-compact-input.d.ts.map +1 -1
  80. package/dist/app/smart-compact-policy.d.ts +1 -1
  81. package/dist/app/smart-compact-policy.d.ts.map +1 -1
  82. package/dist/app/steps/extract.d.ts +45 -1
  83. package/dist/app/steps/extract.d.ts.map +1 -1
  84. package/dist/app/steps/metrics.d.ts +1 -0
  85. package/dist/app/steps/metrics.d.ts.map +1 -1
  86. package/dist/app/steps/persist.d.ts.map +1 -1
  87. package/dist/app/steps/prepare.d.ts.map +1 -1
  88. package/dist/app/steps/recover.d.ts +9 -0
  89. package/dist/app/steps/recover.d.ts.map +1 -1
  90. package/dist/app/steps/synthesize.d.ts.map +1 -1
  91. package/dist/app/steps/tier.d.ts.map +1 -1
  92. package/dist/app/steps/verify.d.ts.map +1 -1
  93. package/dist/app/steps/visual.d.ts +4 -0
  94. package/dist/app/steps/visual.d.ts.map +1 -0
  95. package/dist/app/steps/window.d.ts.map +1 -1
  96. package/dist/app/tool-artifacts.d.ts +27 -0
  97. package/dist/app/tool-artifacts.d.ts.map +1 -0
  98. package/dist/app/visual-archive.d.ts +29 -0
  99. package/dist/app/visual-archive.d.ts.map +1 -0
  100. package/dist/constants.d.ts +96 -1
  101. package/dist/constants.d.ts.map +1 -1
  102. package/dist/domain/compaction-usage.d.ts +16 -0
  103. package/dist/domain/compaction-usage.d.ts.map +1 -0
  104. package/dist/domain/model-capacity.d.ts +12 -0
  105. package/dist/domain/model-capacity.d.ts.map +1 -0
  106. package/dist/domain/provider-evaluation.d.ts +7 -0
  107. package/dist/domain/provider-evaluation.d.ts.map +1 -1
  108. package/dist/domain/telemetry.d.ts +43 -2
  109. package/dist/domain/telemetry.d.ts.map +1 -1
  110. package/dist/domain/tool-semantics.d.ts +23 -0
  111. package/dist/domain/tool-semantics.d.ts.map +1 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +15857 -6965
  114. package/dist/infra/ai-messages.d.ts +1 -1
  115. package/dist/infra/ai-messages.d.ts.map +1 -1
  116. package/dist/infra/context-graph.d.ts +38 -7
  117. package/dist/infra/context-graph.d.ts.map +1 -1
  118. package/dist/infra/fs.d.ts.map +1 -1
  119. package/dist/infra/hindsight-client.d.ts +73 -0
  120. package/dist/infra/hindsight-client.d.ts.map +1 -0
  121. package/dist/infra/hindsight-receipts.d.ts +68 -0
  122. package/dist/infra/hindsight-receipts.d.ts.map +1 -0
  123. package/dist/infra/llm-client.d.ts +26 -23
  124. package/dist/infra/llm-client.d.ts.map +1 -1
  125. package/dist/infra/memory-ref.d.ts +27 -0
  126. package/dist/infra/memory-ref.d.ts.map +1 -0
  127. package/dist/infra/native-protocol.d.ts +54 -0
  128. package/dist/infra/native-protocol.d.ts.map +1 -0
  129. package/dist/infra/optional-components.d.ts +15 -0
  130. package/dist/infra/optional-components.d.ts.map +1 -0
  131. package/dist/infra/paths.d.ts +2 -0
  132. package/dist/infra/paths.d.ts.map +1 -1
  133. package/dist/infra/services.d.ts +15 -5
  134. package/dist/infra/services.d.ts.map +1 -1
  135. package/dist/infra/visual-renderer.d.ts +16 -0
  136. package/dist/infra/visual-renderer.d.ts.map +1 -0
  137. package/dist/mnemopi-worker.js +213 -0
  138. package/dist/phases/explore.d.ts +12 -9
  139. package/dist/phases/explore.d.ts.map +1 -1
  140. package/dist/phases/synthesize.d.ts +18 -3
  141. package/dist/phases/synthesize.d.ts.map +1 -1
  142. package/dist/phases/verify.d.ts +5 -1
  143. package/dist/phases/verify.d.ts.map +1 -1
  144. package/dist/rtk.d.ts +7 -0
  145. package/dist/rtk.d.ts.map +1 -0
  146. package/dist/rtk.js +767 -0
  147. package/dist/types.d.ts +128 -4
  148. package/dist/types.d.ts.map +1 -1
  149. package/dist/ui/dashboard-format.d.ts +2 -1
  150. package/dist/ui/dashboard-format.d.ts.map +1 -1
  151. package/dist/ui/dashboard-insights.d.ts +9 -1
  152. package/dist/ui/dashboard-insights.d.ts.map +1 -1
  153. package/dist/ui/error-format.d.ts +7 -2
  154. package/dist/ui/error-format.d.ts.map +1 -1
  155. package/dist/ui/handoff-overlay.d.ts +26 -0
  156. package/dist/ui/handoff-overlay.d.ts.map +1 -0
  157. package/dist/ui/home-overlay.d.ts +54 -0
  158. package/dist/ui/home-overlay.d.ts.map +1 -0
  159. package/dist/ui/metrics-dashboard-overlay.d.ts.map +1 -1
  160. package/dist/ui/metrics-report.d.ts.map +1 -1
  161. package/dist/ui/navigation-overlay.d.ts +92 -0
  162. package/dist/ui/navigation-overlay.d.ts.map +1 -0
  163. package/dist/ui/overlays.d.ts +12 -2
  164. package/dist/ui/overlays.d.ts.map +1 -1
  165. package/dist/ui/profiles.d.ts +51 -0
  166. package/dist/ui/profiles.d.ts.map +1 -0
  167. package/dist/ui/settings-complex.d.ts +49 -3
  168. package/dist/ui/settings-complex.d.ts.map +1 -1
  169. package/dist/ui/settings-list.d.ts +28 -0
  170. package/dist/ui/settings-list.d.ts.map +1 -0
  171. package/dist/ui/settings-overlay.d.ts +13 -6
  172. package/dist/ui/settings-overlay.d.ts.map +1 -1
  173. package/dist/ui/storage-report.d.ts +4 -0
  174. package/dist/ui/storage-report.d.ts.map +1 -0
  175. package/dist/utils/backups.d.ts.map +1 -1
  176. package/dist/utils/cache.d.ts +6 -2
  177. package/dist/utils/cache.d.ts.map +1 -1
  178. package/dist/utils/config.d.ts +12 -0
  179. package/dist/utils/config.d.ts.map +1 -1
  180. package/dist/utils/helpers.d.ts.map +1 -1
  181. package/dist/utils/id-fingerprint.d.ts +3 -1
  182. package/dist/utils/id-fingerprint.d.ts.map +1 -1
  183. package/dist/utils/issues.d.ts +61 -0
  184. package/dist/utils/issues.d.ts.map +1 -0
  185. package/dist/utils/pruning.d.ts.map +1 -1
  186. package/dist/utils/session-log.d.ts +0 -2
  187. package/dist/utils/session-log.d.ts.map +1 -1
  188. package/dist/utils/state.d.ts +3 -1
  189. package/dist/utils/state.d.ts.map +1 -1
  190. package/dist/utils/tokens.d.ts +10 -2
  191. package/dist/utils/tokens.d.ts.map +1 -1
  192. package/docs/MIGRATING_TO_V8.md +7 -1
  193. package/docs/README.md +69 -0
  194. package/docs/RELEASE.md +174 -56
  195. package/docs/assets/banner.png +0 -0
  196. package/docs/assets/banner.svg +1158 -70
  197. package/docs/assets/pi-smart-compact.png +0 -0
  198. package/docs/assets/pi-smart-compact.svg +24 -0
  199. package/docs/configuration.md +637 -0
  200. package/docs/evaluation.md +409 -0
  201. package/docs/guide.md +879 -0
  202. package/docs/hindsight-memory.md +314 -0
  203. package/docs/identity.md +124 -0
  204. package/package.json +44 -11
  205. package/dist/provider-eval.js +0 -2122
  206. package/dist/provider-scenario-eval.js +0 -2900
  207. package/dist/telemetry-report.js +0 -1973
  208. package/docs/provider-evaluation-2026-08-06.md +0 -63
package/CHANGELOG.md CHANGED
@@ -1,5 +1,715 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [10.0.0] - 2026-09-28
6
+
7
+ **Pi Continuity**: the stable release of the context-hygiene and session-continuity
8
+ rework. This release includes the work recorded in the unpublished
9
+ `9.8.0-canary.*` candidates below; those candidates were never npm releases.
10
+
11
+ ### Upgrade from 9.x
12
+
13
+ - Requires Pi **0.87.1+** and Node.js **22.19+**. The npm package remains
14
+ `pi-smart-compact`; commands, settings namespace and stored paths are not
15
+ renamed. See the [upgrade guide](./docs/guide.md#upgrade-from-9x).
16
+ - A bare `/smart-compact` opens Home in the TUI. Use **Compact now** for the
17
+ interactive flow; print/RPC/SDK use still runs compaction directly. Apply a
18
+ reviewed summary with **A**, not Enter.
19
+ - Agent tools load on demand through `smart_tools` by default. **Always
20
+ available** remains an explicit alternative; tool visibility is not permission
21
+ to bypass compaction or memory confirmation controls.
22
+ - Mnemopi, its optional Bun runtime and image rendering are separate optional
23
+ components, not automatic downloads. Readiness shows the correct install
24
+ command. The default local graph does not require these components.
25
+ - Use only one context-editing owner. Do not load pi-toolkit auto-context
26
+ alongside Continuity navigation. Claude subscription requests require the
27
+ separate adapter with final-payload normalization; the published adapter
28
+ `0.2.2` alone does not cover nested calls (upstream PR #10).
29
+
30
+ ### Added
31
+
32
+ - Recoverable context hygiene: queued manual and automatic cleanup, large-output
33
+ offload, checkpoint/rewind, archived-output search and paged reads. Automatic
34
+ cleanup uses pressure, catalog-price break-even or a cold-cache boundary;
35
+ shell calls, failures, instructions and recent work retain their protections.
36
+ - Session anchors, read-only recall across earlier sessions and branch navigation
37
+ with required carryover. Handoff opens a fresh session from recorded state
38
+ without a model call; lineage retrieval reaches parent-session evidence.
39
+ - A five-choice Home screen, task-oriented settings, effective-state/readiness
40
+ diagnostics, storage reporting and a host prompt-cache ledger.
41
+ - Exclusive project-memory backends: the local graph, an optional local Mnemopi
42
+ engine or an existing Hindsight server. Explicit saves need confirmation;
43
+ stable backend-bound refs support resolution without silent store fallback.
44
+ - Opt-in background preparation, provider-native compaction, image snapshots
45
+ and an explicitly loaded RTK companion. EESV text remains the default;
46
+ experimental provider/image results are not proof of semantic fidelity or
47
+ billed savings.
48
+ - Read-only session replay estimates and paired continuation/memory evaluation
49
+ tooling, with offline defaults and explicit approval for live provider use.
50
+ - GitHub-release-driven npm Trusted Publishing. `publish.yml` uses OIDC instead
51
+ of a stored npm token, preserves the full `prepublishOnly` release gate and
52
+ maps stable releases to `latest`, prereleases to `next`.
53
+
54
+ ### Changed
55
+
56
+ - Documentation now separates quick start, usage/reference and historical
57
+ evidence; long guides have clearer navigation and troubleshooting. Corrected
58
+ local-memory defaults, automatic-cleanup tool requirements, settings refresh
59
+ behavior and optional Hindsight authentication. Shipped pages link to
60
+ repository-only material without depending on excluded local files.
61
+ - Pi Continuity has a unified return-path mark, outlined vector banner and
62
+ reproducible SVG/PNG exports. The catalog image URL is unchanged; the README
63
+ uses a font-independent PNG banner. Asset ownership and export instructions
64
+ are documented in `docs/identity.md` and `assets/README.md`.
65
+ - Contributor and issue templates reflect current tools, privacy boundaries
66
+ and package contents. Repository paths and runtime identifiers are unchanged.
67
+ - Dated reports and pilot data moved to `docs/reports/` and, like the review
68
+ findings, are no longer packed into the npm package (about 150 KB less per
69
+ install; `docs/README.md` still indexes them).
70
+ - `replay-eval` gained `--since=DAYS` and `--progress`, and a session file that
71
+ changes while it is being read (a live session) is now skipped and counted
72
+ instead of failing the whole run.
73
+
74
+ ### Fixed
75
+
76
+ - Context edits, queued navigation and staged compactions revalidate branch,
77
+ session, model, configuration and cancellation state before applying. Rewind
78
+ and pivot change context, never files or external side effects.
79
+ - Archived-output integrity, lineage authorization and target-bound memory refs
80
+ reject tampered or mismatched evidence instead of silently reconstructing it.
81
+ - Provider calls use the requesting Pi session's model runtime, preserving
82
+ registered provider overrides. Native replay requires matching provider state
83
+ and the exact host summary wrapper.
84
+
85
+ ### Release decision
86
+
87
+ The release owner explicitly approved **10.0.0 stable** instead of another
88
+ canary. The available canary report was `HOLD`, with no completed candidate
89
+ cohort; this is a version-specific release-owner exception, not a `PROMOTE`
90
+ result. Deterministic checks and offline pilots do not establish live-model
91
+ quality, billed savings or a completed production observation window.
92
+
93
+ ## [9.8.0-canary.8] - 2026-09-28
94
+
95
+ Integration candidate for the maintainer's daily Pi (real-session data
96
+ collection on the cold-cache trim and the host cache ledger); not published.
97
+ Offline receipts, CI and the release audit are not a live evaluation or a
98
+ canary promotion.
99
+
100
+ ### Changed
101
+
102
+ - The Mnemopi engine (`@oh-my-pi/pi-mnemopi`), its `bun` runtime and the
103
+ image-snapshot renderer (`@resvg/resvg-js`) are no longer installed with
104
+ the extension. They are optional peer dependencies for features that are
105
+ off by default; a plain install used to download about 260 MB for them
106
+ (macOS arm64). When a selected feature lacks its component, Readiness,
107
+ the effective-state report and the failure notices show the exact
108
+ `npm install … --prefix <Pi install root> --legacy-peer-deps` command
109
+ (see README "Optional components"). The release audit now installs the
110
+ components the user's way into a Pi-style npm root and proves they survive
111
+ a Pi update.
112
+
113
+ ### Added
114
+
115
+ - Automatic cleanup held for a cold prompt cache now waits while Pi's cache
116
+ warming keeps the entry alive, and stops that warming once a refresh no
117
+ longer pays by Pi's $0.05 rule, counted net of the cache write the held
118
+ trim avoids; Home notes the stop. The host cache ledger and
119
+ `replay-eval` count a `cache_warm` refresh as keeping the prefix alive.
120
+ - At session start a notice names loaded extensions known to compact or edit
121
+ the same history (pi-openai-toolkit, context-fold, pi-fold,
122
+ pi-context-prune, pi-dcp, pi-toolkit's `context` tool), matched by exact
123
+ command/tool names and whole package path segments, and advises keeping
124
+ only one loaded. Nothing is blocked; unknown extensions are not detected.
125
+ - `/smart-compact handoff [-- note]` opens a new Pi session seeded with one
126
+ anchor message assembled from recorded state: the note, the latest branch
127
+ anchor, the continuity ledger (last Continuity compaction, else the saved
128
+ branch state), `pinPaths`, a memory recall through the selected store, and
129
+ pointers back to the parent session. No model call writes it; it is
130
+ scrubbed and capped at 16,000 characters, cutting recall first. Nothing
131
+ opens when there is no anchor, ledger or note.
132
+ - Home → History & recovery → **Hand off to a new session**: write a note,
133
+ review the seed (size, sources, full text), then confirm; the selection
134
+ starts on Go back. `/smart-compact handoff dry-run [-- note]` shows the seed
135
+ and opens nothing (TUI preview, a message in other UI modes).
136
+ - `smart_context` `status`/`search`/`read` take `scope: "lineage"`: they also
137
+ reach archived output of the sessions this one was handed off or forked
138
+ from, read-only, following `parentSession` up to 3 levels (files up to
139
+ 64 MiB; cycles and missing files end the walk). Parent sources carry
140
+ `session` and `depth`; each parent's own archive records authorize and
141
+ verify its outputs. The default `session` scope is unchanged. The handoff
142
+ seed now points at it instead of `/resume`.
143
+ - Automatic cleanup (`contextHygieneEnabled`) no longer waits only for
144
+ context pressure. A ready batch commits at a turn boundary under pressure,
145
+ or when the model's catalog prices say it pays back its prompt-cache rewrite
146
+ within 24 requests (`N* = ((w - r) × T) / (r × X)`); otherwise it is held
147
+ and sent with the first request after the cache expired, then committed
148
+ when that turn completes. Trim entries record the cause (`pressure`,
149
+ `break-even`, `cold`, `manual`, `agent`); `smart_context` `status` reports a
150
+ held batch as `deferredTrim`. The rule uses catalog price ratios and token
151
+ estimates, not measured cache behavior.
152
+ - `bun run replay-eval --sessions=<dir|file>` replays recorded sessions read-only
153
+ and estimates prompt tokens and catalog-priced cost per request under the
154
+ `none`, `pressure` and `timed-<N>` trim policies (`--break-even`,
155
+ `--rebuild-min`, `--limit`, `--json`), next to the recorded usage. Replay
156
+ estimates only; see `docs/evaluation.md`.
157
+ - The compaction result returned to Pi carries the provider-reported usage of
158
+ the applied run (EESV stage calls or the provider-native compaction
159
+ request), priced at each route model's catalog rates, so Pi's session
160
+ totals and cost include the extension's own work. Cached or estimated runs
161
+ contribute nothing rather than a guess.
162
+ - A foreign compaction (another extension's, or Pi's built-in one) no longer
163
+ passes silently: a prepared Continuity summary it displaces is recorded as
164
+ `discarded` (`native-apply:foreign`) in the metrics log and a once-per-
165
+ session notice names the winner; Pi's built-in compaction is reported only
166
+ while automatic compaction is on.
167
+ - `maxContextTokens` (default `0`, off) makes automatic trigger percentages
168
+ (`minContextPercent`, the background preparation window and the automatic
169
+ admission gate) count against `min(model window, maxContextTokens)`. Model
170
+ requests, summary sizing and hard headroom checks keep the real window.
171
+ Settings › Compaction has a row for it, and Home warns when a model window
172
+ above 400k tokens is uncapped while automatic compaction is on.
173
+ - A session-local host prompt-cache ledger records the provider-reported
174
+ input, cache-read and cache-write tokens of Pi's own requests and classifies
175
+ cache rebuilds (uncached ≥ 16,384 tokens and ≥ half the prompt) as following
176
+ a committed Continuity edit (trim/rewind, pivot, compaction), idle expiry of
177
+ the cache lifetime, or foreign. Home › Readiness & details shows the tallies;
178
+ the third foreign rebuild in a session shows one notice. `smart_context` and
179
+ navigation gain an `onContextEdit` hook that fires only once an edit is on
180
+ the branch.
181
+ - Trimming also archives old, successful shell (`bash`) output of 4,096+
182
+ characters. The shell call itself stays in context; errored results and
183
+ turns that mix shell with writes or unknown tools stay whole. Rewind still
184
+ keeps shell exchanges.
185
+ - Old `smart_context` `read` pages are trimmable like read-only output; the
186
+ marker points at the original source ID so the agent re-reads the source.
187
+ Other `smart_context` results (`status`, `search`, `plan`, `trim`, `rewind`)
188
+ are never trimmed.
189
+ - Trim and rewind records store a SHA-256 and length per archived output
190
+ (`archives: [{ id, sha256, chars }]`). `smart_context` `read`/`search`
191
+ refuse text that no longer matches its record, `status` sources show
192
+ `hashed`, and a rewind withholds mismatched outputs from recovery and says
193
+ how many. Records from earlier versions have no hash and read as before.
194
+
195
+ ### Changed
196
+
197
+ - Home's `Clean up tool output` row shows `held for a cold cache` with the
198
+ estimated savings and pay-back when automatic cleanup is holding a batch;
199
+ selecting it applies the batch at the next completed turn. Settings and
200
+ profile texts for automatic cleanup now name all three commit causes; the
201
+ `handoff` "nothing to hand off" notice says how to record something.
202
+ - Trim markers are now a deterministic digest of at most 6 lines and 400
203
+ characters: the retrieval line, the call's subject (read path, first shell
204
+ command line, or search pattern), the first non-empty output line, and up
205
+ to three error/failure/warning lines, each whitespace-normalized and cut to
206
+ 100 characters.
207
+ - Trimming archives superseded output first: read-only results whose path a
208
+ later call writes, edits or deletes (including literal `bash` targets),
209
+ then results whose path a later plain `read` without `offset`/`limit`
210
+ shows again in full, then the rest, each in session order, within the same
211
+ 32-output cap. Their markers add `(superseded: edited later)` or
212
+ `(superseded: read again in full later)` to the
213
+ subject line. Paths match after `path.normalize` only. Eligibility is
214
+ unchanged; `smart_context` `plan` reports `superseded`.
215
+
216
+ ### Fixed
217
+
218
+ - Sessions with automatic compaction on `background` and `contextHygieneEnabled`
219
+ off trimmed at break-even or on a cold cache since the timing rule landed;
220
+ the background strategy again trims only under pressure, as before.
221
+ Break-even and cold-cache cleanup need `contextHygieneEnabled`. This also
222
+ restored the offline evaluator's `no-compaction` baseline under
223
+ `--background-prep` (it had started trimming, and Pi's idle cache warming
224
+ stopped at every rebuilt boundary).
225
+ - A held automatic trim is applied through Pi's `context_with_system` event,
226
+ not `context`: a changed `context` result makes Pi collapse
227
+ mid-conversation system messages into one head, so the cold request and
228
+ the committed transcript would differ. Verified against the checkout's
229
+ `ExtensionRunner.emitContext`.
230
+ - The offline task evaluator (`release:audit`) no longer reaches the network
231
+ when `rg` is missing: offline arms set `PI_OFFLINE=1` and fail before the
232
+ first round without ripgrep; CI installs it. The offline guard now names the
233
+ first blocked request and its caller.
234
+ - A trim that a cold request already carried was dropped at the end of an
235
+ aborted or failed turn, at a boundary busy with preparation or compaction,
236
+ and after a queued manual change: Pi records the interrupted response with a
237
+ fresh timestamp, so the next request looked warm, went out untrimmed and
238
+ rewrote the prefix the interrupted request had just cached. The carried trim
239
+ now stays in every request until a boundary commits it, a newer context
240
+ rewrite invalidates it, or the session changes. Turning automatic cleanup off
241
+ forgets a held or carried trim.
242
+ - The cold-cache check took the prompt-cache lifetime from the last response
243
+ only; a fully cached or interrupted response after a 1-hour write made a
244
+ 1-hour prefix look 5 minutes old, so the trim could be applied while the
245
+ entry was still warm. The lifetime now comes from the last response that
246
+ wrote cache, as the host cache ledger keeps it.
247
+ - Automatic trims need a reachable `smart_context`, as artifact offload does:
248
+ digests point the model at that tool, so with agent tools off nothing is
249
+ trimmed automatically. `Readiness & details` says so on the
250
+ `Context hygiene` line. Manual cleanup from Home is unaffected.
251
+ - A queued context change (manual cleanup, agent checkpoint, rewind or trim)
252
+ that met an aborted or failed turn vanished silently; it now leaves the usual
253
+ "Context operation not applied" note.
254
+ - A committed rewind was counted as a `trim` in the host prompt-cache ledger;
255
+ it is now `rewind`.
256
+ - Review reports under `docs/findings` stay out of the npm package.
257
+ - Settings opened from Home now apply limits, pinned paths, backup
258
+ directory, Hindsight and model rows to the running session at once, as the
259
+ standalone `/smart-compact settings` screen does; they used to be saved
260
+ only.
261
+ - Home → Settings → How it runs → **This branch** opens the branch-only
262
+ settings again; Enter on it did nothing.
263
+ - The Home header reads `Automatic: prepare in background` for the
264
+ `background` strategy instead of `when idle`.
265
+ - When the readiness check fails, Home's `Status & help` row shows
266
+ `unavailable` with the first line of the error instead of `checking`
267
+ forever.
268
+ - Mode budget rows (Fast, Balanced, Thorough) update their "N changed" count
269
+ after you edit a budget, and a failed budget or Hindsight reset reports the
270
+ error instead of failing silently.
271
+ - `/smart-compact dashboard` outside the TUI says it needs TUI mode and
272
+ points to `/smart-compact metrics` and the HTML dashboard path; it used to
273
+ do nothing.
274
+ - `/smart-compact storage` and `/smart-compact metrics` without a UI print
275
+ their report: to stdout in print mode, to stderr in JSON/SDK mode (RPC
276
+ keeps the notice). Both were silent in JSON mode and `metrics` in print
277
+ mode.
278
+ - Metrics p95 latency uses the nearest rank; with 20 runs it was the slowest
279
+ run.
280
+ - The metrics dashboard pages to the terminal height (at most 24 lines), so
281
+ the position line and key hints stay visible in short terminals.
282
+ - `/smart-compact storage` no longer marks the scan incomplete (and every
283
+ owner `unknown`) when a session file holds a line longer than 1 MiB, such
284
+ as a large tool result.
285
+ - An unreadable Hindsight receipt ledger is no longer read as "no pending
286
+ saves": resolve refuses to delete and saves are refused, both naming the
287
+ ledger file, which is left untouched for repair.
288
+ - Mnemopi readiness reports `ready` when the package and a supported Bun are
289
+ found (worker and database still unverified); the package check no longer
290
+ fails for an installed package.
291
+ - A settled or background auto-trigger whose host never reports back releases
292
+ the session after the hook budget plus `autoTriggerTimeoutMs` and reports
293
+ it once, so later triggers can run.
294
+ - A staged candidate confirmed for another session is discarded and recorded
295
+ instead of lingering and later surfacing as missing local records.
296
+ - Anthropic native compaction reads the top-level usage when the response has
297
+ an empty `iterations` list; it used to record zero tokens.
298
+ - Stored native compaction state larger than 1,024 items or 4 MiB is rejected
299
+ instead of being replayed.
300
+ - Native compaction metrics classify tool runs like EESV runs and record the
301
+ run's latency and provider-cache hit rate instead of zeros; native dry runs
302
+ and declined native runs now appear in metrics.
303
+ - A failed apply (native or EESV) clears only its own staged candidate, and
304
+ the once-per-route native skip notice no longer repeats for every session
305
+ after 500 sessions.
306
+ - A resolved or superseded project-memory fact could come back as active in a
307
+ project with more than 2,000 facts: pruning removed the resolved markers
308
+ first, so a later compaction that still saw the old text re-added it. Active
309
+ facts and resolved markers now have separate 2,000-entry limits, each
310
+ trimmed oldest first.
311
+ - Resolved saved project memories count toward the resolved-marker limit
312
+ instead of piling up until an explicit forget; active saved memories are
313
+ still never trimmed.
314
+ - Deleting project-memory facts no longer scans every graph edge: edge
315
+ targets are indexed, including in existing memory databases.
316
+ - The native continuity handoff no longer stops working for a directory after
317
+ a crash while staging: a lock whose process is gone, or which is older than
318
+ one minute, is taken over. Replacing a handoff keeps the previous one until
319
+ the new one is written, and a handoff recorded for another scope is left in
320
+ place instead of being deleted.
321
+ - Native compaction now counts against the run's output budget and records
322
+ its real prompt and output tokens in the run budget (it used to spend
323
+ nothing); an exhausted call or output budget fails the native attempt
324
+ without sending a request.
325
+ - Native compaction's after-compaction estimate counts the system prompt and
326
+ tool schemas as fixed context, like the smart summary planner, instead of
327
+ shrinking them with the compacted messages; the estimate was optimistic.
328
+ - Native compaction now prepares the same scrubbed conversation backup as the
329
+ smart summary (`backupEnabled`), written after Pi confirms the compaction;
330
+ it used to write none.
331
+ - Hindsight: a resolve marks only the receipts it checked as deleted, so a
332
+ save that lands during the delete stays open; a completed save or delete
333
+ whose local receipt cannot be updated (e.g. ledger locked) is reported
334
+ (`unknown`, or a warning on delete) instead of failing the tool, and the
335
+ next `smart_recall` reconciles it.
336
+ - Hindsight status checks use the operation id the server acknowledged when
337
+ it differs from the one sent; they used to stay `unknown` forever.
338
+ - Hindsight: `smart_recall` marks a receipt `failed` (`not_found`) once the
339
+ server has reported its operation missing for 24 hours, so a full receipt
340
+ ledger drains; the ledger-full message names the ledger file and no longer
341
+ claims `smart_recall` alone clears it.
342
+ - Hindsight recall evidence turns line breaks and other control characters
343
+ from the server into spaces, so remote text cannot forge `Ref:` or
344
+ provenance lines.
345
+
346
+ ## [9.8.0-canary.7] - 2026-09-27
347
+
348
+ Local-only integration candidate; not published or installed in daily Pi.
349
+ Offline receipts, a real-terminal walkthrough and loopback proofs are not a
350
+ live evaluation or a production canary promotion.
351
+
352
+ ### Added
353
+
354
+ - Session navigation, owned by Pi Continuity: named anchors with summaries,
355
+ read-only search of anchors from earlier sessions, and returning to an
356
+ anchor on a new branch with a required carryover. Home → History & recovery
357
+ → Session navigation, `/smart-compact context`, and the `smart_navigation`
358
+ agent tool (`view`, `recall`, `anchor`, `pivot`). Anchors recorded earlier by
359
+ pi-toolkit's `context` tool stay readable. The Anthropic anchor prompt-cache
360
+ marker and the footer anchor status are included.
361
+ - On-demand agent tools: with `toolLoading: "lazy"` (default) the agent sees
362
+ only the `smart_tools` loader (about 400 bytes of tool JSON in a stock Pi
363
+ request) and loads the `navigation`, `history`, `memory` or `compaction`
364
+ group when needed; loaded groups reset at session start, branch change and
365
+ compaction. `eager` shows every permitted tool; `off` shows none while Home
366
+ and the navigation panel keep working. The context-management guide is read
367
+ only on request through `smart_tools` and is never injected into the system
368
+ prompt; Pi does not list it as a skill.
369
+ - Settings → Agent tools & navigation: `toolLoading`,
370
+ `contextNavigationEnabled`, `contextRecallEnabled`, `contextPivotEnabled`,
371
+ `contextAnchorCacheEnabled`, `contextAnchorStatusEnabled` and
372
+ `contextGuidanceEnabled`. Existing settings are preserved; turning
373
+ navigation off keeps recorded anchors and the other switches.
374
+
375
+ ### Changed
376
+
377
+ - Requests the extension makes itself (EESV stages and provider-native
378
+ compaction) go through the requesting session's public model runtime
379
+ instead of pi-ai's standalone completers, so request-time auth and provider
380
+ overrides registered by other extensions apply. Explicit caller API keys and
381
+ headers are no longer sent, so stored OAuth is never bypassed; stage auth is
382
+ an availability preflight only.
383
+ - Removed the pi-toolkit cooperation contracts: the
384
+ `pi-toolkit:adapt-provider-request` channel, the `pi-toolkit:context-pivot`
385
+ pause, the `piToolkit.context.thinningEnabled` fixture and the task-eval
386
+ `--toolkit` option (every arm now runs with `toolLoading: "eager"`).
387
+ pi-toolkit's auto-context must not be loaded together with this extension.
388
+ Claude subscription routes need the separate `pi-claude-oauth-adapter`; the
389
+ published `0.2.2` normalizes the request body only for Pi's own turns, so a
390
+ build that normalizes the final payload inside its provider is required for
391
+ parity on nested requests. Such a patch was prepared and verified against
392
+ `0.2.2` in isolation; it is not part of this package.
393
+ - Tool guidance for `smart_recall`, `smart_save_memory` and `smart_compact`
394
+ moved from Pi's system-prompt tool metadata into the tool descriptions, so
395
+ loading a group on demand does not rewrite the system prompt.
396
+ - The session, context-compat and native-host pilots run without a pi-toolkit
397
+ checkout; the native-host pilot loads the standalone adapter from
398
+ `PSC_CLAUDE_OAUTH_EXTENSION` and classifies its quota preflight as a
399
+ non-model request.
400
+ - LICENSE credits the pi-toolkit auto-context origin (MIT, Ersin Tarhan, with
401
+ the pi-provider-kimi-code and pi-better-messages-cache notices).
402
+
403
+ ### Fixed
404
+
405
+ - A pivot queued by the agent was silently dropped when a threshold
406
+ compaction started in the same idle window; compaction now pauses while a
407
+ pivot is queued or applying.
408
+ - Returning to a human-made anchor kept the carryover but dropped the anchor
409
+ and its summary; anchors are now labelled natively so the anchor text stays
410
+ in context.
411
+ - Artifact offload never ran in the default on-demand mode because
412
+ `smart_context` was not yet active; offload now runs while the agent can
413
+ reach `smart_context` (active or loadable) and stops with agent tools `off`
414
+ or `smart_context` hidden with `/tools`.
415
+ - The "Context OK" notice no longer refers to pi-toolkit.
416
+
417
+ ## [9.8.0-canary.6] - 2026-09-27
418
+
419
+ Local-only corrected evaluation candidate; not published or installed in daily
420
+ Pi. Canary.5 was rejected before paid calls: a synthetic raw `KERN_PROCARGS2`
421
+ probe retrieved another host process environment despite native sandbox rules.
422
+ Its frozen archives remain unchanged.
423
+
424
+ ### Fixed
425
+
426
+ - Replace native macOS tool isolation with fresh, networkless Linux containers.
427
+ Mount only the synthetic fixture and owned HOME; keep the image read-only,
428
+ drop capabilities, limit resources, and isolate host/sibling process tables.
429
+ Resolve the prebuilt runtime image to an immutable ID before execution.
430
+ - Create each container before starting it, then remove the complete container
431
+ on exit, cancellation or timeout, including detached children. File reads
432
+ remain byte-preserving and bounded; startup probes fail before provider use.
433
+ - Preserve evaluator environment/transport restoration even when sandbox
434
+ teardown fails. A local Docker daemon and separately built runtime image
435
+ are evaluation prerequisites, not extension runtime dependencies.
436
+
437
+ ## [9.8.0-canary.5] - 2026-09-27
438
+
439
+ Local-only evaluation-hardening candidate, retaining the canary.4 UI and
440
+ identity changes. Not published or installed in daily Pi. A bounded synthetic
441
+ live pilot is not production canary promotion evidence.
442
+
443
+ ### Fixed
444
+
445
+ - Load only the selected custom provider/model and frozen credential in task
446
+ evaluation; API keys no longer fail an OAuth-only expiry check. Credential
447
+ commands, ambient templates, refresh and mutation are refused.
448
+ - Cap main responses explicitly; refuse output reservations that do not fit
449
+ instead of silently shrinking a later response. Count cumulative Anthropic
450
+ stream usage once, retain missing values as unknown, and snapshot per-arm
451
+ request classes, actual usage and latency. JSON mode now emits its report.
452
+ - Observe live host tool results and the context actually sent at each probe,
453
+ rather than offline-only counters or pre-compaction branch history. An
454
+ archive lookup question alone no longer counts as delivery of its answer.
455
+ - Sandbox live model tools, fixture reads and oracle processes with a clean
456
+ child environment and native macOS filesystem/network restrictions. Startup
457
+ denial checks fail closed; unsupported platforms cannot enter live mode.
458
+
459
+ ## [9.8.0-canary.4] - 2026-09-27
460
+
461
+ Local-only UI, identity and settings candidate; not published or installed in
462
+ daily Pi. Live task comparison and production canary promotion are separate
463
+ checks; offline validation alone does not satisfy the promotion gates.
464
+
465
+ ### Changed
466
+
467
+ - Make Mode the only user-facing compaction selector. Advanced Mode budgets
468
+ retain existing Fast/aggressive, Balanced/balanced and Thorough/light values;
469
+ editing or resetting Mode does not rewrite legacy profiles or budget overrides.
470
+ - Run the adversarial gate on every CI pull request and push to main, matching
471
+ the local release checks. Latest-Pi compatibility remains scheduled/manual.
472
+
473
+ - Adopt **Pi Continuity** as the product identity for context hygiene and session
474
+ continuity. The npm package, repository, commands, tools, settings namespace
475
+ and stored data identifiers remain unchanged; this is not a package migration.
476
+ - Replace the compaction-only artwork with a generated PNG continuity mark and
477
+ self-contained SVG banner, retaining the established asset URLs.
478
+ - Restructure the README as an entry point, with separate user, configuration,
479
+ architecture and evaluation references. Mark historical experiments as dated
480
+ evidence and distinguish current unpublished behavior from the npm release.
481
+
482
+ - Simplified Home to five task-oriented choices, with effective context and
483
+ automatic/agent status above the list. Settings, recovery and diagnostics
484
+ remain accessible without competing with the primary compact action.
485
+ - Replaced technical setting labels with readable choices while preserving
486
+ defaults, persisted values, branch overrides and experimental confirmation.
487
+ Compact-picker cancellation now returns to Home.
488
+ - Compact and review screens show the decision first, with technical details
489
+ under `D`. Capacity refusals explain the next step; provider fallback and
490
+ verification warnings remain visible.
491
+
492
+ ### Fixed
493
+
494
+ - Normalize legacy profile-only `aggressive` settings to Fast on load, while
495
+ preserving explicit modes, custom budgets and the stored settings file.
496
+ - Result/help scrolling and narrow-terminal controls: summaries can be read to
497
+ the end, selected truncated settings are disclosed in full, and compact
498
+ actions remain visible when planner details need paging.
499
+ - Review no longer describes unresolved verification gaps as already patched.
500
+ Approval still requires `A`; `Enter` does not apply a candidate.
501
+
502
+ ## [9.8.0-canary.3] - 2026-09-25
503
+
504
+ Local-only reliability candidate; not published or installed in daily Pi.
505
+ Existing frozen candidates and user settings remain unchanged. Offline proof
506
+ does not establish live provider reliability or satisfy canary promotion gates.
507
+
508
+ ### Fixed
509
+
510
+ - Deterministic fallback keeps each constraint’s full 300-character extraction
511
+ bound and omits redundant category labels. The previous 200-character
512
+ decorated preview could contradict its own source, causing repeated
513
+ verification failures regardless of model. The verifier remains unchanged
514
+ and still rejects genuinely contradictory output.
515
+ - Run-wide cancellation is no longer treated as a recoverable generation
516
+ failure: it stops subsequent synthesis, verification, staging and apply.
517
+ Timed-out previews cannot report success; host cancellation is recorded
518
+ once as neutral `cancelled`, separately from `timeout`. Manual deadline
519
+ notices no longer promise an automatic native fallback. Latency defaults
520
+ and configured budgets are unchanged.
521
+ - Automatic behavior preset explicitly selects the existing `settled` trigger,
522
+ which works with Pi auto-compaction off. Native-hook readiness states its
523
+ host dependency and unknown host setting; threshold labels distinguish a
524
+ replacement gate from actual scheduling. Existing disabled/native-hook
525
+ configurations are not silently changed.
526
+
527
+ ### Changed
528
+
529
+ - Ship only runtime JavaScript entries (`index`, `rtk`, `mnemopi-worker`) and
530
+ declarations. Evaluation/report commands run source scripts from a checkout;
531
+ installed `dist/*-eval.js` and `dist/telemetry-report.js` CLI paths are removed.
532
+ Runtime context hygiene, continuity, recovery and memory features remain.
533
+ - Replace source/build-string and wording-only assertions with pipeline
534
+ cancellation regressions, installed-package checks and real Pi lifecycle
535
+ proof.
536
+
537
+ ## [9.8.0-canary.2] - 2026-09-25
538
+
539
+ Local-only candidate; not published. Prepared for the fresh canary package
540
+ paired with the partner pi-toolkit build. The deterministic release gate
541
+ passed locally (four-project typecheck, full test suite, adversarial gate,
542
+ benchmarks, build, installed-package audit with package-owned Bun, and Pi
543
+ 0.87.1/latest compatibility), but offline validation never replaces the
544
+ required live production canary evidence.
545
+
546
+ ### Added
547
+
548
+ - `/smart-compact` Home: a bare TUI invocation opens one keyboard screen with
549
+ Compact now (tokens/percent or the blocking reason), Queue local cleanup,
550
+ Setup & readiness, How it runs, Output, Models, Memory, History, Metrics and
551
+ Advanced settings. Behavior presets (Manual, Agent can compact, Local cleanup
552
+ only, Automatic cleanup + compaction) are derived from the exact persisted
553
+ flags, apply as one atomic settings patch, keep branch overrides visibly
554
+ separate, and leave the unchanged built-in default labeled as the default.
555
+ Output presets mark Visual hybrid as explicit opt-in and Native as
556
+ experimental with a second confirming Enter, showing why a preset cannot
557
+ apply for the current chat model.
558
+ - `/smart-compact trim` and the Home cleanup row queue the same zero-LLM trim
559
+ through the one `smart_context` controller: no model call, no forced turn, the
560
+ first next provider request is sent untrimmed, and the edit applies at the
561
+ next natural completed-turn boundary. A pending Toolkit pivot or a newer
562
+ boundary change cancels the queued request with a visible notice.
563
+ - `/smart-compact storage`: a strictly read-only inventory of saved tool output
564
+ (totals, per-session in-use / not-referenced-in-scan / unknown status, scan
565
+ coverage, self-managing retention neighbors). There is no `--clean` or
566
+ artifact garbage collection: sessions can live outside Pi's sessions root and
567
+ a running session can write new references at any time, so
568
+ unreferenced-in-scan is never safe-to-delete.
569
+ - Model capacity feasibility: model rows and readiness use local estimates of
570
+ planned stage requests from a retention-aware chunk/extraction plan, with
571
+ requested output and 4,096 tokens of SDK headroom reserved — not the whole
572
+ conversation against the stage model’s window. Ineligible rows are disabled; sizes that only exist
573
+ after generation (explorer feedback, assembly, repair) cannot be pre-known;
574
+ every actual dispatch re-estimates and revalidates the built request before
575
+ the provider is contacted. Snapshots refresh after mode/model/privacy
576
+ changes; the UI never refreshes authentication to build them.
577
+
578
+ ### Changed
579
+
580
+ - The selected memory backend is exclusive. With Hindsight selected, confirmed
581
+ saves and recall use only the user's existing configured server and bank —
582
+ Smart Compact never installs or starts a server — with no local copy or
583
+ fallback (`hindsightLocalFallback` is removed and reported as a stale ignored
584
+ key); failures report themselves instead of quietly using another store.
585
+ Mnemopi and local behave symmetrically, inactive stores are preserved
586
+ untouched, and `scope: "session"` is unsupported on remote backends (skipped,
587
+ nothing else is read). Structured continuity state, backups and artifact
588
+ spill remain session mechanisms independent of the backend choice.
589
+ - Mnemopi runtime resolution is package-owned first: the pinned `bun` optional
590
+ dependency (1.4.2), then its platform `@oven/*` package, then a supported
591
+ Bun (>=1.3.14) on PATH. Normal installs ship the optional runtime and engine,
592
+ so no global Bun is required; nothing installs itself at use time and missing
593
+ pieces fail closed before any memory request is submitted.
594
+ - RTK companion eligibility is exactly bare `git status`, `cargo test` and
595
+ `bun test`: `bun test` joined after an RTK 0.50.0 paired native/filtered
596
+ runner check showed exit-code and failure/load-error parity plus full recall
597
+ of the filtered output, with the command executed exactly once. `git diff`,
598
+ `tsc` and vitest 5 stay untouched (measured lossy or growing), `npm test` and
599
+ `node --test` have no rule, and commands with arguments or shell composition
600
+ remain passthrough.
601
+ - Native compaction and replay are documented honestly about cache effects:
602
+ the request prefix legitimately diverges across a native boundary, while
603
+ checkpoint/rewind trims keep the checkpoint-stable prefix and archive removed
604
+ middle evidence for retrieval.
605
+
606
+ ### Verified
607
+
608
+ - The release audit now runs the installed, packed Mnemopi worker under stock
609
+ Node with a PATH that offers no Bun — proving the package-owned runtime — and
610
+ adds missing-engine and missing-Bun fail-closed negatives that create no
611
+ store, make no model/network request, and keep the unselected local engine
612
+ from starting.
613
+ - Long-session storage durability is pinned with real `SessionManager`
614
+ fixtures: artifacts aged past 20 days (timestamps aged deterministically, not
615
+ a wall-clock soak), retrieval through the public `smart_context` consumer
616
+ after actual reload and fork, fail-closed missing/tampered bytes, and
617
+ per-origin caps without losing earlier evidence.
618
+
619
+ ### Unchanged
620
+
621
+ - The frozen 9.8.0-canary.0/.1 archives and the daily installation are
622
+ untouched; no publish, tag or commit accompanies this candidate. Exact
623
+ paired-archive hashes are recorded by the release owner at final packaging.
624
+
625
+ ## [9.8.0-canary.1] - 2026-09-25
626
+
627
+ Local-only polish candidate; not published. Offline validation does not replace
628
+ the required live production canary evidence.
629
+
630
+ ### Added
631
+
632
+ - Stable, backend- and target-bound refs in confirmed memory saves/recall. Resolve requires the ref instead of exact preview text, names the actual store for consent, and does not retarget when settings change. Hindsight refs additionally bind project and document; unrelated remote documents have no actionable ref.
633
+ - Explicit derived-only reset versus full local graph deletion, with saved/derived/legacy counts, confirmation, and clear exclusions for other backends, compaction state and backups.
634
+ - One read-only effective-state view for preflight (`S`), metrics and dashboard: routes, credential presence versus live verification, backend prerequisites, effective branch policy, pressure gates and runtime preparation.
635
+ - Packaged `task-eval` CLI: four paired stock-Pi continuation/memory arms, repeated-compaction probes, independent executable oracles, usage/cache and policy comparisons. Offline scripted transport is the default; the separate opt-in live path has explicit budgets and limitations, not an implied quality result.
636
+
637
+ ### Fixed
638
+
639
+ - Promotion requires host-confirmed applied runs; cancellations cannot fill the 20-run minimum or manufacture failures. Unknown release channels are not stable evidence. Both cohorts need quality/damage coverage and canary data confidence must reach 85; native runs carry explicit cohort/route metadata.
640
+ - Copied cross-project Hindsight refs, missing targets and target-tail substitution are rejected before deletion. Unknown or missing retain status blocks deletion until terminal evidence, preventing delayed retain completion from recreating a deleted fact. Bounded recall refresh includes unknown receipts; lock failures identify the retained lock without removing it automatically.
641
+ - Current privacy settings re-scrub stored local facts before resolve confirmation without changing ref identity. Truncated recall previews and backend changes no longer make confirmed memories unresolvable.
642
+ - Completed but unused preparation is recorded once with discard reason, timing and cost; graceful session shutdown drains late work and metric writes. Used/discarded reports keep cache categories, reported/estimated usage, subscription billing labels and repair provenance distinct.
643
+ - Empty model pickers report missing credentials instead of cancellation; narrow rows preserve stored values, changed-setting markers refresh after edits/resets, and review accepts uppercase/Kitty Apply, Cancel and Quit keys.
644
+ - Evaluator `--help` exits without running tasks or creating reports.
645
+
646
+ ### Unchanged
647
+
648
+ - Hygiene savings floors, cooldowns, pressure thresholds and preparation TTLs are not tuned from synthetic results. Daily installation, automatic-memory policy and live-provider approval remain untouched.
649
+
650
+ ## [9.8.0-canary.0] - 2026-09-25
651
+
652
+ Local-only candidate; not published. Isolated validation is not the required
653
+ 20-run production canary evidence.
654
+
655
+ ### Added
656
+
657
+ - `compactionEngines`: an ordered engine list (default `["eesv"]`). Engines are tried in order; the first success applies. Unavailable engines are skipped with a reason, failures are recorded, and if none succeeds the conversation is unchanged and every outcome is reported. Settings offer four presets.
658
+ - Native engine: the current model's own provider compaction, for Anthropic Messages (API key and Claude subscription), OpenAI Codex subscription and OpenAI Responses API key. Works on stock Pi 0.87.1+ as an extension: one nested Pi request is sent once as the provider's compaction request (no retries). The state is stored in the compaction entry's `details.native` and replayed to the same provider and model through `before_provider_request`; it is opaque and not EESV-verified. If replay cannot be applied (it depends on Pi's request format), the model reads the text summary, which for OpenAI routes is only the retained user messages. Cuts keep whole turns; a result that is not smaller is rejected. Opt-in; the default stays `["eesv"]`. Live on stock Pi: Codex subscription (gpt-5.6-luna) validated (compaction accepted, replay after reload accepted and byte-exact; recall of incidental details lossy; re-compaction offline only). Claude subscription is experimental: Anthropic may bill the compaction request as extra usage (real-session attempts were rejected with "400 You're out of extra usage"; cause not isolated). Anthropic and OpenAI API-key routes: offline tests only. For subscription users, "Native, fall back to smart summary" is the safe preset. Known limitation: in sessions smaller than Pi's `compaction.keepRecentTokens`, Pi refuses to apply after the engine has run; Smart Compact reports it and the conversation is unchanged.
659
+ - Provider-request adaptation: nested Smart Compact requests to Anthropic Messages (native compaction, native replay and EESV calls) are offered to adapters on the `pi-toolkit:adapt-provider-request` v1 channel, because stock Pi does not run `before_provider_request` for extension-made requests. Claude subscription requests from extensions (native and EESV) require pi-toolkit's Claude OAuth adapter with this contract. A native "extra usage" rejection on a Claude subscription adds a hint to use an API key or put the smart summary engine first.
660
+ - Optional Hindsight memory backend (`memoryBackend: "hindsight"`): confirmed `smart_save_memory` saves also go to a configured Hindsight bank, and `smart_recall` adds a strict project-scoped remote section. The confirmation shows the exact server, bank and document; the key is read from a named environment variable. Accepted, completed, failed and unknown outcomes are reported as such, with a configurable local copy. No automatic uploads. See `docs/hindsight-memory.md`.
661
+ - Optional Mnemopi backend (`memoryBackend: "mnemopi"`): host-confirmed save/resolve and bounded full-text recall through the real local SQLite engine. A separate Bun worker preserves stock Node Pi support; private per-project databases, stable duplicate identity, checked provenance and cross-process locking prevent accidental cross-project or duplicate writes. Embeddings, model calls, shared default banks and automatic uploads remain off. Settings expose an optional absolute/`~/` data directory.
662
+ - Independent `prepareContextPercent` for background preparation, strictly below the existing `minContextPercent` apply gate. Auto/null preserves adaptive lead; the 5,000-token minimum, idle apply lifecycle and all target/yield checks stay in force. TUI validation refuses conflicting edits in both directions.
663
+ - Issue history: `/smart-compact metrics` starts with the last 20 problems (age, repeat count).
664
+ - Settings TUI: per-row reset with `r`, changed-setting marks, inactive dependent rows with a reason, and a warning line for ignored `settings.json` values.
665
+
666
+ - Repeatable offline full-AgentSession pilot with real tools, Toolkit cooperation, automatic hygiene, evidence retrieval, context-only rewind, correlated compaction and persistent reopen. Model transport is scripted, so results do not claim autonomous quality or provider-billing savings.
667
+ - Opt-in `contextHygieneEnabled`, independent of automatic compaction, and `smart_context plan` for non-mutating batch previews. Automatic trimming batches at least 16,384 saved characters and respects an eight-assistant-turn branch-persisted cooldown; no per-turn prompts.
668
+ - Separate, explicitly loaded RTK companion (`pi-smart-compact/rtk`), with CLI delegation, conservative command eligibility, cancellation/session guards and no execution retries. A real RTK 0.50 pilot restricts initial rewriting to bare `git status`/`cargo test`; lossy diffs and counterproductive typecheck filtering are left unchanged.
669
+ - Offline native-compaction compatibility probes against real Pi adapters. Pi 0.87.1's adapters do not parse or replay signed Anthropic or opaque OpenAI compaction data themselves, which is why the native engine sends its own compaction request and replays the state from `before_provider_request`.
670
+ - Opt-in `autoTriggerStrategy: "background"`: prepare EESV on a completed-turn snapshot before the pressure gate, then reuse it at native/idle compaction boundaries without a manual tool call. Single-task speculation, retry cooldown, TTL, cancellation, projected-content checks, and response-headroom/yield validation bound reuse; new tail messages remain verbatim.
671
+ - Regression coverage for non-blocking preparation, late completion, model/config/branch invalidation, and correlated application without a second LLM call.
672
+ - `smart_context`: one branch-local checkpoint, deferred context-only rewind with an agent-authored report, bounded trimming of old read-only output, and paged recovery from the original session log. Errors, side-effecting/unknown tools, recent turns, and tool pairs are preserved. Native boundary metadata survives reload without a second transcript store.
673
+ - Background mode tries local trimming before speculative EESV when the context tool is active, without repeatedly invalidating work already in flight.
674
+ - Opt-in `artifactOffloadEnabled`: persist large successful read-only text outputs before model input, returning a bounded preview and branch-owned reference. Private, integrity-checked, deduplicated files with per-origin quotas; failures keep original output and never claim incomplete recovery.
675
+ - `smart_context search` and line-range reads across existing archived outputs, visual excerpts and new artifacts. Literal matching, bounded scans/pages, source labels, explicit missing-file errors and re-scrubbing before retrieval; no additional model calls or database.
676
+ - Experimental `visualArchiveEnabled` (default `false`): locally rendered bitmap excerpts beside the verified EESV text summary. Optional Node-compatible resvg plus a licensed bundled font, bounded payload/source selection, branch/model/privacy validation, native-session reload/re-rendering, and text fallback. This preserves extra evidence at an additional image-token cost; the initial Sonnet 5 synthetic pilot found no token advantage over equivalent text excerpts.
677
+
678
+ ### Fixed
679
+
680
+ - Native compaction rejects incomplete Codex responses and state missing the required Anthropic signature or OpenAI encrypted content instead of staging unusable context.
681
+ - Native replay requires Pi's exact summary wrapper; overlapping text in a new user instruction is never replaced. Re-compaction stops before sending a request if the prior native state cannot be replayed.
682
+ - Anthropic on-demand compaction removes incompatible `context_management`, including fields supplied by a request adapter. This does not establish the cause of the experimental Claude subscription billing rejection.
683
+ - A queued `smart_context` operation cancelled by a Toolkit pivot now produces a visible, model-delivered cancellation message instead of silently disappearing; context remains unchanged.
684
+ - Rejected settings edits no longer report warnings for hypothetical states that were never written, or hide the subsequent real invalid-file warning.
685
+ - Optional-backend recall labels its local graph section explicitly. Missing Mnemopi dependencies fail before a request is submitted rather than reporting an uncertain write.
686
+ - Notices from a run that finishes after a session switch no longer appear in the new session.
687
+ - Background-run problems are no longer written to stderr inside the TUI; they are shown at the next event.
688
+
689
+ - Artifact byte deduplication no longer overwrites distinct source labels. Paged discovery preserves each tool/source/content combination and authorized entry-ID reads while retaining existing content-hash IDs, branch revocation and re-scrubbing.
690
+ - Archived native-output discovery uses the shared path extractor, including `filePath`, `filename`, `target_file`, `file_uri` and `absolute_path` aliases.
691
+ - Bitmap admission compares equivalent text using the active reader's provider/model calibration, not the summarizer's calibration; checked before and after rendering.
692
+ - Staged summaries now revalidate reader identity/limits, current context growth, native reserve/headroom and yield before apply. New compact instructions, model changes and navigation invalidate old candidates; late native-hook work cannot reapply an invalidated plan.
693
+ - Early artifact offload leaves file/symbol read deliveries intact, preventing pi-lens from granting read-before-edit coverage for omitted middle content. Other eligible outputs still offload; historical trimming/retrieval is unchanged.
694
+ - Cooperate with the updated Toolkit's explicit thinning-off mode and versioned pivot notifications. Pending navigation pauses preparation/compaction/context mutations; matching completion releases it on success/cancel/failure without stale-operation leakage.
695
+ - Pre-compaction dedup now requires identical content, not only matching arguments, and preserves changed observations, unknown tools, media and instruction reads. Status-looking user text no longer authorizes deletion.
696
+ - Shared instruction/skill-source protection across recoverable trim, rewind, artifacts, visual selection and pre-compaction pruning. Recovery tool outputs are not recursively trimmed; missing trim boundaries fail closed.
697
+ - Multi-page rendering now uses a fresh child cancellation signal per page; resvg's native single-use AbortSignal binding previously rejected the second page with `InvalidArg` on Node and Bun. Added a regression test and a bounded, opt-in synthetic live pilot with recorded observations.
698
+ - Compaction and preflight now use Pi's native context projection, honoring `context_edit` replacements and omissions. Raw-log recovery restores only truncated, unedited entries rather than overwriting intentionally changed siblings.
699
+ - Extraction-cache reuse checks a message-content prefix hash as well as entry IDs. Staged summaries reject changed projected context even when their original branch IDs still exist.
700
+
701
+ ### Changed
702
+
703
+ - Tools are exposed lazily, decided only at session start and after compaction: `smart_recall`/`smart_save_memory` once the project has memory (or with Hindsight/Mnemopi), `smart_context` when hygiene/offload/background is on or Toolkit's `context` tool is absent. Tool descriptions were shortened; a new session with Toolkit and no project memory now starts with about 267 tokens of Smart Compact tool text instead of about 1.56k. `/tools` choices are respected.
704
+ - Problems are visible without debug mode: each one is shown once per session as a one-line "Smart Compact: what happened. Effect. What to do." notice. Provider errors include their scrubbed first line (at most 160 characters). `DEBUG=smart-compact` now only adds stack traces.
705
+ - Nothing is added to Pi's footer while healthy. Background preparation no longer shows "preparing/ready", the RTK companion's "inactive" status became a one-time notice, and run progress moved out of the footer. `showStatus` now only shows a note when compaction is manual-only or disabled.
706
+ - Without a UI (print, RPC, SDK), warnings and errors go to stderr, and `/smart-compact` with no arguments runs with the configured defaults instead of reporting "Cancelled".
707
+ - Settings TUI reorganized by task into seven categories (Compaction, Models & reasoning, Memory, Context hygiene, Privacy & safety, This branch only, Advanced › Limits) with plain labels and descriptions. Setting keys and stored values are unchanged.
708
+ - Product focus: context hygiene and session continuity; existing package name and compaction APIs remain stable.
709
+ - Bitmap rendering crops blank width without shrinking glyphs. New archives require a validated model cost rule and at least 25% estimated benefit over equivalent text; unsupported/unprofitable cases retain verified text. No new live model calls or billed-savings claim.
710
+ - Minimum Pi version is **0.87.1**. Host packages remain external peers; development dependencies pin the minimum version for reproducible checks. Update older Pi installations before using this release.
711
+ - Existing `native-hook` default and manual approval behavior are unchanged. Visual evidence is opt-in; filesystem rollback is not included.
712
+
3
713
  ## [9.7.1] - 2026-09-23
4
714
 
5
715
  ### Fixed