pi-blackhole 0.5.10 → 0.5.11

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,6 +2,25 @@
2
2
 
3
3
  ---
4
4
 
5
+ ## [0.5.11] - 2026-10-05
6
+
7
+ ### Added
8
+
9
+ - **Oversized work shrinks to fit instead of stalling.** When no configured model can hold the sized input, the stage re-plans against the largest resolved window and runs that: the observer caps its chunk and drains the remainder in-run, the reflector splits new items into batches that all complete before the single cursor advance, and the dropper evaluates batches under pool-wide pressure and applies the ranker + cap once. A failed batch still voids its run with the cursor unmoved.
10
+ - **A warning when `observeAfterTokens` exceeds `observerChunkMaxTokens`.** Every pass then necessarily runs as multiple capped + drained batches. The loader warns (never clamps); skipped when `memory` is off.
11
+
12
+ ### Fixed
13
+
14
+ - **Observer coverage can no longer skip entries the model never saw.** The cap keeps the oldest contiguous prefix, coverage derives from the ids the serializer actually emitted, and after a recorded or clean-empty close the stage drains the remaining backlog in the same run — a delay, never a loss.
15
+ - **Cut-off worker runs no longer count as finished.** `length`, `aborted`, an unexempt terminal `toolUse` — or any other non-`stop` reason — now fail instead of advancing coverage over work that never happened. A run that stopped on its own stays success even if the signal aborted in the settle window, a length cut on a capped turn still reports as the turn cap, and a throwing stream function surfaces as an ordinary worker error instead of hanging the run.
16
+ - **Small-context models run instead of silently never running.** The fit check prices the measured prompt (content + summaries + static overhead + turn headroom, all CJK-aware) against window minus output allowance minus margin; the output allowance is capped at a quarter of the window, and a too-small window skips without an hour-long cooldown. The stage dispatches that same allowance as the workers' generation cap, so a fitting prompt cannot overflow at generation time.
17
+ - **Compaction no longer freezes on long encoded tool output.** Searching tool results for file paths could spend minutes in a regular expression when output contained a large encoded value, leaving both automatic compaction and `/blackhole` unresponsive. Path scanning now avoids repeated scans and overlapping repetitions while preserving file matching for error retries, and is additionally bounded (head+tail window with a token cap) so multi-megabyte results stay cheap ([#142](https://github.com/k0valik/pi-blackhole/pull/142)).
18
+
19
+ - **The footer stops promising an observer pass that cannot run.** With `memory: false` the O gauge still filled past `observeAfterTokens` and turned warning/error colored, while `consolidation.ts` hard-returns before launching an observer — in a ~300k-token session it read as "observer full but never fired". `status-bar.ts` now gates rendering on `memory` as well as `statusBar`: O and P are omitted whenever memory is off, so nothing can render as if a note-taking pass were due. The gate is read on every render, so `/blackhole om-off`, `/blackhole om-on`, and settings saves take effect within the bar's 1-second poll (gauges return as soon as memory is re-enabled), the X compaction gauge and worker events are unchanged, and `statusBar: false` / `ctx.hasUI === false` still suppress the whole bar.
20
+ - **"Display all settings" no longer credits a tab's value to the layer that overrides it.** A non-winning tab printed `(from <winner>)` next to its own value, so the Global row `on (from Project Local)` claimed Project Local supplied `on` while it actually set `off` — the opposite of the precedence that applied. A higher-precedence winner is now labelled `overridden by <layer>`, and `(from <layer>)` survives only where a lower layer genuinely supplies the value on show; the winning tab still reads `▸ effective`, and layer order, tab order, and the Global-first opening tab are untouched. Edit mode uses the same rule (shared helper), so the scope-locked view no longer prints the old `(from …)` claim for the same key.
21
+
22
+ ---
23
+
5
24
  ## [0.5.10] - 2026-09-29
6
25
 
7
26
  ### Fixed
package/README.md CHANGED
@@ -46,12 +46,13 @@ Then `/reload` or restart Pi. The config file at `~/.pi/agent/pi-blackhole/pi-bl
46
46
 
47
47
  ## ✨ What's new
48
48
 
49
- > **Latest release: [0.5.10](CHANGELOG.md)**
49
+ > **Latest release: [0.5.11](CHANGELOG.md)**
50
50
  >
51
- > - **Memory workers that fail now fall back instead of silently skipping** — observer/reflector/dropper stream errors and turn-cap cutoffs throw into the model fallback chain, so a failed run no longer advances the cursor over work it never finished.
52
- > - **The turn cap only ends runs that did tool work** — a run that stops naturally on exactly its last allowed turn keeps its result instead of failing as cap-cut, and a capped session model is not retried on an identical budget.
53
- > - **`/blackhole` on an ineligible branch reports nothing-to-compact** — instead of Pi's error card plus a second failure toast when the branch already fits inside the keep-recent budget.
54
- > - **A cancelled `/blackhole` stays quiet, and the command loads the config first** — no second vaguer toast on cancel, and a `manual`-mode session flushes pending memory instead of reading defaults.
51
+ > - **Oversized memory work shrinks to fit instead of stalling** — when no configured model holds the sized input, the stages re-plan against the largest window and run, so small-context models work instead of silently never running.
52
+ > - **The observer can no longer skip entries it never saw** — the chunk cap keeps the oldest prefix and drains the backlog in-run, so coverage never advances past content the model wasn't shown.
53
+ > - **Cut-off worker runs fail into fallback instead of counting as finished** — `length`/`aborted`/stray tool-use endings no longer mark uncovered work done.
54
+ > - **Compaction no longer freezes on long encoded tool output** — bounded path scanning keeps multi-megabyte tool results cheap.
55
+ > - **A warning when `observeAfterTokens` exceeds `observerChunkMaxTokens`** — the loader warns (never clamps) that every pass will run as multiple batches.
55
56
  >
56
57
  > See [`CHANGELOG.md`](CHANGELOG.md) for the full history.
57
58
 
@@ -168,7 +169,7 @@ Defaults target ~128k context models and work out of the box — no tuning requi
168
169
  }
169
170
  ```
170
171
 
171
- Fallbacks (optional): each worker tries `stageModel → stageFallbacks → base model → session model` (skipping cooled-down models). By default the workers **do not** fall back to your session model — this avoids surprise cost and cache busting. Enable it with `sessionFallback: true` (default) or set `model` as a shared fallback. See [`docs/CONFIG.md` → Model Configuration](docs/CONFIG.md#model-configuration).
172
+ Fallbacks (optional): each worker tries `stageModel → stageFallbacks → base model → session model` (skipping cooled-down models). By default the session model **is** the last-resort fallback (`sessionFallback: true`), so workers keep running even with no worker models configured. If you don't want worker runs to touch your session model (extra cost and prompt-cache busting), configure cheap worker models (above) and set `sessionFallback: false` — or set `model` as a shared fallback so the session model is never reached. See [`docs/CONFIG.md` → Model Configuration](docs/CONFIG.md#model-configuration).
172
173
 
173
174
  Config file: **`~/.pi/agent/pi-blackhole/pi-blackhole-config.json`**
174
175
 
@@ -190,7 +191,7 @@ https://github.com/user-attachments/assets/a7dd804d-6aca-4bdb-8b6e-0dd779363a43
190
191
 
191
192
  Three background workers (separate LLM calls) run automatically during the session when `memory: true` (the default):
192
193
 
193
- - **Observer** — reads conversation since the last observation marker and extracts timestamped facts: events, decisions, preferences. Input is capped to `observerChunkMaxTokens` newest-first to prevent context blowup on long sessions. Runs most frequently.
194
+ - **Observer** — reads conversation since the last observation marker and extracts timestamped facts: events, decisions, preferences. Input is capped to `observerChunkMaxTokens` as an oldest-first prefix (overflow drains in bounded follow-up batches) to prevent context blowup on long sessions — the coverage cursor never advances past entries the model was not shown. Runs most frequently.
194
195
  - **Reflector** — distills new observations into durable reflections: stable facts, patterns, and constraints that survive future compactions. Runs less often.
195
196
  - **Dropper** — prunes low-value observations from active memory when the pool exceeds `observationsPoolMaxTokens`, while keeping reflections and other long-term elements safely in the session ledger.
196
197