dsh-context-compression-improved 0.15.1 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRIBUTING.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  Thank you for helping improve this community plugin.
4
4
 
5
+ ## Three-Stage Refactor Pipeline (since v0.13.1)
6
+
7
+ All profile-default-value changes MUST follow this pipeline:
8
+
9
+ 1. **Lock baseline** — Before touching implementation, add/update `tests/runtime/behavior-lock-*.spec.ts` asserting the CURRENT behavior verbatim. The test must pass against existing code.
10
+ 2. **Add configuration** — Introduce the new setting (e.g., `minNetGain`, `cardMerge`, `flash-tuned` profile). Default must produce identical behavior to the locked baseline (backward-compatible).
11
+ 3. **Matrix verification** — After merging the behavior change, update the behavior-lock to the new expected values and verify all profile × parameter combinations via the test matrix.
12
+
13
+ CI gate: PRs modifying `profiles.ts` defaults or `COMPRESSION_PROFILES` enumeration without a corresponding `behavior-lock` diff will fail the release check.
14
+
15
+ ---
5
16
  1. Open an issue before large behavior or compatibility changes.
6
17
  2. Keep every production change inside this repository; do not require a DeepSeek Harness core patch.
7
18
  3. Add a failing regression first for compression, surface/recovery, preset, tokenizer, or cache-prefix behavior.
@@ -0,0 +1,17 @@
1
+ import { readFileSync, writeFileSync } from 'node:fs'
2
+ const dir = 'packages/selector/src/client/locales/'
3
+ const files = ['de.ts', 'es.ts', 'fr.ts', 'it.ts', 'ja.ts', 'ko.ts', 'ru.ts', 'pt.ts']
4
+ for (const f of files) {
5
+ const p = dir + f
6
+ let c = readFileSync(p, 'utf8')
7
+ if (c.includes('flash-tuned')) { console.log(f, 'already patched'); continue }
8
+ // Find the last line before the closing brace of the export object
9
+ const marker = 'savings.cumulative'
10
+ const idx = c.indexOf(marker)
11
+ if (idx < 0) { console.log(f, 'marker NOT FOUND'); continue }
12
+ const lineEnd = c.indexOf('\n', idx) + 1
13
+ const addition = " 'profile.flash-tuned': 'Flash-tuned',\n 'detail.flash-tuned': 'Flash optimized',\n"
14
+ c = c.slice(0, lineEnd) + addition + c.slice(lineEnd)
15
+ writeFileSync(p, c)
16
+ console.log(f, 'patched')
17
+ }
@@ -0,0 +1,11 @@
1
+ import { readFileSync, writeFileSync } from 'node:fs'
2
+ const dir = 'packages/selector/src/client/locales/'
3
+ const files = ['de.ts','es.ts','fr.ts','it.ts','ja.ts','ko.ts','ru.ts','pt.ts']
4
+ for (const f of files) {
5
+ const p = dir + f
6
+ let c = readFileSync(p, 'utf8')
7
+ if (c.includes('flash-tuned')) { console.log(f, 'skip'); continue }
8
+ c = c.replace(/("savings\.cumulative.*?\n)/, `$1 'profile.flash-tuned': 'Flash-tuned mode',\n 'detail.flash-tuned': 'Aggressive profile for Flash',\n`)
9
+ writeFileSync(p, c)
10
+ console.log(f, 'patched')
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context-compression-improved",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "tag": "latest"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-context-compression-improved",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Token-saving, auditable tool-result context-compression selector with code-skeleton gate for DeepSeek Harness — fewer tokens on every turn",
6
6
  "engines": {
@@ -58,6 +58,8 @@ declare const zh: {
58
58
  'detail.custom': string;
59
59
  'detail.native': string;
60
60
  'detail.off': string;
61
+ 'profile.flash-tuned': string;
62
+ 'detail.flash-tuned': string;
61
63
  'autoCompact.title': string;
62
64
  'autoCompact.description': string;
63
65
  'autoCompact.inputLabel': string;