dsh-context-compression-improved 0.2.3 → 0.2.5

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 (149) hide show
  1. package/.gitattributes +2 -1
  2. package/.githooks/pre-push +37 -0
  3. package/.github/workflows/ci.yml +39 -39
  4. package/CHANGELOG.ja.md +169 -39
  5. package/CHANGELOG.ko.md +167 -39
  6. package/CHANGELOG.md +333 -135
  7. package/CHANGELOG.zh.md +152 -39
  8. package/CONTRIBUTING.md +22 -22
  9. package/README.ja.md +85 -104
  10. package/README.ko.md +85 -103
  11. package/README.md +94 -112
  12. package/README.zh.md +85 -101
  13. package/THIRD_PARTY_NOTICES.md +14 -14
  14. package/docs/compat-0.1.5-report.md +77 -0
  15. package/docs/installation.ja.md +78 -76
  16. package/docs/installation.ko.md +78 -76
  17. package/docs/installation.md +103 -76
  18. package/docs/installation.zh.md +100 -76
  19. package/docs/repair-log.md +657 -582
  20. package/eslint.config.js +30 -30
  21. package/package.json +163 -142
  22. package/packages/selector/README.md +26 -31
  23. package/packages/selector/README.zh.md +24 -31
  24. package/packages/selector/THIRD_PARTY_NOTICES.md +32 -38
  25. package/packages/selector/cordis.patch.yml +27 -19
  26. package/packages/selector/dsh.plugin.json +2 -2
  27. package/packages/selector/lib/client.d.ts +320 -228
  28. package/packages/selector/lib/client.js +3254 -1462
  29. package/packages/selector/lib/config.js +1713 -842
  30. package/packages/selector/lib/index.d.ts +46 -38
  31. package/packages/selector/lib/index.js +1099 -645
  32. package/packages/selector/lib/invariant.js +70 -70
  33. package/packages/selector/lib/pruner.d.ts +904 -684
  34. package/packages/selector/lib/pruner.js +5800 -3807
  35. package/packages/selector/lib/style.css +88 -46
  36. package/packages/selector/lib/tail-trim.js +145 -136
  37. package/packages/selector/package.json +18 -19
  38. package/packages/selector/screenshots.json +3 -6
  39. package/packages/selector/src/client/CompressionProfileControls.tsx +293 -229
  40. package/packages/selector/src/client/CompressionProfileSelector.module.css +199 -170
  41. package/packages/selector/src/client/CompressionProfileSelector.tsx +85 -79
  42. package/packages/selector/src/client/EstimatorControls.tsx +277 -281
  43. package/packages/selector/src/client/decode.ts +57 -49
  44. package/packages/selector/src/client/index.ts +249 -111
  45. package/packages/selector/src/client/locales/de.ts +141 -0
  46. package/packages/selector/src/client/locales/es.ts +141 -0
  47. package/packages/selector/src/client/locales/fr.ts +141 -0
  48. package/packages/selector/src/client/locales/it.ts +141 -0
  49. package/packages/selector/src/client/locales/ja.ts +141 -0
  50. package/packages/selector/src/client/locales/ko.ts +141 -0
  51. package/packages/selector/src/client/locales/ru.ts +141 -0
  52. package/packages/selector/src/client/locales.ts +282 -198
  53. package/packages/selector/src/client/monitor-fab.ts +336 -0
  54. package/packages/selector/src/client/preset-options.ts +88 -70
  55. package/packages/selector/src/client/savings-card.tsx +150 -0
  56. package/packages/selector/src/client/settings-section.tsx +140 -126
  57. package/packages/selector/src/deepseek-v4-tokenizer.ts +205 -210
  58. package/packages/selector/src/index.ts +671 -327
  59. package/packages/selector/src/invariant.ts +113 -113
  60. package/packages/selector/src/preset-overlay.ts +60 -1
  61. package/packages/selector/src/profiles.ts +431 -342
  62. package/packages/selector/src/pruner/content.ts +18 -5
  63. package/packages/selector/src/pruner/state.ts +57 -43
  64. package/packages/selector/src/pruner/types.ts +23 -5
  65. package/packages/selector/src/pruner.ts +2736 -2144
  66. package/packages/selector/src/runtime/adaptive-cost.ts +23 -12
  67. package/packages/selector/src/runtime/audit.ts +303 -215
  68. package/packages/selector/src/runtime/config.ts +756 -613
  69. package/packages/selector/src/runtime/measurement.ts +436 -403
  70. package/packages/selector/src/runtime/monitor.ts +235 -0
  71. package/packages/selector/src/runtime/reducers.ts +1115 -97
  72. package/packages/selector/src/runtime/retrieve.ts +479 -457
  73. package/packages/selector/src/runtime/savings.ts +337 -0
  74. package/packages/selector/src/runtime/session-events.ts +30 -17
  75. package/packages/selector/src/runtime/summary-command.ts +127 -0
  76. package/packages/selector/src/runtime/tail-trim.ts +166 -166
  77. package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +233 -0
  78. package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +204 -0
  79. package/packages/selector/src/runtime/tokenpilot/advisor.ts +419 -0
  80. package/packages/selector/src/runtime/tokenpilot/benefit.ts +200 -0
  81. package/packages/selector/src/runtime/tokenpilot/dedup.ts +1 -1
  82. package/packages/selector/src/runtime/tokenpilot/estimator.ts +151 -183
  83. package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +53 -0
  84. package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +65 -0
  85. package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +125 -0
  86. package/packages/selector/src/runtime/tokenpilot/intent-range.ts +37 -0
  87. package/packages/selector/src/runtime/tokenpilot/locator.ts +1 -1
  88. package/packages/selector/src/runtime/tokenpilot/read-state.ts +23 -2
  89. package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +303 -0
  90. package/packages/selector/src/runtime/toolclass.ts +103 -0
  91. package/packages/selector/src/runtime/types.ts +365 -309
  92. package/packages/selector/tests/advisor-report.host.spec.ts +223 -0
  93. package/packages/selector/tests/auto-compact.client.spec.tsx +214 -226
  94. package/packages/selector/tests/built/client-artifact.spec.ts +59 -51
  95. package/packages/selector/tests/code-skeleton.client.spec.ts +91 -88
  96. package/packages/selector/tests/custom-contract.client.spec.ts +205 -202
  97. package/packages/selector/tests/estimator-channel.client.spec.tsx +253 -247
  98. package/packages/selector/tests/estimator-route-registration.host.spec.ts +194 -176
  99. package/packages/selector/tests/host-preset-overlay.host.spec.ts +206 -204
  100. package/packages/selector/tests/monitor-fab.client.spec.ts +138 -0
  101. package/packages/selector/tests/preset-options-write.client.spec.ts +207 -181
  102. package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +201 -196
  103. package/packages/selector/tests/preset-overlay.host.spec.ts +246 -243
  104. package/packages/selector/tests/profiles.client.spec.tsx +436 -434
  105. package/packages/selector/tests/public/package-contract.client.spec.ts +78 -33
  106. package/packages/selector/tests/runtime/adaptive-cost.spec.ts +7 -7
  107. package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +232 -0
  108. package/packages/selector/tests/runtime/advisor-invariant.spec.ts +272 -0
  109. package/packages/selector/tests/runtime/advisor.spec.ts +226 -0
  110. package/packages/selector/tests/runtime/audit.spec.ts +275 -129
  111. package/packages/selector/tests/runtime/char-basis.spec.ts +30 -0
  112. package/packages/selector/tests/runtime/code-skeleton.spec.ts +14 -3
  113. package/packages/selector/tests/runtime/deprecated-preset-options.spec.ts +96 -0
  114. package/packages/selector/tests/runtime/frequency-longstrings.spec.ts +74 -0
  115. package/packages/selector/tests/runtime/html-reducer.spec.ts +212 -0
  116. package/packages/selector/tests/runtime/intent-gate.spec.ts +62 -0
  117. package/packages/selector/tests/runtime/intent-summary.spec.ts +156 -0
  118. package/packages/selector/tests/runtime/line-mapping.spec.ts +153 -0
  119. package/packages/selector/tests/runtime/monitor.spec.ts +301 -0
  120. package/packages/selector/tests/runtime/prose-reducers.spec.ts +133 -0
  121. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +2724 -2531
  122. package/packages/selector/tests/runtime/read-input-cap.spec.ts +33 -0
  123. package/packages/selector/tests/runtime/savings.spec.ts +120 -0
  124. package/packages/selector/tests/runtime/search-reducer.spec.ts +110 -0
  125. package/packages/selector/tests/runtime/session-events.spec.ts +27 -27
  126. package/packages/selector/tests/runtime/sidechannel.spec.ts +241 -0
  127. package/packages/selector/tests/runtime/summary-command.spec.ts +154 -0
  128. package/packages/selector/tests/runtime/toc-and-bundled.spec.ts +159 -0
  129. package/packages/selector/tests/runtime/tokenpilot/benefit.spec.ts +217 -0
  130. package/packages/selector/tests/runtime/tokenpilot/estimator.spec.ts +79 -56
  131. package/packages/selector/tests/runtime/tokenpilot/profile-baseline.spec.ts +116 -100
  132. package/packages/selector/tests/runtime/tokenpilot/read-state.spec.ts +24 -0
  133. package/packages/selector/tests/runtime/toolclass.spec.ts +156 -0
  134. package/packages/selector/tests/settings-seat.client.spec.ts +130 -0
  135. package/packages/selector/tests/standing-generation.host.spec.ts +697 -631
  136. package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +253 -250
  137. package/pnpm-workspace.yaml +66 -19
  138. package/scripts/capture-profile-baseline.mjs +42 -0
  139. package/scripts/generate-tokenizer-fixtures.py +81 -81
  140. package/scripts/generate-vision-fixtures.py +208 -208
  141. package/scripts/{packed-components-smoke.ts → packed-components-smoke.mjs} +732 -713
  142. package/scripts/{packed-install-e2e.ts → packed-install-e2e.mjs} +1273 -1072
  143. package/scripts/toolclass-corpus-replay.mjs +281 -0
  144. package/scripts/{verify-release.ts → verify-release.mjs} +318 -300
  145. package/tests/TEST_INVENTORY.md +41 -42
  146. package/scripts/capture-profile-baseline.ts +0 -80
  147. package/tsconfig.scripts.json +0 -13
  148. /package/{packages/selector/assets/screenshots → docs/assets}/context-compression-selector-profiles.jpg +0 -0
  149. /package/{packages/selector/assets/screenshots → docs/assets}/context-compression-selector-settings.png +0 -0
package/CHANGELOG.md CHANGED
@@ -1,135 +1,333 @@
1
- # Changelog
2
-
3
- All notable changes use this file. The project follows semantic versioning after `0.1.0`.
4
-
5
- ## 0.1.1
6
-
7
- ### Added
8
-
9
- - TypeScript toolchain for `scripts/`: `verify-release`, `packed-components-smoke`, and `packed-install-e2e` are now `.ts` sources compiled to `scripts-dist/` via `tsc`, eliminating the last three non-TS source files in the repository.
10
-
11
- ### Changed
12
-
13
- - `package.json` scripts `test:e2e:packed` and `verify:release` now run compiled outputs from `scripts-dist/`.
14
- - Estimator catalog route registration hardened: `asWebServer` returns the service itself (D7 fix), and the estimator UI preserves its section heading when inactive instead of hiding behind an invisible gate (U1 fix).
15
- - Framework documentation corrected: row-level `inject: [webServer]` is not load-bearing (Y22); `isolate()` does not exist in any DSH package.
16
-
17
- ### Fixed
18
-
19
- - The estimator catalog route was never registered since day one because `asWebServer` detached `register` from its service (D7).
20
- - The estimator section silently disappeared when a non-TokenPilot profile was active, with no hint about why or how to enable it (U1).
21
-
22
- ## Unreleased
23
-
24
- ### Added
25
-
26
- - 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).
27
- - 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).
28
- - No-net-savings guard: replacements whose text is not smaller than the original are rejected even when the exact tokenizer reports a token saving.
29
- - Recovery exemption: recovery-tool output is permanently exempt from every reduction pass via a unified per-session exemption set, preventing compress-restore oscillation.
30
- - 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.
31
- - 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.
32
- - 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.
33
- - New audit records: `summary-locator` and `estimator-outcome`; the rewrite record covers dedup via the `dedupe-pointer` reducer. Audit field allowlists are unchanged.
34
- - Simplified Chinese and English copy for the new profile and estimator card; unit and golden coverage under `packages/runtime/tests/tokenpilot/`.
35
-
36
- - 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.
37
- - Settings-UI toggle for the gate in the selector settings section, with Simplified Chinese and English copy.
38
- - Browser/runtime decode parity for the new section, confirm-on-write contract tests for `saveCodeSkeleton`, and a full-document parity matrix extension.
39
-
40
- ### Changed
41
-
42
- - 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.
43
- - This repository is now maintained as an improved fork of `WilliamShi666/dsh-context-compression-selector`; documentation ships in English, Simplified Chinese, Japanese, and Korean.
44
-
45
- ### Fixed
46
-
47
- - 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.
48
- - `presetOptions` writes preserve their siblings. `settingsScope.set('presetOptions', patch)` replaces the whole section, so touching any second estimator field (a provider, a model, an endpoint) deleted `estimatorMode` and every other override — silently switching the estimator back off while the panel still reported a successful save. The patch is now merged over the stored section, `undefined` clears exactly the field it names, an unchanged patch writes nothing, and the confirmation read compares the same fields instead of the channel alone.
49
- - New coverage: `packages/selector/tests/preset-options-write.client.spec.ts` (merged 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).
50
-
51
- ## 0.1.0 - 2026-09-03
52
-
53
- ### Added
54
-
55
- - Stable release of DeepSeek V4 Flash Vision tokenizer integration for `deepseek-v4-flash-vision-exp`, including exact text counting and bounded image-token estimates.
56
- - User-configurable model-driven Auto Compact threshold in the selector settings section.
57
- - Auto Compact threshold linkage for each standard profile's History / micro-compact watermarks and related compression parameters.
58
-
59
- ### Changed
60
-
61
- - The threshold editor now uses one direct numeric input; the slider and fixed quick-value buttons were removed.
62
- - Runtime session-event access supports both the established Harness `events` accessor and the newer `snapshotEvents()` public API.
63
-
64
- ## 0.1.0-beta.4 - 2026-09-02
65
-
66
- ### Fixed
67
-
68
- - 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.
69
-
70
- ## 0.1.0-beta.3 - 2026-09-01
71
-
72
- ### Scope
73
-
74
- 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`.
75
-
76
- ### Added
77
-
78
- - 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.
79
- - 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.
80
- - `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.
81
- - 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.
82
- - 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.
83
- - `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.
84
- - 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.
85
- - 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`.
86
-
87
- ### Known limitations
88
-
89
- - 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.
90
- - 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.
91
- - Custom remains manual token mode; its History parameters do not follow the Auto Compact watermark.
92
- - 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.
93
-
94
- ### Deferred
95
-
96
- - Audit `modality` field and the tokenizer artifact SHA-256 inside audit records (the audits already carry the routed provider/model and tokenizer identity).
97
- - Publishing the (now complete) runtime skip-reason taxonomy as a user-facing documentation table.
98
- - Custom-profile display of the A/D watermarks and an above-D warning; Custom remains fully manual.
99
- - Vision token breakdown UI and promotion of image estimates to exact measurement.
100
-
101
- ## 0.1.0-beta.2 - 2026-08-28
102
-
103
- ### Fixed
104
-
105
- - Resolve the official DeepSeek V4 Flash tokenizer route so Fresh and Aggregate can evaluate tool results for the supported V4 models.
106
- - 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.
107
- - Disable Harness-native head/middle/tail tool-result pruning whenever a selector profile is active, leaving the selector as the sole tool-result compactor.
108
-
109
- ### Changed
110
-
111
- - Protect the newest 10 agent tool calls and a 64,000-token tool-result tail window before History/microcompact rewrites older results.
112
-
113
- ## 0.1.0-beta.1 - 2026-08-27
114
-
115
- ### Added
116
-
117
- - One-install DeepSeek Harness Product Bundle backed by a separate exact-version runtime package.
118
- - Web profile selector with preset-stable settings and an explicit built-in Minimal exception.
119
- - Fresh, Aggregate, routine/capacity-aware History, Native tool-result pruning, and default-off Custom TailTrim.
120
- - Standard-event TailTrim protocol using `compaction/prune` plus recoverable `user/message` replacement.
121
- - Plugin-owned `context_compression_retrieve` recovery tool.
122
- - Structured, content-free policy, evaluation, rewrite, failure, and Native auto-compact audit records.
123
- - Pinned official DeepSeek V4 tokenizer assets with runtime SHA-256 validation and upstream license.
124
- - Public-API component E2E, preset/Minimal, and parent/fork/spawn cache-prefix regression tests.
125
-
126
- ### Compatibility
127
-
128
- - Verified against DeepSeek Harness `dsh-v0.1.1-rc.2` public packages.
129
- - Exact tokenizer mapping is currently limited to `deepseek-v4-flash` and `deepseek-v4-pro`.
130
-
131
- ### Known limitations
132
-
133
- - Adaptive ordinary History fails closed when public request-level route/cache evidence is incomplete; capacity pressure remains a separate safety override.
134
- - Cache-prefix tests prove native fork inheritance and identical serialized prefixes, not a provider-specific cache allocation or a guaranteed DeepSeek cache hit.
135
- - 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.2.5 - 2026-10-03
6
+
7
+ ### Added
8
+
9
+ - Full 0.2.0-mainline feature drop onto the regenerated 0.1.2 line: savings statistics
10
+ (honest ledger, negative-savings pairing, usage aggregation, cost estimation), the
11
+ compression monitor route, the monitorPanel settings card, the floating monitor bubble
12
+ (session binding via the input-left seat with graceful aggregate fallback, context
13
+ occupancy bar, catastrophic-forgetting suggestion at 70% occupancy), and the
14
+ intent-summary settings card. zh/en dictionaries carry the new keys; other languages
15
+ register through the existing addLanguage guard.
16
+
17
+ ## 0.5.7 - 2026-10-01
18
+
19
+ ### Added
20
+
21
+ - **Savings statistics with honest accounting** (inspired by the dsh-token-optimizer concept): every published reduction now lands in a per-process ledger (`runtime/savings.ts`) keyed by the rewrite audit's own `tokensBefore − tokensAfter` — realized savings only, never the theoretical maximum. **Negative savings are paired, not ignored**: the original text of each reduction is SHA-256 registered, and when the model later re-reads that content in full (a new tool result whose hash matches, or a `context_compression_retrieve` return), the re-read tokens are booked as an offset against the earlier claim — skeleton-then-full-read nets negative, exactly as it should. Exact-tokenizer and chars/4 bases are aggregated separately and never merged into one number.
22
+ - Surfaces: read-only `GET /{endpoint,api}/dsh-context-compression-improved/savings` snapshot route (always-on, aggregates only — no session content), and a savings card in the settings section (net/gross/offsets, per-component breakdown, recent offsets) in all nine UI languages.
23
+ - **Usage aggregation & cache-hit monitoring** (the dsh-token-optimizer monitor concept, merged with the honest ledger): every fresh request boundary records the official TokenMeter usage of the last completed request into the same per-session ledger; the snapshot aggregates real input/output/cache-read/cache-write tokens and derives the cache hit rate — the health metric that tells you whether compression is actually saving money or just destroying prefix cache. Sessions are bucketed per net savings (top 8), and a one-line per-session account (net, offsets, requests, cache hit) is logged to the Harness logger on `session/disposed` (probe-registered: hosts without the event stay silent).
24
+ - **Cost estimation on the snapshot route**: when the current host route resolves to an official DeepSeek price record, the response carries the actual aggregated cost plus an estimated saved cost (net exact tokens priced at the cache-miss input band, explicitly labeled an estimate); third-party routes fail closed to no pricing rather than inventing numbers.
25
+
26
+ ### Added
27
+
28
+ - Japanese (`ja`) and Korean (`ko`) UI locale dictionaries, plus the fr/de/it/ru/es dictionaries ported from main — the selector settings section now speaks nine languages (zh / en / de / es / fr / it / ja / ko / ru). Host 0.1.5-rc.2 `dsh-client-locale` carries `addLanguage`, so the extras register via the untyped overload plus `addLanguage` (fallback `en`); labels are self-described, and one failed registration warns instead of sinking activation. Client-only, host-agnostic.
29
+
30
+ ### Fixed
31
+
32
+ - Stale `package-contract` assertion: `engines.dsh` was narrowed to `>=0.1.5-rc.1 <0.1.6-0` by the 0.5.6 release, but the test still expected the wide `<0.2.0-0` range — the spec now matches the shipped manifest.
33
+
34
+ ## 0.5.4 - 2026-09-20
35
+
36
+ ### Fixed
37
+
38
+ - The install surface declares `@deepseek-ai/schemastery` as a runtime dependency. The packaged
39
+ runtime imports it unconditionally (`import z from '@deepseek-ai/schemastery'` in
40
+ `packages/selector/lib/index.js`, `lib/pruner.js` and `lib/advisor-state.js`), but 0.5.3
41
+ declared it nowhere a consumer install reads: the shipped root manifest listed only
42
+ `@huggingface/tokenizers` and `js-yaml`, and `packages/selector/package.json` listed it as a
43
+ peer, which no package manager consults for a nested package it installs. Resolution therefore
44
+ depended on an unrelated installed package hoisting `@deepseek-ai/schemastery` into the
45
+ profile. In a clean install the import fell through to the Harness installation's
46
+ shared-module fallback at `$DSH_HOME/profiles/node_modules`; where that fallback held no built
47
+ package, every plugin entry failed to load and the host booted without the Bundle layer. Both
48
+ manifests now pin `3.18.2`, the version this release is built and tested against, and the
49
+ selector package no longer claims a peer obligation it does not have.
50
+
51
+ ### Added
52
+
53
+ - `verify:release` derives the install-surface dependencies from the bare specifiers the
54
+ packaged runtime files import, instead of naming `@huggingface/tokenizers` and `js-yaml` by
55
+ hand. Which packages ship with the plugin and which the Harness installation provides is a
56
+ reviewed list, and an import whose provider is in neither manifest fails the gate with the
57
+ missing name. The gate was added as a negative control against the unfixed manifests, where it
58
+ failed on `@deepseek-ai/schemastery`.
59
+
60
+ ## 0.5.3 - 2026-09-20
61
+
62
+ ### Fixed
63
+
64
+ - The Bundle patch no longer sets the retired review route flag. `reviewQueueRoute` was
65
+ removed from the plugin's Config schema when the review gate was retired, but it stayed in
66
+ `packages/selector/cordis.patch.yml`, where it advertised a route that can never register.
67
+ Hosts tolerate the unknown key today (the plugin loads and serves — verified on a live host),
68
+ so this is a stale-config defect rather than a break, but it would break on any host that
69
+ validates plugin config strictly.
70
+ - Generated artifacts are pinned to LF (`packages/selector/lib/** text eol=lf`). With
71
+ `core.autocrlf=true` every checkout rewrote the committed `lib/**` to CRLF, so any branch
72
+ switch or merge left the whole artifact directory reported as modified with EOL-only
73
+ differences. Nothing was ever committed from that state, but it made every tree look dirty
74
+ and it would hide a real artifact change.
75
+
76
+ ### Added
77
+
78
+ - A negative-control contract pin on the Bundle patch: it fails when a retired config key is
79
+ set in the patch (asserted on key-setting lines, so the explanatory comment may still name
80
+ the key), and it requires the live `estimatorCatalogRoute` flag to stay wired.
81
+
82
+ ### Tests
83
+
84
+ - The client seat contract also pins the older-host degradation: a host that does not declare
85
+ the seat rejects the registration at the slot boundary, and `apply()` must swallow it and
86
+ warn instead of taking every settings entry down with it.
87
+
88
+ ## 0.5.2 - 2026-09-20
89
+
90
+ ### Changed
91
+
92
+ - The human-gated review pipeline (beta) is **retired**. Its semantics are replaced by
93
+ advice: the benefit model still prices every pass as ONE merged mutation, but the band it
94
+ computes (`profitable` / `high-impact` / `slow-payback` / `unpriceable` / `not-worth-it`)
95
+ is now published as a `reduction-advice` audit record and snapshotted onto the advisor
96
+ report route — it never withholds, delays, or rewrites a reduction. The gate contradicted
97
+ the feature's own requirement (a reduction must never block automatic processing) and, with
98
+ the shipped defaults (`reviewMode` on plus a 4,000-token high-impact threshold against an
99
+ 8,192-token fresh trigger), diverted 100% of a fresh batch into human review, leaving the
100
+ automatic path effectively off for anyone who opted in. The advice thresholds are now
101
+ module constants (α `0.1`, high-impact `4,000` tokens): nothing acts on them, so they are
102
+ no longer settings.
103
+ - Removed with the gate: the review queue and its `storageDomain` adapter, the process-wide
104
+ registry, the `review-queue` / `review-decide` HTTP routes and the `reviewQueueRoute`
105
+ deployment flag, the `shell.overlay` client panel, the `reviewMode` /
106
+ `reviewTimeoutTurns` / `cacheHitDiscountAlpha` / `reviewHighImpactTokens` settings keys,
107
+ and the `review-outcome` audit kind. The four settings keys stay ACCEPTED and IGNORED by
108
+ both decoders — an existing document (the live one carries `reviewMode: false`) still loads
109
+ and still renders its settings card — and never reach the resolved policy. The read-only
110
+ `GET .../advisor-report` route additionally serves `lastAdvice`.
111
+
112
+ ### Added
113
+
114
+ - Regression pins for the retirement: a host-integration spec drives the exact settings that
115
+ used to divert everything (`reviewMode: true`, `reviewHighImpactTokens: 1`) and asserts the
116
+ fresh batch LANDS, described by a `high-impact` advice record; a deprecation-contract spec
117
+ pins accept-and-ignore for the retired keys on both the runtime parser and the browser
118
+ decoder.
119
+
120
+ ### Rollback
121
+
122
+ - Reinstall the last release that still ships the gate: `npm dist-tag add
123
+ dsh-context-compression-improved@0.5.1 dsh-0.1.5 --registry https://registry.npmjs.org/`
124
+ then `dsh plugin --profile web add dsh-context-compression-improved@0.5.1`.
125
+
126
+ ## 0.5.1 - 2026-09-20
127
+
128
+ ### Fixed
129
+
130
+ - Concurrent preset-overlay composition of one identity no longer fails on Windows.
131
+ Publication is now serialized per destination path, and when the atomic rename still
132
+ loses the race the destination is confirmed to already carry this staging file's
133
+ `{mtimeMs, size}` standing key before the publish reports success. Windows `MoveFileEx`
134
+ reports that lost race as `EPERM`/`EBUSY` where POSIX `rename` simply replaces the
135
+ destination, which made `standingKeyFor()` throw during concurrent session start. A
136
+ destination that does not match still fails loudly, so a silently reused generation
137
+ stays forbidden.
138
+ - Release-gate and test repairs that had been hiding this and other pre-existing red
139
+ gates: stale identifiers and a retired audit reason in the packed smokes, a stale
140
+ client-inject expectation, and Windows-only spawn traps (`git` and multi-line
141
+ `node -e` scripts were routed through `cmd.exe`, which rewrote their arguments).
142
+
143
+ ## 0.5.0 - 2026-09-20
144
+
145
+ ### Added
146
+
147
+ - Advisory relevance advisor (statistics and suggestions only, default off): at every turn
148
+ boundary a fire-and-forget pass summarizes the session's tail-task semantics from the
149
+ most recent `todo/write` event (falling back to recent user text), incrementally scores
150
+ historical tool-result candidates for content-and-comment relevance against the current
151
+ task, and computes a prefix-decay figure (character-pressure-weighted mean relevance).
152
+ Low-relevance old segments are marked `recertified` as suggestions for later
153
+ history-aggressiveness decisions — nothing this round consumes them, and advisor output
154
+ can never suppress, delay, or rewrite any reduction that would land (pinned by a
155
+ dedicated invariant test). Configure through the `presetOptions.advisor*` settings keys
156
+ (`advisorMode` `''|'host'|'direct'`, default `''`; the direct channel reuses the
157
+ estimator endpoint; `SideChannel` gained an optional overrides parameter so the
158
+ estimator's transport is shared without sharing its configuration). Observability: new
159
+ `advisor-outcome` audit records (content-free, one per phase: summary / scoring / decay)
160
+ and a read-only `GET .../advisor-report?sessionId=` HTTP route (opt-in deployment flag
161
+ `advisorReportRoute`, mirroring the review routes). Client UI is intentionally absent
162
+ this round.
163
+
164
+ ## 0.4.0 - 2026-09-20
165
+
166
+ ### Fixed
167
+
168
+ - The plugin no longer depends on the routed model id: every planning gate now decides on
169
+ the character basis (Unicode code points via `characterPressure` / `pressureCost`) instead
170
+ of exact tokenizer counts, so a route without a bundled tokenizer (the live
171
+ `deepseek-flash`) lands rewrites again instead of silently skipping. Token thresholds keep
172
+ their names and values (converted at the documented 4.0 chars/token convention, frozen
173
+ profile baseline untouched); token figures become telemetry, labelled honestly by the new
174
+ `measurementBasis` field on rewrite audit records (`exact-tokenizer` vs `characters`,
175
+ with `tokenizerId: 'characters'` / `tokenizerRevision: 'chars-per-token-4.0'` when derived).
176
+ Rollback: `git revert 7a1972a` restores the exact-tokenizer gates as a single unit; confirm
177
+ no later change re-introduced a model-id split that relies on this commit first.
178
+
179
+ ### Added
180
+
181
+ - Batch-level benefit pricing (R1): a review pass is priced as ONE merged mutation — the
182
+ tail KV-cache refill penalty is paid once per batch instead of per candidate, so real
183
+ batches (5×50k with a 64k tail) reach the auto band instead of all dropping.
184
+ - Original-event line mapping (R9a): terminal normalization returns folded lines that each
185
+ carry their 1-based original-event line number; `retrieve` reads raw events, so printed
186
+ ranges resolve to the right lines.
187
+ - Document skeleton and universal prose keep (R8/R8b): structured documents keep headings,
188
+ section first/last lines, list starts and table headers; every other non-code text keeps
189
+ head AND tail with an R9 line-range marker (prose was previously head-only truncated).
190
+ - Two-tier search folding (R10, fixes D8): a lossless per-file L1 locator plus a
191
+ water-filled L2 content quota.
192
+ - Non-adjacent frequency folding (R11): separated exact repeats (up to 8.37% of large
193
+ results) fold to first occurrence plus one counted marker.
194
+ - Long-string placeholders (R12): base64/hex/UUID blobs become length summaries with a
195
+ 16-char recognition prefix.
196
+ - Two-stage HTML reduction (R13, fixes D9): `html-slim` then `html-skeleton`, line-aligned
197
+ so original line numbers survive.
198
+ - R9b anchors: contiguous masks cite original line ranges, scatter masks report
199
+ `lines 1-N scanned, K kept`, and every retrieve hint carries a pasteable
200
+ `{"ref":…,"start_line":N,"max_lines":80}`.
201
+ - Document census: omitted-document summaries list section headings instead of a constant
202
+ `0 error, 0 warn, N info` histogram.
203
+
204
+ ## 0.3.1 - 2026-09-18
205
+
206
+ ### Changed
207
+
208
+ - The runtime package is merged into the selector package: one install brings the whole
209
+ stack, the repository root is the install surface (`name`, `main`, `types`, `exports` with
210
+ `./pruner` and `./invariant`, `dependencies`, `dsh`), and the toolchain, scripts and CI were
211
+ swept to the single package. The verified estimator-catalog registration (dual prefix, guarded
212
+ two-channel activation, per-request service resolution, visible lifecycle lines) was replayed
213
+ onto this line with a host-side guard; the settings schema that `ab2175a` had downgraded to
214
+ `z.any()` is restored, so the daily Custom defaults are published again.
215
+ - 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.
216
+ - 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.
217
+ - 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`.
218
+ - 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.
219
+ - 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.
220
+
221
+ ### Fixed
222
+
223
+ - 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.
224
+ - `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.
225
+ - 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).
226
+
227
+
228
+ ### Added
229
+
230
+ - 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).
231
+ - 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).
232
+ - No-net-savings guard: replacements whose text is not smaller than the original are rejected even when the exact tokenizer reports a token saving.
233
+ - Recovery exemption: recovery-tool output is permanently exempt from every reduction pass via a unified per-session exemption set, preventing compress-restore oscillation.
234
+ - 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.
235
+ - 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.
236
+ - 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.
237
+ - New audit records: `summary-locator` and `estimator-outcome`; the rewrite record covers dedup via the `dedupe-pointer` reducer. Audit field allowlists are unchanged.
238
+ - Simplified Chinese and English copy for the new profile and estimator card; unit and golden coverage under `packages/runtime/tests/tokenpilot/`.
239
+
240
+ - 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.
241
+ - Settings-UI toggle for the gate in the selector settings section, with Simplified Chinese and English copy.
242
+ - Browser/runtime decode parity for the new section, confirm-on-write contract tests for `saveCodeSkeleton`, and a full-document parity matrix extension.
243
+
244
+ ### Changed
245
+
246
+ - 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.
247
+ - This repository is now maintained as an improved fork of `WilliamShi666/dsh-context-compression-selector`; documentation ships in English, Simplified Chinese, Japanese, and Korean.
248
+
249
+ ## 0.1.0 - 2026-09-03
250
+
251
+ ### Added
252
+
253
+ - Stable release of DeepSeek V4 Flash Vision tokenizer integration for `deepseek-v4-flash-vision-exp`, including exact text counting and bounded image-token estimates.
254
+ - User-configurable model-driven Auto Compact threshold in the selector settings section.
255
+ - Auto Compact threshold linkage for each standard profile's History / micro-compact watermarks and related compression parameters.
256
+
257
+ ### Changed
258
+
259
+ - The threshold editor now uses one direct numeric input; the slider and fixed quick-value buttons were removed.
260
+ - Runtime session-event access supports both the established Harness `events` accessor and the newer `snapshotEvents()` public API.
261
+
262
+ ## 0.1.0-beta.4 - 2026-09-02
263
+
264
+ ### Fixed
265
+
266
+ - 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.
267
+
268
+ ## 0.1.0-beta.3 - 2026-09-01
269
+
270
+ ### Scope
271
+
272
+ 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`.
273
+
274
+ ### Added
275
+
276
+ - 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.
277
+ - 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.
278
+ - `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.
279
+ - 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.
280
+ - 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.
281
+ - `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.
282
+ - 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.
283
+ - 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`.
284
+
285
+ ### Known limitations
286
+
287
+ - 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.
288
+ - 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.
289
+ - Custom remains manual token mode; its History parameters do not follow the Auto Compact watermark.
290
+ - 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.
291
+
292
+ ### Deferred
293
+
294
+ - Audit `modality` field and the tokenizer artifact SHA-256 inside audit records (the audits already carry the routed provider/model and tokenizer identity).
295
+ - Publishing the (now complete) runtime skip-reason taxonomy as a user-facing documentation table.
296
+ - Custom-profile display of the A/D watermarks and an above-D warning; Custom remains fully manual.
297
+ - Vision token breakdown UI and promotion of image estimates to exact measurement.
298
+
299
+ ## 0.1.0-beta.2 - 2026-08-28
300
+
301
+ ### Fixed
302
+
303
+ - Resolve the official DeepSeek V4 Flash tokenizer route so Fresh and Aggregate can evaluate tool results for the supported V4 models.
304
+ - 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.
305
+ - Disable Harness-native head/middle/tail tool-result pruning whenever a selector profile is active, leaving the selector as the sole tool-result compactor.
306
+
307
+ ### Changed
308
+
309
+ - Protect the newest 10 agent tool calls and a 64,000-token tool-result tail window before History/microcompact rewrites older results.
310
+
311
+ ## 0.1.0-beta.1 - 2026-08-27
312
+
313
+ ### Added
314
+
315
+ - One-install DeepSeek Harness Product Bundle backed by a separate exact-version runtime package.
316
+ - Web profile selector with preset-stable settings and an explicit built-in Minimal exception.
317
+ - Fresh, Aggregate, routine/capacity-aware History, Native tool-result pruning, and default-off Custom TailTrim.
318
+ - Standard-event TailTrim protocol using `compaction/prune` plus recoverable `user/message` replacement.
319
+ - Plugin-owned `context_compression_retrieve` recovery tool.
320
+ - Structured, content-free policy, evaluation, rewrite, failure, and Native auto-compact audit records.
321
+ - Pinned official DeepSeek V4 tokenizer assets with runtime SHA-256 validation and upstream license.
322
+ - Public-API component E2E, preset/Minimal, and parent/fork/spawn cache-prefix regression tests.
323
+
324
+ ### Compatibility
325
+
326
+ - Verified against DeepSeek Harness `dsh-v0.1.1-rc.2` public packages.
327
+ - Exact tokenizer mapping is currently limited to `deepseek-v4-flash` and `deepseek-v4-pro`.
328
+
329
+ ### Known limitations
330
+
331
+ - Adaptive ordinary History fails closed when public request-level route/cache evidence is incomplete; capacity pressure remains a separate safety override.
332
+ - Cache-prefix tests prove native fork inheritance and identical serialized prefixes, not a provider-specific cache allocation or a guaranteed DeepSeek cache hit.
333
+ - Settings snapshots and first-exposure decisions are process-local to the mounted runtime.