dsh-context-compression-improved 0.2.4 → 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 (127) hide show
  1. package/.gitattributes +2 -1
  2. package/.githooks/pre-push +37 -0
  3. package/.github/workflows/ci.yml +8 -8
  4. package/CHANGELOG.ja.md +169 -39
  5. package/CHANGELOG.ko.md +167 -39
  6. package/CHANGELOG.md +212 -16
  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 +1 -19
  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 +75 -54
  22. package/packages/selector/README.md +7 -12
  23. package/packages/selector/README.zh.md +6 -13
  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 +16 -16
  27. package/packages/selector/lib/client.d.ts +97 -5
  28. package/packages/selector/lib/client.js +1884 -92
  29. package/packages/selector/lib/config.js +863 -6
  30. package/packages/selector/lib/index.d.ts +29 -21
  31. package/packages/selector/lib/index.js +424 -18
  32. package/packages/selector/lib/invariant.js +4 -4
  33. package/packages/selector/lib/pruner.d.ts +179 -4
  34. package/packages/selector/lib/pruner.js +1406 -371
  35. package/packages/selector/lib/style.css +42 -0
  36. package/packages/selector/lib/tail-trim.js +13 -4
  37. package/packages/selector/package.json +18 -27
  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 +200 -62
  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/profiles.ts +431 -342
  61. package/packages/selector/src/pruner/state.ts +57 -43
  62. package/packages/selector/src/pruner.ts +2736 -2154
  63. package/packages/selector/src/runtime/audit.ts +303 -231
  64. package/packages/selector/src/runtime/config.ts +756 -642
  65. package/packages/selector/src/runtime/measurement.ts +436 -432
  66. package/packages/selector/src/runtime/monitor.ts +235 -0
  67. package/packages/selector/src/runtime/retrieve.ts +479 -457
  68. package/packages/selector/src/runtime/savings.ts +337 -0
  69. package/packages/selector/src/runtime/session-events.ts +30 -17
  70. package/packages/selector/src/runtime/summary-command.ts +127 -0
  71. package/packages/selector/src/runtime/tail-trim.ts +166 -166
  72. package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +233 -0
  73. package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +204 -0
  74. package/packages/selector/src/runtime/tokenpilot/advisor.ts +419 -0
  75. package/packages/selector/src/runtime/tokenpilot/benefit.ts +200 -0
  76. package/packages/selector/src/runtime/tokenpilot/estimator.ts +151 -183
  77. package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +53 -0
  78. package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +65 -0
  79. package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +125 -0
  80. package/packages/selector/src/runtime/tokenpilot/intent-range.ts +37 -0
  81. package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +303 -275
  82. package/packages/selector/src/runtime/types.ts +365 -325
  83. package/packages/selector/tests/advisor-report.host.spec.ts +223 -0
  84. package/packages/selector/tests/auto-compact.client.spec.tsx +214 -226
  85. package/packages/selector/tests/built/client-artifact.spec.ts +59 -51
  86. package/packages/selector/tests/code-skeleton.client.spec.ts +91 -88
  87. package/packages/selector/tests/custom-contract.client.spec.ts +205 -202
  88. package/packages/selector/tests/estimator-channel.client.spec.tsx +253 -247
  89. package/packages/selector/tests/estimator-route-registration.host.spec.ts +194 -176
  90. package/packages/selector/tests/host-preset-overlay.host.spec.ts +206 -204
  91. package/packages/selector/tests/monitor-fab.client.spec.ts +138 -0
  92. package/packages/selector/tests/preset-options-write.client.spec.ts +207 -181
  93. package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +201 -196
  94. package/packages/selector/tests/preset-overlay.host.spec.ts +8 -18
  95. package/packages/selector/tests/profiles.client.spec.tsx +436 -434
  96. package/packages/selector/tests/public/package-contract.client.spec.ts +78 -33
  97. package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +232 -0
  98. package/packages/selector/tests/runtime/advisor-invariant.spec.ts +272 -0
  99. package/packages/selector/tests/runtime/advisor.spec.ts +226 -0
  100. package/packages/selector/tests/runtime/audit.spec.ts +275 -172
  101. package/packages/selector/tests/runtime/deprecated-preset-options.spec.ts +96 -0
  102. package/packages/selector/tests/runtime/intent-gate.spec.ts +62 -0
  103. package/packages/selector/tests/runtime/intent-summary.spec.ts +156 -0
  104. package/packages/selector/tests/runtime/monitor.spec.ts +301 -0
  105. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +2724 -2702
  106. package/packages/selector/tests/runtime/savings.spec.ts +120 -0
  107. package/packages/selector/tests/runtime/session-events.spec.ts +27 -27
  108. package/packages/selector/tests/runtime/summary-command.spec.ts +154 -0
  109. package/packages/selector/tests/runtime/tokenpilot/benefit.spec.ts +217 -0
  110. package/packages/selector/tests/runtime/tokenpilot/estimator.spec.ts +79 -56
  111. package/packages/selector/tests/runtime/tokenpilot/profile-baseline.spec.ts +116 -100
  112. package/packages/selector/tests/settings-seat.client.spec.ts +130 -0
  113. package/packages/selector/tests/standing-generation.host.spec.ts +142 -87
  114. package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +253 -250
  115. package/pnpm-workspace.yaml +66 -19
  116. package/scripts/capture-profile-baseline.mjs +42 -0
  117. package/scripts/generate-tokenizer-fixtures.py +81 -81
  118. package/scripts/generate-vision-fixtures.py +208 -208
  119. package/scripts/{packed-components-smoke.ts → packed-components-smoke.mjs} +732 -713
  120. package/scripts/{packed-install-e2e.ts → packed-install-e2e.mjs} +1273 -1072
  121. package/scripts/toolclass-corpus-replay.mjs +281 -273
  122. package/scripts/{verify-release.ts → verify-release.mjs} +318 -300
  123. package/tests/TEST_INVENTORY.md +41 -42
  124. package/scripts/capture-profile-baseline.ts +0 -80
  125. package/tsconfig.scripts.json +0 -13
  126. /package/{packages/selector/assets/screenshots → docs/assets}/context-compression-selector-profiles.jpg +0 -0
  127. /package/{packages/selector/assets/screenshots → docs/assets}/context-compression-selector-settings.png +0 -0
package/CHANGELOG.md CHANGED
@@ -2,26 +2,228 @@
2
2
 
3
3
  All notable changes use this file. The project follows semantic versioning after `0.1.0`.
4
4
 
5
- ## 0.1.1
5
+ ## 0.2.5 - 2026-10-03
6
6
 
7
7
  ### Added
8
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.
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
10
89
 
11
90
  ### Changed
12
91
 
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.
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
16
165
 
17
166
  ### Fixed
18
167
 
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).
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.
21
178
 
22
- ## 0.2.4 — 2026-10-01
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).
23
226
 
24
- > memorax-absorb backport line: R8-R13 runtime reductions, S1 sidechannel relevance, GF-1 read gutter, TokenPilot-inspired profile, byte-identical dedup, recovery exemption, auto-compact summary locator, residual-utility estimator, code-skeleton gate. Merge-back of `feat/backport-015-functional` into the 0.1.2 host line, plus win32 test-portability fixes.
25
227
 
26
228
  ### Added
27
229
 
@@ -33,7 +235,7 @@ All notable changes use this file. The project follows semantic versioning after
33
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.
34
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.
35
237
  - New audit records: `summary-locator` and `estimator-outcome`; the rewrite record covers dedup via the `dedupe-pointer` reducer. Audit field allowlists are unchanged.
36
- - Simplified Chinese and English copy for the new profile and estimator card; unit and golden coverage under `packages/selector/tests/runtime/tokenpilot/`.
238
+ - Simplified Chinese and English copy for the new profile and estimator card; unit and golden coverage under `packages/runtime/tests/tokenpilot/`.
37
239
 
38
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.
39
241
  - Settings-UI toggle for the gate in the selector settings section, with Simplified Chinese and English copy.
@@ -44,12 +246,6 @@ All notable changes use this file. The project follows semantic versioning after
44
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.
45
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.
46
248
 
