pi-blackhole 0.5.6 → 0.5.7

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.
package/CHANGELOG.md CHANGED
@@ -2,8 +2,34 @@
2
2
 
3
3
  ---
4
4
 
5
+ ## [0.5.7] - 2026-09-21
6
+
7
+ ### Added
8
+
9
+ - **Footer status bar.** pi-blackhole now shows live state in the pi footer (config key `statusBar`, default on; env `PI_BLACKHOLE_STATUSBAR`): three token gauges — O (transcript since the last observer run), P (observation pool fill), X (context since the last compaction) — plus worker spinners, `✓ +N` completion events, and compaction notes with their trigger reason. Gauges color by fill: dim under 80%, theme warning color from 80%, theme error color at 100%. The bar reads in-process state (`runtime.config`, `model-budget.ts`, `ledger/progress.ts`, `runtime.consolidationPhase`), so its numbers match `/blackhole-memory` status; it adds no file polling and no threshold guessing, only a 1-second in-process poll of the runtime state. If you ran the standalone `blackhole-status.ts` footer extension before, remove it: two writers on the same `setStatus` key race.
10
+
11
+ ### Changed
12
+
13
+ - **Pi 0.87 is supported.** The `@earendil-works/*` devDependencies move to `0.87.0` in lockstep and the dependabot `>=0.87.0` hold is removed ([#118](https://github.com/k0valik/pi-blackhole/issues/118)). `peerDependencies` (`>=0.85.1 <1.0.0`) is unchanged: the observational-memory system-prompt carrier is probed at runtime, so consolidation keeps its prompt on 0.85/0.86 (legacy `AgentContext.systemPrompt`) and 0.87+ (leading transcript system message) — see Fixed.
14
+ - **CI runs on pull requests targeting `dev` too.** `ci.yml` previously triggered only for `pull_request → main`, so PRs merged into the working branch were gated by bot reviews alone. The full gate (build → typecheck → lint → test → format:check) now covers both branches.
15
+ - **Installs work under pnpm's built-in minimum-release-age policy.** pnpm 11 enforces a 24-hour minimum release age by default, which rejected the brand-new `@earendil-works/*@0.87.0` set. The toolchain pin moves to `pnpm@11.27.1` and those versions are listed in `minimumReleaseAgeExclude` (the previous pin, `11.2.2`, ignored that list), so `pnpm install --frozen-lockfile`, CI, and git-based extension installs no longer wait out the window.
16
+
17
+ ### Fixed
18
+
19
+ - **The compact-shape guard follows Pi 0.87's `_refreshFinalizedContext()` indirection.** 0.87 moved the `agent.state.messages` repoint out of `AgentSession.compact()` into a helper, so the guard that requires the write _inside_ `compact()` rejected the class and mid-run inline compaction failed closed on 0.87 ([#117](https://github.com/k0valik/pi-blackhole/issues/117)). The guard now accepts an assignment found one call level deep in one of the class's own prototype methods, and still rejects inherited helpers, deeper indirection, and a helper that only reads the property.
20
+ - **Observational-memory consolidation keeps its system prompt on Pi 0.87.** 0.87 removed `AgentContext.systemPrompt` and now carries the prompt as a leading transcript `system` message, so the observer, reflector, and dropper would have silently run without their prompts. They now build whichever carrier the loaded host reads — probed by the presence of Pi 0.87's `createInitialSystemMessage` helper, not a version allowlist — so 0.85/0.86 keep the legacy field and 0.87+ gets the transcript message ([#118](https://github.com/k0valik/pi-blackhole/issues/118)).
21
+ - **Discover Pi 0.86's bundled host behind its `createRequire` launcher.** Follow the same-package bootstrap file without executing it before locating the runtime chunk, so inline compaction captures the active `AgentSession` instead of patching the unused modular class and falling back to settled compaction. A bootstrap target that is missing, unreadable, or outside the Pi package now leaves the launcher's own source in place, so the direct-import scan still runs instead of being skipped.
22
+ - **Observer preamble cap now applies in auto/off compaction modes.** `observerPreambleMaxTokens` was previously only enforced in manual mode, so auto-mode observer prompts could grow without bound even though the main session prompt stayed capped by `observationsPoolMaxTokens`; the observer now applies the same relevance-ranked selection budget in all modes, defaulting to 30% of `observerChunkMaxTokens` when unset.
23
+ - **Observer preamble cap now covers reflections, and the context guard prices the full prompt.** Reflections were never trimmed (no drop entry type exists for them), leaving a permanently growing floor on the observer preamble; each preamble section is now capped at `observerPreambleMaxTokens` (reflections newest-first). The pre-flight `observer.context_window_exceeded` guard previously measured only `chunkTokens + 8000`, so oversized prompts sailed through and failed every attempt with a provider 400; it now accounts for the rendered preamble and the observer system prompt, skipping the model cleanly instead.
24
+
25
+ ---
26
+
5
27
  ## [0.5.6] - 2026-09-19
6
28
 
29
+ ### Added
30
+
31
+ - **Pre-compaction output stays visible after compaction** ([#103](https://github.com/k0valik/pi-blackhole/pull/103), thanks @sonSunnoi). After a successful Blackhole compaction, the newest assistant text removed from view is re-rendered as a display-only **Previous output — display only** block, so recent work stays readable without opening `/tree`. Bounded and opt-out: 16 KiB UTF-8 cap with a truncation marker, text only (no tool output, thinking, or images), idempotent per compaction, skipped when the newest dropped text is retained; disabled via `showPreCompactionMessage` (default `true`, env `PI_BLACKHOLE_SHOW_PRE_COMPACTION_MESSAGE`).
32
+
7
33
  ### Changed
8
34
 
9
35
  - **Minimum supported Pi raised to 0.85.1; compat-floor CI retired.** The `compat-min-supported` job re-pinned the `@earendil-works/*` peers to the `peerDependencies` floor and typechecked against them, going red every time. The extension now builds against the pinned devDependencies (0.85.1) and the peer floor is set to match; `peerDependencies` remains the single source of truth for the declared minimum.
package/README.md CHANGED
@@ -31,12 +31,12 @@ Then `/reload` or restart Pi. The config file at `~/.pi/agent/pi-blackhole/pi-bl
31
31
 
32
32
  ## ✨ What's new
33
33
 
34
- > **Latest release: [0.5.6](CHANGELOG.md)**
34
+ > **Latest release: [0.5.7](CHANGELOG.md)**
35
35
  >
36
- > - **Non-English (CJK) sessions are now fully script-aware** — token accounting counts CJK as ~1 token/char (no more ~3× silent overage), text clipping and `recall` queries respect CJK punctuation and word boundaries, and the extractors accept CJK correction anchors and failure stems. ([#105](https://github.com/k0valik/pi-blackhole/issues/105), [#106](https://github.com/k0valik/pi-blackhole/issues/106))
37
- > - **`[Files And Changes]` and `[Commits]` extract what actually happened** — file attribution correlates tool calls with results instead of guessing from a hardcoded tool list, and commit capture understands real-world flag orders and heredocs. ([#105](https://github.com/k0valik/pi-blackhole/issues/105))
38
- > - **Observer chunks always respect `maxTokens`** — `custom_message` entries (previously zero-counted) are now sized like every other entry. ([#110](https://github.com/k0valik/pi-blackhole/issues/110))
39
- > - **`[Files And Changes]` display and cross-compaction merge overhauled** — cwd-relative paths, capped lists that never shrink, and `(#N)` drill-down refs.
36
+ > - **Pi 0.87 is supported** — inline compaction, the observer/reflector/dropper system prompts, and auto-compaction all work on `0.87.0`. The compact-shape guard follows 0.87's `_refreshFinalizedContext()` helper, the memory workers build whichever prompt carrier the loaded host reads, and `@earendil-works/*` moves to `0.87.0` with the dependabot hold removed. ([#117](https://github.com/k0valik/pi-blackhole/issues/117), [#118](https://github.com/k0valik/pi-blackhole/issues/118))
37
+ > - **Live footer status bar** — `O` (transcript since the last observer run), `P` (observation pool fill) and `X` (context since the last compaction) gauges with color thresholds, plus worker spinners and compaction notes carrying their trigger reason. Config `statusBar`, default on. Remove the standalone `blackhole-status.ts` extension if you ran it: two writers race on the same status key. ([#113](https://github.com/k0valik/pi-blackhole/pull/113))
38
+ > - **Inline compaction finds Pi's bundled host behind the 0.86 `createRequire` launcher** — the adapter follows the same-package bootstrap file without executing it, so it patches the `AgentSession` the host actually runs instead of the unused modular class, which fell back to settled compaction. ([#116](https://github.com/k0valik/pi-blackhole/pull/116))
39
+ > - **Observer prompts are capped in every compaction mode** — `observerPreambleMaxTokens` now applies in `auto`/`off` too and covers reflections (newest first), and the pre-flight context guard prices the rendered preamble plus system prompt, so an oversized prompt skips the model cleanly instead of failing every attempt with a provider 400.
40
40
 
41
41
  See [`CHANGELOG.md`](CHANGELOG.md) for the full history.
42
42
 
@@ -73,7 +73,8 @@ Both halves share a single hook and a single output. Together they keep the agen
73
73
 
74
74
  All commands work regardless of `compaction` mode — only _when_ auto-compaction fires changes. See [Compaction modes](#compaction-modes) below.
75
75
 
76
- ### The `recall` tool (agent-facing)
76
+ <details>
77
+ <summary>The `recall` tool (agent-facing)</summary>
77
78
 
78
79
  The agent gets one unified `recall` tool that handles every form of historical lookup. Searches read the raw session file directly, bypassing compaction.
79
80
 
@@ -95,6 +96,8 @@ Every recall response is capped at `recallResponseMaxChars` (default 48,000 ≈
95
96
 
96
97
  The `/blackhole-recall` command exposes the same engine to the user. Results are shown as a collapsible message and auto-fed to the agent as context.
97
98
 
99
+ </details>
100
+
98
101
  ---
99
102
 
100
103
  ## Compaction modes
@@ -195,7 +198,8 @@ If any stage fails (model error, rate limit, timeout), remaining stages are skip
195
198
 
196
199
  ---
197
200
 
198
- ## What the agent sees after compaction
201
+ <details>
202
+ <summary>What the agent sees after compaction</summary>
199
203
 
200
204
  After compaction, the agent sees something like this (sections appear only when relevant — a session with no git commits won't show `[Commits]`):
201
205
 
@@ -248,9 +252,12 @@ Use `recall` with an id to retrieve original context.
248
252
 
249
253
  > **Note:** The OM injection format uses `## Reflections` and `## Observations` Markdown headers followed by a brief footer. Each observation and reflection has a 12-char hex identifier the agent (and you, via `/blackhole-recall`) can use to recover source evidence. When no observations or reflections exist, only the short recall-guidance footer is appended.
250
254
 
255
+ </details>
256
+
251
257
  ---
252
258
 
253
- ## Feature comparison
259
+ <details>
260
+ <summary>Feature comparison</summary>
254
261
 
255
262
  | | pi-blackhole | pi-vcc | pi-obs-memory | Pi default |
256
263
  | ------------------------------------------- | ------------ | ------ | ------------- | ---------- |
@@ -268,6 +275,8 @@ Use `recall` with an id to retrieve original context.
268
275
  | Unified single-file config | ✓ | — | — | — |
269
276
  | Per-session pending state | ✓ | — | — | — |
270
277
 
278
+ </details>
279
+
271
280
  ---
272
281
 
273
282
  ## Uninstall
@@ -296,16 +305,6 @@ rm -rf ~/.pi/agent/pi-blackhole
296
305
 
297
306
  ---
298
307
 
299
- ## Migration from an older version
300
-
301
- If you're upgrading from a pre-0.4.0 config (the old `pi-vcc` / `pi-observational-memory` keys, or an early `pi-blackhole` config with `overrideDefaultCompaction` / `noAutoCompact` / `passive`): see **[`docs/MIGRATION-GUIDE.md`](docs/MIGRATION-GUIDE.md)** for the key mapping, semantic changes, and notes on automatic migration.
302
-
303
- The short version: old keys are auto-migrated in memory at load time and the on-disk file is never mutated. Set the new keys explicitly via `/blackhole settings` (alias `/blackhole configure`) to silence the migration notification.
304
-
305
- The legacy config surface is documented at **[`docs/OLD_CONFIG.md`](docs/OLD_CONFIG.md)** for reference only — no new keys are added there.
306
-
307
- ---
308
-
309
308
  ## Credits
310
309
 
311
310
  `pi-blackhole` started as a merge of two upstream projects but has since diverged significantly. The codebase still carries DNA from both: