pi-smart-compact 9.7.1 → 10.0.1

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