47
- ### Fixed
48
-
49
- - 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.
50
- - `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.
51
- - 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).
52
-
53
249
  ## 0.1.0 - 2026-09-03
54
250
 
55
251
  ### Added
package/CHANGELOG.zh.md CHANGED
@@ -1,39 +1,152 @@
1
- # 更新日志(fork 新增条目)
2
-
3
- > 完整历史(含上游 0.1.0 及更早版本)见 [CHANGELOG.md](CHANGELOG.md)。本文件只翻译本 fork 的新增条目。 · [English](CHANGELOG.md) · [日本語](CHANGELOG.ja.md) · [한국어](CHANGELOG.ko.md)
4
-
5
- ## 0.1.1
6
-
7
- ### 新增
8
-
9
- - `scripts/` 的 TypeScript 工具链:`verify-release`、`packed-components-smoke` 和 `packed-install-e2e` 现为 `.ts` 源文件,通过 `tsc` 编译至 `scripts-dist/`,消除仓库中最后三个非 TS 源文件。
10
-
11
- ### 变更
12
-
13
- - `package.json` 脚本 `test:e2e:packed` 和 `verify:release` 现运行 `scripts-dist/` 中的编译产物。
14
- - 估计器目录路由注册加固:`asWebServer` 直接返回 service 本身(D7 修复),估计器 UI 在未激活时保留区块标题而非隐藏(U1 修复)。
15
- - 框架文档更正:行级 `inject: [webServer]` 非承载性(Y22);DSH 中无 `isolate()` 实例。
16
-
17
- ### 修复
18
-
19
- - 估计器目录路由自始至终从未注册,因 `asWebServer` 使 `register` 脱离 service(D7)。
20
- - 非 TokenPilot Profile 下估计器区块静默消失,无任何启用提示(U1)。
21
-
22
- ## Unreleased(未发布)
23
-
24
- ### 新增
25
-
26
- - 正交的代码骨架压缩门(`codeSkeleton.enabled`,默认关闭):超大源码类工具结果首次曝光时,可保留导入与声明的骨架——省略函数体并保留错误行——失败时回退到原头部裁剪。这道门独立于所有 Profile,且以精确 tokenizer 测量为前提。
27
- - 选择器设置区内新增该门的开关,附简体中文与英文文案。
28
- - 新增段的浏览器/运行时解码对齐测试、`saveCodeSkeleton` 的 confirm-on-write 契约测试,以及全文档 parity 矩阵扩展。
29
-
30
- ### 变更
31
-
32
- - 新增 ESLint 平铺配置基线(`pnpm lint`,CI 同步强制)与 `pnpm test:watch` TDD 环路;清理死导入,并修复 lint 基线暴露的两处错误处理路径。
33
- - 本仓库现为 `WilliamShi666/dsh-context-compression-selector` 的改进版 fork;文档提供英、简中、日、韩四种语言。
34
-
35
- ### 修复
36
-
37
- - 估计器卡片在 Harness 宿主通道上不再要求 API Key。选择宿主通道后只显示实时供应商/模型下拉框,并标出当前真正生效的路由(显式覆盖优先,否则跟随会话默认模型);既不显示密钥输入框,也不再有第二个手填模型输入——端点地址、模型文本框与只写密钥均只属于直连端点通道。
38
- - `presetOptions` 写入改为保留同级字段。`settingsScope.set('presetOptions', patch)` 会替换整个分节,导致再改动估计器的任何一个字段(供应商、模型、端点)都会删掉 `estimatorMode` 及其余全部覆盖值——估计器被静默关回关闭状态,而面板却报告保存成功。现在补丁会合并到已存分节之上,`undefined` 只清除指名的那一个字段,空改动不写盘,且 confirm-on-write 校验同一组字段而非仅校验通道。
39
- - 新增回归覆盖:`packages/selector/tests/preset-options-write.client.spec.ts`(合并写入、保留同级字段、显式清除、空改动不写、未提交写入的报错)与 `packages/selector/tests/estimator-channel.client.spec.tsx`(各通道字段、目录下拉框、手填回退)。
1
+ # 更新日志(fork 新增条目)
2
+
3
+ > 完整历史(含上游 0.1.0 及更早版本)见 [CHANGELOG.md](CHANGELOG.md)。本文件只翻译本 fork 的新增条目。 · [English](CHANGELOG.md) · [日本語](CHANGELOG.ja.md) · [한국어](CHANGELOG.ko.md)
4
+
5
+ ## 0.5.4 - 2026-09-20
6
+
7
+ ### Fixed
8
+
9
+ - 安装面现在把 `@deepseek-ai/schemastery` 声明为**运行时依赖**。打包后的运行时无条件导入它
10
+ (`packages/selector/lib/index.js`、`lib/pruner.js`、`lib/advisor-state.js` 中的
11
+ `import z from '@deepseek-ai/schemastery'`),但 0.5.3 在任何"消费者安装会读取"的位置都没有声明:
12
+ 发布用的根清单只列了 `@huggingface/tokenizers` 与 `js-yaml`,而 `packages/selector/package.json`
13
+ 把它列为 peer——对于它自己安装的嵌套包,包管理器根本不会去读该声明。于是能否解析取决于别的已装包是否
14
+ 恰好把 `@deepseek-ai/schemastery` 提升进 profile。干净安装时该导入会落到 Harness 安装自身的共享模块
15
+ 回退目录 `$DSH_HOME/profiles/node_modules`;当该回退处没有已构建的包时,每个插件入口都加载失败,
16
+ 宿主启动后就没有 Bundle 层。现在两份清单都钉死 `3.18.2`(本次发布构建与实测所用版本),selector 也
17
+ 不再声称一个它并不承担的 peer 义务。
18
+
19
+ ### Added
20
+
21
+ - `verify:release` 改为**从打包运行时文件实际导入的裸标识符推导**安装面依赖,不再手工点名
22
+ `@huggingface/tokenizers` 与 `js-yaml`。哪些随插件发布、哪些由 Harness 安装提供,这份分界是一份
23
+ **经评审的清单**;一旦某个导入的提供方不在两份清单中,门禁就会带着缺失的包名失败。该门禁先以"未修复
24
+ 的清单"做了**阴性对照**,当时正是在 `@deepseek-ai/schemastery` 上失败。
25
+
26
+ ## 0.5.3 - 2026-09-20
27
+
28
+ ### Fixed
29
+
30
+ - Bundle patch 不再设置已退役的 review 路由开关。`reviewQueueRoute` 在 review gate 退役时已从插件的
31
+ Config schema 删除,却仍留在 `packages/selector/cordis.patch.yml` 中,等于宣告了一条永远注册不了的
32
+ 路由。宿主对未知配置键宽容(插件加载与服务均正常,已在真机验证),故属**陈旧配置**而非故障;但任何
33
+ 严格校验插件配置的宿主都会失败。
34
+ - 生成产物钉死为 LF(`packages/selector/lib/** text eol=lf`)。此前在 `core.autocrlf=true` 下,每次
35
+ 检出都会把已提交的 `lib/**` 改写成 CRLF,于是任何分支切换或合并都会让整个产物目录以"仅行尾差异"
36
+ 显示为已修改。该状态从未被提交过,但它让每棵树看起来都是脏的,并且会掩盖真实的产物变更。
37
+
38
+ ### Added
39
+
40
+ - Bundle patch 的**阴性对照**契约钉桩:patch 中一旦设置退役配置键即失败(按"键赋值行"判定,注释里
41
+ 仍可点名该键),并要求在线的 `estimatorCatalogRoute` 开关保持接线。
42
+
43
+ ### Tests
44
+
45
+ - 客户端座位契约补充了老宿主降级钉桩:未声明该 seat 的宿主会在槽边界拒绝注册,`apply()` 必须吞掉该
46
+ 拒绝并告警,而不是把全部设置入口一起弄丢。
47
+
48
+ ## 0.5.2 - 2026-09-20
49
+
50
+ ### Changed
51
+
52
+ - **退役**人工审查管线(review gate,beta)。其语义由"建议"取代:收益模型仍按"整批一次
53
+ mutation"定价,但它算出的分带(`profitable` / `high-impact` / `slow-payback` /
54
+ `unpriceable` / `not-worth-it`)现在只作为 `reduction-advice` 审计记录发布,并在 advisor
55
+ 报告路由上留一份快照——绝不扣留、延迟或改写任何 reduction。该 gate 与本功能自身的要求
56
+ (缩减不阻断自动处理)相矛盾,且在出厂默认下(`reviewMode` 开 + 4000 token 高影响阈值
57
+ 对 8192 token 的 fresh 门槛)会把整批 fresh 100% 改道进人审,等于让选择开启它的用户失去
58
+ 自动路径。建议阈值改为模块常量(α `0.1`、高影响 `4000` token):没有任何路径依据它们
59
+ 行动,因此不再作为配置项。
60
+ - 随 gate 一并移除:审查队列及其 `storageDomain` 适配器、进程级注册表、
61
+ `review-queue` / `review-decide` 两条 HTTP 路由与 `reviewQueueRoute` 部署开关、
62
+ `shell.overlay` 客户端浮窗、`reviewMode` / `reviewTimeoutTurns` /
63
+ `cacheHitDiscountAlpha` / `reviewHighImpactTokens` 四个 settings 键,以及
64
+ `review-outcome` 审计类型。这四个键在**两个解码器**中仍被接受但被忽略——既有配置文档
65
+ (线上即带 `reviewMode: false`)照常加载、设置卡照常渲染——且永不进入已解析的 policy。
66
+ 只读路由 `GET .../advisor-report` 额外提供 `lastAdvice`。
67
+
68
+ ### Added
69
+
70
+ - 退役的回归钉桩:一条宿主集成测试用**当年会全量改道的那套配置**(`reviewMode: true`、
71
+ `reviewHighImpactTokens: 1`)断言 fresh 批次**照常落地**并附带 `high-impact` 建议记录;
72
+ 另一条弃用契约测试在运行时解析器与浏览器解码器两侧钉死"接受但忽略"。
73
+
74
+ ### Rollback
75
+
76
+ - 回退到仍带 gate 的最后一个版本:`npm dist-tag add
77
+ dsh-context-compression-improved@0.5.1 dsh-0.1.5 --registry https://registry.npmjs.org/`,
78
+ 然后 `dsh plugin --profile web add dsh-context-compression-improved@0.5.1`。
79
+
80
+ ## 0.5.1 - 2026-09-20
81
+
82
+ ### Fixed
83
+
84
+ - 同一 identity 的并发 preset-overlay 组装在 Windows 上不再失败:发布改为按目标路径串行,
85
+ 且当原子 rename 仍然竞争失败时,会先确认目标文件已带有本 staging 文件的
86
+ `{mtimeMs, size}` standing key 才判定发布成功。Windows 的 `MoveFileEx` 会把这种竞争
87
+ 失败报成 `EPERM`/`EBUSY`,而 POSIX `rename` 只是覆盖目标——这曾导致并发启动会话时
88
+ `standingKeyFor()` 抛错。目标不匹配时仍会明确失败,静默复用世代依旧被禁止。
89
+ - 一并修复了长期掩盖该问题及其它预存红灯的发布门禁与测试:packed smoke 中陈旧的标识符与
90
+ 已退役的审计 reason、过期的客户端 inject 断言,以及仅 Windows 触发的 spawn 陷阱
91
+ (`git` 与多行 `node -e` 脚本经 `cmd.exe` 转发会被改写参数)。
92
+
93
+ ## 0.5.0 - 2026-09-20
94
+
95
+ ### Added
96
+
97
+ - 建议型相关度 advisor(仅统计与建议,默认关闭):每个 turn 边界以 fire-and-forget 方式
98
+ 运行一次 pass——从最近的 `todo/write` 事件总结尾部任务语义(无 todolist 时回退到最近
99
+ 用户文本)、对历史 tool-result 候选做"内容+注释语义 ↔ 当前任务"的增量相关度打分、并
100
+ 计算前缀腐化度(prefix-decay,按 characterPressure 加权的相关度均值取反)。低相关的
101
+ 旧段标记为 `recertified`,仅作为后续 history 激进化的建议输入——本轮没有任何决策路径
102
+ 消费它,且 advisor 输出绝不抑制、延迟或改写任何本应落地的 reduction(有专项不变量测试
103
+ 钉死)。经 `presetOptions.advisor*` settings 键配置(`advisorMode` `''|'host'|'direct'`,
104
+ 默认 `''`;direct 通道复用 estimator 端点;`SideChannel` 新增可选 overrides 参数,
105
+ 共享传输层而不共享配置)。可观测性:新增 `advisor-outcome` 审计记录(content-free,
106
+ 每阶段一条:summary / scoring / decay)与只读 HTTP 路由
107
+ `GET .../advisor-report?sessionId=`(部署级 opt-in 开关 `advisorReportRoute`,与 review
108
+ 路由同骨架)。本轮刻意不提供客户端 UI。
109
+
110
+ ## 0.4.0 - 2026-09-20
111
+
112
+ ### Fixed
113
+
114
+ - 插件不再依赖路由 model id:全部规划闸门改按字符基准决策(Unicode code points,
115
+ 经 `characterPressure` / `pressureCost`),不再以 exact tokenizer 计数为前提,
116
+ 因此未内建 tokenizer 的路由(线上 `deepseek-flash`)重新能落地改写而不是静默跳过。
117
+ token 阈值键名与数值全部保留(按既有 4.0 字符/token 约定换算,冻结 profile 基线零改动);
118
+ token 数值降级为遥测,由 rewrite 审计记录新增的 `measurementBasis` 字段如实区分
119
+ (`exact-tokenizer` 与 `characters`,派生时写 `tokenizerId: 'characters'` /
120
+ `tokenizerRevision: 'chars-per-token-4.0'`)。回滚:确认无后续改动依赖本提交后再执行
121
+ `git revert 7a1972a` 整体恢复旧闸门。
122
+
123
+ ### Changed
124
+
125
+ - runtime 包并入 selector 包:一次安装即可获得完整栈,仓库根目录即为安装面
126
+ (`name`、`main`、`types`、`exports`(含 `./pruner`、`./invariant`)、`dependencies`、`dsh`),
127
+ 工具链、脚本与 CI 一并收敛为单包。已真机验证的 estimator-catalog 路由注册(双前缀、受保护的
128
+ 双通道激活、按请求解析服务、可检索的生命周期日志)重放到本线,并新增宿主侧守门;`ab2175a`
129
+ 降级为 `z.any()` 的 settings schema 已还原,每日 Custom 默认值重新下发。
130
+ - 在本分支适配官方 DeepSeek Harness `v0.1.5-rc.2`。全部 `@deepseek-ai/dsh-*` 开发依赖与 e2e 官方宿主清单从 `0.1.1-rc.2` 升至 `0.1.5-rc.2`(cordis `4.0.2`、schemastery `3.18.2`),含新的拆分包(`dsh-session-projection`、`dsh-session-persistence`、`dsh-atomic-write`、`dsh-home-paths`、`dsh-sandbox` 等)与 `dsh-client-store` 客户端栈。
131
+ - Surface 替换操作改用 v3 的 `startSeq`/`endSeq` 形状与品牌化 `SessionSeq`;`compaction/prune` 清单保留持久化的 `start`/`end` 字段。surface node 事件改为按 seq 查找而非数组下标。
132
+ - 客户端 bundle 不再引用已移除的 `@deepseek-ai/dsh-client-runtime`:settings 类型改自 `@deepseek-ai/dsh-client-ui-settings`,会话 hooks 合并自 `@deepseek-ai/dsh-client-ui-session`。两份 package manifest 与 `dsh.plugin.json` 声明 `engines.dsh >=0.1.5-alpha.1 <0.2.0-0`。
133
+ - Harness 0.1.5 不再向浏览器暴露会话 `agentPreset`,客户端无法再识别 Minimal 会话;选择器保持可选,旧的不可用横幅不再出现。
134
+ - 测试套件按 0.1.5 语义更新:cordis 插件启动需要 `.await()`,Token Meter 需要预先挂载 `SessionProjectionRegistry`,assistant 事件携带 `stream: []`,settings 命名空间为普通字符串。
135
+
136
+ ### 修复
137
+
138
+ - 估计器卡片在 Harness 宿主通道上不再要求 API Key。选择宿主通道后只显示实时供应商/模型下拉框,并标出当前真正生效的路由(显式覆盖优先,否则跟随会话默认模型);既不显示密钥输入框,也不再有第二个手填模型输入——端点地址、模型文本框与只写密钥均只属于直连端点通道。
139
+ - `presetOptions` 改为按路径写入。此前整段写入会替换整个分节,导致再改动估计器的任何一个字段(供应商、模型、端点)都会删掉 `estimatorMode` 及其余全部覆盖值——估计器被静默关回关闭状态,而面板却报告保存成功。现在每个字段只写自己,`undefined` 只清除指名的那一个字段,且 confirm-on-write 校验的是同一组字段而非仅校验通道。
140
+ - 新增回归覆盖:`packages/selector/tests/preset-options-write.client.spec.ts`(按路径写入、保留同级字段、显式清除、空改动不写、未提交写入的报错)与 `packages/selector/tests/estimator-channel.client.spec.tsx`(各通道字段、目录下拉框、手填回退)。
141
+
142
+
143
+ ### 新增
144
+
145
+ - 正交的代码骨架压缩门(`codeSkeleton.enabled`,默认关闭):超大源码类工具结果首次曝光时,可保留导入与声明的骨架——省略函数体并保留错误行——失败时回退到原头部裁剪。这道门独立于所有 Profile,且以精确 tokenizer 测量为前提。
146
+ - 选择器设置区内新增该门的开关,附简体中文与英文文案。
147
+ - 新增段的浏览器/运行时解码对齐测试、`saveCodeSkeleton` 的 confirm-on-write 契约测试,以及全文档 parity 矩阵扩展。
148
+
149
+ ### 变更
150
+
151
+ - 新增 ESLint 平铺配置基线(`pnpm lint`,CI 同步强制)与 `pnpm test:watch` TDD 环路;清理死导入,并修复 lint 基线暴露的两处错误处理路径。
152
+ - 本仓库现为 `WilliamShi666/dsh-context-compression-selector` 的改进版 fork;文档提供英、简中、日、韩四种语言。
package/CONTRIBUTING.md CHANGED
@@ -1,22 +1,22 @@
1
- # Contributing
2
-
3
- Thank you for helping improve this community plugin.
4
-
5
- 1. Open an issue before large behavior or compatibility changes.
6
- 2. Keep every production change inside this repository; do not require a DeepSeek Harness core patch.
7
- 3. Add a failing regression first for compression, surface/recovery, preset, tokenizer, or cache-prefix behavior.
8
- 4. Run:
9
-
10
- ```sh
11
- pnpm install --frozen-lockfile
12
- pnpm test
13
- pnpm typecheck
14
- pnpm build
15
- pnpm verify:release
16
- pnpm pack:dry-run
17
- ```
18
-
19
- 5. Never commit API keys, `.env` files, real Session logs, prompts/tool results, user paths, generated tarballs, or NPM tokens.
20
- 6. Read [`docs/repair-log.md`](docs/repair-log.md) before starting a new branch or version. It is the cross-version ledger of install/boot defects; a class recorded there must be re-checked on every new line instead of being rediscovered. Note in particular that `lib/` is committed, so a built chunk an entry imports must be committed in the same change — `pnpm verify:release` enforces it.
21
-
22
- Pull requests should explain the evidence for “triggered”, “enabled but skipped”, and fail-open behavior separately. A code path existing is not runtime proof. Changes to tokenizer/model compatibility require an official source, pinned revision, license, byte length, SHA-256, and negative tests.
1
+ # Contributing
2
+
3
+ Thank you for helping improve this community plugin.
4
+
5
+ 1. Open an issue before large behavior or compatibility changes.
6
+ 2. Keep every production change inside this repository; do not require a DeepSeek Harness core patch.
7
+ 3. Add a failing regression first for compression, surface/recovery, preset, tokenizer, or cache-prefix behavior.
8
+ 4. Run:
9
+
10
+ ```sh
11
+ pnpm install --frozen-lockfile
12
+ pnpm test
13
+ pnpm typecheck
14
+ pnpm build
15
+ pnpm verify:release
16
+ pnpm pack:dry-run
17
+ ```
18
+
19
+ 5. Never commit API keys, `.env` files, real Session logs, prompts/tool results, user paths, generated tarballs, or NPM tokens.
20
+ 6. Read [`docs/repair-log.md`](docs/repair-log.md) before starting a new branch or version. It is the cross-version ledger of install/boot defects; a class recorded there must be re-checked on every new line instead of being rediscovered. Note in particular that `lib/` is committed, so a built chunk an entry imports must be committed in the same change — `pnpm verify:release` enforces it — and that the tokenizer assets are content-addressed, so a checkout that rewrites their line endings breaks every consumer (the release gate now fails on CR bytes).
21
+
22
+ Pull requests should explain the evidence for “triggered”, “enabled but skipped”, and fail-open behavior separately. A code path existing is not runtime proof. Changes to tokenizer/model compatibility require an official source, pinned revision, license, byte length, SHA-256, and negative tests.