dsh-context-compression-improved 0.6.5 → 0.8.0-beta.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 (32) hide show
  1. package/CHANGELOG.ja.md +226 -211
  2. package/CHANGELOG.ko.md +220 -205
  3. package/CHANGELOG.md +366 -350
  4. package/CHANGELOG.zh.md +204 -190
  5. package/README.ja.md +85 -85
  6. package/README.ko.md +85 -85
  7. package/README.md +98 -96
  8. package/README.zh.md +85 -85
  9. package/package.json +68 -69
  10. package/packages/selector/dsh.plugin.json +2 -2
  11. package/packages/selector/lib/pruner.js +0 -1
  12. package/packages/selector/lib/style.css +46 -46
  13. package/packages/selector/package.json +114 -114
  14. package/packages/selector/tests/built/client-artifact.spec.ts +59 -59
  15. package/packages/selector/tests/helpers/legacy-settings/index.ts +15 -15
  16. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +41 -41
  17. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +647 -647
  18. package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +78 -78
  19. package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +234 -234
  20. package/packages/selector/tests/host-preset-overlay.host.spec.ts +1 -1
  21. package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +200 -200
  22. package/packages/selector/tests/public/package-contract.client.spec.ts +78 -78
  23. package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +230 -230
  24. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +2731 -2731
  25. package/packages/selector/tests/standing-generation.host.spec.ts +724 -724
  26. package/pnpm-workspace.yaml +66 -66
  27. package/scripts/packed-install-e2e.mjs +1273 -1273
  28. package/scripts/verify-release.mjs +317 -317
  29. package/.agents-stash-064.patch +0 -39
  30. package/_dsh_devdeps.json +0 -50
  31. package/_verify064/package/package.json +0 -162
  32. package/_verify064/package/packages/selector/src/client/index.ts +0 -232
