pi-blackhole 0.5.4 → 0.5.6
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 +32 -0
- package/README.md +5 -6
- package/dist/index.js +157 -139
- package/index.ts +21 -5
- package/package.json +6 -6
- package/src/commands/memory.ts +10 -0
- package/src/commands/pi-vcc.ts +1 -1
- package/src/core/brief.ts +4 -47
- package/src/core/build-sections.ts +152 -28
- package/src/core/config-env.ts +1 -0
- package/src/core/content.ts +25 -2
- package/src/core/sanitize.ts +4 -0
- package/src/core/search-entries.ts +44 -9
- package/src/core/segment.ts +109 -0
- package/src/core/summarize.ts +249 -35
- package/src/core/unified-config.ts +7 -0
- package/src/extract/commits.ts +298 -27
- package/src/extract/file-touch.ts +1367 -0
- package/src/extract/files.ts +203 -38
- package/src/extract/git-status.ts +102 -0
- package/src/extract/goals.ts +3 -3
- package/src/extract/preferences.ts +42 -3
- package/src/hooks/before-compact.ts +35 -1
- package/src/hooks/compact-failed.ts +2 -2
- package/src/hooks/cosmetic-output.ts +229 -0
- package/src/om/agents/dropper/agent.ts +8 -0
- package/src/om/agents/observer/agent.ts +8 -0
- package/src/om/agents/reflector/agent.ts +8 -0
- package/src/om/compaction-trigger.ts +87 -9
- package/src/om/consolidation.ts +59 -46
- package/src/om/cooldown.ts +6 -2
- package/src/om/inline-compaction.ts +137 -35
- package/src/om/model-budget.ts +2 -2
- package/src/om/provider-stream.ts +129 -6
- package/src/om/retryable-error.ts +42 -0
- package/src/om/runtime.ts +70 -0
- package/src/om/tokens.ts +6 -2
- package/src/pi-base/blackhole-settings.ts +12 -0
- package/src/project-recall/corpus.ts +4 -4
- package/src/project-recall/dedup.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
## [0.5.6] - 2026-09-19
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **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.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Observer chunk cap now counts every entry type** ([#110](https://github.com/k0valik/pi-blackhole/issues/110)). `capSourceEntriesToTokens` used a hand-rolled type table that had drifted from the trigger's estimator, so `custom_message` entries (text lives in `.content`, not `.summary`) counted as zero tokens and an oversized chunk could exceed `maxTokens`; it now reuses the same `estimateEntryTokens` the trigger uses (CJK-aware), and debug logging exposes the post-cap chunk size and cooldown-skipped models on the normal path.
|
|
14
|
+
- **CJK-aware token accounting, text primitives, and extractor language handling** ([#106](https://github.com/k0valik/pi-blackhole/issues/106), [#105](https://github.com/k0valik/pi-blackhole/issues/105)). Script detection is automatic — no new config keys. `estimateStringTokens` counts CJK scripts as ~1 token/char instead of `ceil(chars/4)`, so every budget built on it (OM `tokenCount`, pool caps, `retainedToolOutputMaxTokens`, worker context pre-check) no longer admits ~3× the configured tokens. Clipping recognizes CJK terminators (`。!?;`, fullwidth included) and pause punctuation instead of hard-cutting space-free text. `recall` word-segments CJK queries via `Intl.Segmenter`, restoring per-term BM25 ranking with script-aware document-length normalization. `[User Preferences]` accepts CJK correction anchors (`不要`/`回退`/`错了`…) and `[Outstanding Context]` CJK failure stems (`失败`/`报错`/`错误`…) with benign-compound guards, scanning the whole fresh window instead of the last 20 blocks.
|
|
15
|
+
- **`[Files And Changes]` and `[Commits]` now extract what actually happened** ([#105](https://github.com/k0valik/pi-blackhole/issues/105)). File attribution correlates tool calls with results (native path args, anchor-based edits, a bash parser for redirects/`sed -i`/`tee`/`cp`/`mv`/`rm`/`curl -o`), sanitizes arg strings so `src/a.ts:10-40` no longer phantoms next to `/repo/src/a.ts`, and adds git grounding tags (`staged`, `new`, `deleted`, …); the collector runs only at compaction time. `[Commits]` uses a quote-aware token parser with a message-recovery chain (segment-scoped `-m`, `-F -` heredocs, the git success line) and precision guards (`--dry-run`, failed commits, non-`git` commands produce nothing).
|
|
16
|
+
- **`[Files And Changes]` display and cross-compaction merge overhauled**. cwd-relative paths, capped counted lists that never shrink after merge, and single-token paths hard-broken by `wrapLongLines` are reassembled; `(#N)` refs on `[Scope change]` and `[Commits]` for `recall` drill-down; session-goal and outstanding-context clips raised to 200.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## [0.5.5] - 2026-09-15
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **Minimum supported Pi raised to 0.84.3.** The `compat-min-supported` CI job now derives its pin from the `peerDependencies` floor instead of a hardcoded version, so the floor only moves when new Pi APIs are adopted. Fail-closed behavior on older hosts is unchanged.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **OM workers now send provider-required session headers (OpenCode Go `MissingSessionID`).** Observer/reflector/dropper calls bypass Pi's interactive header pipeline (`mergeProviderAttributionHeaders` + `before_provider_headers` in `sdk.ts`) by invoking `streamSimple` directly, so the OpenCode Go gateway rejected every worker request with `400 MissingSessionID` while Pi's own calls worked. Attribution now happens at a single choke point (`withProviderAttributionHeaders`, pi-core `getSessionHeaders` mirror with exact-hostname matching): the Pi session id travels through standard stream options (`sessionId`) and is materialized both as pre-merged `headers` and as a composed `transformHeaders` (honored by pi-ai `applyAuth` after the auth merge), covering builtin, custom-registered, and future providers without per-stage branching. Reworks PR #95 with the contributor's regression assertions kept verbatim. ([#93](https://github.com/k0valik/pi-blackhole/issues/93))
|
|
29
|
+
- **Deterministic 4xx errors now cool models down and engage fallbacks.** A 400-class failure (missing provider-required headers, bad credentials, unknown model) previously retried the same broken session model on every consolidation cycle: `recordRetryableError` is a no-op without a candidate config, and `isRetryableError` gated nothing (debug logging only) — so a deterministic 4xx like `MissingSessionID` never cooled the resolved session model at all. New `isDeterministicError` / `isCooldownWorthyError` classification; deterministic failures persist cooldown (default 1h) including for the resolved session model, so the stage falls through to `*FallbackModels` instead of burning attempts. Transient blips on the main model still only trip the 30s retry gate, never an hour-long cooldown.
|
|
30
|
+
- **Surface silently skipped stale-ctx auto-compactions ([#92](https://github.com/k0valik/pi-blackhole/issues/92)).** In-memory subagent/flow sessions are disposed by their parent right after `agent_end`, so the deferred auto-compaction microtask always bails on a stale extension ctx — previously invisible outside `debug.ndjson`, leaving large headless sessions unbounded with no signal. Each skipped compaction is now counted (`Skipped compactions (disposed ctx)` in `/blackhole-memory` status, process-wide so a parent surfaces nested-session skips) and warned once per session (UI notification; stderr for headless runs). Bail behavior itself is unchanged.
|
|
31
|
+
- **Reliable mid-run host discovery and recovery.** ([#98](https://github.com/k0valik/pi-blackhole/pull/98), thanks @sonSunnoi) On Pi's unbundled layout (`dist/cli.js` importing `dist/main.js`) a resolved bundled chunk no longer counts as host discovery on its own — each package root now falls back to its `dist/index.js` barrel, so inline (mid-run) compaction works instead of silently staying unavailable. Each discovered host also binds its own `prepareCompaction` helper, so a session never borrows another installed host's helper for eligibility checks. Plus: below-threshold observer content now accumulates instead of being dropped by the not-due cursor advance, stale cursors fall back to the coverage/compaction rule, and the startup adapter probe is carried into the runtime so `resume` mode warns once instead of silently falling back. Closes [#96](https://github.com/k0valik/pi-blackhole/issues/96).
|
|
32
|
+
- **Test host doubles without type escapes, and lint-staged tolerates ignored paths.** ([#99](https://github.com/k0valik/pi-blackhole/pull/99), thanks @sonSunnoi) The compaction host test double is now a complete typed `ExtensionAPI` implementation (compile-time contract test included); production code unchanged. Also fixes `lint-staged` failing docs-only commits (`oxfmt --check` on ignored `docs/` paths). Closes [#97](https://github.com/k0valik/pi-blackhole/issues/97).
|
|
33
|
+
- **Quitting right after startup no longer kills Pi.** ([#91](https://github.com/k0valik/pi-blackhole/pull/91), thanks @priaculun) The `session_start` migration notice runs behind a dynamic `import()`, so a quit, `/reload`, or `/new` in that window threw on the stale ctx — with no `.catch()`, the throw escaped as an unhandled rejection and terminated the process. The notice is now catch-terminated (best-effort, never fatal).
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
5
37
|
## [0.5.4] - 2026-09-13
|
|
6
38
|
|
|
7
39
|
### Fixed
|
package/README.md
CHANGED
|
@@ -31,13 +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.
|
|
34
|
+
> **Latest release: [0.5.6](CHANGELOG.md)**
|
|
35
35
|
>
|
|
36
|
-
> - **
|
|
37
|
-
> -
|
|
38
|
-
> - **
|
|
39
|
-
> -
|
|
40
|
-
> - **Auto-compaction no longer errors on "session too small"** — proactive triggers pre-check Pi's own compaction eligibility instead of notice-spamming and throwing.
|
|
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.
|
|
41
40
|
|
|
42
41
|
See [`CHANGELOG.md`](CHANGELOG.md) for the full history.
|
|
43
42
|
|