package/CHANGELOG.md CHANGED
@@ -1,350 +1,366 @@
1
- # Changelog
2
-
3
- All notable changes use this file. The project follows semantic versioning after `0.1.0`.
4
-
5
- ## 0.6.5 - 2026-09-29
6
-
7
- ### Fixed
8
-
9
- - Dev-dependency alignment to the Harness 0.1.7 line: 46 of the 48 `@deepseek-ai/dsh-*`
10
- dev-dependencies moved from the precise `0.1.5-rc.2` pin to the precise `0.1.7-rc.2` pin,
11
- and `pnpm-lock.yaml` was regenerated from a clean tree. Typecheck, build, test, lint, and
12
- `verify:release` now run against the real 0.1.7-rc.2 baseline instead of validating the
13
- 0.1.7 adaptations against 0.1.5 inputs (a false green). Two packages have no 0.1.7-line
14
- release at all and keep their install-time pinned values: `@deepseek-ai/dsh-agent-presets`
15
- (`0.1.6-alpha.2`) and `@deepseek-ai/dsh-code-runtime` (`0.1.5-rc.3`). `react-dom` gained an
16
- explicit `^18.2.0` dev-dependency so a fresh resolution cannot pair React-DOM 19 with
17
- React 18 under the test suites.
18
- - The test-host settings seam was rebuilt against the real 0.1.7 host: `SettingsProvider`
19
- no longer exists in `@deepseek-ai/dsh-settings` (replaced by the declarative
20
- `SettingsForms`), while the plugin keeps the legacy `ctx.settings.get(ns)` read as a
21
- host-shape fallback. The specs now mount a vendored copy of the 0.1.5-rc.2 provider
22
- (`tests/helpers/legacy-settings/`) to exercise exactly that fallback, and the
23
- legacy-namespace registrar narrows the service at the seam. The live DeepSeek harness test
24
- registers the provider through the 0.1.7 adapter seam instead of the removed
25
- self-contained `llm-deepseek` plugin.
26
- - Test adaptations surfaced by the real baseline: the compaction-engine fixtures pass
27
- `headroomTokens: 0` (0.1.7-rc.2 defaults a 65536-token compaction headroom, which swallows
28
- the fixtures' 1k-token probe windows), and the tool-result asset assertion follows the
29
- first-class `role: 'tool'` message shape (no wrapping `tool-result` content block).
30
- - Release gates re-pinned to the official 0.1.7 release: `verify-release.mjs` and the packed
31
- E2E now assert selector peers `>=0.1.7-rc.1 <0.2.0-0`, and the packed E2E's official-harness
32
- clone asserts tag `dsh-v0.1.7-rc.2` (commit `477b4f42`, tree `e3e63253`).
33
- - `packages/selector/dsh.plugin.json` now carries the release version (0.6.5; every earlier
34
- 0.6.x shipped it frozen at 0.1.0) and declares the honest engine range
35
- `>=0.1.7-rc.1 <0.2.0-0`.
36
- - Lint debt from the 0.6.3 manual adaptations cleared: unused imports/locals removed in
37
- `src/index.ts`, `src/client/index.ts`, `src/pruner.ts`, and three host specs; the
38
- standing-generation staging-leftover scan now scopes to the spec's own store so a
39
- concurrently publishing spec cannot fail it.
40
-
41
- ## 0.6.4 - 2026-09-26
42
-
43
- ### Fixed
44
-
45
- - The client locale binder is eager: switching the host locale now re-renders the
46
- compression settings UI without a remount.
47
- - Released from a stash and never committed to any branch (the working tree that published it
48
- was lost); compat/0.1.7 restored the exact content in 0.6.5 and byte-verified it against
49
- the registry tarball before continuing.
50
-
51
- ## 0.5.4 - 2026-09-20
52
-
53
- ### Fixed
54
-
55
- - The install surface declares `@deepseek-ai/schemastery` as a runtime dependency. The packaged
56
- runtime imports it unconditionally (`import z from '@deepseek-ai/schemastery'` in
57
- `packages/selector/lib/index.js`, `lib/pruner.js` and `lib/advisor-state.js`), but 0.5.3
58
- declared it nowhere a consumer install reads: the shipped root manifest listed only
59
- `@huggingface/tokenizers` and `js-yaml`, and `packages/selector/package.json` listed it as a
60
- peer, which no package manager consults for a nested package it installs. Resolution therefore
61
- depended on an unrelated installed package hoisting `@deepseek-ai/schemastery` into the
62
- profile. In a clean install the import fell through to the Harness installation's
63
- shared-module fallback at `$DSH_HOME/profiles/node_modules`; where that fallback held no built
64
- package, every plugin entry failed to load and the host booted without the Bundle layer. Both
65
- manifests now pin `3.18.2`, the version this release is built and tested against, and the
66
- selector package no longer claims a peer obligation it does not have.
67
-
68
- ### Added
69
-
70
- - `verify:release` derives the install-surface dependencies from the bare specifiers the
71
- packaged runtime files import, instead of naming `@huggingface/tokenizers` and `js-yaml` by
72
- hand. Which packages ship with the plugin and which the Harness installation provides is a
73
- reviewed list, and an import whose provider is in neither manifest fails the gate with the
74
- missing name. The gate was added as a negative control against the unfixed manifests, where it
75
- failed on `@deepseek-ai/schemastery`.
76
-
77
- ## 0.5.3 - 2026-09-20
78
-
79
- ### Fixed
80
-
81
- - The Bundle patch no longer sets the retired review route flag. `reviewQueueRoute` was
82
- removed from the plugin's Config schema when the review gate was retired, but it stayed in
83
- `packages/selector/cordis.patch.yml`, where it advertised a route that can never register.
84
- Hosts tolerate the unknown key today (the plugin loads and serves — verified on a live host),
85
- so this is a stale-config defect rather than a break, but it would break on any host that
86
- validates plugin config strictly.
87
- - Generated artifacts are pinned to LF (`packages/selector/lib/** text eol=lf`). With
88
- `core.autocrlf=true` every checkout rewrote the committed `lib/**` to CRLF, so any branch
89
- switch or merge left the whole artifact directory reported as modified with EOL-only
90
- differences. Nothing was ever committed from that state, but it made every tree look dirty
91
- and it would hide a real artifact change.
92
-
93
- ### Added
94
-
95
- - A negative-control contract pin on the Bundle patch: it fails when a retired config key is
96
- set in the patch (asserted on key-setting lines, so the explanatory comment may still name
97
- the key), and it requires the live `estimatorCatalogRoute` flag to stay wired.
98
-
99
- ### Tests
100
-
101
- - The client seat contract also pins the older-host degradation: a host that does not declare
102
- the seat rejects the registration at the slot boundary, and `apply()` must swallow it and
103
- warn instead of taking every settings entry down with it.
104
-
105
- ## 0.5.2 - 2026-09-20
106
-
107
- ### Changed
108
-
109
- - The human-gated review pipeline (beta) is **retired**. Its semantics are replaced by
110
- advice: the benefit model still prices every pass as ONE merged mutation, but the band it
111
- computes (`profitable` / `high-impact` / `slow-payback` / `unpriceable` / `not-worth-it`)
112
- is now published as a `reduction-advice` audit record and snapshotted onto the advisor
113
- report route — it never withholds, delays, or rewrites a reduction. The gate contradicted
114
- the feature's own requirement (a reduction must never block automatic processing) and, with
115
- the shipped defaults (`reviewMode` on plus a 4,000-token high-impact threshold against an
116
- 8,192-token fresh trigger), diverted 100% of a fresh batch into human review, leaving the
117
- automatic path effectively off for anyone who opted in. The advice thresholds are now
118
- module constants (α `0.1`, high-impact `4,000` tokens): nothing acts on them, so they are
119
- no longer settings.
120
- - Removed with the gate: the review queue and its `storageDomain` adapter, the process-wide
121
- registry, the `review-queue` / `review-decide` HTTP routes and the `reviewQueueRoute`
122
- deployment flag, the `shell.overlay` client panel, the `reviewMode` /
123
- `reviewTimeoutTurns` / `cacheHitDiscountAlpha` / `reviewHighImpactTokens` settings keys,
124
- and the `review-outcome` audit kind. The four settings keys stay ACCEPTED and IGNORED by
125
- both decoders — an existing document (the live one carries `reviewMode: false`) still loads
126
- and still renders its settings card — and never reach the resolved policy. The read-only
127
- `GET .../advisor-report` route additionally serves `lastAdvice`.
128
-
129
- ### Added
130
-
131
- - Regression pins for the retirement: a host-integration spec drives the exact settings that
132
- used to divert everything (`reviewMode: true`, `reviewHighImpactTokens: 1`) and asserts the
133
- fresh batch LANDS, described by a `high-impact` advice record; a deprecation-contract spec
134
- pins accept-and-ignore for the retired keys on both the runtime parser and the browser
135
- decoder.
136
-
137
- ### Rollback
138
-
139
- - Reinstall the last release that still ships the gate: `npm dist-tag add
140
- dsh-context-compression-improved@0.5.1 dsh-0.1.5 --registry https://registry.npmjs.org/`
141
- then `dsh plugin --profile web add dsh-context-compression-improved@0.5.1`.
142
-
143
- ## 0.5.1 - 2026-09-20
144
-
145
- ### Fixed
146
-
147
- - Concurrent preset-overlay composition of one identity no longer fails on Windows.
148
- Publication is now serialized per destination path, and when the atomic rename still
149
- loses the race the destination is confirmed to already carry this staging file's
150
- `{mtimeMs, size}` standing key before the publish reports success. Windows `MoveFileEx`
151
- reports that lost race as `EPERM`/`EBUSY` where POSIX `rename` simply replaces the
152
- destination, which made `standingKeyFor()` throw during concurrent session start. A
153
- destination that does not match still fails loudly, so a silently reused generation
154
- stays forbidden.
155
- - Release-gate and test repairs that had been hiding this and other pre-existing red
156
- gates: stale identifiers and a retired audit reason in the packed smokes, a stale
157
- client-inject expectation, and Windows-only spawn traps (`git` and multi-line
158
- `node -e` scripts were routed through `cmd.exe`, which rewrote their arguments).
159
-
160
- ## 0.5.0 - 2026-09-20
161
-
162
- ### Added
163
-
164
- - Advisory relevance advisor (statistics and suggestions only, default off): at every turn
165
- boundary a fire-and-forget pass summarizes the session's tail-task semantics from the
166
- most recent `todo/write` event (falling back to recent user text), incrementally scores
167
- historical tool-result candidates for content-and-comment relevance against the current
168
- task, and computes a prefix-decay figure (character-pressure-weighted mean relevance).
169
- Low-relevance old segments are marked `recertified` as suggestions for later
170
- history-aggressiveness decisions — nothing this round consumes them, and advisor output
171
- can never suppress, delay, or rewrite any reduction that would land (pinned by a
172
- dedicated invariant test). Configure through the `presetOptions.advisor*` settings keys
173
- (`advisorMode` `''|'host'|'direct'`, default `''`; the direct channel reuses the
174
- estimator endpoint; `SideChannel` gained an optional overrides parameter so the
175
- estimator's transport is shared without sharing its configuration). Observability: new
176
- `advisor-outcome` audit records (content-free, one per phase: summary / scoring / decay)
177
- and a read-only `GET .../advisor-report?sessionId=` HTTP route (opt-in deployment flag
178
- `advisorReportRoute`, mirroring the review routes). Client UI is intentionally absent
179
- this round.
180
-
181
- ## 0.4.0 - 2026-09-20
182
-
183
- ### Fixed
184
-
185
- - The plugin no longer depends on the routed model id: every planning gate now decides on
186
- the character basis (Unicode code points via `characterPressure` / `pressureCost`) instead
187
- of exact tokenizer counts, so a route without a bundled tokenizer (the live
188
- `deepseek-flash`) lands rewrites again instead of silently skipping. Token thresholds keep
189
- their names and values (converted at the documented 4.0 chars/token convention, frozen
190
- profile baseline untouched); token figures become telemetry, labelled honestly by the new
191
- `measurementBasis` field on rewrite audit records (`exact-tokenizer` vs `characters`,
192
- with `tokenizerId: 'characters'` / `tokenizerRevision: 'chars-per-token-4.0'` when derived).
193
- Rollback: `git revert 7a1972a` restores the exact-tokenizer gates as a single unit; confirm
194
- no later change re-introduced a model-id split that relies on this commit first.
195
-
196
- ### Added
197
-
198
- - Batch-level benefit pricing (R1): a review pass is priced as ONE merged mutation — the
199
- tail KV-cache refill penalty is paid once per batch instead of per candidate, so real
200
- batches (5×50k with a 64k tail) reach the auto band instead of all dropping.
201
- - Original-event line mapping (R9a): terminal normalization returns folded lines that each
202
- carry their 1-based original-event line number; `retrieve` reads raw events, so printed
203
- ranges resolve to the right lines.
204
- - Document skeleton and universal prose keep (R8/R8b): structured documents keep headings,
205
- section first/last lines, list starts and table headers; every other non-code text keeps
206
- head AND tail with an R9 line-range marker (prose was previously head-only truncated).
207
- - Two-tier search folding (R10, fixes D8): a lossless per-file L1 locator plus a
208
- water-filled L2 content quota.
209
- - Non-adjacent frequency folding (R11): separated exact repeats (up to 8.37% of large
210
- results) fold to first occurrence plus one counted marker.
211
- - Long-string placeholders (R12): base64/hex/UUID blobs become length summaries with a
212
- 16-char recognition prefix.
213
- - Two-stage HTML reduction (R13, fixes D9): `html-slim` then `html-skeleton`, line-aligned
214
- so original line numbers survive.
215
- - R9b anchors: contiguous masks cite original line ranges, scatter masks report
216
- `lines 1-N scanned, K kept`, and every retrieve hint carries a pasteable
217
- `{"ref":…,"start_line":N,"max_lines":80}`.
218
- - Document census: omitted-document summaries list section headings instead of a constant
219
- `0 error, 0 warn, N info` histogram.
220
-
221
- ## 0.3.1 - 2026-09-18
222
-
223
- ### Changed
224
-
225
- - The runtime package is merged into the selector package: one install brings the whole
226
- stack, the repository root is the install surface (`name`, `main`, `types`, `exports` with
227
- `./pruner` and `./invariant`, `dependencies`, `dsh`), and the toolchain, scripts and CI were
228
- swept to the single package. The verified estimator-catalog registration (dual prefix, guarded
229
- two-channel activation, per-request service resolution, visible lifecycle lines) was replayed
230
- onto this line with a host-side guard; the settings schema that `ab2175a` had downgraded to
231
- `z.any()` is restored, so the daily Custom defaults are published again.
232
- - Adapt to the official DeepSeek Harness `v0.1.5-rc.2` on this branch. All `@deepseek-ai/dsh-*` dev dependencies and the pinned e2e host set move from `0.1.1-rc.2` to `0.1.5-rc.2` (cordis `4.0.2`, schemastery `3.18.2`), including the new split packages (`dsh-session-projection`, `dsh-session-persistence`, `dsh-atomic-write`, `dsh-home-paths`, `dsh-sandbox`, and related) and the `dsh-client-store` client stack.
233
- - Surface replace operations now use the v3 `startSeq`/`endSeq` shape with branded `SessionSeq` values; `compaction/prune` manifests keep the durable `start`/`end` fields. Events are resolved from surface nodes by seq lookup instead of array indexing.
234
- - The client bundle no longer imports the removed `@deepseek-ai/dsh-client-runtime`: settings types now come from `@deepseek-ai/dsh-client-ui-settings` and the session hooks merge from `@deepseek-ai/dsh-client-ui-session`. `engines.dsh >=0.1.5-alpha.1 <0.2.0-0` is declared in both package manifests and `dsh.plugin.json`.
235
- - Harness 0.1.5 no longer exposes the session `agentPreset` to the browser, so the client can no longer detect Minimal-only sessions; the selector stays selectable and the old unavailable banner is unreachable.
236
- - Test batteries updated for 0.1.5 semantics: cordis plugin starts require `.await()`, the Token Meter requires a mounted `SessionProjectionRegistry`, assistant events carry `stream: []`, and settings namespaces are plain strings.
237
-
238
- ### Fixed
239
-
240
- - The estimator card no longer demands an API key on the Harness host channel. Selecting the host channel shows the live provider/model dropdowns, names the route that would actually run (explicit override, else the session default), and renders neither a key field nor a second manual model input: the base URL, the model text field, and the write-only key belong to the direct endpoint channel alone.
241
- - `presetOptions` writes are path-addressed. Writing the whole section replaced it, so touching any second estimator field (a provider, a model, an endpoint) deleted `estimatorMode` and every sibling override — silently switching the estimator back off while the panel still reported a successful save. Each field now writes only itself, `undefined` clears exactly the field it names, and the confirmation read validates the same field set instead of the mode alone.
242
- - New coverage: `packages/selector/tests/preset-options-write.client.spec.ts` (path-scoped writes, sibling preservation, explicit clears, no-op patches, uncommitted-write reporting) and `packages/selector/tests/estimator-channel.client.spec.tsx` (per-channel fields, catalog dropdowns, manual fallback).
243
-
244
-
245
- ### Added
246
-
247
- - New `tokenpilot-inspired` profile: a TokenPilot-paper-inspired capability matrix layered on the Balanced thresholds, selected explicitly from the settings UI; every pre-existing profile keeps a byte-identical resolved policy (enforced by a captured-baseline golden test).
248
- - Byte-identical repeated tool-result dedup: an oversized repeat is replaced with a pointer to the first occurrence's append-only original event (`dedupe-pointer`), with a per-session SHA-256 index (2,048-entry insertion-order eviction, hash+seq metadata only).
249
- - No-net-savings guard: replacements whose text is not smaller than the original are rejected even when the exact tokenizer reports a token saving.
250
- - Recovery exemption: recovery-tool output is permanently exempt from every reduction pass via a unified per-session exemption set, preventing compress-restore oscillation.
251
- - Auto Compact summary locator: after `compaction/end`, the landed summary checkpoint gains an Exact Sources block (shadowed seq range, spill files, touched files) so summarized-away details stay recoverable; skipped when it would locate nothing concrete.
252
- - Read-state semantics: a historical read whose file was later mutated is `superseded` and takes the small whole-result placeholder; optional error/warn/info clustering of omitted lines is appended to historical placeholders.
253
- - Optional residual-utility estimator (three channels: off / Harness host model / direct OpenAI-compatible endpoint) with per-session exponential backoff, strict timeout, advisory-only verdicts consumed by the next pressure pass, and numeric-only `estimator-outcome` audits. The estimator card appears only while the new profile is selected; the API key is write-only in settings and never enters the frozen policy, audits, or logs.
254
- - New audit records: `summary-locator` and `estimator-outcome`; the rewrite record covers dedup via the `dedupe-pointer` reducer. Audit field allowlists are unchanged.
255
- - Simplified Chinese and English copy for the new profile and estimator card; unit and golden coverage under `packages/runtime/tests/tokenpilot/`.
256
-
257
- - Orthogonal code-skeleton compression gate (`codeSkeleton.enabled`, default off): the first exposure of an oversized fresh source-code tool result can keep an imports-and-declarations skeleton with bodies elided and error lines preserved, falling back to the original head pruning. The gate is independent of every profile and gated on exact tokenizer measurement.
258
- - Settings-UI toggle for the gate in the selector settings section, with Simplified Chinese and English copy.
259
- - Browser/runtime decode parity for the new section, confirm-on-write contract tests for `saveCodeSkeleton`, and a full-document parity matrix extension.
260
-
261
- ### Changed
262
-
263
- - Added an ESLint flat-config baseline (`pnpm lint`, enforced in CI) and a `pnpm test:watch` TDD loop; removed dead imports and hardened two error paths surfaced by the lint baseline.
264
- - This repository is now maintained as an improved fork of `WilliamShi666/dsh-context-compression-selector`; documentation ships in English, Simplified Chinese, Japanese, and Korean.
265
-
266
- ## 0.1.0 - 2026-09-03
267
-
268
- ### Added
269
-
270
- - Stable release of DeepSeek V4 Flash Vision tokenizer integration for `deepseek-v4-flash-vision-exp`, including exact text counting and bounded image-token estimates.
271
- - User-configurable model-driven Auto Compact threshold in the selector settings section.
272
- - Auto Compact threshold linkage for each standard profile's History / micro-compact watermarks and related compression parameters.
273
-
274
- ### Changed
275
-
276
- - The threshold editor now uses one direct numeric input; the slider and fixed quick-value buttons were removed.
277
- - Runtime session-event access supports both the established Harness `events` accessor and the newer `snapshotEvents()` public API.
278
-
279
- ## 0.1.0-beta.4 - 2026-09-02
280
-
281
- ### Fixed
282
-
283
- - Support the official DeepSeek Harness `dsh-v0.1.2-alpha.5` public API while retaining compatibility with the existing `0.1.1-rc.2` peer range. The plugin now owns the two small immutable-value helpers that the newer Harness no longer exports, and uses the same public `context-compression` namespace literal accepted by both Settings implementations. No Harness core code is modified.
284
-
285
- ## 0.1.0-beta.3 - 2026-09-01
286
-
287
- ### Scope
288
-
289
- This is a staged release. Exact **text-class** token counting for `deepseek-v4-flash-vision-exp`, best-effort bounded **vision-class image** estimates, and the Auto Compact threshold/UI/audit work are delivered. Exact image measurement remains **BLOCKED upstream**: the current measurement seam exposes neither the adapter's projected request-image dimensions nor the absolute serialized position, so estimates cannot be promoted to `exact-tokenizer`.
290
-
291
- ### Added
292
-
293
- - DeepSeek V4 Flash Vision support for `deepseek-v4-flash-vision-exp` via a separately bundled official tokenizer pinned at `deepseek-ai/DeepSeek-V4-Flash-Vision-Exp` revision `6821d6ad3681a4b137b066b76094fa82ebd0a380`. Text, reasoning, tool-call arguments, and pure-text tool results are counted exactly; image-bearing tool-result candidates stay fail-open.
294
- - Vision image-token arithmetic ported line-by-line from the official `inference/image_processor.py` (patch size 14, downsample 3, 384-token cap, min pixels 147456, 8:1 aspect clamp, and position-dependent alignment padding), validated against golden fixtures generated by executing the official Python implementation. Valid intrinsic dimensions now produce `tokenizer-estimate` at the midpoint of all four alignment residues with a 384-token per-image upper bound; malformed or unevaluable dimensions use a documented 256-token fallback. Mixed text/image surfaces aggregate exact text and estimated images without promoting them to exact.
295
- - `autoCompact.thresholdPercent` setting (default 80, integer 50–90, step 1) with one shared validation contract across the settings UI, the persisted schema, and the runtime resolver. The editor lives inside the context-compression selector settings section.
296
- - Standard-profile History linkage to the Auto Compact watermark: `A = floor(C × a)` rescales the History trigger, minimum reclaim, and recent-token tail; `D = floor(A × 0.875)` replaces the fixed 0.7 capacity-pressure ratio as the micro-compact last-chance gate; one batch must justify its cache break by pulling the complete request back below the deadline. Defaults at 80% reproduce the previous numbers exactly.
297
- - The preset overlay writes the saved threshold into the generated `compaction-basic` composition as `thresholdRatio` (with `retainRatio` pinned at 0.16) and, from the same read, into the plugin runtime's deployment config as `autoCompactThresholdPercent`, so one standing generation never runs Auto Compact and micro compact on two different thresholds. Any generation-identity change — threshold, source, or module paths, including equal-length ones — produces a new standing composition generation. Deterministic identity-derived stamps use an 8-hex whole-second window; equal-prefix identities can collide in that first window on a coarse filesystem, so the overlay observes the staging file's real `mtimeMs+size` key and escalates to later hash windows before the atomic rename. Content, permissions, and the final unique stamp are complete before publication; already-running sessions keep their frozen policy.
298
- - `policy-resolved` audits now record the Auto Compact coordination facts (threshold percent, `A`, `D`, parameter source — including `deployment-override`/`mixed` when deployment config replaces linked History watermarks), the routed provider/model, and the bundled tokenizer identity.
299
- - Persisted settings reject present-but-invalid sections (`profile: null`, `custom: null`, own-property `undefined`) before any schema default can absorb them; a malformed stored document freezes the session losslessly (`profile: off`, audited as `settingsInvalidFallback: lossless-off`) instead of silently enabling the lossy Balanced default. The browser decoder applies the same rule and canonicalizes legacy Custom v1/v2 documents to the same v3 document the runtime resolver produces.
300
- - The History planner returns a discriminated outcome, and `component-evaluation` audits distinguish the full skip taxonomy: `below-profile-trigger`, `below-micro-deadline`, `exact-tokenizer-unavailable`, `no-safe-candidates` (only recovery-tool output or already-cleared results), `protected-working-set` (everything inside the protected tail), `insufficient-reclaim` and `cannot-reach-deadline-target` (with the reached/required token numbers), `adaptive-cost-rejected`, and `recovery-tool-unavailable`.
301
-
302
- ### Known limitations
303
-
304
- - Images never claim exact counts. The official expansion depends on the absolute prompt position (system prompt, chat-template framing, adapter image handles) and on the adapter's final request-image projection (including per-route `imagePixelBudget`/`imageDetail` overrides and byte-cap reprojection), none of which is exposed through the current measurement seam. Intrinsic/default estimates may therefore differ materially from provider accounting. Upstream capability requests remain projected request-image dimensions and the absolute serialized position exposed to token-meter extensions.
305
- - History skips the whole batch whenever any tool-result candidate lacks an exact count, including image-bearing candidates, even though sibling text candidates are individually exact.
306
- - Custom remains manual token mode; its History parameters do not follow the Auto Compact watermark.
307
- - A vision token breakdown UI is not shipped; image estimates and the intrinsic alignment diagnostic are available on the measured token view, while lossy rewrite proofs still require exact counts.
308
-
309
- ### Deferred
310
-
311
- - Audit `modality` field and the tokenizer artifact SHA-256 inside audit records (the audits already carry the routed provider/model and tokenizer identity).
312
- - Publishing the (now complete) runtime skip-reason taxonomy as a user-facing documentation table.
313
- - Custom-profile display of the A/D watermarks and an above-D warning; Custom remains fully manual.
314
- - Vision token breakdown UI and promotion of image estimates to exact measurement.
315
-
316
- ## 0.1.0-beta.2 - 2026-08-28
317
-
318
- ### Fixed
319
-
320
- - Resolve the official DeepSeek V4 Flash tokenizer route so Fresh and Aggregate can evaluate tool results for the supported V4 models.
321
- - Run Cache Strict History at the real request boundary once its configured capacity-pressure condition is met; trigger the capacity condition at 70% routed-context utilization.
322
- - Disable Harness-native head/middle/tail tool-result pruning whenever a selector profile is active, leaving the selector as the sole tool-result compactor.
323
-
324
- ### Changed
325
-
326
- - Protect the newest 10 agent tool calls and a 64,000-token tool-result tail window before History/microcompact rewrites older results.
327
-
328
- ## 0.1.0-beta.1 - 2026-08-27
329
-
330
- ### Added
331
-
332
- - One-install DeepSeek Harness Product Bundle backed by a separate exact-version runtime package.
333
- - Web profile selector with preset-stable settings and an explicit built-in Minimal exception.
334
- - Fresh, Aggregate, routine/capacity-aware History, Native tool-result pruning, and default-off Custom TailTrim.
335
- - Standard-event TailTrim protocol using `compaction/prune` plus recoverable `user/message` replacement.
336
- - Plugin-owned `context_compression_retrieve` recovery tool.
337
- - Structured, content-free policy, evaluation, rewrite, failure, and Native auto-compact audit records.
338
- - Pinned official DeepSeek V4 tokenizer assets with runtime SHA-256 validation and upstream license.
339
- - Public-API component E2E, preset/Minimal, and parent/fork/spawn cache-prefix regression tests.
340
-
341
- ### Compatibility
342
-
343
- - Verified against DeepSeek Harness `dsh-v0.1.1-rc.2` public packages.
344
- - Exact tokenizer mapping is currently limited to `deepseek-v4-flash` and `deepseek-v4-pro`.
345
-
346
- ### Known limitations
347
-
348
- - Adaptive ordinary History fails closed when public request-level route/cache evidence is incomplete; capacity pressure remains a separate safety override.
349
- - Cache-prefix tests prove native fork inheritance and identical serialized prefixes, not a provider-specific cache allocation or a guaranteed DeepSeek cache hit.
350
- - Settings snapshots and first-exposure decisions are process-local to the mounted runtime.
1
+ # Changelog
2
+
3
+ All notable changes use this file. The project follows semantic versioning after `0.1.0`.
4
+
5
+ ## 0.8.0-beta.1 - 2026-09-30
6
+
7
+ ### Changed
8
+
9
+ - Harness 0.2.0 compatibility line: all 23 `@deepseek-ai/dsh-*` peer ranges moved to
10
+ `>=0.2.0-rc.1 <0.2.1-0`, and `engines.dsh` follows in all three manifests (root,
11
+ selector package, plugin manifest). `publishConfig.tag` becomes `dsh-0.2.0`; the 0.1.7
12
+ line remains served from `dsh-0.1.7` (now `0.7.0-beta.1`), the 0.1.5/0.1.2 lines from
13
+ their own dist-tags.
14
+ - 39 of the 41 pinned overrides and 46 of the 48 dev-dependencies moved to `0.2.0-rc.1`;
15
+ `@deepseek-ai/dsh-agent-presets` (`0.1.6-alpha.2`) and `@deepseek-ai/dsh-code-runtime`
16
+ (`0.1.5-rc.3`) keep their pins — neither package has any 0.2.0-line release.
17
+ - Release gates re-targeted: the packed-install e2e harness pin now checks out the
18
+ official `dsh-v0.2.0-rc.1` tree (`4878cdab`), and the built-artifact contract test
19
+ asserts the `configForms` client slot (renamed from `settingsScope` on the 0.1.7 line).
20
+
21
+ ## 0.6.5 - 2026-09-29
22
+
23
+ ### Fixed
24
+
25
+ - Dev-dependency alignment to the Harness 0.1.7 line: 46 of the 48 `@deepseek-ai/dsh-*`
26
+ dev-dependencies moved from the precise `0.1.5-rc.2` pin to the precise `0.1.7-rc.2` pin,
27
+ and `pnpm-lock.yaml` was regenerated from a clean tree. Typecheck, build, test, lint, and
28
+ `verify:release` now run against the real 0.1.7-rc.2 baseline instead of validating the
29
+ 0.1.7 adaptations against 0.1.5 inputs (a false green). Two packages have no 0.1.7-line
30
+ release at all and keep their install-time pinned values: `@deepseek-ai/dsh-agent-presets`
31
+ (`0.1.6-alpha.2`) and `@deepseek-ai/dsh-code-runtime` (`0.1.5-rc.3`). `react-dom` gained an
32
+ explicit `^18.2.0` dev-dependency so a fresh resolution cannot pair React-DOM 19 with
33
+ React 18 under the test suites.
34
+ - The test-host settings seam was rebuilt against the real 0.1.7 host: `SettingsProvider`
35
+ no longer exists in `@deepseek-ai/dsh-settings` (replaced by the declarative
36
+ `SettingsForms`), while the plugin keeps the legacy `ctx.settings.get(ns)` read as a
37
+ host-shape fallback. The specs now mount a vendored copy of the 0.1.5-rc.2 provider
38
+ (`tests/helpers/legacy-settings/`) to exercise exactly that fallback, and the
39
+ legacy-namespace registrar narrows the service at the seam. The live DeepSeek harness test
40
+ registers the provider through the 0.1.7 adapter seam instead of the removed
41
+ self-contained `llm-deepseek` plugin.
42
+ - Test adaptations surfaced by the real baseline: the compaction-engine fixtures pass
43
+ `headroomTokens: 0` (0.1.7-rc.2 defaults a 65536-token compaction headroom, which swallows
44
+ the fixtures' 1k-token probe windows), and the tool-result asset assertion follows the
45
+ first-class `role: 'tool'` message shape (no wrapping `tool-result` content block).
46
+ - Release gates re-pinned to the official 0.1.7 release: `verify-release.mjs` and the packed
47
+ E2E now assert selector peers `>=0.1.7-rc.1 <0.2.0-0`, and the packed E2E's official-harness
48
+ clone asserts tag `dsh-v0.1.7-rc.2` (commit `477b4f42`, tree `e3e63253`).
49
+ - `packages/selector/dsh.plugin.json` now carries the release version (0.6.5; every earlier
50
+ 0.6.x shipped it frozen at 0.1.0) and declares the honest engine range
51
+ `>=0.1.7-rc.1 <0.2.0-0`.
52
+ - Lint debt from the 0.6.3 manual adaptations cleared: unused imports/locals removed in
53
+ `src/index.ts`, `src/client/index.ts`, `src/pruner.ts`, and three host specs; the
54
+ standing-generation staging-leftover scan now scopes to the spec's own store so a
55
+ concurrently publishing spec cannot fail it.
56
+
57
+ ## 0.6.4 - 2026-09-26
58
+
59
+ ### Fixed
60
+
61
+ - The client locale binder is eager: switching the host locale now re-renders the
62
+ compression settings UI without a remount.
63
+ - Released from a stash and never committed to any branch (the working tree that published it
64
+ was lost); compat/0.1.7 restored the exact content in 0.6.5 and byte-verified it against
65
+ the registry tarball before continuing.
66
+
67
+ ## 0.5.4 - 2026-09-20
68
+
69
+ ### Fixed
70
+
71
+ - The install surface declares `@deepseek-ai/schemastery` as a runtime dependency. The packaged
72
+ runtime imports it unconditionally (`import z from '@deepseek-ai/schemastery'` in
73
+ `packages/selector/lib/index.js`, `lib/pruner.js` and `lib/advisor-state.js`), but 0.5.3
74
+ declared it nowhere a consumer install reads: the shipped root manifest listed only
75
+ `@huggingface/tokenizers` and `js-yaml`, and `packages/selector/package.json` listed it as a
76
+ peer, which no package manager consults for a nested package it installs. Resolution therefore
77
+ depended on an unrelated installed package hoisting `@deepseek-ai/schemastery` into the
78
+ profile. In a clean install the import fell through to the Harness installation's
79
+ shared-module fallback at `$DSH_HOME/profiles/node_modules`; where that fallback held no built
80
+ package, every plugin entry failed to load and the host booted without the Bundle layer. Both
81
+ manifests now pin `3.18.2`, the version this release is built and tested against, and the
82
+ selector package no longer claims a peer obligation it does not have.
83
+
84
+ ### Added
85
+
86
+ - `verify:release` derives the install-surface dependencies from the bare specifiers the
87
+ packaged runtime files import, instead of naming `@huggingface/tokenizers` and `js-yaml` by
88
+ hand. Which packages ship with the plugin and which the Harness installation provides is a
89
+ reviewed list, and an import whose provider is in neither manifest fails the gate with the
90
+ missing name. The gate was added as a negative control against the unfixed manifests, where it
91
+ failed on `@deepseek-ai/schemastery`.
92
+
93
+ ## 0.5.3 - 2026-09-20
94
+
95
+ ### Fixed
96
+
97
+ - The Bundle patch no longer sets the retired review route flag. `reviewQueueRoute` was
98
+ removed from the plugin's Config schema when the review gate was retired, but it stayed in
99
+ `packages/selector/cordis.patch.yml`, where it advertised a route that can never register.
100
+ Hosts tolerate the unknown key today (the plugin loads and serves — verified on a live host),
101
+ so this is a stale-config defect rather than a break, but it would break on any host that
102
+ validates plugin config strictly.
103
+ - Generated artifacts are pinned to LF (`packages/selector/lib/** text eol=lf`). With
104
+ `core.autocrlf=true` every checkout rewrote the committed `lib/**` to CRLF, so any branch
105
+ switch or merge left the whole artifact directory reported as modified with EOL-only
106
+ differences. Nothing was ever committed from that state, but it made every tree look dirty
107
+ and it would hide a real artifact change.
108
+
109
+ ### Added
110
+
111
+ - A negative-control contract pin on the Bundle patch: it fails when a retired config key is
112
+ set in the patch (asserted on key-setting lines, so the explanatory comment may still name
113
+ the key), and it requires the live `estimatorCatalogRoute` flag to stay wired.
114
+
115
+ ### Tests
116
+
117
+ - The client seat contract also pins the older-host degradation: a host that does not declare
118
+ the seat rejects the registration at the slot boundary, and `apply()` must swallow it and
119
+ warn instead of taking every settings entry down with it.
120
+
121
+ ## 0.5.2 - 2026-09-20
122
+
123
+ ### Changed
124
+
125
+ - The human-gated review pipeline (beta) is **retired**. Its semantics are replaced by
126
+ advice: the benefit model still prices every pass as ONE merged mutation, but the band it
127
+ computes (`profitable` / `high-impact` / `slow-payback` / `unpriceable` / `not-worth-it`)
128
+ is now published as a `reduction-advice` audit record and snapshotted onto the advisor
129
+ report route — it never withholds, delays, or rewrites a reduction. The gate contradicted
130
+ the feature's own requirement (a reduction must never block automatic processing) and, with
131
+ the shipped defaults (`reviewMode` on plus a 4,000-token high-impact threshold against an
132
+ 8,192-token fresh trigger), diverted 100% of a fresh batch into human review, leaving the
133
+ automatic path effectively off for anyone who opted in. The advice thresholds are now
134
+ module constants (α `0.1`, high-impact `4,000` tokens): nothing acts on them, so they are
135
+ no longer settings.
136
+ - Removed with the gate: the review queue and its `storageDomain` adapter, the process-wide
137
+ registry, the `review-queue` / `review-decide` HTTP routes and the `reviewQueueRoute`
138
+ deployment flag, the `shell.overlay` client panel, the `reviewMode` /
139
+ `reviewTimeoutTurns` / `cacheHitDiscountAlpha` / `reviewHighImpactTokens` settings keys,
140
+ and the `review-outcome` audit kind. The four settings keys stay ACCEPTED and IGNORED by
141
+ both decoders — an existing document (the live one carries `reviewMode: false`) still loads
142
+ and still renders its settings card — and never reach the resolved policy. The read-only
143
+ `GET .../advisor-report` route additionally serves `lastAdvice`.
144
+
145
+ ### Added
146
+
147
+ - Regression pins for the retirement: a host-integration spec drives the exact settings that
148
+ used to divert everything (`reviewMode: true`, `reviewHighImpactTokens: 1`) and asserts the
149
+ fresh batch LANDS, described by a `high-impact` advice record; a deprecation-contract spec
150
+ pins accept-and-ignore for the retired keys on both the runtime parser and the browser
151
+ decoder.
152
+
153
+ ### Rollback
154
+
155
+ - Reinstall the last release that still ships the gate: `npm dist-tag add
156
+ dsh-context-compression-improved@0.5.1 dsh-0.1.5 --registry https://registry.npmjs.org/`
157
+ then `dsh plugin --profile web add dsh-context-compression-improved@0.5.1`.
158
+
159
+ ## 0.5.1 - 2026-09-20
160
+
161
+ ### Fixed
162
+
163
+ - Concurrent preset-overlay composition of one identity no longer fails on Windows.
164
+ Publication is now serialized per destination path, and when the atomic rename still
165
+ loses the race the destination is confirmed to already carry this staging file's
166
+ `{mtimeMs, size}` standing key before the publish reports success. Windows `MoveFileEx`
167
+ reports that lost race as `EPERM`/`EBUSY` where POSIX `rename` simply replaces the
168
+ destination, which made `standingKeyFor()` throw during concurrent session start. A
169
+ destination that does not match still fails loudly, so a silently reused generation
170
+ stays forbidden.
171
+ - Release-gate and test repairs that had been hiding this and other pre-existing red
172
+ gates: stale identifiers and a retired audit reason in the packed smokes, a stale
173
+ client-inject expectation, and Windows-only spawn traps (`git` and multi-line
174
+ `node -e` scripts were routed through `cmd.exe`, which rewrote their arguments).
175
+
176
+ ## 0.5.0 - 2026-09-20
177
+
178
+ ### Added
179
+
180
+ - Advisory relevance advisor (statistics and suggestions only, default off): at every turn
181
+ boundary a fire-and-forget pass summarizes the session's tail-task semantics from the
182
+ most recent `todo/write` event (falling back to recent user text), incrementally scores
183
+ historical tool-result candidates for content-and-comment relevance against the current
184
+ task, and computes a prefix-decay figure (character-pressure-weighted mean relevance).
185
+ Low-relevance old segments are marked `recertified` as suggestions for later
186
+ history-aggressiveness decisions — nothing this round consumes them, and advisor output
187
+ can never suppress, delay, or rewrite any reduction that would land (pinned by a
188
+ dedicated invariant test). Configure through the `presetOptions.advisor*` settings keys
189
+ (`advisorMode` `''|'host'|'direct'`, default `''`; the direct channel reuses the
190
+ estimator endpoint; `SideChannel` gained an optional overrides parameter so the
191
+ estimator's transport is shared without sharing its configuration). Observability: new
192
+ `advisor-outcome` audit records (content-free, one per phase: summary / scoring / decay)
193
+ and a read-only `GET .../advisor-report?sessionId=` HTTP route (opt-in deployment flag
194
+ `advisorReportRoute`, mirroring the review routes). Client UI is intentionally absent
195
+ this round.
196
+
197
+ ## 0.4.0 - 2026-09-20
198
+
199
+ ### Fixed
200
+
201
+ - The plugin no longer depends on the routed model id: every planning gate now decides on
202
+ the character basis (Unicode code points via `characterPressure` / `pressureCost`) instead
203
+ of exact tokenizer counts, so a route without a bundled tokenizer (the live
204
+ `deepseek-flash`) lands rewrites again instead of silently skipping. Token thresholds keep
205
+ their names and values (converted at the documented 4.0 chars/token convention, frozen
206
+ profile baseline untouched); token figures become telemetry, labelled honestly by the new
207
+ `measurementBasis` field on rewrite audit records (`exact-tokenizer` vs `characters`,
208
+ with `tokenizerId: 'characters'` / `tokenizerRevision: 'chars-per-token-4.0'` when derived).
209
+ Rollback: `git revert 7a1972a` restores the exact-tokenizer gates as a single unit; confirm
210
+ no later change re-introduced a model-id split that relies on this commit first.
211
+
212
+ ### Added
213
+
214
+ - Batch-level benefit pricing (R1): a review pass is priced as ONE merged mutation — the
215
+ tail KV-cache refill penalty is paid once per batch instead of per candidate, so real
216
+ batches (5×50k with a 64k tail) reach the auto band instead of all dropping.
217
+ - Original-event line mapping (R9a): terminal normalization returns folded lines that each
218
+ carry their 1-based original-event line number; `retrieve` reads raw events, so printed
219
+ ranges resolve to the right lines.
220
+ - Document skeleton and universal prose keep (R8/R8b): structured documents keep headings,
221
+ section first/last lines, list starts and table headers; every other non-code text keeps
222
+ head AND tail with an R9 line-range marker (prose was previously head-only truncated).
223
+ - Two-tier search folding (R10, fixes D8): a lossless per-file L1 locator plus a
224
+ water-filled L2 content quota.
225
+ - Non-adjacent frequency folding (R11): separated exact repeats (up to 8.37% of large
226
+ results) fold to first occurrence plus one counted marker.
227
+ - Long-string placeholders (R12): base64/hex/UUID blobs become length summaries with a
228
+ 16-char recognition prefix.
229
+ - Two-stage HTML reduction (R13, fixes D9): `html-slim` then `html-skeleton`, line-aligned
230
+ so original line numbers survive.
231
+ - R9b anchors: contiguous masks cite original line ranges, scatter masks report
232
+ `lines 1-N scanned, K kept`, and every retrieve hint carries a pasteable
233
+ `{"ref":…,"start_line":N,"max_lines":80}`.
234
+ - Document census: omitted-document summaries list section headings instead of a constant
235
+ `0 error, 0 warn, N info` histogram.
236
+
237
+ ## 0.3.1 - 2026-09-18
238
+
239
+ ### Changed
240
+
241
+ - The runtime package is merged into the selector package: one install brings the whole
242
+ stack, the repository root is the install surface (`name`, `main`, `types`, `exports` with
243
+ `./pruner` and `./invariant`, `dependencies`, `dsh`), and the toolchain, scripts and CI were
244
+ swept to the single package. The verified estimator-catalog registration (dual prefix, guarded
245
+ two-channel activation, per-request service resolution, visible lifecycle lines) was replayed
246
+ onto this line with a host-side guard; the settings schema that `ab2175a` had downgraded to
247
+ `z.any()` is restored, so the daily Custom defaults are published again.
248
+ - Adapt to the official DeepSeek Harness `v0.1.5-rc.2` on this branch. All `@deepseek-ai/dsh-*` dev dependencies and the pinned e2e host set move from `0.1.1-rc.2` to `0.1.5-rc.2` (cordis `4.0.2`, schemastery `3.18.2`), including the new split packages (`dsh-session-projection`, `dsh-session-persistence`, `dsh-atomic-write`, `dsh-home-paths`, `dsh-sandbox`, and related) and the `dsh-client-store` client stack.
249
+ - Surface replace operations now use the v3 `startSeq`/`endSeq` shape with branded `SessionSeq` values; `compaction/prune` manifests keep the durable `start`/`end` fields. Events are resolved from surface nodes by seq lookup instead of array indexing.
250
+ - The client bundle no longer imports the removed `@deepseek-ai/dsh-client-runtime`: settings types now come from `@deepseek-ai/dsh-client-ui-settings` and the session hooks merge from `@deepseek-ai/dsh-client-ui-session`. `engines.dsh >=0.1.5-alpha.1 <0.2.0-0` is declared in both package manifests and `dsh.plugin.json`.
251
+ - Harness 0.1.5 no longer exposes the session `agentPreset` to the browser, so the client can no longer detect Minimal-only sessions; the selector stays selectable and the old unavailable banner is unreachable.
252
+ - Test batteries updated for 0.1.5 semantics: cordis plugin starts require `.await()`, the Token Meter requires a mounted `SessionProjectionRegistry`, assistant events carry `stream: []`, and settings namespaces are plain strings.
253
+
254
+ ### Fixed
255
+
256
+ - The estimator card no longer demands an API key on the Harness host channel. Selecting the host channel shows the live provider/model dropdowns, names the route that would actually run (explicit override, else the session default), and renders neither a key field nor a second manual model input: the base URL, the model text field, and the write-only key belong to the direct endpoint channel alone.
257
+ - `presetOptions` writes are path-addressed. Writing the whole section replaced it, so touching any second estimator field (a provider, a model, an endpoint) deleted `estimatorMode` and every sibling override — silently switching the estimator back off while the panel still reported a successful save. Each field now writes only itself, `undefined` clears exactly the field it names, and the confirmation read validates the same field set instead of the mode alone.
258
+ - New coverage: `packages/selector/tests/preset-options-write.client.spec.ts` (path-scoped writes, sibling preservation, explicit clears, no-op patches, uncommitted-write reporting) and `packages/selector/tests/estimator-channel.client.spec.tsx` (per-channel fields, catalog dropdowns, manual fallback).
259
+
260
+
261
+ ### Added
262
+
263
+ - New `tokenpilot-inspired` profile: a TokenPilot-paper-inspired capability matrix layered on the Balanced thresholds, selected explicitly from the settings UI; every pre-existing profile keeps a byte-identical resolved policy (enforced by a captured-baseline golden test).
264
+ - Byte-identical repeated tool-result dedup: an oversized repeat is replaced with a pointer to the first occurrence's append-only original event (`dedupe-pointer`), with a per-session SHA-256 index (2,048-entry insertion-order eviction, hash+seq metadata only).
265
+ - No-net-savings guard: replacements whose text is not smaller than the original are rejected even when the exact tokenizer reports a token saving.
266
+ - Recovery exemption: recovery-tool output is permanently exempt from every reduction pass via a unified per-session exemption set, preventing compress-restore oscillation.
267
+ - Auto Compact summary locator: after `compaction/end`, the landed summary checkpoint gains an Exact Sources block (shadowed seq range, spill files, touched files) so summarized-away details stay recoverable; skipped when it would locate nothing concrete.
268
+ - Read-state semantics: a historical read whose file was later mutated is `superseded` and takes the small whole-result placeholder; optional error/warn/info clustering of omitted lines is appended to historical placeholders.
269
+ - Optional residual-utility estimator (three channels: off / Harness host model / direct OpenAI-compatible endpoint) with per-session exponential backoff, strict timeout, advisory-only verdicts consumed by the next pressure pass, and numeric-only `estimator-outcome` audits. The estimator card appears only while the new profile is selected; the API key is write-only in settings and never enters the frozen policy, audits, or logs.
270
+ - New audit records: `summary-locator` and `estimator-outcome`; the rewrite record covers dedup via the `dedupe-pointer` reducer. Audit field allowlists are unchanged.
271
+ - Simplified Chinese and English copy for the new profile and estimator card; unit and golden coverage under `packages/runtime/tests/tokenpilot/`.
272
+
273
+ - Orthogonal code-skeleton compression gate (`codeSkeleton.enabled`, default off): the first exposure of an oversized fresh source-code tool result can keep an imports-and-declarations skeleton with bodies elided and error lines preserved, falling back to the original head pruning. The gate is independent of every profile and gated on exact tokenizer measurement.
274
+ - Settings-UI toggle for the gate in the selector settings section, with Simplified Chinese and English copy.
275
+ - Browser/runtime decode parity for the new section, confirm-on-write contract tests for `saveCodeSkeleton`, and a full-document parity matrix extension.
276
+
277
+ ### Changed
278
+
279
+ - Added an ESLint flat-config baseline (`pnpm lint`, enforced in CI) and a `pnpm test:watch` TDD loop; removed dead imports and hardened two error paths surfaced by the lint baseline.
280
+ - This repository is now maintained as an improved fork of `WilliamShi666/dsh-context-compression-selector`; documentation ships in English, Simplified Chinese, Japanese, and Korean.
281
+
282
+ ## 0.1.0 - 2026-09-03
283
+
284
+ ### Added
285
+
286
+ - Stable release of DeepSeek V4 Flash Vision tokenizer integration for `deepseek-v4-flash-vision-exp`, including exact text counting and bounded image-token estimates.
287
+ - User-configurable model-driven Auto Compact threshold in the selector settings section.
288
+ - Auto Compact threshold linkage for each standard profile's History / micro-compact watermarks and related compression parameters.
289
+
290
+ ### Changed
291
+
292
+ - The threshold editor now uses one direct numeric input; the slider and fixed quick-value buttons were removed.
293
+ - Runtime session-event access supports both the established Harness `events` accessor and the newer `snapshotEvents()` public API.
294
+
295
+ ## 0.1.0-beta.4 - 2026-09-02
296
+
297
+ ### Fixed
298
+
299
+ - Support the official DeepSeek Harness `dsh-v0.1.2-alpha.5` public API while retaining compatibility with the existing `0.1.1-rc.2` peer range. The plugin now owns the two small immutable-value helpers that the newer Harness no longer exports, and uses the same public `context-compression` namespace literal accepted by both Settings implementations. No Harness core code is modified.
300
+
301
+ ## 0.1.0-beta.3 - 2026-09-01
302
+
303
+ ### Scope
304
+
305
+ This is a staged release. Exact **text-class** token counting for `deepseek-v4-flash-vision-exp`, best-effort bounded **vision-class image** estimates, and the Auto Compact threshold/UI/audit work are delivered. Exact image measurement remains **BLOCKED upstream**: the current measurement seam exposes neither the adapter's projected request-image dimensions nor the absolute serialized position, so estimates cannot be promoted to `exact-tokenizer`.
306
+
307
+ ### Added
308
+
309
+ - DeepSeek V4 Flash Vision support for `deepseek-v4-flash-vision-exp` via a separately bundled official tokenizer pinned at `deepseek-ai/DeepSeek-V4-Flash-Vision-Exp` revision `6821d6ad3681a4b137b066b76094fa82ebd0a380`. Text, reasoning, tool-call arguments, and pure-text tool results are counted exactly; image-bearing tool-result candidates stay fail-open.
310
+ - Vision image-token arithmetic ported line-by-line from the official `inference/image_processor.py` (patch size 14, downsample 3, 384-token cap, min pixels 147456, 8:1 aspect clamp, and position-dependent alignment padding), validated against golden fixtures generated by executing the official Python implementation. Valid intrinsic dimensions now produce `tokenizer-estimate` at the midpoint of all four alignment residues with a 384-token per-image upper bound; malformed or unevaluable dimensions use a documented 256-token fallback. Mixed text/image surfaces aggregate exact text and estimated images without promoting them to exact.
311
+ - `autoCompact.thresholdPercent` setting (default 80, integer 50–90, step 1) with one shared validation contract across the settings UI, the persisted schema, and the runtime resolver. The editor lives inside the context-compression selector settings section.
312
+ - Standard-profile History linkage to the Auto Compact watermark: `A = floor(C × a)` rescales the History trigger, minimum reclaim, and recent-token tail; `D = floor(A × 0.875)` replaces the fixed 0.7 capacity-pressure ratio as the micro-compact last-chance gate; one batch must justify its cache break by pulling the complete request back below the deadline. Defaults at 80% reproduce the previous numbers exactly.
313
+ - The preset overlay writes the saved threshold into the generated `compaction-basic` composition as `thresholdRatio` (with `retainRatio` pinned at 0.16) and, from the same read, into the plugin runtime's deployment config as `autoCompactThresholdPercent`, so one standing generation never runs Auto Compact and micro compact on two different thresholds. Any generation-identity change — threshold, source, or module paths, including equal-length ones — produces a new standing composition generation. Deterministic identity-derived stamps use an 8-hex whole-second window; equal-prefix identities can collide in that first window on a coarse filesystem, so the overlay observes the staging file's real `mtimeMs+size` key and escalates to later hash windows before the atomic rename. Content, permissions, and the final unique stamp are complete before publication; already-running sessions keep their frozen policy.
314
+ - `policy-resolved` audits now record the Auto Compact coordination facts (threshold percent, `A`, `D`, parameter source — including `deployment-override`/`mixed` when deployment config replaces linked History watermarks), the routed provider/model, and the bundled tokenizer identity.
315
+ - Persisted settings reject present-but-invalid sections (`profile: null`, `custom: null`, own-property `undefined`) before any schema default can absorb them; a malformed stored document freezes the session losslessly (`profile: off`, audited as `settingsInvalidFallback: lossless-off`) instead of silently enabling the lossy Balanced default. The browser decoder applies the same rule and canonicalizes legacy Custom v1/v2 documents to the same v3 document the runtime resolver produces.
316
+ - The History planner returns a discriminated outcome, and `component-evaluation` audits distinguish the full skip taxonomy: `below-profile-trigger`, `below-micro-deadline`, `exact-tokenizer-unavailable`, `no-safe-candidates` (only recovery-tool output or already-cleared results), `protected-working-set` (everything inside the protected tail), `insufficient-reclaim` and `cannot-reach-deadline-target` (with the reached/required token numbers), `adaptive-cost-rejected`, and `recovery-tool-unavailable`.
317
+
318
+ ### Known limitations
319
+
320
+ - Images never claim exact counts. The official expansion depends on the absolute prompt position (system prompt, chat-template framing, adapter image handles) and on the adapter's final request-image projection (including per-route `imagePixelBudget`/`imageDetail` overrides and byte-cap reprojection), none of which is exposed through the current measurement seam. Intrinsic/default estimates may therefore differ materially from provider accounting. Upstream capability requests remain projected request-image dimensions and the absolute serialized position exposed to token-meter extensions.
321
+ - History skips the whole batch whenever any tool-result candidate lacks an exact count, including image-bearing candidates, even though sibling text candidates are individually exact.
322
+ - Custom remains manual token mode; its History parameters do not follow the Auto Compact watermark.
323
+ - A vision token breakdown UI is not shipped; image estimates and the intrinsic alignment diagnostic are available on the measured token view, while lossy rewrite proofs still require exact counts.
324
+
325
+ ### Deferred
326
+
327
+ - Audit `modality` field and the tokenizer artifact SHA-256 inside audit records (the audits already carry the routed provider/model and tokenizer identity).
328
+ - Publishing the (now complete) runtime skip-reason taxonomy as a user-facing documentation table.
329
+ - Custom-profile display of the A/D watermarks and an above-D warning; Custom remains fully manual.
330
+ - Vision token breakdown UI and promotion of image estimates to exact measurement.
331
+
332
+ ## 0.1.0-beta.2 - 2026-08-28
333
+
334
+ ### Fixed
335
+
336
+ - Resolve the official DeepSeek V4 Flash tokenizer route so Fresh and Aggregate can evaluate tool results for the supported V4 models.
337
+ - Run Cache Strict History at the real request boundary once its configured capacity-pressure condition is met; trigger the capacity condition at 70% routed-context utilization.
338
+ - Disable Harness-native head/middle/tail tool-result pruning whenever a selector profile is active, leaving the selector as the sole tool-result compactor.
339
+
340
+ ### Changed
341
+
342
+ - Protect the newest 10 agent tool calls and a 64,000-token tool-result tail window before History/microcompact rewrites older results.
343
+
344
+ ## 0.1.0-beta.1 - 2026-08-27
345
+
346
+ ### Added
347
+
348
+ - One-install DeepSeek Harness Product Bundle backed by a separate exact-version runtime package.
349
+ - Web profile selector with preset-stable settings and an explicit built-in Minimal exception.
350
+ - Fresh, Aggregate, routine/capacity-aware History, Native tool-result pruning, and default-off Custom TailTrim.
351
+ - Standard-event TailTrim protocol using `compaction/prune` plus recoverable `user/message` replacement.
352
+ - Plugin-owned `context_compression_retrieve` recovery tool.
353
+ - Structured, content-free policy, evaluation, rewrite, failure, and Native auto-compact audit records.
354
+ - Pinned official DeepSeek V4 tokenizer assets with runtime SHA-256 validation and upstream license.
355
+ - Public-API component E2E, preset/Minimal, and parent/fork/spawn cache-prefix regression tests.
356
+
357
+ ### Compatibility
358
+
359
+ - Verified against DeepSeek Harness `dsh-v0.1.1-rc.2` public packages.
360
+ - Exact tokenizer mapping is currently limited to `deepseek-v4-flash` and `deepseek-v4-pro`.
361
+
362
+ ### Known limitations
363
+
364
+ - Adaptive ordinary History fails closed when public request-level route/cache evidence is incomplete; capacity pressure remains a separate safety override.
365
+ - Cache-prefix tests prove native fork inheritance and identical serialized prefixes, not a provider-specific cache allocation or a guaranteed DeepSeek cache hit.
366
+ - Settings snapshots and first-exposure decisions are process-local to the mounted runtime.